@visactor/vchart-extension 2.1.2-alpha.3 → 2.1.2-alpha.5

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.
Files changed (143) hide show
  1. package/build/index.js +6843 -5
  2. package/build/index.min.js +2 -2
  3. package/cjs/charts/3d/arc-3d.js +2 -2
  4. package/cjs/charts/3d/arc-3d.js.map +1 -1
  5. package/cjs/charts/axis-3d/index.js +1 -2
  6. package/cjs/charts/axis-3d/linear-axis.js +2 -1
  7. package/cjs/charts/bar-3d/chart-spec-transformer.js +1 -1
  8. package/cjs/charts/bar-3d/chart.js +1 -1
  9. package/cjs/charts/bar-3d/constant.js +1 -1
  10. package/cjs/charts/bar-3d/index.js +1 -1
  11. package/cjs/charts/bar-3d/interface.js +1 -1
  12. package/cjs/charts/bar-3d/series-spec-transformer.js +1 -1
  13. package/cjs/charts/bar-3d/series.js +1 -1
  14. package/cjs/charts/bar-3d/theme.js +1 -1
  15. package/cjs/charts/candlestick/candlestick-transformer.js +1 -1
  16. package/cjs/charts/candlestick/candlestick.js +2 -1
  17. package/cjs/charts/candlestick/index.js +1 -1
  18. package/cjs/charts/candlestick/interface.js +1 -1
  19. package/cjs/charts/candlestick/util.js +1 -1
  20. package/cjs/charts/combination-candlestick/combination-candlestick-transformer.js +1 -1
  21. package/cjs/charts/combination-candlestick/combination-candlestick.js +1 -1
  22. package/cjs/charts/combination-candlestick/constant.js +1 -1
  23. package/cjs/charts/combination-candlestick/index.js +1 -1
  24. package/cjs/charts/combination-candlestick/interface.js +1 -1
  25. package/cjs/charts/conversion-funnel/arrow-data-transform.js +1 -1
  26. package/cjs/charts/conversion-funnel/constants.js +1 -1
  27. package/cjs/charts/conversion-funnel/conversion-funnel-transformer.js +1 -1
  28. package/cjs/charts/conversion-funnel/conversion-funnel.js +1 -1
  29. package/cjs/charts/conversion-funnel/index.js +1 -1
  30. package/cjs/charts/conversion-funnel/interface.js +1 -1
  31. package/cjs/charts/conversion-funnel/util.js +1 -1
  32. package/cjs/charts/funnel-3d/chart.js +2 -1
  33. package/cjs/charts/funnel-3d/constant.js +1 -1
  34. package/cjs/charts/funnel-3d/index.js +1 -1
  35. package/cjs/charts/funnel-3d/interface.js +1 -1
  36. package/cjs/charts/funnel-3d/series-spec-transformer.js +1 -1
  37. package/cjs/charts/funnel-3d/series.js +1 -1
  38. package/cjs/charts/funnel-3d/theme.js +1 -1
  39. package/cjs/charts/histogram-3d/chart.js +1 -1
  40. package/cjs/components/bar-link/bar-link.js +1 -1
  41. package/cjs/components/bar-link/constant.js +1 -1
  42. package/cjs/components/bar-link/index.js +1 -1
  43. package/cjs/components/bar-link/type.js +1 -1
  44. package/cjs/components/bar-link/util.js +1 -1
  45. package/cjs/components/bar-regression-line/index.js +1 -1
  46. package/cjs/components/bar-regression-line/type.js +1 -1
  47. package/cjs/components/extension-mark-sync-state/extension-mark-sync-state.js +1 -1
  48. package/cjs/components/extension-mark-sync-state/index.js +1 -1
  49. package/cjs/components/extension-mark-sync-state/type.js +1 -1
  50. package/cjs/components/histogram-regression-line/index.js +1 -1
  51. package/cjs/components/histogram-regression-line/type.js +1 -2
  52. package/cjs/components/map-label/index.js +1 -1
  53. package/cjs/components/map-label/layout.js +1 -1
  54. package/cjs/components/map-label/map-label-transformer.js +1 -1
  55. package/cjs/components/map-label/map-label.js +1 -1
  56. package/cjs/components/map-label/theme.js +1 -1
  57. package/cjs/components/map-label/type.js +1 -1
  58. package/cjs/components/regression-line/index.js +1 -1
  59. package/cjs/components/regression-line/regression-line.js +1 -1
  60. package/cjs/components/regression-line/type.js +1 -1
  61. package/cjs/components/scatter-regression-line/index.js +1 -1
  62. package/cjs/components/scatter-regression-line/type.js +1 -1
  63. package/cjs/components/series-break/constant.js +1 -1
  64. package/cjs/components/series-break/index.js +1 -1
  65. package/cjs/components/series-break/series-break.js +1 -1
  66. package/cjs/components/series-break/type.js +1 -1
  67. package/cjs/components/series-break/util.js +1 -2
  68. package/cjs/components/series-label/constant.js +1 -1
  69. package/cjs/components/series-label/index.js +1 -1
  70. package/cjs/components/series-label/series-label.js +1 -1
  71. package/cjs/components/series-label/type.js +1 -1
  72. package/cjs/components/series-label/util.js +1 -1
  73. package/esm/charts/3d/arc-3d.js +3 -1
  74. package/esm/charts/3d/arc-3d.js.map +1 -1
  75. package/esm/charts/axis-3d/index.js +1 -2
  76. package/esm/charts/axis-3d/linear-axis.js +2 -1
  77. package/esm/charts/bar-3d/chart-spec-transformer.js +1 -1
  78. package/esm/charts/bar-3d/chart.js +1 -1
  79. package/esm/charts/bar-3d/constant.js +1 -1
  80. package/esm/charts/bar-3d/index.js +1 -1
  81. package/esm/charts/bar-3d/interface.js +1 -1
  82. package/esm/charts/bar-3d/series-spec-transformer.js +1 -1
  83. package/esm/charts/bar-3d/series.js +1 -1
  84. package/esm/charts/bar-3d/theme.js +1 -1
  85. package/esm/charts/candlestick/candlestick-transformer.js +1 -1
  86. package/esm/charts/candlestick/candlestick.js +2 -1
  87. package/esm/charts/candlestick/index.js +1 -1
  88. package/esm/charts/candlestick/interface.js +1 -1
  89. package/esm/charts/candlestick/util.js +1 -1
  90. package/esm/charts/combination-candlestick/combination-candlestick-transformer.js +1 -1
  91. package/esm/charts/combination-candlestick/combination-candlestick.js +1 -1
  92. package/esm/charts/combination-candlestick/constant.js +1 -1
  93. package/esm/charts/combination-candlestick/index.js +1 -1
  94. package/esm/charts/combination-candlestick/interface.js +1 -1
  95. package/esm/charts/conversion-funnel/arrow-data-transform.js +1 -1
  96. package/esm/charts/conversion-funnel/constants.js +1 -1
  97. package/esm/charts/conversion-funnel/conversion-funnel-transformer.js +1 -1
  98. package/esm/charts/conversion-funnel/conversion-funnel.js +1 -1
  99. package/esm/charts/conversion-funnel/index.js +1 -1
  100. package/esm/charts/conversion-funnel/interface.js +1 -1
  101. package/esm/charts/conversion-funnel/util.js +1 -1
  102. package/esm/charts/funnel-3d/chart.js +2 -1
  103. package/esm/charts/funnel-3d/constant.js +1 -1
  104. package/esm/charts/funnel-3d/index.js +1 -1
  105. package/esm/charts/funnel-3d/interface.js +1 -1
  106. package/esm/charts/funnel-3d/series-spec-transformer.js +1 -1
  107. package/esm/charts/funnel-3d/series.js +1 -1
  108. package/esm/charts/funnel-3d/theme.js +1 -1
  109. package/esm/charts/histogram-3d/chart.js +1 -1
  110. package/esm/components/bar-link/bar-link.js +1 -1
  111. package/esm/components/bar-link/constant.js +1 -1
  112. package/esm/components/bar-link/index.js +1 -1
  113. package/esm/components/bar-link/type.js +1 -1
  114. package/esm/components/bar-link/util.js +1 -1
  115. package/esm/components/bar-regression-line/index.js +1 -1
  116. package/esm/components/bar-regression-line/type.js +1 -1
  117. package/esm/components/extension-mark-sync-state/extension-mark-sync-state.js +1 -1
  118. package/esm/components/extension-mark-sync-state/index.js +1 -1
  119. package/esm/components/extension-mark-sync-state/type.js +1 -1
  120. package/esm/components/histogram-regression-line/index.js +1 -1
  121. package/esm/components/histogram-regression-line/type.js +1 -2
  122. package/esm/components/map-label/index.js +1 -1
  123. package/esm/components/map-label/layout.js +1 -1
  124. package/esm/components/map-label/map-label-transformer.js +1 -1
  125. package/esm/components/map-label/map-label.js +1 -1
  126. package/esm/components/map-label/theme.js +1 -1
  127. package/esm/components/map-label/type.js +1 -1
  128. package/esm/components/regression-line/index.js +1 -1
  129. package/esm/components/regression-line/regression-line.js +1 -1
  130. package/esm/components/regression-line/type.js +1 -1
  131. package/esm/components/scatter-regression-line/index.js +1 -1
  132. package/esm/components/scatter-regression-line/type.js +1 -1
  133. package/esm/components/series-break/constant.js +1 -1
  134. package/esm/components/series-break/index.js +1 -1
  135. package/esm/components/series-break/series-break.js +1 -1
  136. package/esm/components/series-break/type.js +1 -1
  137. package/esm/components/series-break/util.js +1 -2
  138. package/esm/components/series-label/constant.js +1 -1
  139. package/esm/components/series-label/index.js +1 -1
  140. package/esm/components/series-label/series-label.js +1 -1
  141. package/esm/components/series-label/type.js +1 -1
  142. package/esm/components/series-label/util.js +1 -1
  143. package/package.json +8 -8
@@ -1,4 +1,4 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@visactor/vchart"),require("@visactor/vutils")):"function"==typeof define&&define.amd?define(["exports","@visactor/vchart","@visactor/vutils"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VChartExtension={},e.VChart,e.VUtils)}(this,(function(e,t,i){"use strict";class r extends t.BaseChartSpecTransformer{transformSpec(e){const{timeData:i,timeNodes:r}=function(e){const{xField:i,yField:r,timeField:a,data:s,topN:n=10,icon:o}=e,l=new Set,d=new Map;return s.sort(((e,t)=>Number(t[i])-Number(e[i]))),s.forEach((e=>{const i=e[a];t.isValid(i)&&l.add(i),d.has(i)||d.set(i,[]);const s=d.get(i);if(s.length<n){const t=Object.assign({},e);o&&o[t[r]]&&(t.icon=o[t[r]]),s.push(t)}})),{timeData:d,timeNodes:Array.from(l).sort()}}(e),{interval:n,xField:o,yField:l,color:d,icon:c,iconPosition:u,iconShape:h,timeLabel:g,label:p,nameLabel:m,xAxis:y,yAxis:v}=e,f=n||1e3,b=Math.min(f,500);if(e.type="common",e.data=[{id:"timeData",values:i.get(r[0])},{id:"time",values:[{time:r[0]}]}],e.color={specified:Object.assign({},d)},e.region=[{clip:!0}],e.series=[{type:"bar",id:"ranking-bar",dataId:"timeData",direction:"horizontal",yField:l,xField:o,seriesField:l,extensionMark:[],label:a(p,Object.assign(Object.assign({},m),{yField:l}))}],e.axes=function(e={},t={}){const i={orient:"left",type:"band",inverse:!0,label:{style:t.label},domainLine:{style:t.domainLine},grid:{style:t.grid}},r={orient:"bottom",type:"linear",nice:!1,animation:!0,label:{style:e.label},domainLine:{style:e.domainLine},grid:{style:e.grid},innerOffset:{right:"10%"}};e.label&&(r.label=e.label);return[i,r]}(y,v),e.player={type:"continuous",auto:!0,loop:!1,interval:f,specs:r.map((e=>({data:[{id:"timeData",values:i.get(e)},{id:"time",values:[{time:e}]}]})))},e.tooltip={visible:!1},e.customMark=[],function(e,{interval:t,exchangeDuration:i}){e.animationAppear=!1,e.animationUpdate={bar:[{type:"update",options:{excludeChannels:["y"]},easing:"linear",duration:t},{channel:["y"],easing:"circInOut",duration:i}],axis:{duration:t,easing:"linear"}},e.animationEnter={bar:[{type:"moveIn",duration:i,easing:"cubicInOut",options:{direction:"y",orient:"negative",point:(e,t,i)=>({y:i.groupHeight+t.getBounds().height()})}}]},e.animationExit={bar:[{type:"moveOut",duration:i,easing:"cubicInOut",options:{direction:"y",orient:"negative"}}]}}(e,{interval:f,exchangeDuration:b}),g&&!1===g.visible||e.customMark.push(function(e={}){return{type:"text",dataId:"time",style:Object.assign({textBaseline:"bottom",fontSize:200,textAlign:"end",fontWeight:600,text:e=>e.time,x:(e,t)=>{var i;return(null===(i=t.vchart.getChart().getCanvasRect())||void 0===i?void 0:i.width)-50},y:(e,t)=>{var i;return(null===(i=t.vchart.getChart().getCanvasRect())||void 0===i?void 0:i.height)-80},fill:"grey",fillOpacity:.5},e)}}(g.style)),c){const t=function(e="bar-end",t="circle",{interval:i,exchangeDuration:r}){return{type:"symbol",dataId:"timeData",style:{symbolType:t,stroke:"white",lineWidth:1,size:(e,t)=>{var i,r;const a=t.vchart,s=null===(i=a.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(a&&s){const e=null!==(r=s.getYAxisHelper().getBandwidth(0))&&void 0!==r?r:0;return Math.max(e-4,0)}return 10},background:e=>e.icon,x:(t,i)=>{var r,a;const s=i.vchart,n=null===(r=s.getChart())||void 0===r?void 0:r.getSeriesInIndex(0)[0];if(s&&n){const i=null!==(a=n.getYAxisHelper().getBandwidth(0))&&void 0!==a?a:0;return"bar-start"===e?i/2:"axis"===e?-i/2:n.dataToPositionX(t)-i/2}},y:(e,t)=>{var i,r;const a=t.vchart,s=null===(i=a.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(a&&s){const t=null!==(r=s.getYAxisHelper().getBandwidth(0))&&void 0!==r?r:0;return s.dataToPositionY(e)+t/2}},scaleY:"rect"===t?1.2:1},animationUpdate:s(i,r),animationEnter:[{type:"moveIn",duration:r,easing:"cubicInOut",options:{direction:"y",orient:"negative",point:(e,t,i)=>({y:i.groupHeight+t.getBounds().height()})}}],animationExit:[{type:"moveOut",duration:r,easing:"cubicInOut",options:{direction:"y",orient:"negative"}}]}}(u,h,{interval:f,exchangeDuration:b});e.series[0].extensionMark.push(t)}super.transformSpec(e)}}function a(e={},t){var i,r,a,s;const n=[];return!1!==e.visible&&n.push({visible:!0,overlap:!1,style:Object.assign({fill:"rgb(64, 64, 64)"},e.style),smartInvert:{fillStrategy:(null===(i=e.style)||void 0===i?void 0:i.fill)?"null":void 0,strokeStrategy:(null===(r=e.style)||void 0===r?void 0:r.stroke)?"null":void 0}}),t.visible&&n.push({visible:!0,overlap:!1,style:Object.assign({},t.style),smartInvert:{fillStrategy:(null===(a=t.style)||void 0===a?void 0:a.fill)?"null":void 0,strokeStrategy:(null===(s=t.style)||void 0===s?void 0:s.stroke)?"null":void 0},position:"bar-end"===t.position?"inside-right":"inside-left",formatter:`{${t.yField}}`}),n}function s(e,t){return[{duration:t,easing:"cubicInOut",channel:["y"]},{options:{excludeChannels:["y"]},channel:["x","x2","x1"],easing:"linear",duration:e}]}class n extends t.BaseChart{constructor(){super(...arguments),this.type="rankingBar",this.transformerConstructor=r}init(){this.isValid()&&super.init()}isValid(){var e,t,i,r;const{xField:a,yField:s,timeField:n,data:o}=this._spec;return a&&s&&n?!!o||(null===(r=(i=this._option).onError)||void 0===r||r.call(i,"Data is required"),!1):(null===(t=(e=this._option).onError)||void 0===t||t.call(e,"Missing Required Config: `xField`, `yField`, `timeField` "),!1)}}n.type="rankingBar",n.view="singleDefault",n.transformerConstructor=r;const o=1e3,l="#21252c",d={labelLayout:"top",bar:{style:{cornerRadius:5}},barBackground:{type:"rect",style:{fill:"rgba(33,37,44,0.1)",cornerRadius:5}},rankingIcon:{visible:!0,style:{fill:l,size:20}},nameLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:l,textBaseline:"middle"}},orderLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:l,textBaseline:"middle"}},valueLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:l,textBaseline:"middle"}},pageSize:5,scrollSize:1,animationAppear:{enable:!0,type:"grow",duration:o,easing:"linear"},animationUpdate:{enable:!0,type:"grow",duration:o,easing:"linear"},animationNormal:{interval:o}},c="dataKey",u="VCHART_ORDER",h="SUPPLY_DATA_KEY";class g extends t.CommonChartSpecTransformer{constructor(){super(...arguments),this.formatMap={},this.paginateDataArr=e=>{const{scrollSize:t=1,pageSize:i=5}=e,r=this.originalData,a={};let s=0;for(let n=0;n<r.length;n+=t)if(s++,a[`page${s}`]=r.slice(n,n+i),n+i-1>=r.length-1){r.push(...Array.from({length:n+i-r.length},(t=>({[e.yField]:100*Math.random(),[e.xField]:null,[h]:!0}))));break}return{orderCount:s,result:a}},this.processRankingData=e=>{const t=[];e.data.forEach(((e,t)=>e[u]=t+1<10?`0${t+1}`:t+1));const i=this.paginateDataArr(e).result,r=this.paginateDataArr(e).orderCount;this.orderCount=r;const a=e.pageSize-i[`page${r}`].length;return i[`page${r}`].push(...Array.from({length:a},(t=>({[e.yField]:100*Math.random(),[e.xField]:null,[h]:!0})))),Object.keys(i).forEach((r=>{t.push({data:[{id:"datas",values:i[r].map((t=>Object.assign(Object.assign({},t),{[c]:t[e.yField]})))},{id:"order",values:[{order:r}]}]})})),t}}isSpecValid(e){const{xField:t,yField:i,data:r}=e;return!!(t&&i&&r&&0!==r.length)}transformSpec(e){var t;super.transformSpec(e),this.isSpecValid(e)?(this.normalizeSpec(e),this.upgradeTextMeasure(e),this.upgradeFormatMap(e),this.processData(e),this.transformBaseSpec(e),this.transformAnimationSpec(e),this.transformAxesSpec(e),e.extensionMark=[this.generateBarBackground(e),...this.generateDecorateHaloIcons(e),this.generateRankingIcon(e),this.generateNameLabel(e),this.generateOrderLabel(e),this.generateValueLabel(e)],this.transformPaddingSpec(e),null===(t=e.customTransformSpec)||void 0===t||t.call(e,e),super.transformSpec(e)):e.series=[]}normalizeSpec(e){(function e(t,i){for(const r in i)"__proto__"!==r&&"constructor"!==r&&"prototype"!==r&&"object"==typeof i[r]&&null!==i[r]?(t.hasOwnProperty(r)||(t[r]=Array.isArray(i[r])?[]:{}),e(t[r],i[r])):t.hasOwnProperty(r)||"object"!=typeof t||(t[r]=i[r]);return t})(e,d),((e,i)=>{i.forEach((i=>{var r,a,s,n,o,l,d;t.isArray(e[i])?null===(r=e[i])||void 0===r||r.forEach(((t,r)=>{var a,s,n;e[i][r]=Object.assign(Object.assign({},t),{style:Object.assign(Object.assign({},null==t?void 0:t.style),{visible:null===(n=null!==(s=null===(a=null==t?void 0:t.style)||void 0===a?void 0:a.visible)&&void 0!==s?s:null==t?void 0:t.visible)||void 0===n||n})})})):e[i]=Object.assign(Object.assign({},e[i]),{style:Object.assign(Object.assign({},null===(a=e[i])||void 0===a?void 0:a.style),{visible:null===(d=null!==(o=null===(n=null===(s=e[i])||void 0===s?void 0:s.style)||void 0===n?void 0:n.visible)&&void 0!==o?o:null===(l=e[i])||void 0===l?void 0:l.visible)||void 0===d||d})})}))})(e,["barBackground","rankingIcon","decorateHaloIcons","orderLabel","nameLabel","valueLabel"])}upgradeTextMeasure(e){var i,r,a,s,n,o,l,d,c;null===(i=this.nameLabelTextMeasure)||void 0===i||i.release(),null===(r=this.valueLabelTextMeasure)||void 0===r||r.release(),null===(a=this.orderLabelTextMeasure)||void 0===a||a.release(),this.nameLabelTextMeasure=new t.TextMeasure({defaultFontParams:null!==(n=null===(s=e.nameLabel)||void 0===s?void 0:s.style)&&void 0!==n?n:{}}),this.valueLabelTextMeasure=new t.TextMeasure({defaultFontParams:null!==(l=null===(o=e.valueLabel)||void 0===o?void 0:o.style)&&void 0!==l?l:{}}),this.orderLabelTextMeasure=new t.TextMeasure({defaultFontParams:null!==(c=null===(d=e.orderLabel)||void 0===d?void 0:d.style)&&void 0!==c?c:{}})}upgradeFormatMap(e){this.formatMap[e.yField]=e.nameLabel.formatMethod,this.formatMap[e.xField]=e.valueLabel.formatMethod,this.formatMap[u]=e.orderLabel.formatMethod}processData(e){var i;(null===(i=e.data[0])||void 0===i?void 0:i.values)||(this.originalData=e.data,this.originalSpec=t.cloneDeep(e),this.dataSpecs=this.processRankingData(e),e.data=this.dataSpecs[0].data)}transformBaseSpec(e){var t,i,r;e.type="common",e.dataKey=c,e.series=[{type:"bar",direction:"horizontal",xField:e.xField,yField:e.yField,barWidth:null!==(i=null===(t=e.bar)||void 0===t?void 0:t.height)&&void 0!==i?i:10,bar:Object.assign(Object.assign({},e.bar),{style:Object.assign(Object.assign({},null===(r=e.bar)||void 0===r?void 0:r.style),{x1:0,visible:t=>{var i,r;return!t[h]&&(null===(r=null===(i=e.bar)||void 0===i?void 0:i.style)||void 0===r||r)}})})}]}transformAnimationSpec(e){var t,i,r;e.animationUpdate.enable&&this.orderCount>1&&(e.player=Object.assign({specs:this.dataSpecs,auto:!0,visible:!1,interval:(null!==(i=null===(t=e.animationNormal)||void 0===t?void 0:t.interval)&&void 0!==i?i:1e3)+(null!==(r=e.animationUpdate.duration)&&void 0!==r?r:1e3)/2,loop:!0},e.player),e.animationExit=this.getAnimationExit(this.originalSpec),e.animationEnter=this.getAnimationEnter(this.originalSpec),e.animationUpdate=this.getAnimationUpdate(this.originalSpec)),e.animationNormal=this.originalSpec.animationNormal,e.animationAppear=this.getAnimationAppear(this.originalSpec,"rect")}transformAxesSpec(e){const{min:t,max:i}=((e,t)=>{let i,r;const a=e.map((e=>e[t])).filter((e=>null!=e));if(0===a.length)i=0,r=1;else{i=Math.min(...a)-(Math.max(...a)-Math.min(...a))/3,r=(Math.max(...a)-i)/.8+i;const e=10,t=i;i===r&&(i=t-e,r=(4*t+e)/4)}return{min:i,max:r}})(this.originalData,e.xField);e.axes=[{orient:"left",type:"band",visible:!1,inverse:!0,paddingOuter:.5},{orient:"bottom",label:{visible:!0},type:"linear",visible:!1,min:t,max:i}]}generateBarBackground(e){var t;return{type:e.barBackground.type,dataId:"data",visible:!0,dataKey:c,zIndex:-99,state:null===(t=e.barBackground)||void 0===t?void 0:t.state,style:Object.assign(Object.assign({x:(t,i)=>"symbol"===e.barBackground.type?i.getRegion().getLayoutRect().width/2:0,y:(t,i)=>i.valueToY([t[e.yField]])+i.yBandwidth()/2-("symbol"===e.barBackground.type?0:e.bar.height/2),size:(t,i)=>[i.getRegion().getLayoutRect().width,e.bar.height],width:(e,t)=>t.getRegion().getLayoutRect().width,height:e.bar.height},e.barBackground.style),{visible:t=>!t[h]&&e.barBackground.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"barBack"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateDecorateHaloIcons(e){var t;return null===(t=e.decorateHaloIcons)||void 0===t?void 0:t.map((t=>({type:"symbol",dataId:"data",visible:!0,dataKey:c,state:null==t?void 0:t.state,style:Object.assign(Object.assign({x:(t,i)=>{if(void 0!==t[e.xField]&&null!==t[e.xField])return i.valueToX([t[e.xField]])},y:(t,i)=>i.valueToY([t[e.yField]])+i.yBandwidth()/2},t.style),{visible:e=>!e[h]&&t.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"symbol"),animationUpdate:this.getAnimationUpdate(this.originalSpec)})))}generateRankingIcon(e){return{type:"symbol",dataId:"data",visible:!0,dataKey:c,state:e.rankingIcon.state,style:Object.assign(Object.assign({x:t=>"bothEnd"===e.labelLayout?-(10+this.nameLabelTextMeasure.fullMeasure(this.formatDatum(e.yField,t)).width+(e.orderLabel.style.visible?5+this.orderLabelTextMeasure.fullMeasure(this.formatDatum(u,t)).width:0)+8):5,y:(t,i)=>"bothEnd"===e.labelLayout?i.valueToY([t[e.yField]])+i.yBandwidth()/2:i.valueToY([t[e.yField]])+i.yBandwidth()/2-e.bar.height/2-5-Math.max(this.nameLabelTextMeasure.fullMeasure(this.formatDatum(e.yField,t)).height,this.orderLabelTextMeasure.fullMeasure(this.formatDatum(u,t)).height)/2},e.rankingIcon.style),{lineWidth:0,stroke:null,visible:t=>!t[h]&&e.rankingIcon.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateNameLabel(e){var t;return{type:"text",dataId:"data",dataKey:c,state:null===(t=e.nameLabel)||void 0===t?void 0:t.state,style:Object.assign(Object.assign({text:t=>this.formatDatum(e.yField,t),x:()=>{var t;return"bothEnd"===e.labelLayout?-10:(e.rankingIcon.style.visible?8+(null!==(t=e.rankingIcon.style.size)&&void 0!==t?t:10):0)+(e.orderLabel.style.visible?5+this.getMaxDataLabelLens(e,u,this.orderLabelTextMeasure):0)},y:(t,i)=>"bothEnd"===e.labelLayout?i.valueToY([t[e.yField]])+i.yBandwidth()/2:i.valueToY([t[e.yField]])+i.yBandwidth()/2-e.bar.height/2-5},e.nameLabel.style),{textAlign:"bothEnd"===e.labelLayout?"right":"left",textBaseline:"bothEnd"===e.labelLayout?"middle":"bottom",visible:t=>!t[h]&&e.nameLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateOrderLabel(e){var t;return{type:"text",dataId:"data",dataKey:c,state:null===(t=e.orderLabel)||void 0===t?void 0:t.state,style:Object.assign(Object.assign({text:e=>this.formatDatum(u,e),x:t=>{var i;return"bothEnd"===e.labelLayout?-(10+this.nameLabelTextMeasure.fullMeasure(this.formatDatum(e.yField,t)).width+5):e.rankingIcon.style.visible?8+(null!==(i=e.rankingIcon.style.size)&&void 0!==i?i:10):0},y:(t,i)=>"bothEnd"===e.labelLayout?i.valueToY([t[e.yField]])+i.yBandwidth()/2:i.valueToY([t[e.yField]])+i.yBandwidth()/2-e.bar.height/2-5},e.orderLabel.style),{textAlign:"bothEnd"===e.labelLayout?"right":"left",textBaseline:"bothEnd"===e.labelLayout?"middle":"bottom",visible:t=>!t[h]&&e.orderLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateValueLabel(e){var t;return{type:"text",dataId:"data",visible:!0,dataKey:c,state:null===(t=e.valueLabel)||void 0===t?void 0:t.state,style:Object.assign(Object.assign({text:t=>this.formatDatum(e.xField,t),x:(t,i)=>"bothEnd"===e.labelLayout?i.getRegion().getLayoutRect().width+5:i.getRegion().getLayoutRect().width,y:(t,i)=>"bothEnd"===e.labelLayout?i.valueToY([t[e.yField]])+i.yBandwidth()/2:i.valueToY([t[e.yField]])+i.yBandwidth()/2-e.bar.height/2-5},e.valueLabel.style),{textAlign:"bothEnd"===e.labelLayout?"left":"right",textBaseline:"bothEnd"===e.labelLayout?"middle":"bottom",visible:t=>!t[h]&&e.valueLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}transformPaddingSpec(e){var t;const i=e.decorateHaloIcons.length>0?Math.max(...e.decorateHaloIcons.map((e=>{var t,i;return null!==(i=null===(t=e.style)||void 0===t?void 0:t.size)&&void 0!==i?i:18}))):0;e.padding=Object.assign({left:"bothEnd"===e.labelLayout?10+this.getMaxDataLabelLens(e,e.yField,this.nameLabelTextMeasure)+(e.orderLabel.style.visible?5+this.getMaxDataLabelLens(e,u,this.orderLabelTextMeasure):0)+(e.rankingIcon.style.visible?8+(null!==(t=e.rankingIcon.style.size)&&void 0!==t?t:10):0)+5:5+i/2,right:"bothEnd"===e.labelLayout?5+this.getMaxDataLabelLens(e,e.xField,this.valueLabelTextMeasure)+5:15,top:0,bottom:0},e.padding)}getMaxDataLabelLens(e,t,i){const r=this.originalData.map((e=>e[h]?0:i.fullMeasure(this.formatDatum(t,e)).width));return Math.max(...r)}formatDatum(e,t){var i;return(null===(i=this.formatMap)||void 0===i?void 0:i[e])?this.formatMap[e](t[e],t):t[e]}getLabelWidth(e,t){return t+e}getAnimationExit(e){var t,i,r,a,s;return!1!==(null===(t=e.animationUpdate)||void 0===t?void 0:t.enable)&&{type:"moveOut",options:{direction:"y",orient:"negative",excludeChannels:["x"],point:(t,i)=>({y:i.getGraphicAttribute("y")-e.height/(e.pageSize+1)*Math.min(e.scrollSize,e.pageSize)})},duration:null!==(r=null===(i=e.animationUpdate)||void 0===i?void 0:i.duration)&&void 0!==r?r:1e3,easing:null!==(s=null===(a=e.animationUpdate)||void 0===a?void 0:a.easing)&&void 0!==s?s:"linear"}}getAnimationEnter(e){var t,i,r,a,s;return!1!==(null===(t=e.animationUpdate)||void 0===t?void 0:t.enable)&&{type:"moveIn",options:{direction:"y",orient:"negative",excludeChannels:["x"],point:(t,i)=>({y:i.getGraphicAttribute("y")+e.height/(e.pageSize+1)*Math.min(e.scrollSize,e.pageSize)})},duration:null!==(r=null===(i=e.animationUpdate)||void 0===i?void 0:i.duration)&&void 0!==r?r:1e3,easing:null!==(s=null===(a=e.animationUpdate)||void 0===a?void 0:a.easing)&&void 0!==s?s:"linear"}}getAnimationAppear(e,t){var i,r,a,s,n,o,l,d,c,u,h,g,p;return!1!==(null===(i=e.animationAppear)||void 0===i?void 0:i.enable)&&("rect"===t?{type:"growWidthIn",oneByOne:!1,duration:null!==(a=null===(r=e.animationAppear)||void 0===r?void 0:r.duration)&&void 0!==a?a:1e3,easing:null!==(n=null===(s=e.animationAppear)||void 0===s?void 0:s.easing)&&void 0!==n?n:"linear",options:{}}:"symbol"===t?{channel:{x:{from:0,to:(e,t)=>t.getGraphicAttribute("x")}},duration:null!==(l=null===(o=e.animationAppear)||void 0===o?void 0:o.duration)&&void 0!==l?l:1e3,easing:null!==(c=null===(d=e.animationAppear)||void 0===d?void 0:d.easing)&&void 0!==c?c:"linear"}:{channel:{opacity:{from:0,to:1}},duration:null!==(h=null===(u=e.animationAppear)||void 0===u?void 0:u.duration)&&void 0!==h?h:1e3,easing:null!==(p=null===(g=e.animationAppear)||void 0===g?void 0:g.easing)&&void 0!==p?p:"linear"})}getAnimationUpdate(e){var t,i,r,a;return!1!==e.animationUpdate.enable&&{duration:null!==(i=null===(t=e.animationUpdate)||void 0===t?void 0:t.duration)&&void 0!==i?i:1e3,easing:null!==(a=null===(r=e.animationUpdate)||void 0===r?void 0:r.easing)&&void 0!==a?a:"linear"}}}class p extends t.BaseChart{constructor(){super(...arguments),this.type="rankingList",this.transformerConstructor=g}init(){this.isValid()&&super.init()}isValid(){var e,t,i,r;const{xField:a,yField:s,data:n}=this._spec;return a&&s?!!n||(null===(r=(i=this._option).onError)||void 0===r||r.call(i,"Data is required"),!1):(null===(t=(e=this._option).onError)||void 0===t||t.call(e,"Missing Required Config: `xField`, `yField` "),!1)}}p.type="rankingList",p.view="singleDefault",p.transformerConstructor=g;
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vchart"),require("@visactor/vrender-core"),require("@visactor/vutils")):"function"==typeof define&&define.amd?define(["exports","@visactor/vchart","@visactor/vrender-core","@visactor/vutils"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VChartExtension={},t.VChart,t.VRender,t.VUtils)}(this,(function(t,e,i,s){"use strict";class r extends e.BaseChartSpecTransformer{transformSpec(t){const{timeData:i,timeNodes:s}=function(t){const{xField:i,yField:s,timeField:r,data:a,topN:n=10,icon:o}=t,l=new Set,h=new Map;return a.sort(((t,e)=>Number(e[i])-Number(t[i]))),a.forEach((t=>{const i=t[r];e.isValid(i)&&l.add(i),h.has(i)||h.set(i,[]);const a=h.get(i);if(a.length<n){const e=Object.assign({},t);o&&o[e[s]]&&(e.icon=o[e[s]]),a.push(e)}})),{timeData:h,timeNodes:Array.from(l).sort()}}(t),{interval:r,xField:o,yField:l,color:h,icon:c,iconPosition:d,iconShape:u,timeLabel:p,label:g,nameLabel:m,xAxis:f,yAxis:y}=t,v=r||1e3,b=Math.min(v,500);if(t.type="common",t.data=[{id:"timeData",values:i.get(s[0])},{id:"time",values:[{time:s[0]}]}],t.color={specified:Object.assign({},h)},t.region=[{clip:!0}],t.series=[{type:"bar",id:"ranking-bar",dataId:"timeData",direction:"horizontal",yField:l,xField:o,seriesField:l,extensionMark:[],label:a(g,Object.assign(Object.assign({},m),{yField:l}))}],t.axes=function(t={},e={}){const i={orient:"left",type:"band",inverse:!0,label:{style:e.label},domainLine:{style:e.domainLine},grid:{style:e.grid}},s={orient:"bottom",type:"linear",nice:!1,animation:!0,label:{style:t.label},domainLine:{style:t.domainLine},grid:{style:t.grid},innerOffset:{right:"10%"}};t.label&&(s.label=t.label);return[i,s]}(f,y),t.player={type:"continuous",auto:!0,loop:!1,interval:v,specs:s.map((t=>({data:[{id:"timeData",values:i.get(t)},{id:"time",values:[{time:t}]}]})))},t.tooltip={visible:!1},t.customMark=[],function(t,{interval:e,exchangeDuration:i}){t.animationAppear=!1,t.animationUpdate={bar:[{type:"update",options:{excludeChannels:["y"]},easing:"linear",duration:e},{channel:["y"],easing:"circInOut",duration:i}],axis:{duration:e,easing:"linear"}},t.animationEnter={bar:[{type:"moveIn",duration:i,easing:"cubicInOut",options:{direction:"y",orient:"negative",point:(t,e,i)=>({y:i.groupHeight+e.getBounds().height()})}}]},t.animationExit={bar:[{type:"moveOut",duration:i,easing:"cubicInOut",options:{direction:"y",orient:"negative"}}]}}(t,{interval:v,exchangeDuration:b}),p&&!1===p.visible||t.customMark.push(function(t={}){return{type:"text",dataId:"time",style:Object.assign({textBaseline:"bottom",fontSize:200,textAlign:"end",fontWeight:600,text:t=>t.time,x:(t,e)=>{var i;return(null===(i=e.vchart.getChart().getCanvasRect())||void 0===i?void 0:i.width)-50},y:(t,e)=>{var i;return(null===(i=e.vchart.getChart().getCanvasRect())||void 0===i?void 0:i.height)-80},fill:"grey",fillOpacity:.5},t)}}(p.style)),c){const e=function(t="bar-end",e="circle",{interval:i,exchangeDuration:s}){return{type:"symbol",dataId:"timeData",style:{symbolType:e,stroke:"white",lineWidth:1,size:(t,e)=>{var i,s;const r=e.vchart,a=null===(i=r.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(r&&a){const t=null!==(s=a.getYAxisHelper().getBandwidth(0))&&void 0!==s?s:0;return Math.max(t-4,0)}return 10},background:t=>t.icon,x:(e,i)=>{var s,r;const a=i.vchart,n=null===(s=a.getChart())||void 0===s?void 0:s.getSeriesInIndex(0)[0];if(a&&n){const i=null!==(r=n.getYAxisHelper().getBandwidth(0))&&void 0!==r?r:0;return"bar-start"===t?i/2:"axis"===t?-i/2:n.dataToPositionX(e)-i/2}},y:(t,e)=>{var i,s;const r=e.vchart,a=null===(i=r.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(r&&a){const e=null!==(s=a.getYAxisHelper().getBandwidth(0))&&void 0!==s?s:0;return a.dataToPositionY(t)+e/2}},scaleY:"rect"===e?1.2:1},animationUpdate:n(i,s),animationEnter:[{type:"moveIn",duration:s,easing:"cubicInOut",options:{direction:"y",orient:"negative",point:(t,e,i)=>({y:i.groupHeight+e.getBounds().height()})}}],animationExit:[{type:"moveOut",duration:s,easing:"cubicInOut",options:{direction:"y",orient:"negative"}}]}}(d,u,{interval:v,exchangeDuration:b});t.series[0].extensionMark.push(e)}super.transformSpec(t)}}function a(t={},e){var i,s,r,a;const n=[];return!1!==t.visible&&n.push({visible:!0,overlap:!1,style:Object.assign({fill:"rgb(64, 64, 64)"},t.style),smartInvert:{fillStrategy:(null===(i=t.style)||void 0===i?void 0:i.fill)?"null":void 0,strokeStrategy:(null===(s=t.style)||void 0===s?void 0:s.stroke)?"null":void 0}}),e.visible&&n.push({visible:!0,overlap:!1,style:Object.assign({},e.style),smartInvert:{fillStrategy:(null===(r=e.style)||void 0===r?void 0:r.fill)?"null":void 0,strokeStrategy:(null===(a=e.style)||void 0===a?void 0:a.stroke)?"null":void 0},position:"bar-end"===e.position?"inside-right":"inside-left",formatter:`{${e.yField}}`}),n}function n(t,e){return[{duration:e,easing:"cubicInOut",channel:["y"]},{options:{excludeChannels:["y"]},channel:["x","x2","x1"],easing:"linear",duration:t}]}class o extends e.BaseChart{constructor(){super(...arguments),this.type="rankingBar",this.transformerConstructor=r}init(){this.isValid()&&super.init()}isValid(){var t,e,i,s;const{xField:r,yField:a,timeField:n,data:o}=this._spec;return r&&a&&n?!!o||(null===(s=(i=this._option).onError)||void 0===s||s.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField`, `timeField` "),!1)}}o.type="rankingBar",o.view="singleDefault",o.transformerConstructor=r;const l=1e3,h="#21252c",c={labelLayout:"top",bar:{style:{cornerRadius:5}},barBackground:{type:"rect",style:{fill:"rgba(33,37,44,0.1)",cornerRadius:5}},rankingIcon:{visible:!0,style:{fill:h,size:20}},nameLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:h,textBaseline:"middle"}},orderLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:h,textBaseline:"middle"}},valueLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:h,textBaseline:"middle"}},pageSize:5,scrollSize:1,animationAppear:{enable:!0,type:"grow",duration:l,easing:"linear"},animationUpdate:{enable:!0,type:"grow",duration:l,easing:"linear"},animationNormal:{interval:l}},d="dataKey",u="VCHART_ORDER",p="SUPPLY_DATA_KEY";class g extends e.CommonChartSpecTransformer{constructor(){super(...arguments),this.formatMap={},this.paginateDataArr=t=>{const{scrollSize:e=1,pageSize:i=5}=t,s=this.originalData,r={};let a=0;for(let n=0;n<s.length;n+=e)if(a++,r[`page${a}`]=s.slice(n,n+i),n+i-1>=s.length-1){s.push(...Array.from({length:n+i-s.length},(e=>({[t.yField]:100*Math.random(),[t.xField]:null,[p]:!0}))));break}return{orderCount:a,result:r}},this.processRankingData=t=>{const e=[];t.data.forEach(((t,e)=>t[u]=e+1<10?`0${e+1}`:e+1));const i=this.paginateDataArr(t).result,s=this.paginateDataArr(t).orderCount;this.orderCount=s;const r=t.pageSize-i[`page${s}`].length;return i[`page${s}`].push(...Array.from({length:r},(e=>({[t.yField]:100*Math.random(),[t.xField]:null,[p]:!0})))),Object.keys(i).forEach((s=>{e.push({data:[{id:"datas",values:i[s].map((e=>Object.assign(Object.assign({},e),{[d]:e[t.yField]})))},{id:"order",values:[{order:s}]}]})})),e}}isSpecValid(t){const{xField:e,yField:i,data:s}=t;return!!(e&&i&&s&&0!==s.length)}transformSpec(t){var e;super.transformSpec(t),this.isSpecValid(t)?(this.normalizeSpec(t),this.upgradeTextMeasure(t),this.upgradeFormatMap(t),this.processData(t),this.transformBaseSpec(t),this.transformAnimationSpec(t),this.transformAxesSpec(t),t.extensionMark=[this.generateBarBackground(t),...this.generateDecorateHaloIcons(t),this.generateRankingIcon(t),this.generateNameLabel(t),this.generateOrderLabel(t),this.generateValueLabel(t)],this.transformPaddingSpec(t),null===(e=t.customTransformSpec)||void 0===e||e.call(t,t),super.transformSpec(t)):t.series=[]}normalizeSpec(t){(function t(e,i){for(const s in i)"__proto__"!==s&&"constructor"!==s&&"prototype"!==s&&"object"==typeof i[s]&&null!==i[s]?(e.hasOwnProperty(s)||(e[s]=Array.isArray(i[s])?[]:{}),t(e[s],i[s])):e.hasOwnProperty(s)||"object"!=typeof e||(e[s]=i[s]);return e})(t,c),((t,i)=>{i.forEach((i=>{var s,r,a,n,o,l,h;e.isArray(t[i])?null===(s=t[i])||void 0===s||s.forEach(((e,s)=>{var r,a,n;t[i][s]=Object.assign(Object.assign({},e),{style:Object.assign(Object.assign({},null==e?void 0:e.style),{visible:null===(n=null!==(a=null===(r=null==e?void 0:e.style)||void 0===r?void 0:r.visible)&&void 0!==a?a:null==e?void 0:e.visible)||void 0===n||n})})})):t[i]=Object.assign(Object.assign({},t[i]),{style:Object.assign(Object.assign({},null===(r=t[i])||void 0===r?void 0:r.style),{visible:null===(h=null!==(o=null===(n=null===(a=t[i])||void 0===a?void 0:a.style)||void 0===n?void 0:n.visible)&&void 0!==o?o:null===(l=t[i])||void 0===l?void 0:l.visible)||void 0===h||h})})}))})(t,["barBackground","rankingIcon","decorateHaloIcons","orderLabel","nameLabel","valueLabel"])}upgradeTextMeasure(t){var i,s,r,a,n,o,l,h,c;null===(i=this.nameLabelTextMeasure)||void 0===i||i.release(),null===(s=this.valueLabelTextMeasure)||void 0===s||s.release(),null===(r=this.orderLabelTextMeasure)||void 0===r||r.release(),this.nameLabelTextMeasure=new e.TextMeasure({defaultFontParams:null!==(n=null===(a=t.nameLabel)||void 0===a?void 0:a.style)&&void 0!==n?n:{}}),this.valueLabelTextMeasure=new e.TextMeasure({defaultFontParams:null!==(l=null===(o=t.valueLabel)||void 0===o?void 0:o.style)&&void 0!==l?l:{}}),this.orderLabelTextMeasure=new e.TextMeasure({defaultFontParams:null!==(c=null===(h=t.orderLabel)||void 0===h?void 0:h.style)&&void 0!==c?c:{}})}upgradeFormatMap(t){this.formatMap[t.yField]=t.nameLabel.formatMethod,this.formatMap[t.xField]=t.valueLabel.formatMethod,this.formatMap[u]=t.orderLabel.formatMethod}processData(t){var i;(null===(i=t.data[0])||void 0===i?void 0:i.values)||(this.originalData=t.data,this.originalSpec=e.cloneDeep(t),this.dataSpecs=this.processRankingData(t),t.data=this.dataSpecs[0].data)}transformBaseSpec(t){var e,i,s;t.type="common",t.dataKey=d,t.series=[{type:"bar",direction:"horizontal",xField:t.xField,yField:t.yField,barWidth:null!==(i=null===(e=t.bar)||void 0===e?void 0:e.height)&&void 0!==i?i:10,bar:Object.assign(Object.assign({},t.bar),{style:Object.assign(Object.assign({},null===(s=t.bar)||void 0===s?void 0:s.style),{x1:0,visible:e=>{var i,s;return!e[p]&&(null===(s=null===(i=t.bar)||void 0===i?void 0:i.style)||void 0===s||s)}})})}]}transformAnimationSpec(t){var e,i,s;t.animationUpdate.enable&&this.orderCount>1&&(t.player=Object.assign({specs:this.dataSpecs,auto:!0,visible:!1,interval:(null!==(i=null===(e=t.animationNormal)||void 0===e?void 0:e.interval)&&void 0!==i?i:1e3)+(null!==(s=t.animationUpdate.duration)&&void 0!==s?s:1e3)/2,loop:!0},t.player),t.animationExit=this.getAnimationExit(this.originalSpec),t.animationEnter=this.getAnimationEnter(this.originalSpec),t.animationUpdate=this.getAnimationUpdate(this.originalSpec)),t.animationNormal=this.originalSpec.animationNormal,t.animationAppear=this.getAnimationAppear(this.originalSpec,"rect")}transformAxesSpec(t){const{min:e,max:i}=((t,e)=>{let i,s;const r=t.map((t=>t[e])).filter((t=>null!=t));if(0===r.length)i=0,s=1;else{i=Math.min(...r)-(Math.max(...r)-Math.min(...r))/3,s=(Math.max(...r)-i)/.8+i;const t=10,e=i;i===s&&(i=e-t,s=(4*e+t)/4)}return{min:i,max:s}})(this.originalData,t.xField);t.axes=[{orient:"left",type:"band",visible:!1,inverse:!0,paddingOuter:.5},{orient:"bottom",label:{visible:!0},type:"linear",visible:!1,min:e,max:i}]}generateBarBackground(t){var e;return{type:t.barBackground.type,dataId:"data",visible:!0,dataKey:d,zIndex:-99,state:null===(e=t.barBackground)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({x:(e,i)=>"symbol"===t.barBackground.type?i.getRegion().getLayoutRect().width/2:0,y:(e,i)=>i.valueToY([e[t.yField]])+i.yBandwidth()/2-("symbol"===t.barBackground.type?0:t.bar.height/2),size:(e,i)=>[i.getRegion().getLayoutRect().width,t.bar.height],width:(t,e)=>e.getRegion().getLayoutRect().width,height:t.bar.height},t.barBackground.style),{visible:e=>!e[p]&&t.barBackground.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"barBack"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateDecorateHaloIcons(t){var e;return null===(e=t.decorateHaloIcons)||void 0===e?void 0:e.map((e=>({type:"symbol",dataId:"data",visible:!0,dataKey:d,state:null==e?void 0:e.state,style:Object.assign(Object.assign({x:(e,i)=>{if(void 0!==e[t.xField]&&null!==e[t.xField])return i.valueToX([e[t.xField]])},y:(e,i)=>i.valueToY([e[t.yField]])+i.yBandwidth()/2},e.style),{visible:t=>!t[p]&&e.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"symbol"),animationUpdate:this.getAnimationUpdate(this.originalSpec)})))}generateRankingIcon(t){return{type:"symbol",dataId:"data",visible:!0,dataKey:d,state:t.rankingIcon.state,style:Object.assign(Object.assign({x:e=>"bothEnd"===t.labelLayout?-(10+this.nameLabelTextMeasure.fullMeasure(this.formatDatum(t.yField,e)).width+(t.orderLabel.style.visible?5+this.orderLabelTextMeasure.fullMeasure(this.formatDatum(u,e)).width:0)+8):5,y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5-Math.max(this.nameLabelTextMeasure.fullMeasure(this.formatDatum(t.yField,e)).height,this.orderLabelTextMeasure.fullMeasure(this.formatDatum(u,e)).height)/2},t.rankingIcon.style),{lineWidth:0,stroke:null,visible:e=>!e[p]&&t.rankingIcon.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateNameLabel(t){var e;return{type:"text",dataId:"data",dataKey:d,state:null===(e=t.nameLabel)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({text:e=>this.formatDatum(t.yField,e),x:()=>{var e;return"bothEnd"===t.labelLayout?-10:(t.rankingIcon.style.visible?8+(null!==(e=t.rankingIcon.style.size)&&void 0!==e?e:10):0)+(t.orderLabel.style.visible?5+this.getMaxDataLabelLens(t,u,this.orderLabelTextMeasure):0)},y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5},t.nameLabel.style),{textAlign:"bothEnd"===t.labelLayout?"right":"left",textBaseline:"bothEnd"===t.labelLayout?"middle":"bottom",visible:e=>!e[p]&&t.nameLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateOrderLabel(t){var e;return{type:"text",dataId:"data",dataKey:d,state:null===(e=t.orderLabel)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({text:t=>this.formatDatum(u,t),x:e=>{var i;return"bothEnd"===t.labelLayout?-(10+this.nameLabelTextMeasure.fullMeasure(this.formatDatum(t.yField,e)).width+5):t.rankingIcon.style.visible?8+(null!==(i=t.rankingIcon.style.size)&&void 0!==i?i:10):0},y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5},t.orderLabel.style),{textAlign:"bothEnd"===t.labelLayout?"right":"left",textBaseline:"bothEnd"===t.labelLayout?"middle":"bottom",visible:e=>!e[p]&&t.orderLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateValueLabel(t){var e;return{type:"text",dataId:"data",visible:!0,dataKey:d,state:null===(e=t.valueLabel)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({text:e=>this.formatDatum(t.xField,e),x:(e,i)=>"bothEnd"===t.labelLayout?i.getRegion().getLayoutRect().width+5:i.getRegion().getLayoutRect().width,y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5},t.valueLabel.style),{textAlign:"bothEnd"===t.labelLayout?"left":"right",textBaseline:"bothEnd"===t.labelLayout?"middle":"bottom",visible:e=>!e[p]&&t.valueLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}transformPaddingSpec(t){var e;const i=t.decorateHaloIcons.length>0?Math.max(...t.decorateHaloIcons.map((t=>{var e,i;return null!==(i=null===(e=t.style)||void 0===e?void 0:e.size)&&void 0!==i?i:18}))):0;t.padding=Object.assign({left:"bothEnd"===t.labelLayout?10+this.getMaxDataLabelLens(t,t.yField,this.nameLabelTextMeasure)+(t.orderLabel.style.visible?5+this.getMaxDataLabelLens(t,u,this.orderLabelTextMeasure):0)+(t.rankingIcon.style.visible?8+(null!==(e=t.rankingIcon.style.size)&&void 0!==e?e:10):0)+5:5+i/2,right:"bothEnd"===t.labelLayout?5+this.getMaxDataLabelLens(t,t.xField,this.valueLabelTextMeasure)+5:15,top:0,bottom:0},t.padding)}getMaxDataLabelLens(t,e,i){const s=this.originalData.map((t=>t[p]?0:i.fullMeasure(this.formatDatum(e,t)).width));return Math.max(...s)}formatDatum(t,e){var i;return(null===(i=this.formatMap)||void 0===i?void 0:i[t])?this.formatMap[t](e[t],e):e[t]}getLabelWidth(t,e){return e+t}getAnimationExit(t){var e,i,s,r,a;return!1!==(null===(e=t.animationUpdate)||void 0===e?void 0:e.enable)&&{type:"moveOut",options:{direction:"y",orient:"negative",excludeChannels:["x"],point:(e,i)=>({y:i.getGraphicAttribute("y")-t.height/(t.pageSize+1)*Math.min(t.scrollSize,t.pageSize)})},duration:null!==(s=null===(i=t.animationUpdate)||void 0===i?void 0:i.duration)&&void 0!==s?s:1e3,easing:null!==(a=null===(r=t.animationUpdate)||void 0===r?void 0:r.easing)&&void 0!==a?a:"linear"}}getAnimationEnter(t){var e,i,s,r,a;return!1!==(null===(e=t.animationUpdate)||void 0===e?void 0:e.enable)&&{type:"moveIn",options:{direction:"y",orient:"negative",excludeChannels:["x"],point:(e,i)=>({y:i.getGraphicAttribute("y")+t.height/(t.pageSize+1)*Math.min(t.scrollSize,t.pageSize)})},duration:null!==(s=null===(i=t.animationUpdate)||void 0===i?void 0:i.duration)&&void 0!==s?s:1e3,easing:null!==(a=null===(r=t.animationUpdate)||void 0===r?void 0:r.easing)&&void 0!==a?a:"linear"}}getAnimationAppear(t,e){var i,s,r,a,n,o,l,h,c,d,u,p,g;return!1!==(null===(i=t.animationAppear)||void 0===i?void 0:i.enable)&&("rect"===e?{type:"growWidthIn",oneByOne:!1,duration:null!==(r=null===(s=t.animationAppear)||void 0===s?void 0:s.duration)&&void 0!==r?r:1e3,easing:null!==(n=null===(a=t.animationAppear)||void 0===a?void 0:a.easing)&&void 0!==n?n:"linear",options:{}}:"symbol"===e?{channel:{x:{from:0,to:(t,e)=>e.getGraphicAttribute("x")}},duration:null!==(l=null===(o=t.animationAppear)||void 0===o?void 0:o.duration)&&void 0!==l?l:1e3,easing:null!==(c=null===(h=t.animationAppear)||void 0===h?void 0:h.easing)&&void 0!==c?c:"linear"}:{channel:{opacity:{from:0,to:1}},duration:null!==(u=null===(d=t.animationAppear)||void 0===d?void 0:d.duration)&&void 0!==u?u:1e3,easing:null!==(g=null===(p=t.animationAppear)||void 0===p?void 0:p.easing)&&void 0!==g?g:"linear"})}getAnimationUpdate(t){var e,i,s,r;return!1!==t.animationUpdate.enable&&{duration:null!==(i=null===(e=t.animationUpdate)||void 0===e?void 0:e.duration)&&void 0!==i?i:1e3,easing:null!==(r=null===(s=t.animationUpdate)||void 0===s?void 0:s.easing)&&void 0!==r?r:"linear"}}}class m extends e.BaseChart{constructor(){super(...arguments),this.type="rankingList",this.transformerConstructor=g}init(){this.isValid()&&super.init()}isValid(){var t,e,i,s;const{xField:r,yField:a,data:n}=this._spec;return r&&a?!!n||(null===(s=(i=this._option).onError)||void 0===s||s.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}m.type="rankingList",m.view="singleDefault",m.transformerConstructor=g;
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -13,4 +13,4 @@
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
15
  ***************************************************************************** */
16
- function m(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(i[r[a]]=e[r[a]])}return i}const y={cornerRadius:4,stroke:"black",strokeOpacity:1,lineWidth:1,closePath:!1,pickable:!1},v={symbolType:"triangle",size:8,scaleX:.7,fill:"black"},f={fill:"#606773",fontSize:12},b={fill:"#eff1f9"};class x extends t.FunnelChartSpecTransformer{transformSpec(e){const{conversionArrow:t,extensionMark:i=[],funnelBackground:r}=e;if(t&&t.arrows&&t.arrows.length){const e=function(e){const{arrows:t}=e,i=m(e,["arrows"]),r=t.filter((e=>"left"===e.position)),a=_(t.filter((e=>"right"===e.position)),i),s=_(r,i),n=[];a&&(a.name="arrowRight",n.push(a));s&&(s.name="arrowLeft",n.push(s));return n}(t);e&&e.length&&i.push(...e)}if(r&&r.visible){const e=function(e){const{style:t={}}=e,i=m(e,["style"]);return Object.assign(Object.assign({type:"rect"},i),{dataIndex:0,zIndex:0,style:Object.assign(Object.assign(Object.assign({},b),t),{x:0,y:(e,t)=>t.getPoints(e)[0].y,width:(e,t)=>{const i=t.getRegion(),{width:r}=i.getLayoutRect();return r},height:(e,t)=>{const i=t.getPoints(e),r=i[0];return i[3].y-r.y}})})}(r);e&&i.push(e)}e.extensionMark=i,super.transformSpec(e)}_getDefaultSeriesSpec(e){const t=super._getDefaultSeriesSpec(e);return t.conversionArrow=e.conversionArrow,t.funnelBackground=e.funnelBackground,t}}function _(e,i){if(0===(null==e?void 0:e.length))return null;const{line:r,symbol:a,text:s,margin:n}=i,o=[],l={type:"group",zIndex:t.LayoutZIndex.Mark+1,children:[]},d=function(e={},t){const{style:i={}}=e,r=m(e,["style"]),a=(e,t)=>{var i,r;const{from:a,to:s}=e,{vchart:n}=t,o=null===(r=null===(i=null==n?void 0:n.getChart())||void 0===i?void 0:i.getSeriesData())||void 0===r?void 0:r.latestData;return!(s>o.length-1||a>o.length-1)};return Object.assign(Object.assign({type:"polygon",interactive:!1},r),{dataKey:e=>`${e.id}`,style:Object.assign(Object.assign(Object.assign({},y),i),{renderable:a,points:(e,i)=>{if(!a(e,i))return[];let r=e.layout.points;return r=S(e,i,t),r}})})}(r,n);d&&o.push(d);const c=function(e={},t){const{style:i={}}=e,r=m(e,["style"]);return Object.assign(Object.assign({type:"symbol",interactive:!1,dataKey:e=>`${e.id}`},r),{style:Object.assign(Object.assign(Object.assign({},v),i),{x:(e,i)=>{var r,a;let s=e.layout.points;return s=S(e,i,t),null!==(a=null===(r=s[(null==s?void 0:s.length)-1])||void 0===r?void 0:r.x)&&void 0!==a?a:NaN},y:(e,i)=>{var r,a;let s=e.layout.points;return s=S(e,i,t),null!==(a=null===(r=s[(null==s?void 0:s.length)-1])||void 0===r?void 0:r.y)&&void 0!==a?a:NaN},angle:e=>"left"===e.position?90:-90})})}(a,n);c&&o.push(c);const u=function(e={},i){const{style:r={},formatMethod:a,textMargin:s=4}=e,n=m(e,["style","formatMethod","textMargin"]);return Object.assign(Object.assign({type:"text",dataKey:e=>`${e.id}`,interactive:!1,animation:!1},n),{style:Object.assign(Object.assign(Object.assign({},f),{text:(e,i)=>{var r,s,n,o,l,d,c;const{text:u}=e;let h=u;if(t.isFunction(a)){const{vchart:t}=i,{from:g,to:p}=e,{field:m}=e.context,y=null!==(n=null===(s=null===(r=null==t?void 0:t.getChart())||void 0===r?void 0:r.getSeriesData())||void 0===s?void 0:s.latestData)&&void 0!==n?n:[],v=null!==(c=null===(d=null===(l=null===(o=null==t?void 0:t.getChart())||void 0===o?void 0:o.getAllSeries()[0])||void 0===l?void 0:l.getViewData())||void 0===d?void 0:d.latestData)&&void 0!==c?c:[],f=v.find((e=>e[m]===y[g][m])),b=v.find((e=>e[m]===y[p][m]));h=a(u,{arrow:e,from:f,to:b})}return h},x:(e,t)=>{var r,a;let n=e.layout.points;return n=S(e,t,i),null!==(a=(null===(r=n[1])||void 0===r?void 0:r.x)+("left"===e.position?-s:s))&&void 0!==a?a:NaN},y:(e,t)=>{var r,a,s;let n=e.layout.points;return n=S(e,t,i),null!==(s=((null===(r=n[1])||void 0===r?void 0:r.y)+(null===(a=n[2])||void 0===a?void 0:a.y))/2)&&void 0!==s?s:NaN},textAlign:e=>"left"===e.position?"right":"left",textBaseline:"middle"}),r)})}(s,n);return u&&o.push(u),l.children=o,l}function S(e,t,i){var r,a,s,n,o;const{vchart:l}=t,{from:d,to:c}=e,{field:u}=e.context,h=null===(a=null===(r=null==l?void 0:l.getChart())||void 0===r?void 0:r.getSeriesData())||void 0===a?void 0:a.latestData,g=null===(o=null===(n=null===(s=null==l?void 0:l.getChart())||void 0===s?void 0:s.getAllSeries()[0])||void 0===n?void 0:n.getViewData())||void 0===o?void 0:o.latestData;let p=[];if(h&&h.length){const r=g.find((e=>e[u]===h[d][u])),a=g.find((e=>e[u]===h[c][u])),s=g[0];if(r&&a&&s){p=function(e,t,i,r,a=12){const{layout:s,distance:n,position:o}=e,{level:l,fromIndex:d,toIndex:c,fromTotal:u,toTotal:h}=s,g="right"===o,p=g?t[1]:t[0],m=g?t[2]:t[3],y=Math.abs(p.y-m.y),v=g?i[1]:i[0],f=g?i[2]:i[3],b=Math.abs(v.y-f.y),x=g?r[1]:r[0],_=y/(u+1),S=b/(h+1),k=p.y+_*(d+1),M=v.y+S*(c+1),C=g?-1:1,A=[{x:p.x-a*C,y:k},{x:x.x-(a+(l+1)*n)*C,y:k},{x:x.x-(a+(l+1)*n)*C,y:M},{x:v.x-a*C,y:M}];return A}(e,t.getPoints(r),t.getPoints(a),t.getPoints(s),i),e.layout.points=p}}return p}function k(e,t){const{from:i,to:r}=e,{from:a,to:s}=t;return r>a&&s>i}function M(e,t){const{from:i,to:r}=e,{from:a,to:s}=t;return i===a&&r===s}const C=(e,i)=>{var r,a,s;if(!e||!(null===(r=e.arrows)||void 0===r?void 0:r.length))return[];const{arrows:n}=e,o=function(e,i){return e.filter((e=>t.isValidNumber(e.from*e.to))).map(((e,t)=>{const{from:r,to:a,position:s="right"}=e;return Object.assign(Object.assign({},e),{position:s,distance:e.distance||40,from:Math.min(r,a),to:Math.max(r,a),span:Math.abs(r-a),isLayout:!1,context:{field:i},layout:{level:0},id:`${r}-${a}-${s}-${t}`})}))}(n,i.categoryField),l=o.filter((e=>"left"===e.position)),d=o.filter((e=>"right"===e.position));return[...null!==(a=A(l))&&void 0!==a?a:[],...null!==(s=A(d))&&void 0!==s?s:[]]};function A(e){if(0===(null==e?void 0:e.length))return null;const i=new Map;return e.forEach((e=>{const r=i.get(e.from);if(t.isValid(r)){const t=r.fromArrows.find((t=>M(t,e)));t?e.layout.duplicateNode=t:r.degree+=1,r.fromArrows.push(e)}else i.set(e.from,{fromArrows:[e],toArrows:[],totalArrows:[],degree:1});const a=i.get(e.to);if(t.isValid(a)){const t=a.toArrows.find((t=>M(t,e)));t?e.layout.duplicateNode=t:a.degree+=1,a.toArrows.push(e)}else i.set(e.to,{toArrows:[e],fromArrows:[],totalArrows:[],degree:1})})),i.forEach((e=>{e.fromArrows.sort(((e,t)=>t.span-e.span)),e.toArrows.sort(((e,t)=>e.span-t.span)),e.totalArrows=[...e.toArrows,...e.fromArrows]})),e.sort(((e,t)=>e.span-t.span)).forEach((r=>{var a;const s=e.filter((e=>e.layout.isLayout)),n=t.maxInArray(s,((e,t)=>e.layout.level-t.layout.level));let o=null!==(a=null==n?void 0:n.layout.level)&&void 0!==a?a:0;for(;o>=0;){if(s.some((e=>e.layout.level===o&&k(e,r)))){o+=1;break}--o}r.layout.level=Math.max(0,o),r.layout.fromTotal=i.get(r.from).degree,r.layout.toTotal=i.get(r.to).degree;const l=r.layout.duplicateNode;l?(r.layout.fromIndex=l.layout.fromIndex,r.layout.toIndex=l.layout.toIndex):(r.layout.fromIndex=F(r,i.get(r.from).totalArrows),r.layout.toIndex=F(r,i.get(r.to).totalArrows)),r.layout.isLayout=!0})),e}function F(e,t){let i=0,r=0;for(let a=0;a<t.length;a++){const s=t[a];if(s===e){i=a-r;break}s.layout.duplicateNode&&r++}return i}class T extends t.FunnelChart{constructor(){super(...arguments),this.type="conversionFunnel",this.transformerConstructor=x}}T.type="conversionFunnel",T.transformerConstructor=x;class L extends t.FunnelSeries{initData(){var e;super.initData();const{conversionArrow:i}=this._spec;i&&(null===(e=i.arrows)||void 0===e?void 0:e.length)&&(this._arrowData=new t.DataView(this._dataSet,{name:`${t.PREFIX}_series_${this.id}_arrowData`}),this._dataSet.getTransform("conversionArrow")||this._dataSet.registerTransform("conversionArrow",C),this._arrowData.parse(i).transform({type:"conversionArrow",options:{categoryField:this._spec.categoryField}}))}afterCompile(){var e;null===(e=super.afterCompile)||void 0===e||e.call(this);const t=this.getMarkInName("arrowRight");t&&t.getMarks().forEach((e=>{e.setDataView(this._arrowData),e.compileData(),e.setTransform([{type:"filter",callback:e=>"right"===e.position}])}));const i=this.getMarkInName("arrowLeft");i&&i.getMarks().forEach((e=>{e.setDataView(this._arrowData),e.compileData(),e.setTransform([{type:"filter",callback:e=>"left"===e.position}])}))}}const w="dataKey";class O extends t.CommonChartSpecTransformer{transformSpec(e){var t,i,r,a,s;super.transformSpec(e);const n=function(e){const t=[];return Object.keys(e.data).forEach((i=>{const r=e.data[i].nodes;t.push({data:[{id:"nodes",values:r.map(((e,t)=>Object.assign(Object.assign({},e),{[w]:t})))},{id:"endpoints",values:[]},{id:"iter",values:[{iter:i}]},{id:"background",values:[{iter:i,x:e.scope[0],y:e.scope[1]},{iter:i,x:e.scope[0],y:e.scope[3]},{iter:i,x:e.scope[2],y:e.scope[3]},{iter:i,x:e.scope[2],y:e.scope[1]},{iter:i,x:e.scope[0],y:e.scope[1]}]}]})})),t}(e),o="neighborhood"!==e.taskType;e.type="common",e.dataKey=w,e.data=n[0].data,e.series=[{id:"background-series",type:"area",dataId:"background",interactive:!1,persent:!0,xField:"x",yField:"y",point:{visible:!1},line:{visible:!1},area:{visible:!0,interactive:!1,style:{background:t=>"neighborhood"===e.taskType?"":`https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/sequence-scatter-bgimg-2/${t.iter}.png`,fill:"transparent",fillOpacity:.5}},hover:{enable:!1},select:{enable:!1}},{id:"line-series",type:"line",dataId:"endpoints",xField:"x",yField:"y",seriesField:"edgeId",animation:!0,point:{visible:!1},line:{visible:!0,style:{stroke:e=>e.color,lineDash:e=>"same_type"===e.type?[0,0]:[3,2],lineWidth:.8,strokeOpacity:.6}}},{id:"scatter-series",type:"scatter",dataId:"nodes",xField:e.xField,yField:e.yField,seriesField:"label",point:{state:{hover:{scaleX:1.5,scaleY:1.5,fillOpacity:1},hover_reverse:{scaleX:1,scaleY:1,fillOpacity:.3}},style:{size:()=>"neighborhood"===e.taskType?6:4,fill:t=>{var i;return null!==(i=e.labelColor[t.label])&&void 0!==i?i:"gray"},fillOpacity:e=>e.confidence}},label:{visible:!0,style:{visible:()=>"neighborhood"===e.taskType,type:"text",fontFamily:"Console",fontStyle:"italic",fontSize:12,fill:"black",fillOpacity:.6,text:e=>e.id}}}],e.player&&(e.player=Object.assign(Object.assign({},e.player),{specs:n}),e.animationAppear={duration:null!==(i=null===(t=e.player)||void 0===t?void 0:t.duration)&&void 0!==i?i:2e3,easing:"linear"},e.animationUpdate={duration:null!==(a=null===(r=e.player)||void 0===r?void 0:r.duration)&&void 0!==a?a:2e3,easing:"linear"}),e.axes=[{orient:"left",type:"linear",inverse:!0,min:e.scope[1],max:e.scope[3]},{orient:"bottom",type:"linear",min:e.scope[0],max:e.scope[2]}],e.customMark=[{type:"text",dataId:"iter",style:Object.assign({x:50,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:100,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(s=e.infoLabel)||void 0===s?void 0:s.style)}],e.legends=[{seriesId:"scatter-series",visible:!0,orient:"right",position:"middle",data:e=>e.map((e=>(e.shape.outerBorder={stroke:e.shape.fill,distance:2,lineWidth:1},e))),title:{visible:!0,align:"left",textStyle:{text:"Classes",fontFamily:"Console",fontSize:18,fontWeight:"bold"}},item:{visible:!0,width:"8%",value:{alignRight:!0,style:{fill:"#000",fillOpacity:1,fontSize:12},state:{unselected:{fill:"#d8d8d8"}}}}}],e.tooltip={visible:o,seriesId:"scatter-series",lockAfterClick:!1,activeType:"mark",trigger:"hover",mark:{title:{visible:!0,value:"Info"},content:[{key:"Label",value:e=>e.label,shapeType:"circle",shapeSize:8},{key:"Prediction",value:e=>e.prediction,shapeType:"circle",shapeSize:8,shapeFill:t=>{var i;return null!==(i=e.labelColor[t.prediction])&&void 0!==i?i:"gray"}},{key:"Confidence",value:e=>e.confidence.toFixed(2),shapeType:"square",shapeSize:8,shapeFill:e=>e.label===e.prediction?"green":"red"}]},style:{panel:{padding:{top:10,bottom:15,left:10,right:10},backgroundColor:"#fff",border:{color:"#eee",width:1,radius:10}},titleLabel:{fontSize:20,fontFamily:"Times New Roman",fill:"brown",fontWeight:"bold",textAlign:"center",lineHeight:24},keyLabel:{fontSize:16,fontFamily:"Times New Roman",fill:"black",textAlign:"center",lineHeight:15,spacing:10},valueLabel:{fontSize:14,fill:"black",textAlign:"center",lineHeight:15,spacing:10}}},e.dataZoom=[{visible:!1,orient:"left",filterMode:"axis",showDetail:!1,roamZoom:{enable:!0,focus:!0,rate:3},roamDrag:{enable:!0,reverse:!0,rate:1}},{visible:!1,orient:"bottom",filterMode:"axis",showDetail:!1,roamZoom:{enable:!0,focus:!0,rate:3},roamDrag:{enable:!0,reverse:!0,rate:1}}],super.transformSpec(e)}}class I extends t.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterLink",this.transformerConstructor=O}init(){this.isValid()&&super.init()}isValid(){var e,t,i,r;const{xField:a,yField:s,data:n}=this._spec;return a&&s?!!n||(null===(r=(i=this._option).onError)||void 0===r||r.call(i,"Data is required"),!1):(null===(t=(e=this._option).onError)||void 0===t||t.call(e,"Missing Required Config: `xField`, `yField` "),!1)}}I.type="sequenceScatterLink",I.view="singleDefault",I.transformerConstructor=O;const E=.2;function D(e){const t=Math.sqrt((2*Math.PI)**2);return Math.exp(-(e**2)/2)/t}const B="dataKey";class P extends t.CommonChartSpecTransformer{transformSpec(e){var t,i,r,a,s,n;super.transformSpec(e);const o=function(e){const t=[];return Object.keys(e.data).forEach((i=>{const r=e.data[i].map(((e,t)=>Object.assign(Object.assign({},e),{[B]:t}))),a=function(e,t=100,i){const r=e.reduce(((e,t)=>{const i=t.label;return e[i]=e[i]||[],e[i].push(t),e}),{}),a=[];return Object.entries(r).forEach((([e,r])=>{const s=i||function(e){return e.length**(-1/6)}(r),n=r.map((e=>e.x)),o=r.map((e=>e.y)),l=Math.min(...n),d=Math.max(...n),c=Math.min(...o),u=Math.max(...o),h=l-(d-l)*E,g=c-(u-c)*E;for(let i=0;i<t;i++)for(let n=0;n<t;n++){const t=h+.1*i,o=g+.1*n;let l=0;for(const e of r)l+=D(Math.sqrt((t-e.x)**2+(o-e.y)**2)/s);l/=r.length*s*s,a.push({x:t,y:o,kde:l,label:e})}})),a}(r,150);t.push({data:[{id:"nodes",values:r},{id:"iter",values:[{iter:i}]},{id:"kde",values:a}]})})),t}(e);e.type="common",e.dataKey=B,e.data=o[0].data,e.scales=[{id:"colorScale",type:"ordinal",specified:{0:"rgb(150, 10, 100)",1:"rgb(31, 119, 180)",2:"rgb(255, 127, 14)",3:"rgb(44, 160, 44)",4:"rgb(214, 39, 40)",5:"rgb(148, 103, 189)",6:"rgb(140, 86, 75)",7:"rgb(227, 119, 194)",8:"rgb(127, 127, 127)",9:"rgb(188, 189, 34)",10:"rgb(23, 190, 207)"}},{id:"brighterColorScale",type:"ordinal",specified:{0:"rgb(150, 10, 150)",1:"rgb(31, 119, 230)",2:"rgb(255, 127, 64)",3:"rgb(44, 160, 94)",4:"rgb(214, 39, 90)",5:"rgb(148, 103, 239)",6:"rgb(140, 86, 125)",7:"rgb(227, 119, 244)",8:"rgb(127, 127, 177)",9:"rgb(188, 189, 84)",10:"rgb(23, 190, 255)"}},...null!==(t=e.scales)&&void 0!==t?t:[]],e.series=[{type:"scatter",dataIndex:0,xField:e.xField,yField:e.yField,seriesField:e.seriesField,size:5,point:{zIndex:1e3,style:{fill:{scale:"colorScale",field:e.seriesField}}}}];e.customMark=[{type:"text",dataIndex:1,style:Object.assign({text:e=>e.iter,x:10,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:25,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(i=e.infoLabel)||void 0===i?void 0:i.style)},{type:"symbol",dataIndex:2,style:{symbolType:"rect",x:(e,t)=>54+(0,t.chart.getAllSeries()[0]._markAttributeContext.valueToX)([e.x]),y:(e,t)=>(0,t.chart.getAllSeries()[0]._markAttributeContext.valueToY)([e.y])+26,size:5,fill:{scale:"brighterColorScale",field:"label"},fillOpacity:e=>10*e.kde}}],e.tooltip={visible:!0,fields:["x","y","label"]},e.player&&(e.player=Object.assign(Object.assign({},e.player),{specs:o}),e.animationAppear={duration:null!==(a=null===(r=e.player)||void 0===r?void 0:r.duration)&&void 0!==a?a:2e3,easing:"linear"},e.animationUpdate={duration:null!==(n=null===(s=e.player)||void 0===s?void 0:s.duration)&&void 0!==n?n:2e3,easing:"linear"}),e.axes=[{orient:"left",type:"linear",nice:!0},{orient:"bottom",type:"linear",nice:!0,label:{visible:!0}}],super.transformSpec(e)}}class j extends t.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterKDE",this.transformerConstructor=P}init(){this.isValid()&&super.init()}isValid(){var e,t,i,r;const{xField:a,yField:s,data:n}=this._spec;return a&&s?!!n||(null===(r=(i=this._option).onError)||void 0===r||r.call(i,"Data is required"),!1):(null===(t=(e=this._option).onError)||void 0===t||t.call(e,"Missing Required Config: `xField`, `yField` "),!1)}}j.type="sequenceScatterKDE",j.view="singleDefault",j.transformerConstructor=P;const R="dataKey";function V(e){const t=[];return Object.keys(e.data).forEach((i=>{let r=null;if(e.backgroundColors&&e.backgroundColors[i]){const t=function(e,t){var i;if("undefined"==typeof document)throw new Error("Canvas rendering requires browser environment with document object");const r=document.createElement("canvas");r.width=t.width,r.height=t.height;const a=r.getContext("2d");if(!a)throw new Error("Failed to get 2D rendering context from canvas");const s=a.createImageData(t.width,t.height);for(let t=0;t<300;t++)for(let r=0;r<300;r++){const a=(null===(i=e[t])||void 0===i?void 0:i[r])||[0,0,0],n=4*(300*t+r);s.data[n]=Math.round(255*a[0]),s.data[n+1]=Math.round(255*a[1]),s.data[n+2]=Math.round(255*a[2]),s.data[n+3]=255}return a.putImageData(s,0,0),r.toDataURL("image/png")}(e.backgroundColors[i],e);r={imageData:t}}t.push({data:[{id:"nodes",values:e.data[i].map(((e,t)=>Object.assign(Object.assign({},e),{[R]:t})))},{id:"inter",values:[{inter:i}]},{id:"background",values:r?[r]:[]}]})})),t}class N extends t.CommonChartSpecTransformer{transformSpec(e){var t,i,r,a,s;super.transformSpec(e);const n=V(e);e.type="common",e.dataKey=R,e.data=n[0].data,e.width=300,e.height=300,e.autoFit=!1,e.series=[{type:"scatter",xField:e.xField,yField:e.yField}],e.player&&(e.player=Object.assign(Object.assign({},e.player),{specs:n}),e.animationAppear={duration:null!==(i=null===(t=e.player)||void 0===t?void 0:t.duration)&&void 0!==i?i:2e3,easing:"linear"},e.animationUpdate={duration:null!==(a=null===(r=e.player)||void 0===r?void 0:r.duration)&&void 0!==a?a:2e3,easing:"linear"}),e.axes=[{orient:"left",type:"linear"},{orient:"bottom",label:{visible:!0},type:"linear"}],e.customMark=[{type:"image",dataIndex:2,style:{x:0,y:0,width:300,height:300,image:e=>e.imageData,zIndex:-1}},{type:"text",dataIndex:1,style:Object.assign({text:e=>e.inter,x:50,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:100,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(s=e.infoLabel)||void 0===s?void 0:s.style)}],e.tooltip={visible:!1},super.transformSpec(e)}}class z extends t.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterPixel",this.transformerConstructor=N}init(){this.isValid()&&super.init()}isValid(){var e,t,i,r;const{xField:a,yField:s,data:n}=this._spec;return a&&s?!!n||(null===(r=(i=this._option).onError)||void 0===r||r.call(i,"Data is required"),!1):(null===(t=(e=this._option).onError)||void 0===t||t.call(e,"Missing Required Config: `xField`, `yField` "),!1)}}z.type="sequenceScatterPixel",z.view="singleDefault",z.transformerConstructor=N;class H extends t.BarChartSpecTransformer{_getDefaultSeriesSpec(e){const t=super._getDefaultSeriesSpec(e);return t.barWidth=e.barWidth,t.barMaxWidth=e.barMaxWidth,t.barMinWidth=e.barMinWidth,t.barGapInGroup=e.barGapInGroup,t}}var G,W,$,K,U;!function(e){e.bar3d="bar3d",e.histogram3d="histogram3d",e.rangeColumn3d="rangeColumn3d",e.pie3d="pie3d",e.wordCloud3d="wordCloud3d",e.funnel3d="funnel3d"}(G||(G={})),function(e){e.rect3d="rect3d",e.arc3d="arc3d",e.pyramid3d="pyramid3d"}(W||(W={})),function(e){e.bar3d="bar3d",e.rangeColumn3d="rangeColumn3d",e.pie3d="pie3d",e.wordCloud3d="wordCloud3d",e.funnel3d="funnel3d"}($||($={})),function(e){e.bar3d="bar3d",e.funnel3d="funnel3d",e.transform3d="transform3d",e.pie3d="pie3d"}(K||(K={})),function(e){e.bar3d_horizontal="bar3d_horizontal",e.bar3d_vertical="bar3d_vertical",e.bar3d_stack="bar3d_stack",e.rangeColumn3d_horizontal="rangeColumn3d_horizontal",e.rangeColumn3d_vertical="rangeColumn3d_vertical"}(U||(U={}));const X=e=>e.zField||e.series&&e.series.some((e=>e.zField));class Y extends t.BasePlugin{constructor(){super(Y.type),this.type="VChart3dPlugin"}onInit(e,t){var i,r;if(this._is3d=!!(r=t)&&((e=>"bar3d"===e||"funnel3d"===e||"histogram3d"===e||"pie3d"===e||"rangeColumn3d"===e||"wordCloud3d"===e)(r.type)||X(r),!0),this._is3d){const{globalInstance:t}=e;t.getCompiler().getStage().set3dOptions(Object.assign({},null===(i=t._option)||void 0===i?void 0:i.options3d))}}onBeforeInitChart(e,t,i){this._is3d&&X(t)&&(t.layout={type:"layout3d"})}}Y.pluginType="chart",Y.type="VChart3dPlugin";const q=()=>{t.registerChartPlugin(Y),t.registerDirectionalLight(),t.registerOrthoCamera(),t.registerViewTransform3dPlugin()},Z={label:{name:"label",type:"text"},bar3d:{name:"bar3d",type:"rect3d"}};class J extends t.BarSeriesSpecTransformer{_transformLabelSpec(e){this._addMarkLabelSpec(e,"bar3d")}}class Q extends t.BaseMark{_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,length:3})}setDataLabelType(){return"rect"}constructor(e,t){super(e,t),this.type=Q.type,this._markConfig.support3d=!0}setMarkConfig(e){super.setMarkConfig(e),this._markConfig.support3d=!0}}Q.type="rect3d";const ee=()=>{t.Factory.registerMark(Q.type,Q),t.registerShadowRoot(),t.registerRect3d(),t.registerRectAnimation(),t.Factory.registerGraphicComponent("rect3d",t.createRect3d)};class te extends t.BarSeries{constructor(){super(...arguments),this.type=$.bar3d,this._barMarkName="bar3d",this._barMarkType="rect3d",this.transformerConstructor=J}}te.type=$.bar3d,te.mark=Z,te.builtInTheme={bar3d:{bar3d:{style:{length:3}},label:{visible:!1,style:{offset:12,position:"outside"}}}},te.transformerConstructor=J;const ie=()=>{t.Factory.registerAnimation("bar3d",((e,i)=>({appear:t.barPresetAnimation(e,i),enter:t.barGrowIn(e,!1),exit:t.barGrowOut(e,!1),disappear:t.barGrowOut(e)}))),ee(),t.registerCartesianBandAxis(),t.registerCartesianLinearAxis(),t.Factory.registerSeries(te.type,te)};class re extends t.Layout{layoutItems(e,i,r,a){this._layoutInit(e,i,r,a);const s={recomputeWidth:this.recomputeWidth,recomputeHeight:this.recomputeHeight};this._layoutNormalItems(i,s);const n={left:this.leftCurrent,top:this.topCurrent,right:this.rightCurrent,bottom:this.bottomCurrent},o=i.filter((e=>"absolute"===e.layoutType)),l=o.filter((e=>"z"===e.layoutOrient));let d={width:0,height:0};if(l.length){d=l[0].getLayoutRect()}this.leftCurrent+=d.width/8,this.rightCurrent-=d.width/8,this.topCurrent+=d.height/8,this.bottomCurrent-=d.height/8;const{regionItems:c,relativeItems:u,relativeOverlapItems:h,allRelatives:g,overlapItems:p}=this._groupItems(i);this.layoutRegionItems(c,u,h,p,s),this._processAutoIndent(c,u,h,p,g,n,s);const m=o.filter((e=>"z"!==e.layoutOrient));this.layoutAbsoluteItems(m);const y=u.filter((e=>"axes"===e.model.specKey&&t.isXAxis(e.layoutOrient)))[0],v=u.filter((e=>"axes"===e.model.specKey&&t.isYAxis(e.layoutOrient)))[0];if(y&&l.length){const e=y.getLayoutStartPoint(),t=y.getLayoutRect(),i={x:"left"===v.layoutOrient?e.x+t.width:e.x,y:e.y,width:this._chartLayoutRect.width,height:this._chartLayoutRect.height};l[0].model.directionStr="left"===v.layoutOrient?"r2l":"l2r";const r=y.getLayoutRect(),a=v.getLayoutRect(),s={length:l[0].getLayoutRect().width,width:r.width,height:a.height};y.model.setLayout3dBox&&y.model.setLayout3dBox(s),v.model.setLayout3dBox&&v.model.setLayout3dBox(s),l[0].model.setLayout3dBox&&l[0].model.setLayout3dBox(s),this.layoutZAxisItems(l,i)}}layoutZAxisItems(e,t){e.forEach((e=>{e.absoluteLayoutInRect(t)}))}getItemComputeLayoutRect(e,t){t||(t={offsetLeft:0,offsetRight:0,offsetTop:0,offsetBottom:0});return{width:this.rightCurrent-this.leftCurrent-e.layoutPaddingLeft-e.layoutPaddingRight-(t.offsetLeft+t.offsetRight),height:this.bottomCurrent-this.topCurrent-e.layoutPaddingTop-e.layoutPaddingBottom-(t.offsetTop+t.offsetBottom)}}_checkAutoIndent(e){const t={top:0,left:0,bottom:0,right:0},i=this._chartViewBox.x2-this._chartViewBox.x1-this.rightCurrent,r=this._chartViewBox.y2-this._chartViewBox.y1-this.bottomCurrent;return e.forEach((e=>{if(!e.getModelVisible()||!e.autoIndent)return;const a="left"===e.layoutOrient||"right"===e.layoutOrient,s=e.getLastComputeOutBounds();a?(t.top=Math.max(t.top,s.y1-this.topCurrent),t.bottom=Math.max(t.bottom,s.y2-r)):(t.left=Math.max(t.left,s.x1-this.leftCurrent),t.right=Math.max(t.right,s.x2-i))})),t}}re.type="layout3d";const ae=()=>{t.Factory.registerLayout(re.type,re)};class se extends t.BarChart{constructor(){super(...arguments),this.transformerConstructor=H,this.type="bar3d",this.seriesType=$.bar3d}}se.type="bar3d",se.seriesType=$.bar3d,se.transformerConstructor=H;const ne=Object.assign(Object.assign({},t.baseSeriesMark),{funnel3d:{name:"funnel3d",type:"pyramid3d"},transform3d:{name:"transform3d",type:"pyramid3d"},transformLabel:{name:"transformLabel",type:"text"},outerLabel:{name:"outerLabel",type:"text"},outerLabelLine:{name:"outerLabelLine",type:"rule"}});class oe extends t.FunnelSeriesSpecTransformer{_transformLabelSpec(e){this._addMarkLabelSpec(e,"funnel3d"),e.isTransform&&this._addMarkLabelSpec(e,"transform3d","transformLabel")}}class le extends t.BasePolygonMark{_getDefaultStyle(){const e=super._getDefaultStyle();return e.stroke=!1,e}constructor(e,t){super(e,t),this.type=le.type,this._markConfig.support3d=!0}setMarkConfig(e){super.setMarkConfig(e),this._markConfig.support3d=!0}}le.type="pyramid3d";const de=t.getFunnelTheme(!0);class ce extends t.FunnelSeries{constructor(){super(...arguments),this.type=$.funnel3d,this._funnelMarkName="funnel3d",this._funnelMarkType="pyramid3d",this._transformMarkName="transform3d",this._transformMarkType="pyramid3d",this.transformerConstructor=oe}initMark(){var e,t,i,r,a,s,n,o;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},ce.mark.funnel3d),{name:this._funnelMarkName,type:this._funnelMarkType}),{themeSpec:null===(e=this._theme)||void 0===e?void 0:e.funnel3d,key:this._seriesField,isSeriesMark:!0},{support3d:!0}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},ce.mark.transform3d),{name:this._transformMarkName,type:this._transformMarkType}),{themeSpec:null===(t=this._theme)||void 0===t?void 0:t.transform3d,key:this._seriesField,skipBeforeLayouted:!1,dataView:this._viewDataTransform.getDataView(),dataProductId:this._viewDataTransform.getProductId()})),null===(r=null===(i=this._spec)||void 0===i?void 0:i.outerLabel)||void 0===r?void 0:r.visible){const{line:e}=null!==(a=this._spec.outerLabel)&&void 0!==a?a:{},{line:t}=null!==(n=null===(s=this._theme)||void 0===s?void 0:s.outerLabel)&&void 0!==n?n:{};this._funnelOuterLabelMark.label=this._createMark(ce.mark.outerLabel,{themeSpec:null===(o=this._theme)||void 0===o?void 0:o.outerLabel,key:this._seriesField,markSpec:this._spec.outerLabel}),this._funnelOuterLabelMark.line=this._createMark(ce.mark.outerLabelLine,{themeSpec:t,key:this._seriesField,markSpec:e})}}initMarkStyle(){super.initMarkStyle();const e=this._funnelMark;e&&this.setMarkStyle(e,{z:e=>{if(this._isHorizontal())return 0;const t=this.getPoints(e),i=Math.max(Math.abs(t[0].x-t[1].x),Math.abs(t[2].x-t[3].x));return(this._computeMaxSize()-i)/2}},"normal",t.AttributeLevel.Series)}initLabelMarkStyle(e){var i,r;super.initLabelMarkStyle(e),this.setMarkStyle(e,{z:e=>{if(this._isHorizontal())return 0;const t=this.getPoints(e),i=Math.max(Math.abs(t[0].x-t[1].x),Math.abs(t[2].x-t[3].x));return(this._computeMaxSize()-i)/2}},"normal",t.AttributeLevel.Series),this._labelMark=e,null===(i=this._funnelOuterLabelMark)||void 0===i||i.label,null===(r=this._funnelOuterLabelMark)||void 0===r||r.line}}ce.type=$.funnel3d,ce.mark=ne,ce.builtInTheme={funnel3d:de},ce.transformerConstructor=oe;const ue=()=>{t.Factory.registerMark(le.type,le),t.registerShadowRoot(),t.registerPyramid3d(),t.registerPolygonAnimation(),t.Factory.registerGraphicComponent("pyramid3d",t.createPyramid3d),t.registerTextMark(),t.registerRuleMark(),t.Factory.registerSeries(ce.type,ce)};class he extends t.BaseChart{constructor(){super(...arguments),this.transformerConstructor=t.FunnelChartSpecTransformer,this.type="funnel3d",this.seriesType=$.funnel3d}}he.type="funnel3d",he.seriesType=$.funnel3d,he.transformerConstructor=t.FunnelChartSpecTransformer;class ge extends t.BaseHistogramChart{constructor(){super(...arguments),this.transformerConstructor=t.HistogramChartSpecTransformer,this.type="histogram3d",this.seriesType=$.bar3d}_setModelOption(){this._modelOption.getDimensionInfo=t.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=t.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=t.getCartesianCrosshairRect}}ge.type="histogram3d",ge.seriesType=$.bar3d,ge.transformerConstructor=t.HistogramChartSpecTransformer;class pe extends t.BasePieChartSpecTransformer{transformSpec(e){super.transformSpec(e),e.series.forEach((t=>{"pie3d"===t.type&&(t.angle3d=e.angle3d)}))}}class me extends t.BaseArcMark{setDataLabelType(){return"arc"}constructor(e,t){super(e,t),this.type=me.type,this._markConfig.support3d=!0}setMarkConfig(e){super.setMarkConfig(e),this._markConfig.support3d=!0}}me.type="arc3d";const ye=Object.assign(Object.assign({},t.baseSeriesMark),{pie3d:{name:"pie3d",type:"arc3d"},labelLine:{name:"labelLine",type:"path"}});class ve extends t.PieSeriesSpecTransformer{_transformLabelSpec(e){this._addMarkLabelSpec(e,"pie3d")}}class fe extends t.BasePieSeries{constructor(){super(...arguments),this.type=$.pie3d,this._pieMarkName="pie3d",this._pieMarkType="arc3d",this.transformerConstructor=ve}setAttrFromSpec(){var e,t;super.setAttrFromSpec(),this._angle3d=null!==(t=null===(e=this._spec)||void 0===e?void 0:e.angle3d)&&void 0!==t?t:-Math.PI/3}initMarkStyle(){super.initMarkStyle();const e=this._pieMark;e&&this.setMarkStyle(e,{beta:()=>this._angle3d},"normal",t.AttributeLevel.Series)}initLabelMarkStyle(e,i={}){e&&(super.initLabelMarkStyle(e),this.setMarkStyle(e,{support3d:!0},void 0,t.AttributeLevel.Mark))}}fe.type=$.pie3d,fe.mark=ye,fe.builtInTheme={pie3d:{outerRadius:.6,pie3d:{style:{height:10,fillOpacity:1}},label:{visible:!1,interactive:!0,position:"outside"}}},fe.transformerConstructor=ve;const be=()=>{t.Factory.registerAnimation("pie3d",((e,i)=>({appear:t.piePresetAnimation(e,i),enter:t.pieEnter(e),exit:t.pieExit(e),disappear:t.pieDisappear(e)}))),t.registerArcAnimation(),t.registerShadowRoot(),t.registerArc3d(),t.Factory.registerGraphicComponent("arc3d",t.createArc3d),t.Factory.registerMark("arc3d",me),t.Factory.registerSeries(fe.type,fe)};class xe extends t.BasePieChart{constructor(){super(...arguments),this.transformerConstructor=pe,this.type="pie3d",this.seriesType=$.pie3d}}xe.type="pie3d",xe.seriesType=$.pie3d,xe.transformerConstructor=pe;const _e="combinationCandlestick";class Se extends t.CartesianChartSpecTransformer{_getDefaultSeriesSpec(e){const t=[e.openField,e.highField,e.lowField,e.closeField],i=super._getDefaultSeriesSpec(e,["candlestick","openField","highField","lowField","closeField","rising","falling","doji"]);return i.yField=t,i}transformSpec(e){super.transformSpec(e),e.axes||(e.axes=[{orient:"bottom"},{orient:"left"}]),t.setDefaultCrosshairForCartesianChart(e)}}class ke extends t.GlyphMark{constructor(){super(...arguments),this.type=ke.type}setGlyphConfig(e){super.setGlyphConfig(e),this._subMarks={line:{type:"line",defaultAttributes:{x:0,y:0}},box:{type:"rect"}},this._positionChannels=["x","boxWidth","open","close","high","low"],this._channelEncoder=null,this._positionEncoder=(e,t,i)=>{const{x:r=i.attribute.x,boxWidth:a=i.attribute.boxWidth,open:s=i.attribute.open,close:n=i.attribute.close,low:o=i.attribute.low,high:l=i.attribute.high}=e,d={};return d.line={points:[{x:r,y:o},{x:r,y:l}]},d.box={x:r-a/2,x1:r+a/2,y:Math.min(s,n),y1:Math.max(s,n),drawStrokeWhenZeroWH:!0},d}}_getDefaultStyle(){return Object.assign({},super._getDefaultStyle())}}ke.type="candlestick";class Me extends t.ACustomAnimate{constructor(e,t,i,r,a){super(e,t,i,r,a)}onBind(){super.onBind();const e=this.target.getFinalAttribute();e&&this.target.setAttributes(e);const{from:t,to:i}=this.computeAttribute();this.propKeys=Object.keys(i).filter((e=>null!=i[e])),this.animate.reSyncProps(),this.from=t,this.to=i,this.target.setAttributes(this.from)}computeAttribute(){return(e=>{const i=e.getFinalAttribute(),{x:r,y:a,open:s,high:n,low:o,close:l}=i,d={from:{x:r,y:a},to:{x:r,y:a}};return t.isValidNumber(s)&&t.isValidNumber(l)&&(s>l?(d.from.open=o,d.to.open=s,d.from.close=o,d.to.close=l,t.isValidNumber(n)&&(d.from.high=o,d.to.high=n)):(d.from.open=n,d.to.open=s,d.from.close=n,d.to.close=l,t.isValidNumber(o)&&(d.from.low=n,d.to.low=o))),d})(this.target,this.params,this.params.options)}onUpdate(e,t,i){const r=this.target.attribute;this.propKeys.forEach((e=>{r[e]=this.from[e]+(this.to[e]-this.from[e])*t})),this.target.setAttributes(r)}}class Ce extends t.ACustomAnimate{constructor(e,t,i,r,a){super(e,t,i,r,a)}onBind(){var e;(null===(e=this.params)||void 0===e?void 0:e.diffAttrs)&&this.target.setAttributes(this.params.diffAttrs);const{from:t,to:i}=this.computeAttribute();this.propKeys=Object.keys(i).filter((e=>null!=i[e])),this.animate.reSyncProps(),this.from=t,this.to=i,this.target.setAttributes(this.from)}computeAttribute(){return(e=>{const i=e.getFinalAttribute(),{x:r,y:a,open:s,high:n,low:o,close:l}=i,d={from:{x:r,y:a},to:{x:r,y:a}};return t.isValidNumber(s)&&t.isValidNumber(l)&&(s>l?(d.from.open=s,d.to.open=o,d.from.close=l,d.to.close=o,t.isValidNumber(n)&&(d.from.high=n,d.to.high=o)):(d.from.open=s,d.to.open=n,d.from.close=l,d.to.close=n,t.isValidNumber(o)&&(d.from.low=o,d.to.low=n))),d})(this.target,this.params,this.params.options)}onUpdate(e,t,i){const r=this.target.attribute;this.propKeys.forEach((e=>{r[e]=this.from[e]+(this.to[e]-this.from[e])*t})),this.target.setAttributes(r)}}const Ae="candlestick";var Fe,Te;!function(e){e.OPEN="open",e.HIGH="high",e.LOW="low",e.CLOSE="close",e.SERIES_FIELD="seriesField"}(Fe||(Fe={})),function(e){e.candlestick="candlestick"}(Te||(Te={}));const Le=Object.assign(Object.assign({},t.baseSeriesMark),{candlestick:{name:"candlestick",type:"candlestick"}});class we extends t.BaseSeriesTooltipHelper{constructor(){super(...arguments),this.getContentKey=e=>t=>{switch(e){case Fe.OPEN:return this.series.getOpenField();case Fe.HIGH:return this.series.getHighField();case Fe.LOW:return this.series.getLowField();case Fe.CLOSE:return this.series.getCloseField();case Fe.SERIES_FIELD:return this.series.getSeriesField()}return null},this.getContentValue=e=>t=>{switch(e){case Fe.OPEN:return t[this.series.getOpenField()];case Fe.HIGH:return t[this.series.getHighField()];case Fe.LOW:return t[this.series.getLowField()];case Fe.CLOSE:return t[this.series.getCloseField()];case Fe.SERIES_FIELD:return t[this.series.getSeriesField()]}return null},this.shapeColorCallback=e=>this.series.getMarkInName("candlestick").getAttribute("stroke",e)}getDefaultContentList(e){return[{key:this.getContentKey(Fe.OPEN),value:this.getContentValue(Fe.OPEN)},{key:this.getContentKey(Fe.HIGH),value:this.getContentValue(Fe.HIGH)},{key:this.getContentKey(Fe.LOW),value:this.getContentValue(Fe.LOW)},{key:this.getContentKey(Fe.CLOSE),value:this.getContentValue(Fe.CLOSE)},{key:this.getContentKey(Fe.SERIES_FIELD),value:this.getContentValue(Fe.SERIES_FIELD)}]}}const Oe={rising:{style:{boxFill:"#FF0000",stroke:"#FF0000"}},falling:{style:{boxFill:"#00AA00",stroke:"#00AA00"}},doji:{style:{boxFill:"#000000",stroke:"#000000"}},candlestick:{style:{lineWidth:1}}};class Ie extends t.CartesianSeries{constructor(){super(...arguments),this.type=Ae,this._mergedStyles={rising:{},falling:{},doji:{}}}getOpenField(){return this._openField}getHighField(){return this._highField}getLowField(){return this._lowField}getCloseField(){return this._closeField}getBoxFill(){return this._boxFill}getStrokeColor(){return this._strokeColor}setAttrFromSpec(){var e,t,i,r,a,s,n,o;super.setAttrFromSpec();const l=this._spec,d=null!==(t=null===(e=l.candlestick)||void 0===e?void 0:e.style)&&void 0!==t?t:{};this._openField=l.openField,this._highField=l.highField,this._lowField=l.lowField,this._closeField=l.closeField,this._boxWidth=d.boxWidth,this._boxFill=d.boxFill,this._strokeColor=d.strokeColor,this._buildMergedStyles(d,null!==(r=null===(i=l.rising)||void 0===i?void 0:i.style)&&void 0!==r?r:{},null!==(s=null===(a=l.falling)||void 0===a?void 0:a.style)&&void 0!==s?s:{},null!==(o=null===(n=l.doji)||void 0===n?void 0:n.style)&&void 0!==o?o:{})}initMark(){this._candlestickMark=this._createMark(Ie.mark.candlestick,{groupKey:this._seriesField,isSeriesMark:!0})}initMarkStyle(){var e;const i=this._candlestickMark;if(i){const r={fill:e=>this.mergeStyle(e).boxFill,stroke:e=>this.mergeStyle(e).stroke,lineWidth:e=>this.mergeStyle(e).lineWidth,boxWidth:null!==(e=this._boxWidth)&&void 0!==e?e:this._getMarkWidth.bind(this),x:this.dataToPositionX.bind(this)};i.setGlyphConfig({}),this.setMarkStyle(i,r,t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}}initCandlestickMarkStyle(){var e;const i=this._candlestickMark,r=this._yAxisHelper;if(i&&r){const{dataToPosition:a}=r,s=null===(e=null==r?void 0:r.getScale)||void 0===e?void 0:e.call(r,0);this.setMarkStyle(i,{open:e=>t.valueInScaleRange(a(this.getDatumPositionValues(e,this._openField),{bandPosition:this._bandPosition}),s),high:e=>t.valueInScaleRange(a(this.getDatumPositionValues(e,this._highField),{bandPosition:this._bandPosition}),s),low:e=>t.valueInScaleRange(a(this.getDatumPositionValues(e,this._lowField),{bandPosition:this._bandPosition}),s),close:e=>t.valueInScaleRange(a(this.getDatumPositionValues(e,this._closeField),{bandPosition:this._bandPosition}),s)},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}}init(e){super.init(e),this.initCandlestickMarkStyle()}_initAnimationSpec(e={}){const i=t.merge({},e);return["appear","enter","update","exit","disappear"].forEach((e=>{i[e]&&"scaleIn"===i[e].type?i[e].type="candlestickScaleIn":i[e]&&"scaleOut"===i[e].type&&(i[e].type="candlestickScaleOut")})),i}initAnimation(){var e;const i=t.getGroupAnimationParams(this);if(this._candlestickMark){const r=this._initAnimationSpec(null===(e=t.Factory.getAnimationInKey("scaleInOut"))||void 0===e?void 0:e()),a=this._initAnimationSpec(t.userAnimationConfig(Ae,this._spec,this._markAttributeContext));this._candlestickMark.setAnimationConfig(t.animationConfig(r,a,i))}}initTooltip(){this._tooltipHelper=new we(this),this._candlestickMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._candlestickMark)}_buildMergedStyles(e,i,r,a){this._mergedStyles.rising=t.merge({},e,i),this._mergedStyles.falling=t.merge({},e,r),this._mergedStyles.doji=t.merge({},e,a)}mergeStyle(e){const t=this.getDatumPositionValues(e,this._openField)[0],i=this.getDatumPositionValues(e,this._closeField)[0];return t<i?this._mergedStyles.rising:t>i?this._mergedStyles.falling:this._mergedStyles.doji}_getMarkWidth(){if(this._autoBoxWidth)return this._autoBoxWidth;const e=this._xAxisHelper,t=this._fieldX,i=e.getBandwidth(t.length-1)/t.length;return this._autoBoxWidth=i,this._autoBoxWidth}onLayoutEnd(){super.onLayoutEnd(),this._autoBoxWidth=null}getActiveMarks(){return[this._candlestickMark]}}Ie.type=Ae,Ie.builtInTheme={candlestick:Oe},Ie.mark=Le;const Ee=()=>{t.registerGlyphMark(),t.registerLine(),t.registerRect(),t.Factory.registerGraphicComponent("line",(e=>t.createLine(e))),t.Factory.registerGraphicComponent("rect",(e=>t.createRect(e))),t.Factory.registerMark(ke.type,ke),t.registerSymbolMark(),t.registerScaleInOutAnimation(),t.registerCartesianBandAxis(),t.registerCartesianLinearAxis(),t.AnimateExecutor.registerBuiltInAnimate("candlestickScaleIn",Me),t.AnimateExecutor.registerBuiltInAnimate("candlestickScaleOut",Ce),t.Factory.registerSeries(Ie.type,Ie)};class De extends t.BaseChart{_setModelOption(){this._modelOption.getDimensionInfo=t.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=t.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=t.getCartesianCrosshairRect}}De.type="candlestick",De.seriesType=Ae,De.transformerConstructor=Se;function Be(e){e.yField=[e.openField,e.highField,e.lowField,e.closeField]}class Pe extends t.CartesianChartSpecTransformer{needAxes(){return!0}transformSpec(e){this.transformRegion(e),void 0===e.tooltip&&(e.tooltip={}),this.transformSeriesSpec(e),this._transformAxisSpec(e),this._transformLayout(e)}transformRegion(e){var t,i;const r=e;r.region=[null!==(t=e.candlestickRegion)&&void 0!==t?t:{}],e.previewSeries&&r.region.push(null!==(i=e.previewRegion)&&void 0!==i?i:{})}transformSeriesSpec(e){var i;e.series=null!==(i=e.series)&&void 0!==i?i:[],e.series.forEach((t=>{this._transformSeriesData(e,t),t.regionIndex=0}));const r=e.series.find((t=>t.id===e.candlestickSeries.id));let a;r?(t.merge(r,e.candlestickSeries),a=r):(e.series.push(e.candlestickSeries),a=e.candlestickSeries),Be(a),this._transformSeriesData(e,a),a.regionIndex=0,e.previewSeries&&t.array(e.previewSeries).forEach((i=>{const r=e.series.find((e=>e.id===i.id));let a;r?(t.merge(r,i),a=r):(e.series.push(i),a=i),a.regionIndex=1,this._transformSeriesData(e,a)}))}_transformSeriesData(e,i){var r;i.data&&(e.data=t.array(null!==(r=e.data)&&void 0!==r?r:[]),t.array(i.data).forEach(((t,r)=>{e.data.push(t),0===r&&(i.dataIndex=e.data.length-1,"id"in t?i.dataId=t.id:"name"in t&&(i.dataId=t.name))})),delete i.data)}_transformAxisSpec(e){super._transformAxisSpec(e),e.previewSeries&&(e.previewAxes||(e.previewAxes={type:"linear",orient:"left",visible:!1}),e.previewAxes.regionIndex=[1],e.axes.push(e.previewAxes),e.axes.forEach((t=>{t!==e.previewAxes&&("left"!==t.orient&&"right"!==t.orient||(t.regionIndex=[0]))})))}_transformDataZoomSpec(e){e.dataZoom&&t.array(e.dataZoom).forEach((e=>{"left"!==e.orient&&"right"!==e.orient||(e.regionIndex=[0])}))}_transformLayout(e){var i,r;const a={type:"grid",col:2,row:6,elements:[],colWidth:[],rowHeight:[]};let s=0,n=0;if(e.title&&!1!==(null===(i=e.title)||void 0===i?void 0:i.visible)&&s++,e.legends){const i=t.array(e.legends)[0];!1!==(null==i?void 0:i.visible)&&("top"===i.orient||"bottom"===i.orient?s++:n++)}if(e.dataZoom&&t.array(e.dataZoom).forEach((e=>{!1!==(null==e?void 0:e.visible)&&("top"===e.orient||"bottom"===e.orient?s++:n++)})),e.axes){const i={top:!1,bottom:!1,left:!1,right:!1,z:!1};t.array(e.axes).forEach((e=>{i[e.orient]||(i[e.orient]=!0,"top"===e.orient||"bottom"===e.orient?s++:n++)}))}s++,n++,e.previewSeries&&s++,a.row=s,a.col=n;const o={top:0,bottom:0,left:0,right:0};if(e.title&&!1!==(null===(r=e.title)||void 0===r?void 0:r.visible)&&this._layoutOrientItem(a,e.title,o,{specKey:"title",index:0},"total"),e.legends){const i=t.array(e.legends)[0];!1!==(null==i?void 0:i.visible)&&this._layoutOrientItem(a,i,o,{specKey:"legends",index:0},"less")}if(e.dataZoom&&t.array(e.dataZoom).forEach(((e,t)=>{!1!==(null==e?void 0:e.visible)&&this._layoutOrientItem(a,e,o,{specKey:"dataZoom",index:t},"one")})),e.axes){const t={left:!1,right:!1};e.axes.forEach(((e,i)=>{"left"!==e.orient&&"right"!==e.orient||t[e.orient]||(t[e.orient]=!0,this._layoutOrientItem(a,e,o,{specKey:"axes",index:i},"one"))}))}const l=this._layoutOrientItem(a,{orient:"top"},o,{specKey:"region",index:0},"one");if(e.previewSeries){const i=this._layoutOrientItem(a,{orient:"bottom"},o,{specKey:"region",index:1},"one"),r=e.axes.findIndex((t=>t===e.previewAxes));if(-1!==r){const e={col:i.col-1,row:i.row,modelKey:"axes",modelIndex:r};a.elements.push(e)}if(e.previewHeight)if("string"==typeof e.previewHeight){if(t.isPercent(e.previewHeight)){const t=e.previewHeight;a.rowHeight.push({index:i.row,size:e=>Number(t.substring(0,t.length-1))*e/100})}}else a.rowHeight.push({index:i.row,size:e.previewHeight})}const d=e.axes.findIndex((e=>"bottom"===e.orient));this._layoutOrientItem(a,e.axes[d],o,{specKey:"axes",index:d},"one"),e.axes.forEach(((t,i)=>{if(t===e.previewAxes)return;const r=a.elements.find((e=>"modelKey"in e&&"axes"===e.modelKey&&e.modelIndex===i));r&&("top"===t.orient||"bottom"===t.orient?r.col=l.col:r.row=l.row)})),t.array(e.dataZoom).forEach(((e,t)=>{const i=a.elements.find((e=>"modelKey"in e&&"dataZoom"===e.modelKey&&e.modelIndex===t));i&&("top"===e.orient||"bottom"===e.orient?i.col=l.col:i.row=l.row)})),e.layout=a}_layoutOrientItem(e,t,i,r,a){var s;const n={modelKey:r.specKey,modelIndex:r.index,col:0,row:0},o=null!==(s=t.orient)&&void 0!==s?s:"top",{span:l,index:d}=this._getLayoutElementCommon(e,i,a,o);return e.elements.push(n),"top"===o?(n.row=i.top,n.rowSpan=1,n.colSpan=l,n.col=d,i.top++):"bottom"===o?(n.row=e.row-i.bottom-1,n.rowSpan=1,n.colSpan=l,n.col=d,i.bottom++):"left"===o?(n.col=i.left,n.colSpan=1,n.rowSpan=l,n.row=d,i.left++):"right"===o&&(n.col=e.col-i.right-1,n.colSpan=1,n.rowSpan=l,n.row=d,i.right++),n}_getLayoutElementCommon(e,t,i,r){return"top"===r||"bottom"===r?{span:"total"===i?e.col:"one"===i?1:e.col-t.left-t.right,index:"total"===i?0:t.left}:{span:"total"===i?e.row:"one"===i?1:e.row-t.top-t.bottom,index:"total"===i?0:t.top}}}class je extends t.BaseChart{constructor(){super(...arguments),this.type=_e,this.transformerConstructor=Pe}_setModelOption(){this._modelOption.getDimensionInfo=(e,i,r)=>{var a;return[...null!==(a=t.getCartesianDimensionInfo(e,i,r))&&void 0!==a?a:[]]},this._modelOption.getDimensionInfoByValue=t.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=t.getCartesianCrosshairRect}}je.type=_e,je.transformerConstructor=Pe,t.mixin(je,t.StackChartMixin);const Re=e=>({custom:t.RotateBySphereAnimate,customParameters:()=>e,easing:"linear",loop:1/0,duration:6e3});class Ve extends t.BaseWordCloudSeries{constructor(){super(...arguments),this.type=$.wordCloud3d}_wordCloudTransformOption(){var e;return Object.assign(Object.assign({},super._wordCloudTransformOption()),{postProjection:null!==(e=this._spec.postProjection)&&void 0!==e?e:"StereographicProjection",depth_3d:this._spec.depth_3d})}_wordCloudShapeTransformOption(){var e;return Object.assign(Object.assign({},super._wordCloudShapeTransformOption()),{postProjection:null!==(e=this._spec.postProjection)&&void 0!==e?e:"StereographicProjection",depth_3d:this._spec.depth_3d})}initMark(){this._wordMark=this._createMark(t.BaseWordCloudSeries.mark.word,{groupKey:this._seriesField,isSeriesMark:!0},{support3d:!0})}initMarkStyle(){super.initMarkStyle();const e=this._wordMark;e&&this.setMarkStyle(e,{z:e=>{var t;return null!==(t=e.z)&&void 0!==t?t:0}},"normal",t.AttributeLevel.Series)}initAnimation(){var e,i;const r=null!==(e=this._padding)&&void 0!==e?e:{};this._wordMark&&this._wordMark.setAnimationConfig(t.animationConfig(null===(i=t.Factory.getAnimationInKey("wordCloud3d"))||void 0===i?void 0:i((()=>{var e;const t=this.getCompiler().getStage(),i=t.width-r.left||0-r.right||0,a=t.height-r.top||0-r.bottom||0,s=Math.max(i,a)/2;return{center:{x:s,y:s,z:null!==(e=this._spec.depth_3d)&&void 0!==e?e:s},r:s}})),t.userAnimationConfig("word",this._spec,this._markAttributeContext)))}}Ve.type=$.wordCloud3d,Ve.builtInTheme={wordCloud3d:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}}};const Ne=()=>{t.registerTextMark(),t.Factory.registerAnimation("wordCloud3d",(e=>({appear:Re(e)}))),t.Factory.registerSeries(Ve.type,Ve)},ze=()=>{Ne()};class He extends t.BaseWordCloudChartSpecTransformer{_getDefaultSeriesSpec(e){const t=super._getDefaultSeriesSpec(e);return t.depth_3d=e.depth_3d,t}}class Ge extends t.BaseWordCloudChart{constructor(){super(...arguments),this.transformerConstructor=He,this.type="wordCloud3d",this.seriesType=$.wordCloud3d}}Ge.type="wordCloud3d",Ge.seriesType=$.wordCloud3d,Ge.transformerConstructor=He;const We=()=>{q(),Ne(),t.Factory.registerChart(Ge.type,Ge)},$e={label:{space:0}};class Ke{setLayout3dBox(e){this.layout3dBox=e}_afterUpdateAttribute(e,i){const r=t.isZAxis(this._orient),a=t.isXAxis(this._orient),s=t.isYAxis(this._orient);let n=0,o=0;if(!i){const e=this.getRegions();let{x:t,y:i}=e[0].getLayoutStartPoint(),r=t+e[0].getLayoutRect().width,a=i+e[0].getLayoutRect().height;for(let s=1;s<e.length;s++){const n=e[s],{x:o,y:l}=n.getLayoutStartPoint(),{width:d,height:c}=n.getLayoutRect();t=Math.min(t,o),r=Math.max(r,d+o),i=Math.min(i,l),a=Math.max(a,c+l)}n=Math.abs(a-i),o=Math.abs(r-t)}let l=0,d=0;const{width:c,height:u}=this.getLayoutRect();let h={x:0,y:0};a?(h={x:c,y:0},l=n,d=c):s&&(h={x:0,y:u},l=o,d=u);const g=this.layout3dBox?this.layout3dBox.length:0;if(!r){const t=this.getLabelItems(d);return e.grid={length:l},e.start={x:0,y:0},e.text=this._spec.title.text||this._dataFieldText,e.maxWidth=this._getTitleLimit(a),e.items=t,e.grid={type:"line",start:{x:0,y:0},end:h,items:t[0],depth:g,length:l},e}return((e,i)=>{var r;const a=t.getCombinedSizeOfRegions(e.getRegions()),{width:s}=e.getLayoutRect(),n=s,o=e.layout3dBox?e.layout3dBox.length:0,l=e.layout3dBox?e.layout3dBox.width:0,d={x:o,y:0},c=e.getLabelItems(n),u={start:{x:0,y:0},end:d,title:{text:e._spec.title.text||e._dataFieldText,maxWidth:e._getTitleLimit(!1)},items:c,scale:e._scale.clone()},h=null!==(r=e.directionStr)&&void 0!==r?r:"r2l";let g=[0,0],p=-Math.PI/2,m=0;return"l2r"===h&&(m=e.layout3dBox.length,g=[0,0,0],p=Math.PI/2),u.z=m,u.alpha=p,u.anchor3d=g,i||(u.grid={type:"line",start:{x:0,y:0},end:d,items:c[0],verticalFactor:e._axisStyle.verticalFactor,depth:l,length:i?0:a.height,alpha:p,z:m,anchor3d:g}),u})(this,i)}}const Ue=Object.assign(Object.assign({},Z),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}});class Xe extends t.RangeColumnSeries{constructor(){super(...arguments),this.type=$.rangeColumn3d,this._barMarkType="rect3d",this._barName=$.bar3d}}Xe.type=$.rangeColumn3d,Xe.mark=Ue;const Ye=()=>{ee(),t.registerCartesianBandAxis(),t.registerCartesianLinearAxis(),t.Factory.registerSeries(Xe.type,Xe)};class qe extends t.RangeColumnSeriesSpecTransformer{_transformLabelSpec(e){var t;"bothEnd"!==(null===(t=e.label)||void 0===t?void 0:t.position)&&this._addMarkLabelSpec(e,"bar3d")}}class Ze extends t.CartesianChartSpecTransformer{_getDefaultSeriesSpec(e){var t,i;const r=super._getDefaultSeriesSpec(e,["bar3d","barGapInGroup"]);return"horizontal"===e.direction?r.xField=null!==(t=e.xField)&&void 0!==t?t:[e.minField,e.maxField]:r.yField=null!==(i=e.yField)&&void 0!==i?i:[e.minField,e.maxField],r}}class Je extends t.BaseChart{constructor(){super(...arguments),this.transformerConstructor=Ze,this.type="rangeColumn3d",this.seriesType=$.rangeColumn3d}_setModelOption(){this._modelOption.getDimensionInfo=t.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=t.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=t.getCartesianCrosshairRect}}Je.type="rangeColumn3d",Je.seriesType=$.rangeColumn3d,Je.transformerConstructor=Ze;const Qe="pictogram",et="pictogram";var tt;!function(e){e.pictogram="pictogram"}(tt||(tt={}));const it=Object.assign(Object.assign({},t.baseSeriesMark),{pictogram:{name:"pictogram",type:"group"}});class rt extends t.BaseChartSpecTransformer{_isValidSeries(e){return e===et}_getDefaultSeriesSpec(e){return super._getDefaultSeriesSpec(e,["type","nameField","valueField","svg","pictogram","defaultFillColor"])}transformSpec(e){super.transformSpec(e),e.region.forEach((e=>{e.coordinate="geo"})),super.transformSeriesSpec(e)}}const at=new Map,st="_vchartViewportRect";let nt;const ot=/-?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?/gi;function lt(e,i){at.has(e)&&t.warn(`svg source key of '${e}' already exists, will be overwritten.`),nt||(nt=new t.DataSet,t.registerDataSetInstanceParser(nt,"svg",t.svgParser));const r=new t.DataView(nt);r.parse(i,{type:"svg"});const a=r.latestData,s=function(e){var t,i,r,a;const s=null===(t=e.match(/<svg\b[\s\S]*?>/i))||void 0===t?void 0:t[0],n=null===(i=null==s?void 0:s.match(/\benable-background\s*=\s*(['"])(.*?)\1/i))||void 0===i?void 0:i[2];if(!n||!/^\s*new\b/i.test(n))return null;const o=null!==(a=null===(r=n.match(ot))||void 0===r?void 0:r.map(Number))&&void 0!==a?a:[],[l,d,c,u]=o;return!Number.isFinite(l)||!Number.isFinite(d)||!Number.isFinite(c)||!Number.isFinite(u)||c<=0||u<=0?null:{x:l,y:d,width:c,height:u}}(i);a&&s&&!a.viewBoxRect&&!function(e){return Number.isFinite(e.width)&&Number.isFinite(e.height)&&e.width>0&&e.height>0}(a)&&(a[st]=s),at.set(e,r)}function dt(e){at.has(e)?at.delete(e):t.warn(`map type of '${e}' does not exists.`)}function ct(e){return at.get(e)}class ut extends t.BaseSeriesSpecTransformer{_getDefaultSpecFromChart(e){var i,r,a;const s=null!==(i=super._getDefaultSpecFromChart(e))&&void 0!==i?i:{},n=e.svg,o=null===(a=null===(r=at.get(n))||void 0===r?void 0:r.latestData)||void 0===a?void 0:a.elements;if(o&&o.length){o.map((e=>e.name)).filter((e=>t.isValid(e))).forEach((t=>{e[t]&&(s[t]=e[t])}))}return s}}class ht extends t.BaseSeriesTooltipHelper{constructor(){super(...arguments),this.dimensionTooltipTitleCallback=e=>{var t;const i=this.series;return null!==(t=this._getDimensionData(e))&&void 0!==t?t:i.getDatumName(e)},this.markTooltipValueCallback=(e,t)=>{const{measureFields:i}=this._seriesCacheInfo;if(i[0]&&e.data)return e.data[i[0]]},this.markTooltipKeyCallback=e=>{var t;return null===(t=e.data)||void 0===t?void 0:t[this.series.getDimensionField()[0]]}}}const gt="element-highlight-by-graphic-name";class pt extends t.ElementHighlight{constructor(){super(...arguments),this.type=gt,this.handleStart=e=>{if(e&&e.item&&this.isGraphicInMark(e.item)){if(this.options.shouldStart?this.options.shouldStart(e):this._filterByName(e)){const t=this._parseTargetKey(e);this.start(t)}}},this.handleReset=e=>{e&&e.item&&this.isGraphicInMark(e.item)&&this.reset()}}_filterByName(e){var t;return!!(null===(t=null==e?void 0:e.node)||void 0===t?void 0:t.name)}_parseTargetKey(e){return e.node.name}start(e){if(t.isNil(e))return;const{interaction:i,highlightState:r,blurState:a}=this.options,s=i.getStatedGraphics(this),n=[];this.getMarks().forEach((t=>{var i;null===(i=t.getGraphics())||void 0===i||i.forEach((t=>{t.name===e&&n.push(t)}))})),i.updateStates(this,n,s,r,a),i.setStatedGraphics(this,n)}reset(){const{highlightState:e,blurState:t,interaction:i}=this.options;i.clearAllStatesOfTrigger(this,e,t),i.setStatedGraphics(this,[])}}pt.type=gt;const mt="element-select-by-graphic-name";class yt extends t.ElementSelect{constructor(){super(...arguments),this.type=mt}start(e){const t=null==e?void 0:e.name;t&&this.getMarks().forEach((e=>{var i;null===(i=e.getGraphics())||void 0===i||i.forEach((e=>{e.name===t&&super.start(e)}))}))}}yt.type=mt;function vt(e){var i;return t.isValid(e)&&"none"!==e&&!(null===(i=e.includes)||void 0===i?void 0:i.call(e,"url"))}const ft=e=>{const t=parseFloat(e.strokeWidth);if(!isNaN(t))return t;const i=e.stroke;return i&&vt(i)?1:0},bt=(e,t)=>{var i;const r=null!==(i=e.fill)&&void 0!==i?i:t;return r&&vt(r)?r:void 0},xt=(e,t)=>{var i;const r=null!==(i=e.stroke)&&void 0!==i?i:t;return!(!r||!vt(r))&&r},_t=e=>Object.assign(Object.assign({},e),{x:parseFloat(e.x)||void 0,y:parseFloat(e.y)||void 0,fillStrokeOrder:!1,fill:bt(e),lineWidth:ft(e),stroke:xt(e)}),St={group:e=>{const t=_t(e);return Object.assign(Object.assign({},t),{visibleAll:!1!==t.visible})},rule:e=>Object.assign(Object.assign({},_t(e)),{x:parseFloat(e.x1),y:parseFloat(e.y1),x1:parseFloat(e.x2),y1:parseFloat(e.y2)}),rect:e=>Object.assign(Object.assign({},_t(e)),{fill:bt(e,"#000"),width:parseFloat(e.width),height:parseFloat(e.height)}),polygon:e=>Object.assign(Object.assign({},_t(e)),{fill:bt(e,"#000"),points:e.points.trim().split(/\s+/).map((e=>{const[t,i]=e.split(",").map(Number);return{x:t,y:i}}))}),line:e=>Object.assign(Object.assign({},_t(e)),{points:e.points.trim().split(/\s+/).map((e=>{const[t,i]=e.split(",").map(Number);return{x:t,y:i}}))}),path:e=>Object.assign(Object.assign({},_t(e)),{path:e.d,fillStrokeOrder:!1,fill:bt(e,"#000")}),arc:e=>{var t;return Object.assign(Object.assign({},_t(e)),{outerRadius:null!==(t=e.r)&&void 0!==t?t:e.ry,x:parseFloat(e.cx),y:parseFloat(e.cy),startAngle:0,endAngle:2*Math.PI,scaleX:parseFloat(e.rx)/parseFloat(e.ry)||1,fill:bt(e,"#000")})},text:(e,t)=>{var i,r;return Object.assign(Object.assign({},_t(e)),{text:t,textAlign:null!==(i=e.textAlign)&&void 0!==i?i:"left",textBaseLine:null!==(r=e.textAnchor)&&void 0!==r?r:"middle",anchor:[0,0],fill:bt(e,"#000")})}},kt=e=>{var i,r;if(!e||!e[0])return{};const{elements:a}=e[0].latestData;if(a&&a.length){a.forEach(((e,i)=>{var r;e[t.DEFAULT_DATA_INDEX]=i,e._uniqueId=`${e.id}-${i}`,e.data=void 0;const{graphicType:a,transform:s}=e,n={visible:"hidden"!==e.attributes.visibility&&"collapse"!==e.attributes.visibility};"text"===e.graphicType?t.merge(n,e._inheritStyle,null===(r=e.parent)||void 0===r?void 0:r._textGroupStyle,e.attributes):"group"!==e.graphicType&&t.merge(n,e._inheritStyle,e.attributes),St[a]?e._finalAttributes=St[a](n,e.value):e._finalAttributes=n,s&&(e._finalAttributes.postMatrix=Object.assign({},s))}));const e=a.filter((e=>"text"===e.tagName));for(let s=0;s<e.length;s++){const n=e[s]._uniqueId,o=a.filter((e=>{let t=!1,i=e.parent;for(;i;){if(i._uniqueId===n){t=!0;break}i=i.parent}return t}));if(o&&o.length){const a=null!==(r=null===(i=e[s]._textGroupStyle)||void 0===i?void 0:i.x)&&void 0!==r?r:0;let n=a;for(let e=0;e<o.length;e++){const i=o[e];if("group"===i.graphicType)n=a;else if(i.value&&void 0===i.parent._textGroupStyle.x){const r=o.slice(0,e).reverse().find((e=>"text"===e.graphicType&&e.value));if(r){n+=t.measureText(r.value,r._finalAttributes).width}i._finalAttributes.x=n}}}}}return a};class Mt extends t.GeoSeries{constructor(){super(...arguments),this.type=et,this._idToMark=new Map}setAttrFromSpec(){var e,t,i;super.setAttrFromSpec(),this.svg=this._spec.svg,this._nameField=this._spec.nameField,this._valueField=this._spec.valueField,this.svg||null===(e=this._option)||void 0===e||e.onError("svg source is not specified !"),this._parsedSvgResult=null===(t=ct(this.svg))||void 0===t?void 0:t.latestData,this._parsedSvgResult||null===(i=this._option)||void 0===i||i.onError(`'${this.svg}' is not registered !`)}getDatumCenter(e){return[Number.NaN,Number.NaN]}getDatumName(e){return e.name||e._nameFromParent}getMarksWithoutRoot(){return this.getMarks().filter((e=>e.name&&!e.name.includes("seriesGroup")&&!e.name.includes("root")&&e!==this._pictogramMark))}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.getTransformMatrix=this.getRootMatrix.bind(this),this._markAttributeContext.coordToPosition=this.coordToPosition.bind(this),this._markAttributeContext.dataToPosition=this.dataToPosition.bind(this)}_defaultHoverConfig(e){return{type:"element-highlight-by-graphic-name",trigger:e.trigger,triggerOff:"pointerout",blurState:t.STATE_VALUE_ENUM.STATE_HOVER_REVERSE,highlightState:t.STATE_VALUE_ENUM.STATE_HOVER}}_defaultSelectConfig(e){const i="multiple"===e.mode,r=t.isValid(e.triggerOff)?e.triggerOff:i?["empty","self"]:["empty",e.trigger];return{type:"element-select-by-graphic-name",trigger:e.trigger,triggerOff:r,reverseState:t.STATE_VALUE_ENUM.STATE_SELECTED_REVERSE,state:t.STATE_VALUE_ENUM.STATE_SELECTED,isMultiple:i}}initMark(){var e;if(this._pictogramMark=this._createMark(Mt.mark.pictogram,{groupKey:this.getDimensionField()[0],isSeriesMark:!0,skipBeforeLayouted:!0},{morph:t.shouldMarkDoMorph(this._spec,Mt.mark.pictogram.name)}),this._pictogramMark){this._pictogramMark.setData(this._mapViewData),this._pictogramMark.setUserId(Mt.mark.pictogram.name);for(const i of this._mapViewData.getDataView().latestData){const{graphicType:r,name:a,parent:s,id:n,_nameFromParent:o,_uniqueId:l}=i,d=this._createMark({type:r,name:null!=a?a:o},{groupKey:l,isSeriesMark:!1,skipBeforeLayouted:!0,parent:null!==(e=this._idToMark.get(null==s?void 0:s._uniqueId))&&void 0!==e?e:this._pictogramMark},{morph:t.shouldMarkDoMorph(this._spec,Mt.mark.pictogram.name)});d&&(d.setData(this._mapViewData),d.setUserId(l),this._idToMark.set(l,d),"group"!==d.type&&d.setMarkConfig({graphicName:d.name}),d.setTransform([{type:"filter",callback:e=>e._uniqueId===l}]))}this._initLabelMark()}}_initLabelMark(){if(!0!==this._spec.label.visible)return;const e=this._createMark(Mt.mark.label,{isSeriesMark:!1,parent:this._pictogramMark,groupKey:"_uniqueId",skipBeforeLayouted:!0});e&&(this._labelMark=e,this._labelMark.setData(this._mapViewData))}initLabelMarkStyle(){this._labelMark&&this.setMarkStyle(this._labelMark,{visible:e=>!!this._validElement(e),x:e=>{var t;return null===(t=this.dataToPosition(e,!0))||void 0===t?void 0:t.x},y:e=>{var t;return null===(t=this.dataToPosition(e,!0))||void 0===t?void 0:t.y},text:e=>e[this.nameField],textAlign:"center",textBaseline:"middle"},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}initMarkStyle(){const{root:e}=this._parsedSvgResult,i=this._getSvgViewportRect(),r=this._mapViewData.getDataView().latestData;e&&(this.setMarkStyle(this._pictogramMark,St.group(e.attributes),"normal",t.AttributeLevel.Built_In),this.setMarkStyle(this._pictogramMark,{postMatrix:()=>this._getFittedSvgRootMatrix()},"normal",t.AttributeLevel.Built_In),i&&this._pictogramMark.setMarkConfig({clip:!0,clipPath:[t.createRect(Object.assign(Object.assign({},i),{fill:!0}))]}));for(const e of r){const{_uniqueId:i,_finalAttributes:r}=e,a=this._idToMark.get(i),s=this._validElement(e);a&&(this.setMarkStyle(a,{keepStrokeScale:!0},"normal",t.AttributeLevel.Built_In),s?(this.initMarkStyleWithSpec(a,t.merge({},this._spec.pictogram,this._spec[a.name])),this.setMarkStyle(a,r,"normal",t.AttributeLevel.Series),a.setPostProcess("fill",((e,i)=>t.isValid(e)?e:this._spec.defaultFillColor))):(a.setMarkConfig({interactive:!1}),this.setMarkStyle(a,r,"normal",t.AttributeLevel.Built_In)))}this.initLabelMarkStyle()}_validElement(e){return e.name||e._nameFromParent}initTooltip(){this._tooltipHelper=new ht(this),this.getMarksWithoutRoot().forEach((e=>{e&&e.name&&this._tooltipHelper.activeTriggerSet.mark.add(e)}))}dataToPosition(e,i=!1){if(!e)return null;const r=e[this.nameField];if(!r)return null;const a=this.getMarksWithoutRoot().filter((e=>e.name===r));if(!a||0===a.length)return null;let s=new t.Bounds;i?a.forEach((e=>{s=s.union(e.getGraphics()[0].globalAABBBounds)})):a.forEach((e=>{s=s.union(e.getProduct().AABBBounds)}));const n={x:(s.x1+s.x2)/2,y:(s.y1+s.y2)/2};if(i){const{x:e,y:t}=this.getLayoutStartPoint();n.x-=e,n.y-=t}return n}coordToPosition(e){if(!e)return null;const{x:t,y:i}=e,r=this.getRootMatrix();if(!r)return null;const a={};return r.getInverse().transformPoint({x:t,y:i},a),a}getRootMatrix(){var e;return null===(e=this.getPictogramRootGraphic())||void 0===e?void 0:e.transMatrix}getPictogramRootGraphic(){return this._pictogramMark.getProduct()}_getSvgRootMatrix(){var e,i;const r=null===(i=null===(e=this._parsedSvgResult)||void 0===e?void 0:e.root)||void 0===i?void 0:i.transform;return r?new t.Matrix(r.a,r.b,r.c,r.d,r.e,r.f):new t.Matrix}_getSvgViewportRect(){var e,t,i,r;const a=null===(e=this._parsedSvgResult)||void 0===e?void 0:e.viewBoxRect;if(a)return a;const{width:s,height:n}=null!==(t=this._parsedSvgResult)&&void 0!==t?t:{};return Number.isFinite(s)&&Number.isFinite(n)&&s>0&&n>0?{x:0,y:0,width:s,height:n}:null!==(r=null===(i=this._parsedSvgResult)||void 0===i?void 0:i[st])&&void 0!==r?r:null}_getSvgRootBounds(e){const i=this._getSvgViewportRect();if(!i)return null;const r=(new t.Bounds).setValue(i.x,i.y,i.x+i.width,i.y+i.height);return r.transformWithMatrix(e),r}_appendMatrixScale(e,i,r){const a=new t.Matrix;return a.translate(r.x,r.y),a.scale(i,i),a.translate(-r.x,-r.y),a.multiply(e.a,e.b,e.c,e.d,e.e,e.f),a}_appendMatrixTranslate(e,i,r){const a=new t.Matrix;return a.translate(i,r),a.multiply(e.a,e.b,e.c,e.d,e.e,e.f),a}_getFittedSvgRootMatrix(){const e=this._getSvgRootMatrix(),t=this._getSvgRootBounds(e);if(!t)return e;const i=t.width(),r=t.height();if(!Number.isFinite(i)||!Number.isFinite(r)||i<=0||r<=0)return e;const{width:a,height:s}=this.getLayoutRect(),n=(t.x1+t.x2)/2,o=(t.y1+t.y2)/2,l=Math.min(a/i,s/r),d=this._appendMatrixScale(e,l,{x:n,y:o});return this._appendMatrixTranslate(d,a/2-n,s/2-o)}initData(){var e,i;super.initData();const r=at.get(this.svg);r||null===(e=this._option)||void 0===e||e.onError("no valid svg found!");const a=new t.DataView(this._dataSet,{name:`pictogram_${this.id}_data`});t.registerDataSetInstanceTransform(this._dataSet,"pictogram",kt),t.registerDataSetInstanceTransform(this._dataSet,"lookup",t.lookup),a.parse([r],{type:"dataview"}).transform({type:"pictogram"}).transform({type:"lookup",options:{from:()=>this.getViewData().latestData,key:"name",fields:this._nameField,set:(e,t)=>{t&&(e.data=t)}}}).transform({type:"lookup",options:{from:()=>this.getViewData().latestData,key:"_nameFromParent",fields:this._nameField,set:(e,t)=>{t&&(e.data=t)}}}),null===(i=this._data)||void 0===i||i.getDataView().target.addListener("change",a.reRunAllTransform),this._mapViewData=new t.CompilableData(this._option,a)}mapViewDataUpdate(){this._mapViewData.updateData()}onLayoutEnd(){var e;super.onLayoutEnd(),null===(e=this._mapViewData)||void 0===e||e.getDataView().reRunAllTransform()}updateSVGSize(){const e=this.getPictogramRootGraphic();e&&e.setAttributes({postMatrix:this._getFittedSvgRootMatrix()})}initEvent(){var e;super.initEvent(),null===(e=this._mapViewData.getDataView())||void 0===e||e.target.addListener("change",this.mapViewDataUpdate.bind(this))}handleZoom(e){const{scale:i,scaleCenter:r}=e;if(1===i)return;const a=this.getPictogramRootGraphic();a&&(a.attribute.postMatrix||a.setAttributes({postMatrix:new t.Matrix}),a.scale(i,i,r))}handlePan(e){const{delta:i}=e;if(0===i[0]&&0===i[1])return;const r=this.getPictogramRootGraphic();r&&(r.attribute.postMatrix||r.setAttributes({postMatrix:new t.Matrix}),r.translate(i[0],i[1]))}getMarkData(e){var t;return null!==(t=e.data)&&void 0!==t?t:{}}getMeasureField(){return[this.valueField]}getDimensionField(){return[this.nameField]}_getSeriesInfo(e,t){const i=this.getDefaultShapeType();return t.map((t=>({key:t,originalKey:t,style:this.getSeriesStyle({data:{[e]:t}}),shapeType:i})))}release(){this._parsedSvgResult=null,this._idToMark.clear(),this._idToMark=null}}Mt.type=et,Mt.mark=it,Mt.transformerConstructor=ut;const Ct=()=>{t.Factory.registerSeries(Mt.type,Mt),t.Factory.registerImplement("registerSVG",lt),t.Factory.registerImplement("unregisterSVG",dt),t.Factory.registerInteractionTrigger(pt.type,pt),t.Factory.registerInteractionTrigger(yt.type,yt)};class At extends t.BaseChart{constructor(){super(...arguments),this.transformerConstructor=rt,this.type=Qe,this.seriesType=et}}At.type=et,At.seriesType=Qe,At.transformerConstructor=rt;class Ft extends t.BaseChartSpecTransformer{transformSpec(e){super.transformSpec(e),this.transformSeriesSpec(e)}_getDefaultSeriesSpec(e){return super._getDefaultSeriesSpec(e,["urlField","nameField","valueField","imageSize","imageSizeRange","ratio","maskShape","imageMask","layoutConfig","image"])}}const Tt="imageCloud",Lt="imageCloud";var wt;!function(e){e.image="image",e.imageMask="imageMask"}(wt||(wt={}));const Ot=Object.assign(Object.assign({},t.baseSeriesMark),{image:{name:"image",type:"image"},imageMask:{name:"imageMask",type:"rect"}});class It extends t.ACustomAnimate{constructor(e,t,i,r,a){var s;super(e,t,i,r,a),this._rotations=null!==(s=null==a?void 0:a.rotation)&&void 0!==s?s:1}onBind(){this._scaleX=this.target.attribute.scaleX,t.isValidNumber(this._rotations)||(this.valid=!1)}onUpdate(e,t,i){var r;if(!1===this.valid)return;if(e)return void(i.scaleX=this._scaleX);const a=360*this._rotations*t*Math.PI/180,s=Math.abs(Math.cos(a))*(null!==(r=this._scaleX)&&void 0!==r?r:1);this.target.attribute.scaleX=s,this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag()}}function Et(e,i){switch(i){case"axialRotate":return[{custom:It,customParameters:{rotation:1},duration:t.DEFAULT_ANIMATION_CONFIG.appear.duration},{channel:{y:{from:(t,i)=>e.height()+i.getFinalAttribute().y},fillOpacity:{from:0,to:1}},easing:"sineInOut"}];case"growIn":return{channel:{scaleX:{from:0,to:1},scaleY:{from:0,to:1},x:{from:()=>e.center().x},y:{from:()=>e.center().y}},duration:t.DEFAULT_ANIMATION_CONFIG.appear.duration};case"scaleIn":return{type:"scaleIn",duration:t.DEFAULT_ANIMATION_CONFIG.appear.duration};default:return{type:"fadeIn",easing:"linear",duration:t.DEFAULT_ANIMATION_CONFIG.appear.duration}}}class Dt extends t.BaseSeriesTooltipHelper{constructor(){super(...arguments),this.markTooltipKeyCallback=e=>{var t,i;return null===(i=null===(t=this.series)||void 0===t?void 0:t.getMarkData(e))||void 0===i?void 0:i[this.series.getDimensionField()[0]]},this.markTooltipValueCallback=e=>{var t,i;const{measureFields:r}=this._seriesCacheInfo,a=null===(t=this.series)||void 0===t?void 0:t.getMarkData(e);if(r[0]&&a)return null!==(i=a[r[0]])&&void 0!==i?i:e.value},this.dimensionTooltipTitleCallback=e=>{var t;const{dimensionFields:i}=this._seriesCacheInfo,r=null===(t=this.series)||void 0===t?void 0:t.getMarkData(e);if(i[0]&&r)return r[i[0]]}}get defaultShapeType(){return"square"}}class Bt extends t.BaseSeries{constructor(){super(...arguments),this.type=Lt}setValueField(e){t.isValid(e)&&(this._valueField=e)}setAttrFromSpec(){super.setAttrFromSpec(),this._nameField=this._spec.nameField,this._valueField=this._spec.valueField,this._urlField=this._spec.urlField}initMark(){var e;(null===(e=this._spec.imageMask)||void 0===e?void 0:e.visible)&&(this._maskMark=this._createMark(Ot.imageMask,{dataView:!1,skipBeforeLayouted:!0})),this._imageMark=this._createMark(Ot.image,{key:e=>`${e[t.DEFAULT_DATA_KEY]}-${e.frequency}`,isSeriesMark:!0,skipBeforeLayouted:!0})}initMarkStyle(){this._initImageMarkStyle(),this._initMaskMarkStyle()}_initImageMarkStyle(){var e,i;if(!this._imageMark)return;this._imageMark.setTransform([Object.assign({type:"imagecloud"},this._imageCloudTransformOption())]),this.setMarkStyle(this._imageMark,{x:e=>e.x,y:e=>e.y,width:e=>e.width,height:e=>e.height,visible:e=>e.visible,angle:e=>e.angle,clipConfig:e=>e.clipConfig,image:e=>e[this._urlField],scaleCenter:["50%","50%"]},"normal",t.AttributeLevel.Series);"masked"===(null===(e=this._spec.layoutConfig)||void 0===e?void 0:e.placement)&&(this.setMarkStyle(this._imageMark,{globalCompositeOperation:"source-atop"},"normal",t.AttributeLevel.Series),this.setMarkStyle(this._rootMark,{width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height,globalCompositeOperation:"destination-in",clip:!0,drawMode:1},"normal",t.AttributeLevel.Series)),"stack"===(null===(i=this._spec.layoutConfig)||void 0===i?void 0:i.layoutMode)&&this.setMarkStyle(this._imageMark,{stroke:"white",lineWidth:2,shadowBlur:6,shadowColor:"grey"},"normal",t.AttributeLevel.Series)}isFillingImage(e){return e._frequency>1}_initMaskMarkStyle(){this._maskMark&&(this._maskMark.setMarkConfig({interactive:!1}),this.setMarkStyle(this._maskMark,{width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height},"normal",t.AttributeLevel.Series))}initTooltip(){this._tooltipHelper=new Dt(this),this._imageMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._imageMark)}_imageCloudTransformOption(){var e;return{size:()=>{const{width:e,height:t}=this._region.getLayoutRect();return[e,t]},image:{field:this._urlField},weight:{field:this._valueField},imageConfig:{imageSize:this._spec.imageSize,imageSizeRange:this._spec.imageSizeRange,padding:null===(e=this._spec.image)||void 0===e?void 0:e.padding},ratio:this._spec.ratio,mask:this._spec.maskShape,maskConfig:this._spec.imageMask,layoutConfig:this._spec.layoutConfig,createCanvas:t.vglobal.createCanvas.bind(t.vglobal),createImage:t.createImage,onUpdateMaskCanvas:((e,t)=>{var i;e&&this._maskMark&&this._maskMark.getProduct().getChildren().forEach((t=>{t.setAttribute("background",e)})),t&&"masked"===(null===(i=this._spec.layoutConfig)||void 0===i?void 0:i.placement)&&this._rootMark.getProduct().setAttribute("background",t)}).bind(this),onLayoutFinished:()=>{var e,t;return null===(t=null===(e=this._option.globalInstance.getChart().getOption().performanceHook)||void 0===e?void 0:e.afterWordcloudShapeDraw)||void 0===t?void 0:t.call(e,this._option.globalInstance)}}}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.isFillingImage=this.isFillingImage.bind(this)}initAnimation(){[this._imageMark].forEach((e=>{var i,r;if(e){const a=null===(r=null===(i=this._spec)||void 0===i?void 0:i.animationAppear)||void 0===r?void 0:r.preset,s={center:()=>{const{width:e,height:t}=this._region.getLayoutRect();return{x:e/2,y:t/2}},height:()=>{const{height:e}=this._region.getLayoutRect();return e}};e.setAnimationConfig(t.animationConfig(t.Factory.getAnimationInKey("imageCloud")(s,a),t.userAnimationConfig("image",this._spec,this._markAttributeContext)))}}))}getDimensionField(){var e;return[null!==(e=this._nameField)&&void 0!==e?e:this._spec.urlField]}getMeasureField(){return[this._valueField]}getStatisticFields(){const e=[];return e.push({key:this._nameField,operations:["values"]}),e.push({key:this._valueField,operations:["max","min"]}),e}getActiveMarks(){return[this._imageMark]}getMarkData(e){var t;return null!==(t=null==e?void 0:e.datum)&&void 0!==t?t:e}getGroupFields(){return[]}dataToPosition(e){return null}dataToPositionX(e){var t;return null===(t=this.dataToPosition(e))||void 0===t?void 0:t.x}dataToPositionY(e){var t;return null===(t=this.dataToPosition(e))||void 0===t?void 0:t.y}valueToPosition(e,t){return null}getStackGroupFields(){return[]}getStackValueField(){return""}}Bt.type=Lt,Bt.mark=Ot;const Pt=()=>{t.registerImageMark(),t.Factory.registerAnimation("imageCloud",((e,t)=>({appear:Et(e,t),enter:Et(e,t),exit:{type:"fadeOut"},disappear:{type:"fadeOut"}}))),t.Factory.registerSeries(Bt.type,Bt),t.Factory.registerGrammarTransform("imagecloud",{transform:t.imagecloudTransform})};class jt extends t.BaseChart{constructor(){super(...arguments),this.transformerConstructor=jt.transformerConstructor,this.type=Tt,this.seriesType=Lt}}jt.type=Tt,jt.seriesType=Lt,jt.transformerConstructor=Ft;class Rt extends t.BaseChartSpecTransformer{_getDefaultSeriesSpec(e){return super._getDefaultSeriesSpec(e,["timeField","eventField","seriesField","titleField","subTitleField","iconField","dot","title","subTitle","icon","line","arrow","labelPosition","sortDataByAxis"])}_setDefaultXAxisSpec(e){return{type:"band",orient:"bottom",label:{visible:!1},tick:{visible:!1},grid:{visible:!1},domainLine:{visible:!1},paddingInner:0,paddingOuter:0}}_setDefaultYAxisSpec(e){return{type:"band",inverse:!0,orient:"left",label:{visible:!1},tick:{visible:!1},grid:{visible:!1},domainLine:{visible:!1},paddingInner:0,paddingOuter:0}}_transformAxisSpec(e){e.axes||(e.axes=[]);const t={x:!1,y:!1};e.axes.forEach((r=>{const{orient:a}=r;let s=null;"top"!==a&&"bottom"!==a||(t.x=!0,s=this._setDefaultXAxisSpec(e)),"left"!==a&&"right"!==a||(t.y=!0,s=this._setDefaultYAxisSpec(e)),s&&Object.keys(s).forEach((e=>{r[e]=i.isObject(r[e])?i.merge(s[e],r[e]):i.isNil(r[e])?s[e]:r[e]}))})),t.x||e.axes.push(this._setDefaultXAxisSpec(e)),t.y||e.axes.push(this._setDefaultYAxisSpec(e))}transformSpec(e){var t,i;super.transformSpec(e),this.transformSeriesSpec(e),this._transformAxisSpec(e);const r=null!==(t=e.direction)&&void 0!==t?t:"horizontal";null===(i=e.series)||void 0===i||i.forEach((e=>{"vertical"===r?(e.timeField&&!e.yField&&(e.yField=e.timeField),e.xField||(e.xField=e.seriesField||"__vchart_timeline_dummy__")):(e.timeField&&!e.xField&&(e.xField=e.timeField),e.yField||(e.yField=e.seriesField||"__vchart_timeline_dummy__"))}))}}const Vt="event",Nt=Object.assign(Object.assign({},t.baseSeriesMark),{line:{name:"line",type:"line"},dot:{name:"dot",type:"symbol"},icon:{name:"icon",type:"symbol"},title:{name:"title",type:"text"},subTitle:{name:"subTitle",type:"text"},arrow:{name:"arrow",type:"path"}});class zt extends t.CartesianSeries{constructor(){super(...arguments),this.type=Vt,this.transformerConstructor=t.BaseSeriesSpecTransformer,this.coordinate="cartesian"}setAttrFromSpec(){super.setAttrFromSpec(),this.setSeriesField(this._spec.seriesField),this._timeField=this._spec.timeField,this._eventField=this._spec.eventField,this._subTitleField=this._spec.subTitleField,this._iconField=this._spec.iconField,this._labelPosition=this._spec.labelPosition}getDimensionField(){return this._timeField?[this._timeField]:[]}getMeasureField(){const e=[];return this._eventField&&e.push(this._eventField),this._subTitleField&&e.push(this._subTitleField),e}initMark(){this._axisLineMark=this._createMark(zt.mark.line,{isSeriesMark:!0,groupKey:this._seriesField}),this._arrowMark=this._createMark(zt.mark.arrow,{isSeriesMark:!0}),this._dotMark=this._createMark(zt.mark.dot,{isSeriesMark:!0}),this._iconMark=this._createMark(zt.mark.icon,{isSeriesMark:!0}),this._titleMark=this._createMark(zt.mark.title),this._subTitleMark=this._createMark(zt.mark.subTitle)}initTooltip(){super.initTooltip(),this._dotMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._dotMark),this._titleMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._titleMark),this._subTitleMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._subTitleMark),this._iconMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._iconMark),this._arrowMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._arrowMark)}initMarkStyle(){var e,r,a,s,n,o,l,d,c,u,h;this._axisLineMark&&this.setMarkStyle(this._axisLineMark,{points:this._getAxisPoints.bind(this),visible:this._isFirstDataInGroup.bind(this),stroke:"#c0c3c7",lineWidth:1},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series);const g=this._spec.dot,p="number"==typeof(null===(e=null==g?void 0:g.style)||void 0===e?void 0:e.size)?g.style.size:8,m=this._spec.title,y=null!==(r=null==m?void 0:m.style)&&void 0!==r?r:{},v=this._spec.subTitle,f=null!==(a=null==v?void 0:v.style)&&void 0!==a?a:{},b="number"==typeof y.fontSize?y.fontSize:14,x=p/2+(null!==(s=null==m?void 0:m.offset)&&void 0!==s?s:6);this._dotMark&&this.setMarkStyle(this._dotMark,{x:e=>this._getPoint(e).x,y:e=>this._getPoint(e).y,size:p,fill:null!==(o=null===(n=null==g?void 0:g.style)||void 0===n?void 0:n.fill)&&void 0!==o?o:this.getColorAttribute()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this._arrowMark&&this.setMarkStyle(this._arrowMark,{path:e=>this._getArrowPath(e),fill:null!==(d=null===(l=null==g?void 0:g.style)||void 0===l?void 0:l.fill)&&void 0!==d?d:this.getColorAttribute()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this._titleMark&&this.setMarkStyle(this._titleMark,Object.assign(Object.assign({fontSize:14},y),{x:e=>this._getTitlePosition(e,x).x,y:e=>this._getTitlePosition(e,x).y,textAlign:e=>this._getLabelTextAlign(e),textBaseline:e=>this._getLabelTextBaseline(e,!0),text:e=>this._getDatumString(e,this._eventField)}),t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this._subTitleMark&&this.setMarkStyle(this._subTitleMark,Object.assign(Object.assign({},f),{x:e=>this._getSubTitlePosition(e,x,b).x,y:e=>this._getSubTitlePosition(e,x,b).y,textAlign:e=>this._getLabelTextAlign(e),textBaseline:e=>this._getLabelTextBaseline(e,!1),text:e=>this._getDatumString(e,this._subTitleField)}),t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series);const _=this._spec.icon,S="number"==typeof(null===(c=null==_?void 0:_.style)||void 0===c?void 0:c.size)?_.style.size:20,k=(i.isValid(null==_?void 0:_.offset)?_.offset+p/2:x)+S/2;this._iconMark&&this.setMarkStyle(this._iconMark,{x:e=>this._getIconPosition(e,k).x,y:e=>this._getIconPosition(e,k).y,size:S,fill:null!==(h=null===(u=null==_?void 0:_.style)||void 0===u?void 0:u.fill)&&void 0!==h?h:this.getColorAttribute(),shape:e=>this._getDatumString(e,this._iconField)||"circle"},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}_getLabelSide(e){const t=this._getViewDataList().indexOf(e),i=this._labelPosition;if("vertical"===this.direction)switch(i){case"left":default:return"primary";case"right":return"secondary";case"left-right":return t%2==0?"primary":"secondary";case"right-left":return t%2==0?"secondary":"primary"}else switch(i){case"top":default:return"primary";case"bottom":return"secondary";case"top-bottom":return t%2==0?"primary":"secondary";case"bottom-top":return t%2==0?"secondary":"primary"}}_getLabelTextAlign(e){if("vertical"===this.direction){return"primary"===this._getLabelSide(e)?"right":"left"}return"center"}_getLabelTextBaseline(e,t){if("vertical"===this.direction)return"middle";return"primary"===this._getLabelSide(e)?"bottom":"top"}_getTitlePosition(e,t){const i=this._getPoint(e),r=this._getLabelSide(e);return"vertical"===this.direction?{x:"primary"===r?i.x-t:i.x+t,y:i.y}:{x:i.x,y:"primary"===r?i.y-t:i.y+t}}_getSubTitlePosition(e,t,i){var r,a,s,n;const o=this._getPoint(e),l=this._getLabelSide(e),d=null!==(a=null===(r=this._spec.title)||void 0===r?void 0:r.subTitleGap)&&void 0!==a?a:4;if("vertical"===this.direction){const e=null!==(n=null===(s=this._spec.title)||void 0===s?void 0:s.style)&&void 0!==n?n:{},r="number"==typeof e.lineHeight?e.lineHeight:1.2*i;return{x:"primary"===l?o.x-t:o.x+t,y:o.y+r+d}}return{x:o.x,y:"primary"===l?o.y-(t+i+d):o.y+(t+i+d)}}_getIconPosition(e,t){const i=this._getPoint(e),r=this._getLabelSide(e);return"vertical"===this.direction?{x:"primary"===r?i.x+t:i.x-t,y:i.y}:{x:i.x,y:"primary"===r?i.y+t:i.y-t}}_getViewDataList(){var e,t;return null!==(t=null===(e=this.getViewData())||void 0===e?void 0:e.latestData)&&void 0!==t?t:[]}_getPoint(e){if("vertical"===this.direction){return{x:this._getPositionFromAxis(e,this.getXAxisHelper(),this._seriesField),y:this._getPositionFromAxis(e,this.getYAxisHelper(),this._timeField)}}return{x:this._getPositionFromAxis(e,this.getXAxisHelper(),this._timeField),y:this._getPositionFromAxis(e,this.getYAxisHelper(),this._seriesField)}}_getPositionFromAxis(e,t,i){var r,a,s,n,o,l;if(!t)return this._getDefaultPosition(i);if(!i||!(i in e))return this._getDefaultPosition(i);const d=e[i];return"band"!==(null===(a=null===(r=t.getSpec)||void 0===r?void 0:r.call(t))||void 0===a?void 0:a.type)&&t.isContinuous?null!==(l=null===(o=t.valueToPosition)||void 0===o?void 0:o.call(t,d))&&void 0!==l?l:this._getDefaultPosition(i):null!==(n=null===(s=t.dataToPosition)||void 0===s?void 0:s.call(t,[d],{bandPosition:.5}))&&void 0!==n?n:this._getDefaultPosition(i)}onXAxisHelperUpdate(){var e;null===(e=super.onXAxisHelperUpdate)||void 0===e||e.call(this),this.onMarkPositionUpdate()}onYAxisHelperUpdate(){var e;null===(e=super.onYAxisHelperUpdate)||void 0===e||e.call(this),this.onMarkPositionUpdate()}_getDefaultPosition(e){const t=this._region.getLayoutRect();if(!this._seriesField||e===this._seriesField){return"vertical"!==this.direction?.5*t.height:.5*t.width}return 0}_getAxisPoints(e){const t=this._region.getLayoutRect();if("vertical"===this.direction){const i=this._getPositionFromAxis(e,this.getXAxisHelper(),this._seriesField);return[{x:i,y:0},{x:i,y:t.height}]}const i=this._getPositionFromAxis(e,this.getYAxisHelper(),this._seriesField);return[{x:0,y:i},{x:t.width,y:i}]}_isFirstDataInGroup(e){if(!this._seriesField){return 0===this._getViewDataList().indexOf(e)}const t=this._getViewDataList(),i=e[this._seriesField];return e===t.find((e=>this._seriesField&&e[this._seriesField]===i))}_getNextDatum(e){const t=this._getViewDataList(),i=t.indexOf(e);if(-1===i||i===t.length-1)return null;if(!this._seriesField)return t[i+1];const r=e[this._seriesField];for(let e=i+1;e<t.length;e++){const i=t[e];if(i[this._seriesField]===r)return i}return null}_getPreviousDatum(e){const t=this._getViewDataList(),i=t.indexOf(e);if(-1===i||0===i)return null;if(!this._seriesField)return t[i-1];const r=e[this._seriesField];for(let e=i-1;e>=0;e--){const i=t[e];if(i[this._seriesField]===r)return i}return null}_getArrowPath(e){var t,i;const r=this._getPoint(e),a=this._getNextDatum(e),s=this._getPreviousDatum(e),n=null!==(i=null===(t=this._spec.arrow)||void 0===t?void 0:t.thickness)&&void 0!==i?i:16,o=this._region.getLayoutRect();if("vertical"===this.direction){const e=this.getYAxisHelper().isInverse(),t=s?{x:r.x,y:(this._getPoint(s).y+r.y)/2}:{x:r.x,y:e?0:o.height},i=a?{x:r.x,y:(this._getPoint(a).y+r.y)/2}:{x:r.x,y:e?o.height:0},l=e?1:-1,d=n/3,c=n/2;return`M ${t.x-c} ${t.y} L ${t.x} ${t.y+l*d} L ${t.x+c} ${t.y} \n L ${i.x+c} ${i.y-l*d} \n L ${i.x} ${i.y}\n L ${i.x-c} ${i.y-l*d} Z`}const l=this.getXAxisHelper().isInverse(),d=s?{x:(this._getPoint(s).x+r.x)/2,y:r.y}:{x:l?o.width:0,y:r.y},c=a?{x:(this._getPoint(a).x+r.x)/2,y:r.y}:{x:l?0:o.width,y:r.y},u=l?-1:1,h=n/2,g=n/3;return`M ${d.x} ${d.y-h} L ${d.x+u*g} ${d.y} L ${d.x} ${d.y+h} \n L ${c.x-u*g} ${c.y+h} \n L ${c.x} ${c.y} \n L ${c.x-u*g} ${c.y-h} Z`}_getDatumString(e,t){if(!e||!t)return"";const i=e[t];return"string"==typeof i?i:null==i?"":String(i)}valueToPosition(e,t){if(e&&"object"==typeof e)return this.dataToPosition(e);const i={};return this._timeField&&(i[this._timeField]=e),this._eventField&&void 0!==t&&(i[this._eventField]=t),this._getPoint(i)}getActiveMarks(){return[this._axisLineMark,this._dotMark,this._iconMark,this._arrowMark,this._titleMark,this._subTitleMark].filter(Boolean)}}zt.type=Vt,zt.mark=Nt,zt.builtInTheme={event:{dot:{style:{size:8}},icon:{visible:!1,style:{size:20}},line:{visible:!0,style:{stroke:"#c0c3c7",lineWidth:1}},title:{visible:!0,offset:6,subTitleGap:4,style:{fontSize:14}},subTitle:{visible:!0,style:{fontSize:12}},arrow:{visible:!1,thickness:16}}},zt.transformerConstructor=t.BaseSeriesSpecTransformer;const Ht=()=>{t.registerSymbolMark(),t.registerTextMark(),t.registerLineMark(),t.registerPathMark(),t.Factory.registerSeries(zt.type,zt)};class Gt extends t.BaseChart{constructor(){super(...arguments),this.transformerConstructor=Rt,this.type="timeline",this.seriesType="event"}}Gt.type="timeline",Gt.seriesType="event",Gt.transformerConstructor=Rt;const Wt="seriesBreak";function $t(e,t,i,r,a=!1){const s=[],{x:n,y:o}=e,{x:l,y:d}=t,c=a?Math.floor((d-o)/(2*i)):Math.floor((l-n)/(2*i)),u=Math.PI/180*r,h=i*Math.cos(u),g=i*Math.sin(u);s.push(`M ${n} ${o}`);for(let e=0;e<=c;e++){const t=a?n+(e%2==0?h:-h):n+e*i*2,r=a?o+e*i*2:e%2==0?o-g:o+g;s.push(`L ${t} ${r}`)}return s.push(`L ${a?n:l} ${a?d:o}`),s.join(" ")}class Kt extends t.AbstractComponent{constructor(){super(...arguments),this.name=Wt}render(){this.removeAllChild();const{data:e=[]}=this.attribute;if(t.isEmpty(e))return;const i=[],r=[];e.forEach((e=>{const{start:a,end:s}=e;((e,i)=>{const{start:r,end:a}=i,s=r.x===a.x,n=s?"x":"y",o=s?"y":"x";let l=!0;const d=1e-6;e.length&&e.forEach((e=>{if(t.isNumberClose(e.start[n],r[n])){const t=Math.min(r[o],a[o]),i=Math.max(r[o],a[o]),s=Math.min(e.start[o],e.end[o]),n=Math.max(e.start[o],e.end[o]);if(!(i<s-d||t>n+d))return e.start[o]=Math.min(s,t),e.end[o]=Math.max(n,i),void(l=!1)}})),l&&e.push(i)})(a.x===s.x?i:r,e)})),[...i,...r].forEach(((e,i)=>{var r;const{start:a,end:s,size:n=4,gap:o=5,style:l={}}=e,d=m(e,["start","end","size","gap","style"]),c=t.createGroup({}),u=a.x===s.x;let h,g,p,y;u?(h={x:a.x-o/2,y:a.y},g={x:s.x-o/2,y:s.y},p={x:a.x+o/2,y:a.y},y={x:s.x+o/2,y:s.y}):(h={x:a.x,y:a.y-o/2},g={x:s.x,y:s.y-o/2},p={x:a.x,y:a.y+o/2},y={x:s.x,y:s.y+o/2});const v=$t(h,g,n,u?75:15,u),f=$t(a,s,n,u?75:15,u),b=$t(p,y,n,u?75:15,u);c.add(t.createPath(Object.assign(Object.assign({path:v,stroke:"#000",lineWidth:1},l),{pickable:!1,zIndex:1}))),c.add(t.createPath(Object.assign(Object.assign({path:b,stroke:"#000",lineWidth:1},l),{pickable:!1,zIndex:1}))),c.add(t.createPath({path:f,stroke:"#fff",lineWidth:o,pickable:!1,zIndex:0})),c.name="series-break",c.data=d,t.isValid(d.axisId)&&(c.id=`${null!==(r=d.axisId)&&void 0!==r?r:""}_${i}`),this.add(c)}))}}function Ut(e,t,i=1){return Math.abs(e-t)<i}function Xt(e,i){return{type:"component",componentType:Wt,interactive:!0,zIndex:500,style:{data:(r,a)=>{const s=[],n=a.vchart.getChart(),o="horizontal"===n.getAllSeries()[0].direction;return e.forEach(((e,r)=>{var a,l;const d=e.id,c=t.isValid(d)?n.getComponentByUserId(d):i&&t.isValid(i[r])?n.getComponentByIndex("axes",i[r]):null===(a=n.getComponentsByKey("axes").filter((t=>t.getSpec().breaks===e.breaks)))||void 0===a?void 0:a[0];if(!c)return;const u=null!=d?d:`${c.type}-${c.id}`,h=function(e){let{x:t,y:i}=e[0].getLayoutStartPoint(),r=t+e[0].getLayoutRect().width,a=i+e[0].getLayoutRect().height;for(let s=1;s<e.length;s++){const n=e[s],{x:o,y:l}=n.getLayoutStartPoint(),{width:d,height:c}=n.getLayoutRect();t=Math.min(t,o),r=Math.max(r,d+o),i=Math.min(i,l),a=Math.max(a,c+l)}return{x1:t,y1:i,x2:r,y2:a}}(c.getRegions());t.array(null===(l=c._break)||void 0===l?void 0:l.breaks).forEach((e=>{const{range:t,breakSymbol:i,gap:r=5}=e,a=c.valueToPosition(t[0]),l=c.valueToPosition(t[1]),d=(a+l)/2+(o?h.x1:h.y1);n.getAllSeries().forEach((e=>{if("bar"===e.type||"waterfall"===e.type){e.getMarkInName("bar").getGraphics().forEach((e=>{const n=e.AABBBounds;let c,g,p,m,y=!1;o?(y=n.x1<(a+l-r)/2&&n.x2>(a+l+r)/2,c=d,g=Math.max(n.y1+h.y1-2,h.y1),p=d,m=Math.min(n.y2+h.y1+2,h.y2)):(y=n.y1<(a+l-r)/2&&n.y2>(a+l+r)/2,c=Math.max(n.x1+h.x1-2,h.x1),g=d,p=Math.min(n.x2+h.x1+2,h.x2),m=d),y&&s.push({start:{x:c,y:g},end:{x:p,y:m},gap:r,style:null==i?void 0:i.style,axisId:u,data:t})}))}else if("line"===e.type){e.getMarkInName(e.type).getGraphics().forEach((e=>{qt(e,"line").forEach((e=>{Yt(o?{start:{x:(a+l)/2,y:0},end:{x:(a+l)/2,y:h.y2-h.y1}}:{start:{x:0,y:(a+l)/2},end:{x:h.x2-h.x1,y:(a+l)/2}},e).forEach((e=>{let a,n;o?(a={x:d,y:Math.max(e[1]+h.y1-10,h.y1)},n={x:d,y:Math.min(e[1]+h.y1+10,h.y2)}):(a={x:Math.max(e[0]+h.x1-10,h.x1),y:d},n={x:Math.min(e[0]+h.x1+10,h.x2),y:d}),s.push({start:a,end:n,gap:r,style:null==i?void 0:i.style,axisId:u,data:t})}))}))}))}else if("area"===e.type){e.getMarkInName("area").getGraphics().forEach((e=>{qt(e,"area").forEach((e=>{const n=Yt(o?{start:{x:(a+l)/2,y:0},end:{x:(a+l)/2,y:h.y2-h.y1}}:{start:{x:0,y:(a+l)/2},end:{x:h.x2-h.x1,y:(a+l)/2}},e);n.sort(((e,t)=>e[0]-t[0]));for(let a=0;a<n.length-1;a++){const l={x:n[a][0],y:n[a][1]},d={x:n[a+1][0],y:n[a+1][1]};if(Zt(o?{x:l.x,y:(l.y+d.y)/2}:{x:(l.x+d.x)/2,y:l.y},e)){let e,a;o?(e={x:l.x+h.x1,y:Math.max(l.y+h.y1-0,h.y1)},a={x:d.x+h.x1,y:Math.min(d.y+h.y1+0,h.y2)}):(e={x:Math.max(l.x+h.x1-0,h.x1),y:l.y+h.y1},a={x:Math.min(d.x+h.x1+0,h.x2),y:d.y+h.y1}),s.push({start:e,end:a,gap:r,style:null==i?void 0:i.style,axisId:u,data:t})}}}))}))}}))}))})),s}}}}function Yt(e,i){const r=[];for(let a=1;a<i.length;a++){const s=t.getIntersectPoint([e.start.x,e.start.y],[e.end.x,e.end.y],[i[a].x,i[a].y],[i[a-1].x,i[a-1].y]);s&&!r.find((e=>Ut(t.PointService.distancePP({x:e[0],y:e[1]},{x:s[0],y:s[1]}),0)))&&r.push(s)}return r}function qt(e,t){const{points:i,segments:r}=e.attribute,a=[];let s=[];const n=e=>{if(e&&e.length){let i=[];if(e.forEach((e=>{var r,n;if(!1===e.defined){if(a.push(s),"area"===t&&i.length){for(let e=i.length-1;e>=0;e--)s.push({x:i[e].x,y:i[e].y});s.push(s[0])}s=[],i=[]}else s.push({x:e.x,y:e.y}),"area"===t&&i.push({x:null!==(r=e.x1)&&void 0!==r?r:e.x,y:null!==(n=e.y1)&&void 0!==n?n:e.y})})),"area"===t&&i.length){for(let e=i.length-1;e>=0;e--)s.push({x:i[e].x,y:i[e].y});s.push(s[0])}a.push(s)}};return i&&i.length?n(i):r&&r.length&&r.forEach((e=>{n(e.points)})),a}function Zt(e,t){const{x:i,y:r}=e;let a=!1;for(let e=0,s=t.length-1;e<t.length;s=e++){const{x:n,y:o}=t[e],{x:l,y:d}=t[s];o>r!=d>r&&i<(l-n)*(r-o)/(d-o)+n&&(a=!a)}return a}const Jt="barLink";class Qt extends t.AbstractComponent{constructor(){super(...arguments),this.name=Jt}render(){const{data:e,linkStyle:i,areaStyle:r,styleMap:a,label:s,linkType:n="total"}=this.attribute;t.isEmpty(e)||(this.removeAllChild(),e.forEach(((e,o)=>{var l,d,c,u,h;const{linePoints:g,areaPoints:p,id:m=o,color:y,data:v}=e;if(p&&!1!==(null===(l=null==a?void 0:a[`area-${m}`])||void 0===l?void 0:l.visible)){const e=t.createArea(Object.assign(Object.assign({points:p,fillOpacity:.3,fill:y,zIndex:0},r),null==a?void 0:a[`area-${m}`]));e.name="bar-link-area",e.id=`area-${m}`,this.add(e)}if(g&&!1!==(null===(d=null==a?void 0:a[`line-${m}`])||void 0===d?void 0:d.visible)&&0!==(null===(c=null==i?void 0:i.lineStyle)||void 0===c?void 0:c.lineWidth)&&0!==(null===(u=null==a?void 0:a[`line-${m}`])||void 0===u?void 0:u.lineWidth)){const{startSymbol:e={},endSymbol:r={},lineStyle:s}=i||{},n=t.cloneDeep(e),o=t.cloneDeep(r);(null==a?void 0:a[`line-${m}`])&&a[`line-${m}`].stroke&&(n.style=Object.assign(Object.assign({},n.style),{color:a[`line-${m}`].stroke}),o.style=Object.assign(Object.assign({},o.style),{color:a[`line-${m}`].stroke})),n.symbolType||n.originSymbolType||(n.originSymbolType="solidArrow"),o.symbolType||o.originSymbolType||(o.originSymbolType="solidArrow");const l=new t.Segment({points:g,startSymbol:Object.assign({size:8},n),endSymbol:Object.assign({size:8},o),lineStyle:Object.assign(Object.assign({lineDash:[3,3],lineWidth:1,stroke:"#000"},s),null==a?void 0:a[`line-${m}`]),pickable:!0,childrenPickable:!1,zIndex:1});l.name="bar-link-line",l.id=`line-${m}`,this.add(l)}if((null==s?void 0:s.visible)&&!1!==(null===(h=null==a?void 0:a[`label-${m}`])||void 0===h?void 0:h.visible)){const{style:e,formatMethod:i}=s,[r,o]=v;let l=r[t.STACK_FIELD_END],d=o[t.STACK_FIELD_END];"value"===n&&(l=r[t.STACK_FIELD_END]-r[t.STACK_FIELD_START],d=o[t.STACK_FIELD_END]-o[t.STACK_FIELD_START]);const c=d-l,u=(d-l)/l*100,h=t.createText(Object.assign(Object.assign({x:.5*(g[0].x+g[1].x),y:.5*(g[0].y+g[1].y),text:i?i(c,u,v):`${c} ${u}`,fontSize:14,fill:"#000",stroke:"#fff",lineWidth:1,textAlign:"center",textBaseline:"middle",background:"#fff",zIndex:2},e),null==a?void 0:a[`label-${m}`]));h.name="bar-link-label",h.id=`label-${m}`,this.add(h)}})))}}function ei(e,i,r){const{isHorizontal:a,isXAxisInverse:s,isYAxisInverse:n,linkType:o,doFill:l,regionStartX:d,regionStartY:c}=r,u=e.AABBBounds,h=i.AABBBounds;let g,p;return a?(g=[{x:(u.x1+u.x2)/2+d,y:u.y1+c},{x:(h.x1+h.x2)/2+d,y:h.y2+c}],s?("total"===o&&(g=[{x:u.x1+d,y:u.y1+c},{x:h.x1+d,y:h.y2+c}]),l&&(p=[{x:u.x1+d,x1:u.x2+d,y:u.y1+c},{x:h.x1+d,x1:h.x2+d,y:h.y2+c}])):("total"===o&&(g=[{x:u.x2+d,y:u.y1+c},{x:h.x2+d,y:h.y2+c}]),l&&(p=[{x:u.x2+d,x1:u.x1+d,y:u.y1+c},{x:h.x2+d,x1:h.x1+d,y:h.y2+c}]))):(g=[{x:u.x2+d,y:(u.y1+u.y2)/2+c},{x:h.x1+d,y:(h.y1+h.y2)/2+c}],n?("total"===o&&(g=[{x:u.x2+d,y:u.y2+c},{x:h.x1+d,y:h.y2+c}]),l&&(p=[{x:u.x2+d,y:u.y2+c,y1:u.y1+c},{x:h.x1+d,y:h.y2+c,y1:h.y1+c}])):("total"===o&&(g=[{x:u.x2+d,y:u.y1+c},{x:h.x1+d,y:h.y1+c}]),l&&(p=[{x:u.x2+d,y:u.y1+c,y1:u.y2+c},{x:h.x1+d,y:h.y1+c,y1:h.y2+c}]))),{areaPoints:p,linePoints:g,data:[t.getDatumOfGraphic(e),t.getDatumOfGraphic(i)],color:e.attribute.fill}}function ti(e={},i){const{linkType:r="total",doFill:a}=e,s=m(e,["linkType","doFill"]);return{type:"component",componentType:Jt,zIndex:500,interactive:!1,style:Object.assign(Object.assign({data:(e,i)=>{const{vchart:s}=i,n=s.getChart().getAllRegions(),o=[];return n.forEach((e=>{const i=e.getSeries().filter((e=>"bar"===e.type)),{x:s,y:n}=e.getLayoutStartPoint();if(i.length){const e=i[0].getGroupFields(),l=[];i.forEach((e=>{var t;(null===(t=e.getMarkInName("bar"))||void 0===t?void 0:t.getGraphics()).forEach((e=>{l.push(e)}))}));const d=function(e,i){const r={};for(let a=0;a<e.length;a++){const s=e[a],n=t.getDatumOfGraphic(s),o=i.map((e=>n[e])).join("-");r[o]||(r[o]=[]),r[o].push(s)}return r}(l,e);Object.values(d).forEach((e=>{e.sort(((e,i)=>t.getDatumOfGraphic(e)[t.STACK_FIELD_END]-t.getDatumOfGraphic(i)[t.STACK_FIELD_END]))}));const c=i[0],u="horizontal"===c.direction,h=c.getYAxisHelper().isInverse(),g=c.getXAxisHelper().isInverse(),p=Object.values(d);if(p.length)if(u){p[0][0].AABBBounds.y1<p[p.length-1][0].AABBBounds.y1&&p.reverse()}else{p[0][0].AABBBounds.x1>p[p.length-1][0].AABBBounds.x1&&p.reverse()}for(let e=0;e<p.length-1;e++){const t=p[e],i=p[e+1];if(t.forEach(((e,t)=>{var l;const d=ei(e,null!==(l=i[t])&&void 0!==l?l:i[i.length-1],{isHorizontal:u,isXAxisInverse:g,isYAxisInverse:h,doFill:a,linkType:r,regionStartX:s,regionStartY:n});o.push(d)})),t.length<i.length){const e=t[t.length-1];for(let l=t.length;l<i.length;l++){const t=ei(e,i[l],{isHorizontal:u,isXAxisInverse:g,isYAxisInverse:h,doFill:a,linkType:r,regionStartX:s,regionStartY:n});o.push(t)}}}}})),o},linkType:r},s),i)}}const ii="seriesLabel";function ri(e,t=10,i=10,r=.1){const a=e.length;if(!e.every(isFinite))return e;if(!(a>1))return e;const s=function(e,t,i){e=+e,t=+t;let r=arguments.length;i=r<2?(t=e,e=0,1):r<3?1:+i;let a=-1;r=0|Math.max(0,Math.ceil((t-e)/i));const s=new Array(r);for(;++a<r;)s[a]=e+a*i;return s}(e.length);for(let n=0;n<i;++n){s.sort(((t,i)=>{return r=e[t],a=e[i],null==r||null==a?NaN:r<a?-1:r>a?1:r>=a?0:NaN;var r,a}));let i=0;for(let r=1;r<a;++r){let a=e[s[r]]-e[s[r-1]];a<t&&(a=(t-a)/2,i=Math.max(i,a),e[s[r-1]]-=a,e[s[r]]+=a)}if(i<r)break}return e}function ai(e,t){return!(t.x1>e.x2||t.x2<e.x1||t.y1>e.y2||t.y2<e.y1)}function si(e,t=10,i=10){const r=e.length;let a,s=0;do{a=!1;for(let i=0;i<r;++i)for(let s=i+1;s<r;++s){const r=e[i].AABBBounds,n=e[s].AABBBounds;if(ai(r,n)){const i=t-(n.x1-r.x2);i>0&&(e[s].attribute.x+=i,n.x1+=i,n.x2+=i,a=!0)}}s++}while(a&&s<i)}function ni(e,i){const{label:r,line:a}=i;return{type:"component",componentType:ii,interactive:!1,style:{position:e,layout:(e,t)=>{var i;return null!==(i=t.vchart.getChart().getAllSeries()[0].getSpec().direction)&&void 0!==i?i:"vertical"},data:(i,r)=>{var a;const s=r.vchart.getChart(),n=s.getAllSeries()[0],o="horizontal"===n.direction,l=o?n.getYAxisHelper():n.getXAxisHelper(),d=null===(a=l.getScale)||void 0===a?void 0:a.call(l,0),c=l.isInverse(),u=n.getDimensionField()[0],h=n.getSeriesField(),g=s.getAllSeries().map((e=>e.type)).filter(((e,t,i)=>i.indexOf(e)===t)),p=[];if(1===g.length&&["bar","area","line","waterfall"].includes(g[0])){("both-ends"===e?["start","end"]:[e]).forEach((e=>{const i="end"===e?t.last(d.domain()):d.domain()[0],r=n.getRegion(),{x:a,y:l}=r.getLayoutStartPoint();let m=0;s.getAllSeries().forEach((t=>{t.getMarkInName("waterfall"===g[0]?"bar":g[0]).getGraphics().forEach((r=>{var s;const n=r.context.data.find((e=>e[u]===i));if(n){const i=r.AABBBounds;let d,y,v,f;"bar"===g[0]||"waterfall"===g[0]?(d="end"===e?{x:o?(i.x1+i.x2)/2:c?i.x1:i.x2,y:o?c?i.y2:i.y1:(i.y1+i.y2)/2}:{x:o?(i.x1+i.x2)/2:c?i.x2:i.x1,y:o?c?i.y1:i.y2:(i.y1+i.y2)/2},y=r.attribute.fill):(d=t.dataToPosition(n),y=r.attribute.stroke||r.attribute.fill),"end"===e?(v=o?"center":c?"end":"start",f=o?c?"top":"bottom":"middle"):(v=o?"center":c?"start":"end",f=o?c?"bottom":"top":"middle");const b=null!==(s=n[h])&&void 0!==s?s:n[u];p.push({point:{x:d.x+a,y:d.y+l},label:b,color:y,textAlign:v,textBaseline:f,series:t,datum:n,id:`${e}-${m}`,position:e}),m++}}))}))}))}return p},line:a,label:Object.assign({space:12},r)}}}class oi extends t.AbstractComponent{constructor(){super(...arguments),this.name=ii}render(){var e,i,r,a;this.removeAllChild();const{data:s,layout:n,label:o,line:l={}}=this.attribute;if(t.isEmpty(s))return;const d=null!==(e=null==o?void 0:o.styleMap)&&void 0!==e?e:{},c={},u=s.filter((e=>{var t;return!1!==(null===(t=d[e.id])||void 0===t?void 0:t.visible)}));if("vertical"===n){const e=1.5*(null!==(r=null===(i=null==o?void 0:o.style)||void 0===i?void 0:i.fontSize)&&void 0!==r?r:12),a=(e,i,r)=>{var a,s,n,o,l,d,c,u;const{label:h,color:g,textAlign:p,textBaseline:m,id:y}=e,v=null!==(s=null===(a=r[y])||void 0===a?void 0:a.formatMethod)&&void 0!==s?s:null===(n=this.attribute.label)||void 0===n?void 0:n.formatMethod,f=t.createText(Object.assign(Object.assign(Object.assign(Object.assign({text:v?v(h,e.datum,{series:e.series}):h},null===(o=this.attribute.label)||void 0===o?void 0:o.style),i),{textAlign:p,textBaseline:m,fill:null!==(c=null===(d=null===(l=this.attribute.label)||void 0===l?void 0:l.style)||void 0===d?void 0:d.fill)&&void 0!==c?c:g}),null===(u=r[y])||void 0===u?void 0:u.style));return f.name="series-label-text",f.id=y,this.add(f),f};["start","end"].forEach((t=>{const i=u.filter((e=>e.position===t)),r=ri(i.map((e=>e.point.y)),e);i.forEach(((e,t)=>{var i;const s={x:e.point.x+(null!==(i=null==o?void 0:o.space)&&void 0!==i?i:8)*("start"===e.textAlign?1:-1),y:r[t]};a(e,s,d),c[e.id]=s}))}))}else{const e=[],i=[];u.forEach((r=>{var a,s,n,l,c;const{point:u,label:h,color:g,textAlign:p,textBaseline:m,id:y,position:v}=r,f={x:u.x,y:u.y},b=null!==(s=null===(a=d[y])||void 0===a?void 0:a.formatMethod)&&void 0!==s?s:null==o?void 0:o.formatMethod,x=t.createText(Object.assign(Object.assign(Object.assign(Object.assign({text:b?b(h,r.datum,{series:r.series}):h},null==o?void 0:o.style),f),{textAlign:p,textBaseline:m,fill:null!==(l=null===(n=null==o?void 0:o.style)||void 0===n?void 0:n.fill)&&void 0!==l?l:g}),null===(c=d[y])||void 0===c?void 0:c.style));x.id=y,x.name="series-label-text",this.add(x),"start"===v?e.push(x):"end"===v&&i.push(x)})),e.length&&si(e,4,10),i.length&&si(i,4,10);const r=null!==(a=null==o?void 0:o.space)&&void 0!==a?a:8;[...e,...i].forEach((e=>{const t="top"===e.attribute.textBaseline?1:-1;e.setAttribute("y",e.attribute.y+r*t),c[e.id]={x:e.attribute.x,y:e.attribute.y}}))}!1!==l.visible&&u.forEach((e=>{var i,r,a,s,o,u;const{point:h,color:g,id:p}=e,m={x:c[p].x+(null!==(a=null===(r=null===(i=d[p])||void 0===i?void 0:i.style)||void 0===r?void 0:r.dx)&&void 0!==a?a:0),y:c[p].y+(null!==(u=null===(o=null===(s=d[p])||void 0===s?void 0:s.style)||void 0===o?void 0:o.dy)&&void 0!==u?u:0)};if(!1!==l.autoVisible){if("vertical"===n&&h.y!==m.y||"horizontal"===n&&h.x!==m.x){const e=t.createLine(Object.assign({points:[h,m],lineWidth:1,stroke:g},l.style));e.name="series-label-line",this.add(e)}}else{const e=t.createLine(Object.assign({points:[h,m],lineWidth:1,stroke:g},l.style));e.name="series-label-line",this.add(e)}}))}}function li(e,t,i=0){return i>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2)}function di(e){var t;if(!e||0===e.length)return[];if(1===e.length)return[e[0].rect];const i=e.map((e=>{var t,i;return Object.assign(Object.assign({},e),{bound:(i=e.rect,{x1:i.x,x2:i.x+i.width,y1:i.y,y2:i.y+i.height}),anchorCandidates:mi(null!==(t=e.anchors)&&void 0!==t?t:[],e.point,e.rect,e.offset)})})),r=[];r.push(i[0].bound);for(let e=1;e<=i.length-1;e++){const a=i[e],s=a.bound;let n=r.some((e=>li(e,s)));if(a.anchorCandidates)if(n&&(null===(t=a.anchorCandidates)||void 0===t?void 0:t.length)>0){for(let e=0;e<a.anchorCandidates.length;e++){const t=a.anchorCandidates[e],i={x1:t.x,y1:t.y,x2:t.x+s.x2-s.x1,y2:t.y+s.y2-s.y1,anchor:t};if(!r.some((e=>li(e,i)))){r.push(i),n=!1;break}}n&&r.push(a.bound)}else r.push(a.bound)}return r.map((e=>function(e){return{x:e.x1,y:e.y1,width:e.x2-e.x1,height:e.y2-e.y1}}(e)))}function ci(e,i,r){const a=e.map((e=>e.pointCoord)),{x1:s,x2:n,y1:o,y2:l}=t.getAABBFromPoints(a),d=r([(s+n)/2,(o+l)/2]);if(!d)return[];const c=e.map((e=>{const a=e.rect,s=gi(i,e.pointCoord)?r(function(e,i,r,a=200){const s=5621/a;let n=i;for(let i=1;i<=s;i++){const i=t.destination(n,a,r);if(!gi(e,i))return[i.x,i.y];n=[i.x,i.y]}return i}(i,[e.pointCoord.x,e.pointCoord.y],ui(hi(e.point,d)))):e.point;s&&(a.x=s.x,a.y=s.y);const n=ui(hi(e.point,d));let o;const l=[];return n>=-45&&n<45?(o="top",l.push("left","right")):n>=45&&n<135?o="right":n>=-135&&n<-45?(o="left",l.push("left")):(o="bottom",l.push("left","right")),e.anchors=l,e.offset=20,e.rect=pi(e.rect,o,0),e}));return di(c)}function ui(e){return e>180?e-360:e}function hi(e,t){return 180*Math.atan2(e.y-t.y,e.x-t.x)/Math.PI+90}function gi(e,i){for(let r=0;r<e.length;r++){if(t.isPointInPolygon(i,e[r]))return!0}return!1}function pi(e,t,i=0){const r=Object.assign({},e);return"top"===t?(r.x-=e.width/2,r.y-=i+e.height/2):"bottom"===t?(r.x-=e.width/2,r.y+=i-e.height/2):"left"===t?(r.x-=i+e.width,r.y-=e.height/2):"right"===t&&(r.x+=i,r.y-=e.height/2),r}function mi(e,t,i,r=0){const a=[];return e.forEach((e=>{const{x:s,y:n}=pi(Object.assign(Object.assign({},t),{width:i.width,height:i.height}),e,r);a.push({x:s,y:n})})),a}const yi={visible:!0,offset:12,position:"top",space:10,nameLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:10}},valueLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:10}},background:{visible:!0,padding:{top:4,bottom:4,left:6,right:6},style:{cornerRadius:2,lineWidth:1,fill:"white",stroke:"grey"}},leader:{visible:!1,style:{lineWidth:1,stroke:"black"}}};class vi extends t.BaseComponentSpecTransformer{_getDefaultSpecFromChart(){return yi}}class fi extends t.BaseComponent{constructor(){super(...arguments),this.type="mapLabel",this.name=" mapLabel",this.specKey="mapLabel",this.transformerConstructor=vi,this.layoutType="none",this.layoutZIndex=t.LayoutZIndex.MarkPoint,this._activeDatum=[]}static getSpecInfo(e){return t.getSpecInfo(e,this.specKey,this.type,(e=>e.visible&&t.isValid(e.seriesId)))}setAttrFromSpec(){var e,t,i,r;this.nameField=null!==(e=this._spec.nameField)&&void 0!==e?e:null===(t=this._series)||void 0===t?void 0:t.getDimensionField()[0],this.valueField=null!==(i=this._spec.valueField)&&void 0!==i?i:null===(r=this._series)||void 0===r?void 0:r.getMeasureField()[0]}created(){super.created(),!1!=!!this._spec.visible&&(this.initRelatedInfo(),this.initData(),this.initEvent())}initRelatedInfo(){var e,t,i,r,a,s,n,o;this._series=this._option.getSeriesInUserIdOrIndex([this._spec.seriesId])[0],"outer"===this._spec.position&&(this._map=null===(t=null===(e=this._regions[0].getSeriesInType("map")[0])||void 0===e?void 0:e.getMapViewData())||void 0===t?void 0:t.latestData,this._longitudeField=null===(a=null===(r=(i=this._regions[0]).getSpec)||void 0===r?void 0:r.call(i))||void 0===a?void 0:a.longitudeField,this._latitudeField=null===(o=null===(n=(s=this._regions[0]).getSpec)||void 0===n?void 0:n.call(s))||void 0===o?void 0:o.latitudeField)}initData(){const e=this._series;if(!e)return;const i=e.getViewData();if(i){const e=new t.DataView(this._option.dataSet,{name:`${this.name}_data`});e.parse([i],{type:"dataview"}),e.transform({type:"copyDataView",level:t.TransformLevel.copyDataView},!1),this._data=new t.CompilableData(this._option,e),e.target.addListener("change",(()=>{"hover"!==this._spec.trigger&&"click"!==this._spec.trigger&&(this._activeDatum=this._data.getLatestData())}))}}initEvent(){this.event.on("zoom",{filter:e=>this._isRelativeModel(e.model)},(()=>(this.handleZoom(),!0))),this.event.on("panmove",{filter:e=>this._isRelativeModel(e.model)},(e=>(this.handlePan(e),!0)));const e=this._spec.trigger;"none"!==e&&("hover"===e?(this.event.on("element-highlight:start",(e=>{const i=e.graphics[0];this._isRelativeSeries(i)&&this._updateDatum(t.getDatumOfGraphic(i))})),this.event.on("element-highlight:reset",(e=>{this._activeDatum&&this._updateDatum(null)}))):"click"===e&&(this.event.on("element-select:start",(e=>{const i=e.graphics[0];this._isRelativeSeries(i)&&this._updateDatum(t.getDatumOfGraphic(i))})),this.event.on("elementSelectReset",(e=>{this._activeDatum&&this._updateDatum([])}))))}handlePan(e){const{delta:t}=e;this._markerComponents.forEach((e=>{e.translate(t[0],t[1])}))}handleZoom(){this._updateMarkerLayoutAttribute()}_updateDatum(e){this._activeDatum=e,this._markerComponents.forEach(((e,t)=>{var i;const r=null===(i=this._data)||void 0===i?void 0:i.getLatestData()[t];this._activeDatum.includes(r)?e.setAttribute("visible",!0):e.setAttribute("visible",!1)}))}dataToPosition(e){return this._series.dataToPosition(e)}updateLayoutAttribute(){var e;const t=null===(e=this._data)||void 0===e?void 0:e.getLatestData();t&&0!==t.length&&(super.updateLayoutAttribute(),this._updateMarkerLayoutAttribute())}_updateMarkerLayoutAttribute(){var e;const i=[],r=[];this._markerComponents||(this._markerComponents=null===(e=this._data)||void 0===e?void 0:e.getLatestData().map(((e,i)=>{var r;const a=new t.MarkPoint({position:void 0,animation:!1});return a&&(a.name=`${this.name}_marker_${i}`,a.id=null!==(r=this._spec.id)&&void 0!==r?r:`${this.name}_marker_${this.id}`,a.setAttribute("zIndex",this.layoutZIndex)),a})));this._markerComponents.forEach(((e,t)=>{const{pairInfo:a,contentMarks:s}=this._evaluateMarker(this._data.getLatestData()[t],t);a&&i.push(a),s&&r.push(s)}));const a=this._layoutLabels(i);this._layoutMarkers(a,r),this._renderMarkers()}_evaluateMarker(e,i){var r,a,s,n,o,l,d,c,u,h,g,p,m,y;let v=0,f=0,b=0,x=0,_=0;const S=this._spec.position||"top",k=this._spec.offset,M=t.normalizeLayoutPaddingSpec(null===(r=this._spec.background)||void 0===r?void 0:r.padding),C=this._spec.space||0;f+=((null==M?void 0:M.left)||0)+((null==M?void 0:M.right)||0),b+=((null==M?void 0:M.top)||0)+((null==M?void 0:M.bottom)||0);const A={},F=this.dataToPosition(e),T=t.graphicCreator.group({});if(T.name=`${this.name}_marker_itemContainer_${i}`,A.container=T,null===(a=this._spec.background)||void 0===a?void 0:a.visible){const e=t.graphicCreator.rect(t.transformToGraphic(Object.assign({},this._spec.background.style)));e.setAttributes(F),A.labelBackground=e,T.appendChild(e)}if(null===(s=this._spec.icon)||void 0===s?void 0:s.visible){const e=t.graphicCreator.symbol(t.transformToGraphic(Object.assign({},this._spec.icon.style)));e.setAttributes(F),e.setAttribute("symbolType",null!==(o=null===(n=this._spec.icon.style)||void 0===n?void 0:n.symbolType)&&void 0!==o?o:null===(l=this._spec.icon.style)||void 0===l?void 0:l.shape);const i=e.AABBBounds,r=null!==(d=(null==i?void 0:i.y2)-(null==i?void 0:i.y1))&&void 0!==d?d:0,a=null!==(c=(null==i?void 0:i.x2)-(null==i?void 0:i.x1))&&void 0!==c?c:0;A.icon=e,T.appendChild(e),_=r,x+=a,v++}if(null===(u=this._spec.nameLabel)||void 0===u?void 0:u.visible){const i=t.graphicCreator.text(t.transformToGraphic(Object.assign({},this._spec.nameLabel.style)));i.setAttributes(F),i.setAttribute("text",e[this.nameField]);const r=i.AABBBounds,a=null!==(h=(null==r?void 0:r.y2)-(null==r?void 0:r.y1))&&void 0!==h?h:0,s=null!==(g=(null==r?void 0:r.x2)-(null==r?void 0:r.x1))&&void 0!==g?g:0;A.nameLabel=i,T.appendChild(i),_=Math.max(_,a),x+=s,v++}if((null===(p=this._spec.valueLabel)||void 0===p?void 0:p.visible)&&t.isValid(e[this.valueField])){const i=t.graphicCreator.text(t.transformToGraphic(Object.assign({},this._spec.valueLabel.style)));i.setAttributes(F),i.setAttribute("text",e[this.valueField]);const r=i.AABBBounds,a=null!==(m=(null==r?void 0:r.y2)-(null==r?void 0:r.y1))&&void 0!==m?m:0,s=null!==(y=(null==r?void 0:r.x2)-(null==r?void 0:r.x1))&&void 0!==y?y:0;A.valueLabel=i,T.appendChild(i),_=Math.max(_,a),x+=s,v++}const L=Object.values(A).find((e=>!!e&&"group"!==e.type)),w={x:null==L?void 0:L.getComputedAttribute("x"),y:null==L?void 0:L.getComputedAttribute("y")},O={x:w.x,y:w.y,width:0,height:0};O.width=f+x+(v-1)*C,O.height=b+_;const I={rect:O,point:w,index:i};if("outer"!==S){const e=["top","right","left","bottom"].filter((e=>e!==S));I.rect=pi(O,S,k),I.anchors=e,I.offset=k}else I.pointCoord={x:+(null==e?void 0:e[this._longitudeField]),y:+(null==e?void 0:e[this._latitudeField])};return{pairInfo:I,contentMarks:A}}_layoutMarkers(e,i){var r,a,s;for(let n=0;n<i.length;n++){if(!e[n]||!i[n])return;const{icon:o,nameLabel:l,valueLabel:d,labelBackground:c,container:u}=i[n],h=e[n],g=t.normalizeLayoutPaddingSpec(null===(r=this._spec.background)||void 0===r?void 0:r.padding),p=this._spec.space||0,m=h.height/2;let y=(null==g?void 0:g.left)||0;[o,l,d].forEach(((e,t)=>{var i,r;if(e){const a=e.AABBBounds;let s=0;"symbol"===e.type&&(s+=(null!==(i=a.x2-a.x1)&&void 0!==i?i:0)/2),e.setAttributes({x:y+s,y:m}),y+=null!==(r=a.x2-a.x1)&&void 0!==r?r:0,2!==t&&(y+=p)}})),null==c||c.setAttributes({x:0,y:0,width:h.width,height:h.height}),null==u||u.setAttributes({dx:-h.width/2,dy:-h.height/2});const v=this._data.getLatestData()[n],f=this.dataToPosition(v),b=this.getRegions()[0].getLayoutStartPoint(),x=!(!(null===(a=this._spec.leader)||void 0===a?void 0:a.visible)||!(o||l||d));this._markerComponents[n].setAttributes({x:b.x,y:b.y,position:f,visible:this._activeDatum.includes(v),itemContent:{refX:0,type:"custom",renderCustomCallback:()=>u,autoRotate:!1,offsetX:h.x+h.width/2-f.x,offsetY:h.y+h.height/2-f.y},itemLine:{visible:x,type:"type-po",lineStyle:t.transformToGraphic(Object.assign({},null===(s=this._spec.leader)||void 0===s?void 0:s.style)),startSymbol:{visible:!1}}})}}_renderMarkers(){if(this._markerComponents&&this._markerComponents.length)for(let e=0;e<this._markerComponents.length;e++)this.getContainer().add(this._markerComponents[e])}_layoutLabels(e){return"outer"===this._spec.position&&this._map?ci(e,this._map,(e=>this._series.dataToPosition({[this._longitudeField]:e[0],[this._latitudeField]:e[1]}))):di(e)}_isRelativeModel(e){var t,i,r;const a=null!==(i=null===(t=this._series.getXAxisHelper())||void 0===t?void 0:t.getAxisId())&&void 0!==i?i:null===(r=this._series.getCoordinateHelper())||void 0===r?void 0:r.getCoordinateId();return(null==e?void 0:e.id)===a}_isRelativeSeries(e){var t;return(null===(t=e.context)||void 0===t?void 0:t.modelId)===this._series.id}_getNeedClearVRenderComponents(){return this._markerComponents}getVRenderComponents(){return this._markerComponents}}fi.type="mapLabel",fi.specKey="mapLabel",fi.transformerConstructor=vi;const bi="regressionLine";class xi extends t.AbstractComponent{constructor(){super(...arguments),this.name=bi}render(){this.removeAllChild();const{data:e,line:i={},label:r,name:a="regression-line",confidenceInterval:s}=this.attribute;t.isEmpty(e)||e.forEach((e=>{const{color:n}=e;if(e.area&&!1!==(null==s?void 0:s.visible)){const i=t.createArea(Object.assign(Object.assign({points:e.area},t.isValid(n)?{fill:n,fillOpacity:.12}:null),null==s?void 0:s.style));i.name="scatter-regression-area",this.add(i)}if(e.line&&!1!==(null==i?void 0:i.visible)){const r=t.createLine(Object.assign(Object.assign({points:e.line,lineWidth:1},t.isValid(n)?{stroke:n}:null),null==i?void 0:i.style));r.name=`${a}-curve`,this.add(r)}const o=t.last(e.line);if(r&&!1!==r.visible&&r.text&&o){const e=t.createText(Object.assign(Object.assign(Object.assign({},o),{text:r.text,textAlign:"end",textBaseline:"middle"}),r.style));e.name=`${a}-label`,this.add(e)}}))}}const _i=(e,i,r=(e=>e.x),a=(e=>e.y),s)=>{switch(e){case"logisitc":return t.regressionLogistic(i,r,a);case"lowess":return t.regressionLowess(i,r,a);case"polynomial":return t.regressionPolynomial(i,r,a,{degree:s});default:return t.regressionLinear(i,r,a)}};function Si(e,i){const{color:r,line:a,confidenceInterval:s,label:n}=i;return{type:"component",componentType:bi,interactive:!1,style:{data:(a,s)=>{const n=s.vchart.getChart().getAllSeries().filter((e=>e.type===t.SeriesTypeEnum.scatter)),o=[];return n&&n.length&&n.forEach((a=>{var s,n;const l=a.getRegion().getLayoutStartPoint(),d=a.getRegion().getLayoutRect(),c=t.clamper(l.y,l.y+d.height),u=a.getColorAttribute(),h=a.getSeriesKeys(),g=a.getViewData().latestData,p=null===(s=a.fieldX)||void 0===s?void 0:s[0],m=null===(n=a.fieldY)||void 0===n?void 0:n[0];p&&m&&g&&!(g.length<=2)&&h.forEach((t=>{var s;const n=g.filter((e=>e[null==u?void 0:u.field]===t));if(!n.length)return;const{evaluateGrid:h,confidenceInterval:y}=_i(e,n,(e=>null==e?void 0:e[p]),(e=>null==e?void 0:e[m]),i.polynomialDegree),v=Math.max(3,Math.floor(n.length/4)),f=h(v),b=y(v);o.push({color:null!=r?r:null===(s=null==u?void 0:u.scale)||void 0===s?void 0:s.scale(t),line:f.map((t=>{const i={[p]:t.x,[m]:t.y};return{x:a.dataToPositionX(i)+l.x,y:c("logisitc"===e?l.y+d.height*(1-t.y):a.dataToPositionY(i)+l.y)}})),area:b.map((e=>{const t={[p]:e.x,[m]:e.lower};return{x:a.dataToPositionX(t)+l.x,y:c(a.dataToPositionY(t)+l.y),y1:c(a.dataToPositionY({[m]:e.upper})+l.y)}}))})}))})),o},line:a,confidenceInterval:s,label:n}}}function ki(e){const{color:i,line:r,confidenceInterval:a,label:s}=e;return{type:"component",componentType:bi,interactive:!1,zIndex:500,style:{data:(r,a)=>{const s=a.vchart.getChart().getAllSeries().filter((e=>e.type===t.SeriesTypeEnum.bar)),n=[];return s&&s.length&&s.forEach((r=>{var a,s,o;const l=r.getRegion().getLayoutStartPoint(),d=r.getRegion().getLayoutStartPoint(),c=r.getRegion().getLayoutRect(),u=t.clamper(d.y,d.y+c.height),h=r.getViewData().latestData,g=null===(a=r.fieldX)||void 0===a?void 0:a[0],p=null===(s=r.fieldY)||void 0===s?void 0:s[0],m="horizontal"===r.direction,y=r.getRawDataStatisticsByField(g).values;if(m||!g||!p||!h||h.length<=2||y.length<=2)return;const{evaluateGrid:v,confidenceInterval:f}=t.regressionPolynomial(h,(e=>y.indexOf(null==e?void 0:e[g])),(e=>null==e?void 0:e[p]),{degree:e.degree}),b=y.length,x=v(b),_=f(b),S=r.getXAxisHelper().getBandwidth(0)/2;n.push({color:null!=i?i:null===(o=r.getOption().globalScale.getScale("color"))||void 0===o?void 0:o.scale(r.getSeriesKeys()[0]),line:x.map((e=>{const t={[g]:y[e.x],[p]:e.y};return{x:r.dataToPositionX(t)+l.x+S,y:u(r.dataToPositionY(t)+l.y)}})),area:_.map((e=>{const t={[g]:y[e.x],[p]:e.lower};return{x:r.dataToPositionX(t)+l.x+S,y:u(r.dataToPositionY(t)+l.y),y1:u(r.dataToPositionY({[p]:e.upper})+l.y)}}))})})),n},line:r,confidenceInterval:a,label:s}}}const Mi=(e,i,r)=>{switch(e){case"kde":return t.kde(i,r);case"ecdf":return t.ecdf(i)}};function Ci(e,i){const{line:r,label:a,color:s}=i;return{type:"component",componentType:bi,interactive:!1,zIndex:500,style:{data:(i,r)=>{const a=r.vchart.getChart().getAllSeries().filter((e=>e.type===t.SeriesTypeEnum.bar)),n=[];return a&&a.length&&a.forEach((i=>{var r,a,o,l,d,c,u,h;const g=i.getRegion().getLayoutStartPoint(),p=i._rawData,m=null==p?void 0:p.rawData,y=null===(a=null===(r=p.transformsArr)||void 0===r?void 0:r.find((e=>"bin"===e.type)))||void 0===a?void 0:a.options,v=null===(o=i.fieldX)||void 0===o?void 0:o[0],f=i.getYAxisHelper().getScale(0),b=i.getViewData().latestData;if(!(m&&m.length&&(null==y?void 0:y.field)&&f&&b&&b.length))return;const x=m.map((e=>e[y.field])),_=Mi(e,x,"kde"===e?{bandwidth:b[0][null!==(d=null===(l=y.outputNames)||void 0===l?void 0:l.x1)&&void 0!==d?d:"x1"]-b[0][null!==(u=null===(c=y.outputNames)||void 0===c?void 0:c.x0)&&void 0!==u?u:"x0"]}:null),S=Math.max(3,Math.floor(x.length/4)),k=_.evaluateGrid(S),M=f.range(),C=M[0],A=t.last(M),F="kde"===e?e=>f.scale(e*m.length*_.bandwidth):e=>C+(A-C)*e;n.push({color:null!=s?s:null===(h=i.getOption().globalScale.getScale("color"))||void 0===h?void 0:h.scale(i.getSeriesKeys()[0]),line:k.map((e=>{const t={[v]:e.x};return{x:i.dataToPositionX(t)+g.x,y:F(e.y)+g.y}}))})})),n},line:r,label:a}}}const Ai="ExtensionMarkSyncStatePlugin";class Fi extends t.BasePlugin{constructor(){super(Ai),this.type=Ai}onAfterInitChart(e,i){var r;if(!this._detectSyncState(i))return;const a=e.globalInstance.getChart();if(!a)return;const s=a.getEvent();if(this._subscribedEvent===s)return;null===(r=this._unsubscribeAfterRender)||void 0===r||r.call(this);const n=()=>this._syncStates();s.on(t.ChartEvent.afterRender,n),this._subscribedEvent=s,this._unsubscribeAfterRender=()=>{s.off(t.ChartEvent.afterRender,n),this._subscribedEvent=void 0}}release(){var e;null===(e=this._unsubscribeAfterRender)||void 0===e||e.call(this),super.release()}_detectSyncState(e){const t=null==e?void 0:e.series;return!!(null==t?void 0:t.some((e=>this._hasExtensionMarkWithSyncState(e.extensionMark))))||this._hasExtensionMarkWithSyncState(null==e?void 0:e.extensionMark)}_hasExtensionMarkWithSyncState(e){return!!(null==e?void 0:e.some((e=>"group"!==e.type&&e.syncState)))}_syncStates(){var e;const t=null===(e=this.service)||void 0===e?void 0:e.globalInstance.getChart();t&&t.getAllSeries().forEach((e=>{var t,i;const r=null===(i=null===(t=e.getSpec())||void 0===t?void 0:t.extensionMark)||void 0===i?void 0:i.filter((e=>"group"!==e.type&&e.syncState));(null==r?void 0:r.length)&&this._syncSeriesStates(e,r)}))}_syncSeriesStates(e,i){const r=new Map;if(e.getActiveMarks().forEach((e=>{e.getGraphics().forEach((e=>{var i;const a=null===(i=e.context)||void 0===i?void 0:i.key;t.isValid(a)&&r.set(String(a),e)}))})),0===r.size)return;const a=`${e.type}_${e.id}_extensionMark`;i.forEach(((i,s)=>{const n=t.isValid(i.name)?`${i.name}`:`${a}_${s}`,o=e.getMarkInName(n);o&&o.getGraphics().forEach((e=>{var i;const a=null===(i=e.context)||void 0===i?void 0:i.key;if(!t.isValid(a))return;const s=r.get(String(a));if(!s)return;const n=s.currentStates;(null==n?void 0:n.length)?e.useStates(n):e.clearStates()}))}))}}Fi.pluginType="chart",Fi.type=Ai;e.BAR_LINK=Jt,e.Bar3dChart=se,e.Bar3dChartSpecTransformer=H,e.Bar3dSeries=te,e.Bar3dSeriesSpecTransformer=J,e.BarLinkComponent=Qt,e.CandlestickChart=De,e.CandlestickChartSpecTransformer=Se,e.CandlestickSeries=Ie,e.CombinationCandlestickChart=je,e.CombinationCandlestickChart_TYPE=_e,e.ConversionFunnelChart=T,e.ConversionFunnelSeries=L,e.DEFAULT_STROKE_COLOR="#000",e.DefaultBandWidth=6,e.ExtensionMarkSyncStatePlugin=Fi,e.Funnel3dChart=he,e.Funnel3dSeries=ce,e.Funnel3dSeriesSpecTransformer=oe,e.Histogram3dChart=ge,e.ImageCloudChart=jt,e.MapLabelComponent=fi,e.PictogramChart=At,e.PictogramChartSpecTransformer=rt,e.PictogramSeries=Mt,e.Pie3dChart=xe,e.Pie3dChartSpecTransformer=pe,e.Pie3dSeries=fe,e.Pie3dSeriesSpecTransformer=ve,e.REGRESSION_LINE=bi,e.RangeColumn3dChart=Je,e.RangeColumn3dChartSpecTransformer=Ze,e.RangeColumn3dSeries=Xe,e.RangeColumn3dSeriesSpecTransformer=qe,e.RankingBar=n,e.RankingList=p,e.RegressionLine=xi,e.SERIES_BREAK=Wt,e.SVG_VIEWPORT_RECT_KEY=st,e.SequenceScatterKDE=j,e.SequenceScatterLink=I,e.SequenceScatterPixel=z,e.SeriesBreakComponent=Kt,e.SeriesLabelComponent=oi,e.TimelineChart=Gt,e.WordCloud3dChart=Ge,e.WordCloud3dChartSpecTransformer=He,e.WordCloud3dSeries=Ve,e.appendBarLinkConfig=function(e,i){e.customMark=t.array(e.customMark).filter((e=>e.componentType!==Jt)),e.customMark.push(ti(i))},e.appendBarRegressionLineConfig=function(e,i){var r;if(!i){const a=Array.isArray(e.series)?e.series:e.series?[e.series]:[];i=null!==(r=t.get(e,bi))&&void 0!==r?r:t.get(a.find((e=>e.type===t.SeriesTypeEnum.bar)),bi)}t.array(i).forEach((t=>{if(!1!==t.visible){e.customMark||(e.customMark=[]);const i=m(t,["visible"]);e.customMark.push(ki(i))}}))},e.appendHistogramRegressionLineConfig=function(e,i){var r;if(!i){const a=Array.isArray(e.series)?e.series:e.series?[e.series]:[];i=null!==(r=t.get(e,bi))&&void 0!==r?r:t.get(a.find((e=>e.type===t.SeriesTypeEnum.bar)),bi)}t.array(i).forEach((t=>{if(!1!==t.visible){e.customMark||(e.customMark=[]);const{type:i}=t,r=m(t,["type"]);e.customMark.push(Ci(i,r))}}))},e.appendScatterRegressionLineConfig=function(e,i){var r;if(!i){const a=Array.isArray(e.series)?e.series:e.series?[e.series]:[];i=null!==(r=t.get(e,bi))&&void 0!==r?r:t.get(a.find((e=>e.type===t.SeriesTypeEnum.scatter)),bi)}t.array(i).forEach((t=>{if(!1!==t.visible){e.customMark||(e.customMark=[]);const{type:i}=t,r=m(t,["type"]);e.customMark.push(Si(i,r))}}))},e.appendSeriesBreakConfig=e=>{var i;if(null===(i=e.axes)||void 0===i?void 0:i.length){const i=e.axes.filter((e=>e.breaks&&e.breaks.length&&!1!==e.visible));if(i.length)return e.customMark=t.array(e.customMark).filter((e=>e.componentType!==Wt)),e.customMark.push(Xt(i,i.map((t=>e.axes.indexOf(t))))),!0}return!1},e.appendSeriesLabelConfig=function(e,i){var r,a,s;if(e.customMark=t.array(e.customMark).filter((e=>e.componentType!==ii)),i||(i=null!==(s=null!==(r=t.get(e,ii))&&void 0!==r?r:t.get(null===(a=e.series)||void 0===a?void 0:a[0],ii))&&void 0!==s?s:{}),i.visible){const{position:t="end"}=i,r=m(i,["position"]);e.customMark.push(ni(t,r))}},e.clearSVGSource=function(){at.clear(),nt=null},e.getBarLinkConfig=ti,e.getBarRegressionLineConfig=ki,e.getHistogramRegressionLineConfig=Ci,e.getSVGSource=ct,e.getScatterRegressionLineConfig=Si,e.getSeriesBreakConfig=Xt,e.getSeriesLabelConfig=ni,e.register3DPlugin=q,e.registerAxis3dPlugin=()=>{q(),ae(),(()=>{t.registerCartesianBandAxis();const e=t.Factory.getComponentInKey(t.CartesianBandAxis.type);e.builtInTheme=Object.assign(Object.assign({},e.builtInTheme),{axisZ:Object.assign(Object.assign({},t.CartesianBandAxis.builtInTheme.axisX),$e)}),t.mixin(e,Ke)})(),(()=>{t.registerCartesianLinearAxis();const e=t.Factory.getComponentInKey(t.CartesianLinearAxis.type);e.builtInTheme=Object.assign(Object.assign({},e.builtInTheme),{axisZ:Object.assign(Object.assign({},t.CartesianLinearAxis.builtInTheme.axisX),$e)}),t.mixin(e,Ke)})(),(()=>{t.registerCartesianTimeAxis();const e=t.Factory.getComponentInKey(t.CartesianTimeAxis.type);e.builtInTheme=Object.assign(Object.assign({},e.builtInTheme),{axisZ:Object.assign(Object.assign({},e.builtInTheme.axisX),$e)}),t.mixin(e,Ke)})(),(()=>{t.registerCartesianLogAxis();const e=t.Factory.getComponentInKey(t.CartesianSymlogAxis.type);e.builtInTheme=Object.assign(Object.assign({},e.builtInTheme),{axisZ:Object.assign(Object.assign({},e.builtInTheme.axisX),$e)}),t.mixin(e,Ke)})(),(()=>{t.registerCartesianLogAxis();const e=t.Factory.getComponentInKey(t.CartesianLogAxis.type);e.builtInTheme=Object.assign(Object.assign({},e.builtInTheme),{axisZ:Object.assign(Object.assign({},t.CartesianLogAxis.builtInTheme.axisX),$e)}),t.mixin(e,Ke)})()},e.registerBar3dChart=()=>{q(),ae(),ie(),t.Factory.registerChart(se.type,se)},e.registerBar3dSeries=ie,e.registerBarLink=()=>{t.Factory.registerGraphicComponent(Jt,(e=>new Qt(e)))},e.registerCandlestickChart=()=>{t.registerDimensionTooltipProcessor(),t.registerMarkTooltipProcessor(),t.registerDimensionEvents(),t.registerDimensionHover(),Ee(),t.Factory.registerChart(De.type,De)},e.registerCandlestickSeries=Ee,e.registerCombinationCandlestickChart=()=>{Ee(),t.Factory.registerChart(je.type,je)},e.registerConversionFunnelChart=e=>{t.registerMarkFilterTransform();const i=(null==e?void 0:e.VChart)||t.VChart;i&&(i.useChart([T]),i.useSeries([L]))},e.registerEventSeries=Ht,e.registerExtensionMarkSyncStatePlugin=()=>{t.registerChartPlugin(Fi)},e.registerFunnel3dChart=()=>{t.registerMarkTooltipProcessor(),q(),ae(),ue(),t.Factory.registerChart(he.type,he)},e.registerFunnel3dSeries=ue,e.registerHistogram3dChart=()=>{t.registerGroupTooltipProcessor(),t.registerDimensionTooltipProcessor(),t.registerMarkTooltipProcessor(),t.registerDimensionEvents(),t.registerDimensionHover(),q(),ae(),ie(),t.Factory.registerChart(ge.type,ge)},e.registerImageCloudChart=()=>{Pt(),t.Factory.registerChart(jt.type,jt)},e.registerMapLabel=e=>{const i=(null==e?void 0:e.VChart)||t.VChart;i&&i.useComponent([fi])},e.registerPictogramChart=()=>{t.registerMarkTooltipProcessor(),Ct(),t.Factory.registerChart(At.type,At)},e.registerPictogramSeries=Ct,e.registerPie3dChart=()=>{t.registerMarkTooltipProcessor(),q(),ae(),be(),t.Factory.registerChart(xe.type,xe)},e.registerPie3dSeries=be,e.registerRangeColumn3dChart=()=>{t.registerDimensionTooltipProcessor(),t.registerMarkTooltipProcessor(),t.registerDimensionEvents(),t.registerDimensionHover(),q(),ae(),Ye(),t.Factory.registerChart(Je.type,Je)},e.registerRangeColumn3dSeries=Ye,e.registerRankingBarChart=e=>{const i=(null==e?void 0:e.VChart)||t.VChart;i&&i.useChart([n])},e.registerRankingList=e=>{const i=(null==e?void 0:e.VChart)||t.VChart;i&&i.useChart([p,t.BarChart])},e.registerRegressionLine=()=>{t.Factory.registerGraphicComponent(bi,(e=>new xi(e)))},e.registerSVGSource=lt,e.registerSequenceScatterKDE=e=>{const i=(null==e?void 0:e.VChart)||t.VChart;i&&i.useChart([j,t.ScatterChart])},e.registerSequenceScatterLink=e=>{const i=(null==e?void 0:e.VChart)||t.VChart;i&&i.useChart([I,t.ScatterChart])},e.registerSequenceScatterPixel=e=>{const i=(null==e?void 0:e.VChart)||t.VChart;i&&i.useChart([z,t.ScatterChart])},e.registerSeriesBreak=()=>{t.Factory.registerGraphicComponent("seriesBreak",(e=>new Kt(e)))},e.registerSeriesLabel=()=>{t.Factory.registerGraphicComponent("seriesLabel",(e=>new oi(e)))},e.registerTimelineChart=()=>{t.registerMarkTooltipProcessor(),Ht(),t.Factory.registerChart(Gt.type,Gt)},e.registerWordCloud3dChart=We,e.registerWordCloud3dSeries=Ne,e.registerWordCloudShape3dChart=()=>{q(),ze(),We()},e.registerWordCloudShape3dSeries=ze,e.svgSourceMap=at,e.transformCandlestickSeriesSpec=Be,e.unregisterSVGSource=dt}));
16
+ function f(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i}const y={cornerRadius:4,stroke:"black",strokeOpacity:1,lineWidth:1,closePath:!1,pickable:!1},v={symbolType:"triangle",size:8,scaleX:.7,fill:"black"},b={fill:"#606773",fontSize:12},x={fill:"#eff1f9"};class _ extends e.FunnelChartSpecTransformer{transformSpec(t){const{conversionArrow:e,extensionMark:i=[],funnelBackground:s}=t;if(e&&e.arrows&&e.arrows.length){const t=function(t){const{arrows:e}=t,i=f(t,["arrows"]),s=e.filter((t=>"left"===t.position)),r=e.filter((t=>"right"===t.position)),a=S(r,i),n=S(s,i),o=[];a&&(a.name="arrowRight",o.push(a));n&&(n.name="arrowLeft",o.push(n));return o}(e);t&&t.length&&i.push(...t)}if(s&&s.visible){const t=function(t){const{style:e={}}=t,i=f(t,["style"]);return Object.assign(Object.assign({type:"rect"},i),{dataIndex:0,zIndex:0,style:Object.assign(Object.assign(Object.assign({},x),e),{x:0,y:(t,e)=>e.getPoints(t)[0].y,width:(t,e)=>{const i=e.getRegion(),{width:s}=i.getLayoutRect();return s},height:(t,e)=>{const i=e.getPoints(t),s=i[0];return i[3].y-s.y}})})}(s);t&&i.push(t)}t.extensionMark=i,super.transformSpec(t)}_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.conversionArrow=t.conversionArrow,e.funnelBackground=t.funnelBackground,e}}function S(t,i){if(0===(null==t?void 0:t.length))return null;const{line:s,symbol:r,text:a,margin:n}=i,o=[],l={type:"group",zIndex:e.LayoutZIndex.Mark+1,children:[]},h=function(t={},e){const{style:i={}}=t,s=f(t,["style"]),r=(t,e)=>{var i,s;const{from:r,to:a}=t,{vchart:n}=e,o=null===(s=null===(i=null==n?void 0:n.getChart())||void 0===i?void 0:i.getSeriesData())||void 0===s?void 0:s.latestData;return!(a>o.length-1||r>o.length-1)};return Object.assign(Object.assign({type:"polygon",interactive:!1},s),{dataKey:t=>`${t.id}`,style:Object.assign(Object.assign(Object.assign({},y),i),{renderable:r,points:(t,i)=>{if(!r(t,i))return[];let s=t.layout.points;return s=A(t,i,e),s}})})}(s,n);h&&o.push(h);const c=function(t={},e){const{style:i={}}=t,s=f(t,["style"]);return Object.assign(Object.assign({type:"symbol",interactive:!1,dataKey:t=>`${t.id}`},s),{style:Object.assign(Object.assign(Object.assign({},v),i),{x:(t,i)=>{var s,r;let a=t.layout.points;return a=A(t,i,e),null!==(r=null===(s=a[(null==a?void 0:a.length)-1])||void 0===s?void 0:s.x)&&void 0!==r?r:NaN},y:(t,i)=>{var s,r;let a=t.layout.points;return a=A(t,i,e),null!==(r=null===(s=a[(null==a?void 0:a.length)-1])||void 0===s?void 0:s.y)&&void 0!==r?r:NaN},angle:t=>"left"===t.position?90:-90})})}(r,n);c&&o.push(c);const d=function(t={},i){const{style:s={},formatMethod:r,textMargin:a=4}=t,n=f(t,["style","formatMethod","textMargin"]);return Object.assign(Object.assign({type:"text",dataKey:t=>`${t.id}`,interactive:!1,animation:!1},n),{style:Object.assign(Object.assign(Object.assign({},b),{text:(t,i)=>{var s,a,n,o,l,h,c;const{text:d}=t;let u=d;if(e.isFunction(r)){const{vchart:e}=i,{from:p,to:g}=t,{field:m}=t.context,f=null!==(n=null===(a=null===(s=null==e?void 0:e.getChart())||void 0===s?void 0:s.getSeriesData())||void 0===a?void 0:a.latestData)&&void 0!==n?n:[],y=null!==(c=null===(h=null===(l=null===(o=null==e?void 0:e.getChart())||void 0===o?void 0:o.getAllSeries()[0])||void 0===l?void 0:l.getViewData())||void 0===h?void 0:h.latestData)&&void 0!==c?c:[],v=y.find((t=>t[m]===f[p][m])),b=y.find((t=>t[m]===f[g][m]));u=r(d,{arrow:t,from:v,to:b})}return u},x:(t,e)=>{var s,r;let n=t.layout.points;return n=A(t,e,i),null!==(r=(null===(s=n[1])||void 0===s?void 0:s.x)+("left"===t.position?-a:a))&&void 0!==r?r:NaN},y:(t,e)=>{var s,r,a;let n=t.layout.points;return n=A(t,e,i),null!==(a=((null===(s=n[1])||void 0===s?void 0:s.y)+(null===(r=n[2])||void 0===r?void 0:r.y))/2)&&void 0!==a?a:NaN},textAlign:t=>"left"===t.position?"right":"left",textBaseline:"middle"}),s)})}(a,n);return d&&o.push(d),l.children=o,l}function A(t,e,i){var s,r,a,n,o;const{vchart:l}=e,{from:h,to:c}=t,{field:d}=t.context,u=null===(r=null===(s=null==l?void 0:l.getChart())||void 0===s?void 0:s.getSeriesData())||void 0===r?void 0:r.latestData,p=null===(o=null===(n=null===(a=null==l?void 0:l.getChart())||void 0===a?void 0:a.getAllSeries()[0])||void 0===n?void 0:n.getViewData())||void 0===o?void 0:o.latestData;let g=[];if(u&&u.length){const s=p.find((t=>t[d]===u[h][d])),r=p.find((t=>t[d]===u[c][d])),a=p[0];if(s&&r&&a){g=function(t,e,i,s,r=12){const{layout:a,distance:n,position:o}=t,{level:l,fromIndex:h,toIndex:c,fromTotal:d,toTotal:u}=a,p="right"===o,g=p?e[1]:e[0],m=p?e[2]:e[3],f=Math.abs(g.y-m.y),y=p?i[1]:i[0],v=p?i[2]:i[3],b=Math.abs(y.y-v.y),x=p?s[1]:s[0],_=f/(d+1),S=b/(u+1),A=g.y+_*(h+1),T=y.y+S*(c+1),C=p?-1:1,M=[{x:g.x-r*C,y:A},{x:x.x-(r+(l+1)*n)*C,y:A},{x:x.x-(r+(l+1)*n)*C,y:T},{x:y.x-r*C,y:T}];return M}(t,e.getPoints(s),e.getPoints(r),e.getPoints(a),i),t.layout.points=g}}return g}function T(t,e){const{from:i,to:s}=t,{from:r,to:a}=e;return s>r&&a>i}function C(t,e){const{from:i,to:s}=t,{from:r,to:a}=e;return i===r&&s===a}const M=(t,i)=>{var s,r,a;if(!t||!(null===(s=t.arrows)||void 0===s?void 0:s.length))return[];const{arrows:n}=t,o=function(t,i){return t.filter((t=>e.isValidNumber(t.from*t.to))).map(((t,e)=>{const{from:s,to:r,position:a="right"}=t;return Object.assign(Object.assign({},t),{position:a,distance:t.distance||40,from:Math.min(s,r),to:Math.max(s,r),span:Math.abs(s-r),isLayout:!1,context:{field:i},layout:{level:0},id:`${s}-${r}-${a}-${e}`})}))}(n,i.categoryField),l=o.filter((t=>"left"===t.position)),h=o.filter((t=>"right"===t.position));return[...null!==(r=k(l))&&void 0!==r?r:[],...null!==(a=k(h))&&void 0!==a?a:[]]};function k(t){if(0===(null==t?void 0:t.length))return null;const i=new Map;return t.forEach((t=>{const s=i.get(t.from);if(e.isValid(s)){const e=s.fromArrows.find((e=>C(e,t)));e?t.layout.duplicateNode=e:s.degree+=1,s.fromArrows.push(t)}else i.set(t.from,{fromArrows:[t],toArrows:[],totalArrows:[],degree:1});const r=i.get(t.to);if(e.isValid(r)){const e=r.toArrows.find((e=>C(e,t)));e?t.layout.duplicateNode=e:r.degree+=1,r.toArrows.push(t)}else i.set(t.to,{toArrows:[t],fromArrows:[],totalArrows:[],degree:1})})),i.forEach((t=>{t.fromArrows.sort(((t,e)=>e.span-t.span)),t.toArrows.sort(((t,e)=>t.span-e.span)),t.totalArrows=[...t.toArrows,...t.fromArrows]})),t.sort(((t,e)=>t.span-e.span)).forEach((s=>{var r;const a=t.filter((t=>t.layout.isLayout)),n=e.maxInArray(a,((t,e)=>t.layout.level-e.layout.level));let o=null!==(r=null==n?void 0:n.layout.level)&&void 0!==r?r:0;for(;o>=0;){if(a.some((t=>t.layout.level===o&&T(t,s)))){o+=1;break}--o}s.layout.level=Math.max(0,o),s.layout.fromTotal=i.get(s.from).degree,s.layout.toTotal=i.get(s.to).degree;const l=s.layout.duplicateNode;l?(s.layout.fromIndex=l.layout.fromIndex,s.layout.toIndex=l.layout.toIndex):(s.layout.fromIndex=w(s,i.get(s.from).totalArrows),s.layout.toIndex=w(s,i.get(s.to).totalArrows)),s.layout.isLayout=!0})),t}function w(t,e){let i=0,s=0;for(let r=0;r<e.length;r++){const a=e[r];if(a===t){i=r-s;break}a.layout.duplicateNode&&s++}return i}class P extends e.FunnelChart{constructor(){super(...arguments),this.type="conversionFunnel",this.transformerConstructor=_}}P.type="conversionFunnel",P.transformerConstructor=_;class O extends e.FunnelSeries{initData(){var t;super.initData();const{conversionArrow:i}=this._spec;i&&(null===(t=i.arrows)||void 0===t?void 0:t.length)&&(this._arrowData=new e.DataView(this._dataSet,{name:`${e.PREFIX}_series_${this.id}_arrowData`}),this._dataSet.getTransform("conversionArrow")||this._dataSet.registerTransform("conversionArrow",M),this._arrowData.parse(i).transform({type:"conversionArrow",options:{categoryField:this._spec.categoryField}}))}afterCompile(){var t;null===(t=super.afterCompile)||void 0===t||t.call(this);const e=this.getMarkInName("arrowRight");e&&e.getMarks().forEach((t=>{t.setDataView(this._arrowData),t.compileData(),t.setTransform([{type:"filter",callback:t=>"right"===t.position}])}));const i=this.getMarkInName("arrowLeft");i&&i.getMarks().forEach((t=>{t.setDataView(this._arrowData),t.compileData(),t.setTransform([{type:"filter",callback:t=>"left"===t.position}])}))}}const B="dataKey";class L extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,s,r,a;super.transformSpec(t);const n=function(t){const e=[];return Object.keys(t.data).forEach((i=>{const s=t.data[i].nodes;e.push({data:[{id:"nodes",values:s.map(((t,e)=>Object.assign(Object.assign({},t),{[B]:e})))},{id:"endpoints",values:[]},{id:"iter",values:[{iter:i}]},{id:"background",values:[{iter:i,x:t.scope[0],y:t.scope[1]},{iter:i,x:t.scope[0],y:t.scope[3]},{iter:i,x:t.scope[2],y:t.scope[3]},{iter:i,x:t.scope[2],y:t.scope[1]},{iter:i,x:t.scope[0],y:t.scope[1]}]}]})})),e}(t),o="neighborhood"!==t.taskType;t.type="common",t.dataKey=B,t.data=n[0].data,t.series=[{id:"background-series",type:"area",dataId:"background",interactive:!1,persent:!0,xField:"x",yField:"y",point:{visible:!1},line:{visible:!1},area:{visible:!0,interactive:!1,style:{background:e=>"neighborhood"===t.taskType?"":`https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/sequence-scatter-bgimg-2/${e.iter}.png`,fill:"transparent",fillOpacity:.5}},hover:{enable:!1},select:{enable:!1}},{id:"line-series",type:"line",dataId:"endpoints",xField:"x",yField:"y",seriesField:"edgeId",animation:!0,point:{visible:!1},line:{visible:!0,style:{stroke:t=>t.color,lineDash:t=>"same_type"===t.type?[0,0]:[3,2],lineWidth:.8,strokeOpacity:.6}}},{id:"scatter-series",type:"scatter",dataId:"nodes",xField:t.xField,yField:t.yField,seriesField:"label",point:{state:{hover:{scaleX:1.5,scaleY:1.5,fillOpacity:1},hover_reverse:{scaleX:1,scaleY:1,fillOpacity:.3}},style:{size:()=>"neighborhood"===t.taskType?6:4,fill:e=>{var i;return null!==(i=t.labelColor[e.label])&&void 0!==i?i:"gray"},fillOpacity:t=>t.confidence}},label:{visible:!0,style:{visible:()=>"neighborhood"===t.taskType,type:"text",fontFamily:"Console",fontStyle:"italic",fontSize:12,fill:"black",fillOpacity:.6,text:t=>t.id}}}],t.player&&(t.player=Object.assign(Object.assign({},t.player),{specs:n}),t.animationAppear={duration:null!==(i=null===(e=t.player)||void 0===e?void 0:e.duration)&&void 0!==i?i:2e3,easing:"linear"},t.animationUpdate={duration:null!==(r=null===(s=t.player)||void 0===s?void 0:s.duration)&&void 0!==r?r:2e3,easing:"linear"}),t.axes=[{orient:"left",type:"linear",inverse:!0,min:t.scope[1],max:t.scope[3]},{orient:"bottom",type:"linear",min:t.scope[0],max:t.scope[2]}],t.customMark=[{type:"text",dataId:"iter",style:Object.assign({x:50,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:100,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(a=t.infoLabel)||void 0===a?void 0:a.style)}],t.legends=[{seriesId:"scatter-series",visible:!0,orient:"right",position:"middle",data:t=>t.map((t=>(t.shape.outerBorder={stroke:t.shape.fill,distance:2,lineWidth:1},t))),title:{visible:!0,align:"left",textStyle:{text:"Classes",fontFamily:"Console",fontSize:18,fontWeight:"bold"}},item:{visible:!0,width:"8%",value:{alignRight:!0,style:{fill:"#000",fillOpacity:1,fontSize:12},state:{unselected:{fill:"#d8d8d8"}}}}}],t.tooltip={visible:o,seriesId:"scatter-series",lockAfterClick:!1,activeType:"mark",trigger:"hover",mark:{title:{visible:!0,value:"Info"},content:[{key:"Label",value:t=>t.label,shapeType:"circle",shapeSize:8},{key:"Prediction",value:t=>t.prediction,shapeType:"circle",shapeSize:8,shapeFill:e=>{var i;return null!==(i=t.labelColor[e.prediction])&&void 0!==i?i:"gray"}},{key:"Confidence",value:t=>t.confidence.toFixed(2),shapeType:"square",shapeSize:8,shapeFill:t=>t.label===t.prediction?"green":"red"}]},style:{panel:{padding:{top:10,bottom:15,left:10,right:10},backgroundColor:"#fff",border:{color:"#eee",width:1,radius:10}},titleLabel:{fontSize:20,fontFamily:"Times New Roman",fill:"brown",fontWeight:"bold",textAlign:"center",lineHeight:24},keyLabel:{fontSize:16,fontFamily:"Times New Roman",fill:"black",textAlign:"center",lineHeight:15,spacing:10},valueLabel:{fontSize:14,fill:"black",textAlign:"center",lineHeight:15,spacing:10}}},t.dataZoom=[{visible:!1,orient:"left",filterMode:"axis",showDetail:!1,roamZoom:{enable:!0,focus:!0,rate:3},roamDrag:{enable:!0,reverse:!0,rate:1}},{visible:!1,orient:"bottom",filterMode:"axis",showDetail:!1,roamZoom:{enable:!0,focus:!0,rate:3},roamDrag:{enable:!0,reverse:!0,rate:1}}],super.transformSpec(t)}}class E extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterLink",this.transformerConstructor=L}init(){this.isValid()&&super.init()}isValid(){var t,e,i,s;const{xField:r,yField:a,data:n}=this._spec;return r&&a?!!n||(null===(s=(i=this._option).onError)||void 0===s||s.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}E.type="sequenceScatterLink",E.view="singleDefault",E.transformerConstructor=L;const D=.2;function F(t){const e=Math.sqrt((2*Math.PI)**2);return Math.exp(-(t**2)/2)/e}const I="dataKey";class R extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,s,r,a,n;super.transformSpec(t);const o=function(t){const e=[];return Object.keys(t.data).forEach((i=>{const s=t.data[i].map(((t,e)=>Object.assign(Object.assign({},t),{[I]:e}))),r=function(t,e=100,i){const s=t.reduce(((t,e)=>{const i=e.label;return t[i]=t[i]||[],t[i].push(e),t}),{}),r=[];return Object.entries(s).forEach((([t,s])=>{const a=i||function(t){return t.length**(-1/6)}(s),n=s.map((t=>t.x)),o=s.map((t=>t.y)),l=Math.min(...n),h=Math.max(...n),c=Math.min(...o),d=Math.max(...o),u=l-(h-l)*D,p=c-(d-c)*D;for(let i=0;i<e;i++)for(let n=0;n<e;n++){const e=u+.1*i,o=p+.1*n;let l=0;for(const t of s)l+=F(Math.sqrt((e-t.x)**2+(o-t.y)**2)/a);l/=s.length*a*a,r.push({x:e,y:o,kde:l,label:t})}})),r}(s,150);e.push({data:[{id:"nodes",values:s},{id:"iter",values:[{iter:i}]},{id:"kde",values:r}]})})),e}(t);t.type="common",t.dataKey=I,t.data=o[0].data,t.scales=[{id:"colorScale",type:"ordinal",specified:{0:"rgb(150, 10, 100)",1:"rgb(31, 119, 180)",2:"rgb(255, 127, 14)",3:"rgb(44, 160, 44)",4:"rgb(214, 39, 40)",5:"rgb(148, 103, 189)",6:"rgb(140, 86, 75)",7:"rgb(227, 119, 194)",8:"rgb(127, 127, 127)",9:"rgb(188, 189, 34)",10:"rgb(23, 190, 207)"}},{id:"brighterColorScale",type:"ordinal",specified:{0:"rgb(150, 10, 150)",1:"rgb(31, 119, 230)",2:"rgb(255, 127, 64)",3:"rgb(44, 160, 94)",4:"rgb(214, 39, 90)",5:"rgb(148, 103, 239)",6:"rgb(140, 86, 125)",7:"rgb(227, 119, 244)",8:"rgb(127, 127, 177)",9:"rgb(188, 189, 84)",10:"rgb(23, 190, 255)"}},...null!==(e=t.scales)&&void 0!==e?e:[]],t.series=[{type:"scatter",dataIndex:0,xField:t.xField,yField:t.yField,seriesField:t.seriesField,size:5,point:{zIndex:1e3,style:{fill:{scale:"colorScale",field:t.seriesField}}}}];t.customMark=[{type:"text",dataIndex:1,style:Object.assign({text:t=>t.iter,x:10,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:25,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(i=t.infoLabel)||void 0===i?void 0:i.style)},{type:"symbol",dataIndex:2,style:{symbolType:"rect",x:(t,e)=>54+(0,e.chart.getAllSeries()[0]._markAttributeContext.valueToX)([t.x]),y:(t,e)=>(0,e.chart.getAllSeries()[0]._markAttributeContext.valueToY)([t.y])+26,size:5,fill:{scale:"brighterColorScale",field:"label"},fillOpacity:t=>10*t.kde}}],t.tooltip={visible:!0,fields:["x","y","label"]},t.player&&(t.player=Object.assign(Object.assign({},t.player),{specs:o}),t.animationAppear={duration:null!==(r=null===(s=t.player)||void 0===s?void 0:s.duration)&&void 0!==r?r:2e3,easing:"linear"},t.animationUpdate={duration:null!==(n=null===(a=t.player)||void 0===a?void 0:a.duration)&&void 0!==n?n:2e3,easing:"linear"}),t.axes=[{orient:"left",type:"linear",nice:!0},{orient:"bottom",type:"linear",nice:!0,label:{visible:!0}}],super.transformSpec(t)}}class N extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterKDE",this.transformerConstructor=R}init(){this.isValid()&&super.init()}isValid(){var t,e,i,s;const{xField:r,yField:a,data:n}=this._spec;return r&&a?!!n||(null===(s=(i=this._option).onError)||void 0===s||s.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}N.type="sequenceScatterKDE",N.view="singleDefault",N.transformerConstructor=R;const j="dataKey";function U(t){const e=[];return Object.keys(t.data).forEach((i=>{let s=null;if(t.backgroundColors&&t.backgroundColors[i]){const e=function(t,e){var i;if("undefined"==typeof document)throw new Error("Canvas rendering requires browser environment with document object");const s=document.createElement("canvas");s.width=e.width,s.height=e.height;const r=s.getContext("2d");if(!r)throw new Error("Failed to get 2D rendering context from canvas");const a=r.createImageData(e.width,e.height);for(let e=0;e<300;e++)for(let s=0;s<300;s++){const r=(null===(i=t[e])||void 0===i?void 0:i[s])||[0,0,0],n=4*(300*e+s);a.data[n]=Math.round(255*r[0]),a.data[n+1]=Math.round(255*r[1]),a.data[n+2]=Math.round(255*r[2]),a.data[n+3]=255}return r.putImageData(a,0,0),s.toDataURL("image/png")}(t.backgroundColors[i],t);s={imageData:e}}e.push({data:[{id:"nodes",values:t.data[i].map(((t,e)=>Object.assign(Object.assign({},t),{[j]:e})))},{id:"inter",values:[{inter:i}]},{id:"background",values:s?[s]:[]}]})})),e}class z extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,s,r,a;super.transformSpec(t);const n=U(t);t.type="common",t.dataKey=j,t.data=n[0].data,t.width=300,t.height=300,t.autoFit=!1,t.series=[{type:"scatter",xField:t.xField,yField:t.yField}],t.player&&(t.player=Object.assign(Object.assign({},t.player),{specs:n}),t.animationAppear={duration:null!==(i=null===(e=t.player)||void 0===e?void 0:e.duration)&&void 0!==i?i:2e3,easing:"linear"},t.animationUpdate={duration:null!==(r=null===(s=t.player)||void 0===s?void 0:s.duration)&&void 0!==r?r:2e3,easing:"linear"}),t.axes=[{orient:"left",type:"linear"},{orient:"bottom",label:{visible:!0},type:"linear"}],t.customMark=[{type:"image",dataIndex:2,style:{x:0,y:0,width:300,height:300,image:t=>t.imageData,zIndex:-1}},{type:"text",dataIndex:1,style:Object.assign({text:t=>t.inter,x:50,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:100,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(a=t.infoLabel)||void 0===a?void 0:a.style)}],t.tooltip={visible:!1},super.transformSpec(t)}}class V extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterPixel",this.transformerConstructor=z}init(){this.isValid()&&super.init()}isValid(){var t,e,i,s;const{xField:r,yField:a,data:n}=this._spec;return r&&a?!!n||(null===(s=(i=this._option).onError)||void 0===s||s.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}V.type="sequenceScatterPixel",V.view="singleDefault",V.transformerConstructor=z;class G extends e.BarChartSpecTransformer{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.barWidth=t.barWidth,e.barMaxWidth=t.barMaxWidth,e.barMinWidth=t.barMinWidth,e.barGapInGroup=t.barGapInGroup,e}}var W,H,$,X,Y;!function(t){t.bar3d="bar3d",t.histogram3d="histogram3d",t.rangeColumn3d="rangeColumn3d",t.pie3d="pie3d",t.wordCloud3d="wordCloud3d",t.funnel3d="funnel3d"}(W||(W={})),function(t){t.rect3d="rect3d",t.arc3d="arc3d",t.pyramid3d="pyramid3d"}(H||(H={})),function(t){t.bar3d="bar3d",t.rangeColumn3d="rangeColumn3d",t.pie3d="pie3d",t.wordCloud3d="wordCloud3d",t.funnel3d="funnel3d"}($||($={})),function(t){t.bar3d="bar3d",t.funnel3d="funnel3d",t.transform3d="transform3d",t.pie3d="pie3d"}(X||(X={})),function(t){t.bar3d_horizontal="bar3d_horizontal",t.bar3d_vertical="bar3d_vertical",t.bar3d_stack="bar3d_stack",t.rangeColumn3d_horizontal="rangeColumn3d_horizontal",t.rangeColumn3d_vertical="rangeColumn3d_vertical"}(Y||(Y={}));const K=t=>t.zField||t.series&&t.series.some((t=>t.zField));class q extends e.BasePlugin{constructor(){super(q.type),this.type="VChart3dPlugin"}onInit(t,e){var i,s;if(this._is3d=!!(s=e)&&((t=>"bar3d"===t||"funnel3d"===t||"histogram3d"===t||"pie3d"===t||"rangeColumn3d"===t||"wordCloud3d"===t)(s.type)||K(s),!0),this._is3d){const{globalInstance:e}=t;e.getCompiler().getStage().set3dOptions(Object.assign({},null===(i=e._option)||void 0===i?void 0:i.options3d))}}onBeforeInitChart(t,e,i){this._is3d&&K(e)&&(e.layout={type:"layout3d"})}}q.pluginType="chart",q.type="VChart3dPlugin";const Z=()=>{e.registerChartPlugin(q),e.registerDirectionalLight(),e.registerOrthoCamera(),e.registerViewTransform3dPlugin()},Q={label:{name:"label",type:"text"},bar3d:{name:"bar3d",type:"rect3d"}};class J extends e.BarSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"bar3d")}}class tt extends e.BaseMark{_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,length:3})}setDataLabelType(){return"rect"}constructor(t,e){super(t,e),this.type=tt.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}tt.type="rect3d";const et=()=>{e.Factory.registerMark(tt.type,tt),e.registerShadowRoot(),e.registerRect3d(),e.registerRectAnimation(),e.Factory.registerGraphicComponent("rect3d",e.createRect3d)};class it extends e.BarSeries{constructor(){super(...arguments),this.type=$.bar3d,this._barMarkName="bar3d",this._barMarkType="rect3d",this.transformerConstructor=J}}it.type=$.bar3d,it.mark=Q,it.builtInTheme={bar3d:{bar3d:{style:{length:3}},label:{visible:!1,style:{offset:12,position:"outside"}}}},it.transformerConstructor=J;const st=()=>{e.Factory.registerAnimation("bar3d",((t,i)=>({appear:e.barPresetAnimation(t,i),enter:e.barGrowIn(t,!1),exit:e.barGrowOut(t,!1),disappear:e.barGrowOut(t)}))),et(),e.registerCartesianBandAxis(),e.registerCartesianLinearAxis(),e.Factory.registerSeries(it.type,it)};class rt extends e.Layout{layoutItems(t,i,s,r){this._layoutInit(t,i,s,r);const a={recomputeWidth:this.recomputeWidth,recomputeHeight:this.recomputeHeight};this._layoutNormalItems(i,a);const n={left:this.leftCurrent,top:this.topCurrent,right:this.rightCurrent,bottom:this.bottomCurrent},o=i.filter((t=>"absolute"===t.layoutType)),l=o.filter((t=>"z"===t.layoutOrient));let h={width:0,height:0};if(l.length){h=l[0].getLayoutRect()}this.leftCurrent+=h.width/8,this.rightCurrent-=h.width/8,this.topCurrent+=h.height/8,this.bottomCurrent-=h.height/8;const{regionItems:c,relativeItems:d,relativeOverlapItems:u,allRelatives:p,overlapItems:g}=this._groupItems(i);this.layoutRegionItems(c,d,u,g,a),this._processAutoIndent(c,d,u,g,p,n,a);const m=o.filter((t=>"z"!==t.layoutOrient));this.layoutAbsoluteItems(m);const f=d.filter((t=>"axes"===t.model.specKey&&e.isXAxis(t.layoutOrient)))[0],y=d.filter((t=>"axes"===t.model.specKey&&e.isYAxis(t.layoutOrient)))[0];if(f&&l.length){const t=f.getLayoutStartPoint(),e=f.getLayoutRect(),i={x:"left"===y.layoutOrient?t.x+e.width:t.x,y:t.y,width:this._chartLayoutRect.width,height:this._chartLayoutRect.height};l[0].model.directionStr="left"===y.layoutOrient?"r2l":"l2r";const s=f.getLayoutRect(),r=y.getLayoutRect(),a={length:l[0].getLayoutRect().width,width:s.width,height:r.height};f.model.setLayout3dBox&&f.model.setLayout3dBox(a),y.model.setLayout3dBox&&y.model.setLayout3dBox(a),l[0].model.setLayout3dBox&&l[0].model.setLayout3dBox(a),this.layoutZAxisItems(l,i)}}layoutZAxisItems(t,e){t.forEach((t=>{t.absoluteLayoutInRect(e)}))}getItemComputeLayoutRect(t,e){e||(e={offsetLeft:0,offsetRight:0,offsetTop:0,offsetBottom:0});return{width:this.rightCurrent-this.leftCurrent-t.layoutPaddingLeft-t.layoutPaddingRight-(e.offsetLeft+e.offsetRight),height:this.bottomCurrent-this.topCurrent-t.layoutPaddingTop-t.layoutPaddingBottom-(e.offsetTop+e.offsetBottom)}}_checkAutoIndent(t){const e={top:0,left:0,bottom:0,right:0},i=this._chartViewBox.x2-this._chartViewBox.x1-this.rightCurrent,s=this._chartViewBox.y2-this._chartViewBox.y1-this.bottomCurrent;return t.forEach((t=>{if(!t.getModelVisible()||!t.autoIndent)return;const r="left"===t.layoutOrient||"right"===t.layoutOrient,a=t.getLastComputeOutBounds();r?(e.top=Math.max(e.top,a.y1-this.topCurrent),e.bottom=Math.max(e.bottom,a.y2-s)):(e.left=Math.max(e.left,a.x1-this.leftCurrent),e.right=Math.max(e.right,a.x2-i))})),e}}rt.type="layout3d";const at=()=>{e.Factory.registerLayout(rt.type,rt)};class nt extends e.BarChart{constructor(){super(...arguments),this.transformerConstructor=G,this.type="bar3d",this.seriesType=$.bar3d}}nt.type="bar3d",nt.seriesType=$.bar3d,nt.transformerConstructor=G;const ot=Object.assign(Object.assign({},e.baseSeriesMark),{funnel3d:{name:"funnel3d",type:"pyramid3d"},transform3d:{name:"transform3d",type:"pyramid3d"},transformLabel:{name:"transformLabel",type:"text"},outerLabel:{name:"outerLabel",type:"text"},outerLabelLine:{name:"outerLabelLine",type:"rule"}});class lt extends e.FunnelSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"funnel3d"),t.isTransform&&this._addMarkLabelSpec(t,"transform3d","transformLabel")}}class ht extends e.BasePolygonMark{_getDefaultStyle(){const t=super._getDefaultStyle();return t.stroke=!1,t}constructor(t,e){super(t,e),this.type=ht.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}ht.type="pyramid3d";const ct=e.getFunnelTheme(!0);class dt extends e.FunnelSeries{constructor(){super(...arguments),this.type=$.funnel3d,this._funnelMarkName="funnel3d",this._funnelMarkType="pyramid3d",this._transformMarkName="transform3d",this._transformMarkType="pyramid3d",this.transformerConstructor=lt}initMark(){var t,e,i,s,r,a,n,o;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},dt.mark.funnel3d),{name:this._funnelMarkName,type:this._funnelMarkType}),{themeSpec:null===(t=this._theme)||void 0===t?void 0:t.funnel3d,key:this._seriesField,isSeriesMark:!0},{support3d:!0}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},dt.mark.transform3d),{name:this._transformMarkName,type:this._transformMarkType}),{themeSpec:null===(e=this._theme)||void 0===e?void 0:e.transform3d,key:this._seriesField,skipBeforeLayouted:!1,dataView:this._viewDataTransform.getDataView(),dataProductId:this._viewDataTransform.getProductId()})),null===(s=null===(i=this._spec)||void 0===i?void 0:i.outerLabel)||void 0===s?void 0:s.visible){const{line:t}=null!==(r=this._spec.outerLabel)&&void 0!==r?r:{},{line:e}=null!==(n=null===(a=this._theme)||void 0===a?void 0:a.outerLabel)&&void 0!==n?n:{};this._funnelOuterLabelMark.label=this._createMark(dt.mark.outerLabel,{themeSpec:null===(o=this._theme)||void 0===o?void 0:o.outerLabel,key:this._seriesField,markSpec:this._spec.outerLabel}),this._funnelOuterLabelMark.line=this._createMark(dt.mark.outerLabelLine,{themeSpec:e,key:this._seriesField,markSpec:t})}}initMarkStyle(){super.initMarkStyle();const t=this._funnelMark;t&&this.setMarkStyle(t,{z:t=>{if(this._isHorizontal())return 0;const e=this.getPoints(t),i=Math.max(Math.abs(e[0].x-e[1].x),Math.abs(e[2].x-e[3].x));return(this._computeMaxSize()-i)/2}},"normal",e.AttributeLevel.Series)}initLabelMarkStyle(t){var i,s;super.initLabelMarkStyle(t),this.setMarkStyle(t,{z:t=>{if(this._isHorizontal())return 0;const e=this.getPoints(t),i=Math.max(Math.abs(e[0].x-e[1].x),Math.abs(e[2].x-e[3].x));return(this._computeMaxSize()-i)/2}},"normal",e.AttributeLevel.Series),this._labelMark=t,null===(i=this._funnelOuterLabelMark)||void 0===i||i.label,null===(s=this._funnelOuterLabelMark)||void 0===s||s.line}}dt.type=$.funnel3d,dt.mark=ot,dt.builtInTheme={funnel3d:ct},dt.transformerConstructor=lt;const ut=()=>{e.Factory.registerMark(ht.type,ht),e.registerShadowRoot(),e.registerPyramid3d(),e.registerPolygonAnimation(),e.Factory.registerGraphicComponent("pyramid3d",e.createPyramid3d),e.registerTextMark(),e.registerRuleMark(),e.Factory.registerSeries(dt.type,dt)};class pt extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=e.FunnelChartSpecTransformer,this.type="funnel3d",this.seriesType=$.funnel3d}}pt.type="funnel3d",pt.seriesType=$.funnel3d,pt.transformerConstructor=e.FunnelChartSpecTransformer;class gt extends e.BaseHistogramChart{constructor(){super(...arguments),this.transformerConstructor=e.HistogramChartSpecTransformer,this.type="histogram3d",this.seriesType=$.bar3d}_setModelOption(){this._modelOption.getDimensionInfo=e.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=e.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=e.getCartesianCrosshairRect}}gt.type="histogram3d",gt.seriesType=$.bar3d,gt.transformerConstructor=e.HistogramChartSpecTransformer;class mt extends e.BasePieChartSpecTransformer{transformSpec(t){super.transformSpec(t),t.series.forEach((e=>{"pie3d"===e.type&&(e.angle3d=t.angle3d)}))}}class ft{static GenAutoIncrementId(){return ft.auto_increment_id++}}ft.auto_increment_id=0;const yt=new class{},vt=s.tau-1e-8;class bt{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,r,a,n){if(Math.abs(a-r)>vt)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let o,l,h,c,d=1/0,u=-1/0,p=1/0,g=-1/0;function m(t){h=i*Math.cos(t),c=i*Math.sin(t),h<d&&(d=h),h>u&&(u=h),c<p&&(p=c),c>g&&(g=c)}if(m(r),m(a),a!==r)if((r%=s.tau)<0&&(r+=s.tau),(a%=s.tau)<0&&(a+=s.tau),a<r&&(n=!n,o=r,r=a,a=o),n)for(a-=s.tau,o=r-r%s.halfPi,l=0;l<4&&o>a;++l,o-=s.halfPi)m(o);else for(o=r-r%s.halfPi+s.halfPi,l=0;l<4&&o<a;++l,o+=s.halfPi)m(o);this.bounds.add(t+d,e+p),this.bounds.add(t+u,e+g)}arcTo(t,e,i,s,r){this.bounds.add(t,e)}bezierCurveTo(t,e,i,s,r,a){this.bounds.add(t,e),this.bounds.add(i,s),this.bounds.add(r,a)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,s){this.bounds.add(t,e),this.bounds.add(i,s)}rect(t,e,i,s){this.bounds.add(t,e),this.bounds.add(t+i,e+s)}clear(){this.bounds.clear()}release(...t){}}class xt{constructor(){this._curves=[],this.bounds=new s.AABBBounds}get curves(){return this._curves}getCurveLengths(){return this._curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const _t=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,St={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7},At={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let Tt,Ct,Mt,kt,wt,Pt;var Ot,Bt,Lt,Et,Dt,Ft;function It(t){const e=t[0],i=t[1],s=t[2],r=t[3],a=t[4],n=t[5],o=t[6],l=t[7],h=l*a,c=-o*n,d=o*a,u=l*n,p=Math.cos(s),g=Math.sin(s),m=Math.cos(r),f=Math.sin(r),y=.5*(r-s),v=Math.sin(.5*y),b=8/3*v*v/Math.sin(y),x=e+p-b*g,_=i+g+b*p,S=e+m,A=i+f,T=S+b*f,C=A-b*m;return[h*x+c*_,d*x+u*_,h*T+c*C,d*T+u*C,h*S+c*A,d*S+u*A]}function Rt(t,e,i,r){const a=function(t,e,i,r,a,n,o,l,h){const c=s.degreeToRadian(o),d=Math.sin(c),u=Math.cos(c),p=u*(l-t)*.5+d*(h-e)*.5,g=u*(h-e)*.5-d*(l-t)*.5;let m=p*p/((i=Math.abs(i))*i)+g*g/((r=Math.abs(r))*r);m>1&&(m=Math.sqrt(m),i*=m,r*=m);const f=u/i,y=d/i,v=-d/r,b=u/r,x=f*l+y*h,_=v*l+b*h,S=f*t+y*e,A=v*t+b*e;let T=1/((S-x)*(S-x)+(A-_)*(A-_))-.25;T<0&&(T=0);let C=Math.sqrt(T);n===a&&(C=-C);const M=.5*(x+S)-C*(A-_),k=.5*(_+A)+C*(S-x),w=Math.atan2(_-k,x-M);let P=Math.atan2(A-k,S-M)-w;P<0&&1===n?P+=s.tau:P>0&&0===n&&(P-=s.tau);const O=Math.ceil(Math.abs(P/(s.halfPi+.001))),B=[];for(let t=0;t<O;++t){const e=w+t*P/O,s=w+(t+1)*P/O;B[t]=[M,k,e,s,i,r,d,u]}return B}(r[5],r[6],r[0],r[1],r[3],r[4],r[2],e,i);for(let e=0;e<a.length;++e){const i=It(a[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}!function(t){t[t.NONE=0]="NONE",t[t.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",t[t.UPDATE_SHAPE=2]="UPDATE_SHAPE",t[t.CLEAR_SHAPE=253]="CLEAR_SHAPE",t[t.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",t[t.INIT=179]="INIT",t[t.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",t[t.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",t[t.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",t[t.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",t[t.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",t[t.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",t[t.UPDATE_PAINT=64]="UPDATE_PAINT",t[t.CLEAR_PAINT=191]="CLEAR_PAINT",t[t.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",t[t.CLEAR_LAYOUT=127]="CLEAR_LAYOUT"}(Ot||(Ot={})),function(t){t[t.GLOBAL=1]="GLOBAL",t[t.LOCAL=16]="LOCAL",t[t.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",t[t.LOCAL_ACCURATE=48]="LOCAL_ACCURATE"}(Bt||(Bt={})),function(t){t[t.INIT=0]="INIT",t[t.DEFAULT=1]="DEFAULT",t[t.STATE=2]="STATE",t[t.ANIMATE_BIND=10]="ANIMATE_BIND",t[t.ANIMATE_PLAY=11]="ANIMATE_PLAY",t[t.ANIMATE_START=12]="ANIMATE_START",t[t.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",t[t.ANIMATE_END=14]="ANIMATE_END",t[t.TRANSLATE=20]="TRANSLATE",t[t.TRANSLATE_TO=21]="TRANSLATE_TO",t[t.SCALE=22]="SCALE",t[t.SCALE_TO=23]="SCALE_TO",t[t.ROTATE=24]="ROTATE",t[t.ROTATE_TO=25]="ROTATE_TO"}(Lt||(Lt={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(Et||(Et={})),function(t){t[t.CubicBezierCurve=0]="CubicBezierCurve",t[t.QuadraticBezierCurve=1]="QuadraticBezierCurve",t[t.ArcCurve=2]="ArcCurve",t[t.LineCurve=3]="LineCurve",t[t.EllipseCurve=4]="EllipseCurve",t[t.MoveCurve=5]="MoveCurve"}(Dt||(Dt={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(Ft||(Ft={}));const Nt=[(t,e,i,s,r,a,n)=>e.arc(t[1]*r+i,t[2]*a+s,t[3]*(r+a)/2,t[4],t[5],t[6],n),(t,e,i,s,r,a,n)=>e.arcTo(t[1]*r+i,t[2]*a+s,t[3]*r+i,t[4]*a+s,t[5]*(r+a)/2,n),(t,e,i,s,r,a,n)=>e.bezierCurveTo(t[1]*r+i,t[2]*a+s,t[3]*r+i,t[4]*a+s,t[5]*r+i,t[6]*a+s,n),(t,e,i,s)=>e.closePath(),(t,e,i,s,r,a)=>e.ellipse(t[1]*r+i,t[2]*a+s,t[3]*r,t[4]*a,t[5],t[6],t[7],t[8]),(t,e,i,s,r,a,n)=>e.lineTo(t[1]*r+i,t[2]*a+s,n),(t,e,i,s,r,a,n)=>e.moveTo(t[1]*r+i,t[2]*a+s,n),(t,e,i,s,r,a,n)=>e.quadraticCurveTo(t[1]*r+i,t[2]*a+s,t[3]*r+i,t[4]*a+s,n),(t,e,i,s,r,a,n)=>e.rect(t[1]*r+i,t[2]*a+s,t[3]*r,t[4]*a,n)];function jt(t,e,i=0,s=0,r=1,a=1,n){for(let o=0;o<t.length;o++){const l=t[o];Nt[l[0]](l,e,i,s,r,a,n)}}class Ut{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function zt(t,e){let i=0;const r=t.length;for(let a=0;a<r;a++){const n=t[a],o=e[a],l=t[(a+1)%r],h=e[(a+1)%r];i+=s.PointService.distanceNN(n,o,l,h)}return i/2}function Vt(t,e,i,s,r){const a=1-r;return a*a*a*t+3*e*r*a*a+3*i*r*r*a+s*r*r*r}function Gt(t,e,i,r,a){const n=Vt(t.x,e.x,i.x,r.x,a),o=Vt(t.y,e.y,i.y,r.y,a);return new s.Point(n,o)}function Wt(t,e,i,s){const r=1-s;return r*r*t+2*r*s*e+s*s*i}function Ht(t,e,i,r){const a=Wt(t.x,e.x,i.x,r),n=Wt(t.y,e.y,i.y,r);return new s.Point(a,n)}class $t extends Ut{constructor(t,e,i,s){super(),this.type=Dt.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=i,this.p3=s}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}getPointAt(t){if(!1!==this.defined)return Gt(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,i=this.p2,s=this.p3,zt([t.x,e.x,i.x,s.x],[t.y,e.y,i.y,s.y])):60;var t,e,i,s}calcProjLength(t){return t===Et.ROW?s.abs(this.p0.x-this.p3.x):t===Et.COLUMN?s.abs(this.p0.y-this.p3.y):0}getAngleAt(t){const e=s.max(t-.01,0),i=s.min(t+.01,1),r=this.getPointAt(e),a=this.getPointAt(i);return s.atan2(a.y-r.y,a.x-r.x)}draw(t,e,i,r,a,n){if(t.moveTo(this.p0.x*r+e,this.p0.y*a+i),n>=1)t.bezierCurveTo(this.p1.x*r+e,this.p1.y*a+i,this.p2.x*r+e,this.p2.y*a+i,this.p3.x*r+e,this.p3.y*a+i);else if(n>0){const[o]=function(t,e){const{p0:i,p1:r,p2:a,p3:n}=t,o=Gt(i,r,a,n,e),l=s.PointService.pointAtPP(i,r,e),h=s.PointService.pointAtPP(r,a,e),c=s.PointService.pointAtPP(a,n,e),d=s.PointService.pointAtPP(l,h,e),u=s.PointService.pointAtPP(h,c,e);return[new $t(i,l,d,o),new $t(o,u,c,n)]}(this,n);t.bezierCurveTo(o.p1.x*r+e,o.p1.y*a+i,o.p2.x*r+e,o.p2.y*a+i,o.p3.x*r+e,o.p3.y*a+i)}}includeX(t){const e=s.min(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=s.max(this.p0.x,this.p1.x,this.p2.x,this.p3.x);return t>=e&&t<=i}getYAt(t){const e=s.min(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=(t-e)/(s.max(this.p0.x,this.p1.x,this.p2.x,this.p3.x)-e);return this.getPointAt(i).y}}class Xt extends Ut{constructor(t,e){super(),this.type=Dt.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return s.PointService.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=s.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)),this.angle}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y)}calcLength(){return this._validPoint()?s.PointService.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===Et.ROW?s.abs(this.p0.x-this.p1.x):t===Et.COLUMN?s.abs(this.p0.y-this.p1.y):0}draw(t,e,i,s,r,a){if(t.moveTo(this.p0.x*s+e,this.p0.y*r+i),a>=1)t.lineTo(this.p1.x*s+e,this.p1.y*r+i);else if(a>0){const n=this.getPointAt(a);t.lineTo(n.x*s+e,n.y*r+i)}}includeX(t){return t>=this.p0.x&&t<=this.p1.x||t>=this.p1.x&&t<=this.p0.x}getYAt(t){if(this.includeX(t)){let e=this.p0,i=this.p1;this.p0.x>this.p1.x&&(e=this.p1,i=this.p0);const s=(t-e.x)/(i.x-e.x);return e.y+s*(i.y-e.y)}return 1/0}}class Yt{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,i,r,a,n,o,l){const h=new $t(new s.Point(this._lastX,this._lastY),new s.Point(t,e),new s.Point(i,r),new s.Point(a,n));h.originP1=this._lastOriginP,h.originP2=l,h.defined=o,this.curves.push(h),this._lastX=a,this._lastY=n,this._lastOriginP=l}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,i,s){const r=this.addLinearCurve(t,e,i,this._lastOriginP,s);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=s}moveTo(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}quadraticCurveTo(t,e,i,s){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,i,r,a){const n=new Xt(new s.Point(this._lastX,this._lastY),new s.Point(t,e));return n.originP1=r,n.originP2=a,n.defined=i,n}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,i;if(t===Et.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],i=this.curves[this.curves.length-1],r=null!==(e=i.p3)&&void 0!==e?e:i.p1;return s.abs(t.p0.y-r.y)}if(t===Et.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],r=null!==(i=e.p3)&&void 0!==i?i:e.p1;return s.abs(t.p0.x-r.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class Kt extends Yt{bezierCurveTo(t,e,i,s,r,a,n,o){return super.bezierCurveTo(e,t,s,i,a,r,n,o)}lineTo(t,e,i,s){return super.lineTo(e,t,i,s)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function qt(t,e,i=1){let s=!1;for(let i=0,r=e.length;i<=r;i++)i>=r===s&&((s=!s)?t.lineStart():t.lineEnd()),s&&t.point(e[i])}function Zt(t,e,i){const r=null!=e?e:s.abs(i[i.length-1].x-i[0].x)>s.abs(i[i.length-1].y-i[0].y)?Et.ROW:Et.COLUMN;return"monotoneY"===t?new Kt(t,r):new Yt(t,r)}class Qt{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function Jt(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;const r=Zt("linear",i,t);return function(t,e){qt(t,e,1)}(new Qt(r,s),t),r}function te(t,e,i,s,r){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6,s,t.lastPoint1)}class ee{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){2===this._point&&te(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:te(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function ie(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return Jt(t,e);const r=Zt("basis",i,t);return function(t,e){qt(t,e,2)}(new ee(r,s),t),r}function se(t){return t<0?-1:1}function re(t,e,i){const s=t._x1-t._x0,r=e-t._x1,a=(t._y1-t._y0)/(s||Number(r<0&&-0)),n=(i-t._y1)/(r||Number(s<0&&-0)),o=(a*r+n*s)/(s+r);return(se(a)+se(n))*Math.min(Math.abs(a),Math.abs(n),.5*Math.abs(o))||0}function ae(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function ne(t,e,i,s,r){const a=t._x0,n=t._y0,o=t._x1,l=t._y1,h=(o-a)/3;t.context.bezierCurveTo(a+h,n+h*e,o-h,l-h*i,o,l,s,t.lastPoint1)}class oe{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:ne(this,this._t0,ae(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const i=t.x,s=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,s,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,s,t);break;case 1:this._point=2;break;case 2:this._point=3,ne(this,ae(this,e=re(this,i,s)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:ne(this,this._t0,e=re(this,i,s),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=s,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class le extends oe{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function he(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return Jt(t,e);const r=Zt("monotoneX",i,t);return function(t,e){qt(t,e,2)}(new oe(r,s),t),r}function ce(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return Jt(t,e);const r=Zt("monotoneY",i,t);return function(t,e){qt(t,e,2)}(new le(r,s),t),r}class de{constructor(t,e=.5,i){this.context=t,this._t=e,this.startPoint=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{const s=this._x*(1-this._t)+e*this._t;.5===this._t?this.context.lineTo(s,this._y,!1!==this._lastDefined,this.lastPoint):this.context.lineTo(s,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(s,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class ue extends de{lineEnd(){this.context.closePath()}}function pe(t,e,i={}){const{direction:r,startPoint:a}=i;if(t.length<2-Number(!!a))return null;const n=new Yt("step",null!=r?r:s.abs(t[t.length-1].x-t[0].x)>s.abs(t[t.length-1].y-t[0].y)?Et.ROW:Et.COLUMN);return ge(new de(n,e,a),t),n}function ge(t,e){return qt(t,e,1)}class me extends Qt{lineEnd(){this.context.closePath()}}function fe(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;const r=Zt("linear",i,t);return function(t,e){qt(t,e,1)}(new me(r,s),t),r}function ye(t,e,i,r,a){let n=t._x1,o=t._y1,l=t._x2,h=t._y2;if(t._l01_a>s.epsilon){const e=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,o=(o*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>s.epsilon){const s=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,r=3*t._l23_a*(t._l23_a+t._l12_a);l=(l*s+t._x1*t._l23_2a-e*t._l12_2a)/r,h=(h*s+t._y1*t._l23_2a-i*t._l12_2a)/r}t.context.bezierCurveTo(n,o,l,h,t._x2,t._y2,r,t.lastPoint1)}function ve(t,e){return function(i,s,r={}){const{direction:a,startPoint:n}=r;if(i.length<2-Number(!!n))return null;if(i.length<3-Number(!!n))return Jt(i,r);const o=Zt(t,a,i);return qt(new e(o,s,n),i,2),o}}const be=ve("catmullRom",class{constructor(t,e=.5,i){this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x2,this._y2,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,s=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+s*s,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,i);break;case 1:this._point=2;break;case 2:this._point=3;default:ye(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});const xe=ve("catmullRomClosed",class{constructor(t,e=.5,i){this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 1:this.context.moveTo(this._x3,this._y3,this.lastPoint1),this.context.closePath();break;case 2:this.context.lineTo(this._x3,this._y3,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),this.context.closePath();break;case 3:this.point({x:this._x3,y:this._y3}),this.point({x:this._x4,y:this._y4}),this.point({x:this._x5,y:this._y5})}}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,s=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+s*s,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=i;break;case 1:this._point=2,this.context.moveTo(this._x4=e,this._y4=i,t);break;case 2:this._point=3,this._x5=e,this._y5=i;break;default:ye(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});class _e extends Ut{constructor(t,e,i){super(),this.type=Dt.QuadraticBezierCurve,this.p0=t,this.p1=e,this.p2=i}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y)}getPointAt(t){if(!1!==this.defined)return Ht(this.p0,this.p1,this.p2,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,i=this.p2,zt([t.x,e.x,i.x],[t.y,e.y,i.y])):60;var t,e,i}calcProjLength(t){return t===Et.ROW?s.abs(this.p0.x-this.p2.x):t===Et.COLUMN?s.abs(this.p0.y-this.p2.y):0}getAngleAt(t){const e=s.max(t-.01,0),i=s.min(t+.01,1),r=this.getPointAt(e),a=this.getPointAt(i);return s.atan2(a.y-r.y,a.x-r.x)}draw(t,e,i,r,a,n){if(t.moveTo(this.p0.x*r+e,this.p0.y*a+i),n>=1)t.quadraticCurveTo(this.p1.x*r+e,this.p1.y*a+i,this.p2.x*r+e,this.p2.y*a+i);else if(n>0){const[o]=function(t,e){const{p0:i,p1:r,p2:a}=t,n=Ht(i,r,a,e),o=s.PointService.pointAtPP(i,r,e),l=s.PointService.pointAtPP(r,a,e);return[new _e(i,o,n),new _e(n,l,a)]}(this,n);t.quadraticCurveTo(o.p1.x*r+e,o.p1.y*a+i,o.p2.x*r+e,o.p2.y*a+i)}}getYAt(t){throw new Error("QuadraticBezierCurve暂不支持getYAt")}includeX(t){throw new Error("QuadraticBezierCurve暂不支持includeX")}}class Se{constructor(t){this.path=t,this._lastX=this._lastY=this._startX=this._startY=0}moveTo(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}lineTo(t,e){const i=this.addLinearCurve(t,e);this.path.addCurve(i),this._lastX=t,this._lastY=e}addLinearCurve(t,e){return new Xt(new s.Point(this._lastX,this._lastY),new s.Point(t,e))}quadraticCurveTo(t,e,i,r){const a=new _e(new s.Point(this._lastX,this._lastY),new s.Point(t,e),new s.Point(i,r));this.path.addCurve(a),this._lastX=i,this._lastY=r}bezierCurveTo(t,e,i,r,a,n){const o=new $t(new s.Point(this._lastX,this._lastY),new s.Point(t,e),new s.Point(i,r),new s.Point(a,n));this.path.addCurve(o),this._lastX=a,this._lastY=n}arcTo(t,e,i,s,r){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,i,s,r,a,n,o){throw new Error("CurveContext不支持调用ellipse")}rect(t,e,i,s){throw new Error("CurveContext不支持调用rect")}arc(t,e,i,s,r,a){throw new Error("CurveContext不支持调用arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}}function Ae(t,e,i){var r,a;switch(e){case"linear":default:return Jt(t,i);case"basis":return ie(t,i);case"monotoneX":return he(t,i);case"monotoneY":return ce(t,i);case"step":return pe(t,.5,i);case"stepClosed":return function(t,e,i={}){const{direction:r,startPoint:a}=i;if(t.length<2-Number(!!a))return null;const n=new Yt("step",null!=r?r:s.abs(t[t.length-1].x-t[0].x)>s.abs(t[t.length-1].y-t[0].y)?Et.ROW:Et.COLUMN);return ge(new ue(n,e,a),t),n}(t,.5,i);case"stepBefore":return pe(t,0,i);case"stepAfter":return pe(t,1,i);case"catmullRom":return be(t,null!==(r=null==i?void 0:i.curveTension)&&void 0!==r?r:.5,i);case"catmullRomClosed":return xe(t,null!==(a=null==i?void 0:i.curveTension)&&void 0!==a?a:.5,i);case"linearClosed":return fe(t,i)}}class Te extends xt{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new bt(this.bounds)}get curves(){return this.tryBuildCurves()}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([At.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([At.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,s){return this.commandList.push([At.Q,t,e,i,s]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,s),this}bezierCurveTo(t,e,i,s,r,a){return this.commandList.push([At.C,t,e,i,s,r,a]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,s,r,a),this}arcTo(t,e,i,s,r){return this.commandList.push([At.AT,t,e,i,s,r]),this._ctx&&this._ctx.arcTo(t,e,i,s,r),this}ellipse(t,e,i,s,r,a,n,o){return this.commandList.push([At.E,t,e,i,s,r,a,n,o]),this._ctx&&this._ctx.ellipse(t,e,i,s,r,a,n,o),this}rect(t,e,i,s){return this.commandList.push([At.R,t,e,i,s]),this._ctx&&this._ctx.rect(t,e,i,s),this}arc(t,e,i,s,r,a){return this.commandList.push([At.A,t,e,i,s,r,a]),this._ctx&&this._ctx.arc(t,e,i,s,r,a),this}closePath(){return this.commandList.push([At.Z]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this._curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this._curves.length=0}beginPath(){this.clear()}tryBuildCurves(){if(!this._curves||!this._curves.length){const t=new Se(this);jt(this.commandList,t,0,0,1,1)}return this._curves}toString(){if(!this.toStringCbList){const t=[];t[At.M]=t=>`M${t[1]} ${t[2]}`,t[At.L]=t=>`L${t[1]} ${t[2]}`,t[At.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[At.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[At.A]=t=>{const e=[],i=t[1],s=t[2],r=t[3];((t,e,i,s,r,a,n,o=!1)=>{const l=2*Math.PI,h=(e%l+l)%l;let c,d=(i%l+l)%l;o?(d>=h&&(d-=l),c=d-h):(d<=h&&(d+=l),c=d-h);const u=Math.ceil(Math.abs(c)/(.5*Math.PI)),p=c/u;for(let e=0;e<u;e++){const i=h+p*e,l=h+p*(e+1),c=4/3*Math.tan(Math.abs(p)/4),d=Math.cos(i),u=Math.sin(i),g=Math.cos(l),m=Math.sin(l),f=d*a+s,y=u*n+r,v=g*a+s,b=m*n+r,x=o?-1:1,_=a*c*x,S=n*c*x;t.push(f-_*u,y+S*d,v+_*m,b-S*g,v,b)}})(e,t[4],t[5],i,s,r,r,t[6]);let a="";for(let t=0;t<e.length;t+=6)a+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return a},t[At.R]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[At.Z]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((i=>{e+=t[i[0]](i)})),e}fromString(t,e,i,s,r){this.clear();const a=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,s;const r=[];for(let t=0,a=e.length;t<a;t++)if(Tt=e[t],Ct=Tt.slice(1),Mt=Tt[0],i=[Mt],s=Ct.match(_t),null!==s){for(let t=0,e=s.length;t<e;t++)kt=s[t],wt=parseFloat(kt),Number.isNaN(wt)||i.push(wt);if(Pt=St[Mt],i.length-1>Pt){let t,e=Mt;for(let s=1,a=i.length;s<a;s+=Pt){t=[e];for(let e=s,r=s+Pt;e<r;e++)t.push(i[e]);r.push(t),"m"===e?e="l":"M"===e&&(e="L")}}else r.push(i)}else r.push(i);return r}(t);return this._runCommandStrList(a,e,i,s,r),this._updateBounds(),this}fromLine(t){const{points:e,curveType:i,clipRangeByDimension:s}=t.attribute;if(!e)return;const r=Ae(e,i);"x"===s?this.direction=Et.ROW:"y"===s?this.direction=Et.COLUMN:"auto"===s&&(this.direction=r.direction),this._curves=r.curves}fromCustomPath2D(t,e,i,s,r){return this.clear(),this._runCommandList(t.commandList,e,i,s,r),this._updateBounds(),this}transform(t,e,i,s){const r=this.commandList;if(!this.transformCbList){const t=[];t[At.M]=this.moveToTransform,t[At.L]=this.lineToTransform,t[At.Q]=this.quadraticCurveToTransform,t[At.C]=this.bezierCurveToTransform,t[At.AT]=this.arcToTransform,t[At.E]=this.ellipseTransform,t[At.R]=this.rectTransform,t[At.A]=this.arcTransform,t[At.Z]=this.closePathTransform,this.transformCbList=t}r.forEach((r=>{this.transformCbList[r[0]](r,t,e,i,s)})),this._updateBounds()}moveToTransform(t,e,i,s,r){t[1]=t[1]*s+e,t[2]=t[2]*r+i}lineToTransform(t,e,i,s,r){t[1]=t[1]*s+e,t[2]=t[2]*r+i}quadraticCurveToTransform(t,e,i,s,r){t[1]=t[1]*s+e,t[2]=t[2]*r+i,t[3]=t[3]*s+e,t[4]=t[4]*r+i}bezierCurveToTransform(t,e,i,s,r){t[1]=t[1]*s+e,t[2]=t[2]*r+i,t[3]=t[3]*s+e,t[4]=t[4]*r+i,t[5]=t[5]*s+e,t[6]=t[6]*r+i}arcToTransform(t,e,i,s,r){t[1]=t[1]*s+e,t[2]=t[2]*r+i,t[3]=t[3]*s+e,t[4]=t[4]*r+i,t[5]=t[5]*(s+r)/2}ellipseTransform(t,e,i,s,r){t[1]=t[1]*s+e,t[2]=t[2]*r+i,t[3]=t[3]*s,t[4]=t[4]*r}rectTransform(t,e,i,s,r){t[1]=t[1]*s+e,t[2]=t[2]*r+i,t[3]=t[3]*s,t[4]=t[4]*r}arcTransform(t,e,i,s,r){t[1]=t[1]*s+e,t[2]=t[2]*r+i,t[3]=t[3]*(s+r)/2}closePathTransform(){}_runCommandStrList(t,e=0,i=0,s=1,r=1){let a,n,o,l,h,c=null,d=0,u=0,p=0,g=0;for(let m=0,f=t.length;m<f;++m){switch(a=t[m],1===s&&1===r||(a=Me(a,s,r)),a[0]){case"l":d+=a[1],u+=a[2],this.lineTo(d+e,u+i);break;case"L":d=a[1],u=a[2],this.lineTo(d+e,u+i);break;case"h":d+=a[1],this.lineTo(d+e,u+i);break;case"H":d=a[1],this.lineTo(d+e,u+i);break;case"v":u+=a[1],this.lineTo(d+e,u+i);break;case"V":u=a[1],this.lineTo(d+e,u+i);break;case"m":d+=a[1],u+=a[2],this.moveTo(d+e,u+i);break;case"M":d=a[1],u=a[2],this.moveTo(d+e,u+i);break;case"c":n=d+a[5],o=u+a[6],p=d+a[3],g=u+a[4],this.bezierCurveTo(d+a[1]+e,u+a[2]+i,p+e,g+i,n+e,o+i),d=n,u=o;break;case"C":d=a[5],u=a[6],p=a[3],g=a[4],this.bezierCurveTo(a[1]+e,a[2]+i,p+e,g+i,d+e,u+i);break;case"s":n=d+a[3],o=u+a[4],null===c[0].match(/[CcSs]/)?(p=d,g=u):(p=2*d-p,g=2*u-g),l=d+a[1],h=u+a[2],this.bezierCurveTo(p+e,g+i,l+e,h+i,n+e,o+i),p=l,g=h,d=n,u=o;break;case"S":n=a[3],o=a[4],null===c[0].match(/[CcSs]/)?(p=d,g=u):(p=2*d-p,g=2*u-g),l=a[1],h=a[2],this.bezierCurveTo(p+e,g+i,l+e,h+i,n+e,o+i),p=l,g=h,d=n,u=o;break;case"q":n=d+a[3],o=u+a[4],p=d+a[1],g=u+a[2],this.quadraticCurveTo(p+e,g+i,n+e,o+i),d=n,u=o;break;case"Q":n=a[3],o=a[4],this.quadraticCurveTo(a[1]+e,a[2]+i,n+e,o+i),d=n,u=o,p=a[1],g=a[2];break;case"t":n=d+a[1],o=u+a[2],null===c[0].match(/[QqTt]/)?(p=d,g=u):"t"===c[0]?(p=2*d-l,g=2*u-h):"q"===c[0]&&(p=2*d-p,g=2*u-g),l=p,h=g,this.quadraticCurveTo(p+e,g+i,n+e,o+i),d=n,u=o,p=d+a[1],g=u+a[2];break;case"T":n=a[1],o=a[2],p=2*d-p,g=2*u-g,this.quadraticCurveTo(p+e,g+i,n+e,o+i),d=n,u=o;break;case"a":Rt(this,d+e,u+i,[a[1],a[2],a[3],a[4],a[5],a[6]+d+e,a[7]+u+i]),d+=a[6],u+=a[7];break;case"A":Rt(this,d+e,u+i,[a[1],a[2],a[3],a[4],a[5],a[6]+e,a[7]+i]),d=a[6],u=a[7];break;case"z":case"Z":this.closePath()}c=a}}_runCommandList(t,e=0,i=0,s=1,r=1){if(0!==e||0!==i||1!==s||1!==r)for(let a=0,n=t.length;a<n;++a){const n=t[a].slice();switch(n[0]){case At.L:this.lineToTransform(n,e,i,s,r);break;case At.M:this.moveToTransform(n,e,i,s,r);break;case At.C:this.bezierCurveToTransform(n,e,i,s,r);break;case At.Q:this.quadraticCurveToTransform(n,e,i,s,r);break;case At.A:this.arcToTransform(n,e,i,s,r);break;case At.E:this.ellipseTransform(n,e,i,s,r);break;case At.R:this.rectTransform(n,e,i,s,r);break;case At.AT:this.arcToTransform(n,e,i,s,r);break;case At.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),jt(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===Et.COLUMN){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return s.abs(t.p0.y-e.p1.y)}if(this.direction===Et.ROW){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return s.abs(t.p0.x-e.p1.x)}return this._curves.reduce(((t,e)=>t+e.getLength()),0)}getYAt(t){if(!this.curves)return 1/0;for(let e=0;e<this.curves.length;e++){const i=this.curves[e];if(i.includeX(t))return i.getYAt(t)}return 1/0}getAttrAt(t){if(!this._curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let s=0;s<this._curves.length;s++){e=this._curves[s];const r=e.getLength(this.direction);if(i+r>=t)break;i+=r}const s=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(s),angle:e.getAngleAt(s)}}drawWithClipRange(t,e,i,s,r){this.tryBuildCurves();const a=this.getLength()*r;let n=0;for(let r=0;r<this._curves.length;r++){const o=this._curves[r],l=o.getLength(this.direction);if(!(n+l<=a)){const r=1-(n+l-a)/l;o.draw(t,i,s,e,e,r);break}o.draw(t,i,s,e,e,1),n+=l}}}const Ce=["l",0,0,0,0,0,0,0];function Me(t,e,i){const s=Ce[0]=t[0];if("a"===s||"A"===s)Ce[1]=e*t[1],Ce[2]=i*t[2],Ce[3]=t[3],Ce[4]=t[4],Ce[5]=t[5],Ce[6]=e*t[6],Ce[7]=i*t[7];else if("h"===s||"H"===s)Ce[1]=e*t[1];else if("v"===s||"V"===s)Ce[1]=i*t[1];else for(let s=1,r=t.length;s<r;++s)Ce[s]=(s%2==1?e:i)*t[s];return Ce}var ke;!function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(ke||(ke={}));const we={x:0,y:0,z:0,dx:0,dy:0,dz:0,scrollX:0,scrollY:0,scaleX:1,scaleY:1,scaleZ:1,angle:0,alpha:0,beta:0,scaleCenter:[0,0],anchor:[0,0],anchor3d:[0,0],postMatrix:new s.Matrix},Pe={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Oe=Object.assign({outerBorder:Object.assign(Object.assign({},Pe),{distance:0}),innerBorder:Object.assign(Object.assign({},Pe),{distance:0})},Pe),Be={text:"",maxLineWidth:1/0,maxWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,'-apple-system',segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",underlineDash:[],underlineOffset:0,disableAutoClipedPoptip:void 0,measureMode:ke.fontBounding,keepCenterInLine:!1},Le=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,autoAnimateTexture:!1,textureRatio:1,textureOptions:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,backgroundKeepAspectRatio:!1,backgroundClip:!0,backgroundScale:1,backgroundOffsetX:0,backgroundOffsetY:0,backgroundPosition:"top-left",blur:0,filter:"",cursor:null,html:null,react:null,vue:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),Oe),{alignSelf:"auto"}),{pickStrokeBuffer:0}),Ee={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},De=Object.assign(Object.assign(Object.assign({strokeSeg:null,renderable:!0,pickable:!0,shadowGraphic:void 0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,fillStrokeOrder:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden",shadowPickMode:"graphic",keepStrokeScale:!1,clipConfig:null,roughStyle:null},{_debug_bounds:!1}),Le),we),Fe=Object.assign(Object.assign({},De),{startAngle:0,endAngle:s.pi2,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,clipRange:1,cap:!1,forceShowCap:!1}),Ie=Object.assign(Object.assign(Object.assign({},De),Ee),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),Re=Object.assign(Object.assign({},De),{radius:1,startAngle:0,endAngle:s.pi2}),Ne=Object.assign(Object.assign({},De),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start",baseOpacity:1,cornerType:"round"}),je=Object.assign(Object.assign({},De),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Ue=Object.assign(Object.assign(Object.assign({},De),Ee),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),ze=Object.assign(Object.assign({},De),{path:new Te,fillStrokeOrder:1,clipRange:1,customPath:()=>{s.Logger.getInstance().warn("空函数")}}),Ve=Object.assign(Object.assign({},De),{points:[],cornerRadius:0,closePath:!0}),Ge=Object.assign(Object.assign({},De),{width:100,height:100,spikes:5,thickness:.5}),We=Object.assign(Object.assign({},De),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0,cornerType:"round",drawStrokeWhenZeroWH:!1});Object.assign(Object.assign({},De),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0,cornerType:"round",drawStrokeWhenZeroWH:!1});const He=Object.assign(Object.assign({},De),{symbolType:"circle",size:10,keepDirIn3d:!0,clipRange:1}),$e=Object.assign(Object.assign(Object.assign({},De),Be),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Xe=Object.assign(Object.assign(Object.assign({},De),Be),{upgradeAttrs:null,editable:!1,editOptions:null,ascentDescentMode:"actual",width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),Ye=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",imageMode:void 0,image:"",width:0,height:0,maxWidth:500,maxHeight:500,imagePosition:"top-left",imageScale:1,imageOffsetX:0,imageOffsetY:0},De),{fill:!0,cornerRadius:0,cornerType:"round"}),Ke=Object.assign(Object.assign({},Ye),{backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1});function qe(t){return function(){var t,e;const i=null===(t=yt.global)||void 0===t?void 0:t.env,s=i?null===(e=yt.canvasFactory)||void 0===e?void 0:e.call(yt,i):void 0;if(!s)throw new Error(`CanvasFactory is not configured for env "${null!=i?i:"unknown"}"`);return s}()(t)}const Ze=1e-4,Qe=Math.sqrt(3),Je=1/3;function ti(t){return t>-pi&&t<pi}function ei(t){return t>pi||t<-pi}const ii=[0,0],si=[0,0],ri=[0,0];function ai(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function ni(t,e,i,s){const r=1-s;return r*(r*t+2*s*e)+s*s*i}function oi(t,e,i,s,r){const a=1-r;return a*a*(a*t+3*r*e)+r*r*(r*s+3*a*i)}function li(t){return(t%=s.pi2)<0&&(t+=s.pi2),t}function hi(t,e,i,s,r,a,n,o,l){if(0===n)return!1;const h=n;return!(l>e+h&&l>s+h&&l>a+h||l<e-h&&l<s-h&&l<a-h||o>t+h&&o>i+h&&o>r+h||o<t-h&&o<i-h&&o<r-h)&&function(t,e,i,s,r,a,n,o,l){let h=0,c=.005,d=1/0;ii[0]=n,ii[1]=o;for(let n=0;n<1;n+=.05){si[0]=ni(t,i,r,n),si[1]=ni(e,s,a,n);const o=ai(ii,si);o<d&&(h=n,d=o)}d=1/0;for(let n=0;n<32&&!(c<Ze);n++){const n=h-c,o=h+c;si[0]=ni(t,i,r,n),si[1]=ni(e,s,a,n);const l=ai(si,ii);if(n>=0&&l<d)h=n,d=l;else{ri[0]=ni(t,i,r,o),ri[1]=ni(e,s,a,o);const n=ai(ri,ii);o<=1&&n<d?(h=o,d=n):c*=.5}}return l&&(l[0]=ni(t,i,r,h),l[1]=ni(e,s,a,h)),Math.sqrt(d)}(t,e,i,s,r,a,o,l,null)<=h/2}function ci(t,e,i,s,r,a,n,o,l,h,c){if(0===l)return!1;const d=l;return!(c>e+d&&c>s+d&&c>a+d&&c>o+d||c<e-d&&c<s-d&&c<a-d&&c<o-d||h>t+d&&h>i+d&&h>r+d&&h>n+d||h<t-d&&h<i-d&&h<r-d&&h<n-d)&&function(t,e,i,s,r,a,n,o,l,h,c){let d,u,p,g,m=0,f=.005,y=1/0;ii[0]=l,ii[1]=h;for(let l=0;l<1;l+=.05)si[0]=oi(t,i,r,n,l),si[1]=oi(e,s,a,o,l),p=ai(ii,si),p<y&&(m=l,y=p);y=1/0;for(let l=0;l<32&&!(f<Ze);l++)d=m-f,u=m+f,si[0]=oi(t,i,r,n,d),si[1]=oi(e,s,a,o,d),p=ai(si,ii),d>=0&&p<y?(m=d,y=p):(ri[0]=oi(t,i,r,n,u),ri[1]=oi(e,s,a,o,u),g=ai(ri,ii),u<=1&&g<y?(m=u,y=g):f*=.5);return c&&(c[0]=oi(t,i,r,n,m),c[1]=oi(e,s,a,o,m)),Math.sqrt(y)}(t,e,i,s,r,a,n,o,h,c,null)<=d/2}function di(t,e,i,r,a,n,o,l,h){if(0===o)return!1;const c=o;l-=t,h-=e;const d=Math.sqrt(l*l+h*h);if(d-c>i||d+c<i)return!1;if(Math.abs(r-a)%s.pi2<1e-4)return!0;if(n){const t=r;r=li(a),a=li(t)}else r=li(r),a=li(a);r>a&&(a+=s.pi2);let u=Math.atan2(h,l);return u<0&&(u+=s.pi2),u>=r&&u<=a||u+s.pi2>=r&&u+s.pi2<=a}function ui(t,e,i,s,r,a,n){if(0===r)return!1;const o=r,l=r/2;let h=0,c=t;if(n>e+l&&n>s+l||n<e-l&&n<s-l||a>t+l&&a>i+l||a<t-l&&a<i-l)return!1;if(t===i)return Math.abs(a-t)<=o/2;h=(e-s)/(t-i),c=(t*s-i*e)/(t-i);const d=h*a-n+c;return d*d/(h*h+1)<=o/2*o/2}const pi=1e-4;function gi(t,e,i,s,r){const a=6*i-12*e+6*t,n=9*e+3*s-3*t-9*i,o=3*e-3*t;let l=0;if(ti(n)){if(ei(a)){const t=-o/a;t>=0&&t<=1&&(r[l++]=t)}}else{const t=a*a-4*n*o;if(ti(t))r[0]=-a/(2*n);else if(t>0){const e=Math.sqrt(t),i=(-a+e)/(2*n),s=(-a-e)/(2*n);i>=0&&i<=1&&(r[l++]=i),s>=0&&s<=1&&(r[l++]=s)}}return l}const mi=[-1,-1,-1],fi=[-1,-1];function yi(){const t=fi[0];fi[0]=fi[1],fi[1]=t}function vi(t,e,i,s,r,a,n,o,l,h){if(h>e&&h>s&&h>a&&h>o||h<e&&h<s&&h<a&&h<o)return 0;const c=function(t,e,i,s,r,a){const n=s+3*(e-i)-t,o=3*(i-2*e+t),l=3*(e-t),h=t-r,c=o*o-3*n*l,d=o*l-9*n*h,u=l*l-3*o*h;let p=0;if(ti(c)&&ti(d))if(ti(o))a[0]=0;else{const t=-l/o;t>=0&&t<=1&&(a[p++]=t)}else{const t=d*d-4*c*u;if(ti(t)){const t=d/c,e=-o/n+t,i=-t/2;e>=0&&e<=1&&(a[p++]=e),i>=0&&i<=1&&(a[p++]=i)}else if(t>0){const e=Math.sqrt(t);let i=c*o+1.5*n*(-d+e),s=c*o+1.5*n*(-d-e);i=i<0?-Math.pow(-i,Je):Math.pow(i,Je),s=s<0?-Math.pow(-s,Je):Math.pow(s,Je);const r=(-o-(i+s))/(3*n);r>=0&&r<=1&&(a[p++]=r)}else{const t=(2*c*o-3*n*d)/(2*Math.sqrt(c*c*c)),e=Math.acos(t)/3,i=Math.sqrt(c),s=Math.cos(e),r=(-o-2*i*s)/(3*n),l=(-o+i*(s+Qe*Math.sin(e)))/(3*n),h=(-o+i*(s-Qe*Math.sin(e)))/(3*n);r>=0&&r<=1&&(a[p++]=r),l>=0&&l<=1&&(a[p++]=l),h>=0&&h<=1&&(a[p++]=h)}}return p}(e,s,a,o,h,mi);if(0===c)return 0;let d=0,u=-1,p=0,g=0;for(let h=0;h<c;h++){const c=mi[h],m=0===c||1===c?.5:1;oi(t,i,r,n,c)<l||(u<0&&(u=gi(e,s,a,o,fi),fi[1]<fi[0]&&u>1&&yi(),p=oi(e,s,a,o,fi[0]),u>1&&(g=oi(e,s,a,o,fi[1]))),2===u?c<fi[0]?d+=p<e?m:-m:c<fi[1]?d+=g<p?m:-m:d+=o<g?m:-m:c<fi[0]?d+=p<e?m:-m:d+=o<p?m:-m)}return d}function bi(t,e,i,s,r,a,n,o){if(o>e&&o>s&&o>a||o<e&&o<s&&o<a)return 0;const l=function(t,e,i,s,r){const a=t-2*e+i,n=2*(e-t),o=t-s;let l=0;if(ti(a)){if(ei(n)){const t=-o/n;t>=0&&t<=1&&(r[l++]=t)}}else{const t=n*n-4*a*o;if(ti(t)){const t=-n/(2*a);t>=0&&t<=1&&(r[l++]=t)}else if(t>0){const e=Math.sqrt(t),i=(-n+e)/(2*a),s=(-n-e)/(2*a);i>=0&&i<=1&&(r[l++]=i),s>=0&&s<=1&&(r[l++]=s)}}return l}(e,s,a,o,mi);if(0===l)return 0;const h=function(t,e,i){const s=t+i-2*e;return 0===s?.5:(t-e)/s}(e,s,a);if(h>=0&&h<=1){let o=0;const c=ni(e,s,a,h);for(let s=0;s<l;s++){const l=0===mi[s]||1===mi[s]?.5:1;ni(t,i,r,mi[s])<n||(mi[s]<h?o+=c<e?l:-l:o+=a<c?l:-l)}return o}const c=0===mi[0]||1===mi[0]?.5:1;return ni(t,i,r,mi[0])<n?0:a<e?c:-c}function xi(t,e,i,r,a,n,o,l){if((l-=e)>i||l<-i)return 0;const h=Math.sqrt(i*i-l*l);mi[0]=-h,mi[1]=h;const c=Math.abs(r-a);if(c<1e-4)return 0;if(c>=s.pi2-1e-4){r=0,a=s.pi2;const e=n?1:-1;return o>=mi[0]+t&&o<=mi[1]+t?e:0}if(r>a){const t=r;r=a,a=t}r<0&&(r+=s.pi2,a+=s.pi2);let d=0;for(let e=0;e<2;e++){const i=mi[e];if(i+t>o){let t=Math.atan2(l,i),e=n?1:-1;t<0&&(t=s.pi2+t),(t>=r&&t<=a||t+s.pi2>=r&&t+s.pi2<=a)&&(t>s.pi/2&&t<1.5*s.pi&&(e=-e),d+=e)}}return d}function _i(t){return Math.round(t/s.pi*1e8)/1e8%2*s.pi}function Si(t,e){let i=_i(t[0]);i<0&&(i+=s.pi2);const r=i-t[0];let a=t[1];a+=r,!e&&a-i>=s.pi2?a=i+s.pi2:e&&i-a>=s.pi2?a=i-s.pi2:!e&&i>a?a=i+(s.pi2-_i(i-a)):e&&i<a&&(a=i-(s.pi2-_i(a-i))),t[0]=i,t[1]=a}const Ai=[0,0];function Ti(t,e,i,r,a){const n=t,o=t.length;let l,h,c=0,d=0,u=0,p=0,g=0;for(let t=0;t<o;t++){const o=n[t],m=0===t;o[0]===At.M&&t>1&&(i||(c+=s.isPointInLine(d,u,p,g,r,a))),m&&(d=o[1],u=o[2],p=d,g=u);const f=o[0],y=o[1],v=o[2],b=o[3],x=o[4],_=o[5],S=o[6];let A=x,T=_;Ai[0]=A,Ai[1]=T,Si(Ai,Boolean(o[6])),A=Ai[0],T=Ai[1];const C=A,M=T-A,k=!!(1-(o[6]?0:1)),w=(r-y)*b/b+y;switch(f){case At.M:p=y,g=v,d=p,u=g;break;case At.L:if(i){if(ui(d,u,y,v,e,r,a))return!0}else c+=s.isPointInLine(d,u,y,v,r,a)||0;d=y,u=v;break;case At.C:if(i){if(ci(d,u,y,v,b,x,_,S,e,r,a))return!0}else c+=vi(d,u,y,v,b,x,_,S,r,a)||0;d=_,u=S;break;case At.Q:if(i){if(hi(d,u,y,v,b,x,e,r,a))return!0}else c+=bi(d,u,y,v,b,x,r,a)||0;d=b,u=x;break;case At.A:if(l=Math.cos(C)*b+y,h=Math.sin(C)*b+v,m?(p=l,g=h):c+=s.isPointInLine(d,u,l,h,r,a),i){if(di(y,v,b,C,C+M,k,e,w,a))return!0}else c+=xi(y,v,b,C,C+M,k,w,a);d=Math.cos(C+M)*b+y,u=Math.sin(C+M)*b+v;break;case At.R:if(p=d=y,g=u=v,l=p+b,h=g+x,i){if(ui(p,g,l,g,e,r,a)||ui(l,g,l,h,e,r,a)||ui(l,h,p,h,e,r,a)||ui(p,h,p,g,e,r,a))return!0}else c+=s.isPointInLine(l,g,l,h,r,a),c+=s.isPointInLine(p,h,p,g,r,a);break;case At.Z:if(i){if(ui(d,u,p,g,e,r,a))return!0}else c+=s.isPointInLine(d,u,p,g,r,a);d=p,u=g}}return i||(m=u,f=g,Math.abs(m-f)<pi)||(c+=s.isPointInLine(d,u,p,g,r,a)||0),0!==c;var m,f}const Ci=new class{constructor(){this.pools=[],this.allocatedCanvas=[]}shareCanvas(){return this.allocatedCanvas.length?this.allocatedCanvas[0]:this.getCommonCanvas()}getCommonCanvas(){return this._commonCanvas||(this._commonCanvas=this.allocate({width:100,height:100,dpr:2})),this._commonCanvas}allocate(t){if(!this.pools.length){const e=qe(Object.assign({nativeCanvas:yt.global.createCanvas(t)},t));return this.allocatedCanvas.push(e),e}const e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}allocateByObj(t){if(!this.pools.length){const e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},i=qe(Object.assign({nativeCanvas:yt.global.createCanvas(e)},e));return this.allocatedCanvas.push(i),i}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}};class Mi{get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get x(){return this.canvas.x}get y(){return this.canvas.y}get canvasX(){return this.canvas.x}get canvasY(){return this.canvas.y}get viewX(){return this.viewport.x}get viewY(){return this.viewport.y}constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=Mi.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}composedDetailPath(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}_composedDetailPath(t){if(t&&t.graphic){const e=t.graphic;if(e.stage){const i=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(i),this._composedDetailPath(t.params)}}}preventDefault(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault()}catch(t){this.nativeEvent.preventDefault&&s.isFunction(this.nativeEvent.preventDefault)&&this.nativeEvent.preventDefault()}this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.stopPropagation()}catch(t){this.nativeEvent.stopPropagation&&s.isFunction(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class ki extends Mi{constructor(t,e){super(),this.type=t,this.detail=e}}const wi={dispatchEvent(t){var e;if(!(t instanceof Mi))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.detailPath&&(t.detailPath=[]),t.target=this,null===(e=null==t?void 0:t.manager)||void 0===e||e.dispatchEvent(t),!t.defaultPrevented},emit(t,e){return this.dispatchEvent(new ki(t,e))}};var Pi,Oi=function(t,e,i,s){return new(i||(i=Promise))((function(r,a){function n(t){try{l(s.next(t))}catch(t){a(t)}}function o(t){try{l(s.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(n,o)}l((s=s.apply(t,e||[])).next())}))};class Bi extends s.EventEmitter{get previousSibling(){return this._prev}get nextSibling(){return this._next}get children(){return this.getChildren()}get firstChild(){return this._firstChild}get lastChild(){return this._lastChild}get count(){return this._count}get childrenCount(){return this._idMap?this._idMap.size:0}constructor(){super(),this._uid=ft.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}onParentSharedStateTreeChanged(t,e){}forEachChildren(t,e=!1){if(e){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}forEachChildrenAsync(t,e=!1){return Oi(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,i=0;for(;e;){let s=t(e,i++);if(s.then&&(s=yield s),s)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let s=t(e,i++);if(s.then&&(s=yield s),s)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t,e=!0){if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t,e=!1){return console.error("暂不支持该函数"),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&s.Logger.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this===t)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let t=0;t<e;t++){if(!i)return null;t>0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}let i;this._nodeList[e]=t;for(let t=e-1;t>=0&&(i=this._nodeList[t],!i);t--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;const s=this.insertInto(t,0);return this._ignoreWarn=!1,s}removeChild(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){const e=this._nodeList.findIndex((e=>e===t));e>=0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}delete(){this.parent&&this.parent.removeChild(this)}removeAllChild(t){if(!this._idMap)return;this._nodeList&&(this._nodeList.length=0);let e=this._firstChild;for(;e;){const t=e._next;e.parent=null,e._prev=null,e._next=null,e=e._next,e=t}this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}replaceChild(t,e){throw new Error("暂不支持")}find(t,e=!1){let i=null;return this.forEachChildren(((e,s)=>!(e===this||!t(e,s)||(i=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const s=e.find(t,!0);if(s)return i=s,!0}return!1})),i}findAll(t,e=!1){let i=[];return this.forEachChildren(((e,s)=>{e!==this&&t(e,s)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const s=e.findAll(t,!0);s.length&&(i=i.concat(s))}})),i}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t,e=!1){return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;null==t?void 0:t.parent;)t=t.parent;return t||this}hasChildNodes(){return null!==this._firstChild}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){const t=[];let e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw new Error("暂不支持")}setAllDescendantsProps(t,e){let i=this._firstChild;for(;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}setCount(t){this._count+=t;let e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,i){const r=s.isBoolean(i,!0)&&i||s.isObject(i)&&i.capture,a=s.isObject(i)&&i.once,n=s.isFunction(e)?void 0:e;return t=r?`${t}capture`:t,e=s.isFunction(e)?e:e.handleEvent,a?super.once(t,e,n):super.on(t,e,n),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,i){const r=s.isBoolean(i,!0)&&i||s.isObject(i)&&i.capture,a=s.isFunction(e)?void 0:e;t=r?`${t}capture`:t,e=s.isFunction(e)?e:e.handleEvent;const n=s.isObject(i)&&i.once;return super.off(t,e,a,n),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return s.isObject(i)?(i.once=!0,this.addEventListener(t,e,i)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t,...e){return super.emit(t.type,t,...e),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class Li{static GetImage(t,e){var i;const s=Li.cache.get(t);s?"fail"===s.loadState?yt.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===s.loadState||"loading"===s.loadState?null===(i=s.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,s.data):Li.loadImage(t,e)}static GetSvg(t,e){var i;let s=Li.cache.get(t);s?"fail"===s.loadState?yt.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===s.loadState||"loading"===s.loadState?null===(i=s.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,s.data):(s={type:"image",loadState:"init"},Li.cache.set(t,s),s.dataPromise=yt.global.loadSvg(t),s.dataPromise?(s.waitingMark=[e],s.dataPromise.then((e=>{var i;s.loadState=(null==e?void 0:e.data)?"success":"fail",s.data=null==e?void 0:e.data,null===(i=s.waitingMark)||void 0===i||i.map(((i,r)=>{(null==e?void 0:e.data)?(s.loadState="success",s.data=e.data,i.imageLoadSuccess(t,e.data)):(s.loadState="fail",i.imageLoadFail(t))})),s.waitingMark&&(s.waitingMark=[])})).catch((()=>{var e;s.loadState="fail",null===(e=s.waitingMark)||void 0===e||e.map((e=>{e.imageLoadFail(t)})),s.waitingMark&&(s.waitingMark=[])}))):(s.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=Li.cache.get(t);return i?"fail"===i.loadState?Promise.reject():"init"===i.loadState||"loading"===i.loadState?i.dataPromise.then((t=>t.data)):Promise.resolve(i.data):(i={type:e,loadState:"init"},Li.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=yt.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=yt.global.loadBlob(t):"json"===e&&(i.dataPromise=yt.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!Li.isLoading&&Li.toLoadAueue.length){Li.isLoading=!0;const t=Li.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:s}=t,r={type:"image",loadState:"init"};if(Li.cache.set(i,r),r.dataPromise=yt.global.loadImage(i),r.dataPromise){r.waitingMark=s;const t=r.dataPromise.then((t=>{var e;r.loadState=(null==t?void 0:t.data)?"success":"fail",r.data=null==t?void 0:t.data,null===(e=r.waitingMark)||void 0===e||e.map(((e,s)=>{(null==t?void 0:t.data)?(r.loadState="success",r.data=t.data,e.imageLoadSuccess(i,t.data)):(r.loadState="fail",e.imageLoadFail(i))})),r.waitingMark&&(r.waitingMark=[])}));e.push(t)}else r.loadState="fail",s.forEach((t=>t.imageLoadFail(i)))})),Promise.all(e).then((()=>{Li.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Li.loading()})).catch((t=>{console.error(t),Li.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Li.loading()}))}}),0)}static loadImage(t,e){const i=Ei(t,Li.toLoadAueue);if(-1!==i)return Li.toLoadAueue[i].marks.push(e),void Li.loading();Li.toLoadAueue.push({url:t,marks:[e]}),Li.loading()}static improveImageLoading(t){const e=Ei(t,Li.toLoadAueue);if(-1!==e){const t=Li.toLoadAueue.splice(e,1);Li.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function Ei(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return-1}Li.cache=new Map,Li.isLoading=!1,Li.toLoadAueue=[],Li.onLoadSuccessCb=[],function(t){t[t.Top=1]="Top",t[t.Right=2]="Right",t[t.Bottom=4]="Bottom",t[t.Left=8]="Left",t[t.ALL=15]="ALL"}(Pi||(Pi={}));const Di=[0,0,0,0],Fi=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Ii=[1,2,3,0,1,2,3,0];function Ri(t,e,i,r){for(;t>=s.pi2;)t-=s.pi2;for(;t<0;)t+=s.pi2;for(;t>e;)e+=s.pi2;Fi[0].x=i,Fi[1].y=i,Fi[2].x=-i,Fi[3].y=-i;const a=Math.ceil(t/s.halfPi)%4,n=Math.ceil(e/s.halfPi)%4;if(r.add(s.cos(t)*i,s.sin(t)*i),r.add(s.cos(e)*i,s.sin(e)*i),a!==n||e-t>s.pi){let t=!1;for(let e=0;e<Ii.length;e++)if(t||a!==Ii[e]){if(t&&n===Ii[e])break;if(t){const t=Fi[Ii[e]];r.add(t.x,t.y)}}else{t=!0;const e=Fi[a];r.add(e.x,e.y)}}}class Ni{bounds(t,e){if(s.isNumber(t)){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}parseSize(t){return s.isNumber(t)?t:Math.min(t[0],t[1])}}function ji(t,e,i,r,a){return a?t.arc(i,r,e,0,s.tau,!1,a):t.arc(i,r,e,0,s.tau),!1}var Ui=new class extends Ni{constructor(){super(...arguments),this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}draw(t,e,i,s,r){return ji(t,this.parseSize(e)/2,i,s,r)}drawOffset(t,e,i,s,r,a){return ji(t,this.parseSize(e)/2+r,i,s,a)}drawToSvgPath(t,e,i,s){const r=this.parseSize(t)/2;return`M ${e-r}, ${i} a ${r},${r} 0 1,0 ${2*r},0 a ${r},${r} 0 1,0 -${2*r},0`}};var zi=new class extends Ni{constructor(){super(...arguments),this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}draw(t,e,i,s,r){return function(t,e,i,s,r){return t.moveTo(-3*e+i,-e+s,r),t.lineTo(-e+i,-e+s,r),t.lineTo(-e+i,-3*e+s,r),t.lineTo(e+i,-3*e+s,r),t.lineTo(e+i,-e+s,r),t.lineTo(3*e+i,-e+s,r),t.lineTo(3*e+i,e+s,r),t.lineTo(e+i,e+s,r),t.lineTo(e+i,3*e+s,r),t.lineTo(-e+i,3*e+s,r),t.lineTo(-e+i,e+s,r),t.lineTo(-3*e+i,e+s,r),t.closePath(),!0}(t,this.parseSize(e)/6,i,s,r)}drawOffset(t,e,i,s,r,a){return function(t,e,i,s,r,a){return t.moveTo(-3*e+i-r,-e+s-r,a),t.lineTo(-e+i-r,-e+s-r,a),t.lineTo(-e+i-r,-3*e+s-r,a),t.lineTo(e+i+r,-3*e+s-r,a),t.lineTo(e+i+r,-e+s-r,a),t.lineTo(3*e+i+r,-e+s-r,a),t.lineTo(3*e+i+r,e+s+r,a),t.lineTo(e+i+r,e+s+r,a),t.lineTo(e+i+r,3*e+s+r,a),t.lineTo(-e+i-r,3*e+s+r,a),t.lineTo(-e+i-r,e+s+r,a),t.lineTo(-3*e+i-r,e+s+r,a),t.closePath(),!0}(t,this.parseSize(e)/6,i,s,r,a)}};function Vi(t,e,i,s,r){return t.moveTo(i,s-e,r),t.lineTo(e+i,s,r),t.lineTo(i,s+e,r),t.lineTo(i-e,s,r),t.closePath(),!0}var Gi=new class extends Ni{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,s,r){return Vi(t,this.parseSize(e)/2,i,s,r)}drawFitDir(t,e,i,s,r){return Vi(t,this.parseSize(e)/2,i,s,r)}drawOffset(t,e,i,s,r,a){return Vi(t,this.parseSize(e)/2+r,i,s,a)}};function Wi(t,e,i,s){const r=2*e;return t.rect(i-e,s-e,r,r),!1}var Hi=new class extends Ni{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,s){return Wi(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,r){return Wi(t,this.parseSize(e)/2+r,i,s)}};function $i(t,e,i,s,r=0){return t.moveTo(i+e+2*r,e+s+r),t.lineTo(i-e-2*r,e+s+r),t.lineTo(i,s-e-2*r),t.closePath(),!0}class Xi extends Ni{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,i,s){return $i(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,r){return $i(t,this.parseSize(e)/2,i,s,r)}}var Yi=new Xi;var Ki=new class extends Xi{constructor(){super(...arguments),this.type="triangle"}};const qi=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),Zi=Math.sin(s.tau/10)*qi,Qi=-Math.cos(s.tau/10)*qi;function Ji(t,e,i,r){const a=Zi*e,n=Qi*e;t.moveTo(i,-e+r),t.lineTo(a+i,n+r);for(let o=1;o<5;++o){const l=s.tau*o/5,h=Math.cos(l),c=Math.sin(l);t.lineTo(c*e+i,-h*e+r),t.lineTo(h*a-c*n+i,c*a+h*n+r)}return t.closePath(),!0}var ts=new class extends Ni{constructor(){super(...arguments),this.type="star",this.pathStr="M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z"}draw(t,e,i,s){return Ji(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,r){return Ji(t,this.parseSize(e)/2+r,i,s)}};const es=s.sqrt(3);function is(t,e,i,s){const r=e,a=r/es,n=a/5,o=e;return t.moveTo(0+i,-r+s),t.lineTo(a/2+i,s),t.lineTo(n/2+i,s),t.lineTo(n/2+i,o+s),t.lineTo(-n/2+i,o+s),t.lineTo(-n/2+i,s),t.lineTo(-a/2+i,s),t.closePath(),!0}var ss=new class extends Ni{constructor(){super(...arguments),this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}draw(t,e,i,s){return is(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,r){return is(t,this.parseSize(e)/2+r,i,s)}};function rs(t,e,i,s){const r=2*e;return t.moveTo(i,-e+s),t.lineTo(r/3/2+i,e+s),t.lineTo(-r/3/2+i,e+s),t.closePath(),!0}var as=new class extends Ni{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,s){return rs(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,r){return rs(t,this.parseSize(e)/2+r,i,s)}};function ns(t,e,i,s){return t.moveTo(-e+i,s),t.lineTo(i,e+s),!1}var os=new class extends Ni{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,s){return ns(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,r){return ns(t,this.parseSize(e)/2+r,i,s)}};const ls=-.5,hs=s.sqrt(3)/2,cs=1/s.sqrt(12);function ds(t,e,i,s){const r=e/2,a=e*cs,n=r,o=e*cs+e,l=-n,h=o;return t.moveTo(r+i,a+s),t.lineTo(n+i,o+s),t.lineTo(l+i,h+s),t.lineTo(ls*r-hs*a+i,hs*r+ls*a+s),t.lineTo(ls*n-hs*o+i,hs*n+ls*o+s),t.lineTo(ls*l-hs*h+i,hs*l+ls*h+s),t.lineTo(ls*r+hs*a+i,ls*a-hs*r+s),t.lineTo(ls*n+hs*o+i,ls*o-hs*n+s),t.lineTo(ls*l+hs*h+i,ls*h-hs*l+s),t.closePath(),!1}var us=new class extends Ni{constructor(){super(...arguments),this.type="wye",this.pathStr="M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z"}draw(t,e,i,s){return ds(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,r){return ds(t,this.parseSize(e)/2+r,i,s)}};function ps(t,e,i,s,r){return t.moveTo(-e+i-2*r,s),t.lineTo(e+i+r,e+s+2*r),t.lineTo(e+i+r,s-e-2*r),t.closePath(),!0}var gs=new class extends Ni{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,i,s){return ps(t,this.parseSize(e)/2,i,s,0)}drawOffset(t,e,i,s,r){return ps(t,this.parseSize(e)/2,i,s,r)}};function ms(t,e,i,s,r=0){return t.moveTo(i-e-r,e+s+2*r),t.lineTo(e+i+2*r,s),t.lineTo(i-e-r,s-e-2*r),t.closePath(),!0}var fs=new class extends Ni{constructor(){super(...arguments),this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,i,s){return ms(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,r){return ms(t,this.parseSize(e)/2,i,s,r)}};function ys(t,e,i,s,r=0){return t.moveTo(i-e-2*r,s-e-r),t.lineTo(i+e+2*r,s-e-r),t.lineTo(i,s+e+2*r),t.closePath(),!0}var vs=new class extends Ni{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,i,s){return ys(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,r){return ys(t,this.parseSize(e)/2,i,s,r)}};const bs=s.sqrt(3);function xs(t,e,i,s){const r=e*bs;return t.moveTo(i,s+-r/3*2),t.lineTo(e+i,s+r),t.lineTo(i-e,s+r),t.closePath(),!0}var _s=new class extends Ni{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,s){return xs(t,this.parseSize(e)/2/bs,i,s)}drawOffset(t,e,i,s,r){return xs(t,this.parseSize(e)/2/bs+r,i,s)}};function Ss(t,e,i,s){const r=2*e;return t.moveTo(e+i,s-r),t.lineTo(i-e,s),t.lineTo(e+i,r+s),!0}var As=new class extends Ni{constructor(){super(...arguments),this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,i,s){return Ss(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,r){return Ss(t,this.parseSize(e)/4+r,i,s)}};function Ts(t,e,i,s){const r=2*e;return t.moveTo(i-e,s-r),t.lineTo(i+e,s),t.lineTo(i-e,r+s),!0}var Cs=new class extends Ni{constructor(){super(...arguments),this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,i,s){return Ts(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,r){return Ts(t,this.parseSize(e)/4+r,i,s)}};function Ms(t,e,i,s){const r=2*e;return t.moveTo(i-r,s+e),t.lineTo(i,s-e),t.lineTo(i+r,s+e),!0}var ks=new class extends Ni{constructor(){super(...arguments),this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,i,s){return Ms(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,r){return Ms(t,this.parseSize(e)/4+r,i,s)}};function ws(t,e,i,s){const r=2*e;return t.moveTo(i-r,s-e),t.lineTo(i,s+e),t.lineTo(i+r,s-e),!0}var Ps=new class extends Ni{constructor(){super(...arguments),this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,i,s){return ws(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,r){return ws(t,this.parseSize(e)/4+r,i,s)}};function Os(t,e,i,s,r){return t.moveTo(i,s-e),t.lineTo(i,s+e),!0}var Bs=new class extends Ni{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,s,r){return Os(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,r,a){return Os(t,this.parseSize(e)/2+r,i,s)}drawToSvgPath(t,e,i,s){const r=this.parseSize(t)/2;return`M ${e}, ${i-r} L ${e},${i+r}`}};function Ls(t,e,i,s,r){return t.moveTo(i-e,s),t.lineTo(i+e,s),!0}var Es=new class extends Ni{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,s,r){return Ls(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,r,a){return Ls(t,this.parseSize(e)/2+r,i,s)}drawToSvgPath(t,e,i,s){const r=this.parseSize(t)/2;return`M ${e-r}, ${i} L ${e+r},${i}`}};function Ds(t,e,i,s,r){return t.moveTo(i-e,s-e),t.lineTo(i+e,s+e),t.moveTo(i+e,s-e),t.lineTo(i-e,s+e),!0}var Fs=new class extends Ni{constructor(){super(...arguments),this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,i,s,r){return Ds(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,r,a){return Ds(t,this.parseSize(e)/2+r,i,s)}drawToSvgPath(t,e,i,s){const r=this.parseSize(t)/2;return`M ${e-r}, ${i-r} L ${e+r},${i+r} M ${e+r}, ${i-r} L ${e-r},${i+r}`}};function Is(t,e,i,s){return t.rect(i-e[0]/2,s-e[1]/2,e[0],e[1]),!1}function Rs(t,e,i,s){const r=e,a=e/2;return t.rect(i-r/2,s-a/2,r,a),!1}var Ns=new class extends Ni{constructor(){super(...arguments),this.type="rect",this.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z"}draw(t,e,i,r){return s.isNumber(e)?Rs(t,e,i,r):Is(t,e,i,r)}drawWithClipRange(t,e,i,r,a,n,o){s.isNumber(e)&&(e=[e,e/2]);const l=2*(e[0]+e[1])*a,h=[{x:i+e[0]/2,y:r-e[1]/2},{x:i+e[0]/2,y:r+e[1]/2},{x:i-e[0]/2,y:r+e[1]/2},{x:i-e[0]/2,y:r-e[1]/2}];let c=0,d=h[3];t.moveTo(d.x,d.y);for(let e=0;e<h.length;e++){const i=h[e],s=Math.sqrt((i.x-d.x)*(i.x-d.x)+(i.y-d.y)*(i.y-d.y));if(c+s>l){const e=(i.x-d.x)*(l-c)/s,r=(i.y-d.y)*(l-c)/s;t.lineTo(d.x+e,d.y+r);break}t.lineTo(i.x,i.y),d=i,c+=s}return!1}drawOffset(t,e,i,r,a){return s.isNumber(e)?Rs(t,e+2*a,i,r):Is(t,[e[0]+2*a,e[1]+2*a],i,r)}};const js=new s.AABBBounds;class Us{constructor(t,e,i=!1){this.pathStr="",this.type=t,s.isArray(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,s,r,a,n){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{t.beginPath(),jt(r.path.commandList,t,i,s,e,e),n&&n(r.path,r.attribute)})),!1):(jt(this.path.commandList,t,i,s,e+r,e+r),!1)}draw(t,e,i,s,r,a){return e=this.parseSize(e),this.drawOffset(t,e,i,s,0,r,a)}parseSize(t){return s.isNumber(t)?t:Math.min(t[0],t[1])}drawWithClipRange(t,e,i,s,r,a,n){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((a=>{a.path.drawWithClipRange(t,e,i,s,r),n&&n(a.path,a.attribute)})),!1):(this.path.drawWithClipRange(t,e,i,s,r),!1)}bounds(t,e){if(t=this.parseSize(t),this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((({path:i})=>{js.x1=i.bounds.x1*t,js.y1=i.bounds.y1*t,js.x2=i.bounds.x2*t,js.y2=i.bounds.y2*t,e.union(js)}))}this.path.bounds&&(e.x1=this.path.bounds.x1*t,e.y1=this.path.bounds.y1*t,e.x2=this.path.bounds.x2*t,e.y2=this.path.bounds.y2*t)}}const zs={};[Ui,zi,Gi,Hi,_s,Ki,ts,ss,as,os,us,gs,fs,Yi,vs,As,Cs,ks,Ps,Ns,Bs,Es,Fs].forEach((t=>{zs[t.type]=t}));const Vs={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"};class Gs{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}function Ws(t,e,i,s){const r=t.indexOf(e,i);if(-1===r)throw new Error(s);return r+e.length-1}function Hs(t,e,i,s=">"){const r=function(t,e,i=">"){let s,r="";for(let a=e;a<t.length;a++){let e=t[a];if(s)e===s&&(s="");else if('"'===e||"'"===e)s=e;else if(e===i[0]){if(!i[1])return{data:r,index:a};if(t[a+1]===i[1])return{data:r,index:a}}else"\t"===e&&(e=" ");r+=e}}(t,e+1,s);if(!r)return;let a=r.data;const n=r.index,o=a.search(/\s/);let l=a,h=!0;-1!==o&&(l=a.substr(0,o).replace(/\s\s*$/,""),a=a.substr(o+1));const c=l;if(i){const t=l.indexOf(":");-1!==t&&(l=l.substr(t+1),h=l!==r.data.substr(t+1))}return{tagName:l,tagExp:a,closeIndex:n,attrExpPresent:h,rawTagName:c}}const $s=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class Xs{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,i){const s=e.tagname;"string"==typeof s?(e.tagname=s,t.addChild(e)):t.addChild(e)}buildAttributesMap(t,e,i){const s={};if(!t)return;const r=function(t,e){const i=[];let s=e.exec(t);for(;s;){const r=[];r.startIndex=e.lastIndex-s[0].length;const a=s.length;for(let t=0;t<a;t++)r.push(s[t]);i.push(r),s=e.exec(t)}return i}(t,$s),a=r.length;for(let t=0;t<a;t++){const e=r[t][1],i=r[t][4];e&&(s[e]=void 0===i||(isNaN(i)?i:Number(i)))}return s}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new Gs("!xml");let i=e,s="",r="";for(let a=0;a<t.length;a++)if("<"===t[a])if("/"===t[a+1]){const e=Ws(t,">",a,"Closing Tag is not closed."),n=r.lastIndexOf(".");r=r.substring(0,n),i=this.tagsNodeStack.pop(),i&&i.child&&s&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=s),s="",a=e}else if("?"===t[a+1])a=Hs(t,a,!1,"?>").closeIndex+1;else if("!--"===t.substr(a+1,3))a=Ws(t,"--\x3e",a+4,"Comment is not closed.");else{const n=Hs(t,a,!1);let o=n.tagName,l=n.tagExp;const h=n.attrExpPresent,c=n.closeIndex;if(o!==e.tagname&&(r+=r?"."+o:o),l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===o[o.length-1]?(o=o.substr(0,o.length-1),r=r.substr(0,r.length-1),l=o):l=l.substr(0,l.length-1);const t=new Gs(o);o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,r,o)),this.addChild(i,t,r),r=r.substr(0,r.lastIndexOf("."))}else{const t=new Gs(o);this.tagsNodeStack.push(i),o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,r,o)),this.addChild(i,t,r),i=t}s="",a=c}else s+=t[a];return e.child}}function Ys(t,e){return Ks(t)}function Ks(t,e){const i={};for(let e=0;e<t.length;e++){const r=t[e],a=qs(r);if(void 0!==a&&r[a]){const t=Ks(r[a]);s=t,Object.keys(s).length,r[":@"]&&Zs(t,r[":@"]),void 0!==i[a]&&i.hasOwnProperty(a)?(Array.isArray(i[a])||(i[a]=[i[a]]),i[a].push(t)):i[a]=t}}var s;return i}function qs(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function Zs(t,e,i){if(e){const i=Object.keys(e),s=i.length;for(let r=0;r<s;r++){const s=i[r];t[s]=e[s]}}}class Qs{constructor(t){this.options=Object.assign({},Qs.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return Ys(new Xs(this.options).parseXml(t),this.options)}}Qs.defaultOptions={};let Js=0;function tr(){return Js++}var er;!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(er||(er={}));const ir=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>ir.set(t,!0)));const sr=new Map;[""].forEach((t=>sr.set(t,!0)));const rr=tr(),ar=tr();tr(),tr(),tr(),tr(),tr(),tr(),tr(),tr(),tr(),tr(),tr(),tr(),tr(),tr(),tr();const nr={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity",stroke:"stroke",fill:"fill"},or=Object.keys(nr),lr={duration:200,easing:"cubicOut"};function hr(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function cr(t,e,i){const s=i[0],r=i[1],a=i[2];let n,o,l,h,c,d,u,p,g,m,f,y;return e===t?(t[12]=e[0]*s+e[4]*r+e[8]*a+e[12],t[13]=e[1]*s+e[5]*r+e[9]*a+e[13],t[14]=e[2]*s+e[6]*r+e[10]*a+e[14],t[15]=e[3]*s+e[7]*r+e[11]*a+e[15]):(n=e[0],o=e[1],l=e[2],h=e[3],c=e[4],d=e[5],u=e[6],p=e[7],g=e[8],m=e[9],f=e[10],y=e[11],t[0]=n,t[1]=o,t[2]=l,t[3]=h,t[4]=c,t[5]=d,t[6]=u,t[7]=p,t[8]=g,t[9]=m,t[10]=f,t[11]=y,t[12]=n*s+c*r+g*a+e[12],t[13]=o*s+d*r+m*a+e[13],t[14]=l*s+u*r+f*a+e[14],t[15]=h*s+p*r+y*a+e[15]),t}function dr(t,e,i){const s=e[0],r=e[1],a=e[2],n=e[3],o=e[4],l=e[5],h=e[6],c=e[7],d=e[8],u=e[9],p=e[10],g=e[11],m=e[12],f=e[13],y=e[14],v=e[15];let b=i[0],x=i[1],_=i[2],S=i[3];return t[0]=b*s+x*o+_*d+S*m,t[1]=b*r+x*l+_*u+S*f,t[2]=b*a+x*h+_*p+S*y,t[3]=b*n+x*c+_*g+S*v,b=i[4],x=i[5],_=i[6],S=i[7],t[4]=b*s+x*o+_*d+S*m,t[5]=b*r+x*l+_*u+S*f,t[6]=b*a+x*h+_*p+S*y,t[7]=b*n+x*c+_*g+S*v,b=i[8],x=i[9],_=i[10],S=i[11],t[8]=b*s+x*o+_*d+S*m,t[9]=b*r+x*l+_*u+S*f,t[10]=b*a+x*h+_*p+S*y,t[11]=b*n+x*c+_*g+S*v,b=i[12],x=i[13],_=i[14],S=i[15],t[12]=b*s+x*o+_*d+S*m,t[13]=b*r+x*l+_*u+S*f,t[14]=b*a+x*h+_*p+S*y,t[15]=b*n+x*c+_*g+S*v,t}function ur(t,e,i){const s=e[0],r=e[1],a=e[2];let n=i[3]*s+i[7]*r+i[11]*a+i[15];return n=n||1,t[0]=(i[0]*s+i[4]*r+i[8]*a+i[12])/n,t[1]=(i[1]*s+i[5]*r+i[9]*a+i[13])/n,t[2]=(i[2]*s+i[6]*r+i[10]*a+i[14])/n,t}class pr{constructor(){this.pools=[]}static identity(t){return hr(t)}allocate(){if(!this.pools.length)return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];const t=this.pools.pop();return pr.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];for(let i=0;i<e.length;i++)e[i]=t[i];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}}const gr=new class{constructor(){this.pools=[]}allocate(t,e,i,r,a,n){if(!this.pools.length)return new s.Matrix(t,e,i,r,a,n);const o=this.pools.pop();return o.a=t,o.b=e,o.c=i,o.d=r,o.e=a,o.f=n,o}allocateByObj(t){if(!this.pools.length)return new s.Matrix(t.a,t.b,t.c,t.d,t.e,t.f);const e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}},mr=new pr,fr=new s.Matrix(1,0,0,1,0,0),yr={x:0,y:0};class vr{get nativeContext(){return this.path}constructor(t,e){this.matrix=new s.Matrix(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new s.Matrix(1,0,0,1,0,0),this.path=new Te,this._clearMatrix=new s.Matrix(1,0,0,1,0,0)}getCanvas(){throw new Error("不支持getCanvas")}getContext(){throw new Error("不支持getContext")}setTransformForCurrent(t=!1){!t&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}get currentMatrix(){return this.matrix}cloneMatrix(t){return gr.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}reset(){this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new s.Matrix(1,0,0,1,0,0),this.stack.length=0}restore(){this.stack.length>0&&(gr.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(gr.free(this.matrix),this.matrix=this.stack.pop())}rotate(t,e=!0){this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e,i=!0){this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e,i=!0){this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,s,r=!0){this.translate(i,s,!1),this.scale(t,e,!1),this.translate(-i,-s,!1),r&&this.setTransformForCurrent()}setTransform(t,e,i,s,r,a,n=!0,o=this.dpr){this.matrix.setValue(o*t,o*e,o*i,o*s,o*r,o*a),n&&this.setTransformForCurrent()}setTransformFromMatrix(t,e=!0,i=this.dpr){this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(t=!0,e=this.dpr){this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,s,r,a,n=!0){this.matrix.multiply(t,e,i,s,r,a),n&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e,i=!0){this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t,e=!0){const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i,s=!0){this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),s&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i,s=!0){this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),s&&this.setTransformForCurrent()}beginPath(){this.path.clear()}clip(t,e){}arc(t,e,i,s,r,a){this.path.arc(t,e,i,s,r,a)}arcTo(t,e,i,s,r){this.path.arcTo(t,e,i,s,r)}bezierCurveTo(t,e,i,s,r,a){this.path.bezierCurveTo(t,e,i,s,r,a)}closePath(){this.path.closePath()}ellipse(t,e,i,s,r,a,n,o){}lineTo(t,e){this.path.lineTo(t,e)}moveTo(t,e){this.path.moveTo(t,e)}quadraticCurveTo(t,e,i,s){this.path.quadraticCurveTo(t,e,i,s)}rect(t,e,i,s){this.path.rect(t,e,i,s)}createImageData(t,e){return null}createLinearGradient(t,e,i,s){throw new Error("不支持createLinearGradient")}createPattern(t,e){throw new Error("不支持createPattern")}createRadialGradient(t,e,i,s,r,a){throw new Error("不支持createRadialGradient")}createConicGradient(t,e,i,s){return null}fill(t,e){}fillRect(t,e,i,s){this.path.rect(t,e,i,s)}clearRect(t,e,i,s){}fillText(t,e,i){}getImageData(t,e,i,s){return null}getLineDash(){return[]}isPointInPath(t,e){return this.matrix.transformPoint({x:t,y:e},yr),function(t,e,i){return Ti(t,0,!1,e,i)}(this.path.commandList,yr.x,yr.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},yr);const i=function(t,e,i){let s=e;const{a:r,b:a,c:n,d:o}=t.currentMatrix,l=Math.sign(r)*Math.sqrt(r*r+a*a),h=Math.sign(o)*Math.sqrt(n*n+o*o);return l+h===0?0:(s=s/Math.abs(l+h)*2*i,s)}(this,this.lineWidth,this.dpr);return function(t,e,i,s){return Ti(t,e,!0,i,s)}(this.path.commandList,i,yr.x,yr.y)}measureText(t){throw new Error("不支持measureText")}putImageData(t,e,i){throw new Error("不支持measureText")}setLineDash(t){}stroke(t){}strokeRect(t,e,i,s){this.path.rect(t,e,i,s)}strokeText(t,e,i){}drawImage(){}setCommonStyle(t,e,i,s,r){}_setCommonStyle(t,e,i,s){}setStrokeStyle(t,e,i,s,r){}_setStrokeStyle(t,e,i,s){}setTextStyleWithoutAlignBaseline(t,e){}setTextStyle(t,e){}draw(){}clearMatrix(t=!0,e=this.dpr){this.setTransformFromMatrix(fr,t,e)}setClearMatrix(t,e,i,s,r,a){this._clearMatrix.setValue(t,e,i,s,r,a)}onlyTranslate(t=this.dpr){return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(...t){this.stack.forEach((t=>gr.free(t))),this.stack.length=0}}var br;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(br||(br={}));class xr{static Get(t,e=br.Color1,i=[0,0,0,1]){if(e===br.Color1){const e=xr.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;const r=s.Color.parseColorString(t);if(r){const e=[r.r/255,r.g/255,r.b/255,r.opacity];xr.store1[t]=e,xr.store255[t]=[r.r,r.g,r.b,r.opacity],i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3]}return i}const r=xr.store255[t];if(r)return i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i;const a=s.Color.parseColorString(t);return a&&(xr.store1[t]=[a.r/255,a.g/255,a.b/255,a.opacity],xr.store255[t]=[a.r,a.g,a.b,a.opacity],i[0]=a.r,i[1]=a.g,i[2]=a.b,i[3]=a.opacity),i}static Set(t,e,i){if(e===br.Color1){if(xr.store1[t])return;xr.store1[t]=i,xr.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(xr.store255[t])return;xr.store255[t]=i,xr.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}xr.store255={},xr.store1={};const _r=new Set(["name","patch","priority","exclude","suppress","resolver","declaredAffectedKeys"]);function Sr(t){return null==t?void 0:t}class Ar{compile(t={}){const e=Object.keys(t).map((e=>[e,this.normalizeDefinition(e,t[e])])),i=e.map((([,t])=>t)).sort(((t,e)=>{var i,s;const r=null!==(i=t.priority)&&void 0!==i?i:0,a=null!==(s=e.priority)&&void 0!==s?s:0;return r!==a?r-a:t.name.localeCompare(e.name)})),s=new Map;i.forEach(((t,e)=>{s.set(t.name,e)}));const r=new Map;return e.forEach((([,t])=>{var e,i,a,n;const o=t.declaredAffectedKeys?new Set(Array.from(t.declaredAffectedKeys)):void 0,l=t.patch?new Set(Object.keys(t.patch)):new Set,h=new Set(l);null==o||o.forEach((t=>h.add(t))),r.set(t.name,{name:t.name,priority:null!==(e=t.priority)&&void 0!==e?e:0,rank:null!==(i=s.get(t.name))&&void 0!==i?i:0,patch:Sr(t.patch),resolver:t.resolver,declaredAffectedKeys:o,exclude:new Set(null!==(a=t.exclude)&&void 0!==a?a:[]),suppress:new Set(null!==(n=t.suppress)&&void 0!==n?n:[]),hasResolver:"function"==typeof t.resolver,affectedKeys:h})})),this.expandRelationClosure(r,"exclude"),this.expandRelationClosure(r,"suppress"),r}normalizeDefinition(t,e){var i,s;if(null==e)return{name:t,priority:0,patch:void 0};if((function(t){return null!=t&&"object"==typeof t&&!Array.isArray(t)}(e)?Object.keys(e):[]).some((t=>_r.has(t)))){const r=e;return{name:null!==(i=r.name)&&void 0!==i?i:t,priority:null!==(s=r.priority)&&void 0!==s?s:0,patch:Sr(r.patch),resolver:r.resolver,declaredAffectedKeys:r.declaredAffectedKeys,exclude:r.exclude,suppress:r.suppress}}return{name:t,priority:0,patch:e}}expandRelationClosure(t,e){const i=new Map;t.forEach(((t,s)=>{i.set(s,new Set(t[e]))})),t.forEach(((t,s)=>{const r=new Set,a=(t,e)=>{const n=i.get(t);n&&n.size&&n.forEach((t=>{t===s||e.has(t)||r.has(t)||(r.add(t),e.add(t),a(t,e),e.delete(t))}))};a(s,new Set([s])),t[e]=r}))}}function Tr(t){return null!=t&&"object"==typeof t&&!Array.isArray(t)}function Cr(t){if(!Tr(t))return t;const e={};return Object.keys(t).forEach((i=>{e[i]=Cr(t[i])})),e}function Mr(t,e){var i;const s=null!==(i=Cr(t))&&void 0!==i?i:{};return Object.keys(e).forEach((t=>{const i=e[t],r=s[t];Tr(r)&&Tr(i)?s[t]=Mr(r,i):s[t]=Cr(i)})),s}class kr{constructor(t){var e;this._activeStates=[],this._effectiveStates=[],this._suppressed=[],this._resolvedPatch={},this.resolverPatchCache=new Map,this.resolverCacheKey="",this.resolverCacheValid=!1,this.baseAttributes={},this.compiledDefinitions=t.compiledDefinitions,this.stateSort=t.stateSort,this.mergeMode=null!==(e=t.mergeMode)&&void 0!==e?e:"shallow"}get activeStates(){return this._activeStates}get effectiveStates(){return this._effectiveStates}get resolvedPatch(){return this._resolvedPatch}get suppressed(){return this._suppressed}setResolveContext(t,e){this.graphic===t&&this.baseAttributes===e||this.invalidateResolverCache(),this.graphic=t,this.baseAttributes=e}applyStates(t){const e=Array.from(new Set(t)),i=this.sortStates(e),s=this.adjudicate(i),r=s.active,a=r.filter((t=>!s.suppressedSet.has(t))),n=r.filter((t=>s.suppressedSet.has(t))),o=!this.sameArray(this._activeStates,r)||!this.sameArray(this._effectiveStates,a)||!this.sameArray(this._suppressed,n);return this._activeStates=r,this._effectiveStates=a,this._suppressed=n,!o&&this.resolverCacheValid||this.recomputePatch(a),{changed:o,activeStates:[...this._activeStates],effectiveStates:[...this._effectiveStates],suppressed:[...this._suppressed]}}addState(t,e){if(this._activeStates.includes(t)&&(e||1===this._activeStates.length))return{changed:!1,activeStates:[...this._activeStates],effectiveStates:[...this._effectiveStates],suppressed:[...this._suppressed]};const i=e&&this._activeStates.length?this._activeStates.concat([t]):[t];return this.applyStates(i)}removeState(t){if(!this._activeStates.length)return{changed:!1,activeStates:[],effectiveStates:[],suppressed:[]};const e=Array.isArray(t)?this._activeStates.filter((e=>!t.includes(e))):this._activeStates.filter((e=>e!==t));return e.length===this._activeStates.length?{changed:!1,activeStates:[...this._activeStates],effectiveStates:[...this._effectiveStates],suppressed:[...this._suppressed]}:this.applyStates(e)}toggleState(t){return this.hasState(t)?this.removeState(t):this.applyStates(this._activeStates.concat([t]))}clearStates(){const t=this._activeStates.length>0||this._effectiveStates.length>0||this._suppressed.length>0;return this._activeStates=[],this._effectiveStates=[],this._suppressed=[],this._resolvedPatch={},this.resolverPatchCache.clear(),this.resolverCacheKey="",this.resolverCacheValid=!1,{changed:t,activeStates:[],effectiveStates:[],suppressed:[]}}invalidateResolverCache(){this.resolverPatchCache.clear(),this.resolverCacheKey="",this.resolverCacheValid=!1}hasState(t){return!!this._activeStates.length&&(null==t||this._activeStates.includes(t))}sortStates(t){const e=[],i=[];return t.forEach((t=>{this.compiledDefinitions.has(t)?e.push(t):i.push(t)})),e.sort(((t,e)=>{const i=this.compiledDefinitions.get(t),s=this.compiledDefinitions.get(e);return i&&s?i.priority!==s.priority?i.priority-s.priority:i.rank-s.rank:0})),this.stateSort&&i.length>1&&i.sort(this.stateSort),e.concat(i)}adjudicate(t){const e=t.slice(),i=new Set;for(let t=e.length-1;t>=0;t--){const s=e[t],r=this.compiledDefinitions.get(s);r&&(r.exclude.forEach((i=>{const s=e.indexOf(i);-1!==s&&(e.splice(s,1),s<t&&(t-=1))})),r.suppress.forEach((t=>{i.add(t)})))}return{active:e,suppressedSet:i}}recomputePatch(t){const e=t.join(","),i={},s=this.resolverCacheValid&&this.resolverCacheKey===e;s||(this.resolverPatchCache.clear(),this.resolverCacheKey=e),t.forEach((t=>{var e;const r=this.compiledDefinitions.get(t);if(r&&(r.patch&&this.mergeInto(i,r.patch),r.hasResolver)){const a=s?this.resolverPatchCache.get(t):null===(e=r.resolver)||void 0===e?void 0:e.call(r,{graphic:this.graphic,activeStates:this._activeStates,effectiveStates:this._effectiveStates,baseAttributes:this.baseAttributes,resolvedPatch:i});a&&(s||this.resolverPatchCache.set(t,a),this.mergeInto(i,a))}})),s||(this.resolverCacheValid=!0),this._resolvedPatch=i}mergeInto(t,e){"deep"!==this.mergeMode?Object.keys(e).forEach((i=>{t[i]=Cr(e[i])})):Object.keys(e).forEach((i=>{var s;const r=e[i],a=t[i],n=null===(s=this.baseAttributes)||void 0===s?void 0:s[i];Tr(a)&&Tr(r)?t[i]=Mr(a,r):!Tr(a)&&Tr(n)&&Tr(r)?t[i]=Mr(n,r):t[i]=Cr(r)}))}sameArray(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}}var wr;!function(t){t[t.NONE=0]="NONE",t[t.PAINT=1]="PAINT",t[t.SHAPE=2]="SHAPE",t[t.BOUNDS=4]="BOUNDS",t[t.TRANSFORM=8]="TRANSFORM",t[t.LAYOUT=16]="LAYOUT",t[t.PICK=32]="PICK"}(wr||(wr={}));const Pr={fill:wr.PAINT,opacity:wr.PAINT,fillOpacity:wr.PAINT,strokeOpacity:wr.PAINT,lineDash:wr.PAINT,lineDashOffset:wr.PAINT,lineCap:wr.PAINT,lineJoin:wr.PAINT,miterLimit:wr.PAINT,shadowColor:wr.PAINT,x:wr.TRANSFORM|wr.BOUNDS,y:wr.TRANSFORM|wr.BOUNDS,scaleX:wr.TRANSFORM|wr.BOUNDS,scaleY:wr.TRANSFORM|wr.BOUNDS,angle:wr.TRANSFORM|wr.BOUNDS,anchor:wr.TRANSFORM|wr.BOUNDS,anchor3d:wr.TRANSFORM|wr.BOUNDS,postMatrix:wr.TRANSFORM|wr.BOUNDS,layout:wr.LAYOUT,zIndex:wr.PAINT,visible:wr.PAINT|wr.PICK,lineWidth:wr.SHAPE|wr.BOUNDS|wr.PICK,width:wr.SHAPE|wr.BOUNDS,height:wr.SHAPE|wr.BOUNDS},Or={stroke:(t,e)=>(null!=t&&!1!==t)!=(null!=e&&!1!==e)?wr.PAINT|wr.BOUNDS|wr.PICK:wr.PAINT,shadowBlur:(t,e)=>{const i=Number(null!=t?t:0),s=Number(null!=e?e:0);return i!==s&&(i>0||s>0)?wr.PAINT|wr.BOUNDS:wr.PAINT}};class Br{analyzeTransition(t,e,i={}){var s,r;const a={targetAttrs:Object.assign({},t),animateAttrs:{},noAnimateAttrs:{}};if(!e)return a;const n=Object.assign(Object.assign({},null!==(s=i.noWorkAnimateAttr)&&void 0!==s?s:{}),(d=null===(r=i.animateConfig)||void 0===r?void 0:r.noAnimateAttrs)?Array.isArray(d)?d.reduce(((t,e)=>(t[e]=1,t)),{}):Object.keys(d).reduce(((t,e)=>(d[e]&&(t[e]=1),t)),{}):{}),o=!0===i.isClear,l=i.getDefaultAttribute,h=i.shouldSkipDefaultAttribute,c=(e,i)=>{if(n[e])a.noAnimateAttrs[e]=i;else if(o&&void 0===i){if(null==h?void 0:h(e,t))return;a.animateAttrs[e]=l(e)}else a.animateAttrs[e]=i};var d;for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&c(e,t[e]);const u=i.extraAnimateAttrs;if(u)for(const e in u){const i=Object.prototype.hasOwnProperty.call(t,e);!Object.prototype.hasOwnProperty.call(u,e)||i&&void 0!==t[e]||c(e,u[e])}return a}applyTransition(t,e,i,s={}){var r,a,n;if(i){const i=null!==(r=s.animateConfig)&&void 0!==r?r:lr;null===(a=t.applyAnimationState)||void 0===a||a.call(t,["state"],[{name:"state",animation:{type:"state",to:e.animateAttrs,duration:i.duration,easing:i.easing}}]),n=e.noAnimateAttrs,Object.keys(n).length>0&&t.setAttributesAndPreventAnimate(e.noAnimateAttrs,!1,{type:Lt.STATE})}else t.stopStateAnimates(),t.setAttributesAndPreventAnimate(e.targetAttrs,!1,{type:Lt.STATE});return t.finalAttribute&&Object.assign(t.finalAttribute,e.targetAttrs),t._emitCustomEvent("afterStateUpdate",{type:Lt.STATE}),e}applyClearTransition(t,e,i,s={}){var r;const a=this.analyzeTransition(e,i,{noWorkAnimateAttr:t.getNoWorkAnimateAttr(),isClear:!0,getDefaultAttribute:t.getDefaultAttribute.bind(t),shouldSkipDefaultAttribute:null!==(r=s.shouldSkipDefaultAttribute)&&void 0!==r?r:t.shouldSkipStateTransitionDefaultAttribute.bind(t),animateConfig:s.animateConfig,extraAnimateAttrs:s.extraAnimateAttrs});return this.applyTransition(t,a,i,s)}}const Lr=new Ar;function Er(t,e=t.revision+1){var i;const s=(r=t.parentScope,a=t.localStateDefinitions,n=t.themeStateDefinitions,Object.assign({},r?r.effectiveSourceDefinitions:n,a));var r,a,n;return t.effectiveSourceDefinitions=s,t.effectiveCompiledDefinitions=Lr.compile(s),t.parentRevisionAtBuild=null===(i=t.parentScope)||void 0===i?void 0:i.revision,t.revision=e,t.dirty=!1,t}function Dr(t){if(t)return t.parentScope&&Dr(t.parentScope),(t.dirty||t.parentScope&&t.parentRevisionAtBuild!==t.parentScope.revision)&&Er(t),t}const Fr=new s.AABBBounds,Ir=new s.Matrix,Rr=["lineWidth","scaleX","scaleY","angle","anchor","visible"],Nr=["x","y"],jr=["scaleX","scaleY"],Ur=["angle"],zr=new Set(["circle","diamond","rect","vertical-line","horizontal-line","bias-lr","bias-rl","grid","wave"]),Vr=new s.Point,Gr=[],Wr=wr.PAINT|wr.SHAPE|wr.BOUNDS|wr.TRANSFORM|wr.LAYOUT;function Hr(t){return"object"==typeof t&&null!=t&&!Array.isArray(t)}function $r(t){if(!Hr(t))return t;const e=t,i={};return Object.keys(e).forEach((t=>{const s=e[t];i[t]=Hr(s)?$r(s):s})),i}function Xr(t,e){return t===e||!!(Hr(t)||Hr(e)||Array.isArray(t)||Array.isArray(e))&&s.isEqual(t,e)}function Yr(t,e){var i;const s=null!==(i=$r(t))&&void 0!==i?i:{};return Object.keys(e).forEach((t=>{const i=e[t],r=s[t];Hr(r)&&Hr(i)?s[t]=Yr(r,i):s[t]=$r(i)})),s}const Kr={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,globalZIndex:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1};class qr extends Bi{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const s=e[i];Object.defineProperty(qr.prototype,s,Object.getOwnPropertyDescriptor(t,s))}}get AABBBounds(){return this.tryUpdateAABBBounds()}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}get baseAttributes(){var t;return null!==(t=this._baseAttributes)&&void 0!==t?t:this.attribute}set baseAttributes(t){t!==this.attribute?this._baseAttributes=t:this._baseAttributes=void 0}constructor(t={}){var e;super(),this._AABBBounds=new s.AABBBounds,this._updateTag=Ot.INIT,this.attribute=t,this.valid=this.isValid(),this.updateAABBBoundsStamp=0,t.background&&this.loadImage(null!==(e=t.background.background)&&void 0!==e?e:t.background,!0),t.texture&&Zr(t.texture)&&this.loadImage(t.texture,!1),t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic)}get normalAttrs(){return this.baseAttributes}set normalAttrs(t){}getBaseAttributesStorage(){var t;return null!==(t=this._baseAttributes)&&void 0!==t?t:this.attribute}getGraphicService(){var t,e;return null!==(e=null===(t=this.stage)||void 0===t?void 0:t.graphicService)&&void 0!==e?e:yt.graphicService}getAttributes(){return this.attribute}getStateTransitionOrchestrator(){return this.stateTransitionOrchestrator||(this.stateTransitionOrchestrator=new Br),this.stateTransitionOrchestrator}resolveBoundSharedStateScope(){var t;let e=this.parent;for(;e;){if(e.sharedStateScope)return e.sharedStateScope;e=e.parent}return null===(t=this.stage)||void 0===t?void 0:t.rootSharedStateScope}syncSharedStateScopeBindingFromTree(t=!0){var e;const i=this.resolveBoundSharedStateScope();return this.boundSharedStateScope===i?(this.syncSharedStateActiveRegistrations(),!1):(this.boundSharedStateScope=i,this.boundSharedStateRevision=void 0,this.compiledStateDefinitions=void 0,this.compiledStateDefinitionsCacheKey=void 0,this.stateEngine=void 0,this.stateEngineCompiledDefinitions=void 0,this.syncSharedStateActiveRegistrations(),t&&(null===(e=this.currentStates)||void 0===e?void 0:e.length)&&this.markSharedStateDirty(),!0)}syncSharedStateScopeBindingOnTreeChange(t=!0){var e,i;return!!((null===(e=this.currentStates)||void 0===e?void 0:e.length)||this.boundSharedStateScope||(null===(i=this.registeredActiveScopes)||void 0===i?void 0:i.size)||this.sharedStateDirty)&&this.syncSharedStateScopeBindingFromTree(t)}syncSharedStateActiveRegistrations(){var t;const e=this.registeredActiveScopes;if(!(null===(t=this.currentStates)||void 0===t?void 0:t.length)||!this.boundSharedStateScope)return(null==e?void 0:e.size)&&(e.forEach((t=>{t.subtreeActiveDescendants.delete(this)})),e.clear()),void(this.registeredActiveScopes=void 0);const i=new Set(function(t){const e=[];let i=t;for(;i;)e.push(i),i=i.parentScope;return e}(this.boundSharedStateScope));null==e||e.forEach((t=>{i.has(t)||t.subtreeActiveDescendants.delete(this)})),i.forEach((t=>{t.subtreeActiveDescendants.add(this)})),this.registeredActiveScopes=i}clearSharedStateActiveRegistrations(){const t=this.registeredActiveScopes;t&&(t.forEach((t=>{t.subtreeActiveDescendants.delete(this)})),t.clear()),this.registeredActiveScopes=void 0}markSharedStateDirty(){var t,e,i;this.sharedStateDirty=!0,t=this.stage,e=this,t&&(null!==(i=t._pendingSharedStateRefreshGraphics)&&void 0!==i?i:t._pendingSharedStateRefreshGraphics=new Set).add(e),function(t){t&&"released"!==t.releaseStatus&&t.renderNextFrame()}(this.stage)}onParentSharedStateTreeChanged(t,e){this.stage===t&&this.layer===e?this.syncSharedStateScopeBindingOnTreeChange():this.setStage(t,e)}refreshSharedStateBeforeRender(){var t;(null===(t=this.currentStates)||void 0===t?void 0:t.length)?(this.syncSharedStateScopeBindingFromTree(!1),this.boundSharedStateScope&&Dr(this.boundSharedStateScope),this.recomputeCurrentStatePatch(),this.stopStateAnimates(),this._restoreAttributeFromStaticTruth({type:Lt.STATE}),this.emitStateUpdateEvent(),this.sharedStateDirty=!1):this.sharedStateDirty=!1}getLocalStatesVersion(){var t,e;return this.localStateDefinitionsSource!==this.states&&(this.localStateDefinitionsSource=this.states,this.localStateDefinitionsVersion=(null!==(t=this.localStateDefinitionsVersion)&&void 0!==t?t:0)+1),null!==(e=this.localStateDefinitionsVersion)&&void 0!==e?e:0}resolveEffectiveCompiledDefinitions(){this.syncSharedStateScopeBindingFromTree(!1);const t=this.boundSharedStateScope;t&&(Dr(t),this.boundSharedStateRevision=t.revision);const e=!!this.states&&Object.keys(this.states).length>0;if(!t){if(!e)return{compiledDefinitions:void 0};const t=`local:${this.getLocalStatesVersion()}`;return this.compiledStateDefinitions&&this.compiledStateDefinitionsCacheKey===t||(this.compiledStateDefinitions=(new Ar).compile(this.states),this.compiledStateDefinitionsCacheKey=t),{compiledDefinitions:this.compiledStateDefinitions}}return{compiledDefinitions:t.effectiveCompiledDefinitions}}recomputeCurrentStatePatch(){var t,e;if(!(null===(t=this.currentStates)||void 0===t?void 0:t.length))return this.effectiveStates=[],this.resolvedStatePatch=void 0,void this.syncSharedStateActiveRegistrations();const i=this.getStateResolveBaseAttrs(),s=this.resolveUseStatesTransition(this.currentStates,i),r=null!==(e=s.effectiveStates)&&void 0!==e?e:s.states,a=this.stateEngine&&this.compiledStateDefinitions?Object.assign({},this.stateEngine.resolvedPatch):{};this.currentStates=s.states,this.effectiveStates=[...r],this.resolvedStatePatch=a,this.syncSharedStateActiveRegistrations()}buildStaticAttributeSnapshot(){var t;const e=$r(null!==(t=this.baseAttributes)&&void 0!==t?t:{}),i=this.resolvedStatePatch;return i?(Object.keys(i).forEach((t=>{const s=i[t],r=e[t];"deep"===this.stateMergeMode&&Hr(r)&&Hr(s)?e[t]=Yr(r,s):e[t]=$r(s)})),e):e}buildRemovedStateAnimationAttrs(t,e){const i={};if(!e)return i;const s=this.buildStaticAttributeSnapshot(),r=s;return Object.keys(e).forEach((e=>{const a=Object.prototype.hasOwnProperty.call(t,e);if(a&&void 0!==t[e])return;const n=t=>{void 0===t&&this.shouldSkipStateTransitionDefaultAttribute(e,r)||(i[e]=void 0===t?t:$r(t))};if(a)n(this.getStateTransitionDefaultAttribute(e,r));else if(Object.prototype.hasOwnProperty.call(s,e)){const t=s[e];n(void 0===t?this.getStateTransitionDefaultAttribute(e,r):t)}else n(this.getStateTransitionDefaultAttribute(e,r))})),i}syncObjectToSnapshot(t,e,i){const s=new Map;return new Set([...Object.keys(t),...Object.keys(e)]).forEach((r=>{if(!0===(null==i?void 0:i[r]))return;const a=Object.prototype.hasOwnProperty.call(e,r),n=t[r];if(!a)return void(Object.prototype.hasOwnProperty.call(t,r)&&(s.set(r,{prev:n,next:void 0}),delete t[r]));const o=e[r];Xr(n,o)||(s.set(r,{prev:n,next:o}),t[r]=$r(o))})),s}_syncAttribute(t){this.attribute===this.baseAttributes&&this.resolvedStatePatch&&this.detachAttributeFromBaseAttributes();const e=this.buildStaticAttributeSnapshot(),i=this.syncObjectToSnapshot(this.attribute,e,t);return this.valid=this.isValid(),this.attributeMayContainTransientAttrs=!!t,i}_syncFinalAttributeFromStaticTruth(t){const e=this.finalAttribute;if(!e)return;const i=this.buildStaticAttributeSnapshot();this.syncObjectToSnapshot(e,i,t)}mergeAttributeDeltaCategory(t,e,i,s){var r;let a="stroke"===e||"shadowBlur"===e?function(t,e,i){var s;const r=Or[t];return r?r(e,i):null!==(s=Pr[t])&&void 0!==s?s:wr.PAINT}(e,i,s):null!==(r=Pr[e])&&void 0!==r?r:wr.PAINT;return a&wr.PICK&&(a|=wr.BOUNDS),a===wr.PAINT&&this.needUpdateTag(e)&&(a=wr.SHAPE|wr.BOUNDS),t|a}submitUpdateByCategory(t,e=!1){if(e)return this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),void this.addUpdateLayoutTag();(t&Wr)!==Wr?(t&wr.SHAPE?this.addUpdateShapeAndBoundsTag():t&wr.BOUNDS&&this.addUpdateBoundTag(),t&wr.PAINT&&this.addUpdatePaintTag(),t&wr.TRANSFORM&&this.addUpdatePositionTag(),t&wr.LAYOUT&&this.addUpdateLayoutTag()):this.addBroadUpdateTag()}submitUpdateByDelta(t,e=!1){let i=wr.NONE;t.forEach(((t,e)=>{i=this.mergeAttributeDeltaCategory(i,e,t.prev,t.next)})),this.submitUpdateByCategory(i,e)}submitTouchedKeyUpdate(t,e=!1){this.submitTouchedUpdate(e||this.needUpdateTags(t))}submitTouchedUpdate(t){!this.updateShapeAndBoundsTagSetted()&&t?this.addUpdateShapeAndBoundsTag():this.addUpdateBoundTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag()}commitBaseAttributeMutation(t=!1,e){var i,s,r;(null===(i=this.currentStates)||void 0===i?void 0:i.length)&&(this.resolverEpoch=(null!==(s=this.resolverEpoch)&&void 0!==s?s:0)+1,null===(r=this.stateEngine)||void 0===r||r.invalidateResolverCache(),this.recomputeCurrentStatePatch());const a=this._syncAttribute();this.submitUpdateByDelta(a,t),this.onAttributeUpdate(e)}canCommitBaseAttributesByTouchedKeys(){var t,e;return!((null===(t=this.currentStates)||void 0===t?void 0:t.length)||this.resolvedStatePatch||this.attributeMayContainTransientAttrs||((null===(e=this.animates)||void 0===e?void 0:e.size)||this._animationStateManager)&&this.hasAnyTrackedAnimate())}detachAttributeFromBaseAttributes(){this.attribute===this.baseAttributes&&(this._baseAttributes=this.attribute,this.attribute=function(t){if(!Hr(t))return t;const e=t,i={};return Object.keys(e).forEach((t=>{const s=e[t];i[t]=Hr(s)?Object.assign({},s):s})),i}(this.attribute))}commitInternalBaseAttributes(t,e){t&&Object.keys(t).length&&(this.canCommitBaseAttributesByTouchedKeys()?this.commitBaseAttributesByTouchedKeys(t,!1,e):(this.detachAttributeFromBaseAttributes(),this.applyBaseAttributes(t),this.commitBaseAttributeMutation(!1,e)))}commitBaseAttributesByTouchedKeys(t,e=!1,i){const s=t,r=this.getBaseAttributesStorage();let a=!1,n=e;for(const t in s)Object.prototype.hasOwnProperty.call(s,t)&&(a=!0,r[t]=s[t],!n&&this.needUpdateTag(t)&&(n=!0));a&&(this.attribute=r,this._baseAttributes=void 0,this.valid=this.isValid(),this.attributeMayContainTransientAttrs=!1,this.submitTouchedUpdate(n),this.onAttributeUpdate(i))}commitBaseAttributeBySingleKey(t,e,i=!1,s){this.getBaseAttributesStorage()[t]=e,this.attribute=this.getBaseAttributesStorage(),this._baseAttributes=void 0,this.valid=this.isValid(),this.attributeMayContainTransientAttrs=!1,this.submitTouchedUpdate(i||this.needUpdateTag(t)),this.onAttributeUpdate(s)}applyBaseAttributes(t){const e=Object.keys(t);for(let i=0;i<e.length;i++){const s=e[i];this.getBaseAttributesStorage()[s]=t[s]}}_commitAnimationStaticAttributes(t,e){if(!t)return;const i=t,s=this.getBaseAttributesStorage(),r=this.attribute,a=new Map;let n=!1;for(const t in i){if(!Object.prototype.hasOwnProperty.call(i,t))continue;n=!0;const e=r[t],o=i[t];s[t]=o,r[t]=o,Xr(e,o)||a.set(t,{prev:e,next:o})}n&&(this.valid=this.isValid(),this.attributeMayContainTransientAttrs=!0,this.submitUpdateByDelta(a),this.onAttributeUpdate(e))}applyAnimationTransientAttributes(t,e=!1,i){const s=t;let r,a=e;for(const t in s)Object.prototype.hasOwnProperty.call(s,t)&&(r||(this.detachAttributeFromBaseAttributes(),r=this.attribute),r[t]=s[t],!a&&this.needUpdateTag(t)&&(a=!0));r&&(this.attributeMayContainTransientAttrs=!0,this.valid=this.isValid(),this.submitTouchedUpdate(a),this.onAttributeUpdate(i))}applyTransientAttributes(t,e=!1,i){this.detachAttributeFromBaseAttributes();const s=new Map,r=Object.keys(t);for(let e=0;e<r.length;e++){const i=r[e],a=this.attribute[i],n=t[i];Xr(a,n)||(s.set(i,{prev:a,next:n}),this.attribute[i]=n)}s.size&&(this.attributeMayContainTransientAttrs=!0),this.valid=this.isValid(),this.submitUpdateByDelta(s,e),this.onAttributeUpdate(i)}_restoreAttributeFromStaticTruth(t,e){this._syncFinalAttributeFromStaticTruth(e);const i=this._syncAttribute(e);this.submitUpdateByDelta(i),this.onAttributeUpdate(t)}collectStatePatchDeltaKeys(t,e){const i=t?Object.keys(t):[];if(!e)return i;for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&!Object.prototype.hasOwnProperty.call(null!=t?t:{},s)&&i.push(s);return i}getStaticTruthValueForStateKey(t,e){var i;const s=null!==(i=this.baseAttributes)&&void 0!==i?i:{},r=e;if(r&&Object.prototype.hasOwnProperty.call(r,t)){const e=r[t],i=s[t];return"deep"===this.stateMergeMode&&Hr(i)&&Hr(e)?{hasValue:!0,value:Yr(i,e)}:{hasValue:!0,value:e}}return Object.prototype.hasOwnProperty.call(s,t)?{hasValue:!0,value:s[t]}:{hasValue:!1,value:void 0}}syncStatePatchDeltaToTarget(t,e,i,s=!1){let r=wr.NONE;for(let a=0;a<e.length;a++){const n=e[a],o=t[n],l=this.getStaticTruthValueForStateKey(n,i);if(!l.hasValue){Object.prototype.hasOwnProperty.call(t,n)&&(delete t[n],s&&(r=this.mergeAttributeDeltaCategory(r,n,o,void 0)));continue}if(Xr(o,l.value))continue;const h=$r(l.value);t[n]=h,s&&(r=this.mergeAttributeDeltaCategory(r,n,o,h))}return r}restoreAttributeFromStatePatchDelta(t,e,i){this.detachAttributeFromBaseAttributes();const s=this.collectStatePatchDeltaKeys(t,e),r=this.finalAttribute;r&&this.syncStatePatchDeltaToTarget(r,s,e,!1);const a=this.syncStatePatchDeltaToTarget(this.attribute,s,e,!0);this.valid=this.isValid(),this.attributeMayContainTransientAttrs=!1,this.submitUpdateByCategory(a),this.onAttributeUpdate(i)}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t,e=!1){var i,s;const{dx:r=t.dx,dy:a=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;Vr.x=r+(null!==(i=t.scrollX)&&void 0!==i?i:0),Vr.y=a+(null!==(s=t.scrollY)&&void 0!==s?s:0)}else Vr.x=r,Vr.y=a;return Vr}onAnimateBind(t){this.detachAttributeFromBaseAttributes(),this._emitCustomEvent("animate-bind",t)}visitTrackedAnimates(t){const e=this.forEachTrackedAnimate;"function"!=typeof e?this.animates&&this.animates.forEach(t):e.call(this,t)}hasAnyTrackedAnimate(){var t;const e=this.hasTrackedAnimate;if("function"==typeof e)return e.call(this);const i=this.getTrackedAnimates;return"function"==typeof i?i.call(this).size>0:!!(null===(t=this.animates)||void 0===t?void 0:t.size)}mayHaveTrackedAnimates(){var t;return!!(null===(t=this.animates)||void 0===t?void 0:t.size)||!!this._animationStateManager}tryUpdateAABBBounds(){if(!(this.shadowRoot||this._updateTag&Ot.UPDATE_BOUNDS))return this._AABBBounds;const t="imprecise"===this.attribute.boundsMode;if(!this.shadowRoot){const e=this.getGraphicService(),i=this.getGraphicTheme();if(!e.validCheck(this.attribute,i,this._AABBBounds,this))return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;e.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const s=this.doUpdateAABBBounds(t,i);return e.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),"empty"===this.attribute.boundsMode&&s.clear(),s}if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;this.getGraphicService().beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return this.getGraphicService().afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),"empty"===this.attribute.boundsMode&&e.clear(),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new s.OBBBounds),this.tryUpdateAABBBounds(),this.updateOBBBoundsStamp===this.updateAABBBoundsStamp?this._OBBBounds:(this.updateOBBBoundsStamp=this.updateAABBBoundsStamp,this.valid?this.doUpdateOBBBounds():(this._OBBBounds.clear(),this._OBBBounds))}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}doUpdateOBBBounds(){return this._OBBBounds}getClipPath(){const{clipConfig:t}=this.attribute;if(!t)return null;this.clipPathMap||(this.clipPathMap=new Map);const{shape:e}=t;let i=this.clipPathMap.get(e)||null;return i||(this.clipPathMap.size>10&&this.clipPathMap.clear(),i=this.parsePath(e),i&&this.clipPathMap.set(e,i)),i}parsePath(t){if(!t)return null;let e=zs[t];if(e)return e;if(e=qr.userSymbolMap[t],e)return e;if(!0===((i=t=Vs[t]||t).startsWith("<svg")||i.startsWith("<?xml"))){const e=new Qs,{svg:i}=e.parse(t);if(!i)return null;const r=s.isArray(i.path)?i.path:[i.path];Fr.clear();const a=[];r.forEach((t=>{const e=(new Te).fromString(t.d),i={};or.forEach((e=>{t[e]&&(i[nr[e]]=t[e])})),a.push({path:e,attribute:i}),Fr.union(e.bounds)}));const n=Fr.width(),o=Fr.height(),l=1/s.max(n,o);a.forEach((t=>t.path.transform(0,0,l,l)));const h=new Us(t,a,!0);return qr.userSymbolMap[t]=h,h}var i;const r=(new Te).fromString(t),a=r.bounds.width(),n=r.bounds.height(),o=1/s.max(a,n);r.transform(0,0,o,o);const l=new Us(t,r);return qr.userSymbolMap[t]=l,l}doUpdateAABBBounds(t,e){this.updateAABBBoundsStamp++;const i=null!=e?e:this.getGraphicTheme();this._AABBBounds.clear();const r=this.attribute,a=this.updateAABBBounds(r,i,this._AABBBounds,t),{boundsPadding:n=i.boundsPadding}=r,o=(l=n)?s.isArray(l)?0===l.length?0:1===l.length?l[0]:2===l.length?(Di[0]=l[0],Di[2]=l[0],Di[1]=l[1],Di[3]=l[1],Di):l:l:0;var l;return o&&a.expand(o),this.clearUpdateBoundTag(),a}updatePathProxyAABBBounds(t){const e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const i=new bt(t);return jt(e.commandList,i,0,0),!0}tryUpdateGlobalAABBBounds(){const t=this.AABBBounds;return this._globalAABBBounds?this._globalAABBBounds.setValue(t.x1,t.y1,t.x2,t.y2):this._globalAABBBounds=t.clone(),this._globalAABBBounds.empty()||this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(t=!0){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(t=!0){return this._transMatrix||(this._transMatrix=new s.Matrix),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&Ot.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&this.getGraphicService().validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&Ot.UPDATE_BOUNDS)&&this.getGraphicService().validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&Ot.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&Ot.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&Ot.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const i=this.attribute;return Number.isFinite((null!==(t=i.x)&&void 0!==t?t:0)+(null!==(e=i.y)&&void 0!==e?e:0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&Ot.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=Ot.CLEAR_SHAPE}containsPoint(t,e,i,r){if(!r)return!1;if(i===Bt.GLOBAL){const i=new s.Point(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),t=i.x,e=i.y}return r.containsPoint(this,{x:t,y:e})}setWidthHeightWithoutTransform(t){this.widthWithoutTransform=t.x2-t.x1,this.heightWithoutTransform=t.y2-t.y1}setAttributesAndPreventAnimate(t,e=!1,i,s){if(!t)return;const r=Object.keys(t);this.captureTransientFromAttrsBeforePreventAnimate(t,r,i),this.syncFinalAttributesFromUpdateContext(i),this.visitTrackedAnimates((t=>{(t.priority!==1/0||s)&&t.preventAttrs(r)})),this.applyTransientAttributes(t,e,i)}syncFinalAttributesFromUpdateContext(t){var e;const i=null==t?void 0:t.type;if(i===Lt.STATE||null!=i&&i>=Lt.ANIMATE_BIND&&i<=Lt.ANIMATE_END)return;const s=null===(e=this.context)||void 0===e?void 0:e.finalAttrs,r=this.setFinalAttributes;s&&"function"==typeof r&&r.call(this,s)}captureTransientFromAttrsBeforePreventAnimate(t,e,i){var r,a;const n=this.context,o=null!==(r=null==n?void 0:n.diffAttrs)&&void 0!==r?r:t,l=null==i?void 0:i.type;if(!e.length||!o||l===Lt.STATE||null!=l&&l>=Lt.ANIMATE_BIND&&l<=Lt.ANIMATE_END)return;const h=this.transientFromAttrsBeforePreventAnimateDiffAttrs===o;let c=h&&null!==(a=this.transientFromAttrsBeforePreventAnimate)&&void 0!==a?a:null;h||(this.transientFromAttrsBeforePreventAnimate=null,this.transientFromAttrsBeforePreventAnimateDiffAttrs=null);let d=!1;for(let i=0;i<e.length;i++){const r=e[i];if(!Object.prototype.hasOwnProperty.call(o,r))continue;const a=this.attribute[r],n=t[r];s.isEqual(a,n)||(null!=c||(c={}),c[r]=$r(a),d=!0)}d&&(this.transientFromAttrsBeforePreventAnimate=c,this.transientFromAttrsBeforePreventAnimateDiffAttrs=o)}consumeTransientFromAttrsBeforePreventAnimate(t){const e=this.transientFromAttrsBeforePreventAnimate,i=this.transientFromAttrsBeforePreventAnimateDiffAttrs;if(!e||!i)return null;for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&(!Object.prototype.hasOwnProperty.call(i,e)||!s.isEqual(i[e],t[e])))return null;let r=null,a=!1;for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(Object.prototype.hasOwnProperty.call(t,i)?(null!=r||(r={}),r[i]=e[i]):a=!0);if(a){const i={};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&!Object.prototype.hasOwnProperty.call(t,s)&&(i[s]=e[s]);this.transientFromAttrsBeforePreventAnimate=i}else this.transientFromAttrsBeforePreventAnimate=null,this.transientFromAttrsBeforePreventAnimateDiffAttrs=null;return r}setAttributes(t,e=!1,i){t&&((t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background&&this.loadImage(t.background,!0),t.texture&&Zr(t.texture)&&this.loadImage(t.texture,!1),t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,i))}_setAttributes(t,e=!1,i){this.canCommitBaseAttributesByTouchedKeys()?this.commitBaseAttributesByTouchedKeys(t,e,i):(this.detachAttributeFromBaseAttributes(),this.applyBaseAttributes(t),this.commitBaseAttributeMutation(e,i))}setAttribute(t,e,i,s){const r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,s);if(r)this._setAttributes(r,i,s);else if(this.canCommitBaseAttributesByTouchedKeys())this.commitBaseAttributeBySingleKey(t,e,!!i,s);else{const r={[t]:e};this.applyBaseAttributes(r),this.commitBaseAttributeMutation(!!i,s)}"background"===t?this.loadImage(e,!0):"texture"===t&&Zr(e)?this.loadImage(e,!1):"shadowGraphic"===t&&this.setShadowGraphic(e)}needUpdateTags(t,e=Rr){for(let i=0;i<e.length;i++){const s=e[i];if(-1!==t.indexOf(s))return!0}return!1}needUpdateTag(t,e=Rr){for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(t){const e={type:Lt.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,this._baseAttributes=void 0,this.resolvedStatePatch=void 0,this.attributeMayContainTransientAttrs=!1,this.valid=this.isValid(),t.background&&this.loadImage(t.background,!0),t.texture&&Zr(t.texture)&&this.loadImage(t.texture,!1),t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._updateTag=Ot.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var i,s;if(0===t&&0===e)return this;const r={type:Lt.TRANSLATE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Nr,r);a&&(t=a.x,e=a.y,delete a.x,delete a.y);const n=this.baseAttributes,o=n.postMatrix,l=a||{};if(o){const i=o.clone();yt.transformUtil.fromMatrix(i,i).translate(t,e),l.postMatrix=i}else l.x=(null!==(i=n.x)&&void 0!==i?i:we.x)+t,l.y=(null!==(s=n.y)&&void 0!==s?s:we.y)+e;return this.commitInternalBaseAttributes(l,r),this}translateTo(t,e){const i=this.baseAttributes;if(i.x===t&&i.y===e)return this;const s={type:Lt.TRANSLATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Nr,s);return r?(this.commitInternalBaseAttributes(r,s),this):(this.commitInternalBaseAttributes({x:t,y:e},s),this)}scale(t,e,i){var r,a;if(1===t&&1===e)return this;const n={type:Lt.SCALE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:i},this.attribute,jr,n);o&&(t=o.scaleX,e=o.scaleY,delete o.scaleX,delete o.scaleY);const l=this.baseAttributes,h=o||{};if(i){let{postMatrix:r}=this.baseAttributes;r=r?r.clone():new s.Matrix,yt.transformUtil.fromMatrix(r,r).scale(t,e,i),h.postMatrix=r}else h.scaleX=(null!==(r=l.scaleX)&&void 0!==r?r:we.scaleX)*t,h.scaleY=(null!==(a=l.scaleY)&&void 0!==a?a:we.scaleY)*e;return this.commitInternalBaseAttributes(h,n),this}scaleTo(t,e){const i=this.baseAttributes;if(i.scaleX===t&&i.scaleY===e)return this;const s={type:Lt.SCALE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,jr,s);return r?(this.commitInternalBaseAttributes(r,s),this):(this.commitInternalBaseAttributes({scaleX:t,scaleY:e},s),this)}rotate(t,e){var i;if(0===t)return this;const r={type:Lt.ROTATE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,Ur,r);a&&delete a.angle;const n=this.baseAttributes,o=a||{};if(e){let{postMatrix:i}=this.baseAttributes;i=i?i.clone():new s.Matrix,yt.transformUtil.fromMatrix(i,i).rotate(t,e),o.postMatrix=i}else o.angle=(null!==(i=n.angle)&&void 0!==i?i:we.angle)+t;return this.commitInternalBaseAttributes(o,r),this}rotateTo(t){if(this.baseAttributes.angle===t)return this;const e={type:Lt.ROTATE_TO},i=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,Ur,e);return i?(this.commitInternalBaseAttributes(i,e),this):(this.commitInternalBaseAttributes({angle:t},e),this)}skewTo(t,e){return this}onAttributeUpdate(t){t&&t.skipUpdateCallback||(this.getGraphicService().onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds(),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds(),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!s.isNil(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}getStateResolveBaseAttrs(){var t;return null!==(t=this.baseAttributes)&&void 0!==t?t:this.attribute}syncStateResolveContext(t=this.getStateResolveBaseAttrs()){var e;return null===(e=this.stateEngine)||void 0===e||e.setResolveContext(this,t),t}ensureStateEngine(t=this.getStateResolveBaseAttrs()){const{compiledDefinitions:e}=this.resolveEffectiveCompiledDefinitions();return this.compiledStateDefinitions=e,e?this.stateEngine&&this.stateEngineCompiledDefinitions===e&&this.stateEngineStateSort===this.stateSort&&this.stateEngineMergeMode===this.stateMergeMode||(this.stateEngine=new kr({compiledDefinitions:e,stateSort:this.stateSort,mergeMode:this.stateMergeMode}),this.stateEngineCompiledDefinitions=e,this.stateEngineStateSort=this.stateSort,this.stateEngineMergeMode=this.stateMergeMode):(this.stateEngine=void 0,this.stateEngineCompiledDefinitions=void 0),this.syncStateResolveContext(t),this.stateEngine&&this.currentStates&&!this.sameStateNames(this.stateEngine.activeStates,this.currentStates)&&this.stateEngine.applyStates(this.currentStates),this.stateEngine}toGraphicStateTransition(t){return{changed:t.changed,states:[...t.activeStates],effectiveStates:[...t.effectiveStates]}}sortLocalStates(t){return this.stateSort?[...t].sort(this.stateSort):[...t]}resolveLocalUseStatesTransition(t){var e;if(!t.length)return this.resolveLocalClearStatesTransition();const i=null!==(e=this.currentStates)&&void 0!==e?e:Gr,s=i.length!==t.length||t.some(((t,e)=>i[e]!==t)),r=this.sortLocalStates(t);return{changed:s,states:s?r:[...i]}}resolveLocalClearStatesTransition(){return{changed:this.hasState(),states:[]}}resolveUseStatesTransition(t,e=this.getStateResolveBaseAttrs()){const i=this.ensureStateEngine(e);return i?this.toGraphicStateTransition(i.applyStates(t)):this.resolveLocalUseStatesTransition(t)}resolveClearStatesTransition(){const t=this.ensureStateEngine();return t?this.toGraphicStateTransition(t.clearStates()):this.resolveLocalClearStatesTransition()}resolveAddStateTransition(t,e){var i;const s=this.ensureStateEngine();if(s)return this.toGraphicStateTransition(s.addState(t,e));if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return{changed:!1,states:[...this.currentStates]};const r=e&&(null===(i=this.currentStates)||void 0===i?void 0:i.length)?this.currentStates.concat([t]):[t];return this.resolveLocalUseStatesTransition(r)}resolveRemoveStateTransition(t){const e=this.ensureStateEngine();if(e)return this.toGraphicStateTransition(e.removeState(t));if(!this.currentStates)return{changed:!1,states:[]};const i=Array.isArray(t)?e=>!t.includes(e):e=>e!==t,s=this.currentStates.filter(i);return s.length===this.currentStates.length?{changed:!1,states:[...this.currentStates]}:this.resolveLocalUseStatesTransition(s)}resolveToggleStateTransition(t){const e=this.ensureStateEngine();if(e)return this.toGraphicStateTransition(e.toggleState(t));if(this.hasState(t))return this.resolveRemoveStateTransition(t);const i=this.currentStates?this.currentStates.slice():[];return i.push(t),this.resolveLocalUseStatesTransition(i)}resolveGraphicStateTransition(t,e=!1){var i;const s=this.getStateResolveBaseAttrs(),r=this.ensureStateEngine(s);e&&(null==r||r.invalidateResolverCache());const a=r?this.toGraphicStateTransition(r.applyStates(t)):this.resolveLocalUseStatesTransition(t),n=this.stateEngine&&this.compiledStateDefinitions?Object.assign({},this.stateEngine.resolvedPatch):{};return{transition:a,effectiveStates:null!==(i=a.effectiveStates)&&void 0!==i?i:a.states,resolvedStateAttrs:n}}normalizeSetStatesOptions(t){return t&&"object"==typeof t?{hasAnimation:t.animate,animateSameStatePatchChange:!0===t.animateSameStatePatchChange,shouldRefreshSameStatePatch:!0}:{hasAnimation:"boolean"==typeof t?t:void 0,animateSameStatePatchChange:!1,shouldRefreshSameStatePatch:!1}}sameStatePatches(t,e){const i=null!=t?t:{},s=null!=e?e:{},r=new Set([...Object.keys(i),...Object.keys(s)]);for(const t of r){if(Object.prototype.hasOwnProperty.call(i,t)!==Object.prototype.hasOwnProperty.call(s,t))return!1;if(!Xr(i[t],s[t]))return!1}return!0}commitSameStatePatchRefresh(t,e,i=!1){var s;const r=null!==(s=this.currentStates)&&void 0!==s?s:Gr,a=this.resolvedStatePatch,{transition:n,effectiveStates:o,resolvedStateAttrs:l}=this.resolveGraphicStateTransition(t,!0),h=!this.sameStatePatches(a,l);h&&!this.beforeStateUpdate(l,r,n.states,e,!1)||(this.currentStates=n.states,this.effectiveStates=[...o],this.resolvedStatePatch=l,this.sharedStateDirty=!1,this.syncSharedStateActiveRegistrations(),h&&(e&&i?(this._syncFinalAttributeFromStaticTruth(),this.applyStateAttrs(l,n.states,e,!1,void 0,this.buildRemovedStateAnimationAttrs(l,a))):(this.stopStateAnimates(),this.attributeMayContainTransientAttrs?this._restoreAttributeFromStaticTruth({type:Lt.STATE}):this.restoreAttributeFromStatePatchDelta(a,this.resolvedStatePatch,{type:Lt.STATE}),this.emitStateUpdateEvent())))}resolveStateAnimateConfig(t){var e,i,s;return null!==(s=null!==(e=null!=t?t:this.stateAnimateConfig)&&void 0!==e?e:null===(i=this.context)||void 0===i?void 0:i.stateAnimateConfig)&&void 0!==s?s:lr}applyStateAttrs(t,e,i,s,r,a){const n=i?this.resolveStateAnimateConfig(r):void 0,o=n?{animateConfig:n,extraAnimateAttrs:a,shouldSkipDefaultAttribute:this.shouldSkipStateTransitionDefaultAttribute.bind(this)}:void 0;if(s)return void this.getStateTransitionOrchestrator().applyClearTransition(this,t,i,o);const l=this.getStateTransitionOrchestrator().analyzeTransition(t,i,{noWorkAnimateAttr:this.getNoWorkAnimateAttr(),animateConfig:n,extraAnimateAttrs:a,shouldSkipDefaultAttribute:this.shouldSkipStateTransitionDefaultAttribute.bind(this)});this.getStateTransitionOrchestrator().applyTransition(this,l,i,o)}updateNormalAttrs(t){}getStateTransitionDefaultAttribute(t,e){return this.getDefaultAttribute(t)}shouldSkipStateTransitionDefaultAttribute(t,e){return!1}stopStateAnimates(t="end"){const e=this.stopAnimationState;if("function"==typeof e)return void e.call(this,"state",t);if(!this.mayHaveTrackedAnimates())return;const i=[];this.visitTrackedAnimates((t=>{t.stateNames&&i.push(t)})),i.forEach((e=>e.stop(t)))}clearStates(t){var e,i,s;const r=null!==(e=this.currentStates)&&void 0!==e?e:Gr,a=this.resolvedStatePatch,n=this.resolveClearStatesTransition();if(!n.changed&&0===r.length)return this.currentStates=[],this.effectiveStates=[],this.resolvedStatePatch=void 0,this.sharedStateDirty=!1,void this.clearSharedStateActiveRegistrations();const o=t||this.hasCustomEvent("beforeStateUpdate")?$r(null!==(i=this.baseAttributes)&&void 0!==i?i:{}):null!==(s=this.baseAttributes)&&void 0!==s?s:{};n.changed&&!this.beforeStateUpdate(o,r,n.states,t,!0)||(this.currentStates=n.states,this.effectiveStates=[],this.resolvedStatePatch=void 0,this.sharedStateDirty=!1,this.clearSharedStateActiveRegistrations(),t?(this._syncFinalAttributeFromStaticTruth(),this.applyStateAttrs(o,n.states,t,!0,void 0,this.buildRemovedStateAnimationAttrs(o,a))):(this.stopStateAnimates(),this.attributeMayContainTransientAttrs?this._restoreAttributeFromStaticTruth({type:Lt.STATE}):this.restoreAttributeFromStatePatchDelta(a,void 0,{type:Lt.STATE}),this.emitStateUpdateEvent()))}removeState(t,e){const i=this.resolveRemoveStateTransition(t);i.changed&&this.useStates(i.states,e)}toggleState(t,e){const i=this.resolveToggleStateTransition(t);i.changed&&this.useStates(i.states,e)}addState(t,e,i){const s=this.resolveAddStateTransition(t,e);s.changed&&this.useStates(s.states,i)}setStates(t,e){var i,s,r;const{hasAnimation:a,animateSameStatePatchChange:n,shouldRefreshSameStatePatch:o}=this.normalizeSetStatesOptions(e),l=(null==t?void 0:t.length)?t:Gr,h=!!((null===(i=this.currentStates)||void 0===i?void 0:i.length)||(null===(s=this.effectiveStates)||void 0===s?void 0:s.length)||this.resolvedStatePatch||(null===(r=this.registeredActiveScopes)||void 0===r?void 0:r.size));if(l.length){if(this.sameStateNames(this.currentStates,l))return o?void this.commitSameStatePatchRefresh(l,a,n):void(this.sharedStateDirty&&this.refreshSharedStateBeforeRender());this.useStates(l,a)}else{if(!h&&!this.sharedStateDirty)return;this.clearStates(a)}}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);const s=null!==(i=this.currentStates)&&void 0!==i?i:Gr,r=this.resolvedStatePatch,{transition:a,effectiveStates:n,resolvedStateAttrs:o}=this.resolveGraphicStateTransition(t);!a.changed&&this.sameStateNames(s,a.states)||this.beforeStateUpdate(o,s,a.states,e,!1)&&(this.currentStates=a.states,this.effectiveStates=[...n],this.resolvedStatePatch=o,this.sharedStateDirty=!1,this.syncSharedStateActiveRegistrations(),e?(this._syncFinalAttributeFromStaticTruth(),this.applyStateAttrs(o,a.states,e,!1,void 0,this.buildRemovedStateAnimationAttrs(o,r))):(this.stopStateAnimates(),this.attributeMayContainTransientAttrs?this._restoreAttributeFromStaticTruth({type:Lt.STATE}):this.restoreAttributeFromStatePatchDelta(r,this.resolvedStatePatch,{type:Lt.STATE}),this.emitStateUpdateEvent()))}invalidateResolver(){var t,e;if(!this.stateEngine||!(null===(t=this.currentStates)||void 0===t?void 0:t.length)||!this.compiledStateDefinitions)return;this.syncStateResolveContext(),this.resolverEpoch=(null!==(e=this.resolverEpoch)&&void 0!==e?e:0)+1,this.stateEngine.invalidateResolverCache();const i=this.stateEngine.applyStates(this.currentStates),s=Object.assign({},this.stateEngine.resolvedPatch);this.effectiveStates=[...i.effectiveStates],this.resolvedStatePatch=s,this.sharedStateDirty=!1,this.syncSharedStateActiveRegistrations(),this.stopStateAnimates(),this._restoreAttributeFromStaticTruth({type:Lt.STATE}),this.emitStateUpdateEvent()}sameStateNames(t,e){const i=null!=t?t:[],s=null!=e?e:[];if(i.length!==s.length)return!1;for(let t=0;t<i.length;t++)if(i[t]!==s[t])return!1;return!0}addUpdateBoundTag(){this._updateTag|=Ot.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdatePaintTag(){this._updateTag|=Ot.UPDATE_PAINT}addUpdateShapeTag(){this._updateTag|=Ot.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=Ot.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addBroadUpdateTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=Ot.UPDATE_SHAPE_AND_BOUNDS|Ot.UPDATE_PAINT|Ot.UPDATE_GLOBAL_LOCAL_MATRIX|Ot.UPDATE_LAYOUT,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&Ot.UPDATE_SHAPE_AND_BOUNDS)===Ot.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=Ot.CLEAR_BOUNDS}clearUpdatePaintTag(){this._updateTag&=Ot.CLEAR_PAINT}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=Ot.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=Ot.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=Ot.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=Ot.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=Ot.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=Ot.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&Ot.UPDATE_LAYOUT)}getAnchor(t,e,i){const s=[0,0],r=()=>{if(e.b)return e.b;const t=this.clone();return t.attribute.angle=0,t.attribute.scaleCenter=null,i&&(t.attribute.scaleX=1,t.attribute.scaleY=1),e.b=t.AABBBounds,e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,i=r();s[0]=i.x1+(i.x2-i.x1)*e}else s[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,i=r();s[1]=i.y1+(i.y2-i.y1)*e}else s[1]=t[1];return s}doUpdateLocalMatrix(){const{x:t=we.x,y:e=we.y,scaleX:i=we.scaleX,scaleY:r=we.scaleY,angle:a=we.angle,scaleCenter:n,anchor:o,postMatrix:l}=this.attribute;let h=[0,0];const c={};if(o&&a&&(h=this.getAnchor(o,c)),!n||1===i&&1===r)s.normalTransform(this._transMatrix,this._transMatrix.reset(),t,e,i,r,a,o&&h);else{const s=this._transMatrix;s.reset(),s.translate(h[0],h[1]),s.rotate(a),s.translate(-h[0],-h[1]),s.translate(t,e),h=this.getAnchor(n,c,!0),yt.transformUtil.fromMatrix(s,s).scale(i,r,{x:h[0],y:h[1]})}const d=this.getOffsetXY(we);if(this._transMatrix.e+=d.x,this._transMatrix.f+=d.y,l){const t=Ir.setValue(l.a,l.b,l.c,l.d,l.e,l.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){var i,s,r,a,n,o,l,h,c,d;const u=null!==(r=null!==(i=null==t?void 0:t.graphicService)&&void 0!==i?i:null===(s=this.stage)||void 0===s?void 0:s.graphicService)&&void 0!==r?r:yt.graphicService,p=this.stage;if(this.stage!==t||this.layer!==e){if(this.stage=t,this.layer=e,((null===(a=this.currentStates)||void 0===a?void 0:a.length)||this.boundSharedStateScope||(null===(n=this.registeredActiveScopes)||void 0===n?void 0:n.size)||this.sharedStateDirty)&&this.syncSharedStateScopeBindingOnTreeChange(!0),this.setStageToShadowRoot(t,e),this.mayHaveTrackedAnimates()&&this.hasAnyTrackedAnimate()){const e=null===(o=null==p?void 0:p.getTimeline)||void 0===o?void 0:o.call(p),i=null===(l=null==t?void 0:t.getTimeline)||void 0===l?void 0:l.call(t),s=[];this.visitTrackedAnimates((t=>{(e&&t.timeline===e||t.timeline.isGlobal)&&(i?t.timeline!==i&&(e&&t.timeline===e&&e.removeAnimate(t,!1),t.setTimeline(i),i.addAnimate(t)):e&&t.timeline===e&&(e.removeAnimate(t,!1),s.push(t)))})),s.length&&(s.forEach((t=>{var e;t.stop();const i=this.untrackAnimate;"function"==typeof i?i.call(this,t.id):null===(e=this.animates)||void 0===e||e.delete(t.id)})),this._restoreAttributeFromStaticTruth({type:Lt.ANIMATE_END}))}return this._onSetStage&&this._onSetStage(this,t,e),void(null===(h=null==u?void 0:u.onSetStage)||void 0===h||h.call(u,this,t))}((null===(c=this.currentStates)||void 0===c?void 0:c.length)||this.boundSharedStateScope||(null===(d=this.registeredActiveScopes)||void 0===d?void 0:d.size)||this.sharedStateDirty)&&this.syncSharedStateScopeBindingOnTreeChange(!0)}detachStageForRelease(){var t,e,i;(null===(t=this.registeredActiveScopes)||void 0===t?void 0:t.size)&&this.clearSharedStateActiveRegistrations(),(this.mayHaveTrackedAnimates()||this.shadowRoot)&&this.stopAnimates(),this.boundSharedStateScope=void 0,this.boundSharedStateRevision=void 0,this.compiledStateDefinitions=void 0,this.compiledStateDefinitionsCacheKey=void 0,this.stateEngine=void 0,this.stateEngineCompiledDefinitions=void 0,this.sharedStateDirty=!1,this.stage=null,this.layer=null,this.shadowRoot&&(null===(i=(e=this.shadowRoot).detachStageForRelease)||void 0===i||i.call(e))}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){this._restoreAttributeFromStaticTruth({type:Lt.ANIMATE_END})}getDefaultAttribute(t){return this.getGraphicTheme()[t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t,e=!1){this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){var e,i,s;return t&&(t.shadowHost=this),this.shadowRoot=null!==(s=null!=t?t:null===(i=(e=yt.graphicService.creator).shadowRoot)||void 0===i?void 0:i.call(e,this))&&void 0!==s?s:require("./shadow-root").createShadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot.release(!0),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((t=>t.toJson()))}}createPathProxy(t){return s.isString(t,!0)?this.pathProxy=(new Te).fromString(t):this.pathProxy=new Te,this.pathProxy}loadImage(t,e=!1){if(e&&(null==t?void 0:t.background)&&(t=t.background),e&&(!t||function(t){return"string"==typeof t?!(t.startsWith("<svg")||s.isValidUrl(t)||t.includes("/")||s.isBase64(t)):!!(t.fill||t.stroke||"string"==typeof t.gradient&&Array.isArray(t.stops))}(t)))return void(this.backgroundImg=!1);if(!t)return;const i=t;this.resources||(this.resources=new Map);const r={data:"init",state:null};this.resources.set(i,r),"string"==typeof t?(r.state="loading",t.startsWith("<svg")?(Li.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(s.isValidUrl(t)||t.includes("/")||s.isBase64(t))&&(Li.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):s.isObject(t)?(r.state="success",r.data=t,this.backgroundImg=this.backgroundImg||e):r.state="fail"}setShadowGraphic(t){t?this.attachShadow().add(t):this.detachShadow()}imageLoadSuccess(t,e,i){if(!this.resources)return;const s=this.resources.get(t);s&&(s.state="success",s.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="fail",e&&e())}_stopAnimates(){if(!this.mayHaveTrackedAnimates())return;const t=[];this.visitTrackedAnimates((e=>{t.push(e)})),t.forEach((t=>{t.stop()}))}stopAnimates(t=!1){this._stopAnimates(),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){var t,e,i,s;this.releaseStatus="released",(null===(t=this.registeredActiveScopes)||void 0===t?void 0:t.size)&&this.clearSharedStateActiveRegistrations(),(this.mayHaveTrackedAnimates()||this.shadowRoot)&&this.stopAnimates();const r=null!==(i=null===(e=this.stage)||void 0===e?void 0:e.graphicService)&&void 0!==i?i:yt.graphicService;null===(s=null==r?void 0:r.onRelease)||void 0===s||s.call(r,this),super.release()}hasCustomEvent(t){return!!this._events&&t in this._events}_dispatchCustomEvent(t,e){var i,s;if(this.hasCustomEvent(t)){const r=new ki(t,e);r.bubbles=!1;const a=null===(s=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===s?void 0:s.manager;return a?(r.manager=a,this.dispatchEvent(r)):Bi.prototype.dispatchEvent.call(this,r)}return!0}beforeStateUpdate(t,e,i,s,r){return!this.hasCustomEvent("beforeStateUpdate")||this._dispatchCustomEvent("beforeStateUpdate",{type:Lt.STATE,attrs:Object.assign({},t),prevStates:e.slice(),nextStates:i.slice(),hasAnimation:!!s,isClear:!!r})}emitStateUpdateEvent(){this.hasCustomEvent("afterStateUpdate")&&this._emitCustomEvent("afterStateUpdate",{type:Lt.STATE})}_emitCustomEvent(t,e){this._dispatchCustomEvent(t,e)}toCustomPath(){var t,e,i;const s=null===(i=null===(e=(null===(t=this.stage)||void 0===t?void 0:t.renderService)||yt.renderService)||void 0===e?void 0:e.drawContribution)||void 0===i?void 0:i.getRenderContribution(this);if(s){const t=new vr(null,1);return s.drawShape(this,t,0,0,{},{}),t.path}return null}}function Zr(t){return!!t&&("string"==typeof t?!zr.has(t)&&(t.startsWith("<svg")||s.isValidUrl(t)||t.includes("/")||s.isBase64(t)):s.isObject(t))}qr.userSymbolMap={},qr.mixin(wi);const Qr={arc:Fe,area:Ie,circle:Re,line:Ue,path:ze,symbol:He,text:$e,rect:We,polygon:Ve,star:Ge,richtext:Xe,richtextIcon:Ke,image:Ye,group:Ne,glyph:je},Jr=Object.keys(Qr);function ta(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const ea={arc:Object.assign({},Qr.arc),area:Object.assign({},Qr.area),circle:Object.assign({},Qr.circle),line:Object.assign({},Qr.line),path:Object.assign({},Qr.path),symbol:Object.assign({},Qr.symbol),text:Object.assign({},Qr.text),rect:Object.assign({},Qr.rect),polygon:Object.assign({},Qr.polygon),star:Object.assign({},Qr.star),richtext:Object.assign({},Qr.richtext),richtextIcon:Object.assign({},Qr.richtextIcon),image:Object.assign({},Qr.image),group:Object.assign({},Qr.group),glyph:Object.assign({},Qr.glyph)};const ia=new class{constructor(){this.initTheme(),this.dirty=!1}get stateDefinitions(){return this._stateDefinitions}set stateDefinitions(t){var e;this._stateDefinitions!==t&&(this._stateDefinitions=t,null===(e=this.onStateDefinitionsChange)||void 0===e||e.call(this))}initTheme(){this._defaultTheme={},Jr.forEach((t=>{this._defaultTheme[t]=Object.create(ea[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e,i=!1){if(this.dirty){const r=this.getParentWithTheme(t);if(r){const t=r.theme;(t.dirty||i)&&t.applyTheme(r,e,!0)}this.userTheme?this.doCombine(r&&r.theme.combinedTheme):(r?this.combinedTheme=r.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,s.Logger.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;Jr.forEach((s=>{const r=Object.create(ea[s]);t&&t[s]&&ta(r,t[s]),i[s]&&ta(r,i[s]),e[s]&&ta(r,e[s]),this.combinedTheme[s]=r})),e.common&&Jr.forEach((t=>{ta(this.combinedTheme[t],e.common)})),this.dirty=!1}setTheme(t,e){let i=this.userTheme;i?Object.keys(t).forEach((e=>{i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}};function sa(t,e){return t.glyphHost?sa(t.glyphHost):e?(t.isContainer,e):function(t){let e;if(e=t.isContainer?t:t.parent,e){for(;e&&!e.theme;)e=e.parent;return e?(e.theme||e.createTheme(),e.theme.getTheme(e)):ia.getTheme()}return null}(t)||t.attachedThemeGraphic&&sa(t.attachedThemeGraphic)||ia.getTheme()}new class{constructor(){this.time=Ft.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,r,a,n,o,l,h,c,d,u){var p;const{background:g,backgroundOpacity:m=(null!==(p=t.attribute.fillOpacity)&&void 0!==p?p:l.backgroundOpacity),opacity:f=l.opacity,backgroundMode:y=l.backgroundMode,backgroundFit:v=l.backgroundFit,backgroundKeepAspectRatio:b=l.backgroundKeepAspectRatio,backgroundScale:x=l.backgroundScale,backgroundOffsetX:_=l.backgroundOffsetX,backgroundOffsetY:S=l.backgroundOffsetY,backgroundClip:A=l.backgroundClip,backgroundPosition:T=l.backgroundPosition}=t.attribute;if(g)if(t.backgroundImg&&t.resources){const r=t.resources.get(function(t){var e;return null!==(e=null==t?void 0:t.background)&&void 0!==e?e:t}(g));if(!r||"success"!==r.state||!r.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=sa(t.parent).group,{scrollX:s=i.scrollX,scrollY:r=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(s,r)}A&&e.clip();const a=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,s,l),e.globalAlpha=m*f,this.doDrawImage(e,r.data,a,{backgroundMode:y,backgroundFit:v,backgroundKeepAspectRatio:b,backgroundScale:x,backgroundOffsetX:_,backgroundOffsetY:S,backgroundPosition:T}),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,s,l),e.globalAlpha=m*f,e.fillStyle=g,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,s){!function(t,e,i,s){var r,a;const{backgroundMode:n,backgroundFit:o,backgroundKeepAspectRatio:l,backgroundScale:h=1,backgroundOffsetX:c=0,backgroundOffsetY:d=0,backgroundPosition:u="top-left"}=s,p=i.width(),g=i.height(),m=function(t){if(!t)return null;const e=la(t.naturalWidth,t.videoWidth,t.width),i=la(t.naturalHeight,t.videoHeight,t.height);return null==e||null==i?null:{width:e,height:i}}(e),{backgroundRepeatMode:f,backgroundSizing:y}=function({backgroundMode:t,backgroundFit:e,backgroundKeepAspectRatio:i}){const s=na[t];return s?{backgroundRepeatMode:"no-repeat",backgroundSizing:s}:{backgroundRepeatMode:t,backgroundSizing:aa({backgroundFit:e,backgroundKeepAspectRatio:i})}}({backgroundMode:n,backgroundFit:o,backgroundKeepAspectRatio:l});let v=p,b=g;if(p<=0||g<=0)return;if("no-repeat"===f){let s=null!==(r=null==m?void 0:m.width)&&void 0!==r?r:p,n=null!==(a=null==m?void 0:m.height)&&void 0!==a?a:g;if("cover"!==y&&"contain"!==y||!m)"fill"===y&&(s=p,n=g);else{const t="cover"===y?Math.max(p/m.width,g/m.height):Math.min(p/m.width,g/m.height);s=m.width*t,n=m.height*t}s*=h,n*=h;const{x:o,y:l}=function(t,e,i){const[s,r]=function(t){var e,i;if(Array.isArray(t))return[null!==(e=t[0])&&void 0!==e?e:"left",null!==(i=t[1])&&void 0!==i?i:"top"];const s=`${null!=t?t:"top-left"}`.trim().toLowerCase().replace(/-/g," ").split(/\s+/).filter(Boolean);if(0===s.length)return["left","top"];if(1===s.length){const t=s[0];return"center"===t?["center","center"]:ra.has(t)?["center",t]:[t,"center"]}let r,a;const n=[];for(let t=0;t<2;t++){const e=s[t];"left"!==e&&"right"!==e?"top"!==e&&"bottom"!==e?n.push(e):a=e:r=e}return null==r&&n.length&&(r=n.shift()),null==a&&n.length&&(a=n.shift()),[null!=r?r:"left",null!=a?a:"top"]}(t);return{x:oa(s,e,"left","center","right"),y:oa(r,i,"top","center","bottom")}}(u,p-s,g-n);return void t.drawImage(e,i.x1+o+c,i.y1+l+d,s,n)}if(o&&"repeat"!==f&&m){const i=m.width,s=m.height;"repeat-x"===f?(v=i*(g/s),b=g):"repeat-y"===f&&(b=s*(p/i),v=p);const r=t.dpr,a=Ci.allocate({width:v,height:b,dpr:r}),n=a.getContext("2d");n&&(n.inuse=!0,n.clearMatrix(),n.setTransformForCurrent(!0),n.clearRect(0,0,v,b),n.drawImage(e,0,0,v,b),e=a.nativeCanvas),Ci.free(a)}const x=t.dpr,_=t.createPattern(e,f);_.setTransform&&_.setTransform(new DOMMatrix([1/x,0,0,1/x,0,0])),t.fillStyle=_,t.translate(i.x1,i.y1),t.fillRect(0,0,p,g),t.translate(-i.x1,-i.y1)}(t,e,i,s)}};const ra=new Set(["top","center","bottom"]);function aa({backgroundFit:t,backgroundKeepAspectRatio:e}){return t?e?"cover":"fill":"auto"}const na={"no-repeat-cover":"cover","no-repeat-contain":"contain","no-repeat-fill":"fill","no-repeat-auto":"auto"};function oa(t,e,i,s,r){if("number"==typeof t&&Number.isFinite(t))return t;const a=`${null!=t?t:""}`.trim().toLowerCase();if(!a||a===i)return 0;if(a===s)return e/2;if(a===r)return e;if(function(t){return/^-?\d+(\.\d+)?%$/.test(t)}(a))return e*parseFloat(a)/100;const n=Number(a);return Number.isFinite(n)?n:0}function la(...t){for(const e of t)if("number"==typeof e&&Number.isFinite(e)&&e>0)return e;return null}const ha=new class{constructor(){this.time=Ft.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,r,a,n,o,l,h,c,d,u){var p,g;const{clipConfig:m}=t.attribute;if(!m)return;const f=t.getClipPath();if(!f)return;const y=!(c||d),v=t.AABBBounds,b=null!==(p=t.attribute.width)&&void 0!==p?p:v.width(),x=null!==(g=t.attribute.height)&&void 0!==g?g:v.height();y&&e.save(),e.beginPath(),!1===f.draw(e,[b,x],i+b/2,s+x/2,0)&&e.closePath(),c&&c(e,t.attribute,l,!0),y&&e.clip()}};const ca=new class{constructor(){this.time=Ft.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,r,a,n,o,l,h,c,d,u){const{clipConfig:p}=t.attribute;p&&t.getClipPath()&&(c||d||e.restore())}};const da=new class{constructor(){this.registry=new Map}create(t,e){const i=this.registry.get(t);if(!i)throw new Error(`GraphicFactory has no creator registered for type "${t}"`);return new i(e)}register(t,e){if(!t)throw new Error("GraphicFactory requires a non-empty graphic type");this.registry.set(t,e)}};const ua=new class{constructor(){this.store=new Map}registerStore(t,e){this.store.set(t,e),this[t]=e}RegisterGraphicCreator(t,e){pa(t,e)}CreateGraphic(t,e){return this.store.has(t)?function(t,e){return da.create(t,e)}(t,e):null}};function pa(t,e){if(!t)throw new Error("Graphic registration requires a non-empty graphic type");ua.registerStore(t,e),da.register(t,function(t){return class{constructor(e){try{return new t(e)}catch(i){return t(e)}}}}(e))}function ga(t,e,i){var s;const{x:r=i.x,y:a=i.y,z:n=i.z,dx:o=i.dx,dy:l=i.dy,dz:h=i.dz,scaleX:c=i.scaleX,scaleY:d=i.scaleY,scaleZ:u=i.scaleZ,alpha:p=i.alpha,beta:g=i.beta,angle:m=i.angle,anchor3d:f=e.attribute.anchor,anchor:y}=e.attribute,v=[0,0,0];if(f){if("string"==typeof f[0]){const t=parseFloat(f[0])/100,i=e.AABBBounds;v[0]=i.x1+(i.x2-i.x1)*t}else v[0]=f[0];if("string"==typeof f[1]){const t=parseFloat(f[1])/100,i=e.AABBBounds;v[1]=i.x1+(i.x2-i.x1)*t}else v[1]=f[1];v[2]=null!==(s=f[2])&&void 0!==s?s:0}if(hr(t),cr(t,t,[r+o,a+l,n+h]),cr(t,t,[v[0],v[1],v[2]]),function(t,e,i){const s=Math.sin(i),r=Math.cos(i),a=e[4],n=e[5],o=e[6],l=e[7],h=e[8],c=e[9],d=e[10],u=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*r+h*s,t[5]=n*r+c*s,t[6]=o*r+d*s,t[7]=l*r+u*s,t[8]=h*r-a*s,t[9]=c*r-n*s,t[10]=d*r-o*s,t[11]=u*r-l*s}(t,t,g),function(t,e,i){const s=Math.sin(i),r=Math.cos(i),a=e[0],n=e[1],o=e[2],l=e[3],h=e[8],c=e[9],d=e[10],u=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*r-h*s,t[1]=n*r-c*s,t[2]=o*r-d*s,t[3]=l*r-u*s,t[8]=a*s+h*r,t[9]=n*s+c*r,t[10]=o*s+d*r,t[11]=l*s+u*r}(t,t,p),cr(t,t,[-v[0],-v[1],v[2]]),function(t,e,i){const s=i[0],r=i[1],a=i[2];t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t[3]=e[3]*s,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[c,d,u]),m){const i=mr.allocate(),s=[0,0];if(y){if("string"==typeof f[0]){const t=parseFloat(f[0])/100,i=e.AABBBounds;s[0]=i.x1+(i.x2-i.x1)*t}else s[0]=f[0];if("string"==typeof f[1]){const t=parseFloat(f[1])/100,i=e.AABBBounds;s[1]=i.x1+(i.x2-i.x1)*t}else s[1]=f[1]}cr(i,i,[s[0],s[1],0]),function(t,e,i){const s=Math.sin(i),r=Math.cos(i),a=e[0],n=e[1],o=e[2],l=e[3],h=e[4],c=e[5],d=e[6],u=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*r+h*s,t[1]=n*r+c*s,t[2]=o*r+d*s,t[3]=l*r+u*s,t[4]=h*r-a*s,t[5]=c*r-n*s,t[6]=d*r-o*s,t[7]=u*r-l*s}(i,i,m),cr(i,i,[-s[0],-s[1],0]),dr(t,t,i)}}class ma{static registerPlugin(t,e){ma._pluginClasses[t]=e}static getPlugin(t){return ma._pluginClasses[t]}}ma._pluginClasses={};const fa=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","clipRange","cap",...Rr];class ya extends qr{constructor(t){super(t),this.type="arc",this.numberType=rr}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:i,innerRadius:s}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(s)}getParsedCornerRadius(){const t=this.getGraphicTheme(),{cornerRadius:e=t.cornerRadius,innerPadding:i=t.innerPadding,outerPadding:r=t.outerPadding}=this.attribute;let{outerRadius:a=t.outerRadius,innerRadius:n=t.innerRadius}=this.attribute;if(a+=r,n-=i,0===e||"0%"===e)return 0;const o=Math.abs(a-n),l=t=>Math.min(s.isNumber(t,!0)?t:o*parseFloat(t)/100,o/2);if(s.isArray(e)){const t=e.map((t=>l(t)||0));return 0===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:(3===t.length&&t.push(0),t)}return l(e)}getParsedAngle(){const t=this.getGraphicTheme();let{startAngle:e=t.startAngle,endAngle:i=t.endAngle}=this.attribute;const{cap:r=t.cap,clipRange:a=t.clipRange}=this.attribute,n=i-e>=0?1:-1;let o=i-e;if(o*=Math.max(0,Math.min(a,1)),e=s.clampAngleByRadian(e),i=e+o,r&&s.abs(o)>s.epsilon&&s.abs(o)<s.pi2-s.epsilon){let a=1,o=1;r.length&&(a=Number(r[0]),o=Number(r[1]));let{outerRadius:l=t.outerRadius,innerRadius:h=t.innerRadius}=this.attribute;const{outerPadding:c=t.outerPadding,innerPadding:d=t.innerPadding}=this.attribute;l+=c,h-=d;const u=Math.abs(l-h)/2,p=u/l;if(u>s.epsilon&&l>s.epsilon)return{startAngle:e-n*p*a,endAngle:i+n*p*o,sc:n*p*a,ec:n*p*o}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=this.getGraphicTheme(),{innerPadding:r=i.innerPadding,outerPadding:a=i.outerPadding,padAngle:n=i.padAngle}=this.attribute;let{outerRadius:o=i.outerRadius,innerRadius:l=i.innerRadius}=this.attribute;o+=a,l-=r;const{padRadius:h=s.sqrt(o*o+l*l)}=this.attribute,c=s.abs(e-t);let d=t,u=e,p=t,g=e;const m=n/2;let f=c,y=c;if(m>s.epsilon&&h>s.epsilon){const i=e>t?1:-1;let r=s.asin(Number(h)/l*s.sin(m)),a=s.asin(Number(h)/o*s.sin(m));return(f-=2*r)>s.epsilon?(r*=i,p+=r,g-=r):(f=0,p=g=(t+e)/2),(y-=2*a)>s.epsilon?(a*=i,d+=a,u-=a):(y=0,d=u=(t+e)/2),{outerStartAngle:d,outerEndAngle:u,innerStartAngle:p,innerEndAngle:g,innerDeltaAngle:f,outerDeltaAngle:y}}return{outerStartAngle:d,outerEndAngle:u,innerStartAngle:p,innerEndAngle:g,innerDeltaAngle:f,outerDeltaAngle:y}}getGraphicTheme(){return sa(this).arc}updateAABBBounds(t,e,i,s){this.updatePathProxyAABBBounds(i)||(s?this.updateArcAABBBoundsImprecise(t,e,i):this.updateArcAABBBoundsAccurate(t,e,i));const{tb1:r,tb2:a}=yt.graphicService.updateTempAABBBounds(i);((t,e,i)=>{const{outerBorder:s,shadowBlur:r=e.shadowBlur}=t;if(s){const t=e.outerBorder,{distance:a=t.distance,lineWidth:n=t.lineWidth}=s;i.expand(a+(r+n)/2)}})(t,e,r),i.union(r),r.setValue(a.x1,a.y1,a.x2,a.y2),this.setWidthHeightWithoutTransform(i);const{lineJoin:n=e.lineJoin}=t;return yt.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updateArcAABBBoundsImprecise(t,e,i){let{outerRadius:s=e.outerRadius,innerRadius:r=e.innerRadius}=t;const{outerPadding:a=e.outerPadding,innerPadding:n=e.innerPadding}=t;return s+=a,r-=n,s<r&&(s=r),i.set(-s,-s,s,s),i}updateArcAABBBoundsAccurate(t,e,i){let{outerRadius:r=e.outerRadius,innerRadius:a=e.innerRadius}=t;const{outerPadding:n=e.outerPadding,innerPadding:o=e.innerPadding}=t;if(r+=n,a-=o,r<a){const t=r;r=a,a=t}let{endAngle:l=e.endAngle,startAngle:h=e.startAngle}=t;if(h>l){const t=h;h=l,l=t}return r<=s.epsilon?i.set(0,0,0,0):Math.abs(l-h)>s.pi2-s.epsilon?i.set(-r,-r,r,r):(Ri(h,l,r,i),Ri(h,l,a,i)),i}needUpdateTags(t){return super.needUpdateTags(t,fa)}needUpdateTag(t){return super.needUpdateTag(t,fa)}toCustomPath(){var t,e,i,r;let a=super.toCustomPath();if(a)return a;const n=this.attribute,{startAngle:o,endAngle:l}=this.getParsedAngle();let h=(null!==(t=n.innerRadius)&&void 0!==t?t:0)-(null!==(e=n.innerPadding)&&void 0!==e?e:0),c=(null!==(i=n.outerRadius)&&void 0!==i?i:0)-(null!==(r=n.outerPadding)&&void 0!==r?r:0);const d=s.abs(l-o),u=l>o;if(c<h){const t=c;c=h,h=t}if(a=new Te,c<=s.epsilon)a.moveTo(0,0);else if(d>=s.pi2-s.epsilon)a.moveTo(0+c*s.cos(o),0+c*s.sin(o)),a.arc(0,0,c,o,l,!u),h>s.epsilon&&(a.moveTo(0+h*s.cos(l),0+h*s.sin(l)),a.arc(0,0,h,l,o,u));else{const t=c*s.cos(o),e=c*s.sin(o),i=h*s.cos(l),r=h*s.sin(l);a.moveTo(0+t,0+e),a.arc(0,0,c,o,l,!u),a.lineTo(0+i,0+r),a.arc(0,0,h,l,o,u),a.closePath()}return a}clone(){return new ya(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return ya.NOWORK_ANIMATE_ATTR}}ya.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Kr);class va extends ya{constructor(t){super(t),this.type="arc3d",this.numberType=ar}updateAABBBounds(t,e,i){const s=this.stage;if(!s||!s.camera)return i;const{outerRadius:r=e.outerRadius,height:a=0}=t,n=r+a;return i.setValue(-n,-n,n,n),yt.graphicService.updateTempAABBBounds(i),yt.graphicService.transformAABBBounds(t,i,e,!1,this),i}getNoWorkAnimateAttr(){return va.NOWORK_ANIMATE_ATTR}}function ba(t){return new va(t)}function xa(t,e){return!(!t&&!e)}function _a(t,e){let i;return i=s.isArray(t)?t.some((t=>t||void 0===t)):!!t,i&&e>0}function Sa(t,e,i){return i&&t*e>0}function Aa(t,e){return t*e>0}va.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Kr);const Ta=Symbol.for("Arc3dRender"),Ca=Symbol.for("GraphicRender");class Ma{constructor(t){this.record=t}to(t){return this.record.implementationType="constructor",this.record.implementationConstructor=t,this.record.cached=!1,this.record.cachedValue=void 0,this}toSelf(){return this.to(this.record.serviceIdentifier)}toDynamicValue(t){return this.record.implementationType="dynamic",this.record.implementationFactory=t,this.record.cached=!1,this.record.cachedValue=void 0,this}toConstantValue(t){return this.record.implementationType="constant",this.record.implementationValue=t,this.record.cached=!0,this.record.cachedValue=t,this}toService(t){return this.record.implementationType="service",this.record.linkedServiceIdentifier=t,this.record.cached=!1,this.record.cachedValue=void 0,this}inSingletonScope(){return this.record.scope="singleton",this}whenTargetNamed(t){return this.record.named=t,this}}class ka{constructor(){this.bindings=new Map,this.bind=t=>{const e={serviceIdentifier:t,scope:"transient",cached:!1},i=this.bindings.get(t);return i?i.push(e):this.bindings.set(t,[e]),new Ma(e)},this.rebind=t=>(this.bindings.delete(t),this.bind(t)),this.isBound=t=>{var e,i;return(null!==(i=null===(e=this.bindings.get(t))||void 0===e?void 0:e.length)&&void 0!==i?i:0)>0},this.getAll=t=>{const e=this.bindings.get(t);return(null==e?void 0:e.length)?e.map((t=>this.resolveBinding(t))).filter((t=>void 0!==t)):[]},this.getNamed=(t,e)=>{const i=this.bindings.get(t);if(!(null==i?void 0:i.length))return;const s=i.find((t=>t.named===e));return s?this.resolveBinding(s):void 0}}resolveBinding(t){var e;if("singleton"===t.scope&&t.cached)return t.cachedValue;let i;switch(t.implementationType){case"constant":i=t.implementationValue;break;case"constructor":i=t.implementationConstructor?new t.implementationConstructor:void 0;break;case"dynamic":i=null===(e=t.implementationFactory)||void 0===e?void 0:e.call(t,{container:this});break;case"service":t.linkedServiceIdentifier&&([i]=this.getAll(t.linkedServiceIdentifier));break;default:i=void 0}return"singleton"===t.scope&&(t.cached=!0,t.cachedValue=i),i}}const wa=new ka;const Pa={x:0,y:0,z:0,lastModelMatrix:null};class Oa{init(t){this.builtinContributions||(this.builtinContributions=[]),this._renderContribitions=t?t.getContributions().slice():[];const e=t=>{this._renderContribitions.includes(t)||this._renderContribitions.push(t)};this.builtinContributions.forEach(e),e(ha),e(ca),this._renderContribitions.length?(this._renderContribitions.sort(((t,e)=>e.order-t.order)),this._beforeRenderContribitions=this._renderContribitions.filter((t=>t.time===Ft.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===Ft.afterFillStroke))):(this._beforeRenderContribitions=[],this._afterRenderContribitions=[])}reInit(){this.init(this.graphicRenderContributions)}beforeRenderStep(t,e,i,s,r,a,n,o,l,h,c,d,u){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,s,r,a,n,o,l,h,c,d,u)}))}afterRenderStep(t,e,i,s,r,a,n,o,l,h,c,d,u){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,s,r,a,n,o,l,h,c,d,u)}))}drawPathProxy(t,e,i,s,r,a,n,o){if(!t.pathProxy)return!1;const l=sa(t,null==a?void 0:a.theme)[t.type.replace("3d","")],{fill:h=l.fill,stroke:c=l.stroke,opacity:d=l.opacity,fillOpacity:u=l.fillOpacity,lineWidth:p=l.lineWidth,strokeOpacity:g=l.strokeOpacity,visible:m=l.visible,x:f=l.x,y:y=l.y}=t.attribute,v=Sa(d,u,h),b=Aa(d,g),x=xa(h),_=_a(c,p);if(!m)return!0;if(!x&&!_)return!0;if(!(v||b||n||o))return!0;e.beginPath();return jt(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,s),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,x,_,v,b,l,r,n,o),_&&(o?o(e,t.attribute,l):b&&(e.setStrokeStyle(t,t.attribute,i-f,s-y,l),e.stroke())),x&&(n?n(e,t.attribute,l):v&&(e.setCommonStyle(t,t.attribute,i-f,s-y,l),e.fill())),this.afterRenderStep(t,e,i,s,x,_,v,b,l,r,n,o),!0}valid(t,e,i,s){const{fill:r=e.fill,background:a,stroke:n=e.stroke,opacity:o=e.opacity,fillOpacity:l=e.fillOpacity,lineWidth:h=e.lineWidth,strokeOpacity:c=e.strokeOpacity,visible:d=e.visible}=t.attribute,u=Sa(o,l,r),p=Aa(o,c),g=xa(r,a),m=_a(n,h);return!(!t.valid||!d)&&!(!g&&!m)&&!!(u||p||i||s||a)&&{fVisible:u,sVisible:p,doFill:g,doStroke:m}}transform(t,e,i,s=!1){const{x:r=e.x,y:a=e.y,z:n=e.z,scaleX:o=e.scaleX,scaleY:l=e.scaleY,angle:h=e.angle,postMatrix:c}=t.attribute,d=i.modelMatrix,u=i.camera;Pa.x=r,Pa.y=a,Pa.z=n,Pa.lastModelMatrix=d;const p=u&&(s||function(t){const{alpha:e,beta:i}=t.attribute;return e||i}(t)),g=p?t.transMatrix.onlyTranslate()&&!c:1===o&&1===l&&0===h&&!c;if(p){const s=mr.allocate(),r=mr.allocate();ga(r,t,e),dr(s,d||s,r),Pa.x=0,Pa.y=0,Pa.z=0,i.modelMatrix=s,i.setTransform(1,0,0,1,0,0,!0),mr.free(r)}if(g&&!d){const s=t.getOffsetXY(e);Pa.x+=s.x,Pa.y+=s.y,Pa.z=n,i.setTransformForCurrent()}else if(p)Pa.x=0,Pa.y=0,Pa.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(u&&i.project){const s=t.getOffsetXY(e);Pa.x+=s.x,Pa.y+=s.y,this.transformWithoutTranslate(i,Pa.x,Pa.y,Pa.z,o,l,h)}else i.transformFromMatrix(t.transMatrix,!0),Pa.x=0,Pa.y=0,Pa.z=0;return Pa}transformUseContext2d(t,e,i,s){const r=s.camera;if(this.camera=r,r){const e=t.AABBBounds,r=e.x2-e.x1,a=e.y2-e.y1,n=s.project(0,0,i),o=s.project(r,0,i),l=s.project(r,a,i),h={x:0,y:0},c={x:r,y:0},d={x:r,y:a};s.camera=null;const u=1/(h.x*(d.y-c.y)-c.x*d.y+d.x*c.y+(c.x-d.x)*h.y),p=-(h.y*(l.x-o.x)-c.y*l.x+d.y*o.x+(c.y-d.y)*n.x)*u,g=(c.y*l.y+h.y*(o.y-l.y)-d.y*o.y+(d.y-c.y)*n.y)*u,m=(h.x*(l.x-o.x)-c.x*l.x+d.x*o.x+(c.x-d.x)*n.x)*u,f=-(c.x*l.y+h.x*(o.y-l.y)-d.x*o.y+(d.x-c.x)*n.y)*u,y=(h.x*(d.y*o.x-c.y*l.x)+h.y*(c.x*l.x-d.x*o.x)+(d.x*c.y-c.x*d.y)*n.x)*u,v=(h.x*(d.y*o.y-c.y*l.y)+h.y*(c.x*l.y-d.x*o.y)+(d.x*c.y-c.x*d.y)*n.y)*u;s.setTransform(p,g,m,f,y,v,!0)}}restoreTransformUseContext2d(t,e,i,s){this.camera&&(s.camera=this.camera)}transformWithoutTranslate(t,e,i,s,r,a,n){const o=t.project(e,i,s);t.translate(o.x,o.y,!1),t.scale(r,a,!1),t.rotate(n,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}_draw(t,e,i,s,r,a){const{context:n}=s;if(!n)return;const{renderable:o}=t.attribute;if(!1===o)return;n.highPerformanceSave();const l=this.transform(t,e,n,i),{x:h,y:c,z:d,lastModelMatrix:u}=l;this.z=d,this.drawPathProxy(t,n,h,c,s,r)||(this.drawShape(t,n,h,c,s,r,null,null,a),this.z=0,n.modelMatrix!==u&&mr.free(n.modelMatrix),n.modelMatrix=u),n.highPerformanceRestore()}}class Ba extends Oa{constructor(){super(...arguments),this.numberType=ar}drawShape(t,e,i,r,a,n,o,l){var h;const c=sa(t,null==n?void 0:n.theme).arc,{fill:d=c.fill}=t.attribute,u=this.valid(t,c,o,l);if(!u)return;const{fVisible:p,sVisible:g,doFill:m,doStroke:f}=u,y=null!==(h=this.z)&&void 0!==h?h:0,{outerPadding:v=c.outerPadding,innerPadding:b=c.innerPadding,height:x=10}=t.attribute;let{outerRadius:_=c.outerRadius,innerRadius:S=c.innerRadius}=t.attribute;_+=v,S-=b;const A=xr.Get(d,br.Color255),{light:T}=a.stage||{},C=a.hack_pieFace,M={top:y,bottom:y+x},k={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===C||"top"===C?(e.beginPath(),function(t,e,i,r,a,n,o){const{startAngle:l,endAngle:h}=t.getParsedAngle(),c=s.abs(h-l),d=h>l;let u=!1;if(n<o){const t=n;n=o,o=t}if(n<=s.epsilon)e.moveTo(i,r,a);else if(c>=s.pi2-s.epsilon)e.moveTo(i+n*s.cos(l),r+n*s.sin(l),a),e.arc(i,r,n,l,h,!d,a),o>s.epsilon&&(e.moveTo(i+o*s.cos(h),r+o*s.sin(h),a),e.arc(i,r,o,h,l,d,a));else{const{outerDeltaAngle:c,innerDeltaAngle:p,outerStartAngle:g,outerEndAngle:m,innerEndAngle:f,innerStartAngle:y}=t.getParsePadAngle(l,h),v=n*s.cos(g),b=n*s.sin(g),x=o*s.cos(f),_=o*s.sin(f);c<.001?u=!0:(e.moveTo(i+v,r+b,a),e.arc(i,r,n,g,m,!d,a)),!(o>s.epsilon)||p<.001?(e.lineTo(i+x,r+_,a),u=!0):(e.lineTo(i+x,r+_,a),e.arc(i,r,o,f,y,d,a))}e.closePath()}(t,e,i,r,M[C],_,S),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,c),m&&(o?o(e,t.attribute,c):p&&(e.setCommonStyle(t,t.attribute,i,r,c),e.fillStyle=T?T.computeColor(k[C],A):d,e.fill())),f&&(l?l(e,t.attribute,c):g&&(e.setStrokeStyle(t,t.attribute,i,r,c),e.stroke()))):"outside"!==C&&"inside"!==C||("inside"===C&&(e.save(),e.beginPath(),e.arc(i,r,S,0,s.pi2,!0,M.top),e.clip()),e.beginPath(),function(t,e,i,r,a,n,o,l){const{startAngle:h,endAngle:c}=t.getParsedAngle(),d=s.abs(c-h),u=c>h;let p=!1;if(o<=s.epsilon)e.moveTo(i,r,a);else if(d>=s.pi2-s.epsilon)e.moveTo(i+o*s.cos(h),r+o*s.sin(h),a),e.arc(i,r,o,h,c,!u,a),e.lineTo(i+o*s.cos(c),r+o*s.sin(c),n),e.arc(i,r,o,c,h,u,n);else{const{innerouterDeltaAngle:t,innerouterStartAngle:d,innerouterEndAngle:g}=l(h,c),m=o*s.cos(d),f=o*s.sin(d),y=o*s.cos(g),v=o*s.sin(g);t<.001?p=!0:(e.moveTo(i+m,r+f,a),e.arc(i,r,o,d,g,!u,a),e.lineTo(i+y,r+v,n),e.arc(i,r,o,g,d,u,n))}e.closePath()}(t,e,i,r,M.top,M.bottom,"outside"===C?_:S,((e,i)=>{const{outerDeltaAngle:s,innerDeltaAngle:r,outerStartAngle:a,outerEndAngle:n,innerEndAngle:o,innerStartAngle:l}=t.getParsePadAngle(e,i);return"outside"===C?{innerouterDeltaAngle:s,innerouterEndAngle:n,innerouterStartAngle:a}:{innerouterDeltaAngle:r,innerouterEndAngle:o,innerouterStartAngle:l}})),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,c),m&&(o?o(e,t.attribute,c):p&&(e.setCommonStyle(t,t.attribute,i,r,c),e.fillStyle=T?T.computeColor(k[C],A):d,e.fill())),f&&(l?l(e,t.attribute,c):g&&(e.setStrokeStyle(t,t.attribute,i,r,c),e.stroke())),"inside"===C&&e.restore())}draw(t,e,i,s){const r=sa(t,null==s?void 0:s.theme).arc;this._draw(t,r,!1,i,s)}}const La=new WeakSet;const Ea=function({bind:t}){(function(t,e){const i="object"==typeof e&&null!==e||"function"==typeof e?e:t;return!!t.has(i)||(t.add(i),!1)})(La,t)||(t(Ba).toDynamicValue((()=>new Ba)).inSingletonScope(),t(Ta).toService(Ba),t(Ca).toService(Ta))};class Da{constructor(t,e,i=.8){this.dir=t,this.color=e,this.colorRgb=xr.Get(e,br.Color1),this.ambient=i;const r=s.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this.formatedDir=[t[0]/r,t[1]/r,t[2]/r]}computeColor(t,e){const i=this.formatedDir,r=s.min(s.max((t[0]*i[0]+t[1]*i[1]+t[2]*i[2])*(1-this.ambient/2),0)+this.ambient,1);let a;a=s.isString(e)?xr.Get(e,br.Color1):e;const n=this.colorRgb;return`rgb(${n[0]*a[0]*r}, ${n[1]*a[1]*r}, ${n[2]*a[2]*r})`}}class Fa{set params(t){this._params=Object.assign({},t),this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}get params(){return Object.assign({},this._params)}constructor(t){this.params=t}getViewMatrix(){return this._viewMatrixCached||(this._viewMatrixCached=mr.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=mr.allocate());const{pos:t,center:e,up:i}=this.params.viewParams;return function(t,e,i,r){let a,n,o,l,h,c,d,u,p,g;const m=e[0],f=e[1],y=e[2],v=r[0],b=r[1],x=r[2],_=i[0],S=i[1],A=i[2];Math.abs(m-_)<s.epsilon&&Math.abs(f-S)<s.epsilon&&Math.abs(y-A)<s.epsilon?hr(t):(d=m-_,u=f-S,p=y-A,g=1/Math.hypot(d,u,p),d*=g,u*=g,p*=g,a=b*p-x*u,n=x*d-v*p,o=v*u-b*d,g=Math.hypot(a,n,o),g?(g=1/g,a*=g,n*=g,o*=g):(a=0,n=0,o=0),l=u*o-p*n,h=p*a-d*o,c=d*n-u*a,g=Math.hypot(l,h,c),g?(g=1/g,l*=g,h*=g,c*=g):(l=0,h=0,c=0),t[0]=a,t[1]=l,t[2]=d,t[3]=0,t[4]=n,t[5]=h,t[6]=u,t[7]=0,t[8]=o,t[9]=c,t[10]=p,t[11]=0,t[12]=-(a*m+n*f+o*y),t[13]=-(l*m+h*f+c*y),t[14]=-(d*m+u*f+p*y),t[15]=1)}(this._viewMatrixCached,t,e,i),this._vp||(this._vp=mr.allocate()),this._vp=dr(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}getProjectionMatrix(){return this._projectionMatrixCached||(this._projectionMatrixCached=mr.allocate()),this._projectionMatrixCached}forceGetProjectionMatrix(){this._projectionMatrixCached||(this._projectionMatrixCached=mr.allocate());const{left:t,top:e,right:i,bottom:s}=this._params;return function(t,e,i,s,r,a,n){const o=1/(e-i),l=1/(s-r),h=1/(a-n);t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+i)*o,t[13]=(r+s)*l,t[14]=(n+a)*h,t[15]=1}(this._projectionMatrixCached,t,i,s,e,0,-2e6),this._vp||(this._vp=mr.allocate()),this._vp=dr(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}getField(){const{fieldRatio:t=.8,fieldDepth:e,left:i,right:s}=this._params;return(null!=e?e:s-i)*t}getProjectionScale(t){const e=this.getField();return e/(e+t)}view(t,e,i){const s=[0,0,0];return ur(s,[t,e,i],this._viewMatrixCached),s}vp(t,e,i){const s=[0,0,0],{pos:r}=this._params.viewParams;ur(s,[t,e,i],this._viewMatrixCached),t=s[0],e=s[1],i=s[2];const a=this.getProjectionScale(i);return{x:t*a+r[0],y:e*a+r[1]}}}const Ia=Symbol.for("CanvasArc3dPicker"),Ra=Symbol.for("CanvasPickerContribution");class Na extends i.BaseRender{contains(t,e,s){const{pickContext:r}=null!=s?s:{};if(!r)return!1;const a=t.getGraphicTheme();r.highPerformanceSave();const n=this.transform(t,a,r),{x:o,y:l,z:h,lastModelMatrix:c}=n;let d=e;if(r.camera){d=e.clone();const i=t.parent.globalTransMatrix;d.x=i.a*e.x+i.c*e.y+i.e,d.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,r,o,l,s,null,((t,e,i)=>!!u||(u=t.isPointInPath(d.x,d.y),u))),this.canvasRenderer.z=0,r.modelMatrix!==c&&i.mat4Allocate.free(r.modelMatrix),r.modelMatrix=c,r.highPerformanceRestore(),u}}class ja extends Na{constructor(t){super(),this.canvasRenderer=t,this.type="arc3d",this.numberType=i.ARC3D_NUMBER_TYPE,this.themeType="arc"}}let Ua=!1;function za(t){var e;Ua||(null===(e=t.isBound)||void 0===e?void 0:e.call(t,Ta))&&(Ua=!0,t.bind(Ia).toDynamicValue((()=>new ja(function(t,e){const[i]=t.getAll(e);if(null==i)throw new Error(`No binding found for ${String(e)}.`);return i}(t,Ta)))).inSingletonScope(),t.bind(Ra).toService(Ia))}function Va(){if(Va.__loaded)return;Va.__loaded=!0;const t=wa;pa("arc3d",ba),ma.registerPlugin("DirectionalLight",Da),ma.registerPlugin("OrthoCamera",Fa),Ea({bind:t.bind}),za(t)}Va.__loaded=!1;const Ga=Va;class Wa extends e.BaseArcMark{setDataLabelType(){return"arc"}constructor(t,e){super(t,e),this.type=Wa.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}Wa.type="arc3d";const Ha=Object.assign(Object.assign({},e.baseSeriesMark),{pie3d:{name:"pie3d",type:"arc3d"},labelLine:{name:"labelLine",type:"path"}});class $a extends e.PieSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"pie3d")}}class Xa extends e.BasePieSeries{constructor(){super(...arguments),this.type=$.pie3d,this._pieMarkName="pie3d",this._pieMarkType="arc3d",this.transformerConstructor=$a}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this._angle3d=null!==(e=null===(t=this._spec)||void 0===t?void 0:t.angle3d)&&void 0!==e?e:-Math.PI/3}initMarkStyle(){super.initMarkStyle();const t=this._pieMark;t&&this.setMarkStyle(t,{beta:()=>this._angle3d},"normal",e.AttributeLevel.Series)}initLabelMarkStyle(t,i={}){t&&(super.initLabelMarkStyle(t),this.setMarkStyle(t,{support3d:!0},void 0,e.AttributeLevel.Mark))}}Xa.type=$.pie3d,Xa.mark=Ha,Xa.builtInTheme={pie3d:{outerRadius:.6,pie3d:{style:{height:10,fillOpacity:1}},label:{visible:!1,interactive:!0,position:"outside"}}},Xa.transformerConstructor=$a;const Ya=()=>{e.Factory.registerAnimation("pie3d",((t,i)=>({appear:e.piePresetAnimation(t,i),enter:e.pieEnter(t),exit:e.pieExit(t),disappear:e.pieDisappear(t)}))),e.registerArcAnimation(),e.registerShadowRoot(),Ga(),e.Factory.registerGraphicComponent("arc3d",e.createArc3d),e.Factory.registerMark("arc3d",Wa),e.Factory.registerSeries(Xa.type,Xa)};class Ka extends e.BasePieChart{constructor(){super(...arguments),this.transformerConstructor=mt,this.type="pie3d",this.seriesType=$.pie3d}}Ka.type="pie3d",Ka.seriesType=$.pie3d,Ka.transformerConstructor=mt;const qa="combinationCandlestick";class Za extends e.CartesianChartSpecTransformer{_getDefaultSeriesSpec(t){const e=[t.openField,t.highField,t.lowField,t.closeField],i=super._getDefaultSeriesSpec(t,["candlestick","openField","highField","lowField","closeField","rising","falling","doji"]);return i.yField=e,i}transformSpec(t){super.transformSpec(t),t.axes||(t.axes=[{orient:"bottom"},{orient:"left"}]),e.setDefaultCrosshairForCartesianChart(t)}}class Qa extends e.GlyphMark{constructor(){super(...arguments),this.type=Qa.type}setGlyphConfig(t){super.setGlyphConfig(t),this._subMarks={line:{type:"line",defaultAttributes:{x:0,y:0}},box:{type:"rect"}},this._positionChannels=["x","boxWidth","open","close","high","low"],this._channelEncoder=null,this._positionEncoder=(t,e,i)=>{const{x:s=i.attribute.x,boxWidth:r=i.attribute.boxWidth,open:a=i.attribute.open,close:n=i.attribute.close,low:o=i.attribute.low,high:l=i.attribute.high}=t,h={};return h.line={points:[{x:s,y:o},{x:s,y:l}]},h.box={x:s-r/2,x1:s+r/2,y:Math.min(a,n),y1:Math.max(a,n),drawStrokeWhenZeroWH:!0},h}}_getDefaultStyle(){return Object.assign({},super._getDefaultStyle())}}Qa.type="candlestick";class Ja extends e.ACustomAnimate{constructor(t,e,i,s,r){super(t,e,i,s,r)}onBind(){super.onBind();const t=this.target.getFinalAttribute();t&&this.target.setAttributes(t);const{from:e,to:i}=this.computeAttribute();this.propKeys=Object.keys(i).filter((t=>null!=i[t])),this.animate.reSyncProps(),this.from=e,this.to=i,this.target.setAttributes(this.from)}computeAttribute(){const t=(t=>{const i=t.getFinalAttribute(),{x:s,y:r,open:a,high:n,low:o,close:l}=i,h={from:{x:s,y:r},to:{x:s,y:r}};return e.isValidNumber(a)&&e.isValidNumber(l)&&(a>l?(h.from.open=o,h.to.open=a,h.from.close=o,h.to.close=l,e.isValidNumber(n)&&(h.from.high=o,h.to.high=n)):(h.from.open=n,h.to.open=a,h.from.close=n,h.to.close=l,e.isValidNumber(o)&&(h.from.low=n,h.to.low=o))),h})(this.target,this.params,this.params.options);return t}onUpdate(t,e,i){const s=this.target.attribute;this.propKeys.forEach((t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e})),this.target.setAttributes(s)}}class tn extends e.ACustomAnimate{constructor(t,e,i,s,r){super(t,e,i,s,r)}onBind(){var t;(null===(t=this.params)||void 0===t?void 0:t.diffAttrs)&&this.target.setAttributes(this.params.diffAttrs);const{from:e,to:i}=this.computeAttribute();this.propKeys=Object.keys(i).filter((t=>null!=i[t])),this.animate.reSyncProps(),this.from=e,this.to=i,this.target.setAttributes(this.from)}computeAttribute(){const t=(t=>{const i=t.getFinalAttribute(),{x:s,y:r,open:a,high:n,low:o,close:l}=i,h={from:{x:s,y:r},to:{x:s,y:r}};return e.isValidNumber(a)&&e.isValidNumber(l)&&(a>l?(h.from.open=a,h.to.open=o,h.from.close=l,h.to.close=o,e.isValidNumber(n)&&(h.from.high=n,h.to.high=o)):(h.from.open=a,h.to.open=n,h.from.close=l,h.to.close=n,e.isValidNumber(o)&&(h.from.low=o,h.to.low=n))),h})(this.target,this.params,this.params.options);return t}onUpdate(t,e,i){const s=this.target.attribute;this.propKeys.forEach((t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e})),this.target.setAttributes(s)}}const en="candlestick";var sn,rn;!function(t){t.OPEN="open",t.HIGH="high",t.LOW="low",t.CLOSE="close",t.SERIES_FIELD="seriesField"}(sn||(sn={})),function(t){t.candlestick="candlestick"}(rn||(rn={}));const an=Object.assign(Object.assign({},e.baseSeriesMark),{candlestick:{name:"candlestick",type:"candlestick"}});class nn extends e.BaseSeriesTooltipHelper{constructor(){super(...arguments),this.getContentKey=t=>e=>{switch(t){case sn.OPEN:return this.series.getOpenField();case sn.HIGH:return this.series.getHighField();case sn.LOW:return this.series.getLowField();case sn.CLOSE:return this.series.getCloseField();case sn.SERIES_FIELD:return this.series.getSeriesField()}return null},this.getContentValue=t=>e=>{switch(t){case sn.OPEN:return e[this.series.getOpenField()];case sn.HIGH:return e[this.series.getHighField()];case sn.LOW:return e[this.series.getLowField()];case sn.CLOSE:return e[this.series.getCloseField()];case sn.SERIES_FIELD:return e[this.series.getSeriesField()]}return null},this.shapeColorCallback=t=>this.series.getMarkInName("candlestick").getAttribute("stroke",t)}getDefaultContentList(t){return[{key:this.getContentKey(sn.OPEN),value:this.getContentValue(sn.OPEN)},{key:this.getContentKey(sn.HIGH),value:this.getContentValue(sn.HIGH)},{key:this.getContentKey(sn.LOW),value:this.getContentValue(sn.LOW)},{key:this.getContentKey(sn.CLOSE),value:this.getContentValue(sn.CLOSE)},{key:this.getContentKey(sn.SERIES_FIELD),value:this.getContentValue(sn.SERIES_FIELD)}]}}const on={rising:{style:{boxFill:"#FF0000",stroke:"#FF0000"}},falling:{style:{boxFill:"#00AA00",stroke:"#00AA00"}},doji:{style:{boxFill:"#000000",stroke:"#000000"}},candlestick:{style:{lineWidth:1}}};class ln extends e.CartesianSeries{constructor(){super(...arguments),this.type=en,this._mergedStyles={rising:{},falling:{},doji:{}}}getOpenField(){return this._openField}getHighField(){return this._highField}getLowField(){return this._lowField}getCloseField(){return this._closeField}getBoxFill(){return this._boxFill}getStrokeColor(){return this._strokeColor}setAttrFromSpec(){var t,e,i,s,r,a,n,o;super.setAttrFromSpec();const l=this._spec,h=null!==(e=null===(t=l.candlestick)||void 0===t?void 0:t.style)&&void 0!==e?e:{};this._openField=l.openField,this._highField=l.highField,this._lowField=l.lowField,this._closeField=l.closeField,this._boxWidth=h.boxWidth,this._boxFill=h.boxFill,this._strokeColor=h.strokeColor,this._buildMergedStyles(h,null!==(s=null===(i=l.rising)||void 0===i?void 0:i.style)&&void 0!==s?s:{},null!==(a=null===(r=l.falling)||void 0===r?void 0:r.style)&&void 0!==a?a:{},null!==(o=null===(n=l.doji)||void 0===n?void 0:n.style)&&void 0!==o?o:{})}initMark(){this._candlestickMark=this._createMark(ln.mark.candlestick,{groupKey:this._seriesField,isSeriesMark:!0})}initMarkStyle(){var t;const i=this._candlestickMark;if(i){const s={fill:t=>this.mergeStyle(t).boxFill,stroke:t=>this.mergeStyle(t).stroke,lineWidth:t=>this.mergeStyle(t).lineWidth,boxWidth:null!==(t=this._boxWidth)&&void 0!==t?t:this._getMarkWidth.bind(this),x:this.dataToPositionX.bind(this)};i.setGlyphConfig({}),this.setMarkStyle(i,s,e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series)}}initCandlestickMarkStyle(){var t;const i=this._candlestickMark,s=this._yAxisHelper;if(i&&s){const{dataToPosition:r}=s,a=null===(t=null==s?void 0:s.getScale)||void 0===t?void 0:t.call(s,0);this.setMarkStyle(i,{open:t=>e.valueInScaleRange(r(this.getDatumPositionValues(t,this._openField),{bandPosition:this._bandPosition}),a),high:t=>e.valueInScaleRange(r(this.getDatumPositionValues(t,this._highField),{bandPosition:this._bandPosition}),a),low:t=>e.valueInScaleRange(r(this.getDatumPositionValues(t,this._lowField),{bandPosition:this._bandPosition}),a),close:t=>e.valueInScaleRange(r(this.getDatumPositionValues(t,this._closeField),{bandPosition:this._bandPosition}),a)},e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series)}}init(t){super.init(t),this.initCandlestickMarkStyle()}_initAnimationSpec(t={}){const i=e.merge({},t);return["appear","enter","update","exit","disappear"].forEach((t=>{i[t]&&"scaleIn"===i[t].type?i[t].type="candlestickScaleIn":i[t]&&"scaleOut"===i[t].type&&(i[t].type="candlestickScaleOut")})),i}initAnimation(){var t;const i=e.getGroupAnimationParams(this);if(this._candlestickMark){const s=this._initAnimationSpec(null===(t=e.Factory.getAnimationInKey("scaleInOut"))||void 0===t?void 0:t()),r=this._initAnimationSpec(e.userAnimationConfig(en,this._spec,this._markAttributeContext));this._candlestickMark.setAnimationConfig(e.animationConfig(s,r,i))}}initTooltip(){this._tooltipHelper=new nn(this),this._candlestickMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._candlestickMark)}_buildMergedStyles(t,i,s,r){this._mergedStyles.rising=e.merge({},t,i),this._mergedStyles.falling=e.merge({},t,s),this._mergedStyles.doji=e.merge({},t,r)}mergeStyle(t){const e=this.getDatumPositionValues(t,this._openField)[0],i=this.getDatumPositionValues(t,this._closeField)[0];return e<i?this._mergedStyles.rising:e>i?this._mergedStyles.falling:this._mergedStyles.doji}_getMarkWidth(){if(this._autoBoxWidth)return this._autoBoxWidth;const t=this._xAxisHelper,e=this._fieldX,i=t.getBandwidth(e.length-1)/e.length;return this._autoBoxWidth=i,this._autoBoxWidth}onLayoutEnd(){super.onLayoutEnd(),this._autoBoxWidth=null}getActiveMarks(){return[this._candlestickMark]}}ln.type=en,ln.builtInTheme={candlestick:on},ln.mark=an;const hn=()=>{e.registerGlyphMark(),e.registerLine(),e.registerRect(),e.Factory.registerGraphicComponent("line",(t=>e.createLine(t))),e.Factory.registerGraphicComponent("rect",(t=>e.createRect(t))),e.Factory.registerMark(Qa.type,Qa),e.registerSymbolMark(),e.registerScaleInOutAnimation(),e.registerCartesianBandAxis(),e.registerCartesianLinearAxis(),e.AnimateExecutor.registerBuiltInAnimate("candlestickScaleIn",Ja),e.AnimateExecutor.registerBuiltInAnimate("candlestickScaleOut",tn),e.Factory.registerSeries(ln.type,ln)};class cn extends e.BaseChart{_setModelOption(){this._modelOption.getDimensionInfo=e.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=e.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=e.getCartesianCrosshairRect}}cn.type="candlestick",cn.seriesType=en,cn.transformerConstructor=Za;function dn(t){t.yField=[t.openField,t.highField,t.lowField,t.closeField]}class un extends e.CartesianChartSpecTransformer{needAxes(){return!0}transformSpec(t){this.transformRegion(t),void 0===t.tooltip&&(t.tooltip={}),this.transformSeriesSpec(t),this._transformAxisSpec(t),this._transformLayout(t)}transformRegion(t){var e,i;const s=t;s.region=[null!==(e=t.candlestickRegion)&&void 0!==e?e:{}],t.previewSeries&&s.region.push(null!==(i=t.previewRegion)&&void 0!==i?i:{})}transformSeriesSpec(t){var i;t.series=null!==(i=t.series)&&void 0!==i?i:[],t.series.forEach((e=>{this._transformSeriesData(t,e),e.regionIndex=0}));const s=t.series.find((e=>e.id===t.candlestickSeries.id));let r;s?(e.merge(s,t.candlestickSeries),r=s):(t.series.push(t.candlestickSeries),r=t.candlestickSeries),dn(r),this._transformSeriesData(t,r),r.regionIndex=0,t.previewSeries&&e.array(t.previewSeries).forEach((i=>{const s=t.series.find((t=>t.id===i.id));let r;s?(e.merge(s,i),r=s):(t.series.push(i),r=i),r.regionIndex=1,this._transformSeriesData(t,r)}))}_transformSeriesData(t,i){var s;i.data&&(t.data=e.array(null!==(s=t.data)&&void 0!==s?s:[]),e.array(i.data).forEach(((e,s)=>{t.data.push(e),0===s&&(i.dataIndex=t.data.length-1,"id"in e?i.dataId=e.id:"name"in e&&(i.dataId=e.name))})),delete i.data)}_transformAxisSpec(t){super._transformAxisSpec(t),t.previewSeries&&(t.previewAxes||(t.previewAxes={type:"linear",orient:"left",visible:!1}),t.previewAxes.regionIndex=[1],t.axes.push(t.previewAxes),t.axes.forEach((e=>{e!==t.previewAxes&&("left"!==e.orient&&"right"!==e.orient||(e.regionIndex=[0]))})))}_transformDataZoomSpec(t){t.dataZoom&&e.array(t.dataZoom).forEach((t=>{"left"!==t.orient&&"right"!==t.orient||(t.regionIndex=[0])}))}_transformLayout(t){var i,s;const r={type:"grid",col:2,row:6,elements:[],colWidth:[],rowHeight:[]};let a=0,n=0;if(t.title&&!1!==(null===(i=t.title)||void 0===i?void 0:i.visible)&&a++,t.legends){const i=e.array(t.legends)[0];!1!==(null==i?void 0:i.visible)&&("top"===i.orient||"bottom"===i.orient?a++:n++)}if(t.dataZoom&&e.array(t.dataZoom).forEach((t=>{!1!==(null==t?void 0:t.visible)&&("top"===t.orient||"bottom"===t.orient?a++:n++)})),t.axes){const i={top:!1,bottom:!1,left:!1,right:!1,z:!1};e.array(t.axes).forEach((t=>{i[t.orient]||(i[t.orient]=!0,"top"===t.orient||"bottom"===t.orient?a++:n++)}))}a++,n++,t.previewSeries&&a++,r.row=a,r.col=n;const o={top:0,bottom:0,left:0,right:0};if(t.title&&!1!==(null===(s=t.title)||void 0===s?void 0:s.visible)&&this._layoutOrientItem(r,t.title,o,{specKey:"title",index:0},"total"),t.legends){const i=e.array(t.legends)[0];!1!==(null==i?void 0:i.visible)&&this._layoutOrientItem(r,i,o,{specKey:"legends",index:0},"less")}if(t.dataZoom&&e.array(t.dataZoom).forEach(((t,e)=>{!1!==(null==t?void 0:t.visible)&&this._layoutOrientItem(r,t,o,{specKey:"dataZoom",index:e},"one")})),t.axes){const e={left:!1,right:!1};t.axes.forEach(((t,i)=>{"left"!==t.orient&&"right"!==t.orient||e[t.orient]||(e[t.orient]=!0,this._layoutOrientItem(r,t,o,{specKey:"axes",index:i},"one"))}))}const l=this._layoutOrientItem(r,{orient:"top"},o,{specKey:"region",index:0},"one");if(t.previewSeries){const i=this._layoutOrientItem(r,{orient:"bottom"},o,{specKey:"region",index:1},"one"),s=t.axes.findIndex((e=>e===t.previewAxes));if(-1!==s){const t={col:i.col-1,row:i.row,modelKey:"axes",modelIndex:s};r.elements.push(t)}if(t.previewHeight)if("string"==typeof t.previewHeight){if(e.isPercent(t.previewHeight)){const e=t.previewHeight;r.rowHeight.push({index:i.row,size:t=>Number(e.substring(0,e.length-1))*t/100})}}else r.rowHeight.push({index:i.row,size:t.previewHeight})}const h=t.axes.findIndex((t=>"bottom"===t.orient));this._layoutOrientItem(r,t.axes[h],o,{specKey:"axes",index:h},"one"),t.axes.forEach(((e,i)=>{if(e===t.previewAxes)return;const s=r.elements.find((t=>"modelKey"in t&&"axes"===t.modelKey&&t.modelIndex===i));s&&("top"===e.orient||"bottom"===e.orient?s.col=l.col:s.row=l.row)})),e.array(t.dataZoom).forEach(((t,e)=>{const i=r.elements.find((t=>"modelKey"in t&&"dataZoom"===t.modelKey&&t.modelIndex===e));i&&("top"===t.orient||"bottom"===t.orient?i.col=l.col:i.row=l.row)})),t.layout=r}_layoutOrientItem(t,e,i,s,r){var a;const n={modelKey:s.specKey,modelIndex:s.index,col:0,row:0},o=null!==(a=e.orient)&&void 0!==a?a:"top",{span:l,index:h}=this._getLayoutElementCommon(t,i,r,o);return t.elements.push(n),"top"===o?(n.row=i.top,n.rowSpan=1,n.colSpan=l,n.col=h,i.top++):"bottom"===o?(n.row=t.row-i.bottom-1,n.rowSpan=1,n.colSpan=l,n.col=h,i.bottom++):"left"===o?(n.col=i.left,n.colSpan=1,n.rowSpan=l,n.row=h,i.left++):"right"===o&&(n.col=t.col-i.right-1,n.colSpan=1,n.rowSpan=l,n.row=h,i.right++),n}_getLayoutElementCommon(t,e,i,s){return"top"===s||"bottom"===s?{span:"total"===i?t.col:"one"===i?1:t.col-e.left-e.right,index:"total"===i?0:e.left}:{span:"total"===i?t.row:"one"===i?1:t.row-e.top-e.bottom,index:"total"===i?0:e.top}}}class pn extends e.BaseChart{constructor(){super(...arguments),this.type=qa,this.transformerConstructor=un}_setModelOption(){this._modelOption.getDimensionInfo=(t,i,s)=>{var r;return[...null!==(r=e.getCartesianDimensionInfo(t,i,s))&&void 0!==r?r:[]]},this._modelOption.getDimensionInfoByValue=e.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=e.getCartesianCrosshairRect}}pn.type=qa,pn.transformerConstructor=un,e.mixin(pn,e.StackChartMixin);const gn=t=>({custom:e.RotateBySphereAnimate,customParameters:()=>t,easing:"linear",loop:1/0,duration:6e3});class mn extends e.BaseWordCloudSeries{constructor(){super(...arguments),this.type=$.wordCloud3d}_wordCloudTransformOption(){var t;return Object.assign(Object.assign({},super._wordCloudTransformOption()),{postProjection:null!==(t=this._spec.postProjection)&&void 0!==t?t:"StereographicProjection",depth_3d:this._spec.depth_3d})}_wordCloudShapeTransformOption(){var t;return Object.assign(Object.assign({},super._wordCloudShapeTransformOption()),{postProjection:null!==(t=this._spec.postProjection)&&void 0!==t?t:"StereographicProjection",depth_3d:this._spec.depth_3d})}initMark(){this._wordMark=this._createMark(e.BaseWordCloudSeries.mark.word,{groupKey:this._seriesField,isSeriesMark:!0},{support3d:!0})}initMarkStyle(){super.initMarkStyle();const t=this._wordMark;t&&this.setMarkStyle(t,{z:t=>{var e;return null!==(e=t.z)&&void 0!==e?e:0}},"normal",e.AttributeLevel.Series)}initAnimation(){var t,i;const s=null!==(t=this._padding)&&void 0!==t?t:{};this._wordMark&&this._wordMark.setAnimationConfig(e.animationConfig(null===(i=e.Factory.getAnimationInKey("wordCloud3d"))||void 0===i?void 0:i((()=>{var t;const e=this.getCompiler().getStage(),i=e.width-s.left||0-s.right||0,r=e.height-s.top||0-s.bottom||0,a=Math.max(i,r)/2;return{center:{x:a,y:a,z:null!==(t=this._spec.depth_3d)&&void 0!==t?t:a},r:a}})),e.userAnimationConfig("word",this._spec,this._markAttributeContext)))}}mn.type=$.wordCloud3d,mn.builtInTheme={wordCloud3d:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}}};const fn=()=>{e.registerTextMark(),e.Factory.registerAnimation("wordCloud3d",(t=>({appear:gn(t)}))),e.Factory.registerSeries(mn.type,mn)},yn=()=>{fn()};class vn extends e.BaseWordCloudChartSpecTransformer{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.depth_3d=t.depth_3d,e}}class bn extends e.BaseWordCloudChart{constructor(){super(...arguments),this.transformerConstructor=vn,this.type="wordCloud3d",this.seriesType=$.wordCloud3d}}bn.type="wordCloud3d",bn.seriesType=$.wordCloud3d,bn.transformerConstructor=vn;const xn=()=>{Z(),fn(),e.Factory.registerChart(bn.type,bn)},_n={label:{space:0}};class Sn{setLayout3dBox(t){this.layout3dBox=t}_afterUpdateAttribute(t,i){const s=e.isZAxis(this._orient),r=e.isXAxis(this._orient),a=e.isYAxis(this._orient);let n=0,o=0;if(!i){const t=this.getRegions();let{x:e,y:i}=t[0].getLayoutStartPoint(),s=e+t[0].getLayoutRect().width,r=i+t[0].getLayoutRect().height;for(let a=1;a<t.length;a++){const n=t[a],{x:o,y:l}=n.getLayoutStartPoint(),{width:h,height:c}=n.getLayoutRect();e=Math.min(e,o),s=Math.max(s,h+o),i=Math.min(i,l),r=Math.max(r,c+l)}n=Math.abs(r-i),o=Math.abs(s-e)}let l=0,h=0;const{width:c,height:d}=this.getLayoutRect();let u={x:0,y:0};r?(u={x:c,y:0},l=n,h=c):a&&(u={x:0,y:d},l=o,h=d);const p=this.layout3dBox?this.layout3dBox.length:0;if(!s){const e=this.getLabelItems(h);return t.grid={length:l},t.start={x:0,y:0},t.text=this._spec.title.text||this._dataFieldText,t.maxWidth=this._getTitleLimit(r),t.items=e,t.grid={type:"line",start:{x:0,y:0},end:u,items:e[0],depth:p,length:l},t}return((t,i)=>{var s;const r=e.getCombinedSizeOfRegions(t.getRegions()),{width:a}=t.getLayoutRect(),n=a,o=t.layout3dBox?t.layout3dBox.length:0,l=t.layout3dBox?t.layout3dBox.width:0,h={x:o,y:0},c=t.getLabelItems(n),d={start:{x:0,y:0},end:h,title:{text:t._spec.title.text||t._dataFieldText,maxWidth:t._getTitleLimit(!1)},items:c,scale:t._scale.clone()},u=null!==(s=t.directionStr)&&void 0!==s?s:"r2l";let p=[0,0],g=-Math.PI/2,m=0;return"l2r"===u&&(m=t.layout3dBox.length,p=[0,0,0],g=Math.PI/2),d.z=m,d.alpha=g,d.anchor3d=p,i||(d.grid={type:"line",start:{x:0,y:0},end:h,items:c[0],verticalFactor:t._axisStyle.verticalFactor,depth:l,length:i?0:r.height,alpha:g,z:m,anchor3d:p}),d})(this,i)}}const An=Object.assign(Object.assign({},Q),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}});class Tn extends e.RangeColumnSeries{constructor(){super(...arguments),this.type=$.rangeColumn3d,this._barMarkType="rect3d",this._barName=$.bar3d}}Tn.type=$.rangeColumn3d,Tn.mark=An;const Cn=()=>{et(),e.registerCartesianBandAxis(),e.registerCartesianLinearAxis(),e.Factory.registerSeries(Tn.type,Tn)};class Mn extends e.RangeColumnSeriesSpecTransformer{_transformLabelSpec(t){var e;"bothEnd"!==(null===(e=t.label)||void 0===e?void 0:e.position)&&this._addMarkLabelSpec(t,"bar3d")}}class kn extends e.CartesianChartSpecTransformer{_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t,["bar3d","barGapInGroup"]);return"horizontal"===t.direction?s.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:s.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],s}}class wn extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=kn,this.type="rangeColumn3d",this.seriesType=$.rangeColumn3d}_setModelOption(){this._modelOption.getDimensionInfo=e.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=e.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=e.getCartesianCrosshairRect}}wn.type="rangeColumn3d",wn.seriesType=$.rangeColumn3d,wn.transformerConstructor=kn;const Pn="pictogram",On="pictogram";var Bn;!function(t){t.pictogram="pictogram"}(Bn||(Bn={}));const Ln=Object.assign(Object.assign({},e.baseSeriesMark),{pictogram:{name:"pictogram",type:"group"}});class En extends e.BaseChartSpecTransformer{_isValidSeries(t){return t===On}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["type","nameField","valueField","svg","pictogram","defaultFillColor"])}transformSpec(t){super.transformSpec(t),t.region.forEach((t=>{t.coordinate="geo"})),super.transformSeriesSpec(t)}}const Dn=new Map,Fn="_vchartViewportRect";let In;const Rn=/-?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?/gi;function Nn(t,i){Dn.has(t)&&e.warn(`svg source key of '${t}' already exists, will be overwritten.`),In||(In=new e.DataSet,e.registerDataSetInstanceParser(In,"svg",e.svgParser));const s=new e.DataView(In);s.parse(i,{type:"svg"});const r=s.latestData,a=function(t){var e,i,s,r;const a=null===(e=t.match(/<svg\b[\s\S]*?>/i))||void 0===e?void 0:e[0],n=null===(i=null==a?void 0:a.match(/\benable-background\s*=\s*(['"])(.*?)\1/i))||void 0===i?void 0:i[2];if(!n||!/^\s*new\b/i.test(n))return null;const o=null!==(r=null===(s=n.match(Rn))||void 0===s?void 0:s.map(Number))&&void 0!==r?r:[],[l,h,c,d]=o;return!Number.isFinite(l)||!Number.isFinite(h)||!Number.isFinite(c)||!Number.isFinite(d)||c<=0||d<=0?null:{x:l,y:h,width:c,height:d}}(i);r&&a&&!r.viewBoxRect&&!function(t){return Number.isFinite(t.width)&&Number.isFinite(t.height)&&t.width>0&&t.height>0}(r)&&(r[Fn]=a),Dn.set(t,s)}function jn(t){Dn.has(t)?Dn.delete(t):e.warn(`map type of '${t}' does not exists.`)}function Un(t){return Dn.get(t)}class zn extends e.BaseSeriesSpecTransformer{_getDefaultSpecFromChart(t){var i,s,r;const a=null!==(i=super._getDefaultSpecFromChart(t))&&void 0!==i?i:{},n=t.svg,o=null===(r=null===(s=Dn.get(n))||void 0===s?void 0:s.latestData)||void 0===r?void 0:r.elements;if(o&&o.length){o.map((t=>t.name)).filter((t=>e.isValid(t))).forEach((e=>{t[e]&&(a[e]=t[e])}))}return a}}class Vn extends e.BaseSeriesTooltipHelper{constructor(){super(...arguments),this.dimensionTooltipTitleCallback=t=>{var e;const i=this.series;return null!==(e=this._getDimensionData(t))&&void 0!==e?e:i.getDatumName(t)},this.markTooltipValueCallback=(t,e)=>{const{measureFields:i}=this._seriesCacheInfo;if(i[0]&&t.data)return t.data[i[0]]},this.markTooltipKeyCallback=t=>{var e;return null===(e=t.data)||void 0===e?void 0:e[this.series.getDimensionField()[0]]}}}const Gn="element-highlight-by-graphic-name";class Wn extends e.ElementHighlight{constructor(){super(...arguments),this.type=Gn,this.handleStart=t=>{if(t&&t.item&&this.isGraphicInMark(t.item)){if(this.options.shouldStart?this.options.shouldStart(t):this._filterByName(t)){const e=this._parseTargetKey(t);this.start(e)}}},this.handleReset=t=>{t&&t.item&&this.isGraphicInMark(t.item)&&this.reset()}}_filterByName(t){var e;return!!(null===(e=null==t?void 0:t.node)||void 0===e?void 0:e.name)}_parseTargetKey(t){return t.node.name}start(t){if(e.isNil(t))return;const{interaction:i,highlightState:s,blurState:r}=this.options,a=i.getStatedGraphics(this),n=[];this.getMarks().forEach((e=>{var i;null===(i=e.getGraphics())||void 0===i||i.forEach((e=>{e.name===t&&n.push(e)}))})),i.updateStates(this,n,a,s,r),i.setStatedGraphics(this,n)}reset(){const{highlightState:t,blurState:e,interaction:i}=this.options;i.clearAllStatesOfTrigger(this,t,e),i.setStatedGraphics(this,[])}}Wn.type=Gn;const Hn="element-select-by-graphic-name";class $n extends e.ElementSelect{constructor(){super(...arguments),this.type=Hn}start(t){const e=null==t?void 0:t.name;e&&this.getMarks().forEach((t=>{var i;null===(i=t.getGraphics())||void 0===i||i.forEach((t=>{t.name===e&&super.start(t)}))}))}}$n.type=Hn;function Xn(t){var i;return e.isValid(t)&&"none"!==t&&!(null===(i=t.includes)||void 0===i?void 0:i.call(t,"url"))}const Yn=t=>{const e=parseFloat(t.strokeWidth);if(!isNaN(e))return e;const i=t.stroke;return i&&Xn(i)?1:0},Kn=(t,e)=>{var i;const s=null!==(i=t.fill)&&void 0!==i?i:e;return s&&Xn(s)?s:void 0},qn=(t,e)=>{var i;const s=null!==(i=t.stroke)&&void 0!==i?i:e;return!(!s||!Xn(s))&&s},Zn=t=>Object.assign(Object.assign({},t),{x:parseFloat(t.x)||void 0,y:parseFloat(t.y)||void 0,fillStrokeOrder:!1,fill:Kn(t),lineWidth:Yn(t),stroke:qn(t)}),Qn={group:t=>{const e=Zn(t);return Object.assign(Object.assign({},e),{visibleAll:!1!==e.visible})},rule:t=>Object.assign(Object.assign({},Zn(t)),{x:parseFloat(t.x1),y:parseFloat(t.y1),x1:parseFloat(t.x2),y1:parseFloat(t.y2)}),rect:t=>Object.assign(Object.assign({},Zn(t)),{fill:Kn(t,"#000"),width:parseFloat(t.width),height:parseFloat(t.height)}),polygon:t=>Object.assign(Object.assign({},Zn(t)),{fill:Kn(t,"#000"),points:t.points.trim().split(/\s+/).map((t=>{const[e,i]=t.split(",").map(Number);return{x:e,y:i}}))}),line:t=>Object.assign(Object.assign({},Zn(t)),{points:t.points.trim().split(/\s+/).map((t=>{const[e,i]=t.split(",").map(Number);return{x:e,y:i}}))}),path:t=>Object.assign(Object.assign({},Zn(t)),{path:t.d,fillStrokeOrder:!1,fill:Kn(t,"#000")}),arc:t=>{var e;return Object.assign(Object.assign({},Zn(t)),{outerRadius:null!==(e=t.r)&&void 0!==e?e:t.ry,x:parseFloat(t.cx),y:parseFloat(t.cy),startAngle:0,endAngle:2*Math.PI,scaleX:parseFloat(t.rx)/parseFloat(t.ry)||1,fill:Kn(t,"#000")})},text:(t,e)=>{var i,s;return Object.assign(Object.assign({},Zn(t)),{text:e,textAlign:null!==(i=t.textAlign)&&void 0!==i?i:"left",textBaseLine:null!==(s=t.textAnchor)&&void 0!==s?s:"middle",anchor:[0,0],fill:Kn(t,"#000")})}},Jn=t=>{var i,s;if(!t||!t[0])return{};const{elements:r}=t[0].latestData;if(r&&r.length){r.forEach(((t,i)=>{var s;t[e.DEFAULT_DATA_INDEX]=i,t._uniqueId=`${t.id}-${i}`,t.data=void 0;const{graphicType:r,transform:a}=t,n={visible:"hidden"!==t.attributes.visibility&&"collapse"!==t.attributes.visibility};"text"===t.graphicType?e.merge(n,t._inheritStyle,null===(s=t.parent)||void 0===s?void 0:s._textGroupStyle,t.attributes):"group"!==t.graphicType&&e.merge(n,t._inheritStyle,t.attributes),Qn[r]?t._finalAttributes=Qn[r](n,t.value):t._finalAttributes=n,a&&(t._finalAttributes.postMatrix=Object.assign({},a))}));const t=r.filter((t=>"text"===t.tagName));for(let a=0;a<t.length;a++){const n=t[a]._uniqueId,o=r.filter((t=>{let e=!1,i=t.parent;for(;i;){if(i._uniqueId===n){e=!0;break}i=i.parent}return e}));if(o&&o.length){const r=null!==(s=null===(i=t[a]._textGroupStyle)||void 0===i?void 0:i.x)&&void 0!==s?s:0;let n=r;for(let t=0;t<o.length;t++){const i=o[t];if("group"===i.graphicType)n=r;else if(i.value&&void 0===i.parent._textGroupStyle.x){const s=o.slice(0,t).reverse().find((t=>"text"===t.graphicType&&t.value));if(s){n+=e.measureText(s.value,s._finalAttributes).width}i._finalAttributes.x=n}}}}}return r};class to extends e.GeoSeries{constructor(){super(...arguments),this.type=On,this._idToMark=new Map}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec(),this.svg=this._spec.svg,this._nameField=this._spec.nameField,this._valueField=this._spec.valueField,this.svg||null===(t=this._option)||void 0===t||t.onError("svg source is not specified !"),this._parsedSvgResult=null===(e=Un(this.svg))||void 0===e?void 0:e.latestData,this._parsedSvgResult||null===(i=this._option)||void 0===i||i.onError(`'${this.svg}' is not registered !`)}getDatumCenter(t){return[Number.NaN,Number.NaN]}getDatumName(t){return t.name||t._nameFromParent}getMarksWithoutRoot(){return this.getMarks().filter((t=>t.name&&!t.name.includes("seriesGroup")&&!t.name.includes("root")&&t!==this._pictogramMark))}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.getTransformMatrix=this.getRootMatrix.bind(this),this._markAttributeContext.coordToPosition=this.coordToPosition.bind(this),this._markAttributeContext.dataToPosition=this.dataToPosition.bind(this)}_defaultHoverConfig(t){return{type:"element-highlight-by-graphic-name",trigger:t.trigger,triggerOff:"pointerout",blurState:e.STATE_VALUE_ENUM.STATE_HOVER_REVERSE,highlightState:e.STATE_VALUE_ENUM.STATE_HOVER}}_defaultSelectConfig(t){const i="multiple"===t.mode,s=e.isValid(t.triggerOff)?t.triggerOff:i?["empty","self"]:["empty",t.trigger];return{type:"element-select-by-graphic-name",trigger:t.trigger,triggerOff:s,reverseState:e.STATE_VALUE_ENUM.STATE_SELECTED_REVERSE,state:e.STATE_VALUE_ENUM.STATE_SELECTED,isMultiple:i}}initMark(){var t;if(this._pictogramMark=this._createMark(to.mark.pictogram,{groupKey:this.getDimensionField()[0],isSeriesMark:!0,skipBeforeLayouted:!0},{morph:e.shouldMarkDoMorph(this._spec,to.mark.pictogram.name)}),this._pictogramMark){this._pictogramMark.setData(this._mapViewData),this._pictogramMark.setUserId(to.mark.pictogram.name);for(const i of this._mapViewData.getDataView().latestData){const{graphicType:s,name:r,parent:a,id:n,_nameFromParent:o,_uniqueId:l}=i,h=this._createMark({type:s,name:null!=r?r:o},{groupKey:l,isSeriesMark:!1,skipBeforeLayouted:!0,parent:null!==(t=this._idToMark.get(null==a?void 0:a._uniqueId))&&void 0!==t?t:this._pictogramMark},{morph:e.shouldMarkDoMorph(this._spec,to.mark.pictogram.name)});h&&(h.setData(this._mapViewData),h.setUserId(l),this._idToMark.set(l,h),"group"!==h.type&&h.setMarkConfig({graphicName:h.name}),h.setTransform([{type:"filter",callback:t=>t._uniqueId===l}]))}this._initLabelMark()}}_initLabelMark(){if(!0!==this._spec.label.visible)return;const t=this._createMark(to.mark.label,{isSeriesMark:!1,parent:this._pictogramMark,groupKey:"_uniqueId",skipBeforeLayouted:!0});t&&(this._labelMark=t,this._labelMark.setData(this._mapViewData))}initLabelMarkStyle(){this._labelMark&&this.setMarkStyle(this._labelMark,{visible:t=>!!this._validElement(t),x:t=>{var e;return null===(e=this.dataToPosition(t,!0))||void 0===e?void 0:e.x},y:t=>{var e;return null===(e=this.dataToPosition(t,!0))||void 0===e?void 0:e.y},text:t=>t[this.nameField],textAlign:"center",textBaseline:"middle"},e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series)}initMarkStyle(){const{root:t}=this._parsedSvgResult,i=this._getSvgViewportRect(),s=this._mapViewData.getDataView().latestData;t&&(this.setMarkStyle(this._pictogramMark,Qn.group(t.attributes),"normal",e.AttributeLevel.Built_In),this.setMarkStyle(this._pictogramMark,{postMatrix:()=>this._getFittedSvgRootMatrix()},"normal",e.AttributeLevel.Built_In),i&&this._pictogramMark.setMarkConfig({clip:!0,clipPath:[e.createRect(Object.assign(Object.assign({},i),{fill:!0}))]}));for(const t of s){const{_uniqueId:i,_finalAttributes:s}=t,r=this._idToMark.get(i),a=this._validElement(t);r&&(this.setMarkStyle(r,{keepStrokeScale:!0},"normal",e.AttributeLevel.Built_In),a?(this.initMarkStyleWithSpec(r,e.merge({},this._spec.pictogram,this._spec[r.name])),this.setMarkStyle(r,s,"normal",e.AttributeLevel.Series),r.setPostProcess("fill",((t,i)=>e.isValid(t)?t:this._spec.defaultFillColor))):(r.setMarkConfig({interactive:!1}),this.setMarkStyle(r,s,"normal",e.AttributeLevel.Built_In)))}this.initLabelMarkStyle()}_validElement(t){return t.name||t._nameFromParent}initTooltip(){this._tooltipHelper=new Vn(this),this.getMarksWithoutRoot().forEach((t=>{t&&t.name&&this._tooltipHelper.activeTriggerSet.mark.add(t)}))}dataToPosition(t,i=!1){if(!t)return null;const s=t[this.nameField];if(!s)return null;const r=this.getMarksWithoutRoot().filter((t=>t.name===s));if(!r||0===r.length)return null;let a=new e.Bounds;i?r.forEach((t=>{a=a.union(t.getGraphics()[0].globalAABBBounds)})):r.forEach((t=>{a=a.union(t.getProduct().AABBBounds)}));const n={x:(a.x1+a.x2)/2,y:(a.y1+a.y2)/2};if(i){const{x:t,y:e}=this.getLayoutStartPoint();n.x-=t,n.y-=e}return n}coordToPosition(t){if(!t)return null;const{x:e,y:i}=t,s=this.getRootMatrix();if(!s)return null;const r={};return s.getInverse().transformPoint({x:e,y:i},r),r}getRootMatrix(){var t;return null===(t=this.getPictogramRootGraphic())||void 0===t?void 0:t.transMatrix}getPictogramRootGraphic(){return this._pictogramMark.getProduct()}_getSvgRootMatrix(){var t,i;const s=null===(i=null===(t=this._parsedSvgResult)||void 0===t?void 0:t.root)||void 0===i?void 0:i.transform;return s?new e.Matrix(s.a,s.b,s.c,s.d,s.e,s.f):new e.Matrix}_getSvgViewportRect(){var t,e,i,s;const r=null===(t=this._parsedSvgResult)||void 0===t?void 0:t.viewBoxRect;if(r)return r;const{width:a,height:n}=null!==(e=this._parsedSvgResult)&&void 0!==e?e:{};return Number.isFinite(a)&&Number.isFinite(n)&&a>0&&n>0?{x:0,y:0,width:a,height:n}:null!==(s=null===(i=this._parsedSvgResult)||void 0===i?void 0:i[Fn])&&void 0!==s?s:null}_getSvgRootBounds(t){const i=this._getSvgViewportRect();if(!i)return null;const s=(new e.Bounds).setValue(i.x,i.y,i.x+i.width,i.y+i.height);return s.transformWithMatrix(t),s}_appendMatrixScale(t,i,s){const r=new e.Matrix;return r.translate(s.x,s.y),r.scale(i,i),r.translate(-s.x,-s.y),r.multiply(t.a,t.b,t.c,t.d,t.e,t.f),r}_appendMatrixTranslate(t,i,s){const r=new e.Matrix;return r.translate(i,s),r.multiply(t.a,t.b,t.c,t.d,t.e,t.f),r}_getFittedSvgRootMatrix(){const t=this._getSvgRootMatrix(),e=this._getSvgRootBounds(t);if(!e)return t;const i=e.width(),s=e.height();if(!Number.isFinite(i)||!Number.isFinite(s)||i<=0||s<=0)return t;const{width:r,height:a}=this.getLayoutRect(),n=(e.x1+e.x2)/2,o=(e.y1+e.y2)/2,l=Math.min(r/i,a/s),h=this._appendMatrixScale(t,l,{x:n,y:o});return this._appendMatrixTranslate(h,r/2-n,a/2-o)}initData(){var t,i;super.initData();const s=Dn.get(this.svg);s||null===(t=this._option)||void 0===t||t.onError("no valid svg found!");const r=new e.DataView(this._dataSet,{name:`pictogram_${this.id}_data`});e.registerDataSetInstanceTransform(this._dataSet,"pictogram",Jn),e.registerDataSetInstanceTransform(this._dataSet,"lookup",e.lookup),r.parse([s],{type:"dataview"}).transform({type:"pictogram"}).transform({type:"lookup",options:{from:()=>this.getViewData().latestData,key:"name",fields:this._nameField,set:(t,e)=>{e&&(t.data=e)}}}).transform({type:"lookup",options:{from:()=>this.getViewData().latestData,key:"_nameFromParent",fields:this._nameField,set:(t,e)=>{e&&(t.data=e)}}}),null===(i=this._data)||void 0===i||i.getDataView().target.addListener("change",r.reRunAllTransform),this._mapViewData=new e.CompilableData(this._option,r)}mapViewDataUpdate(){this._mapViewData.updateData()}onLayoutEnd(){var t;super.onLayoutEnd(),null===(t=this._mapViewData)||void 0===t||t.getDataView().reRunAllTransform()}updateSVGSize(){const t=this.getPictogramRootGraphic();t&&t.setAttributes({postMatrix:this._getFittedSvgRootMatrix()})}initEvent(){var t;super.initEvent(),null===(t=this._mapViewData.getDataView())||void 0===t||t.target.addListener("change",this.mapViewDataUpdate.bind(this))}handleZoom(t){const{scale:i,scaleCenter:s}=t;if(1===i)return;const r=this.getPictogramRootGraphic();r&&(r.attribute.postMatrix||r.setAttributes({postMatrix:new e.Matrix}),r.scale(i,i,s))}handlePan(t){const{delta:i}=t;if(0===i[0]&&0===i[1])return;const s=this.getPictogramRootGraphic();s&&(s.attribute.postMatrix||s.setAttributes({postMatrix:new e.Matrix}),s.translate(i[0],i[1]))}getMarkData(t){var e;return null!==(e=t.data)&&void 0!==e?e:{}}getMeasureField(){return[this.valueField]}getDimensionField(){return[this.nameField]}_getSeriesInfo(t,e){const i=this.getDefaultShapeType();return e.map((e=>({key:e,originalKey:e,style:this.getSeriesStyle({data:{[t]:e}}),shapeType:i})))}release(){this._parsedSvgResult=null,this._idToMark.clear(),this._idToMark=null}}to.type=On,to.mark=Ln,to.transformerConstructor=zn;const eo=()=>{e.Factory.registerSeries(to.type,to),e.Factory.registerImplement("registerSVG",Nn),e.Factory.registerImplement("unregisterSVG",jn),e.Factory.registerInteractionTrigger(Wn.type,Wn),e.Factory.registerInteractionTrigger($n.type,$n)};class io extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=En,this.type=Pn,this.seriesType=On}}io.type=On,io.seriesType=Pn,io.transformerConstructor=En;class so extends e.BaseChartSpecTransformer{transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["urlField","nameField","valueField","imageSize","imageSizeRange","ratio","maskShape","imageMask","layoutConfig","image"])}}const ro="imageCloud",ao="imageCloud";var no;!function(t){t.image="image",t.imageMask="imageMask"}(no||(no={}));const oo=Object.assign(Object.assign({},e.baseSeriesMark),{image:{name:"image",type:"image"},imageMask:{name:"imageMask",type:"rect"}});class lo extends e.ACustomAnimate{constructor(t,e,i,s,r){var a;super(t,e,i,s,r),this._rotations=null!==(a=null==r?void 0:r.rotation)&&void 0!==a?a:1}onBind(){this._scaleX=this.target.attribute.scaleX,e.isValidNumber(this._rotations)||(this.valid=!1)}onUpdate(t,e,i){var s;if(!1===this.valid)return;if(t)return void(i.scaleX=this._scaleX);const r=360*this._rotations*e*Math.PI/180,a=Math.abs(Math.cos(r))*(null!==(s=this._scaleX)&&void 0!==s?s:1);this.target.attribute.scaleX=a,this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag()}}function ho(t,i){switch(i){case"axialRotate":return[{custom:lo,customParameters:{rotation:1},duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration},{channel:{y:{from:(e,i)=>t.height()+i.getFinalAttribute().y},fillOpacity:{from:0,to:1}},easing:"sineInOut"}];case"growIn":return{channel:{scaleX:{from:0,to:1},scaleY:{from:0,to:1},x:{from:()=>t.center().x},y:{from:()=>t.center().y}},duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration};case"scaleIn":return{type:"scaleIn",duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration};default:return{type:"fadeIn",easing:"linear",duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration}}}class co extends e.BaseSeriesTooltipHelper{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>{var e,i;return null===(i=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t))||void 0===i?void 0:i[this.series.getDimensionField()[0]]},this.markTooltipValueCallback=t=>{var e,i;const{measureFields:s}=this._seriesCacheInfo,r=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(s[0]&&r)return null!==(i=r[s[0]])&&void 0!==i?i:t.value},this.dimensionTooltipTitleCallback=t=>{var e;const{dimensionFields:i}=this._seriesCacheInfo,s=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(i[0]&&s)return s[i[0]]}}get defaultShapeType(){return"square"}}class uo extends e.BaseSeries{constructor(){super(...arguments),this.type=ao}setValueField(t){e.isValid(t)&&(this._valueField=t)}setAttrFromSpec(){super.setAttrFromSpec(),this._nameField=this._spec.nameField,this._valueField=this._spec.valueField,this._urlField=this._spec.urlField}initMark(){var t;(null===(t=this._spec.imageMask)||void 0===t?void 0:t.visible)&&(this._maskMark=this._createMark(oo.imageMask,{dataView:!1,skipBeforeLayouted:!0})),this._imageMark=this._createMark(oo.image,{key:t=>`${t[e.DEFAULT_DATA_KEY]}-${t.frequency}`,isSeriesMark:!0,skipBeforeLayouted:!0})}initMarkStyle(){this._initImageMarkStyle(),this._initMaskMarkStyle()}_initImageMarkStyle(){var t,i;if(!this._imageMark)return;this._imageMark.setTransform([Object.assign({type:"imagecloud"},this._imageCloudTransformOption())]),this.setMarkStyle(this._imageMark,{x:t=>t.x,y:t=>t.y,width:t=>t.width,height:t=>t.height,visible:t=>t.visible,angle:t=>t.angle,clipConfig:t=>t.clipConfig,image:t=>t[this._urlField],scaleCenter:["50%","50%"]},"normal",e.AttributeLevel.Series);"masked"===(null===(t=this._spec.layoutConfig)||void 0===t?void 0:t.placement)&&(this.setMarkStyle(this._imageMark,{globalCompositeOperation:"source-atop"},"normal",e.AttributeLevel.Series),this.setMarkStyle(this._rootMark,{width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height,globalCompositeOperation:"destination-in",clip:!0,drawMode:1},"normal",e.AttributeLevel.Series)),"stack"===(null===(i=this._spec.layoutConfig)||void 0===i?void 0:i.layoutMode)&&this.setMarkStyle(this._imageMark,{stroke:"white",lineWidth:2,shadowBlur:6,shadowColor:"grey"},"normal",e.AttributeLevel.Series)}isFillingImage(t){return t._frequency>1}_initMaskMarkStyle(){this._maskMark&&(this._maskMark.setMarkConfig({interactive:!1}),this.setMarkStyle(this._maskMark,{width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height},"normal",e.AttributeLevel.Series))}initTooltip(){this._tooltipHelper=new co(this),this._imageMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._imageMark)}_imageCloudTransformOption(){var t;return{size:()=>{const{width:t,height:e}=this._region.getLayoutRect();return[t,e]},image:{field:this._urlField},weight:{field:this._valueField},imageConfig:{imageSize:this._spec.imageSize,imageSizeRange:this._spec.imageSizeRange,padding:null===(t=this._spec.image)||void 0===t?void 0:t.padding},ratio:this._spec.ratio,mask:this._spec.maskShape,maskConfig:this._spec.imageMask,layoutConfig:this._spec.layoutConfig,createCanvas:e.vglobal.createCanvas.bind(e.vglobal),createImage:e.createImage,onUpdateMaskCanvas:((t,e)=>{var i;t&&this._maskMark&&this._maskMark.getProduct().getChildren().forEach((e=>{e.setAttribute("background",t)})),e&&"masked"===(null===(i=this._spec.layoutConfig)||void 0===i?void 0:i.placement)&&this._rootMark.getProduct().setAttribute("background",e)}).bind(this),onLayoutFinished:()=>{var t,e;return null===(e=null===(t=this._option.globalInstance.getChart().getOption().performanceHook)||void 0===t?void 0:t.afterWordcloudShapeDraw)||void 0===e?void 0:e.call(t,this._option.globalInstance)}}}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.isFillingImage=this.isFillingImage.bind(this)}initAnimation(){[this._imageMark].forEach((t=>{var i,s;if(t){const r=null===(s=null===(i=this._spec)||void 0===i?void 0:i.animationAppear)||void 0===s?void 0:s.preset,a={center:()=>{const{width:t,height:e}=this._region.getLayoutRect();return{x:t/2,y:e/2}},height:()=>{const{height:t}=this._region.getLayoutRect();return t}};t.setAnimationConfig(e.animationConfig(e.Factory.getAnimationInKey("imageCloud")(a,r),e.userAnimationConfig("image",this._spec,this._markAttributeContext)))}}))}getDimensionField(){var t;return[null!==(t=this._nameField)&&void 0!==t?t:this._spec.urlField]}getMeasureField(){return[this._valueField]}getStatisticFields(){const t=[];return t.push({key:this._nameField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}getActiveMarks(){return[this._imageMark]}getMarkData(t){var e;return null!==(e=null==t?void 0:t.datum)&&void 0!==e?e:t}getGroupFields(){return[]}dataToPosition(t){return null}dataToPositionX(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.x}dataToPositionY(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.y}valueToPosition(t,e){return null}getStackGroupFields(){return[]}getStackValueField(){return""}}uo.type=ao,uo.mark=oo;const po=()=>{e.registerImageMark(),e.Factory.registerAnimation("imageCloud",((t,e)=>({appear:ho(t,e),enter:ho(t,e),exit:{type:"fadeOut"},disappear:{type:"fadeOut"}}))),e.Factory.registerSeries(uo.type,uo),e.Factory.registerGrammarTransform("imagecloud",{transform:e.imagecloudTransform})};class go extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=go.transformerConstructor,this.type=ro,this.seriesType=ao}}go.type=ro,go.seriesType=ao,go.transformerConstructor=so;class mo extends e.BaseChartSpecTransformer{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["timeField","eventField","seriesField","titleField","subTitleField","iconField","dot","title","subTitle","icon","line","arrow","labelPosition","sortDataByAxis"])}_setDefaultXAxisSpec(t){return{type:"band",orient:"bottom",label:{visible:!1},tick:{visible:!1},grid:{visible:!1},domainLine:{visible:!1},paddingInner:0,paddingOuter:0}}_setDefaultYAxisSpec(t){return{type:"band",inverse:!0,orient:"left",label:{visible:!1},tick:{visible:!1},grid:{visible:!1},domainLine:{visible:!1},paddingInner:0,paddingOuter:0}}_transformAxisSpec(t){t.axes||(t.axes=[]);const e={x:!1,y:!1};t.axes.forEach((i=>{const{orient:r}=i;let a=null;"top"!==r&&"bottom"!==r||(e.x=!0,a=this._setDefaultXAxisSpec(t)),"left"!==r&&"right"!==r||(e.y=!0,a=this._setDefaultYAxisSpec(t)),a&&Object.keys(a).forEach((t=>{i[t]=s.isObject(i[t])?s.merge(a[t],i[t]):s.isNil(i[t])?a[t]:i[t]}))})),e.x||t.axes.push(this._setDefaultXAxisSpec(t)),e.y||t.axes.push(this._setDefaultYAxisSpec(t))}transformSpec(t){var e,i;super.transformSpec(t),this.transformSeriesSpec(t),this._transformAxisSpec(t);const s=null!==(e=t.direction)&&void 0!==e?e:"horizontal";null===(i=t.series)||void 0===i||i.forEach((t=>{"vertical"===s?(t.timeField&&!t.yField&&(t.yField=t.timeField),t.xField||(t.xField=t.seriesField||"__vchart_timeline_dummy__")):(t.timeField&&!t.xField&&(t.xField=t.timeField),t.yField||(t.yField=t.seriesField||"__vchart_timeline_dummy__"))}))}}const fo="event",yo=Object.assign(Object.assign({},e.baseSeriesMark),{line:{name:"line",type:"line"},dot:{name:"dot",type:"symbol"},icon:{name:"icon",type:"symbol"},title:{name:"title",type:"text"},subTitle:{name:"subTitle",type:"text"},arrow:{name:"arrow",type:"path"}});class vo extends e.CartesianSeries{constructor(){super(...arguments),this.type=fo,this.transformerConstructor=e.BaseSeriesSpecTransformer,this.coordinate="cartesian"}setAttrFromSpec(){super.setAttrFromSpec(),this.setSeriesField(this._spec.seriesField),this._timeField=this._spec.timeField,this._eventField=this._spec.eventField,this._subTitleField=this._spec.subTitleField,this._iconField=this._spec.iconField,this._labelPosition=this._spec.labelPosition}getDimensionField(){return this._timeField?[this._timeField]:[]}getMeasureField(){const t=[];return this._eventField&&t.push(this._eventField),this._subTitleField&&t.push(this._subTitleField),t}initMark(){this._axisLineMark=this._createMark(vo.mark.line,{isSeriesMark:!0,groupKey:this._seriesField}),this._arrowMark=this._createMark(vo.mark.arrow,{isSeriesMark:!0}),this._dotMark=this._createMark(vo.mark.dot,{isSeriesMark:!0}),this._iconMark=this._createMark(vo.mark.icon,{isSeriesMark:!0}),this._titleMark=this._createMark(vo.mark.title),this._subTitleMark=this._createMark(vo.mark.subTitle)}initTooltip(){super.initTooltip(),this._dotMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._dotMark),this._titleMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._titleMark),this._subTitleMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._subTitleMark),this._iconMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._iconMark),this._arrowMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._arrowMark)}initMarkStyle(){var t,i,r,a,n,o,l,h,c,d,u;this._axisLineMark&&this.setMarkStyle(this._axisLineMark,{points:this._getAxisPoints.bind(this),visible:this._isFirstDataInGroup.bind(this),stroke:"#c0c3c7",lineWidth:1},e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series);const p=this._spec.dot,g="number"==typeof(null===(t=null==p?void 0:p.style)||void 0===t?void 0:t.size)?p.style.size:8,m=this._spec.title,f=null!==(i=null==m?void 0:m.style)&&void 0!==i?i:{},y=this._spec.subTitle,v=null!==(r=null==y?void 0:y.style)&&void 0!==r?r:{},b="number"==typeof f.fontSize?f.fontSize:14,x=g/2+(null!==(a=null==m?void 0:m.offset)&&void 0!==a?a:6);this._dotMark&&this.setMarkStyle(this._dotMark,{x:t=>this._getPoint(t).x,y:t=>this._getPoint(t).y,size:g,fill:null!==(o=null===(n=null==p?void 0:p.style)||void 0===n?void 0:n.fill)&&void 0!==o?o:this.getColorAttribute()},e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series),this._arrowMark&&this.setMarkStyle(this._arrowMark,{path:t=>this._getArrowPath(t),fill:null!==(h=null===(l=null==p?void 0:p.style)||void 0===l?void 0:l.fill)&&void 0!==h?h:this.getColorAttribute()},e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series),this._titleMark&&this.setMarkStyle(this._titleMark,Object.assign(Object.assign({fontSize:14},f),{x:t=>this._getTitlePosition(t,x).x,y:t=>this._getTitlePosition(t,x).y,textAlign:t=>this._getLabelTextAlign(t),textBaseline:t=>this._getLabelTextBaseline(t,!0),text:t=>this._getDatumString(t,this._eventField)}),e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series),this._subTitleMark&&this.setMarkStyle(this._subTitleMark,Object.assign(Object.assign({},v),{x:t=>this._getSubTitlePosition(t,x,b).x,y:t=>this._getSubTitlePosition(t,x,b).y,textAlign:t=>this._getLabelTextAlign(t),textBaseline:t=>this._getLabelTextBaseline(t,!1),text:t=>this._getDatumString(t,this._subTitleField)}),e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series);const _=this._spec.icon,S="number"==typeof(null===(c=null==_?void 0:_.style)||void 0===c?void 0:c.size)?_.style.size:20,A=(s.isValid(null==_?void 0:_.offset)?_.offset+g/2:x)+S/2;this._iconMark&&this.setMarkStyle(this._iconMark,{x:t=>this._getIconPosition(t,A).x,y:t=>this._getIconPosition(t,A).y,size:S,fill:null!==(u=null===(d=null==_?void 0:_.style)||void 0===d?void 0:d.fill)&&void 0!==u?u:this.getColorAttribute(),shape:t=>this._getDatumString(t,this._iconField)||"circle"},e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series)}_getLabelSide(t){const e=this._getViewDataList().indexOf(t),i=this._labelPosition;if("vertical"===this.direction)switch(i){case"left":default:return"primary";case"right":return"secondary";case"left-right":return e%2==0?"primary":"secondary";case"right-left":return e%2==0?"secondary":"primary"}else switch(i){case"top":default:return"primary";case"bottom":return"secondary";case"top-bottom":return e%2==0?"primary":"secondary";case"bottom-top":return e%2==0?"secondary":"primary"}}_getLabelTextAlign(t){if("vertical"===this.direction){return"primary"===this._getLabelSide(t)?"right":"left"}return"center"}_getLabelTextBaseline(t,e){if("vertical"===this.direction)return"middle";return"primary"===this._getLabelSide(t)?"bottom":"top"}_getTitlePosition(t,e){const i=this._getPoint(t),s=this._getLabelSide(t);return"vertical"===this.direction?{x:"primary"===s?i.x-e:i.x+e,y:i.y}:{x:i.x,y:"primary"===s?i.y-e:i.y+e}}_getSubTitlePosition(t,e,i){var s,r,a,n;const o=this._getPoint(t),l=this._getLabelSide(t),h=null!==(r=null===(s=this._spec.title)||void 0===s?void 0:s.subTitleGap)&&void 0!==r?r:4;if("vertical"===this.direction){const t=null!==(n=null===(a=this._spec.title)||void 0===a?void 0:a.style)&&void 0!==n?n:{},s="number"==typeof t.lineHeight?t.lineHeight:1.2*i;return{x:"primary"===l?o.x-e:o.x+e,y:o.y+s+h}}return{x:o.x,y:"primary"===l?o.y-(e+i+h):o.y+(e+i+h)}}_getIconPosition(t,e){const i=this._getPoint(t),s=this._getLabelSide(t);return"vertical"===this.direction?{x:"primary"===s?i.x+e:i.x-e,y:i.y}:{x:i.x,y:"primary"===s?i.y+e:i.y-e}}_getViewDataList(){var t,e;return null!==(e=null===(t=this.getViewData())||void 0===t?void 0:t.latestData)&&void 0!==e?e:[]}_getPoint(t){if("vertical"===this.direction){return{x:this._getPositionFromAxis(t,this.getXAxisHelper(),this._seriesField),y:this._getPositionFromAxis(t,this.getYAxisHelper(),this._timeField)}}return{x:this._getPositionFromAxis(t,this.getXAxisHelper(),this._timeField),y:this._getPositionFromAxis(t,this.getYAxisHelper(),this._seriesField)}}_getPositionFromAxis(t,e,i){var s,r,a,n,o,l;if(!e)return this._getDefaultPosition(i);if(!i||!(i in t))return this._getDefaultPosition(i);const h=t[i];return"band"!==(null===(r=null===(s=e.getSpec)||void 0===s?void 0:s.call(e))||void 0===r?void 0:r.type)&&e.isContinuous?null!==(l=null===(o=e.valueToPosition)||void 0===o?void 0:o.call(e,h))&&void 0!==l?l:this._getDefaultPosition(i):null!==(n=null===(a=e.dataToPosition)||void 0===a?void 0:a.call(e,[h],{bandPosition:.5}))&&void 0!==n?n:this._getDefaultPosition(i)}onXAxisHelperUpdate(){var t;null===(t=super.onXAxisHelperUpdate)||void 0===t||t.call(this),this.onMarkPositionUpdate()}onYAxisHelperUpdate(){var t;null===(t=super.onYAxisHelperUpdate)||void 0===t||t.call(this),this.onMarkPositionUpdate()}_getDefaultPosition(t){const e=this._region.getLayoutRect();if(!this._seriesField||t===this._seriesField){return"vertical"!==this.direction?.5*e.height:.5*e.width}return 0}_getAxisPoints(t){const e=this._region.getLayoutRect();if("vertical"===this.direction){const i=this._getPositionFromAxis(t,this.getXAxisHelper(),this._seriesField);return[{x:i,y:0},{x:i,y:e.height}]}const i=this._getPositionFromAxis(t,this.getYAxisHelper(),this._seriesField);return[{x:0,y:i},{x:e.width,y:i}]}_isFirstDataInGroup(t){if(!this._seriesField){return 0===this._getViewDataList().indexOf(t)}const e=this._getViewDataList(),i=t[this._seriesField];return t===e.find((t=>this._seriesField&&t[this._seriesField]===i))}_getNextDatum(t){const e=this._getViewDataList(),i=e.indexOf(t);if(-1===i||i===e.length-1)return null;if(!this._seriesField)return e[i+1];const s=t[this._seriesField];for(let t=i+1;t<e.length;t++){const i=e[t];if(i[this._seriesField]===s)return i}return null}_getPreviousDatum(t){const e=this._getViewDataList(),i=e.indexOf(t);if(-1===i||0===i)return null;if(!this._seriesField)return e[i-1];const s=t[this._seriesField];for(let t=i-1;t>=0;t--){const i=e[t];if(i[this._seriesField]===s)return i}return null}_getArrowPath(t){var e,i;const s=this._getPoint(t),r=this._getNextDatum(t),a=this._getPreviousDatum(t),n=null!==(i=null===(e=this._spec.arrow)||void 0===e?void 0:e.thickness)&&void 0!==i?i:16,o=this._region.getLayoutRect();if("vertical"===this.direction){const t=this.getYAxisHelper().isInverse(),e=a?{x:s.x,y:(this._getPoint(a).y+s.y)/2}:{x:s.x,y:t?0:o.height},i=r?{x:s.x,y:(this._getPoint(r).y+s.y)/2}:{x:s.x,y:t?o.height:0},l=t?1:-1,h=n/3,c=n/2;return`M ${e.x-c} ${e.y} L ${e.x} ${e.y+l*h} L ${e.x+c} ${e.y} \n L ${i.x+c} ${i.y-l*h} \n L ${i.x} ${i.y}\n L ${i.x-c} ${i.y-l*h} Z`}const l=this.getXAxisHelper().isInverse(),h=a?{x:(this._getPoint(a).x+s.x)/2,y:s.y}:{x:l?o.width:0,y:s.y},c=r?{x:(this._getPoint(r).x+s.x)/2,y:s.y}:{x:l?0:o.width,y:s.y},d=l?-1:1,u=n/2,p=n/3;return`M ${h.x} ${h.y-u} L ${h.x+d*p} ${h.y} L ${h.x} ${h.y+u} \n L ${c.x-d*p} ${c.y+u} \n L ${c.x} ${c.y} \n L ${c.x-d*p} ${c.y-u} Z`}_getDatumString(t,e){if(!t||!e)return"";const i=t[e];return"string"==typeof i?i:null==i?"":String(i)}valueToPosition(t,e){if(t&&"object"==typeof t)return this.dataToPosition(t);const i={};return this._timeField&&(i[this._timeField]=t),this._eventField&&void 0!==e&&(i[this._eventField]=e),this._getPoint(i)}getActiveMarks(){return[this._axisLineMark,this._dotMark,this._iconMark,this._arrowMark,this._titleMark,this._subTitleMark].filter(Boolean)}}vo.type=fo,vo.mark=yo,vo.builtInTheme={event:{dot:{style:{size:8}},icon:{visible:!1,style:{size:20}},line:{visible:!0,style:{stroke:"#c0c3c7",lineWidth:1}},title:{visible:!0,offset:6,subTitleGap:4,style:{fontSize:14}},subTitle:{visible:!0,style:{fontSize:12}},arrow:{visible:!1,thickness:16}}},vo.transformerConstructor=e.BaseSeriesSpecTransformer;const bo=()=>{e.registerSymbolMark(),e.registerTextMark(),e.registerLineMark(),e.registerPathMark(),e.Factory.registerSeries(vo.type,vo)};class xo extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=mo,this.type="timeline",this.seriesType="event"}}xo.type="timeline",xo.seriesType="event",xo.transformerConstructor=mo;const _o="seriesBreak";function So(t,e,i,s,r=!1){const a=[],{x:n,y:o}=t,{x:l,y:h}=e,c=r?Math.floor((h-o)/(2*i)):Math.floor((l-n)/(2*i)),d=Math.PI/180*s,u=i*Math.cos(d),p=i*Math.sin(d);a.push(`M ${n} ${o}`);for(let t=0;t<=c;t++){const e=r?n+(t%2==0?u:-u):n+t*i*2,s=r?o+t*i*2:t%2==0?o-p:o+p;a.push(`L ${e} ${s}`)}return a.push(`L ${r?n:l} ${r?h:o}`),a.join(" ")}class Ao extends e.AbstractComponent{constructor(){super(...arguments),this.name=_o}render(){this.removeAllChild();const{data:t=[]}=this.attribute;if(e.isEmpty(t))return;const i=[],s=[];t.forEach((t=>{const{start:r,end:a}=t;((t,i)=>{const{start:s,end:r}=i,a=s.x===r.x,n=a?"x":"y",o=a?"y":"x";let l=!0;const h=1e-6;t.length&&t.forEach((t=>{if(e.isNumberClose(t.start[n],s[n])){const e=Math.min(s[o],r[o]),i=Math.max(s[o],r[o]),a=Math.min(t.start[o],t.end[o]),n=Math.max(t.start[o],t.end[o]);if(!(i<a-h||e>n+h))return t.start[o]=Math.min(a,e),t.end[o]=Math.max(n,i),void(l=!1)}})),l&&t.push(i)})(r.x===a.x?i:s,t)})),[...i,...s].forEach(((t,i)=>{var s;const{start:r,end:a,size:n=4,gap:o=5,style:l={}}=t,h=f(t,["start","end","size","gap","style"]),c=e.createGroup({}),d=r.x===a.x;let u,p,g,m;d?(u={x:r.x-o/2,y:r.y},p={x:a.x-o/2,y:a.y},g={x:r.x+o/2,y:r.y},m={x:a.x+o/2,y:a.y}):(u={x:r.x,y:r.y-o/2},p={x:a.x,y:a.y-o/2},g={x:r.x,y:r.y+o/2},m={x:a.x,y:a.y+o/2});const y=So(u,p,n,d?75:15,d),v=So(r,a,n,d?75:15,d),b=So(g,m,n,d?75:15,d);c.add(e.createPath(Object.assign(Object.assign({path:y,stroke:"#000",lineWidth:1},l),{pickable:!1,zIndex:1}))),c.add(e.createPath(Object.assign(Object.assign({path:b,stroke:"#000",lineWidth:1},l),{pickable:!1,zIndex:1}))),c.add(e.createPath({path:v,stroke:"#fff",lineWidth:o,pickable:!1,zIndex:0})),c.name="series-break",c.data=h,e.isValid(h.axisId)&&(c.id=`${null!==(s=h.axisId)&&void 0!==s?s:""}_${i}`),this.add(c)}))}}function To(t,e,i=1){return Math.abs(t-e)<i}function Co(t,i){return{type:"component",componentType:_o,interactive:!0,zIndex:500,style:{data:(s,r)=>{const a=[],n=r.vchart.getChart(),o="horizontal"===n.getAllSeries()[0].direction;return t.forEach(((t,s)=>{var r,l;const h=t.id,c=e.isValid(h)?n.getComponentByUserId(h):i&&e.isValid(i[s])?n.getComponentByIndex("axes",i[s]):null===(r=n.getComponentsByKey("axes").filter((e=>e.getSpec().breaks===t.breaks)))||void 0===r?void 0:r[0];if(!c)return;const d=null!=h?h:`${c.type}-${c.id}`,u=function(t){let{x:e,y:i}=t[0].getLayoutStartPoint(),s=e+t[0].getLayoutRect().width,r=i+t[0].getLayoutRect().height;for(let a=1;a<t.length;a++){const n=t[a],{x:o,y:l}=n.getLayoutStartPoint(),{width:h,height:c}=n.getLayoutRect();e=Math.min(e,o),s=Math.max(s,h+o),i=Math.min(i,l),r=Math.max(r,c+l)}return{x1:e,y1:i,x2:s,y2:r}}(c.getRegions());e.array(null===(l=c._break)||void 0===l?void 0:l.breaks).forEach((t=>{const{range:e,breakSymbol:i,gap:s=5}=t,r=c.valueToPosition(e[0]),l=c.valueToPosition(e[1]),h=(r+l)/2+(o?u.x1:u.y1);n.getAllSeries().forEach((t=>{if("bar"===t.type||"waterfall"===t.type){t.getMarkInName("bar").getGraphics().forEach((t=>{const n=t.AABBBounds;let c,p,g,m,f=!1;o?(f=n.x1<(r+l-s)/2&&n.x2>(r+l+s)/2,c=h,p=Math.max(n.y1+u.y1-2,u.y1),g=h,m=Math.min(n.y2+u.y1+2,u.y2)):(f=n.y1<(r+l-s)/2&&n.y2>(r+l+s)/2,c=Math.max(n.x1+u.x1-2,u.x1),p=h,g=Math.min(n.x2+u.x1+2,u.x2),m=h),f&&a.push({start:{x:c,y:p},end:{x:g,y:m},gap:s,style:null==i?void 0:i.style,axisId:d,data:e})}))}else if("line"===t.type){t.getMarkInName(t.type).getGraphics().forEach((t=>{ko(t,"line").forEach((t=>{Mo(o?{start:{x:(r+l)/2,y:0},end:{x:(r+l)/2,y:u.y2-u.y1}}:{start:{x:0,y:(r+l)/2},end:{x:u.x2-u.x1,y:(r+l)/2}},t).forEach((t=>{let r,n;o?(r={x:h,y:Math.max(t[1]+u.y1-10,u.y1)},n={x:h,y:Math.min(t[1]+u.y1+10,u.y2)}):(r={x:Math.max(t[0]+u.x1-10,u.x1),y:h},n={x:Math.min(t[0]+u.x1+10,u.x2),y:h}),a.push({start:r,end:n,gap:s,style:null==i?void 0:i.style,axisId:d,data:e})}))}))}))}else if("area"===t.type){t.getMarkInName("area").getGraphics().forEach((t=>{ko(t,"area").forEach((t=>{const n=Mo(o?{start:{x:(r+l)/2,y:0},end:{x:(r+l)/2,y:u.y2-u.y1}}:{start:{x:0,y:(r+l)/2},end:{x:u.x2-u.x1,y:(r+l)/2}},t);n.sort(((t,e)=>t[0]-e[0]));for(let r=0;r<n.length-1;r++){const l={x:n[r][0],y:n[r][1]},h={x:n[r+1][0],y:n[r+1][1]};if(wo(o?{x:l.x,y:(l.y+h.y)/2}:{x:(l.x+h.x)/2,y:l.y},t)){let t,r;o?(t={x:l.x+u.x1,y:Math.max(l.y+u.y1-0,u.y1)},r={x:h.x+u.x1,y:Math.min(h.y+u.y1+0,u.y2)}):(t={x:Math.max(l.x+u.x1-0,u.x1),y:l.y+u.y1},r={x:Math.min(h.x+u.x1+0,u.x2),y:h.y+u.y1}),a.push({start:t,end:r,gap:s,style:null==i?void 0:i.style,axisId:d,data:e})}}}))}))}}))}))})),a}}}}function Mo(t,i){const s=[];for(let r=1;r<i.length;r++){const a=e.getIntersectPoint([t.start.x,t.start.y],[t.end.x,t.end.y],[i[r].x,i[r].y],[i[r-1].x,i[r-1].y]);a&&!s.find((t=>To(e.PointService.distancePP({x:t[0],y:t[1]},{x:a[0],y:a[1]}),0)))&&s.push(a)}return s}function ko(t,e){const{points:i,segments:s}=t.attribute,r=[];let a=[];const n=t=>{if(t&&t.length){let i=[];if(t.forEach((t=>{var s,n;if(!1===t.defined){if(r.push(a),"area"===e&&i.length){for(let t=i.length-1;t>=0;t--)a.push({x:i[t].x,y:i[t].y});a.push(a[0])}a=[],i=[]}else a.push({x:t.x,y:t.y}),"area"===e&&i.push({x:null!==(s=t.x1)&&void 0!==s?s:t.x,y:null!==(n=t.y1)&&void 0!==n?n:t.y})})),"area"===e&&i.length){for(let t=i.length-1;t>=0;t--)a.push({x:i[t].x,y:i[t].y});a.push(a[0])}r.push(a)}};return i&&i.length?n(i):s&&s.length&&s.forEach((t=>{n(t.points)})),r}function wo(t,e){const{x:i,y:s}=t;let r=!1;for(let t=0,a=e.length-1;t<e.length;a=t++){const{x:n,y:o}=e[t],{x:l,y:h}=e[a];o>s!=h>s&&i<(l-n)*(s-o)/(h-o)+n&&(r=!r)}return r}const Po="barLink";class Oo extends e.AbstractComponent{constructor(){super(...arguments),this.name=Po}render(){const{data:t,linkStyle:i,areaStyle:s,styleMap:r,label:a,linkType:n="total"}=this.attribute;e.isEmpty(t)||(this.removeAllChild(),t.forEach(((t,o)=>{var l,h,c,d,u;const{linePoints:p,areaPoints:g,id:m=o,color:f,data:y}=t;if(g&&!1!==(null===(l=null==r?void 0:r[`area-${m}`])||void 0===l?void 0:l.visible)){const t=e.createArea(Object.assign(Object.assign({points:g,fillOpacity:.3,fill:f,zIndex:0},s),null==r?void 0:r[`area-${m}`]));t.name="bar-link-area",t.id=`area-${m}`,this.add(t)}if(p&&!1!==(null===(h=null==r?void 0:r[`line-${m}`])||void 0===h?void 0:h.visible)&&0!==(null===(c=null==i?void 0:i.lineStyle)||void 0===c?void 0:c.lineWidth)&&0!==(null===(d=null==r?void 0:r[`line-${m}`])||void 0===d?void 0:d.lineWidth)){const{startSymbol:t={},endSymbol:s={},lineStyle:a}=i||{},n=e.cloneDeep(t),o=e.cloneDeep(s);(null==r?void 0:r[`line-${m}`])&&r[`line-${m}`].stroke&&(n.style=Object.assign(Object.assign({},n.style),{color:r[`line-${m}`].stroke}),o.style=Object.assign(Object.assign({},o.style),{color:r[`line-${m}`].stroke})),n.symbolType||n.originSymbolType||(n.originSymbolType="solidArrow"),o.symbolType||o.originSymbolType||(o.originSymbolType="solidArrow");const l=new e.Segment({points:p,startSymbol:Object.assign({size:8},n),endSymbol:Object.assign({size:8},o),lineStyle:Object.assign(Object.assign({lineDash:[3,3],lineWidth:1,stroke:"#000"},a),null==r?void 0:r[`line-${m}`]),pickable:!0,childrenPickable:!1,zIndex:1});l.name="bar-link-line",l.id=`line-${m}`,this.add(l)}if((null==a?void 0:a.visible)&&!1!==(null===(u=null==r?void 0:r[`label-${m}`])||void 0===u?void 0:u.visible)){const{style:t,formatMethod:i}=a,[s,o]=y;let l=s[e.STACK_FIELD_END],h=o[e.STACK_FIELD_END];"value"===n&&(l=s[e.STACK_FIELD_END]-s[e.STACK_FIELD_START],h=o[e.STACK_FIELD_END]-o[e.STACK_FIELD_START]);const c=h-l,d=(h-l)/l*100,u=e.createText(Object.assign(Object.assign({x:.5*(p[0].x+p[1].x),y:.5*(p[0].y+p[1].y),text:i?i(c,d,y):`${c} ${d}`,fontSize:14,fill:"#000",stroke:"#fff",lineWidth:1,textAlign:"center",textBaseline:"middle",background:"#fff",zIndex:2},t),null==r?void 0:r[`label-${m}`]));u.name="bar-link-label",u.id=`label-${m}`,this.add(u)}})))}}function Bo(t,i,s){const{isHorizontal:r,isXAxisInverse:a,isYAxisInverse:n,linkType:o,doFill:l,regionStartX:h,regionStartY:c}=s,d=t.AABBBounds,u=i.AABBBounds;let p,g;return r?(p=[{x:(d.x1+d.x2)/2+h,y:d.y1+c},{x:(u.x1+u.x2)/2+h,y:u.y2+c}],a?("total"===o&&(p=[{x:d.x1+h,y:d.y1+c},{x:u.x1+h,y:u.y2+c}]),l&&(g=[{x:d.x1+h,x1:d.x2+h,y:d.y1+c},{x:u.x1+h,x1:u.x2+h,y:u.y2+c}])):("total"===o&&(p=[{x:d.x2+h,y:d.y1+c},{x:u.x2+h,y:u.y2+c}]),l&&(g=[{x:d.x2+h,x1:d.x1+h,y:d.y1+c},{x:u.x2+h,x1:u.x1+h,y:u.y2+c}]))):(p=[{x:d.x2+h,y:(d.y1+d.y2)/2+c},{x:u.x1+h,y:(u.y1+u.y2)/2+c}],n?("total"===o&&(p=[{x:d.x2+h,y:d.y2+c},{x:u.x1+h,y:u.y2+c}]),l&&(g=[{x:d.x2+h,y:d.y2+c,y1:d.y1+c},{x:u.x1+h,y:u.y2+c,y1:u.y1+c}])):("total"===o&&(p=[{x:d.x2+h,y:d.y1+c},{x:u.x1+h,y:u.y1+c}]),l&&(g=[{x:d.x2+h,y:d.y1+c,y1:d.y2+c},{x:u.x1+h,y:u.y1+c,y1:u.y2+c}]))),{areaPoints:g,linePoints:p,data:[e.getDatumOfGraphic(t),e.getDatumOfGraphic(i)],color:t.attribute.fill}}function Lo(t={},i){const{linkType:s="total",doFill:r}=t,a=f(t,["linkType","doFill"]);return{type:"component",componentType:Po,zIndex:500,interactive:!1,style:Object.assign(Object.assign({data:(t,i)=>{const{vchart:a}=i,n=a.getChart().getAllRegions(),o=[];return n.forEach((t=>{const i=t.getSeries().filter((t=>"bar"===t.type)),{x:a,y:n}=t.getLayoutStartPoint();if(i.length){const t=i[0].getGroupFields(),l=[];i.forEach((t=>{var e;(null===(e=t.getMarkInName("bar"))||void 0===e?void 0:e.getGraphics()).forEach((t=>{l.push(t)}))}));const h=function(t,i){const s={};for(let r=0;r<t.length;r++){const a=t[r],n=e.getDatumOfGraphic(a),o=i.map((t=>n[t])).join("-");s[o]||(s[o]=[]),s[o].push(a)}return s}(l,t);Object.values(h).forEach((t=>{t.sort(((t,i)=>e.getDatumOfGraphic(t)[e.STACK_FIELD_END]-e.getDatumOfGraphic(i)[e.STACK_FIELD_END]))}));const c=i[0],d="horizontal"===c.direction,u=c.getYAxisHelper().isInverse(),p=c.getXAxisHelper().isInverse(),g=Object.values(h);if(g.length)if(d){g[0][0].AABBBounds.y1<g[g.length-1][0].AABBBounds.y1&&g.reverse()}else{g[0][0].AABBBounds.x1>g[g.length-1][0].AABBBounds.x1&&g.reverse()}for(let t=0;t<g.length-1;t++){const e=g[t],i=g[t+1];if(e.forEach(((t,e)=>{var l;const h=Bo(t,null!==(l=i[e])&&void 0!==l?l:i[i.length-1],{isHorizontal:d,isXAxisInverse:p,isYAxisInverse:u,doFill:r,linkType:s,regionStartX:a,regionStartY:n});o.push(h)})),e.length<i.length){const t=e[e.length-1];for(let l=e.length;l<i.length;l++){const e=Bo(t,i[l],{isHorizontal:d,isXAxisInverse:p,isYAxisInverse:u,doFill:r,linkType:s,regionStartX:a,regionStartY:n});o.push(e)}}}}})),o},linkType:s},a),i)}}const Eo="seriesLabel";function Do(t,e=10,i=10,s=.1){const r=t.length;if(!t.every(isFinite))return t;if(!(r>1))return t;const a=function(t,e,i){t=+t,e=+e;let s=arguments.length;i=s<2?(e=t,t=0,1):s<3?1:+i;let r=-1;s=0|Math.max(0,Math.ceil((e-t)/i));const a=new Array(s);for(;++r<s;)a[r]=t+r*i;return a}(t.length);for(let n=0;n<i;++n){a.sort(((e,i)=>{return s=t[e],r=t[i],null==s||null==r?NaN:s<r?-1:s>r?1:s>=r?0:NaN;var s,r}));let i=0;for(let s=1;s<r;++s){let r=t[a[s]]-t[a[s-1]];r<e&&(r=(e-r)/2,i=Math.max(i,r),t[a[s-1]]-=r,t[a[s]]+=r)}if(i<s)break}return t}function Fo(t,e){return!(e.x1>t.x2||e.x2<t.x1||e.y1>t.y2||e.y2<t.y1)}function Io(t,e=10,i=10){const s=t.length;let r,a=0;do{r=!1;for(let i=0;i<s;++i)for(let a=i+1;a<s;++a){const s=t[i].AABBBounds,n=t[a].AABBBounds;if(Fo(s,n)){const i=e-(n.x1-s.x2);i>0&&(t[a].attribute.x+=i,n.x1+=i,n.x2+=i,r=!0)}}a++}while(r&&a<i)}function Ro(t,i){const{label:s,line:r}=i;return{type:"component",componentType:Eo,interactive:!1,style:{position:t,layout:(t,e)=>{var i;return null!==(i=e.vchart.getChart().getAllSeries()[0].getSpec().direction)&&void 0!==i?i:"vertical"},data:(i,s)=>{var r;const a=s.vchart.getChart(),n=a.getAllSeries()[0],o="horizontal"===n.direction,l=o?n.getYAxisHelper():n.getXAxisHelper(),h=null===(r=l.getScale)||void 0===r?void 0:r.call(l,0),c=l.isInverse(),d=n.getDimensionField()[0],u=n.getSeriesField(),p=a.getAllSeries().map((t=>t.type)).filter(((t,e,i)=>i.indexOf(t)===e)),g=[];if(1===p.length&&["bar","area","line","waterfall"].includes(p[0])){("both-ends"===t?["start","end"]:[t]).forEach((t=>{const i="end"===t?e.last(h.domain()):h.domain()[0],s=n.getRegion(),{x:r,y:l}=s.getLayoutStartPoint();let m=0;a.getAllSeries().forEach((e=>{e.getMarkInName("waterfall"===p[0]?"bar":p[0]).getGraphics().forEach((s=>{var a;const n=s.context.data.find((t=>t[d]===i));if(n){const i=s.AABBBounds;let h,f,y,v;"bar"===p[0]||"waterfall"===p[0]?(h="end"===t?{x:o?(i.x1+i.x2)/2:c?i.x1:i.x2,y:o?c?i.y2:i.y1:(i.y1+i.y2)/2}:{x:o?(i.x1+i.x2)/2:c?i.x2:i.x1,y:o?c?i.y1:i.y2:(i.y1+i.y2)/2},f=s.attribute.fill):(h=e.dataToPosition(n),f=s.attribute.stroke||s.attribute.fill),"end"===t?(y=o?"center":c?"end":"start",v=o?c?"top":"bottom":"middle"):(y=o?"center":c?"start":"end",v=o?c?"bottom":"top":"middle");const b=null!==(a=n[u])&&void 0!==a?a:n[d];g.push({point:{x:h.x+r,y:h.y+l},label:b,color:f,textAlign:y,textBaseline:v,series:e,datum:n,id:`${t}-${m}`,position:t}),m++}}))}))}))}return g},line:r,label:Object.assign({space:12},s)}}}class No extends e.AbstractComponent{constructor(){super(...arguments),this.name=Eo}render(){var t,i,s,r;this.removeAllChild();const{data:a,layout:n,label:o,line:l={}}=this.attribute;if(e.isEmpty(a))return;const h=null!==(t=null==o?void 0:o.styleMap)&&void 0!==t?t:{},c={},d=a.filter((t=>{var e;return!1!==(null===(e=h[t.id])||void 0===e?void 0:e.visible)}));if("vertical"===n){const t=1.5*(null!==(s=null===(i=null==o?void 0:o.style)||void 0===i?void 0:i.fontSize)&&void 0!==s?s:12),r=(t,i,s)=>{var r,a,n,o,l,h,c,d;const{label:u,color:p,textAlign:g,textBaseline:m,id:f}=t,y=null!==(a=null===(r=s[f])||void 0===r?void 0:r.formatMethod)&&void 0!==a?a:null===(n=this.attribute.label)||void 0===n?void 0:n.formatMethod,v=e.createText(Object.assign(Object.assign(Object.assign(Object.assign({text:y?y(u,t.datum,{series:t.series}):u},null===(o=this.attribute.label)||void 0===o?void 0:o.style),i),{textAlign:g,textBaseline:m,fill:null!==(c=null===(h=null===(l=this.attribute.label)||void 0===l?void 0:l.style)||void 0===h?void 0:h.fill)&&void 0!==c?c:p}),null===(d=s[f])||void 0===d?void 0:d.style));return v.name="series-label-text",v.id=f,this.add(v),v};["start","end"].forEach((e=>{const i=d.filter((t=>t.position===e)),s=Do(i.map((t=>t.point.y)),t);i.forEach(((t,e)=>{var i;const a={x:t.point.x+(null!==(i=null==o?void 0:o.space)&&void 0!==i?i:8)*("start"===t.textAlign?1:-1),y:s[e]};r(t,a,h),c[t.id]=a}))}))}else{const t=[],i=[];d.forEach((s=>{var r,a,n,l,c;const{point:d,label:u,color:p,textAlign:g,textBaseline:m,id:f,position:y}=s,v={x:d.x,y:d.y},b=null!==(a=null===(r=h[f])||void 0===r?void 0:r.formatMethod)&&void 0!==a?a:null==o?void 0:o.formatMethod,x=e.createText(Object.assign(Object.assign(Object.assign(Object.assign({text:b?b(u,s.datum,{series:s.series}):u},null==o?void 0:o.style),v),{textAlign:g,textBaseline:m,fill:null!==(l=null===(n=null==o?void 0:o.style)||void 0===n?void 0:n.fill)&&void 0!==l?l:p}),null===(c=h[f])||void 0===c?void 0:c.style));x.id=f,x.name="series-label-text",this.add(x),"start"===y?t.push(x):"end"===y&&i.push(x)})),t.length&&Io(t,4,10),i.length&&Io(i,4,10);const s=null!==(r=null==o?void 0:o.space)&&void 0!==r?r:8;[...t,...i].forEach((t=>{const e="top"===t.attribute.textBaseline?1:-1;t.setAttribute("y",t.attribute.y+s*e),c[t.id]={x:t.attribute.x,y:t.attribute.y}}))}!1!==l.visible&&d.forEach((t=>{var i,s,r,a,o,d;const{point:u,color:p,id:g}=t,m={x:c[g].x+(null!==(r=null===(s=null===(i=h[g])||void 0===i?void 0:i.style)||void 0===s?void 0:s.dx)&&void 0!==r?r:0),y:c[g].y+(null!==(d=null===(o=null===(a=h[g])||void 0===a?void 0:a.style)||void 0===o?void 0:o.dy)&&void 0!==d?d:0)};if(!1!==l.autoVisible){if("vertical"===n&&u.y!==m.y||"horizontal"===n&&u.x!==m.x){const t=e.createLine(Object.assign({points:[u,m],lineWidth:1,stroke:p},l.style));t.name="series-label-line",this.add(t)}}else{const t=e.createLine(Object.assign({points:[u,m],lineWidth:1,stroke:p},l.style));t.name="series-label-line",this.add(t)}}))}}function jo(t,e,i=0){return i>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2)}function Uo(t){return{x1:t.x,x2:t.x+t.width,y1:t.y,y2:t.y+t.height}}function zo(t){var e;if(!t||0===t.length)return[];if(1===t.length)return[t[0].rect];const i=t.map((t=>{var e;return Object.assign(Object.assign({},t),{bound:Uo(t.rect),anchorCandidates:Xo(null!==(e=t.anchors)&&void 0!==e?e:[],t.point,t.rect,t.offset)})})),s=[];s.push(i[0].bound);for(let t=1;t<=i.length-1;t++){const r=i[t],a=r.bound;let n=s.some((t=>jo(t,a)));if(r.anchorCandidates)if(n&&(null===(e=r.anchorCandidates)||void 0===e?void 0:e.length)>0){for(let t=0;t<r.anchorCandidates.length;t++){const e=r.anchorCandidates[t],i={x1:e.x,y1:e.y,x2:e.x+a.x2-a.x1,y2:e.y+a.y2-a.y1,anchor:e};if(!s.some((t=>jo(t,i)))){s.push(i),n=!1;break}}n&&s.push(r.bound)}else s.push(r.bound)}return s.map((t=>function(t){return{x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}}(t)))}function Vo(t,i,s){const r=t.map((t=>t.pointCoord)),{x1:a,x2:n,y1:o,y2:l}=e.getAABBFromPoints(r),h=s([(a+n)/2,(o+l)/2]);if(!h)return[];const c=t.map((t=>{const r=t.rect,a=Ho(i,t.pointCoord)?s(function(t,i,s,r=200){const a=5621/r;let n=i;for(let i=1;i<=a;i++){const i=e.destination(n,r,s);if(!Ho(t,i))return[i.x,i.y];n=[i.x,i.y]}return i}(i,[t.pointCoord.x,t.pointCoord.y],Go(Wo(t.point,h)))):t.point;a&&(r.x=a.x,r.y=a.y);const n=Go(Wo(t.point,h));let o;const l=[];return n>=-45&&n<45?(o="top",l.push("left","right")):n>=45&&n<135?o="right":n>=-135&&n<-45?(o="left",l.push("left")):(o="bottom",l.push("left","right")),t.anchors=l,t.offset=20,t.rect=$o(t.rect,o,0),t}));return zo(c)}function Go(t){return t>180?t-360:t}function Wo(t,e){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI+90}function Ho(t,i){for(let s=0;s<t.length;s++){if(e.isPointInPolygon(i,t[s]))return!0}return!1}function $o(t,e,i=0){const s=Object.assign({},t);return"top"===e?(s.x-=t.width/2,s.y-=i+t.height/2):"bottom"===e?(s.x-=t.width/2,s.y+=i-t.height/2):"left"===e?(s.x-=i+t.width,s.y-=t.height/2):"right"===e&&(s.x+=i,s.y-=t.height/2),s}function Xo(t,e,i,s=0){const r=[];return t.forEach((t=>{const{x:a,y:n}=$o(Object.assign(Object.assign({},e),{width:i.width,height:i.height}),t,s);r.push({x:a,y:n})})),r}const Yo={visible:!0,offset:12,position:"top",space:10,nameLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:10}},valueLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:10}},background:{visible:!0,padding:{top:4,bottom:4,left:6,right:6},style:{cornerRadius:2,lineWidth:1,fill:"white",stroke:"grey"}},leader:{visible:!1,style:{lineWidth:1,stroke:"black"}}};class Ko extends e.BaseComponentSpecTransformer{_getDefaultSpecFromChart(){return Yo}}class qo extends e.BaseComponent{constructor(){super(...arguments),this.type="mapLabel",this.name=" mapLabel",this.specKey="mapLabel",this.transformerConstructor=Ko,this.layoutType="none",this.layoutZIndex=e.LayoutZIndex.MarkPoint,this._activeDatum=[]}static getSpecInfo(t){return e.getSpecInfo(t,this.specKey,this.type,(t=>t.visible&&e.isValid(t.seriesId)))}setAttrFromSpec(){var t,e,i,s;this.nameField=null!==(t=this._spec.nameField)&&void 0!==t?t:null===(e=this._series)||void 0===e?void 0:e.getDimensionField()[0],this.valueField=null!==(i=this._spec.valueField)&&void 0!==i?i:null===(s=this._series)||void 0===s?void 0:s.getMeasureField()[0]}created(){super.created(),!1!=!!this._spec.visible&&(this.initRelatedInfo(),this.initData(),this.initEvent())}initRelatedInfo(){var t,e,i,s,r,a,n,o;this._series=this._option.getSeriesInUserIdOrIndex([this._spec.seriesId])[0],"outer"===this._spec.position&&(this._map=null===(e=null===(t=this._regions[0].getSeriesInType("map")[0])||void 0===t?void 0:t.getMapViewData())||void 0===e?void 0:e.latestData,this._longitudeField=null===(r=null===(s=(i=this._regions[0]).getSpec)||void 0===s?void 0:s.call(i))||void 0===r?void 0:r.longitudeField,this._latitudeField=null===(o=null===(n=(a=this._regions[0]).getSpec)||void 0===n?void 0:n.call(a))||void 0===o?void 0:o.latitudeField)}initData(){const t=this._series;if(!t)return;const i=t.getViewData();if(i){const t=new e.DataView(this._option.dataSet,{name:`${this.name}_data`});t.parse([i],{type:"dataview"}),t.transform({type:"copyDataView",level:e.TransformLevel.copyDataView},!1),this._data=new e.CompilableData(this._option,t),t.target.addListener("change",(()=>{"hover"!==this._spec.trigger&&"click"!==this._spec.trigger&&(this._activeDatum=this._data.getLatestData())}))}}initEvent(){this.event.on("zoom",{filter:t=>this._isRelativeModel(t.model)},(()=>(this.handleZoom(),!0))),this.event.on("panmove",{filter:t=>this._isRelativeModel(t.model)},(t=>(this.handlePan(t),!0)));const t=this._spec.trigger;"none"!==t&&("hover"===t?(this.event.on("element-highlight:start",(t=>{const i=t.graphics[0];this._isRelativeSeries(i)&&this._updateDatum(e.getDatumOfGraphic(i))})),this.event.on("element-highlight:reset",(t=>{this._activeDatum&&this._updateDatum(null)}))):"click"===t&&(this.event.on("element-select:start",(t=>{const i=t.graphics[0];this._isRelativeSeries(i)&&this._updateDatum(e.getDatumOfGraphic(i))})),this.event.on("elementSelectReset",(t=>{this._activeDatum&&this._updateDatum([])}))))}handlePan(t){const{delta:e}=t;this._markerComponents.forEach((t=>{t.translate(e[0],e[1])}))}handleZoom(){this._updateMarkerLayoutAttribute()}_updateDatum(t){this._activeDatum=t,this._markerComponents.forEach(((t,e)=>{var i;const s=null===(i=this._data)||void 0===i?void 0:i.getLatestData()[e];this._activeDatum.includes(s)?t.setAttribute("visible",!0):t.setAttribute("visible",!1)}))}dataToPosition(t){return this._series.dataToPosition(t)}updateLayoutAttribute(){var t;const e=null===(t=this._data)||void 0===t?void 0:t.getLatestData();e&&0!==e.length&&(super.updateLayoutAttribute(),this._updateMarkerLayoutAttribute())}_updateMarkerLayoutAttribute(){var t;const i=[],s=[];this._markerComponents||(this._markerComponents=null===(t=this._data)||void 0===t?void 0:t.getLatestData().map(((t,i)=>{var s;const r=new e.MarkPoint({position:void 0,animation:!1});return r&&(r.name=`${this.name}_marker_${i}`,r.id=null!==(s=this._spec.id)&&void 0!==s?s:`${this.name}_marker_${this.id}`,r.setAttribute("zIndex",this.layoutZIndex)),r})));this._markerComponents.forEach(((t,e)=>{const{pairInfo:r,contentMarks:a}=this._evaluateMarker(this._data.getLatestData()[e],e);r&&i.push(r),a&&s.push(a)}));const r=this._layoutLabels(i);this._layoutMarkers(r,s),this._renderMarkers()}_evaluateMarker(t,i){var s,r,a,n,o,l,h,c,d,u,p,g,m,f;let y=0,v=0,b=0,x=0,_=0;const S=this._spec.position||"top",A=this._spec.offset,T=e.normalizeLayoutPaddingSpec(null===(s=this._spec.background)||void 0===s?void 0:s.padding),C=this._spec.space||0;v+=((null==T?void 0:T.left)||0)+((null==T?void 0:T.right)||0),b+=((null==T?void 0:T.top)||0)+((null==T?void 0:T.bottom)||0);const M={},k=this.dataToPosition(t),w=e.graphicCreator.group({});if(w.name=`${this.name}_marker_itemContainer_${i}`,M.container=w,null===(r=this._spec.background)||void 0===r?void 0:r.visible){const t=e.graphicCreator.rect(e.transformToGraphic(Object.assign({},this._spec.background.style)));t.setAttributes(k),M.labelBackground=t,w.appendChild(t)}if(null===(a=this._spec.icon)||void 0===a?void 0:a.visible){const t=e.graphicCreator.symbol(e.transformToGraphic(Object.assign({},this._spec.icon.style)));t.setAttributes(k),t.setAttribute("symbolType",null!==(o=null===(n=this._spec.icon.style)||void 0===n?void 0:n.symbolType)&&void 0!==o?o:null===(l=this._spec.icon.style)||void 0===l?void 0:l.shape);const i=t.AABBBounds,s=null!==(h=(null==i?void 0:i.y2)-(null==i?void 0:i.y1))&&void 0!==h?h:0,r=null!==(c=(null==i?void 0:i.x2)-(null==i?void 0:i.x1))&&void 0!==c?c:0;M.icon=t,w.appendChild(t),_=s,x+=r,y++}if(null===(d=this._spec.nameLabel)||void 0===d?void 0:d.visible){const i=e.graphicCreator.text(e.transformToGraphic(Object.assign({},this._spec.nameLabel.style)));i.setAttributes(k),i.setAttribute("text",t[this.nameField]);const s=i.AABBBounds,r=null!==(u=(null==s?void 0:s.y2)-(null==s?void 0:s.y1))&&void 0!==u?u:0,a=null!==(p=(null==s?void 0:s.x2)-(null==s?void 0:s.x1))&&void 0!==p?p:0;M.nameLabel=i,w.appendChild(i),_=Math.max(_,r),x+=a,y++}if((null===(g=this._spec.valueLabel)||void 0===g?void 0:g.visible)&&e.isValid(t[this.valueField])){const i=e.graphicCreator.text(e.transformToGraphic(Object.assign({},this._spec.valueLabel.style)));i.setAttributes(k),i.setAttribute("text",t[this.valueField]);const s=i.AABBBounds,r=null!==(m=(null==s?void 0:s.y2)-(null==s?void 0:s.y1))&&void 0!==m?m:0,a=null!==(f=(null==s?void 0:s.x2)-(null==s?void 0:s.x1))&&void 0!==f?f:0;M.valueLabel=i,w.appendChild(i),_=Math.max(_,r),x+=a,y++}const P=Object.values(M).find((t=>!!t&&"group"!==t.type)),O={x:null==P?void 0:P.getComputedAttribute("x"),y:null==P?void 0:P.getComputedAttribute("y")},B={x:O.x,y:O.y,width:0,height:0};B.width=v+x+(y-1)*C,B.height=b+_;const L={rect:B,point:O,index:i};if("outer"!==S){const t=["top","right","left","bottom"].filter((t=>t!==S));L.rect=$o(B,S,A),L.anchors=t,L.offset=A}else L.pointCoord={x:+(null==t?void 0:t[this._longitudeField]),y:+(null==t?void 0:t[this._latitudeField])};return{pairInfo:L,contentMarks:M}}_layoutMarkers(t,i){var s,r,a;for(let n=0;n<i.length;n++){if(!t[n]||!i[n])return;const{icon:o,nameLabel:l,valueLabel:h,labelBackground:c,container:d}=i[n],u=t[n],p=e.normalizeLayoutPaddingSpec(null===(s=this._spec.background)||void 0===s?void 0:s.padding),g=this._spec.space||0,m=u.height/2;let f=(null==p?void 0:p.left)||0;[o,l,h].forEach(((t,e)=>{var i,s;if(t){const r=t.AABBBounds;let a=0;"symbol"===t.type&&(a+=(null!==(i=r.x2-r.x1)&&void 0!==i?i:0)/2),t.setAttributes({x:f+a,y:m}),f+=null!==(s=r.x2-r.x1)&&void 0!==s?s:0,2!==e&&(f+=g)}})),null==c||c.setAttributes({x:0,y:0,width:u.width,height:u.height}),null==d||d.setAttributes({dx:-u.width/2,dy:-u.height/2});const y=this._data.getLatestData()[n],v=this.dataToPosition(y),b=this.getRegions()[0].getLayoutStartPoint(),x=!(!(null===(r=this._spec.leader)||void 0===r?void 0:r.visible)||!(o||l||h));this._markerComponents[n].setAttributes({x:b.x,y:b.y,position:v,visible:this._activeDatum.includes(y),itemContent:{refX:0,type:"custom",renderCustomCallback:()=>d,autoRotate:!1,offsetX:u.x+u.width/2-v.x,offsetY:u.y+u.height/2-v.y},itemLine:{visible:x,type:"type-po",lineStyle:e.transformToGraphic(Object.assign({},null===(a=this._spec.leader)||void 0===a?void 0:a.style)),startSymbol:{visible:!1}}})}}_renderMarkers(){if(this._markerComponents&&this._markerComponents.length)for(let t=0;t<this._markerComponents.length;t++)this.getContainer().add(this._markerComponents[t])}_layoutLabels(t){return"outer"===this._spec.position&&this._map?Vo(t,this._map,(t=>this._series.dataToPosition({[this._longitudeField]:t[0],[this._latitudeField]:t[1]}))):zo(t)}_isRelativeModel(t){var e,i,s;const r=null!==(i=null===(e=this._series.getXAxisHelper())||void 0===e?void 0:e.getAxisId())&&void 0!==i?i:null===(s=this._series.getCoordinateHelper())||void 0===s?void 0:s.getCoordinateId();return(null==t?void 0:t.id)===r}_isRelativeSeries(t){var e;return(null===(e=t.context)||void 0===e?void 0:e.modelId)===this._series.id}_getNeedClearVRenderComponents(){return this._markerComponents}getVRenderComponents(){return this._markerComponents}}qo.type="mapLabel",qo.specKey="mapLabel",qo.transformerConstructor=Ko;const Zo="regressionLine";class Qo extends e.AbstractComponent{constructor(){super(...arguments),this.name=Zo}render(){this.removeAllChild();const{data:t,line:i={},label:s,name:r="regression-line",confidenceInterval:a}=this.attribute;e.isEmpty(t)||t.forEach((t=>{const{color:n}=t;if(t.area&&!1!==(null==a?void 0:a.visible)){const i=e.createArea(Object.assign(Object.assign({points:t.area},e.isValid(n)?{fill:n,fillOpacity:.12}:null),null==a?void 0:a.style));i.name="scatter-regression-area",this.add(i)}if(t.line&&!1!==(null==i?void 0:i.visible)){const s=e.createLine(Object.assign(Object.assign({points:t.line,lineWidth:1},e.isValid(n)?{stroke:n}:null),null==i?void 0:i.style));s.name=`${r}-curve`,this.add(s)}const o=e.last(t.line);if(s&&!1!==s.visible&&s.text&&o){const t=e.createText(Object.assign(Object.assign(Object.assign({},o),{text:s.text,textAlign:"end",textBaseline:"middle"}),s.style));t.name=`${r}-label`,this.add(t)}}))}}const Jo=(t,i,s=(t=>t.x),r=(t=>t.y),a)=>{switch(t){case"logisitc":return e.regressionLogistic(i,s,r);case"lowess":return e.regressionLowess(i,s,r);case"polynomial":return e.regressionPolynomial(i,s,r,{degree:a});default:return e.regressionLinear(i,s,r)}};function tl(t,i){const{color:s,line:r,confidenceInterval:a,label:n}=i;return{type:"component",componentType:Zo,interactive:!1,style:{data:(r,a)=>{const n=a.vchart.getChart().getAllSeries().filter((t=>t.type===e.SeriesTypeEnum.scatter)),o=[];return n&&n.length&&n.forEach((r=>{var a,n;const l=r.getRegion().getLayoutStartPoint(),h=r.getRegion().getLayoutRect(),c=e.clamper(l.y,l.y+h.height),d=r.getColorAttribute(),u=r.getSeriesKeys(),p=r.getViewData().latestData,g=null===(a=r.fieldX)||void 0===a?void 0:a[0],m=null===(n=r.fieldY)||void 0===n?void 0:n[0];g&&m&&p&&!(p.length<=2)&&u.forEach((e=>{var a;const n=p.filter((t=>t[null==d?void 0:d.field]===e));if(!n.length)return;const{evaluateGrid:u,confidenceInterval:f}=Jo(t,n,(t=>null==t?void 0:t[g]),(t=>null==t?void 0:t[m]),i.polynomialDegree),y=Math.max(3,Math.floor(n.length/4)),v=u(y),b=f(y);o.push({color:null!=s?s:null===(a=null==d?void 0:d.scale)||void 0===a?void 0:a.scale(e),line:v.map((e=>{const i={[g]:e.x,[m]:e.y};return{x:r.dataToPositionX(i)+l.x,y:c("logisitc"===t?l.y+h.height*(1-e.y):r.dataToPositionY(i)+l.y)}})),area:b.map((t=>{const e={[g]:t.x,[m]:t.lower};return{x:r.dataToPositionX(e)+l.x,y:c(r.dataToPositionY(e)+l.y),y1:c(r.dataToPositionY({[m]:t.upper})+l.y)}}))})}))})),o},line:r,confidenceInterval:a,label:n}}}function el(t){const{color:i,line:s,confidenceInterval:r,label:a}=t;return{type:"component",componentType:Zo,interactive:!1,zIndex:500,style:{data:(s,r)=>{const a=r.vchart.getChart().getAllSeries().filter((t=>t.type===e.SeriesTypeEnum.bar)),n=[];return a&&a.length&&a.forEach((s=>{var r,a,o;const l=s.getRegion().getLayoutStartPoint(),h=s.getRegion().getLayoutStartPoint(),c=s.getRegion().getLayoutRect(),d=e.clamper(h.y,h.y+c.height),u=s.getViewData().latestData,p=null===(r=s.fieldX)||void 0===r?void 0:r[0],g=null===(a=s.fieldY)||void 0===a?void 0:a[0],m="horizontal"===s.direction,f=s.getRawDataStatisticsByField(p).values;if(m||!p||!g||!u||u.length<=2||f.length<=2)return;const{evaluateGrid:y,confidenceInterval:v}=e.regressionPolynomial(u,(t=>f.indexOf(null==t?void 0:t[p])),(t=>null==t?void 0:t[g]),{degree:t.degree}),b=f.length,x=y(b),_=v(b),S=s.getXAxisHelper().getBandwidth(0)/2;n.push({color:null!=i?i:null===(o=s.getOption().globalScale.getScale("color"))||void 0===o?void 0:o.scale(s.getSeriesKeys()[0]),line:x.map((t=>{const e={[p]:f[t.x],[g]:t.y};return{x:s.dataToPositionX(e)+l.x+S,y:d(s.dataToPositionY(e)+l.y)}})),area:_.map((t=>{const e={[p]:f[t.x],[g]:t.lower};return{x:s.dataToPositionX(e)+l.x+S,y:d(s.dataToPositionY(e)+l.y),y1:d(s.dataToPositionY({[g]:t.upper})+l.y)}}))})})),n},line:s,confidenceInterval:r,label:a}}}const il=(t,i,s)=>{switch(t){case"kde":return e.kde(i,s);case"ecdf":return e.ecdf(i)}};function sl(t,i){const{line:s,label:r,color:a}=i;return{type:"component",componentType:Zo,interactive:!1,zIndex:500,style:{data:(i,s)=>{const r=s.vchart.getChart().getAllSeries().filter((t=>t.type===e.SeriesTypeEnum.bar)),n=[];return r&&r.length&&r.forEach((i=>{var s,r,o,l,h,c,d,u;const p=i.getRegion().getLayoutStartPoint(),g=i._rawData,m=null==g?void 0:g.rawData,f=null===(r=null===(s=g.transformsArr)||void 0===s?void 0:s.find((t=>"bin"===t.type)))||void 0===r?void 0:r.options,y=null===(o=i.fieldX)||void 0===o?void 0:o[0],v=i.getYAxisHelper().getScale(0),b=i.getViewData().latestData;if(!(m&&m.length&&(null==f?void 0:f.field)&&v&&b&&b.length))return;const x=m.map((t=>t[f.field])),_=il(t,x,"kde"===t?{bandwidth:b[0][null!==(h=null===(l=f.outputNames)||void 0===l?void 0:l.x1)&&void 0!==h?h:"x1"]-b[0][null!==(d=null===(c=f.outputNames)||void 0===c?void 0:c.x0)&&void 0!==d?d:"x0"]}:null),S=Math.max(3,Math.floor(x.length/4)),A=_.evaluateGrid(S),T=v.range(),C=T[0],M=e.last(T),k="kde"===t?t=>v.scale(t*m.length*_.bandwidth):t=>C+(M-C)*t;n.push({color:null!=a?a:null===(u=i.getOption().globalScale.getScale("color"))||void 0===u?void 0:u.scale(i.getSeriesKeys()[0]),line:A.map((t=>{const e={[y]:t.x};return{x:i.dataToPositionX(e)+p.x,y:k(t.y)+p.y}}))})})),n},line:s,label:r}}}const rl="ExtensionMarkSyncStatePlugin";class al extends e.BasePlugin{constructor(){super(rl),this.type=rl}onAfterInitChart(t,i){var s;if(!this._detectSyncState(i))return;const r=t.globalInstance.getChart();if(!r)return;const a=r.getEvent();if(this._subscribedEvent===a)return;null===(s=this._unsubscribeAfterRender)||void 0===s||s.call(this);const n=()=>this._syncStates();a.on(e.ChartEvent.afterRender,n),this._subscribedEvent=a,this._unsubscribeAfterRender=()=>{a.off(e.ChartEvent.afterRender,n),this._subscribedEvent=void 0}}release(){var t;null===(t=this._unsubscribeAfterRender)||void 0===t||t.call(this),super.release()}_detectSyncState(t){const e=null==t?void 0:t.series;return!!(null==e?void 0:e.some((t=>this._hasExtensionMarkWithSyncState(t.extensionMark))))||this._hasExtensionMarkWithSyncState(null==t?void 0:t.extensionMark)}_hasExtensionMarkWithSyncState(t){return!!(null==t?void 0:t.some((t=>"group"!==t.type&&t.syncState)))}_syncStates(){var t;const e=null===(t=this.service)||void 0===t?void 0:t.globalInstance.getChart();e&&e.getAllSeries().forEach((t=>{var e,i;const s=null===(i=null===(e=t.getSpec())||void 0===e?void 0:e.extensionMark)||void 0===i?void 0:i.filter((t=>"group"!==t.type&&t.syncState));(null==s?void 0:s.length)&&this._syncSeriesStates(t,s)}))}_syncSeriesStates(t,i){const s=new Map;if(t.getActiveMarks().forEach((t=>{t.getGraphics().forEach((t=>{var i;const r=null===(i=t.context)||void 0===i?void 0:i.key;e.isValid(r)&&s.set(String(r),t)}))})),0===s.size)return;const r=`${t.type}_${t.id}_extensionMark`;i.forEach(((i,a)=>{const n=e.isValid(i.name)?`${i.name}`:`${r}_${a}`,o=t.getMarkInName(n);o&&o.getGraphics().forEach((t=>{var i;const r=null===(i=t.context)||void 0===i?void 0:i.key;if(!e.isValid(r))return;const a=s.get(String(r));if(!a)return;const n=a.currentStates;(null==n?void 0:n.length)?t.useStates(n):t.clearStates()}))}))}}al.pluginType="chart",al.type=rl;t.BAR_LINK=Po,t.Bar3dChart=nt,t.Bar3dChartSpecTransformer=G,t.Bar3dSeries=it,t.Bar3dSeriesSpecTransformer=J,t.BarLinkComponent=Oo,t.CandlestickChart=cn,t.CandlestickChartSpecTransformer=Za,t.CandlestickSeries=ln,t.CombinationCandlestickChart=pn,t.CombinationCandlestickChart_TYPE=qa,t.ConversionFunnelChart=P,t.ConversionFunnelSeries=O,t.DEFAULT_STROKE_COLOR="#000",t.DefaultBandWidth=6,t.ExtensionMarkSyncStatePlugin=al,t.Funnel3dChart=pt,t.Funnel3dSeries=dt,t.Funnel3dSeriesSpecTransformer=lt,t.Histogram3dChart=gt,t.ImageCloudChart=go,t.MapLabelComponent=qo,t.PictogramChart=io,t.PictogramChartSpecTransformer=En,t.PictogramSeries=to,t.Pie3dChart=Ka,t.Pie3dChartSpecTransformer=mt,t.Pie3dSeries=Xa,t.Pie3dSeriesSpecTransformer=$a,t.REGRESSION_LINE=Zo,t.RangeColumn3dChart=wn,t.RangeColumn3dChartSpecTransformer=kn,t.RangeColumn3dSeries=Tn,t.RangeColumn3dSeriesSpecTransformer=Mn,t.RankingBar=o,t.RankingList=m,t.RegressionLine=Qo,t.SERIES_BREAK=_o,t.SVG_VIEWPORT_RECT_KEY=Fn,t.SequenceScatterKDE=N,t.SequenceScatterLink=E,t.SequenceScatterPixel=V,t.SeriesBreakComponent=Ao,t.SeriesLabelComponent=No,t.TimelineChart=xo,t.WordCloud3dChart=bn,t.WordCloud3dChartSpecTransformer=vn,t.WordCloud3dSeries=mn,t.appendBarLinkConfig=function(t,i){t.customMark=e.array(t.customMark).filter((t=>t.componentType!==Po)),t.customMark.push(Lo(i))},t.appendBarRegressionLineConfig=function(t,i){var s;if(!i){const r=Array.isArray(t.series)?t.series:t.series?[t.series]:[];i=null!==(s=e.get(t,Zo))&&void 0!==s?s:e.get(r.find((t=>t.type===e.SeriesTypeEnum.bar)),Zo)}e.array(i).forEach((e=>{if(!1!==e.visible){t.customMark||(t.customMark=[]);const i=f(e,["visible"]);t.customMark.push(el(i))}}))},t.appendHistogramRegressionLineConfig=function(t,i){var s;if(!i){const r=Array.isArray(t.series)?t.series:t.series?[t.series]:[];i=null!==(s=e.get(t,Zo))&&void 0!==s?s:e.get(r.find((t=>t.type===e.SeriesTypeEnum.bar)),Zo)}e.array(i).forEach((e=>{if(!1!==e.visible){t.customMark||(t.customMark=[]);const{type:i}=e,s=f(e,["type"]);t.customMark.push(sl(i,s))}}))},t.appendScatterRegressionLineConfig=function(t,i){var s;if(!i){const r=Array.isArray(t.series)?t.series:t.series?[t.series]:[];i=null!==(s=e.get(t,Zo))&&void 0!==s?s:e.get(r.find((t=>t.type===e.SeriesTypeEnum.scatter)),Zo)}e.array(i).forEach((e=>{if(!1!==e.visible){t.customMark||(t.customMark=[]);const{type:i}=e,s=f(e,["type"]);t.customMark.push(tl(i,s))}}))},t.appendSeriesBreakConfig=t=>{var i;if(null===(i=t.axes)||void 0===i?void 0:i.length){const i=t.axes.filter((t=>t.breaks&&t.breaks.length&&!1!==t.visible));if(i.length)return t.customMark=e.array(t.customMark).filter((t=>t.componentType!==_o)),t.customMark.push(Co(i,i.map((e=>t.axes.indexOf(e))))),!0}return!1},t.appendSeriesLabelConfig=function(t,i){var s,r,a;if(t.customMark=e.array(t.customMark).filter((t=>t.componentType!==Eo)),i||(i=null!==(a=null!==(s=e.get(t,Eo))&&void 0!==s?s:e.get(null===(r=t.series)||void 0===r?void 0:r[0],Eo))&&void 0!==a?a:{}),i.visible){const{position:e="end"}=i,s=f(i,["position"]);t.customMark.push(Ro(e,s))}},t.clearSVGSource=function(){Dn.clear(),In=null},t.getBarLinkConfig=Lo,t.getBarRegressionLineConfig=el,t.getHistogramRegressionLineConfig=sl,t.getSVGSource=Un,t.getScatterRegressionLineConfig=tl,t.getSeriesBreakConfig=Co,t.getSeriesLabelConfig=Ro,t.register3DPlugin=Z,t.registerAxis3dPlugin=()=>{Z(),at(),(()=>{e.registerCartesianBandAxis();const t=e.Factory.getComponentInKey(e.CartesianBandAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianBandAxis.builtInTheme.axisX),_n)}),e.mixin(t,Sn)})(),(()=>{e.registerCartesianLinearAxis();const t=e.Factory.getComponentInKey(e.CartesianLinearAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianLinearAxis.builtInTheme.axisX),_n)}),e.mixin(t,Sn)})(),(()=>{e.registerCartesianTimeAxis();const t=e.Factory.getComponentInKey(e.CartesianTimeAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},t.builtInTheme.axisX),_n)}),e.mixin(t,Sn)})(),(()=>{e.registerCartesianLogAxis();const t=e.Factory.getComponentInKey(e.CartesianSymlogAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},t.builtInTheme.axisX),_n)}),e.mixin(t,Sn)})(),(()=>{e.registerCartesianLogAxis();const t=e.Factory.getComponentInKey(e.CartesianLogAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianLogAxis.builtInTheme.axisX),_n)}),e.mixin(t,Sn)})()},t.registerBar3dChart=()=>{Z(),at(),st(),e.Factory.registerChart(nt.type,nt)},t.registerBar3dSeries=st,t.registerBarLink=()=>{e.Factory.registerGraphicComponent(Po,(t=>new Oo(t)))},t.registerCandlestickChart=()=>{e.registerDimensionTooltipProcessor(),e.registerMarkTooltipProcessor(),e.registerDimensionEvents(),e.registerDimensionHover(),hn(),e.Factory.registerChart(cn.type,cn)},t.registerCandlestickSeries=hn,t.registerCombinationCandlestickChart=()=>{hn(),e.Factory.registerChart(pn.type,pn)},t.registerConversionFunnelChart=t=>{e.registerMarkFilterTransform();const i=(null==t?void 0:t.VChart)||e.VChart;i&&(i.useChart([P]),i.useSeries([O]))},t.registerEventSeries=bo,t.registerExtensionMarkSyncStatePlugin=()=>{e.registerChartPlugin(al)},t.registerFunnel3dChart=()=>{e.registerMarkTooltipProcessor(),Z(),at(),ut(),e.Factory.registerChart(pt.type,pt)},t.registerFunnel3dSeries=ut,t.registerHistogram3dChart=()=>{e.registerGroupTooltipProcessor(),e.registerDimensionTooltipProcessor(),e.registerMarkTooltipProcessor(),e.registerDimensionEvents(),e.registerDimensionHover(),Z(),at(),st(),e.Factory.registerChart(gt.type,gt)},t.registerImageCloudChart=()=>{po(),e.Factory.registerChart(go.type,go)},t.registerMapLabel=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useComponent([qo])},t.registerPictogramChart=()=>{e.registerMarkTooltipProcessor(),eo(),e.Factory.registerChart(io.type,io)},t.registerPictogramSeries=eo,t.registerPie3dChart=()=>{e.registerMarkTooltipProcessor(),Z(),at(),Ya(),e.Factory.registerChart(Ka.type,Ka)},t.registerPie3dSeries=Ya,t.registerRangeColumn3dChart=()=>{e.registerDimensionTooltipProcessor(),e.registerMarkTooltipProcessor(),e.registerDimensionEvents(),e.registerDimensionHover(),Z(),at(),Cn(),e.Factory.registerChart(wn.type,wn)},t.registerRangeColumn3dSeries=Cn,t.registerRankingBarChart=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([o])},t.registerRankingList=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([m,e.BarChart])},t.registerRegressionLine=()=>{e.Factory.registerGraphicComponent(Zo,(t=>new Qo(t)))},t.registerSVGSource=Nn,t.registerSequenceScatterKDE=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([N,e.ScatterChart])},t.registerSequenceScatterLink=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([E,e.ScatterChart])},t.registerSequenceScatterPixel=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([V,e.ScatterChart])},t.registerSeriesBreak=()=>{e.Factory.registerGraphicComponent("seriesBreak",(t=>new Ao(t)))},t.registerSeriesLabel=()=>{e.Factory.registerGraphicComponent("seriesLabel",(t=>new No(t)))},t.registerTimelineChart=()=>{e.registerMarkTooltipProcessor(),bo(),e.Factory.registerChart(xo.type,xo)},t.registerWordCloud3dChart=xn,t.registerWordCloud3dSeries=fn,t.registerWordCloudShape3dChart=()=>{Z(),yn(),xn()},t.registerWordCloudShape3dSeries=yn,t.svgSourceMap=Dn,t.transformCandlestickSeriesSpec=dn,t.unregisterSVGSource=jn}));