@visactor/lark-vchart 2.1.0-alpha.10 → 2.1.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -22,4 +22,4 @@ function r(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n
|
|
|
22
22
|
*
|
|
23
23
|
* Copyright 2011 - 2019 Tim Guan-tin Chien and contributors.
|
|
24
24
|
* Released under the MIT license
|
|
25
|
-
*/PJ.defaultOptions={gridSize:8,ellipticity:1,maxSingleWordTryCount:1};var OJ=function(t){function e(t){var r;return n(this,e),(r=i(this,e,[Q({},e.defaultOptions,t)])).random=r.options.random?Math.random:function(){return 0},r.aspectRatio=1,r}return h(e,t),a(e,[{key:"fit",value:function(t){for(var e=0,i=this.result.length;e<i;e++)if(IJ(t,this.result[e]))return!1;return!0}},{key:"getTextInfo",value:function(t,e){var i={datum:t,fontSize:this.getTextFontSize(t),fontWeight:this.getTextFontWeight(t),fontStyle:this.getTextFontStyle(t),fontFamily:this.getTextFontFamily(t),angle:this.getTextRotate(t,e),text:this.getText(t)+"",x:this.center[0],y:this.center[1]},n=this.options.getTextBounds(i);return i.width=n.width(),i.height=n.height(),i.top=this.center[1]-i.height+.21*i.height,i.left=this.center[0]-i.width/2,i}},{key:"layoutWord",value:function(t){for(var e=this.getTextInfo(this.data[t],t),i=2*Math.PI,n=0,r=e.left,a=e.top,o=e.width,s=e.height,l=1,u=this.fit(e);!u&&n<this.maxRadius;)n+=.5,l=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*l*Math.cos(i)*this.aspectRatio,a=this.center[1]-s/2+n*l*Math.sin(i),e.left=r,e.top=a,e.x=r+o/2,e.y=a+s/2,u=this.fit(e);return!!u&&!!(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)}},{key:"layout",value:function(t,e){var i=this;if(!(null==t?void 0: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((function(t,e){return i.getTextFontSize(e)-i.getTextFontSize(t)}));for(var n=0;n<t.length&&(this.layoutWord(n),n++,this.progressiveIndex=n,!this.exceedTime()););return this.result}}])}(_J);function IJ(t,e){return!(t.left+t.width<e.left||t.top+t.height<e.top||t.left>e.left+e.width||t.top>e.top+e.height)}OJ.defaultOptions={enlarge:!1};var RJ={x:"x",y:"y",z:"z",fontFamily:"fontFamily",fontSize:"fontSize",fontStyle:"fontStyle",fontWeight:"fontWeight",angle:"angle"},LJ=function(t,e){var i,n,r,a,o,s;if(t.size&&(t.size[0]<=0||t.size[1]<=0))return bt.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];var l=e,u=(null!==(i=t.size)&&void 0!==i?i:[500,500]).slice();u[0]=Math.floor(u[0]),u[1]=Math.floor(u[1]);var h=t.fontFamily?DJ(t.fontFamily):"sans-serif",c=t.fontStyle?DJ(t.fontStyle):"normal",d=t.fontWeight?DJ(t.fontWeight):"normal",v=t.rotate?DJ(t.rotate):0,f=DJ(t.text),p=null!==(n=t.spiral)&&void 0!==n?n:"archimedean",g=t.padding?DJ(t.padding):1,y=null!==(r=t.shape)&&void 0!==r?r:"square",m=null!==(a=t.shrink)&&void 0!==a&&a,_=null!==(o=t.enlarge)&&void 0!==o&&o,b=null!==(s=t.clip)&&void 0!==s&&s,k=t.minFontSize,x=t.randomVisible,S=t.as?Object.assign(Object.assign({},RJ),t.as):RJ,A=t.depth_3d,C=t.postProjection,M=t.fontSize?DJ(t.fontSize):14,T=t.fontSizeRange;if(T&&!L(M)){var w=M,E=zJ(jJ(w,l),T);M=function(t){return E(w(t))}}var B=kJ;"fast"===t.layoutType?B=OJ:"grid"===t.layoutType&&(B=PJ);var P=new B(Object.assign(Object.assign({},t),{text:f,padding:g,spiral:p,shape:y,rotate:v,fontFamily:h,fontStyle:c,fontWeight:d,fontSize:M,shrink:m,clip:b,enlarge:_,minFontSize:k,random:x,outputCallback:function(e){for(var i,n,r=[],a=0,o=e.length;a<o;a++)(i=(n=e[a]).datum)[S.x]=n.x,i[S.y]=n.y,i[S.fontFamily]=n.fontFamily,i[S.fontSize]=n.fontSize,i[S.fontStyle]=n.fontStyle,i[S.fontWeight]=n.fontWeight,i[S.angle]=n.angle,"StereographicProjection"===C&&HJ(u,n,i,S,A),t.dataIndexKey&&(i[t.dataIndexKey]="".concat(a)),r.push(i);return r}}));return P.layout(l,{width:u[0],height:u[1]}),t.progressiveStep>0||t.progressiveTime>0?{progressive:P}:P.output()},DJ=function(t){return P(t)||L(t)||A(t)||O(t)?t:function(e){return e[t.field]}},FJ=function(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)},zJ=function(t,e,i){if(t[0]===t[1])return function(t){return e[0]};var n=FJ(t[0]),r=FJ(t[1]),a=Math.min(n,r),o=Math.max(n,r);return function(t){return(FJ(t)-a)/(o-a)*(e[1]-e[0])+e[0]}},jJ=function(t,e){for(var i,n=1/0,r=-1/0,a=e.length,o=0;o<a;++o)(i=pt(t(e[o])))<n&&(n=i),i>r&&(r=i);return 1===e.length&&n===r&&(n-=1e4),[n,r]};function HJ(t,e,i,n,r){var a=Math.max(t[0],t[1])/2,o=function(t,e,i,n,r){var a=r.x,o=r.y,s=a/t*Math.PI*2,l=Math.PI-o/e*Math.PI;return l+=(l<Math.PI/2?1:-1)*Math.pow(Math.min(l-Math.PI/2,1),2)/5,{x:i*Math.sin(l)*Math.cos(s)+n.x,y:i*Math.cos(l)+n.y,z:i*Math.sin(l)*Math.sin(s)+n.z}}(t[0],t[1],a,{x:a,y:a,z:null!=r?r:a},e);i[n.x]=o.x,i[n.y]=o.y,i[n.z]=o.z}var NJ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=nz.wordCloud,t}return h(e,t),a(e)}(yZ);NJ.type=nz.wordCloud;var UJ=function(){Uz.registerGrammarTransform("wordcloud",{transform:LJ}),kX(),Uz.registerAnimation("wordCloud",(function(t,e){return{appear:mZ(t,e),enter:{type:"fadeIn"},exit:{type:"fadeOut"},disappear:{duration:sU.disappear.duration}}})),Uz.registerSeries(NJ.type,NJ)},VJ=function(t){return A(t)?t():t},WJ=function(t,e){var i,n,r,a,o=t.map((function(t){return Object.assign({},t)}));if(!o||0===o.length)return o;var s=e.asTransformRatio,l=e.asReachRatio,u=e.asHeightRatio,h=e.asValueRatio,c=e.asNextValueRatio,d=e.asLastValueRatio,v=e.asLastValue,f=e.asCurrentValue,p=e.asNextValue,g=VJ(e.valueField),y=null!==(i=VJ(e.heightVisual))&&void 0!==i&&i,m=null===(n=VJ(e.isCone))||void 0===n||n,_=VJ(e.range),b=o.reduce((function(t,e){return Math.max(t,Number.parseFloat(e[g])||-1/0)}),-1/0),k=o.reduce((function(t,e){return Math.min(t,Number.parseFloat(e[g])||1/0)}),1/0),x=[null!==(r=null==_?void 0:_.min)&&void 0!==r?r:k,null!==(a=null==_?void 0:_.max)&&void 0!==a?a:b];return o.forEach((function(t,e){var i,n,r=Number.parseFloat(t[g]),a=Number.parseFloat(null===(i=o[e-1])||void 0===i?void 0:i[g]),_=Number.parseFloat(null===(n=o[e+1])||void 0===n?void 0:n[g]),b=F(_*r)&&0!==r?_/r:0,k=F(r*a)&&0!==a?r/a:0;v&&(t[v]=a),p&&(t[p]=_),s&&(t[s]=b),l&&(t[l]=0===e?1:k),u&&(t[u]=!0===y?b:1/o.length),h&&(t[h]=r/x[1]),c&&(t[c]=e===o.length-1?m?0:t[h]:_/x[1]),d&&(t[d]=0===e?1:a/x[1]),f&&(t[f]=r)})),o},GJ=function(t,e){var i,n,r=null===(n=null===(i=t[0])||void 0===i?void 0:i.latestData)||void 0===n?void 0:n.map((function(t){return Object.assign({},t)}));return r&&0!==r.length?(r.shift(),r.forEach((function(t){t[e.asIsTransformLevel]=!0})),r):r},YJ="".concat(dj,"_FUNNEL_TRANSFORM_RATIO"),KJ="".concat(dj,"_FUNNEL_REACH_RATIO"),XJ="".concat(dj,"_FUNNEL_HEIGHT_RATIO"),qJ="".concat(dj,"_FUNNEL_VALUE_RATIO"),ZJ="".concat(dj,"_FUNNEL_LAST_VALUE_RATIO"),JJ="".concat(dj,"_FUNNEL_NEXT_VALUE_RATIO"),QJ="".concat(dj,"_FUNNEL_LAST_VALUE"),$J="".concat(dj,"_FUNNEL_CURRENT_VALUE"),tQ="".concat(dj,"_FUNNEL_NEXT_VALUE"),eQ="".concat(dj,"_FUNNEL_TRANSFORM_LEVEL"),iQ=function(t){function e(t){var r,a,o;return n(this,e),(r=i(this,e,[t])).dimensionTooltipTitleCallback=function(t,e){var i,n,a,o=r.series;return"transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name)?r._transformRatioText:null!==(n=r._getDimensionData(t))&&void 0!==n?n:null===(a=t.properties)||void 0===a?void 0:a["".concat(o.getCategoryField())]},r.markTooltipValueCallback=function(t,e){var i;return"transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name)?"".concat((100*(null==t?void 0:t[KJ])).toFixed(1),"%"):r._getMeasureData(t)},r.markTooltipKeyCallback=function(t,e){var i;if("transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name))return r._transformRatioText;var n=r._seriesCacheInfo,a=n.dimensionFields,o=n.seriesFields,s=a[a.length-1];return M(o[0])?null==t?void 0:t[o[0]]:null==t?void 0:t[s]},r._transformRatioText=null!==(o=null===(a=t.getSpec())||void 0===a?void 0:a.transformRatioText)&&void 0!==o?o:"转化率",r}return h(e,t),a(e)}(UU),nQ=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultStyle",value:function(){return Object.assign(Object.assign({},_(e,"_getDefaultStyle",this,3)([])),{points:[]})}}])}($N),rQ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=e.type,t}return h(e,t),a(e,[{key:"_getDefaultStyle",value:function(){return Object.assign(Object.assign({},_(e,"_getDefaultStyle",this,3)([])),{lineWidth:0})}}])}(nQ);rQ.type="polygon";var aQ=function(){Uz.registerMark(rQ.type,rQ),xw(),dw(),hP.registerBuiltInAnimate("growPointsOut",uO),Uz.registerGraphicComponent("polygon",Fp)},oQ=Object.assign(Object.assign({},tV),{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"}}),sQ=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"funnel"),t.isTransform&&this._addMarkLabelSpec(t,"transform","transformLabel")}}])}(gV),lQ=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=nz.funnel,t._funnelMarkName="funnel",t._funnelMarkType="polygon",t._transformMarkName="transform",t._transformMarkType="polygon",t.transformerConstructor=sQ,t._funnelMark=null,t._funnelTransformMark=null,t._labelMark=null,t._transformLabelMark=null,t._funnelOuterLabelMark={},t}return h(r,e),a(r,[{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getValueField",value:function(){return this._valueField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"setAttrFromSpec",value:function(){var t,e,i,n,a;_(r,"setAttrFromSpec",this,3)([]),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this._funnelOrient=null!==(t=this._spec.funnelOrient)&&void 0!==t?t:"top",this._shape=null!==(e=this._spec.shape)&&void 0!==e?e:"trapezoid",this._minLabelLineWidth=null!==(a=null===(n=null===(i=this._spec.outerLabel)||void 0===i?void 0:i.line)||void 0===n?void 0:n.minLength)&&void 0!==a?a:20,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._seriesField&&this._spec.categoryField&&this.setSeriesField(this._spec.categoryField)}},{key:"initData",value:function(){if(_(r,"initData",this,3)([]),this._data){fH(this._dataSet,"funnel",WJ),fH(this._dataSet,"funnelTransform",GJ);var t=new Ko(this._dataSet,{name:"".concat(dj,"_series_").concat(this.id,"_viewDataTransform")});t.parse([this.getViewData()],{type:"dataview"}),this._viewDataTransform=new WN(this._option,t)}}},{key:"compile",value:function(){var t,e;_(r,"compile",this,3)([]),this._funnelOuterLabelMark&&(null===(t=this._funnelOuterLabelMark.label)||void 0===t||t.compile({group:this._rootMark.getProduct()}),null===(e=this._funnelOuterLabelMark.line)||void 0===e||e.compile({group:this._rootMark.getProduct()}))}},{key:"compileData",value:function(){var t;_(r,"compileData",this,3)([]),null===(t=this._viewDataTransform)||void 0===t||t.compile()}},{key:"getStatisticFields",value:function(){var t=[];return t.push({key:this._categoryField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}},{key:"_statisticViewData",value:function(){var t,e=this;_(r,"_statisticViewData",this,3)([]),this._data.getDataView().transform({type:"funnel",options:{valueField:function(){return e.getValueField()},isCone:function(){return e._spec.isCone},asCurrentValue:$J,asTransformRatio:YJ,asReachRatio:KJ,asHeightRatio:XJ,asValueRatio:qJ,asNextValueRatio:JJ,asLastValueRatio:ZJ,asLastValue:QJ,asNextValue:tQ,range:function(){return e._spec.range}}}),null===(t=this._viewDataTransform.getDataView())||void 0===t||t.transform({type:"funnelTransform",options:{asIsTransformLevel:eQ}})}},{key:"initMark",value:function(){var t,e,i,n,a,o,s,l;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},r.mark.funnel),{name:this._funnelMarkName,type:this._funnelMarkType}),{themeSpec:null===(t=this._theme)||void 0===t?void 0:t.funnel,groupKey:this._seriesField,isSeriesMark:!0,noSeparateStyle:!0},{morph:dV(this._spec,this._funnelMarkName),morphElementKey:this._seriesField}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},r.mark.transform),{name:this._transformMarkName,type:this._transformMarkType}),{themeSpec:null===(e=this._theme)||void 0===e?void 0:e.transform,noSeparateStyle:!0}),this._funnelTransformMark&&this._funnelTransformMark.setData(this._viewDataTransform)),null===(n=null===(i=this._spec)||void 0===i?void 0:i.outerLabel)||void 0===n?void 0:n.visible){var u=(null!==(a=this._spec.outerLabel)&&void 0!==a?a:{}).line,h=(null!==(s=null===(o=this._theme)||void 0===o?void 0:o.outerLabel)&&void 0!==s?s:{}).line;this._funnelOuterLabelMark.label=this._createMark(r.mark.outerLabel,{themeSpec:null===(l=this._theme)||void 0===l?void 0:l.outerLabel,markSpec:this._spec.outerLabel,noSeparateStyle:!0,parent:!1}),this._funnelOuterLabelMark.line=this._createMark(r.mark.outerLabelLine,{themeSpec:h,markSpec:u,noSeparateStyle:!0,parent:!1})}}},{key:"initTooltip",value:function(){this._tooltipHelper=new iQ(this),this._funnelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._funnelMark),this._funnelTransformMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._funnelTransformMark)}},{key:"getDimensionField",value:function(){return this._seriesField?[this._seriesField]:[]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"getGroupFields",value:function(){return null}},{key:"initMarkStyle",value:function(){var e,i,n,r,a=this,o=this._funnelMark;o&&this.setMarkStyle(o,{points:function(t){return a.getPoints(t)},visible:function(t){return M(t[a._valueField])},fill:this.getColorAttribute()},"normal",t.AttributeLevel.Series);var s=this._funnelTransformMark;s&&this.setMarkStyle(s,{points:function(t){return a.getPoints(t)}},"normal",t.AttributeLevel.Series);var l=this._funnelOuterLabelMark.label;l&&(this.setMarkStyle(l,{text:function(t){return"".concat(t[a.getCategoryField()])},x:function(t){return a._computeOuterLabelPosition(t).x},y:function(t){return a._computeOuterLabelPosition(t).y},textAlign:function(t){return a._computeOuterLabelPosition(t).align},textBaseline:function(t){return a._computeOuterLabelPosition(t).textBaseline},maxLineWidth:function(t){return a._computeOuterLabelLimit(t)},width:0,height:0},"normal",t.AttributeLevel.Series),A(this._spec.outerLabel.formatMethod)&&this.setMarkStyle(l,{text:function(t){return a._spec.outerLabel.formatMethod("".concat(t[a.getCategoryField()]),t)}},"normal",t.AttributeLevel.User_Mark));var u=this._funnelOuterLabelMark.line;if(u&&l){this.setMarkStyle(u,{x:function(t){return a._computeOuterLabelLinePosition(t).x1},y:function(t){return a._computeOuterLabelLinePosition(t).y1},x1:function(t){return a._computeOuterLabelLinePosition(t).x2},y1:function(t){return a._computeOuterLabelLinePosition(t).y2}},"normal",t.AttributeLevel.Series);var h=null!==(n=null===(i=null===(e=this._spec.outerLabel)||void 0===e?void 0:e.line)||void 0===i?void 0:i.visible)&&void 0!==n?n:null===(r=this._spec.outerLabel)||void 0===r?void 0:r.visible;M(h)&&u.setVisible(h)}}},{key:"initLabelMarkStyle",value:function(e){var i,n=this;if(e){var r=e.getTarget(),a=e.getComponent();if(r===this._funnelMark){this._labelMark=e,this.setMarkStyle(e,{text:function(t){return"".concat(t[n.getCategoryField()]," ").concat(t[n.getValueField()])},x:function(t){return n._computeLabelPosition(t).x},y:function(t){return n._computeLabelPosition(t).y},maxLineWidth:function(t){return n._computeLabelLimit(t,n._spec.label)},stroke:this.getColorAttribute()},"normal",t.AttributeLevel.Series);var o=this.getCompiler().getRootMarks();this._funnelOuterLabelMark.label&&zS(o,this._funnelOuterLabelMark.label,a),this._funnelOuterLabelMark.line&&zS(o,this._funnelOuterLabelMark.line,null!==(i=this._funnelOuterLabelMark.label)&&void 0!==i?i:a)}else this._funnelTransformMark&&r===this._funnelTransformMark&&(this._transformLabelMark=e,this.setMarkStyle(e,{text:function(t){return"".concat((100*oz(KJ).bind(n)(t)).toFixed(1),"%")},x:function(t){return n._computeLabelPosition(t).x},y:function(t){return n._computeLabelPosition(t).y},maxLineWidth:function(t){return n._computeLabelLimit(t,n._spec.transformLabel)}},"normal",t.AttributeLevel.Series))}}},{key:"initAnimation",value:function(){var t,e,i,n,r,a,o,s=this,l=null!==(i=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset)&&void 0!==i?i:"clipIn";"clipIn"===l&&this._rootMark&&this._rootMark.setAnimationConfig(lV(null===(n=Uz.getAnimationInKey("cartesianGroupClip"))||void 0===n?void 0:n({direction:function(){return s._isHorizontal()?"x":"y"},width:function(){var t=s.getRootMark().getProduct();if(t){var e=t.AABBBounds,i=e.x1,n=e.x2;return Math.max(i,n)}return s.getLayoutRect().width},height:function(){var t=s.getRootMark().getProduct();if(t){var e=t.AABBBounds,i=e.y1,n=e.y2;return Math.max(i,n)}return s.getLayoutRect().height},orient:function(){return s._isReverse()?"negative":"positive"}},l),uV("group",this._spec,this._markAttributeContext))),[null===(r=this._funnelOuterLabelMark)||void 0===r?void 0:r.label].forEach((function(t){t&&t.setAnimationConfig(lV(Uz.getAnimationInKey("fadeInOut")(),uV(t.name,s._spec,s._markAttributeContext)))})),[this._funnelMark,this._funnelTransformMark].forEach((function(t){t&&t.setAnimationConfig(lV(Uz.getAnimationInKey("funnel")({},l),uV(t.name,s._spec,s._markAttributeContext)))})),(null===(a=this._funnelOuterLabelMark)||void 0===a?void 0:a.line)&&this._funnelOuterLabelMark.line.setAnimationConfig(lV(null===(o=Uz.getAnimationInKey("fadeInOut"))||void 0===o?void 0:o(),uV("outerLabelLine",this._spec,this._markAttributeContext)))}},{key:"initGroups",value:function(){}},{key:"getStackGroupFields",value:function(){return[]}},{key:"getStackValueField",value:function(){return null}},{key:"initEvent",value:function(){var t,e=this;_(r,"initEvent",this,3)([]),null===(t=this._viewDataTransform.getDataView())||void 0===t||t.target.addListener("change",(function(t){e._viewDataTransform.updateData()}))}},{key:"getPoints",value:function(t){var e,i,n=this.isTransformLevel(t),r=this._getMainAxisLength(n)/2;n?(e="rect"===this._shape?this._getSecondaryAxisLength(t[ZJ])/2:this._getSecondaryAxisLength(t[qJ])/2,i=this._getSecondaryAxisLength(t[qJ])/2):(e=this._getSecondaryAxisLength(t[qJ])/2,i="rect"===this._shape?e:this._getSecondaryAxisLength(t[JJ])/2);var a=this._getPositionByData(t),o=a.x,s=a.y,l=this._getPolygonPoints([o,s],e,i,e,i,r);return"center"!==this._funnelAlign&&this._adjustPoints(l),l}},{key:"isTransformLevel",value:function(t){return!!(null==t?void 0:t[eQ])}},{key:"_buildMarkAttributeContext",value:function(){_(r,"_buildMarkAttributeContext",this,3)([]),this._markAttributeContext.valueToPosition=this.valueToPosition.bind(this),this._markAttributeContext.getPoints=this.getPoints.bind(this),this._markAttributeContext.isTransformLevel=this.isTransformLevel.bind(this)}},{key:"valueToPosition",value:function(t){var e,i,n,r=this,a=null===(n=null===(i=null===(e=this.getViewData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i.find)||void 0===n?void 0:n.call(i,(function(e){return e[r._categoryField]===t}));return M(a)?this._getPolygonCenter(this.getPoints(a)):null}},{key:"dataToPosition",value:function(t,e){return e&&!this.isDatumInViewData(t)?null:this.valueToPosition(t[this._categoryField])}},{key:"dataToPositionX",value:function(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.x}},{key:"dataToPositionY",value:function(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.y}},{key:"dataToPositionZ",value:function(t){return 0}},{key:"_getMainAxisLength",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=this.getViewData().latestData.length,n=this._isHorizontal()?this.getLayoutRect().width:this.getLayoutRect().height,r=!!this._spec.isTransform,a=r?0:null!==(t=this._spec.gap)&&void 0!==t?t:0,o=r?Math.max(0,i-1):0,s=this._spec.heightRatio||.5,l=(n-a*Math.max(0,i-1))/(i+s*o);return e?r?l*s:0:l}},{key:"_getSecondaryAxisLength",value:function(t){var e=Number.isNaN(t)||!Number.isFinite(t)?0:t,i=this._computeMaxSize(),n=this._computeMinSize();return n+(i-n)*e}},{key:"_getPositionByData",value:function(t){var e,i=this,n=null===(e=this.getViewData().latestData)||void 0===e?void 0:e.findIndex((function(e){return e[i._categoryField]===t[i._categoryField]&&e[yj]===t[yj]}));if(!M(n)||n<0)return{};var r=this.isTransformLevel(t),a=this._isHorizontal(),o=a?this.getLayoutRect().height:this.getLayoutRect().width,s=a?this.getLayoutRect().width:this.getLayoutRect().height,l=o/2,u=0,h=this._getMainAxisLength(),c=this._getMainAxisLength(!0);return u+=n*(h+c),u+=r?-c/2:h/2,!this._spec.isTransform&&this._spec.gap&&(u+=this._spec.gap*n),this._isReverse()&&(u=s-u),this._isHorizontal()?{x:u,y:l}:{x:l,y:u}}},{key:"_getPolygonPoints",value:function(t,e,i,n,r,a){var o=t[0],s=t[1];switch(this._funnelOrient){case"left":return[{x:o-a,y:s+e},{x:o-a,y:s-n},{x:o+a,y:s-r},{x:o+a,y:s+i}];case"right":return[{x:o+a,y:s-n},{x:o+a,y:s+n},{x:o-a,y:s+i},{x:o-a,y:s-i}];case"bottom":return[{x:o+e,y:s+a},{x:o-n,y:s+a},{x:o-r,y:s-a},{x:o+i,y:s-a}];default:return[{x:o-e,y:s-a},{x:o+n,y:s-a},{x:o+r,y:s+a},{x:o-i,y:s+a}]}}},{key:"_getPolygonCenter",value:function(t){if(this._isHorizontal()){var 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}}var 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}}},{key:"_adjustPoints",value:function(t){var e,i,n;return this._isHorizontal()?(n="y","left"===this._funnelOrient?(e="bottom"===this._funnelAlign?-t[1].y:t[1].y,i="bottom"===this._funnelAlign?-t[2].y:t[2].y):(e="bottom"===this._funnelAlign?-t[0].y:t[0].y,i="bottom"===this._funnelAlign?-t[3].y:t[3].y)):(n="x","top"===this._funnelOrient?(e="left"===this._funnelAlign?t[0].x:-t[0].x,i="left"===this._funnelAlign?t[3].x:-t[3].x):(e="left"===this._funnelAlign?t[1].x:-t[1].x,i="left"===this._funnelAlign?t[2].x:-t[2].x)),t[0][n]-=e,t[1][n]-=e,t[2][n]-=i,t[3][n]-=i,t}},{key:"_computeLabelPosition",value:function(t){var e=this.getPoints(t);return this._getPolygonCenter(e)}},{key:"_computeLabelLimit",value:function(t,e){var i=null==e?void 0:e.limit;if(L(i))return i;var n=this.getPoints(t);return"shapeSize"===i?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}},{key:"_computeOuterLabelPosition",value:function(t){var e,i,n,r,a,o=null===(i=this._spec.outerLabel)||void 0===i?void 0:i.position,s="center",l="middle";if(o=this._isHorizontal()?["top","bottom"].includes(o)?o:"bottom"===this._funnelAlign?"top":"bottom":["left","right"].includes(o)?o:"left"===this._funnelAlign?"right":"left",!1!==(null===(n=this._spec.outerLabel)||void 0===n?void 0:n.alignLabel))r=(e=this._getPositionByData(t)).x,a=e.y,"left"===o?(r=0,s="left"):"right"===o?(r=this.getLayoutRect().width,s="right"):"top"===o?(a=0,l="top"):"bottom"===o&&(a=this.getLayoutRect().height,l="bottom");else{var u=this._computeOuterLabelLinePosition(t);r=u.x2,a=u.y2,"left"===o?(r-=5,s="right"):"right"===o?(r+=5,s="left"):"top"===o?(a-=5,l="bottom"):"bottom"===o&&(a+=5,l="top")}return{x:r,y:a,align:s,textBaseline:l}}},{key:"_computeOuterLabelLimit",value:function(t){var e,i,n,r,a,o;if(this._isHorizontal())return this._getMainAxisLength(this.isTransformLevel(t));var s=this.getPoints(t),l=(Math.abs(s[0].x-s[1].x)+Math.abs(s[2].x-s[3].x))/2,u=this.getCategoryField(),h=null===(r=null===(n=null===(i=null===(e=this._labelMark)||void 0===e?void 0:e.getComponent())||void 0===i?void 0:i.getComponent())||void 0===n?void 0:n.find((function(e){var i,n=e.attribute;return"text"===e.type&&(null===(i=n.data)||void 0===i?void 0:i[u])===t[u]}),!0))||void 0===r?void 0:r.AABBBounds,c=h?h.x2-h.x1:0,d=this._funnelOuterLabelMark.line?this._minLabelLineWidth:0,v=this.getLayoutRect().width-Math.max(l,c);return"center"===this._funnelAlign&&(v/=2),v-d-(null!==(o=null===(a=this._spec.outerLabel)||void 0===a?void 0:a.spaceWidth)&&void 0!==o?o:5)}},{key:"_computeOuterLabelLinePosition",value:function(t){var e,i,n,r,a,o,s,l,u,h,c,d,v,f,p=this.getCategoryField(),g=null===(r=null===(n=null===(i=null===(e=this._funnelOuterLabelMark)||void 0===e?void 0:e.label)||void 0===i?void 0:i.getGraphics())||void 0===n?void 0:n.find((function(e){var i;return(null===(i=e.context.data[0])||void 0===i?void 0:i[p])===t[p]})))||void 0===r?void 0:r.AABBBounds,y=null===(o=null===(a=this._labelMark)||void 0===a?void 0:a.getComponent())||void 0===o?void 0:o.getComponent(),m=null===(s=null==y?void 0:y.find((function(e){var i,n=e.attribute;return"text"===e.type&&(null===(i=n.data)||void 0===i?void 0:i[p])===t[p]}),!0))||void 0===s?void 0:s.AABBBounds,_=null!==(l=this._spec.outerLabel)&&void 0!==l?l:{};if(this._isHorizontal()){var b=null!==(u=_.spaceWidth)&&void 0!==u?u:5,k=this.getPoints(t),x=(Math.abs(k[0].y-k[1].y)+Math.abs(k[2].y-k[3].y))/2;return"top"===this._spec.outerLabel.position||"bottom"===this._funnelAlign?(v=this._getPolygonCenter(k).y-x/2-b,f=!1!==_.alignLabel?(null==g?void 0:g.y2)+b:v-b,c=this._getPolygonCenter(k).x,v-f<this._minLabelLineWidth&&(f=v-this._minLabelLineWidth),d=c):(v=this._getPolygonCenter(k).y+x/2+b,f=!1!==_.alignLabel?(null==g?void 0:g.y1)-b:v+b,c=this._getPolygonCenter(k).x,f-v<this._minLabelLineWidth&&(f=v+this._minLabelLineWidth),d=c),{x1:c,x2:d,y1:v,y2:f}}var S=this.getPoints(t),A=(Math.abs(S[0].x-S[1].x)+Math.abs(S[2].x-S[3].x))/2,C=(null==m?void 0:m.x2)-(null==m?void 0:m.x1)||0,M=null!==(h=_.spaceWidth)&&void 0!==h?h:5;return"right"===this._spec.outerLabel.position||"left"===this._funnelAlign?(c=this._getPolygonCenter(S).x+Math.max(C/2,A/2)+M,d=!1!==_.alignLabel?(null==g?void 0:g.x1)-M:c+M,v=this._getPolygonCenter(S).y,d-c<this._minLabelLineWidth&&(d=c+this._minLabelLineWidth),f=v):(c=this._getPolygonCenter(S).x-Math.max(C/2,A/2)-M,d=!1!==_.alignLabel?(null==g?void 0:g.x2)+M:c-M,v=this._getPolygonCenter(S).y,c-d<this._minLabelLineWidth&&(d=c-this._minLabelLineWidth),f=v),{x1:c,x2:d,y1:v,y2:f}}},{key:"_computeMaxSize",value:function(){var t,e=this._isHorizontal()?this.getLayoutRect().height:this.getLayoutRect().width;return wz(null!==(t=this._spec.maxSize)&&void 0!==t?t:"80%",e)}},{key:"_computeMinSize",value:function(){var t,e=this._isHorizontal()?this.getLayoutRect().height:this.getLayoutRect().width;return wz(null!==(t=this._spec.minSize)&&void 0!==t?t:0,e)}},{key:"_isHorizontal",value:function(){return"left"===this._funnelOrient||"right"===this._funnelOrient}},{key:"_isReverse",value:function(){return"bottom"===this._funnelOrient||"right"===this._funnelOrient}},{key:"getDefaultShapeType",value:function(){return"square"}},{key:"getActiveMarks",value:function(){return[this._funnelMark]}}])}(SV);lQ.type=nz.funnel,lQ.mark=oQ,lQ.builtInTheme={funnel:Yz},lQ.transformerConstructor=sQ;var uQ,hQ=function(){aQ(),kX(),BK(),Uz.registerSeries(lQ.type,lQ),Uz.registerAnimation("funnel",(function(t,e){return Object.assign({appear:"clipIn"===e?void 0:{type:"fadeIn"}},uU)})),Uz.registerAnimation("cartesianGroupClip",(function(t){return{appear:{custom:UP,customParameters:function(e,i){return{animationType:"in",group:i,direction:t.direction(),width:t.width(),height:t.height(),orient:t.orient()}}}}})),cU()},cQ=function(t,e){var i=(t-e[0])/(e[1]-e[0]||1);return Math.max(0,Math.min(1,i))},dQ=function(t){var e=t.filter((function(t){return t.context.diffState===dN.update})),i=ut(e.map((function(t){var e,i;return null===(i=null===(e=null==t?void 0:t.context)||void 0===e?void 0:e.data)||void 0===i?void 0:i[0].depth})));return e.filter((function(t){var e,n;return(null===(n=null===(e=null==t?void 0:t.context)||void 0===e?void 0:e.data)||void 0===n?void 0:n[0].depth)===i}))},vQ=function(t,e,i){if(W(t))return[e,i];var n=ut(t.map((function(t){return 1*t.getFinalAttribute().startAngle}))),r=lt(t.map((function(t){return 1*t.getFinalAttribute().endAngle})));return[n,r]},fQ=function(t){return{channel:{startAngle:{from:function(e,i){var n=t.animationInfo(),r=n.startAngle,a=n.endAngle,o=dQ(i.parent.children),s=vQ(o,r,a);return cQ(i.getFinalAttribute().startAngle,s)*(a-r)+r},to:function(t,e){return e.getFinalAttribute().startAngle}},endAngle:{from:function(e,i){var n=t.animationInfo(),r=n.startAngle,a=n.endAngle,o=dQ(i.parent.children),s=vQ(o,r,a);return cQ(i.getFinalAttribute().endAngle,s)*(a-r)+r},to:function(t,e){return e.getFinalAttribute().endAngle}},outerRadius:{from:function(t,e){return e.getFinalAttribute().innerRadius},to:function(t,e){return e.getFinalAttribute().outerRadius}},innerRadius:{from:function(t,e){return e.getFinalAttribute().innerRadius},to:function(t,e){return e.getFinalAttribute().innerRadius}}}}},pQ=function(t){var e=ut(t.map((function(t){return 1*t.getFinalAttribute().startAngle}))),i=lt(t.map((function(t){return 1*t.getFinalAttribute().endAngle})));return[e,i]},gQ=function(t){return{channel:{startAngle:{from:function(t,e){return e.getFinalAttribute().startAngle},to:function(e,i){var n=t.animationInfo(),r=n.startAngle,a=n.endAngle,o=dQ(i.parent.children),s=pQ(o);return cQ(i.getFinalAttribute().startAngle,s)*(a-r)+r}},endAngle:{from:function(t,e){return e.getFinalAttribute().endAngle},to:function(e,i){var n=t.animationInfo(),r=n.startAngle,a=n.endAngle,o=dQ(i.parent.children),s=pQ(o);return cQ(i.getFinalAttribute().endAngle,s)*(a-r)+r}},outerRadius:{from:function(t,e){return e.getFinalAttribute().outerRadius},to:function(){return t.animationInfo().innerRadius}},innerRadius:{from:function(t,e){return e.getFinalAttribute().innerRadius},to:function(){return t.animationInfo().innerRadius}}}}},yQ=function(t,e){switch(e){case"fadeIn":return{type:"fadeIn"};case"growAngle":return{type:"growAngleIn"};default:return{type:"growRadiusIn"}}},mQ=function(t){if(!t)return[];var e=[];return xZ(t,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),e},_Q=function(t,e){if(!t)return t;var i=e(),n=i.width,r=i.height;return new ZZ(i).layout(t,{width:n,height:r})},bQ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).markTooltipKeyCallback=function(e){return null==e?void 0:e[t.series.getDimensionField()[0]]},t}return h(e,t),a(e)}(UU);!function(t){t.DrillDown="drillDown",t.DrillUp="drillUp"}(uQ||(uQ={}));var kQ=function(t,e){var i=e.info(),n=e.keyField(),r=null==i?void 0:i.key;if(C(r))return t;if(i.type===uQ.DrillDown)return ot(Xj(t,r,n,"children"));if(i.type===uQ.DrillUp){var a=qj(t,r,n,"children");if(a)return ot(a)}return t},xQ=function(){function e(){n(this,e)}return a(e,[{key:"_getDrillTriggerEvent",value:function(t){var e;return null===(e=fK(this._drillParams.mode))||void 0===e?void 0:e[t]}},{key:"_hideTooltip",value:function(){var t=this.getChart().getComponentsByType(c.tooltip)[0];t&&t.hideTooltip()}},{key:"initDrillable",value:function(t){this._drillParams=t}},{key:"initDrillableData",value:function(t){var e=this,i=this._drillParams.getRawData;fH(t,"drillFilter",kQ),i().transform({type:"drillFilter",options:{info:function(){return e._drillInfo},keyField:function(){return e._drillParams.drillField()}}})}},{key:"bindDrillEvent",value:function(){var t=this,e=this._drillParams,i=e.event,n=e.getRawData,r=(0,e.drillField)();this._getDrillTriggerEvent("start")&&i.on(this._getDrillTriggerEvent("start"),(function(e){var i,a,s;if(C(e.datum)||C(null===(i=e.datum)||void 0===i?void 0:i[r]))t.drillUp();else{t._hideTooltip();var l=e.datum[r],u=null!==(s=null===(a=t._drillInfo)||void 0===a?void 0:a.path)&&void 0!==s?s:[],h=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"key",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"children",r=[],a=function(t,s){var l,u=o(t);try{for(u.s();!(l=u.n()).done;){var h=l.value;if(h[i]===e)return r.push.apply(r,b(s).concat([h[i].toString()])),!0;if(h[n]){var c=a(h[n],[].concat(b(s),[h[i]]));if(!0===c)return c}}}catch(t){u.e(t)}finally{u.f()}return!1};return a(t,[]),r}(n().rawData,l,r,"children");u[u.length-1]===h[h.length-1]?t.drillUp():t.drillDown(h)}}))}},{key:"drillDown",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=this._drillParams,n=i.getRawData,r=i.event;if(!O(e)||W(e))return e;var a=e[e.length-1];return this._drillInfo={key:a,path:e,type:uQ.DrillDown},n().reRunAllTransform(),r.emit(t.ChartEvent.drill,{value:{path:e,type:uQ.DrillDown},model:this}),e}},{key:"drillUp",value:function(){var e,i,n=this._drillParams,r=n.getRawData,a=n.event,o=null!==(i=null===(e=this._drillInfo)||void 0===e?void 0:e.path)&&void 0!==i?i:[];if(!O(o)||W(o))return o;var s=o.pop();return this._drillInfo={key:s,path:o,type:uQ.DrillUp},r().reRunAllTransform(),a.emit(t.ChartEvent.drill,{value:{path:o,type:uQ.DrillUp},model:this}),o}}])}(),SQ=Object.assign(Object.assign({},tV),{sunburst:{name:"sunburst",type:"arc"}}),AQ=function(t,e,i){return t.push({key:e,operations:["values"]}),t.push({key:i,operations:["max","min"]}),t.push({key:KU,operations:["max","min","values"]}),t.push({key:XU,operations:["values"]}),t},CQ={innerRadius:0,outerRadius:1,startAngle:-90,endAngle:270,gap:0,labelLayout:{align:"center",offset:0,rotate:"radial"},sunburst:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"},fillOpacity:1,cursor:"pointer"}},label:{visible:!0,style:{cursor:"pointer",fill:{type:"palette",key:"primaryFontColor"},fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}},MQ=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=nz.sunburst,t}return h(r,e),a(r,[{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"getValueField",value:function(){return this._valueField}},{key:"getDimensionField",value:function(){return[this._categoryField]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"setAttrFromSpec",value:function(){var t,e=this;_(r,"setAttrFromSpec",this,3)([]),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:XU),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:function(){var t;return null!==(t=e._spec.drillField)&&void 0!==t?t:yj},getRawData:function(){return e.getRawData()}}),this._startAngle=be(this._spec.startAngle),this._endAngle=be(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}},{key:"initData",value:function(){var t=this;_(r,"initData",this,3)([]);var e=this.getRawData();e&&(this._spec.drill&&this.initDrillableData(this._dataSet),fH(this._dataSet,"sunburstLayout",_Q),fH(this._dataSet,"flatten",mQ),e.transform({type:"sunburstLayout",options:function(){var e=t._computeLevel(),i=e.innerRadius,n=e.outerRadius,r=e.gap,a=e.label;return{nodeKey:t._categoryField,width:t.getLayoutRect().width,height:t.getLayoutRect().height,center:[M(t._centerX)?t._centerX:t.getLayoutRect().width/2,M(t._centerY)?t._centerY:t.getLayoutRect().height/2],startAngle:t._startAngle,endAngle:t._endAngle,innerRadius:i,outerRadius:n,gapRadius:r,label:a}}}),e.transform({type:"flatten",options:{callback:function(t){if(t.datum){var e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}}))}},{key:"getStatisticFields",value:function(){return AQ(_(r,"getStatisticFields",this,3)([]),this._categoryField,this._valueField)}},{key:"_addDataIndexAndKey",value:function(){var t=this.getRawData();C(null==t?void 0:t.dataSet)||(fH(t.dataSet,"addVChartProperty",LU),t.transform({type:"addVChartProperty",options:{beforeCall:QU.bind(this),call:$U}}))}},{key:"initMark",value:function(){this._initArcMark(),this._initLabelMark()}},{key:"initMarkStyle",value:function(){this._initArcMarkStyle(),this._initLabelMarkStyle()}},{key:"_initArcMark",value:function(){if(!1!==this._sunburst.visible){var t=this._createMark(r.mark.sunburst,{isSeriesMark:!0});this._sunburstMark=t}}},{key:"_initArcMarkStyle",value:function(){var e=this;C(this._sunburstMark)||this.setMarkStyle(this._sunburstMark,{x:function(t){return t.x+(M(e._offsetX)?e._offsetX:0)},y:function(t){return t.y+(M(e._offsetY)?e._offsetY:0)},outerRadius:function(t){return t.outerRadius},innerRadius:function(t){return t.innerRadius},startAngle:function(t){return t.startAngle},endAngle:function(t){return t.endAngle},fill:this.getColorAttribute()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"_initLabelMark",value:function(){if(!0===this._label.visible){var t=this._createMark(r.mark.label,{isSeriesMark:!1});this._labelMark=t}}},{key:"_initLabelMarkStyle",value:function(){var e=this;C(this._labelMark)||this.setMarkStyle(this._labelMark,{visible:function(t){var i,n=e._labelAutoVisible;return T(n)&&!0===n.enable?(t.endAngle-t.startAngle)*(t.outerRadius-t.innerRadius)>(null!==(i=null==n?void 0:n.circumference)&&void 0!==i?i:10):e._spec.label.visible},x:function(t){var i;return(null===(i=t.label)||void 0===i?void 0:i.x)+(M(e._offsetX)?e._offsetX:0)},y:function(t){var i;return(null===(i=t.label)||void 0===i?void 0:i.y)+(M(e._offsetY)?e._offsetY:0)},textBaseline:function(t){var e;return null===(e=t.label)||void 0===e?void 0:e.textBaseline},textAlign:function(t){var e;return null===(e=t.label)||void 0===e?void 0:e.textAlign},angle:function(t){var e,i;return null!==(i=null===(e=t.label)||void 0===e?void 0:e.angle)&&void 0!==i?i:0},fontSize:10,text:function(t){return t.name}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"initTooltip",value:function(){this._tooltipHelper=new bQ(this),this._sunburstMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._sunburstMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}},{key:"initAnimation",value:function(){var t,e,i=this,n={animationInfo:function(){return{innerRadius:i._computeRadius(ot(i.__innerRadius))[0],outerRadius:i._computeRadius(ot(i.__outerRadius))[0],startAngle:ot(i._startAngle)[0],endAngle:ot(i._endAngle)[0]}}},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this.getMarksInType("arc").forEach((function(t){var e;t.setAnimationConfig(lV(null===(e=Uz.getAnimationInKey("sunburst"))||void 0===e?void 0:e(n,r),uV(t.name,i._spec,i._markAttributeContext)))})),this.getMarksInType("text").forEach((function(t){var e;t.setAnimationConfig(lV(null===(e=Uz.getAnimationInKey("fadeInOut"))||void 0===e?void 0:e(),uV(t.name,i._spec,i._markAttributeContext)))}))}},{key:"initEvent",value:function(){_(r,"initEvent",this,3)([]),this._spec.drill&&this.bindDrillEvent()}},{key:"onLayoutEnd",value:function(){_(r,"onLayoutEnd",this,3)([]),this._rawData.reRunAllTransform()}},{key:"_computeRadius",value:function(t){var e=this;return O(t)?t.map((function(t){return e._computeLayoutRadius()*t})):this._computeLayoutRadius()*t}},{key:"_computeLevel",value:function(){return{innerRadius:this._computeRadius(this.__innerRadius),outerRadius:this._computeRadius(this.__outerRadius),gap:this._gap,label:this._labelLayout}}},{key:"getGroupFields",value:function(){return[]}},{key:"getStackGroupFields",value:function(){return[]}},{key:"getStackValueField",value:function(){return""}},{key:"_noAnimationDataKey",value:function(t,e){}},{key:"getActiveMarks",value:function(){return[this._sunburstMark]}},{key:"getMarkData",value:function(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}])}(DX);MQ.type=nz.sunburst,MQ.mark=SQ,MQ.builtInTheme={sunburst:CQ},at(MQ,xQ);var TQ=function(){Uz.registerSeries(MQ.type,MQ),XX(),kX(),cU(),Uz.registerAnimation("sunburst",(function(t,e){return{appear:yQ(0,e),enter:fQ(t),exit:gQ(t),disappear:{duration:sU.disappear.duration}}}))},wQ=function(t,e){if(!t)return t;var i=e(),n=i.width,r=i.height;return 0===n||0===r?t:new zZ(i).layout(t,{width:n,height:r})},EQ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).markTooltipKeyCallback=function(e){return null==e?void 0:e[t.series.getDimensionField()[0]]},t}return h(e,t),a(e)}(UU),BQ=function(t){return"fadeIn"===t?{type:"fadeIn"}:{type:"growRadiusIn"}},PQ=Object.assign(Object.assign({},tV),{circlePacking:{name:"circlePacking",type:"arc"}}),OQ=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=nz.circlePacking,t}return h(r,e),a(r,[{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"getValueField",value:function(){return this._valueField}},{key:"getDimensionField",value:function(){return[this._categoryField]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"setAttrFromSpec",value:function(){var t,e=this;_(r,"setAttrFromSpec",this,3)([]),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:XU),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:function(){var t;return null!==(t=e._spec.drillField)&&void 0!==t?t:yj},getRawData:function(){return e.getRawData()}}),this._circlePacking=this._spec.circlePacking,this._label=this._spec.label,this._layoutPadding=this._spec.layoutPadding}},{key:"initData",value:function(){var t=this;_(r,"initData",this,3)([]);var e=this.getRawData();C(e)||(this._spec.drill&&this.initDrillableData(this._dataSet),fH(this._dataSet,"circlePackingLayout",wQ),fH(this._dataSet,"flatten",mQ),e.transform({type:"circlePackingLayout",options:function(){return{nodeKey:t._categoryField,valueField:t._valueField,padding:t._layoutPadding,includeRoot:!1,width:t.getLayoutRect().width||1,height:t.getLayoutRect().height||1}}}),e.transform({type:"flatten",options:{callback:function(t){if(t.datum){var e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}}))}},{key:"_addDataIndexAndKey",value:function(){var t=this.getRawData();C(null==t?void 0:t.dataSet)||(fH(t.dataSet,"addVChartProperty",LU),t.transform({type:"addVChartProperty",options:{beforeCall:QU.bind(this),call:$U}}))}},{key:"initMark",value:function(){this._initCirclePackingMark(),this._initLabelMark()}},{key:"initMarkStyle",value:function(){this._initCirclePackingMarkStyle(),this._initLabelMarkStyle()}},{key:"_initCirclePackingMark",value:function(){var t;if(!1!==(null===(t=this._circlePacking)||void 0===t?void 0:t.visible)){var e=this._createMark(r.mark.circlePacking,{isSeriesMark:!0});this._circlePackingMark=e}}},{key:"_initCirclePackingMarkStyle",value:function(){C(this._circlePackingMark)||this.setMarkStyle(this._circlePackingMark,{x:function(t){return t.x},y:function(t){return t.y},outerRadius:function(t){return t.radius},innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:this.getColorAttribute(),zIndex:function(t){return t.depth}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"_initLabelMark",value:function(){var t;if(!1!==(null===(t=this._label)||void 0===t?void 0:t.visible)){var e=this._createMark(r.mark.label,{isSeriesMark:!1});this._labelMark=e}}},{key:"_initLabelMarkStyle",value:function(){C(this._labelMark)||this.setMarkStyle(this._labelMark,{x:function(t){return t.x},y:function(t){return t.y},text:function(t){return t.key},cursor:"pointer"},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"getStatisticFields",value:function(){return AQ(_(r,"getStatisticFields",this,3)([]),this._categoryField,this._valueField)}},{key:"initTooltip",value:function(){this._tooltipHelper=new EQ(this),this._circlePackingMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._circlePackingMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}},{key:"initAnimation",value:function(){var t,e=this,i=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;this.getMarksInType("arc").forEach((function(t){var n;t.setAnimationConfig(lV(null===(n=Uz.getAnimationInKey("circlePacking"))||void 0===n?void 0:n(void 0,i),uV(t.name,e._spec,e._markAttributeContext)))})),this.getMarksInType("text").forEach((function(t){var i;t.setAnimationConfig(lV(null===(i=Uz.getAnimationInKey("scaleInOut"))||void 0===i?void 0:i(),uV(t.name,e._spec,e._markAttributeContext)))}))}},{key:"initEvent",value:function(){_(r,"initEvent",this,3)([]),this._spec.drill&&this.bindDrillEvent()}},{key:"onLayoutEnd",value:function(){_(r,"onLayoutEnd",this,3)([]),this._rawData.reRunAllTransform()}},{key:"_noAnimationDataKey",value:function(t,e){}},{key:"getActiveMarks",value:function(){return[this._circlePackingMark]}},{key:"getMarkData",value:function(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}])}(MV);OQ.type=nz.circlePacking,OQ.mark=PQ,OQ.builtInTheme={circlePacking:{layoutPadding:5,circlePacking:{visible:!0,style:{cursor:"pointer",lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}},label:{visible:!0,style:{cursor:"pointer",fill:"black",stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}}},at(OQ,xQ);var IQ=function(){Uz.registerSeries(OQ.type,OQ),XX(),kX(),hU(),Uz.registerAnimation("circlePacking",(function(t,e){return{appear:BQ(e),enter:{type:"growRadiusIn"},exit:{type:"growRadiusOut"},disappear:{duration:sU.disappear.duration}}}))},RQ=function(t,e,i){e.forEach((function(e){C(e[i])||t.add(e[i]),e.children&&e.children.length>0&&RQ(t,e.children,i)}))},LQ=function(t){var e;if(!t||!O(t))return[];if(t.length>1){var i={links:[],nodes:[]};return t.forEach((function(t){"links"!==t.id&&"nodes"!==t.id||(i[t.id]=t.values)})),[i]}return(null===(e=t[0])||void 0===e?void 0:e.latestData)?t[0].latestData:t},DQ=function(t,e){var i=A(e)?e():e;if(!t||!(null==i?void 0:i.view)||!t.length)return[];var n=i.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[];var r=t[0],a=FQ(r,i),o=new KZ(i),s=[];return s.push(o.layout(a,n)),s},FQ=function(t,e){if("source"===e.sourceField&&"target"===e.targetField&&"value"===e.valueField)return t;var i=t.links;return i?Object.assign(Object.assign({},t),{links:i.map((function(t){var i={};return Object.keys(t).forEach((function(n){n===e.sourceField?i.source=t[e.sourceField]:n===e.targetField?i.target=t[e.targetField]:n===e.valueField?i.value=t[e.valueField]:i[n]=t[n]})),i}))}):t},zQ=function(t){var e,i;return t&&O(t)&&(null===(e=t[0])||void 0===e?void 0:e.latestData)&&t[0].latestData.length&&t[0].latestData[0]&&null!==(i=t[0].latestData[0].nodes)&&void 0!==i?i:[]},jQ=function(t){var e,i;return t&&O(t)&&(null===(e=t[0])||void 0===e?void 0:e.latestData)&&t[0].latestData.length&&t[0].latestData[0]&&null!==(i=t[0].latestData[0].links)&&void 0!==i?i:[]},HQ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments))._getDimensionData=function(e){if(!C(null==e?void 0:e.source)&&!C(null==e?void 0:e.target)){if(L(e.source)){var i=t.series.getSeriesKeys();return i[e.source]+" => "+i[e.target]}return e.source+" => "+e.target}return e.datum?e.datum[t.series.getSpec().categoryField]:e.key},t.markTooltipValueCallback=function(t){return t.value},t}return h(e,t),a(e)}(UU),NQ=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return{type:"horizontal"===t.direction?"growWidthIn":"growHeightIn",options:{overall:e?t.growFrom():e,orient:"positive"}}},UQ=function(t,e){return"fadeIn"===e?{type:"fadeIn"}:NQ(t)},VQ=function(t){return"fadeIn"===t?{type:"fadeIn"}:{type:"linkPathGrowIn"}},WQ=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"onBind",value:function(){var t,i,n;_(e,"onBind",this,3)([]),(null===(t=this.params)||void 0===t?void 0:t.diffAttrs)&&this.target.setAttributes(this.params.diffAttrs);var r=function(t,e,i){var n={x0:t.getFinalAttribute().x0,x1:t.getFinalAttribute().x1,y0:t.getFinalAttribute().y0,y1:t.getFinalAttribute().y1,thickness:t.getFinalAttribute().thickness};return{from:Object.assign({},n,{x1:n.x0,y1:n.y0}),to:n}}(this.target,this.params.options,this.params),a=r.from,o=r.to,s=null!==(n=null===(i=this.target.context)||void 0===i?void 0:i.lastAttrs)&&void 0!==n?n:a,l=this.target.getFinalAttribute();l&&Object.assign(this.target.attribute,l),this.props=o,this.propKeys=Object.keys(o).filter((function(t){return null!=o[t]})),this.animate.reSyncProps(),this.from=s,this.to=o,this.target.setAttributes(s)}},{key:"onUpdate",value:function(t,e,i){var n=this,r=this.target.attribute;this.propKeys.forEach((function(t){r[t]=n.from[t]+(n.to[t]-n.from[t])*e})),this.target.setAttributes(r)}}])}(JB),GQ=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"onBind",value:function(){var t,i,n;_(e,"onBind",this,3)([]),(null===(t=this.params)||void 0===t?void 0:t.diffAttrs)&&this.target.setAttributes(this.params.diffAttrs);var r=function(t,e,i){var n={x0:t.getFinalAttribute().x0,x1:t.getFinalAttribute().x1,y0:t.getFinalAttribute().y0,y1:t.getFinalAttribute().y1,thickness:t.getFinalAttribute().thickness};return{from:n,to:Object.assign({},n,{x1:n.x0,y1:n.y0})}}(this.target,this.params.options,this.params),a=r.from,o=r.to,s=null!==(n=null===(i=this.target.context)||void 0===i?void 0:i.lastAttrs)&&void 0!==n?n:a;this.props=o,this.propKeys=Object.keys(o).filter((function(t){return null!=o[t]})),this.animate.reSyncProps(),this.from=s,this.to=o,this.target.setAttributes(s)}},{key:"onUpdate",value:function(t,e,i){var n=this,r=this.target.attribute;this.propKeys.forEach((function(t){r[t]=n.from[t]+(n.to[t]-n.from[t])*e})),this.target.setAttributes(r)}}])}(JB),YQ=function(t,e){var i,n=null!==(i=t.curvature)&&void 0!==i?i:.5,r="number"==typeof e?t.thickness*e:t.thickness,a=t.x0,o=t.x1,s=t.y0,l=t.y1,u=a+n*(o-a),h=o+n*(a-o),c=function(t){return t};!1!==t.round&&(a=Math.round(a),o=Math.round(o),s=Math.round(s),l=Math.round(l),u=Math.round(u),h=Math.round(h),c=Math.round),"line"===t.pathType||t.pathType,"center"===t.align?(s=c(t.y0-r/2),l=c(t.y1-r/2)):"end"===t.align?(s=c(t.y0+t.thickness/2-r),l=c(t.y1+t.thickness/2-r)):(s=c(t.y0-t.thickness/2),l=c(t.y1-t.thickness/2));var d=c(s+r),v=c(l+r),f=Math.abs(o-a)>1e-6,p=t.endArrow&&f?"L".concat(o,",").concat(c(l-r/2),"L").concat(c(o+r),",").concat(c((l+v)/2),"L").concat(o,",").concat(c(v+r/2)):"",g=t.startArrow&&f?"L".concat(a,",").concat(c(d+r/2),"L").concat(c(a-r),",").concat(c((s+d)/2),"L").concat(a,",").concat(c(s-r/2)):"";return"line"===t.pathType?"M".concat(a,",").concat(s,"L").concat(o,",").concat(l).concat(p,"L").concat(o,",").concat(v,"L").concat(a,",").concat(d).concat(g,"Z"):"polyline"===t.pathType?"M".concat(a,",").concat(s,"L").concat(u,",").concat(s,"L").concat(u,",").concat(l,"L").concat(o,",").concat(l,"\n ").concat(p,"L").concat(o,",").concat(v,"L").concat(u,",").concat(v,"L").concat(u,",").concat(d,"L").concat(a,",").concat(d).concat(g,"Z"):"M".concat(a,",").concat(s,"C").concat(u,",").concat(s,",").concat(h,",").concat(l,",").concat(o,",").concat(l,"\n ").concat(p,"L").concat(o,",").concat(v,"C").concat(h,",").concat(v,",").concat(u,",").concat(d,",").concat(a,",").concat(d).concat(g,"Z")},KQ=function(t,e){var i,n=null!==(i=t.curvature)&&void 0!==i?i:.5,r="number"==typeof e?t.thickness*e:t.thickness,a=t.y0,o=t.y1,s=t.x0,l=t.x1,u=a+n*(o-a),h=o+n*(a-o),c=function(t){return t};!1!==t.round&&(c=Math.round,a=Math.round(a),o=Math.round(o),s=Math.round(s),l=Math.round(l),u=Math.round(u),h=Math.round(h)),"line"===t.pathType||t.pathType,"center"===t.align?(s=c(t.x0-r/2),l=c(t.x1-r/2)):"end"===t.align?(s=c(t.x0+t.thickness/2-r),l=c(t.x1+t.thickness/2-r)):(s=c(t.x0-t.thickness/2),l=c(t.x1-t.thickness/2));var d=c(s+r),v=c(l+r),f=Math.abs(o-a)>1e-6,p=t.endArrow&&f?"L".concat(c(l-r/2),",").concat(o,"L").concat(c((l+v)/2),",").concat(c(o+r),"L").concat(c(v+r/2),",").concat(o):"",g=t.startArrow&&f?"L".concat(c(d+r/2),",").concat(a,"L").concat(c((d+s)/2),",").concat(c(a-r),"L").concat(c(s-r/2),",").concat(a):"";return"line"===t.pathType?"M".concat(s,",").concat(a,"L").concat(l,",").concat(o).concat(p,"L").concat(v,",").concat(o,"L").concat(d,",").concat(a).concat(g,"Z"):"polyline"===t.pathType?"M".concat(s,",").concat(a,"L").concat(s,",").concat(u,"L").concat(l,",").concat(u,"L").concat(l,",").concat(o,"\n ").concat(p,"L").concat(v,",").concat(o,"L").concat(v,",").concat(u,"L").concat(d,",").concat(u,"L").concat(d,",").concat(a).concat(g,"Z"):"M".concat(s,",").concat(a,"C").concat(s,",").concat(u,",").concat(l,",").concat(h,",").concat(l,",").concat(o,"\n ").concat(p,"L").concat(v,",").concat(o,"C").concat(v,",").concat(h,",").concat(d,",").concat(u,",").concat(d,",").concat(a).concat(g,"Z")},XQ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=e.type,t._subMarks={back:{type:"path",defaultAttributes:{zIndex:0}},front:{type:"path",defaultAttributes:{zIndex:1}}},t._positionChannels=["x0","y0","x1","y1","thickness","round","curvature","ratio","pathType","align","endArrow","startArrow","ratio"],t._channelEncoder={backgroundStyle:function(t){return{back:t}}},t._positionEncoder=function(e,i,n){var r,a,o=Object.assign(Object.assign({},n.attribute),e),s=null!==(r=o.direction)&&void 0!==r?r:null===(a=t._glyphConfig)||void 0===a?void 0:a.direction,l=["vertical","TB","BT"].includes(s)?KQ:YQ,u="number"==typeof o.ratio&&o.ratio>=0&&o.ratio<=1;return{back:{path:u?l(o,1):""},front:{path:l(o,u?o.ratio:1)}}},t}return h(e,t),a(e,[{key:"_getDefaultStyle",value:function(){return Object.assign(Object.assign({},_(e,"_getDefaultStyle",this,3)([])),{x:0,y:0,x0:0,y0:0,x1:100,y1:100,thickness:1,round:!0})}}])}(eX);XQ.type="linkPath";var qQ=Object.assign(Object.assign({},tV),{node:{name:"node",type:"rect"},link:{name:"link",type:"linkPath"}}),ZQ=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"node")}}])}(gV),JQ=function(t,e,i){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4?arguments[4]:void 0;t.runtimeStateCache||(t.runtimeStateCache={}),t.runtimeStateCache[e]=i,t.hasState(e)&&JN(t,e),ZN(t,e,n,r)},QQ=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).type=nz.sankey,e.transformerConstructor=ZQ,e._nodeLayoutZIndex=t.LayoutZIndex.Node,e._labelLayoutZIndex=t.LayoutZIndex.Label,e._viewBox=new ei,e._fillByNode=function(t){var i,n,r,a,o;if(t&&t.sourceRect&&t.targetRect)return e._fillByLink(t);var s=null===(n=null===(i=e._spec.node)||void 0===i?void 0:i.style)||void 0===n?void 0:n.fill;if(M(s))return s;if(M(e._spec.seriesField)){var l=null===(a=null===(r=e._option)||void 0===r?void 0:r.globalScale)||void 0===a?void 0:a.getScale("color"),u=(null==t?void 0:t.datum)?t.datum:t;return null==l?void 0:l.scale(null==u?void 0:u[e._spec.seriesField])}return null===(o=e._colorScale)||void 0===o?void 0:o.scale(e._getNodeNameFromData(t))},e._fillByLink=function(t){var i,n,r,a,o,s,l=null===(n=null===(i=e._spec.link)||void 0===i?void 0:i.style)||void 0===n?void 0:n.fill;if(l)return l;if(M(e._spec.seriesField)){var u=null===(r=e._nodesSeriesData.latestData)||void 0===r?void 0:r.find((function(e){return t.source===e.key})),h=null==u?void 0:u.datum,c=null===(o=null===(a=e._option)||void 0===a?void 0:a.globalScale)||void 0===o?void 0:o.getScale("color");return null==c?void 0:c.scale(null==h?void 0:h[e._spec.seriesField])}var d=L(t.source)?e.getNodeList()[t.source]:t.source;return null===(s=e._colorScale)||void 0===s?void 0:s.scale(d)},e._handleEmphasisElement=function(t){var i,n=null!==(i=e._spec.emphasis)&&void 0!==i?i:{},r=t.item;"adjacency"===n.effect?r&&t.mark===e._nodeMark?e._handleNodeAdjacencyClick(r):r&&t.mark===e._linkMark?e._handleLinkAdjacencyClick(r):e._handleClearEmpty():"related"===n.effect&&(r&&t.mark===e._nodeMark?e._handleNodeRelatedClick(r):r&&t.mark===e._linkMark?e._handleLinkRelatedClick(r):e._handleClearEmpty())},e._handleClearEmpty=function(){var i,n;if(e._needClear){var r=null===(i=e._nodeMark)||void 0===i?void 0:i.getGraphics();if(r&&r.length){var a=null===(n=e._linkMark)||void 0===n?void 0:n.getGraphics();a&&a.length&&(r.forEach((function(e){JN(e,[t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE])})),a.forEach((function(e){JN(e,[t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE])})),e._needClear=!1)}}},e._handleNodeAdjacencyClick=function(i){var n=nH(i),r=[n.key];if(e._linkMark){var a=e._linkMark.getGraphics();if(!a||!a.length)return;a.forEach((function(e,i){var a=nH(e);a.source===n.key?(r.includes(a.target)||r.push(a.target),JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),ZN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,!0)):a.target===n.key?(r.includes(a.source)||r.push(a.source),JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),ZN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,!0)):(JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),ZN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0))}))}e._nodeMark&&e._highLightElements(e._nodeMark.getGraphics(),r),e._needClear=!0},e._handleLinkAdjacencyClick=function(i){var n=nH(i),r=[n.source,n.target];if(e._linkMark){var a=e._linkMark.getGraphics();if(!a||!a.length)return;a.forEach((function(e){e===i?(JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),JQ(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:1})):(JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),ZN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0))}))}e._nodeMark&&e._highLightElements(e._nodeMark.getGraphics(),r),e._needClear=!0},e._handleNodeRelatedClick=function(i){var n,r=nH(i),a=e._nodeMark.getGraphics();if(a&&a.length){var o=e._linkMark.getGraphics();if(o&&o.length){var s=(null===(n=nH(o[0]))||void 0===n?void 0:n.parents)?"parents":"source";if("source"===s){var l=[r.key],u=[];if(o.forEach((function(t,e){var i,n,o,s,h=nH(t),c=(null==h?void 0:h.parents)?"parents":"source";if(ot(h[c]).includes(r.key)){if(u.includes(null!==(i=h.key)&&void 0!==i?i:h.index)||u.push(null!==(n=h.key)&&void 0!==n?n:h.index),l.includes(h.source)||l.push(h.source),!l.includes(h.target)){l.push(h.target);for(var d,v=a.find((function(t){return t.data[0].key===h.target})).data[0].sourceLinks,f=function(){var t=[];return{v:(v.forEach((function(e){var i,n;if(!u.includes(null!==(i=e.key)&&void 0!==i?i:e.index)&&(u.push(null!==(n=e.key)&&void 0!==n?n:e.index),!l.includes(e.target))){l.push(e.target);var r=a.find((function(t){return t.data[0].key===e.target}));t.push(r.data[0].targetLinks)}})),void(v=t))}};(null==v?void 0:v.length)>0;)if(d=f())return d.v}}else if(h.target===r.key&&(u.includes(null!==(o=h.key)&&void 0!==o?o:h.index)||u.push(null!==(s=h.key)&&void 0!==s?s:h.index),!l.includes(h.source))){l.push(h.source);for(var p,g=a.find((function(t){return t.data[0].key===h.source})).data[0].targetLinks,y=function(){var t=[];return{v:(g.forEach((function(e){var i,n;if(!u.includes(null!==(i=e.key)&&void 0!==i?i:e.index)&&(u.push(null!==(n=e.key)&&void 0!==n?n:e.index),!l.includes(e.source))){l.push(e.source);var r=a.find((function(t){return t.data[0].key===e.source}));t.push(r.data[0].targetLinks)}})),void(g=t))}};(null==g?void 0:g.length)>0;)if(p=y())return p.v}})),e._linkMark){var h=e._linkMark.getGraphics();if(!h||!h.length)return;h.forEach((function(e,i){var n,r=nH(e);u.includes(null!==(n=r.key)&&void 0!==n?n:r.index)?(JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),ZN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,!0)):(JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),ZN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0))}))}e._nodeMark&&e._highLightElements(e._nodeMark.getGraphics(),l)}else{var c=[r.key],d=r.targetLinks.reduce((function(t,e){return ot(e.datum).forEach((function(e){for(var i=e.parents,n=i.length,a=function(){var n=i[o].key,a=i[o+1]?i[o+1].key:r.key,s=e.value,l=t.find((function(t){return t.source===n&&t.target===a}));l?l.value+=s:t.push({source:n,target:a,value:s})},o=0;o<n;o++)a()})),t}),[]);o.forEach((function(e,i){var n=nH(e),a=n.datum,o=a?a.filter((function(t){return t[s].some((function(t){return t.key===r.key}))})):null,l=d.find((function(t){return t.source===n.source&&t.target===n.target}));if(o&&o.length){c.includes(n.source)||c.push(n.source),c.includes(n.target)||c.push(n.target);var u=o.reduce((function(t,e){return t+e.value}),0),h=u/n.value;return JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void JQ(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:h})}if(l)return c.includes(n.source)||c.push(n.source),c.includes(n.target)||c.push(n.target),JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void JQ(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:l.value/n.value});JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),ZN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0)})),e._nodeMark&&e._highLightElements(e._nodeMark.getGraphics(),c)}e._needClear=!0}}},e._handleLinkRelatedClick=function(i){var n=e._nodeMark.getGraphics();if(n&&n.length){var r=e._linkMark.getGraphics();if(r&&r.length){if("source"==(nH(i)?"parents":"source"))e._linkMark&&r.forEach((function(e){JN(e,[t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE])})),e._nodeMark&&n.forEach((function(e){JN(e,[t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE])}));else{var a=nH(i),o=[a.source,a.target],s=[];ot(a.datum).forEach((function(t){for(var e=t.parents,i=e.length,n=function(){var i=e[r].key,n=e[r+1].key,a=t.value,o=s.find((function(t){return t.source===i&&t.target===n}));s.push({source:e[r].key,target:e[r+1].key,value:t.value}),o?o.value+=a:s.push({source:i,target:n,value:a})},r=0;r<i-1;r++)n()})),r.forEach((function(e){var i=nH(e),n=i.datum;if(i.source===a.source&&i.target===a.target)return JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void JQ(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:1});var r=n?n.filter((function(t){var e=t.parents.map((function(t){return t.key}));return e.includes(a.source)&&e.includes(a.target)})):null;if(r&&r.length){o.includes(i.source)||o.push(i.source),o.includes(i.target)||o.push(i.target);var l=r.filter((function(t){return t.parents.some((function(e,i){var n;return e.key===a.source&&(null===(n=t.parents[i+1])||void 0===n?void 0:n.key)===a.target}))})).reduce((function(t,e){return t+e.value}),0),u=l/i.value;return JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void JQ(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:u})}var h=s.find((function(t){return t.source===i.source&&t.target===i.target}));if(h)return o.includes(i.source)||o.push(i.source),o.includes(i.target)||o.push(i.target),JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void JQ(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:h.value/i.value});JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),ZN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0)})),e._highLightElements(n,o)}e._needClear=!0}}},e}return h(r,e),a(r,[{key:"direction",get:function(){var t;return null!==(t=this._spec.direction)&&void 0!==t?t:"horizontal"}},{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getValueField",value:function(){return this._valueField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"setAttrFromSpec",value:function(){var t;_(r,"setAttrFromSpec",this,3)([]),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:this._spec.categoryField)}},{key:"initData",value:function(){var e=this;_(r,"initData",this,3)([]);var i=this.getViewData(),n=this.getRawData();if(n&&i){fH(this._dataSet,"sankeyLayout",DQ),fH(this._dataSet,"sankeyFormat",LQ),n.transform({type:"sankeyFormat"},!1),i.transform({type:"sankeyLayout",options:function(){var t,i,n,r;return{view:function(){return{x0:e._viewBox.x1,x1:e._viewBox.x2,y0:e._viewBox.y1,y1:e._viewBox.y2}},sourceField:e._spec.sourceField,targetField:e._spec.targetField,valueField:e._spec.valueField,direction:e.direction,crossNodeAlign:e._spec.crossNodeAlign,nodeAlign:null!==(t=e._spec.nodeAlign)&&void 0!==t?t:"justify",nodeGap:null!==(i=e._spec.nodeGap)&&void 0!==i?i:8,nodeWidth:null!==(n=e._spec.nodeWidth)&&void 0!==n?n:10,linkWidth:e._spec.linkWidth,minStepWidth:e._spec.minStepWidth,minNodeHeight:null!==(r=e._spec.minNodeHeight)&&void 0!==r?r:4,maxNodeHeight:e._spec.maxNodeHeight,minLinkHeight:e._spec.minLinkHeight,maxLinkHeight:e._spec.maxLinkHeight,iterations:e._spec.iterations,nodeKey:e._spec.nodeKey,linkSortBy:e._spec.linkSortBy,nodeSortBy:e._spec.nodeSortBy,setNodeLayer:e._spec.setNodeLayer,dropIsolatedNode:e._spec.dropIsolatedNode,nodeHeight:e._spec.nodeHeight,linkHeight:e._spec.linkHeight,equalNodeHeight:e._spec.equalNodeHeight,linkOverlap:e._spec.linkOverlap,inverse:e._spec.inverse}},level:t.TransformLevel.sankeyLayout});var a=this._option.dataSet;fH(a,"sankeyNodes",zQ),fH(a,"flatten",mQ);var o=new Ko(a,{name:"sankey-node-".concat(this.id,"-data")});o.parse([this.getViewData()],{type:"dataview"}),o.transform({type:"sankeyNodes"}),o.transform({type:"flatten",options:{callback:function(t){if(t.datum){var e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}},!1),o.transform({type:"addVChartProperty",options:{beforeCall:ZU.bind(this),call:JU}},!1),this._nodesSeriesData=o,fH(a,"sankeyLinks",jQ);var s=new Ko(a,{name:"sankey-link-".concat(this.id,"-data")});s.parse([this.getViewData()],{type:"dataview"}),s.transform({type:"sankeyLinks"}),s.transform({type:"addVChartProperty",options:{beforeCall:ZU.bind(this),call:JU}},!1),this._linksSeriesData=s}}},{key:"compileData",value:function(){var t,e;_(r,"compileData",this,3)([]),null===(t=this._linkMark)||void 0===t||t.compileData(),null===(e=this._nodeMark)||void 0===e||e.compileData()}},{key:"initMark",value:function(){this._rootMark.setMarkConfig({overflow:this._spec.overflow,interactive:!!this._spec.overflow});var t=this._createMark(r.mark.node,{isSeriesMark:!0,dataView:this._nodesSeriesData});t&&(t.setMarkConfig({zIndex:this._nodeLayoutZIndex}),this._nodeMark=t);var e=this._createMark(r.mark.link,{dataView:this._linksSeriesData});e&&(this._linkMark=e)}},{key:"_buildMarkAttributeContext",value:function(){_(r,"_buildMarkAttributeContext",this,3)([]),this._markAttributeContext.valueToNode=this.valueToNode.bind(this),this._markAttributeContext.valueToLink=this.valueToLink.bind(this)}},{key:"valueToNode",value:function(t){var e=this._nodesSeriesData.latestData,i=ot(t)[0];return e&&e.find((function(t){return t.key===i}))}},{key:"valueToLink",value:function(t){var e=this._linksSeriesData.latestData,i=ot(t);return e&&e.find((function(t){return t&&t.source===i[0]&&t.target===i[1]}))}},{key:"valueToPositionX",value:function(t){var e=this.valueToNode(t);return null==e?void 0:e.x0}},{key:"valueToPositionY",value:function(t){var e=this.valueToNode(t);return null==e?void 0:e.y0}},{key:"initMarkStyle",value:function(){this._initNodeMarkStyle(),this._initLinkMarkStyle()}},{key:"_initNodeMarkStyle",value:function(){var e,i,n=this._nodeMark;n&&(this.setMarkStyle(n,{x:function(t){return t.x0},x1:function(t){return t.x1},y:function(t){return t.y0},y1:function(t){return t.y1}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Mark),this.setMarkStyle(n,{fill:null!==(i=null===(e=this._spec.node.style)||void 0===e?void 0:e.fill)&&void 0!==i?i:this._fillByNode},"normal",t.AttributeLevel.User_Mark))}},{key:"_initLinkMarkStyle",value:function(){var e,i,n=this._linkMark;n&&(n.setGlyphConfig({direction:this.direction}),this.setMarkStyle(n,{x0:function(t){return t.x0},x1:function(t){return t.x1},y0:function(t){return t.y0},y1:function(t){return t.y1},thickness:function(t){return t.thickness}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this.setMarkStyle(n,{fill:null!==(i=null===(e=this._spec.link.style)||void 0===e?void 0:e.fill)&&void 0!==i?i:this._fillByLink},"normal",t.AttributeLevel.User_Mark))}},{key:"initLabelMarkStyle",value:function(t,e){var i=this;if(t){var n=e.position;n&&n.includes("inside")?this.setMarkStyle(t,{fill:"#ffffff",text:function(t){return i._createText(t,e)},maxLineWidth:function(t){var i;return null!==(i=e.limit)&&void 0!==i?i:t.x1-t.x0}}):this.setMarkStyle(t,{fill:this._fillByNode,text:function(t){return i._createText(t,e)},maxLineWidth:e.limit}),t.setMarkConfig({zIndex:this._labelLayoutZIndex})}}},{key:"_createText",value:function(t,e){if(C(t)||C(t.datum))return"";var i=t.datum[this._spec.categoryField]||"",n=e||{},r=OU(n.formatMethod,n.formatter,i,t.datum),a=r.formatFunc,o=r.args;return a&&(i=a.apply(void 0,b(o).concat([{series:this}]))),i}},{key:"initAnimation",value:function(){var t,e,i,n,r=this,a={direction:this.direction,growFrom:function(){var t,e;return"horizontal"===r.direction?null===(t=r._xAxisHelper)||void 0===t?void 0:t.getScale(0).scale(0):null===(e=r._yAxisHelper)||void 0===e?void 0:e.getScale(0).scale(0)}},o=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._nodeMark&&this._nodeMark.setAnimationConfig(lV(null===(i=Uz.getAnimationInKey("sankeyNode"))||void 0===i?void 0:i(a,o),uV("node",this._spec,this._markAttributeContext))),this._linkMark&&this._linkMark.setAnimationConfig(lV(null===(n=Uz.getAnimationInKey("sankeyLinkPath"))||void 0===n?void 0:n(a,o),uV("link",this._spec,this._markAttributeContext)))}},{key:"initEvent",value:function(){var t,e,i;_(r,"initEvent",this,3)([]),null===(t=this._nodesSeriesData)||void 0===t||t.target.addListener("change",this.nodesSeriesDataUpdate.bind(this)),null===(e=this._linksSeriesData)||void 0===e||e.target.addListener("change",this.linksSeriesDataUpdate.bind(this));var n=null!==(i=this._spec.emphasis)&&void 0!==i?i:{};if(!0!==this._option.disableTriggerEvent&&n.enable&&("adjacency"===n.effect||"related"===n.effect)){var a="hover"===n.trigger?"pointerover":"pointerdown";this.event.on(a,{level:lH.chart},this._handleEmphasisElement)}}},{key:"nodesSeriesDataUpdate",value:function(){this._nodeMark.getData().updateData(),this._nodeList=null,this._setNodeOrdinalColorScale()}},{key:"linksSeriesDataUpdate",value:function(){this._linkMark.getData().updateData()}},{key:"_highLightElements",value:function(e,i){e&&e.length&&e.forEach((function(e){JN(e,[t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS]),i.includes(nH(e).key)?ZN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,!0):ZN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0)}))}},{key:"initTooltip",value:function(){this._tooltipHelper=new HQ(this),this._nodeMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nodeMark),this._linkMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._linkMark)}},{key:"_setNodeOrdinalColorScale",value:function(){var t,e,i,n,r,a=null===(e=null===(t=this._option)||void 0===t?void 0:t.globalScale)||void 0===e?void 0:e.getScale("color");if(null==a?void 0:a._specified)this._colorScale=a;else{var o,s;a&&(o=a.domain(),s=a.range()),s||(s=this._getDataScheme()),o&&!C(o[0])||(o=this.getNodeList())&&o.length>10&&(s=null===(i=this._getDataScheme()[1])||void 0===i?void 0:i.scheme);var l=new _z;null===(r=(n=l.domain(o)).range)||void 0===r||r.call(n,s),this._colorScale=l}}},{key:"getNodeList",value:function(){var t,e,i=this;if(this._nodeList)return this._nodeList;var n=this._rawData.latestData[0],r=(null==n?void 0:n.nodes)?(null===(t=n.nodes[0])||void 0===t?void 0:t.children)?Array.from(this.extractNamesFromTree(n.nodes,this._spec.categoryField)):n.nodes.map((function(t,e){return t[i._spec.categoryField]})):(null==n?void 0:n.links)?Array.from(this.extractNamesFromLink(n.links)):null===(e=null==n?void 0:n.values)||void 0===e?void 0:e.map((function(t,e){return t[i._spec.categoryField]}));return this._nodeList=r,r}},{key:"_getNodeNameFromData",value:function(t){var e;return(null==t?void 0:t.datum)?t.datum[this._spec.categoryField]:null!==(e=t.key)&&void 0!==e?e:t[this._spec.categoryField]}},{key:"extractNamesFromTree",value:function(t,e){var i=this,n=new Set;return t.forEach((function(t){n.add(t[e]),t.children&&i.extractNamesFromTree(t.children,e).forEach((function(t){return n.add(t)}))})),n}},{key:"extractNamesFromLink",value:function(t){var e=new Set,i=this._spec,n=i.sourceField,r=i.targetField;return t.forEach((function(t){M(t[n])&&e.add(t[n]),M(t[r])&&e.add(t[r])})),e}},{key:"getDimensionField",value:function(){return[this._spec.categoryField]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"getRawDataStatisticsByField",value:function(t,e){var i;return this._rawStatisticsCache||(this._rawStatisticsCache={}),this._rawStatisticsCache[t]||(this._viewDataStatistics&&this.getViewData().transformsArr.length<=1&&(null===(i=this._viewDataStatistics.latestData)||void 0===i?void 0:i[t])?this._rawStatisticsCache[t]=this._viewDataStatistics.latestData[t]:this._rawData&&(this._rawStatisticsCache[t]={values:this._collectByField(t)})),this._rawStatisticsCache[t]}},{key:"_collectByField",value:function(t){var e,i,n,r=this,a=[],o=null===(i=null===(e=this.getRawData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i[0];if(!o)return[];if(o.links)(null===(n=o.nodes)||void 0===n?void 0:n.length)&&o.nodes.forEach((function(t){t[r._seriesField]&&a.push(t[r._seriesField])}));else if(o.nodes){var s=new Set;return RQ(s,o.nodes,this._seriesField),Array.from(s)}return a}},{key:"onLayoutEnd",value:function(){_(r,"onLayoutEnd",this,3)([]),this._viewBox.set(0,0,this._region.getLayoutRect().width,this._region.getLayoutRect().height),this.getViewData().reRunAllTransform()}},{key:"getDefaultShapeType",value:function(){return"square"}},{key:"_noAnimationDataKey",value:function(t,e){}},{key:"getActiveMarks",value:function(){return[this._nodeMark,this._linkMark]}},{key:"getMarkData",value:function(t){return t.datum?O(t.datum)?t.datum[t.datum.length-1]:t.datum:t}}])}(MV);QQ.type=nz.sankey,QQ.transformerConstructor=ZQ,QQ.mark=qQ,QQ.builtInTheme={sankey:{link:{style:{fillOpacity:.15,round:!0}}}};var $Q=function(){DY(),iX(),hw(),Uz.registerGraphicComponent("path",(function(t){return bp(t)})),Uz.registerMark(XQ.type,XQ),kX(),Uz.registerAnimation("sankeyNode",(function(t,e){return Object.assign({appear:UQ(t,e)},uU)})),Uz.registerAnimation("sankeyLinkPath",(function(t,e){return{appear:VQ(e),enter:{type:"linkPathGrowIn"},exit:{type:"linkPathGrowOut"},disappear:{duration:sU.disappear.duration}}})),hP.registerBuiltInAnimate("linkPathGrowOut",GQ),hP.registerBuiltInAnimate("linkPathGrowIn",WQ),cU(),Uz.registerSeries(QQ.type,QQ)},t$=function(t,e){var i={},n=e.fields;if(A(n)&&(n=n()),!(null==n?void 0:n.length)||!(null==t?void 0:t.length))return i;if(!t[0].latestData)return i;var r=t[0].latestData,a=mQ(r);return i=WU([{latestData:a}],e)},e$=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).markTooltipKeyCallback=function(e){var i,n;return null===(n=null===(i=t.series)||void 0===i?void 0:i.getMarkData(e))||void 0===n?void 0:n[t.series.getDimensionField()[0]]},t.markTooltipValueCallback=function(e){var i,n,r=t._seriesCacheInfo.measureFields,a=null===(i=t.series)||void 0===i?void 0:i.getMarkData(e);if(r[0]&&a)return null!==(n=a[r[0]])&&void 0!==n?n:e.value},t.dimensionTooltipTitleCallback=function(e){var i,n=t._seriesCacheInfo.dimensionFields,r=null===(i=t.series)||void 0===i?void 0:i.getMarkData(e);if(n[0]&&r)return r[n[0]]},t}return h(e,t),a(e,[{key:"defaultShapeType",get:function(){return"square"}}])}(UU),i$=Object.assign(Object.assign({},tV),{nonLeaf:{name:"nonLeaf",type:"rect"},leaf:{name:"leaf",type:"rect"},nonLeafLabel:{name:"nonLeafLabel",type:"text"}}),n$=function(t){return"fadeIn"===t?{type:"fadeIn"}:{type:"growCenterIn"}},r$=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"nonLeaf","nonLeafLabel","initNonLeafLabelMarkStyle"),this._addMarkLabelSpec(t,"leaf")}}])}(gV),a$=function(t,e){var i=A(e)?e():e,n=i.getViewBox();if(n){var r=new tJ(i).layout(t,n),a=[];return xZ(r,a,{maxDepth:null==i?void 0:i.maxDepth}),a.forEach((function(t){t&&[XU,"name"].forEach((function(e){t[e]=t.datum[t.depth][i.nameField]}))})),a}return[]},o$=function(r){function o(){var t;return n(this,o),(t=i(this,o,arguments)).type=nz.treemap,t.transformerConstructor=r$,t._categoryField="name",t._valueField="value",t._viewBox=new ei,t._enableAnimationHook=t.enableMarkAnimation.bind(e(t)),t.isHierarchyData=function(){return!0},t}return h(o,r),a(o,[{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getValueField",value:function(){return this._valueField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"setAttrFromSpec",value:function(){var t,e=this;_(o,"setAttrFromSpec",this,3)([]),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:XU),this._spec.roam&&(this.initZoomable(this.event,this._option.mode),this._matrix=new ri),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:function(){var t,i;return null!==(i=null!==(t=e._spec.drillField)&&void 0!==t?t:e._categoryField)&&void 0!==i?i:yj},getRawData:function(){return e.getRawData()}}),F(this._spec.maxDepth)&&(this._maxDepth=this._spec.maxDepth-1)}},{key:"initData",value:function(){var t,e=this;_(o,"initData",this,3)([]),fH(this._dataSet,"treemap",a$),null===(t=this._data.getDataView())||void 0===t||t.transform({type:"treemap",options:function(){var t,i,n,r;return{nameField:e._categoryField,valueField:e._valueField,getViewBox:function(){return e._viewBox.empty()?null:{x0:e._viewBox.x1,x1:e._viewBox.x2,y0:e._viewBox.y1,y1:e._viewBox.y2}},maxDepth:e._maxDepth,gapWidth:e._spec.gapWidth,padding:e._spec.nodePadding,splitType:e._spec.splitType,aspectRatio:e._spec.aspectRatio,labelPadding:(null===(t=e._spec.nonLeafLabel)||void 0===t?void 0:t.visible)?null===(i=e._spec.nonLeafLabel)||void 0===i?void 0:i.padding:0,labelPosition:null===(n=e._spec.nonLeafLabel)||void 0===n?void 0:n.position,minVisibleArea:null!==(r=e._spec.minVisibleArea)&&void 0!==r?r:10,minChildrenVisibleArea:e._spec.minChildrenVisibleArea,minChildrenVisibleSize:e._spec.minChildrenVisibleSize}}}),this.getViewData()&&this._spec.drill&&this.initDrillableData(this._dataSet)}},{key:"_runTreemapTransform",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._data.getDataView().reRunAllTransform(),t&&this.getCompiler().renderNextTick()}},{key:"_addDataIndexAndKey",value:function(){var t;(null===(t=this._rawData)||void 0===t?void 0:t.dataSet)&&(fH(this._rawData.dataSet,"addVChartProperty",LU),this._rawData.transform({type:"addVChartProperty",options:{beforeCall:QU.bind(this),call:$U}}))}},{key:"getRawDataStatisticsByField",value:function(t,e){var i;if(this._rawStatisticsCache||(this._rawStatisticsCache={}),!this._rawStatisticsCache[t]&&this._rawData){var n=t$([this._rawData],{fields:[{key:t,operations:e?["min","max"]:["values"]}]})[t];this._rawStatisticsCache[t]=Q(null!==(i=this._rawStatisticsCache[t])&&void 0!==i?i:{},n)}return this._rawStatisticsCache[t]}},{key:"_createHierarchyDataStatistics",value:function(t,e){var i=this;fH(this._dataSet,"hierarchyDimensionStatistics",t$),fH(this._dataSet,"flatten",mQ);var n=new Ko(this._dataSet,{name:t});return n.parse(e,{type:"dataview"}),n.transform({type:"hierarchyDimensionStatistics",options:{fields:function(){var t=i.getStatisticFields();return i._seriesField&&i._seriesField!==i._categoryField&&t.push({key:i._seriesField,operations:["values"]}),t}}},!1),n}},{key:"getStatisticFields",value:function(){return AQ(_(o,"getStatisticFields",this,3)([]),this._categoryField,this._valueField)}},{key:"initMark",value:function(){var t=this,e=this._createMark(o.mark.nonLeaf,{isSeriesMark:!0});e&&(e.setTransform([{type:"filter",callback:function(e){return!t._shouldFilterElement(e,"nonLeaf")}}]),this._nonLeafMark=e);var i=this._createMark(o.mark.leaf,{isSeriesMark:!0});i&&(i.setTransform([{type:"filter",callback:function(e){return!t._shouldFilterElement(e,"leaf")}}]),this._leafMark=i)}},{key:"initMarkStyle",value:function(){this._initLeafMarkStyle(),this._initNonLeafMarkStyle()}},{key:"_initLeafMarkStyle",value:function(){this._leafMark&&this.setMarkStyle(this._leafMark,{x:function(t){return t.x0},y:function(t){return t.y0},x1:function(t){return t.x1},y1:function(t){return t.y1},fill:this.getColorAttribute()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"_initNonLeafMarkStyle",value:function(){this._nonLeafMark&&this.setMarkStyle(this._nonLeafMark,{x:function(t){return t.x0},y:function(t){return t.y0},x1:function(t){return t.x1},y1:function(t){return t.y1},fill:this.getColorAttribute()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"_initRichStyleOfLabelMark",value:function(e){"rich"===e.getTextType()&&this.setMarkStyle(e,{maxWidth:function(t){return Math.abs(t.x0-t.x1)},maxHeight:function(t){return Math.abs(t.y0-t.y1)},ellipsis:!0},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"initLabelMarkStyle",value:function(e){var i=this;e&&(this._labelMark=e,e.setRule("treemap"),this.setMarkStyle(e,{x:function(t){return(t.x0+t.x1)/2},y:function(t){return(t.y0+t.y1)/2},text:function(t){var e;return null===(e=t.datum[t.depth])||void 0===e?void 0:e[i.getDimensionField()[0]]},maxLineWidth:function(t){return t.x1===t.x0?Number.MIN_VALUE:t.x1-t.x0}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this._initRichStyleOfLabelMark(e))}},{key:"initNonLeafLabelMarkStyle",value:function(e){var i=this;e&&(this._nonLeafLabelMark=e,e.setRule("treemap"),this.setMarkStyle(e,{x:function(t){return t.labelRect?(t.labelRect.x0+t.labelRect.x1)/2:(t.x0+t.x1)/2},y:function(t){return t.labelRect?(t.labelRect.y0+t.labelRect.y1)/2:(t.y0+t.y1)/2},text:function(t){var e;return null===(e=t.datum[t.depth])||void 0===e?void 0:e[i.getDimensionField()[0]]},maxLineWidth:function(t){return t.x1===t.x0?Number.MIN_VALUE:t.x1-t.x0}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this._initRichStyleOfLabelMark(e))}},{key:"initAnimation",value:function(){var t=this;this.getMarksInType("rect").forEach((function(e){var i;e.setAnimationConfig(lV(null===(i=Uz.getAnimationInKey("treemap"))||void 0===i?void 0:i(),uV(e.name,t._spec,t._markAttributeContext)))}))}},{key:"initEvent",value:function(){var t=this;_(o,"initEvent",this,3)([]),this._spec.roam&&(this.initDragEventOfSeries(this),this.event.on("panmove",(function(e){t.handlePan(e)})),this.initZoomEventOfSeries(this),this.event.on("zoom",(function(e){t.handleZoom(e)}))),this._spec.drill&&this.bindDrillEvent()}},{key:"_getDataIdKey",value:function(){return"key"}},{key:"initTooltip",value:function(){this._tooltipHelper=new e$(this),this._leafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._leafMark),this._nonLeafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nonLeafMark)}},{key:"_shouldFilterElement",value:function(t,e){var i=t.isLeaf;return"leaf"===e?!i:i}},{key:"handlePan",value:function(t){var e=t.delta;if(0!==e[0]||0!==e[1]){this._matrix.reset(),this._matrix.translate(e[0],e[1]);var i=this._matrix,n=i.a,r=i.b,a=i.c,o=i.d,s=i.e,l=i.f;this._matrix.multiply(n,r,a,o,s,l),this._viewBox.transformWithMatrix(this._matrix),this._runTreemapTransform(!0)}}},{key:"handleZoom",value:function(t){var e=t.scale,i=t.scaleCenter;if(1!==e){this._matrix.reset();var n=i.x,r=i.y;this._matrix.translate(n,r),this._matrix.scale(e,e),this._matrix.translate(-n,-r);var a=this._matrix,o=a.a,s=a.b,l=a.c,u=a.d,h=a.e,c=a.f;this._matrix.multiply(o,s,l,u,h,c),this.disableMarkAnimation(),this.event.on(eH.AFTER_DO_RENDER,this._enableAnimationHook),this._viewBox.transformWithMatrix(this._matrix),this._runTreemapTransform(!0)}}},{key:"getDimensionField",value:function(){return[this._categoryField]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"onLayoutEnd",value:function(){_(o,"onLayoutEnd",this,3)([]),this._viewBox.set(0,0,this.getLayoutRect().width,this.getLayoutRect().height),this._runTreemapTransform()}},{key:"enableMarkAnimation",value:function(){this.getMarks().forEach((function(t){})),[this._labelMark,this._nonLeafLabelMark].forEach((function(t){t&&t.getComponent()&&t.getComponent().getProduct().enableAnimation()})),this.event.off(eH.AFTER_DO_RENDER,this._enableAnimationHook)}},{key:"disableMarkAnimation",value:function(){this.getMarks().forEach((function(t){})),[this._labelMark,this._nonLeafLabelMark].forEach((function(t){t&&t.getComponent()&&t.getComponent().getProduct().disableAnimation()}))}},{key:"getDefaultShapeType",value:function(){return"square"}},{key:"getActiveMarks",value:function(){return[this._nonLeafMark,this._leafMark]}},{key:"getMarkData",value:function(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}])}(MV);o$.type=nz.treemap,o$.mark=i$,o$.builtInTheme={treemap:{gapWidth:1,nodePadding:[5],nonLeaf:{visible:!1,style:{fillOpacity:.5}},label:{style:{fill:"white",textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}},nonLeafLabel:{padding:24,style:{fill:"black",stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},textBaseline:"middle",textAlign:"center"}}}},o$.transformerConstructor=r$,at(o$,xQ),at(o$,gK);var s$=function(){Uz.registerGrammarTransform("filter",{transform:function(t,e){return null==e?void 0:e.filter(t.callback)}}),Uz.registerGrammarTransform("map",{transform:function(t,e){return null==e||e.forEach((function(e,i){t.callback(e)})),e}}),DY(),kX(),Uz.registerAnimation("treemap",(function(t,e){return{appear:n$(e),enter:{type:"growCenterIn"},exit:{type:"growCenterOut"},disappear:{duration:sU.disappear.duration}}})),cU(),Uz.registerSeries(o$.type,o$)},l$=Object.assign(Object.assign({},Uq),{segment:{name:"segment",type:"arc"},track:{name:"track",type:"arc"}}),u$=Object.assign(Object.assign({},tV),{pin:{name:"pin",type:"path"},pinBackground:{name:"pinBackground",type:"path"},pointer:{name:"pointer",type:["path","rect"]}}),h$={type:"fadeIn"};function c$(t,e){return"fadeIn"===e?h$:function(t){return{channel:{angle:{from:t.startAngle+Math.PI/2}}}}(t)}var d$=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments))._supportStack=!1,t}return h(e,t),a(e)}(gV),v$=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"enableByType",value:function(t){return"dimension"!==t}}])}(UU),f$="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",p$={pointer:{type:"path",width:.4,height:.4,style:{path:"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"}},pin:{width:.025,height:.025,style:{path:f$,fill:"#888"}},pinBackground:{width:.06,height:.06,style:{path:f$,fill:"#ddd"}}},g$=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=nz.gaugePointer,t.transformerConstructor=d$,t._pinMark=null,t._pointerMark=null,t._pinBackgroundMark=null,t}return h(e,t),a(e,[{key:"setAttrFromSpec",value:function(){var t;_(e,"setAttrFromSpec",this,3)([]),this.setRadiusField(this._spec.radiusField),this._pointerType="rect"===(null===(t=this._spec.pointer)||void 0===t?void 0:t.type)?"rect":"path"}},{key:"initMark",value:function(){this._pinBackgroundMark=this._createMark(e.mark.pinBackground),this._pointerMark=this._createMark(Object.assign(Object.assign({},e.mark.pointer),{type:this._pointerType}),{isSeriesMark:!0}),this._pinMark=this._createMark(e.mark.pin)}},{key:"initMarkStyle",value:function(){this.initPinBackgroundMarkStyle(),this.initPointerMarkStyle(),this.initPinMarkStyle()}},{key:"initGroups",value:function(){}},{key:"initPointerMarkStyle",value:function(){var t=this,e=this._pointerMark,i=this._spec.pointer;e&&(this.setMarkStyle(e,{x:function(e){var n,r;return t._getPointerAnchor(e,i).x-t._getPointerWidth()*(null!==(r=null===(n=null==i?void 0:i.center)||void 0===n?void 0:n[0])&&void 0!==r?r:0)},y:function(e){var n,r;return t._getPointerAnchor(e,i).y-t._getPointerHeight(e)*(null!==(r=null===(n=null==i?void 0:i.center)||void 0===n?void 0:n[1])&&void 0!==r?r:0)},anchor:function(e){var n=t._getPointerAnchor(e,i);return[n.x,n.y]},fill:this.getColorAttribute(),zIndex:200}),"path"===this._pointerType?this.setMarkStyle(e,{scaleX:this._getPointerWidth.bind(this),scaleY:this._getPointerHeight.bind(this),angle:function(e){return t._getPointerAngle(e)+Math.PI/2}}):this.setMarkStyle(e,{width:this._getPointerWidth.bind(this),height:this._getPointerHeight.bind(this),angle:function(e){return t._getPointerAngle(e)-Math.PI/2}}))}},{key:"initTooltip",value:function(){this._tooltipHelper=new v$(this),this._pointerMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pointerMark)}},{key:"_getPointerAnchor",value:function(t,e){var i;return null===(i=e.isOnCenter)||void 0===i||i?this.angleAxisHelper.center():this.radiusAxisHelper.coordToPoint({radius:this._innerRadius*this._computeLayoutRadius(),angle:this.angleAxisHelper.dataToPosition([t[this._angleField[0]]])})}},{key:"_getPointerWidth",value:function(){return this._spec.pointer.width*this._computeLayoutRadius()}},{key:"_getPointerHeight",value:function(t){var e,i,n=this._spec.pointer,r=this._radiusField[0];return M(this.radiusAxisHelper)&&M(r)?this.radiusAxisHelper.dataToPosition([t[r]])-(null!==(e=null==n?void 0:n.innerPadding)&&void 0!==e?e:0)-(null!==(i=null==n?void 0:n.outerPadding)&&void 0!==i?i:10):n.height*this._computeLayoutRadius()}},{key:"_getPointerAngle",value:function(t){var e=this.angleAxisHelper.getScale().domain(),i=lt(e),n=ut(e),r=Pt(t[this._angleField[0]],n,i);return this.angleAxisHelper.dataToPosition([r])}},{key:"_getRotatedPointerCenterOffset",value:function(t){var e,i,n,r,a=this._spec.pointer,o=this._getPointerWidth()*(null!==(i=null===(e=null==a?void 0:a.center)||void 0===e?void 0:e[0])&&void 0!==i?i:0),s=-this._getPointerHeight(t)*(null!==(r=null===(n=null==a?void 0:a.center)||void 0===n?void 0:n[1])&&void 0!==r?r:0),l=this._getPointerAngle(t)-Math.PI/2,u=Math.cos(l),h=Math.sin(l);return{x:o*u+s*h,y:-(s*u-o*h)}}},{key:"initPinBackgroundMarkStyle",value:function(){var t=this,e=this._pinBackgroundMark,i=this._spec.pinBackground;e&&this.setMarkStyle(e,{x:function(e){return t._getPointerAnchor(e,i).x},y:function(e){return t._getPointerAnchor(e,i).y},scaleX:function(){return i.width*t._computeLayoutRadius()},scaleY:function(){return i.height*t._computeLayoutRadius()},fill:this.getColorAttribute(),zIndex:100})}},{key:"initPinMarkStyle",value:function(){var t=this,e=this._pinMark,i=this._spec.pin;e&&this.setMarkStyle(e,{x:function(e){return t._getPointerAnchor(e,i).x},y:function(e){return t._getPointerAnchor(e,i).y},scaleX:function(){return i.width*t._computeLayoutRadius()},scaleY:function(){return i.height*t._computeLayoutRadius()},fill:this.getColorAttribute(),zIndex:300})}},{key:"getInteractionTriggers",value:function(){return this._parseInteractionConfig(this._pointerMark?[this._pointerMark]:[])}},{key:"initAnimation",value:function(){var t,e,i,n=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._pointerMark.setAnimationConfig(lV(null===(i=Uz.getAnimationInKey("gaugePointer"))||void 0===i?void 0:i({startAngle:this._startAngle},n),uV("pointer",this._spec,this._markAttributeContext)))}},{key:"getDefaultShapeType",value:function(){return"circle"}},{key:"getActiveMarks",value:function(){return[]}}])}(Wq);g$.type=nz.gaugePointer,g$.mark=u$,g$.builtInTheme={gaugePointer:p$},g$.transformerConstructor=d$;var y$=function(){Uz.registerSeries(g$.type,g$),uK(),DY(),Uz.registerAnimation("gaugePointer",(function(t,e){var i=c$(t,e);return{appear:i,enter:i,disappear:{duration:sU.disappear.duration}}})),_q(),yq()},m$=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments))._supportStack=!1,t}return h(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"segment")}}])}(gV),_$=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=nz.gauge,t.transformerConstructor=m$,t._segmentMark=null,t._trackMark=null,t._padAngle=0,t}return h(r,e),a(r,[{key:"setAttrFromSpec",value:function(){var t;_(r,"setAttrFromSpec",this,3)([]),this._padAngle=be(null!==(t=this._spec.padAngle)&&void 0!==t?t:0)}},{key:"initData",value:function(){var t,e=this;_(r,"initData",this,3)([]),fH(this._option.dataSet,"spiltSegment",(function(t,i){var n=t.slice();return n.sort((function(t,i){return t[e._angleField[0]]-i[e._angleField[0]]})),n.forEach((function(t,i){t[Dj]=t[e._angleField[0]],t[Lj]=i>0?n[i-1][Dj]:void 0})),n})),null===(t=this.getViewData())||void 0===t||t.transform({type:"spiltSegment"},!1)}},{key:"initMark",value:function(){_(r,"initMark",this,3)([]),this._trackMark=this._createMark(r.mark.track,{parent:this._arcGroupMark,dataView:!1}),this._segmentMark=this._createMark(r.mark.segment,{parent:this._arcGroupMark,isSeriesMark:!0})}},{key:"initMarkStyle",value:function(){_(r,"initMarkStyle",this,3)([]),this.initTrackMarkStyle(),this.initSegmentMarkStyle()}},{key:"initSegmentMarkStyle",value:function(){var t,e=this,i=this._segmentMark;i&&this.setMarkStyle(i,{x:function(){return e.angleAxisHelper.center().x},y:function(){return e.angleAxisHelper.center().y},startAngle:this._getAngleValueStart.bind(this),endAngle:this._getAngleValueEnd.bind(this),innerRadius:function(){var t;return e._computeLayoutRadius()*(null!==(t=e._spec.innerRadius)&&void 0!==t?t:0)},outerRadius:function(){var t,i;return e._computeLayoutRadius()*(null!==(i=null!==(t=e._spec.radius)&&void 0!==t?t:e._spec.outerRadius)&&void 0!==i?i:1)},cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute(),zIndex:200,forceShowCap:!0})}},{key:"generateRadiusStyle",value:function(t){var e=this;if(t){var i={};return t.outerRadius&&(i.outerRadius=function(){return e._computeLayoutRadius()*t.outerRadius}),t.innerRadius&&(i.innerRadius=function(){return e._computeLayoutRadius()*t.innerRadius}),i}}},{key:"initMarkStyleWithSpec",value:function(e,i){if(_(r,"initMarkStyleWithSpec",this,3)([e,i]),e&&"segment"===e.name){var n=this.getSpec().segment;if(n)for(var a in n.state||{})this.setMarkStyle(e,this.generateRadiusStyle(n.state[a]),a,t.AttributeLevel.User_Mark)}}},{key:"initTooltip",value:function(){_(r,"initTooltip",this,3)([]),this._segmentMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._segmentMark)}},{key:"initTrackMarkStyle",value:function(){var t,e=this,i=this._trackMark;i&&this.setMarkStyle(i,{x:function(){return e.angleAxisHelper.center().x},y:function(){return e.angleAxisHelper.center().y},startAngle:this._startAngle,endAngle:this._endAngle,innerRadius:function(){var t;return e._computeLayoutRadius()*(null!==(t=e._spec.innerRadius)&&void 0!==t?t:0)},outerRadius:function(){var t,i;return e._computeLayoutRadius()*(null!==(i=null!==(t=e._spec.radius)&&void 0!==t?t:e._spec.outerRadius)&&void 0!==i?i:1)},cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,zIndex:100})}},{key:"_getAngleValueStartWithoutMask",value:function(t){var e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t),n=It(e,(e+i)/2)(e+(i>e?1:-1)*Math.abs(this._padAngle/2));return this._spec.clamp?xz(n,this.angleAxisHelper.getScale(0)):n}},{key:"_getAngleValueEndWithoutMask",value:function(t){var e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t),n=It(i,(e+i)/2)(i-(i>e?1:-1)*Math.abs(this._padAngle/2));return this._spec.clamp?xz(n,this.angleAxisHelper.getScale(0)):n}},{key:"_getAngleValueStartWithoutPadAngle",value:function(t){return M(t[Lj])?this.angleAxisHelper.dataToPosition([t[Lj]]):this._startAngle}},{key:"_getAngleValueEndWithoutPadAngle",value:function(t){return this.angleAxisHelper.dataToPosition([t[Dj]])}},{key:"initAnimation",value:function(){var t,e,i,n=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._segmentMark.setAnimationConfig(lV(null===(i=Uz.getAnimationInKey("circularProgress"))||void 0===i?void 0:i({startAngle:this._startAngle},n),uV("segment",this._spec,this._markAttributeContext)))}},{key:"getDefaultShapeType",value:function(){return"circle"}},{key:"getActiveMarks",value:function(){return[]}}])}(Wq);_$.type=nz.gauge,_$.mark=l$,_$.builtInTheme={gauge:{outerRadius:.8,innerRadius:.6,padAngle:1.146,segment:{style:{fillOpacity:1}},tickMask:{visible:!1,angle:3,offsetAngle:0,forceAlign:!0}}},_$.transformerConstructor=m$;var b$=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=e.type,t}return h(e,t),a(e,[{key:"_getDefaultStyle",value:function(){return Object.assign(Object.assign({},_(e,"_getDefaultStyle",this,3)([])),{fill:void 0,lineWidth:0,padding:0})}},{key:"_createGraphic",value:function(){return Of(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}},{key:"_transformGraphicAttributes",value:function(t,i,n){var r,a,o,s=_(e,"_transformGraphicAttributes",this,3)([t,i,n]),l=null!==(a=null!==(r=s.shape)&&void 0!==r?r:s.symbolType)&&void 0!==a?a:null===(o=t.attribute)||void 0===o?void 0:o.symbolType;return C(l)?s.symbolType="rect":s.symbolType=l,s}}])}($N);function k$(t){return!1===t?{}:{type:"fadeIn"}}b$.type="cell";var x$=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"enableByType",value:function(t){return"dimension"!==t}}])}(UU),S$=Object.assign(Object.assign({},tV),{cell:{name:"cell",type:"cell"},cellBackground:{name:"cellBackground",type:"cell"}}),A$=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"cell")}}])}(gV),C$={valueField:!0},M$=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=nz.heatmap,t.transformerConstructor=A$,t}return h(r,e),a(r,[{key:"getFieldValue",value:function(){return this._fieldValue}},{key:"setFieldValue",value:function(t){this._fieldValue=ot(t)}},{key:"_getSpecUpdatePolicy",value:function(){var t=_(r,"_getSpecUpdatePolicy",this,3)([]);return Object.assign(Object.assign({},t),{dataRelatedKeys:Object.assign(Object.assign({},t.dataRelatedKeys),C$)})}},{key:"setAttrFromSpec",value:function(){_(r,"setAttrFromSpec",this,3)([]),this.setFieldValue(this._spec.valueField)}},{key:"initMark",value:function(){this._cellMark=this._createMark(r.mark.cell,{isSeriesMark:!0},{morph:dV(this._spec,r.mark.cell.name),morphElementKey:this.getDimensionField()[0]}),this._backgroundMark=this._createMark(r.mark.cellBackground)}},{key:"initMarkStyle",value:function(){this.initCellMarkStyle(),this.initCellBackgroundMarkStyle()}},{key:"initLabelMarkStyle",value:function(t){var e,i,n,r=this;t&&this.setMarkStyle(t,{fill:null!==(n=null===(i=null===(e=this._spec.cell)||void 0===e?void 0:e.style)||void 0===i?void 0:i.fill)&&void 0!==n?n:this.getColorAttribute(),text:function(t){return t[r.getMeasureField()[0]]}})}},{key:"initCellMarkStyle",value:function(){var e=this;this.setMarkStyle(this._cellMark,{x:function(t){return e.dataToPositionX(t)},y:function(t){return e.dataToPositionY(t)},size:function(){return[e.getCellSize(e._xAxisHelper),e.getCellSize(e._yAxisHelper)]},fill:this.getColorAttribute()},"normal",t.AttributeLevel.Series)}},{key:"initCellBackgroundMarkStyle",value:function(){var e,i,n,r=this,a=bi(null!==(n=null===(i=null===(e=this._spec.cellBackground)||void 0===e?void 0:e.style)||void 0===i?void 0:i.padding)&&void 0!==n?n:0);this.setMarkStyle(this._backgroundMark,{x:function(t){var e=r.getCellSize(r._xAxisHelper);return r.dataToPositionX(t)-e/2+a[3]},y:function(t){var e=r.getCellSize(r._yAxisHelper);return r.dataToPositionY(t)-e/2+a[0]},width:function(){return r.getCellSize(r._xAxisHelper)-a[1]-a[3]},height:function(){return r.getCellSize(r._yAxisHelper)-a[0]-a[2]}},"normal",t.AttributeLevel.Series)}},{key:"getColorAttribute",value:function(){var t;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this._getDefaultColorScale(),field:this.getFieldValue()[0]}}},{key:"getInteractionTriggers",value:function(){return this._parseInteractionConfig(this._cellMark?[this._cellMark]:[])}},{key:"initAnimation",value:function(){var t,e,i,n=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset,r=CV(this);this._cellMark.setAnimationConfig(lV(null===(i=Uz.getAnimationInKey("heatmap"))||void 0===i?void 0:i(n),uV("cell",this._spec,this._markAttributeContext),r))}},{key:"getCellSize",value:function(t){var e,i;return null!==(i=null===(e=t.getBandwidth)||void 0===e?void 0:e.call(t,0))&&void 0!==i?i:6}},{key:"initTooltip",value:function(){this._tooltipHelper=new x$(this),this._cellMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._cellMark)}},{key:"getDefaultShapeType",value:function(){return"rect"}},{key:"getDimensionField",value:function(){return[].concat(this.fieldX,this.fieldY)}},{key:"getMeasureField",value:function(){return this.getFieldValue()}},{key:"getActiveMarks",value:function(){return[this._cellMark]}}])}(MV);M$.type=nz.heatmap,M$.mark=S$,M$.builtInTheme={heatmap:{cell:{style:{shape:"rect",fillOpacity:1}},cellBackground:{visible:!1},label:{style:{lineWidth:2}}}},M$.transformerConstructor=A$;var T$=function(){kX(),Uz.registerMark(b$.type,b$),Uz.registerGraphicComponent("symbol",Of),xw(),Aw(),bL(),Uz.registerAnimation("heatmap",(function(t,e){return Object.assign(Object.assign({},uU),{appear:k$(e)})})),uG(),aG(),Uz.registerSeries(M$.type,M$)},w$=Object.assign(Object.assign({},tV),{nodePoint:{name:"nodePoint",type:"symbol"},ripplePoint:{name:"ripplePoint",type:"ripple"},centerPoint:{name:"centerPoint",type:"symbol"},centerLabel:{name:"centerLabel",type:"text"}}),E$="".concat(dj,"_CORRELATION_X"),B$="".concat(dj,"_CORRELATION_Y"),P$="".concat(dj,"_CORRELATION_SIZE"),O$=function(t){return A(t)?t():t},I$=function(t,e){var i,n,r,a,o,l,u,h;if(!t||!(null==e?void 0:e.view)||!O(t))return t;var c=t,d=e.view();if(d.x1-d.x0==0||d.y1-d.y0==0||d.x1-d.x0==-1/0||d.x1-d.x0==1/0||d.y1-d.y0==-1/0||d.y1-d.y0==1/0)return t;var v=be(null!==(i=O$(e.startAngle))&&void 0!==i?i:-90),f=be(null!==(n=O$(e.endAngle))&&void 0!==n?n:270),p=Math.max((d.x1-d.x0)/2,(d.y1-d.y0)/2),g=Gt(null!==(r=O$(e.innerRadius))&&void 0!==r?r:0,p),y=Gt(O$(e.outerRadius),p),_=O$(e.center),b=[L(null==_?void 0:_[0])?_[0]:d.x0+Gt(null!==(a=null==_?void 0:_[0])&&void 0!==a?a:"50%",d.x1-d.x0),L(null==_?void 0:_[1])?_[1]:d.y0+Gt(null!==(o=null==_?void 0:_[1])&&void 0!==o?o:"50%",d.y1-d.y0)],k=Wt(O$(e.field)),x=c.map(k),S=m(Kt(x),2),A=S[0],M=S[1],T=A===M?function(t){return(g+y)/2}:function(t){return g+(y-g)*(t-A)/(M-A)},w=O$(e.radiusField),E=O$(e.radiusRange),B=C(w)?k:Wt(w),P=null!==(l=null==E?void 0:E[1])&&void 0!==l?l:5,I=function(t){return P};if(B){var R=m(B!==k?Kt(c.map(B)):[A,M],2),D=R[0],F=R[1],z=null!==(u=null==E?void 0:E[0])&&void 0!==u?u:5,j=null!==(h=null==E?void 0:E[1])&&void 0!==h?h:5;D!==F&&(I=function(t){return z+(j-z)*(B(t)-D)/(F-D)})}var H=Math.min(v,f),N=Math.max(v,f),U=R$(H,N,c.length),V=[],W=(N-H)/60;return c.forEach((function(t,e){for(var i,n,r=T(x[e]),a=I(t),o=U[e],l=0;l<60&&(i=b[0]+r*Math.cos(o),n=b[1]+r*Math.sin(o),L$({x:i,y:n,size:a},V)||i-a<d.x0||i+a>d.x1||n-a<d.y0||n+a>d.y1);l++)l<59&&((o+=W)>N?o=H:o<H&&(o=N));V.push(Object.assign(s(s(s({},E$,i),B$,n),P$,a),t))})),V},R$=function(t,e,i){for(var n=0,r=Math.max(Math.ceil(2*(e-t)/Math.PI),2),a=(e-t)/r,o=0,s=1,l=0,u=0,h=[],c=t;l<i;)u<r&&(h.push(c+(u%2?Math.floor(u/2)+Math.floor(r/2):u/2)*a*s),u++),l++,u===r&&(u=0,0===n?n=a/2:n/=2,c=-1==(s*=-1)?e-n:t+n,(o+=1)>=2&&(a/=2,r*=2));return h},L$=function(t,e){return!(!e||!e.length)&&e.some((function(e){var i=e.x,n=e.y,r=e.size;return Math.pow(t.x-i,2)+Math.pow(t.y-n,2)<Math.pow(t.size+r,2)}))},D$=function(t){return A(t)?t():t},F$=function(t,e){if(!t||!O(t))return[];var i=D$(e.keyword),n=D$(e.categoryField),r=t[0].latestData[0];return s(s(s({},n,i),gj,null==r?void 0:r[gj]),mj,null==r?void 0:r[mj])},z$=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=e.type,t._subMarks={ripple0:{type:"symbol",defaultAttributes:{fillOpacity:.75}},ripple1:{type:"symbol",defaultAttributes:{fillOpacity:.5}},ripple2:{type:"symbol",defaultAttributes:{fillOpacity:.25}}},t._positionChannels=["ripple","size"],t._positionEncoder=function(t,e,i){var n=t.ripple,r=void 0===n?i.attribute.ripple:n,a=t.size,o=void 0===a?i.attribute.size:a,s=Pt(r,0,1),l=.5*o;return{ripple0:{size:o+l*s,fillOpacity:.75-.25*s},ripple1:{size:o+l*(1+s),fillOpacity:.5-.25*s},ripple2:{size:o+l*(2+s),fillOpacity:.25-.25*s}}},t}return h(e,t),a(e,[{key:"_getDefaultStyle",value:function(){return Object.assign(Object.assign({},_(e,"_getDefaultStyle",this,3)([])),{x:0,y:0,ripple:0})}}])}(eX);z$.type="ripple";var j$=function(t,e){return"fadeIn"===e?{type:"fadeIn"}:{type:"scaleIn"}},H$=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"nodePoint"),this._addMarkLabelSpec(t,"centerPoint","centerLabel")}}])}(gV),N$=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=nz.correlation,t.transformerConstructor=H$,t._viewBox=new ei,t}return h(r,e),a(r,[{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getValueField",value:function(){return this._valueField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"getSeriesField",value:function(){return this._seriesField}},{key:"setSeriesField",value:function(t){M(t)&&(this._seriesField=t)}},{key:"getSizeField",value:function(){return this._sizeField}},{key:"setSizeField",value:function(t){M(t)&&(this._sizeField=t)}},{key:"getSizeRange",value:function(){return this._sizeRange}},{key:"setSizeRange",value:function(t){M(t)&&(this._sizeRange=t)}},{key:"setAttrFromSpec",value:function(){_(r,"setAttrFromSpec",this,3)([]),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)}},{key:"initData",value:function(){var t=this;if(_(r,"initData",this,3)([]),this._data){fH(this._dataSet,"correlation",I$);var e=new Yo;pH(e,"dataview",Vo),fH(e,"correlationCenter",F$);var i=new Ko(e,{name:"".concat(this.type,"_").concat(this.id,"_center")});i.parse([this.getViewData()],{type:"dataview"}),i.transform({type:"correlationCenter",options:{keyword:function(){var e,i,n;return null!==(n=null===(i=null===(e=t._spec.centerLabel)||void 0===e?void 0:e.style)||void 0===i?void 0:i.text)&&void 0!==n?n:""},categoryField:function(){return t._spec.categoryField}}}),this._centerSeriesData=new WN(this._option,i)}}},{key:"compileData",value:function(){var t;_(r,"compileData",this,3)([]),null===(t=this._centerSeriesData)||void 0===t||t.compile()}},{key:"_statisticViewData",value:function(){var t=this;_(r,"_statisticViewData",this,3)([]),this._data.getDataView().transform({type:"correlation",options:{view:function(){return{x0:t._viewBox.x1,x1:t._viewBox.x2,y0:t._viewBox.y1,y1:t._viewBox.y2}},field:function(){return t._spec.valueField},radiusRange:function(){return t._spec.sizeRange},radiusField:function(){return t._spec.sizeField},center:function(){return[t._spec.centerX,t._spec.centerY]},innerRadius:function(){return t._spec.innerRadius},outerRadius:function(){return t._spec.outerRadius},startAngle:function(){return t._spec.startAngle},endAngle:function(){return t._spec.endAngle}}})}},{key:"initMark",value:function(){var e=this._createMark(r.mark.nodePoint,{groupKey:this._seriesField,isSeriesMark:!0,key:gj});e&&(e.setMarkConfig({zIndex:t.LayoutZIndex.Node}),this._nodePointMark=e);var i=this._createMark(r.mark.ripplePoint,{key:gj,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId()});i&&(this._ripplePointMark=i);var n=this._createMark(r.mark.centerPoint,{key:gj,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId()});n&&(n.setMarkConfig({zIndex:t.LayoutZIndex.Node}),this._centerPointMark=n)}},{key:"initMarkStyle",value:function(){this._initNodePointMarkStyle(),this._initRipplePointMarkStyle(),this._initCenterPointMarkStyle()}},{key:"_initNodePointMarkStyle",value:function(){var e,i,n,r,a=this._nodePointMark;if(a){var o=null!==(i=null===(e=this._spec.nodePoint)||void 0===e?void 0:e.style)&&void 0!==i?i:{};this.setMarkStyle(a,{x:function(t){return t[E$]},y:function(t){return t[B$]},size:function(t){return t[P$]},fill:null!==(n=o.fill)&&void 0!==n?n:this.getColorAttribute(),fillOpacity:null!==(r=o.fillOpacity)&&void 0!==r?r:1,lineWidth:0},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}}},{key:"_initRipplePointMarkStyle",value:function(){var e,i,n,r,a,o=this,s=this._ripplePointMark;if(s){var l=null!==(i=null===(e=this._spec.ripplePoint)||void 0===e?void 0:e.style)&&void 0!==i?i:{};this.setMarkStyle(s,{x:function(){var t;return null!==(t=o._spec.centerX)&&void 0!==t?t:(o._viewBox.x1+o._viewBox.x2)/2},y:function(){var t;return null!==(t=o._spec.centerY)&&void 0!==t?t:(o._viewBox.y1+o._viewBox.y2)/2},size:function(){return Math.max(o._viewBox.x2-o._viewBox.x1,o._viewBox.y2-o._viewBox.y1)/2},fill:null!==(n=l.fill)&&void 0!==n?n:this.getColorAttribute(),opacity:null!==(r=l.fillOpacity)&&void 0!==r?r:.2,ripple:null!==(a=l.ripple)&&void 0!==a?a:0},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}}},{key:"_initCenterPointMarkStyle",value:function(){var e,i,n,r,a,o,s=this,l=this._centerPointMark;l&&this.setMarkStyle(l,{x:function(){var t;return null!==(t=s._spec.centerX)&&void 0!==t?t:(s._viewBox.x1+s._viewBox.x2)/2},y:function(){var t;return null!==(t=s._spec.centerY)&&void 0!==t?t:(s._viewBox.y1+s._viewBox.y2)/2},size:function(){return.2*Math.max(s._viewBox.x2-s._viewBox.x1,s._viewBox.y2-s._viewBox.y1)/2},fill:null!==(n=null===(i=null===(e=this._spec.centerPoint)||void 0===e?void 0:e.style)||void 0===i?void 0:i.fill)&&void 0!==n?n:this.getColorAttribute(),fillOpacity:null!==(o=null===(a=null===(r=this._spec.centerPoint)||void 0===r?void 0:r.style)||void 0===a?void 0:a.fillOpacity)&&void 0!==o?o:1},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"initTooltip",value:function(){_(r,"initTooltip",this,3)([]),this._nodePointMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nodePointMark)}},{key:"initLabelMarkStyle",value:function(e){var i=this;e&&this.setMarkStyle(e,{fill:this.getColorAttribute(),text:function(t){return t[i._categoryField]},z:this.dataToPositionZ.bind(this)},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"initAnimation",value:function(){var t,e,i=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;this._nodePointMark.setAnimationConfig(lV(null===(e=Uz.getAnimationInKey("correlation"))||void 0===e?void 0:e({},i),uV("nodePoint",this._spec,this._markAttributeContext)))}},{key:"getGroupFields",value:function(){return[]}},{key:"getStackGroupFields",value:function(){return[]}},{key:"getStackValueField",value:function(){return""}},{key:"getActiveMarks",value:function(){return[this._nodePointMark,this._centerPointMark]}},{key:"getDimensionField",value:function(){return[this._categoryField]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"onLayoutEnd",value:function(){_(r,"onLayoutEnd",this,3)([]),this._viewBox.set(0,0,this._region.getLayoutRect().width,this._region.getLayoutRect().height),this._rawData.reRunAllTransform(),this.getViewData().reRunAllTransform()}}])}(DX);N$.type=nz.correlation,N$.mark=w$,N$.builtInTheme={correlation:{centerLabel:{visible:!0,position:"center",style:{fill:"#fff",text:""}},label:{visible:!0,position:"bottom",style:{fill:"#000"}}}},N$.transformerConstructor=H$;var U$=function(){$V(),iX(),Aw(),Uz.registerMark(z$.type,z$),Uz.registerGraphicComponent("symbol",(function(t){return Of(t)})),Uz.registerSeries(N$.type,N$),Uz.registerAnimation("correlation",(function(t,e){return Object.assign({appear:j$(0,e)},lU)}))},V$=Object.assign(Object.assign({},tV),{liquidGroup:{name:"liquidGroup",type:"group"},liquid:{name:"liquid",type:"liquid"},liquidBackground:{name:"liquidBackground",type:"group"},liquidOutline:{name:"liquidOutline",type:"group"}}),W$=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=e.type,t._subMarks={wave0:{type:"area",defaultAttributes:{curveType:"monotoneX",fillOpacity:1}},wave1:{type:"area",defaultAttributes:{curveType:"monotoneX",fillOpacity:.66}},wave2:{type:"area",defaultAttributes:{curveType:"monotoneX",fillOpacity:.33}}},t._positionChannels=["wave","y","height"],t._positionEncoder=function(t,e,i){for(var n=t.wave,r=void 0===n?i.attribute.wave:n,a=t.y,o=void 0===a?i.attribute.y:a,s=t.height,l=void 0===s?i.attribute.height:s,u=[],h=[],c=[],d=0;d<21;d++){var v=50*d-500,f=o+(d%2==0?20:0),p=o+l;u.push({x:v+100*r,y:f,y1:p}),h.push({x:v+200*r-40,y:f,y1:p}),c.push({x:v+300*r-20,y:f,y1:p})}return{wave0:{x:0,y:0,points:u},wave1:{x:0,y:0,points:h},wave2:{x:0,y:0,points:c}}},t}return h(e,t),a(e,[{key:"_getDefaultStyle",value:function(){return Object.assign(Object.assign({},_(e,"_getDefaultStyle",this,3)([])),{wave:0})}}])}(eX);W$.type="liquid";var G$=function(t,e){return"drop"===t?function(t,e,i){var n=4*i/3,r=Math.max(n,2*i),a=n/2,o=t,s=a+e-r/2,l=Math.asin(a/(.85*(r-a))),u=Math.sin(l)*a,h=Math.cos(l)*a,c=o-h,d=s+u,v=t,f=s+a/Math.sin(l);return"\n M ".concat(c," ").concat(d,"\n A ").concat(a," ").concat(a," 0 1 1 ").concat(c+2*h," ").concat(d,"\n Q ").concat(v," ").concat(f," ").concat(t," ").concat(e+r/2,"\n Q ").concat(v," ").concat(f," ").concat(c," ").concat(d,"\n Z \n ")}(0,0,e):t},Y$=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).markTooltipKeyCallback=function(e){return t.series.getValueField()},t.markTooltipValueCallback=function(e){return e[t.series.getValueField()]},t.shapeStrokeCallback=function(e){return t.series.getMarkInName("liquid").getAttribute("fill",e)},t}return h(e,t),a(e)}(UU),K$=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=nz.liquid,t.transformerConstructor=tW,t._liquidBackgroundMark=null,t._liquidOutlineMark=null,t._getLiquidPosY=function(){var e=t._getLiquidBackPosAndSize(),i=e.height,n=e.startY;return(t._reverse?i*t._heightRatio:i*(1-t._heightRatio))+n},t._getLiquidHeight=function(){return t._getLiquidBackPosAndSize().height*t._heightRatio},t._getLiquidBackPosAndSize=function(){var e,i,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=t._marginSpec,a=r.top,o=void 0===a?0:a,s=r.bottom,l=void 0===s?0:s,u=r.left,h=void 0===u?0:u,c=r.right,d=void 0===c?0:c,v=n?{}:t._paddingSpec,f=v.top,p=void 0===f?0:f,g=v.bottom,y=void 0===g?0:g,m=v.left,_=void 0===m?0:m,b=v.right,k=void 0===b?0:b;"triangle"===t._maskShape&&(l/=Math.sqrt(3),o=o/Math.sqrt(3)*2,y/=Math.sqrt(3),p=p/Math.sqrt(3)*2);var x=null!==(i=null===(e=t._region)||void 0===e?void 0:e.getLayoutRect())&&void 0!==i?i:{width:0,height:0},S=x.width,A=x.height,C=S/2+(h+_-(d+k))/2,M=A/2+(o+p-(l+y))/2,T=S-(h+d+_+k),w=A-(o+l+p+y),E=Math.min(T,w);return"rect"!==t._maskShape&&(T=E,w=E),{x:C,y:M,size:E,width:T,height:w,startX:C-T/2,startY:M-w/2,endX:C+T/2,endY:M+w/2}},t._getLiquidBackPath=function(){var e,i,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if("rect"===t._maskShape){var r=t._getLiquidBackPosAndSize(n),a=r.x,o=r.y,s=r.width,l=r.height;i=jf({x:a-s/2,y:o-l/2,width:s,height:l,fill:!0})}else{var u=t._getLiquidBackPosAndSize(n),h=u.x,c=u.y,d=u.size;i=Of({x:h,y:c,size:d,symbolType:G$(null!==(e=t._spec.maskShape)&&void 0!==e?e:"circle",d),fill:!0})}return[i]},t}return h(r,e),a(r,[{key:"setValueField",value:function(t){M(t)&&(this._valueField=t)}},{key:"getValueField",value:function(){return this._valueField}},{key:"setAttrFromSpec",value:function(){var t,e;_(r,"setAttrFromSpec",this,3)([]),this._marginSpec=Pz(this._spec.outlineMargin),this._paddingSpec=Pz(this._spec.outlinePadding),this.setValueField(this._spec.valueField),this._reverse=null!==(t=this._spec.reverse)&&void 0!==t&&t,this._maskShape=null!==(e=this._spec.maskShape)&&void 0!==e?e:"circle"}},{key:"viewDataUpdate",value:function(t){var e=this;_(r,"viewDataUpdate",this,3)([t]),this._heightRatio=ae.apply(void 0,b(this._data.getLatestData().map((function(t){return t[e._valueField]}))))}},{key:"initMark",value:function(){this._initLiquidOutlineMark(),this._initLiquidBackgroundMark(),this._initLiquidMark()}},{key:"initMarkStyle",value:function(){this._initLiquidOutlineMarkStyle(),this._initLiquidBackgroundMarkStyle(),this._initLiquidMarkStyle()}},{key:"_initLiquidOutlineMark",value:function(){return this._liquidOutlineMark=this._createMark(r.mark.liquidOutline,{isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidOutlineMark}},{key:"_initLiquidBackgroundMark",value:function(){return this._liquidBackgroundMark=this._createMark(r.mark.liquidBackground,{isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidBackgroundMark}},{key:"_initLiquidMark",value:function(){return this._liquidGroupMark=this._createMark(r.mark.liquidGroup,{parent:this._liquidBackgroundMark,isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidMark=this._createMark(r.mark.liquid,{parent:this._liquidGroupMark,isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidMark}},{key:"_buildMarkAttributeContext",value:function(){_(r,"_buildMarkAttributeContext",this,3)([]),this._markAttributeContext.getLiquidBackPosAndSize=this._getLiquidBackPosAndSize,this._markAttributeContext.getLiquidPosY=this._getLiquidPosY,this._markAttributeContext.getLiquidHeight=this._getLiquidHeight}},{key:"_initLiquidOutlineMarkStyle",value:function(){var e=this,i=this._liquidOutlineMark;i.created(),this.setMarkStyle(i,{stroke:this.getColorAttribute(),width:function(){return e._region.getLayoutRect().width},height:function(){return e._region.getLayoutRect().height},path:function(){return e._getLiquidBackPath(!0)}},"normal",t.AttributeLevel.Series),this._liquidOutlineMark.setMarkConfig({interactive:!1,zIndex:this.layoutZIndex})}},{key:"_initLiquidBackgroundMarkStyle",value:function(){var e=this,i=this._liquidBackgroundMark;i.created(),this.setMarkStyle(i,{width:function(){return e._region.getLayoutRect().width},height:function(){return e._region.getLayoutRect().height},path:function(){return e._getLiquidBackPath()}},"normal",t.AttributeLevel.Series),this._liquidBackgroundMark.setMarkConfig({interactive:!1,zIndex:this.layoutZIndex,clip:!0})}},{key:"_initLiquidMarkStyle",value:function(){var e=this,i=this._liquidMark,n=this._liquidGroupMark;n&&this.setMarkStyle(n,{x:function(){return e._region.getLayoutStartPoint().x+e._region.getLayoutRect().width/2},angle:this._reverse?-Math.PI:0,y:0,dy:this._getLiquidPosY}),i&&this.setMarkStyle(i,{y:0,dy:0,height:this._getLiquidHeight,fill:this.getColorAttribute(),wave:0},"normal",t.AttributeLevel.Series)}},{key:"initTooltip",value:function(){this._tooltipHelper=new Y$(this),this._liquidMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._liquidMark)}},{key:"getInteractionTriggers",value:function(){return this._parseInteractionConfig(this._liquidMark?[this._liquidMark]:[])}},{key:"initAnimation",value:function(){var t,e,i,n,r=this,a={height:{from:0,to:function(){return r._getLiquidHeight()}},dy:{from:function(){var t=r._getLiquidBackPosAndSize(),e=t.height,i=t.startY;return(r._reverse?0:e)+i}}},o=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._liquidMark.setAnimationConfig(lV(null===(i=Uz.getAnimationInKey("liquid"))||void 0===i?void 0:i(a,o),uV("liquid",this._spec,this._markAttributeContext))),this._liquidGroupMark.setAnimationConfig(lV(null===(n=Uz.getAnimationInKey("liquidGroup"))||void 0===n?void 0:n(a,o),uV("liquidGroup",this._spec,this._markAttributeContext)))}},{key:"initEvent",value:function(){var e=this;_(r,"initEvent",this,3)([]),this._spec.indicatorSmartInvert&&this._option.getChart().getComponentsByKey("indicator")&&this.event.on(t.ChartEvent.renderFinished,(function(){e._option.getChart().getComponentsByKey("indicator").forEach((function(t){var i,n,r,a=null===(i=e._liquidMark.getGraphics()[0].getSubGraphic())||void 0===i?void 0:i[0],o=a.globalAABBBounds,s=o.y1,l=o.y2;s+=e._region.getLayoutStartPoint().y,l+=e._region.getLayoutStartPoint().y,null===(r=null===(n=null==t?void 0:t.getIndicatorComponent())||void 0===n?void 0:n.getChildren()[0])||void 0===r||r.getChildren().forEach((function(t){var e=t.globalAABBBounds,i=e.y1,n=e.y2;if(s<i&&l>n){var r=Zw(t.attribute.fill,a.attribute.fill);t.setAttribute("fill",r)}}))}))}))}},{key:"dataToPosition",value:function(t){return null}},{key:"dataToPositionX",value:function(t){return null}},{key:"dataToPositionY",value:function(t){return null}},{key:"valueToPosition",value:function(t,e){return null}},{key:"getStatisticFields",value:function(){return[]}},{key:"getGroupFields",value:function(){return[]}},{key:"getStackGroupFields",value:function(){return[]}},{key:"getStackValueField",value:function(){return""}},{key:"getActiveMarks",value:function(){return[this._liquidMark]}}])}(SV);K$.type=nz.liquid,K$.mark=V$,K$.builtInTheme={liquid:{outlinePadding:10,liquidBackground:{style:{lineWidth:0,fillOpacity:.2}},liquidOutline:{style:{lineWidth:2}}}},K$.transformerConstructor=tW;var X$=function(t){return ot(t).join(",")},q$=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).dimensionTooltipTitleCallback=function(e){return X$(null==e?void 0:e[t.series.getDimensionField()[0]])},t.markTooltipKeyCallback=function(e){return X$(null==e?void 0:e[t.series.getDimensionField()[0]])},t}return h(e,t),a(e)}(UU),Z$=Object.assign(Object.assign({},tV),{circle:{name:"circle",type:"arc"},overlap:{name:"overlap",type:"path"},overlapLabel:{name:"overlapLabel",type:"text"}}),J$=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"circle"),this._addMarkLabelSpec(t,"overlap","overlapLabel","initOverlapLabelMarkStyle")}}])}(gV),Q$=function(t,e){var i=A(e)?e():e,n=i.getViewBox();return n&&(null==t?void 0:t.length)?dJ(Object.assign({setField:i.setField,valueField:i.valueField},n),t):[]},$$=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=nz.venn,t.transformerConstructor=J$,t._viewBox=new ei,t}return h(r,e),a(r,[{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getValueField",value:function(){return this._valueField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"setAttrFromSpec",value:function(){var t,e,i;_(r,"setAttrFromSpec",this,3)([]),this.setCategoryField(null!==(t=this._spec.categoryField)&&void 0!==t?t:"sets"),this.setValueField(null!==(e=this._spec.valueField)&&void 0!==e?e:"size"),this.setSeriesField(null!==(i=this._spec.seriesField)&&void 0!==i?i:yj)}},{key:"initData",value:function(){var t,e=this;_(r,"initData",this,3)([]),fH(this._dataSet,"venn",Q$),null===(t=this._data.getDataView())||void 0===t||t.transform({type:"venn",options:function(){return{getViewBox:function(){return e._viewBox.empty()?null:{x0:e._viewBox.x1,x1:e._viewBox.x2,y0:e._viewBox.y1,y1:e._viewBox.y2}},setField:e._categoryField,valueField:e._valueField}}})}},{key:"compile",value:function(){_(r,"compile",this,3)([]),this._runVennTransform()}},{key:"_runVennTransform",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._data.getDataView().reRunAllTransform(),t&&this.getCompiler().renderNextTick()}},{key:"initMark",value:function(){var t=this._createMark(r.mark.circle,{isSeriesMark:!0});t&&(t.setTransform([{type:"vennMark",datumType:"circle"}]),this._circleMark=t);var e=this._createMark(r.mark.overlap,{isSeriesMark:!0});e&&(e.setTransform([{type:"vennMark",datumType:"overlap"}]),this._overlapMark=e)}},{key:"initMarkStyle",value:function(){this._initCircleMarkStyle(),this._initOverlapMarkStyle()}},{key:"_initCircleMarkStyle",value:function(){this._circleMark&&this.setMarkStyle(this._circleMark,{x:function(t){return t.x},y:function(t){return t.y},innerRadius:0,outerRadius:function(t){return t.radius},startAngle:0,endAngle:2*Math.PI,fill:this.getColorAttribute(),stroke:this.getColorAttribute()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"_initOverlapMarkStyle",value:function(){this._overlapMark&&(this.setMarkStyle(this._overlapMark,{x:function(t){return t.x},y:function(t){return t.y},path:function(t){return t.path},arcs:function(t){return t.arcs},fill:this.getColorAttribute(),stroke:this.getColorAttribute(),zIndex:function(t){return 100*t.sets.length}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this.setMarkStyle(this._overlapMark,{zIndex:function(t){return 100*t.sets.length+1}},t.STATE_VALUE_ENUM.STATE_HOVER,t.AttributeLevel.Series))}},{key:"initLabelMarkStyle",value:function(e){e&&(this._labelMark=e,e.setRule("venn"),this.setMarkStyle(e,{x:function(t){return t.labelX},y:function(t){return t.labelY},text:function(t){return X$(t.sets)},maxLineWidth:function(t){var e=t.x,i=t.radius,n=t.labelX,r=e-i,a=e+i;return Math.min(n-r,a-n)}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series))}},{key:"initOverlapLabelMarkStyle",value:function(e){e&&(this._labelMark=e,e.setRule("venn"),this.setMarkStyle(e,{x:function(t){return t.labelX},y:function(t){return t.labelY},text:function(t){return X$(t.sets)}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series))}},{key:"initTooltip",value:function(){this._tooltipHelper=new q$(this),this._circleMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._circleMark),this._overlapMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._overlapMark)}},{key:"getDimensionField",value:function(){return[this._categoryField]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"onLayoutEnd",value:function(){_(r,"onLayoutEnd",this,3)([]),this._viewBox.set(0,0,this.getLayoutRect().width,this.getLayoutRect().height),this._runVennTransform()}},{key:"getDefaultShapeType",value:function(){return"circle"}},{key:"getActiveMarks",value:function(){return[this._circleMark,this._overlapMark]}},{key:"getStatisticFields",value:function(){var t=[];return t.push({key:this._categoryField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}},{key:"getGroupFields",value:function(){return null}},{key:"dataToPosition",value:function(t,e){return{x:t.x,y:t.y}}},{key:"dataToPositionX",value:function(t){return t.x}},{key:"dataToPositionY",value:function(t){return t.y}},{key:"valueToPosition",value:function(t,e){throw new Error("Method not implemented.")}},{key:"getStackGroupFields",value:function(){return[]}},{key:"getStackValueField",value:function(){return null}},{key:"_getSeriesInfo",value:function(t,e){var i=this,n=this.getDefaultShapeType();return e.map((function(e){return{key:X$(e),originalKey:e,style:i.getSeriesStyle(s({},t,e)),shapeType:n}}))}},{key:"getSeriesFieldValue",value:function(t,e){var i=_(r,"getSeriesFieldValue",this,3)([t,e]);return X$(i)}},{key:"legendSelectedFilter",value:function(t,e){if(t.type===c.discreteLegend){var i=t.getLegendDefaultData(!0);if(0===e.length&&i.length)return[];if(e.length===i.length)return e;var n={};e.forEach((function(t){n[t]=!0}));var r=i.filter((function(t){return!n[X$(t)]})),a=i.filter((function(t){return!r.includes(t)&&r.some((function(e){return ot(e).every((function(e){return t.includes(e)}))}))}));e=e.slice(),a.forEach((function(t){e.splice(e.indexOf(X$(t)),1)}))}return e}},{key:"initAnimation",value:function(){var t=this;this.getMarksInType("arc").forEach((function(e){var i;e.setAnimationConfig(lV(null===(i=Uz.getAnimationInKey("vennCircle"))||void 0===i?void 0:i(),uV(e.name,t._spec,t._markAttributeContext)))})),this.getMarksInType("path").forEach((function(e){var i;e.setAnimationConfig(lV(null===(i=Uz.getAnimationInKey("vennOverlap"))||void 0===i?void 0:i(),uV(e.name,t._spec,t._markAttributeContext)))}))}}])}(SV);$$.type=nz.venn,$$.mark=Z$,$$.builtInTheme={venn:{circle:{style:{opacity:.8},state:{hover:{opacity:1}}},overlap:{style:{opacity:.8},state:{hover:{opacity:1,stroke:"white",lineWidth:2}}},label:{visible:!0,style:{fill:"white",textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"}}},overlapLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}}},$$.transformerConstructor=J$;var t0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=nz.mosaic,t.transformerConstructor=HY,t}return h(e,t),a(e,[{key:"bandWidthField",get:function(){return this._bandWidthField}},{key:"getStack",value:function(){return!0}},{key:"getPercent",value:function(){return this._spec.percent}},{key:"getGroupFields",value:function(){return"vertical"===this.direction?this._specXField:this._specYField}},{key:"setAttrFromSpec",value:function(){_(e,"setAttrFromSpec",this,3)([]);var t=this.getPercent();"horizontal"===this.direction?(t&&(this.setFieldX(Oj),this.setFieldX2(Pj)),this.setFieldY(Rj),this.setFieldY2(Ij)):(t&&(this.setFieldY(Oj),this.setFieldY2(Pj)),this.setFieldX(Rj),this.setFieldX2(Ij)),this._spec.bandWidthField&&(this._bandWidthField=this._spec.bandWidthField)}},{key:"parseLabelStyle",value:function(t,e){if((null==e?void 0:e.filterByGroup)&&C(t.dataFilter)){var i=this.getGroupFields(),n=e.filterByGroup,r=n.field,a=n.type,o=void 0===a?"max":a,s=n.filter;delete t.filterField;var l=i.indexOf(r);if(l<0)return;var u=l%2?"min"===o?"horizontal"===this.direction?this._fieldY2:this._fieldX2:"horizontal"===this.direction?this._fieldY:this._fieldX:"min"===o?"horizontal"===this.direction?this._fieldX2:this._fieldY2:"horizontal"===this.direction?this._fieldX:this._fieldY,h="min"===o?function(t,e){var i,n;return(null===(i=t.data)||void 0===i?void 0:i[u])<(null===(n=e.data)||void 0===n?void 0:n[u])}:function(t,e){var i,n;return(null===(i=t.data)||void 0===i?void 0:i[u])>(null===(n=e.data)||void 0===n?void 0:n[u])};t.dataFilter=function(t){var e={};return t.forEach((function(t){var i=t.data,n=null==i?void 0:i[r];C(n)||s&&!s(t)||e[n]&&!h(t,e[n])||(e[n]=t)})),t.filter((function(t){var i,n=null===(i=t.data)||void 0===i?void 0:i[r];return e[n]&&e[n]===t}))}}return t}}])}(UY);t0.type=nz.mosaic,t0.builtInTheme={mosaic:{label:{visible:!1,position:"center",style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},bar:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}}}},t0.transformerConstructor=HY;var e0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_isValidSeries",value:function(t){return t===nz.map}},{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["type","nameField","valueField","map","nameProperty","centroidProperty","nameMap","area","defaultFillColor","showDefaultName"]])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),t.region.forEach((function(t){t.coordinate="geo"})),_(e,"transformSeriesSpec",this,3)([t])}}])}(LG),i0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=e0,t.type="map",t.seriesType=nz.map,t}return h(e,t),a(e)}(OG);i0.type="map",i0.seriesType=nz.map,i0.transformerConstructor=e0;var n0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_isValidSeries",value:function(t){return!this.seriesType||t===this.seriesType}},{key:"getIndicatorSpec",value:function(t){var e,i,n,r=ot(t.indicator),a=null!==(e=t.innerRadius)&&void 0!==e?e:null===(n=null===(i=t.series)||void 0===i?void 0:i[0])||void 0===n?void 0:n.innerRadius;return M(a)&&r.forEach((function(t){C(t.limitRatio)&&(t.limitRatio=a)})),r}},{key:"_getDefaultSeriesSpec",value:function(t,i){return _(e,"_getDefaultSeriesSpec",this,3)([t,["radius","outerRadius","innerRadius","startAngle","endAngle","centerX","centerY","sortDataByAxis"],i])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),O(t.dataZoom)&&t.dataZoom.length>0&&t.dataZoom.forEach((function(t){"axis"===t.filterMode&&(t.filterMode="filter")})),this.transformSeriesSpec(t),M(t.indicator)&&(t.indicator=this.getIndicatorSpec(t))}}])}(LG),r0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"needAxes",value:function(){return!1}},{key:"_getDefaultSeriesSpec",value:function(t){var i=_(e,"_getDefaultSeriesSpec",this,3)([t,["startAngle","endAngle","centerX","centerY","clamp"]]);return i.categoryField=t.categoryField||t.radiusField,i.valueField=t.valueField||t.angleField,i}},{key:"_transformProgressAxisSpec",value:function(t,e,i,n,r){var a,o;t.axes||(t.axes=[]);var s=(null!==(a=t.axes)&&void 0!==a?a:[]).find((function(t){return"radius"===t.orient})),l=(null!==(o=t.axes)&&void 0!==o?o:[]).find((function(t){return"angle"===t.orient}));l||(l=e,t.axes.push(l)),s||(s=i,t.axes.push(s)),C(l.type)&&(l.type="linear"),C(s.type)&&(s.type="band");var u=dW(l,{min:0,max:1});C(l.min)&&(l.min=u.min),C(l.max)&&(l.max=u.max),n&&Object.assign(l,Nz({},n,l)),r&&Object.assign(s,Nz({},r,s))}}])}(n0),a0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"needAxes",value:function(){return!0}},{key:"_getDefaultSeriesSpec",value:function(t){var i=_(e,"_getDefaultSeriesSpec",this,3)([t]);return i.categoryField=t.categoryField||t.angleField,i.valueField=t.valueField||t.radiusField,i}},{key:"transformSpec",value:function(t){var i;if(_(e,"transformSpec",this,3)([t]),this.needAxes()){t.axes||(t.axes=[]);var n={radius:!1,angle:!1};(null!==(i=t.axes)&&void 0!==i?i:[]).forEach((function(t){var e=t.orient;"radius"===e&&(n.radius=!0),"angle"===e&&(n.angle=!0)})),n.angle||t.axes.push({orient:"angle"}),n.radius||t.axes.push({orient:"radius"})}}}])}(n0),o0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"needAxes",value:function(){return!1}},{key:"_getDefaultSeriesSpec",value:function(t){var i,n=_(e,"_getDefaultSeriesSpec",this,3)([t,["center","centerOffset","cornerRadius","padAngle","minAngle","emptyPlaceholder","showAllZero","supportNegative","useSequentialAnimation","layoutRadius"]]);return this._addSeriesRelatedSpecKeys(["valueField","angleField"]),n.categoryField=t.categoryField||t.seriesField,n.valueField=t.valueField||t.angleField,n.emptyCircle=null===(i=t.emptyPlaceholder)||void 0===i?void 0:i.emptyCircle,n}}])}(n0),s0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=o0,t}return h(e,t),a(e)}(OG);s0.transformerConstructor=o0;var l0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=o0,t.type="pie",t.seriesType=nz.pie,t}return h(e,t),a(e)}(s0);l0.type="pie",l0.seriesType=nz.pie,l0.transformerConstructor=o0;var u0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i,n,r,a=_(e,"_getDefaultSeriesSpec",this,3)([t]);return this._addSeriesRelatedSpecKeys(["radius","outerRadius","innerRadius"]),a.radius=null!==(i=t.radius)&&void 0!==i?i:wW,a.outerRadius=null!==(n=t.outerRadius)&&void 0!==n?n:wW,a.innerRadius=null!==(r=t.innerRadius)&&void 0!==r?r:0,a.stack=t.stack,a.percent=t.percent,a}},{key:"transformSpec",value:function(t){var i;_(e,"transformSpec",this,3)([t]),(null!==(i=t.axes)&&void 0!==i?i:[]).forEach((function(t){["domainLine","grid","label","tick"].forEach((function(e){t[e]||(t[e]={visible:!1})})),"angle"===t.orient&&C(t.bandPosition)&&(t.bandPosition=.5)})),t.crosshair=ot(t.crosshair||{}).map((function(t){return Nz({categoryField:{visible:!0,line:{visible:!0,type:"rect"}}},t)}))}}])}(a0),h0=function(t,e){if(!t)return null;var i=NV(t,(function(t){return"angle"===t.getOrient()}),e),n=NV(t,(function(t){return"radius"===t.getOrient()}),e);if(!(i&&i.length||n&&n.length))return null;var r=[],a=function(t){return t.getDimensionField()[0]},o=e.x,s=e.y;return i&&i.forEach((function(t){var e,i=t.getScale();if(i&&FI(i.type)){var l=i.domain(),u=i.range(),h=t.getCenter(),c={x:o-t.getLayoutStartPoint().x-h.x,y:s-t.getLayoutStartPoint().y-h.y},d=JF({x:1,y:0},c);d=function(t,e){var i=2*Math.PI,n=ut(e),r=lt(e);return t<n?t+=Math.ceil((n-t)/i)*i:t>r&&(t-=Math.ceil((t-r)/i)*i),t}(d,u);var v=QF(c),f=null===(e=n[0])||void 0===e?void 0:e.getScale(),p=null==f?void 0:f.range();if((d-(null==u?void 0:u[0]))*(d-(null==u?void 0:u[1]))>0||(v-(null==p?void 0:p[0]))*(v-(null==p?void 0:p[1]))>0)return;var g=t.invert(d);if(C(g))return;var y=l.findIndex((function(t){return(null==t?void 0:t.toString())===g.toString()}));y<0&&(y=void 0);var m=jV(g,t,"polar",a);r.push({index:y,value:g,position:i.scale(g),axis:t,data:m})}})),n&&n.forEach((function(t){var e,n=t.getScale(),l=null==n?void 0:n.range();if(n&&FI(n.type)){var u=t.getCenter(),h={x:o-t.getLayoutStartPoint().x-u.x,y:s-t.getLayoutStartPoint().y-u.y},c=JF({x:1,y:0},h);c<-Math.PI/2&&(c=2*Math.PI+c);var d=QF(h),v=null===(e=i[0])||void 0===e?void 0:e.getScale(),f=null==v?void 0:v.range();if((c-(null==f?void 0:f[0]))*(c-(null==f?void 0:f[1]))>0||(d-(null==l?void 0:l[0]))*(d-(null==l?void 0:l[1]))>0)return;var p=n.invert(d);if(C(p))return;var g=n.domain().findIndex((function(t){return(null==t?void 0:t.toString())===p.toString()}));g<0&&(g=void 0);var y=jV(p,t,"polar",a);r.push({index:g,value:p,position:n.scale(p),axis:t,data:y})}})),r.length?r:null},c0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=u0,t.type="rose",t.seriesType=nz.rose,t}return h(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=h0}}])}(OG);c0.type="rose",c0.seriesType=nz.rose,c0.transformerConstructor=u0,at(c0,HG);var d0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i,n,r,a,o=_(e,"_getDefaultSeriesSpec",this,3)([t]),s=null===(n=(i=this._option).getTheme)||void 0===n?void 0:n.call(i,"series","radar","area");return this._addSeriesRelatedSpecKeys(["line","point","area"]),o.line=t.line,o.point=t.point,o.stack=t.stack,o.percent=t.percent,o.area=Nz({visible:null!==(r=null==s?void 0:s.visible)&&void 0!==r&&r},t.area),o.seriesMark=null!==(a=t.seriesMark)&&void 0!==a?a:"area",o.activePoint=t.activePoint,o.pointDis=t.pointDis,o.pointDisMul=t.pointDisMul,o.markOverlap=t.markOverlap,o}},{key:"transformSpec",value:function(t){var i;_(e,"transformSpec",this,3)([t]),(null!==(i=t.axes)&&void 0!==i?i:[]).forEach((function(t){"radius"===t.orient&&(["domainLine","label","tick"].forEach((function(e){t[e]||(t[e]={visible:!1})})),t.grid||(t.grid={visible:!0}))})),t.crosshair=ot(t.crosshair||{}).map((function(t){return Nz({categoryField:{visible:!0,line:{visible:!0,type:"line"}}},t)}))}}])}(a0),v0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=d0,t.type="radar",t.seriesType=nz.radar,t}return h(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=h0}}])}(OG);v0.type="radar",v0.seriesType=nz.radar,v0.transformerConstructor=d0,at(v0,HG);var f0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i=_(e,"_getDefaultSeriesSpec",this,3)([t]);return delete i.data,i}},{key:"_transformAxisSpec",value:function(t){var e=this;t.axes&&t.autoBandSize&&t.series.forEach((function(i,n){var r;if("bar"===i.type){var a=e._findBandAxisBySeries(i,n,t.axes);if(a&&!a.bandSize&&!a.maxBandSize&&!a.minBandSize){var o=T(i.autoBandSize)&&null!==(r=i.autoBandSize.extend)&&void 0!==r?r:0,s=i.barMaxWidth,l=i.barMinWidth,u=i.barWidth,h=i.barGapInGroup;e._applyAxisBandSize(a,o,{barMaxWidth:s,barMinWidth:l,barWidth:u,barGapInGroup:h})}}}))}},{key:"transformSpec",value:function(t){var i=this;if(_(e,"transformSpec",this,3)([t]),t.series&&t.series.length){var n=this._getDefaultSeriesSpec(t);t.series.forEach((function(t){i._isValidSeries(t.type)&&Object.keys(n).forEach((function(e){e in t||(t[e]=n[e])}))}))}t.axes&&t.axes.length&&t.axes.forEach((function(e){G(e,"trimPadding")&&Nz(e,_N(i.type,t))})),this._transformAxisSpec(t)}}])}(LG),p0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=f0,t.type="common",t}return h(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=function(t,e,i){var n,r;return[].concat(b(null!==(n=JG(t,e,i))&&void 0!==n?n:[]),b(null!==(r=h0(t,e))&&void 0!==r?r:[]))},this._modelOption.getDimensionInfoByValue=$G,this._modelOption.getRectByDimensionData=aY}}])}(OG);p0.type="common",p0.transformerConstructor=f0,at(p0,HG);var g0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),t.axes.forEach((function(t){return t.type="linear"}))}},{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["x2Field","y2Field","barMinHeight","barBackground","barGap"]])}}])}(DG),y0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=g0,t}return h(e,t),a(e)}(OG);y0.transformerConstructor=g0,at(y0,HG);var m0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),sN(t)}}])}(g0),_0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=m0,t.type="histogram",t.seriesType=nz.bar,t}return h(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=JG,this._modelOption.getDimensionInfoByValue=$G,this._modelOption.getRectByDimensionData=aY}}])}(y0);_0.type="histogram",_0.seriesType=nz.bar,_0.transformerConstructor=m0;var b0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i,n,r=_(e,"_getDefaultSeriesSpec",this,3)([t]);return this._addSeriesRelatedSpecKeys(["cornerRadius","progress","track","roundCap"]),r.progress=t.progress,r.track=t.track,r.tickMask=t.tickMask,r.cornerRadius=null!==(i=t.cornerRadius)&&void 0!==i?i:0,r.roundCap=null!==(n=t.roundCap)&&void 0!==n&&n,r}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this._transformProgressAxisSpec(t,{orient:"angle",visible:!1},{orient:"radius",visible:!1},{forceInitTick:t.tickMask&&!1!==t.tickMask.visible})}}])}(r0),k0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=b0,t.type="circularProgress",t.seriesType=nz.circularProgress,t}return h(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=h0}}])}(OG);k0.type="circularProgress",k0.seriesType=nz.circularProgress,k0.transformerConstructor=b0,at(k0,HG);var x0=function(e){function r(){return n(this,r),i(this,r,arguments)}return h(r,e),a(r,[{key:"_getDefaultSeriesSpec",value:function(t){var e=_(r,"_getDefaultSeriesSpec",this,3)([t]);return this._addSeriesRelatedSpecKeys(["pin","pinBackground","pointer"]),e.radiusField=t.radiusField,e.pin=t.pin,e.pinBackground=t.pinBackground,e.pointer=t.pointer,e}},{key:"_getDefaultCircularProgressSeriesSpec",value:function(t){var e=_(r,"_getDefaultSeriesSpec",this,3)([t]);return e.type=nz.circularProgress,e}},{key:"transformSpec",value:function(e){var i,n,a,o,s;_(r,"transformSpec",this,3)([e]);var l=null===(i=e.series)||void 0===i?void 0:i.find((function(t){return t.type===nz.gauge||t.type===nz.circularProgress}));C(l)&&("circularProgress"===(l=null!==(n=e.gauge)&&void 0!==n?n:this._getDefaultCircularProgressSeriesSpec(e)).type&&(C(l.radiusField)&&C(l.categoryField)&&(l.radiusField=null!==(o=null!==(a=e.radiusField)&&void 0!==a?a:e.categoryField)&&void 0!==o?o:e.seriesField),C(l.valueField)&&C(l.angleField)&&(l.valueField=null!==(s=e.valueField)&&void 0!==s?s:e.angleField)),1===e.series.length?e.series.push(l):e.series.forEach((function(t){t.type===l.type&&Object.keys(l).forEach((function(e){e in t||(t[e]=l[e])}))}))),l.type===nz.circularProgress?this._transformProgressAxisSpec(e,{orient:"angle",visible:!0,domainLine:{visible:!1},grid:{visible:!1}},{orient:"radius",visible:!1},{zIndex:t.LayoutZIndex.Region+50}):this._transformGaugeAxisSpec(e)}},{key:"_transformGaugeAxisSpec",value:function(e){var i;e.axes||(e.axes=[]);var n={radius:null,angle:null};(null!==(i=e.axes)&&void 0!==i?i:[]).forEach((function(t){var e=t.orient;"radius"===e&&(n.radius=t),"angle"===e&&(n.angle=t)})),n.angle||(n.angle={orient:"angle",visible:!0},e.axes.push(n.angle)),n.radius||(n.radius={orient:"radius",visible:!1},e.axes.push(n.radius)),C(n.angle.type)&&(n.angle.type="linear"),C(n.radius.type)&&(n.radius.type="linear"),C(n.angle.zIndex)&&(n.angle.zIndex=t.LayoutZIndex.Region+50)}}])}(r0),S0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=x0,t.type="gauge",t.seriesType=nz.gaugePointer,t}return h(e,t),a(e)}(OG);S0.type="gauge",S0.seriesType=nz.gaugePointer,S0.transformerConstructor=x0;var A0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this.transformSeriesSpec(t)}},{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["nameField","valueField","fontFamilyField","fontWeightField","fontStyleField","colorHexField","colorMode","colorList","rotateAngles","fontWeightRange","fontSizeRange","maskShape","keepAspect","random","wordCloudConfig","wordCloudShapeConfig","word","fillingWord","wordMask"]])}}])}(LG),C0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=A0,t.type="wordCloud",t.seriesType=nz.wordCloud,t}return h(e,t),a(e)}(OG);C0.transformerConstructor=A0;var M0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=A0,t.type="wordCloud",t.seriesType=nz.wordCloud,t}return h(e,t),a(e)}(C0);M0.type="wordCloud",M0.seriesType=nz.wordCloud,M0.transformerConstructor=A0;var T0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"needAxes",value:function(){return!1}},{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["categoryField","valueField","funnelAlign","funnelOrient","heightRatio","shape","funnel","transform","outerLabel","transformLabel","isTransform","maxSize","minSize","gap","isCone","range","transformRatioText"]])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),_(e,"transformSeriesSpec",this,3)([t])}}])}(LG),w0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=T0,t.type="funnel",t.seriesType=nz.funnel,t}return h(e,t),a(e)}(OG);w0.type="funnel",w0.seriesType=nz.funnel,w0.transformerConstructor=T0;var E0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"needAxes",value:function(){return!1}},{key:"_getDefaultSeriesSpec",value:function(t){var i,n,r=_(e,"_getDefaultSeriesSpec",this,3)([t,["bandWidth","progress","track","clamp"]]);return r.direction=null!==(i=t.direction)&&void 0!==i?i:"horizontal",this._addSeriesRelatedSpecKeys(["cornerRadius"]),r.cornerRadius=null!==(n=t.cornerRadius)&&void 0!==n?n:0,r}},{key:"transformSpec",value:function(t){var i,n;if(_(e,"transformSpec",this,3)([t]),t.axes||(t.axes=[]),"vertical"===t.direction){var r=null,a=null;(null!==(i=t.axes)&&void 0!==i?i:[]).forEach((function(t){var e=t.orient;"left"===e&&(r=t),"bottom"===e&&(a=t)})),r||(r={orient:"left",visible:!1},t.axes.push(r)),a||(a={orient:"bottom",visible:!1},t.axes.push(a)),C(a.type)&&(a.type="band"),C(r.type)&&(r.type="linear");var o=dW(r,{min:0,max:1});C(r.min)&&(r.min=o.min),C(r.max)&&(r.max=o.max)}else{var s=null,l=null;(null!==(n=t.axes)&&void 0!==n?n:[]).forEach((function(t){var e=t.orient;"left"===e&&(s=t),"bottom"===e&&(l=t)})),s||(s={type:"band",orient:"left",visible:!1},t.axes.push(s)),l||(l={orient:"bottom",visible:!1},t.axes.push(l)),C(l.type)&&(l.type="linear"),C(s.type)&&(s.type="band");var u=dW(l,{min:0,max:1});C(l.min)&&(l.min=u.min),C(l.max)&&(l.max=u.max)}}}])}(DG),B0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=E0,t.type="linearProgress",t.seriesType=nz.linearProgress,t}return h(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=JG,this._modelOption.getDimensionInfoByValue=$G,this._modelOption.getRectByDimensionData=aY}}])}(OG);B0.type="linearProgress",B0.seriesType=nz.linearProgress,B0.transformerConstructor=E0,at(B0,HG);var P0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i,n,r=_(e,"_getDefaultSeriesSpec",this,3)([t,["barWidth","barMaxWidth","barMinWidth","barGapInGroup","barBackground","barMinHeight","stackCornerRadius","bar"]]);return"horizontal"===t.direction?r.xField=null!==(i=t.xField)&&void 0!==i?i:[t.minField,t.maxField]:r.yField=null!==(n=t.yField)&&void 0!==n?n:[t.minField,t.maxField],r}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),sN(t)}}])}(DG),O0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=P0,t.type="rangeColumn",t.seriesType=nz.rangeColumn,t}return h(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=JG,this._modelOption.getDimensionInfoByValue=$G,this._modelOption.getRectByDimensionData=aY}}])}(OG);O0.type="rangeColumn",O0.seriesType=nz.rangeColumn,O0.transformerConstructor=P0;var I0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i=M(t.startAngle)?t.startAngle:-90,n=M(t.endAngle)?t.endAngle:i+ke(2*Math.PI),r=_(e,"_getDefaultSeriesSpec",this,3)([t,["categoryField","valueField","centerX","centerY","offsetX","offsetY","innerRadius","outerRadius","gap","labelLayout","label","labelAutoVisible","drill","drillField"]]);return r.startAngle=i,r.endAngle=n,r}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this.transformSeriesSpec(t)}}])}(LG),R0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=I0,t.type="sunburst",t.seriesType=nz.sunburst,t}return h(e,t),a(e)}(OG);R0.type="sunburst",R0.seriesType=nz.sunburst,R0.transformerConstructor=I0;var L0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["categoryField","valueField","layoutPadding","circlePacking","drill","drillField"]])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this.transformSeriesSpec(t)}}])}(LG),D0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=L0,t.type="circlePacking",t.seriesType=nz.circlePacking,t}return h(e,t),a(e)}(OG);D0.type="circlePacking",D0.seriesType=nz.circlePacking,D0.transformerConstructor=L0;var F0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["categoryField","valueField","aspectRatio","splitType","maxDepth","gapWidth","nodePadding","minVisibleArea","minChildrenVisibleArea","minChildrenVisibleSize","roam","drill","drillField","leaf","nonLeaf","nonLeafLabel"]])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this.transformSeriesSpec(t)}}])}(LG),z0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=F0,t.type="treemap",t.seriesType=nz.treemap,t}return h(e,t),a(e)}(OG);z0.type="treemap",z0.seriesType=nz.treemap,z0.transformerConstructor=F0;var j0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),t.legends&&ot(t.legends).forEach((function(t){t.select=!1,t.hover=!1,t.filter=!1})),sN(t)}},{key:"_getDefaultSeriesSpec",value:function(t){var i=_(e,"_getDefaultSeriesSpec",this,3)([t]);return this._addSeriesRelatedSpecKeys(["bar","stackLabel","leaderLine","total","calculationMode"]),i.bar=t.bar,i.stackLabel=t.stackLabel,i.leaderLine=t.leaderLine,i.total=t.total,i.calculationMode=t.calculationMode,i}}])}(WY),H0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=j0,t.type="waterfall",t.seriesType=nz.waterfall,t}return h(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=JG,this._modelOption.getDimensionInfoByValue=$G,this._modelOption.getRectByDimensionData=aY}}])}(GY);H0.type="waterfall",H0.seriesType=nz.waterfall,H0.transformerConstructor=j0;var N0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i,n=[t.maxField,t.medianField,t.q1Field,t.q3Field,t.minField,t.outliersField],r=_(e,"_getDefaultSeriesSpec",this,3)([t,["boxPlot","outlier","minField","maxField","q1Field","medianField","q3Field","outliersField","outliersStyle","boxWidth","boxMaxWidth","boxMinWidth","boxGapInGroup"]]);return r.direction=null!==(i=t.direction)&&void 0!==i?i:"vertical",r["horizontal"===r.direction?"xField":"yField"]=n,r}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),t.axes||(t.axes=[{orient:"bottom"},{orient:"left"}]),sN(t)}}])}(DG),U0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=N0,t.type="boxPlot",t.seriesType=nz.boxPlot,t}return h(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=JG,this._modelOption.getDimensionInfoByValue=$G,this._modelOption.getRectByDimensionData=aY}}])}(OG);U0.type="boxPlot",U0.seriesType=nz.boxPlot,U0.transformerConstructor=N0;var V0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["categoryField","valueField","sourceField","targetField","direction","nodeAlign","crossNodeAlign","nodeGap","nodeWidth","linkWidth","minStepWidth","minNodeHeight","maxNodeHeight","minLinkHeight","maxLinkHeight","dropIsolatedNode","nodeHeight","linkHeight","equalNodeHeight","linkOverlap","iterations","nodeKey","linkSortBy","nodeSortBy","setNodeLayer","node","link","emphasis","inverse","overflow"]])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this.transformSeriesSpec(t)}}])}(LG),W0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=V0,t.type="sankey",t.seriesType=nz.sankey,t}return h(e,t),a(e,[{key:"_setStateInDatum",value:function(t,e,i,n){var r=O(e)?e[0]:e;if(r){var a=null;this.filterGraphicsByDatum(r,{filter:function(t,e){return"text"!==e.type&&e.getProduct()&&(!i||i(t,e))},region:n,getDatum:function(t){var e,i=null===(e=nH(t))||void 0===e?void 0:e.datum;return O(i)&&(i=i[0]),i},callback:function(t,e,i,n){var r,a,o=e.getProductId();o&&(o.includes("node")||o.includes("link"))&&(null===(a=(r=i)._handleEmphasisElement)||void 0===a||a.call(r,{item:t,mark:e}))},regionCallback:function(t,e){r&&t.length&&(a=t[0])}}),a&&this._interaction.updateStateOfGraphics(t,[a])}else this._interaction.clearByState(t)}}])}(OG);W0.type="sankey",W0.seriesType=nz.sankey,W0.transformerConstructor=V0;var G0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i,n,r=_(e,"_getDefaultSeriesSpec",this,3)([t]);return this._addSeriesRelatedSpecKeys(["area","point","line"]),r.area=t.area,r.point=t.point,r.line=t.line,"horizontal"===t.direction?r.xField=null!==(i=t.xField)&&void 0!==i?i:[t.minField,t.maxField]:r.yField=null!==(n=t.yField)&&void 0!==n?n:[t.minField,t.maxField],r.stack=!1,r}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),sN(t)}}])}(DG),Y0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=G0,t.type="rangeArea",t.seriesType=nz.rangeArea,t}return h(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=JG,this._modelOption.getDimensionInfoByValue=$G,this._modelOption.getRectByDimensionData=aY}}])}(OG);Y0.type="rangeArea",Y0.seriesType=nz.rangeArea,Y0.transformerConstructor=G0;var K0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["valueField","cell"]])}}])}(DG),X0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=K0,t.type="heatmap",t.seriesType=nz.heatmap,t}return h(e,t),a(e)}(OG);X0.type="heatmap",X0.seriesType=nz.heatmap,X0.transformerConstructor=K0;var q0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["categoryField","valueField","sizeField","sizeRange","centerX","centerY","innerRadius","outerRadius","startAngle","endAngle","ripplePoint","centerPoint","centerLabel","nodePoint"]])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this.transformSeriesSpec(t)}}])}(LG),Z0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=q0,t.type="correlation",t.seriesType=nz.correlation,t}return h(e,t),a(e)}(OG);function J0(t){var e,i,n=Object.assign({},t);return W(t.style)||(n.textStyle=tH(t.style)),W(t.textStyle)||Nz(n.textStyle,tH(t.textStyle)),(null===(e=t.shape)||void 0===e?void 0:e.style)&&tH(n.shape.style),(null===(i=t.background)||void 0===i?void 0:i.style)&&tH(n.background.style),n}Z0.type="correlation",Z0.seriesType=nz.correlation,Z0.transformerConstructor=q0;var Q0=function(t,e){var i=[],n={},r=e.series,a=e.seriesField;return r().forEach((function(t){var e=a(t);(e===t.getSeriesField()?t.getSeriesInfoList():t.getSeriesInfoInField(e)).forEach((function(t){n[t.key]||(n[t.key]=!0,i.push(t))}))})),i},$0=function(t,e){var i,n,r,a=e.series,o=e.selected,s=e.field,l=e.data,u=e.customFilter,h=o(),c=l();if(0===h.length&&c.length)return[];if(h.length===c.length)return t;var d={};h.forEach((function(t){d[t]=!0}));var v=null!==(i=s())&&void 0!==i?i:mj;return u?u(t,h,v):(O(t)&&(null===(n=t[0])||void 0===n?void 0:n.nodes)?(t[0].nodes=t[0].nodes.filter((function(t){return!0===d[t.key]})),(null===(r=t[0])||void 0===r?void 0:r.links)&&(t[0].links=t[0].links.filter((function(t){return!0===d[t.source]&&!0===d[t.target]})))):M(v)&&(t=t.filter((function(t){return!0===d[a.getSeriesFieldValue(t,v)]}))),t)},t1={position:!0,item:!0,title:!0,pager:!0,background:!0},e1=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).layoutType="normal",e.layoutZIndex=t.LayoutZIndex.Legend,e.layoutLevel=t.LayoutLevel.Legend,e.specKey="legends",e._orient="left",e._visible=!0,e._position="middle",e._preSelectedData=[],e._selectedData=[],e.effect={onSelectedDataChange:function(){tz(e._regions,(function(t){var e;null===(e=t.getViewData())||void 0===e||e.markRunning()}),{userId:e._seriesUserId,specIndex:e._seriesIndex}),tz(e._regions,(function(t){t.reFilterViewData()}),{userId:e._seriesUserId,specIndex:e._seriesIndex})}},e}return h(r,e),a(r,[{key:"orient",get:function(){return this._orient}},{key:"visible",get:function(){return this._visible}},{key:"position",get:function(){return this._position}},{key:"getLegendData",value:function(){return this._legendData.getLatestData()}},{key:"getSelectedData",value:function(){return this._selectedData}},{key:"setAttrFromSpec",value:function(){var t;_(r,"setAttrFromSpec",this,3)([]),this._orient=Cz(this._spec.orient)?this._spec.orient:"left",this._position=null!==(t=this._spec.position)&&void 0!==t?t:"middle",this._visible=!1!==this._spec.visible;var e=this._spec,i=e.regionId,n=e.regionIndex,a=e.seriesId,o=e.seriesIndex;M(a)&&(this._seriesUserId=ot(a)),M(i)&&(this._regionUserId=ot(i)),M(o)&&(this._seriesIndex=ot(o)),M(n)&&(this._regionUserIndex=ot(n)),this._regions=this._option.getRegionsInUserIdOrIndex(this._regionUserId,this._regionUserIndex)}},{key:"created",value:function(){_(r,"created",this,3)([]),this.initData()}},{key:"_compareSpec",value:function(t,e){var i=_(r,"_compareSpec",this,3)([t,e]);i.reRender=!0;var n=!nt(e,t);return i.reMake?i:(null==t?void 0:t.orient)!==(null==e?void 0:e.orient)?(i.reMake=!0,i):n&&!i.reCompile&&this._isComponentOnlySpecChange(t,e)?(i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0}),i):(n&&(i.reCompile=!0),i)}},{key:"_isComponentOnlySpecChange",value:function(t,e){var i=e,n=t;return Object.keys(Object.assign(Object.assign({},e),t)).every((function(t){return nt(null==i?void 0:i[t],null==n?void 0:n[t])||t1[t]}))}},{key:"_bindLegendDataChange",value:function(){this._preSelectedData=this._selectedData.slice(),this._initSelectedData(),this._forceLayout()}},{key:"initData",value:function(){var e=this,i=this._initLegendData();i.target.addListener("change",this._bindLegendDataChange.bind(this)),this._legendData=new WN(this._option,i),this._initSelectedData(),tz(this._regions,(function(i){i.event.on(t.ChartEvent.rawDataUpdate,{filter:function(t){var e=t.model;return(null==e?void 0:e.id)===i.id}},(function(){e._legendData.getDataView().reRunAllTransform({skipEqual:!0})}))}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},{key:"setSelectedData",value:function(e){var i,n,r,a=this,o=this._selectedData;C(e)||JSON.stringify(o)===JSON.stringify(e)||(tz(this._regions,(function(t){t.legendSelectedFilter&&(e=t.legendSelectedFilter(a,e))}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._selectedData=b(e),null===(n=(i=this.effect).onSelectedDataChange)||void 0===n||n.call(i),this.event.emit(t.ChartEvent.legendSelectedDataChange,{model:this}),null===(r=this._legendComponent)||void 0===r||r.setSelected(this._selectedData))}},{key:"afterSetLayoutStartPoint",value:function(t){if(_(r,"afterSetLayoutStartPoint",this,3)([t]),this._legendComponent){var e=t.x,i=t.y;F(e*i)&&this._legendComponent.setAttributes({x:e,y:i})}}},{key:"getBoundsInRect",value:function(t,e){var i=this;if(!this._visible)return this._legendComponent&&this._legendComponent.parent&&(this._legendComponent.parent.removeChild(this._legendComponent),this._legendComponent=null),{x1:0,y1:0,x2:0,y2:0};var n={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0},r=this._getLegendAttributes(t);if(r.disableTriggerEvent=this._option.disableTriggerEvent,this._legendComponent)nt(r,this._cacheAttrs)||this._legendComponent.setAttributes(Nz({},r,{defaultSelected:this._selectedData}));else{var a=new(this._getLegendConstructor())(Nz({},r,{defaultSelected:this._selectedData}));a.name="legend",this._legendComponent=a,this.getContainer().add(a),this._option.disableTriggerEvent||this._initEvent(),a.on("*",(function(t,e){return i._delegateEvent(i._legendComponent,t,e)}))}this._cacheAttrs=r;var o=isFinite(this._legendComponent.AABBBounds.width())?this._legendComponent.AABBBounds.width():0,s=isFinite(this._legendComponent.AABBBounds.height())?this._legendComponent.AABBBounds.height():0;if("normal-inline"!==this.layoutType){var l="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",u=this._position,h=e.width,c=e.height,d=0,v=0;"horizontal"===l?"middle"===u?d=(h-o)/2:"end"===u&&(d=h-o):"middle"===u?v=(c-s)/2:"end"===u&&(v=c-s),this._legendComponent.setAttributes({dx:d,dy:v})}return n.x2=n.x1+o,n.y2=n.y1+s,n}},{key:"onDataUpdate",value:function(){var e,i;if(JSON.stringify(this._preSelectedData)!==JSON.stringify(this._selectedData)){if(this._legendComponent){var n=this._getLegendAttributes(this.getLayoutRect());nt(n,this._cacheAttrs)||this._legendComponent.setAttributes(Nz({},n,{defaultSelected:this._selectedData}))}null===(i=(e=this.effect).onSelectedDataChange)||void 0===i||i.call(e),this.event.emit(t.ChartEvent.legendSelectedDataChange,{model:this})}}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._legendComponent]}},{key:"clear",value:function(){_(r,"clear",this,3)([]),this._cacheAttrs=null,this._preSelectedData=null}}])}(DW);e1.specKey="legends";var i1=function(e){function o(){var t;return n(this,o),(t=i(this,o,arguments)).type=c.discreteLegend,t.name=c.discreteLegend,t}return h(o,e),a(o,[{key:"init",value:function(e){var i=this;_(o,"init",this,3)([e]),tz(this._regions,(function(e){e.addViewDataFilter({type:"discreteLegendFilter",options:{series:e,selected:function(){return i._selectedData},field:function(){return i._getSeriesLegendField(e)},data:function(){return i.getLegendDefaultData()},customFilter:i._spec.customFilter},level:t.TransformLevel.legendFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},{key:"_initLegendData",value:function(){var t=this;fH(this._option.dataSet,"discreteLegendFilter",$0),fH(this._option.dataSet,"discreteLegendDataMake",Q0);var e=new Ko(this._option.dataSet,{name:"".concat(this.type,"_").concat(this.id,"_data")});return e.transform({type:"discreteLegendDataMake",options:{series:function(){var e=[];return tz(t._regions,(function(t){e.push(t)}),{specIndex:t._spec.seriesIndex,userId:t._spec.seriesId}),e},seriesField:function(e){return t._getSeriesLegendField(e)}}}),e}},{key:"_getSeriesLegendField",value:function(t){var e,i,n,r=t.getSeriesField(),a=null!==(e=this._spec.scaleName)&&void 0!==e?e:this._spec.scale;if(C(a))return r;if(!t.getRawData())return r;var o=this._option.globalScale.getScaleSpec(a);if(!o)return r;if(this._spec.field)return this._spec.field;if(!JS(o.domain))return r;var s=o.domain.find((function(e){return e.dataId===t.getRawData().name}));return s&&null!==(n=null===(i=s.fields)||void 0===i?void 0:i[0])&&void 0!==n?n:r}},{key:"_initSelectedData",value:function(){var t=this,e=this.getLegendDefaultData();if(this._unselectedData){var i=[],n=[];e.forEach((function(e){t._unselectedData.includes(e)?n.push(e):i.push(e)})),this._selectedData=i,this._unselectedData=n}else this._spec.defaultSelected?this._selectedData=b(this._spec.defaultSelected):this._selectedData=e}},{key:"getLegendDefaultData",value:function(t){return A(this._spec.data)?this._getLegendItems().map((function(t){return t.label})):this._legendData.getLatestData().map(t?function(t){return t.originalKey}:function(t){return t.key})}},{key:"_addDefaultTitleText",value:function(t){var e,i,n,r;if((null===(e=t.title)||void 0===e?void 0:e.visible)&&C(t.title.text)&&C(null===(i=t.title.style)||void 0===i?void 0:i.text)){var a=null===(r=null===(n=this._regions)||void 0===n?void 0:n[0])||void 0===r?void 0:r.getSeries()[0];if(!a)return;t.title.text=Nj(a.getRawData(),a.getSeriesField())}}},{key:"_getLegendAttributes",value:function(t){var e="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",i=Object.assign(Object.assign({layout:e,items:this._getLegendItems(),zIndex:this.layoutZIndex},function(t,e){var i=r(t,["title","item","pager","background","type","id","visible","orient","position","data","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]),n=t.title,a=void 0===n?{}:n,o=t.item,s=void 0===o?{}:o,l=t.pager,u=void 0===l?{}:l,h=t.background,c=void 0===h?{}:h;a=X(a),s=X(s),u=X(u),c=X(c);var d=i;return a.visible?d.title=J0(a):d.title={visible:!1},W(s.focusIconStyle)||tH(s.focusIconStyle),s.shape&&(s.shape=Jj(s.shape)),s.label&&(s.label=Jj(s.label)),s.value&&(s.value=Jj(s.value)),s.background&&(s.background=Jj(s.background)),Mz(s.maxWidth)&&(s.maxWidth=Number(s.maxWidth.substring(0,s.maxWidth.length-1))*e.width/100),Mz(s.width)&&(s.width=Number(s.width.substring(0,s.width.length-1))*e.width/100),Mz(s.height)&&(s.height=Number(s.height.substring(0,s.height.length-1))*e.width/100),d.item=s,"scrollbar"===u.type?(W(u.railStyle)||tH(u.railStyle),W(u.sliderStyle)||tH(u.sliderStyle)):(W(u.textStyle)||tH(u.textStyle),u.handler&&Jj(u.handler)),d.pager=u,c.visible&&!W(c.style)&&(Nz(d,c.style),M(c.padding)&&(d.padding=c.padding)),d}(this._spec,t)),{maxWidth:t.width,maxHeight:t.height});return this._addDefaultTitleText(i),this._addLegendItemFormatMethods(i),i}},{key:"_getLegendConstructor",value:function(){return uF}},{key:"setSelectedData",value:function(t){t&&(this._unselectedData=this.getLegendDefaultData().filter((function(e){return!t.includes(e)}))),_(o,"setSelectedData",this,3)([t])}},{key:"_initEvent",value:function(){var e=this;if(this._legendComponent){var i=!1!==this._spec.filter;this._legendComponent.addEventListener(QD.legendItemClick,(function(n){var r=G(n,"detail.currentSelected");i&&e.setSelectedData(r),e.event.emit(t.ChartEvent.legendItemClick,{model:e,value:r,event:n})})),this._legendComponent.addEventListener(QD.legendItemHover,(function(i){var n=G(i,"detail");e.event.emit(t.ChartEvent.legendItemHover,{model:e,value:n,event:i})})),this._legendComponent.addEventListener(QD.legendItemUnHover,(function(i){var n=G(i,"detail");e.event.emit(t.ChartEvent.legendItemUnHover,{model:e,value:n,event:i})}))}}},{key:"_getLegendItems",value:function(){var t=(this._legendData.getLatestData()||[]).map((function(t){var e,i,n=t.style("fillOpacity"),r=t.style("strokeOpacity"),a=t.style("opacity"),o=t.style("texture");return{label:t.key,shape:{symbolType:null!==(i=null!==(e=t.style("symbolType"))&&void 0!==e?e:t.shapeType)&&void 0!==i?i:"circle",fillOpacity:F(n)?n:1,strokeOpacity:F(r)?r:1,opacity:F(a)?a:1,texturePadding:o?1:null,textureSize:o?4:null,texture:o,fill:t.style("fill"),stroke:t.style("stroke"),textureColor:t.style("textureColor"),innerBorder:t.style("innerBorder"),outerBorder:t.style("outerBorder"),lineDash:t.style("lineDash"),lineDashOffset:t.style("lineDashOffset"),lineWidth:t.style("lineWidth")}}}));return A(this._spec.data)?this._spec.data(t,this._option.globalScale.getScale("color"),this._option.globalScale):t}},{key:"_addLegendItemFormatMethods",value:function(t){var e,i,n,r,a=null!==(i=null===(e=this._spec.item)||void 0===e?void 0:e.label)&&void 0!==i?i:{},o=a.formatMethod,s=a.formatter,l=null!==(r=null===(n=this._spec.item)||void 0===n?void 0:n.value)&&void 0!==r?r:{},u=l.formatMethod,h=l.formatter,c=OU(o,s).formatFunc;s&&!o&&c&&(t.item.label.formatMethod=function(t,e){return c(t,e,s)});var d=OU(u,h).formatFunc;h&&!u&&d&&(t.item.value.formatMethod=function(t,e){return d(h,t,e,s)})}}],[{key:"getSpecInfo",value:function(t){return IU(t,this.specKey,this.type,(function(t){return!t.type||"discrete"===t.type}))}}])}(e1);i1.specKey="legends",i1.builtInTheme={discreteLegend:{orient:"bottom",position:"middle",padding:[16,24],title:{visible:!1,padding:0,textStyle:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"primaryFontColor"},fontWeight:"normal"},space:12},pager:{textStyle:{fill:{type:"palette",key:"discreteLegendPagerTextColor"}},handler:{style:{fill:{type:"palette",key:"discreteLegendPagerHandlerColor"}},state:{disable:{fill:{type:"palette",key:"discreteLegendPagerHandlerDisableColor"}}}}},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:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},opacity:1},state:{unSelected:{fill:{type:"palette",key:"disableFontColor"},opacity:1}}}},allowAllCanceled:!1}},i1.type=c.discreteLegend;var n1=function(t,e){var i=e.series,n=e.field,r=e.scale,a=n();if(n&&a){var o=1/0,s=-1/0;return i().forEach((function(t){var e=t.getRawDataStatisticsByField(a,!0),i=null==e?void 0:e.min,n=null==e?void 0:e.max;F(i)&&(o=Math.min(i,o)),F(n)&&(s=Math.max(n,s))})),[o,s]}if(r){var l=r();return l?l.domain():[]}return[]},r1=function(t,e){var i=e.selected,n=e.field,r=e.data,a=e.isHierarchyData,o=e.customFilter,s=i(),l=n(),u=a||function(t){return t&&t.some((function(t){return t&&function(t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"children";return!!T(t)&&!!t.hasOwnProperty(e)&&Array.isArray(t[e])}(t)}))};if(s===r())return t;if(l&&!W(s)){var h=m(s,2),c=h[0],d=h[1];return o?o(t,s,l):u(t)?Zj(t,+c,+d,l):t.filter((function(t){return t[l]>=c&&t[l]<=d}))}return t};function a1(t){var e=Nz({},t),i=e.title,n=void 0===i?{}:i,a=e.handler,o=void 0===a?{}:a,s=e.rail,l=void 0===s?{}:s,u=e.track,h=void 0===u?{}:u,c=e.startText,d=e.endText,v=e.handlerText,f=e.sizeBackground,p=e.background,g=void 0===p?{}:p;e.type,e.id,e.visible,e.orient,e.position,e.data,e.defaultSelected,e.field,e.filter,e.regionId,e.regionIndex,e.seriesIndex,e.seriesId,e.padding;var y=r(e,["title","handler","rail","track","startText","endText","handlerText","sizeBackground","background","type","id","visible","orient","position","data","defaultSelected","field","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return n.visible?y.title=J0(n):y.title={visible:!1},y.showHandler=!1!==o.visible,W(o.style)||(y.handlerStyle=tH(o.style)),M(l.width)&&(y.railWidth=l.width),M(l.height)&&(y.railHeight=l.height),W(l.style)||(y.railStyle=tH(l.style)),W(h.style)||(y.trackStyle=tH(h.style)),y.startText=Jj(c),y.endText=Jj(d),y.handlerText=function(t){if(!t)return t;var e=Object.assign({},t),i=t.style;return A(i)?e.style=function(t,e,n){return tH(i(t,e,n))}:W(i)||(e.style=tH(i)),e}(v),W(f)||(y.sizeBackground=tH(f)),g.visible&&!W(g.style)&&(Nz(y,g.style),M(g.padding)&&(y.padding=g.padding)),y}var o1={color:vF,size:pF},s1={orient:"right",position:"middle",padding:[16,24],title:{visible:!1,padding:0,textStyle:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"primaryFontColor"}},space:12},handler:{visible:!0},startText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6},endText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6},handlerText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6}},l1=function(t){var e={width:200,height:8,style:{fill:{type:"palette",key:"sliderRailColor"}}};return t?(e.width=200,e.height=8):(e.width=8,e.height=200),Object.assign(Object.assign({},s1),{rail:e,handler:{style:{symbolType:"circle",lineWidth:0,outerBorder:{lineWidth:2,distance:.8,stroke:"#ffffff"},shadowBlur:12,shadowOffsetX:0,shadowOffsetY:4,shadowColor:{type:"palette",key:"shadowColor"}}}})},u1={horizontal:l1(!0),vertical:l1(!1)},h1=function(t){var e={style:{fill:{type:"palette",key:"sliderRailColor"}}};return t?(e.width=200,e.height=4):(e.height=200,e.width=4),Object.assign(Object.assign({},s1),{sizeBackground:{fill:{type:"palette",key:"dataZoomChartColor"}},track:{style:{fill:{type:"palette",key:"sliderTrackColor",a:.8}}},rail:e,handler:{style:{symbolType:"circle",lineWidth:0,outerBorder:{lineWidth:2,distance:.8,stroke:{type:"palette",key:"sliderTrackColor"}},fill:{type:"palette",key:"sliderHandleColor"}}}})},c1={horizontal:h1(!0),vertical:h1(!1)},d1=["#C4E7FF","#98CAFF","#75ACFF","#518FF9","#2775DC","#005CBE","#00429F","#00287E"],v1=[2,10],f1=function(e){function r(t,e){var a;n(this,r),(a=i(this,r,[t,e])).type=c.colorLegend,a.name=c.colorLegend;var o="color"===a._spec.type?c.colorLegend:c.sizeLegend;return a.type=o,a.name=o,a}return h(r,e),a(r,[{key:"setAttrFromSpec",value:function(){_(r,"setAttrFromSpec",this,3)([]),this._field=this._spec.field,this._legendType=this._spec.type}},{key:"init",value:function(e){var i=this;_(r,"init",this,3)([e]),tz(this._regions,(function(e){e.addViewDataFilter({type:"continuousLegendFilter",options:{selected:function(){return i._selectedData},field:function(){return i._field},data:function(){return i._legendData.getLatestData()},isHierarchyData:e.isHierarchyData,customFilter:i._spec.customFilter},level:t.TransformLevel.legendFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},{key:"_getScaleInGlobal",value:function(){var t=this._option.globalScale,e=this._spec.scale;return e||(e=this._legendType),t.getScale(e)}},{key:"_initLegendData",value:function(){var t=this;fH(this._option.dataSet,"continuousLegendFilter",r1),fH(this._option.dataSet,"continuousLegendDataMake",n1);var e=new Ko(this._option.dataSet,{name:"".concat(this.type,"_").concat(this.id,"_data")});return e.transform({type:"continuousLegendDataMake",options:{series:function(){return ez(t._regions,{userId:t._seriesUserId,specIndex:t._seriesIndex})},field:function(){return t._field},scale:this._getScaleInGlobal.bind(this)}}),e}},{key:"_initSelectedData",value:function(){this._spec.defaultSelected?this._selectedData=this._spec.defaultSelected.slice():this._selectedData=this._legendData.getLatestData()}},{key:"_addDefaultTitleText",value:function(t){var e,i,n,r;if((null===(e=t.title)||void 0===e?void 0:e.visible)&&C(t.title.text)&&C(null===(i=t.title.style)||void 0===i?void 0:i.text)){var a=this._field;if(a){var o=null===(r=null===(n=this._regions)||void 0===n?void 0:n[0])||void 0===r?void 0:r.getSeries()[0];if(!o)return;return void(t.title.text=Nj(o.getRawData(),a))}var s=this._spec.scale;s||(s=this._legendType);var l=this._option.globalScale.getScaleSpec(s);if(!JS(null==l?void 0:l.domain))return;var u=l.domain[0];if(0===u.fields.length)return;t.title.text=Nj(this._option.dataSet.getDataView(u.dataId),u.fields[0])}}},{key:"_getLegendAttributes",value:function(t){var e,i,n="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",r="horizontal"===n?"bottom":this.layoutOrient,a=[],o=this._getScaleInGlobal();o&&"linear"===o.type&&(a=o.range()),W(a)&&(a="color"===this._legendType?d1:v1);var l=null!==(e=this._legendData.getLatestData()[0])&&void 0!==e?e:0,u=null!==(i=this._legendData.getLatestData()[1])&&void 0!==i?i:1;this._legendData.getLatestData()[0]===this._legendData.getLatestData()[1]&&(l=Math.min(0,this._legendData.getLatestData()[0]),u=0===this._legendData.getLatestData()[0]?1:Math.max(0,this._legendData.getLatestData()[0]));var h=Object.assign(s({layout:n,align:r,zIndex:this.layoutZIndex,min:l,max:u,value:this._spec.defaultSelected},"color"===this._legendType?"colors":"sizeRange",a),a1(this._spec));return this._addDefaultTitleText(h),h}},{key:"_getLegendConstructor",value:function(){return o1[this._legendType]}},{key:"_initEvent",value:function(){var e=this;if(this._legendComponent){var i=!1!==this._spec.filter;this._legendComponent.addEventListener("change",Lt((function(n){var r=G(n,"detail.value");i&&e.setSelectedData(r),e.event.emit(t.ChartEvent.legendFilter,{model:e,value:r,event:n})}),30))}}}],[{key:"getSpecInfo",value:function(t){var e=IU(t,this.specKey,this.type,(function(t){return"color"===(e=t.type)||"size"===e;var e}));return e&&e.forEach((function(t){t.type="color"===t.spec.type?c.colorLegend:c.sizeLegend})),e}}])}(e1);f1.specKey="legends",f1.builtInTheme={colorLegend:u1,sizeLegend:c1},f1.type=c.continuousLegend;var p1=function(t,e){return M(e)?t.map((function(t){return e[t]})):void 0},g1=function(t,e){return function(i){return t.every((function(t,n){return i[t]===(null==e?void 0:e[n])}))}},y1=function(t){return!C(t)&&(O(t)?t.length>0&&t.every(M):Object.keys(t).length>0)};function m1(t,e,i){var n,r,a,o,s,l,u,h=Object.assign({regionIndex:0},e),c=i.getOption(),d=c.getRegionsInUserIdOrIndex(M(h.regionId)?[h.regionId]:void 0,M(h.regionIndex)?[h.regionIndex]:void 0)[0];if(!d)return"none";var v=k1(t,d),f=null!==(n=h.activeType)&&void 0!==n?n:v.length>1?"dimension":"mark",p=d.getLayoutStartPoint(),g=d.getLayoutRect(),y=c.globalInstance.getContainer(),m=Object.assign({x:0,y:0},y?function(t){var e=t.getBoundingClientRect();return{x:e.x,y:e.y}}(y):{}),_=function(t){var e,i=t.data,n=i.dimensionFields,r=i.dimensionData,a=i.measureFields,o=i.measureData,s=i.groupField,l=i.groupData;return null===(e=t.series.getViewData())||void 0===e?void 0:e.latestData.find((function(t){return g1(n,r)(t)&&g1(a,o)(t)&&(C(s)||g1([s],[l])(t))}))},k=d.getOption().globalInstance.getStage().window.getViewBoxTransform().getInverse(),x=function(t){var e,i,n=function(t){return{x:Math.min(Math.max(t.x,0),g.width),y:Math.min(Math.max(t.y,0),g.height)}}(t),r=null!==(e=h.x)&&void 0!==e?e:p.x+n.x,a=null!==(i=h.y)&&void 0!==i?i:p.y+n.y,o={x:0,y:0};k.transformPoint({x:r,y:a},o);var s=o.x,l=o.y;return{canvasX:s,canvasY:l,clientX:m.x+s,clientY:m.y+l}};if("dimension"===f){var S=v[0];if(!S)return"none";var A=new Map;v.forEach((function(t){var e;A.has(t.series)||A.set(t.series,[]),null===(e=A.get(t.series))||void 0===e||e.push(t)}));var T=[{value:t[S.data.dimensionFields[0]],data:b(A.keys()).map((function(t){var e,i;return{series:t,datum:null!==(i=null===(e=A.get(t))||void 0===e?void 0:e.map((function(t){return _(t)})))&&void 0!==i?i:[]}}))}];M(S.dimType)&&(T[0].position=S.pos[S.dimType],T[0].dimType=S.dimType);var w={changePositionOnly:!1,action:"enter",tooltip:null,dimensionInfo:T,chart:null!==(r=c.globalInstance.getChart())&&void 0!==r?r:void 0,datum:void 0,model:void 0,source:sH.chart,event:x({x:v.reduce((function(t,e){return t+e.pos.x}),0)/v.length,y:v.reduce((function(t,e){return t+e.pos.y}),0)/v.length}),item:void 0};null===(s=null===(o=null===(a=i.processor)||void 0===a?void 0:a.dimension)||void 0===o?void 0:o.showTooltip)||void 0===s||s.call(o,T,w,!1);var E=c.globalInstance;return TU.globalConfig.uniqueTooltip&&TU.hideTooltip(E.id),f}if("mark"===f){var B=v[0];if(!B)return"none";var P=null!==(l=B.data.originDatum)&&void 0!==l?l:Object.assign(Object.assign({},_(B)),t),O=[{datum:[P],series:B.series}],I={changePositionOnly:!1,tooltip:null,dimensionInfo:[{value:P[B.data.dimensionFields[0]],data:O}],chart:null!==(u=c.globalInstance.getChart())&&void 0!==u?u:void 0,datum:P,model:B.series,source:sH.chart,event:x(B.pos),item:void 0};i.processor.mark.showTooltip({datum:P,mark:null,series:B.series},I,!1);var R=c.globalInstance;return TU.globalConfig.uniqueTooltip&&TU.hideTooltip(R.id),f}return"none"}var _1,b1,k1=function(t,e){var i=e.getSeries(),n=[];return i.forEach((function(e){var i,r,a,o,s,l,u,h=e.getDimensionField(),c=e.getMeasureField(),d=e.getSeriesField(),v=M(d)?t[d]:void 0,f=M(d)&&null!==(o=null===(a=null===(r=null===(i=e.getViewDataStatistics)||void 0===i?void 0:i.call(e))||void 0===r?void 0:r.latestData[d])||void 0===a?void 0:a.values)&&void 0!==o?o:[],p=p1(h,t),g=p1(c,t),y=y1(g),_=!y&&M(d)&&C(v)&&f.length>0,b=function(){var t,i=null===(t=e.getViewData())||void 0===t?void 0:t.latestData.find(g1(h,p));if(y||(g=p1(c,i),y1(g))){var r=e.type===nz.pie?e.dataToCentralPosition(i):e.dataToPosition(i);C(r)||isNaN(r.x)||isNaN(r.y)||n.push({pos:r,data:{dimensionFields:h,dimensionData:p,measureFields:c,measureData:g,hasMeasureData:y,groupField:d,groupData:v},series:e})}};if("cartesian"===e.coordinate){var k=e,x=FI(null===(l=null===(s=e.getYAxisHelper())||void 0===s?void 0:s.getScale(0))||void 0===l?void 0:l.type)?"y":"x",S=h.map((function(t,e){return[t,e]})).filter((function(t){var e=m(t,2)[1];return C(null==p?void 0:p[e])})),A=[null!=p?p:[]];S.length>0&&S.forEach((function(t){var i,n,r,a,o=m(t,2),s=o[0],l=o[1],u=null!==(a=null===(r=null===(n=null===(i=e.getViewDataStatistics)||void 0===i?void 0:i.call(e))||void 0===n?void 0:n.latestData[s])||void 0===r?void 0:r.values)&&void 0!==a?a:[],h=[];A.forEach((function(t){u.forEach((function(e){var i,n=null!==(i=null==t?void 0:t.slice())&&void 0!==i?i:[];n[l]=e,h.push(n)}))})),A=h})),A.forEach((function(t){var i,r;if(_){var a=null===(i=k.getViewData())||void 0===i?void 0:i.latestData.filter(g1(h,t));f.forEach((function(i){var r=a.find((function(t){return t[d]===i}));if(g=p1(c,r),y1(g)){var o=k.dataToPosition(r);C(o)||isNaN(o.x)||isNaN(o.y)||n.push({pos:o,data:{dimensionFields:h,dimensionData:t,measureFields:c,measureData:g,hasMeasureData:y,groupField:d,groupData:i},series:e,dimType:x})}}))}else{var o=null===(r=k.getViewData())||void 0===r?void 0:r.latestData.find(g1(h,t));if(!y&&(g=p1(c,o),!y1(g)))return;var s=k.dataToPosition(o);if(C(s)||isNaN(s.x)||isNaN(s.y))return;n.push({pos:s,data:{dimensionFields:h,dimensionData:t,measureFields:c,measureData:g,hasMeasureData:y,groupField:d,groupData:v},dimType:x,series:e})}}))}else if("polar"===e.coordinate)if(e.type===nz.pie)b();else{var T=e;if(_){var w=(null===(u=T.getViewData())||void 0===u?void 0:u.latestData.filter(g1(h,p))).find((function(t){return t[d]===v}));f.forEach((function(t){if(g=p1(c,w),y1(g)){var i=T.dataToPosition(w);C(i)||isNaN(i.x)||isNaN(i.y)||n.push({pos:i,data:{dimensionFields:h,dimensionData:p,measureFields:c,measureData:g,hasMeasureData:y,groupField:d,groupData:t},series:e})}}))}else b()}else"geo"===e.coordinate&&function(){var i,r,a;console.log("parseMarkInfoOfGeoSeries");var o=null===(i=e.getViewData())||void 0===i?void 0:i.latestData.find(g1(h,p)),s=e.getNameMap(),l=null===(a=null===(r=e.getMapViewData)||void 0===r?void 0:r.call(e))||void 0===a?void 0:a.latestData.find((function(t){return h.every((function(e,i){return"name"===e?s[t.properties[e]]===(null==p?void 0:p[i]):t.properties[e]===(null==p?void 0:p[i])}))}));if(l){var u=g;if(l&&!o&&(o=Object.assign({},t)),!y){if(u=g=p1(c,o),!y1(g)&&!o)return;y1(g)||(g=[null])}var f=e.dataToPosition(o);C(f)||isNaN(f.x)||isNaN(f.y)||n.push({pos:f,data:{dimensionFields:h,dimensionData:p,measureFields:c,measureData:u,hasMeasureData:y,groupField:d,groupData:v,originDatum:o},series:e})}}()})),n},x1=function(t){return M(t)&&!O(t)},S1=function(t){return M(t)&&O(t)},A1=["panel","shape","titleLabel","keyLabel","valueLabel","spaceRow","maxContentHeight","align"],C1=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_shouldMergeThemeToSpec",value:function(){return!1}},{key:"_initTheme",value:function(t,i){var n=_(e,"_initTheme",this,3)([t,i]),r=n.spec,a=n.theme,o=Nz.apply(void 0,[{}].concat(b(A1.map((function(t){return void 0!==(null==a?void 0:a[t])?s({},t,a[t]):void 0}))),[null==a?void 0:a.style])),l=Nz({},a);A1.forEach((function(t){delete l[t]})),delete l.style;var u=Nz({},l,r);return u.style=Nz({},o,u.style),{spec:u,theme:a}}},{key:"_transformSpecAfterMergingTheme",value:function(t,i,n){var r,a,o,s,l,u,h;_(e,"_transformSpecAfterMergingTheme",this,3)([t,i,n]),t.visible=null===(r=t.visible)||void 0===r||r,t.activeType=function(t){var e,i,n;if(!1===(null==t?void 0:t.visible))return[];var r={mark:!1!==(null===(e=null==t?void 0:t.mark)||void 0===e?void 0:e.visible),dimension:!1!==(null===(i=null==t?void 0:t.dimension)||void 0===i?void 0:i.visible),group:!1!==(null===(n=null==t?void 0:t.group)||void 0===n?void 0:n.visible)};return M(null==t?void 0:t.activeType)&&Object.keys(r).forEach((function(e){var i;r[e]=null===(i=null==t?void 0:t.activeType)||void 0===i?void 0:i.includes(e)})),Object.keys(r).filter((function(t){return r[t]}))}(t),t.renderMode=null!==(a=t.renderMode)&&void 0!==a?a:KS(this._option.mode)||!GS(this._option.mode)?"canvas":"html",t.trigger=null!==(o=t.trigger)&&void 0!==o?o:"hover",t.className=null!==(s=t.className)&&void 0!==s?s:"vchart-tooltip-element",t.enterable=null!==(l=t.enterable)&&void 0!==l&&l,t.transitionDuration=null!==(u=t.transitionDuration)&&void 0!==u?u:150,t.confine=null!==(h=t.confine)&&void 0!==h?h:"canvas"===t.renderMode,M(t.parentElement)?P(t.parentElement)&&(t.parentElement=z_.getElementById(t.parentElement)):GS(this._option.mode)&&(t.parentElement=null==WS?void 0:WS.body)}}])}(LW),M1={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:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"primaryFontColor"},fontWeight:"bold",textBaseline:"middle",spacing:0},shape:{size:8,spacing:6},keyLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"secondaryFontColor"},textBaseline:"middle",spacing:26},valueLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"primaryFontColor"},fontWeight:"bold",textBaseline:"middle",spacing:0}},T1=function(r){function o(){var r;return n(this,o),(r=i(this,o,arguments)).layoutZIndex=1,r.type=c.tooltip,r.name=c.tooltip,r.transformerConstructor=C1,r.specKey="tooltip",r.layoutType="none",r._isReleased=!1,r.enable=!0,r._alwaysShow=!1,r._eventList=[],r._isTooltipShown=!1,r._clickLock=!1,r._mountEvent=function(t,e,i){r.event.on(t,e,i),r._eventList.push({eventType:t,handler:i})},r._handleClickToLock=function(t){var e,i;if(r._clickLock)r._handleChartMouseOut(t),r._clickLock=!1;else{if(!r._isTooltipShown&&!(null===(i=null===(e=r.tooltipHandler)||void 0===e?void 0:e.isTooltipShown)||void 0===i?void 0:i.call(e)))return;r._clickLock=!0}},r._getMouseOutHandler=function(t){return function(e){var i,n,a,o,s;if(!r._isReleased&&!r._alwaysShow&&!r._clickLock&&(r._isTooltipShown||(null===(n=null===(i=r.tooltipHandler)||void 0===i?void 0:i.isTooltipShown)||void 0===n?void 0:n.call(i)))){var l=GS(null===(a=r._option)||void 0===a?void 0:a.mode),u=e.event,h=u.clientX,c=u.clientY;l&&t&&r._isPointerInChart({x:h,y:c})||(r._enterable?r._outTimer=setTimeout((function(){r._handleChartMouseOut(e)}),null!==(s=null===(o=r._spec)||void 0===o?void 0:o.showDelay)&&void 0!==s?s:50):r._handleChartMouseOut(e))}}},r._handleChartMouseOut=function(t){var i;r._cacheActiveType&&(null===(i=r._option)||void 0===i?void 0:i.componentShowContent)&&(!1===r._option.componentShowContent.tooltip||T(r._option.componentShowContent.tooltip)&&!1===r._option.componentShowContent.tooltip[r._cacheActiveType])||r._alwaysShow||r._isReleased||r._isEnterTooltip||"none"!==r._spec.triggerOff&&(r._hideTooltipByHandler(Object.assign(Object.assign({},t),{tooltip:e(r)})),r._handleMouseMove&&r._handleMouseMove.cancel&&r._handleMouseMove.cancel(),r._cacheEnterableRect=null,r._cacheInfo=void 0,r._cacheParams=void 0,r._cacheActiveType=void 0)},r._getMouseMoveHandler=function(t){return function(e){var i,n,a,o;r._isReleased||r._isEnterTooltip||(r._outTimer&&(clearTimeout(r._outTimer),r._outTimer=null),r.tooltipHandler||r._initHandler(),r.processor||r._initProcessor(),r._alwaysShow||(r._clickLock?t&&(r._handleChartMouseOut(e),r._clickLock=!1):!t&&r._enterable&&(null===(n=null===(i=r.tooltipHandler)||void 0===i?void 0:i.isTooltipShown)||void 0===n?void 0:n.call(i))?(r._showTimer&&clearTimeout(r._showTimer),r._showTimer=setTimeout((function(){r._handleChartMouseMove(e,t)}),null!==(o=null===(a=r._spec)||void 0===a?void 0:a.showDelay)&&void 0!==o?o:50)):r._handleChartMouseMove(e,t)))}},r._handleChartMouseMove=function(t,e){if(!r._isReleased){for(var i=r._getMouseEventData(t),n=i.tooltipInfo.dimension,a=i.ignore.mark,o={mark:!1,dimension:!1,group:!1},s=["group","mark","dimension"],l=0,u=s.length;l<u;l++){var h=s[l],c=!!r.processor[h]&&r._showTooltipByMouseEvent(h,i,t,e);if("unShowByOption"===c)o[h]="unShowByOption";else if(c){o[h]=!0;break}}Object.values(o).every((function(t){return!t}))&&!function(t){return C(t.mark)&&C(t.model)&&C(t.datum)}(t)&&(a&&x1(r._cacheInfo)?o.mark=r._showTooltipByMouseEvent("mark",i,t,e,!0):M(n)&&(o.dimension=r._showTooltipByMouseEvent("dimension",i,t,e))),!0===o.mark||!0===o.group||!0===o.dimension&&!C(n)?r._initEventOfTooltipContent():r._cacheActiveType&&"unShowByOption"===o[r._cacheActiveType]||r._handleChartMouseOut(t)}},r._showTooltipByMouseEvent=function(t,e,i,n,a){var o;if(!r._showContentByEvent(t))return"unShowByOption";var s,l=r.processor[t];if(!l.shouldHandleTooltip(i,e.tooltipInfo[t]))return!1;if(r._hideTimer&&clearTimeout(r._hideTimer),a)s=!l.showTooltip(r._cacheInfo,i,!0);else{var u=e.tooltipInfo[t],h=r._isSameAsCache(u,i,t);(s=!l.showTooltip(u,i,h))&&(r._cacheInfo=u,r._cacheParams=i,r._cacheActiveType=t)}s&&(r._isTooltipShown=!0,n&&r._spec.lockAfterClick&&!r._clickLock?r._clickLock=!0:Number.isFinite(r._spec.hideTimer)&&(r._hideTimer=setTimeout((function(){r._handleChartMouseOut()}),r._spec.hideTimer)));var c=null===(o=r._option)||void 0===o?void 0:o.globalInstance;return s&&TU.globalConfig.uniqueTooltip&&c&&TU.hideTooltip(c.id),s},r._getMouseEventData=function(t){var e={tooltipInfo:{},ignore:{}};return Object.keys(r.processor).forEach((function(i){var n=r.processor[i].getMouseEventData(t),a=n.tooltipInfo,o=n.ignore;e.tooltipInfo[i]=a,e.ignore[i]=o})),e},r._hideTooltipByHandler=function(i){var n,a,o;if(!r._isTooltipShown&&!(null===(a=null===(n=r.tooltipHandler)||void 0===n?void 0:n.isTooltipShown)||void 0===a?void 0:a.call(n)))return 0;r.event.emit(t.ChartEvent.tooltipHide,Object.assign(Object.assign({},i),{source:sH.chart,tooltip:e(r)})),Object.values(r.processor).forEach((function(t){t.clearCache()}));var s=null!==(o=r._spec.handler)&&void 0!==o?o:r.tooltipHandler;if(null==s?void 0:s.hideTooltip){var l=s.hideTooltip.call(s,i);return l||(r._isTooltipShown=!1),l}return 1},r.hideTooltip=function(){if(r._isReleased)return!1;var t={changePositionOnly:!1,tooltip:e(r),item:void 0,datum:void 0,source:sH.chart};return r._alwaysShow=!1,!r._hideTooltipByHandler(t)},r}return h(o,r),a(o,[{key:"isTooltipShown",value:function(){return this._isTooltipShown}},{key:"_registerEvent",value:function(){}},{key:"_releaseEvent",value:function(){}},{key:"onLayoutEnd",value:function(){}},{key:"created",value:function(){_(o,"created",this,3)([]),this._regions=this._option.getAllRegions(),this._initEvent()}},{key:"_compareSpec",value:function(t,e){var i=_(o,"_compareSpec",this,3)([t,e]);return!!nt(e,t)||i.reMake||i.reCompile||(i.change=!0,i.reRender=!0,i.effects=Object.assign(Object.assign({},i.effects),{component:!0,render:!0})),i}},{key:"release",value:function(){var t,e,i=this;_(o,"release",this,3)([]),this._isReleased=!0,this._hideTimer&&clearTimeout(this._hideTimer),this._eventList.forEach((function(t){var e=t.eventType,n=t.handler;i.event.off(e,n)})),this._eventList=[],null===(e=null===(t=this.tooltipHandler)||void 0===t?void 0:t.release)||void 0===e||e.call(t),this._isTooltipShown=!1}},{key:"beforeRelease",value:function(){this.event.emit(t.ChartEvent.tooltipHide,{tooltip:this,chart:this.getChart()}),this.event.emit(t.ChartEvent.tooltipRelease,{tooltip:this,chart:this.getChart()})}},{key:"_initHandler",value:function(){var t,e,i,n=null!==(t=this._spec.renderMode)&&void 0!==t?t:"html",r=this._option.globalInstance.getTooltipHandlerByUser();if(r)this.tooltipHandler=r,this._enterable=!1;else{var a="canvas"===n?uY.canvas:uY.dom,o=Uz.getComponentPluginInType(a);o||NS("Can not find tooltip handler: "+a);var s=new o;s.name="".concat(this._spec.className,"-").concat(null!==(e=this._option.globalInstance.id)&&void 0!==e?e:0,"-").concat(this.getSpecIndex()),null===(i=this.pluginService)||void 0===i||i.load([s]),this.tooltipHandler=s,this._spec.enterable&&"html"===n&&this.tooltipHandler?(this._enterable=!0,this._needInitEventOfTooltip=!0):this._enterable=!1}}},{key:"_initEventOfTooltipContent",value:function(){var t,e,i=this;if(this._needInitEventOfTooltip){var n=null===(e=null===(t=this.tooltipHandler)||void 0===t?void 0:t.getRootDom)||void 0===e?void 0:e.call(t);n&&(n.addEventListener("pointerenter",(function(){var t;if(i._enterable){i._isEnterTooltip=!0;var e=null===(t=n.getBoundingClientRect)||void 0===t?void 0:t.call(n);e&&(i._cacheEnterableRect={width:e.width,height:e.height}),i._outTimer&&(clearTimeout(i._outTimer),i._outTimer=null),i._showTimer&&(clearTimeout(i._showTimer),i._showTimer=null)}})),n.addEventListener("pointerleave",(function(){var t,e,r;if(i._enterable&&(i._isEnterTooltip=!1,"none"!==i._spec.triggerOff&&i._cacheEnterableRect)){var a=null===(t=n.getBoundingClientRect)||void 0===t?void 0:t.call(n);a&&Object.keys(i._cacheEnterableRect).every((function(t){return i._cacheEnterableRect[t]===a[t]}))&&(i._cacheEnterableRect=null,i._outTimer=setTimeout(i.hideTooltip,null!==(r=null===(e=i._spec)||void 0===e?void 0:e.showDelay)&&void 0!==r?r:50))}})),this._needInitEventOfTooltip=!1)}}},{key:"_initProcessor",value:function(){var t=this,e=this._spec.activeType;this.processor={},e.forEach((function(e){var i=Uz.createTooltipProcessor(e,t);i&&(t.processor[e]=i)}))}},{key:"_initEvent",value:function(){var t,e=this;if(!this._option.disableTriggerEvent){var i=ot(null!==(t=this._spec.trigger)&&void 0!==t?t:"hover"),n=ot(this._spec.triggerOff),r=this._option.mode;i.forEach((function(t){var i;"hover"===t?(e._handleMouseMove=e._throttle(e._getMouseMoveHandler(!1)),e._mountEvent("pointermove",{source:"chart"},e._handleMouseMove),(YS(r)||KS(r))&&(e._mountEvent("pointerdown",{source:"chart"},e._getMouseMoveHandler(!1)),e._mountEvent("pointerup",{source:"window"},e._getMouseOutHandler(!0))),e._mountEvent("pointerleave",{source:"chart"},e._getMouseOutHandler(!1))):"click"===t?(e._mountEvent("pointertap",{source:"chart"},e._getMouseMoveHandler(!0)),e._mountEvent("pointerup",{source:"window"},e._getMouseOutHandler(!0))):T(t)&&e._mountEvent(t.eventType,{source:null!==(i=t.source)&&void 0!==i?i:"chart",consume:t.consume},e._getMouseMoveHandler(!0))})),n.filter((function(t){return T(t)})).forEach((function(t){var i,n;e._mountEvent(t.eventType,{source:null!==(i=t.source)&&void 0!==i?i:"chart",consume:t.consume},e._getMouseOutHandler(null!==(n=t.checkOutside)&&void 0!==n&&n))})),!i.includes("click")&&this._spec.lockAfterClick&&this._mountEvent("pointertap",{source:"chart"},this._handleClickToLock)}}},{key:"_throttle",value:function(t){return Dt(t,L(this._spec.throttleInterval)?this._spec.throttleInterval:"html"===this._spec.renderMode&&this._spec.transitionDuration?50:10)}},{key:"_showContentByEvent",value:function(t){var e;if(null===(e=this._option)||void 0===e?void 0:e.componentShowContent){if(!1===this._option.componentShowContent.tooltip)return!1;if(T(this._option.componentShowContent.tooltip)&&!1===this._option.componentShowContent.tooltip[t])return!1}return!0}},{key:"reInit",value:function(t){var e,i,n;if(_(o,"reInit",this,3)([t]),this.tooltipHandler){var r=null!==(e=this._spec.renderMode)&&void 0!==e?e:"html",a=this._spec.enterable&&"html"===r;a&&!this._enterable&&(this._needInitEventOfTooltip=!0),this._enterable=a,null===(n=null===(i=this.tooltipHandler)||void 0===i?void 0:i.reInit)||void 0===n||n.call(i)}else this._initHandler()}},{key:"showTooltip",value:function(t,e){var i;if(this.tooltipHandler||this._initHandler(),this.processor||this._initProcessor(),!(null===(i=this.tooltipHandler)||void 0===i?void 0:i.showTooltip))return!1;var n=m1(t,e,this);return"none"!==n&&(this._alwaysShow=!!(null==e?void 0:e.alwaysShow),this._cacheActiveType=n),n}},{key:"_isSameAsCache",value:function(t,e,i){if(i!==this._cacheActiveType)return!1;if(t===this._cacheInfo)return!0;if(C(this._cacheInfo)||C(t))return!1;if(S1(t)){if(x1(this._cacheInfo))return!1;var n=this._cacheInfo;return n.length===t.length&&t.every((function(t,e){return FV(t,n[e])}))}if(S1(this._cacheInfo))return!1;var r=this._cacheInfo;if((null==t?void 0:t.datum)!==r.datum||(null==t?void 0:t.mark)!==r.mark||(null==t?void 0:t.series)!==r.series)return!1;var a=this._cacheParams;return!C(a)&&!C(e)&&a.mark===e.mark&&a.model===e.model&&a.datum===e.datum}},{key:"_isPointerInChart",value:function(t){var e,i=null===(e=this._option)||void 0===e?void 0:e.globalInstance;if(!i)return!1;if(!i.getChart())return!1;var n=t.x,r=t.y,a=i.getCanvas().getBoundingClientRect(),o=a.x,s=a.y,l=a.width,u=a.height;return n>=o&&n<=o+l&&r>=s&&r<=s+u}},{key:"getVisible",value:function(){return!1!==this._spec.visible}}])}(DW);T1.type=c.tooltip,T1.transformerConstructor=C1,T1.builtInTheme={tooltip:M1},T1.specKey="tooltip",function(t){t[t.success=0]="success",t[t.failed=1]="failed"}(_1||(_1={})),function(t){t[t.ALL=3]="ALL",t[t.HORIZONTAL=2]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(b1||(b1={}));var w1={x:["top","bottom"],y:["left","right"],category:["angle"],value:["radius"]},E1={labelZIndex:!0,gridZIndex:!0},B1={xField:!0,yField:!0,categoryField:!0,valueField:!0},P1={visible:!0,width:!0,style:!0},O1=function(e){function o(e,r){var a;return n(this,o),(a=i(this,o,[e,r])).specKey="crosshair",a.layoutType="none",a.gridZIndex=t.LayoutZIndex.CrossHair_Grid,a.labelZIndex=t.LayoutZIndex.CrossHair,a.trigger="hover",a._handleIn=function(t){if(a._option){var e=a.calculateTriggerPoint(t),i=e.x,n=e.y;a.showDefault=!1,a._layoutCrosshair(i,n);var r=a._getNeedClearVRenderComponents();a._hasActive=r.some((function(t){return t&&!1!==t.attribute.visible}))}},a._handleClickInEvent=function(t){if(!a._hasActive||!a._spec.lockAfterClick||a._clickLock)return a._clickLock?(a._clickLock=!1,void a._handleOutEvent()):void(a._onlyLockClick||(a._handleIn(t),L(a.triggerOff)&&(a._timer&&clearTimeout(a._timer),a._timer=setTimeout((function(){a._handleOutEvent()}),a.triggerOff))));a._clickLock=!0},a._handleHoverInEvent=Dt((function(t){a._clickLock||a._handleIn(t)}),10),a._handleOutEvent=function(){a.enableRemain||a._clickLock||!a._hasActive||(a.clearOutEvent(),a.hideCrosshair())},a._handleTooltipShow=function(t){var e=t.tooltipData;if(!t.isEmptyTooltip&&e&&e.length)if(T(a._spec.followTooltip)&&!1===a._spec.followTooltip[t.activeType])a._handleTooltipHideOrRelease();else{var i=a.calculateTriggerPoint(t),n=i.x,r=i.y;a.showDefault=!1,a._layoutCrosshair(n,r,e,t.activeType);var o=a._getNeedClearVRenderComponents();a._hasActive=o.some((function(t){return t&&!1!==t.attribute.visible}))}else a._handleTooltipHideOrRelease()},a._handleTooltipHideOrRelease=function(){a.clearOutEvent(),a.hideCrosshair()},a.enable=!0,a.showDefault=!0,a}return h(o,e),a(o,[{key:"enableRemain",get:function(){return"none"===this.triggerOff}},{key:"_setAllAxisValues",value:function(t,e,i){var n=this,r=!1;if(t.forEach((function(t){FI(t.axis.getScale().type)&&(r?n.enable=!1:r=!0)})),!this.enable)return!1;var a=this._stateByField[i].currentValue;return t.forEach((function(t,i){var r=t.axis;a.set(i,{datum:n._getDatumAtPoint(r,e),axis:r})})),!0}},{key:"clearAxisValue",value:function(){var t=this;Object.keys(this._stateByField).forEach((function(e){t._stateByField[e].currentValue.clear()}))}},{key:"hideCrosshair",value:function(){this.clearAxisValue(),this.hide()}},{key:"showCrosshair",value:function(t){var e=this;t&&t.length&&(this.showDefault=!1,this.clearAxisValue(),t.forEach((function(t){var i=t.axis,n=t.value;e.setAxisValue(n,i)})),this.layoutByValue(!1))}},{key:"_getLimitBounds",value:function(){var t,e;if(!this._limitBounds){var i=null!==(e=null===(t=this._option.globalInstance.getChart())||void 0===t?void 0:t.getViewRect())&&void 0!==e?e:{width:0,height:0},n=i.width,r=i.height;this._limitBounds={x1:0,y1:0,x2:n,y2:r}}return this._limitBounds}},{key:"_showDefaultCrosshairBySpec",value:function(){var t=this,e=!1;return Object.keys(this._stateByField).forEach((function(i){var n=t._spec[i];if(n&&n.visible&&n.defaultSelect){var r=n.defaultSelect,a=r.axisIndex,o=void 0===a?0:a,s=r.datum,l=t._option.getComponentsByKey("axes").find((function(t){return t.getSpecIndex()===o}));l&&(e=!0,t._stateByField[i].currentValue.clear(),t._stateByField[i].currentValue.set(o,{axis:l,datum:s}))}})),e}},{key:"_updateVisibleCrosshair",value:function(){var t=this,e=!1;Object.keys(this._stateByField).forEach((function(i){var n=t._spec[i];n&&n.visible&&t._stateByField[i].currentValue.size?e=!0:t._hideByField(i)})),e&&this.layoutByValue(!1)}},{key:"_showDefaultCrosshair",value:function(){this.showDefault?this._showDefaultCrosshairBySpec()&&this.layoutByValue(!1):this._updateVisibleCrosshair()}},{key:"setAttrFromSpec",value:function(){_(o,"setAttrFromSpec",this,3)([]),this._parseCrosshairSpec()}},{key:"created",value:function(){_(o,"created",this,3)([]),this._initEvent()}},{key:"_compareSpec",value:function(t,e){var i=_(o,"_compareSpec",this,3)([t,e]);return!nt(e,t)&&(i.change=!0,i.reRender=!0,i.reMake||(this._isComponentOnlySpecChange(t,e)?i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0}):i.reMake=!0)),i}},{key:"_isComponentOnlySpecChange",value:function(t,e){var i=this;return Object.keys(Object.assign(Object.assign({},e),t)).every((function(n){return nt(null==e?void 0:e[n],null==t?void 0:t[n])||E1[n]||B1[n]&&i._isFieldComponentOnlySpecChange(null==e?void 0:e[n],null==t?void 0:t[n])}))}},{key:"_isFieldComponentOnlySpecChange",value:function(t,e){var i=this;return Object.keys(Object.assign(Object.assign({},t),e)).every((function(n){return nt(null==t?void 0:t[n],null==e?void 0:e[n])||"label"===n||"line"===n&&i._isLineComponentOnlySpecChange(null==t?void 0:t.line,null==e?void 0:e.line)}))}},{key:"_isLineComponentOnlySpecChange",value:function(t,e){return Object.keys(Object.assign(Object.assign({},t),e)).every((function(i){return nt(null==t?void 0:t[i],null==e?void 0:e[i])||P1[i]}))}},{key:"_initEvent",value:function(){var t=this;if(!this._option.disableTriggerEvent)if(this._spec.followTooltip)this._registerTooltipEvent();else{var e=this._getTriggerEvent();e&&e.forEach((function(e){t._registerEvent(e.in,!1,e.click),e.out&&t._registerEvent(e.out,!0)}))}}},{key:"_registerEvent",value:function(t,e,i){var n,r=this;if(!1!==(null===(n=this._option.componentShowContent)||void 0===n?void 0:n.crosshair)){var a=e?this._handleOutEvent:i?this._handleClickInEvent:this._handleHoverInEvent,o=e?{level:lH.chart}:{source:sH.chart};O(t)?t.forEach((function(t){r.event.on(t,o,a)})):this.event.on(t,o,a)}}},{key:"_eventOff",value:function(t,e,i){var n=this,r=e?this._handleOutEvent:i?this._handleClickInEvent:this._handleHoverInEvent;O(t)?t.forEach((function(t){n.event.off(t,r)})):this.event.off(t,r)}},{key:"onBeforeRender",value:function(){this._limitBounds=null,this._showDefaultCrosshair()}},{key:"calculateTriggerPoint",value:function(t){var e=t.event,i=this._option.getCompiler().getStage().getLayer(void 0),n={x:e.viewX,y:e.viewY};return i.globalTransMatrix.transformPoint({x:e.viewX,y:e.viewY},n),{x:n.x-this.getLayoutStartPoint().x,y:n.y-this.getLayoutStartPoint().y}}},{key:"_getTriggerEvent",value:function(){var e=this,i=this._option.mode,n=function(e){return e===t.RenderModeEnum["desktop-browser"]||e===t.RenderModeEnum["desktop-miniApp"]?{click:"pointertap",hover:"pointermove",hoverOut:"pointerleave",clickOut:"pointerleave"}:YS(e)||KS(e)?{click:"tap",hover:["pointerdown","pointermove"],hoverOut:"pointerleave",clickOut:"pointerleave"}:null}(void 0===i?t.RenderModeEnum["desktop-browser"]:i);if(n){var r=ot(this.trigger||"hover"),a=function(t){return"click"===t?"none"===e.triggerOff?null:n.clickOut:n.hoverOut};this._spec.lockAfterClick&&!r.includes("click")?(r.push("click"),this._onlyLockClick=!0):this._onlyLockClick=!1;var o=[];return r.forEach((function(t){o.push({click:"click"===t,in:n[t],out:a(t)})})),o}return null}},{key:"_registerTooltipEvent",value:function(){this.event.on(t.ChartEvent.tooltipHide,{source:sH.chart},this._handleTooltipHideOrRelease),this.event.on(t.ChartEvent.tooltipShow,{source:sH.chart},this._handleTooltipShow),this.event.on(t.ChartEvent.tooltipRelease,{source:sH.chart},this._handleTooltipHideOrRelease)}},{key:"_getAxisInfoByField",value:function(t){var e,i,n=null===(i=(e=this._option).getComponentsByKey)||void 0===i?void 0:i.call(e,"axes");if(!(null==n?void 0:n.length))return null;var r=G(this._spec,"".concat(t,"Field.bindingAxesIndex"));if(r||(r=[],n.forEach((function(e,i){w1[t].includes(e.getOrient())&&r.push(i)}))),!r.length)return null;var a=new Map,o=1/0,s=1/0,l=-1/0,u=-1/0,h=this.getLayoutStartPoint(),c=h.x,d=h.y;return r.forEach((function(t){var e,i;o=1/0,s=1/0,l=-1/0,u=-1/0;var r=n.find((function(e){return e.getSpecIndex()===t}));if(r){var h=(null===(i=(e=r).getInnerOffset)||void 0===i?void 0:i.call(e))||{left:0,right:0,top:0,bottom:0};r.getRegions().forEach((function(t){var e=t.getLayoutStartPoint(),i=e.x,n=e.y;o=Math.min(o,i-c+h.left),s=Math.min(s,n-d+h.top),l=Math.max(l,i+t.getLayoutRect().width-c-h.right),u=Math.max(u,n+t.getLayoutRect().height-d-h.bottom)})),a.set(t,{x1:o,y1:s,x2:l,y2:u,axis:r})}})),a}},{key:"onLayoutEnd",value:function(){var t=this._regions[0];this.setLayoutRect(t.getLayoutRect()),this.setLayoutStartPosition(t.getLayoutStartPoint()),_(o,"onLayoutEnd",this,3)([])}},{key:"_releaseEvent",value:function(){var t=this;this.clearOutEvent();var e=this._getTriggerEvent();e&&e.forEach((function(e){t._eventOff(e.in,!1,e.click),e.out&&t._eventOff(e.out,!0)}))}},{key:"_parseFieldInfo",value:function(){var t=this;Object.keys(this._stateByField).forEach((function(e){var i=t._spec[e],n=t._stateByField[e].crosshairComp;if(i&&i.visible){if(t._stateByField[e].attributes=t._parseField(i,e),n){var r=t._stateByField[e].attributes,a=r.style,o="rect"===r.type?"rectStyle":"lineStyle";n.setAttributes(s({},o,a))}}else n&&n.parent&&n.parent.removeChild(n)}))}},{key:"_parseCrosshairSpec",value:function(){this._parseFieldInfo();var t=this._spec,e=t.trigger,i=t.triggerOff,n=t.labelZIndex,r=t.gridZIndex;e&&(this.trigger=e),("none"===i||L(i)&&i>0)&&(this.triggerOff=i),void 0!==n&&(this.labelZIndex=n),void 0!==r&&(this.gridZIndex=r)}},{key:"_parseField",value:function(t,e){var i,n,a,o={},s=t.line,l=void 0===s?{}:s,u=t.label,h=void 0===u?{}:u,c=t.visible;if(o.visible=c,o.type=l.type||"line",!1===l.visible)o.style={visible:!1};else{var d=l.style||{},v=d.stroke,f=d.fill,p=d.lineWidth,g=d,y=g.strokeOpacity,m=g.fillOpacity,_=g.opacity,b=r(g,["strokeOpacity","fillOpacity","opacity"]),k="line"===o.type,x=k?y:m;if(L(_)&&(x=(null!=x?x:1)*_),o.style=Object.assign({opacity:x,pickable:!1,visible:!0},b),k)o.style.stroke=v||f,o.style.lineWidth=G(l,"width",p||2);else{o.style.fill=f||v,(null===(n=null===(i=null==t?void 0:t.line)||void 0===i?void 0:i.style)||void 0===n?void 0:n.stroke)&&(o.style.stroke=t.line.style.stroke);var A=G(l,"width");if("string"==typeof A){var C=parseInt(A.substring(0,A.length-1),10)/100;o.style.sizePercent=C}else"number"!=typeof A&&"function"!=typeof A||(o.style.size=A)}}if(h.visible){var M=h.labelBackground||{},T=null!==(a=h.syncAxisLabelAngle)&&void 0!==a&&a,w=h.style||{},E=M.style||{},B=E.fill,P=void 0===B?"rgba(47, 59, 82, 0.9)":B,O=E.stroke,I=E.outerBorder,R=r(E,["fill","stroke","outerBorder"]);o.label={visible:!0,formatMethod:h.formatMethod,formatter:h.formatter,minWidth:M.minWidth,maxWidth:M.maxWidth,padding:M.padding,syncAxisLabelAngle:T,textStyle:Object.assign(Object.assign({fontSize:14,pickable:!1},w),{fill:w.fill||"#fff",stroke:G(w,"stroke")}),panel:(S(M.visible)?M.visible:M)?Object.assign({visible:!0,pickable:!1,fill:P,stroke:O,outerBorder:Object.assign({stroke:P,distance:0,lineWidth:3},I)},R):{visible:!1},zIndex:this.labelZIndex,childrenPickable:!1,pickable:!1}}else o.label={visible:!1};return o}},{key:"_filterAxisByPoint",value:function(t,e,i){return t&&t.forEach((function(n){var r,a,o,s=n.axis;if(a=e,o=i,((r=n).x1>a||r.x2<a||r.y1>o||r.y2<o)&&t.delete(s.getSpecIndex()),s.type.startsWith("polarAxis")){var l=s.getCenter(),u=s.getInnerRadius(),h=s.getOuterRadius(),c=_e.distancePP({x:e,y:i},l);(c>h||c<u)&&t.delete(s.getSpecIndex())}})),t}},{key:"_updateCrosshairLabel",value:function(t,e,i){var n=this.getContainer();t?t.setAttributes(e):(t=new yE(e),null==n||n.add(t),i(t)),function(t,e){var i=e.x1,n=e.y1,r=e.x2,a=e.y2,o=t.AABBBounds,s=o.x1,l=o.y1,u=o.x2,h=o.y2,c=t.attribute,d=c.dx,v=void 0===d?0:d,f=c.dy,p=void 0===f?0:f,g=0,y=0;s<i&&(g=i-s),l<n&&(y=n-l),u>r&&(g=r-u),h>a&&(y=a-h),g&&t.setAttribute("dx",g+v),y&&t.setAttribute("dy",y+p)}(t,this._getLimitBounds())}},{key:"clearOutEvent",value:function(){this._timer&&(clearTimeout(this._timer),this._timer=null),this._clickLock&&(this._clickLock=null),this._hasActive&&(this._hasActive=null)}},{key:"_hideByField",value:function(t){var e=this._stateByField[t],i=e.crosshairComp,n=e.labelsComp;i&&i.hideAll(),n&&Object.keys(n).forEach((function(t){n[t]&&n[t].hideAll()}))}},{key:"hide",value:function(){var t=this;Object.keys(this._stateByField).forEach((function(e){t._hideByField(e)}))}},{key:"_getNeedClearVRenderComponents",value:function(){var t=this;return Object.keys(this._stateByField).reduce((function(e,i){var n=t._stateByField[i],r=n.crosshairComp,a=n.labelsComp;return r&&e.push(r),a&&Object.keys(a).forEach((function(t){a[t]&&e.push(a[t])})),e}),[])}}])}(DW);O1.specKey="crosshair";var I1={trigger:"hover",bandField:{visible:!1,line:{type:"rect",visible:!0,style:{fill:{type:"palette",key:"axisGridColor"},opacity:.7,lineWidth:0,stroke:{type:"palette",key:"markLineStrokeColor"},lineDash:[2,3]}},label:{visible:!1,style:{fontWeight:"normal",fill:{type:"palette",key:"axisMarkerFontColor"},fontSize:{type:"token",key:"l5FontSize"}},labelBackground:{padding:{bottom:0,top:0,left:2,right:2},style:{fill:{type:"palette",key:"axisMarkerBackgroundColor"},cornerRadius:1}}}},linearField:{visible:!1,line:{type:"line",visible:!0,style:{stroke:{type:"palette",key:"markLineStrokeColor"},fill:"transparent",opacity:.7,lineDash:[2,3]}},label:{visible:!1,style:{fontWeight:"normal",fill:{type:"palette",key:"axisMarkerFontColor"},fontSize:{type:"token",key:"l5FontSize"}},labelBackground:{padding:{bottom:0,top:0,left:2,right:2},style:{fill:{type:"palette",key:"axisMarkerBackgroundColor"},cornerRadius:1}}}}},R1=function(t){function e(t,r){var a;return n(this,e),(a=i(this,e,[t,r])).type=c.cartesianCrosshair,a.name=c.cartesianCrosshair,a._stateByField={xField:{coordKey:"x",anotherAxisKey:"y",currentValue:new Map,labelsComp:{top:null,bottom:null}},yField:{coordKey:"y",anotherAxisKey:"x",currentValue:new Map,labelsComp:{left:null,right:null}}},a}return h(e,t),a(e,[{key:"_findAllAxisContains",value:function(t,e){var i=this._getAxisInfoByField("x"),n=this._getAxisInfoByField("y");return{xAxisMap:this._filterAxisByPoint(i,t,e),yAxisMap:this._filterAxisByPoint(n,t,e)}}},{key:"_getDatumAtPoint",value:function(t,e){var i=TV(t.getOrient())?"x":"y",n=e[i]-(t.getLayoutStartPoint()[i]-this.getLayoutStartPoint()[i]);return t.getScale().invert(n)}},{key:"setAxisValue",value:function(t,e){TV(e.getOrient())?this._stateByField.xField.currentValue.set(e.getSpecIndex(),{datum:t,axis:e}):this._stateByField.yField.currentValue.set(e.getSpecIndex(),{datum:t,axis:e})}},{key:"_layoutCrosshair",value:function(t,e,i,n){var r,a=t,o=e;if(i&&i.length)if("dimension"===n){var s,l=i[0],u=l.data.findIndex((function(t){return t.datum.length>0}));if(u>-1){var h=l.data[u];s=h.series.dataToPosition(h.datum[0])}(M(l.dimType)?"y"===l.dimType:wV(null===(r=null==l?void 0:l.axis)||void 0===r?void 0:r.getOrient()))?o=null==s?void 0:s.y:a=null==s?void 0:s.x}else if("mark"===n){var c=i[0],d=c.series.dataToPosition(c.datum[0]);a=null==d?void 0:d.x,o=null==d?void 0:d.y}this.clearAxisValue();var v=this._findAllAxisContains(a,o),f=v.xAxisMap,p=v.yAxisMap;if(f&&0===f.size||p&&0===p.size){if(this.enableRemain)return;this.hide()}else f&&f.size&&this._setAllAxisValues(f,{x:a,y:o},"xField"),p&&p.size&&this._setAllAxisValues(p,{x:a,y:o},"yField"),this.layoutByValue()}},{key:"layoutByValue",value:function(t){var e=this;if(this.enable){var i=az(this._regions,"cartesian");i&&(tY(this._stateByField,i,this.getLayoutStartPoint(),null!=t?t:this.enableRemain),Object.keys(this._stateByField).forEach((function(t){e._layoutByField(t)})))}}},{key:"_layoutByField",value:function(t){var e=this,i=this._stateByField[t],n=i.cacheInfo,r=i.attributes,a=i.labelsComp,o=i.bandSize,l=i.coordKey;if(r&&n&&(!n._isCache||!this.enableRemain)){var u=n.coord,h=n.labels,c=n.visible,d=n.labelsTextStyle;if(c){var v=nY(this._stateByField[t]);this._updateCrosshairByField(t,v),Object.keys(h).forEach((function(i){var c,v,f;if(h[i].visible){var p=Object.assign(Object.assign(Object.assign(s({},l,u+o/2),h[i]),r.label),{angle:r.label.syncAxisLabelAngle&&null!==(v=null===(c=n.axisLabel)||void 0===c?void 0:c.attribute.angle)&&void 0!==v?v:0,textStyle:Object.assign(Object.assign({},null===(f=r.label)||void 0===f?void 0:f.textStyle),d[i]),zIndex:e.labelZIndex,visible:!0});e._updateCrosshairLabel(a[i],p,(function(e){e.name="crosshair-".concat(t.replace("Field",""),"-").concat(i,"-label"),a[i]=e}))}else a[i]&&a[i].hideAll()}))}else this._hideByField(t)}}},{key:"_updateCrosshairByField",value:function(t,e){var i=this.getContainer(),n=this._stateByField[t].attributes,r=this._stateByField[t].crosshairComp;if(r)r.setAttributes(e);else{var a=n.style;"line"===n.type?r=new RE(Object.assign(Object.assign({},e),{lineStyle:a,zIndex:this.gridZIndex+1,disableTriggerEvent:this._option.disableTriggerEvent,pickable:!1})):"rect"===n.type&&(r=new LE(Object.assign(Object.assign({},e),{rectStyle:a,zIndex:this.gridZIndex,disableTriggerEvent:this._option.disableTriggerEvent,pickable:!1}))),null==i||i.add(r),this._stateByField[t].crosshairComp=r}}}],[{key:"getSpecInfo",value:function(t){return IU(t,this.specKey,this.type,(function(t){return t.xField&&!1!==t.xField.visible||t.yField&&!1!==t.yField.visible}))}}])}(O1);R1.specKey="crosshair",R1.builtInTheme={crosshair:I1},R1.type=c.cartesianCrosshair;var L1=function(t){function e(t,r){var a;return n(this,e),(a=i(this,e,[t,r])).type=c.polarCrosshair,a.name=c.polarCrosshair,a._stateByField={categoryField:{coordKey:"angle",anotherAxisKey:"radius",currentValue:new Map,labelsComp:{all:null}},valueField:{coordKey:"radius",anotherAxisKey:"angle",currentValue:new Map,labelsComp:{all:null}}},a}return h(e,t),a(e,[{key:"setAxisValue",value:function(t,e){"radius"===e.getOrient()?this._stateByField.valueField.currentValue.set(e.getSpecIndex(),{datum:t,axis:e}):this._stateByField.categoryField.currentValue.set(e.getSpecIndex(),{datum:t,axis:e})}},{key:"_findAllAxisContains",value:function(t,e){var i=this._getAxisInfoByField("category"),n=this._getAxisInfoByField("value");return{angleAxisMap:this._filterAxisByPoint(i,t,e),radiusAxisMap:this._filterAxisByPoint(n,t,e)}}},{key:"_getDatumAtPoint",value:function(t,e){var i=t.getLayoutStartPoint(),n=i.x,r=i.y,a=this.getLayoutStartPoint(),o=a.x,s=a.y;return t.positionToData({x:e.x-(n-o),y:e.y-(r-s)})}},{key:"_layoutCrosshair",value:function(t,e,i,n){var r=t,a=e;if(i&&i.length)if("dimension"===n){var o=i[0];if(o.axis){var s=o.axis.pointToCoord({x:r,y:a}),l="radius"===o.axis.getOrient()?{radius:o.position,angle:s.angle}:{radius:s.radius,angle:o.position},u=o.axis.coordToPoint(l);r=u.x,a=u.y}}else if("mark"===n){var h=i[0],c=h.series.dataToPosition(h.datum[0]);r=c.x,a=c.y}this.clearAxisValue();var d=this._findAllAxisContains(r,a),v=d.angleAxisMap,f=d.radiusAxisMap;if(0!==v.size||0!==f.size)v&&this._setAllAxisValues(v,{x:r,y:a},"categoryField"),f&&this._setAllAxisValues(f,{x:r,y:a},"valueField"),this.layoutByValue();else{if(this.enableRemain)return;this.hide()}}},{key:"layoutByValue",value:function(t){var e=this;if(this.enable){var i=az(this._regions,"polar");i&&(function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Object.keys(t).forEach((function(n){var r=t[n],a=r.attributes,o=r.currentValue,s=r.cacheInfo,l=r.coordKey;if(a){var u=!!o.size,h=i&&!u&&M(s),c=h?s:{coord:0,axis:null,visible:u,coordRange:[0,0],sizeRange:[0,0],labels:{all:{visible:!1,text:"",offset:0}}};if(s&&(s._isCache=h),"valueField"===n&&(c.sides=e.angleAxisHelper.getScale(0).domain().length),o.forEach((function(t){var i,r=t.axis,o=t.datum,s=void 0===o?"":o,l=r.niceLabelFormatter;if((null===(i=a.label)||void 0===i?void 0:i.visible)&&(c.labels.all.visible=!0,c.labels.all.defaultFormatter=l,c.labels.all.text=s,c.labels.all.offset=cW(r.getSpec())),"categoryField"===n){var u=e.angleAxisHelper.dataToPosition([s]),h=e.angleAxisHelper.getBandwidth(0),d=r.getOuterRadius();c.coord=u,c.coordRange=[u-h/2,u+h/2],c.sizeRange=[d,d]}else{var v=r.startAngle,f=e.radiusAxisHelper.dataToPosition([s]);c.coord=f,c.coordRange=[f,f],c.sizeRange=[v,v]}c.axis=r})),c&&!h&&c.labels.all.visible&&a&&a.label){var d=c.labels.all,v=a.label,f=OU(v.formatMethod,v.formatter,d.text,{label:d.text,orient:l}),p=f.formatFunc,g=f.args;p?d.text=p.apply(void 0,b(g)):d.defaultFormatter&&(d.text=d.defaultFormatter(d.text))}t[n].cacheInfo=c}}))}(this._stateByField,i,null!=t?t:this.enableRemain),Object.keys(this._stateByField).forEach((function(t){e._layoutByField(t)})))}}},{key:"_layoutByField",value:function(t){var e,i,n,r=this._stateByField[t],a=r.cacheInfo,o=r.attributes,s=r.crosshairComp,l=r.labelsComp,u=r.coordKey;if(!(!a||a._isCache&&this.enableRemain)){var h=this.getContainer(),c=a.visible,d=a.labels,v=a.coord,f=a.sizeRange,p=a.axis;if(c){var g=this.getLayoutStartPoint(),y=null===(i=null===(e=this._spec.valueField)||void 0===e?void 0:e.line)||void 0===i?void 0:i.smooth,m=function(t,e,i){var n=t.cacheInfo,r=t.coordKey,a=t.attributes,o=n.axis,s=n.coord,l=n.sizeRange,u=n.coordRange,h=o.getCenter(),c={x:h.x+e.x,y:h.y+e.y};if("angle"===r)return"sector"==("rect"===a.type?"sector":"line")?{center:c,innerRadius:o.getInnerRadius(),radius:o.getOuterRadius(),startAngle:u[0],endAngle:u[1]}:{start:Ae(c,o.getInnerRadius(),s),end:Ae(c,o.getOuterRadius(),s)};var d=o.startAngle,v=o.endAngle,f=n.sides,p=s;if(!i){var g=o.getCenter(),y=o.coordToPoint({angle:l[0],radius:s}),m=Me(g,y),_=(v-d)/f,b=Math.floor((m-d)/_),k=b*_+d,x=Math.min((b+1)*_+d,v),S=Ae(g,s,k),A=Ae(g,s,x),C=Oe([A.x,A.y],[S.x,S.y],[g.x,g.y],[y.x,y.y]);C&&(p=Pt(_e.distancePN(y,C[0],C[1])+s,o.getInnerRadius(),o.getOuterRadius()))}return{center:c,startAngle:d,endAngle:v,radius:p,sides:f}}(this._stateByField[t],g,y);if(s)s.setAttributes(m);else{var _;if("angle"===u){var b="rect"===o.type?"sector":"line";"line"===b?_=new RE(Object.assign(Object.assign({},m),{lineStyle:o.style,zIndex:this.gridZIndex,pickable:!1})):"sector"===b&&(_=new FE(Object.assign(Object.assign({},m),{sectorStyle:o.style,zIndex:this.gridZIndex,pickable:!1})))}else _="polygon"==(y?"circle":"polygon")?new zE(Object.assign(Object.assign({},m),{lineStyle:o.style,zIndex:this.gridZIndex+1})):new DE(Object.assign(Object.assign({},m),{lineStyle:o.style,zIndex:this.gridZIndex}));this._stateByField[t].crosshairComp=_,h.add(_)}var k=d.all;if(k.visible){var x=p.getCenter(),S={x:x.x+g.x,y:x.y+g.y},A="angle"===u?function(t){return{align:(t=Te(t))>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"left":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"right":"center",baseline:t>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"bottom":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"top":"middle"}}(v):function(t){return{align:(t=Te(t))>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"right":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"left":"center",baseline:t>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"bottom":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"top":"middle"}}(p.startAngle),C="angle"===u?Ae(S,f[1]+k.offset,v):Ae(S,m.radius,p.startAngle),M=Object.assign(Object.assign(Object.assign(Object.assign({},C),o.label),k),{textStyle:Object.assign(Object.assign({},null===(n=o.label)||void 0===n?void 0:n.textStyle),{textAlign:A.align,textBaseline:A.baseline}),zIndex:this.labelZIndex});this._updateCrosshairLabel(l.all,M,(function(t){t.name="crosshair-".concat(u,"-label"),l.all=t}))}else l.all&&l.all.hideAll()}}}}],[{key:"getSpecInfo",value:function(t){return IU(t,this.specKey,this.type,(function(t){return t.categoryField&&!1!==t.categoryField.visible||t.valueField&&!1!==t.valueField.visible}))}}])}(O1);L1.specKey="crosshair",L1.builtInTheme={crosshair:I1},L1.type=c.polarCrosshair;var D1=function(t,e){var i=e.getNewDomain,n=e.isContinuous,r=e.field,a=e.originalFields,o=r(),s=i();if(C(s)||C(o))return t;var l=a(),u=O(o)?o[0]:o;return t[u]&&l&&l[u]&&l[u].lockStatisticsByDomain&&!n()&&(t[u].values=s),t},F1=function(t,e){var i=e.getNewDomain,n=e.isContinuous,r=(0,e.field)(),a=i();if(C(a)||C(r))return t;if(0===a.length)return[];var o={};a.forEach((function(t){o[t]||(o[t]=1)}));var s=null;return s=n()?function(t){var e=!1;return ot(r).every((function(i){t[i]>=a[0]&&t[i]<=st(a)&&(e=!0)})),e}:function(t){var e=!1;return ot(r).every((function(i){(o[t[i]+""]||o[t[i]])&&(e=!0)})),e},t.filter(s)},z1=function(t,e){var i=e.input,n=i.stateFields,r=i.valueFields,a=i.dataCollection,o=i.isCategoryState,l=i.seriesCollection,u=e.output,h=u.stateField,c=u.valueField,d={},v=[],f=[],p=[],g=!1,y=!1;a.forEach((function(t,e){var i;if(!C(n[e])){var a=l[e];if(a){var o=a.getRawDataStatisticsByField(n[e]);M(null==o?void 0:o.max)&&M(null==o?void 0:o.min)&&(y=!0)}var s=null===(i=t.getFields())||void 0===i?void 0:i[n[e]];s&&s.lockStatisticsByDomain&&(g=!0,s.domain.forEach((function(t){C(d[t])&&(p.push(t),d[t]=0,v.push(t))}))),t.latestData.forEach((function(t){ot(n[e]).forEach((function(i){C(t[i])||(C(d[t[i]])&&(p.push(t[i]),d[t[i]]=0,v.push(t[i])),C(r[e])||(d[t[i]]+=isNaN(parseFloat(t[r[e]]))?1:parseFloat(t[r[e]])))}))}))}}));var m=g?p:!1===o||y?p.sort((function(t,e){return t-e})):v;return m.forEach((function(t){var e=s({},h,t);c&&(e[c]=d[t]),f.push(e)})),f},j1=function(t,e,i){var n=e.domain();if(LI(e.type))return i?n[0]+(st(n)-n[0])*(1-t):n[0]+(st(n)-n[0])*t;var r=e.range();i&&(r=r.slice().reverse());var a=r[0]+(st(r)-r[0])*t;return e.invert(a)},H1=function(t,e,i){var n=e.scale(t),r=e.range();return!i&&LI(e.type)&&(r=r.slice().reverse()),Math.max(0,Math.min(1,(n-r[0])/(st(r)-r[0])))},N1=function(t,e){var i=t;if(!i)return!1;var n=i.getScale();return n.range()[0]>n.range()[1]&&(!i.getInverse()||e)},U1=function(t){var e=null==t?void 0:t.bandSize,i=null==t?void 0:t.maxBandSize,n=null==t?void 0:t.minBandSize;if(e||n||i)return{bandSize:e,maxBandSize:i,minBandSize:n}},V1=function(t,e,i){return"start"===t?"percent"===e&&M(i.start)||"value"===e&&M(i.startValue):"percent"===e&&M(i.end)||"value"===e&&M(i.endValue)},W1=function(t,e,i){if(LI(i.type))return[Math.min(e,t),Math.max(e,t)];var n=i.domain(),r=n.indexOf(t),a=n.indexOf(e);return n.slice(Math.min(r,a),Math.max(r,a)+1)},G1=function(){function t(e,i,r,a,o,s,l,u){var h=this;n(this,t),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.initZoomEvent=function(){var t,e,i,n,r,a,o,s={delayType:null!==(e=null===(t=h._spec)||void 0===t?void 0:t.delayType)&&void 0!==e?e:"throttle",delayTime:M(null===(i=h._spec)||void 0===i?void 0:i.delayType)?null!==(r=null===(n=h._spec)||void 0===n?void 0:n.delayTime)&&void 0!==r?r:30:0,realTime:null===(o=null===(a=h._spec)||void 0===a?void 0:a.realTime)||void 0===o||o,allowComponentZoom:!0};h._zoomAttr.enable&&h.initZoomEventOfRegions(h.getRegions(),null,h.handleChartZoom,s),h._scrollAttr.enable&&h.initScrollEventOfRegions(h.getRegions(),null,h.handleChartScroll,s),h._dragAttr.enable&&h.initDragEventOfRegions(h.getRegions(),null,h.handleChartDrag,s)},this.handleChartZoom=function(t,e){var i,n;if(h._activeRoam&&(!h._zoomAttr.filter||h._zoomAttr.filter(t,e))){var r=t.zoomDelta,a=t.zoomX,o=t.zoomY,s=h.getRegions()[0].getLayoutStartPoint(),l=s.x,u=s.y,c=h.getRegions()[0].getLayoutRect(),d=c.width,v=c.height,f=Math.abs(h.getState().start-h.getState().end),p=null!==(n=null===(i=h._spec.roamZoom)||void 0===i?void 0:i.rate)&&void 0!==n?n:1;if(!(f>=1&&r<1||f<=.01&&r>1)){var g=h._isHorizontal?a:o,y=f*(r-1)*p,m=y/2,_=y/2;if(g){var b=h._isHorizontal?l:u,k=h._isHorizontal?d:v;m=Math.abs(b-g)/Math.abs(k-b)*y,_=Math.abs(k-g)/Math.abs(k-b)*y}var x=Pt(h.getState().start+m,0,1),S=Pt(h.getState().end-_,0,1);h._handleChange(Math.min(x,S),Math.max(x,S),!0)}}},this.handleChartScroll=function(t,e){var i;if(!h._activeRoam||h._scrollAttr.filter&&!h._scrollAttr.filter(t,e))return!1;var n=t.scrollX,r=t.scrollY,a=h._isHorizontal?n:r,o=h._isHorizontal?ie(n/r)>=.5:ie(r/n)>=.5;if(h._scrollAttr.reverse||(a=-a),o){var s=h._spec.scrollStep;F(s)&&(a=(a>0?1:-1)*(s*(h.getState().end-h.getState().start)/1)),h.handleChartMove(a,null!==(i=h._scrollAttr.rate)&&void 0!==i?i:1)}var l=0!==h.getState().start&&1!==h.getState().end;return o&&l},this.handleChartDrag=function(t,e){var i;if(h._activeRoam&&(!h._dragAttr.filter||h._dragAttr.filter(t,e))){var n=m(t,2),r=n[0],a=n[1],o=h._isHorizontal?r:a;h._dragAttr.reverse&&(o=-o),h.handleChartMove(o,null!==(i=h._dragAttr.rate)&&void 0!==i?i:1)}},this.handleChartMove=function(t,e){var i=h._isHorizontal?h.getLayoutRect().width:h.getLayoutRect().height;if(Math.abs(t)>=1e-6)if(t>0&&h.getState().end<1){var n=Math.min(1-h.getState().end,t/i)*e;h._handleChange(h.getState().start+n,h.getState().end+n,!0)}else if(t<0&&h.getState().start>0){var r=Math.max(-h.getState().start,t/i)*e;h._handleChange(h.getState().start+r,h.getState().end+r,!0)}return!1},this._type=e,this._spec=i,this._handleChange=r,this.getLayoutRect=a,this.getState=o,this.getRegions=s,this._regions=s(),this.getOption=l,this._option=l(),this.getEvent=u,this._isHorizontal="horizontal"===PV(BV(i))}return a(t,[{key:"enableInteraction",value:function(){this._activeRoam=!0}},{key:"disableInteraction",value:function(){this._activeRoam=!1}},{key:"zoomIn",value:function(t){this.handleChartZoom({zoomDelta:1.2,zoomX:null==t?void 0:t.x,zoomY:null==t?void 0:t.y})}},{key:"zoomOut",value:function(t){this.handleChartZoom({zoomDelta:.8,zoomX:null==t?void 0:t.x,zoomY:null==t?void 0:t.y})}},{key:"setEventAttrFromSpec",value:function(){!0===this._spec.roamZoom||this._spec.roamZoom?this._zoomAttr=Q({},this._zoomAttr,this._spec.roamZoom):this._zoomAttr.enable=!1,!0===this._spec.roamDrag||this._spec.roamDrag?this._dragAttr=Q({},this._dragAttr,this._spec.roamDrag):this._dragAttr.enable=!1,!0===this._spec.roamScroll||this._spec.roamScroll?this._scrollAttr=Q({},this._scrollAttr,this._spec.roamScroll):this._scrollAttr.enable=!1,S(this._spec.roam)&&(this._zoomAttr.enable="scrollBar"!==this._type&&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.getEvent(),this._option.mode)}}])}();at(G1,gK);var Y1=function(r){function o(t,r){var a;return n(this,o),(a=i(this,o,[t,r])).layoutType="none",a._orient="left",a._cacheVisibility=void 0,a._dataUpdating=!1,a._hasInitStateScale=!1,a._shouldChange=!0,a._stateField="x",a._currentDataCollection=[],a._handleStateChange=function(t,e,i){var n,r;return a._startValue=t,a._endValue=e,a._newDomain=W1(a._startValue,a._endValue,a._stateScale),null===(r=(n=a.effect).onZoomChange)||void 0===r||r.call(n,i),!0},a.effect={onZoomChange:function(t){var e,i,n=a._relatedAxisComponent;if(n&&"axis"===a._filterMode){var r=n.getScale(),o=n.getSpec();a._auto&&U1(o)&&a._spec.ignoreBandSize&&(r.bandwidth("auto"),r.maxBandwidth("auto"),r.minBandwidth("auto")),a._updateRangeFactor(t),a._auto&&(null===(i=null===(e=a._component)||void 0===e?void 0:e.setStartAndEnd)||void 0===i||i.call(e,a._start,a._end)),n.effect.scaleUpdate({value:"force"})}else tz(a._regions,(function(t){var e;null===(e=t.getViewData())||void 0===e||e.markRunning()}),{userId:a._seriesUserId,specIndex:a._seriesIndex}),tz(a._regions,(function(t){t.reFilterViewData()}),{userId:a._seriesUserId,specIndex:a._seriesIndex})}},a._visible=!0,a._orient=BV(t),a._isHorizontal="horizontal"===PV(a._orient),a._dataFilterEvent=new G1(a.type,a._spec,a._handleChange.bind(e(a)),a.getLayoutRect.bind(e(a)),(function(){return{start:a._start,end:a._end}}),(function(){return a._regions}),function(){return a._option}.bind(e(a)),(function(){return a.event})),a}return h(o,r),a(o,[{key:"isHorizontal",get:function(){return this._isHorizontal}},{key:"stateScale",get:function(){return this._stateScale}},{key:"relatedAxisComponent",get:function(){return this._relatedAxisComponent}},{key:"setStartAndEnd",value:function(t,e){var i=m(arguments.length>2&&void 0!==arguments[2]?arguments[2]:["percent","percent"],2),n=i[0],r=void 0===n?"percent":n,a=i[1],o=void 0===a?"percent":a,s="percent"===r?t:H1(t,this._stateScale,this._isHorizontal),l="percent"===o?e:H1(e,this._stateScale,this._isHorizontal);this._handleChange(s,l,!0)}},{key:"enableInteraction",value:function(){this._dataFilterEvent.enableInteraction()}},{key:"disableInteraction",value:function(){this._dataFilterEvent.disableInteraction()}},{key:"zoomIn",value:function(t){this._dataFilterEvent.zoomIn(t)}},{key:"zoomOut",value:function(t){this._dataFilterEvent.zoomOut(t)}},{key:"_initEvent",value:function(){var e;this._dataFilterEvent.initZoomEvent(),null===(e=this._relatedAxisComponent)||void 0===e||e.event.on(t.ChartEvent.scaleRawDomainUpdate,(function(t){var e=t.model;console.log("scaleRawDomainUpdate",e.getRawDomain())}))}},{key:"_handleChange",value:function(t,e,i){var n,r;null!==(r=null===(n=this._spec)||void 0===n?void 0:n.zoomLock)&&void 0!==r&&r||e-t!==this._spanCache&&(e-t<this._minSpan||e-t>this._maxSpan)?this._shouldChange=!1:(this._shouldChange=!0,this._spanCache=e-t)}},{key:"_updateRangeFactor",value:function(t){var e=this._relatedAxisComponent,i=e.getScale(),n=N1(e,this._isHorizontal),r=n?[1-this._end,1-this._start]:[this._start,this._end];if(n)switch(t){case"startHandler":e.scaleRangeFactorEnd(r[1]);break;case"endHandler":e.scaleRangeFactorStart(r[0]);break;default:e.scaleRangeFactorStart(r[0],!0),e.scaleRangeFactorEnd(r[1])}else switch(t){case"startHandler":e.scaleRangeFactorStart(r[0]);break;case"endHandler":e.scaleRangeFactorEnd(r[1]);break;default:e.scaleRangeFactorEnd(r[1],!0),e.scaleRangeFactorStart(r[0])}var 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)}},{key:"visible",get:function(){return this._visible}},{key:"created",value:function(){this._handleDataCollectionChangeBound=this._handleDataCollectionChange.bind(this),_(o,"created",this,3)([]),this._setAxisFromSpec(),this._setRegionsFromSpec(),this._initEvent(),this._initData(),this._initStateScale(),this._setStateFromSpec()}},{key:"initLayout",value:function(){_(o,"initLayout",this,3)([]),this._layout&&(this._layout.layoutOrient=this._orient)}},{key:"init",value:function(t){_(o,"init",this,3)([t]),this._addTransformToSeries(),0===this._start&&1===this._end||this.effect.onZoomChange()}},{key:"_compareSpec",value:function(t,e){var i=_(o,"_compareSpec",this,3)([t,e]);return i.reMake||nt(e,t)||(i.change=!0,i.reRender=!0,!i.reCompile&&this._isComponentOnlySpecChange(t,e)?i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0}):i.reMake=!0),i}},{key:"_getComponentOnlySpecKeys",value:function(){return null}},{key:"_isComponentOnlySpecChange",value:function(t,e){var i=this._getComponentOnlySpecKeys();return!!i&&Object.keys(Object.assign(Object.assign({},e),t)).every((function(n){return nt(null==e?void 0:e[n],null==t?void 0:t[n])||i[n]}))}},{key:"reInit",value:function(t){var e=this;_(o,"reInit",this,3)([t]),this._marks.forEach((function(t){t.getMarks().forEach((function(t){e.initMarkStyleWithSpec(t,e._spec[t.name])}))}))}},{key:"onLayoutStart",value:function(t,e){_(o,"onLayoutStart",this,3)([t,e]);var i=this._autoUpdate(t);this._autoVisible(i),this._dataUpdating=!1}},{key:"updateLayoutAttribute",value:function(){this._visible&&this._createOrUpdateComponent(),this._hasInitStateScale||(0===this._start&&1===this._end||(this._newDomain=function(t,e,i,n,r){if(LI(r.type)){var a=r.domain(),o=a[0],s=st(a)-o,l=M(t)?o+s*t:+e,u=M(i)?o+s*i:+n;return[Math.min(u,l),Math.max(u,l)]}var h=r.domain(),c=r.range(),d=c[c.length-1]-c[0],v=M(t)?h.indexOf(r.invert(d*t+c[0])):h.indexOf(e),f=M(i)?h.indexOf(r.invert(d*i+c[0])):h.indexOf(n);return h.slice(Math.min(v,f),Math.max(v,f)+1)}(this._spec.start,this._startValue,this._spec.end,this._endValue,this._stateScale),this.effect.onZoomChange()),this._hasInitStateScale=!0)}},{key:"_initAfterLayout",value:function(){this._stateScale=null,this._initStateScale(),this._updateScaleRange(),this._setStateFromAxis()}},{key:"_beforeLayoutEnd",value:function(){this._hasInitStateScale?this._updateScaleRange():this._initAfterLayout()}},{key:"onLayoutEnd",value:function(){var t;this._beforeLayoutEnd();var e=!(0===this._start&&1===this._end);this._autoVisible(e),_(o,"onLayoutEnd",this,3)([]),null===(t=this._relatedAxisComponent)||void 0===t||t.updateScaleRange()}},{key:"getBoundsInRect",value:function(t){var 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}},{key:"setAttrFromSpec",value:function(){var t;_(o,"setAttrFromSpec",this,3)([]),this._dataFilterEvent.setEventAttrFromSpec(),this._field=this._spec.field,this._width=this._computeWidth(),this._height=this._computeHeight(),this._visible=null===(t=this._spec.visible)||void 0===t||t}},{key:"_setAxisFromSpec",value:function(){var t=this;if(M(this._spec.axisId)?this._relatedAxisComponent=this._option.getComponentByUserId(this._spec.axisId):M(this._spec.axisIndex)&&(this._relatedAxisComponent=this._option.getComponentByIndex("axes",this._spec.axisIndex)),C(this._spec.field)&&!this._relatedAxisComponent){var e=this._option.getComponentsByKey("axes"),i=e.find((function(e){return PV(e._orient)===PV(t._orient)}));if(i)this._relatedAxisComponent=i;else{var n=e.find((function(t){return!LI(t.getScale().type)}));this._relatedAxisComponent=n}}this._relatedAxisComponent&&"axis"===this._filterMode&&(this._relatedAxisComponent.autoIndentOnce=!0)}},{key:"_setRegionsFromSpec",value:function(){var t,e;this._regions=this._relatedAxisComponent?this._relatedAxisComponent.getRegions():this._option.getAllRegions();var i=this._relatedAxisComponent?null===(e=(t=this._relatedAxisComponent).getBindSeriesFilter)||void 0===e?void 0:e.call(t):null;if(M(i)&&(M(i.userId)&&(this._seriesUserId=ot(i.userId)),M(i.specIndex)&&(this._seriesIndex=ot(i.specIndex))),M(this._spec.seriesId)){var n=ot(this._spec.seriesId);this._seriesUserId?this._seriesUserId=this._seriesUserId.filter((function(t){return n.includes(t)})):this._seriesUserId=n}if(M(this._spec.seriesIndex)){var r=ot(this._spec.seriesIndex);this._seriesIndex?this._seriesIndex=this._seriesIndex.filter((function(t){return r.includes(t)})):this._seriesIndex=r}if(M(this._spec.regionIndex)){var a=this._option.getRegionsInIndex(ot(this._spec.regionIndex));this._regions=this._regions.filter((function(t){return a.includes(t)}))}else if(M(this._spec.regionId)){var o=ot(this._spec.regionId);this._regions=o.length?this._regions.filter((function(t){return o.includes(t.id)})):[]}}},{key:"_collectDataInfo",value:function(){var t,e=this,i=[],n=[],r=[],a=[];if(this._relatedAxisComponent){var o={};tz(this._regions,(function(n){var s,l,u="cartesian"===n.coordinate?n.getXAxisHelper():"polar"===n.coordinate?n.angleAxisHelper:null,h="cartesian"===n.coordinate?n.getYAxisHelper():"polar"===n.coordinate?n.radiusAxisHelper:null;if(u&&h){var c=u.getAxisId()===e._relatedAxisComponent.id?u:h.getAxisId()===e._relatedAxisComponent.id?h:e._isHorizontal?u:h,d=c===u?h:u,v=LI(d.getScale(0).type),f=LI(c.getScale(0).type);i.push(n.getRawData());var p=n.getSpec(),g="cartesian"===n.coordinate?ot(p.xField):ot(null!==(s=p.angleField)&&void 0!==s?s:p.categoryField),y="cartesian"===n.coordinate?ot(p.yField):ot(null!==(l=p.radiusField)&&void 0!==l?l:p.valueField);if(o[n.id]="link"===n.type?["from_xField"]:c===u?g:y,f?(t=!1,r.push(o[n.id])):(t=!0,r.push(o[n.id][0])),e._valueField){var m="link"===n.type?["from_yField"]:d===u?g:y;v&&a.push.apply(a,b(m))}}}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._originalStateFields=o}else tz(this._regions,(function(t){i.push(t.getRawData()),n.push(t),r.push(e._field),e._valueField&&a.push(e._spec.valueField)}),{userId:this._seriesUserId,specIndex:this._seriesIndex});return{dataCollection:i,seriesCollection:n,stateFields:r,valueFields:a,isCategoryState:t}}},{key:"_initData",value:function(){var t=this._collectDataInfo(),e=t.dataCollection,i=t.seriesCollection,n=t.stateFields,r=t.valueFields,a=t.isCategoryState,o=this._option.dataSet;pH(o,"dataview",Vo),fH(o,"dataFilterComputeDomain",z1);var s=new Ko(o,{name:"".concat(this.type,"_").concat(this.id,"_data")});s.transform({type:"dataFilterComputeDomain",options:{input:{dataCollection:e,seriesCollection:i,stateFields:n,valueFields:r,isCategoryState:a},output:{stateField:this._stateField,valueField:this._valueField}}},!1),this._data=new WN(this._option,s),s.reRunAllTransform(),this._currentDataCollection=e,o.multipleDataViewAddListener(e,"change",this._handleDataCollectionChangeBound)}},{key:"_addTransformToSeries",value:function(){var e=this;this._relatedAxisComponent&&"axis"===this._filterMode||(fH(this._option.dataSet,"dataFilterWithNewDomain",F1),fH(this._option.dataSet,"lockStatisticsFilter",D1),tz(this._regions,(function(i){i.getViewDataStatistics().transform({type:"lockStatisticsFilter",options:{originalFields:function(){return i.getViewDataStatistics().getFields()},getNewDomain:function(){return e._newDomain},field:function(){var t;return null!==(t=e._field)&&void 0!==t?t:e._parseFieldOfSeries(i)},isContinuous:function(){return LI(e._stateScale.type)}},level:1},!1),i.addViewDataFilter({type:"dataFilterWithNewDomain",options:{getNewDomain:function(){return e._newDomain},field:function(){var t;return null!==(t=e._field)&&void 0!==t?t:e._parseFieldOfSeries(i)},isContinuous:function(){return LI(e._stateScale.type)}},level:t.TransformLevel.dataZoomFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex}))}},{key:"onDataUpdate",value:function(){var t,e=this,i=this._collectDataInfo(),n=i.dataCollection,r=i.seriesCollection,a=i.stateFields,o=i.valueFields,s=i.isCategoryState;(this._currentDataCollection.length!==n.length||this._currentDataCollection.some((function(t,e){return t!==n[e]})))&&(this._currentDataCollection.forEach((function(t){var i;null===(i=null==t?void 0:t.target)||void 0===i||i.removeListener("change",e._handleDataCollectionChangeBound)})),this._currentDataCollection=n,this._option.dataSet.multipleDataViewAddListener(this._currentDataCollection,"change",this._handleDataCollectionChangeBound)),this._data.getDataView().transform({type:"dataFilterComputeDomain",options:{input:{dataCollection:n,seriesCollection:r,stateFields:a,valueFields:o,isCategoryState:s},output:{stateField:this._stateField,valueField:this._valueField}}},!1),this._data.getDataView().reRunAllTransform();var l=this._computeDomainOfStateScale(LI(this._stateScale.type));this._stateScale.domain(l,!1),(M(this._spec.start)||M(this._spec.end))&&this._setStateFromSpec(),this._handleChange(this._start,this._end,!0),this._spec.auto&&!nt(this._domainCache,l)&&(this._domainCache=l,this._dataUpdating=!0,null===(t=this.getChart())||void 0===t||t.setLayoutTag(!0,null,!1))}},{key:"_parseFieldOfSeries",value:function(t){var e;return null===(e=this._originalStateFields)||void 0===e?void 0:e[t.id]}},{key:"_setStateFromSpec",value:function(){var t,e;if(this._auto=!!this._spec.auto,this._spec.rangeMode){var i=m(this._spec.rangeMode,2),n=i[0],r=i[1];V1("start",n,this._spec)&&V1("end",r,this._spec)&&(t="percent"===n?this._spec.start:H1(this._spec.startValue,this._stateScale,this._isHorizontal),e="percent"===r?this._spec.end:H1(this._spec.endValue,this._stateScale,this._isHorizontal))}else t=this._spec.start?this._spec.start:this._spec.startValue?H1(this._spec.startValue,this._stateScale,this._isHorizontal):0,e=this._spec.end?this._spec.end:this._spec.endValue?H1(this._spec.endValue,this._stateScale,this._isHorizontal):1;this._start=Math.max(0,Math.min(1,t)),this._end=Math.max(0,Math.min(1,e))}},{key:"_setStateFromAxis",value:function(){var t,e;this._setStateFromSpec();var i=this._relatedAxisComponent;this._startValue=j1(this._start,this._stateScale,N1(i,this._isHorizontal)),this._endValue=j1(this._end,this._stateScale,N1(i,this._isHorizontal)),this._minSpan=null!==(t=this._spec.minSpan)&&void 0!==t?t:0,this._maxSpan=null!==(e=this._spec.maxSpan)&&void 0!==e?e:1,LI(this._stateScale.type)&&this._stateScale.domain()[0]!==st(this._stateScale.domain())&&(this._spec.minValueSpan&&(this._minSpan=this._spec.minValueSpan/(st(this._stateScale.domain())-this._stateScale.domain()[0])),this._spec.maxValueSpan&&(this._maxSpan=this._spec.maxValueSpan/(st(this._stateScale.domain())-this._stateScale.domain()[0]))),this._minSpan=Math.max(0,this._minSpan),this._maxSpan=Math.min(this._maxSpan,1),i&&(i&&"axis"===this._filterMode||0===this._start&&1===this._end||(this._newDomain=W1(this._startValue,this._endValue,this._stateScale)))}},{key:"_initStateScale",value:function(){var t,e,i,n,r,a,o=this,s=[0,1];if(this._relatedAxisComponent){var l=this._relatedAxisComponent.getScale().clone();this._stateScale=l,null===(e=(t=l).maxBandwidth)||void 0===e||e.call(t,"auto",!0),null===(n=(i=l).minBandwidth)||void 0===n||n.call(i,"auto",!0),null===(a=(r=l).bandwidth)||void 0===a||a.call(r,"auto",!0),l.rangeFactor(s,!0).range(s)}else{var u=!0;this._field&&tz(this._regions,(function(t){var e=t.getRawDataStatisticsByField(o._field);F(null==e?void 0:e.min)&&F(null==e?void 0:e.max)||(u=!1)}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._stateScale=u?new CR:new rR,this._stateScale.domain(this._computeDomainOfStateScale(u),!0).range(s)}}},{key:"_computeDomainOfStateScale",value:function(t){var e=this;if(this._spec.customDomain)return this._spec.customDomain;var i=this._data.getLatestData().map((function(t){return t[e._stateField]}));if(t){var n=i.map((function(t){return 1*t}));return i.length?[ut(n),lt(n)]:[-1/0,1/0]}return i}},{key:"_autoVisible",value:function(e){if(this._auto){e?this.show():this.hide();var i=this._isHorizontal?"height":"width";this.layout.setLayoutRect(s({},i,e?this["_".concat(i)]:0),s({},i,t.AttributeLevel.Built_In))}}},{key:"hide",value:function(){var t;null===(t=this._component)||void 0===t||t.hideAll()}},{key:"show",value:function(){var t;null===(t=this._component)||void 0===t||t.showAll()}},{key:"_autoUpdate",value:function(t){var e,i,n,r,a,o;if(!this._auto)return this._cacheVisibility=void 0,!0;var s=this._relatedAxisComponent,l=null==s?void 0:s.getSpec(),u=null==s?void 0:s.getScale(),h=U1(l);if(!this._dataUpdating&&FI(u.type)&&(null==t?void 0:t.height)===(null===(e=this._cacheRect)||void 0===e?void 0:e.height)&&(null==t?void 0:t.width)===(null===(i=this._cacheRect)||void 0===i?void 0:i.width)&&this._fixedBandSize===(null==h?void 0:h.bandSize))return this._cacheVisibility;var d=!0;if(this._isHorizontal&&(null==t?void 0:t.width)!==(null===(n=this._cacheRect)||void 0===n?void 0:n.width)?u.range(s.getInverse()?[t.width,0]:[0,t.width]):(null==t?void 0:t.height)!==(null===(r=this._cacheRect)||void 0===r?void 0:r.height)&&u.range(s.getInverse()?[0,t.height]:[t.height,0]),this._cacheRect={width:null==t?void 0:t.width,height:null==t?void 0:t.height},this._fixedBandSize=null==h?void 0:h.bandSize,FI(u.type)){h&&(this._start||this._end)&&(this.type===c.scrollBar&&(this._start=0,this._end=1),this._updateRangeFactor());var v=m(null!==(a=u.rangeFactor())&&void 0!==a?a:[],2),f=v[0],p=v[1];d=!(C(f)&&C(p)||0===f&&1===p)}else{var g=m(null!==(o=u.rangeFactor())&&void 0!==o?o:[this._start,this._end],2),y=g[0],_=g[1];d=!(0===y&&1===_)}return this.setStartAndEnd(this._start,this._end),this._cacheVisibility=d,d}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._component]}}])}(DW);at(Y1,gK);var K1=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_mergeThemeToSpec",value:function(t,e){var i=this,n=this._theme,r=t;if(this._shouldMergeThemeToSpec()){var a=function(t){var e=Nz({selectedBackgroundChart:{line:{},area:{}}},i._theme,t),n=t.selectedBackgroundChart,r=void 0===n?{}:n,a=r.line,o=r.area;return a&&!1!==a.visible&&(e.selectedBackgroundChart.line.style=Object.assign(Object.assign({},e.selectedBackgroundChart.line.style),{visible:!0})),o&&!1!==o.visible&&(e.selectedBackgroundChart.area.style=Object.assign(Object.assign({},e.selectedBackgroundChart.area.style),{visible:!0})),e},o=t;r=O(o)?o.map((function(t){return a(t)})):a(o)}return this._adjustPadding(r),{spec:r,theme:n}}}])}(LW),X1=function(t){return{area:{style:{visible:t,stroke:!1,fill:{type:"palette",key:"dataZoomChartColor"}}},line:{style:{visible:t,stroke:{type:"palette",key:"dataZoomChartColor"},lineWidth:1}}}},q1={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:X1(!1),startHandler:{style:{symbolType:"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\nC-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\nC-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\nC0.3-1.4,0.3-1.4,0.3-1.4z;",fill:{type:"palette",key:"sliderHandleColor"},scaleX:1.2,scaleY:1.2,stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},lineWidth:1}},endHandler:{style:{symbolType:"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\nC-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\nC-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\nC0.3-1.4,0.3-1.4,0.3-1.4z;",fill:{type:"palette",key:"sliderHandleColor"},scaleX:1.2,scaleY:1.2,stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},lineWidth:1}},startText:{padding:8,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}}},endText:{padding:8,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}}},backgroundChart:X1(!0)},Z1={width:!0,height:!0,showDetail:!0,middleHandler:!0,background:!0,startHandler:!0,endHandler:!0,startText:!0,endText:!0,dragMask:!0,selectedBackground:!0,backgroundChart:!0,selectedBackgroundChart:!0,showBackgroundChart:!0},J1=function(e){function r(e,a){var o,s;return n(this,r),(o=i(this,r,[e,a])).type=c.dataZoom,o.name=c.dataZoom,o.transformerConstructor=K1,o.specKey="dataZoom",o.layoutZIndex=t.LayoutZIndex.DataZoom,o.layoutLevel=t.LayoutLevel.DataZoom,o.layoutType="region-relative",o._isReverseCache=!1,o._dataToPositionX=function(t){var e=o._isHorizontal?0:o._middleHandlerSize,i=o._isHorizontal?o._startHandlerSize/2:0,n=o._isHorizontal?o._stateScale:o._valueScale,r=o._isHorizontal?o._stateField:o._valueField;return n.scale(t[r])+o.getLayoutStartPoint().x+e+i},o._dataToPositionX2=function(t){var e=o._isHorizontal?0:o._middleHandlerSize,i=o._isHorizontal?o._startHandlerSize/2:0,n=o._isHorizontal?o._stateScale:o._valueScale,r=n.domain()[0];return n.scale(r)+o.getLayoutStartPoint().x+e+i},o._dataToPositionY=function(t){var e=o._isHorizontal?o._middleHandlerSize:0,i=o._isHorizontal?0:o._startHandlerSize/2,n=o._isHorizontal?o._valueScale:o._getPreviewStateScale(),r=o._isHorizontal?o._valueField:o._stateField;return n.scale(t[r])+o.getLayoutStartPoint().y+e+i},o._dataToPositionY2=function(t){var e=o._isHorizontal?o._middleHandlerSize:0,i=o._isHorizontal?0:o._startHandlerSize/2,n=o._isHorizontal?o._valueScale:o._getPreviewStateScale(),r=n.domain()[0];return n.scale(r)+o.getLayoutStartPoint().y+e+i},o._valueField="y",o._filterMode=null!==(s=e.filterMode)&&void 0!==s?s:"filter",o}return h(r,e),a(r,[{key:"_handleChange",value:function(e,i,n,a){if(_(r,"_handleChange",this,3)([e,i,n]),this._shouldChange)if(n&&this._component)this._component.setStartAndEnd(e,i);else{var o=this._relatedAxisComponent,s=j1(e,this._stateScale,N1(o,this._isHorizontal)),l=j1(i,this._stateScale,N1(o,this._isHorizontal));if(!M(s)||!M(l))return;this._start=e,this._end=i,(A(this._spec.updateDataAfterChange)?this._spec.updateDataAfterChange(e,i,s,l):this._handleStateChange(s,l,a))&&this.event.emit(t.ChartEvent.dataZoomChange,{model:this,value:{filterData:"axis"!==this._filterMode,start:e,end:i,startValue:this._startValue,endValue:this._endValue,newDomain:this._newDomain}})}}},{key:"_handleDataCollectionChange",value:function(){this._data.getDataView().reRunAllTransform(),this._initAfterLayout();var t=this._computeDomainOfValueScale();t&&(this._valueScale||(this._valueScale=new CR),this._valueScale.domain(t),this._updateValueScaleRange(),this._component&&this._createOrUpdateComponent(!0))}},{key:"created",value:function(){_(r,"created",this,3)([]),this._initValueScale()}},{key:"updateLayoutAttribute",value:function(){!1!==this._cacheVisibility&&_(r,"updateLayoutAttribute",this,3)([])}},{key:"_beforeLayoutEnd",value:function(){_(r,"_beforeLayoutEnd",this,3)([]);var t=this._relatedAxisComponent;(N1(t,this._isHorizontal)&&!this._isReverseCache||this._auto)&&(this._isReverseCache=N1(t,this._isHorizontal),this.effect.onZoomChange())}},{key:"_getComponentOnlySpecKeys",value:function(){return Z1}},{key:"clear",value:function(){if(this._component){var t=this.getContainer();this._component.removeAllChild(),t&&t.removeChild(this._component),this._component=null}_(r,"clear",this,3)([])}},{key:"getBoundsInRect",value:function(t){var e,i,n,r,a={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0},o=this._startHandlerSize*(null!==(e=this._spec.startHandler.style.scaleX)&&void 0!==e?e:1),s=this._startHandlerSize*(null!==(i=this._spec.startHandler.style.scaleY)&&void 0!==i?i:1),l=this._endHandlerSize*(null!==(n=this._spec.endHandler.style.scaleX)&&void 0!==n?n:1),u=this._endHandlerSize*(null!==(r=this._spec.endHandler.style.scaleY)&&void 0!==r?r:1),h=this._visible?this._isHorizontal?(o-this._startHandlerSize)/2+(l-this._endHandlerSize)/2:(Math.max(o,l)-this._width)/2:0,c=this._visible?this._isHorizontal?(Math.max(s,u)-this._height)/2:(s-this._startHandlerSize)/2+(u-this._endHandlerSize)/2:0;return this._isHorizontal?(a.y2=a.y1+this._height+c,a.x2=a.x1+t.width+h):(a.x2=a.x1+this._width+h,a.y2=a.y1+t.height+c),a}},{key:"setAttrFromSpec",value:function(){var t,e,i,n,a,o,s,l,u,h;_(r,"setAttrFromSpec",this,3)([]);var c=this._isHorizontal?Number(this._spec.height):Number(this._spec.width);this._backgroundSize=null!==(e=null===(t=this._spec.background)||void 0===t?void 0:t.size)&&void 0!==e?e:30,this._middleHandlerSize=this._computeMiddleHandlerSize(),C(null===(a=null===(n=null===(i=this._spec)||void 0===i?void 0:i.startHandler)||void 0===n?void 0:n.style)||void 0===a?void 0:a.size)&&(this._spec.startHandler.style.size=isNaN(c)?this._backgroundSize:c-this._middleHandlerSize),C(null===(l=null===(s=null===(o=this._spec)||void 0===o?void 0:o.endHandler)||void 0===s?void 0:s.style)||void 0===l?void 0:l.size)&&(this._spec.endHandler.style.size=isNaN(c)?this._backgroundSize:c-this._middleHandlerSize);var d=null===(u=this._spec.startHandler.style.visible)||void 0===u||u,v=null===(h=this._spec.endHandler.style.visible)||void 0===h||h;this._startHandlerSize=d?this._spec.startHandler.style.size:0,this._endHandlerSize=v?this._spec.endHandler.style.size:0,this._width=this._computeWidth(),this._height=this._computeHeight()}},{key:"_initValueScale",value:function(){var t=this._computeDomainOfValueScale();if(t){var e=new CR;e.domain(t),this._valueScale=e}}},{key:"_updateScaleRange",value:function(){this._updateStateScaleRange(),this._updateValueScaleRange()}},{key:"_updateStateScaleRange",value:function(){var t,e,i,n=this._startHandlerSize+this._endHandlerSize;if(this._stateScale){var r,a=this._isHorizontal?this.getLayoutRect().width-n:this.getLayoutRect().height-n,o=null!==(e=null===(t=this._relatedAxisComponent)||void 0===t?void 0:t.getScale().range())&&void 0!==e?e:[this._startHandlerSize/2,a+this._startHandlerSize/2],s=this._computeWidth(),l=this._computeHeight();r=this._isHorizontal?this._visible?[this._startHandlerSize/2,s-n+this._startHandlerSize/2]:o:this._visible?[this._startHandlerSize/2,l-n+this._startHandlerSize/2]:o,this._stateScale.range(r),null===(i=this._previewStateScale)||void 0===i||i.range(N1(this._relatedAxisComponent,this._isHorizontal)?r.reverse():r)}}},{key:"_updateValueScaleRange",value:function(){if(this._valueScale){var t=this._computeWidth(),e=this._computeHeight();this._isHorizontal?this._valueScale.range([e-this._middleHandlerSize,0]):"left"===this.layoutOrient?this._valueScale.range([t-this._middleHandlerSize,0]):this._valueScale.range([0,t-this._middleHandlerSize])}}},{key:"_computeDomainOfValueScale",value:function(){var t=this,e=this._data.getLatestData().map((function(e){return e[t._valueField]})),i=e.map((function(t){return 1*t}));return e.length?[ut(i),lt(i)]:null}},{key:"_isScaleValid",value:function(t){if(!t||!t.domain())return!1;var e,i=t.domain();return!(LI(t.type)&&i[0]===st(i)||FI(t.type)&&1===(e=i,e&&O(e)?Array.from(new Set(ot(e))):e).length)}},{key:"_getXScale",value:function(){return this._relatedAxisComponent.getScale().type===this.stateScale.type&&this._isHorizontal?this.stateScale:this._isHorizontal?this._stateScale:this._valueScale}},{key:"_getYScale",value:function(){return this._isHorizontal?this._valueScale:this._stateScale}},{key:"_computeMiddleHandlerSize",value:function(){var t,e,i,n,r=0;if(null===(e=null===(t=this._spec)||void 0===t?void 0:t.middleHandler)||void 0===e?void 0:e.visible){var a=null!==(i=this._spec.middleHandler.icon.style.size)&&void 0!==i?i:8,o=null!==(n=this._spec.middleHandler.background.size)&&void 0!==n?n:40;r+=Math.max(a,o)}return r}},{key:"_computeWidth",value:function(){return!1===this._visible?0:L(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:Math.max(this._startHandlerSize||0,this._endHandlerSize||0,this._backgroundSize||0)+this._middleHandlerSize}},{key:"_computeHeight",value:function(){return!1===this._visible?0:L(this._spec.height)?this._spec.height:this._isHorizontal?Math.max(this._startHandlerSize||0,this._endHandlerSize||0,this._backgroundSize||0)+this._middleHandlerSize:this.getLayoutRect().height}},{key:"_getAttrs",value:function(t){var e,i,n,r,a,o=null!==(e=this._spec)&&void 0!==e?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._computeWidth(),height:this._computeHeight()},showDetail:o.showDetail,brushSelect:null!==(i=o.brushSelect)&&void 0!==i&&i,zoomLock:null!==(n=o.zoomLock)&&void 0!==n&&n,minSpan:this._minSpan,maxSpan:this._maxSpan,delayType:o.delayType,delayTime:M(o.delayType)?null!==(r=o.delayTime)&&void 0!==r?r:30:0,realTime:null===(a=o.realTime)||void 0===a||a,previewData:t&&this._data.getLatestData(),previewPointsX:t&&this._dataToPositionX,previewPointsY:t&&this._dataToPositionY,tolerance:this._spec.tolerance,isReverse:N1(this._relatedAxisComponent,this._isHorizontal)},this._getComponentAttrs(t))}},{key:"_getLayoutAttrs",value:function(){return{position:{x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y},size:{width:this._computeWidth(),height:this._computeHeight()}}}},{key:"_createOrUpdateComponent",value:function(t){var e=this;if(this._visible){var i=!1!==this._spec.showBackgroundChart,n=this._getAttrs(i),r=this._relatedAxisComponent;if(this._component)this._component.setAttributes(n),t&&(this._component.setPreviewData(this._data.getDataView().latestData),i&&(this._isHorizontal?this._component.setPreviewPointsY1(this._dataToPositionY2):this._component.setPreviewPointsX1(this._dataToPositionX2),this._component.setStatePointToData((function(t){return j1(t,e._stateScale,N1(r,e._isHorizontal))}))));else{var a=this.getContainer();this._component=new oD(n),this._component.setPreviewData(this._data.getDataView().latestData),this._isHorizontal?i&&this._component.setPreviewPointsY1(this._dataToPositionY2):i&&this._component.setPreviewPointsX1(this._dataToPositionX2),this._component.setStatePointToData((function(t){return j1(t,e._stateScale,N1(r,e._isHorizontal))})),this._component.addEventListener("dataZoomChange",(function(t){var i=t.detail,n=i.start,r=i.end,a=i.tag;e._handleChange(n,r,void 0,a)})),a.add(this._component)}}}},{key:"_getComponentAttrs",value:function(t){var e,i,n,r,a,o,s,l,u,h,c,d=this._spec,v=d.middleHandler,f=void 0===v?{}:v,p=d.startText,g=void 0===p?{}:p,y=d.endText,m=void 0===y?{}:y,_=d.backgroundChart,b=void 0===_?{}:_,k=d.selectedBackgroundChart,x=void 0===k?{}:k;return{backgroundStyle:tH(null===(e=this._spec.background)||void 0===e?void 0:e.style),startHandlerStyle:tH(null===(i=this._spec.startHandler)||void 0===i?void 0:i.style),middleHandlerStyle:f.visible?{visible:!0,icon:tH(null===(n=f.icon)||void 0===n?void 0:n.style),background:{size:null===(r=f.background)||void 0===r?void 0:r.size,style:tH(null===(a=f.background)||void 0===a?void 0:a.style)}}:{visible:!1},endHandlerStyle:tH(null===(o=this._spec.endHandler)||void 0===o?void 0:o.style),startTextStyle:{padding:g.padding,formatMethod:this._getHandlerTextFormatMethod(g),textStyle:tH(g.style)},endTextStyle:{padding:m.padding,formatMethod:this._getHandlerTextFormatMethod(m),textStyle:tH(m.style)},selectedBackgroundStyle:tH(this._spec.selectedBackground.style),dragMaskStyle:tH(null===(s=this._spec.dragMask)||void 0===s?void 0:s.style),backgroundChartStyle:t?{line:Nz(tH(null===(l=b.line)||void 0===l?void 0:l.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},tH(null===(u=b.area)||void 0===u?void 0:u.style))}:{line:{visible:!1},area:{visible:!1}},selectedBackgroundChartStyle:t?{line:Nz(tH(null===(h=x.line)||void 0===h?void 0:h.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},tH(null===(c=x.area)||void 0===c?void 0:c.style))}:{line:{visible:!1},area:{visible:!1}},disableTriggerEvent:this._option.disableTriggerEvent}}},{key:"_getHandlerTextFormatMethod",value:function(t){var e=t.formatMethod,i=t.formatter,n=OU(e,i).formatFunc;return n?function(t){return n(t,{label:t},i)}:void 0}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._component]}},{key:"onDataUpdate",value:function(){_(r,"onDataUpdate",this,3)([]),this._previewStateScale!==this._stateScale&&(this._previewStateScale=null)}},{key:"_getPreviewStateScale",value:function(){return this._previewStateScale||(N1(this._relatedAxisComponent,this._isHorizontal)?(this._previewStateScale=this._stateScale.clone(),this._previewStateScale.range(this._stateScale.range().reverse())):this._previewStateScale=this._stateScale),this._previewStateScale}}])}(Y1);J1.type=c.dataZoom,J1.transformerConstructor=K1,J1.builtInTheme={dataZoom:q1},J1.specKey="dataZoom";var Q1={horizontal:{height:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}},vertical:{width:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}}},$1={width:!0,height:!0,rail:!0,slider:!0,round:!0,innerPadding:!0,minSliderSize:!0},t2=function(e){function r(e,a){var o,s;return n(this,r),(o=i(this,r,[e,a])).type=c.scrollBar,o.name=c.scrollBar,o.specKey="scrollBar",o.layoutZIndex=t.LayoutZIndex.DataZoom,o.layoutLevel=t.LayoutLevel.DataZoom,o.layoutType="region-relative",o._filterMode=null!==(s=e.filterMode)&&void 0!==s?s:"axis",o}return h(r,e),a(r,[{key:"_handleChange",value:function(e,i,n){_(r,"_handleChange",this,3)([e,i,n]);var a=GF(this._start,e)&&GF(this._end,i);if(this._shouldChange&&(!a||!1===this._spec.realTime)){n&&this._component&&this._component.setAttribute("range",[e,i]),this._start=e,this._end=i;var o=this._relatedAxisComponent,s=N1(o,this._isHorizontal),l=j1(e,this._stateScale,s),u=j1(i,this._stateScale,s);(A(this._spec.updateDataAfterChange)?this._spec.updateDataAfterChange(e,i,l,u):this._handleStateChange(l,u))&&this.event.emit(t.ChartEvent.scrollBarChange,{model:this,value:{filterData:"axis"!==this._filterMode,start:this._start,end:this._end,startValue:this._startValue,endValue:this._endValue,newDomain:this._newDomain}})}}},{key:"_handleDataCollectionChange",value:function(){this._spec.auto&&this._data.getDataView().reRunAllTransform()}},{key:"_getComponentOnlySpecKeys",value:function(){return $1}},{key:"_beforeLayoutEnd",value:function(){var t,e;_(r,"_beforeLayoutEnd",this,3)([]),null===(e=(t=this.effect).onZoomChange)||void 0===e||e.call(t)}},{key:"onLayoutEnd",value:function(){this._updateComponentBounds(),_(r,"onLayoutEnd",this,3)([])}},{key:"_updateScaleRange",value:function(){}},{key:"_updateComponentBounds",value:function(){this._component&&this._component.setAttributes({x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y,width:this.getLayoutRect().width,height:this.getLayoutRect().height})}},{key:"_computeWidth",value:function(){return!1===this._visible?0:L(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:12}},{key:"_computeHeight",value:function(){return!1===this._visible?0:L(this._spec.height)?this._spec.height:this._isHorizontal?12:this.getLayoutRect().height}},{key:"_getAttrs",value:function(){var t,e,i,n,r,a,o;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:null===(t=this._spec)||void 0===t?void 0:t.delayType,delayTime:M(null===(e=this._spec)||void 0===e?void 0:e.delayType)?null!==(n=null===(i=this._spec)||void 0===i?void 0:i.delayTime)&&void 0!==n?n:30:0,realTime:null===(a=null===(r=this._spec)||void 0===r?void 0:r.realTime)||void 0===a||a,minSliderSize:null===(o=this._spec)||void 0===o?void 0:o.minSliderSize},this._getComponentAttrs())}},{key:"_createOrUpdateComponent",value:function(){var t=this,e=this._getAttrs();if(this._component)this._component.setAttributes(e);else{var i=this.getContainer();this._component=new Nw(e),this._component.addEventListener("scrollDrag",(function(e){var i=e.detail.value;t._handleChange(i[0],i[1])})),this._component.addEventListener("scrollUp",(function(e){var i=e.detail.value;t._handleChange(i[0],i[1])})),i.add(this._component)}}},{key:"_getComponentAttrs",value:function(){var t=this._spec,e=t.rail,i=t.slider,n=t.innerPadding,r={};return C(n)||(r.padding=n),W(null==e?void 0:e.style)||(r.railStyle=tH(e.style)),W(null==i?void 0:i.style)||(r.sliderStyle=tH(i.style)),r.disableTriggerEvent=this._option.disableTriggerEvent,r}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._component]}}])}(Y1);t2.type=c.scrollBar,t2.builtInTheme={scrollBar:Q1},t2.specKey="scrollBar";var e2=function(t,e){var i=A(e)?e():e,n=i.datum,r=i.title,a=i.content,o=[],s=n.call(null);return r.visible&&o.push({type:"title",index:0,datum:s,spec:r}),ot(a).forEach((function(t,e){t.visible&&o.push({type:"content",index:e,datum:s,spec:t})})),o},i2=function(t,e){return{fontSize:{type:"token",key:t},fill:{type:"palette",key:e},fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}},n2={title:{visible:!0,autoLimit:!1,autoFit:!1,style:i2("l1FontSize","primaryFontColor")},content:{visible:!0,style:i2("l2FontSize","tertiaryFontColor")}},r2=function(e){function o(){var e;return n(this,o),(e=i(this,o,arguments)).type=c.indicator,e.name=c.indicator,e.specKey="indicator",e.layoutType="none",e.layoutZIndex=t.LayoutZIndex.Indicator,e.layoutLevel=t.LayoutLevel.Indicator,e._gap=0,e._activeDatum=null,e}return h(o,e),a(o,[{key:"created",value:function(){_(o,"created",this,3)([]),this.initData(),this.initEvent()}},{key:"setAttrFromSpec",value:function(){_(o,"setAttrFromSpec",this,3)([]),this._gap=this._spec.gap||0,this._title=this._spec.title,this._content=ot(this._spec.content),this._regions=this._option.getRegionsInUserIdOrIndex(ot(this._spec.regionId),ot(this._spec.regionIndex))}},{key:"_compareSpec",value:function(t,e){var i=_(o,"_compareSpec",this,3)([t,e]);return!!nt(e,t)||i.reMake||i.reCompile||(i.change=!0,i.reRender=!0,i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0})),i}},{key:"initEvent",value:function(){var t=this;this._option.disableTriggerEvent||"none"!==this._spec.trigger&&("hover"===this._spec.trigger?(this.event.on("element-highlight:start",(function(e){var i=e.graphics[0];t.isRelativeModel(i)&&t.updateDatum(nH(i))})),this.event.on("element-highlight:reset",(function(e){t._activeDatum&&t.updateDatum(null)}))):(this.event.on("element-select:start",(function(e){var i=e.graphics[0];t.isRelativeModel(i)&&t.updateDatum(nH(i))})),this.event.on("element-select:reset",(function(e){t._activeDatum&&t.updateDatum(null)}))))}},{key:"updateDatum",value:function(t){this._activeDatum=t,this._displayData.updateData();var e=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(e)}},{key:"initData",value:function(){var t=this;fH(this._option.dataSet,"indicatorFilter",e2);var e=new Ko(this._option.dataSet,{name:"".concat(this.type,"_").concat(this.id,"_data")});e.transform({type:"indicatorFilter",options:function(){return{title:t._title,content:t._content,datum:function(){return t._activeDatum}}}}),e.target.addListener("change",this.updateDatum.bind(this)),this._displayData=new WN(this._option,e)}},{key:"updateLayoutAttribute",value:function(){var t=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(t),_(o,"updateLayoutAttribute",this,3)([])}},{key:"_getIndicatorAttrs",value:function(){var t=this;if(!1===this._spec.visible||!1===this._spec.fixed&&null===this._activeDatum)return{visible:!1};var e=this._regions[0],i=e.getLayoutRect(),n=i.width,a=i.height,o=e.getLayoutStartPoint(),s=o.x,l=o.y,u=this._spec,h=u.content,c=u.offsetX,d=u.offsetY,v=u.limitRatio,f=u.title,p=r(u,["content","offsetX","offsetY","limitRatio","title"]),g=[];return ot(h).forEach((function(e){var i=Nz({},t._theme.content,e);g.push({visible:!1!==i.visible&&(!i.field||null!==t._activeDatum),space:i.space||t._gap,autoLimit:i.autoLimit,autoFit:i.autoFit,fitPercent:i.fitPercent,fitStrategy:i.fitStrategy,style:Object.assign(Object.assign({},$j($(i.style,["text"]),t._activeDatum)),{text:t._createText(i.field,i.style.text)})})})),Object.assign({visible:!0,size:{width:n,height:a},zIndex:this.layoutZIndex,x:s,y:l,dx:c?Iz(c,this._computeLayoutRadius()):0,dy:d?Iz(d,this._computeLayoutRadius()):0,limitRatio:v||1/0,title:{visible:!1!==f.visible&&(!M(f.field)||null!==this._activeDatum),space:f.space||this._gap,autoLimit:f.autoLimit,autoFit:f.autoFit,fitPercent:f.fitPercent,fitStrategy:f.fitStrategy,style:Object.assign(Object.assign({},$j($(f.style,["text"]),this._activeDatum)),{text:this._createText(f.field,f.style.text)})},content:g},p)}},{key:"_createOrUpdateIndicatorComponent",value:function(t){var e=this;if(!1===t.visible)return this._indicatorComponent&&this._indicatorComponent.parent&&this._indicatorComponent.parent.removeChild(this._indicatorComponent),void(this._indicatorComponent=null);if(this._indicatorComponent)nt(t,this._cacheAttrs)||this._indicatorComponent.setAttributes(t);else{var i=this.getContainer(),n=new bF(t);n.name="indicator",i.add(n),this._indicatorComponent=n,this._indicatorComponent.on("*",(function(t,i){return e._delegateEvent(e._indicatorComponent,t,i)}))}this._cacheAttrs=t}},{key:"_createText",value:function(t,e){var i;return t?this._activeDatum?this._activeDatum[t]:"":A(e)?null!==(i=e(this._activeDatum,void 0))&&void 0!==i?i:"":null!=e?e:""}},{key:"_computeLayoutRadius",value:function(){var t=this._regions[0].getLayoutRect(),e=t.width,i=t.height;return Math.min(e/2,i/2)}},{key:"isRelativeModel",value:function(t){return this._regions.some((function(e){return!!e.getSeriesInId(t.context.modelId)}))}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._indicatorComponent]}},{key:"clear",value:function(){this._cacheAttrs=null,_(o,"clear",this,3)([])}},{key:"getIndicatorComponent",value:function(){return this._indicatorComponent}}],[{key:"getSpecInfo",value:function(t){return IU(t,this.specKey,this.type,(function(t){return t&&!1!==t.visible}))}}])}(DW);r2.type=c.indicator,r2.builtInTheme={indicator:n2},r2.specKey="indicator";var a2=["sum","average","min","max","variance","standardDeviation","median"];function o2(t,e,i){if(!i)return!1;var n=t.map((function(t){return 1*t})),r=ut(n),a=lt(n);return e<r||e>a}function s2(t,e){return t?"".concat(t,"_").concat(e,"_extend"):"marker_".concat(e,"_extend")}function l2(t,e,i,n,r,a,o){var s,l,u=n.relativeSeries;return L(t.x)&&o2(e,t.x,i)&&(null===(l=null==u?void 0:(s=u.getXAxisHelper()).setExtendDomain)||void 0===l||l.call(s,s2(o,"xAxis"),t.x)),Mz(t.x)?d2(t.x,r)+a.x:v2(u.getXAxisHelper(),[t.x])+a.x}function u2(t,e,i,n,r,a,o){var s,l,u=n.relativeSeries;return L(t.y)&&o2(e,t.y,i)&&(null===(l=null===(s=u.getYAxisHelper())||void 0===s?void 0:s.setExtendDomain)||void 0===l||l.call(s,s2(o,"yAxis"),t.y)),Mz(t.y)?d2(t.y,r)+a.y:v2(u.getYAxisHelper(),[t.y])+a.y}function h2(t,e,i,n,r){var a,o,s=n.relativeSeries;return L(t.angle)&&o2(e,t.angle,i)&&(null===(o=null===(a=s.angleAxisHelper)||void 0===a?void 0:a.setExtendDomain)||void 0===o||o.call(a,s2(r,"angleAxis"),t.angle)),v2(s.angleAxisHelper,[t.angle])}function c2(t,e,i,n,r){var a,o,s=n.relativeSeries;return L(t.radius)&&o2(e,t.radius,i)&&(null===(o=null===(a=s.radiusAxisHelper)||void 0===a?void 0:a.setExtendDomain)||void 0===o||o.call(a,s2(r,"radiusAxis"),t.radius)),v2(s.radiusAxisHelper,[t.radius])}function d2(t,e){return Number(t.substring(0,t.length-1))*e/100}function v2(t,e){var i=t.getScale(0);return LI(i.type)&&i.domain()[0]===i.domain()[1]&&e[0]!==i.domain()[0]?NaN:t.dataToPosition(e)}function f2(t){return a2.includes(t)}function p2(t,e,i,n,r){var a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=arguments.length>6?arguments[6]:void 0,s=e.getRegion(),l=s.getLayoutStartPoint(),u=i.getRegion(),h=u.getLayoutStartPoint(),c=Math.abs(Math.min(l.x,h.x)-Math.max(l.x+s.getLayoutRect().width,h.x+u.getLayoutRect().width)),d=Math.abs(Math.min(l.y,h.y)-Math.max(l.y+s.getLayoutRect().height,h.y+u.getLayoutRect().height)),v={relativeSeries:n,startRelativeSeries:e,endRelativeSeries:i},f=[],p=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,g=n.getXAxisHelper(),y=n.getYAxisHelper(),m=g.getScale(0).domain(),_=y.getScale(0).domain(),b=a&&!g.isContinuous&&!!g.getBandwidth,k=a&&!y.isContinuous&&!!y.getBandwidth,x={min:null,max:null},S={min:null,max:null};return p.forEach((function(t){var e,i,n=M(t.x),a=M(t.y);if(n&&a)e=l2(t,m,r,v,c,l,o),i=u2(t,_,r,v,d,l,o),g2(e,b,x,f.length),g2(i,k,S,f.length),f.push([{x:e,y:i}]);else if(n){e=l2(t,m,r,v,c,l,o),i=Math.max(l.y+s.getLayoutRect().height,h.y+u.getLayoutRect().height);var p=Math.min(l.y,h.y);g2(e,b,x,f.length),f.push([{x:e,y:i},{x:e,y:p}])}else if(a){e=Math.min(l.x,h.x),i=u2(t,_,r,v,d,l,o);var g=Math.max(l.x+s.getLayoutRect().width,h.x+u.getLayoutRect().width);g2(i,k,S,f.length),f.push([{x:e,y:i},{x:g,y:i}])}})),function(t,e,i,n,r){if(n.min||n.max){var a=e.getBandwidth(0)*(1+e.getScale(0).paddingInner());n.min&&t[n.min.index].forEach((function(t){return t.x-=a/2})),n.max&&t[n.max.index].forEach((function(t){return t.x+=a/2}))}if(r.min||r.max){var o=i.getBandwidth(0)*(1+i.getScale(0).paddingInner());r.min&&t[r.min.index].forEach((function(t){return t.y-=o/2})),r.max&&t[r.max.index].forEach((function(t){return t.y+=o/2}))}}(f,g,y,x,S),f}function g2(t,e,i,n){return e&&((null===i.min||i.min.value>t)&&(i.min={value:t,index:n}),(null===i.max||i.max.value<t)&&(i.max={value:t,index:n})),t}function y2(t,e,i,n,r,a){var o={relativeSeries:n,startRelativeSeries:e,endRelativeSeries:i},s=[],l=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,u=n.angleAxisHelper.getScale(0).domain(),h=n.radiusAxisHelper.getScale(0).domain(),c=Math.min(n.getRegion().getLayoutRect().width/2,n.getRegion().getLayoutRect().height/2);return l.forEach((function(t){var e=M(t.angle),i=M(t.radius);if(e&&i){var n=h2(t,u,r,o,a),l=c2(t,h,r,o,a);s.push([{angle:n,radius:l}])}else if(e){var d=h2(t,u,r,o,a);s.push([{angle:d,radius:-c},{angle:d,radius:c}])}else if(i){var v=c2(t,h,r,o,a);s.push([{radius:v,angle:0},{radius:v,angle:2*Math.PI}])}})),s}function m2(t,e,i,n,r){var a=[],o=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,s=O(n);return o.forEach((function(t,o){var l,u,h,c,d=(null==t?void 0:t.getRefRelativeSeries)?t.getRefRelativeSeries():e,v=d.getRegion(),f=v.getLayoutStartPoint(),p=v.getLayoutRect(),g=p.width,y=p.height,m=0,_=0;if(n){var b=s?n[o]:n,k=b.x,x=b.y;k&&(m=Mz(k)?Number(k.substring(0,k.length-1))*g/100:k),x&&(_=Mz(x)?Number(x.substring(0,x.length-1))*y/100:x)}var S=d.getXAxisHelper().getScale(0).domain(),A=d.getYAxisHelper().getScale(0).domain(),C=ot(t.x),M=ot(t.y);1===C.length&&L(C[0])&&o2(S,C[0],i)&&(null===(u=null===(l=d.getXAxisHelper())||void 0===l?void 0:l.setExtendDomain)||void 0===u||u.call(l,s2(r,"xAxis"),C[0])),1===M.length&&L(M[0])&&o2(A,M[0],i)&&(null===(c=null===(h=d.getYAxisHelper())||void 0===h?void 0:h.setExtendDomain)||void 0===c||c.call(h,s2(r,"yAxis"),M[0])),a.push({x:v2(d.getXAxisHelper(),C)+f.x+m,y:v2(d.getYAxisHelper(),M)+f.y+_})})),a}function _2(t,e,i,n){var r=[];return(t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData).forEach((function(t){var a,o,s,l,u=(null==t?void 0:t.getRefRelativeSeries)?t.getRefRelativeSeries():e,h=u.angleAxisHelper.getScale(0).domain(),c=u.radiusAxisHelper.getScale(0).domain(),d=ot(t.angle),v=ot(t.radius);1===d.length&&L(d[0])&&o2(h,d[0],i)&&(null===(o=null===(a=u.angleAxisHelper)||void 0===a?void 0:a.setExtendDomain)||void 0===o||o.call(a,s2(n,"angleAxis"),d[0])),1===v.length&&L(v[0])&&o2(c,v[0],i)&&(null===(l=null===(s=u.radiusAxisHelper)||void 0===s?void 0:s.setExtendDomain)||void 0===l||l.call(s,s2(n,"radiusAxis"),v[0])),r.push({angle:v2(u.angleAxisHelper,d),radius:v2(u.radiusAxisHelper,v)})})),r}function b2(t,e,i){var n=t.x,r=t.y;return Mz(n)&&(n=d2(n,e)),Mz(r)&&(r=d2(r,i)),{x:n,y:r}}function k2(t,e,i){var n;if(n=A(t)?ot(t(e.getData().getLatestData(),e)):ot(t),i){var r=e.getRegion(),a=r.getLayoutStartPoint(),o=a.x,s=a.y,l=r.getLayoutRect(),u=l.width,h=l.height;return n.map((function(t){var e=b2(t,u,h),i=e.x,n=e.y;return{x:i+=o,y:n+=s}}))}var c=e.getOption().getChart().getViewRect(),d=c.width,v=c.height;return n.map((function(t){return b2(t,d,v)}))}function x2(t){var e=1/0,i=-1/0,n=1/0,r=-1/0;return t.forEach((function(t){var a=t.getLayoutStartPoint(),o=t.getLayoutRect();a.x<e&&(e=a.x),a.x+o.width>i&&(i=a.x+o.width),a.y<n&&(n=a.y),a.y+o.height>r&&(r=a.y+o.height)})),{minX:e,maxX:i,minY:n,maxY:r}}function S2(t,e,i){var n=t.labelBackground,a=void 0===n?{}:n,o=t.style,s=t.shape,l=r(t,["labelBackground","style","shape"]);if(!1!==t.visible){var u=l;return(null==s?void 0:s.visible)?u.shape=Object.assign({visible:!0},tH(s.style)):u.shape={visible:!1},!1!==a.visible?(u.panel=Object.assign({visible:!0,customShape:a.customShape},C2(tH(a.style),e,i)),M(a.padding)&&(u.padding=bi(a.padding))):(u.panel={visible:!1},u.padding=0),o&&(u.textStyle=C2(tH(o),e,i)),u}return{visible:!1}}function A2(t,e,i){for(var n in t)A(t[n])&&(t[n]=t[n](e,i));return t}function C2(t,e,i){return A(t)?t(e,i):t}function M2(t,e){return A(t)?t(e):t}function T2(t,e,i){return M(t)?"regionLeft"===e?i.getLayoutStartPoint().x-t.x:"regionRight"===e?i.getLayoutStartPoint().x+i.getLayoutRect().width-t.x:"regionTop"===e?i.getLayoutStartPoint().y-t.y:"regionBottom"===e?i.getLayoutStartPoint().y+i.getLayoutRect().height-t.y:e:e}function w2(t){return{isXProcess:M(t.x),isYProcess:M(t.y),isX1Process:M(t.x1),isY1Process:M(t.y1),isAngleProcess:M(t.angle),isRadiusProcess:M(t.radius),isAngle1Process:M(t.angle1),isRadius1Process:M(t.radius1),isCoordinatesProcess:M(t.coordinates),isValidProcess:M(t.process)}}function E2(t){var e=w2(t),i=e.isXProcess,n=e.isYProcess,r=e.isX1Process,a=e.isY1Process,o=e.isAngleProcess,s=e.isRadiusProcess,l=e.isAngle1Process,u=e.isRadius1Process,h=e.isCoordinatesProcess,c=e.isValidProcess;return{doXProcess:i&&!n&&!a,doXYY1Process:i&&n&&a,doYProcess:n&&!i&&!r,doYXX1Process:n&&i&&r,doXYProcess:i&&n&&r&&a,doAngleProcess:o&&!l&&!s&&!u,doRadiusProcess:s&&!u&&!o&&!l,doAngRadRad1Process:o&&!l&&s&&u,doRadAngAng1Process:s&&o&&l&&!u,doRadAngProcess:o&&s&&l&&u,doCoordinatesProcess:h&&(!c||"process"in t&&"xy"in t.process)}}function B2(t){var e=w2(t),i=e.isXProcess,n=e.isYProcess,r=e.isX1Process,a=e.isY1Process,o=e.isAngleProcess,s=e.isRadiusProcess,l=e.isAngle1Process,u=e.isRadius1Process;return{doXProcess:i&&r&&!n&&!a,doYProcess:n&&a&&!i&&!r,doXYProcess:i&&r&&n&&a,doAngleProcess:o&&l&&!s&&!u,doRadiusProcess:s&&u&&!o&&!l,doRadAngProcess:o&&s&&l&&u,doCoordinatesProcess:e.isCoordinatesProcess}}function P2(t){return{doXYProcess:M(t.x)&&M(t.y),doPolarProcess:M(t.angle)&&M(t.radius),doGeoProcess:M(t.areaName)}}function O2(t,e){var i;if(e.coordinates){var n,a,o=e,s=o.coordinates,l=o.coordinateType,u=o.getSeriesByIdOrIndex,h=r(o,["coordinates","coordinateType","getSeriesByIdOrIndex"]);if(A(s)){var c=e.getRelativeSeries();n=s(c.getData().getLatestData(),c)}else n=s;i=(n=ot(n)).map((function(t){var e=u(t.refRelativeSeriesId,t.refRelativeSeriesIndex);if("cartesian"===l){var i=e.getSpec(),n=i.xField,r=i.yField,o=t.xFieldDim,s=t.xFieldIndex,c=t.yFieldDim,d=t.yFieldIndex,v=n;M(s)&&(v=ot(n)[s]),o&&ot(n).includes(o)&&(v=o);var f=r;M(d)&&(f=ot(r)[d]),c&&ot(r).includes(c)&&(f=c),a=Object.assign({x:void 0,y:void 0},h),P(t[v])&&f2(t[v])?a.x={field:v,aggrType:t[v]}:a.x=ot(v).map((function(e){return t[e]})),P(t[f])&&f2(t[f])?a.y={field:f,aggrType:t[f]}:a.y=ot(f).map((function(e){return t[e]}))}else if("polar"===l){var p=e.getSpec(),g=p.valueField,y=p.categoryField,m=t.angleFieldDim,_=t.angleFieldIndex,b=y;M(_)&&(b=ot(y)[_]),m&&ot(y).includes(m)&&(b=m);var k=g;a=Object.assign({angle:void 0,radius:void 0},h),P(t[b])&&f2(t[b])?a.angle={field:b,aggrType:t[b]}:a.angle=ot(b).map((function(e){return t[e]})),P(t[k])&&f2(t[k])?a.radius={field:k,aggrType:t[k]}:a.radius=ot(k).map((function(e){return t[e]}))}return a.getRefRelativeSeries=function(){return e},a}))}else i=e;var d=[];return i.forEach((function(e){var i={x:null,y:null,angle:null,radius:null,areaName:null};if(M(e.x)){var n=e.x;O(n)?i.x=n.map((function(i){return R2(i,t,e)})):i.x=R2(n,t,e)}if(M(e.y)){var r=e.y;O(r)?i.y=r.map((function(i){return R2(i,t,e)})):i.y=R2(r,t,e)}if(M(e.angle)){var a=e.angle;O(a)?i.angle=a.map((function(i){return R2(i,t,e)})):i.angle=R2(a,t,e)}if(M(e.radius)){var o=e.radius;O(o)?i.radius=o.map((function(i){return R2(i,t,e)})):i.radius=R2(o,t,e)}if(M(e.areaName)){var s=e.areaName;i.areaName=R2(s,t,e)}e.getRefRelativeSeries&&(i.getRefRelativeSeries=e.getRefRelativeSeries),d.push(i)})),d}var I2={min:function(t,e){return YF(t[0].latestData,e.field)},max:function(t,e){return KF(t[0].latestData,e.field)},sum:function(t,e){return XF(t[0].latestData,e.field)},average:function(t,e){return qF(t[0].latestData,e.field)},variance:function(t,e){return ZF(t[0].latestData,e.field)},standardDeviation:function(t,e){return function(t,e){return Math.sqrt(ZF(t,e))}(t[0].latestData,e.field)},median:function(t,e){return function(t,e){return At(t.map((function(t){return t[e]})))}(t[0].latestData,e.field)}};function R2(t,e,i){var n=i.getRelativeSeries(),r=i.getStartRelativeSeries(),a=i.getEndRelativeSeries(),o=n.getData().getLatestData(),s=r.getData().getLatestData(),l=a.getData().getLatestData();if(A(t))return t(o,s,l,n,r,a);if(E(t)){var u=t.aggrType,h=t.field;return I2[u](e,{field:h})}return t}function L2(t,e){if(e&&e.getRelativeSeries){var i=e.getRelativeSeries();if(i){var n=i.getViewData();return n&&n.latestData&&n.latestData.length?t:[]}}return t}var D2=function(t){var e,i=null===(e=null==t?void 0:t.dataSet)||void 0===e?void 0:e.dataViewMap;return i?Object.values(i).filter(Boolean):[]},F2=function(t,e){var i,n;null===(i=null==t?void 0:t.target)||void 0===i||i.removeListener("change",e.reRunAllTransform),null===(n=null==t?void 0:t.target)||void 0===n||n.removeListener("markRunning",e.markRunning)},z2=function(t){if(t){D2(t).forEach((function(e){F2(e,t)}));var e=null==t?void 0:t.rawData;Array.isArray(e)&&e.forEach((function(e){F2(e,t)}))}},j2=function(t,e){if(t){var i=new Set(D2(t)),n=[],r=function(t){var a=null==t?void 0:t.rawData;Array.isArray(a)&&a.forEach((function(t){i.has(t)&&e(t)&&!n.includes(t)&&(n.push(t),r(t))}))};r(t),function(t){var e=Array.from(new Set(t.filter(Boolean)));e.length&&(e.forEach(z2),e.forEach((function(t){var e;null===(e=t.destroy)||void 0===e||e.call(t)})))}([t].concat(n))}},H2="__vchart_marker_coordinate__",N2=["coordinate","coordinates","x","y","x1","y1","angle","angle1","radius","radius1"],U2=["position","positions","coordinatesOffset","regionRelative"],V2=function(t){return Array.isArray(t)?t.map(V2):t&&"object"==x(t)?"function"!=typeof t.formatMethod?t:Object.assign(Object.assign({},t),{formatMethod:"__vchart_marker_format_method__"}):t},W2=function(t){if(Array.isArray(t))return t.map(W2);if(!t||"object"!=x(t))return t;var e=Object.assign({},t);return Object.keys(e).forEach((function(t){"style"===t||t.endsWith("Style")?e[t]="__vchart_marker_style__":e[t]=W2(e[t])})),e},G2=function(t,e){var i;if(!t||"object"!=x(t))return t;var n=Object.assign({},t);e.normalizeDomainPosition&&N2.forEach((function(t){n[t]=H2})),e.normalizeAutoRange&&"autoRange"in n&&(n.autoRange="__vchart_marker_auto_range__"),U2.forEach((function(t){t in n&&(n[t]=H2)})),"label"in n&&(n.label=V2(n.label)),Object.keys(n).forEach((function(t){n[t]=W2(n[t])}));var r=null===(i=n.itemContent)||void 0===i?void 0:i.text;return r&&"object"==x(r)&&(n.itemContent=Object.assign(Object.assign({},n.itemContent),{text:Object.assign(Object.assign({},V2(r)),{text:"__vchart_marker_text__"})})),n},Y2=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).layoutType="none",t._markerDataChangeHandler=null,t._markerDataOwned=!1,t._layoutOffsetX=0,t._layoutOffsetY=0,t}return h(e,t),a(e,[{key:"getRelativeSeries",value:function(){return this._relativeSeries}},{key:"getMarkerData",value:function(){return this._markerData}},{key:"getMarkAttributeContext",value:function(){return this._markAttributeContext}},{key:"_buildMarkerAttributeContext",value:function(){this._markAttributeContext={relativeSeries:this._relativeSeries,startRelativeSeries:this._startRelativeSeries,endRelativeSeries:this._endRelativeSeries,vchart:this._option.globalInstance}}},{key:"created",value:function(){_(e,"created",this,3)([]),this._bindSeries(),this._initDataView(),this.initEvent(),this._buildMarkerAttributeContext()}},{key:"_getAllRelativeSeries",value:function(){var t=this;return{getRelativeSeries:function(){return t._relativeSeries},getStartRelativeSeries:function(){return t._startRelativeSeries},getEndRelativeSeries:function(){return t._endRelativeSeries}}}},{key:"_getAutoRangeExtendDomainKeyPrefix",value:function(){return"marker_".concat(this.type,"_").concat(this.id)}},{key:"_getAutoRangeExtendDomainKey",value:function(t){return"".concat(this._getAutoRangeExtendDomainKeyPrefix(),"_").concat(t,"_extend")}},{key:"_clearAutoRangeExtendDomain",value:function(){var t,e,i=this;ot(null===(e=(t=this._option).getAllSeries)||void 0===e?void 0:e.call(t)).forEach((function(t){var e,n,r,a,o,s,l,u,h,c;null===(r=null===(n=null===(e=null==t?void 0:t.getXAxisHelper)||void 0===e?void 0:e.call(t))||void 0===n?void 0:n.setExtendDomain)||void 0===r||r.call(n,i._getAutoRangeExtendDomainKey("xAxis"),void 0),null===(s=null===(o=null===(a=null==t?void 0:t.getYAxisHelper)||void 0===a?void 0:a.call(t))||void 0===o?void 0:o.setExtendDomain)||void 0===s||s.call(o,i._getAutoRangeExtendDomainKey("yAxis"),void 0),null===(u=null===(l=null==t?void 0:t.angleAxisHelper)||void 0===l?void 0:l.setExtendDomain)||void 0===u||u.call(l,i._getAutoRangeExtendDomainKey("angleAxis"),void 0),null===(c=null===(h=null==t?void 0:t.radiusAxisHelper)||void 0===h?void 0:h.setExtendDomain)||void 0===c||c.call(h,i._getAutoRangeExtendDomainKey("radiusAxis"),void 0)}))}},{key:"_updateMarkerLayout",value:function(){this._clearAutoRangeExtendDomain(),this._markerLayout()}},{key:"_getFieldInfoFromSpec",value:function(t,e,i){var n={x:"xField",y:"yField",radius:"valueField",angle:"categoryField",areaName:"nameField"};return P(e)&&f2(e)?{field:i.getSpec()[n[t]],aggrType:e}:e}},{key:"_processSpecByDims",value:function(t){var e=this,i=this._relativeSeries,n={};return t.forEach((function(t){return n[t.dim]=e._getFieldInfoFromSpec(t.dim,t.specValue,i)})),Object.assign(Object.assign({},n),this._getAllRelativeSeries())}},{key:"_processSpecCoo",value:function(t){var e=this;return Object.assign(Object.assign({coordinates:t.coordinates||t.coordinate},this._getAllRelativeSeries()),{getSeriesByIdOrIndex:function(t,i){return e._getSeriesByIdOrIndex(t,i)},coordinateType:this.coordinateType})}},{key:"_getRelativeDataView",value:function(){if(this._specifiedDataSeries){var t=[];ot(this._specifiedDataSeries).forEach((function(e){t=t.concat(e.getViewData().latestData)}));var e=new Yo;return e.registerParser("array",d),new Ko(e).parse(t,{type:"array"})}return this._relativeSeries.getViewData()}},{key:"_setMarkerData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._releaseMarkerData(),this._markerData=t,this._markerDataOwned=e}},{key:"_bindMarkerDataChange",value:function(){var t,e=this;(null===(t=this._markerData)||void 0===t?void 0:t.target)&&(this._markerDataChangeHandler=function(){e._updateMarkerLayout()},this._markerData.target.on("change",this._markerDataChangeHandler))}},{key:"_releaseMarkerData",value:function(){var t=this,e=this._markerData;(null==e?void 0:e.target)&&this._markerDataChangeHandler&&e.target.removeListener("change",this._markerDataChangeHandler),this._markerDataChangeHandler=null,this._markerDataOwned&&j2(e,(function(e){return e.name==="".concat(t.type,"_").concat(t.id,"_data")})),this._markerData=null,this._markerDataOwned=!1}},{key:"updateLayoutAttribute",value:function(){var t,i,n,r=this;if(null===(t=this._spec.visible)||void 0===t||t){if(!this._markerComponent){var a=this._createMarkerComponent();a.name=null!==(i=this._spec.name)&&void 0!==i?i:this.type,a.id=null!==(n=this._spec.id)&&void 0!==n?n:"".concat(this.type,"-").concat(this.id),this._markerComponent=a,this.getContainer().add(this._markerComponent),this._markerComponent.on("*",(function(t,e){r._delegateEvent(r._markerComponent,t,e,null,r.getMarkerData.bind(r))}))}this._updateMarkerLayout()}_(e,"updateLayoutAttribute",this,3)([])}},{key:"_getSeriesByIdOrIndex",value:function(t,e){var i,n,r;return(r=null===(i=this._option.getSeriesInUserIdOrIndex(M(t)?[t]:[],[e]))||void 0===i?void 0:i[0])||(r=null!==(n=this._relativeSeries)&&void 0!==n?n:this._getFirstSeries()),r}},{key:"_bindSeries",value:function(){var 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),t.specifiedDataSeriesIndex&&"all"===t.specifiedDataSeriesIndex||t.specifiedDataSeriesId&&"all"===t.specifiedDataSeriesId?this._specifiedDataSeries=this._option.getAllSeries():(t.specifiedDataSeriesIndex||t.specifiedDataSeriesId)&&(this._specifiedDataSeries=this._getSeriesByIdOrIndex(t.specifiedDataSeriesId,t.specifiedDataSeriesIndex))}},{key:"initEvent",value:function(){"cartesian"!==this._relativeSeries.coordinate&&(this._relativeSeries.event.on("zoom",this._updateMarkerLayout.bind(this)),this._relativeSeries.event.on("panmove",this._updateMarkerLayout.bind(this)),this._relativeSeries.event.on("scroll",this._updateMarkerLayout.bind(this)))}},{key:"clear",value:function(){_(e,"clear",this,3)([]),this._markerComponent=null,this._firstSeries=null}},{key:"release",value:function(){this._releaseMarkerData(),_(e,"release",this,3)([])}},{key:"_getFirstSeries",value:function(){var t;if(this._firstSeries)return this._firstSeries;var e=az(this._regions);return e?(this._firstSeries=e,e):(null===(t=this._option)||void 0===t||t.onError("need at least one series"),null)}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._markerComponent]}},{key:"onLayoutStart",value:function(t,i){C(this._spec.offsetX)||(this._layoutOffsetX=wz(this._spec.offsetX,i.width,i)),C(this._spec.offsetY)||(this._layoutOffsetY=wz(this._spec.offsetY,i.height,i)),_(e,"onLayoutStart",this,3)([t,i])}},{key:"_compareSpec",value:function(t,i){var n=_(e,"_compareSpec",this,3)([t,i]);return nt(i,t)||(n.reRender=!0,n.change=!0,n.reMake||n.reCompile||!this._isComponentOnlySpecChange(t,i)?n.reMake||n.reCompile||!this._isAutoRangeSpecChange(t,i)?n.reMake=!0:n.effects=Object.assign(Object.assign({},n.effects),{component:!0,scaleDomain:!0,layout:!0,render:!0}):n.effects=Object.assign(Object.assign({},n.effects),{component:!0,layout:!0,render:!0})),n}},{key:"_isComponentOnlySpecChange",value:function(t,e){var i=!(null==t?void 0:t.autoRange)&&!(null==e?void 0:e.autoRange);return nt(G2(e,{normalizeDomainPosition:i}),G2(t,{normalizeDomainPosition:i}))}},{key:"_isAutoRangeSpecChange",value:function(t,e){return!(!(null==t?void 0:t.autoRange)&&!(null==e?void 0:e.autoRange))&&nt(G2(e,{normalizeDomainPosition:!0,normalizeAutoRange:!0}),G2(t,{normalizeDomainPosition:!0,normalizeAutoRange:!0}))}},{key:"reInit",value:function(t){_(e,"reInit",this,3)([t]),this._releaseMarkerData(),this._bindSeries(),this._initDataView(),this._buildMarkerAttributeContext(),this._markerComponent&&this._updateMarkerLayout()}},{key:"_initCommonDataView",value:function(){var t=this._computeOptions().options,e=this._getRelativeDataView();fH(this._option.dataSet,"markerAggregation",O2),fH(this._option.dataSet,"markerFilter",L2),this._releaseMarkerData();var i=new Ko(this._option.dataSet,{name:"".concat(this.type,"_").concat(this.id,"_data")});i.parse([e],{type:"dataview"}),i.transform({type:"markerAggregation",options:t}),i.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),this._setMarkerData(i,!0),this._bindMarkerDataChange()}}],[{key:"_getMarkerCoordinateType",value:function(t){return"cartesian"}},{key:"getSpecInfo",value:function(t){var e=this;return IU(t,this.specKey,this.type,(function(t){return!1!==t.visible&&e._getMarkerCoordinateType(t)===e.coordinateType}))}}])}(DW);function K2(t,e){return function(t,e,i){var n=Zt(t,(function(t){return t[e]}),(function(t){return t[i]})),r=n.predict,a=YF(t,e),o=KF(t,e),l=r(a),u=r(o);return[s(s({},e,a),i,l),s(s({},e,o),i,u)]}(t[0].latestData,e.fieldX,e.fieldY)}var X2=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).specKey="markLine",e.layoutZIndex=t.LayoutZIndex.MarkLine,e}return h(r,e),a(r,[{key:"_createMarkerComponent",value:function(){var t,e,i,n,r,a,o,s,l,u,h,c,d,v=this,f=this._spec,p=f.startSymbol,g=void 0===p?{}:p,y=f.endSymbol,m=void 0===y?{}:y,_=ot(null!==(t=this._spec.label)&&void 0!==t?t:{}),b={zIndex:this.layoutZIndex,interactive:null===(e=this._spec.interactive)||void 0===e||e,hover:null===(i=this._spec.interactive)||void 0===i||i,select:null===(n=this._spec.interactive)||void 0===n||n,points:[{x:0,y:0},{x:0,y:0}],center:{x:0,y:0},radius:0,startAngle:0,endAngle:0,lineStyle:C2(tH(null===(r=this._spec.line)||void 0===r?void 0:r.style),this._markerData,this._markAttributeContext),clipInRange:null!==(a=this._spec.clip)&&void 0!==a&&a,label:_.map((function(t){return S2(t,v._markerData,v._markAttributeContext)})),state:{line:A2(null!==(s=null===(o=this._spec.line)||void 0===o?void 0:o.state)&&void 0!==s?s:{},this._markerData,this._markAttributeContext),lineStartSymbol:A2(null!==(u=null===(l=this._spec.startSymbol)||void 0===l?void 0:l.state)&&void 0!==u?u:{},this._markerData,this._markAttributeContext),lineEndSymbol:A2(null!==(c=null===(h=this._spec.endSymbol)||void 0===h?void 0:h.state)&&void 0!==c?c:{},this._markerData,this._markAttributeContext),label:_.map((function(t){var e;return A2(null!==(e=t.state)&&void 0!==e?e:{},v._markerData,v._markAttributeContext)})),labelBackground:_.map((function(t){var e,i;return A2(null!==(i=null===(e=t.labelBackground)||void 0===e?void 0:e.state)&&void 0!==i?i:{},v._markerData,v._markAttributeContext)}))},animation:null!==(d=this._spec.animation)&&void 0!==d&&d,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate};return g.visible?b.startSymbol=Object.assign(Object.assign({},g),{visible:!0,style:C2(tH(g.style),this._markerData,this._markAttributeContext)}):b.startSymbol={visible:!1},m.visible?b.endSymbol=Object.assign(Object.assign({},m),{visible:!0,style:C2(tH(m.style),this._markerData,this._markAttributeContext)}):b.endSymbol={visible:!1},this._newMarkLineComponent(b)}},{key:"_getUpdateMarkerAttrs",value:function(){var t,e,i,n=this._spec,r=this._markerData,a=this._startRelativeSeries,o=this._endRelativeSeries,s=this._relativeSeries,l=this._computePointsAttr(),u=s.getViewData().latestData,h=r.latestData[0]&&r.latestData[0].latestData?r.latestData[0].latestData:r.latestData;if(n.clip||ot(n.label).some((function(t){return null==t?void 0:t.confine}))){var c=x2([a.getRegion(),o.getRegion(),s.getRegion()]),d=c.minX,v=c.maxX,f=c.minY;i={x:d,y:f,width:v-d,height:c.maxY-f}}var p=ot((null!==(e=null===(t=this._markerComponent)||void 0===t?void 0:t.attribute)&&void 0!==e?e:{}).label),g=ot(this._spec.label),y=p.map((function(t,e){var i=g[e]||{};return Object.assign(Object.assign({},t),{text:i.formatMethod?i.formatMethod(h,u):null==t?void 0:t.text})}));return Object.assign(Object.assign({},l),{label:y,limitRect:i,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}},{key:"_markerLayout",value:function(){var t,e=this._getUpdateMarkerAttrs();null===(t=this._markerComponent)||void 0===t||t.setAttributes(e)}},{key:"_initDataView",value:function(){var t=this._spec,e="coordinates"in t,i=E2(t),n=i.doXProcess,r=i.doYProcess,a=i.doXYY1Process,o=i.doYXX1Process,s=i.doXYProcess,l=i.doAngleProcess,u=i.doRadiusProcess,h=i.doAngRadRad1Process,c=i.doRadAngAng1Process,d=i.doRadAngProcess;if(this._setMarkerData(this._getRelativeDataView()),n||r||a||o||s||l||u||h||c||d||e){fH(this._option.dataSet,"markerAggregation",O2),fH(this._option.dataSet,"markerRegression",K2),fH(this._option.dataSet,"markerFilter",L2);var v=this._computeOptions(),f=v.options,p=v.needAggr,g=v.needRegr,y=v.processData,m=new Ko(this._option.dataSet);m.parse([y],{type:"dataview"}),p&&m.transform({type:"markerAggregation",options:f}),g&&m.transform({type:"markerRegression",options:f}),m.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),this._setMarkerData(m,!0),this._bindMarkerDataChange()}}}],[{key:"_getMarkerCoordinateType",value:function(t){var e=E2(t),i=e.doAngleProcess,n=e.doRadiusProcess,r=e.doAngRadRad1Process,a=e.doRadAngAng1Process,o=e.doRadAngProcess;return"polar"===t.coordinateType||i||n||r||a||o?"polar":"cartesian"}}])}(Y2);X2.specKey="markLine";var q2=function(t){return{visible:t,symbolType:"triangle",size:10,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}}},Z2={style:{fontSize:{type:"token",key:"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"}}},refY:5},J2={line:{style:{lineDash:[3,3],stroke:{type:"palette",key:"markLineStrokeColor"}}},startSymbol:q2(!1),endSymbol:q2(!0),label:Z2},Q2=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=c.markLine,t.name=c.markLine,t.coordinateType="cartesian",t}return h(e,t),a(e,[{key:"_newMarkLineComponent",value:function(t){return new ND(t)}},{key:"_computePointsAttr",value:function(){var t,e=this._spec,i=this._markerData,n=this._startRelativeSeries,r=this._endRelativeSeries,a=this._relativeSeries,o=M(e.coordinates),s=M(e.process),l=s&&M(e.process.x),u=s&&M(e.process.y),h=M(e.positions),c=null!==(t=e.autoRange)&&void 0!==t&&t,d=E2(e),v=d.doXProcess,f=d.doYProcess,p=d.doXYY1Process,g=d.doYXX1Process,y=d.doXYProcess,m=d.doCoordinatesProcess,_=[];if(v||p||f||g||y||o&&l||o&&u){var b=p2(i,n,r,a,c,!1,this._getAutoRangeExtendDomainKeyPrefix());_=1===b.length?b[0]:b.map((function(t){return t[0]}))}else m?_=m2(i,a,c,e.coordinatesOffset,this._getAutoRangeExtendDomainKeyPrefix()):h&&(_=k2(e.positions,a,e.regionRelative));return{points:_}}},{key:"_markerLayout",value:function(){var t,e,i,n,r,a=this._getUpdateMarkerAttrs();if("type-step"===this._spec.type){var o,s=this._startRelativeSeries,l=this._endRelativeSeries,u=this._spec.line||{},h=u.multiSegment,c=u.mainSegmentIndex,d=this._spec,v=d.connectDirection,f=d.expandDistance,p=void 0===f?0:f;if(Mz(p)){var g=s.getRegion(),y=g.getLayoutStartPoint(),m=l.getRegion(),_=m.getLayoutStartPoint();if("bottom"===v||"top"===v){var b=Math.abs(Math.min(y.y,_.y)-Math.max(y.y+g.getLayoutRect().height,_.y+m.getLayoutRect().height));o=Number(p.substring(0,p.length-1))*b/100}else{var k=Math.abs(Math.min(y.x,_.x)-Math.max(y.x+g.getLayoutRect().width,_.x+m.getLayoutRect().width));o=Number(p.substring(0,p.length-1))*k/100}}else o=p;var x=a.points,S=a.limitRect;if(!x||x.length<2)return void(null===(t=this._markerComponent)||void 0===t||t.setAttributes(a));var A,C=function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=[],a=t.y-e.y,o=t.x-e.x;switch(i){case"top":r.push(t),r.push({x:t.x,y:a>0?t.y-n-Math.abs(a):t.y-n}),r.push({x:e.x,y:a>0?e.y-n:e.y-n-Math.abs(a)}),r.push(e);break;case"bottom":r.push(t),r.push({x:t.x,y:a<0?t.y+n+Math.abs(a):t.y+n}),r.push({x:e.x,y:a<0?e.y+n:e.y+n+Math.abs(a)}),r.push(e);break;case"left":r.push(t),r.push({x:o>0?t.x-n-Math.abs(o):t.x-n,y:t.y}),r.push({x:o>0?e.x-n:e.x-n-Math.abs(o),y:e.y}),r.push(e);break;case"right":r.push(t),r.push({x:o>0?t.x+n:t.x+n+Math.abs(o),y:t.y}),r.push({x:o>0?e.x+n+Math.abs(o):e.x+n,y:e.y}),r.push(e)}return r}(x[0],x[1],v,o);A=h&&M(c)?{position:"middle",autoRotate:!1}:Object.assign({position:"start",autoRotate:!1},function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=t.y-e.y,a=t.x-e.x;return"bottom"===i?{dx:a>0?-a/2:Math.abs(a/2),dy:r>0?n:Math.abs(r)+n}:"top"===i?{dx:a>0?-Math.abs(a/2):+Math.abs(a/2),dy:r>0?-(Math.abs(r)+n):-n}:"left"===i?{dx:a>0?-a-n:-n,dy:r>0?-r/2:Math.abs(r/2)}:"right"===i?{dx:a>0?n:Math.abs(a)+n,dy:r>0?-r/2:Math.abs(r/2)}:{}}(x[0],x[1],v,o));var T=ot((null!==(i=null===(e=this._markerComponent)||void 0===e?void 0:e.attribute)&&void 0!==i?i:{}).label),w=ot(a.label),E=ot(this._spec.label);null===(n=this._markerComponent)||void 0===n||n.setAttributes({points:h?[[C[0],C[1]],[C[1],C[2]],[C[2],C[3]]]:C,label:w.map((function(t,e){var i,n,r,a,o=0,s=0,l=null!==(i=A.dx)&&void 0!==i?i:0,u=null!==(n=A.dy)&&void 0!==n?n:0,h=null!==(r=E[e])&&void 0!==r?r:E[0];return F(null==h?void 0:h.refX)&&(o+=h.refX),F(null==h?void 0:h.refY)&&(s+=h.refY),F(null==h?void 0:h.dx)&&(l+=h.dx),F(null==h?void 0:h.dy)&&(u+=h.dy),Object.assign(Object.assign(Object.assign({},t),A),{refX:o,refY:s,dx:l,dy:u,textStyle:Object.assign(Object.assign({},null===(a=T[e])||void 0===a?void 0:a.textStyle),{textAlign:"center",textBaseline:"middle"})})})),limitRect:S,multiSegment:h,mainSegmentIndex:c,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}else null===(r=this._markerComponent)||void 0===r||r.setAttributes(a)}},{key:"_computeOptions",value:function(){var t,e=this._getRelativeDataView(),i=!0,n=!1,r=this._spec,a=this._relativeSeries,o=E2(r),s=o.doXProcess,l=o.doYProcess,u=o.doXYY1Process,h=o.doYXX1Process,c=o.doXYProcess,d=o.doCoordinatesProcess;if(c)t=[this._processSpecByDims([{dim:"x",specValue:r.x},{dim:"y",specValue:r.y}]),this._processSpecByDims([{dim:"x",specValue:r.x1},{dim:"y",specValue:r.y1}])];else if(s)t=[this._processSpecByDims([{dim:"x",specValue:r.x}])];else if(l)t=[this._processSpecByDims([{dim:"y",specValue:r.y}])];else if(u)t=[this._processSpecByDims([{dim:"x",specValue:r.x},{dim:"y",specValue:r.y}]),this._processSpecByDims([{dim:"x",specValue:r.x},{dim:"y",specValue:r.y1}])];else if(h)t=[this._processSpecByDims([{dim:"x",specValue:r.x},{dim:"y",specValue:r.y}]),this._processSpecByDims([{dim:"x",specValue:r.x1},{dim:"y",specValue:r.y}])];else if(d){if(t=this._processSpecCoo(r),i=!1,e=new Ko(this._option.dataSet,{name:"".concat(this.type,"_").concat(this.id,"_data")}).parse([a.getViewData()],{type:"dataview"}).transform({type:"markerAggregation",options:t}),r.process&&M(r.process.x)&&(t=[this._processSpecByDims([{dim:"x",specValue:r.process.x}])],i=!0),r.process&&M(r.process.y)&&(t=t=[this._processSpecByDims([{dim:"y",specValue:r.process.y}])],i=!0),r.process&&M(r.process.xy)){var v=a.getSpec();t={fieldX:v.xField,fieldY:v.yField},n=!0}}else i=!1;return{options:t,needAggr:i,needRegr:n,processData:e}}}])}(X2);Q2.type=c.markLine,Q2.coordinateType="cartesian",Q2.builtInTheme={markLine:J2};var $2=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=c.polarMarkLine,t.name=c.polarMarkLine,t.coordinateType="polar",t}return h(e,t),a(e,[{key:"_newMarkLineComponent",value:function(t){var e=E2(this._spec),i=e.doRadiusProcess,n=e.doRadAngAng1Process;return i||n?new WD(t):new ND(t)}},{key:"_computePointsAttr",value:function(){var t,e=this._spec,i=this._markerData,n=this._startRelativeSeries,r=this._endRelativeSeries,a=this._relativeSeries,o=null!==(t=e.autoRange)&&void 0!==t&&t,s=E2(e),l=s.doAngleProcess,u=s.doRadiusProcess,h=s.doAngRadRad1Process,c=s.doRadAngAng1Process,d=s.doRadAngProcess,v=s.doCoordinatesProcess,f=[],p={},g={x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y};if(l||u||h||c||d){var y=y2(i,n,r,a,o,this._getAutoRangeExtendDomainKeyPrefix());f=1===y.length?y[0]:y.map((function(t){return t[0]})),p=f[0].radius===f[1].radius?{radius:f[0].radius,startAngle:f[0].angle,endAngle:f[1].angle,center:g}:{points:f.map((function(t){return Ae(g,t.radius,t.angle)}))}}else v&&(p={points:(f=_2(i,a,o,this._getAutoRangeExtendDomainKeyPrefix())).map((function(t){return Ae(g,t.radius,t.angle)}))});return p}},{key:"_computeOptions",value:function(){var t,e=this._spec,i=E2(e),n=i.doAngleProcess,r=i.doRadiusProcess,a=i.doAngRadRad1Process,o=i.doRadAngAng1Process,s=i.doRadAngProcess,l=i.doCoordinatesProcess,u=this._getRelativeDataView();return s?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"angle",specValue:e.angle1},{dim:"radius",specValue:e.radius1}])]:n?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle}])]:r?t=[this._processSpecByDims([{dim:"radius",specValue:e.radius}])]:a?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius1}])]:o?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"angle",specValue:e.angle1},{dim:"radius",specValue:e.radius}])]:l&&(t=this._processSpecCoo(e)),{options:t,needAggr:!0,needRegr:!1,processData:u}}}])}(X2);$2.type=c.polarMarkLine,$2.coordinateType="polar",$2.builtInTheme={polarMarkLine:J2};var t3=function(e){function r(e,a){var o;return n(this,r),(o=i(this,r,[e,a])).type=c.title,o.specKey=c.title,o.layoutType="normal",o.layoutZIndex=t.LayoutZIndex.Title,o.layoutLevel=t.LayoutLevel.Title,o._orient="top",o._orient=Cz(e.orient)?e.orient:"top",o}return h(r,e),a(r,[{key:"orient",get:function(){return this._orient}},{key:"initLayout",value:function(){_(r,"initLayout",this,3)([]),this._layout&&(this._layout.layoutOrient=this._orient)}},{key:"_compareSpec",value:function(t,e){var i=_(r,"_compareSpec",this,3)([t,e]),n=!nt(e,t);return(null==e?void 0:e.orient)===(null==t?void 0:t.orient)&&(null==e?void 0:e.visible)===t.visible||(i.reMake=!0),i.change=!0,i.reRender=!0,n&&!i.reMake&&(i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0})),i}},{key:"afterSetLayoutStartPoint",value:function(t){F(t.x)&&this._titleComponent&&this._titleComponent.setAttribute("x",t.x),F(t.y)&&this._titleComponent&&this._titleComponent.setAttribute("y",t.y),_(r,"afterSetLayoutStartPoint",this,3)([t])}},{key:"getBoundsInRect",value:function(t){var e={};this.setLayoutRect(t);var i=this._getTitleAttrs();this._createOrUpdateTitleComponent(i),e=this._getTitleLayoutRect();var n=this.getLayoutStartPoint(),r=n.x,a=n.y;return{x1:r,y1:a,x2:r+e.width,y2:a+e.height}}},{key:"_getTitleLayoutRect",value:function(){var t=this._titleComponent.AABBBounds;return{width:this._spec.width?this._spec.width:F(t.width())?t.width():0,height:this._spec.height?this._spec.height:F(t.height())?t.height():0}}},{key:"_getTitleAttrs",value:function(){var t,e,i,n,r,a;if(!1===this._spec.visible)return{visible:!1};var o=this.getLayoutRect(),s=wz(this._spec.width,o.width,null,o.width),l=wz(this._spec.maxWidth,o.width,null,o.width),u=Math.max(Math.min(s,l,o.width),0),h=M(this._spec.text)&&""!==this._spec.text,c=M(this._spec.subtext)&&""!==this._spec.subtext,d=Object.assign(Object.assign({},$(this._spec,["padding"])),{textType:null!==(t=this._spec.textType)&&void 0!==t?t:"text",text:h?this._spec.text:void 0,subtextType:null!==(e=this._spec.subtextType)&&void 0!==e?e:"text",subtext:c?this._spec.subtext:void 0,x:null!==(i=this._spec.x)&&void 0!==i?i:0,y:null!==(n=this._spec.y)&&void 0!==n?n:0,height:this._spec.height,minWidth:this._spec.minWidth,maxWidth:u,minHeight:this._spec.minHeight,maxHeight:this._spec.maxHeight,padding:this._spec.innerPadding,align:null!==(r=this._spec.align)&&void 0!==r?r:"left",verticalAlign:null!==(a=this._spec.verticalAlign)&&void 0!==a?a:"top",textStyle:Object.assign({maxLineWidth:u},this._spec.textStyle),subtextStyle:Object.assign({maxLineWidth:u},this._spec.subtextStyle)});if(h&&(d.textStyle.width=u),c&&(d.subtextStyle.width=u),M(this._spec.width)){var v=Math.max(Math.min(s,o.width),0);h?d.textStyle.width=v:delete d.textStyle.width,c&&(d.subtextStyle.width=v)}return d}},{key:"_createOrUpdateTitleComponent",value:function(t){var e=this;if(this._titleComponent)nt(t,this._cacheAttrs)||this._titleComponent.setAttributes(t);else{var i=this.getContainer(),n=new gF(t);n.name="title",i.add(n),this._titleComponent=n,n.on("*",(function(t,i){return e._delegateEvent(n,t,i)}))}return this._cacheAttrs=t,this._titleComponent}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._titleComponent]}},{key:"clear",value:function(){_(r,"clear",this,3)([]),this._cacheAttrs=null}}],[{key:"getSpecInfo",value:function(t){return IU(t,this.specKey,c.title,(function(t){return!1!==t.visible}))}}])}(DW);t3.type=c.title,t3.specKey=c.title,t3.builtInTheme={title:{padding:{top:4,bottom:20},textStyle:{fontSize:{type:"token",key:"l3FontSize"},lineHeight:{type:"token",key:"l3LineHeight"},fill:{type:"palette",key:"primaryFontColor"}},subtextStyle:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fill:{type:"palette",key:"tertiaryFontColor"}}}};var e3=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).specKey="markArea",e.layoutZIndex=t.LayoutZIndex.MarkArea,e}return h(r,e),a(r,[{key:"_createMarkerComponent",value:function(){var t,e,i,n,r,a,o,s,l=this,u=ot(null!==(t=this._spec.label)&&void 0!==t?t:{}),h={zIndex:this.layoutZIndex,interactive:null===(e=this._spec.interactive)||void 0===e||e,hover:null===(i=this._spec.interactive)||void 0===i||i,select:null===(n=this._spec.interactive)||void 0===n||n,points:[{x:0,y:0}],center:{x:0,y:0},innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,areaStyle:C2(tH(null===(r=this._spec.area)||void 0===r?void 0:r.style),this._markerData,this._markAttributeContext),clipInRange:null!==(a=this._spec.clip)&&void 0!==a&&a,label:u.map((function(t){return S2(t,l._markerData,l._markAttributeContext)})),state:{area:A2(null===(o=this._spec.area)||void 0===o?void 0:o.state,this._markerData,this._markAttributeContext),label:u.map((function(t){return A2(t.state,l._markerData,l._markAttributeContext)})),labelBackground:u.map((function(t){var e;return A2(null===(e=t.labelBackground)||void 0===e?void 0:e.state,l._markerData,l._markAttributeContext)}))},animation:null!==(s=this._spec.animation)&&void 0!==s&&s,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate};return this._newMarkAreaComponent(h)}},{key:"_markerLayout",value:function(){var t,e,i=this._spec,n=this._markerData,r=this._startRelativeSeries,a=this._endRelativeSeries,o=this._relativeSeries,s=this._computePointsAttr(),l=this._getRelativeDataView().latestData,u=n?n.latestData[0]&&n.latestData[0].latestData?n.latestData[0].latestData:n.latestData:l;if(i.clip||ot(i.label).some((function(t){return null==t?void 0:t.confine}))){var h=x2([r.getRegion(),a.getRegion(),o.getRegion()]),c=h.minX,d=h.maxX,v=h.minY;e={x:c,y:v,width:d-c,height:h.maxY-v}}if(this._markerComponent){var f=ot(null===(t=this._markerComponent.attribute)||void 0===t?void 0:t.label),p=ot(this._spec.label);this._markerComponent.setAttributes(Object.assign(Object.assign({},s),{label:f.map((function(t,e){var i=p[e]||{};return Object.assign(Object.assign({},t),{text:i.formatMethod?i.formatMethod(u,l):null==t?void 0:t.text})})),limitRect:e,dx:this._layoutOffsetX,dy:this._layoutOffsetY}))}}},{key:"_initDataView",value:function(){var t=B2(this._spec),e=t.doXProcess,i=t.doYProcess,n=t.doXYProcess,r=t.doAngleProcess,a=t.doRadiusProcess,o=t.doRadAngProcess,s=t.doCoordinatesProcess;if(!(e||i||n||r||a||o||s))return null;this._initCommonDataView()}}],[{key:"_getMarkerCoordinateType",value:function(t){var e=B2(t),i=e.doAngleProcess,n=e.doRadiusProcess,r=e.doRadAngProcess;return"polar"===t.coordinateType||i||n||r?"polar":"cartesian"}}])}(Y2);e3.specKey="markArea";var i3={area:{style:{fill:{type:"palette",key:"axisDomainColor",a:.25}}},label:{style:{fontSize:{type:"token",key:"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"}}}}},n3=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=c.markArea,t.name=c.markArea,t.coordinateType="cartesian",t}return h(e,t),a(e,[{key:"_newMarkAreaComponent",value:function(t){return new VD(t)}},{key:"_computePointsAttr",value:function(){var t,e,i=this._spec,n=this._markerData,r=this._startRelativeSeries,a=this._endRelativeSeries,o=this._relativeSeries,s=B2(i),l=s.doXProcess,u=s.doYProcess,h=s.doXYProcess,c=s.doCoordinatesProcess,d=M(i.positions),v=null!==(t=i.autoRange)&&void 0!==t&&t,f=null!==(e=i.includeFullBand)&&void 0!==e&&e,p=[];if(h){var g=m(p2(n,r,a,o,v,f,this._getAutoRangeExtendDomainKeyPrefix()),2),y=g[0],_=g[1];y&&y.length&&_&&_.length&&(p=[{x:y[0].x,y:_[0].y},y[0],{x:_[0].x,y:y[0].y},_[0]])}else if(l||u){var k=m(p2(n,r,a,o,v,f,this._getAutoRangeExtendDomainKeyPrefix()),2),x=k[0],S=k[1];x&&x.length&&S&&S.length&&(p=[].concat(b(x),[S[1],S[0]]))}else c?p=m2(n,o,v,i.coordinatesOffset,this._getAutoRangeExtendDomainKeyPrefix()):d&&(p=k2(i.positions,o,i.regionRelative));return{points:p}}},{key:"_computeOptions",value:function(){var t,e=this._spec,i=B2(e),n=i.doXProcess,r=i.doYProcess,a=i.doXYProcess,o=i.doCoordinatesProcess;return a?t=[this._processSpecByDims([{dim:"x",specValue:e.x},{dim:"y",specValue:e.y}]),this._processSpecByDims([{dim:"x",specValue:e.x1},{dim:"y",specValue:e.y1}])]:n?t=[this._processSpecByDims([{dim:"x",specValue:e.x}]),this._processSpecByDims([{dim:"x",specValue:e.x1}])]:r?t=[this._processSpecByDims([{dim:"y",specValue:e.y}]),this._processSpecByDims([{dim:"y",specValue:e.y1}])]:o&&(t=this._processSpecCoo(e)),{options:t}}}])}(e3);n3.type=c.markArea,n3.coordinateType="cartesian",n3.builtInTheme={markArea:i3};var r3=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=c.polarMarkArea,t.name=c.polarMarkArea,t.coordinateType="polar",t}return h(e,t),a(e,[{key:"_newMarkAreaComponent",value:function(t){var e=B2(this._spec),i=e.doRadiusProcess,n=e.doAngleProcess,r=e.doRadAngProcess;return n||i||r?new GD(t):new VD(t)}},{key:"_computePointsAttr",value:function(){var t,e=this._spec,i=this._markerData,n=this._startRelativeSeries,r=this._endRelativeSeries,a=this._relativeSeries,o=B2(e),s=o.doAngleProcess,l=o.doRadiusProcess,u=o.doRadAngProcess,h=o.doCoordinatesProcess,c=null!==(t=e.autoRange)&&void 0!==t&&t,d={},v={x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y};if(s||l||u){var f=y2(i,n,r,a,c,this._getAutoRangeExtendDomainKeyPrefix());u?d={innerRadius:f[0][0].radius,outerRadius:f[1][0].radius,startAngle:f[0][0].angle,endAngle:f[1][0].angle,center:v}:s?d={innerRadius:0,outerRadius:Math.abs(f[0][0].radius),startAngle:f[0][1].angle,endAngle:f[1][1].angle,center:v}:l&&(d={innerRadius:f[0][0].radius,outerRadius:f[1][0].radius,startAngle:f[0][0].angle,endAngle:f[1][1].angle,center:v})}else h&&(d={points:_2(i,a,c,this._getAutoRangeExtendDomainKeyPrefix()).map((function(t){return Ae(v,t.radius,t.angle)}))});return d}},{key:"_computeOptions",value:function(){var t,e=this._spec,i=B2(e),n=i.doAngleProcess,r=i.doRadiusProcess,a=i.doRadAngProcess,o=i.doCoordinatesProcess;return a?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"angle",specValue:e.angle1},{dim:"radius",specValue:e.radius1}])]:n?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"angle",specValue:e.angle1},{dim:"radius",specValue:e.radius}])]:r?t=[this._processSpecByDims([{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"radius",specValue:e.radius1}])]:o&&(t=this._processSpecCoo(e)),{options:t}}}])}(e3);r3.type=c.polarMarkArea,r3.coordinateType="polar",r3.builtInTheme={polarMarkArea:i3};var a3=function(t){return tH(Object.assign({},t))},o3=function(t){return Object.assign(Object.assign({},t),{style:Object.assign({},tH(t.style))})},s3=function(t){var e,i,n,r,a,o,s,l,u,h,c,d,v,f,p,g,y=a3(null!==(i=null===(e=null==t?void 0:t.slider)||void 0===e?void 0:e.trackStyle)&&void 0!==i?i:{}),m=a3(null!==(r=null===(n=null==t?void 0:t.slider)||void 0===n?void 0:n.railStyle)&&void 0!==r?r:{}),_=(g=null!==(o=null===(a=null==t?void 0:t.slider)||void 0===a?void 0:a.handlerStyle)&&void 0!==o?o:{},tH(Object.assign({},g))),b=o3(null!==(l=null===(s=null==t?void 0:t.controller)||void 0===s?void 0:s.start)&&void 0!==l?l:{}),k=o3(null!==(h=null===(u=null==t?void 0:t.controller)||void 0===u?void 0:u.pause)&&void 0!==h?h:{}),x=o3(null!==(d=null===(c=null==t?void 0:t.controller)||void 0===c?void 0:c.backward)&&void 0!==d?d:{}),S=o3(null!==(f=null===(v=null==t?void 0:t.controller)||void 0===v?void 0:v.forward)&&void 0!==f?f:{}),A=Object.assign(Object.assign({},t),{direction:t.direction,interval:t.interval,visible:t.visible,orient:null!==(p=t.orient)&&void 0!==p?p:"bottom",slider:Object.assign(Object.assign({},t.slider),{trackStyle:y,railStyle:m,handlerStyle:_}),controller:Object.assign(Object.assign({},t.controller),{start:b,pause:k,backward:x,forward:S})});return t.visible||(A.controller.visible=!1,A.slider.visible=!1),A},l3=function(t){return"left"===t||"right"===t},u3=function(t){return"top"===t||"bottom"===t},h3={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:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},pause:{order:0,space:10,position:"start",style:{size:12,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:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}}}},c3=function(r){function o(){var r;return n(this,o),(r=i(this,o,arguments)).layoutZIndex=t.LayoutZIndex.Player,r.layoutLevel=t.LayoutLevel.Player,r.specKey="player",r.type=c.player,r._orient="bottom",r._getPlayerAttrs=function(){var t,e,i,n,a,o,s,l,u=r._spec.type,h={size:{width:r._width,height:r._height},dx:null!==(t=r._spec.dx)&&void 0!==t?t:0+r._dx,dy:null!==(e=r._spec.dy)&&void 0!==e?e:0+r._dy};return"discrete"===u?Object.assign(Object.assign(Object.assign({},(s=r._spec,l=r._specs,Object.assign(Object.assign({},s3(s)),{data:l,type:"discrete"}))),h),{disableTriggerEvent:r._option.disableTriggerEvent,loop:null===(n=null===(i=r._spec)||void 0===i?void 0:i.loop)||void 0===n||n}):Object.assign(Object.assign(Object.assign({},function(t,e){return Object.assign(Object.assign({},s3(t)),{data:e,type:"continuous"})}(r._spec,r._specs)),h),{disableTriggerEvent:r._option.disableTriggerEvent,loop:null===(o=null===(a=r._spec)||void 0===a?void 0:a.loop)||void 0===o||o})},r._createOrUpdatePlayerComponent=function(){var t=Object.assign({},r._getPlayerAttrs()),e=r.getContainer();r._playerComponent?nt(t,r._cacheAttrs)||(r._cacheAttrs=t,r._playerComponent.setAttributes(t),r._playerComponent._initAttributes(),r._playerComponent.render()):("discrete"===t.type?r._playerComponent=new IF(t):r._playerComponent=new LF(t),r._cacheAttrs=t,r._playerComponent.name="player",e.add(r._playerComponent),r._initEvent())},r._maxSize=function(){var t,e,i,n,a,o,s,l,u;return Math.max.apply(Math,b(ot(null===(e=null===(t=r._spec.controller.start)||void 0===t?void 0:t.style)||void 0===e?void 0:e.size)).concat(b(ot(null===(n=null===(i=r._spec.controller.pause)||void 0===i?void 0:i.style)||void 0===n?void 0:n.size)),b(ot(null===(o=null===(a=r._spec.controller.backward)||void 0===a?void 0:a.style)||void 0===o?void 0:o.size)),b(ot(null===(l=null===(s=r._spec.controller.forward)||void 0===s?void 0:s.style)||void 0===l?void 0:l.size)),[null!==(u=l3(r._orient)?r._spec.slider.railStyle.width:r._spec.slider.railStyle.height)&&void 0!==u?u:10]))},r._sliderExceededSize=function(){var t,e,i,n,a,o,s,l,u,h=null!==(t=l3(r._orient)?r._spec.slider.railStyle.width:r._spec.slider.railStyle.height)&&void 0!==t?t:10,c=Math.max.apply(Math,b(ot(null===(i=null===(e=r._spec.controller.start)||void 0===e?void 0:e.style)||void 0===i?void 0:i.size)).concat(b(ot(null===(a=null===(n=r._spec.controller.pause)||void 0===n?void 0:n.style)||void 0===a?void 0:a.size)),b(ot(null===(s=null===(o=r._spec.controller.backward)||void 0===o?void 0:o.style)||void 0===s?void 0:s.size)),b(ot(null===(u=null===(l=r._spec.controller.forward)||void 0===l?void 0:l.style)||void 0===u?void 0:u.size))));return h>=c?h-c:0},r.autoPlayCallback=function(){var t;(null===(t=r._spec)||void 0===t?void 0:t.auto)&&(r._playerComponent.pause(),r._playerComponent.play())},r._initEvent=function(){r._option.disableTriggerEvent||(r._option.globalInstance.off(t.ChartEvent.rendered,r.autoPlayCallback),r._option.globalInstance.on(t.ChartEvent.rendered,r.autoPlayCallback),r._playerComponent.addEventListener(AF.end,(function(){var i;r.event.emit(t.ChartEvent.playerEnd,{model:e(r)}),r._alternate&&"discrete"===r._spec.type&&(r._direction="default"===r._direction?"reverse":"default",r._playerComponent.setAttributes({direction:r._direction,dataIndex:"reverse"===r._direction?r._specs.length-2:1})),(null===(i=r._spec)||void 0===i?void 0:i.loop)&&r._playerComponent.play()})),r._playerComponent.addEventListener(AF.change,(function(t){var e=t.detail.index;r.changePlayerIndex(e)})),r._playerComponent.addEventListener(AF.backward,(function(i){var n=i.detail.index,a=r._specs[n];r.event.emit(t.ChartEvent.playerBackward,{model:e(r),value:{spec:a,index:n,specs:r._specs}})})),r._playerComponent.addEventListener(AF.forward,(function(i){var n=i.detail.index,a=r._specs[n];r.event.emit(t.ChartEvent.playerForward,{model:e(r),value:{spec:a,index:n,specs:r._specs}})})),r._playerComponent.addEventListener(AF.play,(function(i){var n=i.detail.index,a=r._specs[n];r.event.emit(t.ChartEvent.playerPlay,{model:e(r),value:{spec:a,index:n,specs:r._specs}})})),r._playerComponent.addEventListener(AF.pause,(function(i){var n=i.detail.index,a=r._specs[n];r.event.emit(t.ChartEvent.playerPause,{model:e(r),value:{spec:a,index:n,specs:r._specs}})})))},r}return h(o,r),a(o,[{key:"orient",get:function(){return this._orient}},{key:"layoutOrient",set:function(t){this._orient=t}},{key:"setAttrFromSpec",value:function(){var t,e,i,n,r,a,s,l;_(o,"setAttrFromSpec",this,3)([]),this._orient=null!==(t=this._spec.orient)&&void 0!==t?t:"bottom",this._specs=null!==(e=this._spec.specs)&&void 0!==e?e:[],this._direction=null!==(i=this._spec.direction)&&void 0!==i?i:"default",this._alternate=null!==(n=this._spec.alternate)&&void 0!==n&&n,this._dx=null!==(r=this._spec.dx)&&void 0!==r?r:0,this._dy=null!==(a=this._spec.dy)&&void 0!==a?a:0,this._position=null!==(s=this._spec.position)&&void 0!==s?s:"middle",this._visible=null===(l=this._spec.visible)||void 0===l||l}},{key:"_compareSpec",value:function(t,e){var i=_(o,"_compareSpec",this,3)([t,e]),n=!nt(e,t);return(null==e?void 0:e.type)!==(null==t?void 0:t.type)?(i.reMake=!0,i):(!n||i.reMake||i.reCompile||(i.change=!0,i.reRender=!0,i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0})),i)}},{key:"afterSetLayoutStartPoint",value:function(t){if(_(o,"afterSetLayoutStartPoint",this,3)([t]),F(t.x)){var e=l3(this._orient)?t.x+this._sliderExceededSize()/2:t.x;this._playerComponent&&this._playerComponent.setAttribute("x",e)}if(F(t.y)){var i=u3(this._orient)?t.y+this._sliderExceededSize()/2:t.y;this._playerComponent&&this._playerComponent.setAttribute("y",i)}}},{key:"getBoundsInRect",value:function(t,e){this._width=this._computeWidth(t),this._height=this._computeHeight(t),this._dx=this._computeDx(e),this._dy=this._computeDy(e);var i=this._computeLayoutRect(t,this._width,this._height);return this._createOrUpdatePlayerComponent(),i}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._playerComponent]}},{key:"_computeLayoutRect",value:function(t,e,i){if(!1===this._visible)return{x1:0,x2:0,y1:0,y2:0};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}}}},{key:"_computeWidth",value:function(t){return L(this._spec.width)?Math.min(t.width,Number(this._spec.width)):l3(this._orient)?this._maxSize():t.width}},{key:"_computeHeight",value:function(t){return L(this._spec.height)?(this._height=this._spec.height,Math.min(t.height,Number(this._spec.height))):u3(this._orient)?this._maxSize():t.height}},{key:"_computeDx",value:function(t){return l3(this._orient)||"start"===this._position?0:"middle"===this._position?(t.width-this._width)/2:t.width-this._width}},{key:"_computeDy",value:function(t){return u3(this._orient)||"start"===this._position?0:"middle"===this._position?(t.height-this._height)/2:t.height-this._height}},{key:"changePlayerIndex",value:function(e){var i=this._specs[e];this._option.globalInstance.updateFullData(i.data),this.event.emit(t.ChartEvent.playerChange,{model:this,value:{spec:i,index:e,specs:this._specs}})}},{key:"release",value:function(){this._option.globalInstance.off(t.ChartEvent.rendered,this.autoPlayCallback)}}])}(DW);c3.builtInTheme={player:h3},c3.specKey="player",c3.type=c.player;var d3=function(e){function r(e,a){var o;return n(this,r),(o=i(this,r,[e,a])).type=c.label,o.name=c.label,o.layoutType="none",o.layoutZIndex=t.LayoutZIndex.Label,o._regions=a.getRegionsInIndex(a.regionIndexes),o}return h(r,e),a(r,[{key:"_interactiveConfig",value:function(t){var e=t.interactive,i={hover:!1,select:!1,state:t.state};if(!0!==e)return i;var n=this._option.getChart().getSpec(),r=n.hover,a=n.select;return!1===r&&!1===r.enable||(i.hover=!0),!1===a&&!1===a.enable||(i.select=!0),i}},{key:"_compareSpec",value:function(t,e){var i=_(r,"_compareSpec",this,3)([t,e]);return i.reRender=!0,nt(e,t)||(i.change=!0,i.reMake||i.reCompile?i.reMake=!0:i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0})),i}},{key:"_getDataLabelType",value:function(t,e){var i=t.type;return"line"===i||"area"===i?null!=e?e:"line-data":"rect"===i?"rect":"arc"===i?"arc":"symbol"===i||"cell"===i?"symbol":t.setDataLabelType?t.setDataLabelType():""}},{key:"_setTransformOfComponent",value:function(t,e){var i=this;t.setAttributeTransform((function(t){var n=t.labelStyle,r=t.size,a=t.itemEncoder,o=r(),s=fz({type:"palette",key:"secondaryFontColor"},i.getColorScheme());return{dataLabels:ot(e).map((function(t,e){var r=n(e),l=[],u=t.getGraphics();if(u)return r.data&&r.data.length?r.data.forEach((function(t,i){if(u[i]){var n=a(t,{labelIndex:e});C(n.fill)&&(n.fill=s),C(n.data)&&(n.data=t),l.push(n)}})):u.forEach((function(t){var i=t.context,n=i.data;i.diffState!==dN.exit&&n.forEach((function(t,i){!function(t){if(null==t)throw new TypeError("Cannot destructure "+t)}(i);var n=a(t,{labelIndex:e});C(n.fill)&&(n.fill=s),C(n.data)&&(n.data=t),l.push(n)}))})),E(r.overlap)&&C(r.overlap.size)&&(r.overlap.size=Object.assign({},o)),Object.assign(Object.assign({smartInvert:!1,baseMarkGroupName:t.getProductId(),getBaseMarks:function(){return u}},r),{type:i._getDataLabelType(t,r.type),data:l})})),size:o}}))}},{key:"getVRenderComponents",value:function(){var t=[];return this.getMarks().forEach((function(e){var i=e.getComponent();i&&t.push(i)})),t}},{key:"clear",value:function(){_(r,"clear",this,3)([]),this.getMarks().forEach((function(t){t&&t.clearComponent()}))}}])}(DW);d3.type=c.label;var v3=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).skipEncode=!1,t}return h(e,t),a(e,[{key:"getRule",value:function(){return this._rule}},{key:"setRule",value:function(t){this._rule=t}},{key:"getTarget",value:function(){return this._target}},{key:"setTarget",value:function(t){this._target=t,this._rule||this.setRule(t.type)}},{key:"getComponent",value:function(){return this._component}},{key:"setComponent",value:function(t){this._component=t}},{key:"render",value:function(){}}])}(bX);v3.type="text",v3.constructorType="label";var f3=function(){kX(),Uz.registerMark(v3.constructorType,v3)},p3=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_initTheme",value:function(t,e){return{spec:t,theme:this._theme}}}])}(LW),g3=function(e){function r(e,a){var o;return n(this,r),(o=i(this,r,[e,a])).type=c.label,o.name=c.label,o.specKey="label",o.transformerConstructor=p3,o.layoutZIndex=t.LayoutZIndex.Label,o._layoutRule=e.labelLayout||"series",o}return h(r,e),a(r,[{key:"init",value:function(t){_(r,"init",this,3)([t]),this.initEvent(),this._initTextMark(),this._initLabelComponent(),this._initTextMarkStyle()}},{key:"reInit",value:function(t){_(r,"reInit",this,3)([t]),this._labelInfoMap&&(this._labelInfoMap.forEach((function(t){t.forEach((function(t){t.labelMark.release()}))})),this._labelInfoMap.clear()),this._labelInfoMap&&this._labelInfoMap.clear(),this._initTextMark(),this._initLabelComponent(),this._initTextMarkStyle()}},{key:"initEvent",value:function(){var e=this;this.event.on(t.ChartEvent.dataZoomChange,(function(){e._labelComponentMap.forEach((function(t,e){var i=e.getComponent();i&&i.disableAnimation()})),e.event.on(eH.AFTER_MARK_RENDER_END,i)}));var i=function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(){e._labelComponentMap.forEach((function(t,e){var i=e.getComponent();i&&i.enableAnimation()})),e.event.off(eH.AFTER_MARK_RENDER_END,i)}))}},{key:"_initTextMark",value:function(){var t=this;this._labelInfoMap||(this._labelInfoMap=new Map),this._labelComponentMap||(this._labelComponentMap=new Map),tz(this._regions,(function(e){var i=e.getSpecInfo().markLabelSpec,n=void 0===i?{}:i,r=Object.keys(n),a=e.getRegion();t._labelInfoMap.get(a)||t._labelInfoMap.set(a,[]);for(var o=function(){var i=r[s],o=e.getMarkInName(i);o&&n[i].forEach((function(n,r){var s,l,u;if(n.visible){var h=t._labelInfoMap.get(a),c=t._createMark({type:"label",name:"".concat(null!==(s=e.userId)&&void 0!==s?s:e.id,"-").concat(i,"-label-").concat(r)},{attributeContext:e.getMarkAttributeContext()});n.showRelatedMarkTooltip&&(null===(u=null===(l=e.tooltipHelper)||void 0===l?void 0:l.activeTriggerSet.mark)||void 0===u||u.add(c)),c.setTarget(o),h.push({labelMark:c,baseMark:o,series:e,labelSpec:n})}}))},s=0;s<r.length;s++)o()}))}},{key:"_initLabelComponent",value:function(){var t=this,e={};this._labelComponentMap.forEach((function(t,i){e[i.name]=i})),this._labelInfoMap.forEach((function(i,n){if("region"===t._layoutRule){var r=!1,a="".concat(n.getGroupMark().name,"-label-component"),o=e[a];o||(r=!0,o=t._createMark({type:"component",name:a},{componentType:"label"},{support3d:t._spec.support3d})),o&&(r&&(o.setSkipBeforeLayouted(!0),t._marks.addMark(o),i.forEach((function(t){var e;null===(e=t.baseMark.getData())||void 0===e||e.addRelatedMark(o)}))),i[0]&&M(i[0].labelSpec.zIndex)&&o.setMarkConfig({zIndex:i[0].labelSpec.zIndex}),t._labelComponentMap.set(o,(function(){return t._labelInfoMap.get(n)})),e[a]=null)}else i.forEach((function(i,r){var a,o=!1,s="".concat(i.labelMark.name,"-component"),l=e[s];l||(o=!0,l=t._createMark({type:"component",name:s},{componentType:"label",noSeparateStyle:!0},{support3d:i.baseMark.getMarkConfig().support3d})),l&&(M(i.labelSpec.zIndex)&&l.setMarkConfig({zIndex:i.labelSpec.zIndex}),o&&(l.setSkipBeforeLayouted(!0),t._marks.addMark(l),null===(a=i.baseMark.getData())||void 0===a||a.addRelatedMark(l)),t._labelComponentMap.set(l,(function(){return t._labelInfoMap.get(n)[r]})),e[s]=null)}))})),Object.keys(e).forEach((function(i){var n=e[i];n&&(n.releaseWithExitAnimation()||n.release(),t._labelComponentMap.delete(n))}))}},{key:"_initTextMarkStyle",value:function(){var e=this;this._labelComponentMap.forEach((function(t,e){ot(t()).forEach((function(t){t.labelMark.setComponent(e)}))})),this._labelInfoMap.forEach((function(i){i.forEach((function(i){var n,r,a=i.labelMark,o=i.labelSpec,s=i.series;if(e.initMarkStyleWithSpec(a,o),A(null==o?void 0:o.getStyleHandler)){var l=o.getStyleHandler(s);null==l||l.call(s,a,o)}(null===(r=null===(n=a.stateStyle)||void 0===n?void 0:n.normal)||void 0===r?void 0:r.lineWidth)&&a.setAttribute("stroke",s.getColorAttribute(),"normal",t.AttributeLevel.Base_Series)}))}))}},{key:"updateLayoutAttribute",value:function(){var t=this;_(r,"updateLayoutAttribute",this,3)([]),this._labelComponentMap.forEach((function(e,i){var n=e();O(n)?t._updateMultiLabelAttribute(n,i):t._updateSingleLabelAttribute(n,i)}))}},{key:"_updateMultiLabelAttribute",value:function(t,e){this._updateLabelComponentAttribute(e,t.map((function(t){return t.baseMark})),t)}},{key:"_updateSingleLabelAttribute",value:function(t,e){var i=t.baseMark;this._updateLabelComponentAttribute(e,i,[t])}},{key:"_updateLabelComponentAttribute",value:function(t,e,i){var n=this,r=this._option.getComponentsByType("totalLabel");t.setMarkConfig({interactive:!1}),t.setSimpleStyle({labelStyle:function(t){var e,a,o=i[t],s=o.labelSpec,l=o.labelMark,u=o.series,h=l.getRule(),c=n._interactiveConfig(s),d=null!==(a=null===(e=n._spec)||void 0===e?void 0:e.centerOffset)&&void 0!==a?a:0,v=Nz({textStyle:Object.assign({pickable:!0===s.interactive},s.style),overlap:{avoidMarks:r.map((function(t){return t.getMarks()[0].getProductId()}))}},FK(h,o),Object.assign(Object.assign(Object.assign({},$(s,["position","style","state","type","stackDataFilterType","getStyleHandler"])),c),{centerOffset:d}),s.stackDataFilterType?{dataFilter:"min"===s.stackDataFilterType?function(t){return t.filter((function(t){return t.data[Bj]}))}:function(t){return t.filter((function(t){return t.data[Ej]}))}}:{});return u&&u.parseLabelStyle&&(v=u.parseLabelStyle(v,s,l)),"line"!==h&&"area"!==h||(v.type=h),v},size:function(){var t;return Object.assign({padding:null===(t=i[0].labelSpec.overlap)||void 0===t?void 0:t.padding},i[0].series.getRegion().getLayoutRect())},itemEncoder:function(t,e){var n=e.labelIndex;return i[n]&&!i[n].labelMark.skipEncode?zK(i[n],t,i[n].labelSpec.formatMethod,i[n].labelSpec.formatter):{data:t}}}),this._setTransformOfComponent(t,e)}},{key:"compileMarks",value:function(){var t=this;this.getMarks().forEach((function(e){var i,n=t._labelComponentMap.get(e)();i=O(n)?n[0].series.getRegion().getGroupMark().getProduct():n.series.getRegion().getGroupMark().getProduct(),e.compile({group:i})}))}},{key:"getLabelInfoByTextGraphic",value:function(t){var e,i=null==t?void 0:t.parent,n=null==i?void 0:i.parent;if(n){var r=n.getChildren().indexOf(i);this._labelComponentMap.forEach((function(t,i){i.getComponent()===n&&(e=ot(t())[r])}))}return e}}],[{key:"getSpecInfo",value:function(t,e){var i=this,n=[];return((null==e?void 0:e.region)||[]).forEach((function(r,a){(r.seriesIndexes||[]).some((function(t){var i=e.series[t].markLabelSpec,n=void 0===i?{}:i;return Object.values(n).some((function(t){return Array.isArray(t)&&function(t){return t.some((function(t){return t.visible}))}(t)}))}))&&n.push({spec:t,type:c.label,specInfoPath:["component",i.specKey,a],regionIndexes:[a]})})),n}}])}(d3);g3.type=c.label,g3.specKey="label",g3.transformerConstructor=p3;var y3=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).type=c.totalLabel,e.name=c.totalLabel,e.specKey="totalLabel",e.layoutZIndex=t.LayoutZIndex.Label,e}return h(r,e),a(r,[{key:"init",value:function(t){_(r,"init",this,3)([t]),this._initTextMark(),this._initLabelComponent()}},{key:"reInit",value:function(t){_(r,"reInit",this,3)([t]),this._initTextMark()}},{key:"_initTextMark",value:function(){var t,e=this._getSeries();if(null===(t=e.getSpec().totalLabel)||void 0===t?void 0:t.visible){var i=e.getSeriesMark();if(i){var n=this._createMark({type:"label",name:"".concat(i.name,"-total-label")});this._baseMark=i,this._textMark=n,this._initTextMarkStyle()}}}},{key:"_initTextMarkStyle",value:function(){var e;_(r,"initMarkStyleWithSpec",this,3)([this._textMark,this._spec]),this.setMarkStyle(this._textMark,{text:function(t){return t[Tj]}},"normal",t.AttributeLevel.Default);var i=this._getSeries();null===(e=i.initTotalLabelMarkStyle)||void 0===e||e.call(i,this._textMark)}},{key:"_initLabelComponent",value:function(){var t,e=this._getSeries(),i=this._createMark({type:"component",name:"".concat(null!==(t=e.name)&&void 0!==t?t:e.type,"-total-label-component")},{componentType:"label"},{support3d:this._spec.support3d});i&&(this._marks.addMark(i),e.getData().addRelatedMark(i))}},{key:"updateLayoutAttribute",value:function(){var t=this;_(r,"updateLayoutAttribute",this,3)([]);var e=this._getSeries();this._marks.forEach((function(i,n){i.setMarkConfig({interactive:!1}),i.setSimpleStyle({labelStyle:function(){var i,n;if(t._baseMark){var r=t._spec,a=r.offset,o=r.animation,s=r.overlap,l=r.position,u=void 0===l?"top":l,h=t._interactiveConfig(t._spec);return Nz({textStyle:{pickable:!0===t._spec.interactive},position:m3(e,t._baseMark.type,u),x:0,y:0},null!==(n=null===(i=e.getTotalLabelComponentStyle)||void 0===i?void 0:i.call(e,{baseMark:t._baseMark,labelMark:t._textMark}))&&void 0!==n?n:{},Object.assign({offset:a,animation:o,overlap:s,dataFilter:function(t){return t.filter((function(t){return"bottom"===u?t.data[Bj]:t.data[Ej]}))}},h))}},size:function(){var e;return Object.assign({padding:null===(e=t._spec.overlap)||void 0===e?void 0:e.padding},t._regions[0].getLayoutRect())},itemEncoder:function(i){return zK({baseMark:t._baseMark,labelMark:t._textMark,series:e,labelSpec:e.getSpec().totalLabel},i,t._spec.formatMethod)}}),t._setTransformOfComponent(i,t._baseMark)}))}},{key:"compileMarks",value:function(){var t=this;this.getMarks().forEach((function(e){var i=t._regions[0].getGroupMark().getProduct();e.compile({group:i,context:{model:t}})}))}},{key:"_getSeries",value:function(){return this._option.getSeriesInIndex([this.getSpecPath()[1]])[0]}}],[{key:"getSpecInfo",value:function(t,e){var i,n=this,r=[];return null===(i=null==e?void 0:e.region)||void 0===i||i.forEach((function(t,i){var a;null===(a=t.seriesIndexes)||void 0===a||a.forEach((function(t){var a=e.series[t].spec[n.specKey];(null==a?void 0:a.visible)&&r.push({spec:a,type:c.totalLabel,specPath:["series",t,n.specKey],specInfoPath:["component",n.specKey,t],regionIndexes:[i],seriesIndexes:[t]})}))})),r}}])}(d3);function m3(t,e){var i,n,r,a,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",s=t.direction;a="bottom"===o?{vertical:["bottom","top"],horizontal:["left","right"]}:{vertical:["top","bottom"],horizontal:["right","left"]};var l=("horizontal"===s?null===(i=t.getXAxisHelper())||void 0===i?void 0:i.isInverse():null===(n=t.getYAxisHelper())||void 0===n?void 0:n.isInverse())?1:0;switch(e){case"rect":case"symbol":r=a[s][l];break;default:r="top"}return r}y3.type=c.totalLabel,y3.builtInTheme={totalLabel:{visible:!1,offset:5,overlap:{clampForce:!0,strategy:[]},smartInvert:!1,animation:!1,style:{fontSize:{type:"token",key:"l4FontSize"},fill:{type:"palette",key:"primaryFontColor"}}}},y3.specKey="totalLabel";var _3=function(e){function o(){var e;return n(this,o),(e=i(this,o,arguments)).specKey="markPoint",e.layoutZIndex=t.LayoutZIndex.MarkPoint,e}return h(o,e),a(o,[{key:"_createMarkerComponent",value:function(){var t,e,i,n,a,o,s,l,u,h,c,d,v,f,p,g,y,m,_,b,k,x,S,A,C,M,T,w,E,B,P,O,I,R,L=this._spec,D=L.itemContent,F=void 0===D?{}:D,z=L.itemLine,j=void 0===z?{}:z,H=L.targetSymbol,N=void 0===H?{}:H,U=F,V=U.type,W=void 0===V?"text":V,G=U.text,Y=U.symbol,K=U.image,X=U.richText,q=U.customMark,Z=U.textStyle,J=U.symbolStyle,$=U.imageStyle,tt=U.richTextStyle,et=U.customMarkStyle,it=U.style,nt=void 0===it?{}:it,rt=U.state,at=void 0===rt?{}:rt,ot=r(U,["type","text","symbol","image","richText","customMark","textStyle","symbolStyle","imageStyle","richTextStyle","customMarkStyle","style","state"]),st=null,lt=null,ut={};"text"===W?(st=null!==(t=null==G?void 0:G.state)&&void 0!==t?t:at,ut={dx:0,dy:0},lt=S2(Object.assign(Object.assign({},G),{style:Q(ut,null!==(n=null!==(i=null!==(e=null==G?void 0:G.style)&&void 0!==e?e:null==G?void 0:G.textStyle)&&void 0!==i?i:Z)&&void 0!==n?n:nt)}),this._markerData,this._markAttributeContext)):"richText"===W?(st=null!==(a=null==X?void 0:X.state)&&void 0!==a?a:at,lt=C2(Q(ut={width:100,height:100},null!==(s=null!==(o=null==X?void 0:X.style)&&void 0!==o?o:tt)&&void 0!==s?s:nt),this._markerData,this._markAttributeContext)):"symbol"===W?(st=null!==(l=null==Y?void 0:Y.state)&&void 0!==l?l:at,lt=tH(C2(Q(ut={symbolType:"star",fill:"rgb(48, 115, 242)",fillOpacity:.8,size:20},null!==(h=null!==(u=null==Y?void 0:Y.style)&&void 0!==u?u:J)&&void 0!==h?h:nt),this._markerData,this._markAttributeContext))):"image"===W?(st=null!==(c=null==K?void 0:K.state)&&void 0!==c?c:at,lt=C2(Q(ut={width:80,height:80},null!==(v=null!==(d=null==K?void 0:K.style)&&void 0!==d?d:$)&&void 0!==v?v:nt),this._markerData,this._markAttributeContext)):"custom"===W&&(st=null!==(f=null==q?void 0:q.state)&&void 0!==f?f:at,lt=C2(null!==(g=null!==(p=null==q?void 0:q.style)&&void 0!==p?p:et)&&void 0!==g?g:nt,this._markerData,this._markAttributeContext));var ht={zIndex:this.layoutZIndex,interactive:null===(y=this._spec.interactive)||void 0===y||y,hover:null===(m=this._spec.interactive)||void 0===m||m,select:null===(_=this._spec.interactive)||void 0===_||_,position:{x:0,y:0},clipInRange:null!==(b=this._spec.clip)&&void 0!==b&&b,itemContent:Object.assign(Object.assign({type:W,offsetX:M2(F.offsetX,this._relativeSeries.getRegion()),offsetY:M2(F.offsetX,this._relativeSeries.getRegion())},ot),{style:C2(lt,this._markerData,this._markAttributeContext)}),targetSymbol:{offset:null!==(k=N.offset)&&void 0!==k?k:0,visible:null!==(x=N.visible)&&void 0!==x&&x,size:null!==(S=N.size)&&void 0!==S?S:20,style:C2(N.style,this._markerData,this._markAttributeContext)},state:{line:A2(null!==(C=null===(A=this._spec.itemLine.line)||void 0===A?void 0:A.state)&&void 0!==C?C:{},this._markerData,this._markAttributeContext),lineStartSymbol:A2(null!==(T=null===(M=this._spec.itemLine.startSymbol)||void 0===M?void 0:M.state)&&void 0!==T?T:{},this._markerData,this._markAttributeContext),lineEndSymbol:A2(null!==(E=null===(w=this._spec.itemLine.endSymbol)||void 0===w?void 0:w.state)&&void 0!==E?E:{},this._markerData,this._markAttributeContext),itemContent:A2(st,this._markerData,this._markAttributeContext),textBackground:A2(null===(P=null===(B=this._spec.itemContent.text)||void 0===B?void 0:B.labelBackground)||void 0===P?void 0:P.state,this._markerData,this._markAttributeContext),targetItem:A2(null!==(I=null===(O=this._spec.targetSymbol)||void 0===O?void 0:O.state)&&void 0!==I?I:{},this._markerData,this._markAttributeContext)},animation:null!==(R=this._spec.animation)&&void 0!==R&&R,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate},ct=j.visible,dt=j.line,vt=void 0===dt?{}:dt,ft=r(j,["visible","line"]);return ht.itemLine=!1!==ct?Object.assign(Object.assign({},ft),{visible:!0,lineStyle:tH(vt.style)}):{visible:!1},new KD(ht)}},{key:"_markerLayout",value:function(){var t,e,i,n,a,o,s,l,u,h,c,d,v,f,p=this._spec,g=this._markerData,y=this._relativeSeries,m=this._computePointsAttr().point,_=this._getRelativeDataView().latestData,b=g?g.latestData[0]&&g.latestData[0].latestData?g.latestData[0].latestData:g.latestData:_,k=this._spec,x=k.itemLine,S=void 0===x?{}:x,A=k.itemContent,C=void 0===A?{}:A,T=S.visible,w=S.line,E=void 0===w?{}:w,B=r(S,["visible","line"]),P=!1!==T?Object.assign(Object.assign({},B),{visible:!0,lineStyle:tH(E.style)}):{visible:!1},O=S2(Object.assign(Object.assign({},C.text),{style:Q({dx:0,dy:0},null!==(e=null===(t=C.text)||void 0===t?void 0:t.style)&&void 0!==e?e:C.style)}),g,this._markAttributeContext);if(p.clip||(null===(i=p.itemContent)||void 0===i?void 0:i.confine)){var I=x2([y.getRegion()]),R=I.minX,L=I.maxX,D=I.minY;f={x:R,y:D,width:L-R,height:I.maxY-D}}if(this._markerComponent){var F=null!==(n=this._markerComponent.attribute)&&void 0!==n?n:{},z=null!==(o=null===(a=F.itemContent)||void 0===a?void 0:a.textStyle)&&void 0!==o?o:{},j=null===(s=this._spec.itemContent.text)||void 0===s?void 0:s.text;this._markerComponent.setAttributes({position:void 0===m?{x:null,y:null}:m,itemContent:Object.assign(Object.assign({},F.itemContent),{panel:null!==(l=O.panel)&&void 0!==l?l:null===(u=F.itemContent)||void 0===u?void 0:u.panel,padding:null!==(h=O.padding)&&void 0!==h?h:null===(c=F.itemContent)||void 0===c?void 0:c.padding,textStyle:Object.assign(Object.assign(Object.assign({},z),null!==(d=O.textStyle)&&void 0!==d?d:{}),{text:(null===(v=this._spec.itemContent.text)||void 0===v?void 0:v.formatMethod)?this._spec.itemContent.text.formatMethod(b,_):M(j)?j:z.text}),offsetX:T2(m,F.itemContent.offsetX,this._relativeSeries.getRegion()),offsetY:T2(m,F.itemContent.offsetY,this._relativeSeries.getRegion())}),itemLine:P,limitRect:f,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}}},{key:"_initDataView",value:function(){var t=this._spec,e=P2(t),i=e.doXYProcess,n=e.doPolarProcess,r=e.doGeoProcess;(M(t.coordinate)||i||n||r)&&this._initCommonDataView()}}],[{key:"_getMarkerCoordinateType",value:function(t){var e=P2(t),i=e.doPolarProcess,n=e.doGeoProcess;return"polar"===t.coordinateType||i?"polar":"geo"===t.coordinateType||n?"geo":"cartesian"}}])}(Y2);_3.specKey="markPoint";var b3={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}},k3=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=c.markPoint,t.name=c.markPoint,t.coordinateType="cartesian",t}return h(e,t),a(e,[{key:"_computePointsAttr",value:function(){var t,e,i,n,r=this._spec,a=this._markerData,o=this._relativeSeries,s=M(r.x)&&M(r.y),l=M(r.coordinate),u=M(r.position),h=null!==(t=null==r?void 0:r.autoRange)&&void 0!==t&&t;return s?n=null===(i=null===(e=p2(a,o,o,o,h,!1,this._getAutoRangeExtendDomainKeyPrefix()))||void 0===e?void 0:e[0])||void 0===i?void 0:i[0]:l?n=m2(a,o,h,r.coordinatesOffset,this._getAutoRangeExtendDomainKeyPrefix())[0]:u&&(n=k2(r.position,o,r.regionRelative)[0]),{point:n}}},{key:"_computeOptions",value:function(){var t,e=this._spec,i=P2(e).doXYProcess,n=M(e.coordinate);return i?t=[this._processSpecByDims([{dim:"x",specValue:e.x},{dim:"y",specValue:e.y}])]:n&&(t=this._processSpecCoo(e)),{options:t}}}])}(_3);k3.type=c.markPoint,k3.coordinateType="cartesian",k3.builtInTheme={markPoint:b3};var x3=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=c.polarMarkPoint,t.name=c.polarMarkPoint,t.coordinateType="polar",t}return h(e,t),a(e,[{key:"_computePointsAttr",value:function(){var t,e,i=this._markerData,n=this._relativeSeries,r=y2(i,n,n,n,null!==(e=null===(t=this._spec)||void 0===t?void 0:t.autoRange)&&void 0!==e&&e,this._getAutoRangeExtendDomainKeyPrefix())[0][0];return{point:Ae({x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y},r.radius,r.angle)}}},{key:"_computeOptions",value:function(){var t=this._spec;return{options:[this._processSpecByDims([{dim:"radius",specValue:t.radius},{dim:"angle",specValue:t.angle}])]}}}])}(_3);x3.type=c.polarMarkPoint,x3.coordinateType="polar",x3.builtInTheme={polarMarkPoint:b3};var S3=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=c.geoMarkPoint,t.name=c.geoMarkPoint,t.coordinateType="geo",t}return h(e,t),a(e,[{key:"_computePointsAttr",value:function(){var t=function(t,e){var i=[];return(t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData).forEach((function(t){M(t.areaName)&&i.push([{x:e.nameValueToPosition(t.areaName).x+e.getRegion().getLayoutStartPoint().x,y:e.nameValueToPosition(t.areaName).y+e.getRegion().getLayoutStartPoint().y}])})),i}(this._markerData,this._relativeSeries)[0][0];return{point:t}}},{key:"_computeOptions",value:function(){var t=this._spec;return{options:[this._processSpecByDims([{dim:"areaName",specValue:t.areaName}])]}}}])}(_3);S3.type=c.geoMarkPoint,S3.coordinateType="geo",S3.builtInTheme={geoMarkPoint:b3};var A3="inBrush",C3="outOfBrush",M3={style:!0,inBrush:!0,outOfBrush:!0},T3=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).layoutType="none",e.type=c.brush,e.name=c.brush,e.specKey="brush",e.layoutZIndex=t.LayoutZIndex.Brush,e._linkedSeries=[],e._itemMap={},e._linkedItemMap={},e._inBrushElementsMap={},e._outOfBrushElementsMap={},e._linkedInBrushElementsMap={},e._linkedOutOfBrushElementsMap={},e._cacheInteractiveRangeAttrs=[],e._releatedAxes=[],e._regionAxisMap={},e._axisDataZoomMap={},e._zoomRecord=[],e}return h(r,e),a(r,[{key:"init",value:function(){var e=this._transformBrushedMarkAttr(this._spec.inBrush),i=this._transformBrushedMarkAttr(this._spec.outOfBrush);this._option.getAllSeries().forEach((function(n){n.getActiveMarks().forEach((function(r){r&&(n.setMarkStyle(r,Object.assign({},e),A3,t.AttributeLevel.Series),n.setMarkStyle(r,Object.assign({},i),C3,t.AttributeLevel.Series))}))}))}},{key:"reInit",value:function(t){_(r,"reInit",this,3)([t]),this.init()}},{key:"_initNeedOperatedItem",value:function(){var t=this,e=this._spec.seriesId,i=this._spec.seriesIndex;this._relativeRegions.forEach((function(n){var r=[];n.getSeries().forEach((function(a){(e&&ot(e).includes(a.userId.toString())||i&&ot(i).includes(a.getSpecIndex())||!i&&!e)&&r.push.apply(r,b(a.getMarksWithoutRoot())),t._itemMap[n.id]=r}))})),this._linkedSeries.forEach((function(e){t._linkedItemMap[e.id]=e.getMarksWithoutRoot()}))}},{key:"created",value:function(){_(r,"created",this,3)([]),this.initEvent(),this._bindRegions(),this._bindLinkedSeries(),this._initRegionAxisMap(),this._initAxisDataZoomMap(),this._initNeedOperatedItem()}},{key:"_bindRegions",value:function(){M(this._spec.regionId)||M(this._spec.regionIndex)?this._relativeRegions=this._option.getRegionsInUserIdOrIndex(ot(this._spec.regionId),ot(this._spec.regionIndex)):this._relativeRegions=this._option.getAllRegions()}},{key:"_bindLinkedSeries",value:function(){(M(this._spec.brushLinkSeriesId)||M(this._spec.brushLinkSeriesIndex))&&(this._linkedSeries=this._option.getSeriesInUserIdOrIndex(ot(this._spec.brushLinkSeriesId),ot(this._spec.brushLinkSeriesIndex)))}},{key:"_initRegionAxisMap",value:function(){var t=this;M(this._spec.axisId)?ot(this._spec.axisId).forEach((function(e){t._releatedAxes.push(t._option.getComponentByUserId(e))})):M(this._spec.axisIndex)?ot(this._spec.axisIndex).forEach((function(e){t._releatedAxes.push(t._option.getComponentByIndex("axes",e))})):this._releatedAxes=this._option.getComponentsByKey("axes"),this._releatedAxes.forEach((function(e){null==e||e.getRegions().forEach((function(i){t._regionAxisMap["region_"+i.id]?t._regionAxisMap["region_"+i.id].push(e):t._regionAxisMap["region_"+i.id]=[e]}))}))}},{key:"_initAxisDataZoomMap",value:function(){var t=this;this._option.getComponentsByKey("dataZoom").forEach((function(e){e.relatedAxisComponent&&(t._axisDataZoomMap[e.relatedAxisComponent.id]=e)}))}},{key:"initEvent",value:function(){}},{key:"_compareSpec",value:function(t,e){var i=this;this._brushComponents&&this._relativeRegions.forEach((function(t,e){i._updateBrushComponent(t,e)}));var n=_(r,"_compareSpec",this,3)([t,e]);return nt(e,t)||(n.change=!0,n.reRender=!0,n.reMake||n.reCompile||!this._isComponentOnlySpecChange(t,e)?n.reMake=!0:n.effects=Object.assign(Object.assign({},n.effects),{component:!0,layout:!0,render:!0})),n}},{key:"_isComponentOnlySpecChange",value:function(t,e){return Object.keys(Object.assign(Object.assign({},e),t)).every((function(i){return nt(null==e?void 0:e[i],null==t?void 0:t[i])||M3[i]}))}},{key:"onLayoutEnd",value:function(){var t,e=this;_(r,"onLayoutEnd",this,3)([]),this._option.disableTriggerEvent||(null===(t=this._spec.visible)||void 0===t||t)&&(this._brushComponents?this._relativeRegions.forEach((function(t,i){e._updateBrushComponent(t,i)})):(this._brushComponents=[],this._relativeRegions.forEach((function(t,i){e._createBrushComponent(t,i)}))))}},{key:"_updateBrushComponent",value:function(t,e){var i,n=this._getBrushInteractiveAttr(t),r=this._brushComponents[e];r.setAttributes(Object.assign({brushStyle:tH(null===(i=this._spec)||void 0===i?void 0:i.style)},n)),this._initMarkBrushState(e,""),r.children[0].removeAllChild()}},{key:"_shouldEnableInteractive",value:function(){return!1!==this.getOption().getCompiler().getOption().interactive}},{key:"_createBrushComponent",value:function(e,i){var n,r,a=this,o=this._getBrushInteractiveAttr(e),s=new jF(Object.assign(Object.assign(Object.assign({zIndex:this.layoutZIndex,brushStyle:tH(null===(n=this._spec)||void 0===n?void 0:n.style)},o),this._spec),{disableTriggerEvent:this._option.disableTriggerEvent}));s.id=null!==(r=this._spec.id)&&void 0!==r?r:"brush-".concat(this.id),this.getContainer().add(s),this._brushComponents.push(s),this._cacheInteractiveRangeAttrs.push(o),s.addEventListener(OF.brushActive,(function(n){a._initMarkBrushState(i,C3),a._emitEvent(t.ChartEvent.brushActive,e,n)})),s.addEventListener(OF.drawStart,(function(i){a._spec.disableDimensionHoverWhenBrushing&&a._option.globalInstance.disableDimensionHoverEvent(!0),a._setRegionMarkPickable(e,!0),a._emitEvent(t.ChartEvent.brushStart,e,i)})),s.addEventListener(OF.moveStart,(function(i){a._spec.disableDimensionHoverWhenBrushing&&a._option.globalInstance.disableDimensionHoverEvent(!0),a._setRegionMarkPickable(e,!0),a._emitEvent(t.ChartEvent.brushStart,e,i)})),s.addEventListener(OF.drawing,(function(i){a._setRegionMarkPickable(e,!1),a._handleBrushChange(e,i),a._emitEvent(t.ChartEvent.brushChange,e,i)})),s.addEventListener(OF.moving,(function(i){a._setRegionMarkPickable(e,!1),a._handleBrushChange(e,i),a._emitEvent(t.ChartEvent.brushChange,e,i)})),s.addEventListener(OF.brushClear,(function(n){a._spec.disableDimensionHoverWhenBrushing&&a._option.globalInstance.disableDimensionHoverEvent(!1),a._setRegionMarkPickable(e,!0),a._initMarkBrushState(i,""),a._emitEvent(t.ChartEvent.brushClear,e,n)})),s.addEventListener(OF.drawEnd,(function(n){var r;a._spec.disableDimensionHoverWhenBrushing&&a._option.globalInstance.disableDimensionHoverEvent(!1),a._setRegionMarkPickable(e,!0);var o=n.detail.operateMask,s=a._spec.updateElementsState,l=void 0===s||s;if(null===(r=a._spec)||void 0===r?void 0:r.onBrushEnd)!0===a._spec.onBrushEnd(n)?(a.clearGraphic(),a._initMarkBrushState(i,""),a._emitEvent(t.ChartEvent.brushClear,e,n)):(a._spec.onBrushEnd(n),a._emitEvent(t.ChartEvent.brushEnd,e,n));else{var u=a._extendDataInBrush(a._inBrushElementsMap);(!a._spec.zoomWhenEmpty&&u.length>0||!l)&&a._setAxisAndDataZoom(o,e),a._emitEvent(t.ChartEvent.brushEnd,e,n)}})),s.addEventListener(OF.moveEnd,(function(i){a._spec.disableDimensionHoverWhenBrushing&&a._option.globalInstance.disableDimensionHoverEvent(!1),a._setRegionMarkPickable(e,!0);var n=i.detail.operateMask,r=a._spec.updateElementsState,o=void 0===r||r,s=a._extendDataInBrush(a._inBrushElementsMap);(!a._spec.zoomWhenEmpty&&s.length>0||o)&&a._setAxisAndDataZoom(n,e),a._emitEvent(t.ChartEvent.brushEnd,e,i)}))}},{key:"_getBrushInteractiveAttr",value:function(t){var 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],interactive:this._shouldEnableInteractive()}}},{key:"_transformBrushedMarkAttr",value:function(t){var e={};return(null==t?void 0:t.symbol)&&(e.symbolType=t.symbol),(null==t?void 0:t.symbolSize)&&(e.size=t.symbolSize),(null==t?void 0:t.color)&&(e.fill=t.color),(null==t?void 0:t.colorAlpha)&&(e.fillOpacity=t.colorAlpha),Object.assign(Object.assign({},tH(t)),e)}},{key:"_handleBrushChange",value:function(t,e){var i=e.detail.operateMask;this._operateMask=i;var n=this._spec.updateElementsState;(void 0===n||n)&&(this._reconfigItem(i,t),this._reconfigLinkedItem(i,t))}},{key:"_extendDataInBrush",value:function(t){var e,i,n=[];for(var r in t)for(var a in t[r])n.push(Object.assign({},null===(i=null===(e=t[r][a].context)||void 0===e?void 0:e.data)||void 0===i?void 0:i[0]));return n}},{key:"_extendDatumOutOfBrush",value:function(t){var e,i,n=[];for(var r in t)n.push(null===(i=null===(e=t[r].context)||void 0===e?void 0:e.data)||void 0===i?void 0:i[0]);return n}},{key:"_emitEvent",value:function(t,e,i){var n;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,zoomRecord:this._zoomRecord},vchart:null===(n=this._option)||void 0===n?void 0:n.globalInstance,event:i})}},{key:"_reconfigItem",value:function(t,e){var i,n,r,a=this;if((null==t?void 0:t.globalTransMatrix)&&(null===(i=null==t?void 0:t.attribute)||void 0===i?void 0:i.points)){var o=null!==(r=null===(n=null==t?void 0:t.attribute)||void 0===n?void 0:n.points)&&void 0!==r?r:[],s=t.globalTransMatrix,l=s.a,u=s.b,h=s.c,c=s.d,d=s.e,v=s.f,f=o.map((function(t){return{x:l*t.x+h*t.y+d,y:u*t.x+c*t.y+v}})),p=this._spec.markTypeFilter,g=void 0===p?[]:p;this._itemMap[e.id].forEach((function(e){if(!g.includes(e.type)){var i=e.getGraphics();i&&i.length&&i.forEach((function(i){var n,r,o,s=e.id+"_"+i.context.key,l=a._isBrushContainItem(t.globalAABBBounds,f,i);(null===(n=a._outOfBrushElementsMap)||void 0===n?void 0:n[s])&&l?(ZN(i,A3,!0),a._inBrushElementsMap[null==t?void 0:t.name]||(a._inBrushElementsMap[null==t?void 0:t.name]={}),a._inBrushElementsMap[null==t?void 0:t.name][s]=i,delete a._outOfBrushElementsMap[s]):(null===(o=null===(r=a._inBrushElementsMap)||void 0===r?void 0:r[null==t?void 0:t.name])||void 0===o?void 0:o[s])&&!l&&(JN(i,A3),ZN(i,C3,!0),a._outOfBrushElementsMap[s]=i,delete a._inBrushElementsMap[t.name][s])}))}}))}}},{key:"_reconfigLinkedItem",value:function(t,e){var i,n=this;if((null==t?void 0:t.globalTransMatrix)&&(null===(i=null==t?void 0:t.attribute)||void 0===i?void 0:i.points)){var r=e.getLayoutStartPoint(),a=e.getSeries().map((function(t){return t.id}));this._linkedSeries.forEach((function(e){var i,o;if(!a.includes(e.id)){var s=e.getRegion().getLayoutStartPoint(),l=s.x-r.x,u=s.y-r.y,h=null!==(o=null===(i=null==t?void 0:t.attribute)||void 0===i?void 0:i.points)&&void 0!==o?o:[],c=t.globalTransMatrix,d=c.a,v=c.b,f=c.c,p=c.d,g=c.e,y=c.f,m=l||0,_=u||0,b=h.map((function(t){return{x:d*t.x+f*t.y+g+m,y:v*t.x+p*t.y+y+_}}));t.globalAABBBounds.clone().set(t.globalAABBBounds.x1+m,t.globalAABBBounds.y1+_,t.globalAABBBounds.x2+m,t.globalAABBBounds.y2+_);var k=n._spec.markTypeFilter,x=void 0===k?[]:k;n._linkedItemMap[e.id].forEach((function(e){if(!x.includes(e.type)){var i=e.getGraphics();i&&i.length&&i.forEach((function(i){var r,a,o;i.context;var s=e.id+"_"+i.context.key;(null===(r=n._linkedOutOfBrushElementsMap)||void 0===r?void 0:r[s])&&n._isBrushContainItem(t.globalAABBBounds,b,i)?(ZN(i,A3,!0),n._linkedInBrushElementsMap[null==t?void 0:t.name]||(n._linkedInBrushElementsMap[null==t?void 0:t.name]={}),n._linkedInBrushElementsMap[null==t?void 0:t.name][s]=i,delete n._linkedOutOfBrushElementsMap[s]):(null===(o=null===(a=n._linkedInBrushElementsMap)||void 0===a?void 0:a[null==t?void 0:t.name])||void 0===o?void 0:o[s])&&!n._isBrushContainItem(t.globalAABBBounds,b,i)&&(JN(i,A3),ZN(i,C3,!0),n._linkedOutOfBrushElementsMap[s]=i)}))}}))}}))}}},{key:"_isBrushContainItem",value:function(t,e,i){if(["symbol","rect"].includes(i.type)){var n=null==i?void 0:i.globalAABBBounds,r=n.x1,a=n.x2,o=n.y1,s=n.y2;return function(t,e){for(var i=0;i<e.length;i++){if(Ge(t,e[i].x,e[i].y))return!0;if(i>0&&We(e[i-1].x,e[i-1].y,e[i].x,e[i].y,t))return!0}return!1}(e,[{x:r,y:o},{x:a,y:o},{x:a,y:s},{x:r,y:s}])}return t.intersects(i.globalAABBBounds)}},{key:"_initItemMap",value:function(t,e,i){var n=this._spec.markTypeFilter,r=void 0===n?[]:n;Object.entries(t).forEach((function(t){var n=m(t,2);n[0],n[1].forEach((function(t){if(!r.includes(t.type)){var n=t.getGraphics();n&&n.length&&n.forEach((function(n){var r=t.id+"_"+n.context.key;JN(n,[A3,C3]),i&&ZN(n,i,!0),e[r]=n}))}}))}))}},{key:"_initMarkBrushState",value:function(t,e){this._brushComponents.forEach((function(e,i){i!==t&&e.children[0].removeAllChild()})),this._inBrushElementsMap={},this._outOfBrushElementsMap={},this._linkedInBrushElementsMap={},this._linkedOutOfBrushElementsMap={},this._initItemMap(this._itemMap,this._outOfBrushElementsMap,e),this._initItemMap(this._linkedItemMap,this._linkedOutOfBrushElementsMap,e)}},{key:"_setRegionMarkPickable",value:function(t,e){t.getGroupMark().getGraphics().forEach((function(t){return t.setAttribute("childrenPickable",e)}))}},{key:"_stateClamp",value:function(t){return Math.min(Math.max(0,t),1)}},{key:"_setAxisAndDataZoom",value:function(t,e){var i,n=this;if(this._zoomRecord=[],this._spec.zoomAfterBrush){var r=t.AABBBounds;null===(i=this._regionAxisMap["region_"+e.id])||void 0===i||i.forEach((function(t){var i,a,o="bottom"===t.layoutOrient||"top"===t.layoutOrient,s=null!==(i=n._spec.axisRangeExpand)&&void 0!==i?i:0,l=r.x1,u=r.x2,h=r.y1,c=r.y2,d=o?"x":"y",v=o?l:h,f=o?u:c,p=t.getScale().range(),g=null!==(a=t.scaleRangeFactor())&&void 0!==a?a:[0,1],y=st(p)<p[0],m=v-e.getLayoutStartPoint()[d],_=f-e.getLayoutStartPoint()[d],b=y?Math.min(m,_):Math.max(m,_),k=y?Math.max(m,_):Math.min(m,_),x=(k-p[0])/(st(p)-p[0])*(g[1]-g[0])+g[0],S=(b-p[0])/(st(p)-p[0])*(g[1]-g[0])+g[0],A=n._stateClamp(x-s),C=n._stateClamp(S+s);if(n._axisDataZoomMap[t.id]){var M=n._axisDataZoomMap[t.id],T=y?1-A:A,w=y?1-C:C;M.setStartAndEnd(Math.min(T,w),Math.max(T,w),["percent","percent"]),n._zoomRecord.push({operateComponent:M,start:T,end:w,startValue:j1(T,M.stateScale,N1(M.relatedAxisComponent,M.isHorizontal)),endValue:j1(w,M.stateScale,N1(M.relatedAxisComponent,M.isHorizontal))})}else t.scaleRangeFactor([A,C]),t.effect.scaleUpdate(),n._zoomRecord.push({operateComponent:t,start:A,end:C,startValue:t.getScale().invert(k),endValue:t.getScale().invert(b)})}))}}},{key:"_getNeedClearVRenderComponents",value:function(){return this._brushComponents}},{key:"clearGraphic",value:function(){this._brushComponents&&this._brushComponents.forEach((function(t){t._container.incrementalClearChild()}))}},{key:"clear",value:function(){var t=this;if(this._brushComponents){var e=this.getContainer();this._brushComponents.forEach((function(i,n){t._initMarkBrushState(n,""),i.removeAllChild(),i.releaseBrushEvents(),e&&e.removeChild(i)})),this._brushComponents=null}}},{key:"clearBrushStateAndMask",value:function(){var t=this;this._relativeRegions.forEach((function(e,i){t._initMarkBrushState(i,""),t._brushComponents[i].children[0].removeAllChild()}))}}],[{key:"getSpecInfo",value:function(t){return IU(t,this.specKey,this.type,(function(t){return!1!==t.visible}))}}])}(DW);T3.type=c.brush,T3.builtInTheme={brush:{style:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",lineWidth:2},brushMode:"single",brushType:"rect",brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:0}},T3.specKey="brush";var w3={style:!0,state:!0},E3=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).type=c.customMark,e.specKey="customMark",e.layoutType="none",e.layoutZIndex=t.LayoutZIndex.CustomMark,e.layoutLevel=t.LayoutLevel.CustomMark,e}return h(r,e),a(r,[{key:"created",value:function(){_(r,"created",this,3)([]),this.initMarks(),this.initEvent()}},{key:"getMarkAttributeContext",value:function(){return this._markAttributeContext}},{key:"_buildMarkAttributeContext",value:function(){var t=this;this._markAttributeContext={vchart:this._option.globalInstance,globalScale:function(e,i){var n;return null===(n=t._option.globalScale.getScale(e))||void 0===n?void 0:n.scale(i)}}}},{key:"initMarks",value:function(){var t=this;if(this._spec){var e=null;if(this._spec.parent){var i=this.getChart().getAllMarks().find((function(e){return e.getUserId()===t._spec.parent}));"group"===i.type&&(e=i)}this._createExtensionMark(this._spec,e,"".concat(dj,"_series_").concat(this.id,"_extensionMark"),0)}}},{key:"_createExtensionMark",value:function(t,e,i){var n,r,a=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=this._createMark({type:t.type,name:M(t.name)?"".concat(t.name):"".concat(i,"_").concat(o)},{skipBeforeLayouted:!0,attributeContext:this._getMarkAttributeContext(),componentType:t.componentType,key:t.dataKey});if(s){if(M(t.id)&&s.setUserId(t.id),(null===(n=this._option.globalInstance)||void 0===n?void 0:n.isAnimationEnable())&&t.animation){var l=lV({},uV(t.type,t,this._markAttributeContext));s.setAnimationConfig(l)}if(C(e)?this._marks.addMark(s):e&&e.addMark(s),this.initMarkStyleWithSpec(s,t),"group"===t.type&&(i="".concat(i,"_").concat(o),null===(r=t.children)||void 0===r||r.forEach((function(t,e){a._createExtensionMark(t,s,i,e)}))),M(t.dataId)||F(t.dataIndex)){var u=this.getChart().getSeriesData(t.dataId,t.dataIndex);u&&(s.setDataView(u),u.target.addListener("change",(function(){s.getData().updateData()})))}}}},{key:"initEvent",value:function(){}},{key:"_compareSpec",value:function(t,e){var i=_(r,"_compareSpec",this,3)([t,e]);return nt(e,t)||(i.reMake||i.reCompile||!this._isComponentOnlySpecChange(t,e)?i.reMake=!0:i.effects=Object.assign(Object.assign({},i.effects),{component:!0,render:!0})),i.change=!0,i.reRender=!0,i}},{key:"_isComponentOnlySpecChange",value:function(t,e){return Object.keys(Object.assign(Object.assign({},e),t)).every((function(i){return nt(null==e?void 0:e[i],null==t?void 0:t[i])||w3[i]}))}},{key:"reInit",value:function(t){_(r,"reInit",this,3)([t]),this._updateMarkStyleWithSpec(this._spec,this.getMarks()[0]),this.getMarks().forEach((function(t){t.commit(!1,!0)}))}},{key:"_updateMarkStyleWithSpec",value:function(t,e){var i,n,r,a,o=this;if(t&&e&&(this.initMarkStyleWithSpec(e,t),"group"===t.type)){var s=null!==(r=null===(n=(i=e).getMarks)||void 0===n?void 0:n.call(i))&&void 0!==r?r:[];null===(a=t.children)||void 0===a||a.forEach((function(t,e){o._updateMarkStyleWithSpec(t,s[e])}))}}},{key:"_getMarkAttributeContext",value:function(){var t=this;return{vchart:this._option.globalInstance,chart:this.getChart(),globalScale:function(e,i){var n;return null===(n=t._option.globalScale.getScale(e))||void 0===n?void 0:n.scale(i)},getLayoutBounds:function(){var e=t.getLayoutStartPoint(),i=e.x,n=e.y,r=t.getLayoutRect(),a=r.width,o=r.height;return(new ei).set(i,n,i+a,n+o)}}}},{key:"_getLayoutRect",value:function(){var t=new ei;return this.getMarks().forEach((function(e){var i=e.getProduct();i&&t.union(i.AABBBounds)})),t.empty()?{width:0,height:0}:{width:t.width(),height:t.height()}}},{key:"getBoundsInRect",value:function(t){this.setLayoutRect(t);var e=this._getLayoutRect(),i=this.getLayoutStartPoint(),n=i.x,r=i.y;return{x1:n,y1:r,x2:n+e.width,y2:r+e.height}}},{key:"getVRenderComponents",value:function(){var t=[],e=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(i){if(i&&"group"===i.type)i.getMarks().forEach((function(t){e(t)}));else if("component"===i.type){var n=null==i?void 0:i.getComponent();n&&t.push(n)}}));return this.getMarks().forEach((function(t){e(t)})),t}}])}(DW);E3.type=c.customMark,E3.specKey="customMark";var B3=function(){function t(e,i){n(this,t),this._chartLayoutRect={x:0,y:0,width:1,height:1},this._col=1,this._row=1,this._elementMap=new Map,this.standardizationSpec(e),this._gridInfo=e,this._col=e.col,this._row=e.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=null==i?void 0:i.onError,this.initUserSetting()}return a(t,[{key:"standardizationSpec",value:function(t){var e,i,n;t.col=null!==(e=t.col)&&void 0!==e?e:1,t.row=null!==(i=t.row)&&void 0!==i?i:1,t.elements=null!==(n=t.elements)&&void 0!==n?n:[]}},{key:"initUserSetting",value:function(){var t=this;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((function(e,i){e||(t._colSize[i]={value:0,isUserSetting:!1,isLayoutSetting:!1})})),this._rowSize.forEach((function(e,i){e||(t._rowSize[i]={value:0,isUserSetting:!1,isLayoutSetting:!1})}))}},{key:"setSizeFromUserSetting",value:function(t,e,i,n){t.forEach((function(t){t.index<0&&t.index>=i||(F(t.size)?e[t.index]={value:+t.size,isUserSetting:!0,isLayoutSetting:!1}:A(t.size)&&(e[t.index]={value:t.size(n),isUserSetting:!0,isLayoutSetting:!1}))}))}},{key:"clearLayoutSize",value:function(){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((function(t){t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)})),this._rowSize.forEach((function(t){t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)}))}},{key:"getItemGridInfo",value:function(t){var e,i,n=this._elementMap.get(t);return n||(i=null===(e=this._gridInfo.elements)||void 0===e?void 0:e.find((function(e){var i;if("modelId"in e&&M(e.modelId)){if(M(t.model.userId)&&t.model.userId===e.modelId)return!0}else if("modelKey"in e&&M(e.modelKey)&&"modelIndex"in e&&M(e.modelIndex)&&(null!==(i=t.model.specKey)&&void 0!==i?i:t.model.type)===e.modelKey&&t.model.getSpecIndex()===e.modelIndex)return!0;return!1})),i||(i={col:0,colSpan:1,row:0,rowSpan:1}),this._elementMap.set(t,i),i)}},{key:"getSizeFromGrid",value:function(t,e){for(var i,n="col"===e?this._colSize:this._rowSize,r=0,a=t[e];a<t[e]+(null!==(i=t["".concat(e,"Span")])&&void 0!==i?i:1);a++)r+=n[a].value;return r}},{key:"getSizeFromUser",value:function(t,e){var i,n,r="col"===e?this._colSize:this._rowSize;if(null===(i=r[t[e]])||void 0===i?void 0:i.isUserSetting){for(var a=0,o=t[e];o<t[e]+(null!==(n=t["".concat(e,"Span")])&&void 0!==n?n:1);o++){if(!r[o].isUserSetting)return;a+=r[o].value}return a}}},{key:"setItemLayoutSizeToGrid",value:function(t,e){if(P3(t)){if(e.colSpan&&e.colSpan>1)return;if(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)return;if(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}}},{key:"layoutGrid",value:function(t){var e="col"===t?this._colSize:this._rowSize,i="col"===t?this._chartLayoutRect.width:this._chartLayoutRect.height,n=[];e.forEach((function(t){t.isUserSetting||t.isLayoutSetting?i-=t.value:n.push(t)})),i<0&&console.warn("layout content ".concat(t," size bigger than chart")),n.forEach((function(t){return t.value=i/n.length}))}},{key:"getItemPosition",value:function(t){for(var e=this.getItemGridInfo(t),i={x:this._chartLayoutRect.x,y:this._chartLayoutRect.y},n=0;n<e.col;n++)i.x+=this._colSize[n].value;for(var r=0;r<e.row;r++)i.y+=this._rowSize[r].value;return i.x+=t.layoutPaddingLeft+t.layoutOffsetX,i.y+=t.layoutPaddingTop+t.layoutOffsetY,i}},{key:"getItemLayoutRect",value:function(t){var e,i,n=this.getItemGridInfo(t);return{width:(null!==(e=this.getSizeFromGrid(n,"col"))&&void 0!==e?e:this._chartLayoutRect.width)-t.layoutPaddingLeft-t.layoutPaddingRight,height:(null!==(i=this.getSizeFromGrid(n,"row"))&&void 0!==i?i:this._chartLayoutRect.height)-t.layoutPaddingTop-t.layoutPaddingBottom}}},{key:"layoutItems",value:function(t,e,i,n){var r=this;this._chartLayoutRect=i,this._chartViewBox=n,this.clearLayoutSize(),e.sort((function(t,e){return e.layoutLevel-t.layoutLevel}));var a=e.filter((function(t){return"normal"===t.layoutType&&!1!==t.getModelVisible()})),o=a.filter((function(t){return P3(t)})),s=a.filter((function(t){return!P3(t)}));a.forEach((function(t){r.layoutOneItem(t,"user",!1)}));var l=e.filter((function(t){return"region-relative"===t.layoutType})),u=l.filter((function(t){return P3(t)})),h=l.filter((function(t){return!P3(t)}));u.forEach((function(t){return r.layoutOneItem(t,"user",!1)})),this.layoutGrid("col"),s.forEach((function(t){return r.layoutOneItem(t,"colGrid",!1)})),h.forEach((function(t){r.layoutOneItem(t,"colGrid",!1)})),this.layoutGrid("row"),h.forEach((function(t){r.layoutOneItem(t,"grid",!1)})),o.forEach((function(t){return r.layoutOneItem(t,"grid",!1)})),u.forEach((function(t){r.layoutOneItem(t,"grid",!0)})),this.layoutGrid("col"),e.filter((function(t){return"region"===t.layoutType})).forEach((function(t){return r.layoutOneItem(t,"grid",!1)})),this.layoutAbsoluteItems(e.filter((function(t){return"absolute"===t.layoutType}))),e.filter((function(t){return"absolute"!==t.layoutType})).forEach((function(t){t.setLayoutStartPosition(r.getItemPosition(t))}))}},{key:"layoutAbsoluteItems",value:function(t){var e=this;t.forEach((function(t){t.absoluteLayoutInRect(e._chartLayoutRect)}))}},{key:"layoutOneItem",value:function(t,e,i){var n,r,a="rowGrid"===e||"grid"===e?this.getSizeFromGrid.bind(this):this.getSizeFromUser.bind(this),o="colGrid"===e||"grid"===e?this.getSizeFromGrid.bind(this):this.getSizeFromUser.bind(this),s=this.getItemGridInfo(t),l={width:(null!==(n=o(s,"col"))&&void 0!==n?n:this._chartLayoutRect.width)-t.layoutPaddingLeft-t.layoutPaddingRight,height:(null!==(r=a(s,"row"))&&void 0!==r?r:this._chartLayoutRect.height)-t.layoutPaddingTop-t.layoutPaddingBottom},u=t.computeBoundsInRect(l);F(u.width)||(u.width=l.width),F(u.height)||(u.height=l.height),t.setLayoutRect("grid"!==e?u:l),this.setItemLayoutSizeToGrid(t,s)}}])}();function P3(t){return"left"===t.layoutOrient||"right"===t.layoutOrient}B3.type="grid";var O3="vchart-tooltip",I3="".concat(O3,"-container"),R3="".concat(O3,"-title"),L3="".concat(O3,"-content-box"),D3={offsetX:10,offsetY:10},F3="99999999999999";function z3(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\(/g,"(").replace(/ /g," ")}var j3=function(t,e){return t?(e||(e=t.getBoundingClientRect()),t.offsetWidth>0?e.width/t.offsetWidth:t.offsetHeight>0?e.height/t.offsetHeight:1):1},H3=function(t){return P(t)&&""!==(null==t?void 0:t.trim())||L(t)?z3(t):""},N3=function(t,e){var i;if(M(t))if(L(t))i=t;else if(A(t)){var n=t(e);L(n)&&(i=n)}return i},U3={left:[-2,0],right:[2,0],top:[0,-2],bottom:[0,2],insideTop:[0,-1.5],insideBottom:[0,1.5],insideLeft:[-1.5,0],insideRight:[1.5,0],insideTopLeft:[-1.5,-1.5],insideTopRight:[1.5,-1.5],insideBottomLeft:[-1.5,1.5],insideBottomRight:[1.5,1.5],lt:[-2,-2],tl:[-2,-2],rt:[2,-2],tr:[2,-2],bl:[-2,2],lb:[-2,2],br:[2,2],rb:[2,2],inside:[0,0],center:[0,0],centerBottom:[0,1],centerTop:[0,-1],centerLeft:[-1,0],centerRight:[1,0]},V3=function(t,e){var i,n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;return null!==(n=null===(i=U3[t])||void 0===i?void 0:i["x"===e?0:1])&&void 0!==n?n:r},W3=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments))._visible=!0,t._isReleased=!1,t.showTooltip=function(e,i,n){return n.changePositionOnly?t.changeTooltipPosition(n,i):t.changeTooltip(!0,n,i)},t.changeTooltip=function(e,i,n){return t._isReleased?1:e?t.changeTooltipPosition(i,n):(t._updateTooltip(!1,i),0)},t.changeTooltipPosition=function(e,i){var n,r,a,o,s;if(t._isReleased)return 1;var l=e.event,u=e.tooltipSpec,h=e.activeTooltipSpec,c=e.changePositionOnly;if(!h)return 1;var d=h.activeType;if(h.handler)return null!==(a=null===(r=(n=h.handler).showTooltip)||void 0===r?void 0:r.call(n,d,i,e))&&void 0!==a?a:0;var v=h,f=t._getActualTooltipPosition(h,e,t._getTooltipBoxSize(h,c));h.position=f;var p=null!==(o=h.updatePosition)&&void 0!==o?o:null===(s=u[d])||void 0===s?void 0:s.updatePosition;p&&(h.position=p(h.position,i,e));var g=!1!==(null==v?void 0:v.visible);return i&&"pointerout"!==l.type&&h.visible&&(h.title||h.content)||(g=!1),t._updateTooltip(g,Object.assign(Object.assign({},e),{changePositionOnly:c})),0},t._getActualTooltipPosition=function(e,i,n){var r,a,o,s,l,u,h,c,d,v=t._chartOption.getRectByDimensionData,f=i.tooltipSpec,p={x:1/0,y:1/0};if(!f)return p;var g,y=i.event,m=e.activeType,_=e.data,b="dimension"===m?null===(a=null===(r=_[0])||void 0===r?void 0:r.data)||void 0===a?void 0:a[0]:null==_?void 0:_[0],k=t._option,x=k.offsetX,S=k.offsetY,C=f[m],w=FU(null==C?void 0:C.position,_,i),E=null!==(o=FU(null==C?void 0:C.positionMode,_,i))&&void 0!==o?o:"mark"===m?"mark":"pointer",B=null!=n?n:{},P=B.width,O=void 0===P?0:P,I=B.height,R=void 0===I?0:I,D="canvas"===f.renderMode,z=null===(s=null==i?void 0:i.chart)||void 0===s?void 0:s.getCanvasRect(),j=null!==(l=null==z?void 0:z.width)&&void 0!==l?l:vj,H=null!==(u=null==z?void 0:z.height)&&void 0!==u?u:fj,N=!1,U={width:0,height:0},V={x:0,y:0},W={x:0,y:0},G=1,Y=1,K=GS(t._env);if(K&&!f.confine?(U.width=window.innerWidth,U.height=window.innerHeight):(U.width=j,U.height=H),K&&!D){var X=t._getParentElement(f);W=null!==(c=null===(h=null==X?void 0:X.getBoundingClientRect)||void 0===h?void 0:h.call(X))&&void 0!==c?c:p;var q=null!==(d=t._compiler.getCanvas())&&void 0!==d?d:t._chartContainer;g=null==q?void 0:q.getBoundingClientRect(),V={x:g.x-W.x,y:g.y-W.y},G=j3(q,g),Y=j3(X,W)}var Z=Y/G,J={},Q={x:w,y:w},$={x:["left","right"],y:["top","bottom"]},tt=function(t,e){var n,r,a,o=t.orient,s=t.mode,l=t.offset,u=i.model,h=null==u?void 0:u.getLayoutStartPoint(),c=null!=l?l:"x"===e?x:S;if("mark"===s){N=!0;var d=i.item,f=null==d?void 0:d.AABBBounds;f&&h&&(r=("x"===e?f.x1:f.y1)+h[e],a=("x"===e?f.x2:f.y2)+h[e])}else if(v&&"crosshair"===s&&"cartesian"===(null===(n=null==b?void 0:b.series)||void 0===n?void 0:n.coordinate)&&b.datum&&b.datum.length){N=!0;var p=v(b,h);p&&(r=p.start[e],a=p.end[e])}else Q[e]=o;if(N){var g=$[e][0],y="x"===e?O:R;switch(V3(o,e)){case-2:J[g]=r-y*Z-c;break;case-1.5:J[g]=r+c;break;case 0:J[g]=(r+a)/2-y*Z/2;break;case-1:J[g]=(r+a)/2-y*Z-c;break;case 1:J[g]=(r+a)/2+c;break;case 1.5:J[g]=a-y*Z-c;break;case 2:J[g]=a+c}}},et=["x","y"];if(T(w))if(function(t){return T(t)&&(M(t.left)||M(t.right)||M(t.top)||M(t.bottom))}(w)){var it=w.left,nt=w.right,rt=w.top,at=w.bottom;J.left=N3(it,y),J.top=N3(rt,y),J.right=N3(nt,y),J.bottom=N3(at,y)}else(function(t){return T(t)&&(M(t.x)||M(t.y))})(w)&&et.forEach((function(t){var e=w[t];L(e)||A(e)?J[$[t][0]]=N3(e,y):tt(e,t)}));else M(w)&&(tt({orient:w,mode:E},"x"),tt({orient:w,mode:E},"y"));var ot={x:null,y:null};return et.forEach((function(t){var e,i="x"===t?O:R,n="x"===t?j:H,r="x"===t?x:S,a=V3(Q[t],t);if(F(J[$[t][0]]))ot[t]=J[$[t][0]];else if(F(J[$[t][1]]))ot[t]=n-i*Z-J[$[t][1]];else{var o="x"===t?y.canvasX:y.canvasY;ot[t]=a>0?o+r:0===a?o-i*Z/2:o-i*Z-r}ot[t]*=G,K&&(ot[t]+=V[t]),ot[t]/=Y;var s="x"===t?U.width:U.height,l=f.confine?-(W[t]-(null!==(e=null==g?void 0:g[t])&&void 0!==e?e:0)/G)/Y:-W[t]/Y,u=s/Y+l-i;2!==a&&ot[t]<l?N?ot[t]=l:(ot[t]+=0===a?r+i/2:2*r+i,ot[t]>u&&(ot[t]=u)):-2!==a&&ot[t]>u&&(N?ot[t]=u:(ot[t]-=0===a?r+i/2:2*r+i,ot[t]<l&&(ot[t]=l)))})),ot},t}return h(e,t),a(e,[{key:"env",get:function(){return this._env}},{key:"onAdd",value:function(t){_(e,"onAdd",this,3)([t]);var i=t.component;this._component=i,this._chartOption=i.getOption(),this._env=this._chartOption.mode,this._chartContainer=this._chartOption.globalInstance.getContainer(),this._compiler=i.getCompiler(),this._initFromSpec()}},{key:"hideTooltip",value:function(t){return this.changeTooltip(!1,t)}},{key:"release",value:function(){var t,e,i,n,r=null!==(e=null===(t=this._component)||void 0===t?void 0:t.getSpec())&&void 0!==e?e:{};r.handler?null===(n=(i=r.handler).release)||void 0===n||n.call(i):(this._removeTooltip(),this._isReleased=!0,this._chartOption=null,this._component=null)}},{key:"_getDefaultOption",value:function(){var t,e,i=this._component.getSpec().offset;return i?{offsetX:null!==(t=i.x)&&void 0!==t?t:D3.offsetX,offsetY:null!==(e=i.y)&&void 0!==e?e:D3.offsetY}:D3}},{key:"_getParentElement",value:function(t){return t.parentElement}},{key:"getTooltipContainer",value:function(){return this._container}},{key:"_initFromSpec",value:function(){this._option=this._getDefaultOption()}},{key:"reInit",value:function(){this._initFromSpec()}}])}(lW);W3.specKey="tooltip";var G3=function(t,e){return M(t)?O(t)?t.map((function(t){return"".concat(t,"px")})).join(" "):"".concat(t,"px"):null!=e?e:"initial"},Y3=function(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};M(i.fontFamily)&&(n.fontFamily=i.fontFamily);var r=null!==(t=i.fill)&&void 0!==t?t:i.fontColor;return M(r)&&(n.color=r),M(i.fontWeight)&&(n.fontWeight=i.fontWeight),M(i.textAlign)&&(n.textAlign=i.textAlign),M(i.fontSize)&&(n.fontSize=G3(i.fontSize)),M(i.maxWidth)&&(n.maxWidth=G3(i.maxWidth)),i.multiLine||M(i.maxWidth)&&!1!==i.multiLine?(n.whiteSpace="initial",n.wordBreak=null!==(e=i.wordBreak)&&void 0!==e?e:"break-word"):(n.wordBreak="normal",n.whiteSpace="nowrap"),n},K3=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.lineHeight;return t.fontSize?wz(e,t.fontSize):0},X3=function(t){var e,i=t.backgroundColor,n=t.border,r=t.shadow,a=t.padding,o={borderWidth:"".concat(null!==(e=null==n?void 0:n.width)&&void 0!==e?e:0,"px")},s=null;(null==n?void 0:n.color)&&(o.borderColor=n.color),i&&(o.backgroundColor=i),o.boxShadow=r?"".concat(r.x,"px ").concat(r.y,"px ").concat(r.blur,"px ").concat(r.spread,"px ").concat(r.color):"initial";var l=(null!=n?n:{}).radius;return M(l)&&(o.borderRadius=F(l)?"".concat(l,"px"):"".concat(l)),M(a)&&(s=bi(a),o.padding=G3(s)),{panelStyle:o,panelPadding:s}};function q3(t,e){t&&t.style&&e&&Object.keys(e).forEach((function(i){t.style[i]=e[i]}))}var Z3=function(t){function e(){var t;return n(this,e),(t=i(this,e,[e.type])).type=uY.dom,t._tooltipContainer=null==WS?void 0:WS.body,t}return h(e,t),a(e,[{key:"getVisibility",value:function(){return!!this._rootDom&&"visible"===this._rootDom.style.visibility}},{key:"setVisibility",value:function(t){t!==this.getVisibility()&&this._rootDom&&(this._rootDom.style.visibility=t?"visible":"hidden")}},{key:"getRootDom",value:function(){return this._rootDom}},{key:"onAdd",value:function(t){_(e,"onAdd",this,3)([t]),this._initStyle(),this.initEl()}},{key:"initEl",value:function(){var t=this._component.getSpec().parentElement;if(WS&&t&&t.children&&t.children.length){for(var e=0;e<t.children.length;e++)if(t.children[e].classList.contains(I3)){this._container=t.children[e];break}this._container||(this._container=WS.createElement("div"),this._container.style.position="relative",this._container.style.zIndex=F3,this._container.classList.add(I3),t.appendChild(this._container))}}},{key:"initRootDom",value:function(){var t,e=this._component.getSpec(),i=document.createElement("div"),n=null===(t=this._chartOption)||void 0===t?void 0:t.getTheme("fontFamily");q3(i,Object.assign({left:"0",top:"0",pointerEvents:"none",padding:"12px",position:"absolute",zIndex:F3,fontFamily:null!=n?n:Fz.fontFamily,fontSize:"11px",borderRadius:"3px",borderStyle:"solid",lineHeight:"initial",background:"#fff",boxShadow:"2px 2px 4px rgba(0, 0, 0, 0.1)",maxWidth:"100wh",maxHeight:"100vh",visibility:"hidden"},this._domStyle.panel)),i.classList.add(e.className),i.setAttribute("vchart-tooltip-id","".concat(this.id)),this._container.appendChild(i),this._rootDom=i}},{key:"_getTooltipBoxSize",value:function(t,e){var i;this._rootDom||this.initRootDom(),e||this._updateDomStringByCol(t),this._updateDomStyle("height",e);var n=null===(i=this._rootDom)||void 0===i?void 0:i.getBoundingClientRect();return{width:null==n?void 0:n.width,height:null==n?void 0:n.height}}},{key:"_removeTooltip",value:function(){this._rootDom&&this._rootDom.parentNode&&(this._rootDom.parentNode.removeChild(this._rootDom),this._rootDom=null),this._container=null}},{key:"_updateTooltip",value:function(t,e){var i,n;if(t&&this._rootDom){var r=e.tooltipSpec,a=e.activeTooltipSpec;e.changePositionOnly||(this._tooltipActual=a);var o=this._rootDom;if(o){var s=null!==(i=a.position)&&void 0!==i?i:{},l=s.x,u=void 0===l?0:l,h=s.y,c=void 0===h?0:h,d={x:u,y:c},v=this.getVisibility();r.updateElement&&(this._updatePosition(null!==(n=this._cacheCustomTooltipPosition)&&void 0!==n?n:{x:u,y:c}),r.updateElement(o,a,e),d=this._getActualTooltipPosition(a,e,{width:o.offsetWidth,height:o.offsetHeight}),this._cacheCustomTooltipPosition=d),!v&&t&&(this._rootDom.style.transition="none",this._updatePosition(d,!1),this._rootDom.getBoundingClientRect()),this._updatePosition(d)}this.setVisibility(t)}else this.setVisibility(t),this._cacheCustomTooltipPosition=void 0}},{key:"_initStyle",value:function(){var t=this._component.getSpec();this._domStyle=function(){var t,e,i,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=r.style,o=void 0===a?{}:a,s=r.enterable,l=r.transitionDuration,u=o.panel,h=void 0===u?{}:u,c=o.titleLabel,d=o.shape,v=o.keyLabel,f=o.valueLabel,p=o.spaceRow,g=o.align,y=X3(h),m=y.panelStyle,_=y.panelPadding,b={marginTop:"0px",marginBottom:"0px"};m.pointerEvents=s?"auto":"none",l&&(m.transitionDuration=l?"".concat(l,"ms"):"initial",m.transitionProperty=l?"transform":"initial",m.transitionTimingFunction=l?"ease-out":"initial"),F(p)&&(b.marginBottom="".concat(p,"px"));var k={width:G3(null!==(t=null==d?void 0:d.size)&&void 0!==t?t:8)},x=Y3(c),S=Y3(v),A=Y3(f),M="right"===g?"marginLeft":"marginRight";"right"===g&&(m.direction="rtl"),C(x.textAlign)&&(x.textAlign="right"===g?"right":"left"),C(S.textAlign)&&(S.textAlign="right"===g?"right":"left"),C(A.textAlign)&&(A.textAlign="right"===g?"left":"right"),k[M]=G3(null!==(e=d.spacing)&&void 0!==e?e:8),S[M]=G3(null!==(i=v.spacing)&&void 0!==i?i:26),A[M]=G3(null!==(n=f.spacing)&&void 0!==n?n:0);var T=Math.max(K3(f),K3(v));return b.lineHeight=T>0?"".concat(T,"px"):"20px",{panelPadding:_,row:b,panel:m,title:x,shape:k,key:S,value:A}}(t)}},{key:"_updateDomStringByCol",value:function(t){var e,i=this,n=t.title,r=void 0===n?{}:n,a=t.content,o=a&&a.length,s=this._domStyle.row,l=b(this._rootDom.children),u=l.find((function(t){return t.className.includes(R3)})),h=l.find((function(t){return t.className.includes(L3)}));if(!u&&!1!==r.visible){u=document.createElement("h2");var c=document.createElement("span");u.appendChild(c),u.classList.add(R3),this._rootDom.firstChild?this._rootDom.insertBefore(u,this._rootDom.firstChild):this._rootDom.appendChild(u)}u&&!1!==r.visible?(q3(u,Object.assign(Object.assign(Object.assign({},this._domStyle.title),o?s:{marginBottom:"0px"}),{marginTop:"0px"})),u.firstChild.innerHTML="".concat(null!==(e=r.value)&&void 0!==e?e:"")):u&&!1===r.visible&&u.parentNode.removeChild(u);var d=["shape","key","value"];if(!h&&o&&(h=document.createElement("div"),d.forEach((function(t){var e=document.createElement("div");e.classList.add("".concat(O3,"-column")),e.classList.add("".concat(O3,"-").concat(t,"-column")),e.setAttribute("data-col",t),h.appendChild(e)})),h.classList.add(L3),this._rootDom.appendChild(h)),h&&o){var v=b(h.children);q3(h,{whiteSpace:"nowrap"}),v.forEach((function(t,e){var n=t.getAttribute("data-col");if(n&&d.includes(n)){var r="shape"===n&&a.every((function(t){return!t.hasShape||!t.shapeType}));q3(t,Object.assign(Object.assign({},i._domStyle[n]),{display:r?"none":"inline-block",verticalAlign:"top"}));var o=b(t.children);o.slice(a.length).forEach((function(t){t.parentNode.removeChild(t)})),a.forEach((function(e,r){var l=o[r];l||((l=document.createElement("div")).classList.add("".concat(O3,"-").concat(n)),t.appendChild(l));var u=Object.assign({},s);r===a.length-1&&(u.marginBottom="0px"),u.display=!1===e.visible?"none":"block",u.height="initial","key"===n?(l.innerHTML=H3(e.key),e.keyStyle&&Y3(e.keyStyle,u)):"value"===n?(l.innerHTML=H3(e.value),e.valueStyle&&Y3(e.valueStyle,u)):"shape"===n&&(l.innerHTML=function(t,e){var i,n,r,a,o,s;if(!t||!t.hasShape||!t.shapeType)return"";var l,u,h='style="display:inline-block;vertical-align:middle;"',c=t.shapeType,d=t.shapeStroke,v=t.shapeHollow,f=void 0!==v&&v,p=t.shapeFill,g=null!==(i=t.shapeSize)&&void 0!==i?i:8,y=t.shapeLineWidth?z3(t.shapeLineWidth)+"px":"0px",_="currentColor",b=function(){return d?z3(d):_},k=g,x=function(t){return new Pf({symbolType:t,size:k,fill:!0})},S=x(c),A=S.getParsedPath();if(!A.path&&A.pathStr&&(S=x(A.pathStr)),S.getParsedPath().path){var C=S.getParsedPath().path;u=C.toString(),l=C.bounds}else A.isSvg&&A.svgCache&&(u=A.svgCache.map((function(t){return t.path.toString()})).join(),l=A.svgCache.reduce((function(t,e){return t.union(e.path.bounds)}),new ei));var M="".concat(l.x1," ").concat(l.y1," ").concat(l.width()," ").concat(l.height());if("0px"!==y){var w=M.split(" ").map((function(t){return Number(t)})),E=m(w,4),B=E[0],O=E[1],I=E[2],R=E[3],L=Number(y.slice(0,-2));M="".concat(B-L/2," ").concat(O-L/2," ").concat(I+L," ").concat(R+L)}var D=yd.IsGradientStr(p);if(!p||P(p)&&!D||f)return _=f?"none":p?z3(p):"currentColor","\n <svg ".concat(h,' width="').concat(g,'" height="').concat(g,'" viewBox="').concat(M,'">\n <path\n d="').concat(u,'"\n style="fill: ').concat(_,"; stroke: ").concat(b(),"; stroke-width: ").concat(y,'"\n >\n </path>\n </svg>');var F=D?yd.Parse(p):T(p)?p:null;if(F){_="gradientColor"+(null!=e?e:"");var z="",j=(null!==(n=F.stops)&&void 0!==n?n:[]).map((function(t){return'<stop offset="'.concat(z3(t.offset.toString()),'" stop-color="').concat(z3(t.color),'"/>')})).join("");return"radial"===F.gradient?z='<radialGradient id="'.concat(_,'" cx="50%" cy="50%" r="50%" fx="0%" fy="0%">\n ').concat(j,"\n </radialGradient>"):"linear"===F.gradient&&(z='<linearGradient id="'.concat(_,'" x1="').concat(100*(null!==(r=F.x0)&&void 0!==r?r:0),'%" y1="').concat(100*(null!==(a=F.y0)&&void 0!==a?a:0),'%" x2="').concat(100*(null!==(o=F.x1)&&void 0!==o?o:0),'%" y2="').concat(100*(null!==(s=F.y1)&&void 0!==s?s:0),'%">\n ').concat(j,"\n </linearGradient>")),"\n <svg ".concat(h,' width="').concat(g,'" height="').concat(g,'" viewBox="-0.5 -0.5 1 1">\n ').concat(z,'\n <path\n d="').concat(u,'"\n style="fill: url(#').concat(_,"); stroke: ").concat(b(),"; stroke-width: ").concat(y,'"\n >\n </path>\n </svg>')}return""}(e,"".concat(i.id,"_").concat(r))),q3(l,u)}))}}))}else h&&!o&&h.parentNode.removeChild(h)}},{key:"_updateDomStyle",value:function(){var t,e,i,n,r,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"width",o=arguments.length>1?arguments[1]:void 0,s=this._rootDom,l=b(s.children).find((function(t){return t.className.includes(L3)})),u=b(s.children).find((function(t){return t.className.includes(R3)}));if(l){var h=this._component.getSpec(),c={},d=null===(t=h.style)||void 0===t?void 0:t.titleLabel;if(d&&d.autoWidth&&!1!==d.multiLine&&u){var v=b(l.children).reduce((function(t,e){return"height"===a?t+e.getBoundingClientRect().width:Math.max(t,e.getBoundingClientRect().width)}),0);v>0&&(u.style.maxWidth="".concat(v,"px"),u.style.maxWidth="".concat(Math.ceil(l.getBoundingClientRect().width),"px"))}if(M(null===(e=null==h?void 0:h.style)||void 0===e?void 0:e.maxContentHeight)){var f=u&&u.className.includes(R3)?u.getBoundingClientRect().height+(null!==(i=h.style.spaceRow)&&void 0!==i?i:0):0,p=this._chartOption.getChartViewRect(),g=wz(h.style.maxContentHeight,Math.min(p.height,document.body.clientHeight)-f-(this._domStyle.panelPadding?this._domStyle.panelPadding[0]+this._domStyle.panelPadding[1]:0));g>0&&(c.maxHeight="".concat(g,"px"),c.overflowY="auto",c.width="calc(100% + ".concat(this._domStyle.panelPadding?this._domStyle.panelPadding[1]+"px":"10px",")"),q3(l,c))}var y=l.children,m=[];if(y){for(var _=0;_<y.length;_++)for(var k=null!==(n=y[_].children)&&void 0!==n?n:[],x=0;x<k.length;x++){o&&(k[x].style[a]="initial");var S=k[x].getBoundingClientRect()[a];(void 0===m[x]||m[x]<S)&&(m[x]=S)}for(var A=0;A<y.length;A++)for(var C=null!==(r=y[A].children)&&void 0!==r?r:[],T=0;T<C.length;T++)C[T].style[a]="".concat(m[T],"px")}}}},{key:"_getParentElement",value:function(t){var i;return null!==(i=this._container)&&void 0!==i?i:_(e,"_getParentElement",this,3)([t])}},{key:"isTooltipShown",value:function(){return this.getVisibility()}},{key:"reInit",value:function(){_(e,"reInit",this,3)([]),this._initStyle(),this._rootDom&&q3(this._rootDom,this._domStyle.panel),this.getVisibility()&&(this._updateDomStringByCol(this._tooltipActual),this._updateDomStyle("height",!1))}},{key:"_updatePosition",value:function(t){var e=t.x,i=t.y,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._rootDom&&(this._rootDom.style.transform="translate3d(".concat(e,"px, ").concat(i,"px, 0)"),n&&""!==this._rootDom.style.transition&&(this._rootDom.style.transition="",Object.assign(this._rootDom.style,this._domStyle.panel)))}}])}(W3);Z3.type=uY.dom;var J3={fontFamily:Fz.fontFamily,spacing:10,wordBreak:"break-word"},Q3=function(t,e){var i,n,r;"rich"!==(null==t?void 0:t.type)&&"html"!==(null==t?void 0:t.type)?(t=(null!=t?t:"").toString(),n=e.multiLine?(n=t.split("\n")).map((function(t,e){return e<n.length-1?t+"\n":t})):[t],r=n.map((function(t){return Object.assign(Object.assign({},e),{text:t})}))):(r=t.text,n=t);var a=$p({wordBreak:null!==(i=e.wordBreak)&&void 0!==i?i:"break-word",maxWidth:e.maxWidth?e.maxWidth:void 0,width:0,height:0,textConfig:r});return{width:a.width(),height:a.height(),text:n}};function $3(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;return Object.assign(Object.assign({},null!=r?r:J3),{fill:null!==(t=i.fill)&&void 0!==t?t:i.fontColor,textAlign:i.textAlign,textBaseline:i.textBaseline,fontFamily:null!==(e=i.fontFamily)&&void 0!==e?e:n,fontSize:i.fontSize,fontWeight:i.fontWeight,lineHeight:i.lineHeight,spacing:i.spacing,multiLine:M(i.maxWidth)?!1!==i.multiLine:i.multiLine,maxWidth:i.maxWidth,wordBreak:i.wordBreak,autoWidth:i.autoWidth})}var t5=function(t){var e,i=t.backgroundColor,n=t.border,r=t.shadow,a={lineWidth:null!==(e=null==n?void 0:n.width)&&void 0!==e?e:0,shadow:!!r};(null==n?void 0:n.color)&&(a.stroke=n.color),i&&(a.fill=i),r&&(a.shadowColor=r.color,a.shadowBlur=r.blur,a.shadowOffsetX=r.x,a.shadowOffsetY=r.y,a.shadowSpread=r.spread);var o=(null!=n?n:{}).radius;return M(o)&&(a.cornerRadius=[o,o,o,o]),a},e5=function(t){function e(){var t;return n(this,e),(t=i(this,e,[e.type])).type=uY.canvas,t._attributes=null,t}return h(e,t),a(e,[{key:"onAdd",value:function(t){var i;_(e,"onAdd",this,3)([t]),this._tooltipCanvasId=null===(i=this._chartOption.modeParams)||void 0===i?void 0:i.tooltipCanvasId}},{key:"_initTooltipComponent",value:function(t){var e=this._getLayer(t);this._tooltipComponent=new WF({autoCalculatePosition:!1,autoMeasure:!1}),e.add(this._tooltipComponent)}},{key:"_getLayer",value:function(t){if(this._layer)return this._layer;this._layer=t.createLayer(this._tooltipCanvasId);var e=this._layer.layerHandler.canvas.nativeCanvas;return e&&e.style&&(e.style.touchAction="none",e.style.pointerEvents="none"),this._layer}},{key:"_getTooltipBoxSize",value:function(t,e){var i,n;if(!e||C(this._attributes)){var r=null===(i=this._chartOption)||void 0===i?void 0:i.getTheme("fontFamily");this._attributes=function(t,e,i){var n,r,a,o,s,l=e.style,u=void 0===l?{}:l,h=e.enterable,c=e.transitionDuration,d=u.panel,v=void 0===d?{}:d,f=u.titleLabel,p=u.shape,g=u.keyLabel,y=u.valueLabel,m=u.spaceRow,_=u.align,b=bi(v.padding),k=Pz(v.padding),x=$3(Object.assign({textAlign:"right"===_?"right":"left"},f),i),S=$3(Object.assign({textAlign:"right"===_?"right":"left"},g),i),A=$3(y,i),C={fill:!0,size:null!==(n=null==p?void 0:p.size)&&void 0!==n?n:8,spacing:null!==(r=null==p?void 0:p.spacing)&&void 0!==r?r:6},T={panel:t5(v),padding:b,title:{},content:[],titleStyle:{value:x,spaceRow:m},contentStyle:{shape:C,key:S,value:A,spaceRow:m},hasContentShape:!1,keyWidth:0,valueWidth:0,enterable:h,transitionDuration:c,align:_},w=t.title,E=void 0===w?{}:w,B=t.content,P=void 0===B?[]:B,O=k.left+k.right,I=k.top+k.bottom,R=0,L=!!P.length,D=0,F=0,z=0,j=0;if(L){var H=[],N=[],U=[],V=[],W=0;T.content=P.map((function(t,e){var i=0,n=t.hasShape,r=t.key,a=t.shapeType,o=void 0===a?"":a,s=t.shapeFill,l=t.shapeStroke,u=t.shapeLineWidth,h=t.shapeSize,c=t.value,d=t.isKeyAdaptive,v=t.spaceRow,f=t.keyStyle,p=t.valueStyle,g=t.shapeHollow,y={height:0,spaceRow:null!=v?v:m};if(M(r)){var _=Nz({},S,$3(f,void 0,{})),b=Q3(r,_),k=b.width,x=b.height,T=b.text;y.key=Object.assign(Object.assign({width:k,height:x},_),{text:T}),d?N.push(k):H.push(k),i=Math.max(i,x)}if(M(c)){var w=Nz({},A,$3(p,void 0,{})),E=Q3(c,w),B=E.width,O=E.height,I=E.text;y.value=Object.assign(Object.assign({width:B,height:O},w),{text:I}),U.push(B),i=Math.max(i,O)}if(n){var R={visible:!0,symbolType:o};g?R.stroke=s:R.fill=s,R.stroke=null!=l?l:s,R.lineWidth=u,y.shape=R;var L=null!=h?h:C.size;i=Math.max(L,i),V.push(L)}else y.shape={visible:!1};return y.height=i,W+=i,e<P.length-1&&(W+=y.spaceRow),y})),I+=W,D=H.length?lt(H):0,F=N.length?lt(N):0,z=U.length?lt(U):0,j=V.length?lt(V)+C.spacing:0,R=Math.max(j+D+S.spacing+z+A.spacing,j+F,R),T.hasContentShape=!!V.length,T.keyWidth=D,T.valueWidth=z}var G=0,Y=0,K=0,X=E.visible,q=void 0===X||X,Z=E.value,J=void 0===Z?"":Z,Q=E.valueStyle,$=E.spaceRow;T.title.visible=q,T.title.spaceRow=null!=$?$:m;var tt={},et=function(){return tt.autoWidth&&!1!==tt.multiLine};if(q){tt=Nz({},x,$3(Q,void 0,{})),et()&&(tt.multiLine=null===(a=tt.multiLine)||void 0===a||a,tt.maxWidth=null!==(o=tt.maxWidth)&&void 0!==o?o:L?Math.ceil(R):void 0);var it=Q3(J,tt),nt=it.text,rt=it.width,at=it.height;T.title.value=Object.assign(Object.assign({width:et()?Math.min(rt,null!==(s=tt.maxWidth)&&void 0!==s?s:Number.MAX_VALUE):rt,height:at},tt),{text:nt}),G=T.title.value.width,K=(Y=T.title.value.height)+(L?T.title.spaceRow:0)}return I+=K,T.title.width=G,T.title.height=Y,et()?O+=R||G:O+=Math.max(G,R),L&&T.content.forEach((function(t){var e,i=t.value;i&&(null===(e=i.autoWidth)||void 0===e||e)&&(i.width=O-k.left-k.right-j-D-S.spacing-A.spacing,i.maxWidth||(i.maxWidth=Math.ceil(i.width)),T.valueWidth=Math.max(T.valueWidth,i.width))})),T.panel.width=O,T.panel.height=I,T}(t,this._component.getSpec(),r)}var a=(null!==(n=this._attributes)&&void 0!==n?n:{}).panel;return{width:a.width+a.lineWidth,height:a.height+a.lineWidth}}},{key:"_removeTooltip",value:function(){this._layer&&this._layer.removeAllChild(),this._attributes=null}},{key:"_updateTooltip",value:function(t,e){this._visible=t;var i=this._compiler.getStage();if(i)if(t){this._tooltipComponent||this._initTooltipComponent(i);var n=e.activeTooltipSpec.position;e.changePositionOnly?M(n)&&this._tooltipComponent.setAttributes(n):this._tooltipComponent.setAttributes(Object.assign(Object.assign({},this._attributes),n)),this._tooltipComponent.attribute.visible||(this._tooltipComponent.showAll(),this._tooltipComponent.setAttributes({visibleAll:!0}))}else this._tooltipComponent&&this._tooltipComponent.attribute.visible&&(this._tooltipComponent.hideAll(),this._tooltipComponent.setAttributes({visibleAll:!1}))}},{key:"isTooltipShown",value:function(){var t;return null===(t=this._tooltipComponent)||void 0===t?void 0:t.attribute.visibleAll}},{key:"release",value:function(){var t;_(e,"release",this,3)([]),null===(t=this._layer)||void 0===t||t.release()}}])}(W3);e5.type=uY.canvas;var i5=/\{([^}]+)\}/,n5=/\{([^}]+)\}/g,r5=/:/,a5=function(t){function e(){var t;return n(this,e),(t=i(this,e,[e.type])).type="formatterPlugin",t._timeModeFormat={utc:Oi.getInstance().timeUTCFormat,local:Oi.getInstance().timeFormat},t._formatter=t._format,t._timeFormatter=t._timeModeFormat.local,t._numericFormatter=ji.getInstance().format,t._numericSpecifier=ji.getInstance().formatter,t._numericFormatterCache=new Map,t._isNumericFormatterCache=new Map,t}return h(e,t),a(e,[{key:"onInit",value:function(t,i){var n;if(t.globalInstance){this._spec=null!==(n=null==i?void 0:i[e.specKey])&&void 0!==n?n:{};var r=this._spec,a=r.timeMode,o=r.customFormatter,s=r.numericFormatter,l=r.timeFormatter;A(o)?this._formatter=o:(this._formatter=this._format.bind(this),A(l)?this._timeFormatter=l:a&&this._timeModeFormat[a]&&(this._timeFormatter=this._timeModeFormat[a]),s&&(this._numericFormatter=s,this._numericSpecifier=null,this._numericFormatterCache=null)),Uz.registerFormatter(this._formatter)}}},{key:"_format",value:function(t,e,i){var n=this;return O(t)?t.map((function(t,r){var a=O(i)?i[r]:i;return a?n._formatSingleLine(t,e,a):t})):O(i)?i.map((function(i){return n._formatSingleLine(t,e,i)})):this._formatSingleLine(t,e,i)}},{key:"_formatSingleLine",value:function(t,e,i){var n,r=this;return this._isNumericFormatterCache&&(this._isNumericFormatterCache.get(i)?n=this._isNumericFormatterCache.get(i):(n=i5.test(i),this._isNumericFormatterCache.set(i,n))),n?i.replace(n5,(function(t,i){if(!r5.test(i)){var n=e[i.trim()];return void 0!==n?n:t}var a=i.split(":"),o=e[a.shift()],s=a.join(":");return r._formatSingleText(o,s)})):this._formatSingleText(t,i)}},{key:"_formatSingleText",value:function(t,e){var i;return Di.test(e)&&this._numericFormatter?this._numericFormatterCache&&this._numericSpecifier?(this._numericFormatterCache.get(e)?i=this._numericFormatterCache.get(e):(i=this._numericSpecifier(e),this._numericFormatterCache.set(e,i)),i(Number(t))):this._numericFormatter(e,Number(t)):e.includes("%")&&this._timeFormatter?this._timeFormatter(e,t):e.startsWith("calc(")?this._calcFormatter(e,t):t}},{key:"_calcFormatter",value:function(t,e){try{var i=t.slice(5,-1).replace(/v/g,String(e));return this._calculateMathExpression(i,e)}catch(t){return e}}},{key:"_calculateMathExpression",value:function(t,e){var i=t.replace(/\s+/g,"");if(!this._isValidMathExpression(i))return e;try{var n=new Function("return ("+i+")")();if("number"!=typeof n||isNaN(n)||!isFinite(n))throw new Error("Invalid calculation result");return n}catch(t){return e}}},{key:"_isValidMathExpression",value:function(t){return/^[0-9+\-*/().]+$/.test(t)}},{key:"release",value:function(){_(e,"release",this,3)([]),this._format=null,this._timeFormatter=null,this._numericFormatter=null,this._numericSpecifier=null,this._numericFormatterCache=null,this._isNumericFormatterCache=null}}])}(lW);a5.pluginType="chart",a5.specKey="formatter",a5.type="formatterPlugin",TU.useRegisters([function(){vY(),pY(),yY(),GG(),WG(),CG(),gG(),JV(),$V(),vU(),hU(),uG(),aG(),Uz.registerSeries(MG.type,MG),Uz.registerChart(mY.type,mY)},function(){vY(),pY(),yY(),WG(),CG(),gG(),JV(),kY(),$V(),AY(),uG(),aG(),Uz.registerSeries(MY.type,MY),GG(),Uz.registerChart(wY.type,wY)},function(){vY(),pY(),yY(),WG(),VY(),GG(),Uz.registerChart(GY.type,GY)},function(){vY(),pY(),GG(),WG(),iK(),Uz.registerChart(rK.type,rK)},function(){pY(),iq(),Uz.registerChart(l0.type,l0)},function(){vY(),pY(),GG(),WG(),kq(),Uz.registerChart(c0.type,c0)},function(){vY(),pY(),yY(),GG(),WG(),Bq(),Uz.registerChart(v0.type,v0)},function(){vY(),pY(),yY(),GG(),WG(),VY(),Uz.registerTransform("bin",ho),Uz.registerChart(_0.type,_0)},function(){pY(),mK(),uK(),Uz.registerSeries(bK.type,bK),Uz.registerImplement("registerMap",_H),Uz.registerImplement("unregisterMap",bH),cU(),Uz.registerChart(i0.type,i0)},function(){pY(),y$(),Uz.registerSeries(_$.type,_$),XX(),Xq(),yq(),Qq(),Uz.registerChart(S0.type,S0)},function(){pY(),UJ(),Uz.registerChart(M0.type,M0)},function(){pY(),hQ(),Uz.registerChart(w0.type,w0)},function(){vY(),pY(),yY(),GG(),WG(),JK(),Uz.registerChart(H0.type,H0)},function(){vY(),pY(),GG(),WG(),_X(),Uz.registerTransform("boxplot",co),Uz.registerChart(U0.type,U0)},function(){vY(),pY(),GG(),WG(),Qq(),Uz.registerChart(k0.type,k0)},function(){vY(),pY(),GG(),WG(),sZ(),Uz.registerChart(B0.type,B0)},function(){vY(),pY(),GG(),WG(),OX(),Uz.registerChart(O0.type,O0)},function(){vY(),pY(),yY(),GG(),WG(),kY(),uG(),aG(),Uz.registerSeries(LX.type,LX),Uz.registerChart(Y0.type,Y0)},function(){pY(),TQ(),Uz.registerChart(R0.type,R0)},function(){pY(),IQ(),Uz.registerChart(D0.type,D0)},function(){pY(),s$(),Uz.registerChart(z0.type,z0)},function(){pY(),Vw(),$Q(),Uz.registerChart(W0.type,W0)},function(){pY(),T$(),Uz.registerChart(X0.type,X0)},function(){pY(),U$(),Uz.registerChart(Z0.type,Z0)},function(){vY(),pY(),yY(),GG(),Uz.registerChart(p0.type,p0),WG()},aG,uG,function(){Uz.registerGraphicComponent(OW.lineAxis,(function(t,e){return new xI(t,e)})),Uz.registerGraphicComponent(IW.lineAxisGrid,(function(t,e){return new RL(t,e)})),UW(),Uz.registerComponent(hG.type,hG)},function(){Uz.registerGraphicComponent(OW.lineAxis,(function(t,e){return new xI(t,e)})),Uz.registerGraphicComponent(IW.lineAxisGrid,(function(t,e){return new RL(t,e)})),UW(),Uz.registerComponent(cG.type,cG)},function(){Uz.registerGraphicComponent(OW.lineAxis,(function(t,e){return new xI(t,e)})),Uz.registerGraphicComponent(IW.lineAxisGrid,(function(t,e){return new RL(t,e)})),UW(),Uz.registerComponent(dG.type,dG)},_q,yq,function(){Uz.registerComponent(i1.type,i1)},function(){Uz.registerComponent(f1.type,f1)},function(){Uz.registerComponent(T1.type,T1)},function(){Uz.registerComponent(R1.type,R1)},function(){Uz.registerComponent(L1.type,L1)},function(){Uz.registerComponent(J1.type,J1)},function(){Uz.registerComponent(t2.type,t2)},function(){Uz.registerComponent(r2.type,r2)},mK,function(){Uz.registerComponent(Q2.type,Q2),HD()},function(){Uz.registerComponent(n3.type,n3),UD()},function(){Uz.registerComponent(k3.type,k3),YD()},function(){Uz.registerComponent($2.type,$2),WD._animate=kD,HD()},function(){Uz.registerComponent(r3.type,r3),GD._animate=SD,UD()},function(){Uz.registerComponent(x3.type,x3),YD()},function(){Uz.registerComponent(S3.type,S3),YD()},function(){Uz.registerComponent(t3.type,t3)},function(){Uz.registerComponent(c3.type,c3)},function(){Uz.registerGraphicComponent(g3.type,(function(t){return new BL(t)})),f3(),zW(),Uz.registerComponent(g3.type,g3,!0,1/0)},function(){Uz.registerGraphicComponent(y3.type,(function(t){return new BL(t)})),f3(),zW(),Uz.registerComponent(y3.type,y3,!0)},function(){Uz.registerComponent(T3.type,T3)},function(){Uz.registerComponent(E3.type,E3)},function(){OE()},function(){Uz.registerLayout(B3.type,B3)},function(){var t;t=e5,Uz.registerComponentPlugin(t.type,t)},function(){var t;t=a5,Uz.registerChartPlugin(t.type,t)},_U,xU]),TU.useRegisters([function(){tT(j_)}]),t.DEFAULT_CHART_HEIGHT=fj,t.DEFAULT_CHART_WIDTH=vj,t.DEFAULT_CLOSE_STROKE_JOIN=BU,t.DEFAULT_DATA_INDEX=gj,t.DEFAULT_DATA_KEY=yj,t.DEFAULT_DATA_SERIES_FIELD=mj,t.DEFAULT_KEY=Fj,t.DEFAULT_LAYOUT_RECT_LEVEL=0,t.DEFAULT_LAYOUT_RECT_LEVEL_MIN=-1,t.DEFAULT_LINEAR_INTERPOLATE=EU,t.DEFAULT_MAP_LOOK_UP_KEY=zj,t.DEFAULT_MEASURE_CANVAS_ID=pj,t.DEFAULT_SERIES_STYLE_NAME=_j,t.DEFAULT_SMOOTH_INTERPOLATE=wU,t.Factory=Uz,t.MOSAIC_CAT_END_PERCENT=Rj,t.MOSAIC_CAT_START_PERCENT=Ij,t.MOSAIC_VALUE_END_PERCENT=Oj,t.MOSAIC_VALUE_START_PERCENT=Pj,t.ManualTicker=function(t){function e(t){var r;return n(this,e),(r=i(this,e,[t])).lastFrameTime=0,r.status=Ul.RUNNING,r}return h(e,t),a(e,[{key:"setupTickHandler",value:function(){var t=new sP;return this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0}},{key:"checkSkip",value:function(t){return!1}},{key:"getTime",value:function(){return this.tickerHandler.getTime()}},{key:"tickAt",value:function(t){this.tickTo(t)}},{key:"start",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.status===Ul.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===Ul.PAUSE)return!1;if(this.ifCanStop())return!1}return this.status=Ul.RUNNING,!0}}])}(oP),t.PREFIX=dj,t.SEGMENT_FIELD_END=Dj,t.SEGMENT_FIELD_START=Lj,t.STACK_FIELD_END=xj,t.STACK_FIELD_END_OffsetSilhouette=Mj,t.STACK_FIELD_END_PERCENT=Aj,t.STACK_FIELD_KEY=bj,t.STACK_FIELD_START=kj,t.STACK_FIELD_START_OffsetSilhouette=Cj,t.STACK_FIELD_START_PERCENT=Sj,t.STACK_FIELD_TOTAL=Tj,t.STACK_FIELD_TOTAL_BOTTOM=Bj,t.STACK_FIELD_TOTAL_PERCENT=wj,t.STACK_FIELD_TOTAL_TOP=Ej,t.StreamLight=aI,t.ThemeManager=rj,t.USER_LAYOUT_RECT_LEVEL=9,t.VChart=TU,t.boundsInRect=Bz,t.builtinThemes=Kz,t.calcLayoutNumber=wz,t.calcPadding=Ez,t.computeActualDataScheme=dz,t.convertPoint=Oz,t.createArc=Mp,t.createArea=Sp,t.createGroup=Rp,t.createLine=Lf,t.createRect=jf,t.createRichText=yp,t.createSymbol=Of,t.createText=Mf,t.darkTheme=jz,t.dataScheme=Rz,t.default=TU,t.defaultThemeName=Xz,t.getActualColor=fz,t.getActualNumValue=Iz,t.getColorSchemeBySeries=mz,t.getDataScheme=cz,t.getFunnelTheme=Gz,t.getMergedTheme=ij,t.getSpecInfo=IU,t.getTheme=$z,t.hasThemeMerged=Jz,t.isColorKey=pz,t.isPercent=Mz,t.isPercentOffset=Tz,t.isProgressiveDataColorScheme=gz,t.isTokenKey=Dz,t.isValidOrient=Cz,t.lightTheme=zz,t.lookup=RU,t.measureText=cj,t.normalizeLayoutPaddingSpec=Pz,t.queryColorFromColorScheme=vz,t.queryToken=Lz,t.registerDataSetInstanceParser=pH,t.registerDataSetInstanceTransform=fH,t.registerTheme=Qz,t.removeTheme=tj,t.themeExist=ej,t.themes=qz,t.token=Fz,t.transformColorSchemeToStandardStruct=yz,t.transformToGraphic=tH,t.version="2.0.22",t.vglobal=z_,t.warn=HS,Object.defineProperty(t,"__esModule",{value:!0})})(C.exports);var M=A(C.exports);Component({properties:{styles:{type:String},canvasId:{type:String},spec:{type:Object,observer:function(t,e){this.chart&&JSON.stringify(t)!==JSON.stringify(e)&&this.chart.updateSpec(t)}},options:{type:Object,value:{}},events:{type:Object,value:[]}},data:{offscreenCanvasWidth:0,offscreenCanvasHeight:0,chart:void 0},detached:function(){this.chart&&this.chart.release()},ready:function(){var t=this;this.data.spec&&this.data.canvasId?(tt.onWindowResize((function(e){t.init()})),this.init()):console.warn("组件需绑定 spec 变量并且设置唯一 canvas-id")},methods:{init:function(){var t=this;tt.createSelectorQuery().in(this).select("#".concat(this.data.canvasId,"_draw_canvas")).boundingClientRect((function(e){if(e){t.setData({offscreenCanvasWidth:e.width,offscreenCanvasHeight:e.height}),t.chart&&t.chart.release();var i=new M(v(v({},t.data.spec),{},{width:e.width,height:e.height}),v({mode:"miniApp",modeParams:{domref:e,force:!0,canvasIdLists:["".concat(t.data.canvasId,"_draw_canvas"),"".concat(t.data.canvasId,"_tooltip_canvas"),"".concat(t.data.canvasId,"_hit_canvas")],tooltipCanvasId:"".concat(t.data.canvasId,"_tooltip_canvas"),freeCanvasIdx:2},dpr:tt.getSystemInfoSync().pixelRatio,renderCanvas:"".concat(t.data.canvasId,"_draw_canvas")},t.data.options));t.chart=i,t.triggerEvent("chartinit"),t.data.events&&t.data.events.forEach((function(t){t&&i.on(t.type,v(v({},t.query),{},{source:"chart"}),t.handler)})),i.renderAsync().then((function(e){t.triggerEvent("chartready")}))}else console.error("未找到 #".concat(t.data.canvasId," 组件"))})).exec()},bindEvent:function(t){var e=tt.getSystemInfoSync().brand;if(!("PC"===e&&t.type.startsWith("touch")||"PC"!==e&&t.type.startsWith("mouse"))){var i=this.chart;i&&(t.target=i.getCanvas(),i.getStage().window.dispatchEvent(t))}}}})}));
|
|
25
|
+
*/PJ.defaultOptions={gridSize:8,ellipticity:1,maxSingleWordTryCount:1};var OJ=function(t){function e(t){var r;return n(this,e),(r=i(this,e,[Q({},e.defaultOptions,t)])).random=r.options.random?Math.random:function(){return 0},r.aspectRatio=1,r}return h(e,t),a(e,[{key:"fit",value:function(t){for(var e=0,i=this.result.length;e<i;e++)if(IJ(t,this.result[e]))return!1;return!0}},{key:"getTextInfo",value:function(t,e){var i={datum:t,fontSize:this.getTextFontSize(t),fontWeight:this.getTextFontWeight(t),fontStyle:this.getTextFontStyle(t),fontFamily:this.getTextFontFamily(t),angle:this.getTextRotate(t,e),text:this.getText(t)+"",x:this.center[0],y:this.center[1]},n=this.options.getTextBounds(i);return i.width=n.width(),i.height=n.height(),i.top=this.center[1]-i.height+.21*i.height,i.left=this.center[0]-i.width/2,i}},{key:"layoutWord",value:function(t){for(var e=this.getTextInfo(this.data[t],t),i=2*Math.PI,n=0,r=e.left,a=e.top,o=e.width,s=e.height,l=1,u=this.fit(e);!u&&n<this.maxRadius;)n+=.5,l=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*l*Math.cos(i)*this.aspectRatio,a=this.center[1]-s/2+n*l*Math.sin(i),e.left=r,e.top=a,e.x=r+o/2,e.y=a+s/2,u=this.fit(e);return!!u&&!!(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)}},{key:"layout",value:function(t,e){var i=this;if(!(null==t?void 0: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((function(t,e){return i.getTextFontSize(e)-i.getTextFontSize(t)}));for(var n=0;n<t.length&&(this.layoutWord(n),n++,this.progressiveIndex=n,!this.exceedTime()););return this.result}}])}(_J);function IJ(t,e){return!(t.left+t.width<e.left||t.top+t.height<e.top||t.left>e.left+e.width||t.top>e.top+e.height)}OJ.defaultOptions={enlarge:!1};var RJ={x:"x",y:"y",z:"z",fontFamily:"fontFamily",fontSize:"fontSize",fontStyle:"fontStyle",fontWeight:"fontWeight",angle:"angle"},LJ=function(t,e){var i,n,r,a,o,s;if(t.size&&(t.size[0]<=0||t.size[1]<=0))return bt.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];var l=e,u=(null!==(i=t.size)&&void 0!==i?i:[500,500]).slice();u[0]=Math.floor(u[0]),u[1]=Math.floor(u[1]);var h=t.fontFamily?DJ(t.fontFamily):"sans-serif",c=t.fontStyle?DJ(t.fontStyle):"normal",d=t.fontWeight?DJ(t.fontWeight):"normal",v=t.rotate?DJ(t.rotate):0,f=DJ(t.text),p=null!==(n=t.spiral)&&void 0!==n?n:"archimedean",g=t.padding?DJ(t.padding):1,y=null!==(r=t.shape)&&void 0!==r?r:"square",m=null!==(a=t.shrink)&&void 0!==a&&a,_=null!==(o=t.enlarge)&&void 0!==o&&o,b=null!==(s=t.clip)&&void 0!==s&&s,k=t.minFontSize,x=t.randomVisible,S=t.as?Object.assign(Object.assign({},RJ),t.as):RJ,A=t.depth_3d,C=t.postProjection,M=t.fontSize?DJ(t.fontSize):14,T=t.fontSizeRange;if(T&&!L(M)){var w=M,E=zJ(jJ(w,l),T);M=function(t){return E(w(t))}}var B=kJ;"fast"===t.layoutType?B=OJ:"grid"===t.layoutType&&(B=PJ);var P=new B(Object.assign(Object.assign({},t),{text:f,padding:g,spiral:p,shape:y,rotate:v,fontFamily:h,fontStyle:c,fontWeight:d,fontSize:M,shrink:m,clip:b,enlarge:_,minFontSize:k,random:x,outputCallback:function(e){for(var i,n,r=[],a=0,o=e.length;a<o;a++)(i=(n=e[a]).datum)[S.x]=n.x,i[S.y]=n.y,i[S.fontFamily]=n.fontFamily,i[S.fontSize]=n.fontSize,i[S.fontStyle]=n.fontStyle,i[S.fontWeight]=n.fontWeight,i[S.angle]=n.angle,"StereographicProjection"===C&&HJ(u,n,i,S,A),t.dataIndexKey&&(i[t.dataIndexKey]="".concat(a)),r.push(i);return r}}));return P.layout(l,{width:u[0],height:u[1]}),t.progressiveStep>0||t.progressiveTime>0?{progressive:P}:P.output()},DJ=function(t){return P(t)||L(t)||A(t)||O(t)?t:function(e){return e[t.field]}},FJ=function(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)},zJ=function(t,e,i){if(t[0]===t[1])return function(t){return e[0]};var n=FJ(t[0]),r=FJ(t[1]),a=Math.min(n,r),o=Math.max(n,r);return function(t){return(FJ(t)-a)/(o-a)*(e[1]-e[0])+e[0]}},jJ=function(t,e){for(var i,n=1/0,r=-1/0,a=e.length,o=0;o<a;++o)(i=pt(t(e[o])))<n&&(n=i),i>r&&(r=i);return 1===e.length&&n===r&&(n-=1e4),[n,r]};function HJ(t,e,i,n,r){var a=Math.max(t[0],t[1])/2,o=function(t,e,i,n,r){var a=r.x,o=r.y,s=a/t*Math.PI*2,l=Math.PI-o/e*Math.PI;return l+=(l<Math.PI/2?1:-1)*Math.pow(Math.min(l-Math.PI/2,1),2)/5,{x:i*Math.sin(l)*Math.cos(s)+n.x,y:i*Math.cos(l)+n.y,z:i*Math.sin(l)*Math.sin(s)+n.z}}(t[0],t[1],a,{x:a,y:a,z:null!=r?r:a},e);i[n.x]=o.x,i[n.y]=o.y,i[n.z]=o.z}var NJ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=nz.wordCloud,t}return h(e,t),a(e)}(yZ);NJ.type=nz.wordCloud;var UJ=function(){Uz.registerGrammarTransform("wordcloud",{transform:LJ}),kX(),Uz.registerAnimation("wordCloud",(function(t,e){return{appear:mZ(t,e),enter:{type:"fadeIn"},exit:{type:"fadeOut"},disappear:{duration:sU.disappear.duration}}})),Uz.registerSeries(NJ.type,NJ)},VJ=function(t){return A(t)?t():t},WJ=function(t,e){var i,n,r,a,o=t.map((function(t){return Object.assign({},t)}));if(!o||0===o.length)return o;var s=e.asTransformRatio,l=e.asReachRatio,u=e.asHeightRatio,h=e.asValueRatio,c=e.asNextValueRatio,d=e.asLastValueRatio,v=e.asLastValue,f=e.asCurrentValue,p=e.asNextValue,g=VJ(e.valueField),y=null!==(i=VJ(e.heightVisual))&&void 0!==i&&i,m=null===(n=VJ(e.isCone))||void 0===n||n,_=VJ(e.range),b=o.reduce((function(t,e){return Math.max(t,Number.parseFloat(e[g])||-1/0)}),-1/0),k=o.reduce((function(t,e){return Math.min(t,Number.parseFloat(e[g])||1/0)}),1/0),x=[null!==(r=null==_?void 0:_.min)&&void 0!==r?r:k,null!==(a=null==_?void 0:_.max)&&void 0!==a?a:b];return o.forEach((function(t,e){var i,n,r=Number.parseFloat(t[g]),a=Number.parseFloat(null===(i=o[e-1])||void 0===i?void 0:i[g]),_=Number.parseFloat(null===(n=o[e+1])||void 0===n?void 0:n[g]),b=F(_*r)&&0!==r?_/r:0,k=F(r*a)&&0!==a?r/a:0;v&&(t[v]=a),p&&(t[p]=_),s&&(t[s]=b),l&&(t[l]=0===e?1:k),u&&(t[u]=!0===y?b:1/o.length),h&&(t[h]=r/x[1]),c&&(t[c]=e===o.length-1?m?0:t[h]:_/x[1]),d&&(t[d]=0===e?1:a/x[1]),f&&(t[f]=r)})),o},GJ=function(t,e){var i,n,r=null===(n=null===(i=t[0])||void 0===i?void 0:i.latestData)||void 0===n?void 0:n.map((function(t){return Object.assign({},t)}));return r&&0!==r.length?(r.shift(),r.forEach((function(t){t[e.asIsTransformLevel]=!0})),r):r},YJ="".concat(dj,"_FUNNEL_TRANSFORM_RATIO"),KJ="".concat(dj,"_FUNNEL_REACH_RATIO"),XJ="".concat(dj,"_FUNNEL_HEIGHT_RATIO"),qJ="".concat(dj,"_FUNNEL_VALUE_RATIO"),ZJ="".concat(dj,"_FUNNEL_LAST_VALUE_RATIO"),JJ="".concat(dj,"_FUNNEL_NEXT_VALUE_RATIO"),QJ="".concat(dj,"_FUNNEL_LAST_VALUE"),$J="".concat(dj,"_FUNNEL_CURRENT_VALUE"),tQ="".concat(dj,"_FUNNEL_NEXT_VALUE"),eQ="".concat(dj,"_FUNNEL_TRANSFORM_LEVEL"),iQ=function(t){function e(t){var r,a,o;return n(this,e),(r=i(this,e,[t])).dimensionTooltipTitleCallback=function(t,e){var i,n,a,o=r.series;return"transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name)?r._transformRatioText:null!==(n=r._getDimensionData(t))&&void 0!==n?n:null===(a=t.properties)||void 0===a?void 0:a["".concat(o.getCategoryField())]},r.markTooltipValueCallback=function(t,e){var i;return"transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name)?"".concat((100*(null==t?void 0:t[KJ])).toFixed(1),"%"):r._getMeasureData(t)},r.markTooltipKeyCallback=function(t,e){var i;if("transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name))return r._transformRatioText;var n=r._seriesCacheInfo,a=n.dimensionFields,o=n.seriesFields,s=a[a.length-1];return M(o[0])?null==t?void 0:t[o[0]]:null==t?void 0:t[s]},r._transformRatioText=null!==(o=null===(a=t.getSpec())||void 0===a?void 0:a.transformRatioText)&&void 0!==o?o:"转化率",r}return h(e,t),a(e)}(UU),nQ=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultStyle",value:function(){return Object.assign(Object.assign({},_(e,"_getDefaultStyle",this,3)([])),{points:[]})}}])}($N),rQ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=e.type,t}return h(e,t),a(e,[{key:"_getDefaultStyle",value:function(){return Object.assign(Object.assign({},_(e,"_getDefaultStyle",this,3)([])),{lineWidth:0})}}])}(nQ);rQ.type="polygon";var aQ=function(){Uz.registerMark(rQ.type,rQ),xw(),dw(),hP.registerBuiltInAnimate("growPointsOut",uO),Uz.registerGraphicComponent("polygon",Fp)},oQ=Object.assign(Object.assign({},tV),{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"}}),sQ=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"funnel"),t.isTransform&&this._addMarkLabelSpec(t,"transform","transformLabel")}}])}(gV),lQ=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=nz.funnel,t._funnelMarkName="funnel",t._funnelMarkType="polygon",t._transformMarkName="transform",t._transformMarkType="polygon",t.transformerConstructor=sQ,t._funnelMark=null,t._funnelTransformMark=null,t._labelMark=null,t._transformLabelMark=null,t._funnelOuterLabelMark={},t}return h(r,e),a(r,[{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getValueField",value:function(){return this._valueField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"setAttrFromSpec",value:function(){var t,e,i,n,a;_(r,"setAttrFromSpec",this,3)([]),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this._funnelOrient=null!==(t=this._spec.funnelOrient)&&void 0!==t?t:"top",this._shape=null!==(e=this._spec.shape)&&void 0!==e?e:"trapezoid",this._minLabelLineWidth=null!==(a=null===(n=null===(i=this._spec.outerLabel)||void 0===i?void 0:i.line)||void 0===n?void 0:n.minLength)&&void 0!==a?a:20,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._seriesField&&this._spec.categoryField&&this.setSeriesField(this._spec.categoryField)}},{key:"initData",value:function(){if(_(r,"initData",this,3)([]),this._data){fH(this._dataSet,"funnel",WJ),fH(this._dataSet,"funnelTransform",GJ);var t=new Ko(this._dataSet,{name:"".concat(dj,"_series_").concat(this.id,"_viewDataTransform")});t.parse([this.getViewData()],{type:"dataview"}),this._viewDataTransform=new WN(this._option,t)}}},{key:"compile",value:function(){var t,e;_(r,"compile",this,3)([]),this._funnelOuterLabelMark&&(null===(t=this._funnelOuterLabelMark.label)||void 0===t||t.compile({group:this._rootMark.getProduct()}),null===(e=this._funnelOuterLabelMark.line)||void 0===e||e.compile({group:this._rootMark.getProduct()}))}},{key:"compileData",value:function(){var t;_(r,"compileData",this,3)([]),null===(t=this._viewDataTransform)||void 0===t||t.compile()}},{key:"getStatisticFields",value:function(){var t=[];return t.push({key:this._categoryField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}},{key:"_statisticViewData",value:function(){var t,e=this;_(r,"_statisticViewData",this,3)([]),this._data.getDataView().transform({type:"funnel",options:{valueField:function(){return e.getValueField()},isCone:function(){return e._spec.isCone},asCurrentValue:$J,asTransformRatio:YJ,asReachRatio:KJ,asHeightRatio:XJ,asValueRatio:qJ,asNextValueRatio:JJ,asLastValueRatio:ZJ,asLastValue:QJ,asNextValue:tQ,range:function(){return e._spec.range}}}),null===(t=this._viewDataTransform.getDataView())||void 0===t||t.transform({type:"funnelTransform",options:{asIsTransformLevel:eQ}})}},{key:"initMark",value:function(){var t,e,i,n,a,o,s,l;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},r.mark.funnel),{name:this._funnelMarkName,type:this._funnelMarkType}),{themeSpec:null===(t=this._theme)||void 0===t?void 0:t.funnel,groupKey:this._seriesField,isSeriesMark:!0,noSeparateStyle:!0},{morph:dV(this._spec,this._funnelMarkName),morphElementKey:this._seriesField}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},r.mark.transform),{name:this._transformMarkName,type:this._transformMarkType}),{themeSpec:null===(e=this._theme)||void 0===e?void 0:e.transform,noSeparateStyle:!0}),this._funnelTransformMark&&this._funnelTransformMark.setData(this._viewDataTransform)),null===(n=null===(i=this._spec)||void 0===i?void 0:i.outerLabel)||void 0===n?void 0:n.visible){var u=(null!==(a=this._spec.outerLabel)&&void 0!==a?a:{}).line,h=(null!==(s=null===(o=this._theme)||void 0===o?void 0:o.outerLabel)&&void 0!==s?s:{}).line;this._funnelOuterLabelMark.label=this._createMark(r.mark.outerLabel,{themeSpec:null===(l=this._theme)||void 0===l?void 0:l.outerLabel,markSpec:this._spec.outerLabel,noSeparateStyle:!0,parent:!1}),this._funnelOuterLabelMark.line=this._createMark(r.mark.outerLabelLine,{themeSpec:h,markSpec:u,noSeparateStyle:!0,parent:!1})}}},{key:"initTooltip",value:function(){this._tooltipHelper=new iQ(this),this._funnelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._funnelMark),this._funnelTransformMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._funnelTransformMark)}},{key:"getDimensionField",value:function(){return this._seriesField?[this._seriesField]:[]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"getGroupFields",value:function(){return null}},{key:"initMarkStyle",value:function(){var e,i,n,r,a=this,o=this._funnelMark;o&&this.setMarkStyle(o,{points:function(t){return a.getPoints(t)},visible:function(t){return M(t[a._valueField])},fill:this.getColorAttribute()},"normal",t.AttributeLevel.Series);var s=this._funnelTransformMark;s&&this.setMarkStyle(s,{points:function(t){return a.getPoints(t)}},"normal",t.AttributeLevel.Series);var l=this._funnelOuterLabelMark.label;l&&(this.setMarkStyle(l,{text:function(t){return"".concat(t[a.getCategoryField()])},x:function(t){return a._computeOuterLabelPosition(t).x},y:function(t){return a._computeOuterLabelPosition(t).y},textAlign:function(t){return a._computeOuterLabelPosition(t).align},textBaseline:function(t){return a._computeOuterLabelPosition(t).textBaseline},maxLineWidth:function(t){return a._computeOuterLabelLimit(t)},width:0,height:0},"normal",t.AttributeLevel.Series),A(this._spec.outerLabel.formatMethod)&&this.setMarkStyle(l,{text:function(t){return a._spec.outerLabel.formatMethod("".concat(t[a.getCategoryField()]),t)}},"normal",t.AttributeLevel.User_Mark));var u=this._funnelOuterLabelMark.line;if(u&&l){this.setMarkStyle(u,{x:function(t){return a._computeOuterLabelLinePosition(t).x1},y:function(t){return a._computeOuterLabelLinePosition(t).y1},x1:function(t){return a._computeOuterLabelLinePosition(t).x2},y1:function(t){return a._computeOuterLabelLinePosition(t).y2}},"normal",t.AttributeLevel.Series);var h=null!==(n=null===(i=null===(e=this._spec.outerLabel)||void 0===e?void 0:e.line)||void 0===i?void 0:i.visible)&&void 0!==n?n:null===(r=this._spec.outerLabel)||void 0===r?void 0:r.visible;M(h)&&u.setVisible(h)}}},{key:"initLabelMarkStyle",value:function(e){var i,n=this;if(e){var r=e.getTarget(),a=e.getComponent();if(r===this._funnelMark){this._labelMark=e,this.setMarkStyle(e,{text:function(t){return"".concat(t[n.getCategoryField()]," ").concat(t[n.getValueField()])},x:function(t){return n._computeLabelPosition(t).x},y:function(t){return n._computeLabelPosition(t).y},maxLineWidth:function(t){return n._computeLabelLimit(t,n._spec.label)},stroke:this.getColorAttribute()},"normal",t.AttributeLevel.Series);var o=this.getCompiler().getRootMarks();this._funnelOuterLabelMark.label&&zS(o,this._funnelOuterLabelMark.label,a),this._funnelOuterLabelMark.line&&zS(o,this._funnelOuterLabelMark.line,null!==(i=this._funnelOuterLabelMark.label)&&void 0!==i?i:a)}else this._funnelTransformMark&&r===this._funnelTransformMark&&(this._transformLabelMark=e,this.setMarkStyle(e,{text:function(t){return"".concat((100*oz(KJ).bind(n)(t)).toFixed(1),"%")},x:function(t){return n._computeLabelPosition(t).x},y:function(t){return n._computeLabelPosition(t).y},maxLineWidth:function(t){return n._computeLabelLimit(t,n._spec.transformLabel)}},"normal",t.AttributeLevel.Series))}}},{key:"initAnimation",value:function(){var t,e,i,n,r,a,o,s=this,l=null!==(i=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset)&&void 0!==i?i:"clipIn";"clipIn"===l&&this._rootMark&&this._rootMark.setAnimationConfig(lV(null===(n=Uz.getAnimationInKey("cartesianGroupClip"))||void 0===n?void 0:n({direction:function(){return s._isHorizontal()?"x":"y"},width:function(){var t=s.getRootMark().getProduct();if(t){var e=t.AABBBounds,i=e.x1,n=e.x2;return Math.max(i,n)}return s.getLayoutRect().width},height:function(){var t=s.getRootMark().getProduct();if(t){var e=t.AABBBounds,i=e.y1,n=e.y2;return Math.max(i,n)}return s.getLayoutRect().height},orient:function(){return s._isReverse()?"negative":"positive"}},l),uV("group",this._spec,this._markAttributeContext))),[null===(r=this._funnelOuterLabelMark)||void 0===r?void 0:r.label].forEach((function(t){t&&t.setAnimationConfig(lV(Uz.getAnimationInKey("fadeInOut")(),uV(t.name,s._spec,s._markAttributeContext)))})),[this._funnelMark,this._funnelTransformMark].forEach((function(t){t&&t.setAnimationConfig(lV(Uz.getAnimationInKey("funnel")({},l),uV(t.name,s._spec,s._markAttributeContext)))})),(null===(a=this._funnelOuterLabelMark)||void 0===a?void 0:a.line)&&this._funnelOuterLabelMark.line.setAnimationConfig(lV(null===(o=Uz.getAnimationInKey("fadeInOut"))||void 0===o?void 0:o(),uV("outerLabelLine",this._spec,this._markAttributeContext)))}},{key:"initGroups",value:function(){}},{key:"getStackGroupFields",value:function(){return[]}},{key:"getStackValueField",value:function(){return null}},{key:"initEvent",value:function(){var t,e=this;_(r,"initEvent",this,3)([]),null===(t=this._viewDataTransform.getDataView())||void 0===t||t.target.addListener("change",(function(t){e._viewDataTransform.updateData()}))}},{key:"getPoints",value:function(t){var e,i,n=this.isTransformLevel(t),r=this._getMainAxisLength(n)/2;n?(e="rect"===this._shape?this._getSecondaryAxisLength(t[ZJ])/2:this._getSecondaryAxisLength(t[qJ])/2,i=this._getSecondaryAxisLength(t[qJ])/2):(e=this._getSecondaryAxisLength(t[qJ])/2,i="rect"===this._shape?e:this._getSecondaryAxisLength(t[JJ])/2);var a=this._getPositionByData(t),o=a.x,s=a.y,l=this._getPolygonPoints([o,s],e,i,e,i,r);return"center"!==this._funnelAlign&&this._adjustPoints(l),l}},{key:"isTransformLevel",value:function(t){return!!(null==t?void 0:t[eQ])}},{key:"_buildMarkAttributeContext",value:function(){_(r,"_buildMarkAttributeContext",this,3)([]),this._markAttributeContext.valueToPosition=this.valueToPosition.bind(this),this._markAttributeContext.getPoints=this.getPoints.bind(this),this._markAttributeContext.isTransformLevel=this.isTransformLevel.bind(this)}},{key:"valueToPosition",value:function(t){var e,i,n,r=this,a=null===(n=null===(i=null===(e=this.getViewData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i.find)||void 0===n?void 0:n.call(i,(function(e){return e[r._categoryField]===t}));return M(a)?this._getPolygonCenter(this.getPoints(a)):null}},{key:"dataToPosition",value:function(t,e){return e&&!this.isDatumInViewData(t)?null:this.valueToPosition(t[this._categoryField])}},{key:"dataToPositionX",value:function(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.x}},{key:"dataToPositionY",value:function(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.y}},{key:"dataToPositionZ",value:function(t){return 0}},{key:"_getMainAxisLength",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=this.getViewData().latestData.length,n=this._isHorizontal()?this.getLayoutRect().width:this.getLayoutRect().height,r=!!this._spec.isTransform,a=r?0:null!==(t=this._spec.gap)&&void 0!==t?t:0,o=r?Math.max(0,i-1):0,s=this._spec.heightRatio||.5,l=(n-a*Math.max(0,i-1))/(i+s*o);return e?r?l*s:0:l}},{key:"_getSecondaryAxisLength",value:function(t){var e=Number.isNaN(t)||!Number.isFinite(t)?0:t,i=this._computeMaxSize(),n=this._computeMinSize();return n+(i-n)*e}},{key:"_getPositionByData",value:function(t){var e,i=this,n=null===(e=this.getViewData().latestData)||void 0===e?void 0:e.findIndex((function(e){return e[i._categoryField]===t[i._categoryField]&&e[yj]===t[yj]}));if(!M(n)||n<0)return{};var r=this.isTransformLevel(t),a=this._isHorizontal(),o=a?this.getLayoutRect().height:this.getLayoutRect().width,s=a?this.getLayoutRect().width:this.getLayoutRect().height,l=o/2,u=0,h=this._getMainAxisLength(),c=this._getMainAxisLength(!0);return u+=n*(h+c),u+=r?-c/2:h/2,!this._spec.isTransform&&this._spec.gap&&(u+=this._spec.gap*n),this._isReverse()&&(u=s-u),this._isHorizontal()?{x:u,y:l}:{x:l,y:u}}},{key:"_getPolygonPoints",value:function(t,e,i,n,r,a){var o=t[0],s=t[1];switch(this._funnelOrient){case"left":return[{x:o-a,y:s+e},{x:o-a,y:s-n},{x:o+a,y:s-r},{x:o+a,y:s+i}];case"right":return[{x:o+a,y:s-n},{x:o+a,y:s+n},{x:o-a,y:s+i},{x:o-a,y:s-i}];case"bottom":return[{x:o+e,y:s+a},{x:o-n,y:s+a},{x:o-r,y:s-a},{x:o+i,y:s-a}];default:return[{x:o-e,y:s-a},{x:o+n,y:s-a},{x:o+r,y:s+a},{x:o-i,y:s+a}]}}},{key:"_getPolygonCenter",value:function(t){if(this._isHorizontal()){var 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}}var 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}}},{key:"_adjustPoints",value:function(t){var e,i,n;return this._isHorizontal()?(n="y","left"===this._funnelOrient?(e="bottom"===this._funnelAlign?-t[1].y:t[1].y,i="bottom"===this._funnelAlign?-t[2].y:t[2].y):(e="bottom"===this._funnelAlign?-t[0].y:t[0].y,i="bottom"===this._funnelAlign?-t[3].y:t[3].y)):(n="x","top"===this._funnelOrient?(e="left"===this._funnelAlign?t[0].x:-t[0].x,i="left"===this._funnelAlign?t[3].x:-t[3].x):(e="left"===this._funnelAlign?t[1].x:-t[1].x,i="left"===this._funnelAlign?t[2].x:-t[2].x)),t[0][n]-=e,t[1][n]-=e,t[2][n]-=i,t[3][n]-=i,t}},{key:"_computeLabelPosition",value:function(t){var e=this.getPoints(t);return this._getPolygonCenter(e)}},{key:"_computeLabelLimit",value:function(t,e){var i=null==e?void 0:e.limit;if(L(i))return i;var n=this.getPoints(t);return"shapeSize"===i?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}},{key:"_computeOuterLabelPosition",value:function(t){var e,i,n,r,a,o=null===(i=this._spec.outerLabel)||void 0===i?void 0:i.position,s="center",l="middle";if(o=this._isHorizontal()?["top","bottom"].includes(o)?o:"bottom"===this._funnelAlign?"top":"bottom":["left","right"].includes(o)?o:"left"===this._funnelAlign?"right":"left",!1!==(null===(n=this._spec.outerLabel)||void 0===n?void 0:n.alignLabel))r=(e=this._getPositionByData(t)).x,a=e.y,"left"===o?(r=0,s="left"):"right"===o?(r=this.getLayoutRect().width,s="right"):"top"===o?(a=0,l="top"):"bottom"===o&&(a=this.getLayoutRect().height,l="bottom");else{var u=this._computeOuterLabelLinePosition(t);r=u.x2,a=u.y2,"left"===o?(r-=5,s="right"):"right"===o?(r+=5,s="left"):"top"===o?(a-=5,l="bottom"):"bottom"===o&&(a+=5,l="top")}return{x:r,y:a,align:s,textBaseline:l}}},{key:"_computeOuterLabelLimit",value:function(t){var e,i,n,r,a,o;if(this._isHorizontal())return this._getMainAxisLength(this.isTransformLevel(t));var s=this.getPoints(t),l=(Math.abs(s[0].x-s[1].x)+Math.abs(s[2].x-s[3].x))/2,u=this.getCategoryField(),h=null===(r=null===(n=null===(i=null===(e=this._labelMark)||void 0===e?void 0:e.getComponent())||void 0===i?void 0:i.getComponent())||void 0===n?void 0:n.find((function(e){var i,n=e.attribute;return"text"===e.type&&(null===(i=n.data)||void 0===i?void 0:i[u])===t[u]}),!0))||void 0===r?void 0:r.AABBBounds,c=h?h.x2-h.x1:0,d=this._funnelOuterLabelMark.line?this._minLabelLineWidth:0,v=this.getLayoutRect().width-Math.max(l,c);return"center"===this._funnelAlign&&(v/=2),v-d-(null!==(o=null===(a=this._spec.outerLabel)||void 0===a?void 0:a.spaceWidth)&&void 0!==o?o:5)}},{key:"_computeOuterLabelLinePosition",value:function(t){var e,i,n,r,a,o,s,l,u,h,c,d,v,f,p=this.getCategoryField(),g=null===(r=null===(n=null===(i=null===(e=this._funnelOuterLabelMark)||void 0===e?void 0:e.label)||void 0===i?void 0:i.getGraphics())||void 0===n?void 0:n.find((function(e){var i;return(null===(i=e.context.data[0])||void 0===i?void 0:i[p])===t[p]})))||void 0===r?void 0:r.AABBBounds,y=null===(o=null===(a=this._labelMark)||void 0===a?void 0:a.getComponent())||void 0===o?void 0:o.getComponent(),m=null===(s=null==y?void 0:y.find((function(e){var i,n=e.attribute;return"text"===e.type&&(null===(i=n.data)||void 0===i?void 0:i[p])===t[p]}),!0))||void 0===s?void 0:s.AABBBounds,_=null!==(l=this._spec.outerLabel)&&void 0!==l?l:{};if(this._isHorizontal()){var b=null!==(u=_.spaceWidth)&&void 0!==u?u:5,k=this.getPoints(t),x=(Math.abs(k[0].y-k[1].y)+Math.abs(k[2].y-k[3].y))/2;return"top"===this._spec.outerLabel.position||"bottom"===this._funnelAlign?(v=this._getPolygonCenter(k).y-x/2-b,f=!1!==_.alignLabel?(null==g?void 0:g.y2)+b:v-b,c=this._getPolygonCenter(k).x,v-f<this._minLabelLineWidth&&(f=v-this._minLabelLineWidth),d=c):(v=this._getPolygonCenter(k).y+x/2+b,f=!1!==_.alignLabel?(null==g?void 0:g.y1)-b:v+b,c=this._getPolygonCenter(k).x,f-v<this._minLabelLineWidth&&(f=v+this._minLabelLineWidth),d=c),{x1:c,x2:d,y1:v,y2:f}}var S=this.getPoints(t),A=(Math.abs(S[0].x-S[1].x)+Math.abs(S[2].x-S[3].x))/2,C=(null==m?void 0:m.x2)-(null==m?void 0:m.x1)||0,M=null!==(h=_.spaceWidth)&&void 0!==h?h:5;return"right"===this._spec.outerLabel.position||"left"===this._funnelAlign?(c=this._getPolygonCenter(S).x+Math.max(C/2,A/2)+M,d=!1!==_.alignLabel?(null==g?void 0:g.x1)-M:c+M,v=this._getPolygonCenter(S).y,d-c<this._minLabelLineWidth&&(d=c+this._minLabelLineWidth),f=v):(c=this._getPolygonCenter(S).x-Math.max(C/2,A/2)-M,d=!1!==_.alignLabel?(null==g?void 0:g.x2)+M:c-M,v=this._getPolygonCenter(S).y,c-d<this._minLabelLineWidth&&(d=c-this._minLabelLineWidth),f=v),{x1:c,x2:d,y1:v,y2:f}}},{key:"_computeMaxSize",value:function(){var t,e=this._isHorizontal()?this.getLayoutRect().height:this.getLayoutRect().width;return wz(null!==(t=this._spec.maxSize)&&void 0!==t?t:"80%",e)}},{key:"_computeMinSize",value:function(){var t,e=this._isHorizontal()?this.getLayoutRect().height:this.getLayoutRect().width;return wz(null!==(t=this._spec.minSize)&&void 0!==t?t:0,e)}},{key:"_isHorizontal",value:function(){return"left"===this._funnelOrient||"right"===this._funnelOrient}},{key:"_isReverse",value:function(){return"bottom"===this._funnelOrient||"right"===this._funnelOrient}},{key:"getDefaultShapeType",value:function(){return"square"}},{key:"getActiveMarks",value:function(){return[this._funnelMark]}}])}(SV);lQ.type=nz.funnel,lQ.mark=oQ,lQ.builtInTheme={funnel:Yz},lQ.transformerConstructor=sQ;var uQ,hQ=function(){aQ(),kX(),BK(),Uz.registerSeries(lQ.type,lQ),Uz.registerAnimation("funnel",(function(t,e){return Object.assign({appear:"clipIn"===e?void 0:{type:"fadeIn"}},uU)})),Uz.registerAnimation("cartesianGroupClip",(function(t){return{appear:{custom:UP,customParameters:function(e,i){return{animationType:"in",group:i,direction:t.direction(),width:t.width(),height:t.height(),orient:t.orient()}}}}})),cU()},cQ=function(t,e){var i=(t-e[0])/(e[1]-e[0]||1);return Math.max(0,Math.min(1,i))},dQ=function(t){var e=t.filter((function(t){return t.context.diffState===dN.update})),i=ut(e.map((function(t){var e,i;return null===(i=null===(e=null==t?void 0:t.context)||void 0===e?void 0:e.data)||void 0===i?void 0:i[0].depth})));return e.filter((function(t){var e,n;return(null===(n=null===(e=null==t?void 0:t.context)||void 0===e?void 0:e.data)||void 0===n?void 0:n[0].depth)===i}))},vQ=function(t,e,i){if(W(t))return[e,i];var n=ut(t.map((function(t){return 1*t.getFinalAttribute().startAngle}))),r=lt(t.map((function(t){return 1*t.getFinalAttribute().endAngle})));return[n,r]},fQ=function(t){return{channel:{startAngle:{from:function(e,i){var n=t.animationInfo(),r=n.startAngle,a=n.endAngle,o=dQ(i.parent.children),s=vQ(o,r,a);return cQ(i.getFinalAttribute().startAngle,s)*(a-r)+r},to:function(t,e){return e.getFinalAttribute().startAngle}},endAngle:{from:function(e,i){var n=t.animationInfo(),r=n.startAngle,a=n.endAngle,o=dQ(i.parent.children),s=vQ(o,r,a);return cQ(i.getFinalAttribute().endAngle,s)*(a-r)+r},to:function(t,e){return e.getFinalAttribute().endAngle}},outerRadius:{from:function(t,e){return e.getFinalAttribute().innerRadius},to:function(t,e){return e.getFinalAttribute().outerRadius}},innerRadius:{from:function(t,e){return e.getFinalAttribute().innerRadius},to:function(t,e){return e.getFinalAttribute().innerRadius}}}}},pQ=function(t){var e=ut(t.map((function(t){return 1*t.getFinalAttribute().startAngle}))),i=lt(t.map((function(t){return 1*t.getFinalAttribute().endAngle})));return[e,i]},gQ=function(t){return{channel:{startAngle:{from:function(t,e){return e.getFinalAttribute().startAngle},to:function(e,i){var n=t.animationInfo(),r=n.startAngle,a=n.endAngle,o=dQ(i.parent.children),s=pQ(o);return cQ(i.getFinalAttribute().startAngle,s)*(a-r)+r}},endAngle:{from:function(t,e){return e.getFinalAttribute().endAngle},to:function(e,i){var n=t.animationInfo(),r=n.startAngle,a=n.endAngle,o=dQ(i.parent.children),s=pQ(o);return cQ(i.getFinalAttribute().endAngle,s)*(a-r)+r}},outerRadius:{from:function(t,e){return e.getFinalAttribute().outerRadius},to:function(){return t.animationInfo().innerRadius}},innerRadius:{from:function(t,e){return e.getFinalAttribute().innerRadius},to:function(){return t.animationInfo().innerRadius}}}}},yQ=function(t,e){switch(e){case"fadeIn":return{type:"fadeIn"};case"growAngle":return{type:"growAngleIn"};default:return{type:"growRadiusIn"}}},mQ=function(t){if(!t)return[];var e=[];return xZ(t,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),e},_Q=function(t,e){if(!t)return t;var i=e(),n=i.width,r=i.height;return new ZZ(i).layout(t,{width:n,height:r})},bQ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).markTooltipKeyCallback=function(e){return null==e?void 0:e[t.series.getDimensionField()[0]]},t}return h(e,t),a(e)}(UU);!function(t){t.DrillDown="drillDown",t.DrillUp="drillUp"}(uQ||(uQ={}));var kQ=function(t,e){var i=e.info(),n=e.keyField(),r=null==i?void 0:i.key;if(C(r))return t;if(i.type===uQ.DrillDown)return ot(Xj(t,r,n,"children"));if(i.type===uQ.DrillUp){var a=qj(t,r,n,"children");if(a)return ot(a)}return t},xQ=function(){function e(){n(this,e)}return a(e,[{key:"_getDrillTriggerEvent",value:function(t){var e;return null===(e=fK(this._drillParams.mode))||void 0===e?void 0:e[t]}},{key:"_hideTooltip",value:function(){var t=this.getChart().getComponentsByType(c.tooltip)[0];t&&t.hideTooltip()}},{key:"initDrillable",value:function(t){this._drillParams=t}},{key:"initDrillableData",value:function(t){var e=this,i=this._drillParams.getRawData;fH(t,"drillFilter",kQ),i().transform({type:"drillFilter",options:{info:function(){return e._drillInfo},keyField:function(){return e._drillParams.drillField()}}})}},{key:"bindDrillEvent",value:function(){var t=this,e=this._drillParams,i=e.event,n=e.getRawData,r=(0,e.drillField)();this._getDrillTriggerEvent("start")&&i.on(this._getDrillTriggerEvent("start"),(function(e){var i,a,s;if(C(e.datum)||C(null===(i=e.datum)||void 0===i?void 0:i[r]))t.drillUp();else{t._hideTooltip();var l=e.datum[r],u=null!==(s=null===(a=t._drillInfo)||void 0===a?void 0:a.path)&&void 0!==s?s:[],h=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"key",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"children",r=[],a=function(t,s){var l,u=o(t);try{for(u.s();!(l=u.n()).done;){var h=l.value;if(h[i]===e)return r.push.apply(r,b(s).concat([h[i].toString()])),!0;if(h[n]){var c=a(h[n],[].concat(b(s),[h[i]]));if(!0===c)return c}}}catch(t){u.e(t)}finally{u.f()}return!1};return a(t,[]),r}(n().rawData,l,r,"children");u[u.length-1]===h[h.length-1]?t.drillUp():t.drillDown(h)}}))}},{key:"drillDown",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=this._drillParams,n=i.getRawData,r=i.event;if(!O(e)||W(e))return e;var a=e[e.length-1];return this._drillInfo={key:a,path:e,type:uQ.DrillDown},n().reRunAllTransform(),r.emit(t.ChartEvent.drill,{value:{path:e,type:uQ.DrillDown},model:this}),e}},{key:"drillUp",value:function(){var e,i,n=this._drillParams,r=n.getRawData,a=n.event,o=null!==(i=null===(e=this._drillInfo)||void 0===e?void 0:e.path)&&void 0!==i?i:[];if(!O(o)||W(o))return o;var s=o.pop();return this._drillInfo={key:s,path:o,type:uQ.DrillUp},r().reRunAllTransform(),a.emit(t.ChartEvent.drill,{value:{path:o,type:uQ.DrillUp},model:this}),o}}])}(),SQ=Object.assign(Object.assign({},tV),{sunburst:{name:"sunburst",type:"arc"}}),AQ=function(t,e,i){return t.push({key:e,operations:["values"]}),t.push({key:i,operations:["max","min"]}),t.push({key:KU,operations:["max","min","values"]}),t.push({key:XU,operations:["values"]}),t},CQ={innerRadius:0,outerRadius:1,startAngle:-90,endAngle:270,gap:0,labelLayout:{align:"center",offset:0,rotate:"radial"},sunburst:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"},fillOpacity:1,cursor:"pointer"}},label:{visible:!0,style:{cursor:"pointer",fill:{type:"palette",key:"primaryFontColor"},fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}},MQ=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=nz.sunburst,t}return h(r,e),a(r,[{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"getValueField",value:function(){return this._valueField}},{key:"getDimensionField",value:function(){return[this._categoryField]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"setAttrFromSpec",value:function(){var t,e=this;_(r,"setAttrFromSpec",this,3)([]),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:XU),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:function(){var t;return null!==(t=e._spec.drillField)&&void 0!==t?t:yj},getRawData:function(){return e.getRawData()}}),this._startAngle=be(this._spec.startAngle),this._endAngle=be(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}},{key:"initData",value:function(){var t=this;_(r,"initData",this,3)([]);var e=this.getRawData();e&&(this._spec.drill&&this.initDrillableData(this._dataSet),fH(this._dataSet,"sunburstLayout",_Q),fH(this._dataSet,"flatten",mQ),e.transform({type:"sunburstLayout",options:function(){var e=t._computeLevel(),i=e.innerRadius,n=e.outerRadius,r=e.gap,a=e.label;return{nodeKey:t._categoryField,width:t.getLayoutRect().width,height:t.getLayoutRect().height,center:[M(t._centerX)?t._centerX:t.getLayoutRect().width/2,M(t._centerY)?t._centerY:t.getLayoutRect().height/2],startAngle:t._startAngle,endAngle:t._endAngle,innerRadius:i,outerRadius:n,gapRadius:r,label:a}}}),e.transform({type:"flatten",options:{callback:function(t){if(t.datum){var e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}}))}},{key:"getStatisticFields",value:function(){return AQ(_(r,"getStatisticFields",this,3)([]),this._categoryField,this._valueField)}},{key:"_addDataIndexAndKey",value:function(){var t=this.getRawData();C(null==t?void 0:t.dataSet)||(fH(t.dataSet,"addVChartProperty",LU),t.transform({type:"addVChartProperty",options:{beforeCall:QU.bind(this),call:$U}}))}},{key:"initMark",value:function(){this._initArcMark(),this._initLabelMark()}},{key:"initMarkStyle",value:function(){this._initArcMarkStyle(),this._initLabelMarkStyle()}},{key:"_initArcMark",value:function(){if(!1!==this._sunburst.visible){var t=this._createMark(r.mark.sunburst,{isSeriesMark:!0});this._sunburstMark=t}}},{key:"_initArcMarkStyle",value:function(){var e=this;C(this._sunburstMark)||this.setMarkStyle(this._sunburstMark,{x:function(t){return t.x+(M(e._offsetX)?e._offsetX:0)},y:function(t){return t.y+(M(e._offsetY)?e._offsetY:0)},outerRadius:function(t){return t.outerRadius},innerRadius:function(t){return t.innerRadius},startAngle:function(t){return t.startAngle},endAngle:function(t){return t.endAngle},fill:this.getColorAttribute()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"_initLabelMark",value:function(){if(!0===this._label.visible){var t=this._createMark(r.mark.label,{isSeriesMark:!1});this._labelMark=t}}},{key:"_initLabelMarkStyle",value:function(){var e=this;C(this._labelMark)||this.setMarkStyle(this._labelMark,{visible:function(t){var i,n=e._labelAutoVisible;return T(n)&&!0===n.enable?(t.endAngle-t.startAngle)*(t.outerRadius-t.innerRadius)>(null!==(i=null==n?void 0:n.circumference)&&void 0!==i?i:10):e._spec.label.visible},x:function(t){var i;return(null===(i=t.label)||void 0===i?void 0:i.x)+(M(e._offsetX)?e._offsetX:0)},y:function(t){var i;return(null===(i=t.label)||void 0===i?void 0:i.y)+(M(e._offsetY)?e._offsetY:0)},textBaseline:function(t){var e;return null===(e=t.label)||void 0===e?void 0:e.textBaseline},textAlign:function(t){var e;return null===(e=t.label)||void 0===e?void 0:e.textAlign},angle:function(t){var e,i;return null!==(i=null===(e=t.label)||void 0===e?void 0:e.angle)&&void 0!==i?i:0},fontSize:10,text:function(t){return t.name}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"initTooltip",value:function(){this._tooltipHelper=new bQ(this),this._sunburstMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._sunburstMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}},{key:"initAnimation",value:function(){var t,e,i=this,n={animationInfo:function(){return{innerRadius:i._computeRadius(ot(i.__innerRadius))[0],outerRadius:i._computeRadius(ot(i.__outerRadius))[0],startAngle:ot(i._startAngle)[0],endAngle:ot(i._endAngle)[0]}}},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this.getMarksInType("arc").forEach((function(t){var e;t.setAnimationConfig(lV(null===(e=Uz.getAnimationInKey("sunburst"))||void 0===e?void 0:e(n,r),uV(t.name,i._spec,i._markAttributeContext)))})),this.getMarksInType("text").forEach((function(t){var e;t.setAnimationConfig(lV(null===(e=Uz.getAnimationInKey("fadeInOut"))||void 0===e?void 0:e(),uV(t.name,i._spec,i._markAttributeContext)))}))}},{key:"initEvent",value:function(){_(r,"initEvent",this,3)([]),this._spec.drill&&this.bindDrillEvent()}},{key:"onLayoutEnd",value:function(){_(r,"onLayoutEnd",this,3)([]),this._rawData.reRunAllTransform()}},{key:"_computeRadius",value:function(t){var e=this;return O(t)?t.map((function(t){return e._computeLayoutRadius()*t})):this._computeLayoutRadius()*t}},{key:"_computeLevel",value:function(){return{innerRadius:this._computeRadius(this.__innerRadius),outerRadius:this._computeRadius(this.__outerRadius),gap:this._gap,label:this._labelLayout}}},{key:"getGroupFields",value:function(){return[]}},{key:"getStackGroupFields",value:function(){return[]}},{key:"getStackValueField",value:function(){return""}},{key:"_noAnimationDataKey",value:function(t,e){}},{key:"getActiveMarks",value:function(){return[this._sunburstMark]}},{key:"getMarkData",value:function(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}])}(DX);MQ.type=nz.sunburst,MQ.mark=SQ,MQ.builtInTheme={sunburst:CQ},at(MQ,xQ);var TQ=function(){Uz.registerSeries(MQ.type,MQ),XX(),kX(),cU(),Uz.registerAnimation("sunburst",(function(t,e){return{appear:yQ(0,e),enter:fQ(t),exit:gQ(t),disappear:{duration:sU.disappear.duration}}}))},wQ=function(t,e){if(!t)return t;var i=e(),n=i.width,r=i.height;return 0===n||0===r?t:new zZ(i).layout(t,{width:n,height:r})},EQ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).markTooltipKeyCallback=function(e){return null==e?void 0:e[t.series.getDimensionField()[0]]},t}return h(e,t),a(e)}(UU),BQ=function(t){return"fadeIn"===t?{type:"fadeIn"}:{type:"growRadiusIn"}},PQ=Object.assign(Object.assign({},tV),{circlePacking:{name:"circlePacking",type:"arc"}}),OQ=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=nz.circlePacking,t}return h(r,e),a(r,[{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"getValueField",value:function(){return this._valueField}},{key:"getDimensionField",value:function(){return[this._categoryField]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"setAttrFromSpec",value:function(){var t,e=this;_(r,"setAttrFromSpec",this,3)([]),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:XU),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:function(){var t;return null!==(t=e._spec.drillField)&&void 0!==t?t:yj},getRawData:function(){return e.getRawData()}}),this._circlePacking=this._spec.circlePacking,this._label=this._spec.label,this._layoutPadding=this._spec.layoutPadding}},{key:"initData",value:function(){var t=this;_(r,"initData",this,3)([]);var e=this.getRawData();C(e)||(this._spec.drill&&this.initDrillableData(this._dataSet),fH(this._dataSet,"circlePackingLayout",wQ),fH(this._dataSet,"flatten",mQ),e.transform({type:"circlePackingLayout",options:function(){return{nodeKey:t._categoryField,valueField:t._valueField,padding:t._layoutPadding,includeRoot:!1,width:t.getLayoutRect().width||1,height:t.getLayoutRect().height||1}}}),e.transform({type:"flatten",options:{callback:function(t){if(t.datum){var e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}}))}},{key:"_addDataIndexAndKey",value:function(){var t=this.getRawData();C(null==t?void 0:t.dataSet)||(fH(t.dataSet,"addVChartProperty",LU),t.transform({type:"addVChartProperty",options:{beforeCall:QU.bind(this),call:$U}}))}},{key:"initMark",value:function(){this._initCirclePackingMark(),this._initLabelMark()}},{key:"initMarkStyle",value:function(){this._initCirclePackingMarkStyle(),this._initLabelMarkStyle()}},{key:"_initCirclePackingMark",value:function(){var t;if(!1!==(null===(t=this._circlePacking)||void 0===t?void 0:t.visible)){var e=this._createMark(r.mark.circlePacking,{isSeriesMark:!0});this._circlePackingMark=e}}},{key:"_initCirclePackingMarkStyle",value:function(){C(this._circlePackingMark)||this.setMarkStyle(this._circlePackingMark,{x:function(t){return t.x},y:function(t){return t.y},outerRadius:function(t){return t.radius},innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:this.getColorAttribute(),zIndex:function(t){return t.depth}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"_initLabelMark",value:function(){var t;if(!1!==(null===(t=this._label)||void 0===t?void 0:t.visible)){var e=this._createMark(r.mark.label,{isSeriesMark:!1});this._labelMark=e}}},{key:"_initLabelMarkStyle",value:function(){C(this._labelMark)||this.setMarkStyle(this._labelMark,{x:function(t){return t.x},y:function(t){return t.y},text:function(t){return t.key},cursor:"pointer"},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"getStatisticFields",value:function(){return AQ(_(r,"getStatisticFields",this,3)([]),this._categoryField,this._valueField)}},{key:"initTooltip",value:function(){this._tooltipHelper=new EQ(this),this._circlePackingMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._circlePackingMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}},{key:"initAnimation",value:function(){var t,e=this,i=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;this.getMarksInType("arc").forEach((function(t){var n;t.setAnimationConfig(lV(null===(n=Uz.getAnimationInKey("circlePacking"))||void 0===n?void 0:n(void 0,i),uV(t.name,e._spec,e._markAttributeContext)))})),this.getMarksInType("text").forEach((function(t){var i;t.setAnimationConfig(lV(null===(i=Uz.getAnimationInKey("scaleInOut"))||void 0===i?void 0:i(),uV(t.name,e._spec,e._markAttributeContext)))}))}},{key:"initEvent",value:function(){_(r,"initEvent",this,3)([]),this._spec.drill&&this.bindDrillEvent()}},{key:"onLayoutEnd",value:function(){_(r,"onLayoutEnd",this,3)([]),this._rawData.reRunAllTransform()}},{key:"_noAnimationDataKey",value:function(t,e){}},{key:"getActiveMarks",value:function(){return[this._circlePackingMark]}},{key:"getMarkData",value:function(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}])}(MV);OQ.type=nz.circlePacking,OQ.mark=PQ,OQ.builtInTheme={circlePacking:{layoutPadding:5,circlePacking:{visible:!0,style:{cursor:"pointer",lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}},label:{visible:!0,style:{cursor:"pointer",fill:"black",stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}}},at(OQ,xQ);var IQ=function(){Uz.registerSeries(OQ.type,OQ),XX(),kX(),hU(),Uz.registerAnimation("circlePacking",(function(t,e){return{appear:BQ(e),enter:{type:"growRadiusIn"},exit:{type:"growRadiusOut"},disappear:{duration:sU.disappear.duration}}}))},RQ=function(t,e,i){e.forEach((function(e){C(e[i])||t.add(e[i]),e.children&&e.children.length>0&&RQ(t,e.children,i)}))},LQ=function(t){var e;if(!t||!O(t))return[];if(t.length>1){var i={links:[],nodes:[]};return t.forEach((function(t){"links"!==t.id&&"nodes"!==t.id||(i[t.id]=t.values)})),[i]}return(null===(e=t[0])||void 0===e?void 0:e.latestData)?t[0].latestData:t},DQ=function(t,e){var i=A(e)?e():e;if(!t||!(null==i?void 0:i.view)||!t.length)return[];var n=i.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[];var r=t[0],a=FQ(r,i),o=new KZ(i),s=[];return s.push(o.layout(a,n)),s},FQ=function(t,e){if("source"===e.sourceField&&"target"===e.targetField&&"value"===e.valueField)return t;var i=t.links;return i?Object.assign(Object.assign({},t),{links:i.map((function(t){var i={};return Object.keys(t).forEach((function(n){n===e.sourceField?i.source=t[e.sourceField]:n===e.targetField?i.target=t[e.targetField]:n===e.valueField?i.value=t[e.valueField]:i[n]=t[n]})),i}))}):t},zQ=function(t){var e,i;return t&&O(t)&&(null===(e=t[0])||void 0===e?void 0:e.latestData)&&t[0].latestData.length&&t[0].latestData[0]&&null!==(i=t[0].latestData[0].nodes)&&void 0!==i?i:[]},jQ=function(t){var e,i;return t&&O(t)&&(null===(e=t[0])||void 0===e?void 0:e.latestData)&&t[0].latestData.length&&t[0].latestData[0]&&null!==(i=t[0].latestData[0].links)&&void 0!==i?i:[]},HQ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments))._getDimensionData=function(e){if(!C(null==e?void 0:e.source)&&!C(null==e?void 0:e.target)){if(L(e.source)){var i=t.series.getSeriesKeys();return i[e.source]+" => "+i[e.target]}return e.source+" => "+e.target}return e.datum?e.datum[t.series.getSpec().categoryField]:e.key},t.markTooltipValueCallback=function(t){return t.value},t}return h(e,t),a(e)}(UU),NQ=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return{type:"horizontal"===t.direction?"growWidthIn":"growHeightIn",options:{overall:e?t.growFrom():e,orient:"positive"}}},UQ=function(t,e){return"fadeIn"===e?{type:"fadeIn"}:NQ(t)},VQ=function(t){return"fadeIn"===t?{type:"fadeIn"}:{type:"linkPathGrowIn"}},WQ=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"onBind",value:function(){var t,i,n;_(e,"onBind",this,3)([]),(null===(t=this.params)||void 0===t?void 0:t.diffAttrs)&&this.target.setAttributes(this.params.diffAttrs);var r=function(t,e,i){var n={x0:t.getFinalAttribute().x0,x1:t.getFinalAttribute().x1,y0:t.getFinalAttribute().y0,y1:t.getFinalAttribute().y1,thickness:t.getFinalAttribute().thickness};return{from:Object.assign({},n,{x1:n.x0,y1:n.y0}),to:n}}(this.target,this.params.options,this.params),a=r.from,o=r.to,s=null!==(n=null===(i=this.target.context)||void 0===i?void 0:i.lastAttrs)&&void 0!==n?n:a,l=this.target.getFinalAttribute();l&&Object.assign(this.target.attribute,l),this.props=o,this.propKeys=Object.keys(o).filter((function(t){return null!=o[t]})),this.animate.reSyncProps(),this.from=s,this.to=o,this.target.setAttributes(s)}},{key:"onUpdate",value:function(t,e,i){var n=this,r=this.target.attribute;this.propKeys.forEach((function(t){r[t]=n.from[t]+(n.to[t]-n.from[t])*e})),this.target.setAttributes(r)}}])}(JB),GQ=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"onBind",value:function(){var t,i,n;_(e,"onBind",this,3)([]),(null===(t=this.params)||void 0===t?void 0:t.diffAttrs)&&this.target.setAttributes(this.params.diffAttrs);var r=function(t,e,i){var n={x0:t.getFinalAttribute().x0,x1:t.getFinalAttribute().x1,y0:t.getFinalAttribute().y0,y1:t.getFinalAttribute().y1,thickness:t.getFinalAttribute().thickness};return{from:n,to:Object.assign({},n,{x1:n.x0,y1:n.y0})}}(this.target,this.params.options,this.params),a=r.from,o=r.to,s=null!==(n=null===(i=this.target.context)||void 0===i?void 0:i.lastAttrs)&&void 0!==n?n:a;this.props=o,this.propKeys=Object.keys(o).filter((function(t){return null!=o[t]})),this.animate.reSyncProps(),this.from=s,this.to=o,this.target.setAttributes(s)}},{key:"onUpdate",value:function(t,e,i){var n=this,r=this.target.attribute;this.propKeys.forEach((function(t){r[t]=n.from[t]+(n.to[t]-n.from[t])*e})),this.target.setAttributes(r)}}])}(JB),YQ=function(t,e){var i,n=null!==(i=t.curvature)&&void 0!==i?i:.5,r="number"==typeof e?t.thickness*e:t.thickness,a=t.x0,o=t.x1,s=t.y0,l=t.y1,u=a+n*(o-a),h=o+n*(a-o),c=function(t){return t};!1!==t.round&&(a=Math.round(a),o=Math.round(o),s=Math.round(s),l=Math.round(l),u=Math.round(u),h=Math.round(h),c=Math.round),"line"===t.pathType||t.pathType,"center"===t.align?(s=c(t.y0-r/2),l=c(t.y1-r/2)):"end"===t.align?(s=c(t.y0+t.thickness/2-r),l=c(t.y1+t.thickness/2-r)):(s=c(t.y0-t.thickness/2),l=c(t.y1-t.thickness/2));var d=c(s+r),v=c(l+r),f=Math.abs(o-a)>1e-6,p=t.endArrow&&f?"L".concat(o,",").concat(c(l-r/2),"L").concat(c(o+r),",").concat(c((l+v)/2),"L").concat(o,",").concat(c(v+r/2)):"",g=t.startArrow&&f?"L".concat(a,",").concat(c(d+r/2),"L").concat(c(a-r),",").concat(c((s+d)/2),"L").concat(a,",").concat(c(s-r/2)):"";return"line"===t.pathType?"M".concat(a,",").concat(s,"L").concat(o,",").concat(l).concat(p,"L").concat(o,",").concat(v,"L").concat(a,",").concat(d).concat(g,"Z"):"polyline"===t.pathType?"M".concat(a,",").concat(s,"L").concat(u,",").concat(s,"L").concat(u,",").concat(l,"L").concat(o,",").concat(l,"\n ").concat(p,"L").concat(o,",").concat(v,"L").concat(u,",").concat(v,"L").concat(u,",").concat(d,"L").concat(a,",").concat(d).concat(g,"Z"):"M".concat(a,",").concat(s,"C").concat(u,",").concat(s,",").concat(h,",").concat(l,",").concat(o,",").concat(l,"\n ").concat(p,"L").concat(o,",").concat(v,"C").concat(h,",").concat(v,",").concat(u,",").concat(d,",").concat(a,",").concat(d).concat(g,"Z")},KQ=function(t,e){var i,n=null!==(i=t.curvature)&&void 0!==i?i:.5,r="number"==typeof e?t.thickness*e:t.thickness,a=t.y0,o=t.y1,s=t.x0,l=t.x1,u=a+n*(o-a),h=o+n*(a-o),c=function(t){return t};!1!==t.round&&(c=Math.round,a=Math.round(a),o=Math.round(o),s=Math.round(s),l=Math.round(l),u=Math.round(u),h=Math.round(h)),"line"===t.pathType||t.pathType,"center"===t.align?(s=c(t.x0-r/2),l=c(t.x1-r/2)):"end"===t.align?(s=c(t.x0+t.thickness/2-r),l=c(t.x1+t.thickness/2-r)):(s=c(t.x0-t.thickness/2),l=c(t.x1-t.thickness/2));var d=c(s+r),v=c(l+r),f=Math.abs(o-a)>1e-6,p=t.endArrow&&f?"L".concat(c(l-r/2),",").concat(o,"L").concat(c((l+v)/2),",").concat(c(o+r),"L").concat(c(v+r/2),",").concat(o):"",g=t.startArrow&&f?"L".concat(c(d+r/2),",").concat(a,"L").concat(c((d+s)/2),",").concat(c(a-r),"L").concat(c(s-r/2),",").concat(a):"";return"line"===t.pathType?"M".concat(s,",").concat(a,"L").concat(l,",").concat(o).concat(p,"L").concat(v,",").concat(o,"L").concat(d,",").concat(a).concat(g,"Z"):"polyline"===t.pathType?"M".concat(s,",").concat(a,"L").concat(s,",").concat(u,"L").concat(l,",").concat(u,"L").concat(l,",").concat(o,"\n ").concat(p,"L").concat(v,",").concat(o,"L").concat(v,",").concat(u,"L").concat(d,",").concat(u,"L").concat(d,",").concat(a).concat(g,"Z"):"M".concat(s,",").concat(a,"C").concat(s,",").concat(u,",").concat(l,",").concat(h,",").concat(l,",").concat(o,"\n ").concat(p,"L").concat(v,",").concat(o,"C").concat(v,",").concat(h,",").concat(d,",").concat(u,",").concat(d,",").concat(a).concat(g,"Z")},XQ=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=e.type,t._subMarks={back:{type:"path",defaultAttributes:{zIndex:0}},front:{type:"path",defaultAttributes:{zIndex:1}}},t._positionChannels=["x0","y0","x1","y1","thickness","round","curvature","ratio","pathType","align","endArrow","startArrow","ratio"],t._channelEncoder={backgroundStyle:function(t){return{back:t}}},t._positionEncoder=function(e,i,n){var r,a,o=Object.assign(Object.assign({},n.attribute),e),s=null!==(r=o.direction)&&void 0!==r?r:null===(a=t._glyphConfig)||void 0===a?void 0:a.direction,l=["vertical","TB","BT"].includes(s)?KQ:YQ,u="number"==typeof o.ratio&&o.ratio>=0&&o.ratio<=1;return{back:{path:u?l(o,1):""},front:{path:l(o,u?o.ratio:1)}}},t}return h(e,t),a(e,[{key:"_getDefaultStyle",value:function(){return Object.assign(Object.assign({},_(e,"_getDefaultStyle",this,3)([])),{x:0,y:0,x0:0,y0:0,x1:100,y1:100,thickness:1,round:!0})}}])}(eX);XQ.type="linkPath";var qQ=Object.assign(Object.assign({},tV),{node:{name:"node",type:"rect"},link:{name:"link",type:"linkPath"}}),ZQ=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"node")}}])}(gV),JQ=function(t,e,i){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4?arguments[4]:void 0;t.runtimeStateCache||(t.runtimeStateCache={}),t.runtimeStateCache[e]=i,t.hasState(e)&&JN(t,e),ZN(t,e,n,r)},QQ=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).type=nz.sankey,e.transformerConstructor=ZQ,e._nodeLayoutZIndex=t.LayoutZIndex.Node,e._labelLayoutZIndex=t.LayoutZIndex.Label,e._viewBox=new ei,e._fillByNode=function(t){var i,n,r,a,o;if(t&&t.sourceRect&&t.targetRect)return e._fillByLink(t);var s=null===(n=null===(i=e._spec.node)||void 0===i?void 0:i.style)||void 0===n?void 0:n.fill;if(M(s))return s;if(M(e._spec.seriesField)){var l=null===(a=null===(r=e._option)||void 0===r?void 0:r.globalScale)||void 0===a?void 0:a.getScale("color"),u=(null==t?void 0:t.datum)?t.datum:t;return null==l?void 0:l.scale(null==u?void 0:u[e._spec.seriesField])}return null===(o=e._colorScale)||void 0===o?void 0:o.scale(e._getNodeNameFromData(t))},e._fillByLink=function(t){var i,n,r,a,o,s,l=null===(n=null===(i=e._spec.link)||void 0===i?void 0:i.style)||void 0===n?void 0:n.fill;if(l)return l;if(M(e._spec.seriesField)){var u=null===(r=e._nodesSeriesData.latestData)||void 0===r?void 0:r.find((function(e){return t.source===e.key})),h=null==u?void 0:u.datum,c=null===(o=null===(a=e._option)||void 0===a?void 0:a.globalScale)||void 0===o?void 0:o.getScale("color");return null==c?void 0:c.scale(null==h?void 0:h[e._spec.seriesField])}var d=L(t.source)?e.getNodeList()[t.source]:t.source;return null===(s=e._colorScale)||void 0===s?void 0:s.scale(d)},e._handleEmphasisElement=function(t){var i,n=null!==(i=e._spec.emphasis)&&void 0!==i?i:{},r=t.item;"adjacency"===n.effect?r&&t.mark===e._nodeMark?e._handleNodeAdjacencyClick(r):r&&t.mark===e._linkMark?e._handleLinkAdjacencyClick(r):e._handleClearEmpty():"related"===n.effect&&(r&&t.mark===e._nodeMark?e._handleNodeRelatedClick(r):r&&t.mark===e._linkMark?e._handleLinkRelatedClick(r):e._handleClearEmpty())},e._handleClearEmpty=function(){var i,n;if(e._needClear){var r=null===(i=e._nodeMark)||void 0===i?void 0:i.getGraphics();if(r&&r.length){var a=null===(n=e._linkMark)||void 0===n?void 0:n.getGraphics();a&&a.length&&(r.forEach((function(e){JN(e,[t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE])})),a.forEach((function(e){JN(e,[t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE])})),e._needClear=!1)}}},e._handleNodeAdjacencyClick=function(i){var n=nH(i),r=[n.key];if(e._linkMark){var a=e._linkMark.getGraphics();if(!a||!a.length)return;a.forEach((function(e,i){var a=nH(e);a.source===n.key?(r.includes(a.target)||r.push(a.target),JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),ZN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,!0)):a.target===n.key?(r.includes(a.source)||r.push(a.source),JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),ZN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,!0)):(JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),ZN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0))}))}e._nodeMark&&e._highLightElements(e._nodeMark.getGraphics(),r),e._needClear=!0},e._handleLinkAdjacencyClick=function(i){var n=nH(i),r=[n.source,n.target];if(e._linkMark){var a=e._linkMark.getGraphics();if(!a||!a.length)return;a.forEach((function(e){e===i?(JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),JQ(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:1})):(JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),ZN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0))}))}e._nodeMark&&e._highLightElements(e._nodeMark.getGraphics(),r),e._needClear=!0},e._handleNodeRelatedClick=function(i){var n,r=nH(i),a=e._nodeMark.getGraphics();if(a&&a.length){var o=e._linkMark.getGraphics();if(o&&o.length){var s=(null===(n=nH(o[0]))||void 0===n?void 0:n.parents)?"parents":"source";if("source"===s){var l=[r.key],u=[];if(o.forEach((function(t,e){var i,n,o,s,h=nH(t),c=(null==h?void 0:h.parents)?"parents":"source";if(ot(h[c]).includes(r.key)){if(u.includes(null!==(i=h.key)&&void 0!==i?i:h.index)||u.push(null!==(n=h.key)&&void 0!==n?n:h.index),l.includes(h.source)||l.push(h.source),!l.includes(h.target)){l.push(h.target);for(var d,v=a.find((function(t){return t.data[0].key===h.target})).data[0].sourceLinks,f=function(){var t=[];return{v:(v.forEach((function(e){var i,n;if(!u.includes(null!==(i=e.key)&&void 0!==i?i:e.index)&&(u.push(null!==(n=e.key)&&void 0!==n?n:e.index),!l.includes(e.target))){l.push(e.target);var r=a.find((function(t){return t.data[0].key===e.target}));t.push(r.data[0].targetLinks)}})),void(v=t))}};(null==v?void 0:v.length)>0;)if(d=f())return d.v}}else if(h.target===r.key&&(u.includes(null!==(o=h.key)&&void 0!==o?o:h.index)||u.push(null!==(s=h.key)&&void 0!==s?s:h.index),!l.includes(h.source))){l.push(h.source);for(var p,g=a.find((function(t){return t.data[0].key===h.source})).data[0].targetLinks,y=function(){var t=[];return{v:(g.forEach((function(e){var i,n;if(!u.includes(null!==(i=e.key)&&void 0!==i?i:e.index)&&(u.push(null!==(n=e.key)&&void 0!==n?n:e.index),!l.includes(e.source))){l.push(e.source);var r=a.find((function(t){return t.data[0].key===e.source}));t.push(r.data[0].targetLinks)}})),void(g=t))}};(null==g?void 0:g.length)>0;)if(p=y())return p.v}})),e._linkMark){var h=e._linkMark.getGraphics();if(!h||!h.length)return;h.forEach((function(e,i){var n,r=nH(e);u.includes(null!==(n=r.key)&&void 0!==n?n:r.index)?(JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),ZN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,!0)):(JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),ZN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0))}))}e._nodeMark&&e._highLightElements(e._nodeMark.getGraphics(),l)}else{var c=[r.key],d=r.targetLinks.reduce((function(t,e){return ot(e.datum).forEach((function(e){for(var i=e.parents,n=i.length,a=function(){var n=i[o].key,a=i[o+1]?i[o+1].key:r.key,s=e.value,l=t.find((function(t){return t.source===n&&t.target===a}));l?l.value+=s:t.push({source:n,target:a,value:s})},o=0;o<n;o++)a()})),t}),[]);o.forEach((function(e,i){var n=nH(e),a=n.datum,o=a?a.filter((function(t){return t[s].some((function(t){return t.key===r.key}))})):null,l=d.find((function(t){return t.source===n.source&&t.target===n.target}));if(o&&o.length){c.includes(n.source)||c.push(n.source),c.includes(n.target)||c.push(n.target);var u=o.reduce((function(t,e){return t+e.value}),0),h=u/n.value;return JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void JQ(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:h})}if(l)return c.includes(n.source)||c.push(n.source),c.includes(n.target)||c.push(n.target),JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void JQ(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:l.value/n.value});JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),ZN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0)})),e._nodeMark&&e._highLightElements(e._nodeMark.getGraphics(),c)}e._needClear=!0}}},e._handleLinkRelatedClick=function(i){var n=e._nodeMark.getGraphics();if(n&&n.length){var r=e._linkMark.getGraphics();if(r&&r.length){if("source"==(nH(i)?"parents":"source"))e._linkMark&&r.forEach((function(e){JN(e,[t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE])})),e._nodeMark&&n.forEach((function(e){JN(e,[t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE])}));else{var a=nH(i),o=[a.source,a.target],s=[];ot(a.datum).forEach((function(t){for(var e=t.parents,i=e.length,n=function(){var i=e[r].key,n=e[r+1].key,a=t.value,o=s.find((function(t){return t.source===i&&t.target===n}));s.push({source:e[r].key,target:e[r+1].key,value:t.value}),o?o.value+=a:s.push({source:i,target:n,value:a})},r=0;r<i-1;r++)n()})),r.forEach((function(e){var i=nH(e),n=i.datum;if(i.source===a.source&&i.target===a.target)return JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void JQ(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:1});var r=n?n.filter((function(t){var e=t.parents.map((function(t){return t.key}));return e.includes(a.source)&&e.includes(a.target)})):null;if(r&&r.length){o.includes(i.source)||o.push(i.source),o.includes(i.target)||o.push(i.target);var l=r.filter((function(t){return t.parents.some((function(e,i){var n;return e.key===a.source&&(null===(n=t.parents[i+1])||void 0===n?void 0:n.key)===a.target}))})).reduce((function(t,e){return t+e.value}),0),u=l/i.value;return JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void JQ(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:u})}var h=s.find((function(t){return t.source===i.source&&t.target===i.target}));if(h)return o.includes(i.source)||o.push(i.source),o.includes(i.target)||o.push(i.target),JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void JQ(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:h.value/i.value});JN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),ZN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0)})),e._highLightElements(n,o)}e._needClear=!0}}},e}return h(r,e),a(r,[{key:"direction",get:function(){var t;return null!==(t=this._spec.direction)&&void 0!==t?t:"horizontal"}},{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getValueField",value:function(){return this._valueField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"setAttrFromSpec",value:function(){var t;_(r,"setAttrFromSpec",this,3)([]),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:this._spec.categoryField)}},{key:"initData",value:function(){var e=this;_(r,"initData",this,3)([]);var i=this.getViewData(),n=this.getRawData();if(n&&i){fH(this._dataSet,"sankeyLayout",DQ),fH(this._dataSet,"sankeyFormat",LQ),n.transform({type:"sankeyFormat"},!1),i.transform({type:"sankeyLayout",options:function(){var t,i,n,r;return{view:function(){return{x0:e._viewBox.x1,x1:e._viewBox.x2,y0:e._viewBox.y1,y1:e._viewBox.y2}},sourceField:e._spec.sourceField,targetField:e._spec.targetField,valueField:e._spec.valueField,direction:e.direction,crossNodeAlign:e._spec.crossNodeAlign,nodeAlign:null!==(t=e._spec.nodeAlign)&&void 0!==t?t:"justify",nodeGap:null!==(i=e._spec.nodeGap)&&void 0!==i?i:8,nodeWidth:null!==(n=e._spec.nodeWidth)&&void 0!==n?n:10,linkWidth:e._spec.linkWidth,minStepWidth:e._spec.minStepWidth,minNodeHeight:null!==(r=e._spec.minNodeHeight)&&void 0!==r?r:4,maxNodeHeight:e._spec.maxNodeHeight,minLinkHeight:e._spec.minLinkHeight,maxLinkHeight:e._spec.maxLinkHeight,iterations:e._spec.iterations,nodeKey:e._spec.nodeKey,linkSortBy:e._spec.linkSortBy,nodeSortBy:e._spec.nodeSortBy,setNodeLayer:e._spec.setNodeLayer,dropIsolatedNode:e._spec.dropIsolatedNode,nodeHeight:e._spec.nodeHeight,linkHeight:e._spec.linkHeight,equalNodeHeight:e._spec.equalNodeHeight,linkOverlap:e._spec.linkOverlap,inverse:e._spec.inverse}},level:t.TransformLevel.sankeyLayout});var a=this._option.dataSet;fH(a,"sankeyNodes",zQ),fH(a,"flatten",mQ);var o=new Ko(a,{name:"sankey-node-".concat(this.id,"-data")});o.parse([this.getViewData()],{type:"dataview"}),o.transform({type:"sankeyNodes"}),o.transform({type:"flatten",options:{callback:function(t){if(t.datum){var e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}},!1),o.transform({type:"addVChartProperty",options:{beforeCall:ZU.bind(this),call:JU}},!1),this._nodesSeriesData=o,fH(a,"sankeyLinks",jQ);var s=new Ko(a,{name:"sankey-link-".concat(this.id,"-data")});s.parse([this.getViewData()],{type:"dataview"}),s.transform({type:"sankeyLinks"}),s.transform({type:"addVChartProperty",options:{beforeCall:ZU.bind(this),call:JU}},!1),this._linksSeriesData=s}}},{key:"compileData",value:function(){var t,e;_(r,"compileData",this,3)([]),null===(t=this._linkMark)||void 0===t||t.compileData(),null===(e=this._nodeMark)||void 0===e||e.compileData()}},{key:"initMark",value:function(){this._rootMark.setMarkConfig({overflow:this._spec.overflow,interactive:!!this._spec.overflow});var t=this._createMark(r.mark.node,{isSeriesMark:!0,dataView:this._nodesSeriesData});t&&(t.setMarkConfig({zIndex:this._nodeLayoutZIndex}),this._nodeMark=t);var e=this._createMark(r.mark.link,{dataView:this._linksSeriesData});e&&(this._linkMark=e)}},{key:"_buildMarkAttributeContext",value:function(){_(r,"_buildMarkAttributeContext",this,3)([]),this._markAttributeContext.valueToNode=this.valueToNode.bind(this),this._markAttributeContext.valueToLink=this.valueToLink.bind(this)}},{key:"valueToNode",value:function(t){var e=this._nodesSeriesData.latestData,i=ot(t)[0];return e&&e.find((function(t){return t.key===i}))}},{key:"valueToLink",value:function(t){var e=this._linksSeriesData.latestData,i=ot(t);return e&&e.find((function(t){return t&&t.source===i[0]&&t.target===i[1]}))}},{key:"valueToPositionX",value:function(t){var e=this.valueToNode(t);return null==e?void 0:e.x0}},{key:"valueToPositionY",value:function(t){var e=this.valueToNode(t);return null==e?void 0:e.y0}},{key:"initMarkStyle",value:function(){this._initNodeMarkStyle(),this._initLinkMarkStyle()}},{key:"_initNodeMarkStyle",value:function(){var e,i,n=this._nodeMark;n&&(this.setMarkStyle(n,{x:function(t){return t.x0},x1:function(t){return t.x1},y:function(t){return t.y0},y1:function(t){return t.y1}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Mark),this.setMarkStyle(n,{fill:null!==(i=null===(e=this._spec.node.style)||void 0===e?void 0:e.fill)&&void 0!==i?i:this._fillByNode},"normal",t.AttributeLevel.User_Mark))}},{key:"_initLinkMarkStyle",value:function(){var e,i,n=this._linkMark;n&&(n.setGlyphConfig({direction:this.direction}),this.setMarkStyle(n,{x0:function(t){return t.x0},x1:function(t){return t.x1},y0:function(t){return t.y0},y1:function(t){return t.y1},thickness:function(t){return t.thickness}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this.setMarkStyle(n,{fill:null!==(i=null===(e=this._spec.link.style)||void 0===e?void 0:e.fill)&&void 0!==i?i:this._fillByLink},"normal",t.AttributeLevel.User_Mark))}},{key:"initLabelMarkStyle",value:function(t,e){var i=this;if(t){var n=e.position;n&&n.includes("inside")?this.setMarkStyle(t,{fill:"#ffffff",text:function(t){return i._createText(t,e)},maxLineWidth:function(t){var i;return null!==(i=e.limit)&&void 0!==i?i:t.x1-t.x0}}):this.setMarkStyle(t,{fill:this._fillByNode,text:function(t){return i._createText(t,e)},maxLineWidth:e.limit}),t.setMarkConfig({zIndex:this._labelLayoutZIndex})}}},{key:"_createText",value:function(t,e){if(C(t)||C(t.datum))return"";var i=t.datum[this._spec.categoryField]||"",n=e||{},r=OU(n.formatMethod,n.formatter,i,t.datum),a=r.formatFunc,o=r.args;return a&&(i=a.apply(void 0,b(o).concat([{series:this}]))),i}},{key:"initAnimation",value:function(){var t,e,i,n,r=this,a={direction:this.direction,growFrom:function(){var t,e;return"horizontal"===r.direction?null===(t=r._xAxisHelper)||void 0===t?void 0:t.getScale(0).scale(0):null===(e=r._yAxisHelper)||void 0===e?void 0:e.getScale(0).scale(0)}},o=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._nodeMark&&this._nodeMark.setAnimationConfig(lV(null===(i=Uz.getAnimationInKey("sankeyNode"))||void 0===i?void 0:i(a,o),uV("node",this._spec,this._markAttributeContext))),this._linkMark&&this._linkMark.setAnimationConfig(lV(null===(n=Uz.getAnimationInKey("sankeyLinkPath"))||void 0===n?void 0:n(a,o),uV("link",this._spec,this._markAttributeContext)))}},{key:"initEvent",value:function(){var t,e,i;_(r,"initEvent",this,3)([]),null===(t=this._nodesSeriesData)||void 0===t||t.target.addListener("change",this.nodesSeriesDataUpdate.bind(this)),null===(e=this._linksSeriesData)||void 0===e||e.target.addListener("change",this.linksSeriesDataUpdate.bind(this));var n=null!==(i=this._spec.emphasis)&&void 0!==i?i:{};if(!0!==this._option.disableTriggerEvent&&n.enable&&("adjacency"===n.effect||"related"===n.effect)){var a="hover"===n.trigger?"pointerover":"pointerdown";this.event.on(a,{level:lH.chart},this._handleEmphasisElement)}}},{key:"nodesSeriesDataUpdate",value:function(){this._nodeMark.getData().updateData(),this._nodeList=null,this._setNodeOrdinalColorScale()}},{key:"linksSeriesDataUpdate",value:function(){this._linkMark.getData().updateData()}},{key:"_highLightElements",value:function(e,i){e&&e.length&&e.forEach((function(e){JN(e,[t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS]),i.includes(nH(e).key)?ZN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,!0):ZN(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0)}))}},{key:"initTooltip",value:function(){this._tooltipHelper=new HQ(this),this._nodeMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nodeMark),this._linkMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._linkMark)}},{key:"_setNodeOrdinalColorScale",value:function(){var t,e,i,n,r,a=null===(e=null===(t=this._option)||void 0===t?void 0:t.globalScale)||void 0===e?void 0:e.getScale("color");if(null==a?void 0:a._specified)this._colorScale=a;else{var o,s;a&&(o=a.domain(),s=a.range()),s||(s=this._getDataScheme()),o&&!C(o[0])||(o=this.getNodeList())&&o.length>10&&(s=null===(i=this._getDataScheme()[1])||void 0===i?void 0:i.scheme);var l=new _z;null===(r=(n=l.domain(o)).range)||void 0===r||r.call(n,s),this._colorScale=l}}},{key:"getNodeList",value:function(){var t,e,i=this;if(this._nodeList)return this._nodeList;var n=this._rawData.latestData[0],r=(null==n?void 0:n.nodes)?(null===(t=n.nodes[0])||void 0===t?void 0:t.children)?Array.from(this.extractNamesFromTree(n.nodes,this._spec.categoryField)):n.nodes.map((function(t,e){return t[i._spec.categoryField]})):(null==n?void 0:n.links)?Array.from(this.extractNamesFromLink(n.links)):null===(e=null==n?void 0:n.values)||void 0===e?void 0:e.map((function(t,e){return t[i._spec.categoryField]}));return this._nodeList=r,r}},{key:"_getNodeNameFromData",value:function(t){var e;return(null==t?void 0:t.datum)?t.datum[this._spec.categoryField]:null!==(e=t.key)&&void 0!==e?e:t[this._spec.categoryField]}},{key:"extractNamesFromTree",value:function(t,e){var i=this,n=new Set;return t.forEach((function(t){n.add(t[e]),t.children&&i.extractNamesFromTree(t.children,e).forEach((function(t){return n.add(t)}))})),n}},{key:"extractNamesFromLink",value:function(t){var e=new Set,i=this._spec,n=i.sourceField,r=i.targetField;return t.forEach((function(t){M(t[n])&&e.add(t[n]),M(t[r])&&e.add(t[r])})),e}},{key:"getDimensionField",value:function(){return[this._spec.categoryField]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"getRawDataStatisticsByField",value:function(t,e){var i;return this._rawStatisticsCache||(this._rawStatisticsCache={}),this._rawStatisticsCache[t]||(this._viewDataStatistics&&this.getViewData().transformsArr.length<=1&&(null===(i=this._viewDataStatistics.latestData)||void 0===i?void 0:i[t])?this._rawStatisticsCache[t]=this._viewDataStatistics.latestData[t]:this._rawData&&(this._rawStatisticsCache[t]={values:this._collectByField(t)})),this._rawStatisticsCache[t]}},{key:"_collectByField",value:function(t){var e,i,n,r=this,a=[],o=null===(i=null===(e=this.getRawData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i[0];if(!o)return[];if(o.links)(null===(n=o.nodes)||void 0===n?void 0:n.length)&&o.nodes.forEach((function(t){t[r._seriesField]&&a.push(t[r._seriesField])}));else if(o.nodes){var s=new Set;return RQ(s,o.nodes,this._seriesField),Array.from(s)}return a}},{key:"onLayoutEnd",value:function(){_(r,"onLayoutEnd",this,3)([]),this._viewBox.set(0,0,this._region.getLayoutRect().width,this._region.getLayoutRect().height),this.getViewData().reRunAllTransform()}},{key:"getDefaultShapeType",value:function(){return"square"}},{key:"_noAnimationDataKey",value:function(t,e){}},{key:"getActiveMarks",value:function(){return[this._nodeMark,this._linkMark]}},{key:"getMarkData",value:function(t){return t.datum?O(t.datum)?t.datum[t.datum.length-1]:t.datum:t}}])}(MV);QQ.type=nz.sankey,QQ.transformerConstructor=ZQ,QQ.mark=qQ,QQ.builtInTheme={sankey:{link:{style:{fillOpacity:.15,round:!0}}}};var $Q=function(){DY(),iX(),hw(),Uz.registerGraphicComponent("path",(function(t){return bp(t)})),Uz.registerMark(XQ.type,XQ),kX(),Uz.registerAnimation("sankeyNode",(function(t,e){return Object.assign({appear:UQ(t,e)},uU)})),Uz.registerAnimation("sankeyLinkPath",(function(t,e){return{appear:VQ(e),enter:{type:"linkPathGrowIn"},exit:{type:"linkPathGrowOut"},disappear:{duration:sU.disappear.duration}}})),hP.registerBuiltInAnimate("linkPathGrowOut",GQ),hP.registerBuiltInAnimate("linkPathGrowIn",WQ),cU(),Uz.registerSeries(QQ.type,QQ)},t$=function(t,e){var i={},n=e.fields;if(A(n)&&(n=n()),!(null==n?void 0:n.length)||!(null==t?void 0:t.length))return i;if(!t[0].latestData)return i;var r=t[0].latestData,a=mQ(r);return i=WU([{latestData:a}],e)},e$=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).markTooltipKeyCallback=function(e){var i,n;return null===(n=null===(i=t.series)||void 0===i?void 0:i.getMarkData(e))||void 0===n?void 0:n[t.series.getDimensionField()[0]]},t.markTooltipValueCallback=function(e){var i,n,r=t._seriesCacheInfo.measureFields,a=null===(i=t.series)||void 0===i?void 0:i.getMarkData(e);if(r[0]&&a)return null!==(n=a[r[0]])&&void 0!==n?n:e.value},t.dimensionTooltipTitleCallback=function(e){var i,n=t._seriesCacheInfo.dimensionFields,r=null===(i=t.series)||void 0===i?void 0:i.getMarkData(e);if(n[0]&&r)return r[n[0]]},t}return h(e,t),a(e,[{key:"defaultShapeType",get:function(){return"square"}}])}(UU),i$=Object.assign(Object.assign({},tV),{nonLeaf:{name:"nonLeaf",type:"rect"},leaf:{name:"leaf",type:"rect"},nonLeafLabel:{name:"nonLeafLabel",type:"text"}}),n$=function(t){return"fadeIn"===t?{type:"fadeIn"}:{type:"growCenterIn"}},r$=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"nonLeaf","nonLeafLabel","initNonLeafLabelMarkStyle"),this._addMarkLabelSpec(t,"leaf")}}])}(gV),a$=function(t,e){var i=A(e)?e():e,n=i.getViewBox();if(n){var r=new tJ(i).layout(t,n),a=[];return xZ(r,a,{maxDepth:null==i?void 0:i.maxDepth}),a.forEach((function(t){t&&[XU,"name"].forEach((function(e){t[e]=t.datum[t.depth][i.nameField]}))})),a}return[]},o$=function(r){function o(){var t;return n(this,o),(t=i(this,o,arguments)).type=nz.treemap,t.transformerConstructor=r$,t._categoryField="name",t._valueField="value",t._viewBox=new ei,t._enableAnimationHook=t.enableMarkAnimation.bind(e(t)),t.isHierarchyData=function(){return!0},t}return h(o,r),a(o,[{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getValueField",value:function(){return this._valueField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"setAttrFromSpec",value:function(){var t,e=this;_(o,"setAttrFromSpec",this,3)([]),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:XU),this._spec.roam&&(this.initZoomable(this.event,this._option.mode),this._matrix=new ri),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:function(){var t,i;return null!==(i=null!==(t=e._spec.drillField)&&void 0!==t?t:e._categoryField)&&void 0!==i?i:yj},getRawData:function(){return e.getRawData()}}),F(this._spec.maxDepth)&&(this._maxDepth=this._spec.maxDepth-1)}},{key:"initData",value:function(){var t,e=this;_(o,"initData",this,3)([]),fH(this._dataSet,"treemap",a$),null===(t=this._data.getDataView())||void 0===t||t.transform({type:"treemap",options:function(){var t,i,n,r;return{nameField:e._categoryField,valueField:e._valueField,getViewBox:function(){return e._viewBox.empty()?null:{x0:e._viewBox.x1,x1:e._viewBox.x2,y0:e._viewBox.y1,y1:e._viewBox.y2}},maxDepth:e._maxDepth,gapWidth:e._spec.gapWidth,padding:e._spec.nodePadding,splitType:e._spec.splitType,aspectRatio:e._spec.aspectRatio,labelPadding:(null===(t=e._spec.nonLeafLabel)||void 0===t?void 0:t.visible)?null===(i=e._spec.nonLeafLabel)||void 0===i?void 0:i.padding:0,labelPosition:null===(n=e._spec.nonLeafLabel)||void 0===n?void 0:n.position,minVisibleArea:null!==(r=e._spec.minVisibleArea)&&void 0!==r?r:10,minChildrenVisibleArea:e._spec.minChildrenVisibleArea,minChildrenVisibleSize:e._spec.minChildrenVisibleSize}}}),this.getViewData()&&this._spec.drill&&this.initDrillableData(this._dataSet)}},{key:"_runTreemapTransform",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._data.getDataView().reRunAllTransform(),t&&this.getCompiler().renderNextTick()}},{key:"_addDataIndexAndKey",value:function(){var t;(null===(t=this._rawData)||void 0===t?void 0:t.dataSet)&&(fH(this._rawData.dataSet,"addVChartProperty",LU),this._rawData.transform({type:"addVChartProperty",options:{beforeCall:QU.bind(this),call:$U}}))}},{key:"getRawDataStatisticsByField",value:function(t,e){var i;if(this._rawStatisticsCache||(this._rawStatisticsCache={}),!this._rawStatisticsCache[t]&&this._rawData){var n=t$([this._rawData],{fields:[{key:t,operations:e?["min","max"]:["values"]}]})[t];this._rawStatisticsCache[t]=Q(null!==(i=this._rawStatisticsCache[t])&&void 0!==i?i:{},n)}return this._rawStatisticsCache[t]}},{key:"_createHierarchyDataStatistics",value:function(t,e){var i=this;fH(this._dataSet,"hierarchyDimensionStatistics",t$),fH(this._dataSet,"flatten",mQ);var n=new Ko(this._dataSet,{name:t});return n.parse(e,{type:"dataview"}),n.transform({type:"hierarchyDimensionStatistics",options:{fields:function(){var t=i.getStatisticFields();return i._seriesField&&i._seriesField!==i._categoryField&&t.push({key:i._seriesField,operations:["values"]}),t}}},!1),n}},{key:"getStatisticFields",value:function(){return AQ(_(o,"getStatisticFields",this,3)([]),this._categoryField,this._valueField)}},{key:"initMark",value:function(){var t=this,e=this._createMark(o.mark.nonLeaf,{isSeriesMark:!0});e&&(e.setTransform([{type:"filter",callback:function(e){return!t._shouldFilterElement(e,"nonLeaf")}}]),this._nonLeafMark=e);var i=this._createMark(o.mark.leaf,{isSeriesMark:!0});i&&(i.setTransform([{type:"filter",callback:function(e){return!t._shouldFilterElement(e,"leaf")}}]),this._leafMark=i)}},{key:"initMarkStyle",value:function(){this._initLeafMarkStyle(),this._initNonLeafMarkStyle()}},{key:"_initLeafMarkStyle",value:function(){this._leafMark&&this.setMarkStyle(this._leafMark,{x:function(t){return t.x0},y:function(t){return t.y0},x1:function(t){return t.x1},y1:function(t){return t.y1},fill:this.getColorAttribute()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"_initNonLeafMarkStyle",value:function(){this._nonLeafMark&&this.setMarkStyle(this._nonLeafMark,{x:function(t){return t.x0},y:function(t){return t.y0},x1:function(t){return t.x1},y1:function(t){return t.y1},fill:this.getColorAttribute()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"_initRichStyleOfLabelMark",value:function(e){"rich"===e.getTextType()&&this.setMarkStyle(e,{maxWidth:function(t){return Math.abs(t.x0-t.x1)},maxHeight:function(t){return Math.abs(t.y0-t.y1)},ellipsis:!0},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"initLabelMarkStyle",value:function(e){var i=this;e&&(this._labelMark=e,e.setRule("treemap"),this.setMarkStyle(e,{x:function(t){return(t.x0+t.x1)/2},y:function(t){return(t.y0+t.y1)/2},text:function(t){var e;return null===(e=t.datum[t.depth])||void 0===e?void 0:e[i.getDimensionField()[0]]},maxLineWidth:function(t){return t.x1===t.x0?Number.MIN_VALUE:t.x1-t.x0}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this._initRichStyleOfLabelMark(e))}},{key:"initNonLeafLabelMarkStyle",value:function(e){var i=this;e&&(this._nonLeafLabelMark=e,e.setRule("treemap"),this.setMarkStyle(e,{x:function(t){return t.labelRect?(t.labelRect.x0+t.labelRect.x1)/2:(t.x0+t.x1)/2},y:function(t){return t.labelRect?(t.labelRect.y0+t.labelRect.y1)/2:(t.y0+t.y1)/2},text:function(t){var e;return null===(e=t.datum[t.depth])||void 0===e?void 0:e[i.getDimensionField()[0]]},maxLineWidth:function(t){return t.x1===t.x0?Number.MIN_VALUE:t.x1-t.x0}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this._initRichStyleOfLabelMark(e))}},{key:"initAnimation",value:function(){var t=this;this.getMarksInType("rect").forEach((function(e){var i;e.setAnimationConfig(lV(null===(i=Uz.getAnimationInKey("treemap"))||void 0===i?void 0:i(),uV(e.name,t._spec,t._markAttributeContext)))}))}},{key:"initEvent",value:function(){var t=this;_(o,"initEvent",this,3)([]),this._spec.roam&&(this.initDragEventOfSeries(this),this.event.on("panmove",(function(e){t.handlePan(e)})),this.initZoomEventOfSeries(this),this.event.on("zoom",(function(e){t.handleZoom(e)}))),this._spec.drill&&this.bindDrillEvent()}},{key:"_getDataIdKey",value:function(){return"key"}},{key:"initTooltip",value:function(){this._tooltipHelper=new e$(this),this._leafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._leafMark),this._nonLeafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nonLeafMark)}},{key:"_shouldFilterElement",value:function(t,e){var i=t.isLeaf;return"leaf"===e?!i:i}},{key:"handlePan",value:function(t){var e=t.delta;if(0!==e[0]||0!==e[1]){this._matrix.reset(),this._matrix.translate(e[0],e[1]);var i=this._matrix,n=i.a,r=i.b,a=i.c,o=i.d,s=i.e,l=i.f;this._matrix.multiply(n,r,a,o,s,l),this._viewBox.transformWithMatrix(this._matrix),this._runTreemapTransform(!0)}}},{key:"handleZoom",value:function(t){var e=t.scale,i=t.scaleCenter;if(1!==e){this._matrix.reset();var n=i.x,r=i.y;this._matrix.translate(n,r),this._matrix.scale(e,e),this._matrix.translate(-n,-r);var a=this._matrix,o=a.a,s=a.b,l=a.c,u=a.d,h=a.e,c=a.f;this._matrix.multiply(o,s,l,u,h,c),this.disableMarkAnimation(),this.event.on(eH.AFTER_DO_RENDER,this._enableAnimationHook),this._viewBox.transformWithMatrix(this._matrix),this._runTreemapTransform(!0)}}},{key:"getDimensionField",value:function(){return[this._categoryField]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"onLayoutEnd",value:function(){_(o,"onLayoutEnd",this,3)([]),this._viewBox.set(0,0,this.getLayoutRect().width,this.getLayoutRect().height),this._runTreemapTransform()}},{key:"enableMarkAnimation",value:function(){this.getMarks().forEach((function(t){})),[this._labelMark,this._nonLeafLabelMark].forEach((function(t){t&&t.getComponent()&&t.getComponent().getProduct().enableAnimation()})),this.event.off(eH.AFTER_DO_RENDER,this._enableAnimationHook)}},{key:"disableMarkAnimation",value:function(){this.getMarks().forEach((function(t){})),[this._labelMark,this._nonLeafLabelMark].forEach((function(t){t&&t.getComponent()&&t.getComponent().getProduct().disableAnimation()}))}},{key:"getDefaultShapeType",value:function(){return"square"}},{key:"getActiveMarks",value:function(){return[this._nonLeafMark,this._leafMark]}},{key:"getMarkData",value:function(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}])}(MV);o$.type=nz.treemap,o$.mark=i$,o$.builtInTheme={treemap:{gapWidth:1,nodePadding:[5],nonLeaf:{visible:!1,style:{fillOpacity:.5}},label:{style:{fill:"white",textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}},nonLeafLabel:{padding:24,style:{fill:"black",stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},textBaseline:"middle",textAlign:"center"}}}},o$.transformerConstructor=r$,at(o$,xQ),at(o$,gK);var s$=function(){Uz.registerGrammarTransform("filter",{transform:function(t,e){return null==e?void 0:e.filter(t.callback)}}),Uz.registerGrammarTransform("map",{transform:function(t,e){return null==e||e.forEach((function(e,i){t.callback(e)})),e}}),DY(),kX(),Uz.registerAnimation("treemap",(function(t,e){return{appear:n$(e),enter:{type:"growCenterIn"},exit:{type:"growCenterOut"},disappear:{duration:sU.disappear.duration}}})),cU(),Uz.registerSeries(o$.type,o$)},l$=Object.assign(Object.assign({},Uq),{segment:{name:"segment",type:"arc"},track:{name:"track",type:"arc"}}),u$=Object.assign(Object.assign({},tV),{pin:{name:"pin",type:"path"},pinBackground:{name:"pinBackground",type:"path"},pointer:{name:"pointer",type:["path","rect"]}}),h$={type:"fadeIn"};function c$(t,e){return"fadeIn"===e?h$:function(t){return{channel:{angle:{from:t.startAngle+Math.PI/2}}}}(t)}var d$=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments))._supportStack=!1,t}return h(e,t),a(e)}(gV),v$=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"enableByType",value:function(t){return"dimension"!==t}}])}(UU),f$="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",p$={pointer:{type:"path",width:.4,height:.4,style:{path:"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"}},pin:{width:.025,height:.025,style:{path:f$,fill:"#888"}},pinBackground:{width:.06,height:.06,style:{path:f$,fill:"#ddd"}}},g$=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=nz.gaugePointer,t.transformerConstructor=d$,t._pinMark=null,t._pointerMark=null,t._pinBackgroundMark=null,t}return h(e,t),a(e,[{key:"setAttrFromSpec",value:function(){var t;_(e,"setAttrFromSpec",this,3)([]),this.setRadiusField(this._spec.radiusField),this._pointerType="rect"===(null===(t=this._spec.pointer)||void 0===t?void 0:t.type)?"rect":"path"}},{key:"initMark",value:function(){this._pinBackgroundMark=this._createMark(e.mark.pinBackground),this._pointerMark=this._createMark(Object.assign(Object.assign({},e.mark.pointer),{type:this._pointerType}),{isSeriesMark:!0}),this._pinMark=this._createMark(e.mark.pin)}},{key:"initMarkStyle",value:function(){this.initPinBackgroundMarkStyle(),this.initPointerMarkStyle(),this.initPinMarkStyle()}},{key:"initGroups",value:function(){}},{key:"initPointerMarkStyle",value:function(){var t=this,e=this._pointerMark,i=this._spec.pointer;e&&(this.setMarkStyle(e,{x:function(e){var n,r;return t._getPointerAnchor(e,i).x-t._getPointerWidth()*(null!==(r=null===(n=null==i?void 0:i.center)||void 0===n?void 0:n[0])&&void 0!==r?r:0)},y:function(e){var n,r;return t._getPointerAnchor(e,i).y-t._getPointerHeight(e)*(null!==(r=null===(n=null==i?void 0:i.center)||void 0===n?void 0:n[1])&&void 0!==r?r:0)},anchor:function(e){var n=t._getPointerAnchor(e,i);return[n.x,n.y]},fill:this.getColorAttribute(),zIndex:200}),"path"===this._pointerType?this.setMarkStyle(e,{scaleX:this._getPointerWidth.bind(this),scaleY:this._getPointerHeight.bind(this),angle:function(e){return t._getPointerAngle(e)+Math.PI/2}}):this.setMarkStyle(e,{width:this._getPointerWidth.bind(this),height:this._getPointerHeight.bind(this),angle:function(e){return t._getPointerAngle(e)-Math.PI/2}}))}},{key:"initTooltip",value:function(){this._tooltipHelper=new v$(this),this._pointerMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pointerMark)}},{key:"_getPointerAnchor",value:function(t,e){var i;return null===(i=e.isOnCenter)||void 0===i||i?this.angleAxisHelper.center():this.radiusAxisHelper.coordToPoint({radius:this._innerRadius*this._computeLayoutRadius(),angle:this.angleAxisHelper.dataToPosition([t[this._angleField[0]]])})}},{key:"_getPointerWidth",value:function(){return this._spec.pointer.width*this._computeLayoutRadius()}},{key:"_getPointerHeight",value:function(t){var e,i,n=this._spec.pointer,r=this._radiusField[0];return M(this.radiusAxisHelper)&&M(r)?this.radiusAxisHelper.dataToPosition([t[r]])-(null!==(e=null==n?void 0:n.innerPadding)&&void 0!==e?e:0)-(null!==(i=null==n?void 0:n.outerPadding)&&void 0!==i?i:10):n.height*this._computeLayoutRadius()}},{key:"_getPointerAngle",value:function(t){var e=this.angleAxisHelper.getScale().domain(),i=lt(e),n=ut(e),r=Pt(t[this._angleField[0]],n,i);return this.angleAxisHelper.dataToPosition([r])}},{key:"_getRotatedPointerCenterOffset",value:function(t){var e,i,n,r,a=this._spec.pointer,o=this._getPointerWidth()*(null!==(i=null===(e=null==a?void 0:a.center)||void 0===e?void 0:e[0])&&void 0!==i?i:0),s=-this._getPointerHeight(t)*(null!==(r=null===(n=null==a?void 0:a.center)||void 0===n?void 0:n[1])&&void 0!==r?r:0),l=this._getPointerAngle(t)-Math.PI/2,u=Math.cos(l),h=Math.sin(l);return{x:o*u+s*h,y:-(s*u-o*h)}}},{key:"initPinBackgroundMarkStyle",value:function(){var t=this,e=this._pinBackgroundMark,i=this._spec.pinBackground;e&&this.setMarkStyle(e,{x:function(e){return t._getPointerAnchor(e,i).x},y:function(e){return t._getPointerAnchor(e,i).y},scaleX:function(){return i.width*t._computeLayoutRadius()},scaleY:function(){return i.height*t._computeLayoutRadius()},fill:this.getColorAttribute(),zIndex:100})}},{key:"initPinMarkStyle",value:function(){var t=this,e=this._pinMark,i=this._spec.pin;e&&this.setMarkStyle(e,{x:function(e){return t._getPointerAnchor(e,i).x},y:function(e){return t._getPointerAnchor(e,i).y},scaleX:function(){return i.width*t._computeLayoutRadius()},scaleY:function(){return i.height*t._computeLayoutRadius()},fill:this.getColorAttribute(),zIndex:300})}},{key:"getInteractionTriggers",value:function(){return this._parseInteractionConfig(this._pointerMark?[this._pointerMark]:[])}},{key:"initAnimation",value:function(){var t,e,i,n=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._pointerMark.setAnimationConfig(lV(null===(i=Uz.getAnimationInKey("gaugePointer"))||void 0===i?void 0:i({startAngle:this._startAngle},n),uV("pointer",this._spec,this._markAttributeContext)))}},{key:"getDefaultShapeType",value:function(){return"circle"}},{key:"getActiveMarks",value:function(){return[]}}])}(Wq);g$.type=nz.gaugePointer,g$.mark=u$,g$.builtInTheme={gaugePointer:p$},g$.transformerConstructor=d$;var y$=function(){Uz.registerSeries(g$.type,g$),uK(),DY(),Uz.registerAnimation("gaugePointer",(function(t,e){var i=c$(t,e);return{appear:i,enter:i,disappear:{duration:sU.disappear.duration}}})),_q(),yq()},m$=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments))._supportStack=!1,t}return h(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"segment")}}])}(gV),_$=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=nz.gauge,t.transformerConstructor=m$,t._segmentMark=null,t._trackMark=null,t._padAngle=0,t}return h(r,e),a(r,[{key:"setAttrFromSpec",value:function(){var t;_(r,"setAttrFromSpec",this,3)([]),this._padAngle=be(null!==(t=this._spec.padAngle)&&void 0!==t?t:0)}},{key:"initData",value:function(){var t,e=this;_(r,"initData",this,3)([]),fH(this._option.dataSet,"spiltSegment",(function(t,i){var n=t.slice();return n.sort((function(t,i){return t[e._angleField[0]]-i[e._angleField[0]]})),n.forEach((function(t,i){t[Dj]=t[e._angleField[0]],t[Lj]=i>0?n[i-1][Dj]:void 0})),n})),null===(t=this.getViewData())||void 0===t||t.transform({type:"spiltSegment"},!1)}},{key:"initMark",value:function(){_(r,"initMark",this,3)([]),this._trackMark=this._createMark(r.mark.track,{parent:this._arcGroupMark,dataView:!1}),this._segmentMark=this._createMark(r.mark.segment,{parent:this._arcGroupMark,isSeriesMark:!0})}},{key:"initMarkStyle",value:function(){_(r,"initMarkStyle",this,3)([]),this.initTrackMarkStyle(),this.initSegmentMarkStyle()}},{key:"initSegmentMarkStyle",value:function(){var t,e=this,i=this._segmentMark;i&&this.setMarkStyle(i,{x:function(){return e.angleAxisHelper.center().x},y:function(){return e.angleAxisHelper.center().y},startAngle:this._getAngleValueStart.bind(this),endAngle:this._getAngleValueEnd.bind(this),innerRadius:function(){var t;return e._computeLayoutRadius()*(null!==(t=e._spec.innerRadius)&&void 0!==t?t:0)},outerRadius:function(){var t,i;return e._computeLayoutRadius()*(null!==(i=null!==(t=e._spec.radius)&&void 0!==t?t:e._spec.outerRadius)&&void 0!==i?i:1)},cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute(),zIndex:200,forceShowCap:!0})}},{key:"generateRadiusStyle",value:function(t){var e=this;if(t){var i={};return t.outerRadius&&(i.outerRadius=function(){return e._computeLayoutRadius()*t.outerRadius}),t.innerRadius&&(i.innerRadius=function(){return e._computeLayoutRadius()*t.innerRadius}),i}}},{key:"initMarkStyleWithSpec",value:function(e,i){if(_(r,"initMarkStyleWithSpec",this,3)([e,i]),e&&"segment"===e.name){var n=this.getSpec().segment;if(n)for(var a in n.state||{})this.setMarkStyle(e,this.generateRadiusStyle(n.state[a]),a,t.AttributeLevel.User_Mark)}}},{key:"initTooltip",value:function(){_(r,"initTooltip",this,3)([]),this._segmentMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._segmentMark)}},{key:"initTrackMarkStyle",value:function(){var t,e=this,i=this._trackMark;i&&this.setMarkStyle(i,{x:function(){return e.angleAxisHelper.center().x},y:function(){return e.angleAxisHelper.center().y},startAngle:this._startAngle,endAngle:this._endAngle,innerRadius:function(){var t;return e._computeLayoutRadius()*(null!==(t=e._spec.innerRadius)&&void 0!==t?t:0)},outerRadius:function(){var t,i;return e._computeLayoutRadius()*(null!==(i=null!==(t=e._spec.radius)&&void 0!==t?t:e._spec.outerRadius)&&void 0!==i?i:1)},cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,zIndex:100})}},{key:"_getAngleValueStartWithoutMask",value:function(t){var e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t),n=It(e,(e+i)/2)(e+(i>e?1:-1)*Math.abs(this._padAngle/2));return this._spec.clamp?xz(n,this.angleAxisHelper.getScale(0)):n}},{key:"_getAngleValueEndWithoutMask",value:function(t){var e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t),n=It(i,(e+i)/2)(i-(i>e?1:-1)*Math.abs(this._padAngle/2));return this._spec.clamp?xz(n,this.angleAxisHelper.getScale(0)):n}},{key:"_getAngleValueStartWithoutPadAngle",value:function(t){return M(t[Lj])?this.angleAxisHelper.dataToPosition([t[Lj]]):this._startAngle}},{key:"_getAngleValueEndWithoutPadAngle",value:function(t){return this.angleAxisHelper.dataToPosition([t[Dj]])}},{key:"initAnimation",value:function(){var t,e,i,n=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._segmentMark.setAnimationConfig(lV(null===(i=Uz.getAnimationInKey("circularProgress"))||void 0===i?void 0:i({startAngle:this._startAngle},n),uV("segment",this._spec,this._markAttributeContext)))}},{key:"getDefaultShapeType",value:function(){return"circle"}},{key:"getActiveMarks",value:function(){return[]}}])}(Wq);_$.type=nz.gauge,_$.mark=l$,_$.builtInTheme={gauge:{outerRadius:.8,innerRadius:.6,padAngle:1.146,segment:{style:{fillOpacity:1}},tickMask:{visible:!1,angle:3,offsetAngle:0,forceAlign:!0}}},_$.transformerConstructor=m$;var b$=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=e.type,t}return h(e,t),a(e,[{key:"_getDefaultStyle",value:function(){return Object.assign(Object.assign({},_(e,"_getDefaultStyle",this,3)([])),{fill:void 0,lineWidth:0,padding:0})}},{key:"_createGraphic",value:function(){return Of(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}},{key:"_transformGraphicAttributes",value:function(t,i,n){var r,a,o,s=_(e,"_transformGraphicAttributes",this,3)([t,i,n]),l=null!==(a=null!==(r=s.shape)&&void 0!==r?r:s.symbolType)&&void 0!==a?a:null===(o=t.attribute)||void 0===o?void 0:o.symbolType;return C(l)?s.symbolType="rect":s.symbolType=l,s}}])}($N);function k$(t){return!1===t?{}:{type:"fadeIn"}}b$.type="cell";var x$=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"enableByType",value:function(t){return"dimension"!==t}}])}(UU),S$=Object.assign(Object.assign({},tV),{cell:{name:"cell",type:"cell"},cellBackground:{name:"cellBackground",type:"cell"}}),A$=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"cell")}}])}(gV),C$={valueField:!0},M$=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=nz.heatmap,t.transformerConstructor=A$,t}return h(r,e),a(r,[{key:"getFieldValue",value:function(){return this._fieldValue}},{key:"setFieldValue",value:function(t){this._fieldValue=ot(t)}},{key:"_getSpecUpdatePolicy",value:function(){var t=_(r,"_getSpecUpdatePolicy",this,3)([]);return Object.assign(Object.assign({},t),{dataRelatedKeys:Object.assign(Object.assign({},t.dataRelatedKeys),C$)})}},{key:"setAttrFromSpec",value:function(){_(r,"setAttrFromSpec",this,3)([]),this.setFieldValue(this._spec.valueField)}},{key:"initMark",value:function(){this._cellMark=this._createMark(r.mark.cell,{isSeriesMark:!0},{morph:dV(this._spec,r.mark.cell.name),morphElementKey:this.getDimensionField()[0]}),this._backgroundMark=this._createMark(r.mark.cellBackground)}},{key:"initMarkStyle",value:function(){this.initCellMarkStyle(),this.initCellBackgroundMarkStyle()}},{key:"initLabelMarkStyle",value:function(t){var e,i,n,r=this;t&&this.setMarkStyle(t,{fill:null!==(n=null===(i=null===(e=this._spec.cell)||void 0===e?void 0:e.style)||void 0===i?void 0:i.fill)&&void 0!==n?n:this.getColorAttribute(),text:function(t){return t[r.getMeasureField()[0]]}})}},{key:"initCellMarkStyle",value:function(){var e=this;this.setMarkStyle(this._cellMark,{x:function(t){return e.dataToPositionX(t)},y:function(t){return e.dataToPositionY(t)},size:function(){return[e.getCellSize(e._xAxisHelper),e.getCellSize(e._yAxisHelper)]},fill:this.getColorAttribute()},"normal",t.AttributeLevel.Series)}},{key:"initCellBackgroundMarkStyle",value:function(){var e,i,n,r=this,a=bi(null!==(n=null===(i=null===(e=this._spec.cellBackground)||void 0===e?void 0:e.style)||void 0===i?void 0:i.padding)&&void 0!==n?n:0);this.setMarkStyle(this._backgroundMark,{x:function(t){var e=r.getCellSize(r._xAxisHelper);return r.dataToPositionX(t)-e/2+a[3]},y:function(t){var e=r.getCellSize(r._yAxisHelper);return r.dataToPositionY(t)-e/2+a[0]},width:function(){return r.getCellSize(r._xAxisHelper)-a[1]-a[3]},height:function(){return r.getCellSize(r._yAxisHelper)-a[0]-a[2]}},"normal",t.AttributeLevel.Series)}},{key:"getColorAttribute",value:function(){var t;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this._getDefaultColorScale(),field:this.getFieldValue()[0]}}},{key:"getInteractionTriggers",value:function(){return this._parseInteractionConfig(this._cellMark?[this._cellMark]:[])}},{key:"initAnimation",value:function(){var t,e,i,n=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset,r=CV(this);this._cellMark.setAnimationConfig(lV(null===(i=Uz.getAnimationInKey("heatmap"))||void 0===i?void 0:i(n),uV("cell",this._spec,this._markAttributeContext),r))}},{key:"getCellSize",value:function(t){var e,i;return null!==(i=null===(e=t.getBandwidth)||void 0===e?void 0:e.call(t,0))&&void 0!==i?i:6}},{key:"initTooltip",value:function(){this._tooltipHelper=new x$(this),this._cellMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._cellMark)}},{key:"getDefaultShapeType",value:function(){return"rect"}},{key:"getDimensionField",value:function(){return[].concat(this.fieldX,this.fieldY)}},{key:"getMeasureField",value:function(){return this.getFieldValue()}},{key:"getActiveMarks",value:function(){return[this._cellMark]}}])}(MV);M$.type=nz.heatmap,M$.mark=S$,M$.builtInTheme={heatmap:{cell:{style:{shape:"rect",fillOpacity:1}},cellBackground:{visible:!1},label:{style:{lineWidth:2}}}},M$.transformerConstructor=A$;var T$=function(){kX(),Uz.registerMark(b$.type,b$),Uz.registerGraphicComponent("symbol",Of),xw(),Aw(),bL(),Uz.registerAnimation("heatmap",(function(t,e){return Object.assign(Object.assign({},uU),{appear:k$(e)})})),uG(),aG(),Uz.registerSeries(M$.type,M$)},w$=Object.assign(Object.assign({},tV),{nodePoint:{name:"nodePoint",type:"symbol"},ripplePoint:{name:"ripplePoint",type:"ripple"},centerPoint:{name:"centerPoint",type:"symbol"},centerLabel:{name:"centerLabel",type:"text"}}),E$="".concat(dj,"_CORRELATION_X"),B$="".concat(dj,"_CORRELATION_Y"),P$="".concat(dj,"_CORRELATION_SIZE"),O$=function(t){return A(t)?t():t},I$=function(t,e){var i,n,r,a,o,l,u,h;if(!t||!(null==e?void 0:e.view)||!O(t))return t;var c=t,d=e.view();if(d.x1-d.x0==0||d.y1-d.y0==0||d.x1-d.x0==-1/0||d.x1-d.x0==1/0||d.y1-d.y0==-1/0||d.y1-d.y0==1/0)return t;var v=be(null!==(i=O$(e.startAngle))&&void 0!==i?i:-90),f=be(null!==(n=O$(e.endAngle))&&void 0!==n?n:270),p=Math.max((d.x1-d.x0)/2,(d.y1-d.y0)/2),g=Gt(null!==(r=O$(e.innerRadius))&&void 0!==r?r:0,p),y=Gt(O$(e.outerRadius),p),_=O$(e.center),b=[L(null==_?void 0:_[0])?_[0]:d.x0+Gt(null!==(a=null==_?void 0:_[0])&&void 0!==a?a:"50%",d.x1-d.x0),L(null==_?void 0:_[1])?_[1]:d.y0+Gt(null!==(o=null==_?void 0:_[1])&&void 0!==o?o:"50%",d.y1-d.y0)],k=Wt(O$(e.field)),x=c.map(k),S=m(Kt(x),2),A=S[0],M=S[1],T=A===M?function(t){return(g+y)/2}:function(t){return g+(y-g)*(t-A)/(M-A)},w=O$(e.radiusField),E=O$(e.radiusRange),B=C(w)?k:Wt(w),P=null!==(l=null==E?void 0:E[1])&&void 0!==l?l:5,I=function(t){return P};if(B){var R=m(B!==k?Kt(c.map(B)):[A,M],2),D=R[0],F=R[1],z=null!==(u=null==E?void 0:E[0])&&void 0!==u?u:5,j=null!==(h=null==E?void 0:E[1])&&void 0!==h?h:5;D!==F&&(I=function(t){return z+(j-z)*(B(t)-D)/(F-D)})}var H=Math.min(v,f),N=Math.max(v,f),U=R$(H,N,c.length),V=[],W=(N-H)/60;return c.forEach((function(t,e){for(var i,n,r=T(x[e]),a=I(t),o=U[e],l=0;l<60&&(i=b[0]+r*Math.cos(o),n=b[1]+r*Math.sin(o),L$({x:i,y:n,size:a},V)||i-a<d.x0||i+a>d.x1||n-a<d.y0||n+a>d.y1);l++)l<59&&((o+=W)>N?o=H:o<H&&(o=N));V.push(Object.assign(s(s(s({},E$,i),B$,n),P$,a),t))})),V},R$=function(t,e,i){for(var n=0,r=Math.max(Math.ceil(2*(e-t)/Math.PI),2),a=(e-t)/r,o=0,s=1,l=0,u=0,h=[],c=t;l<i;)u<r&&(h.push(c+(u%2?Math.floor(u/2)+Math.floor(r/2):u/2)*a*s),u++),l++,u===r&&(u=0,0===n?n=a/2:n/=2,c=-1==(s*=-1)?e-n:t+n,(o+=1)>=2&&(a/=2,r*=2));return h},L$=function(t,e){return!(!e||!e.length)&&e.some((function(e){var i=e.x,n=e.y,r=e.size;return Math.pow(t.x-i,2)+Math.pow(t.y-n,2)<Math.pow(t.size+r,2)}))},D$=function(t){return A(t)?t():t},F$=function(t,e){if(!t||!O(t))return[];var i=D$(e.keyword),n=D$(e.categoryField),r=t[0].latestData[0];return s(s(s({},n,i),gj,null==r?void 0:r[gj]),mj,null==r?void 0:r[mj])},z$=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=e.type,t._subMarks={ripple0:{type:"symbol",defaultAttributes:{fillOpacity:.75}},ripple1:{type:"symbol",defaultAttributes:{fillOpacity:.5}},ripple2:{type:"symbol",defaultAttributes:{fillOpacity:.25}}},t._positionChannels=["ripple","size"],t._positionEncoder=function(t,e,i){var n=t.ripple,r=void 0===n?i.attribute.ripple:n,a=t.size,o=void 0===a?i.attribute.size:a,s=Pt(r,0,1),l=.5*o;return{ripple0:{size:o+l*s,fillOpacity:.75-.25*s},ripple1:{size:o+l*(1+s),fillOpacity:.5-.25*s},ripple2:{size:o+l*(2+s),fillOpacity:.25-.25*s}}},t}return h(e,t),a(e,[{key:"_getDefaultStyle",value:function(){return Object.assign(Object.assign({},_(e,"_getDefaultStyle",this,3)([])),{x:0,y:0,ripple:0})}}])}(eX);z$.type="ripple";var j$=function(t,e){return"fadeIn"===e?{type:"fadeIn"}:{type:"scaleIn"}},H$=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"nodePoint"),this._addMarkLabelSpec(t,"centerPoint","centerLabel")}}])}(gV),N$=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=nz.correlation,t.transformerConstructor=H$,t._viewBox=new ei,t}return h(r,e),a(r,[{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getValueField",value:function(){return this._valueField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"getSeriesField",value:function(){return this._seriesField}},{key:"setSeriesField",value:function(t){M(t)&&(this._seriesField=t)}},{key:"getSizeField",value:function(){return this._sizeField}},{key:"setSizeField",value:function(t){M(t)&&(this._sizeField=t)}},{key:"getSizeRange",value:function(){return this._sizeRange}},{key:"setSizeRange",value:function(t){M(t)&&(this._sizeRange=t)}},{key:"setAttrFromSpec",value:function(){_(r,"setAttrFromSpec",this,3)([]),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)}},{key:"initData",value:function(){var t=this;if(_(r,"initData",this,3)([]),this._data){fH(this._dataSet,"correlation",I$);var e=new Yo;pH(e,"dataview",Vo),fH(e,"correlationCenter",F$);var i=new Ko(e,{name:"".concat(this.type,"_").concat(this.id,"_center")});i.parse([this.getViewData()],{type:"dataview"}),i.transform({type:"correlationCenter",options:{keyword:function(){var e,i,n;return null!==(n=null===(i=null===(e=t._spec.centerLabel)||void 0===e?void 0:e.style)||void 0===i?void 0:i.text)&&void 0!==n?n:""},categoryField:function(){return t._spec.categoryField}}}),this._centerSeriesData=new WN(this._option,i)}}},{key:"compileData",value:function(){var t;_(r,"compileData",this,3)([]),null===(t=this._centerSeriesData)||void 0===t||t.compile()}},{key:"_statisticViewData",value:function(){var t=this;_(r,"_statisticViewData",this,3)([]),this._data.getDataView().transform({type:"correlation",options:{view:function(){return{x0:t._viewBox.x1,x1:t._viewBox.x2,y0:t._viewBox.y1,y1:t._viewBox.y2}},field:function(){return t._spec.valueField},radiusRange:function(){return t._spec.sizeRange},radiusField:function(){return t._spec.sizeField},center:function(){return[t._spec.centerX,t._spec.centerY]},innerRadius:function(){return t._spec.innerRadius},outerRadius:function(){return t._spec.outerRadius},startAngle:function(){return t._spec.startAngle},endAngle:function(){return t._spec.endAngle}}})}},{key:"initMark",value:function(){var e=this._createMark(r.mark.nodePoint,{groupKey:this._seriesField,isSeriesMark:!0,key:gj});e&&(e.setMarkConfig({zIndex:t.LayoutZIndex.Node}),this._nodePointMark=e);var i=this._createMark(r.mark.ripplePoint,{key:gj,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId()});i&&(this._ripplePointMark=i);var n=this._createMark(r.mark.centerPoint,{key:gj,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId()});n&&(n.setMarkConfig({zIndex:t.LayoutZIndex.Node}),this._centerPointMark=n)}},{key:"initMarkStyle",value:function(){this._initNodePointMarkStyle(),this._initRipplePointMarkStyle(),this._initCenterPointMarkStyle()}},{key:"_initNodePointMarkStyle",value:function(){var e,i,n,r,a=this._nodePointMark;if(a){var o=null!==(i=null===(e=this._spec.nodePoint)||void 0===e?void 0:e.style)&&void 0!==i?i:{};this.setMarkStyle(a,{x:function(t){return t[E$]},y:function(t){return t[B$]},size:function(t){return t[P$]},fill:null!==(n=o.fill)&&void 0!==n?n:this.getColorAttribute(),fillOpacity:null!==(r=o.fillOpacity)&&void 0!==r?r:1,lineWidth:0},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}}},{key:"_initRipplePointMarkStyle",value:function(){var e,i,n,r,a,o=this,s=this._ripplePointMark;if(s){var l=null!==(i=null===(e=this._spec.ripplePoint)||void 0===e?void 0:e.style)&&void 0!==i?i:{};this.setMarkStyle(s,{x:function(){var t;return null!==(t=o._spec.centerX)&&void 0!==t?t:(o._viewBox.x1+o._viewBox.x2)/2},y:function(){var t;return null!==(t=o._spec.centerY)&&void 0!==t?t:(o._viewBox.y1+o._viewBox.y2)/2},size:function(){return Math.max(o._viewBox.x2-o._viewBox.x1,o._viewBox.y2-o._viewBox.y1)/2},fill:null!==(n=l.fill)&&void 0!==n?n:this.getColorAttribute(),opacity:null!==(r=l.fillOpacity)&&void 0!==r?r:.2,ripple:null!==(a=l.ripple)&&void 0!==a?a:0},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}}},{key:"_initCenterPointMarkStyle",value:function(){var e,i,n,r,a,o,s=this,l=this._centerPointMark;l&&this.setMarkStyle(l,{x:function(){var t;return null!==(t=s._spec.centerX)&&void 0!==t?t:(s._viewBox.x1+s._viewBox.x2)/2},y:function(){var t;return null!==(t=s._spec.centerY)&&void 0!==t?t:(s._viewBox.y1+s._viewBox.y2)/2},size:function(){return.2*Math.max(s._viewBox.x2-s._viewBox.x1,s._viewBox.y2-s._viewBox.y1)/2},fill:null!==(n=null===(i=null===(e=this._spec.centerPoint)||void 0===e?void 0:e.style)||void 0===i?void 0:i.fill)&&void 0!==n?n:this.getColorAttribute(),fillOpacity:null!==(o=null===(a=null===(r=this._spec.centerPoint)||void 0===r?void 0:r.style)||void 0===a?void 0:a.fillOpacity)&&void 0!==o?o:1},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"initTooltip",value:function(){_(r,"initTooltip",this,3)([]),this._nodePointMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nodePointMark)}},{key:"initLabelMarkStyle",value:function(e){var i=this;e&&this.setMarkStyle(e,{fill:this.getColorAttribute(),text:function(t){return t[i._categoryField]},z:this.dataToPositionZ.bind(this)},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"initAnimation",value:function(){var t,e,i=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;this._nodePointMark.setAnimationConfig(lV(null===(e=Uz.getAnimationInKey("correlation"))||void 0===e?void 0:e({},i),uV("nodePoint",this._spec,this._markAttributeContext)))}},{key:"getGroupFields",value:function(){return[]}},{key:"getStackGroupFields",value:function(){return[]}},{key:"getStackValueField",value:function(){return""}},{key:"getActiveMarks",value:function(){return[this._nodePointMark,this._centerPointMark]}},{key:"getDimensionField",value:function(){return[this._categoryField]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"onLayoutEnd",value:function(){_(r,"onLayoutEnd",this,3)([]),this._viewBox.set(0,0,this._region.getLayoutRect().width,this._region.getLayoutRect().height),this._rawData.reRunAllTransform(),this.getViewData().reRunAllTransform()}}])}(DX);N$.type=nz.correlation,N$.mark=w$,N$.builtInTheme={correlation:{centerLabel:{visible:!0,position:"center",style:{fill:"#fff",text:""}},label:{visible:!0,position:"bottom",style:{fill:"#000"}}}},N$.transformerConstructor=H$;var U$=function(){$V(),iX(),Aw(),Uz.registerMark(z$.type,z$),Uz.registerGraphicComponent("symbol",(function(t){return Of(t)})),Uz.registerSeries(N$.type,N$),Uz.registerAnimation("correlation",(function(t,e){return Object.assign({appear:j$(0,e)},lU)}))},V$=Object.assign(Object.assign({},tV),{liquidGroup:{name:"liquidGroup",type:"group"},liquid:{name:"liquid",type:"liquid"},liquidBackground:{name:"liquidBackground",type:"group"},liquidOutline:{name:"liquidOutline",type:"group"}}),W$=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=e.type,t._subMarks={wave0:{type:"area",defaultAttributes:{curveType:"monotoneX",fillOpacity:1}},wave1:{type:"area",defaultAttributes:{curveType:"monotoneX",fillOpacity:.66}},wave2:{type:"area",defaultAttributes:{curveType:"monotoneX",fillOpacity:.33}}},t._positionChannels=["wave","y","height"],t._positionEncoder=function(t,e,i){for(var n=t.wave,r=void 0===n?i.attribute.wave:n,a=t.y,o=void 0===a?i.attribute.y:a,s=t.height,l=void 0===s?i.attribute.height:s,u=[],h=[],c=[],d=0;d<21;d++){var v=50*d-500,f=o+(d%2==0?20:0),p=o+l;u.push({x:v+100*r,y:f,y1:p}),h.push({x:v+200*r-40,y:f,y1:p}),c.push({x:v+300*r-20,y:f,y1:p})}return{wave0:{x:0,y:0,points:u},wave1:{x:0,y:0,points:h},wave2:{x:0,y:0,points:c}}},t}return h(e,t),a(e,[{key:"_getDefaultStyle",value:function(){return Object.assign(Object.assign({},_(e,"_getDefaultStyle",this,3)([])),{wave:0})}}])}(eX);W$.type="liquid";var G$=function(t,e){return"drop"===t?function(t,e,i){var n=4*i/3,r=Math.max(n,2*i),a=n/2,o=t,s=a+e-r/2,l=Math.asin(a/(.85*(r-a))),u=Math.sin(l)*a,h=Math.cos(l)*a,c=o-h,d=s+u,v=t,f=s+a/Math.sin(l);return"\n M ".concat(c," ").concat(d,"\n A ").concat(a," ").concat(a," 0 1 1 ").concat(c+2*h," ").concat(d,"\n Q ").concat(v," ").concat(f," ").concat(t," ").concat(e+r/2,"\n Q ").concat(v," ").concat(f," ").concat(c," ").concat(d,"\n Z \n ")}(0,0,e):t},Y$=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).markTooltipKeyCallback=function(e){return t.series.getValueField()},t.markTooltipValueCallback=function(e){return e[t.series.getValueField()]},t.shapeStrokeCallback=function(e){return t.series.getMarkInName("liquid").getAttribute("fill",e)},t}return h(e,t),a(e)}(UU),K$=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=nz.liquid,t.transformerConstructor=tW,t._liquidBackgroundMark=null,t._liquidOutlineMark=null,t._getLiquidPosY=function(){var e=t._getLiquidBackPosAndSize(),i=e.height,n=e.startY;return(t._reverse?i*t._heightRatio:i*(1-t._heightRatio))+n},t._getLiquidHeight=function(){return t._getLiquidBackPosAndSize().height*t._heightRatio},t._getLiquidBackPosAndSize=function(){var e,i,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=t._marginSpec,a=r.top,o=void 0===a?0:a,s=r.bottom,l=void 0===s?0:s,u=r.left,h=void 0===u?0:u,c=r.right,d=void 0===c?0:c,v=n?{}:t._paddingSpec,f=v.top,p=void 0===f?0:f,g=v.bottom,y=void 0===g?0:g,m=v.left,_=void 0===m?0:m,b=v.right,k=void 0===b?0:b;"triangle"===t._maskShape&&(l/=Math.sqrt(3),o=o/Math.sqrt(3)*2,y/=Math.sqrt(3),p=p/Math.sqrt(3)*2);var x=null!==(i=null===(e=t._region)||void 0===e?void 0:e.getLayoutRect())&&void 0!==i?i:{width:0,height:0},S=x.width,A=x.height,C=S/2+(h+_-(d+k))/2,M=A/2+(o+p-(l+y))/2,T=S-(h+d+_+k),w=A-(o+l+p+y),E=Math.min(T,w);return"rect"!==t._maskShape&&(T=E,w=E),{x:C,y:M,size:E,width:T,height:w,startX:C-T/2,startY:M-w/2,endX:C+T/2,endY:M+w/2}},t._getLiquidBackPath=function(){var e,i,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if("rect"===t._maskShape){var r=t._getLiquidBackPosAndSize(n),a=r.x,o=r.y,s=r.width,l=r.height;i=jf({x:a-s/2,y:o-l/2,width:s,height:l,fill:!0})}else{var u=t._getLiquidBackPosAndSize(n),h=u.x,c=u.y,d=u.size;i=Of({x:h,y:c,size:d,symbolType:G$(null!==(e=t._spec.maskShape)&&void 0!==e?e:"circle",d),fill:!0})}return[i]},t}return h(r,e),a(r,[{key:"setValueField",value:function(t){M(t)&&(this._valueField=t)}},{key:"getValueField",value:function(){return this._valueField}},{key:"setAttrFromSpec",value:function(){var t,e;_(r,"setAttrFromSpec",this,3)([]),this._marginSpec=Pz(this._spec.outlineMargin),this._paddingSpec=Pz(this._spec.outlinePadding),this.setValueField(this._spec.valueField),this._reverse=null!==(t=this._spec.reverse)&&void 0!==t&&t,this._maskShape=null!==(e=this._spec.maskShape)&&void 0!==e?e:"circle"}},{key:"viewDataUpdate",value:function(t){var e=this;_(r,"viewDataUpdate",this,3)([t]),this._heightRatio=ae.apply(void 0,b(this._data.getLatestData().map((function(t){return t[e._valueField]}))))}},{key:"initMark",value:function(){this._initLiquidOutlineMark(),this._initLiquidBackgroundMark(),this._initLiquidMark()}},{key:"initMarkStyle",value:function(){this._initLiquidOutlineMarkStyle(),this._initLiquidBackgroundMarkStyle(),this._initLiquidMarkStyle()}},{key:"_initLiquidOutlineMark",value:function(){return this._liquidOutlineMark=this._createMark(r.mark.liquidOutline,{isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidOutlineMark}},{key:"_initLiquidBackgroundMark",value:function(){return this._liquidBackgroundMark=this._createMark(r.mark.liquidBackground,{isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidBackgroundMark}},{key:"_initLiquidMark",value:function(){return this._liquidGroupMark=this._createMark(r.mark.liquidGroup,{parent:this._liquidBackgroundMark,isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidMark=this._createMark(r.mark.liquid,{parent:this._liquidGroupMark,isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidMark}},{key:"_buildMarkAttributeContext",value:function(){_(r,"_buildMarkAttributeContext",this,3)([]),this._markAttributeContext.getLiquidBackPosAndSize=this._getLiquidBackPosAndSize,this._markAttributeContext.getLiquidPosY=this._getLiquidPosY,this._markAttributeContext.getLiquidHeight=this._getLiquidHeight}},{key:"_initLiquidOutlineMarkStyle",value:function(){var e=this,i=this._liquidOutlineMark;i.created(),this.setMarkStyle(i,{stroke:this.getColorAttribute(),width:function(){return e._region.getLayoutRect().width},height:function(){return e._region.getLayoutRect().height},path:function(){return e._getLiquidBackPath(!0)}},"normal",t.AttributeLevel.Series),this._liquidOutlineMark.setMarkConfig({interactive:!1,zIndex:this.layoutZIndex})}},{key:"_initLiquidBackgroundMarkStyle",value:function(){var e=this,i=this._liquidBackgroundMark;i.created(),this.setMarkStyle(i,{width:function(){return e._region.getLayoutRect().width},height:function(){return e._region.getLayoutRect().height},path:function(){return e._getLiquidBackPath()}},"normal",t.AttributeLevel.Series),this._liquidBackgroundMark.setMarkConfig({interactive:!1,zIndex:this.layoutZIndex,clip:!0})}},{key:"_initLiquidMarkStyle",value:function(){var e=this,i=this._liquidMark,n=this._liquidGroupMark;n&&this.setMarkStyle(n,{x:function(){return e._region.getLayoutStartPoint().x+e._region.getLayoutRect().width/2},angle:this._reverse?-Math.PI:0,y:0,dy:this._getLiquidPosY}),i&&this.setMarkStyle(i,{y:0,dy:0,height:this._getLiquidHeight,fill:this.getColorAttribute(),wave:0},"normal",t.AttributeLevel.Series)}},{key:"initTooltip",value:function(){this._tooltipHelper=new Y$(this),this._liquidMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._liquidMark)}},{key:"getInteractionTriggers",value:function(){return this._parseInteractionConfig(this._liquidMark?[this._liquidMark]:[])}},{key:"initAnimation",value:function(){var t,e,i,n,r=this,a={height:{from:0,to:function(){return r._getLiquidHeight()}},dy:{from:function(){var t=r._getLiquidBackPosAndSize(),e=t.height,i=t.startY;return(r._reverse?0:e)+i}}},o=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._liquidMark.setAnimationConfig(lV(null===(i=Uz.getAnimationInKey("liquid"))||void 0===i?void 0:i(a,o),uV("liquid",this._spec,this._markAttributeContext))),this._liquidGroupMark.setAnimationConfig(lV(null===(n=Uz.getAnimationInKey("liquidGroup"))||void 0===n?void 0:n(a,o),uV("liquidGroup",this._spec,this._markAttributeContext)))}},{key:"initEvent",value:function(){var e=this;_(r,"initEvent",this,3)([]),this._spec.indicatorSmartInvert&&this._option.getChart().getComponentsByKey("indicator")&&this.event.on(t.ChartEvent.renderFinished,(function(){e._option.getChart().getComponentsByKey("indicator").forEach((function(t){var i,n,r,a=null===(i=e._liquidMark.getGraphics()[0].getSubGraphic())||void 0===i?void 0:i[0],o=a.globalAABBBounds,s=o.y1,l=o.y2;s+=e._region.getLayoutStartPoint().y,l+=e._region.getLayoutStartPoint().y,null===(r=null===(n=null==t?void 0:t.getIndicatorComponent())||void 0===n?void 0:n.getChildren()[0])||void 0===r||r.getChildren().forEach((function(t){var e=t.globalAABBBounds,i=e.y1,n=e.y2;if(s<i&&l>n){var r=Zw(t.attribute.fill,a.attribute.fill);t.setAttribute("fill",r)}}))}))}))}},{key:"dataToPosition",value:function(t){return null}},{key:"dataToPositionX",value:function(t){return null}},{key:"dataToPositionY",value:function(t){return null}},{key:"valueToPosition",value:function(t,e){return null}},{key:"getStatisticFields",value:function(){return[]}},{key:"getGroupFields",value:function(){return[]}},{key:"getStackGroupFields",value:function(){return[]}},{key:"getStackValueField",value:function(){return""}},{key:"getActiveMarks",value:function(){return[this._liquidMark]}}])}(SV);K$.type=nz.liquid,K$.mark=V$,K$.builtInTheme={liquid:{outlinePadding:10,liquidBackground:{style:{lineWidth:0,fillOpacity:.2}},liquidOutline:{style:{lineWidth:2}}}},K$.transformerConstructor=tW;var X$=function(t){return ot(t).join(",")},q$=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).dimensionTooltipTitleCallback=function(e){return X$(null==e?void 0:e[t.series.getDimensionField()[0]])},t.markTooltipKeyCallback=function(e){return X$(null==e?void 0:e[t.series.getDimensionField()[0]])},t}return h(e,t),a(e)}(UU),Z$=Object.assign(Object.assign({},tV),{circle:{name:"circle",type:"arc"},overlap:{name:"overlap",type:"path"},overlapLabel:{name:"overlapLabel",type:"text"}}),J$=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_transformLabelSpec",value:function(t){this._addMarkLabelSpec(t,"circle"),this._addMarkLabelSpec(t,"overlap","overlapLabel","initOverlapLabelMarkStyle")}}])}(gV),Q$=function(t,e){var i=A(e)?e():e,n=i.getViewBox();return n&&(null==t?void 0:t.length)?dJ(Object.assign({setField:i.setField,valueField:i.valueField},n),t):[]},$$=function(e){function r(){var t;return n(this,r),(t=i(this,r,arguments)).type=nz.venn,t.transformerConstructor=J$,t._viewBox=new ei,t}return h(r,e),a(r,[{key:"getCategoryField",value:function(){return this._categoryField}},{key:"setCategoryField",value:function(t){return this._categoryField=t,this._categoryField}},{key:"getValueField",value:function(){return this._valueField}},{key:"setValueField",value:function(t){return this._valueField=t,this._valueField}},{key:"setAttrFromSpec",value:function(){var t,e,i;_(r,"setAttrFromSpec",this,3)([]),this.setCategoryField(null!==(t=this._spec.categoryField)&&void 0!==t?t:"sets"),this.setValueField(null!==(e=this._spec.valueField)&&void 0!==e?e:"size"),this.setSeriesField(null!==(i=this._spec.seriesField)&&void 0!==i?i:yj)}},{key:"initData",value:function(){var t,e=this;_(r,"initData",this,3)([]),fH(this._dataSet,"venn",Q$),null===(t=this._data.getDataView())||void 0===t||t.transform({type:"venn",options:function(){return{getViewBox:function(){return e._viewBox.empty()?null:{x0:e._viewBox.x1,x1:e._viewBox.x2,y0:e._viewBox.y1,y1:e._viewBox.y2}},setField:e._categoryField,valueField:e._valueField}}})}},{key:"compile",value:function(){_(r,"compile",this,3)([]),this._runVennTransform()}},{key:"_runVennTransform",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._data.getDataView().reRunAllTransform(),t&&this.getCompiler().renderNextTick()}},{key:"initMark",value:function(){var t=this._createMark(r.mark.circle,{isSeriesMark:!0});t&&(t.setTransform([{type:"vennMark",datumType:"circle"}]),this._circleMark=t);var e=this._createMark(r.mark.overlap,{isSeriesMark:!0});e&&(e.setTransform([{type:"vennMark",datumType:"overlap"}]),this._overlapMark=e)}},{key:"initMarkStyle",value:function(){this._initCircleMarkStyle(),this._initOverlapMarkStyle()}},{key:"_initCircleMarkStyle",value:function(){this._circleMark&&this.setMarkStyle(this._circleMark,{x:function(t){return t.x},y:function(t){return t.y},innerRadius:0,outerRadius:function(t){return t.radius},startAngle:0,endAngle:2*Math.PI,fill:this.getColorAttribute(),stroke:this.getColorAttribute()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}},{key:"_initOverlapMarkStyle",value:function(){this._overlapMark&&(this.setMarkStyle(this._overlapMark,{x:function(t){return t.x},y:function(t){return t.y},path:function(t){return t.path},arcs:function(t){return t.arcs},fill:this.getColorAttribute(),stroke:this.getColorAttribute(),zIndex:function(t){return 100*t.sets.length}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this.setMarkStyle(this._overlapMark,{zIndex:function(t){return 100*t.sets.length+1}},t.STATE_VALUE_ENUM.STATE_HOVER,t.AttributeLevel.Series))}},{key:"initLabelMarkStyle",value:function(e){e&&(this._labelMark=e,e.setRule("venn"),this.setMarkStyle(e,{x:function(t){return t.labelX},y:function(t){return t.labelY},text:function(t){return X$(t.sets)},maxLineWidth:function(t){var e=t.x,i=t.radius,n=t.labelX,r=e-i,a=e+i;return Math.min(n-r,a-n)}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series))}},{key:"initOverlapLabelMarkStyle",value:function(e){e&&(this._labelMark=e,e.setRule("venn"),this.setMarkStyle(e,{x:function(t){return t.labelX},y:function(t){return t.labelY},text:function(t){return X$(t.sets)}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series))}},{key:"initTooltip",value:function(){this._tooltipHelper=new q$(this),this._circleMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._circleMark),this._overlapMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._overlapMark)}},{key:"getDimensionField",value:function(){return[this._categoryField]}},{key:"getMeasureField",value:function(){return[this._valueField]}},{key:"onLayoutEnd",value:function(){_(r,"onLayoutEnd",this,3)([]),this._viewBox.set(0,0,this.getLayoutRect().width,this.getLayoutRect().height),this._runVennTransform()}},{key:"getDefaultShapeType",value:function(){return"circle"}},{key:"getActiveMarks",value:function(){return[this._circleMark,this._overlapMark]}},{key:"getStatisticFields",value:function(){var t=[];return t.push({key:this._categoryField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}},{key:"getGroupFields",value:function(){return null}},{key:"dataToPosition",value:function(t,e){return{x:t.x,y:t.y}}},{key:"dataToPositionX",value:function(t){return t.x}},{key:"dataToPositionY",value:function(t){return t.y}},{key:"valueToPosition",value:function(t,e){throw new Error("Method not implemented.")}},{key:"getStackGroupFields",value:function(){return[]}},{key:"getStackValueField",value:function(){return null}},{key:"_getSeriesInfo",value:function(t,e){var i=this,n=this.getDefaultShapeType();return e.map((function(e){return{key:X$(e),originalKey:e,style:i.getSeriesStyle(s({},t,e)),shapeType:n}}))}},{key:"getSeriesFieldValue",value:function(t,e){var i=_(r,"getSeriesFieldValue",this,3)([t,e]);return X$(i)}},{key:"legendSelectedFilter",value:function(t,e){if(t.type===c.discreteLegend){var i=t.getLegendDefaultData(!0);if(0===e.length&&i.length)return[];if(e.length===i.length)return e;var n={};e.forEach((function(t){n[t]=!0}));var r=i.filter((function(t){return!n[X$(t)]})),a=i.filter((function(t){return!r.includes(t)&&r.some((function(e){return ot(e).every((function(e){return t.includes(e)}))}))}));e=e.slice(),a.forEach((function(t){e.splice(e.indexOf(X$(t)),1)}))}return e}},{key:"initAnimation",value:function(){var t=this;this.getMarksInType("arc").forEach((function(e){var i;e.setAnimationConfig(lV(null===(i=Uz.getAnimationInKey("vennCircle"))||void 0===i?void 0:i(),uV(e.name,t._spec,t._markAttributeContext)))})),this.getMarksInType("path").forEach((function(e){var i;e.setAnimationConfig(lV(null===(i=Uz.getAnimationInKey("vennOverlap"))||void 0===i?void 0:i(),uV(e.name,t._spec,t._markAttributeContext)))}))}}])}(SV);$$.type=nz.venn,$$.mark=Z$,$$.builtInTheme={venn:{circle:{style:{opacity:.8},state:{hover:{opacity:1}}},overlap:{style:{opacity:.8},state:{hover:{opacity:1,stroke:"white",lineWidth:2}}},label:{visible:!0,style:{fill:"white",textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"}}},overlapLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}}},$$.transformerConstructor=J$;var t0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=nz.mosaic,t.transformerConstructor=HY,t}return h(e,t),a(e,[{key:"bandWidthField",get:function(){return this._bandWidthField}},{key:"getStack",value:function(){return!0}},{key:"getPercent",value:function(){return this._spec.percent}},{key:"getGroupFields",value:function(){return"vertical"===this.direction?this._specXField:this._specYField}},{key:"setAttrFromSpec",value:function(){_(e,"setAttrFromSpec",this,3)([]);var t=this.getPercent();"horizontal"===this.direction?(t&&(this.setFieldX(Oj),this.setFieldX2(Pj)),this.setFieldY(Rj),this.setFieldY2(Ij)):(t&&(this.setFieldY(Oj),this.setFieldY2(Pj)),this.setFieldX(Rj),this.setFieldX2(Ij)),this._spec.bandWidthField&&(this._bandWidthField=this._spec.bandWidthField)}},{key:"parseLabelStyle",value:function(t,e){if((null==e?void 0:e.filterByGroup)&&C(t.dataFilter)){var i=this.getGroupFields(),n=e.filterByGroup,r=n.field,a=n.type,o=void 0===a?"max":a,s=n.filter;delete t.filterField;var l=i.indexOf(r);if(l<0)return;var u=l%2?"min"===o?"horizontal"===this.direction?this._fieldY2:this._fieldX2:"horizontal"===this.direction?this._fieldY:this._fieldX:"min"===o?"horizontal"===this.direction?this._fieldX2:this._fieldY2:"horizontal"===this.direction?this._fieldX:this._fieldY,h="min"===o?function(t,e){var i,n;return(null===(i=t.data)||void 0===i?void 0:i[u])<(null===(n=e.data)||void 0===n?void 0:n[u])}:function(t,e){var i,n;return(null===(i=t.data)||void 0===i?void 0:i[u])>(null===(n=e.data)||void 0===n?void 0:n[u])};t.dataFilter=function(t){var e={};return t.forEach((function(t){var i=t.data,n=null==i?void 0:i[r];C(n)||s&&!s(t)||e[n]&&!h(t,e[n])||(e[n]=t)})),t.filter((function(t){var i,n=null===(i=t.data)||void 0===i?void 0:i[r];return e[n]&&e[n]===t}))}}return t}}])}(UY);t0.type=nz.mosaic,t0.builtInTheme={mosaic:{label:{visible:!1,position:"center",style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},bar:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}}}},t0.transformerConstructor=HY;var e0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_isValidSeries",value:function(t){return t===nz.map}},{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["type","nameField","valueField","map","nameProperty","centroidProperty","nameMap","area","defaultFillColor","showDefaultName"]])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),t.region.forEach((function(t){t.coordinate="geo"})),_(e,"transformSeriesSpec",this,3)([t])}}])}(LG),i0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=e0,t.type="map",t.seriesType=nz.map,t}return h(e,t),a(e)}(OG);i0.type="map",i0.seriesType=nz.map,i0.transformerConstructor=e0;var n0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_isValidSeries",value:function(t){return!this.seriesType||t===this.seriesType}},{key:"getIndicatorSpec",value:function(t){var e,i,n,r=ot(t.indicator),a=null!==(e=t.innerRadius)&&void 0!==e?e:null===(n=null===(i=t.series)||void 0===i?void 0:i[0])||void 0===n?void 0:n.innerRadius;return M(a)&&r.forEach((function(t){C(t.limitRatio)&&(t.limitRatio=a)})),r}},{key:"_getDefaultSeriesSpec",value:function(t,i){return _(e,"_getDefaultSeriesSpec",this,3)([t,["radius","outerRadius","innerRadius","startAngle","endAngle","centerX","centerY","sortDataByAxis"],i])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),O(t.dataZoom)&&t.dataZoom.length>0&&t.dataZoom.forEach((function(t){"axis"===t.filterMode&&(t.filterMode="filter")})),this.transformSeriesSpec(t),M(t.indicator)&&(t.indicator=this.getIndicatorSpec(t))}}])}(LG),r0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"needAxes",value:function(){return!1}},{key:"_getDefaultSeriesSpec",value:function(t){var i=_(e,"_getDefaultSeriesSpec",this,3)([t,["startAngle","endAngle","centerX","centerY","clamp"]]);return i.categoryField=t.categoryField||t.radiusField,i.valueField=t.valueField||t.angleField,i}},{key:"_transformProgressAxisSpec",value:function(t,e,i,n,r){var a,o;t.axes||(t.axes=[]);var s=(null!==(a=t.axes)&&void 0!==a?a:[]).find((function(t){return"radius"===t.orient})),l=(null!==(o=t.axes)&&void 0!==o?o:[]).find((function(t){return"angle"===t.orient}));l||(l=e,t.axes.push(l)),s||(s=i,t.axes.push(s)),C(l.type)&&(l.type="linear"),C(s.type)&&(s.type="band");var u=dW(l,{min:0,max:1});C(l.min)&&(l.min=u.min),C(l.max)&&(l.max=u.max),n&&Object.assign(l,Nz({},n,l)),r&&Object.assign(s,Nz({},r,s))}}])}(n0),a0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"needAxes",value:function(){return!0}},{key:"_getDefaultSeriesSpec",value:function(t){var i=_(e,"_getDefaultSeriesSpec",this,3)([t]);return i.categoryField=t.categoryField||t.angleField,i.valueField=t.valueField||t.radiusField,i}},{key:"transformSpec",value:function(t){var i;if(_(e,"transformSpec",this,3)([t]),this.needAxes()){t.axes||(t.axes=[]);var n={radius:!1,angle:!1};(null!==(i=t.axes)&&void 0!==i?i:[]).forEach((function(t){var e=t.orient;"radius"===e&&(n.radius=!0),"angle"===e&&(n.angle=!0)})),n.angle||t.axes.push({orient:"angle"}),n.radius||t.axes.push({orient:"radius"})}}}])}(n0),o0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"needAxes",value:function(){return!1}},{key:"_getDefaultSeriesSpec",value:function(t){var i,n=_(e,"_getDefaultSeriesSpec",this,3)([t,["center","centerOffset","cornerRadius","padAngle","minAngle","emptyPlaceholder","showAllZero","supportNegative","useSequentialAnimation","layoutRadius"]]);return this._addSeriesRelatedSpecKeys(["valueField","angleField"]),n.categoryField=t.categoryField||t.seriesField,n.valueField=t.valueField||t.angleField,n.emptyCircle=null===(i=t.emptyPlaceholder)||void 0===i?void 0:i.emptyCircle,n}}])}(n0),s0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=o0,t}return h(e,t),a(e)}(OG);s0.transformerConstructor=o0;var l0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=o0,t.type="pie",t.seriesType=nz.pie,t}return h(e,t),a(e)}(s0);l0.type="pie",l0.seriesType=nz.pie,l0.transformerConstructor=o0;var u0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i,n,r,a=_(e,"_getDefaultSeriesSpec",this,3)([t]);return this._addSeriesRelatedSpecKeys(["radius","outerRadius","innerRadius"]),a.radius=null!==(i=t.radius)&&void 0!==i?i:wW,a.outerRadius=null!==(n=t.outerRadius)&&void 0!==n?n:wW,a.innerRadius=null!==(r=t.innerRadius)&&void 0!==r?r:0,a.stack=t.stack,a.percent=t.percent,a}},{key:"transformSpec",value:function(t){var i;_(e,"transformSpec",this,3)([t]),(null!==(i=t.axes)&&void 0!==i?i:[]).forEach((function(t){["domainLine","grid","label","tick"].forEach((function(e){t[e]||(t[e]={visible:!1})})),"angle"===t.orient&&C(t.bandPosition)&&(t.bandPosition=.5)})),t.crosshair=ot(t.crosshair||{}).map((function(t){return Nz({categoryField:{visible:!0,line:{visible:!0,type:"rect"}}},t)}))}}])}(a0),h0=function(t,e){if(!t)return null;var i=NV(t,(function(t){return"angle"===t.getOrient()}),e),n=NV(t,(function(t){return"radius"===t.getOrient()}),e);if(!(i&&i.length||n&&n.length))return null;var r=[],a=function(t){return t.getDimensionField()[0]},o=e.x,s=e.y;return i&&i.forEach((function(t){var e,i=t.getScale();if(i&&FI(i.type)){var l=i.domain(),u=i.range(),h=t.getCenter(),c={x:o-t.getLayoutStartPoint().x-h.x,y:s-t.getLayoutStartPoint().y-h.y},d=JF({x:1,y:0},c);d=function(t,e){var i=2*Math.PI,n=ut(e),r=lt(e);return t<n?t+=Math.ceil((n-t)/i)*i:t>r&&(t-=Math.ceil((t-r)/i)*i),t}(d,u);var v=QF(c),f=null===(e=n[0])||void 0===e?void 0:e.getScale(),p=null==f?void 0:f.range();if((d-(null==u?void 0:u[0]))*(d-(null==u?void 0:u[1]))>0||(v-(null==p?void 0:p[0]))*(v-(null==p?void 0:p[1]))>0)return;var g=t.invert(d);if(C(g))return;var y=l.findIndex((function(t){return(null==t?void 0:t.toString())===g.toString()}));y<0&&(y=void 0);var m=jV(g,t,"polar",a);r.push({index:y,value:g,position:i.scale(g),axis:t,data:m})}})),n&&n.forEach((function(t){var e,n=t.getScale(),l=null==n?void 0:n.range();if(n&&FI(n.type)){var u=t.getCenter(),h={x:o-t.getLayoutStartPoint().x-u.x,y:s-t.getLayoutStartPoint().y-u.y},c=JF({x:1,y:0},h);c<-Math.PI/2&&(c=2*Math.PI+c);var d=QF(h),v=null===(e=i[0])||void 0===e?void 0:e.getScale(),f=null==v?void 0:v.range();if((c-(null==f?void 0:f[0]))*(c-(null==f?void 0:f[1]))>0||(d-(null==l?void 0:l[0]))*(d-(null==l?void 0:l[1]))>0)return;var p=n.invert(d);if(C(p))return;var g=n.domain().findIndex((function(t){return(null==t?void 0:t.toString())===p.toString()}));g<0&&(g=void 0);var y=jV(p,t,"polar",a);r.push({index:g,value:p,position:n.scale(p),axis:t,data:y})}})),r.length?r:null},c0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=u0,t.type="rose",t.seriesType=nz.rose,t}return h(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=h0}}])}(OG);c0.type="rose",c0.seriesType=nz.rose,c0.transformerConstructor=u0,at(c0,HG);var d0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i,n,r,a,o=_(e,"_getDefaultSeriesSpec",this,3)([t]),s=null===(n=(i=this._option).getTheme)||void 0===n?void 0:n.call(i,"series","radar","area");return this._addSeriesRelatedSpecKeys(["line","point","area"]),o.line=t.line,o.point=t.point,o.stack=t.stack,o.percent=t.percent,o.area=Nz({visible:null!==(r=null==s?void 0:s.visible)&&void 0!==r&&r},t.area),o.seriesMark=null!==(a=t.seriesMark)&&void 0!==a?a:"area",o.activePoint=t.activePoint,o.pointDis=t.pointDis,o.pointDisMul=t.pointDisMul,o.markOverlap=t.markOverlap,o}},{key:"transformSpec",value:function(t){var i;_(e,"transformSpec",this,3)([t]),(null!==(i=t.axes)&&void 0!==i?i:[]).forEach((function(t){"radius"===t.orient&&(["domainLine","label","tick"].forEach((function(e){t[e]||(t[e]={visible:!1})})),t.grid||(t.grid={visible:!0}))})),t.crosshair=ot(t.crosshair||{}).map((function(t){return Nz({categoryField:{visible:!0,line:{visible:!0,type:"line"}}},t)}))}}])}(a0),v0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=d0,t.type="radar",t.seriesType=nz.radar,t}return h(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=h0}}])}(OG);v0.type="radar",v0.seriesType=nz.radar,v0.transformerConstructor=d0,at(v0,HG);var f0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i=_(e,"_getDefaultSeriesSpec",this,3)([t]);return delete i.data,i}},{key:"_transformAxisSpec",value:function(t){var e=this;t.axes&&t.autoBandSize&&t.series.forEach((function(i,n){var r;if("bar"===i.type){var a=e._findBandAxisBySeries(i,n,t.axes);if(a&&!a.bandSize&&!a.maxBandSize&&!a.minBandSize){var o=T(i.autoBandSize)&&null!==(r=i.autoBandSize.extend)&&void 0!==r?r:0,s=i.barMaxWidth,l=i.barMinWidth,u=i.barWidth,h=i.barGapInGroup;e._applyAxisBandSize(a,o,{barMaxWidth:s,barMinWidth:l,barWidth:u,barGapInGroup:h})}}}))}},{key:"transformSpec",value:function(t){var i=this;if(_(e,"transformSpec",this,3)([t]),t.series&&t.series.length){var n=this._getDefaultSeriesSpec(t);t.series.forEach((function(t){i._isValidSeries(t.type)&&Object.keys(n).forEach((function(e){e in t||(t[e]=n[e])}))}))}t.axes&&t.axes.length&&t.axes.forEach((function(e){G(e,"trimPadding")&&Nz(e,_N(i.type,t))})),this._transformAxisSpec(t)}}])}(LG),p0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=f0,t.type="common",t}return h(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=function(t,e,i){var n,r;return[].concat(b(null!==(n=JG(t,e,i))&&void 0!==n?n:[]),b(null!==(r=h0(t,e))&&void 0!==r?r:[]))},this._modelOption.getDimensionInfoByValue=$G,this._modelOption.getRectByDimensionData=aY}}])}(OG);p0.type="common",p0.transformerConstructor=f0,at(p0,HG);var g0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),t.axes.forEach((function(t){return t.type="linear"}))}},{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["x2Field","y2Field","barMinHeight","barBackground","barGap"]])}}])}(DG),y0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=g0,t}return h(e,t),a(e)}(OG);y0.transformerConstructor=g0,at(y0,HG);var m0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),sN(t)}}])}(g0),_0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=m0,t.type="histogram",t.seriesType=nz.bar,t}return h(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=JG,this._modelOption.getDimensionInfoByValue=$G,this._modelOption.getRectByDimensionData=aY}}])}(y0);_0.type="histogram",_0.seriesType=nz.bar,_0.transformerConstructor=m0;var b0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i,n,r=_(e,"_getDefaultSeriesSpec",this,3)([t]);return this._addSeriesRelatedSpecKeys(["cornerRadius","progress","track","roundCap"]),r.progress=t.progress,r.track=t.track,r.tickMask=t.tickMask,r.cornerRadius=null!==(i=t.cornerRadius)&&void 0!==i?i:0,r.roundCap=null!==(n=t.roundCap)&&void 0!==n&&n,r}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this._transformProgressAxisSpec(t,{orient:"angle",visible:!1},{orient:"radius",visible:!1},{forceInitTick:t.tickMask&&!1!==t.tickMask.visible})}}])}(r0),k0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=b0,t.type="circularProgress",t.seriesType=nz.circularProgress,t}return h(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=h0}}])}(OG);k0.type="circularProgress",k0.seriesType=nz.circularProgress,k0.transformerConstructor=b0,at(k0,HG);var x0=function(e){function r(){return n(this,r),i(this,r,arguments)}return h(r,e),a(r,[{key:"_getDefaultSeriesSpec",value:function(t){var e=_(r,"_getDefaultSeriesSpec",this,3)([t]);return this._addSeriesRelatedSpecKeys(["pin","pinBackground","pointer"]),e.radiusField=t.radiusField,e.pin=t.pin,e.pinBackground=t.pinBackground,e.pointer=t.pointer,e}},{key:"_getDefaultCircularProgressSeriesSpec",value:function(t){var e=_(r,"_getDefaultSeriesSpec",this,3)([t]);return e.type=nz.circularProgress,e}},{key:"transformSpec",value:function(e){var i,n,a,o,s;_(r,"transformSpec",this,3)([e]);var l=null===(i=e.series)||void 0===i?void 0:i.find((function(t){return t.type===nz.gauge||t.type===nz.circularProgress}));C(l)&&("circularProgress"===(l=null!==(n=e.gauge)&&void 0!==n?n:this._getDefaultCircularProgressSeriesSpec(e)).type&&(C(l.radiusField)&&C(l.categoryField)&&(l.radiusField=null!==(o=null!==(a=e.radiusField)&&void 0!==a?a:e.categoryField)&&void 0!==o?o:e.seriesField),C(l.valueField)&&C(l.angleField)&&(l.valueField=null!==(s=e.valueField)&&void 0!==s?s:e.angleField)),1===e.series.length?e.series.push(l):e.series.forEach((function(t){t.type===l.type&&Object.keys(l).forEach((function(e){e in t||(t[e]=l[e])}))}))),l.type===nz.circularProgress?this._transformProgressAxisSpec(e,{orient:"angle",visible:!0,domainLine:{visible:!1},grid:{visible:!1}},{orient:"radius",visible:!1},{zIndex:t.LayoutZIndex.Region+50}):this._transformGaugeAxisSpec(e)}},{key:"_transformGaugeAxisSpec",value:function(e){var i;e.axes||(e.axes=[]);var n={radius:null,angle:null};(null!==(i=e.axes)&&void 0!==i?i:[]).forEach((function(t){var e=t.orient;"radius"===e&&(n.radius=t),"angle"===e&&(n.angle=t)})),n.angle||(n.angle={orient:"angle",visible:!0},e.axes.push(n.angle)),n.radius||(n.radius={orient:"radius",visible:!1},e.axes.push(n.radius)),C(n.angle.type)&&(n.angle.type="linear"),C(n.radius.type)&&(n.radius.type="linear"),C(n.angle.zIndex)&&(n.angle.zIndex=t.LayoutZIndex.Region+50)}}])}(r0),S0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=x0,t.type="gauge",t.seriesType=nz.gaugePointer,t}return h(e,t),a(e)}(OG);S0.type="gauge",S0.seriesType=nz.gaugePointer,S0.transformerConstructor=x0;var A0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this.transformSeriesSpec(t)}},{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["nameField","valueField","fontFamilyField","fontWeightField","fontStyleField","colorHexField","colorMode","colorList","rotateAngles","fontWeightRange","fontSizeRange","maskShape","keepAspect","random","wordCloudConfig","wordCloudShapeConfig","word","fillingWord","wordMask"]])}}])}(LG),C0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=A0,t.type="wordCloud",t.seriesType=nz.wordCloud,t}return h(e,t),a(e)}(OG);C0.transformerConstructor=A0;var M0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=A0,t.type="wordCloud",t.seriesType=nz.wordCloud,t}return h(e,t),a(e)}(C0);M0.type="wordCloud",M0.seriesType=nz.wordCloud,M0.transformerConstructor=A0;var T0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"needAxes",value:function(){return!1}},{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["categoryField","valueField","funnelAlign","funnelOrient","heightRatio","shape","funnel","transform","outerLabel","transformLabel","isTransform","maxSize","minSize","gap","isCone","range","transformRatioText"]])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),_(e,"transformSeriesSpec",this,3)([t])}}])}(LG),w0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=T0,t.type="funnel",t.seriesType=nz.funnel,t}return h(e,t),a(e)}(OG);w0.type="funnel",w0.seriesType=nz.funnel,w0.transformerConstructor=T0;var E0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"needAxes",value:function(){return!1}},{key:"_getDefaultSeriesSpec",value:function(t){var i,n,r=_(e,"_getDefaultSeriesSpec",this,3)([t,["bandWidth","progress","track","clamp"]]);return r.direction=null!==(i=t.direction)&&void 0!==i?i:"horizontal",this._addSeriesRelatedSpecKeys(["cornerRadius"]),r.cornerRadius=null!==(n=t.cornerRadius)&&void 0!==n?n:0,r}},{key:"transformSpec",value:function(t){var i,n;if(_(e,"transformSpec",this,3)([t]),t.axes||(t.axes=[]),"vertical"===t.direction){var r=null,a=null;(null!==(i=t.axes)&&void 0!==i?i:[]).forEach((function(t){var e=t.orient;"left"===e&&(r=t),"bottom"===e&&(a=t)})),r||(r={orient:"left",visible:!1},t.axes.push(r)),a||(a={orient:"bottom",visible:!1},t.axes.push(a)),C(a.type)&&(a.type="band"),C(r.type)&&(r.type="linear");var o=dW(r,{min:0,max:1});C(r.min)&&(r.min=o.min),C(r.max)&&(r.max=o.max)}else{var s=null,l=null;(null!==(n=t.axes)&&void 0!==n?n:[]).forEach((function(t){var e=t.orient;"left"===e&&(s=t),"bottom"===e&&(l=t)})),s||(s={type:"band",orient:"left",visible:!1},t.axes.push(s)),l||(l={orient:"bottom",visible:!1},t.axes.push(l)),C(l.type)&&(l.type="linear"),C(s.type)&&(s.type="band");var u=dW(l,{min:0,max:1});C(l.min)&&(l.min=u.min),C(l.max)&&(l.max=u.max)}}}])}(DG),B0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=E0,t.type="linearProgress",t.seriesType=nz.linearProgress,t}return h(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=JG,this._modelOption.getDimensionInfoByValue=$G,this._modelOption.getRectByDimensionData=aY}}])}(OG);B0.type="linearProgress",B0.seriesType=nz.linearProgress,B0.transformerConstructor=E0,at(B0,HG);var P0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i,n,r=_(e,"_getDefaultSeriesSpec",this,3)([t,["barWidth","barMaxWidth","barMinWidth","barGapInGroup","barBackground","barMinHeight","stackCornerRadius","bar"]]);return"horizontal"===t.direction?r.xField=null!==(i=t.xField)&&void 0!==i?i:[t.minField,t.maxField]:r.yField=null!==(n=t.yField)&&void 0!==n?n:[t.minField,t.maxField],r}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),sN(t)}}])}(DG),O0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=P0,t.type="rangeColumn",t.seriesType=nz.rangeColumn,t}return h(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=JG,this._modelOption.getDimensionInfoByValue=$G,this._modelOption.getRectByDimensionData=aY}}])}(OG);O0.type="rangeColumn",O0.seriesType=nz.rangeColumn,O0.transformerConstructor=P0;var I0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i=M(t.startAngle)?t.startAngle:-90,n=M(t.endAngle)?t.endAngle:i+ke(2*Math.PI),r=_(e,"_getDefaultSeriesSpec",this,3)([t,["categoryField","valueField","centerX","centerY","offsetX","offsetY","innerRadius","outerRadius","gap","labelLayout","label","labelAutoVisible","drill","drillField"]]);return r.startAngle=i,r.endAngle=n,r}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this.transformSeriesSpec(t)}}])}(LG),R0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=I0,t.type="sunburst",t.seriesType=nz.sunburst,t}return h(e,t),a(e)}(OG);R0.type="sunburst",R0.seriesType=nz.sunburst,R0.transformerConstructor=I0;var L0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["categoryField","valueField","layoutPadding","circlePacking","drill","drillField"]])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this.transformSeriesSpec(t)}}])}(LG),D0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=L0,t.type="circlePacking",t.seriesType=nz.circlePacking,t}return h(e,t),a(e)}(OG);D0.type="circlePacking",D0.seriesType=nz.circlePacking,D0.transformerConstructor=L0;var F0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["categoryField","valueField","aspectRatio","splitType","maxDepth","gapWidth","nodePadding","minVisibleArea","minChildrenVisibleArea","minChildrenVisibleSize","roam","drill","drillField","leaf","nonLeaf","nonLeafLabel"]])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this.transformSeriesSpec(t)}}])}(LG),z0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=F0,t.type="treemap",t.seriesType=nz.treemap,t}return h(e,t),a(e)}(OG);z0.type="treemap",z0.seriesType=nz.treemap,z0.transformerConstructor=F0;var j0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),t.legends&&ot(t.legends).forEach((function(t){t.select=!1,t.hover=!1,t.filter=!1})),sN(t)}},{key:"_getDefaultSeriesSpec",value:function(t){var i=_(e,"_getDefaultSeriesSpec",this,3)([t]);return this._addSeriesRelatedSpecKeys(["bar","stackLabel","leaderLine","total","calculationMode"]),i.bar=t.bar,i.stackLabel=t.stackLabel,i.leaderLine=t.leaderLine,i.total=t.total,i.calculationMode=t.calculationMode,i}}])}(WY),H0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=j0,t.type="waterfall",t.seriesType=nz.waterfall,t}return h(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=JG,this._modelOption.getDimensionInfoByValue=$G,this._modelOption.getRectByDimensionData=aY}}])}(GY);H0.type="waterfall",H0.seriesType=nz.waterfall,H0.transformerConstructor=j0;var N0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i,n=[t.maxField,t.medianField,t.q1Field,t.q3Field,t.minField,t.outliersField],r=_(e,"_getDefaultSeriesSpec",this,3)([t,["boxPlot","outlier","minField","maxField","q1Field","medianField","q3Field","outliersField","outliersStyle","boxWidth","boxMaxWidth","boxMinWidth","boxGapInGroup"]]);return r.direction=null!==(i=t.direction)&&void 0!==i?i:"vertical",r["horizontal"===r.direction?"xField":"yField"]=n,r}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),t.axes||(t.axes=[{orient:"bottom"},{orient:"left"}]),sN(t)}}])}(DG),U0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=N0,t.type="boxPlot",t.seriesType=nz.boxPlot,t}return h(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=JG,this._modelOption.getDimensionInfoByValue=$G,this._modelOption.getRectByDimensionData=aY}}])}(OG);U0.type="boxPlot",U0.seriesType=nz.boxPlot,U0.transformerConstructor=N0;var V0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["categoryField","valueField","sourceField","targetField","direction","nodeAlign","crossNodeAlign","nodeGap","nodeWidth","linkWidth","minStepWidth","minNodeHeight","maxNodeHeight","minLinkHeight","maxLinkHeight","dropIsolatedNode","nodeHeight","linkHeight","equalNodeHeight","linkOverlap","iterations","nodeKey","linkSortBy","nodeSortBy","setNodeLayer","node","link","emphasis","inverse","overflow"]])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this.transformSeriesSpec(t)}}])}(LG),W0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=V0,t.type="sankey",t.seriesType=nz.sankey,t}return h(e,t),a(e,[{key:"_setStateInDatum",value:function(t,e,i,n){var r=O(e)?e[0]:e;if(r){var a=null;this.filterGraphicsByDatum(r,{filter:function(t,e){return"text"!==e.type&&e.getProduct()&&(!i||i(t,e))},region:n,getDatum:function(t){var e,i=null===(e=nH(t))||void 0===e?void 0:e.datum;return O(i)&&(i=i[0]),i},callback:function(t,e,i,n){var r,a,o=e.getProductId();o&&(o.includes("node")||o.includes("link"))&&(null===(a=(r=i)._handleEmphasisElement)||void 0===a||a.call(r,{item:t,mark:e}))},regionCallback:function(t,e){r&&t.length&&(a=t[0])}}),a&&this._interaction.updateStateOfGraphics(t,[a])}else this._interaction.clearByState(t)}}])}(OG);W0.type="sankey",W0.seriesType=nz.sankey,W0.transformerConstructor=V0;var G0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){var i,n,r=_(e,"_getDefaultSeriesSpec",this,3)([t]);return this._addSeriesRelatedSpecKeys(["area","point","line"]),r.area=t.area,r.point=t.point,r.line=t.line,"horizontal"===t.direction?r.xField=null!==(i=t.xField)&&void 0!==i?i:[t.minField,t.maxField]:r.yField=null!==(n=t.yField)&&void 0!==n?n:[t.minField,t.maxField],r.stack=!1,r}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),sN(t)}}])}(DG),Y0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=G0,t.type="rangeArea",t.seriesType=nz.rangeArea,t}return h(e,t),a(e,[{key:"_setModelOption",value:function(){this._modelOption.getDimensionInfo=JG,this._modelOption.getDimensionInfoByValue=$G,this._modelOption.getRectByDimensionData=aY}}])}(OG);Y0.type="rangeArea",Y0.seriesType=nz.rangeArea,Y0.transformerConstructor=G0;var K0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["valueField","cell"]])}}])}(DG),X0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=K0,t.type="heatmap",t.seriesType=nz.heatmap,t}return h(e,t),a(e)}(OG);X0.type="heatmap",X0.seriesType=nz.heatmap,X0.transformerConstructor=K0;var q0=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_getDefaultSeriesSpec",value:function(t){return _(e,"_getDefaultSeriesSpec",this,3)([t,["categoryField","valueField","sizeField","sizeRange","centerX","centerY","innerRadius","outerRadius","startAngle","endAngle","ripplePoint","centerPoint","centerLabel","nodePoint"]])}},{key:"transformSpec",value:function(t){_(e,"transformSpec",this,3)([t]),this.transformSeriesSpec(t)}}])}(LG),Z0=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).transformerConstructor=q0,t.type="correlation",t.seriesType=nz.correlation,t}return h(e,t),a(e)}(OG);function J0(t){var e,i,n=Object.assign({},t);return W(t.style)||(n.textStyle=tH(t.style)),W(t.textStyle)||Nz(n.textStyle,tH(t.textStyle)),(null===(e=t.shape)||void 0===e?void 0:e.style)&&tH(n.shape.style),(null===(i=t.background)||void 0===i?void 0:i.style)&&tH(n.background.style),n}Z0.type="correlation",Z0.seriesType=nz.correlation,Z0.transformerConstructor=q0;var Q0=function(t,e){var i=[],n={},r=e.series,a=e.seriesField;return r().forEach((function(t){var e=a(t);(e===t.getSeriesField()?t.getSeriesInfoList():t.getSeriesInfoInField(e)).forEach((function(t){n[t.key]||(n[t.key]=!0,i.push(t))}))})),i},$0=function(t,e){var i,n,r,a=e.series,o=e.selected,s=e.field,l=e.data,u=e.customFilter,h=o(),c=l();if(0===h.length&&c.length)return[];if(h.length===c.length)return t;var d={};h.forEach((function(t){d[t]=!0}));var v=null!==(i=s())&&void 0!==i?i:mj;return u?u(t,h,v):(O(t)&&(null===(n=t[0])||void 0===n?void 0:n.nodes)?(t[0].nodes=t[0].nodes.filter((function(t){return!0===d[t.key]})),(null===(r=t[0])||void 0===r?void 0:r.links)&&(t[0].links=t[0].links.filter((function(t){return!0===d[t.source]&&!0===d[t.target]})))):M(v)&&(t=t.filter((function(t){return!0===d[a.getSeriesFieldValue(t,v)]}))),t)},t1={position:!0,item:!0,title:!0,pager:!0,background:!0},e1=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).layoutType="normal",e.layoutZIndex=t.LayoutZIndex.Legend,e.layoutLevel=t.LayoutLevel.Legend,e.specKey="legends",e._orient="left",e._visible=!0,e._position="middle",e._preSelectedData=[],e._selectedData=[],e.effect={onSelectedDataChange:function(){tz(e._regions,(function(t){var e;null===(e=t.getViewData())||void 0===e||e.markRunning()}),{userId:e._seriesUserId,specIndex:e._seriesIndex}),tz(e._regions,(function(t){t.reFilterViewData()}),{userId:e._seriesUserId,specIndex:e._seriesIndex})}},e}return h(r,e),a(r,[{key:"orient",get:function(){return this._orient}},{key:"visible",get:function(){return this._visible}},{key:"position",get:function(){return this._position}},{key:"getLegendData",value:function(){return this._legendData.getLatestData()}},{key:"getSelectedData",value:function(){return this._selectedData}},{key:"setAttrFromSpec",value:function(){var t;_(r,"setAttrFromSpec",this,3)([]),this._orient=Cz(this._spec.orient)?this._spec.orient:"left",this._position=null!==(t=this._spec.position)&&void 0!==t?t:"middle",this._visible=!1!==this._spec.visible;var e=this._spec,i=e.regionId,n=e.regionIndex,a=e.seriesId,o=e.seriesIndex;M(a)&&(this._seriesUserId=ot(a)),M(i)&&(this._regionUserId=ot(i)),M(o)&&(this._seriesIndex=ot(o)),M(n)&&(this._regionUserIndex=ot(n)),this._regions=this._option.getRegionsInUserIdOrIndex(this._regionUserId,this._regionUserIndex)}},{key:"created",value:function(){_(r,"created",this,3)([]),this.initData()}},{key:"_compareSpec",value:function(t,e){var i=_(r,"_compareSpec",this,3)([t,e]);i.reRender=!0;var n=!nt(e,t);return i.reMake?i:(null==t?void 0:t.orient)!==(null==e?void 0:e.orient)?(i.reMake=!0,i):n&&!i.reCompile&&this._isComponentOnlySpecChange(t,e)?(i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0}),i):(n&&(i.reCompile=!0),i)}},{key:"_isComponentOnlySpecChange",value:function(t,e){var i=e,n=t;return Object.keys(Object.assign(Object.assign({},e),t)).every((function(t){return nt(null==i?void 0:i[t],null==n?void 0:n[t])||t1[t]}))}},{key:"_bindLegendDataChange",value:function(){this._preSelectedData=this._selectedData.slice(),this._initSelectedData(),this._forceLayout()}},{key:"initData",value:function(){var e=this,i=this._initLegendData();i.target.addListener("change",this._bindLegendDataChange.bind(this)),this._legendData=new WN(this._option,i),this._initSelectedData(),tz(this._regions,(function(i){i.event.on(t.ChartEvent.rawDataUpdate,{filter:function(t){var e=t.model;return(null==e?void 0:e.id)===i.id}},(function(){e._legendData.getDataView().reRunAllTransform({skipEqual:!0})}))}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},{key:"setSelectedData",value:function(e){var i,n,r,a=this,o=this._selectedData;C(e)||JSON.stringify(o)===JSON.stringify(e)||(tz(this._regions,(function(t){t.legendSelectedFilter&&(e=t.legendSelectedFilter(a,e))}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._selectedData=b(e),null===(n=(i=this.effect).onSelectedDataChange)||void 0===n||n.call(i),this.event.emit(t.ChartEvent.legendSelectedDataChange,{model:this}),null===(r=this._legendComponent)||void 0===r||r.setSelected(this._selectedData))}},{key:"afterSetLayoutStartPoint",value:function(t){if(_(r,"afterSetLayoutStartPoint",this,3)([t]),this._legendComponent){var e=t.x,i=t.y;F(e*i)&&this._legendComponent.setAttributes({x:e,y:i})}}},{key:"getBoundsInRect",value:function(t,e){var i=this;if(!this._visible)return this._legendComponent&&this._legendComponent.parent&&(this._legendComponent.parent.removeChild(this._legendComponent),this._legendComponent=null),{x1:0,y1:0,x2:0,y2:0};var n={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0},r=this._getLegendAttributes(t);if(r.disableTriggerEvent=this._option.disableTriggerEvent,this._legendComponent)nt(r,this._cacheAttrs)||this._legendComponent.setAttributes(Nz({},r,{defaultSelected:this._selectedData}));else{var a=new(this._getLegendConstructor())(Nz({},r,{defaultSelected:this._selectedData}));a.name="legend",this._legendComponent=a,this.getContainer().add(a),this._option.disableTriggerEvent||this._initEvent(),a.on("*",(function(t,e){return i._delegateEvent(i._legendComponent,t,e)}))}this._cacheAttrs=r;var o=isFinite(this._legendComponent.AABBBounds.width())?this._legendComponent.AABBBounds.width():0,s=isFinite(this._legendComponent.AABBBounds.height())?this._legendComponent.AABBBounds.height():0;if("normal-inline"!==this.layoutType){var l="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",u=this._position,h=e.width,c=e.height,d=0,v=0;"horizontal"===l?"middle"===u?d=(h-o)/2:"end"===u&&(d=h-o):"middle"===u?v=(c-s)/2:"end"===u&&(v=c-s),this._legendComponent.setAttributes({dx:d,dy:v})}return n.x2=n.x1+o,n.y2=n.y1+s,n}},{key:"onDataUpdate",value:function(){var e,i;if(JSON.stringify(this._preSelectedData)!==JSON.stringify(this._selectedData)){if(this._legendComponent){var n=this._getLegendAttributes(this.getLayoutRect());nt(n,this._cacheAttrs)||this._legendComponent.setAttributes(Nz({},n,{defaultSelected:this._selectedData}))}null===(i=(e=this.effect).onSelectedDataChange)||void 0===i||i.call(e),this.event.emit(t.ChartEvent.legendSelectedDataChange,{model:this})}}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._legendComponent]}},{key:"clear",value:function(){_(r,"clear",this,3)([]),this._cacheAttrs=null,this._preSelectedData=null}}])}(DW);e1.specKey="legends";var i1=function(e){function o(){var t;return n(this,o),(t=i(this,o,arguments)).type=c.discreteLegend,t.name=c.discreteLegend,t}return h(o,e),a(o,[{key:"init",value:function(e){var i=this;_(o,"init",this,3)([e]),tz(this._regions,(function(e){e.addViewDataFilter({type:"discreteLegendFilter",options:{series:e,selected:function(){return i._selectedData},field:function(){return i._getSeriesLegendField(e)},data:function(){return i.getLegendDefaultData()},customFilter:i._spec.customFilter},level:t.TransformLevel.legendFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},{key:"_initLegendData",value:function(){var t=this;fH(this._option.dataSet,"discreteLegendFilter",$0),fH(this._option.dataSet,"discreteLegendDataMake",Q0);var e=new Ko(this._option.dataSet,{name:"".concat(this.type,"_").concat(this.id,"_data")});return e.transform({type:"discreteLegendDataMake",options:{series:function(){var e=[];return tz(t._regions,(function(t){e.push(t)}),{specIndex:t._spec.seriesIndex,userId:t._spec.seriesId}),e},seriesField:function(e){return t._getSeriesLegendField(e)}}}),e}},{key:"_getSeriesLegendField",value:function(t){var e,i,n,r=t.getSeriesField(),a=null!==(e=this._spec.scaleName)&&void 0!==e?e:this._spec.scale;if(C(a))return r;if(!t.getRawData())return r;var o=this._option.globalScale.getScaleSpec(a);if(!o)return r;if(this._spec.field)return this._spec.field;if(!JS(o.domain))return r;var s=o.domain.find((function(e){return e.dataId===t.getRawData().name}));return s&&null!==(n=null===(i=s.fields)||void 0===i?void 0:i[0])&&void 0!==n?n:r}},{key:"_initSelectedData",value:function(){var t=this,e=this.getLegendDefaultData();if(this._unselectedData){var i=[],n=[];e.forEach((function(e){t._unselectedData.includes(e)?n.push(e):i.push(e)})),this._selectedData=i,this._unselectedData=n}else this._spec.defaultSelected?this._selectedData=b(this._spec.defaultSelected):this._selectedData=e}},{key:"getLegendDefaultData",value:function(t){return A(this._spec.data)?this._getLegendItems().map((function(t){return t.label})):this._legendData.getLatestData().map(t?function(t){return t.originalKey}:function(t){return t.key})}},{key:"_addDefaultTitleText",value:function(t){var e,i,n,r;if((null===(e=t.title)||void 0===e?void 0:e.visible)&&C(t.title.text)&&C(null===(i=t.title.style)||void 0===i?void 0:i.text)){var a=null===(r=null===(n=this._regions)||void 0===n?void 0:n[0])||void 0===r?void 0:r.getSeries()[0];if(!a)return;t.title.text=Nj(a.getRawData(),a.getSeriesField())}}},{key:"_getLegendAttributes",value:function(t){var e="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",i=Object.assign(Object.assign({layout:e,items:this._getLegendItems(),zIndex:this.layoutZIndex},function(t,e){var i=r(t,["title","item","pager","background","type","id","visible","orient","position","data","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]),n=t.title,a=void 0===n?{}:n,o=t.item,s=void 0===o?{}:o,l=t.pager,u=void 0===l?{}:l,h=t.background,c=void 0===h?{}:h;a=X(a),s=X(s),u=X(u),c=X(c);var d=i;return a.visible?d.title=J0(a):d.title={visible:!1},W(s.focusIconStyle)||tH(s.focusIconStyle),s.shape&&(s.shape=Jj(s.shape)),s.label&&(s.label=Jj(s.label)),s.value&&(s.value=Jj(s.value)),s.background&&(s.background=Jj(s.background)),Mz(s.maxWidth)&&(s.maxWidth=Number(s.maxWidth.substring(0,s.maxWidth.length-1))*e.width/100),Mz(s.width)&&(s.width=Number(s.width.substring(0,s.width.length-1))*e.width/100),Mz(s.height)&&(s.height=Number(s.height.substring(0,s.height.length-1))*e.width/100),d.item=s,"scrollbar"===u.type?(W(u.railStyle)||tH(u.railStyle),W(u.sliderStyle)||tH(u.sliderStyle)):(W(u.textStyle)||tH(u.textStyle),u.handler&&Jj(u.handler)),d.pager=u,c.visible&&!W(c.style)&&(Nz(d,c.style),M(c.padding)&&(d.padding=c.padding)),d}(this._spec,t)),{maxWidth:t.width,maxHeight:t.height});return this._addDefaultTitleText(i),this._addLegendItemFormatMethods(i),i}},{key:"_getLegendConstructor",value:function(){return uF}},{key:"setSelectedData",value:function(t){t&&(this._unselectedData=this.getLegendDefaultData().filter((function(e){return!t.includes(e)}))),_(o,"setSelectedData",this,3)([t])}},{key:"_initEvent",value:function(){var e=this;if(this._legendComponent){var i=!1!==this._spec.filter;this._legendComponent.addEventListener(QD.legendItemClick,(function(n){var r=G(n,"detail.currentSelected");i&&e.setSelectedData(r),e.event.emit(t.ChartEvent.legendItemClick,{model:e,value:r,event:n})})),this._legendComponent.addEventListener(QD.legendItemHover,(function(i){var n=G(i,"detail");e.event.emit(t.ChartEvent.legendItemHover,{model:e,value:n,event:i})})),this._legendComponent.addEventListener(QD.legendItemUnHover,(function(i){var n=G(i,"detail");e.event.emit(t.ChartEvent.legendItemUnHover,{model:e,value:n,event:i})}))}}},{key:"_getLegendItems",value:function(){var t=(this._legendData.getLatestData()||[]).map((function(t){var e,i,n=t.style("fillOpacity"),r=t.style("strokeOpacity"),a=t.style("opacity"),o=t.style("texture");return{label:t.key,shape:{symbolType:null!==(i=null!==(e=t.style("symbolType"))&&void 0!==e?e:t.shapeType)&&void 0!==i?i:"circle",fillOpacity:F(n)?n:1,strokeOpacity:F(r)?r:1,opacity:F(a)?a:1,texturePadding:o?1:null,textureSize:o?4:null,texture:o,fill:t.style("fill"),stroke:t.style("stroke"),textureColor:t.style("textureColor"),innerBorder:t.style("innerBorder"),outerBorder:t.style("outerBorder"),lineDash:t.style("lineDash"),lineDashOffset:t.style("lineDashOffset"),lineWidth:t.style("lineWidth")}}}));return A(this._spec.data)?this._spec.data(t,this._option.globalScale.getScale("color"),this._option.globalScale):t}},{key:"_addLegendItemFormatMethods",value:function(t){var e,i,n,r,a=null!==(i=null===(e=this._spec.item)||void 0===e?void 0:e.label)&&void 0!==i?i:{},o=a.formatMethod,s=a.formatter,l=null!==(r=null===(n=this._spec.item)||void 0===n?void 0:n.value)&&void 0!==r?r:{},u=l.formatMethod,h=l.formatter,c=OU(o,s).formatFunc;s&&!o&&c&&(t.item.label.formatMethod=function(t,e){return c(t,e,s)});var d=OU(u,h).formatFunc;h&&!u&&d&&(t.item.value.formatMethod=function(t,e){return d(h,t,e,s)})}}],[{key:"getSpecInfo",value:function(t){return IU(t,this.specKey,this.type,(function(t){return!t.type||"discrete"===t.type}))}}])}(e1);i1.specKey="legends",i1.builtInTheme={discreteLegend:{orient:"bottom",position:"middle",padding:[16,24],title:{visible:!1,padding:0,textStyle:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"primaryFontColor"},fontWeight:"normal"},space:12},pager:{textStyle:{fill:{type:"palette",key:"discreteLegendPagerTextColor"}},handler:{style:{fill:{type:"palette",key:"discreteLegendPagerHandlerColor"}},state:{disable:{fill:{type:"palette",key:"discreteLegendPagerHandlerDisableColor"}}}}},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:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},opacity:1},state:{unSelected:{fill:{type:"palette",key:"disableFontColor"},opacity:1}}}},allowAllCanceled:!1}},i1.type=c.discreteLegend;var n1=function(t,e){var i=e.series,n=e.field,r=e.scale,a=n();if(n&&a){var o=1/0,s=-1/0;return i().forEach((function(t){var e=t.getRawDataStatisticsByField(a,!0),i=null==e?void 0:e.min,n=null==e?void 0:e.max;F(i)&&(o=Math.min(i,o)),F(n)&&(s=Math.max(n,s))})),[o,s]}if(r){var l=r();return l?l.domain():[]}return[]},r1=function(t,e){var i=e.selected,n=e.field,r=e.data,a=e.isHierarchyData,o=e.customFilter,s=i(),l=n(),u=a||function(t){return t&&t.some((function(t){return t&&function(t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"children";return!!T(t)&&!!t.hasOwnProperty(e)&&Array.isArray(t[e])}(t)}))};if(s===r())return t;if(l&&!W(s)){var h=m(s,2),c=h[0],d=h[1];return o?o(t,s,l):u(t)?Zj(t,+c,+d,l):t.filter((function(t){return t[l]>=c&&t[l]<=d}))}return t};function a1(t){var e=Nz({},t),i=e.title,n=void 0===i?{}:i,a=e.handler,o=void 0===a?{}:a,s=e.rail,l=void 0===s?{}:s,u=e.track,h=void 0===u?{}:u,c=e.startText,d=e.endText,v=e.handlerText,f=e.sizeBackground,p=e.background,g=void 0===p?{}:p;e.type,e.id,e.visible,e.orient,e.position,e.data,e.defaultSelected,e.field,e.filter,e.regionId,e.regionIndex,e.seriesIndex,e.seriesId,e.padding;var y=r(e,["title","handler","rail","track","startText","endText","handlerText","sizeBackground","background","type","id","visible","orient","position","data","defaultSelected","field","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return n.visible?y.title=J0(n):y.title={visible:!1},y.showHandler=!1!==o.visible,W(o.style)||(y.handlerStyle=tH(o.style)),M(l.width)&&(y.railWidth=l.width),M(l.height)&&(y.railHeight=l.height),W(l.style)||(y.railStyle=tH(l.style)),W(h.style)||(y.trackStyle=tH(h.style)),y.startText=Jj(c),y.endText=Jj(d),y.handlerText=function(t){if(!t)return t;var e=Object.assign({},t),i=t.style;return A(i)?e.style=function(t,e,n){return tH(i(t,e,n))}:W(i)||(e.style=tH(i)),e}(v),W(f)||(y.sizeBackground=tH(f)),g.visible&&!W(g.style)&&(Nz(y,g.style),M(g.padding)&&(y.padding=g.padding)),y}var o1={color:vF,size:pF},s1={orient:"right",position:"middle",padding:[16,24],title:{visible:!1,padding:0,textStyle:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"primaryFontColor"}},space:12},handler:{visible:!0},startText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6},endText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6},handlerText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6}},l1=function(t){var e={width:200,height:8,style:{fill:{type:"palette",key:"sliderRailColor"}}};return t?(e.width=200,e.height=8):(e.width=8,e.height=200),Object.assign(Object.assign({},s1),{rail:e,handler:{style:{symbolType:"circle",lineWidth:0,outerBorder:{lineWidth:2,distance:.8,stroke:"#ffffff"},shadowBlur:12,shadowOffsetX:0,shadowOffsetY:4,shadowColor:{type:"palette",key:"shadowColor"}}}})},u1={horizontal:l1(!0),vertical:l1(!1)},h1=function(t){var e={style:{fill:{type:"palette",key:"sliderRailColor"}}};return t?(e.width=200,e.height=4):(e.height=200,e.width=4),Object.assign(Object.assign({},s1),{sizeBackground:{fill:{type:"palette",key:"dataZoomChartColor"}},track:{style:{fill:{type:"palette",key:"sliderTrackColor",a:.8}}},rail:e,handler:{style:{symbolType:"circle",lineWidth:0,outerBorder:{lineWidth:2,distance:.8,stroke:{type:"palette",key:"sliderTrackColor"}},fill:{type:"palette",key:"sliderHandleColor"}}}})},c1={horizontal:h1(!0),vertical:h1(!1)},d1=["#C4E7FF","#98CAFF","#75ACFF","#518FF9","#2775DC","#005CBE","#00429F","#00287E"],v1=[2,10],f1=function(e){function r(t,e){var a;n(this,r),(a=i(this,r,[t,e])).type=c.colorLegend,a.name=c.colorLegend;var o="color"===a._spec.type?c.colorLegend:c.sizeLegend;return a.type=o,a.name=o,a}return h(r,e),a(r,[{key:"setAttrFromSpec",value:function(){_(r,"setAttrFromSpec",this,3)([]),this._field=this._spec.field,this._legendType=this._spec.type}},{key:"init",value:function(e){var i=this;_(r,"init",this,3)([e]),tz(this._regions,(function(e){e.addViewDataFilter({type:"continuousLegendFilter",options:{selected:function(){return i._selectedData},field:function(){return i._field},data:function(){return i._legendData.getLatestData()},isHierarchyData:e.isHierarchyData,customFilter:i._spec.customFilter},level:t.TransformLevel.legendFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},{key:"_getScaleInGlobal",value:function(){var t=this._option.globalScale,e=this._spec.scale;return e||(e=this._legendType),t.getScale(e)}},{key:"_initLegendData",value:function(){var t=this;fH(this._option.dataSet,"continuousLegendFilter",r1),fH(this._option.dataSet,"continuousLegendDataMake",n1);var e=new Ko(this._option.dataSet,{name:"".concat(this.type,"_").concat(this.id,"_data")});return e.transform({type:"continuousLegendDataMake",options:{series:function(){return ez(t._regions,{userId:t._seriesUserId,specIndex:t._seriesIndex})},field:function(){return t._field},scale:this._getScaleInGlobal.bind(this)}}),e}},{key:"_initSelectedData",value:function(){this._spec.defaultSelected?this._selectedData=this._spec.defaultSelected.slice():this._selectedData=this._legendData.getLatestData()}},{key:"_addDefaultTitleText",value:function(t){var e,i,n,r;if((null===(e=t.title)||void 0===e?void 0:e.visible)&&C(t.title.text)&&C(null===(i=t.title.style)||void 0===i?void 0:i.text)){var a=this._field;if(a){var o=null===(r=null===(n=this._regions)||void 0===n?void 0:n[0])||void 0===r?void 0:r.getSeries()[0];if(!o)return;return void(t.title.text=Nj(o.getRawData(),a))}var s=this._spec.scale;s||(s=this._legendType);var l=this._option.globalScale.getScaleSpec(s);if(!JS(null==l?void 0:l.domain))return;var u=l.domain[0];if(0===u.fields.length)return;t.title.text=Nj(this._option.dataSet.getDataView(u.dataId),u.fields[0])}}},{key:"_getLegendAttributes",value:function(t){var e,i,n="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",r="horizontal"===n?"bottom":this.layoutOrient,a=[],o=this._getScaleInGlobal();o&&"linear"===o.type&&(a=o.range()),W(a)&&(a="color"===this._legendType?d1:v1);var l=null!==(e=this._legendData.getLatestData()[0])&&void 0!==e?e:0,u=null!==(i=this._legendData.getLatestData()[1])&&void 0!==i?i:1;this._legendData.getLatestData()[0]===this._legendData.getLatestData()[1]&&(l=Math.min(0,this._legendData.getLatestData()[0]),u=0===this._legendData.getLatestData()[0]?1:Math.max(0,this._legendData.getLatestData()[0]));var h=Object.assign(s({layout:n,align:r,zIndex:this.layoutZIndex,min:l,max:u,value:this._spec.defaultSelected},"color"===this._legendType?"colors":"sizeRange",a),a1(this._spec));return this._addDefaultTitleText(h),h}},{key:"_getLegendConstructor",value:function(){return o1[this._legendType]}},{key:"_initEvent",value:function(){var e=this;if(this._legendComponent){var i=!1!==this._spec.filter;this._legendComponent.addEventListener("change",Lt((function(n){var r=G(n,"detail.value");i&&e.setSelectedData(r),e.event.emit(t.ChartEvent.legendFilter,{model:e,value:r,event:n})}),30))}}}],[{key:"getSpecInfo",value:function(t){var e=IU(t,this.specKey,this.type,(function(t){return"color"===(e=t.type)||"size"===e;var e}));return e&&e.forEach((function(t){t.type="color"===t.spec.type?c.colorLegend:c.sizeLegend})),e}}])}(e1);f1.specKey="legends",f1.builtInTheme={colorLegend:u1,sizeLegend:c1},f1.type=c.continuousLegend;var p1=function(t,e){return M(e)?t.map((function(t){return e[t]})):void 0},g1=function(t,e){return function(i){return t.every((function(t,n){return i[t]===(null==e?void 0:e[n])}))}},y1=function(t){return!C(t)&&(O(t)?t.length>0&&t.every(M):Object.keys(t).length>0)};function m1(t,e,i){var n,r,a,o,s,l,u,h=Object.assign({regionIndex:0},e),c=i.getOption(),d=c.getRegionsInUserIdOrIndex(M(h.regionId)?[h.regionId]:void 0,M(h.regionIndex)?[h.regionIndex]:void 0)[0];if(!d)return"none";var v=k1(t,d),f=null!==(n=h.activeType)&&void 0!==n?n:v.length>1?"dimension":"mark",p=d.getLayoutStartPoint(),g=d.getLayoutRect(),y=c.globalInstance.getContainer(),m=Object.assign({x:0,y:0},y?function(t){var e=t.getBoundingClientRect();return{x:e.x,y:e.y}}(y):{}),_=function(t){var e,i=t.data,n=i.dimensionFields,r=i.dimensionData,a=i.measureFields,o=i.measureData,s=i.groupField,l=i.groupData;return null===(e=t.series.getViewData())||void 0===e?void 0:e.latestData.find((function(t){return g1(n,r)(t)&&g1(a,o)(t)&&(C(s)||g1([s],[l])(t))}))},k=d.getOption().globalInstance.getStage().window.getViewBoxTransform().getInverse(),x=function(t){var e,i,n=function(t){return{x:Math.min(Math.max(t.x,0),g.width),y:Math.min(Math.max(t.y,0),g.height)}}(t),r=null!==(e=h.x)&&void 0!==e?e:p.x+n.x,a=null!==(i=h.y)&&void 0!==i?i:p.y+n.y,o={x:0,y:0};k.transformPoint({x:r,y:a},o);var s=o.x,l=o.y;return{canvasX:s,canvasY:l,clientX:m.x+s,clientY:m.y+l}};if("dimension"===f){var S=v[0];if(!S)return"none";var A=new Map;v.forEach((function(t){var e;A.has(t.series)||A.set(t.series,[]),null===(e=A.get(t.series))||void 0===e||e.push(t)}));var T=[{value:t[S.data.dimensionFields[0]],data:b(A.keys()).map((function(t){var e,i;return{series:t,datum:null!==(i=null===(e=A.get(t))||void 0===e?void 0:e.map((function(t){return _(t)})))&&void 0!==i?i:[]}}))}];M(S.dimType)&&(T[0].position=S.pos[S.dimType],T[0].dimType=S.dimType);var w={changePositionOnly:!1,action:"enter",tooltip:null,dimensionInfo:T,chart:null!==(r=c.globalInstance.getChart())&&void 0!==r?r:void 0,datum:void 0,model:void 0,source:sH.chart,event:x({x:v.reduce((function(t,e){return t+e.pos.x}),0)/v.length,y:v.reduce((function(t,e){return t+e.pos.y}),0)/v.length}),item:void 0};null===(s=null===(o=null===(a=i.processor)||void 0===a?void 0:a.dimension)||void 0===o?void 0:o.showTooltip)||void 0===s||s.call(o,T,w,!1);var E=c.globalInstance;return TU.globalConfig.uniqueTooltip&&TU.hideTooltip(E.id),f}if("mark"===f){var B=v[0];if(!B)return"none";var P=null!==(l=B.data.originDatum)&&void 0!==l?l:Object.assign(Object.assign({},_(B)),t),O=[{datum:[P],series:B.series}],I={changePositionOnly:!1,tooltip:null,dimensionInfo:[{value:P[B.data.dimensionFields[0]],data:O}],chart:null!==(u=c.globalInstance.getChart())&&void 0!==u?u:void 0,datum:P,model:B.series,source:sH.chart,event:x(B.pos),item:void 0};i.processor.mark.showTooltip({datum:P,mark:null,series:B.series},I,!1);var R=c.globalInstance;return TU.globalConfig.uniqueTooltip&&TU.hideTooltip(R.id),f}return"none"}var _1,b1,k1=function(t,e){var i=e.getSeries(),n=[];return i.forEach((function(e){var i,r,a,o,s,l,u,h=e.getDimensionField(),c=e.getMeasureField(),d=e.getSeriesField(),v=M(d)?t[d]:void 0,f=M(d)&&null!==(o=null===(a=null===(r=null===(i=e.getViewDataStatistics)||void 0===i?void 0:i.call(e))||void 0===r?void 0:r.latestData[d])||void 0===a?void 0:a.values)&&void 0!==o?o:[],p=p1(h,t),g=p1(c,t),y=y1(g),_=!y&&M(d)&&C(v)&&f.length>0,b=function(){var t,i=null===(t=e.getViewData())||void 0===t?void 0:t.latestData.find(g1(h,p));if(y||(g=p1(c,i),y1(g))){var r=e.type===nz.pie?e.dataToCentralPosition(i):e.dataToPosition(i);C(r)||isNaN(r.x)||isNaN(r.y)||n.push({pos:r,data:{dimensionFields:h,dimensionData:p,measureFields:c,measureData:g,hasMeasureData:y,groupField:d,groupData:v},series:e})}};if("cartesian"===e.coordinate){var k=e,x=FI(null===(l=null===(s=e.getYAxisHelper())||void 0===s?void 0:s.getScale(0))||void 0===l?void 0:l.type)?"y":"x",S=h.map((function(t,e){return[t,e]})).filter((function(t){var e=m(t,2)[1];return C(null==p?void 0:p[e])})),A=[null!=p?p:[]];S.length>0&&S.forEach((function(t){var i,n,r,a,o=m(t,2),s=o[0],l=o[1],u=null!==(a=null===(r=null===(n=null===(i=e.getViewDataStatistics)||void 0===i?void 0:i.call(e))||void 0===n?void 0:n.latestData[s])||void 0===r?void 0:r.values)&&void 0!==a?a:[],h=[];A.forEach((function(t){u.forEach((function(e){var i,n=null!==(i=null==t?void 0:t.slice())&&void 0!==i?i:[];n[l]=e,h.push(n)}))})),A=h})),A.forEach((function(t){var i,r;if(_){var a=null===(i=k.getViewData())||void 0===i?void 0:i.latestData.filter(g1(h,t));f.forEach((function(i){var r=a.find((function(t){return t[d]===i}));if(g=p1(c,r),y1(g)){var o=k.dataToPosition(r);C(o)||isNaN(o.x)||isNaN(o.y)||n.push({pos:o,data:{dimensionFields:h,dimensionData:t,measureFields:c,measureData:g,hasMeasureData:y,groupField:d,groupData:i},series:e,dimType:x})}}))}else{var o=null===(r=k.getViewData())||void 0===r?void 0:r.latestData.find(g1(h,t));if(!y&&(g=p1(c,o),!y1(g)))return;var s=k.dataToPosition(o);if(C(s)||isNaN(s.x)||isNaN(s.y))return;n.push({pos:s,data:{dimensionFields:h,dimensionData:t,measureFields:c,measureData:g,hasMeasureData:y,groupField:d,groupData:v},dimType:x,series:e})}}))}else if("polar"===e.coordinate)if(e.type===nz.pie)b();else{var T=e;if(_){var w=(null===(u=T.getViewData())||void 0===u?void 0:u.latestData.filter(g1(h,p))).find((function(t){return t[d]===v}));f.forEach((function(t){if(g=p1(c,w),y1(g)){var i=T.dataToPosition(w);C(i)||isNaN(i.x)||isNaN(i.y)||n.push({pos:i,data:{dimensionFields:h,dimensionData:p,measureFields:c,measureData:g,hasMeasureData:y,groupField:d,groupData:t},series:e})}}))}else b()}else"geo"===e.coordinate&&function(){var i,r,a;console.log("parseMarkInfoOfGeoSeries");var o=null===(i=e.getViewData())||void 0===i?void 0:i.latestData.find(g1(h,p)),s=e.getNameMap(),l=null===(a=null===(r=e.getMapViewData)||void 0===r?void 0:r.call(e))||void 0===a?void 0:a.latestData.find((function(t){return h.every((function(e,i){return"name"===e?s[t.properties[e]]===(null==p?void 0:p[i]):t.properties[e]===(null==p?void 0:p[i])}))}));if(l){var u=g;if(l&&!o&&(o=Object.assign({},t)),!y){if(u=g=p1(c,o),!y1(g)&&!o)return;y1(g)||(g=[null])}var f=e.dataToPosition(o);C(f)||isNaN(f.x)||isNaN(f.y)||n.push({pos:f,data:{dimensionFields:h,dimensionData:p,measureFields:c,measureData:u,hasMeasureData:y,groupField:d,groupData:v,originDatum:o},series:e})}}()})),n},x1=function(t){return M(t)&&!O(t)},S1=function(t){return M(t)&&O(t)},A1=["panel","shape","titleLabel","keyLabel","valueLabel","spaceRow","maxContentHeight","align"],C1=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_shouldMergeThemeToSpec",value:function(){return!1}},{key:"_initTheme",value:function(t,i){var n=_(e,"_initTheme",this,3)([t,i]),r=n.spec,a=n.theme,o=Nz.apply(void 0,[{}].concat(b(A1.map((function(t){return void 0!==(null==a?void 0:a[t])?s({},t,a[t]):void 0}))),[null==a?void 0:a.style])),l=Nz({},a);A1.forEach((function(t){delete l[t]})),delete l.style;var u=Nz({},l,r);return u.style=Nz({},o,u.style),{spec:u,theme:a}}},{key:"_transformSpecAfterMergingTheme",value:function(t,i,n){var r,a,o,s,l,u,h;_(e,"_transformSpecAfterMergingTheme",this,3)([t,i,n]),t.visible=null===(r=t.visible)||void 0===r||r,t.activeType=function(t){var e,i,n;if(!1===(null==t?void 0:t.visible))return[];var r={mark:!1!==(null===(e=null==t?void 0:t.mark)||void 0===e?void 0:e.visible),dimension:!1!==(null===(i=null==t?void 0:t.dimension)||void 0===i?void 0:i.visible),group:!1!==(null===(n=null==t?void 0:t.group)||void 0===n?void 0:n.visible)};return M(null==t?void 0:t.activeType)&&Object.keys(r).forEach((function(e){var i;r[e]=null===(i=null==t?void 0:t.activeType)||void 0===i?void 0:i.includes(e)})),Object.keys(r).filter((function(t){return r[t]}))}(t),t.renderMode=null!==(a=t.renderMode)&&void 0!==a?a:KS(this._option.mode)||!GS(this._option.mode)?"canvas":"html",t.trigger=null!==(o=t.trigger)&&void 0!==o?o:"hover",t.className=null!==(s=t.className)&&void 0!==s?s:"vchart-tooltip-element",t.enterable=null!==(l=t.enterable)&&void 0!==l&&l,t.transitionDuration=null!==(u=t.transitionDuration)&&void 0!==u?u:150,t.confine=null!==(h=t.confine)&&void 0!==h?h:"canvas"===t.renderMode,M(t.parentElement)?P(t.parentElement)&&(t.parentElement=z_.getElementById(t.parentElement)):GS(this._option.mode)&&(t.parentElement=null==WS?void 0:WS.body)}}])}(LW),M1={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:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"primaryFontColor"},fontWeight:"bold",textBaseline:"middle",spacing:0},shape:{size:8,spacing:6},keyLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"secondaryFontColor"},textBaseline:"middle",spacing:26},valueLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"primaryFontColor"},fontWeight:"bold",textBaseline:"middle",spacing:0}},T1=function(r){function o(){var r;return n(this,o),(r=i(this,o,arguments)).layoutZIndex=1,r.type=c.tooltip,r.name=c.tooltip,r.transformerConstructor=C1,r.specKey="tooltip",r.layoutType="none",r._isReleased=!1,r.enable=!0,r._alwaysShow=!1,r._eventList=[],r._isTooltipShown=!1,r._clickLock=!1,r._mountEvent=function(t,e,i){r.event.on(t,e,i),r._eventList.push({eventType:t,handler:i})},r._handleClickToLock=function(t){var e,i;if(r._clickLock)r._handleChartMouseOut(t),r._clickLock=!1;else{if(!r._isTooltipShown&&!(null===(i=null===(e=r.tooltipHandler)||void 0===e?void 0:e.isTooltipShown)||void 0===i?void 0:i.call(e)))return;r._clickLock=!0}},r._getMouseOutHandler=function(t){return function(e){var i,n,a,o,s;if(!r._isReleased&&!r._alwaysShow&&!r._clickLock&&(r._isTooltipShown||(null===(n=null===(i=r.tooltipHandler)||void 0===i?void 0:i.isTooltipShown)||void 0===n?void 0:n.call(i)))){var l=GS(null===(a=r._option)||void 0===a?void 0:a.mode),u=e.event,h=u.clientX,c=u.clientY;l&&t&&r._isPointerInChart({x:h,y:c})||(r._enterable?r._outTimer=setTimeout((function(){r._handleChartMouseOut(e)}),null!==(s=null===(o=r._spec)||void 0===o?void 0:o.showDelay)&&void 0!==s?s:50):r._handleChartMouseOut(e))}}},r._handleChartMouseOut=function(t){var i;r._cacheActiveType&&(null===(i=r._option)||void 0===i?void 0:i.componentShowContent)&&(!1===r._option.componentShowContent.tooltip||T(r._option.componentShowContent.tooltip)&&!1===r._option.componentShowContent.tooltip[r._cacheActiveType])||r._alwaysShow||r._isReleased||r._isEnterTooltip||"none"!==r._spec.triggerOff&&(r._hideTooltipByHandler(Object.assign(Object.assign({},t),{tooltip:e(r)})),r._handleMouseMove&&r._handleMouseMove.cancel&&r._handleMouseMove.cancel(),r._cacheEnterableRect=null,r._cacheInfo=void 0,r._cacheParams=void 0,r._cacheActiveType=void 0)},r._getMouseMoveHandler=function(t){return function(e){var i,n,a,o;r._isReleased||r._isEnterTooltip||(r._outTimer&&(clearTimeout(r._outTimer),r._outTimer=null),r.tooltipHandler||r._initHandler(),r.processor||r._initProcessor(),r._alwaysShow||(r._clickLock?t&&(r._handleChartMouseOut(e),r._clickLock=!1):!t&&r._enterable&&(null===(n=null===(i=r.tooltipHandler)||void 0===i?void 0:i.isTooltipShown)||void 0===n?void 0:n.call(i))?(r._showTimer&&clearTimeout(r._showTimer),r._showTimer=setTimeout((function(){r._handleChartMouseMove(e,t)}),null!==(o=null===(a=r._spec)||void 0===a?void 0:a.showDelay)&&void 0!==o?o:50)):r._handleChartMouseMove(e,t)))}},r._handleChartMouseMove=function(t,e){if(!r._isReleased){for(var i=r._getMouseEventData(t),n=i.tooltipInfo.dimension,a=i.ignore.mark,o={mark:!1,dimension:!1,group:!1},s=["group","mark","dimension"],l=0,u=s.length;l<u;l++){var h=s[l],c=!!r.processor[h]&&r._showTooltipByMouseEvent(h,i,t,e);if("unShowByOption"===c)o[h]="unShowByOption";else if(c){o[h]=!0;break}}Object.values(o).every((function(t){return!t}))&&!function(t){return C(t.mark)&&C(t.model)&&C(t.datum)}(t)&&(a&&x1(r._cacheInfo)?o.mark=r._showTooltipByMouseEvent("mark",i,t,e,!0):M(n)&&(o.dimension=r._showTooltipByMouseEvent("dimension",i,t,e))),!0===o.mark||!0===o.group||!0===o.dimension&&!C(n)?r._initEventOfTooltipContent():r._cacheActiveType&&"unShowByOption"===o[r._cacheActiveType]||r._handleChartMouseOut(t)}},r._showTooltipByMouseEvent=function(t,e,i,n,a){var o;if(!r._showContentByEvent(t))return"unShowByOption";var s,l=r.processor[t];if(!l.shouldHandleTooltip(i,e.tooltipInfo[t]))return!1;if(r._hideTimer&&clearTimeout(r._hideTimer),a)s=!l.showTooltip(r._cacheInfo,i,!0);else{var u=e.tooltipInfo[t],h=r._isSameAsCache(u,i,t);(s=!l.showTooltip(u,i,h))&&(r._cacheInfo=u,r._cacheParams=i,r._cacheActiveType=t)}s&&(r._isTooltipShown=!0,n&&r._spec.lockAfterClick&&!r._clickLock?r._clickLock=!0:Number.isFinite(r._spec.hideTimer)&&(r._hideTimer=setTimeout((function(){r._handleChartMouseOut()}),r._spec.hideTimer)));var c=null===(o=r._option)||void 0===o?void 0:o.globalInstance;return s&&TU.globalConfig.uniqueTooltip&&c&&TU.hideTooltip(c.id),s},r._getMouseEventData=function(t){var e={tooltipInfo:{},ignore:{}};return Object.keys(r.processor).forEach((function(i){var n=r.processor[i].getMouseEventData(t),a=n.tooltipInfo,o=n.ignore;e.tooltipInfo[i]=a,e.ignore[i]=o})),e},r._hideTooltipByHandler=function(i){var n,a,o;if(!r._isTooltipShown&&!(null===(a=null===(n=r.tooltipHandler)||void 0===n?void 0:n.isTooltipShown)||void 0===a?void 0:a.call(n)))return 0;r.event.emit(t.ChartEvent.tooltipHide,Object.assign(Object.assign({},i),{source:sH.chart,tooltip:e(r)})),Object.values(r.processor).forEach((function(t){t.clearCache()}));var s=null!==(o=r._spec.handler)&&void 0!==o?o:r.tooltipHandler;if(null==s?void 0:s.hideTooltip){var l=s.hideTooltip.call(s,i);return l||(r._isTooltipShown=!1),l}return 1},r.hideTooltip=function(){if(r._isReleased)return!1;var t={changePositionOnly:!1,tooltip:e(r),item:void 0,datum:void 0,source:sH.chart};return r._alwaysShow=!1,!r._hideTooltipByHandler(t)},r}return h(o,r),a(o,[{key:"isTooltipShown",value:function(){return this._isTooltipShown}},{key:"_registerEvent",value:function(){}},{key:"_releaseEvent",value:function(){}},{key:"onLayoutEnd",value:function(){}},{key:"created",value:function(){_(o,"created",this,3)([]),this._regions=this._option.getAllRegions(),this._initEvent()}},{key:"_compareSpec",value:function(t,e){var i=_(o,"_compareSpec",this,3)([t,e]);return!!nt(e,t)||i.reMake||i.reCompile||(i.change=!0,i.reRender=!0,i.effects=Object.assign(Object.assign({},i.effects),{component:!0,render:!0})),i}},{key:"release",value:function(){var t,e,i=this;_(o,"release",this,3)([]),this._isReleased=!0,this._hideTimer&&clearTimeout(this._hideTimer),this._eventList.forEach((function(t){var e=t.eventType,n=t.handler;i.event.off(e,n)})),this._eventList=[],null===(e=null===(t=this.tooltipHandler)||void 0===t?void 0:t.release)||void 0===e||e.call(t),this._isTooltipShown=!1}},{key:"beforeRelease",value:function(){this.event.emit(t.ChartEvent.tooltipHide,{tooltip:this,chart:this.getChart()}),this.event.emit(t.ChartEvent.tooltipRelease,{tooltip:this,chart:this.getChart()})}},{key:"_initHandler",value:function(){var t,e,i,n=null!==(t=this._spec.renderMode)&&void 0!==t?t:"html",r=this._option.globalInstance.getTooltipHandlerByUser();if(r)this.tooltipHandler=r,this._enterable=!1;else{var a="canvas"===n?uY.canvas:uY.dom,o=Uz.getComponentPluginInType(a);o||NS("Can not find tooltip handler: "+a);var s=new o;s.name="".concat(this._spec.className,"-").concat(null!==(e=this._option.globalInstance.id)&&void 0!==e?e:0,"-").concat(this.getSpecIndex()),null===(i=this.pluginService)||void 0===i||i.load([s]),this.tooltipHandler=s,this._spec.enterable&&"html"===n&&this.tooltipHandler?(this._enterable=!0,this._needInitEventOfTooltip=!0):this._enterable=!1}}},{key:"_initEventOfTooltipContent",value:function(){var t,e,i=this;if(this._needInitEventOfTooltip){var n=null===(e=null===(t=this.tooltipHandler)||void 0===t?void 0:t.getRootDom)||void 0===e?void 0:e.call(t);n&&(n.addEventListener("pointerenter",(function(){var t;if(i._enterable){i._isEnterTooltip=!0;var e=null===(t=n.getBoundingClientRect)||void 0===t?void 0:t.call(n);e&&(i._cacheEnterableRect={width:e.width,height:e.height}),i._outTimer&&(clearTimeout(i._outTimer),i._outTimer=null),i._showTimer&&(clearTimeout(i._showTimer),i._showTimer=null)}})),n.addEventListener("pointerleave",(function(){var t,e,r;if(i._enterable&&(i._isEnterTooltip=!1,"none"!==i._spec.triggerOff&&i._cacheEnterableRect)){var a=null===(t=n.getBoundingClientRect)||void 0===t?void 0:t.call(n);a&&Object.keys(i._cacheEnterableRect).every((function(t){return i._cacheEnterableRect[t]===a[t]}))&&(i._cacheEnterableRect=null,i._outTimer=setTimeout(i.hideTooltip,null!==(r=null===(e=i._spec)||void 0===e?void 0:e.showDelay)&&void 0!==r?r:50))}})),this._needInitEventOfTooltip=!1)}}},{key:"_initProcessor",value:function(){var t=this,e=this._spec.activeType;this.processor={},e.forEach((function(e){var i=Uz.createTooltipProcessor(e,t);i&&(t.processor[e]=i)}))}},{key:"_initEvent",value:function(){var t,e=this;if(!this._option.disableTriggerEvent){var i=ot(null!==(t=this._spec.trigger)&&void 0!==t?t:"hover"),n=ot(this._spec.triggerOff),r=this._option.mode;i.forEach((function(t){var i;"hover"===t?(e._handleMouseMove=e._throttle(e._getMouseMoveHandler(!1)),e._mountEvent("pointermove",{source:"chart"},e._handleMouseMove),(YS(r)||KS(r))&&(e._mountEvent("pointerdown",{source:"chart"},e._getMouseMoveHandler(!1)),e._mountEvent("pointerup",{source:"window"},e._getMouseOutHandler(!0))),e._mountEvent("pointerleave",{source:"chart"},e._getMouseOutHandler(!1))):"click"===t?(e._mountEvent("pointertap",{source:"chart"},e._getMouseMoveHandler(!0)),e._mountEvent("pointerup",{source:"window"},e._getMouseOutHandler(!0))):T(t)&&e._mountEvent(t.eventType,{source:null!==(i=t.source)&&void 0!==i?i:"chart",consume:t.consume},e._getMouseMoveHandler(!0))})),n.filter((function(t){return T(t)})).forEach((function(t){var i,n;e._mountEvent(t.eventType,{source:null!==(i=t.source)&&void 0!==i?i:"chart",consume:t.consume},e._getMouseOutHandler(null!==(n=t.checkOutside)&&void 0!==n&&n))})),!i.includes("click")&&this._spec.lockAfterClick&&this._mountEvent("pointertap",{source:"chart"},this._handleClickToLock)}}},{key:"_throttle",value:function(t){return Dt(t,L(this._spec.throttleInterval)?this._spec.throttleInterval:"html"===this._spec.renderMode&&this._spec.transitionDuration?50:10)}},{key:"_showContentByEvent",value:function(t){var e;if(null===(e=this._option)||void 0===e?void 0:e.componentShowContent){if(!1===this._option.componentShowContent.tooltip)return!1;if(T(this._option.componentShowContent.tooltip)&&!1===this._option.componentShowContent.tooltip[t])return!1}return!0}},{key:"reInit",value:function(t){var e,i,n;if(_(o,"reInit",this,3)([t]),this.tooltipHandler){var r=null!==(e=this._spec.renderMode)&&void 0!==e?e:"html",a=this._spec.enterable&&"html"===r;a&&!this._enterable&&(this._needInitEventOfTooltip=!0),this._enterable=a,null===(n=null===(i=this.tooltipHandler)||void 0===i?void 0:i.reInit)||void 0===n||n.call(i)}else this._initHandler()}},{key:"showTooltip",value:function(t,e){var i;if(this.tooltipHandler||this._initHandler(),this.processor||this._initProcessor(),!(null===(i=this.tooltipHandler)||void 0===i?void 0:i.showTooltip))return!1;var n=m1(t,e,this);return"none"!==n&&(this._alwaysShow=!!(null==e?void 0:e.alwaysShow),this._cacheActiveType=n),n}},{key:"_isSameAsCache",value:function(t,e,i){if(i!==this._cacheActiveType)return!1;if(t===this._cacheInfo)return!0;if(C(this._cacheInfo)||C(t))return!1;if(S1(t)){if(x1(this._cacheInfo))return!1;var n=this._cacheInfo;return n.length===t.length&&t.every((function(t,e){return FV(t,n[e])}))}if(S1(this._cacheInfo))return!1;var r=this._cacheInfo;if((null==t?void 0:t.datum)!==r.datum||(null==t?void 0:t.mark)!==r.mark||(null==t?void 0:t.series)!==r.series)return!1;var a=this._cacheParams;return!C(a)&&!C(e)&&a.mark===e.mark&&a.model===e.model&&a.datum===e.datum}},{key:"_isPointerInChart",value:function(t){var e,i=null===(e=this._option)||void 0===e?void 0:e.globalInstance;if(!i)return!1;if(!i.getChart())return!1;var n=t.x,r=t.y,a=i.getCanvas().getBoundingClientRect(),o=a.x,s=a.y,l=a.width,u=a.height;return n>=o&&n<=o+l&&r>=s&&r<=s+u}},{key:"getVisible",value:function(){return!1!==this._spec.visible}}])}(DW);T1.type=c.tooltip,T1.transformerConstructor=C1,T1.builtInTheme={tooltip:M1},T1.specKey="tooltip",function(t){t[t.success=0]="success",t[t.failed=1]="failed"}(_1||(_1={})),function(t){t[t.ALL=3]="ALL",t[t.HORIZONTAL=2]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(b1||(b1={}));var w1={x:["top","bottom"],y:["left","right"],category:["angle"],value:["radius"]},E1={labelZIndex:!0,gridZIndex:!0},B1={xField:!0,yField:!0,categoryField:!0,valueField:!0},P1={visible:!0,width:!0,style:!0},O1=function(e){function o(e,r){var a;return n(this,o),(a=i(this,o,[e,r])).specKey="crosshair",a.layoutType="none",a.gridZIndex=t.LayoutZIndex.CrossHair_Grid,a.labelZIndex=t.LayoutZIndex.CrossHair,a.trigger="hover",a._handleIn=function(t){if(a._option){var e=a.calculateTriggerPoint(t),i=e.x,n=e.y;a.showDefault=!1,a._layoutCrosshair(i,n);var r=a._getNeedClearVRenderComponents();a._hasActive=r.some((function(t){return t&&!1!==t.attribute.visible}))}},a._handleClickInEvent=function(t){if(!a._hasActive||!a._spec.lockAfterClick||a._clickLock)return a._clickLock?(a._clickLock=!1,void a._handleOutEvent()):void(a._onlyLockClick||(a._handleIn(t),L(a.triggerOff)&&(a._timer&&clearTimeout(a._timer),a._timer=setTimeout((function(){a._handleOutEvent()}),a.triggerOff))));a._clickLock=!0},a._handleHoverInEvent=Dt((function(t){a._clickLock||a._handleIn(t)}),10),a._handleOutEvent=function(){a.enableRemain||a._clickLock||!a._hasActive||(a.clearOutEvent(),a.hideCrosshair())},a._handleTooltipShow=function(t){var e=t.tooltipData;if(!t.isEmptyTooltip&&e&&e.length)if(T(a._spec.followTooltip)&&!1===a._spec.followTooltip[t.activeType])a._handleTooltipHideOrRelease();else{var i=a.calculateTriggerPoint(t),n=i.x,r=i.y;a.showDefault=!1,a._layoutCrosshair(n,r,e,t.activeType);var o=a._getNeedClearVRenderComponents();a._hasActive=o.some((function(t){return t&&!1!==t.attribute.visible}))}else a._handleTooltipHideOrRelease()},a._handleTooltipHideOrRelease=function(){a.clearOutEvent(),a.hideCrosshair()},a.enable=!0,a.showDefault=!0,a}return h(o,e),a(o,[{key:"enableRemain",get:function(){return"none"===this.triggerOff}},{key:"_setAllAxisValues",value:function(t,e,i){var n=this,r=!1;if(t.forEach((function(t){FI(t.axis.getScale().type)&&(r?n.enable=!1:r=!0)})),!this.enable)return!1;var a=this._stateByField[i].currentValue;return t.forEach((function(t,i){var r=t.axis;a.set(i,{datum:n._getDatumAtPoint(r,e),axis:r})})),!0}},{key:"clearAxisValue",value:function(){var t=this;Object.keys(this._stateByField).forEach((function(e){t._stateByField[e].currentValue.clear()}))}},{key:"hideCrosshair",value:function(){this.clearAxisValue(),this.hide()}},{key:"showCrosshair",value:function(t){var e=this;t&&t.length&&(this.showDefault=!1,this.clearAxisValue(),t.forEach((function(t){var i=t.axis,n=t.value;e.setAxisValue(n,i)})),this.layoutByValue(!1))}},{key:"_getLimitBounds",value:function(){var t,e;if(!this._limitBounds){var i=null!==(e=null===(t=this._option.globalInstance.getChart())||void 0===t?void 0:t.getViewRect())&&void 0!==e?e:{width:0,height:0},n=i.width,r=i.height;this._limitBounds={x1:0,y1:0,x2:n,y2:r}}return this._limitBounds}},{key:"_showDefaultCrosshairBySpec",value:function(){var t=this,e=!1;return Object.keys(this._stateByField).forEach((function(i){var n=t._spec[i];if(n&&n.visible&&n.defaultSelect){var r=n.defaultSelect,a=r.axisIndex,o=void 0===a?0:a,s=r.datum,l=t._option.getComponentsByKey("axes").find((function(t){return t.getSpecIndex()===o}));l&&(e=!0,t._stateByField[i].currentValue.clear(),t._stateByField[i].currentValue.set(o,{axis:l,datum:s}))}})),e}},{key:"_updateVisibleCrosshair",value:function(){var t=this,e=!1;Object.keys(this._stateByField).forEach((function(i){var n=t._spec[i];n&&n.visible&&t._stateByField[i].currentValue.size?e=!0:t._hideByField(i)})),e&&this.layoutByValue(!1)}},{key:"_showDefaultCrosshair",value:function(){this.showDefault?this._showDefaultCrosshairBySpec()&&this.layoutByValue(!1):this._updateVisibleCrosshair()}},{key:"setAttrFromSpec",value:function(){_(o,"setAttrFromSpec",this,3)([]),this._parseCrosshairSpec()}},{key:"created",value:function(){_(o,"created",this,3)([]),this._initEvent()}},{key:"_compareSpec",value:function(t,e){var i=_(o,"_compareSpec",this,3)([t,e]);return!nt(e,t)&&(i.change=!0,i.reRender=!0,i.reMake||(this._isComponentOnlySpecChange(t,e)?i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0}):i.reMake=!0)),i}},{key:"_isComponentOnlySpecChange",value:function(t,e){var i=this;return Object.keys(Object.assign(Object.assign({},e),t)).every((function(n){return nt(null==e?void 0:e[n],null==t?void 0:t[n])||E1[n]||B1[n]&&i._isFieldComponentOnlySpecChange(null==e?void 0:e[n],null==t?void 0:t[n])}))}},{key:"_isFieldComponentOnlySpecChange",value:function(t,e){var i=this;return Object.keys(Object.assign(Object.assign({},t),e)).every((function(n){return nt(null==t?void 0:t[n],null==e?void 0:e[n])||"label"===n||"line"===n&&i._isLineComponentOnlySpecChange(null==t?void 0:t.line,null==e?void 0:e.line)}))}},{key:"_isLineComponentOnlySpecChange",value:function(t,e){return Object.keys(Object.assign(Object.assign({},t),e)).every((function(i){return nt(null==t?void 0:t[i],null==e?void 0:e[i])||P1[i]}))}},{key:"_initEvent",value:function(){var t=this;if(!this._option.disableTriggerEvent)if(this._spec.followTooltip)this._registerTooltipEvent();else{var e=this._getTriggerEvent();e&&e.forEach((function(e){t._registerEvent(e.in,!1,e.click),e.out&&t._registerEvent(e.out,!0)}))}}},{key:"_registerEvent",value:function(t,e,i){var n,r=this;if(!1!==(null===(n=this._option.componentShowContent)||void 0===n?void 0:n.crosshair)){var a=e?this._handleOutEvent:i?this._handleClickInEvent:this._handleHoverInEvent,o=e?{level:lH.chart}:{source:sH.chart};O(t)?t.forEach((function(t){r.event.on(t,o,a)})):this.event.on(t,o,a)}}},{key:"_eventOff",value:function(t,e,i){var n=this,r=e?this._handleOutEvent:i?this._handleClickInEvent:this._handleHoverInEvent;O(t)?t.forEach((function(t){n.event.off(t,r)})):this.event.off(t,r)}},{key:"onBeforeRender",value:function(){this._limitBounds=null,this._showDefaultCrosshair()}},{key:"calculateTriggerPoint",value:function(t){var e=t.event,i=this._option.getCompiler().getStage().getLayer(void 0),n={x:e.viewX,y:e.viewY};return i.globalTransMatrix.transformPoint({x:e.viewX,y:e.viewY},n),{x:n.x-this.getLayoutStartPoint().x,y:n.y-this.getLayoutStartPoint().y}}},{key:"_getTriggerEvent",value:function(){var e=this,i=this._option.mode,n=function(e){return e===t.RenderModeEnum["desktop-browser"]||e===t.RenderModeEnum["desktop-miniApp"]?{click:"pointertap",hover:"pointermove",hoverOut:"pointerleave",clickOut:"pointerleave"}:YS(e)||KS(e)?{click:"tap",hover:["pointerdown","pointermove"],hoverOut:"pointerleave",clickOut:"pointerleave"}:null}(void 0===i?t.RenderModeEnum["desktop-browser"]:i);if(n){var r=ot(this.trigger||"hover"),a=function(t){return"click"===t?"none"===e.triggerOff?null:n.clickOut:n.hoverOut};this._spec.lockAfterClick&&!r.includes("click")?(r.push("click"),this._onlyLockClick=!0):this._onlyLockClick=!1;var o=[];return r.forEach((function(t){o.push({click:"click"===t,in:n[t],out:a(t)})})),o}return null}},{key:"_registerTooltipEvent",value:function(){this.event.on(t.ChartEvent.tooltipHide,{source:sH.chart},this._handleTooltipHideOrRelease),this.event.on(t.ChartEvent.tooltipShow,{source:sH.chart},this._handleTooltipShow),this.event.on(t.ChartEvent.tooltipRelease,{source:sH.chart},this._handleTooltipHideOrRelease)}},{key:"_getAxisInfoByField",value:function(t){var e,i,n=null===(i=(e=this._option).getComponentsByKey)||void 0===i?void 0:i.call(e,"axes");if(!(null==n?void 0:n.length))return null;var r=G(this._spec,"".concat(t,"Field.bindingAxesIndex"));if(r||(r=[],n.forEach((function(e,i){w1[t].includes(e.getOrient())&&r.push(i)}))),!r.length)return null;var a=new Map,o=1/0,s=1/0,l=-1/0,u=-1/0,h=this.getLayoutStartPoint(),c=h.x,d=h.y;return r.forEach((function(t){var e,i;o=1/0,s=1/0,l=-1/0,u=-1/0;var r=n.find((function(e){return e.getSpecIndex()===t}));if(r){var h=(null===(i=(e=r).getInnerOffset)||void 0===i?void 0:i.call(e))||{left:0,right:0,top:0,bottom:0};r.getRegions().forEach((function(t){var e=t.getLayoutStartPoint(),i=e.x,n=e.y;o=Math.min(o,i-c+h.left),s=Math.min(s,n-d+h.top),l=Math.max(l,i+t.getLayoutRect().width-c-h.right),u=Math.max(u,n+t.getLayoutRect().height-d-h.bottom)})),a.set(t,{x1:o,y1:s,x2:l,y2:u,axis:r})}})),a}},{key:"onLayoutEnd",value:function(){var t=this._regions[0];this.setLayoutRect(t.getLayoutRect()),this.setLayoutStartPosition(t.getLayoutStartPoint()),_(o,"onLayoutEnd",this,3)([])}},{key:"_releaseEvent",value:function(){var t=this;this.clearOutEvent();var e=this._getTriggerEvent();e&&e.forEach((function(e){t._eventOff(e.in,!1,e.click),e.out&&t._eventOff(e.out,!0)}))}},{key:"_parseFieldInfo",value:function(){var t=this;Object.keys(this._stateByField).forEach((function(e){var i=t._spec[e],n=t._stateByField[e].crosshairComp;if(i&&i.visible){if(t._stateByField[e].attributes=t._parseField(i,e),n){var r=t._stateByField[e].attributes,a=r.style,o="rect"===r.type?"rectStyle":"lineStyle";n.setAttributes(s({},o,a))}}else n&&n.parent&&n.parent.removeChild(n)}))}},{key:"_parseCrosshairSpec",value:function(){this._parseFieldInfo();var t=this._spec,e=t.trigger,i=t.triggerOff,n=t.labelZIndex,r=t.gridZIndex;e&&(this.trigger=e),("none"===i||L(i)&&i>0)&&(this.triggerOff=i),void 0!==n&&(this.labelZIndex=n),void 0!==r&&(this.gridZIndex=r)}},{key:"_parseField",value:function(t,e){var i,n,a,o={},s=t.line,l=void 0===s?{}:s,u=t.label,h=void 0===u?{}:u,c=t.visible;if(o.visible=c,o.type=l.type||"line",!1===l.visible)o.style={visible:!1};else{var d=l.style||{},v=d.stroke,f=d.fill,p=d.lineWidth,g=d,y=g.strokeOpacity,m=g.fillOpacity,_=g.opacity,b=r(g,["strokeOpacity","fillOpacity","opacity"]),k="line"===o.type,x=k?y:m;if(L(_)&&(x=(null!=x?x:1)*_),o.style=Object.assign({opacity:x,pickable:!1,visible:!0},b),k)o.style.stroke=v||f,o.style.lineWidth=G(l,"width",p||2);else{o.style.fill=f||v,(null===(n=null===(i=null==t?void 0:t.line)||void 0===i?void 0:i.style)||void 0===n?void 0:n.stroke)&&(o.style.stroke=t.line.style.stroke);var A=G(l,"width");if("string"==typeof A){var C=parseInt(A.substring(0,A.length-1),10)/100;o.style.sizePercent=C}else"number"!=typeof A&&"function"!=typeof A||(o.style.size=A)}}if(h.visible){var M=h.labelBackground||{},T=null!==(a=h.syncAxisLabelAngle)&&void 0!==a&&a,w=h.style||{},E=M.style||{},B=E.fill,P=void 0===B?"rgba(47, 59, 82, 0.9)":B,O=E.stroke,I=E.outerBorder,R=r(E,["fill","stroke","outerBorder"]);o.label={visible:!0,formatMethod:h.formatMethod,formatter:h.formatter,minWidth:M.minWidth,maxWidth:M.maxWidth,padding:M.padding,syncAxisLabelAngle:T,textStyle:Object.assign(Object.assign({fontSize:14,pickable:!1},w),{fill:w.fill||"#fff",stroke:G(w,"stroke")}),panel:(S(M.visible)?M.visible:M)?Object.assign({visible:!0,pickable:!1,fill:P,stroke:O,outerBorder:Object.assign({stroke:P,distance:0,lineWidth:3},I)},R):{visible:!1},zIndex:this.labelZIndex,childrenPickable:!1,pickable:!1}}else o.label={visible:!1};return o}},{key:"_filterAxisByPoint",value:function(t,e,i){return t&&t.forEach((function(n){var r,a,o,s=n.axis;if(a=e,o=i,((r=n).x1>a||r.x2<a||r.y1>o||r.y2<o)&&t.delete(s.getSpecIndex()),s.type.startsWith("polarAxis")){var l=s.getCenter(),u=s.getInnerRadius(),h=s.getOuterRadius(),c=_e.distancePP({x:e,y:i},l);(c>h||c<u)&&t.delete(s.getSpecIndex())}})),t}},{key:"_updateCrosshairLabel",value:function(t,e,i){var n=this.getContainer();t?t.setAttributes(e):(t=new yE(e),null==n||n.add(t),i(t)),function(t,e){var i=e.x1,n=e.y1,r=e.x2,a=e.y2,o=t.AABBBounds,s=o.x1,l=o.y1,u=o.x2,h=o.y2,c=t.attribute,d=c.dx,v=void 0===d?0:d,f=c.dy,p=void 0===f?0:f,g=0,y=0;s<i&&(g=i-s),l<n&&(y=n-l),u>r&&(g=r-u),h>a&&(y=a-h),g&&t.setAttribute("dx",g+v),y&&t.setAttribute("dy",y+p)}(t,this._getLimitBounds())}},{key:"clearOutEvent",value:function(){this._timer&&(clearTimeout(this._timer),this._timer=null),this._clickLock&&(this._clickLock=null),this._hasActive&&(this._hasActive=null)}},{key:"_hideByField",value:function(t){var e=this._stateByField[t],i=e.crosshairComp,n=e.labelsComp;i&&i.hideAll(),n&&Object.keys(n).forEach((function(t){n[t]&&n[t].hideAll()}))}},{key:"hide",value:function(){var t=this;Object.keys(this._stateByField).forEach((function(e){t._hideByField(e)}))}},{key:"_getNeedClearVRenderComponents",value:function(){var t=this;return Object.keys(this._stateByField).reduce((function(e,i){var n=t._stateByField[i],r=n.crosshairComp,a=n.labelsComp;return r&&e.push(r),a&&Object.keys(a).forEach((function(t){a[t]&&e.push(a[t])})),e}),[])}}])}(DW);O1.specKey="crosshair";var I1={trigger:"hover",bandField:{visible:!1,line:{type:"rect",visible:!0,style:{fill:{type:"palette",key:"axisGridColor"},opacity:.7,lineWidth:0,stroke:{type:"palette",key:"markLineStrokeColor"},lineDash:[2,3]}},label:{visible:!1,style:{fontWeight:"normal",fill:{type:"palette",key:"axisMarkerFontColor"},fontSize:{type:"token",key:"l5FontSize"}},labelBackground:{padding:{bottom:0,top:0,left:2,right:2},style:{fill:{type:"palette",key:"axisMarkerBackgroundColor"},cornerRadius:1}}}},linearField:{visible:!1,line:{type:"line",visible:!0,style:{stroke:{type:"palette",key:"markLineStrokeColor"},fill:"transparent",opacity:.7,lineDash:[2,3]}},label:{visible:!1,style:{fontWeight:"normal",fill:{type:"palette",key:"axisMarkerFontColor"},fontSize:{type:"token",key:"l5FontSize"}},labelBackground:{padding:{bottom:0,top:0,left:2,right:2},style:{fill:{type:"palette",key:"axisMarkerBackgroundColor"},cornerRadius:1}}}}},R1=function(t){function e(t,r){var a;return n(this,e),(a=i(this,e,[t,r])).type=c.cartesianCrosshair,a.name=c.cartesianCrosshair,a._stateByField={xField:{coordKey:"x",anotherAxisKey:"y",currentValue:new Map,labelsComp:{top:null,bottom:null}},yField:{coordKey:"y",anotherAxisKey:"x",currentValue:new Map,labelsComp:{left:null,right:null}}},a}return h(e,t),a(e,[{key:"_findAllAxisContains",value:function(t,e){var i=this._getAxisInfoByField("x"),n=this._getAxisInfoByField("y");return{xAxisMap:this._filterAxisByPoint(i,t,e),yAxisMap:this._filterAxisByPoint(n,t,e)}}},{key:"_getDatumAtPoint",value:function(t,e){var i=TV(t.getOrient())?"x":"y",n=e[i]-(t.getLayoutStartPoint()[i]-this.getLayoutStartPoint()[i]);return t.getScale().invert(n)}},{key:"setAxisValue",value:function(t,e){TV(e.getOrient())?this._stateByField.xField.currentValue.set(e.getSpecIndex(),{datum:t,axis:e}):this._stateByField.yField.currentValue.set(e.getSpecIndex(),{datum:t,axis:e})}},{key:"_layoutCrosshair",value:function(t,e,i,n){var r,a=t,o=e;if(i&&i.length)if("dimension"===n){var s,l=i[0],u=l.data.findIndex((function(t){return t.datum.length>0}));if(u>-1){var h=l.data[u];s=h.series.dataToPosition(h.datum[0])}(M(l.dimType)?"y"===l.dimType:wV(null===(r=null==l?void 0:l.axis)||void 0===r?void 0:r.getOrient()))?o=null==s?void 0:s.y:a=null==s?void 0:s.x}else if("mark"===n){var c=i[0],d=c.series.dataToPosition(c.datum[0]);a=null==d?void 0:d.x,o=null==d?void 0:d.y}this.clearAxisValue();var v=this._findAllAxisContains(a,o),f=v.xAxisMap,p=v.yAxisMap;if(f&&0===f.size||p&&0===p.size){if(this.enableRemain)return;this.hide()}else f&&f.size&&this._setAllAxisValues(f,{x:a,y:o},"xField"),p&&p.size&&this._setAllAxisValues(p,{x:a,y:o},"yField"),this.layoutByValue()}},{key:"layoutByValue",value:function(t){var e=this;if(this.enable){var i=az(this._regions,"cartesian");i&&(tY(this._stateByField,i,this.getLayoutStartPoint(),null!=t?t:this.enableRemain),Object.keys(this._stateByField).forEach((function(t){e._layoutByField(t)})))}}},{key:"_layoutByField",value:function(t){var e=this,i=this._stateByField[t],n=i.cacheInfo,r=i.attributes,a=i.labelsComp,o=i.bandSize,l=i.coordKey;if(r&&n&&(!n._isCache||!this.enableRemain)){var u=n.coord,h=n.labels,c=n.visible,d=n.labelsTextStyle;if(c){var v=nY(this._stateByField[t]);this._updateCrosshairByField(t,v),Object.keys(h).forEach((function(i){var c,v,f;if(h[i].visible){var p=Object.assign(Object.assign(Object.assign(s({},l,u+o/2),h[i]),r.label),{angle:r.label.syncAxisLabelAngle&&null!==(v=null===(c=n.axisLabel)||void 0===c?void 0:c.attribute.angle)&&void 0!==v?v:0,textStyle:Object.assign(Object.assign({},null===(f=r.label)||void 0===f?void 0:f.textStyle),d[i]),zIndex:e.labelZIndex,visible:!0});e._updateCrosshairLabel(a[i],p,(function(e){e.name="crosshair-".concat(t.replace("Field",""),"-").concat(i,"-label"),a[i]=e}))}else a[i]&&a[i].hideAll()}))}else this._hideByField(t)}}},{key:"_updateCrosshairByField",value:function(t,e){var i=this.getContainer(),n=this._stateByField[t].attributes,r=this._stateByField[t].crosshairComp;if(r)r.setAttributes(e);else{var a=n.style;"line"===n.type?r=new RE(Object.assign(Object.assign({},e),{lineStyle:a,zIndex:this.gridZIndex+1,disableTriggerEvent:this._option.disableTriggerEvent,pickable:!1})):"rect"===n.type&&(r=new LE(Object.assign(Object.assign({},e),{rectStyle:a,zIndex:this.gridZIndex,disableTriggerEvent:this._option.disableTriggerEvent,pickable:!1}))),null==i||i.add(r),this._stateByField[t].crosshairComp=r}}}],[{key:"getSpecInfo",value:function(t){return IU(t,this.specKey,this.type,(function(t){return t.xField&&!1!==t.xField.visible||t.yField&&!1!==t.yField.visible}))}}])}(O1);R1.specKey="crosshair",R1.builtInTheme={crosshair:I1},R1.type=c.cartesianCrosshair;var L1=function(t){function e(t,r){var a;return n(this,e),(a=i(this,e,[t,r])).type=c.polarCrosshair,a.name=c.polarCrosshair,a._stateByField={categoryField:{coordKey:"angle",anotherAxisKey:"radius",currentValue:new Map,labelsComp:{all:null}},valueField:{coordKey:"radius",anotherAxisKey:"angle",currentValue:new Map,labelsComp:{all:null}}},a}return h(e,t),a(e,[{key:"setAxisValue",value:function(t,e){"radius"===e.getOrient()?this._stateByField.valueField.currentValue.set(e.getSpecIndex(),{datum:t,axis:e}):this._stateByField.categoryField.currentValue.set(e.getSpecIndex(),{datum:t,axis:e})}},{key:"_findAllAxisContains",value:function(t,e){var i=this._getAxisInfoByField("category"),n=this._getAxisInfoByField("value");return{angleAxisMap:this._filterAxisByPoint(i,t,e),radiusAxisMap:this._filterAxisByPoint(n,t,e)}}},{key:"_getDatumAtPoint",value:function(t,e){var i=t.getLayoutStartPoint(),n=i.x,r=i.y,a=this.getLayoutStartPoint(),o=a.x,s=a.y;return t.positionToData({x:e.x-(n-o),y:e.y-(r-s)})}},{key:"_layoutCrosshair",value:function(t,e,i,n){var r=t,a=e;if(i&&i.length)if("dimension"===n){var o=i[0];if(o.axis){var s=o.axis.pointToCoord({x:r,y:a}),l="radius"===o.axis.getOrient()?{radius:o.position,angle:s.angle}:{radius:s.radius,angle:o.position},u=o.axis.coordToPoint(l);r=u.x,a=u.y}}else if("mark"===n){var h=i[0],c=h.series.dataToPosition(h.datum[0]);r=c.x,a=c.y}this.clearAxisValue();var d=this._findAllAxisContains(r,a),v=d.angleAxisMap,f=d.radiusAxisMap;if(0!==v.size||0!==f.size)v&&this._setAllAxisValues(v,{x:r,y:a},"categoryField"),f&&this._setAllAxisValues(f,{x:r,y:a},"valueField"),this.layoutByValue();else{if(this.enableRemain)return;this.hide()}}},{key:"layoutByValue",value:function(t){var e=this;if(this.enable){var i=az(this._regions,"polar");i&&(function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Object.keys(t).forEach((function(n){var r=t[n],a=r.attributes,o=r.currentValue,s=r.cacheInfo,l=r.coordKey;if(a){var u=!!o.size,h=i&&!u&&M(s),c=h?s:{coord:0,axis:null,visible:u,coordRange:[0,0],sizeRange:[0,0],labels:{all:{visible:!1,text:"",offset:0}}};if(s&&(s._isCache=h),"valueField"===n&&(c.sides=e.angleAxisHelper.getScale(0).domain().length),o.forEach((function(t){var i,r=t.axis,o=t.datum,s=void 0===o?"":o,l=r.niceLabelFormatter;if((null===(i=a.label)||void 0===i?void 0:i.visible)&&(c.labels.all.visible=!0,c.labels.all.defaultFormatter=l,c.labels.all.text=s,c.labels.all.offset=cW(r.getSpec())),"categoryField"===n){var u=e.angleAxisHelper.dataToPosition([s]),h=e.angleAxisHelper.getBandwidth(0),d=r.getOuterRadius();c.coord=u,c.coordRange=[u-h/2,u+h/2],c.sizeRange=[d,d]}else{var v=r.startAngle,f=e.radiusAxisHelper.dataToPosition([s]);c.coord=f,c.coordRange=[f,f],c.sizeRange=[v,v]}c.axis=r})),c&&!h&&c.labels.all.visible&&a&&a.label){var d=c.labels.all,v=a.label,f=OU(v.formatMethod,v.formatter,d.text,{label:d.text,orient:l}),p=f.formatFunc,g=f.args;p?d.text=p.apply(void 0,b(g)):d.defaultFormatter&&(d.text=d.defaultFormatter(d.text))}t[n].cacheInfo=c}}))}(this._stateByField,i,null!=t?t:this.enableRemain),Object.keys(this._stateByField).forEach((function(t){e._layoutByField(t)})))}}},{key:"_layoutByField",value:function(t){var e,i,n,r=this._stateByField[t],a=r.cacheInfo,o=r.attributes,s=r.crosshairComp,l=r.labelsComp,u=r.coordKey;if(!(!a||a._isCache&&this.enableRemain)){var h=this.getContainer(),c=a.visible,d=a.labels,v=a.coord,f=a.sizeRange,p=a.axis;if(c){var g=this.getLayoutStartPoint(),y=null===(i=null===(e=this._spec.valueField)||void 0===e?void 0:e.line)||void 0===i?void 0:i.smooth,m=function(t,e,i){var n=t.cacheInfo,r=t.coordKey,a=t.attributes,o=n.axis,s=n.coord,l=n.sizeRange,u=n.coordRange,h=o.getCenter(),c={x:h.x+e.x,y:h.y+e.y};if("angle"===r)return"sector"==("rect"===a.type?"sector":"line")?{center:c,innerRadius:o.getInnerRadius(),radius:o.getOuterRadius(),startAngle:u[0],endAngle:u[1]}:{start:Ae(c,o.getInnerRadius(),s),end:Ae(c,o.getOuterRadius(),s)};var d=o.startAngle,v=o.endAngle,f=n.sides,p=s;if(!i){var g=o.getCenter(),y=o.coordToPoint({angle:l[0],radius:s}),m=Me(g,y),_=(v-d)/f,b=Math.floor((m-d)/_),k=b*_+d,x=Math.min((b+1)*_+d,v),S=Ae(g,s,k),A=Ae(g,s,x),C=Oe([A.x,A.y],[S.x,S.y],[g.x,g.y],[y.x,y.y]);C&&(p=Pt(_e.distancePN(y,C[0],C[1])+s,o.getInnerRadius(),o.getOuterRadius()))}return{center:c,startAngle:d,endAngle:v,radius:p,sides:f}}(this._stateByField[t],g,y);if(s)s.setAttributes(m);else{var _;if("angle"===u){var b="rect"===o.type?"sector":"line";"line"===b?_=new RE(Object.assign(Object.assign({},m),{lineStyle:o.style,zIndex:this.gridZIndex,pickable:!1})):"sector"===b&&(_=new FE(Object.assign(Object.assign({},m),{sectorStyle:o.style,zIndex:this.gridZIndex,pickable:!1})))}else _="polygon"==(y?"circle":"polygon")?new zE(Object.assign(Object.assign({},m),{lineStyle:o.style,zIndex:this.gridZIndex+1})):new DE(Object.assign(Object.assign({},m),{lineStyle:o.style,zIndex:this.gridZIndex}));this._stateByField[t].crosshairComp=_,h.add(_)}var k=d.all;if(k.visible){var x=p.getCenter(),S={x:x.x+g.x,y:x.y+g.y},A="angle"===u?function(t){return{align:(t=Te(t))>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"left":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"right":"center",baseline:t>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"bottom":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"top":"middle"}}(v):function(t){return{align:(t=Te(t))>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"right":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"left":"center",baseline:t>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"bottom":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"top":"middle"}}(p.startAngle),C="angle"===u?Ae(S,f[1]+k.offset,v):Ae(S,m.radius,p.startAngle),M=Object.assign(Object.assign(Object.assign(Object.assign({},C),o.label),k),{textStyle:Object.assign(Object.assign({},null===(n=o.label)||void 0===n?void 0:n.textStyle),{textAlign:A.align,textBaseline:A.baseline}),zIndex:this.labelZIndex});this._updateCrosshairLabel(l.all,M,(function(t){t.name="crosshair-".concat(u,"-label"),l.all=t}))}else l.all&&l.all.hideAll()}}}}],[{key:"getSpecInfo",value:function(t){return IU(t,this.specKey,this.type,(function(t){return t.categoryField&&!1!==t.categoryField.visible||t.valueField&&!1!==t.valueField.visible}))}}])}(O1);L1.specKey="crosshair",L1.builtInTheme={crosshair:I1},L1.type=c.polarCrosshair;var D1=function(t,e){var i=e.getNewDomain,n=e.isContinuous,r=e.field,a=e.originalFields,o=r(),s=i();if(C(s)||C(o))return t;var l=a(),u=O(o)?o[0]:o;return t[u]&&l&&l[u]&&l[u].lockStatisticsByDomain&&!n()&&(t[u].values=s),t},F1=function(t,e){var i=e.getNewDomain,n=e.isContinuous,r=(0,e.field)(),a=i();if(C(a)||C(r))return t;if(0===a.length)return[];var o={};a.forEach((function(t){o[t]||(o[t]=1)}));var s=null;return s=n()?function(t){var e=!1;return ot(r).every((function(i){t[i]>=a[0]&&t[i]<=st(a)&&(e=!0)})),e}:function(t){var e=!1;return ot(r).every((function(i){(o[t[i]+""]||o[t[i]])&&(e=!0)})),e},t.filter(s)},z1=function(t,e){var i=e.input,n=i.stateFields,r=i.valueFields,a=i.dataCollection,o=i.isCategoryState,l=i.seriesCollection,u=e.output,h=u.stateField,c=u.valueField,d={},v=[],f=[],p=[],g=!1,y=!1;a.forEach((function(t,e){var i;if(!C(n[e])){var a=l[e];if(a){var o=a.getRawDataStatisticsByField(n[e]);M(null==o?void 0:o.max)&&M(null==o?void 0:o.min)&&(y=!0)}var s=null===(i=t.getFields())||void 0===i?void 0:i[n[e]];s&&s.lockStatisticsByDomain&&(g=!0,s.domain.forEach((function(t){C(d[t])&&(p.push(t),d[t]=0,v.push(t))}))),t.latestData.forEach((function(t){ot(n[e]).forEach((function(i){C(t[i])||(C(d[t[i]])&&(p.push(t[i]),d[t[i]]=0,v.push(t[i])),C(r[e])||(d[t[i]]+=isNaN(parseFloat(t[r[e]]))?1:parseFloat(t[r[e]])))}))}))}}));var m=g?p:!1===o||y?p.sort((function(t,e){return t-e})):v;return m.forEach((function(t){var e=s({},h,t);c&&(e[c]=d[t]),f.push(e)})),f},j1=function(t,e,i){var n=e.domain();if(LI(e.type))return i?n[0]+(st(n)-n[0])*(1-t):n[0]+(st(n)-n[0])*t;var r=e.range();i&&(r=r.slice().reverse());var a=r[0]+(st(r)-r[0])*t;return e.invert(a)},H1=function(t,e,i){var n=e.scale(t),r=e.range();return!i&&LI(e.type)&&(r=r.slice().reverse()),Math.max(0,Math.min(1,(n-r[0])/(st(r)-r[0])))},N1=function(t,e){var i=t;if(!i)return!1;var n=i.getScale();return n.range()[0]>n.range()[1]&&(!i.getInverse()||e)},U1=function(t){var e=null==t?void 0:t.bandSize,i=null==t?void 0:t.maxBandSize,n=null==t?void 0:t.minBandSize;if(e||n||i)return{bandSize:e,maxBandSize:i,minBandSize:n}},V1=function(t,e,i){return"start"===t?"percent"===e&&M(i.start)||"value"===e&&M(i.startValue):"percent"===e&&M(i.end)||"value"===e&&M(i.endValue)},W1=function(t,e,i){if(LI(i.type))return[Math.min(e,t),Math.max(e,t)];var n=i.domain(),r=n.indexOf(t),a=n.indexOf(e);return n.slice(Math.min(r,a),Math.max(r,a)+1)},G1=function(){function t(e,i,r,a,o,s,l,u){var h=this;n(this,t),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.initZoomEvent=function(){var t,e,i,n,r,a,o,s={delayType:null!==(e=null===(t=h._spec)||void 0===t?void 0:t.delayType)&&void 0!==e?e:"throttle",delayTime:M(null===(i=h._spec)||void 0===i?void 0:i.delayType)?null!==(r=null===(n=h._spec)||void 0===n?void 0:n.delayTime)&&void 0!==r?r:30:0,realTime:null===(o=null===(a=h._spec)||void 0===a?void 0:a.realTime)||void 0===o||o,allowComponentZoom:!0};h._zoomAttr.enable&&h.initZoomEventOfRegions(h.getRegions(),null,h.handleChartZoom,s),h._scrollAttr.enable&&h.initScrollEventOfRegions(h.getRegions(),null,h.handleChartScroll,s),h._dragAttr.enable&&h.initDragEventOfRegions(h.getRegions(),null,h.handleChartDrag,s)},this.handleChartZoom=function(t,e){var i,n;if(h._activeRoam&&(!h._zoomAttr.filter||h._zoomAttr.filter(t,e))){var r=t.zoomDelta,a=t.zoomX,o=t.zoomY,s=h.getRegions()[0].getLayoutStartPoint(),l=s.x,u=s.y,c=h.getRegions()[0].getLayoutRect(),d=c.width,v=c.height,f=Math.abs(h.getState().start-h.getState().end),p=null!==(n=null===(i=h._spec.roamZoom)||void 0===i?void 0:i.rate)&&void 0!==n?n:1;if(!(f>=1&&r<1||f<=.01&&r>1)){var g=h._isHorizontal?a:o,y=f*(r-1)*p,m=y/2,_=y/2;if(g){var b=h._isHorizontal?l:u,k=h._isHorizontal?d:v;m=Math.abs(b-g)/Math.abs(k-b)*y,_=Math.abs(k-g)/Math.abs(k-b)*y}var x=Pt(h.getState().start+m,0,1),S=Pt(h.getState().end-_,0,1);h._handleChange(Math.min(x,S),Math.max(x,S),!0)}}},this.handleChartScroll=function(t,e){var i;if(!h._activeRoam||h._scrollAttr.filter&&!h._scrollAttr.filter(t,e))return!1;var n=t.scrollX,r=t.scrollY,a=h._isHorizontal?n:r,o=h._isHorizontal?ie(n/r)>=.5:ie(r/n)>=.5;if(h._scrollAttr.reverse||(a=-a),o){var s=h._spec.scrollStep;F(s)&&(a=(a>0?1:-1)*(s*(h.getState().end-h.getState().start)/1)),h.handleChartMove(a,null!==(i=h._scrollAttr.rate)&&void 0!==i?i:1)}var l=0!==h.getState().start&&1!==h.getState().end;return o&&l},this.handleChartDrag=function(t,e){var i;if(h._activeRoam&&(!h._dragAttr.filter||h._dragAttr.filter(t,e))){var n=m(t,2),r=n[0],a=n[1],o=h._isHorizontal?r:a;h._dragAttr.reverse&&(o=-o),h.handleChartMove(o,null!==(i=h._dragAttr.rate)&&void 0!==i?i:1)}},this.handleChartMove=function(t,e){var i=h._isHorizontal?h.getLayoutRect().width:h.getLayoutRect().height;if(Math.abs(t)>=1e-6)if(t>0&&h.getState().end<1){var n=Math.min(1-h.getState().end,t/i)*e;h._handleChange(h.getState().start+n,h.getState().end+n,!0)}else if(t<0&&h.getState().start>0){var r=Math.max(-h.getState().start,t/i)*e;h._handleChange(h.getState().start+r,h.getState().end+r,!0)}return!1},this._type=e,this._spec=i,this._handleChange=r,this.getLayoutRect=a,this.getState=o,this.getRegions=s,this._regions=s(),this.getOption=l,this._option=l(),this.getEvent=u,this._isHorizontal="horizontal"===PV(BV(i))}return a(t,[{key:"enableInteraction",value:function(){this._activeRoam=!0}},{key:"disableInteraction",value:function(){this._activeRoam=!1}},{key:"zoomIn",value:function(t){this.handleChartZoom({zoomDelta:1.2,zoomX:null==t?void 0:t.x,zoomY:null==t?void 0:t.y})}},{key:"zoomOut",value:function(t){this.handleChartZoom({zoomDelta:.8,zoomX:null==t?void 0:t.x,zoomY:null==t?void 0:t.y})}},{key:"setEventAttrFromSpec",value:function(){!0===this._spec.roamZoom||this._spec.roamZoom?this._zoomAttr=Q({},this._zoomAttr,this._spec.roamZoom):this._zoomAttr.enable=!1,!0===this._spec.roamDrag||this._spec.roamDrag?this._dragAttr=Q({},this._dragAttr,this._spec.roamDrag):this._dragAttr.enable=!1,!0===this._spec.roamScroll||this._spec.roamScroll?this._scrollAttr=Q({},this._scrollAttr,this._spec.roamScroll):this._scrollAttr.enable=!1,S(this._spec.roam)&&(this._zoomAttr.enable="scrollBar"!==this._type&&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.getEvent(),this._option.mode)}}])}();at(G1,gK);var Y1=function(r){function o(t,r){var a;return n(this,o),(a=i(this,o,[t,r])).layoutType="none",a._orient="left",a._cacheVisibility=void 0,a._dataUpdating=!1,a._hasInitStateScale=!1,a._shouldChange=!0,a._stateField="x",a._currentDataCollection=[],a._handleStateChange=function(t,e,i){var n,r;return a._startValue=t,a._endValue=e,a._newDomain=W1(a._startValue,a._endValue,a._stateScale),null===(r=(n=a.effect).onZoomChange)||void 0===r||r.call(n,i),!0},a.effect={onZoomChange:function(t){var e,i,n=a._relatedAxisComponent;if(n&&"axis"===a._filterMode){var r=n.getScale(),o=n.getSpec();a._auto&&U1(o)&&a._spec.ignoreBandSize&&(r.bandwidth("auto"),r.maxBandwidth("auto"),r.minBandwidth("auto")),a._updateRangeFactor(t),a._auto&&(null===(i=null===(e=a._component)||void 0===e?void 0:e.setStartAndEnd)||void 0===i||i.call(e,a._start,a._end)),n.effect.scaleUpdate({value:"force"})}else tz(a._regions,(function(t){var e;null===(e=t.getViewData())||void 0===e||e.markRunning()}),{userId:a._seriesUserId,specIndex:a._seriesIndex}),tz(a._regions,(function(t){t.reFilterViewData()}),{userId:a._seriesUserId,specIndex:a._seriesIndex})}},a._visible=!0,a._orient=BV(t),a._isHorizontal="horizontal"===PV(a._orient),a._dataFilterEvent=new G1(a.type,a._spec,a._handleChange.bind(e(a)),a.getLayoutRect.bind(e(a)),(function(){return{start:a._start,end:a._end}}),(function(){return a._regions}),function(){return a._option}.bind(e(a)),(function(){return a.event})),a}return h(o,r),a(o,[{key:"isHorizontal",get:function(){return this._isHorizontal}},{key:"stateScale",get:function(){return this._stateScale}},{key:"relatedAxisComponent",get:function(){return this._relatedAxisComponent}},{key:"setStartAndEnd",value:function(t,e){var i=m(arguments.length>2&&void 0!==arguments[2]?arguments[2]:["percent","percent"],2),n=i[0],r=void 0===n?"percent":n,a=i[1],o=void 0===a?"percent":a,s="percent"===r?t:H1(t,this._stateScale,this._isHorizontal),l="percent"===o?e:H1(e,this._stateScale,this._isHorizontal);this._handleChange(s,l,!0)}},{key:"enableInteraction",value:function(){this._dataFilterEvent.enableInteraction()}},{key:"disableInteraction",value:function(){this._dataFilterEvent.disableInteraction()}},{key:"zoomIn",value:function(t){this._dataFilterEvent.zoomIn(t)}},{key:"zoomOut",value:function(t){this._dataFilterEvent.zoomOut(t)}},{key:"_initEvent",value:function(){var e;this._dataFilterEvent.initZoomEvent(),null===(e=this._relatedAxisComponent)||void 0===e||e.event.on(t.ChartEvent.scaleRawDomainUpdate,(function(t){var e=t.model;console.log("scaleRawDomainUpdate",e.getRawDomain())}))}},{key:"_handleChange",value:function(t,e,i){var n,r;null!==(r=null===(n=this._spec)||void 0===n?void 0:n.zoomLock)&&void 0!==r&&r||e-t!==this._spanCache&&(e-t<this._minSpan||e-t>this._maxSpan)?this._shouldChange=!1:(this._shouldChange=!0,this._spanCache=e-t)}},{key:"_updateRangeFactor",value:function(t){var e=this._relatedAxisComponent,i=e.getScale(),n=N1(e,this._isHorizontal),r=n?[1-this._end,1-this._start]:[this._start,this._end];if(n)switch(t){case"startHandler":e.scaleRangeFactorEnd(r[1]);break;case"endHandler":e.scaleRangeFactorStart(r[0]);break;default:e.scaleRangeFactorStart(r[0],!0),e.scaleRangeFactorEnd(r[1])}else switch(t){case"startHandler":e.scaleRangeFactorStart(r[0]);break;case"endHandler":e.scaleRangeFactorEnd(r[1]);break;default:e.scaleRangeFactorEnd(r[1],!0),e.scaleRangeFactorStart(r[0])}var 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)}},{key:"visible",get:function(){return this._visible}},{key:"created",value:function(){this._handleDataCollectionChangeBound=this._handleDataCollectionChange.bind(this),_(o,"created",this,3)([]),this._setAxisFromSpec(),this._setRegionsFromSpec(),this._initEvent(),this._initData(),this._initStateScale(),this._setStateFromSpec()}},{key:"initLayout",value:function(){_(o,"initLayout",this,3)([]),this._layout&&(this._layout.layoutOrient=this._orient)}},{key:"init",value:function(t){_(o,"init",this,3)([t]),this._addTransformToSeries(),0===this._start&&1===this._end||this.effect.onZoomChange()}},{key:"_compareSpec",value:function(t,e){var i=_(o,"_compareSpec",this,3)([t,e]);return i.reMake||nt(e,t)||(i.change=!0,i.reRender=!0,!i.reCompile&&this._isComponentOnlySpecChange(t,e)?i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0}):i.reMake=!0),i}},{key:"_getComponentOnlySpecKeys",value:function(){return null}},{key:"_isComponentOnlySpecChange",value:function(t,e){var i=this._getComponentOnlySpecKeys();return!!i&&Object.keys(Object.assign(Object.assign({},e),t)).every((function(n){return nt(null==e?void 0:e[n],null==t?void 0:t[n])||i[n]}))}},{key:"reInit",value:function(t){var e=this;_(o,"reInit",this,3)([t]),this._marks.forEach((function(t){t.getMarks().forEach((function(t){e.initMarkStyleWithSpec(t,e._spec[t.name])}))}))}},{key:"onLayoutStart",value:function(t,e){_(o,"onLayoutStart",this,3)([t,e]);var i=this._autoUpdate(t);this._autoVisible(i),this._dataUpdating=!1}},{key:"updateLayoutAttribute",value:function(){this._visible&&this._createOrUpdateComponent(),this._hasInitStateScale||(0===this._start&&1===this._end||(this._newDomain=function(t,e,i,n,r){if(LI(r.type)){var a=r.domain(),o=a[0],s=st(a)-o,l=M(t)?o+s*t:+e,u=M(i)?o+s*i:+n;return[Math.min(u,l),Math.max(u,l)]}var h=r.domain(),c=r.range(),d=c[c.length-1]-c[0],v=M(t)?h.indexOf(r.invert(d*t+c[0])):h.indexOf(e),f=M(i)?h.indexOf(r.invert(d*i+c[0])):h.indexOf(n);return h.slice(Math.min(v,f),Math.max(v,f)+1)}(this._spec.start,this._startValue,this._spec.end,this._endValue,this._stateScale),this.effect.onZoomChange()),this._hasInitStateScale=!0)}},{key:"_initAfterLayout",value:function(){this._stateScale=null,this._initStateScale(),this._updateScaleRange(),this._setStateFromAxis()}},{key:"_beforeLayoutEnd",value:function(){this._hasInitStateScale?this._updateScaleRange():this._initAfterLayout()}},{key:"onLayoutEnd",value:function(){var t;this._beforeLayoutEnd();var e=!(0===this._start&&1===this._end);this._autoVisible(e),_(o,"onLayoutEnd",this,3)([]),null===(t=this._relatedAxisComponent)||void 0===t||t.updateScaleRange()}},{key:"getBoundsInRect",value:function(t){var 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}},{key:"setAttrFromSpec",value:function(){var t;_(o,"setAttrFromSpec",this,3)([]),this._dataFilterEvent.setEventAttrFromSpec(),this._field=this._spec.field,this._width=this._computeWidth(),this._height=this._computeHeight(),this._visible=null===(t=this._spec.visible)||void 0===t||t}},{key:"_setAxisFromSpec",value:function(){var t=this;if(M(this._spec.axisId)?this._relatedAxisComponent=this._option.getComponentByUserId(this._spec.axisId):M(this._spec.axisIndex)&&(this._relatedAxisComponent=this._option.getComponentByIndex("axes",this._spec.axisIndex)),C(this._spec.field)&&!this._relatedAxisComponent){var e=this._option.getComponentsByKey("axes"),i=e.find((function(e){return PV(e._orient)===PV(t._orient)}));if(i)this._relatedAxisComponent=i;else{var n=e.find((function(t){return!LI(t.getScale().type)}));this._relatedAxisComponent=n}}this._relatedAxisComponent&&"axis"===this._filterMode&&(this._relatedAxisComponent.autoIndentOnce=!0)}},{key:"_setRegionsFromSpec",value:function(){var t,e;this._regions=this._relatedAxisComponent?this._relatedAxisComponent.getRegions():this._option.getAllRegions();var i=this._relatedAxisComponent?null===(e=(t=this._relatedAxisComponent).getBindSeriesFilter)||void 0===e?void 0:e.call(t):null;if(M(i)&&(M(i.userId)&&(this._seriesUserId=ot(i.userId)),M(i.specIndex)&&(this._seriesIndex=ot(i.specIndex))),M(this._spec.seriesId)){var n=ot(this._spec.seriesId);this._seriesUserId?this._seriesUserId=this._seriesUserId.filter((function(t){return n.includes(t)})):this._seriesUserId=n}if(M(this._spec.seriesIndex)){var r=ot(this._spec.seriesIndex);this._seriesIndex?this._seriesIndex=this._seriesIndex.filter((function(t){return r.includes(t)})):this._seriesIndex=r}if(M(this._spec.regionIndex)){var a=this._option.getRegionsInIndex(ot(this._spec.regionIndex));this._regions=this._regions.filter((function(t){return a.includes(t)}))}else if(M(this._spec.regionId)){var o=ot(this._spec.regionId);this._regions=o.length?this._regions.filter((function(t){return o.includes(t.id)})):[]}}},{key:"_collectDataInfo",value:function(){var t,e=this,i=[],n=[],r=[],a=[];if(this._relatedAxisComponent){var o={};tz(this._regions,(function(n){var s,l,u="cartesian"===n.coordinate?n.getXAxisHelper():"polar"===n.coordinate?n.angleAxisHelper:null,h="cartesian"===n.coordinate?n.getYAxisHelper():"polar"===n.coordinate?n.radiusAxisHelper:null;if(u&&h){var c=u.getAxisId()===e._relatedAxisComponent.id?u:h.getAxisId()===e._relatedAxisComponent.id?h:e._isHorizontal?u:h,d=c===u?h:u,v=LI(d.getScale(0).type),f=LI(c.getScale(0).type);i.push(n.getRawData());var p=n.getSpec(),g="cartesian"===n.coordinate?ot(p.xField):ot(null!==(s=p.angleField)&&void 0!==s?s:p.categoryField),y="cartesian"===n.coordinate?ot(p.yField):ot(null!==(l=p.radiusField)&&void 0!==l?l:p.valueField);if(o[n.id]="link"===n.type?["from_xField"]:c===u?g:y,f?(t=!1,r.push(o[n.id])):(t=!0,r.push(o[n.id][0])),e._valueField){var m="link"===n.type?["from_yField"]:d===u?g:y;v&&a.push.apply(a,b(m))}}}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._originalStateFields=o}else tz(this._regions,(function(t){i.push(t.getRawData()),n.push(t),r.push(e._field),e._valueField&&a.push(e._spec.valueField)}),{userId:this._seriesUserId,specIndex:this._seriesIndex});return{dataCollection:i,seriesCollection:n,stateFields:r,valueFields:a,isCategoryState:t}}},{key:"_initData",value:function(){var t=this._collectDataInfo(),e=t.dataCollection,i=t.seriesCollection,n=t.stateFields,r=t.valueFields,a=t.isCategoryState,o=this._option.dataSet;pH(o,"dataview",Vo),fH(o,"dataFilterComputeDomain",z1);var s=new Ko(o,{name:"".concat(this.type,"_").concat(this.id,"_data")});s.transform({type:"dataFilterComputeDomain",options:{input:{dataCollection:e,seriesCollection:i,stateFields:n,valueFields:r,isCategoryState:a},output:{stateField:this._stateField,valueField:this._valueField}}},!1),this._data=new WN(this._option,s),s.reRunAllTransform(),this._currentDataCollection=e,o.multipleDataViewAddListener(e,"change",this._handleDataCollectionChangeBound)}},{key:"_addTransformToSeries",value:function(){var e=this;this._relatedAxisComponent&&"axis"===this._filterMode||(fH(this._option.dataSet,"dataFilterWithNewDomain",F1),fH(this._option.dataSet,"lockStatisticsFilter",D1),tz(this._regions,(function(i){i.getViewDataStatistics().transform({type:"lockStatisticsFilter",options:{originalFields:function(){return i.getViewDataStatistics().getFields()},getNewDomain:function(){return e._newDomain},field:function(){var t;return null!==(t=e._field)&&void 0!==t?t:e._parseFieldOfSeries(i)},isContinuous:function(){return LI(e._stateScale.type)}},level:1},!1),i.addViewDataFilter({type:"dataFilterWithNewDomain",options:{getNewDomain:function(){return e._newDomain},field:function(){var t;return null!==(t=e._field)&&void 0!==t?t:e._parseFieldOfSeries(i)},isContinuous:function(){return LI(e._stateScale.type)}},level:t.TransformLevel.dataZoomFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex}))}},{key:"onDataUpdate",value:function(){var t,e=this,i=this._collectDataInfo(),n=i.dataCollection,r=i.seriesCollection,a=i.stateFields,o=i.valueFields,s=i.isCategoryState;(this._currentDataCollection.length!==n.length||this._currentDataCollection.some((function(t,e){return t!==n[e]})))&&(this._currentDataCollection.forEach((function(t){var i;null===(i=null==t?void 0:t.target)||void 0===i||i.removeListener("change",e._handleDataCollectionChangeBound)})),this._currentDataCollection=n,this._option.dataSet.multipleDataViewAddListener(this._currentDataCollection,"change",this._handleDataCollectionChangeBound)),this._data.getDataView().transform({type:"dataFilterComputeDomain",options:{input:{dataCollection:n,seriesCollection:r,stateFields:a,valueFields:o,isCategoryState:s},output:{stateField:this._stateField,valueField:this._valueField}}},!1),this._data.getDataView().reRunAllTransform();var l=this._computeDomainOfStateScale(LI(this._stateScale.type));this._stateScale.domain(l,!1),(M(this._spec.start)||M(this._spec.end))&&this._setStateFromSpec(),this._handleChange(this._start,this._end,!0),this._spec.auto&&!nt(this._domainCache,l)&&(this._domainCache=l,this._dataUpdating=!0,null===(t=this.getChart())||void 0===t||t.setLayoutTag(!0,null,!1))}},{key:"_parseFieldOfSeries",value:function(t){var e;return null===(e=this._originalStateFields)||void 0===e?void 0:e[t.id]}},{key:"_setStateFromSpec",value:function(){var t,e;if(this._auto=!!this._spec.auto,this._spec.rangeMode){var i=m(this._spec.rangeMode,2),n=i[0],r=i[1];V1("start",n,this._spec)&&V1("end",r,this._spec)&&(t="percent"===n?this._spec.start:H1(this._spec.startValue,this._stateScale,this._isHorizontal),e="percent"===r?this._spec.end:H1(this._spec.endValue,this._stateScale,this._isHorizontal))}else t=this._spec.start?this._spec.start:this._spec.startValue?H1(this._spec.startValue,this._stateScale,this._isHorizontal):0,e=this._spec.end?this._spec.end:this._spec.endValue?H1(this._spec.endValue,this._stateScale,this._isHorizontal):1;this._start=Math.max(0,Math.min(1,t)),this._end=Math.max(0,Math.min(1,e))}},{key:"_setStateFromAxis",value:function(){var t,e;this._setStateFromSpec();var i=this._relatedAxisComponent;this._startValue=j1(this._start,this._stateScale,N1(i,this._isHorizontal)),this._endValue=j1(this._end,this._stateScale,N1(i,this._isHorizontal)),this._minSpan=null!==(t=this._spec.minSpan)&&void 0!==t?t:0,this._maxSpan=null!==(e=this._spec.maxSpan)&&void 0!==e?e:1,LI(this._stateScale.type)&&this._stateScale.domain()[0]!==st(this._stateScale.domain())&&(this._spec.minValueSpan&&(this._minSpan=this._spec.minValueSpan/(st(this._stateScale.domain())-this._stateScale.domain()[0])),this._spec.maxValueSpan&&(this._maxSpan=this._spec.maxValueSpan/(st(this._stateScale.domain())-this._stateScale.domain()[0]))),this._minSpan=Math.max(0,this._minSpan),this._maxSpan=Math.min(this._maxSpan,1),i&&(i&&"axis"===this._filterMode||0===this._start&&1===this._end||(this._newDomain=W1(this._startValue,this._endValue,this._stateScale)))}},{key:"_initStateScale",value:function(){var t,e,i,n,r,a,o=this,s=[0,1];if(this._relatedAxisComponent){var l=this._relatedAxisComponent.getScale().clone();this._stateScale=l,null===(e=(t=l).maxBandwidth)||void 0===e||e.call(t,"auto",!0),null===(n=(i=l).minBandwidth)||void 0===n||n.call(i,"auto",!0),null===(a=(r=l).bandwidth)||void 0===a||a.call(r,"auto",!0),l.rangeFactor(s,!0).range(s)}else{var u=!0;this._field&&tz(this._regions,(function(t){var e=t.getRawDataStatisticsByField(o._field);F(null==e?void 0:e.min)&&F(null==e?void 0:e.max)||(u=!1)}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._stateScale=u?new CR:new rR,this._stateScale.domain(this._computeDomainOfStateScale(u),!0).range(s)}}},{key:"_computeDomainOfStateScale",value:function(t){var e=this;if(this._spec.customDomain)return this._spec.customDomain;var i=this._data.getLatestData().map((function(t){return t[e._stateField]}));if(t){var n=i.map((function(t){return 1*t}));return i.length?[ut(n),lt(n)]:[-1/0,1/0]}return i}},{key:"_autoVisible",value:function(e){if(this._auto){e?this.show():this.hide();var i=this._isHorizontal?"height":"width";this.layout.setLayoutRect(s({},i,e?this["_".concat(i)]:0),s({},i,t.AttributeLevel.Built_In))}}},{key:"hide",value:function(){var t;null===(t=this._component)||void 0===t||t.hideAll()}},{key:"show",value:function(){var t;null===(t=this._component)||void 0===t||t.showAll()}},{key:"_autoUpdate",value:function(t){var e,i,n,r,a,o;if(!this._auto)return this._cacheVisibility=void 0,!0;var s=this._relatedAxisComponent,l=null==s?void 0:s.getSpec(),u=null==s?void 0:s.getScale(),h=U1(l);if(!this._dataUpdating&&FI(u.type)&&(null==t?void 0:t.height)===(null===(e=this._cacheRect)||void 0===e?void 0:e.height)&&(null==t?void 0:t.width)===(null===(i=this._cacheRect)||void 0===i?void 0:i.width)&&this._fixedBandSize===(null==h?void 0:h.bandSize))return this._cacheVisibility;var d=!0;if(this._isHorizontal&&(null==t?void 0:t.width)!==(null===(n=this._cacheRect)||void 0===n?void 0:n.width)?u.range(s.getInverse()?[t.width,0]:[0,t.width]):(null==t?void 0:t.height)!==(null===(r=this._cacheRect)||void 0===r?void 0:r.height)&&u.range(s.getInverse()?[0,t.height]:[t.height,0]),this._cacheRect={width:null==t?void 0:t.width,height:null==t?void 0:t.height},this._fixedBandSize=null==h?void 0:h.bandSize,FI(u.type)){h&&(this._start||this._end)&&(this.type===c.scrollBar&&(this._start=0,this._end=1),this._updateRangeFactor());var v=m(null!==(a=u.rangeFactor())&&void 0!==a?a:[],2),f=v[0],p=v[1];d=!(C(f)&&C(p)||0===f&&1===p)}else{var g=m(null!==(o=u.rangeFactor())&&void 0!==o?o:[this._start,this._end],2),y=g[0],_=g[1];d=!(0===y&&1===_)}return this.setStartAndEnd(this._start,this._end),this._cacheVisibility=d,d}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._component]}}])}(DW);at(Y1,gK);var K1=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_mergeThemeToSpec",value:function(t,e){var i=this,n=this._theme,r=t;if(this._shouldMergeThemeToSpec()){var a=function(t){var e=Nz({selectedBackgroundChart:{line:{},area:{}}},i._theme,t),n=t.selectedBackgroundChart,r=void 0===n?{}:n,a=r.line,o=r.area;return a&&!1!==a.visible&&(e.selectedBackgroundChart.line.style=Object.assign(Object.assign({},e.selectedBackgroundChart.line.style),{visible:!0})),o&&!1!==o.visible&&(e.selectedBackgroundChart.area.style=Object.assign(Object.assign({},e.selectedBackgroundChart.area.style),{visible:!0})),e},o=t;r=O(o)?o.map((function(t){return a(t)})):a(o)}return this._adjustPadding(r),{spec:r,theme:n}}}])}(LW),X1=function(t){return{area:{style:{visible:t,stroke:!1,fill:{type:"palette",key:"dataZoomChartColor"}}},line:{style:{visible:t,stroke:{type:"palette",key:"dataZoomChartColor"},lineWidth:1}}}},q1={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:X1(!1),startHandler:{style:{symbolType:"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\nC-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\nC-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\nC0.3-1.4,0.3-1.4,0.3-1.4z;",fill:{type:"palette",key:"sliderHandleColor"},scaleX:1.2,scaleY:1.2,stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},lineWidth:1}},endHandler:{style:{symbolType:"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\nC-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\nC-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\nC0.3-1.4,0.3-1.4,0.3-1.4z;",fill:{type:"palette",key:"sliderHandleColor"},scaleX:1.2,scaleY:1.2,stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},lineWidth:1}},startText:{padding:8,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}}},endText:{padding:8,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}}},backgroundChart:X1(!0)},Z1={width:!0,height:!0,showDetail:!0,middleHandler:!0,background:!0,startHandler:!0,endHandler:!0,startText:!0,endText:!0,dragMask:!0,selectedBackground:!0,backgroundChart:!0,selectedBackgroundChart:!0,showBackgroundChart:!0},J1=function(e){function r(e,a){var o,s;return n(this,r),(o=i(this,r,[e,a])).type=c.dataZoom,o.name=c.dataZoom,o.transformerConstructor=K1,o.specKey="dataZoom",o.layoutZIndex=t.LayoutZIndex.DataZoom,o.layoutLevel=t.LayoutLevel.DataZoom,o.layoutType="region-relative",o._isReverseCache=!1,o._dataToPositionX=function(t){var e=o._isHorizontal?0:o._middleHandlerSize,i=o._isHorizontal?o._startHandlerSize/2:0,n=o._isHorizontal?o._stateScale:o._valueScale,r=o._isHorizontal?o._stateField:o._valueField;return n.scale(t[r])+o.getLayoutStartPoint().x+e+i},o._dataToPositionX2=function(t){var e=o._isHorizontal?0:o._middleHandlerSize,i=o._isHorizontal?o._startHandlerSize/2:0,n=o._isHorizontal?o._stateScale:o._valueScale,r=n.domain()[0];return n.scale(r)+o.getLayoutStartPoint().x+e+i},o._dataToPositionY=function(t){var e=o._isHorizontal?o._middleHandlerSize:0,i=o._isHorizontal?0:o._startHandlerSize/2,n=o._isHorizontal?o._valueScale:o._getPreviewStateScale(),r=o._isHorizontal?o._valueField:o._stateField;return n.scale(t[r])+o.getLayoutStartPoint().y+e+i},o._dataToPositionY2=function(t){var e=o._isHorizontal?o._middleHandlerSize:0,i=o._isHorizontal?0:o._startHandlerSize/2,n=o._isHorizontal?o._valueScale:o._getPreviewStateScale(),r=n.domain()[0];return n.scale(r)+o.getLayoutStartPoint().y+e+i},o._valueField="y",o._filterMode=null!==(s=e.filterMode)&&void 0!==s?s:"filter",o}return h(r,e),a(r,[{key:"_handleChange",value:function(e,i,n,a){if(_(r,"_handleChange",this,3)([e,i,n]),this._shouldChange)if(n&&this._component)this._component.setStartAndEnd(e,i);else{var o=this._relatedAxisComponent,s=j1(e,this._stateScale,N1(o,this._isHorizontal)),l=j1(i,this._stateScale,N1(o,this._isHorizontal));if(!M(s)||!M(l))return;this._start=e,this._end=i,(A(this._spec.updateDataAfterChange)?this._spec.updateDataAfterChange(e,i,s,l):this._handleStateChange(s,l,a))&&this.event.emit(t.ChartEvent.dataZoomChange,{model:this,value:{filterData:"axis"!==this._filterMode,start:e,end:i,startValue:this._startValue,endValue:this._endValue,newDomain:this._newDomain}})}}},{key:"_handleDataCollectionChange",value:function(){this._data.getDataView().reRunAllTransform(),this._initAfterLayout();var t=this._computeDomainOfValueScale();t&&(this._valueScale||(this._valueScale=new CR),this._valueScale.domain(t),this._updateValueScaleRange(),this._component&&this._createOrUpdateComponent(!0))}},{key:"created",value:function(){_(r,"created",this,3)([]),this._initValueScale()}},{key:"updateLayoutAttribute",value:function(){!1!==this._cacheVisibility&&_(r,"updateLayoutAttribute",this,3)([])}},{key:"_beforeLayoutEnd",value:function(){_(r,"_beforeLayoutEnd",this,3)([]);var t=this._relatedAxisComponent;(N1(t,this._isHorizontal)&&!this._isReverseCache||this._auto)&&(this._isReverseCache=N1(t,this._isHorizontal),this.effect.onZoomChange())}},{key:"_getComponentOnlySpecKeys",value:function(){return Z1}},{key:"clear",value:function(){if(this._component){var t=this.getContainer();this._component.removeAllChild(),t&&t.removeChild(this._component),this._component=null}_(r,"clear",this,3)([])}},{key:"getBoundsInRect",value:function(t){var e,i,n,r,a={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0},o=this._startHandlerSize*(null!==(e=this._spec.startHandler.style.scaleX)&&void 0!==e?e:1),s=this._startHandlerSize*(null!==(i=this._spec.startHandler.style.scaleY)&&void 0!==i?i:1),l=this._endHandlerSize*(null!==(n=this._spec.endHandler.style.scaleX)&&void 0!==n?n:1),u=this._endHandlerSize*(null!==(r=this._spec.endHandler.style.scaleY)&&void 0!==r?r:1),h=this._visible?this._isHorizontal?(o-this._startHandlerSize)/2+(l-this._endHandlerSize)/2:(Math.max(o,l)-this._width)/2:0,c=this._visible?this._isHorizontal?(Math.max(s,u)-this._height)/2:(s-this._startHandlerSize)/2+(u-this._endHandlerSize)/2:0;return this._isHorizontal?(a.y2=a.y1+this._height+c,a.x2=a.x1+t.width+h):(a.x2=a.x1+this._width+h,a.y2=a.y1+t.height+c),a}},{key:"setAttrFromSpec",value:function(){var t,e,i,n,a,o,s,l,u,h;_(r,"setAttrFromSpec",this,3)([]);var c=this._isHorizontal?Number(this._spec.height):Number(this._spec.width);this._backgroundSize=null!==(e=null===(t=this._spec.background)||void 0===t?void 0:t.size)&&void 0!==e?e:30,this._middleHandlerSize=this._computeMiddleHandlerSize(),C(null===(a=null===(n=null===(i=this._spec)||void 0===i?void 0:i.startHandler)||void 0===n?void 0:n.style)||void 0===a?void 0:a.size)&&(this._spec.startHandler.style.size=isNaN(c)?this._backgroundSize:c-this._middleHandlerSize),C(null===(l=null===(s=null===(o=this._spec)||void 0===o?void 0:o.endHandler)||void 0===s?void 0:s.style)||void 0===l?void 0:l.size)&&(this._spec.endHandler.style.size=isNaN(c)?this._backgroundSize:c-this._middleHandlerSize);var d=null===(u=this._spec.startHandler.style.visible)||void 0===u||u,v=null===(h=this._spec.endHandler.style.visible)||void 0===h||h;this._startHandlerSize=d?this._spec.startHandler.style.size:0,this._endHandlerSize=v?this._spec.endHandler.style.size:0,this._width=this._computeWidth(),this._height=this._computeHeight()}},{key:"_initValueScale",value:function(){var t=this._computeDomainOfValueScale();if(t){var e=new CR;e.domain(t),this._valueScale=e}}},{key:"_updateScaleRange",value:function(){this._updateStateScaleRange(),this._updateValueScaleRange()}},{key:"_updateStateScaleRange",value:function(){var t,e,i,n=this._startHandlerSize+this._endHandlerSize;if(this._stateScale){var r,a=this._isHorizontal?this.getLayoutRect().width-n:this.getLayoutRect().height-n,o=null!==(e=null===(t=this._relatedAxisComponent)||void 0===t?void 0:t.getScale().range())&&void 0!==e?e:[this._startHandlerSize/2,a+this._startHandlerSize/2],s=this._computeWidth(),l=this._computeHeight();r=this._isHorizontal?this._visible?[this._startHandlerSize/2,s-n+this._startHandlerSize/2]:o:this._visible?[this._startHandlerSize/2,l-n+this._startHandlerSize/2]:o,this._stateScale.range(r),null===(i=this._previewStateScale)||void 0===i||i.range(N1(this._relatedAxisComponent,this._isHorizontal)?r.reverse():r)}}},{key:"_updateValueScaleRange",value:function(){if(this._valueScale){var t=this._computeWidth(),e=this._computeHeight();this._isHorizontal?this._valueScale.range([e-this._middleHandlerSize,0]):"left"===this.layoutOrient?this._valueScale.range([t-this._middleHandlerSize,0]):this._valueScale.range([0,t-this._middleHandlerSize])}}},{key:"_computeDomainOfValueScale",value:function(){var t=this,e=this._data.getLatestData().map((function(e){return e[t._valueField]})),i=e.map((function(t){return 1*t}));return e.length?[ut(i),lt(i)]:null}},{key:"_isScaleValid",value:function(t){if(!t||!t.domain())return!1;var e,i=t.domain();return!(LI(t.type)&&i[0]===st(i)||FI(t.type)&&1===(e=i,e&&O(e)?Array.from(new Set(ot(e))):e).length)}},{key:"_getXScale",value:function(){return this._relatedAxisComponent.getScale().type===this.stateScale.type&&this._isHorizontal?this.stateScale:this._isHorizontal?this._stateScale:this._valueScale}},{key:"_getYScale",value:function(){return this._isHorizontal?this._valueScale:this._stateScale}},{key:"_computeMiddleHandlerSize",value:function(){var t,e,i,n,r=0;if(null===(e=null===(t=this._spec)||void 0===t?void 0:t.middleHandler)||void 0===e?void 0:e.visible){var a=null!==(i=this._spec.middleHandler.icon.style.size)&&void 0!==i?i:8,o=null!==(n=this._spec.middleHandler.background.size)&&void 0!==n?n:40;r+=Math.max(a,o)}return r}},{key:"_computeWidth",value:function(){return!1===this._visible?0:L(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:Math.max(this._startHandlerSize||0,this._endHandlerSize||0,this._backgroundSize||0)+this._middleHandlerSize}},{key:"_computeHeight",value:function(){return!1===this._visible?0:L(this._spec.height)?this._spec.height:this._isHorizontal?Math.max(this._startHandlerSize||0,this._endHandlerSize||0,this._backgroundSize||0)+this._middleHandlerSize:this.getLayoutRect().height}},{key:"_getAttrs",value:function(t){var e,i,n,r,a,o=null!==(e=this._spec)&&void 0!==e?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._computeWidth(),height:this._computeHeight()},showDetail:o.showDetail,brushSelect:null!==(i=o.brushSelect)&&void 0!==i&&i,zoomLock:null!==(n=o.zoomLock)&&void 0!==n&&n,minSpan:this._minSpan,maxSpan:this._maxSpan,delayType:o.delayType,delayTime:M(o.delayType)?null!==(r=o.delayTime)&&void 0!==r?r:30:0,realTime:null===(a=o.realTime)||void 0===a||a,previewData:t&&this._data.getLatestData(),previewPointsX:t&&this._dataToPositionX,previewPointsY:t&&this._dataToPositionY,tolerance:this._spec.tolerance,isReverse:N1(this._relatedAxisComponent,this._isHorizontal)},this._getComponentAttrs(t))}},{key:"_getLayoutAttrs",value:function(){return{position:{x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y},size:{width:this._computeWidth(),height:this._computeHeight()}}}},{key:"_createOrUpdateComponent",value:function(t){var e=this;if(this._visible){var i=!1!==this._spec.showBackgroundChart,n=this._getAttrs(i),r=this._relatedAxisComponent;if(this._component)this._component.setAttributes(n),t&&(this._component.setPreviewData(this._data.getDataView().latestData),i&&(this._isHorizontal?this._component.setPreviewPointsY1(this._dataToPositionY2):this._component.setPreviewPointsX1(this._dataToPositionX2),this._component.setStatePointToData((function(t){return j1(t,e._stateScale,N1(r,e._isHorizontal))}))));else{var a=this.getContainer();this._component=new oD(n),this._component.setPreviewData(this._data.getDataView().latestData),this._isHorizontal?i&&this._component.setPreviewPointsY1(this._dataToPositionY2):i&&this._component.setPreviewPointsX1(this._dataToPositionX2),this._component.setStatePointToData((function(t){return j1(t,e._stateScale,N1(r,e._isHorizontal))})),this._component.addEventListener("dataZoomChange",(function(t){var i=t.detail,n=i.start,r=i.end,a=i.tag;e._handleChange(n,r,void 0,a)})),a.add(this._component)}}}},{key:"_getComponentAttrs",value:function(t){var e,i,n,r,a,o,s,l,u,h,c,d=this._spec,v=d.middleHandler,f=void 0===v?{}:v,p=d.startText,g=void 0===p?{}:p,y=d.endText,m=void 0===y?{}:y,_=d.backgroundChart,b=void 0===_?{}:_,k=d.selectedBackgroundChart,x=void 0===k?{}:k;return{backgroundStyle:tH(null===(e=this._spec.background)||void 0===e?void 0:e.style),startHandlerStyle:tH(null===(i=this._spec.startHandler)||void 0===i?void 0:i.style),middleHandlerStyle:f.visible?{visible:!0,icon:tH(null===(n=f.icon)||void 0===n?void 0:n.style),background:{size:null===(r=f.background)||void 0===r?void 0:r.size,style:tH(null===(a=f.background)||void 0===a?void 0:a.style)}}:{visible:!1},endHandlerStyle:tH(null===(o=this._spec.endHandler)||void 0===o?void 0:o.style),startTextStyle:{padding:g.padding,formatMethod:this._getHandlerTextFormatMethod(g),textStyle:tH(g.style)},endTextStyle:{padding:m.padding,formatMethod:this._getHandlerTextFormatMethod(m),textStyle:tH(m.style)},selectedBackgroundStyle:tH(this._spec.selectedBackground.style),dragMaskStyle:tH(null===(s=this._spec.dragMask)||void 0===s?void 0:s.style),backgroundChartStyle:t?{line:Nz(tH(null===(l=b.line)||void 0===l?void 0:l.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},tH(null===(u=b.area)||void 0===u?void 0:u.style))}:{line:{visible:!1},area:{visible:!1}},selectedBackgroundChartStyle:t?{line:Nz(tH(null===(h=x.line)||void 0===h?void 0:h.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},tH(null===(c=x.area)||void 0===c?void 0:c.style))}:{line:{visible:!1},area:{visible:!1}},disableTriggerEvent:this._option.disableTriggerEvent}}},{key:"_getHandlerTextFormatMethod",value:function(t){var e=t.formatMethod,i=t.formatter,n=OU(e,i).formatFunc;return n?function(t){return n(t,{label:t},i)}:void 0}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._component]}},{key:"onDataUpdate",value:function(){_(r,"onDataUpdate",this,3)([]),this._previewStateScale!==this._stateScale&&(this._previewStateScale=null)}},{key:"_getPreviewStateScale",value:function(){return this._previewStateScale||(N1(this._relatedAxisComponent,this._isHorizontal)?(this._previewStateScale=this._stateScale.clone(),this._previewStateScale.range(this._stateScale.range().reverse())):this._previewStateScale=this._stateScale),this._previewStateScale}}])}(Y1);J1.type=c.dataZoom,J1.transformerConstructor=K1,J1.builtInTheme={dataZoom:q1},J1.specKey="dataZoom";var Q1={horizontal:{height:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}},vertical:{width:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}}},$1={width:!0,height:!0,rail:!0,slider:!0,round:!0,innerPadding:!0,minSliderSize:!0},t2=function(e){function r(e,a){var o,s;return n(this,r),(o=i(this,r,[e,a])).type=c.scrollBar,o.name=c.scrollBar,o.specKey="scrollBar",o.layoutZIndex=t.LayoutZIndex.DataZoom,o.layoutLevel=t.LayoutLevel.DataZoom,o.layoutType="region-relative",o._filterMode=null!==(s=e.filterMode)&&void 0!==s?s:"axis",o}return h(r,e),a(r,[{key:"_handleChange",value:function(e,i,n){_(r,"_handleChange",this,3)([e,i,n]);var a=GF(this._start,e)&&GF(this._end,i);if(this._shouldChange&&(!a||!1===this._spec.realTime)){n&&this._component&&this._component.setAttribute("range",[e,i]),this._start=e,this._end=i;var o=this._relatedAxisComponent,s=N1(o,this._isHorizontal),l=j1(e,this._stateScale,s),u=j1(i,this._stateScale,s);(A(this._spec.updateDataAfterChange)?this._spec.updateDataAfterChange(e,i,l,u):this._handleStateChange(l,u))&&this.event.emit(t.ChartEvent.scrollBarChange,{model:this,value:{filterData:"axis"!==this._filterMode,start:this._start,end:this._end,startValue:this._startValue,endValue:this._endValue,newDomain:this._newDomain}})}}},{key:"_handleDataCollectionChange",value:function(){this._spec.auto&&this._data.getDataView().reRunAllTransform()}},{key:"_getComponentOnlySpecKeys",value:function(){return $1}},{key:"_beforeLayoutEnd",value:function(){var t,e;_(r,"_beforeLayoutEnd",this,3)([]),null===(e=(t=this.effect).onZoomChange)||void 0===e||e.call(t)}},{key:"onLayoutEnd",value:function(){this._updateComponentBounds(),_(r,"onLayoutEnd",this,3)([])}},{key:"_updateScaleRange",value:function(){}},{key:"_updateComponentBounds",value:function(){this._component&&this._component.setAttributes({x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y,width:this.getLayoutRect().width,height:this.getLayoutRect().height})}},{key:"_computeWidth",value:function(){return!1===this._visible?0:L(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:12}},{key:"_computeHeight",value:function(){return!1===this._visible?0:L(this._spec.height)?this._spec.height:this._isHorizontal?12:this.getLayoutRect().height}},{key:"_getAttrs",value:function(){var t,e,i,n,r,a,o;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:null===(t=this._spec)||void 0===t?void 0:t.delayType,delayTime:M(null===(e=this._spec)||void 0===e?void 0:e.delayType)?null!==(n=null===(i=this._spec)||void 0===i?void 0:i.delayTime)&&void 0!==n?n:30:0,realTime:null===(a=null===(r=this._spec)||void 0===r?void 0:r.realTime)||void 0===a||a,minSliderSize:null===(o=this._spec)||void 0===o?void 0:o.minSliderSize},this._getComponentAttrs())}},{key:"_createOrUpdateComponent",value:function(){var t=this,e=this._getAttrs();if(this._component)this._component.setAttributes(e);else{var i=this.getContainer();this._component=new Nw(e),this._component.addEventListener("scrollDrag",(function(e){var i=e.detail.value;t._handleChange(i[0],i[1])})),this._component.addEventListener("scrollUp",(function(e){var i=e.detail.value;t._handleChange(i[0],i[1])})),i.add(this._component)}}},{key:"_getComponentAttrs",value:function(){var t=this._spec,e=t.rail,i=t.slider,n=t.innerPadding,r={};return C(n)||(r.padding=n),W(null==e?void 0:e.style)||(r.railStyle=tH(e.style)),W(null==i?void 0:i.style)||(r.sliderStyle=tH(i.style)),r.disableTriggerEvent=this._option.disableTriggerEvent,r}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._component]}}])}(Y1);t2.type=c.scrollBar,t2.builtInTheme={scrollBar:Q1},t2.specKey="scrollBar";var e2=function(t,e){var i=A(e)?e():e,n=i.datum,r=i.title,a=i.content,o=[],s=n.call(null);return r.visible&&o.push({type:"title",index:0,datum:s,spec:r}),ot(a).forEach((function(t,e){t.visible&&o.push({type:"content",index:e,datum:s,spec:t})})),o},i2=function(t,e){return{fontSize:{type:"token",key:t},fill:{type:"palette",key:e},fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}},n2={title:{visible:!0,autoLimit:!1,autoFit:!1,style:i2("l1FontSize","primaryFontColor")},content:{visible:!0,style:i2("l2FontSize","tertiaryFontColor")}},r2=function(e){function o(){var e;return n(this,o),(e=i(this,o,arguments)).type=c.indicator,e.name=c.indicator,e.specKey="indicator",e.layoutType="none",e.layoutZIndex=t.LayoutZIndex.Indicator,e.layoutLevel=t.LayoutLevel.Indicator,e._gap=0,e._activeDatum=null,e}return h(o,e),a(o,[{key:"created",value:function(){_(o,"created",this,3)([]),this.initData(),this.initEvent()}},{key:"setAttrFromSpec",value:function(){_(o,"setAttrFromSpec",this,3)([]),this._gap=this._spec.gap||0,this._title=this._spec.title,this._content=ot(this._spec.content),this._regions=this._option.getRegionsInUserIdOrIndex(ot(this._spec.regionId),ot(this._spec.regionIndex))}},{key:"_compareSpec",value:function(t,e){var i=_(o,"_compareSpec",this,3)([t,e]);return!!nt(e,t)||i.reMake||i.reCompile||(i.change=!0,i.reRender=!0,i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0})),i}},{key:"initEvent",value:function(){var t=this;this._option.disableTriggerEvent||"none"!==this._spec.trigger&&("hover"===this._spec.trigger?(this.event.on("element-highlight:start",(function(e){var i=e.graphics[0];t.isRelativeModel(i)&&t.updateDatum(nH(i))})),this.event.on("element-highlight:reset",(function(e){t._activeDatum&&t.updateDatum(null)}))):(this.event.on("element-select:start",(function(e){var i=e.graphics[0];t.isRelativeModel(i)&&t.updateDatum(nH(i))})),this.event.on("element-select:reset",(function(e){t._activeDatum&&t.updateDatum(null)}))))}},{key:"updateDatum",value:function(t){this._activeDatum=t,this._displayData.updateData();var e=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(e)}},{key:"initData",value:function(){var t=this;fH(this._option.dataSet,"indicatorFilter",e2);var e=new Ko(this._option.dataSet,{name:"".concat(this.type,"_").concat(this.id,"_data")});e.transform({type:"indicatorFilter",options:function(){return{title:t._title,content:t._content,datum:function(){return t._activeDatum}}}}),e.target.addListener("change",this.updateDatum.bind(this)),this._displayData=new WN(this._option,e)}},{key:"updateLayoutAttribute",value:function(){var t=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(t),_(o,"updateLayoutAttribute",this,3)([])}},{key:"_getIndicatorAttrs",value:function(){var t=this;if(!1===this._spec.visible||!1===this._spec.fixed&&null===this._activeDatum)return{visible:!1};var e=this._regions[0],i=e.getLayoutRect(),n=i.width,a=i.height,o=e.getLayoutStartPoint(),s=o.x,l=o.y,u=this._spec,h=u.content,c=u.offsetX,d=u.offsetY,v=u.limitRatio,f=u.title,p=r(u,["content","offsetX","offsetY","limitRatio","title"]),g=[];return ot(h).forEach((function(e){var i=Nz({},t._theme.content,e);g.push({visible:!1!==i.visible&&(!i.field||null!==t._activeDatum),space:i.space||t._gap,autoLimit:i.autoLimit,autoFit:i.autoFit,fitPercent:i.fitPercent,fitStrategy:i.fitStrategy,style:Object.assign(Object.assign({},$j($(i.style,["text"]),t._activeDatum)),{text:t._createText(i.field,i.style.text)})})})),Object.assign({visible:!0,size:{width:n,height:a},zIndex:this.layoutZIndex,x:s,y:l,dx:c?Iz(c,this._computeLayoutRadius()):0,dy:d?Iz(d,this._computeLayoutRadius()):0,limitRatio:v||1/0,title:{visible:!1!==f.visible&&(!M(f.field)||null!==this._activeDatum),space:f.space||this._gap,autoLimit:f.autoLimit,autoFit:f.autoFit,fitPercent:f.fitPercent,fitStrategy:f.fitStrategy,style:Object.assign(Object.assign({},$j($(f.style,["text"]),this._activeDatum)),{text:this._createText(f.field,f.style.text)})},content:g},p)}},{key:"_createOrUpdateIndicatorComponent",value:function(t){var e=this;if(!1===t.visible)return this._indicatorComponent&&this._indicatorComponent.parent&&this._indicatorComponent.parent.removeChild(this._indicatorComponent),void(this._indicatorComponent=null);if(this._indicatorComponent)nt(t,this._cacheAttrs)||this._indicatorComponent.setAttributes(t);else{var i=this.getContainer(),n=new bF(t);n.name="indicator",i.add(n),this._indicatorComponent=n,this._indicatorComponent.on("*",(function(t,i){return e._delegateEvent(e._indicatorComponent,t,i)}))}this._cacheAttrs=t}},{key:"_createText",value:function(t,e){var i;return t?this._activeDatum?this._activeDatum[t]:"":A(e)?null!==(i=e(this._activeDatum,void 0))&&void 0!==i?i:"":null!=e?e:""}},{key:"_computeLayoutRadius",value:function(){var t=this._regions[0].getLayoutRect(),e=t.width,i=t.height;return Math.min(e/2,i/2)}},{key:"isRelativeModel",value:function(t){return this._regions.some((function(e){return!!e.getSeriesInId(t.context.modelId)}))}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._indicatorComponent]}},{key:"clear",value:function(){this._cacheAttrs=null,_(o,"clear",this,3)([])}},{key:"getIndicatorComponent",value:function(){return this._indicatorComponent}}],[{key:"getSpecInfo",value:function(t){return IU(t,this.specKey,this.type,(function(t){return t&&!1!==t.visible}))}}])}(DW);r2.type=c.indicator,r2.builtInTheme={indicator:n2},r2.specKey="indicator";var a2=["sum","average","min","max","variance","standardDeviation","median"];function o2(t,e,i){if(!i)return!1;var n=t.map((function(t){return 1*t})),r=ut(n),a=lt(n);return e<r||e>a}function s2(t,e){return t?"".concat(t,"_").concat(e,"_extend"):"marker_".concat(e,"_extend")}function l2(t,e,i,n,r,a,o){var s,l,u=n.relativeSeries;return L(t.x)&&o2(e,t.x,i)&&(null===(l=null==u?void 0:(s=u.getXAxisHelper()).setExtendDomain)||void 0===l||l.call(s,s2(o,"xAxis"),t.x)),Mz(t.x)?d2(t.x,r)+a.x:v2(u.getXAxisHelper(),[t.x])+a.x}function u2(t,e,i,n,r,a,o){var s,l,u=n.relativeSeries;return L(t.y)&&o2(e,t.y,i)&&(null===(l=null===(s=u.getYAxisHelper())||void 0===s?void 0:s.setExtendDomain)||void 0===l||l.call(s,s2(o,"yAxis"),t.y)),Mz(t.y)?d2(t.y,r)+a.y:v2(u.getYAxisHelper(),[t.y])+a.y}function h2(t,e,i,n,r){var a,o,s=n.relativeSeries;return L(t.angle)&&o2(e,t.angle,i)&&(null===(o=null===(a=s.angleAxisHelper)||void 0===a?void 0:a.setExtendDomain)||void 0===o||o.call(a,s2(r,"angleAxis"),t.angle)),v2(s.angleAxisHelper,[t.angle])}function c2(t,e,i,n,r){var a,o,s=n.relativeSeries;return L(t.radius)&&o2(e,t.radius,i)&&(null===(o=null===(a=s.radiusAxisHelper)||void 0===a?void 0:a.setExtendDomain)||void 0===o||o.call(a,s2(r,"radiusAxis"),t.radius)),v2(s.radiusAxisHelper,[t.radius])}function d2(t,e){return Number(t.substring(0,t.length-1))*e/100}function v2(t,e){var i=t.getScale(0);return LI(i.type)&&i.domain()[0]===i.domain()[1]&&e[0]!==i.domain()[0]?NaN:t.dataToPosition(e)}function f2(t){return a2.includes(t)}function p2(t,e,i,n,r){var a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=arguments.length>6?arguments[6]:void 0,s=e.getRegion(),l=s.getLayoutStartPoint(),u=i.getRegion(),h=u.getLayoutStartPoint(),c=Math.abs(Math.min(l.x,h.x)-Math.max(l.x+s.getLayoutRect().width,h.x+u.getLayoutRect().width)),d=Math.abs(Math.min(l.y,h.y)-Math.max(l.y+s.getLayoutRect().height,h.y+u.getLayoutRect().height)),v={relativeSeries:n,startRelativeSeries:e,endRelativeSeries:i},f=[],p=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,g=n.getXAxisHelper(),y=n.getYAxisHelper(),m=g.getScale(0).domain(),_=y.getScale(0).domain(),b=a&&!g.isContinuous&&!!g.getBandwidth,k=a&&!y.isContinuous&&!!y.getBandwidth,x={min:null,max:null},S={min:null,max:null};return p.forEach((function(t){var e,i,n=M(t.x),a=M(t.y);if(n&&a)e=l2(t,m,r,v,c,l,o),i=u2(t,_,r,v,d,l,o),g2(e,b,x,f.length),g2(i,k,S,f.length),f.push([{x:e,y:i}]);else if(n){e=l2(t,m,r,v,c,l,o),i=Math.max(l.y+s.getLayoutRect().height,h.y+u.getLayoutRect().height);var p=Math.min(l.y,h.y);g2(e,b,x,f.length),f.push([{x:e,y:i},{x:e,y:p}])}else if(a){e=Math.min(l.x,h.x),i=u2(t,_,r,v,d,l,o);var g=Math.max(l.x+s.getLayoutRect().width,h.x+u.getLayoutRect().width);g2(i,k,S,f.length),f.push([{x:e,y:i},{x:g,y:i}])}})),function(t,e,i,n,r){if(n.min||n.max){var a=e.getBandwidth(0)*(1+e.getScale(0).paddingInner());n.min&&t[n.min.index].forEach((function(t){return t.x-=a/2})),n.max&&t[n.max.index].forEach((function(t){return t.x+=a/2}))}if(r.min||r.max){var o=i.getBandwidth(0)*(1+i.getScale(0).paddingInner());r.min&&t[r.min.index].forEach((function(t){return t.y-=o/2})),r.max&&t[r.max.index].forEach((function(t){return t.y+=o/2}))}}(f,g,y,x,S),f}function g2(t,e,i,n){return e&&((null===i.min||i.min.value>t)&&(i.min={value:t,index:n}),(null===i.max||i.max.value<t)&&(i.max={value:t,index:n})),t}function y2(t,e,i,n,r,a){var o={relativeSeries:n,startRelativeSeries:e,endRelativeSeries:i},s=[],l=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,u=n.angleAxisHelper.getScale(0).domain(),h=n.radiusAxisHelper.getScale(0).domain(),c=Math.min(n.getRegion().getLayoutRect().width/2,n.getRegion().getLayoutRect().height/2);return l.forEach((function(t){var e=M(t.angle),i=M(t.radius);if(e&&i){var n=h2(t,u,r,o,a),l=c2(t,h,r,o,a);s.push([{angle:n,radius:l}])}else if(e){var d=h2(t,u,r,o,a);s.push([{angle:d,radius:-c},{angle:d,radius:c}])}else if(i){var v=c2(t,h,r,o,a);s.push([{radius:v,angle:0},{radius:v,angle:2*Math.PI}])}})),s}function m2(t,e,i,n,r){var a=[],o=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,s=O(n);return o.forEach((function(t,o){var l,u,h,c,d=(null==t?void 0:t.getRefRelativeSeries)?t.getRefRelativeSeries():e,v=d.getRegion(),f=v.getLayoutStartPoint(),p=v.getLayoutRect(),g=p.width,y=p.height,m=0,_=0;if(n){var b=s?n[o]:n,k=b.x,x=b.y;k&&(m=Mz(k)?Number(k.substring(0,k.length-1))*g/100:k),x&&(_=Mz(x)?Number(x.substring(0,x.length-1))*y/100:x)}var S=d.getXAxisHelper().getScale(0).domain(),A=d.getYAxisHelper().getScale(0).domain(),C=ot(t.x),M=ot(t.y);1===C.length&&L(C[0])&&o2(S,C[0],i)&&(null===(u=null===(l=d.getXAxisHelper())||void 0===l?void 0:l.setExtendDomain)||void 0===u||u.call(l,s2(r,"xAxis"),C[0])),1===M.length&&L(M[0])&&o2(A,M[0],i)&&(null===(c=null===(h=d.getYAxisHelper())||void 0===h?void 0:h.setExtendDomain)||void 0===c||c.call(h,s2(r,"yAxis"),M[0])),a.push({x:v2(d.getXAxisHelper(),C)+f.x+m,y:v2(d.getYAxisHelper(),M)+f.y+_})})),a}function _2(t,e,i,n){var r=[];return(t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData).forEach((function(t){var a,o,s,l,u=(null==t?void 0:t.getRefRelativeSeries)?t.getRefRelativeSeries():e,h=u.angleAxisHelper.getScale(0).domain(),c=u.radiusAxisHelper.getScale(0).domain(),d=ot(t.angle),v=ot(t.radius);1===d.length&&L(d[0])&&o2(h,d[0],i)&&(null===(o=null===(a=u.angleAxisHelper)||void 0===a?void 0:a.setExtendDomain)||void 0===o||o.call(a,s2(n,"angleAxis"),d[0])),1===v.length&&L(v[0])&&o2(c,v[0],i)&&(null===(l=null===(s=u.radiusAxisHelper)||void 0===s?void 0:s.setExtendDomain)||void 0===l||l.call(s,s2(n,"radiusAxis"),v[0])),r.push({angle:v2(u.angleAxisHelper,d),radius:v2(u.radiusAxisHelper,v)})})),r}function b2(t,e,i){var n=t.x,r=t.y;return Mz(n)&&(n=d2(n,e)),Mz(r)&&(r=d2(r,i)),{x:n,y:r}}function k2(t,e,i){var n;if(n=A(t)?ot(t(e.getData().getLatestData(),e)):ot(t),i){var r=e.getRegion(),a=r.getLayoutStartPoint(),o=a.x,s=a.y,l=r.getLayoutRect(),u=l.width,h=l.height;return n.map((function(t){var e=b2(t,u,h),i=e.x,n=e.y;return{x:i+=o,y:n+=s}}))}var c=e.getOption().getChart().getViewRect(),d=c.width,v=c.height;return n.map((function(t){return b2(t,d,v)}))}function x2(t){var e=1/0,i=-1/0,n=1/0,r=-1/0;return t.forEach((function(t){var a=t.getLayoutStartPoint(),o=t.getLayoutRect();a.x<e&&(e=a.x),a.x+o.width>i&&(i=a.x+o.width),a.y<n&&(n=a.y),a.y+o.height>r&&(r=a.y+o.height)})),{minX:e,maxX:i,minY:n,maxY:r}}function S2(t,e,i){var n=t.labelBackground,a=void 0===n?{}:n,o=t.style,s=t.shape,l=r(t,["labelBackground","style","shape"]);if(!1!==t.visible){var u=l;return(null==s?void 0:s.visible)?u.shape=Object.assign({visible:!0},tH(s.style)):u.shape={visible:!1},!1!==a.visible?(u.panel=Object.assign({visible:!0,customShape:a.customShape},C2(tH(a.style),e,i)),M(a.padding)&&(u.padding=bi(a.padding))):(u.panel={visible:!1},u.padding=0),o&&(u.textStyle=C2(tH(o),e,i)),u}return{visible:!1}}function A2(t,e,i){for(var n in t)A(t[n])&&(t[n]=t[n](e,i));return t}function C2(t,e,i){return A(t)?t(e,i):t}function M2(t,e){return A(t)?t(e):t}function T2(t,e,i){return M(t)?"regionLeft"===e?i.getLayoutStartPoint().x-t.x:"regionRight"===e?i.getLayoutStartPoint().x+i.getLayoutRect().width-t.x:"regionTop"===e?i.getLayoutStartPoint().y-t.y:"regionBottom"===e?i.getLayoutStartPoint().y+i.getLayoutRect().height-t.y:e:e}function w2(t){return{isXProcess:M(t.x),isYProcess:M(t.y),isX1Process:M(t.x1),isY1Process:M(t.y1),isAngleProcess:M(t.angle),isRadiusProcess:M(t.radius),isAngle1Process:M(t.angle1),isRadius1Process:M(t.radius1),isCoordinatesProcess:M(t.coordinates),isValidProcess:M(t.process)}}function E2(t){var e=w2(t),i=e.isXProcess,n=e.isYProcess,r=e.isX1Process,a=e.isY1Process,o=e.isAngleProcess,s=e.isRadiusProcess,l=e.isAngle1Process,u=e.isRadius1Process,h=e.isCoordinatesProcess,c=e.isValidProcess;return{doXProcess:i&&!n&&!a,doXYY1Process:i&&n&&a,doYProcess:n&&!i&&!r,doYXX1Process:n&&i&&r,doXYProcess:i&&n&&r&&a,doAngleProcess:o&&!l&&!s&&!u,doRadiusProcess:s&&!u&&!o&&!l,doAngRadRad1Process:o&&!l&&s&&u,doRadAngAng1Process:s&&o&&l&&!u,doRadAngProcess:o&&s&&l&&u,doCoordinatesProcess:h&&(!c||"process"in t&&"xy"in t.process)}}function B2(t){var e=w2(t),i=e.isXProcess,n=e.isYProcess,r=e.isX1Process,a=e.isY1Process,o=e.isAngleProcess,s=e.isRadiusProcess,l=e.isAngle1Process,u=e.isRadius1Process;return{doXProcess:i&&r&&!n&&!a,doYProcess:n&&a&&!i&&!r,doXYProcess:i&&r&&n&&a,doAngleProcess:o&&l&&!s&&!u,doRadiusProcess:s&&u&&!o&&!l,doRadAngProcess:o&&s&&l&&u,doCoordinatesProcess:e.isCoordinatesProcess}}function P2(t){return{doXYProcess:M(t.x)&&M(t.y),doPolarProcess:M(t.angle)&&M(t.radius),doGeoProcess:M(t.areaName)}}function O2(t,e){var i;if(e.coordinates){var n,a,o=e,s=o.coordinates,l=o.coordinateType,u=o.getSeriesByIdOrIndex,h=r(o,["coordinates","coordinateType","getSeriesByIdOrIndex"]);if(A(s)){var c=e.getRelativeSeries();n=s(c.getData().getLatestData(),c)}else n=s;i=(n=ot(n)).map((function(t){var e=u(t.refRelativeSeriesId,t.refRelativeSeriesIndex);if("cartesian"===l){var i=e.getSpec(),n=i.xField,r=i.yField,o=t.xFieldDim,s=t.xFieldIndex,c=t.yFieldDim,d=t.yFieldIndex,v=n;M(s)&&(v=ot(n)[s]),o&&ot(n).includes(o)&&(v=o);var f=r;M(d)&&(f=ot(r)[d]),c&&ot(r).includes(c)&&(f=c),a=Object.assign({x:void 0,y:void 0},h),P(t[v])&&f2(t[v])?a.x={field:v,aggrType:t[v]}:a.x=ot(v).map((function(e){return t[e]})),P(t[f])&&f2(t[f])?a.y={field:f,aggrType:t[f]}:a.y=ot(f).map((function(e){return t[e]}))}else if("polar"===l){var p=e.getSpec(),g=p.valueField,y=p.categoryField,m=t.angleFieldDim,_=t.angleFieldIndex,b=y;M(_)&&(b=ot(y)[_]),m&&ot(y).includes(m)&&(b=m);var k=g;a=Object.assign({angle:void 0,radius:void 0},h),P(t[b])&&f2(t[b])?a.angle={field:b,aggrType:t[b]}:a.angle=ot(b).map((function(e){return t[e]})),P(t[k])&&f2(t[k])?a.radius={field:k,aggrType:t[k]}:a.radius=ot(k).map((function(e){return t[e]}))}return a.getRefRelativeSeries=function(){return e},a}))}else i=e;var d=[];return i.forEach((function(e){var i={x:null,y:null,angle:null,radius:null,areaName:null};if(M(e.x)){var n=e.x;O(n)?i.x=n.map((function(i){return R2(i,t,e)})):i.x=R2(n,t,e)}if(M(e.y)){var r=e.y;O(r)?i.y=r.map((function(i){return R2(i,t,e)})):i.y=R2(r,t,e)}if(M(e.angle)){var a=e.angle;O(a)?i.angle=a.map((function(i){return R2(i,t,e)})):i.angle=R2(a,t,e)}if(M(e.radius)){var o=e.radius;O(o)?i.radius=o.map((function(i){return R2(i,t,e)})):i.radius=R2(o,t,e)}if(M(e.areaName)){var s=e.areaName;i.areaName=R2(s,t,e)}e.getRefRelativeSeries&&(i.getRefRelativeSeries=e.getRefRelativeSeries),d.push(i)})),d}var I2={min:function(t,e){return YF(t[0].latestData,e.field)},max:function(t,e){return KF(t[0].latestData,e.field)},sum:function(t,e){return XF(t[0].latestData,e.field)},average:function(t,e){return qF(t[0].latestData,e.field)},variance:function(t,e){return ZF(t[0].latestData,e.field)},standardDeviation:function(t,e){return function(t,e){return Math.sqrt(ZF(t,e))}(t[0].latestData,e.field)},median:function(t,e){return function(t,e){return At(t.map((function(t){return t[e]})))}(t[0].latestData,e.field)}};function R2(t,e,i){var n=i.getRelativeSeries(),r=i.getStartRelativeSeries(),a=i.getEndRelativeSeries(),o=n.getData().getLatestData(),s=r.getData().getLatestData(),l=a.getData().getLatestData();if(A(t))return t(o,s,l,n,r,a);if(E(t)){var u=t.aggrType,h=t.field;return I2[u](e,{field:h})}return t}function L2(t,e){if(e&&e.getRelativeSeries){var i=e.getRelativeSeries();if(i){var n=i.getViewData();return n&&n.latestData&&n.latestData.length?t:[]}}return t}var D2=function(t){var e,i=null===(e=null==t?void 0:t.dataSet)||void 0===e?void 0:e.dataViewMap;return i?Object.values(i).filter(Boolean):[]},F2=function(t,e){var i,n;null===(i=null==t?void 0:t.target)||void 0===i||i.removeListener("change",e.reRunAllTransform),null===(n=null==t?void 0:t.target)||void 0===n||n.removeListener("markRunning",e.markRunning)},z2=function(t){if(t){D2(t).forEach((function(e){F2(e,t)}));var e=null==t?void 0:t.rawData;Array.isArray(e)&&e.forEach((function(e){F2(e,t)}))}},j2=function(t,e){if(t){var i=new Set(D2(t)),n=[],r=function(t){var a=null==t?void 0:t.rawData;Array.isArray(a)&&a.forEach((function(t){i.has(t)&&e(t)&&!n.includes(t)&&(n.push(t),r(t))}))};r(t),function(t){var e=Array.from(new Set(t.filter(Boolean)));e.length&&(e.forEach(z2),e.forEach((function(t){var e;null===(e=t.destroy)||void 0===e||e.call(t)})))}([t].concat(n))}},H2="__vchart_marker_coordinate__",N2=["coordinate","coordinates","x","y","x1","y1","angle","angle1","radius","radius1"],U2=["position","positions","coordinatesOffset","regionRelative"],V2=["offsetX","offsetY","confine"],W2=function(t){return Array.isArray(t)?t.map(W2):t&&"object"==x(t)?"function"!=typeof t.formatMethod?t:Object.assign(Object.assign({},t),{formatMethod:"__vchart_marker_format_method__"}):t},G2=function(t){if(Array.isArray(t))return t.map(G2);if(!t||"object"!=x(t))return t;var e=Object.assign({},t);return Object.keys(e).forEach((function(t){"style"===t||t.endsWith("Style")?e[t]="__vchart_marker_style__":e[t]=G2(e[t])})),e},Y2=function(t,e){if(!t||"object"!=x(t))return t;var i=Object.assign({},t);e.normalizeDomainPosition&&N2.forEach((function(t){i[t]=H2})),e.normalizeAutoRange&&"autoRange"in i&&(i.autoRange="__vchart_marker_auto_range__"),U2.forEach((function(t){t in i&&(i[t]=H2)})),"label"in i&&(i.label=W2(i.label)),Object.keys(i).forEach((function(t){i[t]=G2(i[t])}));var n=i.itemContent;if(n&&"object"==x(n)){i.itemContent=Object.assign({},n),V2.forEach((function(t){t in i.itemContent&&(i.itemContent[t]=H2)}));var r=i.itemContent.text;r&&"object"==x(r)&&(i.itemContent.text=Object.assign(Object.assign({},W2(r)),{text:"__vchart_marker_text__"}))}return i},K2=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).layoutType="none",t._markerDataChangeHandler=null,t._markerDataOwned=!1,t._layoutOffsetX=0,t._layoutOffsetY=0,t}return h(e,t),a(e,[{key:"getRelativeSeries",value:function(){return this._relativeSeries}},{key:"getMarkerData",value:function(){return this._markerData}},{key:"getMarkAttributeContext",value:function(){return this._markAttributeContext}},{key:"_buildMarkerAttributeContext",value:function(){this._markAttributeContext={relativeSeries:this._relativeSeries,startRelativeSeries:this._startRelativeSeries,endRelativeSeries:this._endRelativeSeries,vchart:this._option.globalInstance}}},{key:"created",value:function(){_(e,"created",this,3)([]),this._bindSeries(),this._initDataView(),this.initEvent(),this._buildMarkerAttributeContext()}},{key:"_getAllRelativeSeries",value:function(){var t=this;return{getRelativeSeries:function(){return t._relativeSeries},getStartRelativeSeries:function(){return t._startRelativeSeries},getEndRelativeSeries:function(){return t._endRelativeSeries}}}},{key:"_getAutoRangeExtendDomainKeyPrefix",value:function(){return"marker_".concat(this.type,"_").concat(this.id)}},{key:"_getAutoRangeExtendDomainKey",value:function(t){return"".concat(this._getAutoRangeExtendDomainKeyPrefix(),"_").concat(t,"_extend")}},{key:"_clearAutoRangeExtendDomain",value:function(){var t,e,i=this;ot(null===(e=(t=this._option).getAllSeries)||void 0===e?void 0:e.call(t)).forEach((function(t){var e,n,r,a,o,s,l,u,h,c;null===(r=null===(n=null===(e=null==t?void 0:t.getXAxisHelper)||void 0===e?void 0:e.call(t))||void 0===n?void 0:n.setExtendDomain)||void 0===r||r.call(n,i._getAutoRangeExtendDomainKey("xAxis"),void 0),null===(s=null===(o=null===(a=null==t?void 0:t.getYAxisHelper)||void 0===a?void 0:a.call(t))||void 0===o?void 0:o.setExtendDomain)||void 0===s||s.call(o,i._getAutoRangeExtendDomainKey("yAxis"),void 0),null===(u=null===(l=null==t?void 0:t.angleAxisHelper)||void 0===l?void 0:l.setExtendDomain)||void 0===u||u.call(l,i._getAutoRangeExtendDomainKey("angleAxis"),void 0),null===(c=null===(h=null==t?void 0:t.radiusAxisHelper)||void 0===h?void 0:h.setExtendDomain)||void 0===c||c.call(h,i._getAutoRangeExtendDomainKey("radiusAxis"),void 0)}))}},{key:"_updateMarkerLayout",value:function(){this._clearAutoRangeExtendDomain(),this._markerLayout()}},{key:"_getFieldInfoFromSpec",value:function(t,e,i){var n={x:"xField",y:"yField",radius:"valueField",angle:"categoryField",areaName:"nameField"};return P(e)&&f2(e)?{field:i.getSpec()[n[t]],aggrType:e}:e}},{key:"_processSpecByDims",value:function(t){var e=this,i=this._relativeSeries,n={};return t.forEach((function(t){return n[t.dim]=e._getFieldInfoFromSpec(t.dim,t.specValue,i)})),Object.assign(Object.assign({},n),this._getAllRelativeSeries())}},{key:"_processSpecCoo",value:function(t){var e=this;return Object.assign(Object.assign({coordinates:t.coordinates||t.coordinate},this._getAllRelativeSeries()),{getSeriesByIdOrIndex:function(t,i){return e._getSeriesByIdOrIndex(t,i)},coordinateType:this.coordinateType})}},{key:"_getRelativeDataView",value:function(){if(this._specifiedDataSeries){var t=[];ot(this._specifiedDataSeries).forEach((function(e){t=t.concat(e.getViewData().latestData)}));var e=new Yo;return e.registerParser("array",d),new Ko(e).parse(t,{type:"array"})}return this._relativeSeries.getViewData()}},{key:"_setMarkerData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._releaseMarkerData(),this._markerData=t,this._markerDataOwned=e}},{key:"_bindMarkerDataChange",value:function(){var t,e=this;(null===(t=this._markerData)||void 0===t?void 0:t.target)&&(this._markerDataChangeHandler=function(){e._updateMarkerLayout()},this._markerData.target.on("change",this._markerDataChangeHandler))}},{key:"_releaseMarkerData",value:function(){var t=this,e=this._markerData;(null==e?void 0:e.target)&&this._markerDataChangeHandler&&e.target.removeListener("change",this._markerDataChangeHandler),this._markerDataChangeHandler=null,this._markerDataOwned&&j2(e,(function(e){return e.name==="".concat(t.type,"_").concat(t.id,"_data")})),this._markerData=null,this._markerDataOwned=!1}},{key:"updateLayoutAttribute",value:function(){var t,i,n,r=this;if(null===(t=this._spec.visible)||void 0===t||t){if(!this._markerComponent){var a=this._createMarkerComponent();a.name=null!==(i=this._spec.name)&&void 0!==i?i:this.type,a.id=null!==(n=this._spec.id)&&void 0!==n?n:"".concat(this.type,"-").concat(this.id),this._markerComponent=a,this.getContainer().add(this._markerComponent),this._markerComponent.on("*",(function(t,e){r._delegateEvent(r._markerComponent,t,e,null,r.getMarkerData.bind(r))}))}this._updateMarkerLayout()}_(e,"updateLayoutAttribute",this,3)([])}},{key:"_getSeriesByIdOrIndex",value:function(t,e){var i,n,r;return(r=null===(i=this._option.getSeriesInUserIdOrIndex(M(t)?[t]:[],[e]))||void 0===i?void 0:i[0])||(r=null!==(n=this._relativeSeries)&&void 0!==n?n:this._getFirstSeries()),r}},{key:"_bindSeries",value:function(){var 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),t.specifiedDataSeriesIndex&&"all"===t.specifiedDataSeriesIndex||t.specifiedDataSeriesId&&"all"===t.specifiedDataSeriesId?this._specifiedDataSeries=this._option.getAllSeries():(t.specifiedDataSeriesIndex||t.specifiedDataSeriesId)&&(this._specifiedDataSeries=this._getSeriesByIdOrIndex(t.specifiedDataSeriesId,t.specifiedDataSeriesIndex))}},{key:"initEvent",value:function(){"cartesian"!==this._relativeSeries.coordinate&&(this._relativeSeries.event.on("zoom",this._updateMarkerLayout.bind(this)),this._relativeSeries.event.on("panmove",this._updateMarkerLayout.bind(this)),this._relativeSeries.event.on("scroll",this._updateMarkerLayout.bind(this)))}},{key:"clear",value:function(){_(e,"clear",this,3)([]),this._markerComponent=null,this._firstSeries=null}},{key:"release",value:function(){this._releaseMarkerData(),_(e,"release",this,3)([])}},{key:"_getFirstSeries",value:function(){var t;if(this._firstSeries)return this._firstSeries;var e=az(this._regions);return e?(this._firstSeries=e,e):(null===(t=this._option)||void 0===t||t.onError("need at least one series"),null)}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._markerComponent]}},{key:"onLayoutStart",value:function(t,i){C(this._spec.offsetX)||(this._layoutOffsetX=wz(this._spec.offsetX,i.width,i)),C(this._spec.offsetY)||(this._layoutOffsetY=wz(this._spec.offsetY,i.height,i)),_(e,"onLayoutStart",this,3)([t,i])}},{key:"_compareSpec",value:function(t,i){var n=_(e,"_compareSpec",this,3)([t,i]);return nt(i,t)||(n.reRender=!0,n.change=!0,n.reMake||n.reCompile||!this._isComponentOnlySpecChange(t,i)?n.reMake||n.reCompile||!this._isAutoRangeSpecChange(t,i)?n.reMake=!0:n.effects=Object.assign(Object.assign({},n.effects),{component:!0,scaleDomain:!0,layout:!0,render:!0}):n.effects=Object.assign(Object.assign({},n.effects),{component:!0,layout:!0,render:!0})),n}},{key:"_isComponentOnlySpecChange",value:function(t,e){var i=!(null==t?void 0:t.autoRange)&&!(null==e?void 0:e.autoRange);return nt(Y2(e,{normalizeDomainPosition:i}),Y2(t,{normalizeDomainPosition:i}))}},{key:"_isAutoRangeSpecChange",value:function(t,e){return!(!(null==t?void 0:t.autoRange)&&!(null==e?void 0:e.autoRange))&&nt(Y2(e,{normalizeDomainPosition:!0,normalizeAutoRange:!0}),Y2(t,{normalizeDomainPosition:!0,normalizeAutoRange:!0}))}},{key:"reInit",value:function(t){_(e,"reInit",this,3)([t]),this._releaseMarkerData(),this._bindSeries(),this._initDataView(),this._buildMarkerAttributeContext(),this._markerComponent&&this._updateMarkerLayout()}},{key:"_initCommonDataView",value:function(){var t=this._computeOptions().options,e=this._getRelativeDataView();fH(this._option.dataSet,"markerAggregation",O2),fH(this._option.dataSet,"markerFilter",L2),this._releaseMarkerData();var i=new Ko(this._option.dataSet,{name:"".concat(this.type,"_").concat(this.id,"_data")});i.parse([e],{type:"dataview"}),i.transform({type:"markerAggregation",options:t}),i.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),this._setMarkerData(i,!0),this._bindMarkerDataChange()}}],[{key:"_getMarkerCoordinateType",value:function(t){return"cartesian"}},{key:"getSpecInfo",value:function(t){var e=this;return IU(t,this.specKey,this.type,(function(t){return!1!==t.visible&&e._getMarkerCoordinateType(t)===e.coordinateType}))}}])}(DW);function X2(t,e){return function(t,e,i){var n=Zt(t,(function(t){return t[e]}),(function(t){return t[i]})),r=n.predict,a=YF(t,e),o=KF(t,e),l=r(a),u=r(o);return[s(s({},e,a),i,l),s(s({},e,o),i,u)]}(t[0].latestData,e.fieldX,e.fieldY)}var q2=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).specKey="markLine",e.layoutZIndex=t.LayoutZIndex.MarkLine,e}return h(r,e),a(r,[{key:"_createMarkerComponent",value:function(){var t,e,i,n,r,a,o,s,l,u,h,c,d,v=this,f=this._spec,p=f.startSymbol,g=void 0===p?{}:p,y=f.endSymbol,m=void 0===y?{}:y,_=ot(null!==(t=this._spec.label)&&void 0!==t?t:{}),b={zIndex:this.layoutZIndex,interactive:null===(e=this._spec.interactive)||void 0===e||e,hover:null===(i=this._spec.interactive)||void 0===i||i,select:null===(n=this._spec.interactive)||void 0===n||n,points:[{x:0,y:0},{x:0,y:0}],center:{x:0,y:0},radius:0,startAngle:0,endAngle:0,lineStyle:C2(tH(null===(r=this._spec.line)||void 0===r?void 0:r.style),this._markerData,this._markAttributeContext),clipInRange:null!==(a=this._spec.clip)&&void 0!==a&&a,label:_.map((function(t){return S2(t,v._markerData,v._markAttributeContext)})),state:{line:A2(null!==(s=null===(o=this._spec.line)||void 0===o?void 0:o.state)&&void 0!==s?s:{},this._markerData,this._markAttributeContext),lineStartSymbol:A2(null!==(u=null===(l=this._spec.startSymbol)||void 0===l?void 0:l.state)&&void 0!==u?u:{},this._markerData,this._markAttributeContext),lineEndSymbol:A2(null!==(c=null===(h=this._spec.endSymbol)||void 0===h?void 0:h.state)&&void 0!==c?c:{},this._markerData,this._markAttributeContext),label:_.map((function(t){var e;return A2(null!==(e=t.state)&&void 0!==e?e:{},v._markerData,v._markAttributeContext)})),labelBackground:_.map((function(t){var e,i;return A2(null!==(i=null===(e=t.labelBackground)||void 0===e?void 0:e.state)&&void 0!==i?i:{},v._markerData,v._markAttributeContext)}))},animation:null!==(d=this._spec.animation)&&void 0!==d&&d,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate};return g.visible?b.startSymbol=Object.assign(Object.assign({},g),{visible:!0,style:C2(tH(g.style),this._markerData,this._markAttributeContext)}):b.startSymbol={visible:!1},m.visible?b.endSymbol=Object.assign(Object.assign({},m),{visible:!0,style:C2(tH(m.style),this._markerData,this._markAttributeContext)}):b.endSymbol={visible:!1},this._newMarkLineComponent(b)}},{key:"_getUpdateMarkerAttrs",value:function(){var t,e,i,n=this._spec,r=this._markerData,a=this._startRelativeSeries,o=this._endRelativeSeries,s=this._relativeSeries,l=this._computePointsAttr(),u=s.getViewData().latestData,h=r.latestData[0]&&r.latestData[0].latestData?r.latestData[0].latestData:r.latestData;if(n.clip||ot(n.label).some((function(t){return null==t?void 0:t.confine}))){var c=x2([a.getRegion(),o.getRegion(),s.getRegion()]),d=c.minX,v=c.maxX,f=c.minY;i={x:d,y:f,width:v-d,height:c.maxY-f}}var p=ot((null!==(e=null===(t=this._markerComponent)||void 0===t?void 0:t.attribute)&&void 0!==e?e:{}).label),g=ot(this._spec.label),y=p.map((function(t,e){var i=g[e]||{};return Object.assign(Object.assign({},t),{text:i.formatMethod?i.formatMethod(h,u):null==t?void 0:t.text})}));return Object.assign(Object.assign({},l),{label:y,limitRect:i,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}},{key:"_markerLayout",value:function(){var t,e=this._getUpdateMarkerAttrs();null===(t=this._markerComponent)||void 0===t||t.setAttributes(e)}},{key:"_initDataView",value:function(){var t=this._spec,e="coordinates"in t,i=E2(t),n=i.doXProcess,r=i.doYProcess,a=i.doXYY1Process,o=i.doYXX1Process,s=i.doXYProcess,l=i.doAngleProcess,u=i.doRadiusProcess,h=i.doAngRadRad1Process,c=i.doRadAngAng1Process,d=i.doRadAngProcess;if(this._setMarkerData(this._getRelativeDataView()),n||r||a||o||s||l||u||h||c||d||e){fH(this._option.dataSet,"markerAggregation",O2),fH(this._option.dataSet,"markerRegression",X2),fH(this._option.dataSet,"markerFilter",L2);var v=this._computeOptions(),f=v.options,p=v.needAggr,g=v.needRegr,y=v.processData,m=new Ko(this._option.dataSet);m.parse([y],{type:"dataview"}),p&&m.transform({type:"markerAggregation",options:f}),g&&m.transform({type:"markerRegression",options:f}),m.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),this._setMarkerData(m,!0),this._bindMarkerDataChange()}}}],[{key:"_getMarkerCoordinateType",value:function(t){var e=E2(t),i=e.doAngleProcess,n=e.doRadiusProcess,r=e.doAngRadRad1Process,a=e.doRadAngAng1Process,o=e.doRadAngProcess;return"polar"===t.coordinateType||i||n||r||a||o?"polar":"cartesian"}}])}(K2);q2.specKey="markLine";var Z2=function(t){return{visible:t,symbolType:"triangle",size:10,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}}},J2={style:{fontSize:{type:"token",key:"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"}}},refY:5},Q2={line:{style:{lineDash:[3,3],stroke:{type:"palette",key:"markLineStrokeColor"}}},startSymbol:Z2(!1),endSymbol:Z2(!0),label:J2},$2=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=c.markLine,t.name=c.markLine,t.coordinateType="cartesian",t}return h(e,t),a(e,[{key:"_newMarkLineComponent",value:function(t){return new ND(t)}},{key:"_computePointsAttr",value:function(){var t,e=this._spec,i=this._markerData,n=this._startRelativeSeries,r=this._endRelativeSeries,a=this._relativeSeries,o=M(e.coordinates),s=M(e.process),l=s&&M(e.process.x),u=s&&M(e.process.y),h=M(e.positions),c=null!==(t=e.autoRange)&&void 0!==t&&t,d=E2(e),v=d.doXProcess,f=d.doYProcess,p=d.doXYY1Process,g=d.doYXX1Process,y=d.doXYProcess,m=d.doCoordinatesProcess,_=[];if(v||p||f||g||y||o&&l||o&&u){var b=p2(i,n,r,a,c,!1,this._getAutoRangeExtendDomainKeyPrefix());_=1===b.length?b[0]:b.map((function(t){return t[0]}))}else m?_=m2(i,a,c,e.coordinatesOffset,this._getAutoRangeExtendDomainKeyPrefix()):h&&(_=k2(e.positions,a,e.regionRelative));return{points:_}}},{key:"_markerLayout",value:function(){var t,e,i,n,r,a=this._getUpdateMarkerAttrs();if("type-step"===this._spec.type){var o,s=this._startRelativeSeries,l=this._endRelativeSeries,u=this._spec.line||{},h=u.multiSegment,c=u.mainSegmentIndex,d=this._spec,v=d.connectDirection,f=d.expandDistance,p=void 0===f?0:f;if(Mz(p)){var g=s.getRegion(),y=g.getLayoutStartPoint(),m=l.getRegion(),_=m.getLayoutStartPoint();if("bottom"===v||"top"===v){var b=Math.abs(Math.min(y.y,_.y)-Math.max(y.y+g.getLayoutRect().height,_.y+m.getLayoutRect().height));o=Number(p.substring(0,p.length-1))*b/100}else{var k=Math.abs(Math.min(y.x,_.x)-Math.max(y.x+g.getLayoutRect().width,_.x+m.getLayoutRect().width));o=Number(p.substring(0,p.length-1))*k/100}}else o=p;var x=a.points,S=a.limitRect;if(!x||x.length<2)return void(null===(t=this._markerComponent)||void 0===t||t.setAttributes(a));var A,C=function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=[],a=t.y-e.y,o=t.x-e.x;switch(i){case"top":r.push(t),r.push({x:t.x,y:a>0?t.y-n-Math.abs(a):t.y-n}),r.push({x:e.x,y:a>0?e.y-n:e.y-n-Math.abs(a)}),r.push(e);break;case"bottom":r.push(t),r.push({x:t.x,y:a<0?t.y+n+Math.abs(a):t.y+n}),r.push({x:e.x,y:a<0?e.y+n:e.y+n+Math.abs(a)}),r.push(e);break;case"left":r.push(t),r.push({x:o>0?t.x-n-Math.abs(o):t.x-n,y:t.y}),r.push({x:o>0?e.x-n:e.x-n-Math.abs(o),y:e.y}),r.push(e);break;case"right":r.push(t),r.push({x:o>0?t.x+n:t.x+n+Math.abs(o),y:t.y}),r.push({x:o>0?e.x+n+Math.abs(o):e.x+n,y:e.y}),r.push(e)}return r}(x[0],x[1],v,o);A=h&&M(c)?{position:"middle",autoRotate:!1}:Object.assign({position:"start",autoRotate:!1},function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=t.y-e.y,a=t.x-e.x;return"bottom"===i?{dx:a>0?-a/2:Math.abs(a/2),dy:r>0?n:Math.abs(r)+n}:"top"===i?{dx:a>0?-Math.abs(a/2):+Math.abs(a/2),dy:r>0?-(Math.abs(r)+n):-n}:"left"===i?{dx:a>0?-a-n:-n,dy:r>0?-r/2:Math.abs(r/2)}:"right"===i?{dx:a>0?n:Math.abs(a)+n,dy:r>0?-r/2:Math.abs(r/2)}:{}}(x[0],x[1],v,o));var T=ot((null!==(i=null===(e=this._markerComponent)||void 0===e?void 0:e.attribute)&&void 0!==i?i:{}).label),w=ot(a.label),E=ot(this._spec.label);null===(n=this._markerComponent)||void 0===n||n.setAttributes({points:h?[[C[0],C[1]],[C[1],C[2]],[C[2],C[3]]]:C,label:w.map((function(t,e){var i,n,r,a,o=0,s=0,l=null!==(i=A.dx)&&void 0!==i?i:0,u=null!==(n=A.dy)&&void 0!==n?n:0,h=null!==(r=E[e])&&void 0!==r?r:E[0];return F(null==h?void 0:h.refX)&&(o+=h.refX),F(null==h?void 0:h.refY)&&(s+=h.refY),F(null==h?void 0:h.dx)&&(l+=h.dx),F(null==h?void 0:h.dy)&&(u+=h.dy),Object.assign(Object.assign(Object.assign({},t),A),{refX:o,refY:s,dx:l,dy:u,textStyle:Object.assign(Object.assign({},null===(a=T[e])||void 0===a?void 0:a.textStyle),{textAlign:"center",textBaseline:"middle"})})})),limitRect:S,multiSegment:h,mainSegmentIndex:c,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}else null===(r=this._markerComponent)||void 0===r||r.setAttributes(a)}},{key:"_computeOptions",value:function(){var t,e=this._getRelativeDataView(),i=!0,n=!1,r=this._spec,a=this._relativeSeries,o=E2(r),s=o.doXProcess,l=o.doYProcess,u=o.doXYY1Process,h=o.doYXX1Process,c=o.doXYProcess,d=o.doCoordinatesProcess;if(c)t=[this._processSpecByDims([{dim:"x",specValue:r.x},{dim:"y",specValue:r.y}]),this._processSpecByDims([{dim:"x",specValue:r.x1},{dim:"y",specValue:r.y1}])];else if(s)t=[this._processSpecByDims([{dim:"x",specValue:r.x}])];else if(l)t=[this._processSpecByDims([{dim:"y",specValue:r.y}])];else if(u)t=[this._processSpecByDims([{dim:"x",specValue:r.x},{dim:"y",specValue:r.y}]),this._processSpecByDims([{dim:"x",specValue:r.x},{dim:"y",specValue:r.y1}])];else if(h)t=[this._processSpecByDims([{dim:"x",specValue:r.x},{dim:"y",specValue:r.y}]),this._processSpecByDims([{dim:"x",specValue:r.x1},{dim:"y",specValue:r.y}])];else if(d){if(t=this._processSpecCoo(r),i=!1,e=new Ko(this._option.dataSet,{name:"".concat(this.type,"_").concat(this.id,"_data")}).parse([a.getViewData()],{type:"dataview"}).transform({type:"markerAggregation",options:t}),r.process&&M(r.process.x)&&(t=[this._processSpecByDims([{dim:"x",specValue:r.process.x}])],i=!0),r.process&&M(r.process.y)&&(t=t=[this._processSpecByDims([{dim:"y",specValue:r.process.y}])],i=!0),r.process&&M(r.process.xy)){var v=a.getSpec();t={fieldX:v.xField,fieldY:v.yField},n=!0}}else i=!1;return{options:t,needAggr:i,needRegr:n,processData:e}}}])}(q2);$2.type=c.markLine,$2.coordinateType="cartesian",$2.builtInTheme={markLine:Q2};var t3=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=c.polarMarkLine,t.name=c.polarMarkLine,t.coordinateType="polar",t}return h(e,t),a(e,[{key:"_newMarkLineComponent",value:function(t){var e=E2(this._spec),i=e.doRadiusProcess,n=e.doRadAngAng1Process;return i||n?new WD(t):new ND(t)}},{key:"_computePointsAttr",value:function(){var t,e=this._spec,i=this._markerData,n=this._startRelativeSeries,r=this._endRelativeSeries,a=this._relativeSeries,o=null!==(t=e.autoRange)&&void 0!==t&&t,s=E2(e),l=s.doAngleProcess,u=s.doRadiusProcess,h=s.doAngRadRad1Process,c=s.doRadAngAng1Process,d=s.doRadAngProcess,v=s.doCoordinatesProcess,f=[],p={},g={x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y};if(l||u||h||c||d){var y=y2(i,n,r,a,o,this._getAutoRangeExtendDomainKeyPrefix());f=1===y.length?y[0]:y.map((function(t){return t[0]})),p=f[0].radius===f[1].radius?{radius:f[0].radius,startAngle:f[0].angle,endAngle:f[1].angle,center:g}:{points:f.map((function(t){return Ae(g,t.radius,t.angle)}))}}else v&&(p={points:(f=_2(i,a,o,this._getAutoRangeExtendDomainKeyPrefix())).map((function(t){return Ae(g,t.radius,t.angle)}))});return p}},{key:"_computeOptions",value:function(){var t,e=this._spec,i=E2(e),n=i.doAngleProcess,r=i.doRadiusProcess,a=i.doAngRadRad1Process,o=i.doRadAngAng1Process,s=i.doRadAngProcess,l=i.doCoordinatesProcess,u=this._getRelativeDataView();return s?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"angle",specValue:e.angle1},{dim:"radius",specValue:e.radius1}])]:n?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle}])]:r?t=[this._processSpecByDims([{dim:"radius",specValue:e.radius}])]:a?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius1}])]:o?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"angle",specValue:e.angle1},{dim:"radius",specValue:e.radius}])]:l&&(t=this._processSpecCoo(e)),{options:t,needAggr:!0,needRegr:!1,processData:u}}}])}(q2);t3.type=c.polarMarkLine,t3.coordinateType="polar",t3.builtInTheme={polarMarkLine:Q2};var e3=function(e){function r(e,a){var o;return n(this,r),(o=i(this,r,[e,a])).type=c.title,o.specKey=c.title,o.layoutType="normal",o.layoutZIndex=t.LayoutZIndex.Title,o.layoutLevel=t.LayoutLevel.Title,o._orient="top",o._orient=Cz(e.orient)?e.orient:"top",o}return h(r,e),a(r,[{key:"orient",get:function(){return this._orient}},{key:"initLayout",value:function(){_(r,"initLayout",this,3)([]),this._layout&&(this._layout.layoutOrient=this._orient)}},{key:"_compareSpec",value:function(t,e){var i=_(r,"_compareSpec",this,3)([t,e]),n=!nt(e,t);return(null==e?void 0:e.orient)===(null==t?void 0:t.orient)&&(null==e?void 0:e.visible)===t.visible||(i.reMake=!0),i.change=!0,i.reRender=!0,n&&!i.reMake&&(i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0})),i}},{key:"afterSetLayoutStartPoint",value:function(t){F(t.x)&&this._titleComponent&&this._titleComponent.setAttribute("x",t.x),F(t.y)&&this._titleComponent&&this._titleComponent.setAttribute("y",t.y),_(r,"afterSetLayoutStartPoint",this,3)([t])}},{key:"getBoundsInRect",value:function(t){var e={};this.setLayoutRect(t);var i=this._getTitleAttrs();this._createOrUpdateTitleComponent(i),e=this._getTitleLayoutRect();var n=this.getLayoutStartPoint(),r=n.x,a=n.y;return{x1:r,y1:a,x2:r+e.width,y2:a+e.height}}},{key:"_getTitleLayoutRect",value:function(){var t=this._titleComponent.AABBBounds;return{width:this._spec.width?this._spec.width:F(t.width())?t.width():0,height:this._spec.height?this._spec.height:F(t.height())?t.height():0}}},{key:"_getTitleAttrs",value:function(){var t,e,i,n,r,a;if(!1===this._spec.visible)return{visible:!1};var o=this.getLayoutRect(),s=wz(this._spec.width,o.width,null,o.width),l=wz(this._spec.maxWidth,o.width,null,o.width),u=Math.max(Math.min(s,l,o.width),0),h=M(this._spec.text)&&""!==this._spec.text,c=M(this._spec.subtext)&&""!==this._spec.subtext,d=Object.assign(Object.assign({},$(this._spec,["padding"])),{textType:null!==(t=this._spec.textType)&&void 0!==t?t:"text",text:h?this._spec.text:void 0,subtextType:null!==(e=this._spec.subtextType)&&void 0!==e?e:"text",subtext:c?this._spec.subtext:void 0,x:null!==(i=this._spec.x)&&void 0!==i?i:0,y:null!==(n=this._spec.y)&&void 0!==n?n:0,height:this._spec.height,minWidth:this._spec.minWidth,maxWidth:u,minHeight:this._spec.minHeight,maxHeight:this._spec.maxHeight,padding:this._spec.innerPadding,align:null!==(r=this._spec.align)&&void 0!==r?r:"left",verticalAlign:null!==(a=this._spec.verticalAlign)&&void 0!==a?a:"top",textStyle:Object.assign({maxLineWidth:u},this._spec.textStyle),subtextStyle:Object.assign({maxLineWidth:u},this._spec.subtextStyle)});if(h&&(d.textStyle.width=u),c&&(d.subtextStyle.width=u),M(this._spec.width)){var v=Math.max(Math.min(s,o.width),0);h?d.textStyle.width=v:delete d.textStyle.width,c&&(d.subtextStyle.width=v)}return d}},{key:"_createOrUpdateTitleComponent",value:function(t){var e=this;if(this._titleComponent)nt(t,this._cacheAttrs)||this._titleComponent.setAttributes(t);else{var i=this.getContainer(),n=new gF(t);n.name="title",i.add(n),this._titleComponent=n,n.on("*",(function(t,i){return e._delegateEvent(n,t,i)}))}return this._cacheAttrs=t,this._titleComponent}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._titleComponent]}},{key:"clear",value:function(){_(r,"clear",this,3)([]),this._cacheAttrs=null}}],[{key:"getSpecInfo",value:function(t){return IU(t,this.specKey,c.title,(function(t){return!1!==t.visible}))}}])}(DW);e3.type=c.title,e3.specKey=c.title,e3.builtInTheme={title:{padding:{top:4,bottom:20},textStyle:{fontSize:{type:"token",key:"l3FontSize"},lineHeight:{type:"token",key:"l3LineHeight"},fill:{type:"palette",key:"primaryFontColor"}},subtextStyle:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fill:{type:"palette",key:"tertiaryFontColor"}}}};var i3=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).specKey="markArea",e.layoutZIndex=t.LayoutZIndex.MarkArea,e}return h(r,e),a(r,[{key:"_createMarkerComponent",value:function(){var t,e,i,n,r,a,o,s,l=this,u=ot(null!==(t=this._spec.label)&&void 0!==t?t:{}),h={zIndex:this.layoutZIndex,interactive:null===(e=this._spec.interactive)||void 0===e||e,hover:null===(i=this._spec.interactive)||void 0===i||i,select:null===(n=this._spec.interactive)||void 0===n||n,points:[{x:0,y:0}],center:{x:0,y:0},innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,areaStyle:C2(tH(null===(r=this._spec.area)||void 0===r?void 0:r.style),this._markerData,this._markAttributeContext),clipInRange:null!==(a=this._spec.clip)&&void 0!==a&&a,label:u.map((function(t){return S2(t,l._markerData,l._markAttributeContext)})),state:{area:A2(null===(o=this._spec.area)||void 0===o?void 0:o.state,this._markerData,this._markAttributeContext),label:u.map((function(t){return A2(t.state,l._markerData,l._markAttributeContext)})),labelBackground:u.map((function(t){var e;return A2(null===(e=t.labelBackground)||void 0===e?void 0:e.state,l._markerData,l._markAttributeContext)}))},animation:null!==(s=this._spec.animation)&&void 0!==s&&s,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate};return this._newMarkAreaComponent(h)}},{key:"_markerLayout",value:function(){var t,e,i=this._spec,n=this._markerData,r=this._startRelativeSeries,a=this._endRelativeSeries,o=this._relativeSeries,s=this._computePointsAttr(),l=this._getRelativeDataView().latestData,u=n?n.latestData[0]&&n.latestData[0].latestData?n.latestData[0].latestData:n.latestData:l;if(i.clip||ot(i.label).some((function(t){return null==t?void 0:t.confine}))){var h=x2([r.getRegion(),a.getRegion(),o.getRegion()]),c=h.minX,d=h.maxX,v=h.minY;e={x:c,y:v,width:d-c,height:h.maxY-v}}if(this._markerComponent){var f=ot(null===(t=this._markerComponent.attribute)||void 0===t?void 0:t.label),p=ot(this._spec.label);this._markerComponent.setAttributes(Object.assign(Object.assign({},s),{label:f.map((function(t,e){var i=p[e]||{};return Object.assign(Object.assign({},t),{text:i.formatMethod?i.formatMethod(u,l):null==t?void 0:t.text})})),limitRect:e,dx:this._layoutOffsetX,dy:this._layoutOffsetY}))}}},{key:"_initDataView",value:function(){var t=B2(this._spec),e=t.doXProcess,i=t.doYProcess,n=t.doXYProcess,r=t.doAngleProcess,a=t.doRadiusProcess,o=t.doRadAngProcess,s=t.doCoordinatesProcess;if(!(e||i||n||r||a||o||s))return null;this._initCommonDataView()}}],[{key:"_getMarkerCoordinateType",value:function(t){var e=B2(t),i=e.doAngleProcess,n=e.doRadiusProcess,r=e.doRadAngProcess;return"polar"===t.coordinateType||i||n||r?"polar":"cartesian"}}])}(K2);i3.specKey="markArea";var n3={area:{style:{fill:{type:"palette",key:"axisDomainColor",a:.25}}},label:{style:{fontSize:{type:"token",key:"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"}}}}},r3=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=c.markArea,t.name=c.markArea,t.coordinateType="cartesian",t}return h(e,t),a(e,[{key:"_newMarkAreaComponent",value:function(t){return new VD(t)}},{key:"_computePointsAttr",value:function(){var t,e,i=this._spec,n=this._markerData,r=this._startRelativeSeries,a=this._endRelativeSeries,o=this._relativeSeries,s=B2(i),l=s.doXProcess,u=s.doYProcess,h=s.doXYProcess,c=s.doCoordinatesProcess,d=M(i.positions),v=null!==(t=i.autoRange)&&void 0!==t&&t,f=null!==(e=i.includeFullBand)&&void 0!==e&&e,p=[];if(h){var g=m(p2(n,r,a,o,v,f,this._getAutoRangeExtendDomainKeyPrefix()),2),y=g[0],_=g[1];y&&y.length&&_&&_.length&&(p=[{x:y[0].x,y:_[0].y},y[0],{x:_[0].x,y:y[0].y},_[0]])}else if(l||u){var k=m(p2(n,r,a,o,v,f,this._getAutoRangeExtendDomainKeyPrefix()),2),x=k[0],S=k[1];x&&x.length&&S&&S.length&&(p=[].concat(b(x),[S[1],S[0]]))}else c?p=m2(n,o,v,i.coordinatesOffset,this._getAutoRangeExtendDomainKeyPrefix()):d&&(p=k2(i.positions,o,i.regionRelative));return{points:p}}},{key:"_computeOptions",value:function(){var t,e=this._spec,i=B2(e),n=i.doXProcess,r=i.doYProcess,a=i.doXYProcess,o=i.doCoordinatesProcess;return a?t=[this._processSpecByDims([{dim:"x",specValue:e.x},{dim:"y",specValue:e.y}]),this._processSpecByDims([{dim:"x",specValue:e.x1},{dim:"y",specValue:e.y1}])]:n?t=[this._processSpecByDims([{dim:"x",specValue:e.x}]),this._processSpecByDims([{dim:"x",specValue:e.x1}])]:r?t=[this._processSpecByDims([{dim:"y",specValue:e.y}]),this._processSpecByDims([{dim:"y",specValue:e.y1}])]:o&&(t=this._processSpecCoo(e)),{options:t}}}])}(i3);r3.type=c.markArea,r3.coordinateType="cartesian",r3.builtInTheme={markArea:n3};var a3=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=c.polarMarkArea,t.name=c.polarMarkArea,t.coordinateType="polar",t}return h(e,t),a(e,[{key:"_newMarkAreaComponent",value:function(t){var e=B2(this._spec),i=e.doRadiusProcess,n=e.doAngleProcess,r=e.doRadAngProcess;return n||i||r?new GD(t):new VD(t)}},{key:"_computePointsAttr",value:function(){var t,e=this._spec,i=this._markerData,n=this._startRelativeSeries,r=this._endRelativeSeries,a=this._relativeSeries,o=B2(e),s=o.doAngleProcess,l=o.doRadiusProcess,u=o.doRadAngProcess,h=o.doCoordinatesProcess,c=null!==(t=e.autoRange)&&void 0!==t&&t,d={},v={x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y};if(s||l||u){var f=y2(i,n,r,a,c,this._getAutoRangeExtendDomainKeyPrefix());u?d={innerRadius:f[0][0].radius,outerRadius:f[1][0].radius,startAngle:f[0][0].angle,endAngle:f[1][0].angle,center:v}:s?d={innerRadius:0,outerRadius:Math.abs(f[0][0].radius),startAngle:f[0][1].angle,endAngle:f[1][1].angle,center:v}:l&&(d={innerRadius:f[0][0].radius,outerRadius:f[1][0].radius,startAngle:f[0][0].angle,endAngle:f[1][1].angle,center:v})}else h&&(d={points:_2(i,a,c,this._getAutoRangeExtendDomainKeyPrefix()).map((function(t){return Ae(v,t.radius,t.angle)}))});return d}},{key:"_computeOptions",value:function(){var t,e=this._spec,i=B2(e),n=i.doAngleProcess,r=i.doRadiusProcess,a=i.doRadAngProcess,o=i.doCoordinatesProcess;return a?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"angle",specValue:e.angle1},{dim:"radius",specValue:e.radius1}])]:n?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"angle",specValue:e.angle1},{dim:"radius",specValue:e.radius}])]:r?t=[this._processSpecByDims([{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"radius",specValue:e.radius1}])]:o&&(t=this._processSpecCoo(e)),{options:t}}}])}(i3);a3.type=c.polarMarkArea,a3.coordinateType="polar",a3.builtInTheme={polarMarkArea:n3};var o3=function(t){return tH(Object.assign({},t))},s3=function(t){return Object.assign(Object.assign({},t),{style:Object.assign({},tH(t.style))})},l3=function(t){var e,i,n,r,a,o,s,l,u,h,c,d,v,f,p,g,y=o3(null!==(i=null===(e=null==t?void 0:t.slider)||void 0===e?void 0:e.trackStyle)&&void 0!==i?i:{}),m=o3(null!==(r=null===(n=null==t?void 0:t.slider)||void 0===n?void 0:n.railStyle)&&void 0!==r?r:{}),_=(g=null!==(o=null===(a=null==t?void 0:t.slider)||void 0===a?void 0:a.handlerStyle)&&void 0!==o?o:{},tH(Object.assign({},g))),b=s3(null!==(l=null===(s=null==t?void 0:t.controller)||void 0===s?void 0:s.start)&&void 0!==l?l:{}),k=s3(null!==(h=null===(u=null==t?void 0:t.controller)||void 0===u?void 0:u.pause)&&void 0!==h?h:{}),x=s3(null!==(d=null===(c=null==t?void 0:t.controller)||void 0===c?void 0:c.backward)&&void 0!==d?d:{}),S=s3(null!==(f=null===(v=null==t?void 0:t.controller)||void 0===v?void 0:v.forward)&&void 0!==f?f:{}),A=Object.assign(Object.assign({},t),{direction:t.direction,interval:t.interval,visible:t.visible,orient:null!==(p=t.orient)&&void 0!==p?p:"bottom",slider:Object.assign(Object.assign({},t.slider),{trackStyle:y,railStyle:m,handlerStyle:_}),controller:Object.assign(Object.assign({},t.controller),{start:b,pause:k,backward:x,forward:S})});return t.visible||(A.controller.visible=!1,A.slider.visible=!1),A},u3=function(t){return"left"===t||"right"===t},h3=function(t){return"top"===t||"bottom"===t},c3={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:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},pause:{order:0,space:10,position:"start",style:{size:12,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:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}}}},d3=function(r){function o(){var r;return n(this,o),(r=i(this,o,arguments)).layoutZIndex=t.LayoutZIndex.Player,r.layoutLevel=t.LayoutLevel.Player,r.specKey="player",r.type=c.player,r._orient="bottom",r._getPlayerAttrs=function(){var t,e,i,n,a,o,s,l,u=r._spec.type,h={size:{width:r._width,height:r._height},dx:null!==(t=r._spec.dx)&&void 0!==t?t:0+r._dx,dy:null!==(e=r._spec.dy)&&void 0!==e?e:0+r._dy};return"discrete"===u?Object.assign(Object.assign(Object.assign({},(s=r._spec,l=r._specs,Object.assign(Object.assign({},l3(s)),{data:l,type:"discrete"}))),h),{disableTriggerEvent:r._option.disableTriggerEvent,loop:null===(n=null===(i=r._spec)||void 0===i?void 0:i.loop)||void 0===n||n}):Object.assign(Object.assign(Object.assign({},function(t,e){return Object.assign(Object.assign({},l3(t)),{data:e,type:"continuous"})}(r._spec,r._specs)),h),{disableTriggerEvent:r._option.disableTriggerEvent,loop:null===(o=null===(a=r._spec)||void 0===a?void 0:a.loop)||void 0===o||o})},r._createOrUpdatePlayerComponent=function(){var t=Object.assign({},r._getPlayerAttrs()),e=r.getContainer();r._playerComponent?nt(t,r._cacheAttrs)||(r._cacheAttrs=t,r._playerComponent.setAttributes(t),r._playerComponent._initAttributes(),r._playerComponent.render()):("discrete"===t.type?r._playerComponent=new IF(t):r._playerComponent=new LF(t),r._cacheAttrs=t,r._playerComponent.name="player",e.add(r._playerComponent),r._initEvent())},r._maxSize=function(){var t,e,i,n,a,o,s,l,u;return Math.max.apply(Math,b(ot(null===(e=null===(t=r._spec.controller.start)||void 0===t?void 0:t.style)||void 0===e?void 0:e.size)).concat(b(ot(null===(n=null===(i=r._spec.controller.pause)||void 0===i?void 0:i.style)||void 0===n?void 0:n.size)),b(ot(null===(o=null===(a=r._spec.controller.backward)||void 0===a?void 0:a.style)||void 0===o?void 0:o.size)),b(ot(null===(l=null===(s=r._spec.controller.forward)||void 0===s?void 0:s.style)||void 0===l?void 0:l.size)),[null!==(u=u3(r._orient)?r._spec.slider.railStyle.width:r._spec.slider.railStyle.height)&&void 0!==u?u:10]))},r._sliderExceededSize=function(){var t,e,i,n,a,o,s,l,u,h=null!==(t=u3(r._orient)?r._spec.slider.railStyle.width:r._spec.slider.railStyle.height)&&void 0!==t?t:10,c=Math.max.apply(Math,b(ot(null===(i=null===(e=r._spec.controller.start)||void 0===e?void 0:e.style)||void 0===i?void 0:i.size)).concat(b(ot(null===(a=null===(n=r._spec.controller.pause)||void 0===n?void 0:n.style)||void 0===a?void 0:a.size)),b(ot(null===(s=null===(o=r._spec.controller.backward)||void 0===o?void 0:o.style)||void 0===s?void 0:s.size)),b(ot(null===(u=null===(l=r._spec.controller.forward)||void 0===l?void 0:l.style)||void 0===u?void 0:u.size))));return h>=c?h-c:0},r.autoPlayCallback=function(){var t;(null===(t=r._spec)||void 0===t?void 0:t.auto)&&(r._playerComponent.pause(),r._playerComponent.play())},r._initEvent=function(){r._option.disableTriggerEvent||(r._option.globalInstance.off(t.ChartEvent.rendered,r.autoPlayCallback),r._option.globalInstance.on(t.ChartEvent.rendered,r.autoPlayCallback),r._playerComponent.addEventListener(AF.end,(function(){var i;r.event.emit(t.ChartEvent.playerEnd,{model:e(r)}),r._alternate&&"discrete"===r._spec.type&&(r._direction="default"===r._direction?"reverse":"default",r._playerComponent.setAttributes({direction:r._direction,dataIndex:"reverse"===r._direction?r._specs.length-2:1})),(null===(i=r._spec)||void 0===i?void 0:i.loop)&&r._playerComponent.play()})),r._playerComponent.addEventListener(AF.change,(function(t){var e=t.detail.index;r.changePlayerIndex(e)})),r._playerComponent.addEventListener(AF.backward,(function(i){var n=i.detail.index,a=r._specs[n];r.event.emit(t.ChartEvent.playerBackward,{model:e(r),value:{spec:a,index:n,specs:r._specs}})})),r._playerComponent.addEventListener(AF.forward,(function(i){var n=i.detail.index,a=r._specs[n];r.event.emit(t.ChartEvent.playerForward,{model:e(r),value:{spec:a,index:n,specs:r._specs}})})),r._playerComponent.addEventListener(AF.play,(function(i){var n=i.detail.index,a=r._specs[n];r.event.emit(t.ChartEvent.playerPlay,{model:e(r),value:{spec:a,index:n,specs:r._specs}})})),r._playerComponent.addEventListener(AF.pause,(function(i){var n=i.detail.index,a=r._specs[n];r.event.emit(t.ChartEvent.playerPause,{model:e(r),value:{spec:a,index:n,specs:r._specs}})})))},r}return h(o,r),a(o,[{key:"orient",get:function(){return this._orient}},{key:"layoutOrient",set:function(t){this._orient=t}},{key:"setAttrFromSpec",value:function(){var t,e,i,n,r,a,s,l;_(o,"setAttrFromSpec",this,3)([]),this._orient=null!==(t=this._spec.orient)&&void 0!==t?t:"bottom",this._specs=null!==(e=this._spec.specs)&&void 0!==e?e:[],this._direction=null!==(i=this._spec.direction)&&void 0!==i?i:"default",this._alternate=null!==(n=this._spec.alternate)&&void 0!==n&&n,this._dx=null!==(r=this._spec.dx)&&void 0!==r?r:0,this._dy=null!==(a=this._spec.dy)&&void 0!==a?a:0,this._position=null!==(s=this._spec.position)&&void 0!==s?s:"middle",this._visible=null===(l=this._spec.visible)||void 0===l||l}},{key:"_compareSpec",value:function(t,e){var i=_(o,"_compareSpec",this,3)([t,e]),n=!nt(e,t);return(null==e?void 0:e.type)!==(null==t?void 0:t.type)?(i.reMake=!0,i):(!n||i.reMake||i.reCompile||(i.change=!0,i.reRender=!0,i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0})),i)}},{key:"afterSetLayoutStartPoint",value:function(t){if(_(o,"afterSetLayoutStartPoint",this,3)([t]),F(t.x)){var e=u3(this._orient)?t.x+this._sliderExceededSize()/2:t.x;this._playerComponent&&this._playerComponent.setAttribute("x",e)}if(F(t.y)){var i=h3(this._orient)?t.y+this._sliderExceededSize()/2:t.y;this._playerComponent&&this._playerComponent.setAttribute("y",i)}}},{key:"getBoundsInRect",value:function(t,e){this._width=this._computeWidth(t),this._height=this._computeHeight(t),this._dx=this._computeDx(e),this._dy=this._computeDy(e);var i=this._computeLayoutRect(t,this._width,this._height);return this._createOrUpdatePlayerComponent(),i}},{key:"_getNeedClearVRenderComponents",value:function(){return[this._playerComponent]}},{key:"_computeLayoutRect",value:function(t,e,i){if(!1===this._visible)return{x1:0,x2:0,y1:0,y2:0};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}}}},{key:"_computeWidth",value:function(t){return L(this._spec.width)?Math.min(t.width,Number(this._spec.width)):u3(this._orient)?this._maxSize():t.width}},{key:"_computeHeight",value:function(t){return L(this._spec.height)?(this._height=this._spec.height,Math.min(t.height,Number(this._spec.height))):h3(this._orient)?this._maxSize():t.height}},{key:"_computeDx",value:function(t){return u3(this._orient)||"start"===this._position?0:"middle"===this._position?(t.width-this._width)/2:t.width-this._width}},{key:"_computeDy",value:function(t){return h3(this._orient)||"start"===this._position?0:"middle"===this._position?(t.height-this._height)/2:t.height-this._height}},{key:"changePlayerIndex",value:function(e){var i=this._specs[e];this._option.globalInstance.updateFullData(i.data),this.event.emit(t.ChartEvent.playerChange,{model:this,value:{spec:i,index:e,specs:this._specs}})}},{key:"release",value:function(){this._option.globalInstance.off(t.ChartEvent.rendered,this.autoPlayCallback)}}])}(DW);d3.builtInTheme={player:c3},d3.specKey="player",d3.type=c.player;var v3=function(e){function r(e,a){var o;return n(this,r),(o=i(this,r,[e,a])).type=c.label,o.name=c.label,o.layoutType="none",o.layoutZIndex=t.LayoutZIndex.Label,o._regions=a.getRegionsInIndex(a.regionIndexes),o}return h(r,e),a(r,[{key:"_interactiveConfig",value:function(t){var e=t.interactive,i={hover:!1,select:!1,state:t.state};if(!0!==e)return i;var n=this._option.getChart().getSpec(),r=n.hover,a=n.select;return!1===r&&!1===r.enable||(i.hover=!0),!1===a&&!1===a.enable||(i.select=!0),i}},{key:"_compareSpec",value:function(t,e){var i=_(r,"_compareSpec",this,3)([t,e]);return i.reRender=!0,nt(e,t)||(i.change=!0,i.reMake||i.reCompile?i.reMake=!0:i.effects=Object.assign(Object.assign({},i.effects),{component:!0,layout:!0,render:!0})),i}},{key:"_getDataLabelType",value:function(t,e){var i=t.type;return"line"===i||"area"===i?null!=e?e:"line-data":"rect"===i?"rect":"arc"===i?"arc":"symbol"===i||"cell"===i?"symbol":t.setDataLabelType?t.setDataLabelType():""}},{key:"_setTransformOfComponent",value:function(t,e){var i=this;t.setAttributeTransform((function(t){var n=t.labelStyle,r=t.size,a=t.itemEncoder,o=r(),s=fz({type:"palette",key:"secondaryFontColor"},i.getColorScheme());return{dataLabels:ot(e).map((function(t,e){var r=n(e),l=[],u=t.getGraphics();if(u)return r.data&&r.data.length?r.data.forEach((function(t,i){if(u[i]){var n=a(t,{labelIndex:e});C(n.fill)&&(n.fill=s),C(n.data)&&(n.data=t),l.push(n)}})):u.forEach((function(t){var i=t.context,n=i.data;i.diffState!==dN.exit&&n.forEach((function(t,i){!function(t){if(null==t)throw new TypeError("Cannot destructure "+t)}(i);var n=a(t,{labelIndex:e});C(n.fill)&&(n.fill=s),C(n.data)&&(n.data=t),l.push(n)}))})),E(r.overlap)&&C(r.overlap.size)&&(r.overlap.size=Object.assign({},o)),Object.assign(Object.assign({smartInvert:!1,baseMarkGroupName:t.getProductId(),getBaseMarks:function(){return u}},r),{type:i._getDataLabelType(t,r.type),data:l})})),size:o}}))}},{key:"getVRenderComponents",value:function(){var t=[];return this.getMarks().forEach((function(e){var i=e.getComponent();i&&t.push(i)})),t}},{key:"clear",value:function(){_(r,"clear",this,3)([]),this.getMarks().forEach((function(t){t&&t.clearComponent()}))}}])}(DW);v3.type=c.label;var f3=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).skipEncode=!1,t}return h(e,t),a(e,[{key:"getRule",value:function(){return this._rule}},{key:"setRule",value:function(t){this._rule=t}},{key:"getTarget",value:function(){return this._target}},{key:"setTarget",value:function(t){this._target=t,this._rule||this.setRule(t.type)}},{key:"getComponent",value:function(){return this._component}},{key:"setComponent",value:function(t){this._component=t}},{key:"render",value:function(){}}])}(bX);f3.type="text",f3.constructorType="label";var p3=function(){kX(),Uz.registerMark(f3.constructorType,f3)},g3=function(t){function e(){return n(this,e),i(this,e,arguments)}return h(e,t),a(e,[{key:"_initTheme",value:function(t,e){return{spec:t,theme:this._theme}}}])}(LW),y3=function(e){function r(e,a){var o;return n(this,r),(o=i(this,r,[e,a])).type=c.label,o.name=c.label,o.specKey="label",o.transformerConstructor=g3,o.layoutZIndex=t.LayoutZIndex.Label,o._layoutRule=e.labelLayout||"series",o}return h(r,e),a(r,[{key:"init",value:function(t){_(r,"init",this,3)([t]),this.initEvent(),this._initTextMark(),this._initLabelComponent(),this._initTextMarkStyle()}},{key:"reInit",value:function(t){_(r,"reInit",this,3)([t]),this._labelInfoMap&&(this._labelInfoMap.forEach((function(t){t.forEach((function(t){t.labelMark.release()}))})),this._labelInfoMap.clear()),this._labelInfoMap&&this._labelInfoMap.clear(),this._initTextMark(),this._initLabelComponent(),this._initTextMarkStyle()}},{key:"initEvent",value:function(){var e=this;this.event.on(t.ChartEvent.dataZoomChange,(function(){e._labelComponentMap.forEach((function(t,e){var i=e.getComponent();i&&i.disableAnimation()})),e.event.on(eH.AFTER_MARK_RENDER_END,i)}));var i=function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(){e._labelComponentMap.forEach((function(t,e){var i=e.getComponent();i&&i.enableAnimation()})),e.event.off(eH.AFTER_MARK_RENDER_END,i)}))}},{key:"_initTextMark",value:function(){var t=this;this._labelInfoMap||(this._labelInfoMap=new Map),this._labelComponentMap||(this._labelComponentMap=new Map),tz(this._regions,(function(e){var i=e.getSpecInfo().markLabelSpec,n=void 0===i?{}:i,r=Object.keys(n),a=e.getRegion();t._labelInfoMap.get(a)||t._labelInfoMap.set(a,[]);for(var o=function(){var i=r[s],o=e.getMarkInName(i);o&&n[i].forEach((function(n,r){var s,l,u;if(n.visible){var h=t._labelInfoMap.get(a),c=t._createMark({type:"label",name:"".concat(null!==(s=e.userId)&&void 0!==s?s:e.id,"-").concat(i,"-label-").concat(r)},{attributeContext:e.getMarkAttributeContext()});n.showRelatedMarkTooltip&&(null===(u=null===(l=e.tooltipHelper)||void 0===l?void 0:l.activeTriggerSet.mark)||void 0===u||u.add(c)),c.setTarget(o),h.push({labelMark:c,baseMark:o,series:e,labelSpec:n})}}))},s=0;s<r.length;s++)o()}))}},{key:"_initLabelComponent",value:function(){var t=this,e={};this._labelComponentMap.forEach((function(t,i){e[i.name]=i})),this._labelInfoMap.forEach((function(i,n){if("region"===t._layoutRule){var r=!1,a="".concat(n.getGroupMark().name,"-label-component"),o=e[a];o||(r=!0,o=t._createMark({type:"component",name:a},{componentType:"label"},{support3d:t._spec.support3d})),o&&(r&&(o.setSkipBeforeLayouted(!0),t._marks.addMark(o),i.forEach((function(t){var e;null===(e=t.baseMark.getData())||void 0===e||e.addRelatedMark(o)}))),i[0]&&M(i[0].labelSpec.zIndex)&&o.setMarkConfig({zIndex:i[0].labelSpec.zIndex}),t._labelComponentMap.set(o,(function(){return t._labelInfoMap.get(n)})),e[a]=null)}else i.forEach((function(i,r){var a,o=!1,s="".concat(i.labelMark.name,"-component"),l=e[s];l||(o=!0,l=t._createMark({type:"component",name:s},{componentType:"label",noSeparateStyle:!0},{support3d:i.baseMark.getMarkConfig().support3d})),l&&(M(i.labelSpec.zIndex)&&l.setMarkConfig({zIndex:i.labelSpec.zIndex}),o&&(l.setSkipBeforeLayouted(!0),t._marks.addMark(l),null===(a=i.baseMark.getData())||void 0===a||a.addRelatedMark(l)),t._labelComponentMap.set(l,(function(){return t._labelInfoMap.get(n)[r]})),e[s]=null)}))})),Object.keys(e).forEach((function(i){var n=e[i];n&&(n.releaseWithExitAnimation()||n.release(),t._labelComponentMap.delete(n))}))}},{key:"_initTextMarkStyle",value:function(){var e=this;this._labelComponentMap.forEach((function(t,e){ot(t()).forEach((function(t){t.labelMark.setComponent(e)}))})),this._labelInfoMap.forEach((function(i){i.forEach((function(i){var n,r,a=i.labelMark,o=i.labelSpec,s=i.series;if(e.initMarkStyleWithSpec(a,o),A(null==o?void 0:o.getStyleHandler)){var l=o.getStyleHandler(s);null==l||l.call(s,a,o)}(null===(r=null===(n=a.stateStyle)||void 0===n?void 0:n.normal)||void 0===r?void 0:r.lineWidth)&&a.setAttribute("stroke",s.getColorAttribute(),"normal",t.AttributeLevel.Base_Series)}))}))}},{key:"updateLayoutAttribute",value:function(){var t=this;_(r,"updateLayoutAttribute",this,3)([]),this._labelComponentMap.forEach((function(e,i){var n=e();O(n)?t._updateMultiLabelAttribute(n,i):t._updateSingleLabelAttribute(n,i)}))}},{key:"_updateMultiLabelAttribute",value:function(t,e){this._updateLabelComponentAttribute(e,t.map((function(t){return t.baseMark})),t)}},{key:"_updateSingleLabelAttribute",value:function(t,e){var i=t.baseMark;this._updateLabelComponentAttribute(e,i,[t])}},{key:"_updateLabelComponentAttribute",value:function(t,e,i){var n=this,r=this._option.getComponentsByType("totalLabel");t.setMarkConfig({interactive:!1}),t.setSimpleStyle({labelStyle:function(t){var e,a,o=i[t],s=o.labelSpec,l=o.labelMark,u=o.series,h=l.getRule(),c=n._interactiveConfig(s),d=null!==(a=null===(e=n._spec)||void 0===e?void 0:e.centerOffset)&&void 0!==a?a:0,v=Nz({textStyle:Object.assign({pickable:!0===s.interactive},s.style),overlap:{avoidMarks:r.map((function(t){return t.getMarks()[0].getProductId()}))}},FK(h,o),Object.assign(Object.assign(Object.assign({},$(s,["position","style","state","type","stackDataFilterType","getStyleHandler"])),c),{centerOffset:d}),s.stackDataFilterType?{dataFilter:"min"===s.stackDataFilterType?function(t){return t.filter((function(t){return t.data[Bj]}))}:function(t){return t.filter((function(t){return t.data[Ej]}))}}:{});return u&&u.parseLabelStyle&&(v=u.parseLabelStyle(v,s,l)),"line"!==h&&"area"!==h||(v.type=h),v},size:function(){var t;return Object.assign({padding:null===(t=i[0].labelSpec.overlap)||void 0===t?void 0:t.padding},i[0].series.getRegion().getLayoutRect())},itemEncoder:function(t,e){var n=e.labelIndex;return i[n]&&!i[n].labelMark.skipEncode?zK(i[n],t,i[n].labelSpec.formatMethod,i[n].labelSpec.formatter):{data:t}}}),this._setTransformOfComponent(t,e)}},{key:"compileMarks",value:function(){var t=this;this.getMarks().forEach((function(e){var i,n=t._labelComponentMap.get(e)();i=O(n)?n[0].series.getRegion().getGroupMark().getProduct():n.series.getRegion().getGroupMark().getProduct(),e.compile({group:i})}))}},{key:"getLabelInfoByTextGraphic",value:function(t){var e,i=null==t?void 0:t.parent,n=null==i?void 0:i.parent;if(n){var r=n.getChildren().indexOf(i);this._labelComponentMap.forEach((function(t,i){i.getComponent()===n&&(e=ot(t())[r])}))}return e}}],[{key:"getSpecInfo",value:function(t,e){var i=this,n=[];return((null==e?void 0:e.region)||[]).forEach((function(r,a){(r.seriesIndexes||[]).some((function(t){var i=e.series[t].markLabelSpec,n=void 0===i?{}:i;return Object.values(n).some((function(t){return Array.isArray(t)&&function(t){return t.some((function(t){return t.visible}))}(t)}))}))&&n.push({spec:t,type:c.label,specInfoPath:["component",i.specKey,a],regionIndexes:[a]})})),n}}])}(v3);y3.type=c.label,y3.specKey="label",y3.transformerConstructor=g3;var m3=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).type=c.totalLabel,e.name=c.totalLabel,e.specKey="totalLabel",e.layoutZIndex=t.LayoutZIndex.Label,e}return h(r,e),a(r,[{key:"init",value:function(t){_(r,"init",this,3)([t]),this._initTextMark(),this._initLabelComponent()}},{key:"reInit",value:function(t){_(r,"reInit",this,3)([t]),this._initTextMark()}},{key:"_initTextMark",value:function(){var t,e=this._getSeries();if(null===(t=e.getSpec().totalLabel)||void 0===t?void 0:t.visible){var i=e.getSeriesMark();if(i){var n=this._createMark({type:"label",name:"".concat(i.name,"-total-label")});this._baseMark=i,this._textMark=n,this._initTextMarkStyle()}}}},{key:"_initTextMarkStyle",value:function(){var e;_(r,"initMarkStyleWithSpec",this,3)([this._textMark,this._spec]),this.setMarkStyle(this._textMark,{text:function(t){return t[Tj]}},"normal",t.AttributeLevel.Default);var i=this._getSeries();null===(e=i.initTotalLabelMarkStyle)||void 0===e||e.call(i,this._textMark)}},{key:"_initLabelComponent",value:function(){var t,e=this._getSeries(),i=this._createMark({type:"component",name:"".concat(null!==(t=e.name)&&void 0!==t?t:e.type,"-total-label-component")},{componentType:"label"},{support3d:this._spec.support3d});i&&(this._marks.addMark(i),e.getData().addRelatedMark(i))}},{key:"updateLayoutAttribute",value:function(){var t=this;_(r,"updateLayoutAttribute",this,3)([]);var e=this._getSeries();this._marks.forEach((function(i,n){i.setMarkConfig({interactive:!1}),i.setSimpleStyle({labelStyle:function(){var i,n;if(t._baseMark){var r=t._spec,a=r.offset,o=r.animation,s=r.overlap,l=r.position,u=void 0===l?"top":l,h=t._interactiveConfig(t._spec);return Nz({textStyle:{pickable:!0===t._spec.interactive},position:_3(e,t._baseMark.type,u),x:0,y:0},null!==(n=null===(i=e.getTotalLabelComponentStyle)||void 0===i?void 0:i.call(e,{baseMark:t._baseMark,labelMark:t._textMark}))&&void 0!==n?n:{},Object.assign({offset:a,animation:o,overlap:s,dataFilter:function(t){return t.filter((function(t){return"bottom"===u?t.data[Bj]:t.data[Ej]}))}},h))}},size:function(){var e;return Object.assign({padding:null===(e=t._spec.overlap)||void 0===e?void 0:e.padding},t._regions[0].getLayoutRect())},itemEncoder:function(i){return zK({baseMark:t._baseMark,labelMark:t._textMark,series:e,labelSpec:e.getSpec().totalLabel},i,t._spec.formatMethod)}}),t._setTransformOfComponent(i,t._baseMark)}))}},{key:"compileMarks",value:function(){var t=this;this.getMarks().forEach((function(e){var i=t._regions[0].getGroupMark().getProduct();e.compile({group:i,context:{model:t}})}))}},{key:"_getSeries",value:function(){return this._option.getSeriesInIndex([this.getSpecPath()[1]])[0]}}],[{key:"getSpecInfo",value:function(t,e){var i,n=this,r=[];return null===(i=null==e?void 0:e.region)||void 0===i||i.forEach((function(t,i){var a;null===(a=t.seriesIndexes)||void 0===a||a.forEach((function(t){var a=e.series[t].spec[n.specKey];(null==a?void 0:a.visible)&&r.push({spec:a,type:c.totalLabel,specPath:["series",t,n.specKey],specInfoPath:["component",n.specKey,t],regionIndexes:[i],seriesIndexes:[t]})}))})),r}}])}(v3);function _3(t,e){var i,n,r,a,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",s=t.direction;a="bottom"===o?{vertical:["bottom","top"],horizontal:["left","right"]}:{vertical:["top","bottom"],horizontal:["right","left"]};var l=("horizontal"===s?null===(i=t.getXAxisHelper())||void 0===i?void 0:i.isInverse():null===(n=t.getYAxisHelper())||void 0===n?void 0:n.isInverse())?1:0;switch(e){case"rect":case"symbol":r=a[s][l];break;default:r="top"}return r}m3.type=c.totalLabel,m3.builtInTheme={totalLabel:{visible:!1,offset:5,overlap:{clampForce:!0,strategy:[]},smartInvert:!1,animation:!1,style:{fontSize:{type:"token",key:"l4FontSize"},fill:{type:"palette",key:"primaryFontColor"}}}},m3.specKey="totalLabel";var b3=function(e){function o(){var e;return n(this,o),(e=i(this,o,arguments)).specKey="markPoint",e.layoutZIndex=t.LayoutZIndex.MarkPoint,e}return h(o,e),a(o,[{key:"_createMarkerComponent",value:function(){var t,e,i,n,a,o,s,l,u,h,c,d,v,f,p,g,y,m,_,b,k,x,S,A,C,M,T,w,E,B,P,O,I,R,L=this._spec,D=L.itemContent,F=void 0===D?{}:D,z=L.itemLine,j=void 0===z?{}:z,H=L.targetSymbol,N=void 0===H?{}:H,U=this._relativeSeries.getRegion(),V=F,W=V.type,G=void 0===W?"text":W,Y=V.text,K=V.symbol,X=V.image,q=V.richText,Z=V.customMark,J=V.textStyle,$=V.symbolStyle,tt=V.imageStyle,et=V.richTextStyle,it=V.customMarkStyle,nt=V.style,rt=void 0===nt?{}:nt,at=V.state,ot=void 0===at?{}:at,st=r(V,["type","text","symbol","image","richText","customMark","textStyle","symbolStyle","imageStyle","richTextStyle","customMarkStyle","style","state"]),lt=null,ut=null,ht={};"text"===G?(lt=null!==(t=null==Y?void 0:Y.state)&&void 0!==t?t:ot,ht={dx:0,dy:0},ut=S2(Object.assign(Object.assign({},Y),{style:Q(ht,null!==(n=null!==(i=null!==(e=null==Y?void 0:Y.style)&&void 0!==e?e:null==Y?void 0:Y.textStyle)&&void 0!==i?i:J)&&void 0!==n?n:rt)}),this._markerData,this._markAttributeContext)):"richText"===G?(lt=null!==(a=null==q?void 0:q.state)&&void 0!==a?a:ot,ut=C2(Q(ht={width:100,height:100},null!==(s=null!==(o=null==q?void 0:q.style)&&void 0!==o?o:et)&&void 0!==s?s:rt),this._markerData,this._markAttributeContext)):"symbol"===G?(lt=null!==(l=null==K?void 0:K.state)&&void 0!==l?l:ot,ut=tH(C2(Q(ht={symbolType:"star",fill:"rgb(48, 115, 242)",fillOpacity:.8,size:20},null!==(h=null!==(u=null==K?void 0:K.style)&&void 0!==u?u:$)&&void 0!==h?h:rt),this._markerData,this._markAttributeContext))):"image"===G?(lt=null!==(c=null==X?void 0:X.state)&&void 0!==c?c:ot,ut=C2(Q(ht={width:80,height:80},null!==(v=null!==(d=null==X?void 0:X.style)&&void 0!==d?d:tt)&&void 0!==v?v:rt),this._markerData,this._markAttributeContext)):"custom"===G&&(lt=null!==(f=null==Z?void 0:Z.state)&&void 0!==f?f:ot,ut=C2(null!==(g=null!==(p=null==Z?void 0:Z.style)&&void 0!==p?p:it)&&void 0!==g?g:rt,this._markerData,this._markAttributeContext));var ct={zIndex:this.layoutZIndex,interactive:null===(y=this._spec.interactive)||void 0===y||y,hover:null===(m=this._spec.interactive)||void 0===m||m,select:null===(_=this._spec.interactive)||void 0===_||_,position:{x:0,y:0},clipInRange:null!==(b=this._spec.clip)&&void 0!==b&&b,itemContent:Object.assign(Object.assign({type:G,offsetX:M2(F.offsetX,U),offsetY:M2(F.offsetY,U)},st),{style:C2(ut,this._markerData,this._markAttributeContext)}),targetSymbol:{offset:null!==(k=N.offset)&&void 0!==k?k:0,visible:null!==(x=N.visible)&&void 0!==x&&x,size:null!==(S=N.size)&&void 0!==S?S:20,style:C2(N.style,this._markerData,this._markAttributeContext)},state:{line:A2(null!==(C=null===(A=this._spec.itemLine.line)||void 0===A?void 0:A.state)&&void 0!==C?C:{},this._markerData,this._markAttributeContext),lineStartSymbol:A2(null!==(T=null===(M=this._spec.itemLine.startSymbol)||void 0===M?void 0:M.state)&&void 0!==T?T:{},this._markerData,this._markAttributeContext),lineEndSymbol:A2(null!==(E=null===(w=this._spec.itemLine.endSymbol)||void 0===w?void 0:w.state)&&void 0!==E?E:{},this._markerData,this._markAttributeContext),itemContent:A2(lt,this._markerData,this._markAttributeContext),textBackground:A2(null===(P=null===(B=this._spec.itemContent.text)||void 0===B?void 0:B.labelBackground)||void 0===P?void 0:P.state,this._markerData,this._markAttributeContext),targetItem:A2(null!==(I=null===(O=this._spec.targetSymbol)||void 0===O?void 0:O.state)&&void 0!==I?I:{},this._markerData,this._markAttributeContext)},animation:null!==(R=this._spec.animation)&&void 0!==R&&R,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate},dt=j.visible,vt=j.line,ft=void 0===vt?{}:vt,pt=r(j,["visible","line"]);return ct.itemLine=!1!==dt?Object.assign(Object.assign({},pt),{visible:!0,lineStyle:tH(ft.style)}):{visible:!1},new KD(ct)}},{key:"_markerLayout",value:function(){var t,e,i,n,a,o,s,l,u,h,c,d,v,f,p=this._spec,g=this._markerData,y=this._relativeSeries,m=this._computePointsAttr().point,_=this._getRelativeDataView().latestData,b=g?g.latestData[0]&&g.latestData[0].latestData?g.latestData[0].latestData:g.latestData:_,k=this._spec,x=k.itemLine,S=void 0===x?{}:x,A=k.itemContent,C=void 0===A?{}:A,T=this._relativeSeries.getRegion(),w=S.visible,E=S.line,B=void 0===E?{}:E,P=r(S,["visible","line"]),O=!1!==w?Object.assign(Object.assign({},P),{visible:!0,lineStyle:tH(B.style)}):{visible:!1},I=S2(Object.assign(Object.assign({},C.text),{style:Q({dx:0,dy:0},null!==(e=null===(t=C.text)||void 0===t?void 0:t.style)&&void 0!==e?e:C.style)}),g,this._markAttributeContext);if(p.clip||(null===(i=p.itemContent)||void 0===i?void 0:i.confine)){var R=x2([y.getRegion()]),L=R.minX,D=R.maxX,F=R.minY;f={x:L,y:F,width:D-L,height:R.maxY-F}}if(this._markerComponent){var z=null!==(n=this._markerComponent.attribute)&&void 0!==n?n:{},j=null!==(o=null===(a=z.itemContent)||void 0===a?void 0:a.textStyle)&&void 0!==o?o:{},H=null===(s=this._spec.itemContent.text)||void 0===s?void 0:s.text,N=M2(C.offsetX,T),U=M2(C.offsetY,T);this._markerComponent.setAttributes({position:void 0===m?{x:null,y:null}:m,itemContent:Object.assign(Object.assign({},z.itemContent),{panel:null!==(l=I.panel)&&void 0!==l?l:null===(u=z.itemContent)||void 0===u?void 0:u.panel,padding:null!==(h=I.padding)&&void 0!==h?h:null===(c=z.itemContent)||void 0===c?void 0:c.padding,textStyle:Object.assign(Object.assign(Object.assign({},j),null!==(d=I.textStyle)&&void 0!==d?d:{}),{text:(null===(v=this._spec.itemContent.text)||void 0===v?void 0:v.formatMethod)?this._spec.itemContent.text.formatMethod(b,_):M(H)?H:j.text}),offsetX:T2(m,N,T),offsetY:T2(m,U,T)}),itemLine:O,limitRect:f,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}}},{key:"_initDataView",value:function(){var t=this._spec,e=P2(t),i=e.doXYProcess,n=e.doPolarProcess,r=e.doGeoProcess;(M(t.coordinate)||i||n||r)&&this._initCommonDataView()}}],[{key:"_getMarkerCoordinateType",value:function(t){var e=P2(t),i=e.doPolarProcess,n=e.doGeoProcess;return"polar"===t.coordinateType||i?"polar":"geo"===t.coordinateType||n?"geo":"cartesian"}}])}(K2);b3.specKey="markPoint";var k3={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}},x3=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=c.markPoint,t.name=c.markPoint,t.coordinateType="cartesian",t}return h(e,t),a(e,[{key:"_computePointsAttr",value:function(){var t,e,i,n,r=this._spec,a=this._markerData,o=this._relativeSeries,s=M(r.x)&&M(r.y),l=M(r.coordinate),u=M(r.position),h=null!==(t=null==r?void 0:r.autoRange)&&void 0!==t&&t;return s?n=null===(i=null===(e=p2(a,o,o,o,h,!1,this._getAutoRangeExtendDomainKeyPrefix()))||void 0===e?void 0:e[0])||void 0===i?void 0:i[0]:l?n=m2(a,o,h,r.coordinatesOffset,this._getAutoRangeExtendDomainKeyPrefix())[0]:u&&(n=k2(r.position,o,r.regionRelative)[0]),{point:n}}},{key:"_computeOptions",value:function(){var t,e=this._spec,i=P2(e).doXYProcess,n=M(e.coordinate);return i?t=[this._processSpecByDims([{dim:"x",specValue:e.x},{dim:"y",specValue:e.y}])]:n&&(t=this._processSpecCoo(e)),{options:t}}}])}(b3);x3.type=c.markPoint,x3.coordinateType="cartesian",x3.builtInTheme={markPoint:k3};var S3=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=c.polarMarkPoint,t.name=c.polarMarkPoint,t.coordinateType="polar",t}return h(e,t),a(e,[{key:"_computePointsAttr",value:function(){var t,e,i=this._markerData,n=this._relativeSeries,r=y2(i,n,n,n,null!==(e=null===(t=this._spec)||void 0===t?void 0:t.autoRange)&&void 0!==e&&e,this._getAutoRangeExtendDomainKeyPrefix())[0][0];return{point:Ae({x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y},r.radius,r.angle)}}},{key:"_computeOptions",value:function(){var t=this._spec;return{options:[this._processSpecByDims([{dim:"radius",specValue:t.radius},{dim:"angle",specValue:t.angle}])]}}}])}(b3);S3.type=c.polarMarkPoint,S3.coordinateType="polar",S3.builtInTheme={polarMarkPoint:k3};var A3=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments)).type=c.geoMarkPoint,t.name=c.geoMarkPoint,t.coordinateType="geo",t}return h(e,t),a(e,[{key:"_computePointsAttr",value:function(){var t=function(t,e){var i=[];return(t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData).forEach((function(t){M(t.areaName)&&i.push([{x:e.nameValueToPosition(t.areaName).x+e.getRegion().getLayoutStartPoint().x,y:e.nameValueToPosition(t.areaName).y+e.getRegion().getLayoutStartPoint().y}])})),i}(this._markerData,this._relativeSeries)[0][0];return{point:t}}},{key:"_computeOptions",value:function(){var t=this._spec;return{options:[this._processSpecByDims([{dim:"areaName",specValue:t.areaName}])]}}}])}(b3);A3.type=c.geoMarkPoint,A3.coordinateType="geo",A3.builtInTheme={geoMarkPoint:k3};var C3="inBrush",M3="outOfBrush",T3={style:!0,inBrush:!0,outOfBrush:!0},w3=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).layoutType="none",e.type=c.brush,e.name=c.brush,e.specKey="brush",e.layoutZIndex=t.LayoutZIndex.Brush,e._linkedSeries=[],e._itemMap={},e._linkedItemMap={},e._inBrushElementsMap={},e._outOfBrushElementsMap={},e._linkedInBrushElementsMap={},e._linkedOutOfBrushElementsMap={},e._cacheInteractiveRangeAttrs=[],e._releatedAxes=[],e._regionAxisMap={},e._axisDataZoomMap={},e._zoomRecord=[],e}return h(r,e),a(r,[{key:"init",value:function(){var e=this._transformBrushedMarkAttr(this._spec.inBrush),i=this._transformBrushedMarkAttr(this._spec.outOfBrush);this._option.getAllSeries().forEach((function(n){n.getActiveMarks().forEach((function(r){r&&(n.setMarkStyle(r,Object.assign({},e),C3,t.AttributeLevel.Series),n.setMarkStyle(r,Object.assign({},i),M3,t.AttributeLevel.Series))}))}))}},{key:"reInit",value:function(t){_(r,"reInit",this,3)([t]),this.init()}},{key:"_initNeedOperatedItem",value:function(){var t=this,e=this._spec.seriesId,i=this._spec.seriesIndex;this._relativeRegions.forEach((function(n){var r=[];n.getSeries().forEach((function(a){(e&&ot(e).includes(a.userId.toString())||i&&ot(i).includes(a.getSpecIndex())||!i&&!e)&&r.push.apply(r,b(a.getMarksWithoutRoot())),t._itemMap[n.id]=r}))})),this._linkedSeries.forEach((function(e){t._linkedItemMap[e.id]=e.getMarksWithoutRoot()}))}},{key:"created",value:function(){_(r,"created",this,3)([]),this.initEvent(),this._bindRegions(),this._bindLinkedSeries(),this._initRegionAxisMap(),this._initAxisDataZoomMap(),this._initNeedOperatedItem()}},{key:"_bindRegions",value:function(){M(this._spec.regionId)||M(this._spec.regionIndex)?this._relativeRegions=this._option.getRegionsInUserIdOrIndex(ot(this._spec.regionId),ot(this._spec.regionIndex)):this._relativeRegions=this._option.getAllRegions()}},{key:"_bindLinkedSeries",value:function(){(M(this._spec.brushLinkSeriesId)||M(this._spec.brushLinkSeriesIndex))&&(this._linkedSeries=this._option.getSeriesInUserIdOrIndex(ot(this._spec.brushLinkSeriesId),ot(this._spec.brushLinkSeriesIndex)))}},{key:"_initRegionAxisMap",value:function(){var t=this;M(this._spec.axisId)?ot(this._spec.axisId).forEach((function(e){t._releatedAxes.push(t._option.getComponentByUserId(e))})):M(this._spec.axisIndex)?ot(this._spec.axisIndex).forEach((function(e){t._releatedAxes.push(t._option.getComponentByIndex("axes",e))})):this._releatedAxes=this._option.getComponentsByKey("axes"),this._releatedAxes.forEach((function(e){null==e||e.getRegions().forEach((function(i){t._regionAxisMap["region_"+i.id]?t._regionAxisMap["region_"+i.id].push(e):t._regionAxisMap["region_"+i.id]=[e]}))}))}},{key:"_initAxisDataZoomMap",value:function(){var t=this;this._option.getComponentsByKey("dataZoom").forEach((function(e){e.relatedAxisComponent&&(t._axisDataZoomMap[e.relatedAxisComponent.id]=e)}))}},{key:"initEvent",value:function(){}},{key:"_compareSpec",value:function(t,e){var i=this;this._brushComponents&&this._relativeRegions.forEach((function(t,e){i._updateBrushComponent(t,e)}));var n=_(r,"_compareSpec",this,3)([t,e]);return nt(e,t)||(n.change=!0,n.reRender=!0,n.reMake||n.reCompile||!this._isComponentOnlySpecChange(t,e)?n.reMake=!0:n.effects=Object.assign(Object.assign({},n.effects),{component:!0,layout:!0,render:!0})),n}},{key:"_isComponentOnlySpecChange",value:function(t,e){return Object.keys(Object.assign(Object.assign({},e),t)).every((function(i){return nt(null==e?void 0:e[i],null==t?void 0:t[i])||T3[i]}))}},{key:"onLayoutEnd",value:function(){var t,e=this;_(r,"onLayoutEnd",this,3)([]),this._option.disableTriggerEvent||(null===(t=this._spec.visible)||void 0===t||t)&&(this._brushComponents?this._relativeRegions.forEach((function(t,i){e._updateBrushComponent(t,i)})):(this._brushComponents=[],this._relativeRegions.forEach((function(t,i){e._createBrushComponent(t,i)}))))}},{key:"_updateBrushComponent",value:function(t,e){var i,n=this._getBrushInteractiveAttr(t),r=this._brushComponents[e];r.setAttributes(Object.assign({brushStyle:tH(null===(i=this._spec)||void 0===i?void 0:i.style)},n)),this._initMarkBrushState(e,""),r.children[0].removeAllChild()}},{key:"_shouldEnableInteractive",value:function(){return!1!==this.getOption().getCompiler().getOption().interactive}},{key:"_createBrushComponent",value:function(e,i){var n,r,a=this,o=this._getBrushInteractiveAttr(e),s=new jF(Object.assign(Object.assign(Object.assign({zIndex:this.layoutZIndex,brushStyle:tH(null===(n=this._spec)||void 0===n?void 0:n.style)},o),this._spec),{disableTriggerEvent:this._option.disableTriggerEvent}));s.id=null!==(r=this._spec.id)&&void 0!==r?r:"brush-".concat(this.id),this.getContainer().add(s),this._brushComponents.push(s),this._cacheInteractiveRangeAttrs.push(o),s.addEventListener(OF.brushActive,(function(n){a._initMarkBrushState(i,M3),a._emitEvent(t.ChartEvent.brushActive,e,n)})),s.addEventListener(OF.drawStart,(function(i){a._spec.disableDimensionHoverWhenBrushing&&a._option.globalInstance.disableDimensionHoverEvent(!0),a._setRegionMarkPickable(e,!0),a._emitEvent(t.ChartEvent.brushStart,e,i)})),s.addEventListener(OF.moveStart,(function(i){a._spec.disableDimensionHoverWhenBrushing&&a._option.globalInstance.disableDimensionHoverEvent(!0),a._setRegionMarkPickable(e,!0),a._emitEvent(t.ChartEvent.brushStart,e,i)})),s.addEventListener(OF.drawing,(function(i){a._setRegionMarkPickable(e,!1),a._handleBrushChange(e,i),a._emitEvent(t.ChartEvent.brushChange,e,i)})),s.addEventListener(OF.moving,(function(i){a._setRegionMarkPickable(e,!1),a._handleBrushChange(e,i),a._emitEvent(t.ChartEvent.brushChange,e,i)})),s.addEventListener(OF.brushClear,(function(n){a._spec.disableDimensionHoverWhenBrushing&&a._option.globalInstance.disableDimensionHoverEvent(!1),a._setRegionMarkPickable(e,!0),a._initMarkBrushState(i,""),a._emitEvent(t.ChartEvent.brushClear,e,n)})),s.addEventListener(OF.drawEnd,(function(n){var r;a._spec.disableDimensionHoverWhenBrushing&&a._option.globalInstance.disableDimensionHoverEvent(!1),a._setRegionMarkPickable(e,!0);var o=n.detail.operateMask,s=a._spec.updateElementsState,l=void 0===s||s;if(null===(r=a._spec)||void 0===r?void 0:r.onBrushEnd)!0===a._spec.onBrushEnd(n)?(a.clearGraphic(),a._initMarkBrushState(i,""),a._emitEvent(t.ChartEvent.brushClear,e,n)):(a._spec.onBrushEnd(n),a._emitEvent(t.ChartEvent.brushEnd,e,n));else{var u=a._extendDataInBrush(a._inBrushElementsMap);(!a._spec.zoomWhenEmpty&&u.length>0||!l)&&a._setAxisAndDataZoom(o,e),a._emitEvent(t.ChartEvent.brushEnd,e,n)}})),s.addEventListener(OF.moveEnd,(function(i){a._spec.disableDimensionHoverWhenBrushing&&a._option.globalInstance.disableDimensionHoverEvent(!1),a._setRegionMarkPickable(e,!0);var n=i.detail.operateMask,r=a._spec.updateElementsState,o=void 0===r||r,s=a._extendDataInBrush(a._inBrushElementsMap);(!a._spec.zoomWhenEmpty&&s.length>0||o)&&a._setAxisAndDataZoom(n,e),a._emitEvent(t.ChartEvent.brushEnd,e,i)}))}},{key:"_getBrushInteractiveAttr",value:function(t){var 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],interactive:this._shouldEnableInteractive()}}},{key:"_transformBrushedMarkAttr",value:function(t){var e={};return(null==t?void 0:t.symbol)&&(e.symbolType=t.symbol),(null==t?void 0:t.symbolSize)&&(e.size=t.symbolSize),(null==t?void 0:t.color)&&(e.fill=t.color),(null==t?void 0:t.colorAlpha)&&(e.fillOpacity=t.colorAlpha),Object.assign(Object.assign({},tH(t)),e)}},{key:"_handleBrushChange",value:function(t,e){var i=e.detail.operateMask;this._operateMask=i;var n=this._spec.updateElementsState;(void 0===n||n)&&(this._reconfigItem(i,t),this._reconfigLinkedItem(i,t))}},{key:"_extendDataInBrush",value:function(t){var e,i,n=[];for(var r in t)for(var a in t[r])n.push(Object.assign({},null===(i=null===(e=t[r][a].context)||void 0===e?void 0:e.data)||void 0===i?void 0:i[0]));return n}},{key:"_extendDatumOutOfBrush",value:function(t){var e,i,n=[];for(var r in t)n.push(null===(i=null===(e=t[r].context)||void 0===e?void 0:e.data)||void 0===i?void 0:i[0]);return n}},{key:"_emitEvent",value:function(t,e,i){var n;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,zoomRecord:this._zoomRecord},vchart:null===(n=this._option)||void 0===n?void 0:n.globalInstance,event:i})}},{key:"_reconfigItem",value:function(t,e){var i,n,r,a=this;if((null==t?void 0:t.globalTransMatrix)&&(null===(i=null==t?void 0:t.attribute)||void 0===i?void 0:i.points)){var o=null!==(r=null===(n=null==t?void 0:t.attribute)||void 0===n?void 0:n.points)&&void 0!==r?r:[],s=t.globalTransMatrix,l=s.a,u=s.b,h=s.c,c=s.d,d=s.e,v=s.f,f=o.map((function(t){return{x:l*t.x+h*t.y+d,y:u*t.x+c*t.y+v}})),p=this._spec.markTypeFilter,g=void 0===p?[]:p;this._itemMap[e.id].forEach((function(e){if(!g.includes(e.type)){var i=e.getGraphics();i&&i.length&&i.forEach((function(i){var n,r,o,s=e.id+"_"+i.context.key,l=a._isBrushContainItem(t.globalAABBBounds,f,i);(null===(n=a._outOfBrushElementsMap)||void 0===n?void 0:n[s])&&l?(ZN(i,C3,!0),a._inBrushElementsMap[null==t?void 0:t.name]||(a._inBrushElementsMap[null==t?void 0:t.name]={}),a._inBrushElementsMap[null==t?void 0:t.name][s]=i,delete a._outOfBrushElementsMap[s]):(null===(o=null===(r=a._inBrushElementsMap)||void 0===r?void 0:r[null==t?void 0:t.name])||void 0===o?void 0:o[s])&&!l&&(JN(i,C3),ZN(i,M3,!0),a._outOfBrushElementsMap[s]=i,delete a._inBrushElementsMap[t.name][s])}))}}))}}},{key:"_reconfigLinkedItem",value:function(t,e){var i,n=this;if((null==t?void 0:t.globalTransMatrix)&&(null===(i=null==t?void 0:t.attribute)||void 0===i?void 0:i.points)){var r=e.getLayoutStartPoint(),a=e.getSeries().map((function(t){return t.id}));this._linkedSeries.forEach((function(e){var i,o;if(!a.includes(e.id)){var s=e.getRegion().getLayoutStartPoint(),l=s.x-r.x,u=s.y-r.y,h=null!==(o=null===(i=null==t?void 0:t.attribute)||void 0===i?void 0:i.points)&&void 0!==o?o:[],c=t.globalTransMatrix,d=c.a,v=c.b,f=c.c,p=c.d,g=c.e,y=c.f,m=l||0,_=u||0,b=h.map((function(t){return{x:d*t.x+f*t.y+g+m,y:v*t.x+p*t.y+y+_}}));t.globalAABBBounds.clone().set(t.globalAABBBounds.x1+m,t.globalAABBBounds.y1+_,t.globalAABBBounds.x2+m,t.globalAABBBounds.y2+_);var k=n._spec.markTypeFilter,x=void 0===k?[]:k;n._linkedItemMap[e.id].forEach((function(e){if(!x.includes(e.type)){var i=e.getGraphics();i&&i.length&&i.forEach((function(i){var r,a,o;i.context;var s=e.id+"_"+i.context.key;(null===(r=n._linkedOutOfBrushElementsMap)||void 0===r?void 0:r[s])&&n._isBrushContainItem(t.globalAABBBounds,b,i)?(ZN(i,C3,!0),n._linkedInBrushElementsMap[null==t?void 0:t.name]||(n._linkedInBrushElementsMap[null==t?void 0:t.name]={}),n._linkedInBrushElementsMap[null==t?void 0:t.name][s]=i,delete n._linkedOutOfBrushElementsMap[s]):(null===(o=null===(a=n._linkedInBrushElementsMap)||void 0===a?void 0:a[null==t?void 0:t.name])||void 0===o?void 0:o[s])&&!n._isBrushContainItem(t.globalAABBBounds,b,i)&&(JN(i,C3),ZN(i,M3,!0),n._linkedOutOfBrushElementsMap[s]=i)}))}}))}}))}}},{key:"_isBrushContainItem",value:function(t,e,i){if(["symbol","rect"].includes(i.type)){var n=null==i?void 0:i.globalAABBBounds,r=n.x1,a=n.x2,o=n.y1,s=n.y2;return function(t,e){for(var i=0;i<e.length;i++){if(Ge(t,e[i].x,e[i].y))return!0;if(i>0&&We(e[i-1].x,e[i-1].y,e[i].x,e[i].y,t))return!0}return!1}(e,[{x:r,y:o},{x:a,y:o},{x:a,y:s},{x:r,y:s}])}return t.intersects(i.globalAABBBounds)}},{key:"_initItemMap",value:function(t,e,i){var n=this._spec.markTypeFilter,r=void 0===n?[]:n;Object.entries(t).forEach((function(t){var n=m(t,2);n[0],n[1].forEach((function(t){if(!r.includes(t.type)){var n=t.getGraphics();n&&n.length&&n.forEach((function(n){var r=t.id+"_"+n.context.key;JN(n,[C3,M3]),i&&ZN(n,i,!0),e[r]=n}))}}))}))}},{key:"_initMarkBrushState",value:function(t,e){this._brushComponents.forEach((function(e,i){i!==t&&e.children[0].removeAllChild()})),this._inBrushElementsMap={},this._outOfBrushElementsMap={},this._linkedInBrushElementsMap={},this._linkedOutOfBrushElementsMap={},this._initItemMap(this._itemMap,this._outOfBrushElementsMap,e),this._initItemMap(this._linkedItemMap,this._linkedOutOfBrushElementsMap,e)}},{key:"_setRegionMarkPickable",value:function(t,e){t.getGroupMark().getGraphics().forEach((function(t){return t.setAttribute("childrenPickable",e)}))}},{key:"_stateClamp",value:function(t){return Math.min(Math.max(0,t),1)}},{key:"_setAxisAndDataZoom",value:function(t,e){var i,n=this;if(this._zoomRecord=[],this._spec.zoomAfterBrush){var r=t.AABBBounds;null===(i=this._regionAxisMap["region_"+e.id])||void 0===i||i.forEach((function(t){var i,a,o="bottom"===t.layoutOrient||"top"===t.layoutOrient,s=null!==(i=n._spec.axisRangeExpand)&&void 0!==i?i:0,l=r.x1,u=r.x2,h=r.y1,c=r.y2,d=o?"x":"y",v=o?l:h,f=o?u:c,p=t.getScale().range(),g=null!==(a=t.scaleRangeFactor())&&void 0!==a?a:[0,1],y=st(p)<p[0],m=v-e.getLayoutStartPoint()[d],_=f-e.getLayoutStartPoint()[d],b=y?Math.min(m,_):Math.max(m,_),k=y?Math.max(m,_):Math.min(m,_),x=(k-p[0])/(st(p)-p[0])*(g[1]-g[0])+g[0],S=(b-p[0])/(st(p)-p[0])*(g[1]-g[0])+g[0],A=n._stateClamp(x-s),C=n._stateClamp(S+s);if(n._axisDataZoomMap[t.id]){var M=n._axisDataZoomMap[t.id],T=y?1-A:A,w=y?1-C:C;M.setStartAndEnd(Math.min(T,w),Math.max(T,w),["percent","percent"]),n._zoomRecord.push({operateComponent:M,start:T,end:w,startValue:j1(T,M.stateScale,N1(M.relatedAxisComponent,M.isHorizontal)),endValue:j1(w,M.stateScale,N1(M.relatedAxisComponent,M.isHorizontal))})}else t.scaleRangeFactor([A,C]),t.effect.scaleUpdate(),n._zoomRecord.push({operateComponent:t,start:A,end:C,startValue:t.getScale().invert(k),endValue:t.getScale().invert(b)})}))}}},{key:"_getNeedClearVRenderComponents",value:function(){return this._brushComponents}},{key:"clearGraphic",value:function(){this._brushComponents&&this._brushComponents.forEach((function(t){t._container.incrementalClearChild()}))}},{key:"clear",value:function(){var t=this;if(this._brushComponents){var e=this.getContainer();this._brushComponents.forEach((function(i,n){t._initMarkBrushState(n,""),i.removeAllChild(),i.releaseBrushEvents(),e&&e.removeChild(i)})),this._brushComponents=null}}},{key:"clearBrushStateAndMask",value:function(){var t=this;this._relativeRegions.forEach((function(e,i){t._initMarkBrushState(i,""),t._brushComponents[i].children[0].removeAllChild()}))}}],[{key:"getSpecInfo",value:function(t){return IU(t,this.specKey,this.type,(function(t){return!1!==t.visible}))}}])}(DW);w3.type=c.brush,w3.builtInTheme={brush:{style:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",lineWidth:2},brushMode:"single",brushType:"rect",brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:0}},w3.specKey="brush";var E3={style:!0,state:!0},B3=function(e){function r(){var e;return n(this,r),(e=i(this,r,arguments)).type=c.customMark,e.specKey="customMark",e.layoutType="none",e.layoutZIndex=t.LayoutZIndex.CustomMark,e.layoutLevel=t.LayoutLevel.CustomMark,e}return h(r,e),a(r,[{key:"created",value:function(){_(r,"created",this,3)([]),this.initMarks(),this.initEvent()}},{key:"getMarkAttributeContext",value:function(){return this._markAttributeContext}},{key:"_buildMarkAttributeContext",value:function(){var t=this;this._markAttributeContext={vchart:this._option.globalInstance,globalScale:function(e,i){var n;return null===(n=t._option.globalScale.getScale(e))||void 0===n?void 0:n.scale(i)}}}},{key:"initMarks",value:function(){var t=this;if(this._spec){var e=null;if(this._spec.parent){var i=this.getChart().getAllMarks().find((function(e){return e.getUserId()===t._spec.parent}));"group"===i.type&&(e=i)}this._createExtensionMark(this._spec,e,"".concat(dj,"_series_").concat(this.id,"_extensionMark"),0)}}},{key:"_createExtensionMark",value:function(t,e,i){var n,r,a=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=this._createMark({type:t.type,name:M(t.name)?"".concat(t.name):"".concat(i,"_").concat(o)},{skipBeforeLayouted:!0,attributeContext:this._getMarkAttributeContext(),componentType:t.componentType,key:t.dataKey});if(s){if(M(t.id)&&s.setUserId(t.id),(null===(n=this._option.globalInstance)||void 0===n?void 0:n.isAnimationEnable())&&t.animation){var l=lV({},uV(t.type,t,this._markAttributeContext));s.setAnimationConfig(l)}if(C(e)?this._marks.addMark(s):e&&e.addMark(s),this.initMarkStyleWithSpec(s,t),"group"===t.type&&(i="".concat(i,"_").concat(o),null===(r=t.children)||void 0===r||r.forEach((function(t,e){a._createExtensionMark(t,s,i,e)}))),M(t.dataId)||F(t.dataIndex)){var u=this.getChart().getSeriesData(t.dataId,t.dataIndex);u&&(s.setDataView(u),u.target.addListener("change",(function(){s.getData().updateData()})))}}}},{key:"initEvent",value:function(){}},{key:"_compareSpec",value:function(t,e){var i=_(r,"_compareSpec",this,3)([t,e]);return nt(e,t)||(i.reMake||i.reCompile||!this._isComponentOnlySpecChange(t,e)?i.reMake=!0:i.effects=Object.assign(Object.assign({},i.effects),{component:!0,render:!0})),i.change=!0,i.reRender=!0,i}},{key:"_isComponentOnlySpecChange",value:function(t,e){return Object.keys(Object.assign(Object.assign({},e),t)).every((function(i){return nt(null==e?void 0:e[i],null==t?void 0:t[i])||E3[i]}))}},{key:"reInit",value:function(t){_(r,"reInit",this,3)([t]),this._updateMarkStyleWithSpec(this._spec,this.getMarks()[0]),this.getMarks().forEach((function(t){t.commit(!1,!0)}))}},{key:"_updateMarkStyleWithSpec",value:function(t,e){var i,n,r,a,o=this;if(t&&e&&(this.initMarkStyleWithSpec(e,t),"group"===t.type)){var s=null!==(r=null===(n=(i=e).getMarks)||void 0===n?void 0:n.call(i))&&void 0!==r?r:[];null===(a=t.children)||void 0===a||a.forEach((function(t,e){o._updateMarkStyleWithSpec(t,s[e])}))}}},{key:"_getMarkAttributeContext",value:function(){var t=this;return{vchart:this._option.globalInstance,chart:this.getChart(),globalScale:function(e,i){var n;return null===(n=t._option.globalScale.getScale(e))||void 0===n?void 0:n.scale(i)},getLayoutBounds:function(){var e=t.getLayoutStartPoint(),i=e.x,n=e.y,r=t.getLayoutRect(),a=r.width,o=r.height;return(new ei).set(i,n,i+a,n+o)}}}},{key:"_getLayoutRect",value:function(){var t=new ei;return this.getMarks().forEach((function(e){var i=e.getProduct();i&&t.union(i.AABBBounds)})),t.empty()?{width:0,height:0}:{width:t.width(),height:t.height()}}},{key:"getBoundsInRect",value:function(t){this.setLayoutRect(t);var e=this._getLayoutRect(),i=this.getLayoutStartPoint(),n=i.x,r=i.y;return{x1:n,y1:r,x2:n+e.width,y2:r+e.height}}},{key:"getVRenderComponents",value:function(){var t=[],e=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(i){if(i&&"group"===i.type)i.getMarks().forEach((function(t){e(t)}));else if("component"===i.type){var n=null==i?void 0:i.getComponent();n&&t.push(n)}}));return this.getMarks().forEach((function(t){e(t)})),t}}])}(DW);B3.type=c.customMark,B3.specKey="customMark";var P3=function(){function t(e,i){n(this,t),this._chartLayoutRect={x:0,y:0,width:1,height:1},this._col=1,this._row=1,this._elementMap=new Map,this.standardizationSpec(e),this._gridInfo=e,this._col=e.col,this._row=e.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=null==i?void 0:i.onError,this.initUserSetting()}return a(t,[{key:"standardizationSpec",value:function(t){var e,i,n;t.col=null!==(e=t.col)&&void 0!==e?e:1,t.row=null!==(i=t.row)&&void 0!==i?i:1,t.elements=null!==(n=t.elements)&&void 0!==n?n:[]}},{key:"initUserSetting",value:function(){var t=this;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((function(e,i){e||(t._colSize[i]={value:0,isUserSetting:!1,isLayoutSetting:!1})})),this._rowSize.forEach((function(e,i){e||(t._rowSize[i]={value:0,isUserSetting:!1,isLayoutSetting:!1})}))}},{key:"setSizeFromUserSetting",value:function(t,e,i,n){t.forEach((function(t){t.index<0&&t.index>=i||(F(t.size)?e[t.index]={value:+t.size,isUserSetting:!0,isLayoutSetting:!1}:A(t.size)&&(e[t.index]={value:t.size(n),isUserSetting:!0,isLayoutSetting:!1}))}))}},{key:"clearLayoutSize",value:function(){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((function(t){t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)})),this._rowSize.forEach((function(t){t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)}))}},{key:"getItemGridInfo",value:function(t){var e,i,n=this._elementMap.get(t);return n||(i=null===(e=this._gridInfo.elements)||void 0===e?void 0:e.find((function(e){var i;if("modelId"in e&&M(e.modelId)){if(M(t.model.userId)&&t.model.userId===e.modelId)return!0}else if("modelKey"in e&&M(e.modelKey)&&"modelIndex"in e&&M(e.modelIndex)&&(null!==(i=t.model.specKey)&&void 0!==i?i:t.model.type)===e.modelKey&&t.model.getSpecIndex()===e.modelIndex)return!0;return!1})),i||(i={col:0,colSpan:1,row:0,rowSpan:1}),this._elementMap.set(t,i),i)}},{key:"getSizeFromGrid",value:function(t,e){for(var i,n="col"===e?this._colSize:this._rowSize,r=0,a=t[e];a<t[e]+(null!==(i=t["".concat(e,"Span")])&&void 0!==i?i:1);a++)r+=n[a].value;return r}},{key:"getSizeFromUser",value:function(t,e){var i,n,r="col"===e?this._colSize:this._rowSize;if(null===(i=r[t[e]])||void 0===i?void 0:i.isUserSetting){for(var a=0,o=t[e];o<t[e]+(null!==(n=t["".concat(e,"Span")])&&void 0!==n?n:1);o++){if(!r[o].isUserSetting)return;a+=r[o].value}return a}}},{key:"setItemLayoutSizeToGrid",value:function(t,e){if(O3(t)){if(e.colSpan&&e.colSpan>1)return;if(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)return;if(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}}},{key:"layoutGrid",value:function(t){var e="col"===t?this._colSize:this._rowSize,i="col"===t?this._chartLayoutRect.width:this._chartLayoutRect.height,n=[];e.forEach((function(t){t.isUserSetting||t.isLayoutSetting?i-=t.value:n.push(t)})),i<0&&console.warn("layout content ".concat(t," size bigger than chart")),n.forEach((function(t){return t.value=i/n.length}))}},{key:"getItemPosition",value:function(t){for(var e=this.getItemGridInfo(t),i={x:this._chartLayoutRect.x,y:this._chartLayoutRect.y},n=0;n<e.col;n++)i.x+=this._colSize[n].value;for(var r=0;r<e.row;r++)i.y+=this._rowSize[r].value;return i.x+=t.layoutPaddingLeft+t.layoutOffsetX,i.y+=t.layoutPaddingTop+t.layoutOffsetY,i}},{key:"getItemLayoutRect",value:function(t){var e,i,n=this.getItemGridInfo(t);return{width:(null!==(e=this.getSizeFromGrid(n,"col"))&&void 0!==e?e:this._chartLayoutRect.width)-t.layoutPaddingLeft-t.layoutPaddingRight,height:(null!==(i=this.getSizeFromGrid(n,"row"))&&void 0!==i?i:this._chartLayoutRect.height)-t.layoutPaddingTop-t.layoutPaddingBottom}}},{key:"layoutItems",value:function(t,e,i,n){var r=this;this._chartLayoutRect=i,this._chartViewBox=n,this.clearLayoutSize(),e.sort((function(t,e){return e.layoutLevel-t.layoutLevel}));var a=e.filter((function(t){return"normal"===t.layoutType&&!1!==t.getModelVisible()})),o=a.filter((function(t){return O3(t)})),s=a.filter((function(t){return!O3(t)}));a.forEach((function(t){r.layoutOneItem(t,"user",!1)}));var l=e.filter((function(t){return"region-relative"===t.layoutType})),u=l.filter((function(t){return O3(t)})),h=l.filter((function(t){return!O3(t)}));u.forEach((function(t){return r.layoutOneItem(t,"user",!1)})),this.layoutGrid("col"),s.forEach((function(t){return r.layoutOneItem(t,"colGrid",!1)})),h.forEach((function(t){r.layoutOneItem(t,"colGrid",!1)})),this.layoutGrid("row"),h.forEach((function(t){r.layoutOneItem(t,"grid",!1)})),o.forEach((function(t){return r.layoutOneItem(t,"grid",!1)})),u.forEach((function(t){r.layoutOneItem(t,"grid",!0)})),this.layoutGrid("col"),e.filter((function(t){return"region"===t.layoutType})).forEach((function(t){return r.layoutOneItem(t,"grid",!1)})),this.layoutAbsoluteItems(e.filter((function(t){return"absolute"===t.layoutType}))),e.filter((function(t){return"absolute"!==t.layoutType})).forEach((function(t){t.setLayoutStartPosition(r.getItemPosition(t))}))}},{key:"layoutAbsoluteItems",value:function(t){var e=this;t.forEach((function(t){t.absoluteLayoutInRect(e._chartLayoutRect)}))}},{key:"layoutOneItem",value:function(t,e,i){var n,r,a="rowGrid"===e||"grid"===e?this.getSizeFromGrid.bind(this):this.getSizeFromUser.bind(this),o="colGrid"===e||"grid"===e?this.getSizeFromGrid.bind(this):this.getSizeFromUser.bind(this),s=this.getItemGridInfo(t),l={width:(null!==(n=o(s,"col"))&&void 0!==n?n:this._chartLayoutRect.width)-t.layoutPaddingLeft-t.layoutPaddingRight,height:(null!==(r=a(s,"row"))&&void 0!==r?r:this._chartLayoutRect.height)-t.layoutPaddingTop-t.layoutPaddingBottom},u=t.computeBoundsInRect(l);F(u.width)||(u.width=l.width),F(u.height)||(u.height=l.height),t.setLayoutRect("grid"!==e?u:l),this.setItemLayoutSizeToGrid(t,s)}}])}();function O3(t){return"left"===t.layoutOrient||"right"===t.layoutOrient}P3.type="grid";var I3="vchart-tooltip",R3="".concat(I3,"-container"),L3="".concat(I3,"-title"),D3="".concat(I3,"-content-box"),F3={offsetX:10,offsetY:10},z3="99999999999999";function j3(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\(/g,"(").replace(/ /g," ")}var H3=function(t,e){return t?(e||(e=t.getBoundingClientRect()),t.offsetWidth>0?e.width/t.offsetWidth:t.offsetHeight>0?e.height/t.offsetHeight:1):1},N3=function(t){return P(t)&&""!==(null==t?void 0:t.trim())||L(t)?j3(t):""},U3=function(t,e){var i;if(M(t))if(L(t))i=t;else if(A(t)){var n=t(e);L(n)&&(i=n)}return i},V3={left:[-2,0],right:[2,0],top:[0,-2],bottom:[0,2],insideTop:[0,-1.5],insideBottom:[0,1.5],insideLeft:[-1.5,0],insideRight:[1.5,0],insideTopLeft:[-1.5,-1.5],insideTopRight:[1.5,-1.5],insideBottomLeft:[-1.5,1.5],insideBottomRight:[1.5,1.5],lt:[-2,-2],tl:[-2,-2],rt:[2,-2],tr:[2,-2],bl:[-2,2],lb:[-2,2],br:[2,2],rb:[2,2],inside:[0,0],center:[0,0],centerBottom:[0,1],centerTop:[0,-1],centerLeft:[-1,0],centerRight:[1,0]},W3=function(t,e){var i,n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;return null!==(n=null===(i=V3[t])||void 0===i?void 0:i["x"===e?0:1])&&void 0!==n?n:r},G3=function(t){function e(){var t;return n(this,e),(t=i(this,e,arguments))._visible=!0,t._isReleased=!1,t.showTooltip=function(e,i,n){return n.changePositionOnly?t.changeTooltipPosition(n,i):t.changeTooltip(!0,n,i)},t.changeTooltip=function(e,i,n){return t._isReleased?1:e?t.changeTooltipPosition(i,n):(t._updateTooltip(!1,i),0)},t.changeTooltipPosition=function(e,i){var n,r,a,o,s;if(t._isReleased)return 1;var l=e.event,u=e.tooltipSpec,h=e.activeTooltipSpec,c=e.changePositionOnly;if(!h)return 1;var d=h.activeType;if(h.handler)return null!==(a=null===(r=(n=h.handler).showTooltip)||void 0===r?void 0:r.call(n,d,i,e))&&void 0!==a?a:0;var v=h,f=t._getActualTooltipPosition(h,e,t._getTooltipBoxSize(h,c));h.position=f;var p=null!==(o=h.updatePosition)&&void 0!==o?o:null===(s=u[d])||void 0===s?void 0:s.updatePosition;p&&(h.position=p(h.position,i,e));var g=!1!==(null==v?void 0:v.visible);return i&&"pointerout"!==l.type&&h.visible&&(h.title||h.content)||(g=!1),t._updateTooltip(g,Object.assign(Object.assign({},e),{changePositionOnly:c})),0},t._getActualTooltipPosition=function(e,i,n){var r,a,o,s,l,u,h,c,d,v=t._chartOption.getRectByDimensionData,f=i.tooltipSpec,p={x:1/0,y:1/0};if(!f)return p;var g,y=i.event,m=e.activeType,_=e.data,b="dimension"===m?null===(a=null===(r=_[0])||void 0===r?void 0:r.data)||void 0===a?void 0:a[0]:null==_?void 0:_[0],k=t._option,x=k.offsetX,S=k.offsetY,C=f[m],w=FU(null==C?void 0:C.position,_,i),E=null!==(o=FU(null==C?void 0:C.positionMode,_,i))&&void 0!==o?o:"mark"===m?"mark":"pointer",B=null!=n?n:{},P=B.width,O=void 0===P?0:P,I=B.height,R=void 0===I?0:I,D="canvas"===f.renderMode,z=null===(s=null==i?void 0:i.chart)||void 0===s?void 0:s.getCanvasRect(),j=null!==(l=null==z?void 0:z.width)&&void 0!==l?l:vj,H=null!==(u=null==z?void 0:z.height)&&void 0!==u?u:fj,N=!1,U={width:0,height:0},V={x:0,y:0},W={x:0,y:0},G=1,Y=1,K=GS(t._env);if(K&&!f.confine?(U.width=window.innerWidth,U.height=window.innerHeight):(U.width=j,U.height=H),K&&!D){var X=t._getParentElement(f);W=null!==(c=null===(h=null==X?void 0:X.getBoundingClientRect)||void 0===h?void 0:h.call(X))&&void 0!==c?c:p;var q=null!==(d=t._compiler.getCanvas())&&void 0!==d?d:t._chartContainer;g=null==q?void 0:q.getBoundingClientRect(),V={x:g.x-W.x,y:g.y-W.y},G=H3(q,g),Y=H3(X,W)}var Z=Y/G,J={},Q={x:w,y:w},$={x:["left","right"],y:["top","bottom"]},tt=function(t,e){var n,r,a,o=t.orient,s=t.mode,l=t.offset,u=i.model,h=null==u?void 0:u.getLayoutStartPoint(),c=null!=l?l:"x"===e?x:S;if("mark"===s){N=!0;var d=i.item,f=null==d?void 0:d.AABBBounds;f&&h&&(r=("x"===e?f.x1:f.y1)+h[e],a=("x"===e?f.x2:f.y2)+h[e])}else if(v&&"crosshair"===s&&"cartesian"===(null===(n=null==b?void 0:b.series)||void 0===n?void 0:n.coordinate)&&b.datum&&b.datum.length){N=!0;var p=v(b,h);p&&(r=p.start[e],a=p.end[e])}else Q[e]=o;if(N){var g=$[e][0],y="x"===e?O:R;switch(W3(o,e)){case-2:J[g]=r-y*Z-c;break;case-1.5:J[g]=r+c;break;case 0:J[g]=(r+a)/2-y*Z/2;break;case-1:J[g]=(r+a)/2-y*Z-c;break;case 1:J[g]=(r+a)/2+c;break;case 1.5:J[g]=a-y*Z-c;break;case 2:J[g]=a+c}}},et=["x","y"];if(T(w))if(function(t){return T(t)&&(M(t.left)||M(t.right)||M(t.top)||M(t.bottom))}(w)){var it=w.left,nt=w.right,rt=w.top,at=w.bottom;J.left=U3(it,y),J.top=U3(rt,y),J.right=U3(nt,y),J.bottom=U3(at,y)}else(function(t){return T(t)&&(M(t.x)||M(t.y))})(w)&&et.forEach((function(t){var e=w[t];L(e)||A(e)?J[$[t][0]]=U3(e,y):tt(e,t)}));else M(w)&&(tt({orient:w,mode:E},"x"),tt({orient:w,mode:E},"y"));var ot={x:null,y:null};return et.forEach((function(t){var e,i="x"===t?O:R,n="x"===t?j:H,r="x"===t?x:S,a=W3(Q[t],t);if(F(J[$[t][0]]))ot[t]=J[$[t][0]];else if(F(J[$[t][1]]))ot[t]=n-i*Z-J[$[t][1]];else{var o="x"===t?y.canvasX:y.canvasY;ot[t]=a>0?o+r:0===a?o-i*Z/2:o-i*Z-r}ot[t]*=G,K&&(ot[t]+=V[t]),ot[t]/=Y;var s="x"===t?U.width:U.height,l=f.confine?-(W[t]-(null!==(e=null==g?void 0:g[t])&&void 0!==e?e:0)/G)/Y:-W[t]/Y,u=s/Y+l-i;2!==a&&ot[t]<l?N?ot[t]=l:(ot[t]+=0===a?r+i/2:2*r+i,ot[t]>u&&(ot[t]=u)):-2!==a&&ot[t]>u&&(N?ot[t]=u:(ot[t]-=0===a?r+i/2:2*r+i,ot[t]<l&&(ot[t]=l)))})),ot},t}return h(e,t),a(e,[{key:"env",get:function(){return this._env}},{key:"onAdd",value:function(t){_(e,"onAdd",this,3)([t]);var i=t.component;this._component=i,this._chartOption=i.getOption(),this._env=this._chartOption.mode,this._chartContainer=this._chartOption.globalInstance.getContainer(),this._compiler=i.getCompiler(),this._initFromSpec()}},{key:"hideTooltip",value:function(t){return this.changeTooltip(!1,t)}},{key:"release",value:function(){var t,e,i,n,r=null!==(e=null===(t=this._component)||void 0===t?void 0:t.getSpec())&&void 0!==e?e:{};r.handler?null===(n=(i=r.handler).release)||void 0===n||n.call(i):(this._removeTooltip(),this._isReleased=!0,this._chartOption=null,this._component=null)}},{key:"_getDefaultOption",value:function(){var t,e,i=this._component.getSpec().offset;return i?{offsetX:null!==(t=i.x)&&void 0!==t?t:F3.offsetX,offsetY:null!==(e=i.y)&&void 0!==e?e:F3.offsetY}:F3}},{key:"_getParentElement",value:function(t){return t.parentElement}},{key:"getTooltipContainer",value:function(){return this._container}},{key:"_initFromSpec",value:function(){this._option=this._getDefaultOption()}},{key:"reInit",value:function(){this._initFromSpec()}}])}(lW);G3.specKey="tooltip";var Y3=function(t,e){return M(t)?O(t)?t.map((function(t){return"".concat(t,"px")})).join(" "):"".concat(t,"px"):null!=e?e:"initial"},K3=function(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};M(i.fontFamily)&&(n.fontFamily=i.fontFamily);var r=null!==(t=i.fill)&&void 0!==t?t:i.fontColor;return M(r)&&(n.color=r),M(i.fontWeight)&&(n.fontWeight=i.fontWeight),M(i.textAlign)&&(n.textAlign=i.textAlign),M(i.fontSize)&&(n.fontSize=Y3(i.fontSize)),M(i.maxWidth)&&(n.maxWidth=Y3(i.maxWidth)),i.multiLine||M(i.maxWidth)&&!1!==i.multiLine?(n.whiteSpace="initial",n.wordBreak=null!==(e=i.wordBreak)&&void 0!==e?e:"break-word"):(n.wordBreak="normal",n.whiteSpace="nowrap"),n},X3=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.lineHeight;return t.fontSize?wz(e,t.fontSize):0},q3=function(t){var e,i=t.backgroundColor,n=t.border,r=t.shadow,a=t.padding,o={borderWidth:"".concat(null!==(e=null==n?void 0:n.width)&&void 0!==e?e:0,"px")},s=null;(null==n?void 0:n.color)&&(o.borderColor=n.color),i&&(o.backgroundColor=i),o.boxShadow=r?"".concat(r.x,"px ").concat(r.y,"px ").concat(r.blur,"px ").concat(r.spread,"px ").concat(r.color):"initial";var l=(null!=n?n:{}).radius;return M(l)&&(o.borderRadius=F(l)?"".concat(l,"px"):"".concat(l)),M(a)&&(s=bi(a),o.padding=Y3(s)),{panelStyle:o,panelPadding:s}};function Z3(t,e){t&&t.style&&e&&Object.keys(e).forEach((function(i){t.style[i]=e[i]}))}var J3=function(t){function e(){var t;return n(this,e),(t=i(this,e,[e.type])).type=uY.dom,t._tooltipContainer=null==WS?void 0:WS.body,t}return h(e,t),a(e,[{key:"getVisibility",value:function(){return!!this._rootDom&&"visible"===this._rootDom.style.visibility}},{key:"setVisibility",value:function(t){t!==this.getVisibility()&&this._rootDom&&(this._rootDom.style.visibility=t?"visible":"hidden")}},{key:"getRootDom",value:function(){return this._rootDom}},{key:"onAdd",value:function(t){_(e,"onAdd",this,3)([t]),this._initStyle(),this.initEl()}},{key:"initEl",value:function(){var t=this._component.getSpec().parentElement;if(WS&&t&&t.children&&t.children.length){for(var e=0;e<t.children.length;e++)if(t.children[e].classList.contains(R3)){this._container=t.children[e];break}this._container||(this._container=WS.createElement("div"),this._container.style.position="relative",this._container.style.zIndex=z3,this._container.classList.add(R3),t.appendChild(this._container))}}},{key:"initRootDom",value:function(){var t,e=this._component.getSpec(),i=document.createElement("div"),n=null===(t=this._chartOption)||void 0===t?void 0:t.getTheme("fontFamily");Z3(i,Object.assign({left:"0",top:"0",pointerEvents:"none",padding:"12px",position:"absolute",zIndex:z3,fontFamily:null!=n?n:Fz.fontFamily,fontSize:"11px",borderRadius:"3px",borderStyle:"solid",lineHeight:"initial",background:"#fff",boxShadow:"2px 2px 4px rgba(0, 0, 0, 0.1)",maxWidth:"100wh",maxHeight:"100vh",visibility:"hidden"},this._domStyle.panel)),i.classList.add(e.className),i.setAttribute("vchart-tooltip-id","".concat(this.id)),this._container.appendChild(i),this._rootDom=i}},{key:"_getTooltipBoxSize",value:function(t,e){var i;this._rootDom||this.initRootDom(),e||this._updateDomStringByCol(t),this._updateDomStyle("height",e);var n=null===(i=this._rootDom)||void 0===i?void 0:i.getBoundingClientRect();return{width:null==n?void 0:n.width,height:null==n?void 0:n.height}}},{key:"_removeTooltip",value:function(){this._rootDom&&this._rootDom.parentNode&&(this._rootDom.parentNode.removeChild(this._rootDom),this._rootDom=null),this._container=null}},{key:"_updateTooltip",value:function(t,e){var i,n;if(t&&this._rootDom){var r=e.tooltipSpec,a=e.activeTooltipSpec;e.changePositionOnly||(this._tooltipActual=a);var o=this._rootDom;if(o){var s=null!==(i=a.position)&&void 0!==i?i:{},l=s.x,u=void 0===l?0:l,h=s.y,c=void 0===h?0:h,d={x:u,y:c},v=this.getVisibility();r.updateElement&&(this._updatePosition(null!==(n=this._cacheCustomTooltipPosition)&&void 0!==n?n:{x:u,y:c}),r.updateElement(o,a,e),d=this._getActualTooltipPosition(a,e,{width:o.offsetWidth,height:o.offsetHeight}),this._cacheCustomTooltipPosition=d),!v&&t&&(this._rootDom.style.transition="none",this._updatePosition(d,!1),this._rootDom.getBoundingClientRect()),this._updatePosition(d)}this.setVisibility(t)}else this.setVisibility(t),this._cacheCustomTooltipPosition=void 0}},{key:"_initStyle",value:function(){var t=this._component.getSpec();this._domStyle=function(){var t,e,i,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=r.style,o=void 0===a?{}:a,s=r.enterable,l=r.transitionDuration,u=o.panel,h=void 0===u?{}:u,c=o.titleLabel,d=o.shape,v=o.keyLabel,f=o.valueLabel,p=o.spaceRow,g=o.align,y=q3(h),m=y.panelStyle,_=y.panelPadding,b={marginTop:"0px",marginBottom:"0px"};m.pointerEvents=s?"auto":"none",l&&(m.transitionDuration=l?"".concat(l,"ms"):"initial",m.transitionProperty=l?"transform":"initial",m.transitionTimingFunction=l?"ease-out":"initial"),F(p)&&(b.marginBottom="".concat(p,"px"));var k={width:Y3(null!==(t=null==d?void 0:d.size)&&void 0!==t?t:8)},x=K3(c),S=K3(v),A=K3(f),M="right"===g?"marginLeft":"marginRight";"right"===g&&(m.direction="rtl"),C(x.textAlign)&&(x.textAlign="right"===g?"right":"left"),C(S.textAlign)&&(S.textAlign="right"===g?"right":"left"),C(A.textAlign)&&(A.textAlign="right"===g?"left":"right"),k[M]=Y3(null!==(e=d.spacing)&&void 0!==e?e:8),S[M]=Y3(null!==(i=v.spacing)&&void 0!==i?i:26),A[M]=Y3(null!==(n=f.spacing)&&void 0!==n?n:0);var T=Math.max(X3(f),X3(v));return b.lineHeight=T>0?"".concat(T,"px"):"20px",{panelPadding:_,row:b,panel:m,title:x,shape:k,key:S,value:A}}(t)}},{key:"_updateDomStringByCol",value:function(t){var e,i=this,n=t.title,r=void 0===n?{}:n,a=t.content,o=a&&a.length,s=this._domStyle.row,l=b(this._rootDom.children),u=l.find((function(t){return t.className.includes(L3)})),h=l.find((function(t){return t.className.includes(D3)}));if(!u&&!1!==r.visible){u=document.createElement("h2");var c=document.createElement("span");u.appendChild(c),u.classList.add(L3),this._rootDom.firstChild?this._rootDom.insertBefore(u,this._rootDom.firstChild):this._rootDom.appendChild(u)}u&&!1!==r.visible?(Z3(u,Object.assign(Object.assign(Object.assign({},this._domStyle.title),o?s:{marginBottom:"0px"}),{marginTop:"0px"})),u.firstChild.innerHTML="".concat(null!==(e=r.value)&&void 0!==e?e:"")):u&&!1===r.visible&&u.parentNode.removeChild(u);var d=["shape","key","value"];if(!h&&o&&(h=document.createElement("div"),d.forEach((function(t){var e=document.createElement("div");e.classList.add("".concat(I3,"-column")),e.classList.add("".concat(I3,"-").concat(t,"-column")),e.setAttribute("data-col",t),h.appendChild(e)})),h.classList.add(D3),this._rootDom.appendChild(h)),h&&o){var v=b(h.children);Z3(h,{whiteSpace:"nowrap"}),v.forEach((function(t,e){var n=t.getAttribute("data-col");if(n&&d.includes(n)){var r="shape"===n&&a.every((function(t){return!t.hasShape||!t.shapeType}));Z3(t,Object.assign(Object.assign({},i._domStyle[n]),{display:r?"none":"inline-block",verticalAlign:"top"}));var o=b(t.children);o.slice(a.length).forEach((function(t){t.parentNode.removeChild(t)})),a.forEach((function(e,r){var l=o[r];l||((l=document.createElement("div")).classList.add("".concat(I3,"-").concat(n)),t.appendChild(l));var u=Object.assign({},s);r===a.length-1&&(u.marginBottom="0px"),u.display=!1===e.visible?"none":"block",u.height="initial","key"===n?(l.innerHTML=N3(e.key),e.keyStyle&&K3(e.keyStyle,u)):"value"===n?(l.innerHTML=N3(e.value),e.valueStyle&&K3(e.valueStyle,u)):"shape"===n&&(l.innerHTML=function(t,e){var i,n,r,a,o,s;if(!t||!t.hasShape||!t.shapeType)return"";var l,u,h='style="display:inline-block;vertical-align:middle;"',c=t.shapeType,d=t.shapeStroke,v=t.shapeHollow,f=void 0!==v&&v,p=t.shapeFill,g=null!==(i=t.shapeSize)&&void 0!==i?i:8,y=t.shapeLineWidth?j3(t.shapeLineWidth)+"px":"0px",_="currentColor",b=function(){return d?j3(d):_},k=g,x=function(t){return new Pf({symbolType:t,size:k,fill:!0})},S=x(c),A=S.getParsedPath();if(!A.path&&A.pathStr&&(S=x(A.pathStr)),S.getParsedPath().path){var C=S.getParsedPath().path;u=C.toString(),l=C.bounds}else A.isSvg&&A.svgCache&&(u=A.svgCache.map((function(t){return t.path.toString()})).join(),l=A.svgCache.reduce((function(t,e){return t.union(e.path.bounds)}),new ei));var M="".concat(l.x1," ").concat(l.y1," ").concat(l.width()," ").concat(l.height());if("0px"!==y){var w=M.split(" ").map((function(t){return Number(t)})),E=m(w,4),B=E[0],O=E[1],I=E[2],R=E[3],L=Number(y.slice(0,-2));M="".concat(B-L/2," ").concat(O-L/2," ").concat(I+L," ").concat(R+L)}var D=yd.IsGradientStr(p);if(!p||P(p)&&!D||f)return _=f?"none":p?j3(p):"currentColor","\n <svg ".concat(h,' width="').concat(g,'" height="').concat(g,'" viewBox="').concat(M,'">\n <path\n d="').concat(u,'"\n style="fill: ').concat(_,"; stroke: ").concat(b(),"; stroke-width: ").concat(y,'"\n >\n </path>\n </svg>');var F=D?yd.Parse(p):T(p)?p:null;if(F){_="gradientColor"+(null!=e?e:"");var z="",j=(null!==(n=F.stops)&&void 0!==n?n:[]).map((function(t){return'<stop offset="'.concat(j3(t.offset.toString()),'" stop-color="').concat(j3(t.color),'"/>')})).join("");return"radial"===F.gradient?z='<radialGradient id="'.concat(_,'" cx="50%" cy="50%" r="50%" fx="0%" fy="0%">\n ').concat(j,"\n </radialGradient>"):"linear"===F.gradient&&(z='<linearGradient id="'.concat(_,'" x1="').concat(100*(null!==(r=F.x0)&&void 0!==r?r:0),'%" y1="').concat(100*(null!==(a=F.y0)&&void 0!==a?a:0),'%" x2="').concat(100*(null!==(o=F.x1)&&void 0!==o?o:0),'%" y2="').concat(100*(null!==(s=F.y1)&&void 0!==s?s:0),'%">\n ').concat(j,"\n </linearGradient>")),"\n <svg ".concat(h,' width="').concat(g,'" height="').concat(g,'" viewBox="-0.5 -0.5 1 1">\n ').concat(z,'\n <path\n d="').concat(u,'"\n style="fill: url(#').concat(_,"); stroke: ").concat(b(),"; stroke-width: ").concat(y,'"\n >\n </path>\n </svg>')}return""}(e,"".concat(i.id,"_").concat(r))),Z3(l,u)}))}}))}else h&&!o&&h.parentNode.removeChild(h)}},{key:"_updateDomStyle",value:function(){var t,e,i,n,r,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"width",o=arguments.length>1?arguments[1]:void 0,s=this._rootDom,l=b(s.children).find((function(t){return t.className.includes(D3)})),u=b(s.children).find((function(t){return t.className.includes(L3)}));if(l){var h=this._component.getSpec(),c={},d=null===(t=h.style)||void 0===t?void 0:t.titleLabel;if(d&&d.autoWidth&&!1!==d.multiLine&&u){var v=b(l.children).reduce((function(t,e){return"height"===a?t+e.getBoundingClientRect().width:Math.max(t,e.getBoundingClientRect().width)}),0);v>0&&(u.style.maxWidth="".concat(v,"px"),u.style.maxWidth="".concat(Math.ceil(l.getBoundingClientRect().width),"px"))}if(M(null===(e=null==h?void 0:h.style)||void 0===e?void 0:e.maxContentHeight)){var f=u&&u.className.includes(L3)?u.getBoundingClientRect().height+(null!==(i=h.style.spaceRow)&&void 0!==i?i:0):0,p=this._chartOption.getChartViewRect(),g=wz(h.style.maxContentHeight,Math.min(p.height,document.body.clientHeight)-f-(this._domStyle.panelPadding?this._domStyle.panelPadding[0]+this._domStyle.panelPadding[1]:0));g>0&&(c.maxHeight="".concat(g,"px"),c.overflowY="auto",c.width="calc(100% + ".concat(this._domStyle.panelPadding?this._domStyle.panelPadding[1]+"px":"10px",")"),Z3(l,c))}var y=l.children,m=[];if(y){for(var _=0;_<y.length;_++)for(var k=null!==(n=y[_].children)&&void 0!==n?n:[],x=0;x<k.length;x++){o&&(k[x].style[a]="initial");var S=k[x].getBoundingClientRect()[a];(void 0===m[x]||m[x]<S)&&(m[x]=S)}for(var A=0;A<y.length;A++)for(var C=null!==(r=y[A].children)&&void 0!==r?r:[],T=0;T<C.length;T++)C[T].style[a]="".concat(m[T],"px")}}}},{key:"_getParentElement",value:function(t){var i;return null!==(i=this._container)&&void 0!==i?i:_(e,"_getParentElement",this,3)([t])}},{key:"isTooltipShown",value:function(){return this.getVisibility()}},{key:"reInit",value:function(){_(e,"reInit",this,3)([]),this._initStyle(),this._rootDom&&Z3(this._rootDom,this._domStyle.panel),this.getVisibility()&&(this._updateDomStringByCol(this._tooltipActual),this._updateDomStyle("height",!1))}},{key:"_updatePosition",value:function(t){var e=t.x,i=t.y,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._rootDom&&(this._rootDom.style.transform="translate3d(".concat(e,"px, ").concat(i,"px, 0)"),n&&""!==this._rootDom.style.transition&&(this._rootDom.style.transition="",Object.assign(this._rootDom.style,this._domStyle.panel)))}}])}(G3);J3.type=uY.dom;var Q3={fontFamily:Fz.fontFamily,spacing:10,wordBreak:"break-word"},$3=function(t,e){var i,n,r;"rich"!==(null==t?void 0:t.type)&&"html"!==(null==t?void 0:t.type)?(t=(null!=t?t:"").toString(),n=e.multiLine?(n=t.split("\n")).map((function(t,e){return e<n.length-1?t+"\n":t})):[t],r=n.map((function(t){return Object.assign(Object.assign({},e),{text:t})}))):(r=t.text,n=t);var a=$p({wordBreak:null!==(i=e.wordBreak)&&void 0!==i?i:"break-word",maxWidth:e.maxWidth?e.maxWidth:void 0,width:0,height:0,textConfig:r});return{width:a.width(),height:a.height(),text:n}};function t5(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;return Object.assign(Object.assign({},null!=r?r:Q3),{fill:null!==(t=i.fill)&&void 0!==t?t:i.fontColor,textAlign:i.textAlign,textBaseline:i.textBaseline,fontFamily:null!==(e=i.fontFamily)&&void 0!==e?e:n,fontSize:i.fontSize,fontWeight:i.fontWeight,lineHeight:i.lineHeight,spacing:i.spacing,multiLine:M(i.maxWidth)?!1!==i.multiLine:i.multiLine,maxWidth:i.maxWidth,wordBreak:i.wordBreak,autoWidth:i.autoWidth})}var e5=function(t){var e,i=t.backgroundColor,n=t.border,r=t.shadow,a={lineWidth:null!==(e=null==n?void 0:n.width)&&void 0!==e?e:0,shadow:!!r};(null==n?void 0:n.color)&&(a.stroke=n.color),i&&(a.fill=i),r&&(a.shadowColor=r.color,a.shadowBlur=r.blur,a.shadowOffsetX=r.x,a.shadowOffsetY=r.y,a.shadowSpread=r.spread);var o=(null!=n?n:{}).radius;return M(o)&&(a.cornerRadius=[o,o,o,o]),a},i5=function(t){function e(){var t;return n(this,e),(t=i(this,e,[e.type])).type=uY.canvas,t._attributes=null,t}return h(e,t),a(e,[{key:"onAdd",value:function(t){var i;_(e,"onAdd",this,3)([t]),this._tooltipCanvasId=null===(i=this._chartOption.modeParams)||void 0===i?void 0:i.tooltipCanvasId}},{key:"_initTooltipComponent",value:function(t){var e=this._getLayer(t);this._tooltipComponent=new WF({autoCalculatePosition:!1,autoMeasure:!1}),e.add(this._tooltipComponent)}},{key:"_getLayer",value:function(t){if(this._layer)return this._layer;this._layer=t.createLayer(this._tooltipCanvasId);var e=this._layer.layerHandler.canvas.nativeCanvas;return e&&e.style&&(e.style.touchAction="none",e.style.pointerEvents="none"),this._layer}},{key:"_getTooltipBoxSize",value:function(t,e){var i,n;if(!e||C(this._attributes)){var r=null===(i=this._chartOption)||void 0===i?void 0:i.getTheme("fontFamily");this._attributes=function(t,e,i){var n,r,a,o,s,l=e.style,u=void 0===l?{}:l,h=e.enterable,c=e.transitionDuration,d=u.panel,v=void 0===d?{}:d,f=u.titleLabel,p=u.shape,g=u.keyLabel,y=u.valueLabel,m=u.spaceRow,_=u.align,b=bi(v.padding),k=Pz(v.padding),x=t5(Object.assign({textAlign:"right"===_?"right":"left"},f),i),S=t5(Object.assign({textAlign:"right"===_?"right":"left"},g),i),A=t5(y,i),C={fill:!0,size:null!==(n=null==p?void 0:p.size)&&void 0!==n?n:8,spacing:null!==(r=null==p?void 0:p.spacing)&&void 0!==r?r:6},T={panel:e5(v),padding:b,title:{},content:[],titleStyle:{value:x,spaceRow:m},contentStyle:{shape:C,key:S,value:A,spaceRow:m},hasContentShape:!1,keyWidth:0,valueWidth:0,enterable:h,transitionDuration:c,align:_},w=t.title,E=void 0===w?{}:w,B=t.content,P=void 0===B?[]:B,O=k.left+k.right,I=k.top+k.bottom,R=0,L=!!P.length,D=0,F=0,z=0,j=0;if(L){var H=[],N=[],U=[],V=[],W=0;T.content=P.map((function(t,e){var i=0,n=t.hasShape,r=t.key,a=t.shapeType,o=void 0===a?"":a,s=t.shapeFill,l=t.shapeStroke,u=t.shapeLineWidth,h=t.shapeSize,c=t.value,d=t.isKeyAdaptive,v=t.spaceRow,f=t.keyStyle,p=t.valueStyle,g=t.shapeHollow,y={height:0,spaceRow:null!=v?v:m};if(M(r)){var _=Nz({},S,t5(f,void 0,{})),b=$3(r,_),k=b.width,x=b.height,T=b.text;y.key=Object.assign(Object.assign({width:k,height:x},_),{text:T}),d?N.push(k):H.push(k),i=Math.max(i,x)}if(M(c)){var w=Nz({},A,t5(p,void 0,{})),E=$3(c,w),B=E.width,O=E.height,I=E.text;y.value=Object.assign(Object.assign({width:B,height:O},w),{text:I}),U.push(B),i=Math.max(i,O)}if(n){var R={visible:!0,symbolType:o};g?R.stroke=s:R.fill=s,R.stroke=null!=l?l:s,R.lineWidth=u,y.shape=R;var L=null!=h?h:C.size;i=Math.max(L,i),V.push(L)}else y.shape={visible:!1};return y.height=i,W+=i,e<P.length-1&&(W+=y.spaceRow),y})),I+=W,D=H.length?lt(H):0,F=N.length?lt(N):0,z=U.length?lt(U):0,j=V.length?lt(V)+C.spacing:0,R=Math.max(j+D+S.spacing+z+A.spacing,j+F,R),T.hasContentShape=!!V.length,T.keyWidth=D,T.valueWidth=z}var G=0,Y=0,K=0,X=E.visible,q=void 0===X||X,Z=E.value,J=void 0===Z?"":Z,Q=E.valueStyle,$=E.spaceRow;T.title.visible=q,T.title.spaceRow=null!=$?$:m;var tt={},et=function(){return tt.autoWidth&&!1!==tt.multiLine};if(q){tt=Nz({},x,t5(Q,void 0,{})),et()&&(tt.multiLine=null===(a=tt.multiLine)||void 0===a||a,tt.maxWidth=null!==(o=tt.maxWidth)&&void 0!==o?o:L?Math.ceil(R):void 0);var it=$3(J,tt),nt=it.text,rt=it.width,at=it.height;T.title.value=Object.assign(Object.assign({width:et()?Math.min(rt,null!==(s=tt.maxWidth)&&void 0!==s?s:Number.MAX_VALUE):rt,height:at},tt),{text:nt}),G=T.title.value.width,K=(Y=T.title.value.height)+(L?T.title.spaceRow:0)}return I+=K,T.title.width=G,T.title.height=Y,et()?O+=R||G:O+=Math.max(G,R),L&&T.content.forEach((function(t){var e,i=t.value;i&&(null===(e=i.autoWidth)||void 0===e||e)&&(i.width=O-k.left-k.right-j-D-S.spacing-A.spacing,i.maxWidth||(i.maxWidth=Math.ceil(i.width)),T.valueWidth=Math.max(T.valueWidth,i.width))})),T.panel.width=O,T.panel.height=I,T}(t,this._component.getSpec(),r)}var a=(null!==(n=this._attributes)&&void 0!==n?n:{}).panel;return{width:a.width+a.lineWidth,height:a.height+a.lineWidth}}},{key:"_removeTooltip",value:function(){this._layer&&this._layer.removeAllChild(),this._attributes=null}},{key:"_updateTooltip",value:function(t,e){this._visible=t;var i=this._compiler.getStage();if(i)if(t){this._tooltipComponent||this._initTooltipComponent(i);var n=e.activeTooltipSpec.position;e.changePositionOnly?M(n)&&this._tooltipComponent.setAttributes(n):this._tooltipComponent.setAttributes(Object.assign(Object.assign({},this._attributes),n)),this._tooltipComponent.attribute.visible||(this._tooltipComponent.showAll(),this._tooltipComponent.setAttributes({visibleAll:!0}))}else this._tooltipComponent&&this._tooltipComponent.attribute.visible&&(this._tooltipComponent.hideAll(),this._tooltipComponent.setAttributes({visibleAll:!1}))}},{key:"isTooltipShown",value:function(){var t;return null===(t=this._tooltipComponent)||void 0===t?void 0:t.attribute.visibleAll}},{key:"release",value:function(){var t;_(e,"release",this,3)([]),null===(t=this._layer)||void 0===t||t.release()}}])}(G3);i5.type=uY.canvas;var n5=/\{([^}]+)\}/,r5=/\{([^}]+)\}/g,a5=/:/,o5=function(t){function e(){var t;return n(this,e),(t=i(this,e,[e.type])).type="formatterPlugin",t._timeModeFormat={utc:Oi.getInstance().timeUTCFormat,local:Oi.getInstance().timeFormat},t._formatter=t._format,t._timeFormatter=t._timeModeFormat.local,t._numericFormatter=ji.getInstance().format,t._numericSpecifier=ji.getInstance().formatter,t._numericFormatterCache=new Map,t._isNumericFormatterCache=new Map,t}return h(e,t),a(e,[{key:"onInit",value:function(t,i){var n;if(t.globalInstance){this._spec=null!==(n=null==i?void 0:i[e.specKey])&&void 0!==n?n:{};var r=this._spec,a=r.timeMode,o=r.customFormatter,s=r.numericFormatter,l=r.timeFormatter;A(o)?this._formatter=o:(this._formatter=this._format.bind(this),A(l)?this._timeFormatter=l:a&&this._timeModeFormat[a]&&(this._timeFormatter=this._timeModeFormat[a]),s&&(this._numericFormatter=s,this._numericSpecifier=null,this._numericFormatterCache=null)),Uz.registerFormatter(this._formatter)}}},{key:"_format",value:function(t,e,i){var n=this;return O(t)?t.map((function(t,r){var a=O(i)?i[r]:i;return a?n._formatSingleLine(t,e,a):t})):O(i)?i.map((function(i){return n._formatSingleLine(t,e,i)})):this._formatSingleLine(t,e,i)}},{key:"_formatSingleLine",value:function(t,e,i){var n,r=this;return this._isNumericFormatterCache&&(this._isNumericFormatterCache.get(i)?n=this._isNumericFormatterCache.get(i):(n=n5.test(i),this._isNumericFormatterCache.set(i,n))),n?i.replace(r5,(function(t,i){if(!a5.test(i)){var n=e[i.trim()];return void 0!==n?n:t}var a=i.split(":"),o=e[a.shift()],s=a.join(":");return r._formatSingleText(o,s)})):this._formatSingleText(t,i)}},{key:"_formatSingleText",value:function(t,e){var i;return Di.test(e)&&this._numericFormatter?this._numericFormatterCache&&this._numericSpecifier?(this._numericFormatterCache.get(e)?i=this._numericFormatterCache.get(e):(i=this._numericSpecifier(e),this._numericFormatterCache.set(e,i)),i(Number(t))):this._numericFormatter(e,Number(t)):e.includes("%")&&this._timeFormatter?this._timeFormatter(e,t):e.startsWith("calc(")?this._calcFormatter(e,t):t}},{key:"_calcFormatter",value:function(t,e){try{var i=t.slice(5,-1).replace(/v/g,String(e));return this._calculateMathExpression(i,e)}catch(t){return e}}},{key:"_calculateMathExpression",value:function(t,e){var i=t.replace(/\s+/g,"");if(!this._isValidMathExpression(i))return e;try{var n=new Function("return ("+i+")")();if("number"!=typeof n||isNaN(n)||!isFinite(n))throw new Error("Invalid calculation result");return n}catch(t){return e}}},{key:"_isValidMathExpression",value:function(t){return/^[0-9+\-*/().]+$/.test(t)}},{key:"release",value:function(){_(e,"release",this,3)([]),this._format=null,this._timeFormatter=null,this._numericFormatter=null,this._numericSpecifier=null,this._numericFormatterCache=null,this._isNumericFormatterCache=null}}])}(lW);o5.pluginType="chart",o5.specKey="formatter",o5.type="formatterPlugin",TU.useRegisters([function(){vY(),pY(),yY(),GG(),WG(),CG(),gG(),JV(),$V(),vU(),hU(),uG(),aG(),Uz.registerSeries(MG.type,MG),Uz.registerChart(mY.type,mY)},function(){vY(),pY(),yY(),WG(),CG(),gG(),JV(),kY(),$V(),AY(),uG(),aG(),Uz.registerSeries(MY.type,MY),GG(),Uz.registerChart(wY.type,wY)},function(){vY(),pY(),yY(),WG(),VY(),GG(),Uz.registerChart(GY.type,GY)},function(){vY(),pY(),GG(),WG(),iK(),Uz.registerChart(rK.type,rK)},function(){pY(),iq(),Uz.registerChart(l0.type,l0)},function(){vY(),pY(),GG(),WG(),kq(),Uz.registerChart(c0.type,c0)},function(){vY(),pY(),yY(),GG(),WG(),Bq(),Uz.registerChart(v0.type,v0)},function(){vY(),pY(),yY(),GG(),WG(),VY(),Uz.registerTransform("bin",ho),Uz.registerChart(_0.type,_0)},function(){pY(),mK(),uK(),Uz.registerSeries(bK.type,bK),Uz.registerImplement("registerMap",_H),Uz.registerImplement("unregisterMap",bH),cU(),Uz.registerChart(i0.type,i0)},function(){pY(),y$(),Uz.registerSeries(_$.type,_$),XX(),Xq(),yq(),Qq(),Uz.registerChart(S0.type,S0)},function(){pY(),UJ(),Uz.registerChart(M0.type,M0)},function(){pY(),hQ(),Uz.registerChart(w0.type,w0)},function(){vY(),pY(),yY(),GG(),WG(),JK(),Uz.registerChart(H0.type,H0)},function(){vY(),pY(),GG(),WG(),_X(),Uz.registerTransform("boxplot",co),Uz.registerChart(U0.type,U0)},function(){vY(),pY(),GG(),WG(),Qq(),Uz.registerChart(k0.type,k0)},function(){vY(),pY(),GG(),WG(),sZ(),Uz.registerChart(B0.type,B0)},function(){vY(),pY(),GG(),WG(),OX(),Uz.registerChart(O0.type,O0)},function(){vY(),pY(),yY(),GG(),WG(),kY(),uG(),aG(),Uz.registerSeries(LX.type,LX),Uz.registerChart(Y0.type,Y0)},function(){pY(),TQ(),Uz.registerChart(R0.type,R0)},function(){pY(),IQ(),Uz.registerChart(D0.type,D0)},function(){pY(),s$(),Uz.registerChart(z0.type,z0)},function(){pY(),Vw(),$Q(),Uz.registerChart(W0.type,W0)},function(){pY(),T$(),Uz.registerChart(X0.type,X0)},function(){pY(),U$(),Uz.registerChart(Z0.type,Z0)},function(){vY(),pY(),yY(),GG(),Uz.registerChart(p0.type,p0),WG()},aG,uG,function(){Uz.registerGraphicComponent(OW.lineAxis,(function(t,e){return new xI(t,e)})),Uz.registerGraphicComponent(IW.lineAxisGrid,(function(t,e){return new RL(t,e)})),UW(),Uz.registerComponent(hG.type,hG)},function(){Uz.registerGraphicComponent(OW.lineAxis,(function(t,e){return new xI(t,e)})),Uz.registerGraphicComponent(IW.lineAxisGrid,(function(t,e){return new RL(t,e)})),UW(),Uz.registerComponent(cG.type,cG)},function(){Uz.registerGraphicComponent(OW.lineAxis,(function(t,e){return new xI(t,e)})),Uz.registerGraphicComponent(IW.lineAxisGrid,(function(t,e){return new RL(t,e)})),UW(),Uz.registerComponent(dG.type,dG)},_q,yq,function(){Uz.registerComponent(i1.type,i1)},function(){Uz.registerComponent(f1.type,f1)},function(){Uz.registerComponent(T1.type,T1)},function(){Uz.registerComponent(R1.type,R1)},function(){Uz.registerComponent(L1.type,L1)},function(){Uz.registerComponent(J1.type,J1)},function(){Uz.registerComponent(t2.type,t2)},function(){Uz.registerComponent(r2.type,r2)},mK,function(){Uz.registerComponent($2.type,$2),HD()},function(){Uz.registerComponent(r3.type,r3),UD()},function(){Uz.registerComponent(x3.type,x3),YD()},function(){Uz.registerComponent(t3.type,t3),WD._animate=kD,HD()},function(){Uz.registerComponent(a3.type,a3),GD._animate=SD,UD()},function(){Uz.registerComponent(S3.type,S3),YD()},function(){Uz.registerComponent(A3.type,A3),YD()},function(){Uz.registerComponent(e3.type,e3)},function(){Uz.registerComponent(d3.type,d3)},function(){Uz.registerGraphicComponent(y3.type,(function(t){return new BL(t)})),p3(),zW(),Uz.registerComponent(y3.type,y3,!0,1/0)},function(){Uz.registerGraphicComponent(m3.type,(function(t){return new BL(t)})),p3(),zW(),Uz.registerComponent(m3.type,m3,!0)},function(){Uz.registerComponent(w3.type,w3)},function(){Uz.registerComponent(B3.type,B3)},function(){OE()},function(){Uz.registerLayout(P3.type,P3)},function(){var t;t=i5,Uz.registerComponentPlugin(t.type,t)},function(){var t;t=o5,Uz.registerChartPlugin(t.type,t)},_U,xU]),TU.useRegisters([function(){tT(j_)}]),t.DEFAULT_CHART_HEIGHT=fj,t.DEFAULT_CHART_WIDTH=vj,t.DEFAULT_CLOSE_STROKE_JOIN=BU,t.DEFAULT_DATA_INDEX=gj,t.DEFAULT_DATA_KEY=yj,t.DEFAULT_DATA_SERIES_FIELD=mj,t.DEFAULT_KEY=Fj,t.DEFAULT_LAYOUT_RECT_LEVEL=0,t.DEFAULT_LAYOUT_RECT_LEVEL_MIN=-1,t.DEFAULT_LINEAR_INTERPOLATE=EU,t.DEFAULT_MAP_LOOK_UP_KEY=zj,t.DEFAULT_MEASURE_CANVAS_ID=pj,t.DEFAULT_SERIES_STYLE_NAME=_j,t.DEFAULT_SMOOTH_INTERPOLATE=wU,t.Factory=Uz,t.MOSAIC_CAT_END_PERCENT=Rj,t.MOSAIC_CAT_START_PERCENT=Ij,t.MOSAIC_VALUE_END_PERCENT=Oj,t.MOSAIC_VALUE_START_PERCENT=Pj,t.ManualTicker=function(t){function e(t){var r;return n(this,e),(r=i(this,e,[t])).lastFrameTime=0,r.status=Ul.RUNNING,r}return h(e,t),a(e,[{key:"setupTickHandler",value:function(){var t=new sP;return this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0}},{key:"checkSkip",value:function(t){return!1}},{key:"getTime",value:function(){return this.tickerHandler.getTime()}},{key:"tickAt",value:function(t){this.tickTo(t)}},{key:"start",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.status===Ul.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===Ul.PAUSE)return!1;if(this.ifCanStop())return!1}return this.status=Ul.RUNNING,!0}}])}(oP),t.PREFIX=dj,t.SEGMENT_FIELD_END=Dj,t.SEGMENT_FIELD_START=Lj,t.STACK_FIELD_END=xj,t.STACK_FIELD_END_OffsetSilhouette=Mj,t.STACK_FIELD_END_PERCENT=Aj,t.STACK_FIELD_KEY=bj,t.STACK_FIELD_START=kj,t.STACK_FIELD_START_OffsetSilhouette=Cj,t.STACK_FIELD_START_PERCENT=Sj,t.STACK_FIELD_TOTAL=Tj,t.STACK_FIELD_TOTAL_BOTTOM=Bj,t.STACK_FIELD_TOTAL_PERCENT=wj,t.STACK_FIELD_TOTAL_TOP=Ej,t.StreamLight=aI,t.ThemeManager=rj,t.USER_LAYOUT_RECT_LEVEL=9,t.VChart=TU,t.boundsInRect=Bz,t.builtinThemes=Kz,t.calcLayoutNumber=wz,t.calcPadding=Ez,t.computeActualDataScheme=dz,t.convertPoint=Oz,t.createArc=Mp,t.createArea=Sp,t.createGroup=Rp,t.createLine=Lf,t.createRect=jf,t.createRichText=yp,t.createSymbol=Of,t.createText=Mf,t.darkTheme=jz,t.dataScheme=Rz,t.default=TU,t.defaultThemeName=Xz,t.getActualColor=fz,t.getActualNumValue=Iz,t.getColorSchemeBySeries=mz,t.getDataScheme=cz,t.getFunnelTheme=Gz,t.getMergedTheme=ij,t.getSpecInfo=IU,t.getTheme=$z,t.hasThemeMerged=Jz,t.isColorKey=pz,t.isPercent=Mz,t.isPercentOffset=Tz,t.isProgressiveDataColorScheme=gz,t.isTokenKey=Dz,t.isValidOrient=Cz,t.lightTheme=zz,t.lookup=RU,t.measureText=cj,t.normalizeLayoutPaddingSpec=Pz,t.queryColorFromColorScheme=vz,t.queryToken=Lz,t.registerDataSetInstanceParser=pH,t.registerDataSetInstanceTransform=fH,t.registerTheme=Qz,t.removeTheme=tj,t.themeExist=ej,t.themes=qz,t.token=Fz,t.transformColorSchemeToStandardStruct=yz,t.transformToGraphic=tH,t.version="2.0.22",t.vglobal=z_,t.warn=HS,Object.defineProperty(t,"__esModule",{value:!0})})(C.exports);var M=A(C.exports);Component({properties:{styles:{type:String},canvasId:{type:String},spec:{type:Object,observer:function(t,e){this.chart&&JSON.stringify(t)!==JSON.stringify(e)&&this.chart.updateSpec(t)}},options:{type:Object,value:{}},events:{type:Object,value:[]}},data:{offscreenCanvasWidth:0,offscreenCanvasHeight:0,chart:void 0},detached:function(){this.chart&&this.chart.release()},ready:function(){var t=this;this.data.spec&&this.data.canvasId?(tt.onWindowResize((function(e){t.init()})),this.init()):console.warn("组件需绑定 spec 变量并且设置唯一 canvas-id")},methods:{init:function(){var t=this;tt.createSelectorQuery().in(this).select("#".concat(this.data.canvasId,"_draw_canvas")).boundingClientRect((function(e){if(e){t.setData({offscreenCanvasWidth:e.width,offscreenCanvasHeight:e.height}),t.chart&&t.chart.release();var i=new M(v(v({},t.data.spec),{},{width:e.width,height:e.height}),v({mode:"miniApp",modeParams:{domref:e,force:!0,canvasIdLists:["".concat(t.data.canvasId,"_draw_canvas"),"".concat(t.data.canvasId,"_tooltip_canvas"),"".concat(t.data.canvasId,"_hit_canvas")],tooltipCanvasId:"".concat(t.data.canvasId,"_tooltip_canvas"),freeCanvasIdx:2},dpr:tt.getSystemInfoSync().pixelRatio,renderCanvas:"".concat(t.data.canvasId,"_draw_canvas")},t.data.options));t.chart=i,t.triggerEvent("chartinit"),t.data.events&&t.data.events.forEach((function(t){t&&i.on(t.type,v(v({},t.query),{},{source:"chart"}),t.handler)})),i.renderAsync().then((function(e){t.triggerEvent("chartready")}))}else console.error("未找到 #".concat(t.data.canvasId," 组件"))})).exec()},bindEvent:function(t){var e=tt.getSystemInfoSync().brand;if(!("PC"===e&&t.type.startsWith("touch")||"PC"!==e&&t.type.startsWith("mouse"))){var i=this.chart;i&&(t.target=i.getCanvas(),i.getStage().window.dispatchEvent(t))}}}})}));
|