@visactor/vchart-extension 2.0.0-alpha.2 → 2.0.0-alpha.3

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.
@@ -1,15 +1,15 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vchart"),require("@visactor/vutils")):"function"==typeof define&&define.amd?define(["exports","@visactor/vchart","@visactor/vutils"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VChartExtension={},t.VChart,t.VUtils)}(this,(function(t,e,i){"use strict";class n extends e.BaseChartSpecTransformer{transformSpec(t){const{timeData:e,timeNodes:n}=function(t){const{xField:e,yField:n,timeField:s,data:r,topN:a=10,icon:o}=t,l=new Set,h=new Map;return r.sort(((t,i)=>Number(i[e])-Number(t[e]))),r.forEach((t=>{const e=t[s];i.isValid(e)&&l.add(e),h.has(e)||h.set(e,[]);const r=h.get(e);if(r.length<a){const e=Object.assign({},t);o&&o[e[n]]&&(e.icon=o[e[n]]),r.push(e)}})),{timeData:h,timeNodes:Array.from(l).sort()}}(t),{interval:a,xField:o,yField:l,color:h,icon:c,iconPosition:d,iconShape:u,timeLabel:p,label:g,nameLabel:f,xAxis:m,yAxis:y}=t,b=a||1e3,v=Math.min(b,500);if(t.type="common",t.data=[{id:"timeData",values:e.get(n[0])},{id:"time",values:[{time:n[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:s(g,Object.assign(Object.assign({},f),{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}},n={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&&(n.label=t.label);return[i,n]}(m,y),t.player={type:"continuous",auto:!0,loop:!1,interval:b,specs:n.map((t=>({data:[{id:"timeData",values:e.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:b,exchangeDuration:v}),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:n}){return{type:"symbol",dataId:"timeData",style:{symbolType:e,stroke:"white",lineWidth:1,size:(t,e)=>{var i,n;const s=e.vchart,r=null===(i=s.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(s&&r){const t=null!==(n=r.getYAxisHelper().getBandwidth(0))&&void 0!==n?n:0;return Math.max(t-4,0)}return 10},background:t=>t.icon,x:(e,i)=>{var n,s;const r=i.vchart,a=null===(n=r.getChart())||void 0===n?void 0:n.getSeriesInIndex(0)[0];if(r&&a){const i=null!==(s=a.getYAxisHelper().getBandwidth(0))&&void 0!==s?s:0;return"bar-start"===t?i/2:"axis"===t?-i/2:a.dataToPositionX(e)-i/2}},y:(t,e)=>{var i,n;const s=e.vchart,r=null===(i=s.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(s&&r){const e=null!==(n=r.getYAxisHelper().getBandwidth(0))&&void 0!==n?n:0;return r.dataToPositionY(t)+e/2}},scaleY:"rect"===e?1.2:1},animationUpdate:r(i,n),animationEnter:[{type:"moveIn",duration:n,easing:"cubicInOut",options:{direction:"y",orient:"negative",point:(t,e,i)=>({y:i.groupHeight+e.getBounds().height()})}}],animationExit:[{type:"moveOut",duration:n,easing:"cubicInOut",options:{direction:"y",orient:"negative"}}]}}(d,u,{interval:b,exchangeDuration:v});t.series[0].extensionMark.push(e)}super.transformSpec(t)}}function s(t={},e){var i,n,s,r;const a=[];return!1!==t.visible&&a.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===(n=t.style)||void 0===n?void 0:n.stroke)?"null":void 0}}),e.visible&&a.push({visible:!0,overlap:!1,style:Object.assign({},e.style),smartInvert:{fillStrategy:(null===(s=e.style)||void 0===s?void 0:s.fill)?"null":void 0,strokeStrategy:(null===(r=e.style)||void 0===r?void 0:r.stroke)?"null":void 0},position:"bar-end"===e.position?"inside-right":"inside-left",formatter:`{${e.yField}}`}),a}function r(t,e){return[{duration:e,easing:"cubicInOut",channel:["y"]},{options:{excludeChannels:["y"]},channel:["x","x2","x1"],easing:"linear",duration:t}]}class a extends e.BaseChart{constructor(){super(...arguments),this.type="rankingBar",this.transformerConstructor=n}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,timeField:a,data:o}=this._spec;return s&&r&&a?!!o||(null===(n=(i=this._option).onError)||void 0===n||n.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)}}a.type="rankingBar",a.view="singleDefault",a.transformerConstructor=n;const o=1e3,l="#21252c",h={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",d="VCHART_ORDER",u="SUPPLY_DATA_KEY";class p extends e.CommonChartSpecTransformer{constructor(){super(...arguments),this.formatMap={},this.paginateDataArr=t=>{const{scrollSize:e=1,pageSize:i=5}=t,n=this.originalData,s={};let r=0;for(let a=0;a<n.length;a+=e)if(r++,s[`page${r}`]=n.slice(a,a+i),a+i-1>=n.length-1){n.push(...Array.from({length:a+i-n.length},(e=>({[t.yField]:100*Math.random(),[t.xField]:null,[u]:!0}))));break}return{orderCount:r,result:s}},this.processRankingData=t=>{const e=[];t.data.forEach(((t,e)=>t[d]=e+1<10?`0${e+1}`:e+1));const i=this.paginateDataArr(t).result,n=this.paginateDataArr(t).orderCount;this.orderCount=n;const s=t.pageSize-i[`page${n}`].length;return i[`page${n}`].push(...Array.from({length:s},(e=>({[t.yField]:100*Math.random(),[t.xField]:null,[u]:!0})))),Object.keys(i).forEach((n=>{e.push({data:[{id:"datas",values:i[n].map((e=>Object.assign(Object.assign({},e),{[c]:e[t.yField]})))},{id:"order",values:[{order:n}]}]})})),e}}isSpecValid(t){const{xField:e,yField:i,data:n}=t;return!!(e&&i&&n&&0!==n.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 n in i)"__proto__"!==n&&"constructor"!==n&&"prototype"!==n&&"object"==typeof i[n]&&null!==i[n]?(e.hasOwnProperty(n)||(e[n]=Array.isArray(i[n])?[]:{}),t(e[n],i[n])):e.hasOwnProperty(n)||"object"!=typeof e||(e[n]=i[n]);return e})(t,h),((t,e)=>{e.forEach((e=>{var n,s,r,a,o,l,h;i.isArray(t[e])?null===(n=t[e])||void 0===n||n.forEach(((i,n)=>{var s,r,a;t[e][n]=Object.assign(Object.assign({},i),{style:Object.assign(Object.assign({},null==i?void 0:i.style),{visible:null===(a=null!==(r=null===(s=null==i?void 0:i.style)||void 0===s?void 0:s.visible)&&void 0!==r?r:null==i?void 0:i.visible)||void 0===a||a})})})):t[e]=Object.assign(Object.assign({},t[e]),{style:Object.assign(Object.assign({},null===(s=t[e])||void 0===s?void 0:s.style),{visible:null===(h=null!==(o=null===(a=null===(r=t[e])||void 0===r?void 0:r.style)||void 0===a?void 0:a.visible)&&void 0!==o?o:null===(l=t[e])||void 0===l?void 0:l.visible)||void 0===h||h})})}))})(t,["barBackground","rankingIcon","decorateHaloIcons","orderLabel","nameLabel","valueLabel"])}upgradeTextMeasure(t){var e,n,s,r,a,o,l,h,c;null===(e=this.nameLabelTextMeasure)||void 0===e||e.release(),null===(n=this.valueLabelTextMeasure)||void 0===n||n.release(),null===(s=this.orderLabelTextMeasure)||void 0===s||s.release(),this.nameLabelTextMeasure=new i.TextMeasure({defaultFontParams:null!==(a=null===(r=t.nameLabel)||void 0===r?void 0:r.style)&&void 0!==a?a:{}}),this.valueLabelTextMeasure=new i.TextMeasure({defaultFontParams:null!==(l=null===(o=t.valueLabel)||void 0===o?void 0:o.style)&&void 0!==l?l:{}}),this.orderLabelTextMeasure=new i.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[d]=t.orderLabel.formatMethod}processData(t){var e;(null===(e=t.data[0])||void 0===e?void 0:e.values)||(this.originalData=t.data,this.originalSpec=i.cloneDeep(t),this.dataSpecs=this.processRankingData(t),t.data=this.dataSpecs[0].data)}transformBaseSpec(t){var e,i,n;t.type="common",t.dataKey=c,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===(n=t.bar)||void 0===n?void 0:n.style),{x1:0,visible:e=>{var i,n;return!e[u]&&(null===(n=null===(i=t.bar)||void 0===i?void 0:i.style)||void 0===n||n)}})})}]}transformAnimationSpec(t){var e,i,n;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!==(n=t.animationUpdate.duration)&&void 0!==n?n: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,n;const s=t.map((t=>t[e])).filter((t=>null!=t));if(0===s.length)i=0,n=1;else{i=Math.min(...s)-(Math.max(...s)-Math.min(...s))/3,n=(Math.max(...s)-i)/.8+i;const t=10,e=i;i===n&&(i=e-t,n=(4*e+t)/4)}return{min:i,max:n}})(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:c,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[u]&&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:c,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[u]&&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:c,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(d,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(d,e)).height)/2},t.rankingIcon.style),{lineWidth:0,stroke:null,visible:e=>!e[u]&&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:c,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,d,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[u]&&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:c,state:null===(e=t.orderLabel)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({text:t=>this.formatDatum(d,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[u]&&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:c,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[u]&&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,d,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 n=this.originalData.map((t=>t[u]?0:i.fullMeasure(this.formatDatum(e,t)).width));return Math.max(...n)}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,n,s,r;return!1!==(null===(e=t.animationUpdate)||void 0===e?void 0:e.enable)&&{type:"moveOut",options:{direction:"y",orient:"negative",point:(e,i)=>({y:i.getGraphicAttribute("y")-t.height/(t.pageSize+1)*Math.min(t.scrollSize,t.pageSize)})},duration:null!==(n=null===(i=t.animationUpdate)||void 0===i?void 0:i.duration)&&void 0!==n?n:1e3,easing:null!==(r=null===(s=t.animationUpdate)||void 0===s?void 0:s.easing)&&void 0!==r?r:"linear"}}getAnimationEnter(t){var e,i,n,s,r;return!1!==(null===(e=t.animationUpdate)||void 0===e?void 0:e.enable)&&{type:"moveIn",options:{direction:"y",orient:"negative",excludeChannels:["y"],point:(e,i)=>({y:i.getGraphicAttribute("y")+t.height/(t.pageSize+1)*Math.min(t.scrollSize,t.pageSize)})},duration:null!==(n=null===(i=t.animationUpdate)||void 0===i?void 0:i.duration)&&void 0!==n?n:1e3,easing:null!==(r=null===(s=t.animationUpdate)||void 0===s?void 0:s.easing)&&void 0!==r?r:"linear"}}getAnimationAppear(t,e){var i,n,s,r,a,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!==(s=null===(n=t.animationAppear)||void 0===n?void 0:n.duration)&&void 0!==s?s:1e3,easing:null!==(a=null===(r=t.animationAppear)||void 0===r?void 0:r.easing)&&void 0!==a?a:"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,n,s;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!==(s=null===(n=t.animationUpdate)||void 0===n?void 0:n.easing)&&void 0!==s?s:"linear"}}}class g extends e.BaseChart{constructor(){super(...arguments),this.type="rankingList",this.transformerConstructor=p}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,data:a}=this._spec;return s&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}g.type="rankingList",g.view="singleDefault",g.transformerConstructor=p;const f=(t,e)=>{var n,s;if(!(null==e?void 0:e.fields))return t;if(0===t.length)return t;const r=e.fields,a=t[0],o={},l=[];for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)){const h=r[e];if(h.sort&&(i.isValidNumber(h.sortIndex)||(h.sortIndex=0),i.isValid(h.sortReverse)||(h.sortReverse="desc"===h.sort)),!h.type){let i=a;e in a||(i=null!==(n=t.find((t=>e in t)))&&void 0!==n?n:a),h.type="number"==typeof i[e]?"linear":"ordinal"}let c;if("number"==typeof h.sortIndex&&(c={key:e,type:h.type,index:h.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:!0===h.sortReverse},l.push(c)),(null===(s=h.domain)||void 0===s?void 0:s.length)>0)if("ordinal"===h.type){h._domainCache={},o[e]=h;const t={};h.domain.forEach(((e,i)=>{t[e]=i,h._domainCache[e]=i})),c&&(c.sortIndex=t,c.sortIndexCount=h.domain.length)}else h.domain.length>=2&&(o[e]=h)}return Object.keys(o).length>0&&(t=t.filter((t=>{for(const e in o){const i=o[e];if("ordinal"===i.type){if(!(t[e]in i._domainCache))return!1}else if(i.domain[0]>t[e]||i.domain[1]<t[e])return!1}return!0}))),l.sort(((t,e)=>t.index-e.index)),t.sort(((t,e)=>function(t,e,i){for(let n=0;n<i.length;n++){const s=i[n];let r=0;if("ordinal"===s.type?(void 0===s.sortIndex[e[s.key]]&&(s.sortIndex[e[s.key]]=s.sortIndexCount++),void 0===s.sortIndex[t[s.key]]&&(s.sortIndex[t[s.key]]=s.sortIndexCount++),r=s.sortIndex[t[s.key]]-s.sortIndex[e[s.key]]):"linear"===s.type&&(r=t[s.key]-e[s.key]),s.sortReverse&&(r=-r),0!==r)return r}return 0}(t,e,l))),t};const m={svg:"group",rect:"rect",line:"rule",polygon:"polygon",path:"path",polyline:"line",g:"group",circle:"arc",ellipse:"arc"},y=Object.keys(m),b=["g","svg","text","tspan","switch"],v=["font-size","font-family","font-weight","font-style","text-align","text-anchor"],x=["visibility","x","y","width","height","d","points","stroke","stroke-width","fill","fill-opacity","stroke-opacity",...v,"cx","cy","r","cx","cy","rx","ry","x1","x2","y1","y2"],_=["visible","fill","stroke","stroke-width","fill-opacity","stroke-opacity",...v],A=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;const S=function(t){let e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).customDOMParser;if(e||(null===window||void 0===window?void 0:window.DOMParser)&&(e=t=>(new DOMParser).parseFromString(t,"text/xml")),!e)throw new Error("No Available DOMParser!");const n=e(t);let s=9===n.nodeType?n.firstChild:n;for(;s&&("svg"!==s.nodeName.toLowerCase()||1!==s.nodeType);)s=s.nextSibling;return s?function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=[],s=B(t,null);let r=parseFloat(t.getAttribute("width")||e.width),a=parseFloat(t.getAttribute("height")||e.height);!i.isValidNumber(r)&&(r=null),!i.isValidNumber(a)&&(a=null);const o=t.getAttribute("viewBox");let l;if(o){const t=o.match(A)||[];if(t.length>=4&&(l={x:parseFloat(t[0]||0),y:parseFloat(t[1]||0),width:parseFloat(t[2]),height:parseFloat(t[3])},r||a)){const t={x:0,y:0,width:r,height:a},e=t.width/l.width,n=t.height/l.height,o=Math.min(e,n),h=-(l.x+l.width/2)*o+(t.x+t.width/2),c=-(l.y+l.height/2)*o+(t.y+t.height/2),d=(new i.Matrix).translate(h,c).scale(o,o);s.transform=d}}return k(t,s,n),{root:s,width:r,height:a,elements:n,viewBoxRect:l}}(s):null};let T=0;function w(t){let e;const{parent:n,attributes:s}=t,r=t=>t?_.reduce(((e,n)=>{const s=i.toCamelCase(n);return i.isValid(t[s])&&(e[s]=t[s]),e}),{}):{};return n?(n._inheritStyle||(n._inheritStyle=r(n.attributes)),e=i.merge({},n._inheritStyle,r(s))):e=r(s),e}function M(t){var e,n,s;const r={},a=null!==(e=t.attributes)&&void 0!==e?e:{},o=null!==(n=t.style)&&void 0!==n?n:{};for(let t=0;t<x.length;t++){const e=x[t],n=i.isValid(o[e])&&""!==o[e]?o[e]:null===(s=a[e])||void 0===s?void 0:s.value;i.isValid(n)&&(r[i.toCamelCase(e)]=isNaN(+n)?n:parseFloat(n))}return"none"===o.display&&(r.visible=!1),["fontSize","strokeWidth","width","height"].forEach((t=>{const e=r[t];i.isString(r[t])&&(r[t]=parseFloat(e))})),r}function B(t,e){var n,s,r,a,o;const l=null===(n=t.tagName)||void 0===n?void 0:n.toLowerCase();if(3===t.nodeType||"text"===l||"tspan"===l)return function(t,e){var n,s,r,a,o,l;if(!e)return null;const h=null===(n=t.tagName)||void 0===n?void 0:n.toLowerCase();if(!h&&"group"!==e.graphicType)return null;const c="text"===h||"tspan"===h,d=c?"group":"text",u=c||null===(s=t.textContent)||void 0===s?void 0:s.replace(/\n/g," ").replace(/\s+/g," ");if(" "===u)return null;let p;return p=c?{tagName:h,graphicType:d,attributes:M(t),parent:e,name:t.getAttribute("name"),id:null!==(r=t.getAttribute("id"))&&void 0!==r?r:`${h}-${T++}`,transform:C(t),value:u}:{tagName:h,graphicType:"text",attributes:M(t),parent:e,name:null==e?void 0:e.name,id:null!==(o=null===(a=t.getAttribute)||void 0===a?void 0:a.call(t,"id"))&&void 0!==o?o:`${h}-${T++}`,value:u},p._inheritStyle=w(p),i.isValid(p.name)||(p._nameFromParent=null!==(l=e.name)&&void 0!==l?l:e._nameFromParent),c?e._textGroupStyle?p._textGroupStyle=i.merge({},e._textGroupStyle,M(t)):p._textGroupStyle=M(t):p.attributes=p._inheritStyle,p}(t,e);if(!y.includes(l))return null;const h={tagName:l,graphicType:m[l],attributes:M(t),parent:e,name:null!==(s=t.getAttribute("name"))&&void 0!==s?s:null===(r=null==e?void 0:e.attributes)||void 0===r?void 0:r.name,id:null!==(a=t.getAttribute("id"))&&void 0!==a?a:`${l}-${T++}`,transform:C(t)};return h._inheritStyle=w(h),e&&!i.isValid(h.name)&&(h._nameFromParent=null!==(o=e.name)&&void 0!==o?o:e._nameFromParent),h}function C(t){var e,n;const s=null===(e=t.transform)||void 0===e?void 0:e.baseVal;if(!s)return null;const r=null===(n=s.consolidate())||void 0===n?void 0:n.matrix;if(!r)return null;const{a:a,b:o,c:l,d:h,e:c,f:d}=r;return new i.Matrix(a,o,l,h,c,d)}function k(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];var n;if(!t)return;let s;"svg"!==t.nodeName&&(s=B(t,e)),s&&i.push(s);let r=b.includes(null===(n=t.tagName)||void 0===n?void 0:n.toLocaleLowerCase())?t.firstChild:null;for(;r;)k(r,null!=s?s:e,i),r=r.nextSibling}let P=0;function O(){return P>1e8&&(P=0),(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"dataset")+"_"+P++}class R{constructor(t){var e;let n;this.options=t,this.isDataSet=!0,this.transformMap={},this.parserMap={},this.dataViewMap={},this.target=new i.EventEmitter,n=(null==t?void 0:t.name)?t.name:O("dataset"),this.name=n,this._logger=null!==(e=null==t?void 0:t.logger)&&void 0!==e?e:i.Logger.getInstance()}setLogger(t){this._logger=t}getDataView(t){return this.dataViewMap[t]}setDataView(t,e){var i;this.dataViewMap[t]&&(null===(i=this._logger)||void 0===i||i.error(`Error: dataView ${t} 之前已存在,请重新命名`)),this.dataViewMap[t]=e}removeDataView(t){this.dataViewMap[t]=null,delete this.dataViewMap[t]}registerParser(t,e){var i;this.parserMap[t]&&(null===(i=this._logger)||void 0===i||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.parserMap[t]=e}removeParser(t){this.parserMap[t]=null,delete this.parserMap[t]}getParser(t){return this.parserMap[t]||this.parserMap.default}registerTransform(t,e){var i;this.transformMap[t]&&(null===(i=this._logger)||void 0===i||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.transformMap[t]=e}removeTransform(t){this.transformMap[t]=null,delete this.transformMap[t]}getTransform(t){return this.transformMap[t]}multipleDataViewAddListener(t,e,i){this._callMap||(this._callMap=new Map);let n=this._callMap.get(i);n||(n=()=>{t.some((t=>t.isRunning))||i()}),t.forEach((t=>{t.target.addListener(e,n)})),this._callMap.set(i,n)}allDataViewAddListener(t,e){this.multipleDataViewAddListener(Object.values(this.dataViewMap),t,e)}multipleDataViewRemoveListener(t,e,i){if(this._callMap){const n=this._callMap.get(i);n&&t.forEach((t=>{t.target.removeListener(e,n)})),this._callMap.delete(i)}}multipleDataViewUpdateInParse(t){t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.markRunning()})),t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.parseNewData(t.data,t.options)}))}multipleDataViewUpdateInRawData(t){t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.markRunning()})),t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.updateRawData(t.data,t.options)}))}destroy(){this.transformMap=null,this.parserMap=null,this.dataViewMap=null,this._callMap=null,this.target.removeAllListeners()}}class L{constructor(t,e){var n=this;let s;this.dataSet=t,this.options=e,this.isDataView=!0,this.target=new i.EventEmitter,this.parseOption=null,this.transformsArr=[],this.isRunning=!1,this.rawData={},this.history=!1,this.parserData={},this.latestData={},this._fields=null,this.reRunAllTransform=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=n.latestData;return n.isRunning=!0,n.resetTransformData(),n.transformsArr.forEach((e=>{n.executeTransform(e,{pushHistory:t.pushHistory,emitMessage:!1})})),n.isRunning=!1,!1===t.emitMessage||t.skipEqual&&i.isEqual(e,n.latestData)||n.target.emit("change",{latestData:n.latestData}),n},this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},s=(null==e?void 0:e.name)?e.name:O("dataview"),this.name=s,(null==e?void 0:e.history)&&(this.history=e.history,this.historyData=[]),this.dataSet.setDataView(s,this),this.setFields(null==e?void 0:e.fields)}parse(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];var n;this.isRunning=!0,i&&this.target.emit("beforeParse",[]),e&&(this.parseOption=e);const s=this.cloneParseData(t,e);if(null==e?void 0:e.type){const t=(null!==(n=this.dataSet.getParser(e.type))&&void 0!==n?n:this.dataSet.getParser("bytejson"))(s,e.options,this);this.rawData=s,this.parserData=t,this.history&&this.historyData.push(s,t),this.latestData=t}else this.parserData=s,this.rawData=s,this.history&&this.historyData.push(s),this.latestData=s;return this.isRunning=!1,i&&this.target.emit("afterParse",[]),this}transform(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.isRunning=!0,t&&t.type){let i=!0;if("fields"===t.type){this._fields=t.options.fields;const e=this.transformsArr.findIndex((e=>e.type===t.type));e>=0&&(i=!1,this.transformsArr[e].options.fields=this._fields)}i&&this.transformsArr.push(t),e&&this.executeTransform(t)}return this.sortTransform(),this.isRunning=!1,this}sortTransform(){this.transformsArr.length>=2&&this.transformsArr.sort(((t,e)=>{var i,n;return(null!==(i=t.level)&&void 0!==i?i:0)-(null!==(n=e.level)&&void 0!==n?n:0)}))}executeTransform(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{pushHistory:n,emitMessage:s,skipEqual:r}=e,a=this.dataSet.getTransform(t.type),o=this.latestData,l=a(o,t.options);this.history&&!1!==n&&this.historyData.push(l),this.latestData=l,!1===s||r&&i.isEqual(o,this.latestData)||this.target.emit("change",{latestData:this.latestData})}resetTransformData(){this.latestData=this.parserData,this.history&&(this.historyData.length=0,this.historyData.push(this.rawData,this.parserData))}cloneParseData(t,e){let n=!1;return t instanceof L||!0!==(null==e?void 0:e.clone)||(n=!0),n?i.cloneDeep(t):t}parseNewData(t,e){this.parse(t,e||this.parseOption),this.reRunAllTransform()}updateRawData(t,e){const i=this.cloneParseData(t,e);this.rawData=i,this.parserData=i,this.latestData=i,this.reRunAllTransform()}getFields(){var t;return this._fields?this._fields:"dataview"===(null===(t=this.parseOption)||void 0===t?void 0:t.type)&&1===this.rawData.length&&this.rawData[0].getFields?this.rawData[0].getFields():null}setFields(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._fields=t&&e?i.merge({},this._fields,t):t;const n=this.transformsArr.find((t=>"fields"===t.type));!i.isNil(this._fields)&&i.isNil(n)?(this.dataSet.registerTransform("fields",f),this.transform({type:"fields",options:{fields:this._fields}},!1)):n&&(n.options.fields=this._fields)}destroy(){this.dataSet.removeDataView(this.name),this.latestData=null,this.rawData=null,this.parserData=null,this.transformsArr=null,this.target=null}}
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vchart")):"function"==typeof define&&define.amd?define(["exports","@visactor/vchart"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VChartExtension={},t.VChart)}(this,(function(t,e){"use strict";function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var n={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function s(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,n,r,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new s(n,r||t,a),l=i?i+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],o]:t._events[l].push(o):(t._events[l]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,n,s=[];if(0===this._eventsCount)return s;for(n in t=this._events)e.call(t,n)&&s.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(t)):s},o.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,r=n.length,a=new Array(r);s<r;s++)a[s]=n[s].fn;return a},o.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},o.prototype.emit=function(t,e,n,s,r,a){var o=i?i+t:t;if(!this._events[o])return!1;var l,h,c=this._events[o],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,n),!0;case 4:return c.fn.call(c.context,e,n,s),!0;case 5:return c.fn.call(c.context,e,n,s,r),!0;case 6:return c.fn.call(c.context,e,n,s,r,a),!0}for(h=1,l=new Array(u-1);h<u;h++)l[h-1]=arguments[h];c.fn.apply(c.context,l)}else{var d,p=c.length;for(h=0;h<p;h++)switch(c[h].once&&this.removeListener(t,c[h].fn,void 0,!0),u){case 1:c[h].fn.call(c[h].context);break;case 2:c[h].fn.call(c[h].context,e);break;case 3:c[h].fn.call(c[h].context,e,n);break;case 4:c[h].fn.call(c[h].context,e,n,s);break;default:if(!l)for(d=1,l=new Array(u-1);d<u;d++)l[d-1]=arguments[d];c[h].fn.apply(c[h].context,l)}}return!0},o.prototype.on=function(t,e,i){return r(this,t,e,i,!1)},o.prototype.once=function(t,e,i){return r(this,t,e,i,!0)},o.prototype.removeListener=function(t,e,n,s){var r=i?i+t:t;if(!this._events[r])return this;if(!e)return a(this,r),this;var o=this._events[r];if(o.fn)o.fn!==e||s&&!o.once||n&&o.context!==n||a(this,r);else{for(var l=0,h=[],c=o.length;l<c;l++)(o[l].fn!==e||s&&!o[l].once||n&&o[l].context!==n)&&h.push(o[l]);h.length?this._events[r]=1===h.length?h[0]:h:a(this,r)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&a(this,e)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,t.exports=o}(n);var s=i(n.exports);var r=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var a=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||r(t,"Boolean")};var o=t=>"function"==typeof t;var l=t=>null==t;var h=t=>null!=t;var c=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var u=t=>"object"==typeof t&&null!==t;var d=function(t){if(!u(t)||!r(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};var p=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===e:"string"===e||r(t,"String")};var g=t=>Array.isArray?Array.isArray(t):r(t,"Array");var f=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var m=t=>r(t,"Date");var y=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===e:"number"===e||r(t,"Number")};var b=t=>y(t)&&Number.isFinite(t);var v=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var x=t=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t);var _=t=>({}.toString.call(t).replace(/^\[object /,"").replace(/]$/,""));const A=Object.prototype;var S=function(t){const e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||A)};const T=Object.prototype.hasOwnProperty;function w(t){if(l(t))return!0;if(f(t))return!t.length;const e=_(t);if("Map"===e||"Set"===e)return!t.size;if(S(t))return!Object.keys(t).length;for(const e in t)if(T.call(t,e))return!1;return!0}var M=(t,e,i)=>{const n=p(e)?e.split("."):e;for(let e=0;e<n.length;e++)t=t?t[n[e]]:void 0;return void 0===t?i:t};function B(t,e,i){let n;if(!h(t)||"object"!=typeof t||e&&e(t))return t;const s=g(t),r=t.length;n=s?new Array(r):"object"==typeof t?{}:a(t)||y(t)||p(t)?t:m(t)?new Date(+t):void 0;const o=s?void 0:Object.keys(Object(t));let l=-1;if(n)for(;++l<(o||t).length;){const s=o?o[l]:l,r=t[s];i&&i.includes(s.toString())?n[s]=r:n[s]=B(r,e,i)}return n}function C(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e){if(t===e)return;if(h(e)&&"object"==typeof e){const s=Object(e),r=[];for(const t in s)r.push(t);let{length:a}=r,o=-1;for(;a--;){const a=r[++o];!h(s[a])||"object"!=typeof s[a]||n&&g(t[a])?P(t,a,s[a]):k(t,e,a,i,n)}}}}function k(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const r=t[i],a=e[i];let o=e[i],l=!0;if(g(a)){if(n)o=[];else if(g(r))o=r;else if(f(r)){o=new Array(r.length);let t=-1;const e=r.length;for(;++t<e;)o[t]=r[t]}}else d(a)?(o=null!=r?r:{},"function"!=typeof r&&"object"==typeof r||(o={})):l=!1;l&&C(o,a,n,s),P(t,i,o)}function P(t,e,i){(void 0!==i&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],i)||void 0===i&&!(e in t))&&(t[e]=i)}function O(t){let e=-1;const i=arguments.length<=1?0:arguments.length-1;for(;++e<i;)C(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1],!0);return t}function R(t,e){if(!t||!d(t))return t;const i={};return Object.keys(t).forEach((n=>{const s=t[n];let r=!1;e.forEach((t=>{(p(t)&&t===n||t instanceof RegExp&&n.match(t))&&(r=!0)})),r||(i[n]=s)})),i}function L(t){return Object.prototype.toString.call(t)}function I(t){return Object.keys(t)}function E(t,e,i){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(null==t||null==e)return!1;if(Number.isNaN(t)&&Number.isNaN(e))return!0;if(L(t)!==L(e))return!1;if(o(t))return!!(null==i?void 0:i.skipFunction);if("object"!=typeof t)return!1;if(g(t)){if(t.length!==e.length)return!1;for(let n=t.length-1;n>=0;n--)if(!E(t[n],e[n],i))return!1;return!0}if(!d(t))return!1;const n=I(t),s=I(e);if(n.length!==s.length)return!1;n.sort(),s.sort();for(let t=n.length-1;t>=0;t--)if(n[t]!=s[t])return!1;for(let s=n.length-1;s>=0;s--){const r=n[s];if(!E(t[r],e[r],i))return!1}return!0}function D(t,e,i){const n=function(t){if(!t)return[];if(Object.keys)return Object.keys(t);const e=[];for(const i in t)t.hasOwnProperty(i)&&e.push(i);return e}(e);for(let s=0;s<n.length;s++){const r=n[s];(i?null!=e[r]:null==t[r])&&(t[r]=e[r])}return t}function F(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames){const n=Object.getOwnPropertyNames(e);for(let s=0;s<n.length;s++){const r=n[s];"constructor"!==r&&(i?null!=e[r]:null==t[r])&&(t[r]=e[r])}}else D(t,e,i)}function j(t){return h(t)?g(t)?t:[t]:[]}const U=(t,e)=>{var i;if(0===t.length)return;let n=t[0];for(let s=1;s<t.length;s++){const r=t[s];(null!==(i=null==e?void 0:e(r,n))&&void 0!==i?i:r-n)<0&&(n=r)}return n};function N(t,e){if(!g(t)||!g(e))return!1;if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}function W(t){if(!g(t))return[t];const e=[];for(const i of t)e.push(...W(i));return e}function z(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function G(t){return Number(t)}const V="undefined"!=typeof console;function H(t,e,i){const n=[e].concat([].slice.call(i));V&&console[t].apply(console,n)}var X;!function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug"}(X||(X={}));class ${static getInstance(t,e){return $._instance&&y(t)?$._instance.level(t):$._instance||($._instance=new $(t,e)),$._instance}static setInstance(t){return $._instance=t}static setInstanceLevel(t){$._instance?$._instance.level(t):$._instance=new $(t)}static clearInstance(){$._instance=null}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:X.None,e=arguments.length>1?arguments[1]:void 0;this._onErrorHandler=[],this._level=t,this._method=e}addErrorHandler(t){this._onErrorHandler.find((e=>e===t))||this._onErrorHandler.push(t)}removeErrorHandler(t){const e=this._onErrorHandler.findIndex((e=>e===t));e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._onErrorHandler.forEach((t=>t(...e)))}canLogInfo(){return this._level>=X.Info}canLogDebug(){return this._level>=X.Debug}canLogError(){return this._level>=X.Error}canLogWarn(){return this._level>=X.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(){for(var t,e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return this._level>=X.Error&&(this._onErrorHandler.length?this.callErrorHandler(...i):H(null!==(t=this._method)&&void 0!==t?t:"error","ERROR",i)),this}warn(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=X.Warn&&H(this._method||"warn","WARN",e),this}info(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=X.Info&&H(this._method||"log","INFO",e),this}debug(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=X.Debug&&H(this._method||"log","DEBUG",e),this}}$._instance=null;const Y=t=>{let e=null,i=null;return function(){for(var n=arguments.length,s=new Array(n),r=0;r<n;r++)s[r]=arguments[r];return e&&s.every(((t,i)=>t===e[i]))||(e=s,i=t(...s)),i}};var q=function(t,e,i){return t<e?e:t>i?i:t};function K(t,e){return i=>t*(1-i)+e*i}function Z(t,e){return function(i){return Math.round(t*(1-i)+e*i)}}const J=t=>e=>M(e,t),Q=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(o(t))return t;const i=[t];return(e&&e.get||J)(i)},tt=t=>t?"string"==typeof t||"number"==typeof t?()=>t:o(t)?t:e=>e[t.field]:null,et=(t,e)=>{const i=o(e)?e:t=>t;let n,s;if(t&&t.length){const e=t.length;for(let r=0;r<e;r+=1){let e=i(t[r]);l(e)||!y(e=+e)||Number.isNaN(e)||(l(n)?(n=e,s=e):(n=Math.min(n,e),s=Math.max(s,e)))}return[n,s]}return[n,s]},it=1e-12,nt=Math.PI,st=nt/2,rt=2*nt,at=2*Math.PI,ot=Math.abs,lt=Math.atan2,ht=Math.cos,ct=Math.max,ut=Math.min,dt=Math.sin,pt=Math.sqrt,gt=Math.pow;function ft(t){return t>=1?st:t<=-1?-st:Math.asin(t)}function mt(t,e,i,n,s){let r=i,a=n;return"number"==typeof t&&"number"==typeof i&&(r=(1-s)*t+s*i),"number"==typeof e&&"number"==typeof n&&(a=(1-s)*e+s*n),{x:r,y:a}}function yt(t,e){return t[0]*e[1]-t[1]*e[0]}class bt{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;this.x=0,this.y=0,this.x=t,this.y=e,this.x1=i,this.y1=n}clone(){return new bt(this.x,this.y)}copyFrom(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}set(t,e){return this.x=t,this.y=e,this}add(t){return y(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return y(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}multi(t){throw new Error("暂不支持")}div(t){throw new Error("暂不支持")}}class vt{static distancePP(t,e){return pt(gt(t.x-e.x,2)+gt(t.y-e.y,2))}static distanceNN(t,e,i,n){return pt(gt(t-i,2)+gt(e-n,2))}static distancePN(t,e,i){return pt(gt(e-t.x,2)+gt(i-t.y,2))}static pointAtPP(t,e,i){return new bt((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}function xt(t){return t*(Math.PI/180)}function _t(t){return 180*t/Math.PI}const At=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-rt;)t+=rt;else if(t>0)for(;t>rt;)t-=rt;return t};function St(t,e,i){return e?{x:t.x+e*Math.cos(i),y:t.y+e*Math.sin(i)}:{x:t.x,y:t.y}}function Tt(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function wt(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1]}function Mt(t,e,i,n){if(!function(t,e,i,n){let s=t[0],r=e[0],a=i[0],o=n[0];return r<s&&([s,r]=[r,s]),o<a&&([o,a]=[a,o]),!(r<a||o<s||(s=t[1],r=e[1],a=i[1],o=n[1],r<s&&([s,r]=[r,s]),o<a&&([o,a]=[a,o]),r<a||o<s))}(t,e,i,n))return!1;const s=[0,0],r=[0,0],a=[0,0];if(wt(s,e,t),wt(r,n,i),ot((o=s)[0]-(l=r)[0])+ot(o[1]-l[1])<1e-12)return!0;var o,l;wt(a,i,t);const h=yt(a,r)/yt(s,r);return h>=0&&h<=1&&[t[0]+s[0]*h,t[1]+s[1]*h]}var Bt;function Ct(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function kt(t,e){let{x:i,y:n}=t,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};return{x:(i-s.x)*Math.cos(e)-(n-s.y)*Math.sin(e)+s.x,y:(i-s.x)*Math.sin(e)+(n-s.y)*Math.cos(e)+s.y}}function Pt(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function Ot(t,e){const i=e?xt(t.angle):t.angle,n=Pt(t);return[kt({x:t.x1,y:t.y1},i,n),kt({x:t.x2,y:t.y1},i,n),kt({x:t.x2,y:t.y2},i,n),kt({x:t.x1,y:t.y2},i,n)]}let Rt,Lt,It,Et;function Dt(t){return Rt=1/0,Lt=1/0,It=-1/0,Et=-1/0,t.forEach((t=>{Rt>t.x&&(Rt=t.x),It<t.x&&(It=t.x),Lt>t.y&&(Lt=t.y),Et<t.y&&(Et=t.y)})),{x1:Rt,y1:Lt,x2:It,y2:Et}}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(Bt||(Bt={}));const Ft=1e-8;function jt(t,e,i){let n=0,s=t[0];if(!s)return!1;for(let r=1;r<t.length;r++){const a=t[r];n+=Ut(s.x,s.y,a.x,a.y,e,i),s=a}const r=t[0];return Nt(s.x,r.x)&&Nt(s.y,r.y)||(n+=Ut(s.x,s.y,r.x,r.y,e,i)),0!==n}function Ut(t,e,i,n,s,r){if(r>e&&r>n||r<e&&r<n)return 0;if(n===e)return 0;const a=(r-e)/(n-e);let o=n<e?1:-1;1!==a&&0!==a||(o=n<e?.5:-.5);const l=a*(i-t)+t;return l===s?1/0:l>s?o:0}function Nt(t,e){return Math.abs(t-e)<Ft}const Wt=t=>{let e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,n=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(e&=1023,i&=1023,n=e<<10|i,n+=65536),12288===n||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":8361===n||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||172===n||175===n||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":161===n||164===n||167<=n&&n<=168||170===n||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||198===n||208===n||215<=n&&n<=216||222<=n&&n<=225||230===n||232<=n&&n<=234||236<=n&&n<=237||240===n||242<=n&&n<=243||247<=n&&n<=250||252===n||254===n||257===n||273===n||275===n||283===n||294<=n&&n<=295||299===n||305<=n&&n<=307||312===n||319<=n&&n<=322||324===n||328<=n&&n<=331||333===n||338<=n&&n<=339||358<=n&&n<=359||363===n||462===n||464===n||466===n||468===n||470===n||472===n||474===n||476===n||593===n||609===n||708===n||711===n||713<=n&&n<=715||717===n||720===n||728<=n&&n<=731||733===n||735===n||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||1025===n||1040<=n&&n<=1103||1105===n||8208===n||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||8240===n||8242<=n&&n<=8243||8245===n||8251===n||8254===n||8308===n||8319===n||8321<=n&&n<=8324||8364===n||8451===n||8453===n||8457===n||8467===n||8470===n||8481<=n&&n<=8482||8486===n||8491===n||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||8585===n||8592<=n&&n<=8601||8632<=n&&n<=8633||8658===n||8660===n||8679===n||8704===n||8706<=n&&n<=8707||8711<=n&&n<=8712||8715===n||8719===n||8721===n||8725===n||8730===n||8733<=n&&n<=8736||8739===n||8741===n||8743<=n&&n<=8748||8750===n||8756<=n&&n<=8759||8764<=n&&n<=8765||8776===n||8780===n||8786===n||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||8853===n||8857===n||8869===n||8895===n||8978===n||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||9675===n||9678<=n&&n<=9681||9698<=n&&n<=9701||9711===n||9733<=n&&n<=9734||9737===n||9742<=n&&n<=9743||9748<=n&&n<=9749||9756===n||9758===n||9792===n||9794===n||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||9839===n||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||9955===n||9960<=n&&n<=9983||10045===n||10071===n||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||65533===n||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"};function zt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;i||(i=1);const{fontStyle:n=e.fontStyle,fontVariant:s=e.fontVariant,fontWeight:r=e.fontWeight,fontSize:a=e.fontSize,fontFamily:o=e.fontFamily}=t;return(n?n+" ":"")+(s?s+" ":"")+(r?r+" ":"")+a*i+"px "+(o||"sans-serif")}class Gt{constructor(t,e){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=t,this._userSpec=null!=e?e:{},this.textSpec=this._initSpec(),h(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=h(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(l(this._canvas)&&(h(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),l(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&globalThis&&h(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),l(this._context)&&h(this._canvas)){const t=this._canvas.getContext("2d");h(t)&&(t.save(),t.font=zt(this.textSpec),this._contextSaved=!0,this._context=t)}return!l(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,i;const{defaultFontParams:n={}}=this._option,{fontStyle:s=n.fontStyle,fontVariant:r=n.fontVariant,fontWeight:a=(null!==(t=n.fontWeight)&&void 0!==t?t:"normal"),fontSize:o=(null!==(e=n.fontSize)&&void 0!==e?e:12),fontFamily:l=(null!==(i=n.fontFamily)&&void 0!==i?i:"sans-serif"),align:h,textAlign:c=(null!=h?h:"center"),baseline:u,textBaseline:d=(null!=u?u:"middle"),ellipsis:g,limit:f}=this._userSpec;let{lineHeight:m=o}=this._userSpec;if(p(m)&&"%"===m[m.length-1]){const t=Number.parseFloat(m.substring(0,m.length-1))/100;m=o*t}return{fontStyle:s,fontVariant:r,fontFamily:l,fontSize:o,fontWeight:a,textAlign:c,textBaseline:d,ellipsis:g,limit:f,lineHeight:m}}measure(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}fullMeasure(t){if(l(t))return{width:0,height:0};if(l(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:i,fontWeight:n,textAlign:s,textBaseline:r,ellipsis:a,limit:o,lineHeight:h}=this.textSpec;let c;try{const l=this._option.getTextBounds({text:t,fontFamily:e,fontSize:i,fontWeight:n,textAlign:s,textBaseline:r,ellipsis:!!a,maxLineWidth:o||1/0,lineHeight:h});c={width:l.width(),height:l.height()}}catch(e){this._notSupportVRender=!0,c=this.measureWithNaiveCanvas(t)}return c}measureWithNaiveCanvas(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(t){var e;if(!this.initContext())return this._quickMeasureWithoutCanvas(t);const i=this._context.measureText(t),{fontSize:n,lineHeight:s}=this.textSpec;return{width:i.width,height:null!==(e=s)&&void 0!==e?e:n,fontBoundingBoxAscent:i.fontBoundingBoxAscent,fontBoundingBoxDescent:i.fontBoundingBoxDescent}}quickMeasure(t){return this._measureReduce(t,this._quickMeasure.bind(this))}_quickMeasure(t){const e={width:0,height:0};for(let i=0;i<t.length;i++){const n=t[i];let s=this._measureSpecialChar(n);l(s)&&Gt.NUMBERS_CHAR_SET.includes(n)&&(s=this._measureNumberChar()),l(s)&&["F","W"].includes(Wt(n))&&(s=this._measureFullSizeChar()),l(s)&&(s=this._measureLetterChar()),e.width+=s.width,e.height=Math.max(e.height,s.height),!l(s.fontBoundingBoxAscent)&&(e.fontBoundingBoxAscent=s.fontBoundingBoxAscent),!l(s.fontBoundingBoxDescent)&&(e.fontBoundingBoxDescent=s.fontBoundingBoxDescent)}return e}quickMeasureWithoutCanvas(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(t){var e;const i={width:0,height:0},{fontSize:n,lineHeight:s}=this.textSpec;for(let e=0;e<t.length;e++){const s=t[e],r=["F","W"].includes(Wt(s))?1:.53;i.width+=r*n}return i.height=null!==(e=s)&&void 0!==e?e:n,i}_measureReduce(t,e){var i;const{fontSize:n,lineHeight:s}=this.textSpec,r={width:0,height:0};if(l(t))return r;if(g(t)){const a=t.filter(h).map((t=>t.toString()));return 0===a.length?r:1===a.length?e(a[0]):{width:a.reduce(((t,i)=>Math.max(t,e(i).width)),0),height:a.length*((null!==(i=s)&&void 0!==i?i:n)+1)+1}}return e(t.toString())}_measureNumberChar(){if(l(this._numberCharSize)){const t=this._standardMethod(Gt.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/Gt.NUMBERS_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._numberCharSize}_measureFullSizeChar(){return l(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(Gt.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(l(this._letterCharSize)){const t=this._standardMethod(Gt.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/Gt.ALPHABET_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._letterCharSize}_measureSpecialChar(t){return h(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){h(this._canvas)&&(this._canvas=null),h(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}function Vt(t,e,i){const{x1:n,y1:s,x2:r,y2:a}=e;return i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f),e):(t.clear(),t.add(i.a*n+i.c*s+i.e,i.b*n+i.d*s+i.f),t.add(i.a*r+i.c*s+i.e,i.b*r+i.d*s+i.f),t.add(i.a*r+i.c*a+i.e,i.b*r+i.d*a+i.f),t.add(i.a*n+i.c*a+i.e,i.b*n+i.d*a+i.f),e)}Gt.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",Gt.NUMBERS_CHAR_SET="0123456789",Gt.FULL_SIZE_CHAR="字";class Ht{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new Ht(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}setValue(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=i,this.y2=n,this}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return i<t?(this.x2=t,this.x1=i):(this.x1=t,this.x2=i),n<e?(this.y2=e,this.y1=n):(this.y1=e,this.y2=n),this}add(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}expand(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return g(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}rotate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=this.rotatedPoints(t,e,i);return this.clear().add(n[0],n[1]).add(n[2],n[3]).add(n[4],n[5]).add(n[6],n[7])}scale(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const s=this.scalePoints(t,e,i,n);return this.clear().add(s[0],s[1]).add(s[2],s[3])}union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}contains(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}containsPoint(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}scaleY(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return Vt(this,this,t),this}copy(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}rotatedPoints(t,e,i){const{x1:n,y1:s,x2:r,y2:a}=this,o=Math.cos(t),l=Math.sin(t),h=e-e*o+i*l,c=i-e*l-i*o;return[o*n-l*s+h,l*n+o*s+c,o*n-l*a+h,l*n+o*a+c,o*r-l*s+h,l*r+o*s+c,o*r-l*a+h,l*r+o*a+c]}scalePoints(t,e,i,n){const{x1:s,y1:r,x2:a,y2:o}=this;return[t*s+(1-t)*i,e*r+(1-e)*n,t*a+(1-t)*i,e*o+(1-e)*n]}}class Xt extends Ht{}class $t extends Ht{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;var i;super(t),t&&(this.angle=null!==(i=t.angle)&&void 0!==i?i:e)}intersects(t){return function(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=Ot(t,i),s=Ot(e,i),r=(t,e)=>[e.x-t.x,e.y-t.y],a=r(Pt(t),Pt(e)),o=r(n[0],n[1]),l=r(n[1],n[2]),h=r(s[0],s[1]),c=r(s[1],s[2]),u=i?xt(t.angle):t.angle;let d=i?xt(90-t.angle):t.angle+st;const p=i?xt(e.angle):e.angle;let g=i?xt(90-e.angle):e.angle+st;d>at&&(d-=at),g>at&&(g-=at);const f=(t,e,i,n)=>{const s=[Math.cos(e),Math.sin(e)];return t+(Ct(s,i)+Ct(s,n))/2>Ct(s,a)};return f((t.x2-t.x1)/2,u,h,c)&&f((t.y2-t.y1)/2,d,h,c)&&f((e.x2-e.x1)/2,p,o,l)&&f((e.y2-e.y1)/2,g,o,l)}(this,t)}setValue(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return super.setValue(t,e,i,n),this.angle=s,this}clone(){return new $t(this)}getRotatedCorners(){const t={x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2};return[kt({x:this.x1,y:this.y1},this.angle,t),kt({x:this.x2,y:this.y1},this.angle,t),kt({x:this.x1,y:this.y2},this.angle,t),kt({x:this.x2,y:this.y2},this.angle,t)]}}class Yt{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.a=t,this.b=e,this.c=i,this.d=n,this.e=s,this.f=r}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,i,n,s,r){return!(this.e!==s||this.f!==r||this.a!==t||this.d!==n||this.b!==e||this.c!==i)}setValue(t,e,i,n,s,r){return this.a=t,this.b=e,this.c=i,this.d=n,this.e=s,this.f=r,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,i=this.c,n=this.d,s=this.e,r=this.f,a=new Yt,o=t*n-e*i;return a.a=n/o,a.b=-e/o,a.c=-i/o,a.d=t/o,a.e=(i*r-n*s)/o,a.f=-(t*r-e*s)/o,a}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.a*e+this.c*i,s=this.b*e+this.d*i,r=this.a*-i+this.c*e,a=this.b*-i+this.d*e;return this.a=n,this.b=s,this.c=r,this.d=a,this}rotateByCenter(t,e,i){const n=Math.cos(t),s=Math.sin(t),r=(1-n)*e+s*i,a=(1-n)*i-s*e,o=n*this.a-s*this.b,l=s*this.a+n*this.b,h=n*this.c-s*this.d,c=s*this.c+n*this.d,u=n*this.e-s*this.f+r,d=s*this.e+n*this.f+a;return this.a=o,this.b=l,this.c=h,this.d=c,this.e=u,this.f=d,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,i,n,s,r){return this.multiply(t,e,i,n,s,r),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:i,d:n,e:s,f:r}=this;return this.a=e,this.b=t,this.c=n,this.d=i,this.e=r,this.f=s,this}multiply(t,e,i,n,s,r){const a=this.a,o=this.b,l=this.c,h=this.d,c=a*t+l*e,u=o*t+h*e,d=a*i+l*n,p=o*i+h*n,g=a*s+l*r+this.e,f=o*s+h*r+this.f;return this.a=c,this.b=u,this.c=d,this.d=p,this.e=g,this.f=f,this}interpolate(t,e){const i=new Yt;return i.a=this.a+(t.a-this.a)*e,i.b=this.b+(t.b-this.b)*e,i.c=this.c+(t.c-this.c)*e,i.d=this.d+(t.d-this.d)*e,i.e=this.e+(t.e-this.e)*e,i.f=this.f+(t.f-this.f)*e,i}transformPoint(t,e){const{a:i,b:n,c:s,d:r,e:a,f:o}=this,l=i*r-n*s,h=r/l,c=-n/l,u=-s/l,d=i/l,p=(s*o-r*a)/l,g=-(i*o-n*a)/l,{x:f,y:m}=t;e.x=f*h+m*u+p,e.y=f*c+m*d+g}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new Yt(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,i=this.c,n=this.d,s=t*n-e*i,r={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const a=Math.sqrt(t*t+e*e);r.rotateDeg=e>0?Math.acos(t/a):-Math.acos(t/a),r.scaleX=a,r.scaleY=s/a,r.skewX=(t*i+e*n)/s,r.skewY=0}else if(0!==i||0!==n){const a=Math.sqrt(i*i+n*n);r.rotateDeg=Math.PI/2-(n>0?Math.acos(-i/a):-Math.acos(i/a)),r.scaleX=s/a,r.scaleY=a,r.skewX=0,r.skewY=(t*i+e*n)/s}return r.rotateDeg=_t(r.rotateDeg),r}}function qt(t,e,i){e/=100,i/=100;const n=(1-Math.abs(2*i-1))*e,s=n*(1-Math.abs(t/60%2-1)),r=i-n/2;let a=0,o=0,l=0;return 0<=t&&t<60?(a=n,o=s,l=0):60<=t&&t<120?(a=s,o=n,l=0):120<=t&&t<180?(a=0,o=n,l=s):180<=t&&t<240?(a=0,o=s,l=n):240<=t&&t<300?(a=s,o=0,l=n):300<=t&&t<360&&(a=n,o=0,l=s),a=Math.round(255*(a+r)),o=Math.round(255*(o+r)),l=Math.round(255*(l+r)),{r:a,g:o,b:l}}function Kt(t,e,i){t/=255,e/=255,i/=255;const n=Math.min(t,e,i),s=Math.max(t,e,i),r=s-n;let a=0,o=0,l=0;return a=0===r?0:s===t?(e-i)/r%6:s===e?(i-t)/r+2:(t-e)/r+4,a=Math.round(60*a),a<0&&(a+=360),l=(s+n)/2,o=0===r?0:r/(1-Math.abs(2*l-1)),o=+(100*o).toFixed(1),l=+(100*l).toFixed(1),{h:a,s:o,l:l}}const Zt=/^#([0-9a-f]{3,8})$/,Jt={transparent:4294967040},Qt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function te(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function ee(t){return y(t)?new ae(t>>16,t>>8&255,255&t,1):g(t)?new ae(t[0],t[1],t[2]):new ae(255,255,255)}function ie(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function ne(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const se=(t,e)=>{const i=Zt.exec(t);if(e||i){const t=parseInt(i[1],16),e=i[1].length;return 3===e?new ae((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?ee(t):8===e?new ae(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class re{static Brighter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new re(t).brighter(e).toRGBA()}static SetOpacity(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new re(t).setOpacity(e).toRGBA()}static getColorBrightness(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl";const i=t instanceof re?t:new re(t);switch(e){case"hsv":default:return i.getHSVBrightness();case"hsl":return i.getHSLBrightness();case"lum":return i.getLuminance();case"lum2":return i.getLuminance2();case"lum3":return i.getLuminance3();case"wcag":return i.getLuminanceWCAG()}}static parseColorString(t){if(h(Jt[t]))return function(t){return y(t)?new ae(t>>>24,t>>>16&255,t>>>8&255,255&t):g(t)?new ae(t[0],t[1],t[2],t[3]):new ae(255,255,255,1)}(Jt[t]);if(h(Qt[t]))return ee(Qt[t]);const e=`${t}`.trim().toLowerCase(),i=se(e);if(void 0!==i)return i;if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const t=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new ae(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){const t=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),i=qt(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new ae(i.r,i.g,i.b,parseFloat(t[3]))}}constructor(t){const e=re.parseColorString(t);e?this.color=e:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new ae(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(t){const{r:e,g:i,b:n}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(n*t))),this}add(t){const{r:e,g:i,b:n}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,i+t.color.g),this.color.b+=Math.min(255,n+t.color.b),this}sub(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}multiply(t){const{r:e,g:i,b:n}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(n*t.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return.5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(t,e,i){const n=this.color.opacity,s=Kt(this.color.r,this.color.g,this.color.b),r=qt(l(t)?s.h:q(t,0,360),l(e)?s.s:e>=0&&e<=1?100*e:e,l(i)?s.l:i<=1&&i>=0?100*i:i);return this.color=new ae(r.r,r.g,r.b,n),this}setRGB(t,e,i){return!l(t)&&(this.color.r=t),!l(e)&&(this.color.g=e),!l(i)&&(this.color.b=i),this}setHex(t){const e=`${t}`.trim().toLowerCase(),i=se(e,!0);return null!=i?i:this}setColorName(t){const e=Qt[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}getLuminanceWCAG(){const t=this.color.r/255,e=this.color.g/255,i=this.color.b/255;let n,s,r;return n=t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4),s=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),r=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4),.2126*n+.7152*s+.0722*r}clone(){return new re(this.color.toString())}copyGammaToLinear(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}copyLinearToGamma(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;const i=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,i),this.color.g=Math.pow(t.color.g,i),this.color.b=Math.pow(t.color.b,i),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=ie(t.color.r),this.color.g=ie(t.color.g),this.color.b=ie(t.color.b),this}copyLinearToSRGB(t){return this.color.r=ne(t.color.r),this.color.g=ne(t.color.g),this.color.b=ne(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class ae{constructor(t,e,i,n){this.r=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.g=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),h(n)?this.opacity=isNaN(+n)?1:Math.max(0,Math.min(1,+n)):this.opacity=1}formatHex(){return`#${te(this.r)+te(this.g)+te(this.b)+(1===this.opacity?"":te(255*this.opacity))}`}formatRgb(){const t=this.opacity;return`${1===t?"rgb(":"rgba("}${this.r},${this.g},${this.b}${1===t?")":`,${t})`}`}formatHsl(){const t=this.opacity,{h:e,s:i,l:n}=Kt(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${i}%,${n}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}var oe=Object.freeze({__proto__:null,Color:re,DEFAULT_COLORS:Qt,RGB:ae,hexToRgb:function(t){let e="",i="",n="";const s="#"===t[0]?1:0;for(let r=s;r<t.length;r++)"#"!==t[r]&&(r<s+2?e+=t[r]:r<s+4?i+=t[r]:r<s+6&&(n+=t[r]));return[parseInt(e,16),parseInt(i,16),parseInt(n,16)]},hslToRgb:qt,interpolateRgb:function(t,e){const i=t.r,n=e.r,s=t.g,r=e.g,a=t.b,o=e.b,l=t.opacity,h=e.opacity;return t=>{const e=Math.round(i*(1-t)+n*t),c=Math.round(s*(1-t)+r*t),u=Math.round(a*(1-t)+o*t);return new ae(e,c,u,l*(1-t)+h*t)}},rgbToHex:function(t,e,i){return Number((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)},rgbToHsl:Kt});function le(t){return t.replace(/-([a-z])/g,((t,e)=>e.toUpperCase()))}var he=6371008.8,ce={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:39.37*he,kilometers:6371.0088,kilometres:6371.0088,meters:he,metres:he,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:he/1852,radians:1,yards:6967335.223679999};function ue(t,e){if(!t)return!1;if(!e)return!1;const i="Feature"===(r=e).type?r.geometry:r,n=i.type,s=e.bbox;var r;let a=i.coordinates;if(s&&!0===function(t,e,i){if(!e)return!0;if(!i)return t.x>=e.x1&&t.x<=e.x2&&t.y>=e.y1&&t.y<=e.y2;let n=e.x1,s=e.x2,r=e.y1,a=e.y2;return n>s&&([n,s]=[s,n]),r>a&&([r,a]=[a,r]),t.x>=n&&t.x<=s&&t.y>=r&&t.y<=a}(t,{x1:s[0],x2:s[1],y1:s[1],y2:s[3]},!0))return!1;"Polygon"===n&&(a=[a]);let o=!1;for(let e=0;e<a.length;++e)for(let i=0;i<a[e].length;++i)if(jt(a[e][i].map((t=>({x:t[0],y:t[1]}))),t.x,t.y))return o=!0,o;return o}function de(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const s=xt(t[0]),r=xt(t[1]),a=xt(i),o=function(t,e){void 0===e&&(e="kilometers");var i=ce[e];if(!i)throw new Error(e+" units is invalid");return t/i}(e,n.units),l=Math.asin(Math.sin(r)*Math.cos(o)+Math.cos(r)*Math.sin(o)*Math.cos(a));return{x:_t(s+Math.atan2(Math.sin(a)*Math.sin(o)*Math.cos(r),Math.cos(o)-Math.sin(r)*Math.sin(l))),y:_t(l)}}class pe extends e.BaseChartSpecTransformer{transformSpec(t){const{timeData:e,timeNodes:i}=function(t){const{xField:e,yField:i,timeField:n,data:s,topN:r=10,icon:a}=t,o=new Set,l=new Map;return s.sort(((t,i)=>Number(i[e])-Number(t[e]))),s.forEach((t=>{const e=t[n];h(e)&&o.add(e),l.has(e)||l.set(e,[]);const s=l.get(e);if(s.length<r){const e=Object.assign({},t);a&&a[e[i]]&&(e.icon=a[e[i]]),s.push(e)}})),{timeData:l,timeNodes:Array.from(o).sort()}}(t),{interval:n,xField:s,yField:r,color:a,icon:o,iconPosition:l,iconShape:c,timeLabel:u,label:d,nameLabel:p,xAxis:g,yAxis:f}=t,m=n||1e3,y=Math.min(m,500);if(t.type="common",t.data=[{id:"timeData",values:e.get(i[0])},{id:"time",values:[{time:i[0]}]}],t.color={specified:Object.assign({},a)},t.region=[{clip:!0}],t.series=[{type:"bar",id:"ranking-bar",dataId:"timeData",direction:"horizontal",yField:r,xField:s,seriesField:r,extensionMark:[],label:ge(d,Object.assign(Object.assign({},p),{yField:r}))}],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}},n={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&&(n.label=t.label);return[i,n]}(g,f),t.player={type:"continuous",auto:!0,loop:!1,interval:m,specs:i.map((t=>({data:[{id:"timeData",values:e.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:m,exchangeDuration:y}),u&&!1===u.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)}}(u.style)),o){const e=function(t="bar-end",e="circle",{interval:i,exchangeDuration:n}){return{type:"symbol",dataId:"timeData",style:{symbolType:e,stroke:"white",lineWidth:1,size:(t,e)=>{var i,n;const s=e.vchart,r=null===(i=s.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(s&&r){const t=null!==(n=r.getYAxisHelper().getBandwidth(0))&&void 0!==n?n:0;return Math.max(t-4,0)}return 10},background:t=>t.icon,x:(e,i)=>{var n,s;const r=i.vchart,a=null===(n=r.getChart())||void 0===n?void 0:n.getSeriesInIndex(0)[0];if(r&&a){const i=null!==(s=a.getYAxisHelper().getBandwidth(0))&&void 0!==s?s:0;return"bar-start"===t?i/2:"axis"===t?-i/2:a.dataToPositionX(e)-i/2}},y:(t,e)=>{var i,n;const s=e.vchart,r=null===(i=s.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(s&&r){const e=null!==(n=r.getYAxisHelper().getBandwidth(0))&&void 0!==n?n:0;return r.dataToPositionY(t)+e/2}},scaleY:"rect"===e?1.2:1},animationUpdate:fe(i,n),animationEnter:[{type:"moveIn",duration:n,easing:"cubicInOut",options:{direction:"y",orient:"negative",point:(t,e,i)=>({y:i.groupHeight+e.getBounds().height()})}}],animationExit:[{type:"moveOut",duration:n,easing:"cubicInOut",options:{direction:"y",orient:"negative"}}]}}(l,c,{interval:m,exchangeDuration:y});t.series[0].extensionMark.push(e)}super.transformSpec(t)}}function ge(t={},e){var i,n,s,r;const a=[];return!1!==t.visible&&a.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===(n=t.style)||void 0===n?void 0:n.stroke)?"null":void 0}}),e.visible&&a.push({visible:!0,overlap:!1,style:Object.assign({},e.style),smartInvert:{fillStrategy:(null===(s=e.style)||void 0===s?void 0:s.fill)?"null":void 0,strokeStrategy:(null===(r=e.style)||void 0===r?void 0:r.stroke)?"null":void 0},position:"bar-end"===e.position?"inside-right":"inside-left",formatter:`{${e.yField}}`}),a}function fe(t,e){return[{duration:e,easing:"cubicInOut",channel:["y"]},{options:{excludeChannels:["y"]},channel:["x","x2","x1"],easing:"linear",duration:t}]}class me extends e.BaseChart{constructor(){super(...arguments),this.type="rankingBar",this.transformerConstructor=pe}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,timeField:a,data:o}=this._spec;return s&&r&&a?!!o||(null===(n=(i=this._option).onError)||void 0===n||n.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)}}me.type="rankingBar",me.view="singleDefault",me.transformerConstructor=pe;const ye=1e3,be="#21252c",ve={labelLayout:"top",bar:{style:{cornerRadius:5}},barBackground:{type:"rect",style:{fill:"rgba(33,37,44,0.1)",cornerRadius:5}},rankingIcon:{visible:!0,style:{fill:be,size:20}},nameLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:be,textBaseline:"middle"}},orderLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:be,textBaseline:"middle"}},valueLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:be,textBaseline:"middle"}},pageSize:5,scrollSize:1,animationAppear:{enable:!0,type:"grow",duration:ye,easing:"linear"},animationUpdate:{enable:!0,type:"grow",duration:ye,easing:"linear"},animationNormal:{interval:ye}},xe="dataKey",_e="VCHART_ORDER",Ae="SUPPLY_DATA_KEY";class Se extends e.CommonChartSpecTransformer{constructor(){super(...arguments),this.formatMap={},this.paginateDataArr=t=>{const{scrollSize:e=1,pageSize:i=5}=t,n=this.originalData,s={};let r=0;for(let a=0;a<n.length;a+=e)if(r++,s[`page${r}`]=n.slice(a,a+i),a+i-1>=n.length-1){n.push(...Array.from({length:a+i-n.length},(e=>({[t.yField]:100*Math.random(),[t.xField]:null,[Ae]:!0}))));break}return{orderCount:r,result:s}},this.processRankingData=t=>{const e=[];t.data.forEach(((t,e)=>t[_e]=e+1<10?`0${e+1}`:e+1));const i=this.paginateDataArr(t).result,n=this.paginateDataArr(t).orderCount;this.orderCount=n;const s=t.pageSize-i[`page${n}`].length;return i[`page${n}`].push(...Array.from({length:s},(e=>({[t.yField]:100*Math.random(),[t.xField]:null,[Ae]:!0})))),Object.keys(i).forEach((n=>{e.push({data:[{id:"datas",values:i[n].map((e=>Object.assign(Object.assign({},e),{[xe]:e[t.yField]})))},{id:"order",values:[{order:n}]}]})})),e}}isSpecValid(t){const{xField:e,yField:i,data:n}=t;return!!(e&&i&&n&&0!==n.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 n in i)"__proto__"!==n&&"constructor"!==n&&"prototype"!==n&&"object"==typeof i[n]&&null!==i[n]?(e.hasOwnProperty(n)||(e[n]=Array.isArray(i[n])?[]:{}),t(e[n],i[n])):e.hasOwnProperty(n)||"object"!=typeof e||(e[n]=i[n]);return e})(t,ve),((t,e)=>{e.forEach((e=>{var i,n,s,r,a,o,l;g(t[e])?null===(i=t[e])||void 0===i||i.forEach(((i,n)=>{var s,r,a;t[e][n]=Object.assign(Object.assign({},i),{style:Object.assign(Object.assign({},null==i?void 0:i.style),{visible:null===(a=null!==(r=null===(s=null==i?void 0:i.style)||void 0===s?void 0:s.visible)&&void 0!==r?r:null==i?void 0:i.visible)||void 0===a||a})})})):t[e]=Object.assign(Object.assign({},t[e]),{style:Object.assign(Object.assign({},null===(n=t[e])||void 0===n?void 0:n.style),{visible:null===(l=null!==(a=null===(r=null===(s=t[e])||void 0===s?void 0:s.style)||void 0===r?void 0:r.visible)&&void 0!==a?a:null===(o=t[e])||void 0===o?void 0:o.visible)||void 0===l||l})})}))})(t,["barBackground","rankingIcon","decorateHaloIcons","orderLabel","nameLabel","valueLabel"])}upgradeTextMeasure(t){var e,i,n,s,r,a,o,l,h;null===(e=this.nameLabelTextMeasure)||void 0===e||e.release(),null===(i=this.valueLabelTextMeasure)||void 0===i||i.release(),null===(n=this.orderLabelTextMeasure)||void 0===n||n.release(),this.nameLabelTextMeasure=new Gt({defaultFontParams:null!==(r=null===(s=t.nameLabel)||void 0===s?void 0:s.style)&&void 0!==r?r:{}}),this.valueLabelTextMeasure=new Gt({defaultFontParams:null!==(o=null===(a=t.valueLabel)||void 0===a?void 0:a.style)&&void 0!==o?o:{}}),this.orderLabelTextMeasure=new Gt({defaultFontParams:null!==(h=null===(l=t.orderLabel)||void 0===l?void 0:l.style)&&void 0!==h?h:{}})}upgradeFormatMap(t){this.formatMap[t.yField]=t.nameLabel.formatMethod,this.formatMap[t.xField]=t.valueLabel.formatMethod,this.formatMap[_e]=t.orderLabel.formatMethod}processData(t){var e;(null===(e=t.data[0])||void 0===e?void 0:e.values)||(this.originalData=t.data,this.originalSpec=B(t),this.dataSpecs=this.processRankingData(t),t.data=this.dataSpecs[0].data)}transformBaseSpec(t){var e,i,n;t.type="common",t.dataKey=xe,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===(n=t.bar)||void 0===n?void 0:n.style),{x1:0,visible:e=>{var i,n;return!e[Ae]&&(null===(n=null===(i=t.bar)||void 0===i?void 0:i.style)||void 0===n||n)}})})}]}transformAnimationSpec(t){var e,i,n;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!==(n=t.animationUpdate.duration)&&void 0!==n?n: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,n;const s=t.map((t=>t[e])).filter((t=>null!=t));if(0===s.length)i=0,n=1;else{i=Math.min(...s)-(Math.max(...s)-Math.min(...s))/3,n=(Math.max(...s)-i)/.8+i;const t=10,e=i;i===n&&(i=e-t,n=(4*e+t)/4)}return{min:i,max:n}})(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:xe,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[Ae]&&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:xe,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[Ae]&&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:xe,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(_e,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(_e,e)).height)/2},t.rankingIcon.style),{lineWidth:0,stroke:null,visible:e=>!e[Ae]&&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:xe,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,_e,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[Ae]&&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:xe,state:null===(e=t.orderLabel)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({text:t=>this.formatDatum(_e,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[Ae]&&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:xe,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[Ae]&&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,_e,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 n=this.originalData.map((t=>t[Ae]?0:i.fullMeasure(this.formatDatum(e,t)).width));return Math.max(...n)}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,n,s,r;return!1!==(null===(e=t.animationUpdate)||void 0===e?void 0:e.enable)&&{type:"moveOut",options:{direction:"y",orient:"negative",point:(e,i)=>({y:i.getGraphicAttribute("y")-t.height/(t.pageSize+1)*Math.min(t.scrollSize,t.pageSize)})},duration:null!==(n=null===(i=t.animationUpdate)||void 0===i?void 0:i.duration)&&void 0!==n?n:1e3,easing:null!==(r=null===(s=t.animationUpdate)||void 0===s?void 0:s.easing)&&void 0!==r?r:"linear"}}getAnimationEnter(t){var e,i,n,s,r;return!1!==(null===(e=t.animationUpdate)||void 0===e?void 0:e.enable)&&{type:"moveIn",options:{direction:"y",orient:"negative",excludeChannels:["y"],point:(e,i)=>({y:i.getGraphicAttribute("y")+t.height/(t.pageSize+1)*Math.min(t.scrollSize,t.pageSize)})},duration:null!==(n=null===(i=t.animationUpdate)||void 0===i?void 0:i.duration)&&void 0!==n?n:1e3,easing:null!==(r=null===(s=t.animationUpdate)||void 0===s?void 0:s.easing)&&void 0!==r?r:"linear"}}getAnimationAppear(t,e){var i,n,s,r,a,o,l,h,c,u,d,p,g;return!1!==(null===(i=t.animationAppear)||void 0===i?void 0:i.enable)&&("rect"===e?{type:"growWidthIn",oneByOne:!1,duration:null!==(s=null===(n=t.animationAppear)||void 0===n?void 0:n.duration)&&void 0!==s?s:1e3,easing:null!==(a=null===(r=t.animationAppear)||void 0===r?void 0:r.easing)&&void 0!==a?a:"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!==(d=null===(u=t.animationAppear)||void 0===u?void 0:u.duration)&&void 0!==d?d: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,n,s;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!==(s=null===(n=t.animationUpdate)||void 0===n?void 0:n.easing)&&void 0!==s?s:"linear"}}}class Te extends e.BaseChart{constructor(){super(...arguments),this.type="rankingList",this.transformerConstructor=Se}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,data:a}=this._spec;return s&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}Te.type="rankingList",Te.view="singleDefault",Te.transformerConstructor=Se;const we=(t,e)=>{var i,n;if(!(null==e?void 0:e.fields))return t;if(0===t.length)return t;const s=e.fields,r=t[0],a={},o=[];for(const e in s)if(Object.prototype.hasOwnProperty.call(s,e)){const l=s[e];if(l.sort&&(b(l.sortIndex)||(l.sortIndex=0),h(l.sortReverse)||(l.sortReverse="desc"===l.sort)),!l.type){let n=r;e in r||(n=null!==(i=t.find((t=>e in t)))&&void 0!==i?i:r),l.type="number"==typeof n[e]?"linear":"ordinal"}let c;if("number"==typeof l.sortIndex&&(c={key:e,type:l.type,index:l.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:!0===l.sortReverse},o.push(c)),(null===(n=l.domain)||void 0===n?void 0:n.length)>0)if("ordinal"===l.type){l._domainCache={},a[e]=l;const t={};l.domain.forEach(((e,i)=>{t[e]=i,l._domainCache[e]=i})),c&&(c.sortIndex=t,c.sortIndexCount=l.domain.length)}else l.domain.length>=2&&(a[e]=l)}return Object.keys(a).length>0&&(t=t.filter((t=>{for(const e in a){const i=a[e];if("ordinal"===i.type){if(!(t[e]in i._domainCache))return!1}else if(i.domain[0]>t[e]||i.domain[1]<t[e])return!1}return!0}))),o.sort(((t,e)=>t.index-e.index)),t.sort(((t,e)=>function(t,e,i){for(let n=0;n<i.length;n++){const s=i[n];let r=0;if("ordinal"===s.type?(void 0===s.sortIndex[e[s.key]]&&(s.sortIndex[e[s.key]]=s.sortIndexCount++),void 0===s.sortIndex[t[s.key]]&&(s.sortIndex[t[s.key]]=s.sortIndexCount++),r=s.sortIndex[t[s.key]]-s.sortIndex[e[s.key]]):"linear"===s.type&&(r=t[s.key]-e[s.key]),s.sortReverse&&(r=-r),0!==r)return r}return 0}(t,e,o))),t};const Me={svg:"group",rect:"rect",line:"rule",polygon:"polygon",path:"path",polyline:"line",g:"group",circle:"arc",ellipse:"arc"},Be=Object.keys(Me),Ce=["g","svg","text","tspan","switch"],ke=["font-size","font-family","font-weight","font-style","text-align","text-anchor"],Pe=["visibility","x","y","width","height","d","points","stroke","stroke-width","fill","fill-opacity","stroke-opacity",...ke,"cx","cy","r","cx","cy","rx","ry","x1","x2","y1","y2"],Oe=["visible","fill","stroke","stroke-width","fill-opacity","stroke-opacity",...ke],Re=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;const Le=function(t){let e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).customDOMParser;if(e||(null===window||void 0===window?void 0:window.DOMParser)&&(e=t=>(new DOMParser).parseFromString(t,"text/xml")),!e)throw new Error("No Available DOMParser!");const i=e(t);let n=9===i.nodeType?i.firstChild:i;for(;n&&("svg"!==n.nodeName.toLowerCase()||1!==n.nodeType);)n=n.nextSibling;return n?function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=[],n=Fe(t,null);let s=parseFloat(t.getAttribute("width")||e.width),r=parseFloat(t.getAttribute("height")||e.height);!b(s)&&(s=null),!b(r)&&(r=null);const a=t.getAttribute("viewBox");let o;if(a){const t=a.match(Re)||[];if(t.length>=4&&(o={x:parseFloat(t[0]||0),y:parseFloat(t[1]||0),width:parseFloat(t[2]),height:parseFloat(t[3])},s||r)){const t={x:0,y:0,width:s,height:r},e=t.width/o.width,i=t.height/o.height,a=Math.min(e,i),l=-(o.x+o.width/2)*a+(t.x+t.width/2),h=-(o.y+o.height/2)*a+(t.y+t.height/2),c=(new Yt).translate(l,h).scale(a,a);n.transform=c}}return Ue(t,n,i),{root:n,width:s,height:r,elements:i,viewBoxRect:o}}(n):null};let Ie=0;function Ee(t){let e;const{parent:i,attributes:n}=t,s=t=>t?Oe.reduce(((e,i)=>{const n=le(i);return h(t[n])&&(e[n]=t[n]),e}),{}):{};return i?(i._inheritStyle||(i._inheritStyle=s(i.attributes)),e=O({},i._inheritStyle,s(n))):e=s(n),e}function De(t){var e,i,n;const s={},r=null!==(e=t.attributes)&&void 0!==e?e:{},a=null!==(i=t.style)&&void 0!==i?i:{};for(let t=0;t<Pe.length;t++){const e=Pe[t],i=h(a[e])&&""!==a[e]?a[e]:null===(n=r[e])||void 0===n?void 0:n.value;h(i)&&(s[le(e)]=isNaN(+i)?i:parseFloat(i))}return"none"===a.display&&(s.visible=!1),["fontSize","strokeWidth","width","height"].forEach((t=>{const e=s[t];p(s[t])&&(s[t]=parseFloat(e))})),s}function Fe(t,e){var i,n,s,r,a;const o=null===(i=t.tagName)||void 0===i?void 0:i.toLowerCase();if(3===t.nodeType||"text"===o||"tspan"===o)return function(t,e){var i,n,s,r,a,o;if(!e)return null;const l=null===(i=t.tagName)||void 0===i?void 0:i.toLowerCase();if(!l&&"group"!==e.graphicType)return null;const c="text"===l||"tspan"===l,u=c?"group":"text",d=c||null===(n=t.textContent)||void 0===n?void 0:n.replace(/\n/g," ").replace(/\s+/g," ");if(" "===d)return null;let p;return p=c?{tagName:l,graphicType:u,attributes:De(t),parent:e,name:t.getAttribute("name"),id:null!==(s=t.getAttribute("id"))&&void 0!==s?s:`${l}-${Ie++}`,transform:je(t),value:d}:{tagName:l,graphicType:"text",attributes:De(t),parent:e,name:null==e?void 0:e.name,id:null!==(a=null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"id"))&&void 0!==a?a:`${l}-${Ie++}`,value:d},p._inheritStyle=Ee(p),h(p.name)||(p._nameFromParent=null!==(o=e.name)&&void 0!==o?o:e._nameFromParent),c?e._textGroupStyle?p._textGroupStyle=O({},e._textGroupStyle,De(t)):p._textGroupStyle=De(t):p.attributes=p._inheritStyle,p}(t,e);if(!Be.includes(o))return null;const l={tagName:o,graphicType:Me[o],attributes:De(t),parent:e,name:null!==(n=t.getAttribute("name"))&&void 0!==n?n:null===(s=null==e?void 0:e.attributes)||void 0===s?void 0:s.name,id:null!==(r=t.getAttribute("id"))&&void 0!==r?r:`${o}-${Ie++}`,transform:je(t)};return l._inheritStyle=Ee(l),e&&!h(l.name)&&(l._nameFromParent=null!==(a=e.name)&&void 0!==a?a:e._nameFromParent),l}function je(t){var e,i;const n=null===(e=t.transform)||void 0===e?void 0:e.baseVal;if(!n)return null;const s=null===(i=n.consolidate())||void 0===i?void 0:i.matrix;if(!s)return null;const{a:r,b:a,c:o,d:l,e:h,f:c}=s;return new Yt(r,a,o,l,h,c)}function Ue(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];var n;if(!t)return;let s;"svg"!==t.nodeName&&(s=Fe(t,e)),s&&i.push(s);let r=Ce.includes(null===(n=t.tagName)||void 0===n?void 0:n.toLocaleLowerCase())?t.firstChild:null;for(;r;)Ue(r,null!=s?s:e,i),r=r.nextSibling}let Ne=0;function We(){return Ne>1e8&&(Ne=0),(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"dataset")+"_"+Ne++}class ze{constructor(t){var e;let i;this.options=t,this.isDataSet=!0,this.transformMap={},this.parserMap={},this.dataViewMap={},this.target=new s,i=(null==t?void 0:t.name)?t.name:We("dataset"),this.name=i,this._logger=null!==(e=null==t?void 0:t.logger)&&void 0!==e?e:$.getInstance()}setLogger(t){this._logger=t}getDataView(t){return this.dataViewMap[t]}setDataView(t,e){var i;this.dataViewMap[t]&&(null===(i=this._logger)||void 0===i||i.error(`Error: dataView ${t} 之前已存在,请重新命名`)),this.dataViewMap[t]=e}removeDataView(t){this.dataViewMap[t]=null,delete this.dataViewMap[t]}registerParser(t,e){var i;this.parserMap[t]&&(null===(i=this._logger)||void 0===i||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.parserMap[t]=e}removeParser(t){this.parserMap[t]=null,delete this.parserMap[t]}getParser(t){return this.parserMap[t]||this.parserMap.default}registerTransform(t,e){var i;this.transformMap[t]&&(null===(i=this._logger)||void 0===i||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.transformMap[t]=e}removeTransform(t){this.transformMap[t]=null,delete this.transformMap[t]}getTransform(t){return this.transformMap[t]}multipleDataViewAddListener(t,e,i){this._callMap||(this._callMap=new Map);let n=this._callMap.get(i);n||(n=()=>{t.some((t=>t.isRunning))||i()}),t.forEach((t=>{t.target.addListener(e,n)})),this._callMap.set(i,n)}allDataViewAddListener(t,e){this.multipleDataViewAddListener(Object.values(this.dataViewMap),t,e)}multipleDataViewRemoveListener(t,e,i){if(this._callMap){const n=this._callMap.get(i);n&&t.forEach((t=>{t.target.removeListener(e,n)})),this._callMap.delete(i)}}multipleDataViewUpdateInParse(t){t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.markRunning()})),t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.parseNewData(t.data,t.options)}))}multipleDataViewUpdateInRawData(t){t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.markRunning()})),t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.updateRawData(t.data,t.options)}))}destroy(){this.transformMap=null,this.parserMap=null,this.dataViewMap=null,this._callMap=null,this.target.removeAllListeners()}}class Ge{constructor(t,e){var i=this;let n;this.dataSet=t,this.options=e,this.isDataView=!0,this.target=new s,this.parseOption=null,this.transformsArr=[],this.isRunning=!1,this.rawData={},this.history=!1,this.parserData={},this.latestData={},this._fields=null,this.reRunAllTransform=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=i.latestData;return i.isRunning=!0,i.resetTransformData(),i.transformsArr.forEach((e=>{i.executeTransform(e,{pushHistory:t.pushHistory,emitMessage:!1})})),i.isRunning=!1,!1===t.emitMessage||t.skipEqual&&E(e,i.latestData)||i.target.emit("change",{latestData:i.latestData}),i},this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},n=(null==e?void 0:e.name)?e.name:We("dataview"),this.name=n,(null==e?void 0:e.history)&&(this.history=e.history,this.historyData=[]),this.dataSet.setDataView(n,this),this.setFields(null==e?void 0:e.fields)}parse(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];var n;this.isRunning=!0,i&&this.target.emit("beforeParse",[]),e&&(this.parseOption=e);const s=this.cloneParseData(t,e);if(null==e?void 0:e.type){const t=(null!==(n=this.dataSet.getParser(e.type))&&void 0!==n?n:this.dataSet.getParser("bytejson"))(s,e.options,this);this.rawData=s,this.parserData=t,this.history&&this.historyData.push(s,t),this.latestData=t}else this.parserData=s,this.rawData=s,this.history&&this.historyData.push(s),this.latestData=s;return this.isRunning=!1,i&&this.target.emit("afterParse",[]),this}transform(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.isRunning=!0,t&&t.type){let i=!0;if("fields"===t.type){this._fields=t.options.fields;const e=this.transformsArr.findIndex((e=>e.type===t.type));e>=0&&(i=!1,this.transformsArr[e].options.fields=this._fields)}i&&this.transformsArr.push(t),e&&this.executeTransform(t)}return this.sortTransform(),this.isRunning=!1,this}sortTransform(){this.transformsArr.length>=2&&this.transformsArr.sort(((t,e)=>{var i,n;return(null!==(i=t.level)&&void 0!==i?i:0)-(null!==(n=e.level)&&void 0!==n?n:0)}))}executeTransform(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{pushHistory:i,emitMessage:n,skipEqual:s}=e,r=this.dataSet.getTransform(t.type),a=this.latestData,o=r(a,t.options);this.history&&!1!==i&&this.historyData.push(o),this.latestData=o,!1===n||s&&E(a,this.latestData)||this.target.emit("change",{latestData:this.latestData})}resetTransformData(){this.latestData=this.parserData,this.history&&(this.historyData.length=0,this.historyData.push(this.rawData,this.parserData))}cloneParseData(t,e){let i=!1;return t instanceof Ge||!0!==(null==e?void 0:e.clone)||(i=!0),i?B(t):t}parseNewData(t,e){this.parse(t,e||this.parseOption),this.reRunAllTransform()}updateRawData(t,e){const i=this.cloneParseData(t,e);this.rawData=i,this.parserData=i,this.latestData=i,this.reRunAllTransform()}getFields(){var t;return this._fields?this._fields:"dataview"===(null===(t=this.parseOption)||void 0===t?void 0:t.type)&&1===this.rawData.length&&this.rawData[0].getFields?this.rawData[0].getFields():null}setFields(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._fields=t&&e?O({},this._fields,t):t;const i=this.transformsArr.find((t=>"fields"===t.type));!l(this._fields)&&l(i)?(this.dataSet.registerTransform("fields",we),this.transform({type:"fields",options:{fields:this._fields}},!1)):i&&(i.options.fields=this._fields)}destroy(){this.dataSet.removeDataView(this.name),this.latestData=null,this.rawData=null,this.parserData=null,this.transformsArr=null,this.target=null}}
2
2
  /*! *****************************************************************************
3
- Copyright (c) Microsoft Corporation.
3
+ Copyright (c) Microsoft Corporation.
4
4
 
5
- Permission to use, copy, modify, and/or distribute this software for any
6
- purpose with or without fee is hereby granted.
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted.
7
7
 
8
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
- PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function I(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i}const E={cornerRadius:4,stroke:"black",strokeOpacity:1,lineWidth:1,closePath:!1,pickable:!1},D={symbolType:"triangle",size:8,scaleX:.7,fill:"black"},F={fill:"#606773",fontSize:12},j={fill:"#eff1f9"};class U extends e.FunnelChartSpecTransformer{transformSpec(t){const{conversionArrow:e,extensionMark:i=[],funnelBackground:n}=t;if(e&&e.arrows&&e.arrows.length){const t=function(t){const{arrows:e}=t,i=I(t,["arrows"]),n=e.filter((t=>"left"===t.position)),s=e.filter((t=>"right"===t.position)),r=N(s,i),a=N(n,i),o=[];r&&(r.name="arrowRight",o.push(r));a&&(a.name="arrowLeft",o.push(a));return o}(e);t&&t.length&&i.push(...t)}if(n&&n.visible){const t=function(t){const{style:e={}}=t,i=I(t,["style"]);return Object.assign(Object.assign({type:"rect"},i),{dataIndex:0,zIndex:0,style:Object.assign(Object.assign(Object.assign({},j),e),{x:0,y:(t,e)=>e.getPoints(t)[0].y,width:(t,e)=>{const i=e.getRegion(),{width:n}=i.getLayoutRect();return n},height:(t,e)=>{const i=e.getPoints(t),n=i[0];return i[3].y-n.y}})})}(n);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 N(t,n){if(0===(null==t?void 0:t.length))return null;const{line:s,symbol:r,text:a,margin:o}=n,l=[],h={type:"group",zIndex:e.LayoutZIndex.Mark+1,children:[]},c=function(t={},e){const{style:i={}}=t,n=I(t,["style"]),s=(t,e)=>{var i,n;const{from:s,to:r}=t,{vchart:a}=e,o=null===(n=null===(i=null==a?void 0:a.getChart())||void 0===i?void 0:i.getSeriesData())||void 0===n?void 0:n.latestData;return!(r>o.length-1||s>o.length-1)};return Object.assign(Object.assign({type:"polygon",interactive:!1},n),{dataKey:t=>`${t.id}`,style:Object.assign(Object.assign(Object.assign({},E),i),{renderable:s,points:(t,i)=>{if(!s(t,i))return[];let n=t.layout.points;return n=W(t,i,e),n}})})}(s,o);c&&l.push(c);const d=function(t={},e){const{style:i={}}=t,n=I(t,["style"]);return Object.assign(Object.assign({type:"symbol",interactive:!1,dataKey:t=>`${t.id}`},n),{style:Object.assign(Object.assign(Object.assign({},D),i),{x:(t,i)=>{var n,s;let r=t.layout.points;return r=W(t,i,e),null!==(s=null===(n=r[(null==r?void 0:r.length)-1])||void 0===n?void 0:n.x)&&void 0!==s?s:NaN},y:(t,i)=>{var n,s;let r=t.layout.points;return r=W(t,i,e),null!==(s=null===(n=r[(null==r?void 0:r.length)-1])||void 0===n?void 0:n.y)&&void 0!==s?s:NaN},angle:t=>"left"===t.position?90:-90})})}(r,o);d&&l.push(d);const u=function(t={},e){const{style:n={},formatMethod:s,textMargin:r=4}=t,a=I(t,["style","formatMethod","textMargin"]);return Object.assign(Object.assign({type:"text",dataKey:t=>`${t.id}`,interactive:!1,animation:!1},a),{style:Object.assign(Object.assign(Object.assign({},F),{text:(t,e)=>{var n,r,a,o,l,h,c;const{text:d}=t;let u=d;if(i.isFunction(s)){const{vchart:i}=e,{from:p,to:g}=t,{field:f}=t.context,m=null!==(a=null===(r=null===(n=null==i?void 0:i.getChart())||void 0===n?void 0:n.getSeriesData())||void 0===r?void 0:r.latestData)&&void 0!==a?a:[],y=null!==(c=null===(h=null===(l=null===(o=null==i?void 0:i.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:[],b=y.find((t=>t[f]===m[p][f])),v=y.find((t=>t[f]===m[g][f]));u=s(d,{arrow:t,from:b,to:v})}return u},x:(t,i)=>{var n,s;let a=t.layout.points;return a=W(t,i,e),null!==(s=(null===(n=a[1])||void 0===n?void 0:n.x)+("left"===t.position?-r:r))&&void 0!==s?s:NaN},y:(t,i)=>{var n,s,r;let a=t.layout.points;return a=W(t,i,e),null!==(r=((null===(n=a[1])||void 0===n?void 0:n.y)+(null===(s=a[2])||void 0===s?void 0:s.y))/2)&&void 0!==r?r:NaN},textAlign:t=>"left"===t.position?"right":"left",textBaseline:"middle"}),n)})}(a,o);return u&&l.push(u),h.children=l,h}function W(t,e,i){var n,s,r,a,o;const{vchart:l}=e,{from:h,to:c}=t,{field:d}=t.context,u=null===(s=null===(n=null==l?void 0:l.getChart())||void 0===n?void 0:n.getSeriesData())||void 0===s?void 0:s.latestData,p=null===(o=null===(a=null===(r=null==l?void 0:l.getChart())||void 0===r?void 0:r.getAllSeries()[0])||void 0===a?void 0:a.getViewData())||void 0===o?void 0:o.latestData;let g=[];if(u&&u.length){const n=p.find((t=>t[d]===u[h][d])),s=p.find((t=>t[d]===u[c][d])),r=p[0];if(n&&s&&r){g=function(t,e,i,n,s=12){const{layout:r,distance:a,position:o}=t,{level:l,fromIndex:h,toIndex:c,fromTotal:d,toTotal:u}=r,p="right"===o,g=p?e[1]:e[0],f=p?e[2]:e[3],m=Math.abs(g.y-f.y),y=p?i[1]:i[0],b=p?i[2]:i[3],v=Math.abs(y.y-b.y),x=p?n[1]:n[0],_=m/(d+1),A=v/(u+1),S=g.y+_*(h+1),T=y.y+A*(c+1),w=p?-1:1,M=[{x:g.x-s*w,y:S},{x:x.x-(s+(l+1)*a)*w,y:S},{x:x.x-(s+(l+1)*a)*w,y:T},{x:y.x-s*w,y:T}];return M}(t,e.getPoints(n),e.getPoints(s),e.getPoints(r),i),t.layout.points=g}}return g}function z(t,e){const{from:i,to:n}=t,{from:s,to:r}=e;return n>s&&r>i}function V(t,e){const{from:i,to:n}=t,{from:s,to:r}=e;return i===s&&n===r}const G=(t,e)=>{var n,s,r;if(!t||!(null===(n=t.arrows)||void 0===n?void 0:n.length))return[];const{arrows:a}=t,o=function(t,e){return t.filter((t=>i.isValidNumber(t.from*t.to))).map(((t,i)=>{const{from:n,to:s,position:r="right"}=t;return Object.assign(Object.assign({},t),{position:r,distance:t.distance||40,from:Math.min(n,s),to:Math.max(n,s),span:Math.abs(n-s),isLayout:!1,context:{field:e},layout:{level:0},id:`${n}-${s}-${r}-${i}`})}))}(a,e.categoryField),l=o.filter((t=>"left"===t.position)),h=o.filter((t=>"right"===t.position));return[...null!==(s=H(l))&&void 0!==s?s:[],...null!==(r=H(h))&&void 0!==r?r:[]]};function H(t){if(0===(null==t?void 0:t.length))return null;const e=new Map;return t.forEach((t=>{const n=e.get(t.from);if(i.isValid(n)){const e=n.fromArrows.find((e=>V(e,t)));e?t.layout.duplicateNode=e:n.degree+=1,n.fromArrows.push(t)}else e.set(t.from,{fromArrows:[t],toArrows:[],totalArrows:[],degree:1});const s=e.get(t.to);if(i.isValid(s)){const e=s.toArrows.find((e=>V(e,t)));e?t.layout.duplicateNode=e:s.degree+=1,s.toArrows.push(t)}else e.set(t.to,{toArrows:[t],fromArrows:[],totalArrows:[],degree:1})})),e.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((n=>{var s;const r=t.filter((t=>t.layout.isLayout)),a=i.maxInArray(r,((t,e)=>t.layout.level-e.layout.level));let o=null!==(s=null==a?void 0:a.layout.level)&&void 0!==s?s:0;for(;o>=0;){if(r.some((t=>t.layout.level===o&&z(t,n)))){o+=1;break}--o}n.layout.level=Math.max(0,o),n.layout.fromTotal=e.get(n.from).degree,n.layout.toTotal=e.get(n.to).degree;const l=n.layout.duplicateNode;l?(n.layout.fromIndex=l.layout.fromIndex,n.layout.toIndex=l.layout.toIndex):(n.layout.fromIndex=X(n,e.get(n.from).totalArrows),n.layout.toIndex=X(n,e.get(n.to).totalArrows)),n.layout.isLayout=!0})),t}function X(t,e){let i=0,n=0;for(let s=0;s<e.length;s++){const r=e[s];if(r===t){i=s-n;break}r.layout.duplicateNode&&n++}return i}class Y extends e.FunnelChart{constructor(){super(...arguments),this.type="conversionFunnel",this.transformerConstructor=U}}Y.type="conversionFunnel",Y.transformerConstructor=U;class q 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 L(this._dataSet,{name:`${e.PREFIX}_series_${this.id}_arrowData`}),this._dataSet.getTransform("conversionArrow")||this._dataSet.registerTransform("conversionArrow",G),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 $="dataKey";class K extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,n,s,r;super.transformSpec(t);const a=function(t){const e=[];return Object.keys(t.data).forEach((i=>{const n=t.data[i].nodes;e.push({data:[{id:"nodes",values:n.map(((t,e)=>Object.assign(Object.assign({},t),{[$]: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=$,t.data=a[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:a}),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!==(s=null===(n=t.player)||void 0===n?void 0:n.duration)&&void 0!==s?s: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===(r=t.infoLabel)||void 0===r?void 0:r.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 Z extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterLink",this.transformerConstructor=K}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,data:a}=this._spec;return s&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}Z.type="sequenceScatterLink",Z.view="singleDefault",Z.transformerConstructor=K;const J=.2;function Q(t){const e=Math.sqrt((2*Math.PI)**2);return Math.exp(-(t**2)/2)/e}const tt="dataKey";class et extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,n,s,r,a;super.transformSpec(t);const o=function(t){const e=[];return Object.keys(t.data).forEach((i=>{const n=t.data[i].map(((t,e)=>Object.assign(Object.assign({},t),{[tt]:e}))),s=function(t,e=100,i){const n=t.reduce(((t,e)=>{const i=e.label;return t[i]=t[i]||[],t[i].push(e),t}),{}),s=[];return Object.entries(n).forEach((([t,n])=>{const r=i||function(t){return t.length**(-1/6)}(n),a=n.map((t=>t.x)),o=n.map((t=>t.y)),l=Math.min(...a),h=Math.max(...a),c=Math.min(...o),d=Math.max(...o),u=l-(h-l)*J,p=c-(d-c)*J;for(let i=0;i<e;i++)for(let a=0;a<e;a++){const e=u+.1*i,o=p+.1*a;let l=0;for(const t of n)l+=Q(Math.sqrt((e-t.x)**2+(o-t.y)**2)/r);l/=n.length*r*r,s.push({x:e,y:o,kde:l,label:t})}})),s}(n,150);e.push({data:[{id:"nodes",values:n},{id:"iter",values:[{iter:i}]},{id:"kde",values:s}]})})),e}(t);t.type="common",t.dataKey=tt,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!==(s=null===(n=t.player)||void 0===n?void 0:n.duration)&&void 0!==s?s:2e3,easing:"linear"},t.animationUpdate={duration:null!==(a=null===(r=t.player)||void 0===r?void 0:r.duration)&&void 0!==a?a:2e3,easing:"linear"}),t.axes=[{orient:"left",type:"linear",nice:!0},{orient:"bottom",type:"linear",nice:!0,label:{visible:!0}}],super.transformSpec(t)}}class it extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterKDE",this.transformerConstructor=et}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,data:a}=this._spec;return s&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}it.type="sequenceScatterKDE",it.view="singleDefault",it.transformerConstructor=et;const nt="dataKey";function st(t){const e=[];return Object.keys(t.data).forEach((i=>{let n=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 n=document.createElement("canvas");n.width=e.width,n.height=e.height;const s=n.getContext("2d");if(!s)throw new Error("Failed to get 2D rendering context from canvas");const r=s.createImageData(e.width,e.height);for(let e=0;e<300;e++)for(let n=0;n<300;n++){const s=(null===(i=t[e])||void 0===i?void 0:i[n])||[0,0,0],a=4*(300*e+n);r.data[a]=Math.round(255*s[0]),r.data[a+1]=Math.round(255*s[1]),r.data[a+2]=Math.round(255*s[2]),r.data[a+3]=255}return s.putImageData(r,0,0),n.toDataURL("image/png")}(t.backgroundColors[i],t);n={imageData:e}}e.push({data:[{id:"nodes",values:t.data[i].map(((t,e)=>Object.assign(Object.assign({},t),{[nt]:e})))},{id:"inter",values:[{inter:i}]},{id:"background",values:n?[n]:[]}]})})),e}class rt extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,n,s,r;super.transformSpec(t);const a=st(t);t.type="common",t.dataKey=nt,t.data=a[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:a}),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!==(s=null===(n=t.player)||void 0===n?void 0:n.duration)&&void 0!==s?s: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===(r=t.infoLabel)||void 0===r?void 0:r.style)}],t.tooltip={visible:!1},super.transformSpec(t)}}class at extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterPixel",this.transformerConstructor=rt}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,data:a}=this._spec;return s&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}at.type="sequenceScatterPixel",at.view="singleDefault",at.transformerConstructor=rt;class ot 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 lt,ht,ct,dt,ut;!function(t){t.bar3d="bar3d",t.histogram3d="histogram3d",t.rangeColumn3d="rangeColumn3d",t.pie3d="pie3d",t.wordCloud3d="wordCloud3d",t.funnel3d="funnel3d"}(lt||(lt={})),function(t){t.rect3d="rect3d",t.arc3d="arc3d",t.pyramid3d="pyramid3d"}(ht||(ht={})),function(t){t.bar3d="bar3d",t.rangeColumn3d="rangeColumn3d",t.pie3d="pie3d",t.wordCloud3d="wordCloud3d",t.funnel3d="funnel3d"}(ct||(ct={})),function(t){t.bar3d="bar3d",t.funnel3d="funnel3d",t.transform3d="transform3d",t.pie3d="pie3d"}(dt||(dt={})),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"}(ut||(ut={}));class pt{static GenAutoIncrementId(){return pt.auto_increment_id++}}pt.auto_increment_id=0;class gt{constructor(t){this.id=pt.GenAutoIncrementId(),this.registry=t}}const ft="named",mt="inject",yt="inversify:tagged",bt="inversify:paramtypes";class vt{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===ft?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var xt=function(t){var e;return function(t){const e="function"==typeof Symbol&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=Object.getPrototypeOf(Function),n=("object"==typeof process&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),s=new WeakMap;function r(t,e,i){let r=s.get(t);if(h(r)){if(!i)return;r=new n,s.set(t,r)}let a=r.get(e);if(h(a)){if(!i)return;a=new n,r.set(e,a)}return a}function a(t,e,i){if(o(t,e,i))return!0;const n=f(e);return!c(n)&&a(t,n,i)}function o(t,e,i){const n=r(e,i,!1);return!h(n)&&!!n.has(t)}function l(t,e,i){if(o(t,e,i))return function(t,e,i){const n=r(e,i,!1);if(!h(n))return n.get(t)}(t,e,i);const n=f(e);return c(n)?void 0:l(t,n,i)}function h(t){return void 0===t}function c(t){return null===t}function d(t){return"object"==typeof t?null!==t:"function"==typeof t}function u(t,i){switch(function(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}const n=3===i?"string":5===i?"number":"default",s=function(t,e){const i=t[e];if(null!=i){if(!g(i))throw new TypeError;return i}}(t,e);if(void 0!==s){const e=s.call(t,n);if(d(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(g(e)){const i=e.call(t);if(!d(i))return i}const i=t.valueOf;if(g(i)){const e=i.call(t);if(!d(e))return e}}else{const e=t.valueOf;if(g(e)){const i=e.call(t);if(!d(i))return i}const i=t.toString;if(g(i)){const e=i.call(t);if(!d(e))return e}}throw new TypeError}(t,"default"===n?"number":n)}function p(t){const e=u(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function g(t){return"function"==typeof t}function f(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===i)return e;if(e!==i)return e;const n=t.prototype,s=n&&Object.getPrototypeOf(n);if(null==s||s===Object.prototype)return e;const r=s.constructor;return"function"!=typeof r||r===t?e:r}t("defineMetadata",(function(t,e,i,n){if(!d(i))throw new TypeError;return s=t,a=e,void r(i,n,!0).set(s,a);var s,a})),t("hasMetadata",(function(t,e,i){if(!d(e))throw new TypeError;return h(i)||(i=p(i)),a(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!d(e))throw new TypeError;return h(i)||(i=p(i)),o(t,e,i)})),t("getMetadata",(function(t,e,i){if(!d(e))throw new TypeError;return h(i)||(i=p(i)),l(t,e,i)}))}((e=t,function(t,i){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:i})})),t}({});function _t(t,e,i,n){!function(t,e,i,n){const s=[n];let r={};xt.hasOwnMetadata(t,e)&&(r=xt.getMetadata(t,e));let a=r[i];void 0===a&&(a=[]),a.push(...s),r[i]=a,xt.defineMetadata(t,r,e)}(yt,t,i.toString(),n)}function At(t){return(e,i,n)=>{_t(e,0,n,t)}}const St=(Tt=mt,t=>(e,i,n)=>At(new vt(Tt,t))(e,i,n));var Tt;function wt(){return function(t){return xt.defineMetadata(bt,null,t),t}}function Mt(t){return At(new vt(ft,t))}const Bt="Singleton",Ct="Transient",kt="ConstantValue",Pt="DynamicValue",Ot="Factory",Rt="Function",Lt="Instance",It="Invalid";class Et{constructor(t,e){this.id=pt.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=It,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new Et(this.serviceIdentifier,this.scope);return t.activated=t.scope===Bt&&this.activated,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.provider=this.provider,t.constraint=this.constraint,t.cache=this.cache,t}}class Dt{getConstructorMetadata(t){return{compilerGeneratedMetadata:xt.getMetadata(bt,t),userGeneratedMetadata:xt.getMetadata(yt,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const Ft=(jt=ft,t=>{const e=e=>{if(null==e)return!1;if(e.key===jt&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;const i=e.constructorArgsMetadata;for(let e=0;e<i.length;e++)if(i[e].key===jt&&i[e].value===t)return!0;return!1};return e.metaData=new vt(jt,t),e});var jt;class Ut{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=Bt,this}inTransientScope(){return this._binding.scope=Ct,this}whenTargetNamed(t){return this._binding.constraint=Ft(t),this}}class Nt{constructor(t){this._binding=t}to(t){return this._binding.type=Lt,this._binding.implementationType=t,new Ut(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=Pt,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new Ut(this._binding)}toConstantValue(t){return this._binding.type=kt,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=Bt,new Ut(this._binding)}toFactory(t){return this._binding.type=Ot,this._binding.factory=t,this._binding.scope=Bt,new Ut(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}const Wt=Symbol("ContributionProvider");class zt{constructor(t,e){this.serviceIdentifier=t,this.container=e}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}}function Vt(t,e){t(Wt).toDynamicValue((t=>{let{container:i}=t;return new zt(e,i)})).inSingletonScope().whenTargetNamed(e)}class Gt{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((t=>!(t.name===i&&(!e||t.fn===e)))))}_parseOptions(t,e,i){let n;if("string"==typeof e)n={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof n.name||""===n.name)throw new Error("Missing name for tap");return n=Object.assign({type:t,fn:i},n),n}_tap(t,e,i){this._insert(this._parseOptions(t,e,i))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let i=0;"number"==typeof t.stage&&(i=t.stage);let n=this.taps.length;for(;n>0;){n--;const t=this.taps[n];this.taps[n+1]=t;const s=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(s>i)){n++;break}}this.taps[n]=t}}class Ht extends Gt{call(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this.taps.map((t=>t.fn)).forEach((t=>t(...e)))}}const Xt=new class{};var Yt,qt,$t,Kt;!function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(Yt||(Yt={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(qt||(qt={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}($t||($t={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(Kt||(Kt={}));const Zt=i.tau-1e-8;class Jt{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,n,s,r,a){if(Math.abs(r-s)>Zt)return this.bounds.add(t-n,e-n),void this.bounds.add(t+n,e+n);let o,l,h,c,d=1/0,u=-1/0,p=1/0,g=-1/0;function f(t){h=n*Math.cos(t),c=n*Math.sin(t),h<d&&(d=h),h>u&&(u=h),c<p&&(p=c),c>g&&(g=c)}if(f(s),f(r),r!==s)if((s%=i.tau)<0&&(s+=i.tau),(r%=i.tau)<0&&(r+=i.tau),r<s&&(a=!a,o=s,s=r,r=o),a)for(r-=i.tau,o=s-s%i.halfPi,l=0;l<4&&o>r;++l,o-=i.halfPi)f(o);else for(o=s-s%i.halfPi+i.halfPi,l=0;l<4&&o<r;++l,o+=i.halfPi)f(o);this.bounds.add(t+d,e+p),this.bounds.add(t+u,e+g)}arcTo(t,e,i,n,s){this.bounds.add(t,e)}bezierCurveTo(t,e,i,n,s,r){this.bounds.add(t,e),this.bounds.add(i,n),this.bounds.add(s,r)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,n){this.bounds.add(t,e),this.bounds.add(i,n)}rect(t,e,i,n){this.bounds.add(t,e),this.bounds.add(t+i,e+n)}clear(){this.bounds.clear()}release(){}}class Qt{constructor(){this._curves=[],this.bounds=new i.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 te=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,ee={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},ie={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let ne,se,re,ae,oe,le;var he,ce,de,ue,pe,ge;function fe(t){const e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=t[6],l=t[7],h=l*r,c=-o*a,d=o*r,u=l*a,p=Math.cos(n),g=Math.sin(n),f=Math.cos(s),m=Math.sin(s),y=.5*(s-n),b=Math.sin(.5*y),v=8/3*b*b/Math.sin(y),x=e+p-v*g,_=i+g+v*p,A=e+f,S=i+m,T=A+v*m,w=S-v*f;return[h*x+c*_,d*x+u*_,h*T+c*w,d*T+u*w,h*A+c*S,d*A+u*S]}function me(t,e,n,s){const r=function(t,e,n,s,r,a,o,l,h){const c=i.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 f=p*p/((n=Math.abs(n))*n)+g*g/((s=Math.abs(s))*s);f>1&&(f=Math.sqrt(f),n*=f,s*=f);const m=u/n,y=d/n,b=-d/s,v=u/s,x=m*l+y*h,_=b*l+v*h,A=m*t+y*e,S=b*t+v*e;let T=1/((A-x)*(A-x)+(S-_)*(S-_))-.25;T<0&&(T=0);let w=Math.sqrt(T);a===r&&(w=-w);const M=.5*(x+A)-w*(S-_),B=.5*(_+S)+w*(A-x),C=Math.atan2(_-B,x-M);let k=Math.atan2(S-B,A-M)-C;k<0&&1===a?k+=i.tau:k>0&&0===a&&(k-=i.tau);const P=Math.ceil(Math.abs(k/(i.halfPi+.001))),O=[];for(let t=0;t<P;++t){const e=C+t*k/P,i=C+(t+1)*k/P;O[t]=[M,B,e,i,n,s,d,u]}return O}(s[5],s[6],s[0],s[1],s[3],s[4],s[2],e,n);for(let e=0;e<r.length;++e){const i=fe(r[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_LAYOUT=128]="UPDATE_LAYOUT",t[t.CLEAR_LAYOUT=127]="CLEAR_LAYOUT"}(he||(he={})),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"}(ce||(ce={})),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"}(de||(de={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(ue||(ue={})),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"}(pe||(pe={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(ge||(ge={}));const ye=[(t,e,i,n,s,r,a)=>e.arc(t[1]*s+i,t[2]*r+n,t[3]*(s+r)/2,t[4],t[5],t[6],a),(t,e,i,n,s,r,a)=>e.arcTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,t[5]*(s+r)/2,a),(t,e,i,n,s,r,a)=>e.bezierCurveTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,t[5]*s+i,t[6]*r+n,a),(t,e,i,n)=>e.closePath(),(t,e,i,n,s,r)=>e.ellipse(t[1]*s+i,t[2]*r+n,t[3]*s,t[4]*r,t[5],t[6],t[7],t[8]),(t,e,i,n,s,r,a)=>e.lineTo(t[1]*s+i,t[2]*r+n,a),(t,e,i,n,s,r,a)=>e.moveTo(t[1]*s+i,t[2]*r+n,a),(t,e,i,n,s,r,a)=>e.quadraticCurveTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,a),(t,e,i,n,s,r,a)=>e.rect(t[1]*s+i,t[2]*r+n,t[3]*s,t[4]*r,a)];function be(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=arguments.length>6?arguments[6]:void 0;for(let o=0;o<t.length;o++){const l=t[o];ye[l[0]](l,e,i,n,s,r,a)}}class ve{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function xe(t,e){let n=0;const s=t.length;for(let r=0;r<s;r++){const a=t[r],o=e[r],l=t[(r+1)%s],h=e[(r+1)%s];n+=i.PointService.distanceNN(a,o,l,h)}return n/2}function _e(t,e,i,n,s){const r=1-s;return r*r*r*t+3*e*s*r*r+3*i*s*s*r+n*s*s*s}function Ae(t,e,n,s,r){const a=_e(t.x,e.x,n.x,s.x,r),o=_e(t.y,e.y,n.y,s.y,r);return new i.Point(a,o)}function Se(t,e,i,n){const s=1-n;return s*s*t+2*s*n*e+n*n*i}function Te(t,e,n,s){const r=Se(t.x,e.x,n.x,s),a=Se(t.y,e.y,n.y,s);return new i.Point(r,a)}function we(t,e){const{p0:n,p1:s,p2:r,p3:a}=t,o=Ae(n,s,r,a,e),l=i.PointService.pointAtPP(n,s,e),h=i.PointService.pointAtPP(s,r,e),c=i.PointService.pointAtPP(r,a,e),d=i.PointService.pointAtPP(l,h,e),u=i.PointService.pointAtPP(h,c,e);return[new Me(n,l,d,o),new Me(o,u,c,a)]}class Me extends ve{constructor(t,e,i,n){super(),this.type=pe.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=i,this.p3=n}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}getPointAt(t){if(!1!==this.defined)return Ae(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,n=this.p3,xe([t.x,e.x,i.x,n.x],[t.y,e.y,i.y,n.y])):60;var t,e,i,n}calcProjLength(t){return t===ue.ROW?i.abs(this.p0.x-this.p3.x):t===ue.COLUMN?i.abs(this.p0.y-this.p3.y):0}getAngleAt(t){const e=i.max(t-.01,0),n=i.min(t+.01,1),s=this.getPointAt(e),r=this.getPointAt(n);return i.atan2(r.y-s.y,r.x-s.x)}draw(t,e,i,n,s,r){if(t.moveTo(this.p0.x*n+e,this.p0.y*s+i),r>=1)t.bezierCurveTo(this.p1.x*n+e,this.p1.y*s+i,this.p2.x*n+e,this.p2.y*s+i,this.p3.x*n+e,this.p3.y*s+i);else if(r>0){const[a]=we(this,r);t.bezierCurveTo(a.p1.x*n+e,a.p1.y*s+i,a.p2.x*n+e,a.p2.y*s+i,a.p3.x*n+e,a.p3.y*s+i)}}includeX(t){const e=i.min(this.p0.x,this.p1.x,this.p2.x,this.p3.x),n=i.max(this.p0.x,this.p1.x,this.p2.x,this.p3.x);return t>=e&&t<=n}getYAt(t){const e=i.min(this.p0.x,this.p1.x,this.p2.x,this.p3.x),n=(t-e)/(i.max(this.p0.x,this.p1.x,this.p2.x,this.p3.x)-e);return this.getPointAt(n).y}}class Be extends ve{constructor(t,e){super(),this.type=pe.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return i.PointService.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=i.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()?i.PointService.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===ue.ROW?i.abs(this.p0.x-this.p1.x):t===ue.COLUMN?i.abs(this.p0.y-this.p1.y):0}draw(t,e,i,n,s,r){if(t.moveTo(this.p0.x*n+e,this.p0.y*s+i),r>=1)t.lineTo(this.p1.x*n+e,this.p1.y*s+i);else if(r>0){const a=this.getPointAt(r);t.lineTo(a.x*n+e,a.y*s+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 n=(t-e.x)/(i.x-e.x);return e.y+n*(i.y-e.y)}return 1/0}}class Ce{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,n,s,r,a,o,l){const h=new Me(new i.Point(this._lastX,this._lastY),new i.Point(t,e),new i.Point(n,s),new i.Point(r,a));h.originP1=this._lastOriginP,h.originP2=l,h.defined=o,this.curves.push(h),this._lastX=r,this._lastY=a,this._lastOriginP=l}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,i,n){const s=this.addLinearCurve(t,e,i,this._lastOriginP,n);this.curves.push(s),this._lastX=t,this._lastY=e,this._lastOriginP=n}moveTo(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}quadraticCurveTo(t,e,i,n){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,n,s,r){const a=new Be(new i.Point(this._lastX,this._lastY),new i.Point(t,e));return a.originP1=s,a.originP2=r,a.defined=n,a}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,n;if(t===ue.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],n=this.curves[this.curves.length-1],s=null!==(e=n.p3)&&void 0!==e?e:n.p1;return i.abs(t.p0.y-s.y)}if(t===ue.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],s=null!==(n=e.p3)&&void 0!==n?n:e.p1;return i.abs(t.p0.x-s.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class ke extends Ce{bezierCurveTo(t,e,i,n,s,r,a,o){return super.bezierCurveTo(e,t,n,i,r,s,a,o)}lineTo(t,e,i,n){return super.lineTo(e,t,i,n)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function Pe(t,e){let i=!1;for(let n=0,s=e.length;n<=s;n++)n>=s===i&&((i=!i)?t.lineStart():t.lineEnd()),i&&t.point(e[n])}function Oe(t,e,n){const s=null!=e?e:i.abs(n[n.length-1].x-n[0].x)>i.abs(n[n.length-1].y-n[0].y)?ue.ROW:ue.COLUMN;return"monotoneY"===t?new ke(t,s):new Ce(t,s)}class Re{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 Le(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const s=Oe("linear",i,t);return function(t,e){Pe(t,e)}(new Re(s,n),t),s}function Ie(t,e,i,n,s){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,n,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&&Ie(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:Ie(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 De(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return Le(t,e);const s=Oe("basis",i,t);return function(t,e){Pe(t,e)}(new Ee(s,n),t),s}function Fe(t){return t<0?-1:1}function je(t,e,i){const n=t._x1-t._x0,s=e-t._x1,r=(t._y1-t._y0)/(n||Number(s<0&&-0)),a=(i-t._y1)/(s||Number(n<0&&-0)),o=(r*s+a*n)/(n+s);return(Fe(r)+Fe(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(o))||0}function Ue(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function Ne(t,e,i,n,s){const r=t._x0,a=t._y0,o=t._x1,l=t._y1,h=(o-r)/3;t.context.bezierCurveTo(r+h,a+h*e,o-h,l-h*i,o,l,n,t.lastPoint1)}class We{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,Ue(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,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,n,t);break;case 1:this._point=2;break;case 2:this._point=3,Ne(this,Ue(this,e=je(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:Ne(this,this._t0,e=je(this,i,n),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=n,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 ze extends We{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function Ve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return Le(t,e);const s=Oe("monotoneX",i,t);return function(t,e){Pe(t,e)}(new We(s,n),t),s}function Ge(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return Le(t,e);const s=Oe("monotoneY",i,t);return function(t,e){Pe(t,e)}(new ze(s,n),t),s}let He=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;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 n=this._x*(1-this._t)+e*this._t;.5===this._t?this.context.lineTo(n,this._y,!1!==this._lastDefined,this.lastPoint):this.context.lineTo(n,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(n,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 Xe extends He{lineEnd(){this.context.closePath()}}function Ye(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:s,startPoint:r}=n;if(t.length<2-Number(!!r))return null;const a=new Ce("step",null!=s?s:i.abs(t[t.length-1].x-t[0].x)>i.abs(t[t.length-1].y-t[0].y)?ue.ROW:ue.COLUMN);return qe(new He(a,e,r),t),a}function qe(t,e){return Pe(t,e)}class $e extends Re{lineEnd(){this.context.closePath()}}function Ke(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const s=Oe("linear",i,t);return function(t,e){Pe(t,e)}(new $e(s,n),t),s}function Ze(t,e,n,s,r){let a=t._x1,o=t._y1,l=t._x2,h=t._y2;if(t._l01_a>i.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);a=(a*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>i.epsilon){const i=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);l=(l*i+t._x1*t._l23_2a-e*t._l12_2a)/s,h=(h*i+t._y1*t._l23_2a-n*t._l12_2a)/s}t.context.bezierCurveTo(a,o,l,h,t._x2,t._y2,s,t.lastPoint1)}function Je(t,e){return function(i,n){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:r,startPoint:a}=s;if(i.length<2-Number(!!a))return null;if(i.length<3-Number(!!a))return Le(i,s);const o=Oe(t,r,i);return Pe(new e(o,n,a),i),o}}const Qe=Je("catmullRom",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;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,n=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+n*n,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:Ze(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 ti=Je("catmullRomClosed",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;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,n=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+n*n,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:Ze(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 ei extends ve{constructor(t,e,i){super(),this.type=pe.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 Te(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,xe([t.x,e.x,i.x],[t.y,e.y,i.y])):60;var t,e,i}calcProjLength(t){return t===ue.ROW?i.abs(this.p0.x-this.p2.x):t===ue.COLUMN?i.abs(this.p0.y-this.p2.y):0}getAngleAt(t){const e=i.max(t-.01,0),n=i.min(t+.01,1),s=this.getPointAt(e),r=this.getPointAt(n);return i.atan2(r.y-s.y,r.x-s.x)}draw(t,e,n,s,r,a){if(t.moveTo(this.p0.x*s+e,this.p0.y*r+n),a>=1)t.quadraticCurveTo(this.p1.x*s+e,this.p1.y*r+n,this.p2.x*s+e,this.p2.y*r+n);else if(a>0){const[o]=function(t,e){const{p0:n,p1:s,p2:r}=t,a=Te(n,s,r,e),o=i.PointService.pointAtPP(n,s,e),l=i.PointService.pointAtPP(s,r,e);return[new ei(n,o,a),new ei(a,l,r)]}(this,a);t.quadraticCurveTo(o.p1.x*s+e,o.p1.y*r+n,o.p2.x*s+e,o.p2.y*r+n)}}getYAt(t){throw new Error("QuadraticBezierCurve暂不支持getYAt")}includeX(t){throw new Error("QuadraticBezierCurve暂不支持includeX")}}class ii{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 Be(new i.Point(this._lastX,this._lastY),new i.Point(t,e))}quadraticCurveTo(t,e,n,s){const r=new ei(new i.Point(this._lastX,this._lastY),new i.Point(t,e),new i.Point(n,s));this.path.addCurve(r),this._lastX=n,this._lastY=s}bezierCurveTo(t,e,n,s,r,a){const o=new Me(new i.Point(this._lastX,this._lastY),new i.Point(t,e),new i.Point(n,s),new i.Point(r,a));this.path.addCurve(o),this._lastX=r,this._lastY=a}arcTo(t,e,i,n,s){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,i,n,s,r,a,o){throw new Error("CurveContext不支持调用ellipse")}rect(t,e,i,n){throw new Error("CurveContext不支持调用rect")}arc(t,e,i,n,s,r){throw new Error("CurveContext不支持调用arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}}function ni(t,e,n){var s,r;switch(e){case"linear":default:return Le(t,n);case"basis":return De(t,n);case"monotoneX":return Ve(t,n);case"monotoneY":return Ge(t,n);case"step":return Ye(t,.5,n);case"stepClosed":return function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:s,startPoint:r}=n;if(t.length<2-Number(!!r))return null;const a=new Ce("step",null!=s?s:i.abs(t[t.length-1].x-t[0].x)>i.abs(t[t.length-1].y-t[0].y)?ue.ROW:ue.COLUMN);return qe(new Xe(a,e,r),t),a}(t,.5,n);case"stepBefore":return Ye(t,0,n);case"stepAfter":return Ye(t,1,n);case"catmullRom":return Qe(t,null!==(s=null==n?void 0:n.curveTension)&&void 0!==s?s:.5,n);case"catmullRomClosed":return ti(t,null!==(r=null==n?void 0:n.curveTension)&&void 0!==r?r:.5,n);case"linearClosed":return Ke(t,n)}}class si extends Qt{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new Jt(this.bounds)}get curves(){return this.tryBuildCurves()}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([ie.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([ie.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.commandList.push([ie.Q,t,e,i,n]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this}bezierCurveTo(t,e,i,n,s,r){return this.commandList.push([ie.C,t,e,i,n,s,r]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,s,r),this}arcTo(t,e,i,n,s){return this.commandList.push([ie.AT,t,e,i,n,s]),this._ctx&&this._ctx.arcTo(t,e,i,n,s),this}ellipse(t,e,i,n,s,r,a,o){return this.commandList.push([ie.E,t,e,i,n,s,r,a,o]),this._ctx&&this._ctx.ellipse(t,e,i,n,s,r,a,o),this}rect(t,e,i,n){return this.commandList.push([ie.R,t,e,i,n]),this._ctx&&this._ctx.rect(t,e,i,n),this}arc(t,e,i,n,s,r){return this.commandList.push([ie.A,t,e,i,n,s,r]),this._ctx&&this._ctx.arc(t,e,i,n,s,r),this}closePath(){return this.commandList.push([ie.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 ii(this);be(this.commandList,t,0,0,1,1)}return this._curves}toString(){if(!this.toStringCbList){const t=[];t[ie.M]=t=>`M${t[1]} ${t[2]}`,t[ie.L]=t=>`L${t[1]} ${t[2]}`,t[ie.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[ie.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[ie.A]=t=>{const e=[],i=t[1],n=t[2],s=t[3];!function(t,e,i,n,s,r,a){let o=arguments.length>7&&void 0!==arguments[7]&&arguments[7];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),f=Math.sin(l),m=d*r+n,y=u*a+s,b=g*r+n,v=f*a+s,x=o?-1:1,_=r*c*x,A=a*c*x;t.push(m-_*u,y+A*d,b+_*f,v-A*g,b,v)}}(e,t[4],t[5],i,n,s,s,t[6]);let r="";for(let t=0;t<e.length;t+=6)r+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return r},t[ie.R]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[ie.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,n,s){this.clear();const r=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,n;const s=[];for(let t=0,r=e.length;t<r;t++)if(ne=e[t],se=ne.slice(1),re=ne[0],i=[re],n=se.match(te),null!==n){for(let t=0,e=n.length;t<e;t++)ae=n[t],oe=parseFloat(ae),Number.isNaN(oe)||i.push(oe);if(le=ee[re],i.length-1>le){let t,e=re;for(let n=1,r=i.length;n<r;n+=le){t=[e];for(let e=n,s=n+le;e<s;e++)t.push(i[e]);s.push(t),"m"===e?e="l":"M"===e&&(e="L")}}else s.push(i)}else s.push(i);return s}(t);return this._runCommandStrList(r,e,i,n,s),this._updateBounds(),this}fromLine(t){const{points:e,curveType:i,clipRangeByDimension:n}=t.attribute;if(!e)return;const s=ni(e,i);"x"===n?this.direction=ue.ROW:"y"===n?this.direction=ue.COLUMN:"auto"===n&&(this.direction=s.direction),this._curves=s.curves}fromCustomPath2D(t,e,i,n,s){return this.clear(),this._runCommandList(t.commandList,e,i,n,s),this._updateBounds(),this}transform(t,e,i,n){const s=this.commandList;if(!this.transformCbList){const t=[];t[ie.M]=this.moveToTransform,t[ie.L]=this.lineToTransform,t[ie.Q]=this.quadraticCurveToTransform,t[ie.C]=this.bezierCurveToTransform,t[ie.AT]=this.arcToTransform,t[ie.E]=this.ellipseTransform,t[ie.R]=this.rectTransform,t[ie.A]=this.arcTransform,t[ie.Z]=this.closePathTransform,this.transformCbList=t}s.forEach((s=>{this.transformCbList[s[0]](s,t,e,i,n)})),this._updateBounds()}moveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i}lineToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i}quadraticCurveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i}bezierCurveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i,t[5]=t[5]*n+e,t[6]=t[6]*s+i}arcToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i,t[5]=t[5]*(n+s)/2}ellipseTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n,t[4]=t[4]*s}rectTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n,t[4]=t[4]*s}arcTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*(n+s)/2}closePathTransform(){}_runCommandStrList(t){let e,i,n,s,r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,c=null,d=0,u=0,p=0,g=0;for(let f=0,m=t.length;f<m;++f){switch(e=t[f],1===l&&1===h||(e=ai(e,l,h)),e[0]){case"l":d+=e[1],u+=e[2],this.lineTo(d+a,u+o);break;case"L":d=e[1],u=e[2],this.lineTo(d+a,u+o);break;case"h":d+=e[1],this.lineTo(d+a,u+o);break;case"H":d=e[1],this.lineTo(d+a,u+o);break;case"v":u+=e[1],this.lineTo(d+a,u+o);break;case"V":u=e[1],this.lineTo(d+a,u+o);break;case"m":d+=e[1],u+=e[2],this.moveTo(d+a,u+o);break;case"M":d=e[1],u=e[2],this.moveTo(d+a,u+o);break;case"c":i=d+e[5],n=u+e[6],p=d+e[3],g=u+e[4],this.bezierCurveTo(d+e[1]+a,u+e[2]+o,p+a,g+o,i+a,n+o),d=i,u=n;break;case"C":d=e[5],u=e[6],p=e[3],g=e[4],this.bezierCurveTo(e[1]+a,e[2]+o,p+a,g+o,d+a,u+o);break;case"s":i=d+e[3],n=u+e[4],null===c[0].match(/[CcSs]/)?(p=d,g=u):(p=2*d-p,g=2*u-g),s=d+e[1],r=u+e[2],this.bezierCurveTo(p+a,g+o,s+a,r+o,i+a,n+o),p=s,g=r,d=i,u=n;break;case"S":i=e[3],n=e[4],null===c[0].match(/[CcSs]/)?(p=d,g=u):(p=2*d-p,g=2*u-g),s=e[1],r=e[2],this.bezierCurveTo(p+a,g+o,s+a,r+o,i+a,n+o),p=s,g=r,d=i,u=n;break;case"q":i=d+e[3],n=u+e[4],p=d+e[1],g=u+e[2],this.quadraticCurveTo(p+a,g+o,i+a,n+o),d=i,u=n;break;case"Q":i=e[3],n=e[4],this.quadraticCurveTo(e[1]+a,e[2]+o,i+a,n+o),d=i,u=n,p=e[1],g=e[2];break;case"t":i=d+e[1],n=u+e[2],null===c[0].match(/[QqTt]/)?(p=d,g=u):"t"===c[0]?(p=2*d-s,g=2*u-r):"q"===c[0]&&(p=2*d-p,g=2*u-g),s=p,r=g,this.quadraticCurveTo(p+a,g+o,i+a,n+o),d=i,u=n,p=d+e[1],g=u+e[2];break;case"T":i=e[1],n=e[2],p=2*d-p,g=2*u-g,this.quadraticCurveTo(p+a,g+o,i+a,n+o),d=i,u=n;break;case"a":me(this,d+a,u+o,[e[1],e[2],e[3],e[4],e[5],e[6]+d+a,e[7]+u+o]),d+=e[6],u+=e[7];break;case"A":me(this,d+a,u+o,[e[1],e[2],e[3],e[4],e[5],e[6]+a,e[7]+o]),d=e[6],u=e[7];break;case"z":case"Z":this.closePath()}c=e}}_runCommandList(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==i||1!==n||1!==s)for(let r=0,a=t.length;r<a;++r){const a=t[r].slice();switch(a[0]){case ie.L:this.lineToTransform(a,e,i,n,s);break;case ie.M:this.moveToTransform(a,e,i,n,s);break;case ie.C:this.bezierCurveToTransform(a,e,i,n,s);break;case ie.Q:this.quadraticCurveToTransform(a,e,i,n,s);break;case ie.A:this.arcToTransform(a,e,i,n,s);break;case ie.E:this.ellipseTransform(a,e,i,n,s);break;case ie.R:this.rectTransform(a,e,i,n,s);break;case ie.AT:this.arcToTransform(a,e,i,n,s);break;case ie.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),be(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===ue.COLUMN){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return i.abs(t.p0.y-e.p1.y)}if(this.direction===ue.ROW){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return i.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 n=0;n<this._curves.length;n++){e=this._curves[n];const s=e.getLength(this.direction);if(i+s>=t)break;i+=s}const n=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(n),angle:e.getAngleAt(n)}}drawWithClipRange(t,e,i,n,s){this.tryBuildCurves();const r=this.getLength()*s;let a=0;for(let s=0;s<this._curves.length;s++){const o=this._curves[s],l=o.getLength(this.direction);if(!(a+l<=r)){const s=1-(a+l-r)/l;o.draw(t,i,n,e,e,s);break}o.draw(t,i,n,e,e,1),a+=l}}}const ri=["l",0,0,0,0,0,0,0];function ai(t,e,i){const n=ri[0]=t[0];if("a"===n||"A"===n)ri[1]=e*t[1],ri[2]=i*t[2],ri[3]=t[3],ri[4]=t[4],ri[5]=t[5],ri[6]=e*t[6],ri[7]=i*t[7];else if("h"===n||"H"===n)ri[1]=e*t[1];else if("v"===n||"V"===n)ri[1]=i*t[1];else for(let n=1,s=t.length;n<s;++n)ri[n]=(n%2==1?e:i)*t[n];return ri}const oi={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 i.Matrix},li={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},hi=Object.assign({outerBorder:Object.assign(Object.assign({},li),{distance:0}),innerBorder:Object.assign(Object.assign({},li),{distance:0})},li),ci={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:Yt.fontBounding,keepCenterInLine:!1},di=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,blur:0,filter:"",cursor:null,html:null,react:null,vue:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),hi),{alignSelf:"auto"}),{pickStrokeBuffer:0}),ui={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},pi=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}),di),oi),gi=Object.assign(Object.assign({},pi),{startAngle:0,endAngle:i.pi2,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),fi=Object.assign(Object.assign(Object.assign({},pi),ui),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),mi=Object.assign(Object.assign({},pi),{radius:1,startAngle:0,endAngle:i.pi2}),yi=Object.assign(Object.assign({},pi),{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"}),bi=Object.assign(Object.assign({},pi),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),vi=Object.assign(Object.assign(Object.assign({},pi),ui),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),xi=Object.assign(Object.assign({},pi),{path:new si,fillStrokeOrder:1,clipRange:1,customPath:()=>{i.Logger.getInstance().warn("空函数")}}),_i=Object.assign(Object.assign({},pi),{points:[],cornerRadius:0,closePath:!0}),Ai=Object.assign(Object.assign({},pi),{width:100,height:100,spikes:5,thickness:.5}),Si=Object.assign(Object.assign({},pi),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0,cornerType:"round"});Object.assign(Object.assign({},pi),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0,cornerType:"round"});const Ti=Object.assign(Object.assign({},pi),{symbolType:"circle",size:10,keepDirIn3d:!0,clipRange:1}),wi=Object.assign(Object.assign(Object.assign({},pi),ci),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Mi=Object.assign(Object.assign(Object.assign({},pi),ci),{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}),Bi=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0,maxWidth:500,maxHeight:500},pi),{fill:!0,cornerRadius:0,cornerType:"round"}),Ci=Object.assign(Object.assign({},Bi),{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}),ki=function(){const t={linearGradient:/^(linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,fromAngleValue:/^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/(^\#[0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,rgbaColor:/^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/};let e="";function i(t){const i=new Error(e+": "+t);throw i.source=e,i}function n(){return s("linear",t.linearGradient,r)||s("radial",t.radialGradient,o)||s("conic",t.conicGradient,a)}function s(e,n,s){return function(n,r){const a=y(n);if(a){y(t.startCall)||i("Missing (");const n=function(n){const r=s();return r&&(y(t.comma)||i("Missing comma before color stops")),{type:e,orientation:r,colorStops:u(p)}}();return y(t.endCall)||i("Missing )"),n}}(n)}function r(){return m("directional",t.sideOrCorner,1)||m("angular",t.angleValue,1)}function a(){return m("angular",t.fromAngleValue,1)}function o(){let i,n,s=l();return s&&(i=[],i.push(s),n=e,y(t.comma)&&(s=l(),s?i.push(s):e=n)),i}function l(){let t=function(){const t=m("shape",/^(circle)/i,0);return t&&(t.style=f()||h()),t}()||function(){const t=m("shape",/^(ellipse)/i,0);return t&&(t.style=g()||h()),t}();if(t)t.at=c();else{const e=h();if(e){t=e;const i=c();i&&(t.at=i)}else{const e=d();e&&(t={type:"default-radial",at:e})}}return t}function h(){return m("extent-keyword",t.extentKeywords,1)}function c(){if(m("position",/^at/,0)){const t=d();return t||i("Missing positioning value"),t}}function d(){const t={x:g(),y:g()};if(t.x||t.y)return{type:"position",value:t}}function u(e){let n=e();const s=[];if(n)for(s.push(n);y(t.comma);)n=e(),n?s.push(n):i("One extra comma");return s}function p(){const e=m("hex",t.hexColor,1)||m("rgba",t.rgbaColor,1)||m("rgb",t.rgbColor,1)||m("literal",t.literalColor,0);return e||i("Expected color definition"),e.length=g(),e}function g(){return m("%",t.percentageValue,1)||m("position-keyword",t.positionKeywords,1)||f()}function f(){return m("px",t.pixelValue,1)||m("em",t.emValue,1)}function m(t,e,i){const n=y(e);if(n)return{type:t,value:n[i]}}function y(t){const i=/^[\n\r\t\s]+/.exec(e);i&&b(i[0].length);const n=t.exec(e);return n&&b(n[0].length),n}function b(t){e=e.substr(t)}return function(t){return e=t.toString(),function(){const t=u(n);return e.length>0&&i("Invalid input not EOF"),t}()}}();class Pi{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(Pi.IsGradientStr(t))try{const e=ki(t)[0];if(e){if("linear"===e.type)return Pi.ParseLinear(e);if("radial"===e.type)return Pi.ParseRadial(e);if("conic"===e.type)return Pi.ParseConic(e)}}catch(e){return t}return t}static ParseConic(t){const{orientation:e,colorStops:n=[]}=t,s=i.pi/2,r=parseFloat(e.value)/180*i.pi-s;return{gradient:"conical",x:.5,y:.5,startAngle:r,endAngle:r+i.pi2,stops:n.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseRadial(t){const{colorStops:e=[]}=t;return{gradient:"radial",x0:.5,y0:.5,x1:.5,y1:.5,r0:0,r1:1,stops:e.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseLinear(t){const{orientation:e,colorStops:n=[]}=t,s=i.pi/2;let r="angular"===e.type?parseFloat(e.value)/180*i.pi:0;for(;r<0;)r+=i.pi2;for(;r>=i.pi2;)r-=i.pi2;let a=0,o=0,l=0,h=0;return r<s?(a=0,o=1,l=Math.sin(r),h=o-Math.cos(r)):r<i.pi?(a=0,o=0,l=Math.cos(r-s),h=Math.sin(r-s)):r<i.pi+s?(a=1,o=0,l=a-Math.sin(r-i.pi),h=Math.cos(r-i.pi)):(a=1,l=a-Math.cos(r-s-i.pi),h-=Math.sin(r-s-i.pi)),{gradient:"linear",x0:a,y0:o,x1:l,y1:h,stops:n.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}}function Oi(t,e,i){let n=e;const{a:s,b:r,c:a,d:o}=t.currentMatrix,l=Math.sign(s)*Math.sqrt(s*s+r*r),h=Math.sign(o)*Math.sqrt(a*a+o*o);return l+h===0?0:(n=n/Math.abs(l+h)*2*i,n)}function Ri(t,e,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;var a,o,l,h;if(!e||!0===e)return"black";let c,d;if(i.isArray(e))for(let t=0;t<e.length&&(d=e[t],!d);t++);else d=e;if(d=Pi.Parse(d),"string"==typeof d)return d;if(n.AABBBounds&&(!n.attribute||0!==n.attribute.scaleX||0!==n.attribute.scaleY)){const e=n.AABBBounds;let i=e.x2-e.x1,u=e.y2-e.y1,p=e.x1-s,g=e.y1-r;if(n.attribute){const{scaleX:t=1,scaleY:e=1,angle:s=0}=n.attribute;i/=t,u/=e,p/=t,g/=e,(s||1!==t||1!==e)&&(p=null!==(a=n.x1WithoutTransform)&&void 0!==a?a:0,g=null!==(o=n.y1WithoutTransform)&&void 0!==o?o:0,i=null!==(l=n.widthWithoutTransform)&&void 0!==l?l:i,u=null!==(h=n.heightWithoutTransform)&&void 0!==h?h:u)}"linear"===d.gradient?c=function(t,e,i,n,s,r){var a,o,l,h;const c=t.createLinearGradient(i+(null!==(a=e.x0)&&void 0!==a?a:0)*s,n+(null!==(o=e.y0)&&void 0!==o?o:0)*r,i+(null!==(l=e.x1)&&void 0!==l?l:1)*s,n+(null!==(h=e.y1)&&void 0!==h?h:0)*r);return e.stops.forEach((t=>{c.addColorStop(t.offset,t.color)})),c}(t,d,p,g,i,u):"conical"===d.gradient?c=function(t,e,i,n,s,r){var a,o;const l=t.createConicGradient(i+(null!==(a=e.x)&&void 0!==a?a:0)*s,n+(null!==(o=e.y)&&void 0!==o?o:0)*r,e.startAngle,e.endAngle);return e.stops.forEach((t=>{l.addColorStop(t.offset,t.color)})),l.GetPattern?l.GetPattern(s+i,r+n,void 0):l}(t,d,p,g,i,u):"radial"===d.gradient&&(c=function(t,e,i,n,s,r){var a,o,l,h,c,d;const u=t.createRadialGradient(i+(null!==(a=e.x0)&&void 0!==a?a:.5)*s,n+(null!==(o=e.y0)&&void 0!==o?o:.5)*r,Math.max(s,r)*(null!==(l=e.r0)&&void 0!==l?l:0),i+(null!==(h=e.x1)&&void 0!==h?h:.5)*s,n+(null!==(c=e.y1)&&void 0!==c?c:.5)*r,Math.max(s,r)*(null!==(d=e.r1)&&void 0!==d?d:.5));return e.stops.forEach((t=>{u.addColorStop(t.offset,t.color)})),u}(t,d,p,g,i,u))}return c||"orange"}const Li={horizontal:{width:"width",height:"height",left:"left",top:"top",x:"x",y:"y",bottom:"bottom"},vertical:{width:"height",height:"width",left:"top",top:"left",x:"y",y:"x",bottom:"right"}},Ii=!0,Ei=!1,Di=/\w|\(|\)|-/,Fi=/[.?!,;:/,。?!、;:]/,ji=/\S/,Ui=(t,e)=>{let i=e.fontSize||16;switch(e.script){case"super":case"sub":i*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:i,fontFamily:e.fontFamily})};function Ni(t,e,i,n,s){if(t.length<=1)return 0;if(!e||e<=0)return 0;const r=Xt.graphicUtil.textMeasure;let a=n,o=t.slice(0,a),l=Math.floor(r.measureText(o,i).width),h=t.slice(0,a+1),c=Math.floor(r.measureText(h,i).width);for(;l>e||c<=e;){if(l>e?a--:a++,a>t.length){a=t.length;break}if(a<0){a=0;break}o=t.slice(0,a),l=Math.floor(r.measureText(o,i).width),h=t.slice(0,a+1),c=Math.floor(r.measureText(h,i).width)}return s&&(a=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e;for(;Di.test(t[n-1])&&Di.test(t[n])||Fi.test(t[n]);)if(n--,n<=0)return i?Wi(t,e):e;return n}(t,a)),a}function Wi(t,e){let i=e;for(;Di.test(t[i+1])&&Di.test(t[i])||Fi.test(t[i]);)if(i++,i>=t.length)return i;return i+1}function zi(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"actual";var n;if(""===t)return{ascent:0,height:0,descent:0,width:0};const s=Xt.graphicUtil.textMeasure.measureText(t,e),r={ascent:0,height:0,descent:0,width:0},a="actual"===i?s.actualBoundingBoxAscent:s.fontBoundingBoxAscent,o="actual"===i?s.actualBoundingBoxDescent:s.fontBoundingBoxDescent;"number"!=typeof a||"number"!=typeof o?(r.width=Math.floor(s.width),r.height=e.fontSize||0,r.ascent=r.height,r.descent=0):(r.width=Math.floor(s.width),r.height=Math.floor(a+o),r.ascent=Math.floor(a),r.descent=r.height-r.ascent);const l=null!==(n=e.space)&&void 0!==n?n:0;return r.width+=l,r}const Vi=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||Ct,this.options=e,this.id=pt.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new Dt}load(t){const e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}get(t){const e=this._getNotAllArgs(t,!1);return this._get(e)}getAll(t){const e=this._getAllArgs(t);return this._get(e)}getTagged(t,e,i){const n=this._getNotAllArgs(t,!1,e,i);return this._get(n)}getNamed(t,e){return this.getTagged(t,ft,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new Et(t,e),n=this._bindingDictionary.get(t)||[];return n.push(i),this._bindingDictionary.set(t,n),new Nt(i)}unbind(t){this._bindingDictionary.delete(t)}rebind(t){return this.unbind(t),this.bind(t)}_getContainerModuleHelpersFactory(){const t=(t,e)=>{t._binding.moduleId=e},e=e=>i=>{const n=this.bind(i);return t(n,e),n},i=()=>t=>this.unbind(t),n=()=>t=>this.isBound(t),s=e=>i=>{const n=this.rebind(i);return t(n,e),n};return t=>({bindFunction:e(t),isboundFunction:n(),rebindFunction:s(t),unbindFunction:i(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,i,n){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:n}}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_get(t){const e=[];return this._bindingDictionary.get(t.serviceIdentifier).filter((e=>e.constraint(t))).forEach((t=>{e.push(this._resolveFromBinding(t))})),t.isMultiInject||1!==e.length?e:e[0]}_getChildRequest(t){const e=t.implementationType,{userGeneratedMetadata:i}=this._metadataReader.getConstructorMetadata(e),n=Object.keys(i),s=[];for(let t=0;t<n.length;t++){const e=i[t],n={};e.forEach((t=>{n[t.key]=t.value}));const r={inject:n[mt],multiInject:n.multi_inject},a=r.inject||r.multiInject,o={serviceIdentifier:a,constructorArgsMetadata:e},l=(this._bindingDictionary.get(a)||[]).filter((t=>t.constraint(o)));if(l.length){const t={injectIdentifier:a,metadata:e,bindings:l};s.push(t)}}return s}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case kt:case Rt:e=t.cache;break;case Lt:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}_resolveInstance(t,e){if(t.activated)return t.cache;const i=this._getChildRequest(t);return this._createInstance(e,i)}_createInstance(t,e){return e.length?new t(...this._resolveRequests(e)):new t}_resolveRequests(t){return t.map((t=>t.bindings.length>1?t.bindings.map((t=>this._resolveFromBinding(t))):this._resolveFromBinding(t.bindings[0])))}_saveToScope(t,e){t.scope===Bt&&(t.cache=e,t.activated=!0)}},Gi=Symbol.for("CanvasFactory");function Hi(t){return Vi.getNamed(Gi,Xt.global.env)(t)}const Xi=1e-4,Yi=Math.sqrt(3),qi=1/3;function $i(t){return t>-hn&&t<hn}function Ki(t){return t>hn||t<-hn}const Zi=[0,0],Ji=[0,0],Qi=[0,0];function tn(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function en(t,e,i,n){const s=1-n;return s*(s*t+2*n*e)+n*n*i}function nn(t,e,i,n,s){const r=1-s;return r*r*(r*t+3*s*e)+s*s*(s*n+3*r*i)}function sn(t){return(t%=i.pi2)<0&&(t+=i.pi2),t}function rn(t,e,i,n,s,r,a,o,l){if(0===a)return!1;const h=a;return!(l>e+h&&l>n+h&&l>r+h||l<e-h&&l<n-h&&l<r-h||o>t+h&&o>i+h&&o>s+h||o<t-h&&o<i-h&&o<s-h)&&function(t,e,i,n,s,r,a,o,l){let h=0,c=.005,d=1/0;Zi[0]=a,Zi[1]=o;for(let a=0;a<1;a+=.05){Ji[0]=en(t,i,s,a),Ji[1]=en(e,n,r,a);const o=tn(Zi,Ji);o<d&&(h=a,d=o)}d=1/0;for(let a=0;a<32&&!(c<Xi);a++){const a=h-c,o=h+c;Ji[0]=en(t,i,s,a),Ji[1]=en(e,n,r,a);const l=tn(Ji,Zi);if(a>=0&&l<d)h=a,d=l;else{Qi[0]=en(t,i,s,o),Qi[1]=en(e,n,r,o);const a=tn(Qi,Zi);o<=1&&a<d?(h=o,d=a):c*=.5}}return l&&(l[0]=en(t,i,s,h),l[1]=en(e,n,r,h)),Math.sqrt(d)}(t,e,i,n,s,r,o,l,null)<=h/2}function an(t,e,i,n,s,r,a,o,l,h,c){if(0===l)return!1;const d=l;return!(c>e+d&&c>n+d&&c>r+d&&c>o+d||c<e-d&&c<n-d&&c<r-d&&c<o-d||h>t+d&&h>i+d&&h>s+d&&h>a+d||h<t-d&&h<i-d&&h<s-d&&h<a-d)&&function(t,e,i,n,s,r,a,o,l,h,c){let d,u,p,g,f=0,m=.005,y=1/0;Zi[0]=l,Zi[1]=h;for(let l=0;l<1;l+=.05)Ji[0]=nn(t,i,s,a,l),Ji[1]=nn(e,n,r,o,l),p=tn(Zi,Ji),p<y&&(f=l,y=p);y=1/0;for(let l=0;l<32&&!(m<Xi);l++)d=f-m,u=f+m,Ji[0]=nn(t,i,s,a,d),Ji[1]=nn(e,n,r,o,d),p=tn(Ji,Zi),d>=0&&p<y?(f=d,y=p):(Qi[0]=nn(t,i,s,a,u),Qi[1]=nn(e,n,r,o,u),g=tn(Qi,Zi),u<=1&&g<y?(f=u,y=g):m*=.5);return c&&(c[0]=nn(t,i,s,a,f),c[1]=nn(e,n,r,o,f)),Math.sqrt(y)}(t,e,i,n,s,r,a,o,h,c,null)<=d/2}function on(t,e,n,s,r,a,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>n||d+c<n)return!1;if(Math.abs(s-r)%i.pi2<1e-4)return!0;if(a){const t=s;s=sn(r),r=sn(t)}else s=sn(s),r=sn(r);s>r&&(r+=i.pi2);let u=Math.atan2(h,l);return u<0&&(u+=i.pi2),u>=s&&u<=r||u+i.pi2>=s&&u+i.pi2<=r}function ln(t,e,i,n,s,r,a){if(0===s)return!1;const o=s,l=s/2;let h=0,c=t;if(a>e+l&&a>n+l||a<e-l&&a<n-l||r>t+l&&r>i+l||r<t-l&&r<i-l)return!1;if(t===i)return Math.abs(r-t)<=o/2;h=(e-n)/(t-i),c=(t*n-i*e)/(t-i);const d=h*r-a+c;return d*d/(h*h+1)<=o/2*o/2}const hn=1e-4;function cn(t,e,i,n,s){const r=6*i-12*e+6*t,a=9*e+3*n-3*t-9*i,o=3*e-3*t;let l=0;if($i(a)){if(Ki(r)){const t=-o/r;t>=0&&t<=1&&(s[l++]=t)}}else{const t=r*r-4*a*o;if($i(t))s[0]=-r/(2*a);else if(t>0){const e=Math.sqrt(t),i=(-r+e)/(2*a),n=(-r-e)/(2*a);i>=0&&i<=1&&(s[l++]=i),n>=0&&n<=1&&(s[l++]=n)}}return l}const dn=[-1,-1,-1],un=[-1,-1];function pn(){const t=un[0];un[0]=un[1],un[1]=t}function gn(t,e,i,n,s,r,a,o,l,h){if(h>e&&h>n&&h>r&&h>o||h<e&&h<n&&h<r&&h<o)return 0;const c=function(t,e,i,n,s,r){const a=n+3*(e-i)-t,o=3*(i-2*e+t),l=3*(e-t),h=t-s,c=o*o-3*a*l,d=o*l-9*a*h,u=l*l-3*o*h;let p=0;if($i(c)&&$i(d))if($i(o))r[0]=0;else{const t=-l/o;t>=0&&t<=1&&(r[p++]=t)}else{const t=d*d-4*c*u;if($i(t)){const t=d/c,e=-o/a+t,i=-t/2;e>=0&&e<=1&&(r[p++]=e),i>=0&&i<=1&&(r[p++]=i)}else if(t>0){const e=Math.sqrt(t);let i=c*o+1.5*a*(-d+e),n=c*o+1.5*a*(-d-e);i=i<0?-Math.pow(-i,qi):Math.pow(i,qi),n=n<0?-Math.pow(-n,qi):Math.pow(n,qi);const s=(-o-(i+n))/(3*a);s>=0&&s<=1&&(r[p++]=s)}else{const t=(2*c*o-3*a*d)/(2*Math.sqrt(c*c*c)),e=Math.acos(t)/3,i=Math.sqrt(c),n=Math.cos(e),s=(-o-2*i*n)/(3*a),l=(-o+i*(n+Yi*Math.sin(e)))/(3*a),h=(-o+i*(n-Yi*Math.sin(e)))/(3*a);s>=0&&s<=1&&(r[p++]=s),l>=0&&l<=1&&(r[p++]=l),h>=0&&h<=1&&(r[p++]=h)}}return p}(e,n,r,o,h,dn);if(0===c)return 0;let d=0,u=-1,p=0,g=0;for(let h=0;h<c;h++){const c=dn[h],f=0===c||1===c?.5:1;nn(t,i,s,a,c)<l||(u<0&&(u=cn(e,n,r,o,un),un[1]<un[0]&&u>1&&pn(),p=nn(e,n,r,o,un[0]),u>1&&(g=nn(e,n,r,o,un[1]))),2===u?c<un[0]?d+=p<e?f:-f:c<un[1]?d+=g<p?f:-f:d+=o<g?f:-f:c<un[0]?d+=p<e?f:-f:d+=o<p?f:-f)}return d}function fn(t,e,i,n,s,r,a,o){if(o>e&&o>n&&o>r||o<e&&o<n&&o<r)return 0;const l=function(t,e,i,n,s){const r=t-2*e+i,a=2*(e-t),o=t-n;let l=0;if($i(r)){if(Ki(a)){const t=-o/a;t>=0&&t<=1&&(s[l++]=t)}}else{const t=a*a-4*r*o;if($i(t)){const t=-a/(2*r);t>=0&&t<=1&&(s[l++]=t)}else if(t>0){const e=Math.sqrt(t),i=(-a+e)/(2*r),n=(-a-e)/(2*r);i>=0&&i<=1&&(s[l++]=i),n>=0&&n<=1&&(s[l++]=n)}}return l}(e,n,r,o,dn);if(0===l)return 0;const h=function(t,e,i){const n=t+i-2*e;return 0===n?.5:(t-e)/n}(e,n,r);if(h>=0&&h<=1){let o=0;const c=en(e,n,r,h);for(let n=0;n<l;n++){const l=0===dn[n]||1===dn[n]?.5:1;en(t,i,s,dn[n])<a||(dn[n]<h?o+=c<e?l:-l:o+=r<c?l:-l)}return o}const c=0===dn[0]||1===dn[0]?.5:1;return en(t,i,s,dn[0])<a?0:r<e?c:-c}function mn(t,e,n,s,r,a,o,l){if((l-=e)>n||l<-n)return 0;const h=Math.sqrt(n*n-l*l);dn[0]=-h,dn[1]=h;const c=Math.abs(s-r);if(c<1e-4)return 0;if(c>=i.pi2-1e-4){s=0,r=i.pi2;const e=a?1:-1;return o>=dn[0]+t&&o<=dn[1]+t?e:0}if(s>r){const t=s;s=r,r=t}s<0&&(s+=i.pi2,r+=i.pi2);let d=0;for(let e=0;e<2;e++){const n=dn[e];if(n+t>o){let t=Math.atan2(l,n),e=a?1:-1;t<0&&(t=i.pi2+t),(t>=s&&t<=r||t+i.pi2>=s&&t+i.pi2<=r)&&(t>i.pi/2&&t<1.5*i.pi&&(e=-e),d+=e)}}return d}function yn(t){return Math.round(t/i.pi*1e8)/1e8%2*i.pi}function bn(t,e){let n=yn(t[0]);n<0&&(n+=i.pi2);const s=n-t[0];let r=t[1];r+=s,!e&&r-n>=i.pi2?r=n+i.pi2:e&&n-r>=i.pi2?r=n-i.pi2:!e&&n>r?r=n+(i.pi2-yn(n-r)):e&&n<r&&(r=n-(i.pi2-yn(r-n))),t[0]=n,t[1]=r}const vn=[0,0];function xn(t,e,n,s,r){const a=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=a[t],f=0===t;o[0]===ie.M&&t>1&&(n||(c+=i.isPointInLine(d,u,p,g,s,r))),f&&(d=o[1],u=o[2],p=d,g=u);const m=o[0],y=o[1],b=o[2],v=o[3],x=o[4],_=o[5],A=o[6];let S=x,T=_;vn[0]=S,vn[1]=T,bn(vn,Boolean(o[6])),S=vn[0],T=vn[1];const w=S,M=T-S,B=!!(1-(o[6]?0:1)),C=(s-y)*v/v+y;switch(m){case ie.M:p=y,g=b,d=p,u=g;break;case ie.L:if(n){if(ln(d,u,y,b,e,s,r))return!0}else c+=i.isPointInLine(d,u,y,b,s,r)||0;d=y,u=b;break;case ie.C:if(n){if(an(d,u,y,b,v,x,_,A,e,s,r))return!0}else c+=gn(d,u,y,b,v,x,_,A,s,r)||0;d=_,u=A;break;case ie.Q:if(n){if(rn(d,u,y,b,v,x,e,s,r))return!0}else c+=fn(d,u,y,b,v,x,s,r)||0;d=v,u=x;break;case ie.A:if(l=Math.cos(w)*v+y,h=Math.sin(w)*v+b,f?(p=l,g=h):c+=i.isPointInLine(d,u,l,h,s,r),n){if(on(y,b,v,w,w+M,B,e,C,r))return!0}else c+=mn(y,b,v,w,w+M,B,C,r);d=Math.cos(w+M)*v+y,u=Math.sin(w+M)*v+b;break;case ie.R:if(p=d=y,g=u=b,l=p+v,h=g+x,n){if(ln(p,g,l,g,e,s,r)||ln(l,g,l,h,e,s,r)||ln(l,h,p,h,e,s,r)||ln(p,h,p,g,e,s,r))return!0}else c+=i.isPointInLine(l,g,l,h,s,r),c+=i.isPointInLine(p,h,p,g,s,r);break;case ie.Z:if(n){if(ln(d,u,p,g,e,s,r))return!0}else c+=i.isPointInLine(d,u,p,g,s,r);d=p,u=g}}return n||(f=u,m=g,Math.abs(f-m)<hn)||(c+=i.isPointInLine(d,u,p,g,s,r)||0),0!==c;var f,m}const _n=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=Hi(Object.assign({nativeCanvas:Xt.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=Hi(Object.assign({nativeCanvas:Xt.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(){this.pools=[]}},An={arc:gi,area:fi,circle:mi,line:vi,path:xi,symbol:Ti,text:wi,rect:Si,polygon:_i,star:Ai,richtext:Mi,richtextIcon:Ci,image:Bi,group:yi,glyph:bi},Sn=Object.keys(An);function Tn(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const wn={arc:Object.assign({},An.arc),area:Object.assign({},An.area),circle:Object.assign({},An.circle),line:Object.assign({},An.line),path:Object.assign({},An.path),symbol:Object.assign({},An.symbol),text:Object.assign({},An.text),rect:Object.assign({},An.rect),polygon:Object.assign({},An.polygon),star:Object.assign({},An.star),richtext:Object.assign({},An.richtext),richtextIcon:Object.assign({},An.richtextIcon),image:Object.assign({},An.image),group:Object.assign({},An.group),glyph:Object.assign({},An.glyph)};class Mn{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},Sn.forEach((t=>{this._defaultTheme[t]=Object.create(wn[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){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){const s=this.getParentWithTheme(t);if(s){const t=s.theme;(t.dirty||n)&&t.applyTheme(s,e,!0)}this.userTheme?this.doCombine(s&&s.theme.combinedTheme):(s?this.combinedTheme=s.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,i.Logger.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;Sn.forEach((n=>{const s=Object.create(wn[n]);t&&t[n]&&Tn(s,t[n]),i[n]&&Tn(s,i[n]),e[n]&&Tn(s,e[n]),this.combinedTheme[n]=s})),e.common&&Sn.forEach((t=>{Tn(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))}))}}const Bn=new Mn;function Cn(t,e){return t.glyphHost?Cn(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)):Bn.getTheme()}return null}(t)||t.attachedThemeGraphic&&Cn(t.attachedThemeGraphic)||Bn.getTheme()}var kn=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function a(t){try{l(n.next(t))}catch(t){r(t)}}function o(t){try{l(n.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((n=n.apply(t,e||[])).next())}))};class Pn extends i.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=pt.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return kn(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];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){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&&i.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 n=this.insertInto(t,0);return this._ignoreWarn=!1,n}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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=null;return this.forEachChildren(((e,n)=>!(e===this||!t(e,n)||(i=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.find(t,!0);if(n)return i=n,!0}return!1})),i}findAll(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=[];return this.forEachChildren(((e,n)=>{e!==this&&t(e,n)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.findAll(t,!0);n.length&&(i=i.concat(n))}})),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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[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,n){const s=i.isBoolean(n,!0)&&n||i.isObject(n)&&n.capture,r=i.isObject(n)&&n.once,a=i.isFunction(e)?void 0:e;return t=s?`${t}capture`:t,e=i.isFunction(e)?e:e.handleEvent,r?super.once(t,e,a):super.on(t,e,a),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,n){const s=i.isBoolean(n,!0)&&n||i.isObject(n)&&n.capture,r=i.isFunction(e)?void 0:e;t=s?`${t}capture`:t,e=i.isFunction(e)?e:e.handleEvent;const a=i.isObject(n)&&n.once;return super.off(t,e,r,a),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,n){return i.isObject(n)?(n.once=!0,this.addEventListener(t,e,n)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return super.emit(t.type,t,...i),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class On{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=On.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&&i.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&&i.isFunction(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class Rn extends On{constructor(t,e){super(),this.type=t,this.detail=e}}const Ln={dispatchEvent(t){var e;if(!(t instanceof On))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 Rn(t,e))}};class In{static GetImage(t,e){var i;const n=In.cache.get(t);n?"fail"===n.loadState?Xt.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,n.data):In.loadImage(t,e)}static GetSvg(t,e){var i;let n=In.cache.get(t);n?"fail"===n.loadState?Xt.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,n.data):(n={type:"image",loadState:"init"},In.cache.set(t,n),n.dataPromise=Xt.global.loadSvg(t),n.dataPromise?(n.waitingMark=[e],n.dataPromise.then((e=>{var i;n.loadState=(null==e?void 0:e.data)?"success":"fail",n.data=null==e?void 0:e.data,null===(i=n.waitingMark)||void 0===i||i.map(((i,s)=>{(null==e?void 0:e.data)?(n.loadState="success",n.data=e.data,i.imageLoadSuccess(t,e.data)):(n.loadState="fail",i.imageLoadFail(t))})),n.waitingMark&&(n.waitingMark=[])}))):(n.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=In.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"},In.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=Xt.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=Xt.global.loadBlob(t):"json"===e&&(i.dataPromise=Xt.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!In.isLoading&&In.toLoadAueue.length){In.isLoading=!0;const t=In.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:n}=t,s={type:"image",loadState:"init"};if(In.cache.set(i,s),s.dataPromise=Xt.global.loadImage(i),s.dataPromise){s.waitingMark=n;const t=s.dataPromise.then((t=>{var e;s.loadState=(null==t?void 0:t.data)?"success":"fail",s.data=null==t?void 0:t.data,null===(e=s.waitingMark)||void 0===e||e.map(((e,n)=>{(null==t?void 0:t.data)?(s.loadState="success",s.data=t.data,e.imageLoadSuccess(i,t.data)):(s.loadState="fail",e.imageLoadFail(i))})),s.waitingMark&&(s.waitingMark=[])}));e.push(t)}else s.loadState="fail",n.forEach((t=>t.imageLoadFail(i)))})),Promise.all(e).then((()=>{In.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),In.loading()})).catch((t=>{console.error(t),In.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),In.loading()}))}}),0)}static loadImage(t,e){const i=En(t,In.toLoadAueue);if(-1!==i)return In.toLoadAueue[i].marks.push(e),void In.loading();In.toLoadAueue.push({url:t,marks:[e]}),In.loading()}static improveImageLoading(t){const e=En(t,In.toLoadAueue);if(-1!==e){const t=In.toLoadAueue.splice(e,1);In.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function En(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return-1}var Dn;In.cache=new Map,In.isLoading=!1,In.toLoadAueue=[],In.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"}(Dn||(Dn={}));const Fn=[!1,!1,!1,!1],jn=[0,0,0,0],Un=t=>t?i.isArray(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(jn[0]=t[0],jn[2]=t[0],jn[1]=t[1],jn[3]=t[1],jn):t:t:0,Nn=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Wn=[1,2,3,0,1,2,3,0];function zn(t,e,n,s){for(;t>=i.pi2;)t-=i.pi2;for(;t<0;)t+=i.pi2;for(;t>e;)e+=i.pi2;Nn[0].x=n,Nn[1].y=n,Nn[2].x=-n,Nn[3].y=-n;const r=Math.ceil(t/i.halfPi)%4,a=Math.ceil(e/i.halfPi)%4;if(s.add(i.cos(t)*n,i.sin(t)*n),s.add(i.cos(e)*n,i.sin(e)*n),r!==a||e-t>i.pi){let t=!1;for(let e=0;e<Wn.length;e++)if(t||r!==Wn[e]){if(t&&a===Wn[e])break;if(t){const t=Nn[Wn[e]];s.add(t.x,t.y)}}else{t=!0;const e=Nn[r];s.add(e.x,e.y)}}}function Vn(t,e,n){const{x:s,y:r}=i.pointAt(t.x,t.y,e.x,e.y,n),{x:a,y:o}=i.pointAt(t.x1,t.y1,e.x1,e.y1,n),l=new i.Point(s,r,a,o);return l.defined=e.defined,l}function Gn(t,e,n){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);let s=[];if(t.length>e.length){s=e.map((t=>{const e=new i.Point(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let i=0;i<e.length;i++)s[i]=Vn(t[i],e[i],n)}else{s=e.map((t=>{const e=new i.Point(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let i=0;i<t.length;i++)s[i]=Vn(t[i],e[i],n)}return s}const Hn=(t,e)=>{const n=((t,e)=>i.isString(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t)(t,e);return isNaN(n)?n:Math.max(e,n)};class Xn{bounds(t,e){if(i.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 i.isNumber(t)?t:Math.min(t[0],t[1])}}function Yn(t,e,n,s,r){return r?t.arc(n,s,e,0,i.tau,!1,r):t.arc(n,s,e,0,i.tau),!1}var qn=new class extends Xn{constructor(){super(...arguments),this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}draw(t,e,i,n,s){return Yn(t,this.parseSize(e)/2,i,n,s)}drawOffset(t,e,i,n,s,r){return Yn(t,this.parseSize(e)/2+s,i,n,r)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i} a ${s},${s} 0 1,0 ${2*s},0 a ${s},${s} 0 1,0 -${2*s},0`}};var $n=new class extends Xn{constructor(){super(...arguments),this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}draw(t,e,i,n,s){return function(t,e,i,n,s){return t.moveTo(-3*e+i,-e+n,s),t.lineTo(-e+i,-e+n,s),t.lineTo(-e+i,-3*e+n,s),t.lineTo(e+i,-3*e+n,s),t.lineTo(e+i,-e+n,s),t.lineTo(3*e+i,-e+n,s),t.lineTo(3*e+i,e+n,s),t.lineTo(e+i,e+n,s),t.lineTo(e+i,3*e+n,s),t.lineTo(-e+i,3*e+n,s),t.lineTo(-e+i,e+n,s),t.lineTo(-3*e+i,e+n,s),t.closePath(),!0}(t,this.parseSize(e)/6,i,n,s)}drawOffset(t,e,i,n,s,r){return function(t,e,i,n,s,r){return t.moveTo(-3*e+i-s,-e+n-s,r),t.lineTo(-e+i-s,-e+n-s,r),t.lineTo(-e+i-s,-3*e+n-s,r),t.lineTo(e+i+s,-3*e+n-s,r),t.lineTo(e+i+s,-e+n-s,r),t.lineTo(3*e+i+s,-e+n-s,r),t.lineTo(3*e+i+s,e+n+s,r),t.lineTo(e+i+s,e+n+s,r),t.lineTo(e+i+s,3*e+n+s,r),t.lineTo(-e+i-s,3*e+n+s,r),t.lineTo(-e+i-s,e+n+s,r),t.lineTo(-3*e+i-s,e+n+s,r),t.closePath(),!0}(t,this.parseSize(e)/6,i,n,s,r)}};function Kn(t,e,i,n,s){return t.moveTo(i,n-e,s),t.lineTo(e+i,n,s),t.lineTo(i,n+e,s),t.lineTo(i-e,n,s),t.closePath(),!0}var Zn=new class extends Xn{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,n,s){return Kn(t,this.parseSize(e)/2,i,n,s)}drawFitDir(t,e,i,n,s){return Kn(t,this.parseSize(e)/2,i,n,s)}drawOffset(t,e,i,n,s,r){return Kn(t,this.parseSize(e)/2+s,i,n,r)}};function Jn(t,e,i,n){const s=2*e;return t.rect(i-e,n-e,s,s),!1}var Qn=new class extends Xn{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return Jn(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Jn(t,this.parseSize(e)/2+s,i,n)}};function ts(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i+e+2*s,e+n+s),t.lineTo(i-e-2*s,e+n+s),t.lineTo(i,n-e-2*s),t.closePath(),!0}class es extends Xn{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,i,n){return ts(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return ts(t,this.parseSize(e)/2,i,n,s)}}var is=new es;var ns=new class extends es{constructor(){super(...arguments),this.type="triangle"}};const ss=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),rs=Math.sin(i.tau/10)*ss,as=-Math.cos(i.tau/10)*ss;function os(t,e,n,s){const r=rs*e,a=as*e;t.moveTo(n,-e+s),t.lineTo(r+n,a+s);for(let o=1;o<5;++o){const l=i.tau*o/5,h=Math.cos(l),c=Math.sin(l);t.lineTo(c*e+n,-h*e+s),t.lineTo(h*r-c*a+n,c*r+h*a+s)}return t.closePath(),!0}var ls=new class extends Xn{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,n){return os(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return os(t,this.parseSize(e)/2+s,i,n)}};const hs=i.sqrt(3);function cs(t,e,i,n){const s=e,r=s/hs,a=r/5,o=e;return t.moveTo(0+i,-s+n),t.lineTo(r/2+i,n),t.lineTo(a/2+i,n),t.lineTo(a/2+i,o+n),t.lineTo(-a/2+i,o+n),t.lineTo(-a/2+i,n),t.lineTo(-r/2+i,n),t.closePath(),!0}var ds=new class extends Xn{constructor(){super(...arguments),this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}draw(t,e,i,n){return cs(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return cs(t,this.parseSize(e)/2+s,i,n)}};function us(t,e,i,n){const s=2*e;return t.moveTo(i,-e+n),t.lineTo(s/3/2+i,e+n),t.lineTo(-s/3/2+i,e+n),t.closePath(),!0}var ps=new class extends Xn{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,n){return us(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return us(t,this.parseSize(e)/2+s,i,n)}};function gs(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var fs=new class extends Xn{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,n){return gs(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return gs(t,this.parseSize(e)/2+s,i,n)}};const ms=-.5,ys=i.sqrt(3)/2,bs=1/i.sqrt(12);function vs(t,e,i,n){const s=e/2,r=e*bs,a=s,o=e*bs+e,l=-a,h=o;return t.moveTo(s+i,r+n),t.lineTo(a+i,o+n),t.lineTo(l+i,h+n),t.lineTo(ms*s-ys*r+i,ys*s+ms*r+n),t.lineTo(ms*a-ys*o+i,ys*a+ms*o+n),t.lineTo(ms*l-ys*h+i,ys*l+ms*h+n),t.lineTo(ms*s+ys*r+i,ms*r-ys*s+n),t.lineTo(ms*a+ys*o+i,ms*o-ys*a+n),t.lineTo(ms*l+ys*h+i,ms*h-ys*l+n),t.closePath(),!1}var xs=new class extends Xn{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,n){return vs(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return vs(t,this.parseSize(e)/2+s,i,n)}};function _s(t,e,i,n,s){return t.moveTo(-e+i-2*s,n),t.lineTo(e+i+s,e+n+2*s),t.lineTo(e+i+s,n-e-2*s),t.closePath(),!0}var As=new class extends Xn{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,i,n){return _s(t,this.parseSize(e)/2,i,n,0)}drawOffset(t,e,i,n,s){return _s(t,this.parseSize(e)/2,i,n,s)}};function Ss(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i-e-s,e+n+2*s),t.lineTo(e+i+2*s,n),t.lineTo(i-e-s,n-e-2*s),t.closePath(),!0}var Ts=new class extends Xn{constructor(){super(...arguments),this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,i,n){return Ss(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Ss(t,this.parseSize(e)/2,i,n,s)}};function ws(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i-e-2*s,n-e-s),t.lineTo(i+e+2*s,n-e-s),t.lineTo(i,n+e+2*s),t.closePath(),!0}var Ms=new class extends Xn{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,i,n){return ws(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return ws(t,this.parseSize(e)/2,i,n,s)}};const Bs=i.sqrt(3);function Cs(t,e,i,n){const s=e*Bs;return t.moveTo(i,n+-s/3*2),t.lineTo(e+i,n+s),t.lineTo(i-e,n+s),t.closePath(),!0}var ks=new class extends Xn{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,n){return Cs(t,this.parseSize(e)/2/Bs,i,n)}drawOffset(t,e,i,n,s){return Cs(t,this.parseSize(e)/2/Bs+s,i,n)}};function Ps(t,e,i,n){const s=2*e;return t.moveTo(e+i,n-s),t.lineTo(i-e,n),t.lineTo(e+i,s+n),!0}var Os=new class extends Xn{constructor(){super(...arguments),this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,i,n){return Ps(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Ps(t,this.parseSize(e)/4+s,i,n)}};function Rs(t,e,i,n){const s=2*e;return t.moveTo(i-e,n-s),t.lineTo(i+e,n),t.lineTo(i-e,s+n),!0}var Ls=new class extends Xn{constructor(){super(...arguments),this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,i,n){return Rs(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Rs(t,this.parseSize(e)/4+s,i,n)}};function Is(t,e,i,n){const s=2*e;return t.moveTo(i-s,n+e),t.lineTo(i,n-e),t.lineTo(i+s,n+e),!0}var Es=new class extends Xn{constructor(){super(...arguments),this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,i,n){return Is(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Is(t,this.parseSize(e)/4+s,i,n)}};function Ds(t,e,i,n){const s=2*e;return t.moveTo(i-s,n-e),t.lineTo(i,n+e),t.lineTo(i+s,n-e),!0}var Fs=new class extends Xn{constructor(){super(...arguments),this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,i,n){return Ds(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Ds(t,this.parseSize(e)/4+s,i,n)}};function js(t,e,i,n,s){return t.moveTo(i,n-e),t.lineTo(i,n+e),!0}var Us=new class extends Xn{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,n,s){return js(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return js(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e}, ${i-s} L ${e},${i+s}`}};function Ns(t,e,i,n,s){return t.moveTo(i-e,n),t.lineTo(i+e,n),!0}var Ws=new class extends Xn{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,n,s){return Ns(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return Ns(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i} L ${e+s},${i}`}};function zs(t,e,i,n,s){return t.moveTo(i-e,n-e),t.lineTo(i+e,n+e),t.moveTo(i+e,n-e),t.lineTo(i-e,n+e),!0}var Vs=new class extends Xn{constructor(){super(...arguments),this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,i,n,s){return zs(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return zs(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i-s} L ${e+s},${i+s} M ${e+s}, ${i-s} L ${e-s},${i+s}`}};function Gs(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}function Hs(t,e,i,n){const s=e,r=e/2;return t.rect(i-s/2,n-r/2,s,r),!1}var Xs=new class extends Xn{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,n,s){return i.isNumber(e)?Hs(t,e,n,s):Gs(t,e,n,s)}drawWithClipRange(t,e,n,s,r,a,o){i.isNumber(e)&&(e=[e,e/2]);const l=2*(e[0]+e[1])*r,h=[{x:n+e[0]/2,y:s-e[1]/2},{x:n+e[0]/2,y:s+e[1]/2},{x:n-e[0]/2,y:s+e[1]/2},{x:n-e[0]/2,y:s-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],n=Math.sqrt((i.x-d.x)*(i.x-d.x)+(i.y-d.y)*(i.y-d.y));if(c+n>l){const e=(i.x-d.x)*(l-c)/n,s=(i.y-d.y)*(l-c)/n;t.lineTo(d.x+e,d.y+s);break}t.lineTo(i.x,i.y),d=i,c+=n}return!1}drawOffset(t,e,n,s,r){return i.isNumber(e)?Hs(t,e+2*r,n,s):Gs(t,[e[0]+2*r,e[1]+2*r],n,s)}};const Ys=new i.AABBBounds;class qs{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.pathStr="",this.type=t,i.isArray(e)?this.svgCache=e:this.path=e,this.isSvg=n}drawOffset(t,e,i,n,s,r,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((s=>{t.beginPath(),be(s.path.commandList,t,i,n,e,e),a&&a(s.path,s.attribute)})),!1):(be(this.path.commandList,t,i,n,e+s,e+s),!1)}draw(t,e,i,n,s,r){return e=this.parseSize(e),this.drawOffset(t,e,i,n,0,s,r)}parseSize(t){return i.isNumber(t)?t:Math.min(t[0],t[1])}drawWithClipRange(t,e,i,n,s,r,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{r.path.drawWithClipRange(t,e,i,n,s),a&&a(r.path,r.attribute)})),!1):(this.path.drawWithClipRange(t,e,i,n,s),!1)}bounds(t,e){if(t=this.parseSize(t),this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((i=>{let{path:n}=i;Ys.x1=n.bounds.x1*t,Ys.y1=n.bounds.y1*t,Ys.x2=n.bounds.x2*t,Ys.y2=n.bounds.y2*t,e.union(Ys)}))}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 $s={};[qn,$n,Zn,Qn,ks,ns,ls,ds,ps,fs,xs,As,Ts,is,Ms,Os,Ls,Es,Fs,Xs,Us,Ws,Vs].forEach((t=>{$s[t.type]=t}));const Ks={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 Zs{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 Js(t,e,i,n){const s=t.indexOf(e,i);if(-1===s)throw new Error(n);return s+e.length-1}function Qs(t,e,i){const n=function(t,e){let i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",s="";for(let r=e;r<t.length;r++){let e=t[r];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:s,index:r};if(t[r+1]===n[1])return{data:s,index:r}}else"\t"===e&&(e=" ");s+=e}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(!n)return;let s=n.data;const r=n.index,a=s.search(/\s/);let o=s,l=!0;-1!==a&&(o=s.substr(0,a).replace(/\s\s*$/,""),s=s.substr(a+1));const h=o;if(i){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1),l=o!==n.data.substr(t+1))}return{tagName:o,tagExp:s,closeIndex:r,attrExpPresent:l,rawTagName:h}}const tr=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class er{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,i){const n=e.tagname;"string"==typeof n?(e.tagname=n,t.addChild(e)):t.addChild(e)}buildAttributesMap(t,e,i){const n={};if(!t)return;const s=function(t,e){const i=[];let n=e.exec(t);for(;n;){const s=[];s.startIndex=e.lastIndex-n[0].length;const r=n.length;for(let t=0;t<r;t++)s.push(n[t]);i.push(s),n=e.exec(t)}return i}(t,tr),r=s.length;for(let t=0;t<r;t++){const e=s[t][1],i=s[t][4];e&&(n[e]=void 0===i||(isNaN(i)?i:Number(i)))}return n}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new Zs("!xml");let i=e,n="",s="";for(let r=0;r<t.length;r++)if("<"===t[r])if("/"===t[r+1]){const e=Js(t,">",r,"Closing Tag is not closed."),a=s.lastIndexOf(".");s=s.substring(0,a),i=this.tagsNodeStack.pop(),i&&i.child&&n&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=n),n="",r=e}else if("?"===t[r+1])r=Qs(t,r,!1,"?>").closeIndex+1;else if("!--"===t.substr(r+1,3))r=Js(t,"--\x3e",r+4,"Comment is not closed.");else{const a=Qs(t,r,!1);let o=a.tagName,l=a.tagExp;const h=a.attrExpPresent,c=a.closeIndex;if(o!==e.tagname&&(s+=s?"."+o:o),l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===o[o.length-1]?(o=o.substr(0,o.length-1),s=s.substr(0,s.length-1),l=o):l=l.substr(0,l.length-1);const t=new Zs(o);o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,s,o)),this.addChild(i,t,s),s=s.substr(0,s.lastIndexOf("."))}else{const t=new Zs(o);this.tagsNodeStack.push(i),o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,s,o)),this.addChild(i,t,s),i=t}n="",r=c}else n+=t[r];return e.child}}function ir(t,e){return nr(t)}function nr(t,e){const i={};for(let e=0;e<t.length;e++){const s=t[e],r=sr(s);if(void 0!==r&&s[r]){const t=nr(s[r]);n=t,Object.keys(n).length,s[":@"]&&rr(t,s[":@"]),void 0!==i[r]&&i.hasOwnProperty(r)?(Array.isArray(i[r])||(i[r]=[i[r]]),i[r].push(t)):i[r]=t}}var n;return i}function sr(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function rr(t,e,i){if(e){const i=Object.keys(e),n=i.length;for(let s=0;s<n;s++){const n=i[s];t[n]=e[n]}}}class ar{constructor(t){this.options=Object.assign({},ar.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return ir(new er(this.options).parseXml(t),this.options)}}function or(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+(n/2+(i?function(t,e){return t?e:0}(i,e):0))),t}ar.defaultOptions={};let lr=0;function hr(){return lr++}var cr;!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(cr||(cr={}));const dr=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>dr.set(t,!0)));const ur=new Map;function pr(t){if(dr.has(t))return!0;if(ur.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>ur.set(t,!0)));const gr=hr(),fr=hr(),mr=hr();hr(),hr();const yr=hr(),br=hr(),vr=hr(),xr=hr(),_r=hr(),Ar=hr(),Sr=hr(),Tr=hr(),wr=hr();hr();const Mr=hr(),Br=hr(),Cr=Symbol.for("GraphicCreator"),kr={"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"},Pr=Object.keys(kr),Or={duration:200,easing:"cubicOut"};function Rr(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 Lr(t,e,i){const n=i[0],s=i[1],r=i[2];let a,o,l,h,c,d,u,p,g,f,m,y;return e===t?(t[12]=e[0]*n+e[4]*s+e[8]*r+e[12],t[13]=e[1]*n+e[5]*s+e[9]*r+e[13],t[14]=e[2]*n+e[6]*s+e[10]*r+e[14],t[15]=e[3]*n+e[7]*s+e[11]*r+e[15]):(a=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],f=e[9],m=e[10],y=e[11],t[0]=a,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]=f,t[10]=m,t[11]=y,t[12]=a*n+c*s+g*r+e[12],t[13]=o*n+d*s+f*r+e[13],t[14]=l*n+u*s+m*r+e[14],t[15]=h*n+p*s+y*r+e[15]),t}function Ir(t,e,i){const n=e[0],s=e[1],r=e[2],a=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],f=e[12],m=e[13],y=e[14],b=e[15];let v=i[0],x=i[1],_=i[2],A=i[3];return t[0]=v*n+x*o+_*d+A*f,t[1]=v*s+x*l+_*u+A*m,t[2]=v*r+x*h+_*p+A*y,t[3]=v*a+x*c+_*g+A*b,v=i[4],x=i[5],_=i[6],A=i[7],t[4]=v*n+x*o+_*d+A*f,t[5]=v*s+x*l+_*u+A*m,t[6]=v*r+x*h+_*p+A*y,t[7]=v*a+x*c+_*g+A*b,v=i[8],x=i[9],_=i[10],A=i[11],t[8]=v*n+x*o+_*d+A*f,t[9]=v*s+x*l+_*u+A*m,t[10]=v*r+x*h+_*p+A*y,t[11]=v*a+x*c+_*g+A*b,v=i[12],x=i[13],_=i[14],A=i[15],t[12]=v*n+x*o+_*d+A*f,t[13]=v*s+x*l+_*u+A*m,t[14]=v*r+x*h+_*p+A*y,t[15]=v*a+x*c+_*g+A*b,t}function Er(t,e,i){const n=e[0],s=e[1],r=e[2];let a=i[3]*n+i[7]*s+i[11]*r+i[15];return a=a||1,t[0]=(i[0]*n+i[4]*s+i[8]*r+i[12])/a,t[1]=(i[1]*n+i[5]*s+i[9]*r+i[13])/a,t[2]=(i[2]*n+i[6]*s+i[10]*r+i[14])/a,t}class Dr{constructor(){this.pools=[]}static identity(t){return Rr(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 Dr.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(){this.pools=[]}}const Fr=new class{constructor(){this.pools=[]}allocate(t,e,n,s,r,a){if(!this.pools.length)return new i.Matrix(t,e,n,s,r,a);const o=this.pools.pop();return o.a=t,o.b=e,o.c=n,o.d=s,o.e=r,o.f=a,o}allocateByObj(t){if(!this.pools.length)return new i.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(){this.pools=[]}},jr=new Dr;var Ur=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Nr=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const Wr=new i.Matrix(1,0,0,1,0,0),zr={x:0,y:0};let Vr=class{get nativeContext(){return this.path}constructor(t,e){this.matrix=new i.Matrix(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new i.Matrix(1,0,0,1,0,0),this.path=new si,this._clearMatrix=new i.Matrix(1,0,0,1,0,0)}getCanvas(){throw new Error("不支持getCanvas")}getContext(){throw new Error("不支持getContext")}setTransformForCurrent(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}get currentMatrix(){return this.matrix}cloneMatrix(t){return Fr.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}reset(){this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new i.Matrix(1,0,0,1,0,0),this.stack.length=0}restore(){this.stack.length>0&&(Fr.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(Fr.free(this.matrix),this.matrix=this.stack.pop())}rotate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];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){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,n){let s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(i,n,!1),this.scale(t,e,!1),this.translate(-i,-n,!1),s&&this.setTransformForCurrent()}setTransform(t,e,i,n,s,r){let a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(o*t,o*e,o*i,o*n,o*s,o*r),a&&this.setTransformForCurrent()}setTransformFromMatrix(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]: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(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,n,s,r){let a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,i,n,s,r),a&&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){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}beginPath(){this.path.clear()}clip(t,e){}arc(t,e,i,n,s,r){this.path.arc(t,e,i,n,s,r)}arcTo(t,e,i,n,s){this.path.arcTo(t,e,i,n,s)}bezierCurveTo(t,e,i,n,s,r){this.path.bezierCurveTo(t,e,i,n,s,r)}closePath(){this.path.closePath()}ellipse(t,e,i,n,s,r,a,o){}lineTo(t,e){this.path.lineTo(t,e)}moveTo(t,e){this.path.moveTo(t,e)}quadraticCurveTo(t,e,i,n){this.path.quadraticCurveTo(t,e,i,n)}rect(t,e,i,n){this.path.rect(t,e,i,n)}createImageData(t,e){return null}createLinearGradient(t,e,i,n){throw new Error("不支持createLinearGradient")}createPattern(t,e){throw new Error("不支持createPattern")}createRadialGradient(t,e,i,n,s,r){throw new Error("不支持createRadialGradient")}createConicGradient(t,e,i,n){return null}fill(t,e){}fillRect(t,e,i,n){this.path.rect(t,e,i,n)}clearRect(t,e,i,n){}fillText(t,e,i){}getImageData(t,e,i,n){return null}getLineDash(){return[]}isPointInPath(t,e){return this.matrix.transformPoint({x:t,y:e},zr),function(t,e,i){return xn(t,0,!1,e,i)}(this.path.commandList,zr.x,zr.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},zr);const i=Oi(this,this.lineWidth,this.dpr);return function(t,e,i,n){return xn(t,e,!0,i,n)}(this.path.commandList,i,zr.x,zr.y)}measureText(t){throw new Error("不支持measureText")}putImageData(t,e,i){throw new Error("不支持measureText")}setLineDash(t){}stroke(t){}strokeRect(t,e,i,n){this.path.rect(t,e,i,n)}strokeText(t,e,i){}drawImage(){}setCommonStyle(t,e,i,n,s){}_setCommonStyle(t,e,i,n){}setStrokeStyle(t,e,i,n,s){}_setStrokeStyle(t,e,i,n){}setTextStyleWithoutAlignBaseline(t,e){}setTextStyle(t,e){}draw(){}clearMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(Wr,t,e)}setClearMatrix(t,e,i,n,s,r){this._clearMatrix.setValue(t,e,i,n,s,r)}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(){this.stack.forEach((t=>Fr.free(t))),this.stack.length=0}};var Gr;Vr=Ur([wt(),Nr("design:paramtypes",[Object,Number])],Vr),function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(Gr||(Gr={}));class Hr{static Get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Gr.Color1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(e===Gr.Color1){const e=Hr.store1[t];if(e)return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n;const s=i.Color.parseColorString(t);if(s){const e=[s.r/255,s.g/255,s.b/255,s.opacity];Hr.store1[t]=e,Hr.store255[t]=[s.r,s.g,s.b,s.opacity],n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3]}return n}const s=Hr.store255[t];if(s)return n[0]=s[0],n[1]=s[1],n[2]=s[2],n[3]=s[3],n;const r=i.Color.parseColorString(t);return r&&(Hr.store1[t]=[r.r/255,r.g/255,r.b/255,r.opacity],Hr.store255[t]=[r.r,r.g,r.b,r.opacity],n[0]=r.r,n[1]=r.g,n[2]=r.b,n[3]=r.opacity),n}static Set(t,e,i){if(e===Gr.Color1){if(Hr.store1[t])return;Hr.store1[t]=i,Hr.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(Hr.store255[t])return;Hr.store255[t]=i,Hr.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function Xr(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)&&i.isNumber(t[0])?e?`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])},${t[3].toFixed(2)})`:`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])})`:t}function Yr(t,e,n,s,r){return Array.isArray(t)&&!i.isNumber(t[0])||Array.isArray(e)&&!i.isNumber(e[0])?new Array(4).fill(0).map(((r,a)=>{var o,l;return qr(i.isArray(t)?null!==(o=t[a])&&void 0!==o?o:t[0]:t,i.isArray(e)?null!==(l=e[a])&&void 0!==l?l:e[0]:e,n,s)})):qr(t,e,n,s,r)}function qr(t,e,i,n,s){if(!t||!e)return t&&Xr(t)||e&&Xr(e)||!1;let r,a,o=!1,l=!1;if(Array.isArray(t)?r=t:"string"==typeof t?r=Hr.Get(t,Gr.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=Hr.Get(e,Gr.Color255):l=!0,o!==l){const r=o?t:e,a=o?e:t,l=Object.assign(Object.assign({},r),{stops:r.stops.map((t=>Object.assign(Object.assign({},t),{color:Xr(a)})))});return o?Yr(r,l,i,n,s):Yr(l,r,i,n,s)}if(o){if(t.gradient===e.gradient){const n=t,s=e,r=n.stops,a=s.stops;if(r.length!==a.length)return!1;if("linear"===n.gradient)return function(t,e,i){const n=t.stops,s=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:Jr(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i);if("radial"===n.gradient)return function(t,e,i){const n=t.stops,s=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,r0:t.r0+(e.r0-t.r0)*i,r1:t.r1+(e.r1-t.r1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:Jr(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i);if("conical"===n.gradient)return function(t,e,i){const n=t.stops,s=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*i,endAngle:t.endAngle+(e.endAngle-t.endAngle)*i,x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:Jr(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i)}return!1}return s&&s(r,a),Xr(function(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}(r,a,i),n)}function $r(t,e,i){return`rgba(${t[0]+(e[0]-t[0])*i},${t[1]+(e[1]-t[1])*i},${t[2]+(e[2]-t[2])*i},${t[3]+(e[3]-t[3])*i})`}Hr.store255={},Hr.store1={};const Kr=[0,0,0,0],Zr=[0,0,0,0];function Jr(t,e,i){return Hr.Get(t,Gr.Color255,Kr),Hr.Get(e,Gr.Color255,Zr),`rgba(${Math.round(Kr[0]+(Zr[0]-Kr[0])*i)},${Math.round(Kr[1]+(Zr[1]-Kr[1])*i)},${Math.round(Kr[2]+(Zr[2]-Kr[2])*i)},${Kr[3]+(Zr[3]-Kr[3])*i})`}const Qr=new i.AABBBounds,ta=new i.Matrix;new i.AABBBounds;const ea=["lineWidth","scaleX","scaleY","angle","anchor","visible"],ia=["x","y"],na=["scaleX","scaleY"],sa=["angle"],ra=new i.Point,aa={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 oa extends Pn{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const n=e[i];Object.defineProperty(oa.prototype,n,Object.getOwnPropertyDescriptor(t,n))}}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)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;super(),this._AABBBounds=new i.AABBBounds,this._updateTag=he.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.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic)}getGraphicService(){var t,e;return null!==(e=null===(t=this.stage)||void 0===t?void 0:t.graphicService)&&void 0!==e?e:Xt.graphicService}getAttributes(){return this.attribute}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var i,n;const{dx:s=t.dx,dy:r=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;ra.x=s+(null!==(i=t.scrollX)&&void 0!==i?i:0),ra.y=r+(null!==(n=t.scrollY)&&void 0!==n?n:0)}else ra.x=s,ra.y=r;return ra}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(){const t="imprecise"===this.attribute.boundsMode;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 i.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=$s[t];if(e)return e;if(e=oa.userSymbolMap[t],e)return e;if(!0===((n=t=Ks[t]||t).startsWith("<svg")||n.startsWith("<?xml"))){const e=new ar,{svg:n}=e.parse(t);if(!n)return null;const s=i.isArray(n.path)?n.path:[n.path];Qr.clear();const r=[];s.forEach((t=>{const e=(new si).fromString(t.d),i={};Pr.forEach((e=>{t[e]&&(i[kr[e]]=t[e])})),r.push({path:e,attribute:i}),Qr.union(e.bounds)}));const a=Qr.width(),o=Qr.height(),l=1/i.max(a,o);r.forEach((t=>t.path.transform(0,0,l,l)));const h=new qs(t,r,!0);return oa.userSymbolMap[t]=h,h}var n;const s=(new si).fromString(t),r=s.bounds.width(),a=s.bounds.height(),o=1/i.max(r,a);s.transform(0,0,o,o);const l=new qs(t,s);return oa.userSymbolMap[t]=l,l}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const i=this.attribute,n=this.updateAABBBounds(i,e,this._AABBBounds,t),{boundsPadding:s=e.boundsPadding}=i,r=Un(s);return r&&n.expand(r),this.clearUpdateBoundTag(),n}updatePathProxyAABBBounds(t){const e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const i=new Jt(t);return be(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(){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(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._transMatrix||(this._transMatrix=new i.Matrix),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&he.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&this.getGraphicService().validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&he.UPDATE_BOUNDS)&&this.getGraphicService().validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&he.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&he.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&he.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&he.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=he.CLEAR_SHAPE}containsPoint(t,e,n,s){if(!s)return!1;if(n===ce.GLOBAL){const n=new i.Point(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(n,n),t=n.x,e=n.y}return s.containsPoint(this,{x:t,y:e})}setWidthHeightWithoutTransform(t){this.widthWithoutTransform=t.x2-t.x1,this.heightWithoutTransform=t.y2-t.y1}setAttributesAndPreventAnimate(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;this.setAttributes(t,e,i),this.animates&&this.animates.forEach((e=>{Object.keys(t).forEach((t=>{e.preventAttr(t)}))}))}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,i)}_setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;const n=Object.keys(t);for(let e=0;e<n.length;e++){const i=n[e];this.attribute[i]=t[i]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}setAttribute(t,e,n,s){var r;const a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,s);a?this._setAttributes(a,n,s):i.isNil(null===(r=this.normalAttrs)||void 0===r?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s)):this.normalAttrs[t]=e,"background"===t?this.loadImage(e,!0):"shadowGraphic"===t&&this.setShadowGraphic(e)}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ea;for(let i=0;i<e.length;i++){const n=e[i];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ea;for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(t){const e={type:de.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._updateTag=he.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var i,n;if(0===t&&0===e)return this;const s={type:de.TRANSLATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,ia,s);r&&(t=r.x,e=r.y,delete r.x,delete r.y,this._setAttributes(r));const a=this.attribute,o=a.postMatrix;return o?Xt.transformUtil.fromMatrix(o,o).translate(t,e):(a.x=(null!==(i=a.x)&&void 0!==i?i:oi.x)+t,a.y=(null!==(n=a.y)&&void 0!==n?n:oi.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}translateTo(t,e){const i=this.attribute;if(i.x===t&&i.y===e)return this;const n={type:de.TRANSLATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,ia,n);return s?(this._setAttributes(s,!1,n),this):(i.x=t,i.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}scale(t,e,n){var s,r;if(1===t&&1===e)return this;const a={type:de.SCALE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:n},this.attribute,na,a);o&&(t=o.scaleX,e=o.scaleY,delete o.scaleX,delete o.scaleY,this._setAttributes(o));const l=this.attribute;if(n){let{postMatrix:s}=this.attribute;s||(s=new i.Matrix,l.postMatrix=s),Xt.transformUtil.fromMatrix(s,s).scale(t,e,n)}else l.scaleX=(null!==(s=l.scaleX)&&void 0!==s?s:oi.scaleX)*t,l.scaleY=(null!==(r=l.scaleY)&&void 0!==r?r:oi.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(a),this}scaleTo(t,e){const i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;const n={type:de.SCALE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,na,n);return s?(this._setAttributes(s,!1,n),this):(i.scaleX=t,i.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}rotate(t,e){var n;if(0===t)return this;const s={type:de.ROTATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,sa,s);r&&(delete r.angle,this._setAttributes(r,!1,s));const a=this.attribute;if(e){let{postMatrix:n}=this.attribute;n||(n=new i.Matrix,a.postMatrix=n),Xt.transformUtil.fromMatrix(n,n).rotate(t,e)}else a.angle=(null!==(n=a.angle)&&void 0!==n?n:oi.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}rotateTo(t){const e=this.attribute;if(e.angle===t)return this;const i={type:de.ROTATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,sa,i);return n?(this._setAttributes(n,!1,i),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}skewTo(t,e){return this}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)&&(!!i.isNil(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(t,e,i,n){var s,r;if(i){const e=Object.keys(t),i=this.getNoWorkAnimateAttr(),a={};let o;e.forEach((e=>{i[e]?(o||(o={}),o[e]=t[e]):a[e]=n&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const l=null!==(r=null!==(s=this.context&&this.context.stateAnimateConfig)&&void 0!==s?s:this.stateAnimateConfig)&&void 0!==r?r:Or;this.applyAnimationState(["state"],[{name:"state",animation:{type:"state",to:a,duration:l.duration,easing:l.easing}}]),o&&this.setAttributesAndPreventAnimate(o,!1,{type:de.STATE})}else this.stopStateAnimates(),this.setAttributesAndPreventAnimate(t,!1,{type:de.STATE});this._emitCustomEvent("afterStateUpdate",{type:de.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach((t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((e=>{t[e]=this.normalAttrs[e]}))):Object.keys(t).forEach((t=>{e[t]=this.getNormalAttribute(t)})),this.normalAttrs=e}stopStateAnimates(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"end";this.animates&&this.animates.forEach((e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))}))}getNormalAttribute(t){var e,i;const n=this.attribute[t];return this.animates?null===(e=this.finalAttribute)||void 0===e?void 0:e[t]:null!=n?n:null===(i=this.finalAttribute)||void 0===i?void 0:i[t]}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if(this.currentStates){const n=i.isArray(t)?e=>!t.includes(e):e=>e!==t,s=this.currentStates.filter(n);s.length!==this.currentStates.length&&this.useStates(s,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}addState(t,e,i){var n;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const s=e&&(null===(n=this.currentStates)||void 0===n?void 0:n.length)?this.currentStates.concat([t]):[t];this.useStates(s,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if((null===(i=this.currentStates)||void 0===i?void 0:i.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const n={};t.forEach((e=>{var i;const s=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];s&&Object.assign(n,s)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,t,e)}addUpdateBoundTag(){this._updateTag|=he.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=he.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=he.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&he.UPDATE_SHAPE_AND_BOUNDS)===he.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=he.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=he.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=he.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=he.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=he.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=he.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=he.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&he.UPDATE_LAYOUT)}getAnchor(t,e,i){const n=[0,0],s=()=>{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=s();n[0]=i.x1+(i.x2-i.x1)*e}else n[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,i=s();n[1]=i.y1+(i.y2-i.y1)*e}else n[1]=t[1];return n}doUpdateLocalMatrix(){const{x:t=oi.x,y:e=oi.y,scaleX:n=oi.scaleX,scaleY:s=oi.scaleY,angle:r=oi.angle,scaleCenter:a,anchor:o,postMatrix:l}=this.attribute;let h=[0,0];const c={};if(o&&r&&(h=this.getAnchor(o,c)),!a||1===n&&1===s)i.normalTransform(this._transMatrix,this._transMatrix.reset(),t,e,n,s,r,o&&h);else{const i=this._transMatrix;i.reset(),i.translate(h[0],h[1]),i.rotate(r),i.translate(-h[0],-h[1]),i.translate(t,e),h=this.getAnchor(a,c,!0),Xt.transformUtil.fromMatrix(i,i).scale(n,s,{x:h[0],y:h[1]})}const d=this.getOffsetXY(oi);if(this._transMatrix.e+=d.x,this._transMatrix.f+=d.y,l){const t=ta.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){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.timeline.isGlobal&&(t.setTimeline(e),e.addAnimate(t))}))}this._onSetStage&&this._onSetStage(this,t,e),this.getGraphicService().onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:de.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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:Xt.graphicService.creator.shadowRoot(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 i.isString(t,!0)?this.pathProxy=(new si).fromString(t):this.pathProxy=new si,this.pathProxy}loadImage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const n=t;this.resources||(this.resources=new Map);const s={data:"init",state:null};this.resources.set(n,s),"string"==typeof t?(s.state="loading",t.startsWith("<svg")?(In.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(i.isValidUrl(t)||t.includes("/")||i.isBase64(t))&&(In.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):i.isObject(t)?(s.state="success",s.data=t,this.backgroundImg=this.backgroundImg||e):s.state="fail"}setShadowGraphic(t){t?this.attachShadow().add(t):this.detachShadow()}imageLoadSuccess(t,e,i){if(!this.resources)return;const n=this.resources.get(t);n&&(n.state="success",n.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",this.stopAnimates(),Xt.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,n;if(this._events&&t in this._events){const s=new Rn(t,e);s.bubbles=!1,s.manager=null===(n=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===n?void 0:n.manager,this.dispatchEvent(s)}}toCustomPath(){var t,e,i;const n=null===(i=null===(e=(null===(t=this.stage)||void 0===t?void 0:t.renderService)||Xt.renderService)||void 0===e?void 0:e.drawContribution)||void 0===i?void 0:i.getRenderContribution(this);if(n){const t=new Vr(null,1);return n.drawShape(this,t,0,0,{},{}),t.path}return null}}var la;oa.userSymbolMap={},oa.mixin(Ln),function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(la||(la={}));class ha extends oa{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=yr,this._childUpdateTag=he.UPDATE_BOUNDS}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}setTheme(t){return this.theme||(this.theme=new Mn),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new Mn)}visibleAll(t){this.setAttribute("visible",t),this.forEachChildren((e=>{e.isContainer&&e.visibleAll?e.visibleAll(t):e.setAttribute("visible",t)}))}hideAll(){this.visibleAll(!1)}showAll(){this.visibleAll(!0)}containsPoint(t,e,n){if(n===ce.GLOBAL){const n=new i.Point(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(n,n),this.AABBBounds.contains(n.x,n.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&he.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.getGraphicService().beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),this.getGraphicService().afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),"empty"===this.attribute.boundsMode&&e.clear(),e}doUpdateLocalMatrix(){const{x:t=oi.x,y:e=oi.y,dx:i=oi.dx,dy:n=oi.dy,scaleX:s=oi.scaleX,scaleY:r=oi.scaleY,angle:a=oi.angle,postMatrix:o}=this.attribute;if(0!==t||0!==e||0!==i||0!==n||1!==s||1!==r||0!==a||o)return super.doUpdateLocalMatrix();this._transMatrix.reset()}getGraphicTheme(){return Cn(this).group}updateAABBBounds(t,e,i){const n=i;i=i.clone();const{width:s,height:r,path:a,clip:o=e.clip}=t;if(a&&a.length?a.forEach((t=>{i.union(t.AABBBounds)})):null!=s&&null!=r&&i.set(0,0,Math.max(0,s),Math.max(0,r)),!o){this.forEachChildren((t=>{i.union(t.AABBBounds)}));const{scrollX:e=0,scrollY:n=0}=t;i.translate(e,n)}return Xt.graphicService.updateTempAABBBounds(i),Xt.graphicService.transformAABBBounds(t,i,e,!1,this),n.copy(i),n}doUpdateAABBBounds(){this.updateAABBBoundsStamp++;const t=super.doUpdateAABBBounds();return this.parent&&this.parent.addChildUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),t}clearUpdateBoundTag(){this._updateTag&=he.CLEAR_BOUNDS,this._childUpdateTag&=he.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=he.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&he.UPDATE_BOUNDS||(this._childUpdateTag|=he.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}getTheme(){return this.theme.getTheme(this)}incrementalAppendChild(t){const e=super.appendChild(t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),this.getGraphicService().onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),this.getGraphicService().onClearIncremental(this,this.stage)}_updateChildToStage(t){return this.stage&&t&&t.setStage(this.stage,this.layer),this.addUpdateBoundTag(),t}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertBefore(t,e){return this._updateChildToStage(super.insertBefore(t,e))}insertAfter(t,e){return this._updateChildToStage(super.insertAfter(t,e))}insertInto(t,e){return this._updateChildToStage(super.insertInto(t,e))}removeChild(t){const e=super.removeChild(t);return t.stage=null,this.getGraphicService().onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.forEachChildren((e=>{this.getGraphicService().onRemove(e),t&&e.isContainer&&e.removeAllChild(t)})),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),this.getGraphicService().onSetStage(this,t),this.forEachChildren((e=>{e.setStage(t,this.layer)})))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}tryUpdateGlobalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){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();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&he.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,i){let n=this._getChildByName(t);return n?n.setAttributes(e):(n=Xt.graphicService.creator[i](e),n.name=t,this.add(n)),n}clone(){return new ha(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return ha.NOWORK_ANIMATE_ATTR}release(t){t&&this.forEachChildren((e=>{e.release(t)})),super.release()}}function ca(t){return new ha(t)}function da(t,e){return!(!t&&!e)}function ua(t,e){let n;return n=i.isArray(t)?t.some((t=>t||void 0===t)):!!t,n&&e>0}function pa(t,e,i){return i&&t*e>0}function ga(t,e,i,n,s){return s&&t*e>0&&0!==i&&0!==n}function fa(t,e){return t*e>0}function ma(t,e,i,n){return t*e>0&&0!==i&&0!==n}function ya(t,e,i,n,s,r,a){const o=t-i,l=e-n,h=(a?r:-r)/Math.sqrt(o*o+l*l),c=h*l,d=-h*o,u=t+c,p=e+d,g=i+c,f=n+d,m=(u+g)/2,y=(p+f)/2,b=g-u,v=f-p,x=b*b+v*v,_=s-r,A=u*f-g*p,S=(v<0?-1:1)*Math.sqrt(Math.max(0,_*_*x-A*A));let T=(A*v-b*S)/x,w=(-A*b-v*S)/x;const M=(A*v+b*S)/x,B=(-A*b+v*S)/x,C=T-m,k=w-y,P=M-m,O=B-y;return C*C+k*k>P*P+O*O&&(T=M,w=B),{cx:T,cy:w,x01:-c,y01:-d,x11:T*(s/_-1),y11:w*(s/_-1)}}function ba(t,e,n,s,r){const a=i.abs(n-e),o=t.getParsedCornerRadius(),l=i.isArray(o),{outerDeltaAngle:h,innerDeltaAngle:c,outerStartAngle:d,outerEndAngle:u,innerEndAngle:p,innerStartAngle:g}=t.getParsePadAngle(e,n),f=l?o[0]:o,m=l?o[1]:o,y=l?o[2]:o,b=l?o[3]:o,v=Math.max(m,f),x=Math.max(y,b);let _=v,A=x;const S=r*i.cos(d),T=r*i.sin(d),w=s*i.cos(p),M=s*i.sin(p);let B,C,k,P;if((x>i.epsilon||v>i.epsilon)&&(B=r*i.cos(u),C=r*i.sin(u),k=s*i.cos(g),P=s*i.sin(g),a<i.pi)){const t=function(t,e,n,s,r,a,o,l){const h=n-t,c=s-e,d=o-r,u=l-a;let p=u*h-d*c;return p*p<i.epsilon?[]:(p=(d*(e-a)-u*(t-r))/p,[t+p*h,e+p*c])}(S,T,k,P,B,C,w,M);if(t){const e=S-t[0],n=T-t[1],a=B-t[0],o=C-t[1],l=1/i.sin(i.acos((e*a+n*o)/(i.sqrt(e*e+n*n)*i.sqrt(a*a+o*o)))/2),h=i.sqrt(t[0]*t[0]+t[1]*t[1]);A=i.min(x,(s-h)/(l-1)),_=i.min(v,(r-h)/(l+1))}}return{outerDeltaAngle:h,xors:S,yors:T,xirs:k,yirs:P,xore:B,yore:C,xire:w,yire:M,limitedOcr:_,limitedIcr:A,outerCornerRadiusStart:f,outerCornerRadiusEnd:m,maxOuterCornerRadius:v,maxInnerCornerRadius:x,outerStartAngle:d,outerEndAngle:u,innerDeltaAngle:c,innerEndAngle:p,innerStartAngle:g,innerCornerRadiusStart:b,innerCornerRadiusEnd:y}}function va(t,e,n,s,r,a,o){const{startAngle:l,endAngle:h}=t.getParsedAngle(),c=i.abs(h-l),d=h>l;let u=!1;if(r<a){const t=r;r=a,a=t}if(r<=i.epsilon)e.moveTo(n,s);else if(c>=i.pi2-i.epsilon)e.moveTo(n+r*i.cos(l),s+r*i.sin(l)),e.arc(n,s,r,l,h,!d),a>i.epsilon&&(e.moveTo(n+a*i.cos(h),s+a*i.sin(h)),e.arc(n,s,a,h,l,d));else{const{outerDeltaAngle:c,xors:p,yors:g,xirs:f,yirs:m,limitedOcr:y,outerCornerRadiusStart:b,outerCornerRadiusEnd:v,maxOuterCornerRadius:x,xore:_,yore:A,xire:S,yire:T,outerStartAngle:w,outerEndAngle:M,limitedIcr:B,innerDeltaAngle:C,innerEndAngle:k,innerStartAngle:P,innerCornerRadiusStart:O,innerCornerRadiusEnd:R,maxInnerCornerRadius:L}=ba(t,l,h,a,r);if(c<.001)o&&(o[3]||o[1])&&e.moveTo(n+p,s+g),u=!0;else if(y>i.epsilon){const t=i.min(b,y),a=i.min(v,y),l=ya(f,m,p,g,r,t,Number(d)),h=ya(_,A,S,T,r,a,Number(d));y<x&&t===a?!o||o[0]?(e.moveTo(n+l.cx+l.x01,s+l.cy+l.y01),e.arc(n+l.cx,s+l.cy,y,i.atan2(l.y01,l.x01),i.atan2(h.y01,h.x01),!d)):e.moveTo(n+l.cx+y*i.cos(i.atan2(h.y01,h.x01)),s+l.cy+y*i.sin(i.atan2(h.y01,h.x01))):!o||o[0]?(e.moveTo(n+l.cx+l.x01,s+l.cy+l.y01),t>0&&e.arc(n+l.cx,s+l.cy,t,i.atan2(l.y01,l.x01),i.atan2(l.y11,l.x11),!d),e.arc(n,s,r,i.atan2(l.cy+l.y11,l.cx+l.x11),i.atan2(h.cy+h.y11,h.cx+h.x11),!d),a>0&&e.arc(n+h.cx,s+h.cy,a,i.atan2(h.y11,h.x11),i.atan2(h.y01,h.x01),!d)):a>0?e.moveTo(n+h.cx+a*i.cos(i.atan2(h.y01,h.x01)),s+h.cy+a*i.sin(i.atan2(h.y01,h.x01))):e.moveTo(n+_,s+r*i.sin(M))}else!o||o[0]?(e.moveTo(n+p,s+g),e.arc(n,s,r,w,M,!d)):e.moveTo(n+r*i.cos(M),s+r*i.sin(M));if(!(a>i.epsilon)||C<.001)!o||o[1]?e.lineTo(n+S,s+T):e.moveTo(n+S,s+T),u=!0;else if(B>i.epsilon){const t=i.min(O,B),r=i.min(R,B),l=ya(S,T,_,A,a,-r,Number(d)),h=ya(p,g,f,m,a,-t,Number(d));if(!o||o[1]?e.lineTo(n+l.cx+l.x01,s+l.cy+l.y01):e.moveTo(n+l.cx+l.x01,s+l.cy+l.y01),B<L&&t===r){const t=i.atan2(h.y01,h.x01);!o||o[2]?e.arc(n+l.cx,s+l.cy,B,i.atan2(l.y01,l.x01),t,!d):e.moveTo(n+l.cx+i.cos(t),s+l.cy+i.sin(t))}else!o||o[2]?(r>0&&e.arc(n+l.cx,s+l.cy,r,i.atan2(l.y01,l.x01),i.atan2(l.y11,l.x11),!d),e.arc(n,s,a,i.atan2(l.cy+l.y11,l.cx+l.x11),i.atan2(h.cy+h.y11,h.cx+h.x11),d),t>0&&e.arc(n+h.cx,s+h.cy,t,i.atan2(h.y11,h.x11),i.atan2(h.y01,h.x01),!d)):t>0?e.moveTo(n+h.cx+t*i.cos(i.atan2(h.y01,h.x01)),s+h.cy+t*i.sin(i.atan2(h.y01,h.x01))):e.moveTo(n+f,s+m)}else!o||o[1]?e.lineTo(n+S,s+T):e.moveTo(n+S,s+T),!o||o[2]?e.arc(n,s,a,k,P,d):e.moveTo(n+a*i.cos(P),s+a*i.sin(P))}return o?o[3]&&e.lineTo(n+r*i.cos(l),s+r*i.sin(l)):e.closePath(),u}ha.NOWORK_ANIMATE_ATTR=aa;const xa=Symbol.for("ArcRenderContribution"),_a=Symbol.for("ImageRenderContribution"),Aa=Symbol.for("PolygonRenderContribution"),Sa=Symbol.for("RectRenderContribution"),Ta=Symbol.for("SymbolRenderContribution"),wa=Symbol.for("TextRenderContribution"),Ma=Symbol.for("InteractiveSubRenderContribution");function Ba(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function Ca(t,e,i){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?(arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}var ka=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Pa=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Oa=function(t,e){return function(i,n){e(i,n,t)}};function Ra(t,e,i){var n;const{x:s=i.x,y:r=i.y,z:a=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:f=i.angle,anchor3d:m=e.attribute.anchor,anchor:y}=e.attribute,b=[0,0,0];if(m){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;b[0]=i.x1+(i.x2-i.x1)*t}else b[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;b[1]=i.x1+(i.x2-i.x1)*t}else b[1]=m[1];b[2]=null!==(n=m[2])&&void 0!==n?n:0}if(Rr(t),Lr(t,t,[s+o,r+l,a+h]),Lr(t,t,[b[0],b[1],b[2]]),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[4],a=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]=r*s+h*n,t[5]=a*s+c*n,t[6]=o*s+d*n,t[7]=l*s+u*n,t[8]=h*s-r*n,t[9]=c*s-a*n,t[10]=d*s-o*n,t[11]=u*s-l*n}(t,t,g),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[0],a=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]=r*s-h*n,t[1]=a*s-c*n,t[2]=o*s-d*n,t[3]=l*s-u*n,t[8]=r*n+h*s,t[9]=a*n+c*s,t[10]=o*n+d*s,t[11]=l*n+u*s}(t,t,p),Lr(t,t,[-b[0],-b[1],b[2]]),function(t,e,i){const n=i[0],s=i[1],r=i[2];t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*s,t[5]=e[5]*s,t[6]=e[6]*s,t[7]=e[7]*s,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[c,d,u]),f){const i=jr.allocate(),n=[0,0];if(y){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;n[0]=i.x1+(i.x2-i.x1)*t}else n[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;n[1]=i.x1+(i.x2-i.x1)*t}else n[1]=m[1]}Lr(i,i,[n[0],n[1],0]),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[0],a=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]=r*s+h*n,t[1]=a*s+c*n,t[2]=o*s+d*n,t[3]=l*s+u*n,t[4]=h*s-r*n,t[5]=c*s-a*n,t[6]=d*s-o*n,t[7]=u*s-l*n}(i,i,f),Lr(i,i,[-n[0],-n[1],0]),Ir(t,t,i)}}let La=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new Ht(["graphic"]),onSetStage:new Ht(["graphic","stage"]),onRemove:new Ht(["graphic"]),onRelease:new Ht(["graphic"]),onAddIncremental:new Ht(["graphic","group","stage"]),onClearIncremental:new Ht(["graphic","group","stage"]),beforeUpdateAABBBounds:new Ht(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new Ht(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"]),clearAABBBounds:new Ht(["graphic","stage","aabbBounds"])},this.tempAABBBounds1=new i.AABBBounds,this.tempAABBBounds2=new i.AABBBounds}onAttributeUpdate(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}onSetStage(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}onRemove(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}onRelease(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(t)}onAddIncremental(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,i,n){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,n)}afterUpdateAABBBounds(t,e,i,n,s){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,n,s)}clearAABBBounds(t,e,i){this.hooks.clearAABBBounds.taps.length&&this.hooks.clearAABBBounds.call(t,e,i)}updatePathProxyAABBBounds(t,e){const i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;const n=new Jt(t);return be(i.commandList,n,0,0),!0}updateHTMLTextAABBBounds(t,e,n,s){const{textAlign:r,textBaseline:a}=t;if(null!=t.forceBoundsHeight){const e=i.isNumber(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),s=Ca(a,e,e);n.set(n.x1,s,n.x2,s+e)}if(null!=t.forceBoundsWidth){const e=i.isNumber(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),s=Ba(r,e);n.set(s,n.y1,s+e,n.y2)}}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,n,s,r){if(!e.empty()){const{scaleX:i=n.scaleX,scaleY:r=n.scaleY,stroke:a=n.stroke,shadowBlur:o=n.shadowBlur,lineWidth:l=n.lineWidth,pickStrokeBuffer:h=n.pickStrokeBuffer,strokeBoundsBuffer:c=n.strokeBoundsBuffer}=t,d=this.tempAABBBounds1,u=this.tempAABBBounds2;if(a&&l){or(d,(l+h)/Math.abs(i+r),s,c),e.union(d),d.setValue(u.x1,u.y1,u.x2,u.y2)}if(o){const{shadowOffsetX:s=n.shadowOffsetX,shadowOffsetY:a=n.shadowOffsetY}=t;or(d,o/Math.abs(i+r)*2,!1,c+1),d.translate(s,a),e.union(d)}}if(this.combindShadowAABBBounds(e,r),e.empty())return;let a=!0;const o=r.transMatrix;r&&r.isContainer&&(a=!(1===o.a&&0===o.b&&0===o.c&&1===o.d&&0===o.e&&0===o.f)),a&&i.transformBoundsWithMatrix(e,e,o)}validCheck(t,e,i,n){if(!n)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(n.shadowRoot||n.isContainer)return!0;const{visible:s=e.visible}=t;return!(!n.valid||!s)||(i.empty()||(n.parent&&i.transformWithMatrix(n.parent.globalTransMatrix),this.clearAABBBounds(n,n.stage,i),i.clear()),!1)}updateTempAABBBounds(t){const e=this.tempAABBBounds1,i=this.tempAABBBounds2;return e.setValue(t.x1,t.y1,t.x2,t.y2),i.setValue(t.x1,t.y1,t.x2,t.y2),{tb1:e,tb2:i}}};La=ka([wt(),Oa(0,St(Cr)),Pa("design:paramtypes",[Object])],La);const Ia=(t,e,i)=>{const{outerBorder:n,shadowBlur:s=e.shadowBlur}=t;if(n){const t=e.outerBorder,{distance:r=t.distance,lineWidth:a=t.lineWidth}=n;i.expand(r+(s+a)/2)}return i};class Ea{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i,n){if(t.xOffset="left"===e||"start"===e?0:"center"===e?t.width/-2:"right"===e||"end"===e?-t.width:0,"top"===i)t.yOffset=0;else if("middle"===i)t.yOffset=t.height/-2;else if("alphabetic"===i){let e=.79;if(1===n.length){const t=n[0];e=t.ascent/(t.ascent+t.descent)}t.yOffset=t.height*-e}else t.yOffset=-t.height;return t}GetLayoutByLines(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",r=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;const{lineWidth:o,suffixPosition:l="end",measureMode:h=Yt.actualBounding,keepCenterInLine:c=!1}=null!=a?a:{};t=t.map((t=>t.toString()));const d=[],u=[0,0];if("number"==typeof o&&o!==1/0){let e;for(let i=0,n=t.length;i<n;i++){const n=this.textMeasure.measureTextPixelADscentAndWidth(t[i],this.textOptions,h);let a=t[i].toString();if(n.width>o){const n=this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,o,s,r,l);a=n.str,e=n.width}else e=n.width;d.push({str:a,width:e,ascent:n.ascent,descent:n.descent,keepCenterInLine:c})}u[0]=o}else{let e,i,n=0;for(let s=0,r=t.length;s<r;s++){i=t[s];const r=this.textMeasure.measureTextPixelADscentAndWidth(t[s],this.textOptions,h);e=r.width,n=Math.max(n,e),d.push({str:i,width:e,ascent:r.ascent,descent:r.descent,keepCenterInLine:c})}u[0]=n}u[1]=d.length*n,u[0]=d.reduce(((t,e)=>Math.max(t,e.width)),0);const p={xOffset:0,yOffset:0,width:u[0],height:u[1]};return this.LayoutBBox(p,e,i,d),this.layoutWithBBox(p,d,e,i,n)}layoutWithBBox(t,e,i,n,s){const r=[0,0],a=e.length*s;"top"===n||("middle"===n?r[1]=(t.height-a)/2:"bottom"===n&&(r[1]=t.height-a));for(let a=0;a<e.length;a++)this.lineOffset(t,e[a],i,n,s,r);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:s,textAlign:i,textBaseline:n}}lineOffset(t,e,i,n,s,r){if("left"===i||"start"===i?e.leftOffset=0:"center"===i?e.leftOffset=(t.width-e.width)/2:"right"!==i&&"end"!==i||(e.leftOffset=t.width-e.width),e.topOffset=s/2+(e.ascent-e.descent)/2+r[1],!e.keepCenterInLine){const t=0,i=e.ascent+e.descent+t;if(i<s-t&&("bottom"===n?e.topOffset+=(s-i)/2:"top"===n&&(e.topOffset-=(s-i)/2)),"alphabetic"===n){const t=s/(e.ascent+e.descent);e.topOffset=s/2+(e.ascent-e.descent)/2*t+r[1]}}return r[1]+=s,e}}const Da=["text","maxLineWidth","maxWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...ea];class Fa extends oa{get font(){const t=this.getGraphicTheme();return this._font||(this._font=i.getContextFont(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,i=this.getGraphicTheme(),n=this.getMaxWidth(i);return Number.isFinite(n)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:i.text).toString()}get clipedWidth(){return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){var t,e;const i=this.getGraphicTheme(),n=this.attribute,s=this.getMaxWidth(i);if(!Number.isFinite(s))return!1;const{text:r}=this.attribute;if(this.tryUpdateAABBBounds(),null===(e=null===(t=this.cache)||void 0===t?void 0:t.layoutData)||void 0===e?void 0:e.lines){let t="";return this.cache.layoutData.lines.forEach((e=>{t+=e.str})),(Array.isArray(r)?r.join(""):r)!==t}return"vertical"===n.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map((t=>t.text)).join("")!==n.text.toString():null!=this.clipedText&&this.clipedText!==n.text.toString()}get multilineLayout(){return this.tryUpdateAABBBounds(),this.cache.layoutData}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16}),this.type="text",this.numberType=Br,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return i.isArray(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}getGraphicTheme(){return Cn(this).text}doUpdateOBBBounds(){const t=this.getGraphicTheme();this._OBBBounds.clear();const e=this.attribute,{angle:n=t.angle}=e;if(!n){const t=this.AABBBounds;return this._OBBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._OBBBounds}this.obbText||(this.obbText=new Fa({})),this.obbText.setAttributes(Object.assign(Object.assign({},e),{angle:0}));const s=this.obbText.AABBBounds,{x:r,y:a}=e,o={x:(s.x1+s.x2)/2,y:(s.y1+s.y2)/2},l=i.rotatePoint(o,n,{x:r,y:a});return this._OBBBounds.copy(s),this._OBBBounds.translate(l.x-o.x,l.y-o.y),this._OBBBounds.angle=n,this._OBBBounds}updateAABBBounds(t,e,n){const{text:s=e.text}=this.attribute;Array.isArray(s)?this.updateMultilineAABBBounds(s):this.updateSingallineAABBBounds(s);const{tb1:r}=Xt.graphicService.updateTempAABBBounds(n),{scaleX:a=e.scaleX,scaleY:o=e.scaleY,shadowBlur:l=e.shadowBlur,strokeBoundsBuffer:h=e.strokeBoundsBuffer}=t;if(l){or(r,l/Math.abs(a+o),!0,h),n.union(r)}return Xt.graphicService.combindShadowAABBBounds(n,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||Xt.graphicService.updateHTMLTextAABBBounds(t,e,n),this.widthWithoutTransform=n.x2-n.x1,this.heightWithoutTransform=n.y2-n.y1,i.transformBoundsWithMatrix(n,n,this.transMatrix),n}updateSingallineAABBBounds(t){this.updateMultilineAABBBounds([t]);const e=this.cache.layoutData;if(e&&e.lines&&e.lines.length){const t=e.lines[0];this.cache.clipedText=t.str,this.cache.clipedWidth=t.width}return this._AABBBounds}updateMultilineAABBBounds(t){const e=this.getGraphicTheme(),{direction:i=e.direction,underlineOffset:n=e.underlineOffset}=this.attribute,s="horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===i&&n&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+n),s}guessLineHeightBuf(t){return t?.1*t:0}updateHorizontalMultilineAABBBounds(t){var e;const i=this.getGraphicTheme(),n=this.attribute,{fontFamily:s=i.fontFamily,textAlign:r=i.textAlign,textBaseline:a=i.textBaseline,fontSize:o=i.fontSize,fontWeight:l=i.fontWeight,ellipsis:h=i.ellipsis,maxLineWidth:c,stroke:d=i.stroke,wrap:u=i.wrap,measureMode:p=i.measureMode,lineWidth:g=i.lineWidth,whiteSpace:f=i.whiteSpace,suffixPosition:m=i.suffixPosition,ignoreBuf:y=i.ignoreBuf,keepCenterInLine:b=i.keepCenterInLine}=n,v=y?0:this.guessLineHeightBuf(o),x=this.getLineHeight(n,i,v);if("normal"===f||u)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(g/2),this._AABBBounds}const _=Xt.graphicUtil.textMeasure,A=new Ea(s,{fontSize:o,fontWeight:l,fontFamily:s,lineHeight:x},_).GetLayoutByLines(t,r,a,x,!0===h?i.ellipsis:h||void 0,!1,{lineWidth:c,suffixPosition:m,measureMode:p,keepCenterInLine:b}),{bbox:S}=A;return this.cache.layoutData=A,this.clearUpdateShapeTag(),this._AABBBounds.set(S.xOffset,S.yOffset,S.xOffset+S.width,S.yOffset+S.height),d&&this._AABBBounds.expand(g/2),this._AABBBounds}updateWrapAABBBounds(t){var e,n,s;const r=this.getGraphicTheme(),{fontFamily:a=r.fontFamily,textAlign:o=r.textAlign,textBaseline:l=r.textBaseline,fontSize:h=r.fontSize,ellipsis:c=r.ellipsis,maxLineWidth:d,stroke:u=r.stroke,lineWidth:p=r.lineWidth,wordBreak:g=r.wordBreak,fontWeight:f=r.fontWeight,ignoreBuf:m=r.ignoreBuf,measureMode:y=r.measureMode,suffixPosition:b=r.suffixPosition,heightLimit:v=0,lineClamp:x,keepCenterInLine:_=r.keepCenterInLine}=this.attribute,A=m?0:this.guessLineHeightBuf(h),S=this.getLineHeight(this.attribute,r,A);if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),u&&this._AABBBounds.expand(p/2),this._AABBBounds}const T=Xt.graphicUtil.textMeasure,w={fontSize:h,fontWeight:f,fontFamily:a,lineHeight:S},M=new Ea(a,w,T),B=i.isArray(t)?t.map((t=>t.toString())):[t.toString()],C=[],k=[0,0];let P=1/0;if(v>0&&(P=Math.max(Math.floor(v/S),1)),x&&(P=Math.min(P,x)),"number"==typeof d&&d!==1/0){if(d>0)for(let t=0;t<B.length;t++){const e=B[t];let i=!0;if(t===P-1){const i=T.clipTextWithSuffix(e,w,d,c,!1,b,t!==B.length-1),n=T.measureTextPixelADscentAndWidth(i.str,w,y);C.push({str:i.str,width:i.width,ascent:n.ascent,descent:n.descent,keepCenterInLine:_});break}const r=T.clipText(e,w,d,"break-all"!==g,"keep-all"===g);if(""!==e&&""===r.str||r.wordBreaked){if(c){const t=T.clipTextWithSuffix(e,w,d,c,!1,b);r.str=null!==(n=t.str)&&void 0!==n?n:"",r.width=null!==(s=t.width)&&void 0!==s?s:0}else r.str="",r.width=0;i=!1}const a=T.measureTextPixelADscentAndWidth(r.str,w,y);C.push({str:r.str,width:r.width,ascent:a.ascent,descent:a.descent,keepCenterInLine:_});let o=r.str.length;if(!r.wordBreaked||""!==e&&""===r.str||(i=!0,o=r.wordBreaked),r.str.length===e.length);else if(i){let i=e.substring(o);"keep-all"===g&&(i=i.replace(/^\s+/g,"")),B.splice(t+1,0,i)}}let t=0;C.forEach((e=>{t=Math.max(t,e.width)})),k[0]=t}else{let t,e,i=0;for(let n=0,s=B.length;n<s;n++){if(n===P-1){const t=T.clipTextWithSuffix(B[n],w,d,c,!1,b),e=T.measureTextPixelADscentAndWidth(t.str,w,y);C.push({str:t.str,width:t.width,ascent:e.ascent,descent:e.descent,keepCenterInLine:_}),i=Math.max(i,t.width);break}e=B[n],t=T.measureTextWidth(e,w),i=Math.max(i,t);const s=T.measureTextPixelADscentAndWidth(e,w,y);C.push({str:e,width:t,ascent:s.ascent,descent:s.descent,keepCenterInLine:_})}k[0]=i}k[1]=C.length*S;const O={xOffset:0,yOffset:0,width:k[0],height:k[1]};M.LayoutBBox(O,o,l,C);const R=M.layoutWithBBox(O,C,o,l,S);return this.cache.layoutData=R,this.clearUpdateShapeTag(),this._AABBBounds.set(O.xOffset,O.yOffset,O.xOffset+O.width,O.yOffset+O.height),u&&this._AABBBounds.expand(p/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e,n;const s=this.getGraphicTheme(),r=Xt.graphicUtil.textMeasure;let a;const o=this.attribute,{maxLineWidth:l=s.maxLineWidth,ellipsis:h=s.ellipsis,fontFamily:c=s.fontFamily,fontSize:d=s.fontSize,fontWeight:u=s.fontWeight,stroke:p=s.stroke,lineWidth:g=s.lineWidth,verticalMode:f=s.verticalMode,suffixPosition:m=s.suffixPosition}=o,y=this.getLineHeight(o,s,0);let{textAlign:b=s.textAlign,textBaseline:v=s.textBaseline}=o;if(!f){const t=b;b=null!==(e=Fa.baselineMapAlign[v])&&void 0!==e?e:"left",v=null!==(n=Fa.alignMapBaseline[t])&&void 0!==n?n:"top"}if(a=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=i.max(e,a)}));const t=Ba(b,a),e=this.cache.verticalList.length*y,n=Ca(v,e,d);return this._AABBBounds.set(n,t,n+e,t+a),p&&this._AABBBounds.expand(g/2),this._AABBBounds}const x=t.map((t=>function(t){const e=[];let i=0,n="";for(let s=0;s<t.length;s++)pr(t[s])?i?n+=t[s]:(i=1,n=t[s]):(i&&(e.push({text:n,direction:cr.VERTICAL}),n="",i=0),e.push({text:t[s],direction:cr.HORIZONTAL}));return n&&e.push({text:n,direction:cr.VERTICAL}),e}(t.toString())));x.forEach(((t,e)=>{if(Number.isFinite(l))if(h){const i=!0===h?s.ellipsis:h,n=r.clipTextWithSuffixVertical(t,{fontSize:d,fontWeight:u,fontFamily:c},l,i,!1,m);x[e]=n.verticalList,a=n.width}else{const i=r.clipTextVertical(t,{fontSize:d,fontWeight:u,fontFamily:c},l,!1);x[e]=i.verticalList,a=i.width}else a=0,t.forEach((t=>{const e=t.direction===cr.HORIZONTAL?d:r.measureTextWidth(t.text,{fontSize:d,fontWeight:u,fontFamily:c});a+=e,t.width=e}))})),this.cache.verticalList=x,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=i.max(e,a)}));const _=Ba(b,a),A=this.cache.verticalList.length*y,S=Ca(v,A,d);return this._AABBBounds.set(S,_,S+A,_+a),p&&this._AABBBounds.expand(g/2),this._AABBBounds}getMaxWidth(t){var e,i;const n=this.attribute;return null!==(i=null!==(e=n.maxLineWidth)&&void 0!==e?e:n.maxWidth)&&void 0!==i?i:t.maxWidth}getLineHeight(t,e,i){var n;return null!==(n=Hn(t.lineHeight,t.fontSize||e.fontSize))&&void 0!==n?n:(t.fontSize||e.fontSize)+i}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Da;return super.needUpdateTags(t,e)}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Da;return super.needUpdateTag(t,e)}_interpolate(t,e,i,n,s){"text"===t&&(s.text=n)}clone(){return new Fa(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Fa.NOWORK_ANIMATE_ATTR}getBaselineMapAlign(){return Fa.baselineMapAlign}getAlignMapBaseline(){return Fa.alignMapBaseline}}function ja(t){return new Fa(t)}Fa.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},aa),Fa.baselineMapAlign={top:"left",bottom:"right",middle:"center"},Fa.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const Ua=["symbolType","size",...ea];let Na=class t extends oa{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"}),this.type="symbol",this.numberType=Mr}getParsedPath(){return this.shouldUpdateShape()&&(this._parsedPath=this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}getParsedPath2D(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=null;try{n=new Path2D}catch(t){return null}const s=this.getParsedPath();if(!s)return null;s.draw(n,i,t,e)}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return i.isArray(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const{symbolType:t="circle"}=this.attribute;return super.parsePath(t)}getGraphicTheme(){return Cn(this).symbol}updateAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i)||(n?this.updateSymbolAABBBoundsImprecise(t,e,i):this.updateSymbolAABBBoundsAccurate(t,e,i));const{tb1:s,tb2:r}=Xt.graphicService.updateTempAABBBounds(i);((t,e,i)=>{const{outerBorder:n,shadowBlur:s=e.shadowBlur,strokeBoundsBuffer:r=e.strokeBoundsBuffer}=t;if(n){const t=e.outerBorder,{distance:a=t.distance,lineWidth:o=t.lineWidth}=n;or(i,a+(s+o)/2,!0,r)}})(t,e,s),i.union(s),s.setValue(r.x1,r.y1,r.x2,r.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,this.x1WithoutTransform=i.x1,this.y1WithoutTransform=i.y1;const{lineJoin:a=e.lineJoin}=t;return Xt.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateSymbolAABBBoundsImprecise(t,e,n){const{size:s=e.size}=t;if(i.isArray(s))n.set(-s[0]/2,-s[1]/2,s[0]/2,s[1]/2);else{const t=s/2;n.set(-t,-t,t,t)}return n}updateSymbolAABBBoundsAccurate(t,e,i){const{size:n=e.size}=t;return this.getParsedPath().bounds(n,i),i}needUpdateTags(t){return super.needUpdateTags(t,Ua)}needUpdateTag(t){return super.needUpdateTag(t,Ua)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,n=i.isArray(e)?e:[e,e];return t.path?(new si).fromCustomPath2D(t.path,0,0,n[0],n[1]):(new si).fromString(t.pathStr,0,0,n[0],n[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Wa(t){return new Na(t)}Na.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},aa);const za=["segments","points","curveType","curveTension",...ea];let Va=class t extends oa{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),this.type="line",this.numberType=vr}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!(!t||t.length<=1)}_interpolate(t,e,i,n,s){"points"===t&&(s.points=Gn(i,n,e))}getGraphicTheme(){return Cn(this).line}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i):this.updateLineAABBBoundsByPoints(t,e,i)),Xt.graphicService.updateTempAABBBounds(i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:n=e.lineJoin}=t;return Xt.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updateLineAABBBoundsByPoints(t,e,i,n){const{points:s=e.points,connectedType:r}=t,a=i;return s.forEach((t=>{!1===t.defined&&"connect"!==r||a.add(t.x,t.y)})),a}updateLineAABBBoundsBySegments(t,e,i,n){const{segments:s=e.segments,connectedType:r}=t,a=i;return s.forEach((t=>{t.points.forEach((t=>{!1===t.defined&&"connect"!==r||a.add(t.x,t.y)}))})),a}needUpdateTags(t){return super.needUpdateTags(t,za)}needUpdateTag(t){return super.needUpdateTag(t,za)}toCustomPath(){let t=super.toCustomPath();if(t)return t;const e=this.attribute;t=new si;const i=e.segments,n=e=>{if(e&&e.length){let i=!0;e.forEach((e=>{!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),i=!1)}))}};return i&&i.length?i.forEach((t=>{n(t.points)})):e.points&&n(e.points),t}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Ga(t){return new Va(t)}Va.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},aa);const Ha=["width","x1","y1","height","cornerRadius",...ea];class Xa extends oa{constructor(t){super(t),this.type="rect",this.numberType=Sr}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return Cn(this).rect}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){let{width:e,height:n}=t;const{x1:s,y1:r,x:a,y:o}=t;e=null!=e?e:s-a,n=null!=n?n:r-o,(isFinite(e)||isFinite(n)||isFinite(a)||isFinite(o))&&i.set(0,0,e||0,n||0)}const{tb1:n,tb2:s}=Xt.graphicService.updateTempAABBBounds(i);return Ia(t,e,n),i.union(n),n.setValue(s.x1,s.y1,s.x2,s.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,Xt.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,Ha)}needUpdateTag(t){return super.needUpdateTag(t,Ha)}toCustomPath(){let t=super.toCustomPath();if(t)return t;const e=this.attribute,{x:n,y:s,width:r,height:a}=(t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=i.isNil(t.width)?t.x1-t.x:t.width,n=i.isNil(t.height)?t.y1-t.y:t.height,s=0,r=0;return e<0?(s=e,e=-e):Number.isNaN(e)&&(e=0),n<0?(r=n,n=-n):Number.isNaN(n)&&(n=0),{x:s,y:r,width:e,height:n}})(e);return t=new si,t.moveTo(n,s),t.rect(n,s,r,a),t}clone(){return new Xa(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Xa.NOWORK_ANIMATE_ATTR}}function Ya(t){return new Xa(t)}Xa.NOWORK_ANIMATE_ATTR=aa;const qa=[[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]];class $a extends Xa{constructor(t){super(t),this.type="rect3d",this.numberType=Tr}findFace(){const t={polygons:[],vertices:[],edges:[]},e=this.getGraphicTheme(),{x1:n,y1:s,x:r,y:a,length:o=i.min(e.width,e.height)}=this.attribute;let{width:l,height:h}=this.attribute;l=null!=l?l:n-r,h=null!=h?h:s-a;for(let e=0;e<qa.length;e++){const i=qa[e];t.vertices.push([i[0]*l,i[1]*h,i[2]*o])}return t.polygons.push({polygon:[0,1,5,4],normal:[0,-1,0]}),t.polygons.push({polygon:[2,3,7,6],normal:[0,1,0]}),t.polygons.push({polygon:[4,7,3,0],normal:[-1,0,0]}),t.polygons.push({polygon:[1,2,6,5],normal:[1,0,0]}),t.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),t.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),t.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],t}getNoWorkAnimateAttr(){return $a.NOWORK_ANIMATE_ATTR}}function Ka(t){return new $a(t)}$a.NOWORK_ANIMATE_ATTR=aa;class Za{constructor(t,e,i,n,s,r,a,o,l,h,c,d,u,p){this.left=t,this.top=e,this.width=i,this.height=n,this.actualHeight=0,this.bottom=e+n,this.right=t+i,this.ellipsis=s,this.wordBreak=r,this.verticalDirection=a,this.lines=[],this.globalAlign=o,this.globalBaseline=l,this.layoutDirection=h,this.directionKey=Li[this.layoutDirection],this.isWidthMax=c,this.isHeightMax=d,this.singleLine=u,p?(p.clear(),this.icons=p):this.icons=new Map}draw(t,e){const{width:i,height:n}=this.getActualSize(),s=this.isWidthMax?Math.min(this.width,i):this.width||i||0;let r=this.isHeightMax?Math.min(this.height,n):this.height||n||0;r=Math.min(r,n);let a=0;switch(this.globalBaseline){case"top":a=0;break;case"middle":a=-r/2;break;case"bottom":a=-r}let o=0;"right"===this.globalAlign||"end"===this.globalAlign?o=-s:"center"===this.globalAlign&&(o=-s/2);let l=this[this.directionKey.height];this.singleLine&&(l=this.lines[0].height+1);let h=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=l&&0!==l)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i];if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+l)return h;let r=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(r=!0,h=!0),this.lines[i].draw(t,r,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}else{const i=Math.floor((l-this.actualHeight)/2);"vertical"===this.layoutDirection?o+=i:a+=i;for(let i=0;i<this.lines.length;i++)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i],r=l-this.lines[i].top-this.lines[i].height;if(0===l)this.lines[i].draw(t,!1,o,r+a,this.ellipsis,e);else{if(r+s>this[this.directionKey.top]+l||r<this[this.directionKey.top])return h;{let n=!1;this.ellipsis&&this.lines[i+1]&&r-this.lines[i+1].height<this[this.directionKey.top]&&(n=!0,h=!0),this.lines[i].draw(t,n,o,r+a,this.ellipsis,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(o+=this.lines[0].height+1);for(let i=0;i<this.lines.length;i++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(o-=this.lines[i].height+this.lines[i].top);const{top:n,height:s}=this.lines[i];if(0===l)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e);else{if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+l)return h;{let n=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(n=!0,h=!0),this.lines[i].draw(t,n,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}}}}return h}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let i=0;i<this.lines.length;i++){const n=this.lines[i];n.actualWidth>t&&(t=n.actualWidth),e+=n.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:i,height:n}=this.getRawActualSize();this.width,this.height;let s=this[this.directionKey.height];if(this.singleLine&&(s=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=s&&0!==s)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i];if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+s);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+s){const n=!0===this.ellipsis?"...":this.ellipsis||"",s=this.lines[i].getWidthWithEllips(n);s>t&&(t=s),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else{Math.floor((s-this.actualHeight)/2);for(let i=0;i<this.lines.length;i++)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else if("bottom"===this.verticalDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i],a=s-this.lines[i].top-this.lines[i].height;if(0===s)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(a+r>this[this.directionKey.top]+s||a<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[i+1]&&a-this.lines[i+1].height<this[this.directionKey.top]){const n=!0===this.ellipsis?"...":this.ellipsis||"",s=this.lines[i].getWidthWithEllips(n);s>t&&(t=s),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i];if(0===s)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+s);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+s){const n=!0===this.ellipsis?"...":this.ellipsis||"",s=this.lines[i].getWidthWithEllips(n);s>t&&(t=s),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}function Ja(t,e,i,n){const s=Math.round(t),r=Math.round(i),a=Math.round(e),o=Math.round(n);return{left:t>s?s:s-.5,top:i>r?r:r-.5,right:a>e?a:a+.5,bottom:o>n?o:o+.5}}class Qa{constructor(t,e,i,n){var s,r;this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic",this.ascentDescentMode=n;const a=Hn(i.lineHeight,this.fontSize);this.lineHeight="number"==typeof a?a>this.fontSize?a:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:o,height:l,descent:h,width:c}=zi(t,i,this.ascentDescentMode);let d=0,u=0,p=0;this.height>l&&(d=(this.height-l)/2,u=Math.ceil(d),p=Math.floor(d)),"top"===this.textBaseline?(this.ascent=d,this.descent=l-d):"bottom"===this.textBaseline?(this.ascent=l-d,this.descent=d):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=o+u,this.descent=h+p),this.length=t.length,this.width=c||0,this.text=t||"",this.newLine=e||!1,this.character=i,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,this.space=i.space,this.dx=null!==(s=i.dx)&&void 0!==s?s:0,this.dy=null!==(r=i.dy)&&void 0!==r?r:0,"vertical"===i.direction&&(this.direction=i.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height),this.ellipsisStr="..."}updateWidth(){const{width:t}=zi(this.text,this.character,this.ascentDescentMode);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}drawBackground(t,e,i,n,s,r,a){if(""===this.text||"\n"===this.text||!this.character.background||this.character.backgroundOpacity&&!(this.character.backgroundOpacity>0))return;let o=e+i,l=this.text,h=this.left+n;o+=this.top;let c=this.direction;if(this.verticalEllipsis)l=this.ellipsisStr,c="vertical",o-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)l+=this.ellipsisStr,"right"!==r&&"end"!==r||(h-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Ni(l,("vertical"===c?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,l.length-1);if(l=l.slice(0,t),l+=this.ellipsisStr,"right"===r||"end"===r)if("vertical"===c);else{const{width:e}=zi(this.text.slice(t),this.character,this.ascentDescentMode);h-=this.ellipsisWidth-e}}}const d=Ja(h,h+(this.widthOrigin||this.width),e,e+a);return Object.assign(Object.assign({},d),{fillStyle:this.character.background,globalAlpha:this.character.backgroundOpacity})}draw(t,e,i,n,s,r,a){var o;let l=e+i,h=this.text,c=this.left+n+(null!==(o=this.space)&&void 0!==o?o:0)/2;l+=this.top;let d=this.direction;if(this.verticalEllipsis)h=this.ellipsisStr,d="vertical",l-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)h+=this.ellipsisStr,"right"!==r&&"end"!==r||(c-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Ni(h,("vertical"===d?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,h.length-1);if(h=h.slice(0,t),h+=this.ellipsisStr,"right"===r||"end"===r)if("vertical"===d);else{const{width:e}=zi(this.text.slice(t),this.character,this.ascentDescentMode);c-=this.ellipsisWidth-e}}}switch(this.character.script){case"super":l-=this.ascent*(1/3);break;case"sub":l+=this.descent/2}"vertical"===d&&(t.save(),t.rotateAbout(Math.PI/2,c,l),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(c,l),c=0,l=0);const{lineWidth:u=1}=this.character;if(this.character.stroke&&u&&t.strokeText(h,c+this.dx,l+this.dy),this.character.fill&&t.fillText(h,c+this.dx,l+this.dy),this.character.fill)if(this.character.lineThrough||this.character.underline){if(this.character.underline){const e=1+l,i=Ja(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}if(this.character.lineThrough){const e=1+l-this.ascent/2,i=Ja(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l-this.ascent/2,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}}else if("underline"===this.character.textDecoration){const e=1+l,i=Ja(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}else if("line-through"===this.character.textDecoration){const e=1+l-this.ascent/2,i=Ja(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l-this.ascent/2,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}"vertical"===d&&t.restore()}getWidthWithEllips(t){let e=this.text;const i="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return i;if("add"===this.ellipsis)return i+this.ellipsisWidth;if("replace"===this.ellipsis){const t=Ni(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+=this.ellipsisStr;const{width:n}=zi(this.text.slice(t),this.character,this.ascentDescentMode);return i+this.ellipsisWidth-n}return i}}const to=["width","height","image",...ea];class eo extends oa{constructor(t){super(t),this.type="image",this.numberType=br,this.loadImage(this.attribute.image)}getImageElement(){const{image:t}=this.attribute;if(!t||!this.resources)return null;const e=this.resources.get(t);return"success"!==e.state?null:e.data}get width(){return this.tryUpdateAABBBounds(),this._actualWidth}get height(){return this.tryUpdateAABBBounds(),this._actualHeight}get repeatX(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,i){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()})),this.addUpdateBoundTag()}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}setAttributes(t,e,i){return t.image&&this.loadImage(t.image),super.setAttributes(t,e,i)}setAttribute(t,e,i,n){return"image"===t&&this.loadImage(e),super.setAttribute(t,e,i,n)}getGraphicTheme(){return Cn(this).image}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const{maxWidth:n=e.maxWidth,maxHeight:s=e.maxHeight}=t;let{width:r,height:a}=t;if(null==r||null==a){const t=this.getImageElement();if(t){const e=t.width,i=t.height;if(null!=r)a=r*(i/e);else if(null!=a)r=a*(e/i);else{const t=e/i;t>n/s?(r=n,a=n/t):(a=s,r=s*t)}}else r=n,a=s}this._actualWidth=r,this._actualHeight=a,i.set(0,0,r,a)}const{tb1:n,tb2:s}=Xt.graphicService.updateTempAABBBounds(i);return Ia(t,e,n),i.union(n),n.setValue(s.x1,s.y1,s.x2,s.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,Xt.graphicService.transformAABBBounds(t,i,e,!1,this),i}getDefaultAttribute(t){return Bi[t]}needUpdateTags(t){return super.needUpdateTags(t,to)}needUpdateTag(t){return super.needUpdateTag(t,to)}clone(){return new eo(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return eo.NOWORK_ANIMATE_ATTR}}function io(t){return new eo(t)}eo.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},aa);class no extends eo{constructor(t){if(super(t),this._x=0,this._y=0,this._hovered=!1,this._marginArray=[0,0,0,0],"always"===t.backgroundShowMode&&(this._hovered=!0),t.margin){const e=Un(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,n)=>{if(i.isArray(n)&&-1!==n.indexOf("margin")||"margin"===n)if(e.margin){const t=Un(e.margin);this._marginArray="number"==typeof t?[t,t,t,t]:t}else this._marginArray=[0,0,0,0]}}get width(){var t;return(null!==(t=this.attribute.width)&&void 0!==t?t:0)+this._marginArray[1]+this._marginArray[3]}get height(){var t;return(null!==(t=this.attribute.height)&&void 0!==t?t:0)+this._marginArray[0]+this._marginArray[2]}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();const{width:t=Bi.width,height:e=Bi.height}=this.attribute,{backgroundWidth:i=t,backgroundHeight:n=e}=this.attribute,s=(i-t)/2,r=(n-e)/2;return this._AABBBounds.expand([0,2*s,2*r,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class so{constructor(t,e,i,n,s,r,a,o){this.left=t,this.width=e,this.baseline=i,this.ascent=n,this.descent=s,this.top=i-n,this.paragraphs=r.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof no?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=a,this.directionKey=Li[this.direction],this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof Qa){const e=ji.exec(t.text);0!==(null==e?void 0:e.index)&&(t.text=t.text.slice(null==e?void 0:e.index),t.updateWidth())}this.actualWidth+=t[this.directionKey.width],l=Math.max(t[this.directionKey.height],l)})),this.height=l,this.blankWidth=o?0:this.width-this.actualWidth,this.calcOffset(e,o)}calcOffset(t,e){const i=this.directionKey,n=this.height;let s=this.left,r=0;this.actualWidth<t&&!e&&("right"===this.textAlign||"end"===this.textAlign?s=t-this.actualWidth:"center"===this.textAlign?s=(t-this.actualWidth)/2:"justify"===this.textAlign&&(this.paragraphs.length<2?s=(t-this.actualWidth)/2:r=(t-this.actualWidth)/(this.paragraphs.length-1))),this.paragraphs.map((function(t){t instanceof no?(t["_"+i.x]=s,s+=t[i.width]+r,t["_"+i.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?n-t.height:(n-t.height)/2):(t[i.left]=s,s+=t[i.width]+r)}))}draw(t,e,i,n,s,r){if(s&&(e||this.paragraphs.some((t=>t.overflow)))){let t=!0,i=!1;for(let e=this.paragraphs.length-1;e>=0;e--){const n=this.paragraphs[e];if(n.overflow)t=t&&""===n.text;else if(t){i=!0;break}}let n=0;if(!i)for(let t=this.paragraphs.length-1;t>=0;t--){const i=this.paragraphs[t];if(i.overflow){if(""===i.text)break;continue}if(i instanceof no)break;if("vertical"===this.direction&&"vertical"!==i.direction){i.verticalEllipsis=!0;break}const r=!0===s?"...":s||"";i.ellipsisStr=r;const{width:a}=zi(r,i.character,i.ascentDescentMode),o=a||0;if(o<=this.blankWidth+n){e&&(i.ellipsis="add");break}if(o<=this.blankWidth+n+i.width){i.ellipsis="replace",i.ellipsisWidth=o,i.ellipsisOtherParagraphWidth=this.blankWidth+n;break}i.ellipsis="hide",n+=i.width}}let a="",o=-1,l=[];const h=[l];this.paragraphs.forEach(((e,s)=>{if(e instanceof no)return;const r=e.drawBackground(t,n,this.ascent,i,0===s,this.textAlign,this.height);r&&(a===r.fillStyle&&o===r.globalAlpha||(l=[],h.push(l),a=r.fillStyle,o=r.globalAlpha),l.push(r))})),h.forEach((e=>{if(0===e.length)return;const i=e[0],n=e[e.length-1];t.fillStyle=i.fillStyle,t.globalAlpha=i.globalAlpha,t.fillRect(i.left,i.top,n.right-i.left,n.bottom-i.top)})),this.paragraphs.forEach(((e,s)=>{if(e instanceof no)return e.setAttributes({x:i+e._x,y:n+e._y}),void r(e,t,i+e._x,n+e._y,this.ascent);const a={x1:this.left,y1:this.top,x2:this.left+this.actualWidth,y2:this.top+this.height};(function(t,e){const i=e&&e.stroke||Ei;if(!i)return void(t.globalAlpha=0);const{strokeOpacity:n=1,opacity:s=1}=e;t.globalAlpha=n*s,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=i,Ui(t,e)})(t,e.character),function(t,e,i){const n=e&&e.fill||Ii;if(!n)return void(t.globalAlpha=0);const{fillOpacity:s=1,opacity:r=1}=e;t.globalAlpha=s*r,t.fillStyle=i?Ri(t,n,{AABBBounds:i}):n,Ui(t,e)}(t,e.character,a),e.draw(t,n,this.ascent,i,0===s,this.textAlign,this.height)}))}getWidthWithEllips(t){let e=0;for(let i=this.paragraphs.length-1;i>=0;i--){const n=this.paragraphs[i];if(n instanceof no)break;const{width:s}=zi(t,n.character,n.ascentDescentMode),r=s||0;if(r<=this.blankWidth+e){n.ellipsis="add",n.ellipsisWidth=r;break}if(r<=this.blankWidth+e+n.width){n.ellipsis="replace",n.ellipsisWidth=r,n.ellipsisOtherParagraphWidth=this.blankWidth+e;break}n.ellipsis="hide",e+=n.width}let i=0;return this.paragraphs.forEach(((t,e)=>{i+=t instanceof no?t.width:t.getWidthWithEllips(this.direction)})),i}}class ro{constructor(t){this.frame=t,this.width=this.frame.width,this.height=this.frame.height,this.lineWidth=0,this.y=this.frame.top,this.maxAscent=0,this.maxDescent=0,this.maxAscentForBlank=0,this.maxDescentForBlank=0,this.lineBuffer=[],this.direction=t.layoutDirection,this.directionKey=Li[this.direction]}store(t){if(t instanceof no){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,i=0;"top"===t.attribute.textBaseline?(e=0,i=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,i=0):(e=t.height/2,i=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,i)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}send(){if(0===this.lineBuffer.length)return;const t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,i=new so(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(i),this.frame.actualHeight+=i.height,this.y+=i.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t instanceof no?"horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):0===this.lineBuffer.length?(this.store(t),this.send()):(this.send(),this.deal(t)):"number"!=typeof this.width||this.width<0||(t.newLine&&this.send(),(0!==t.text.length||this.newLine)&&("horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t,e)))}cut(t,e){const i=this[this.directionKey.width]-this.lineWidth||0,n=Math.ceil(i/t[this.directionKey.width]*t.length)||0,s=Ni(t.text,i,t.character,n,"break-word"===this.frame.wordBreak);if(0!==s){const[i,n]=function(t,e){const i=t.text.slice(0,e),n=t.text.slice(e);return[new Qa(i,t.newLine,t.character,t.ascentDescentMode),new Qa(n,!0,t.character,t.ascentDescentMode)]}(t,s);this.store(i),e?this.send():this.deal(n)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}let ao=!1;try{ao=Intl&&"function"==typeof Intl.Segmenter}catch(t){ao=!1}const oo=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize","fontFamily","fontStyle","fontWeight","lineWidth","opacity","fillOpacity","strokeOpacity",...ea];class lo extends oa{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=wr,this.onBeforeAttributeUpdate=(t,e,i)=>{for(const i in t)if("hoverIconId"===i){if(t[i]===e[i])continue;const n=this._frameCache.icons.get(t[i]);this.updateHoverIconState(n)}}}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:Mi.width}set width(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:Mi.height}set height(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get maxWidth(){return this.attribute.maxWidth}set maxWidth(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}get maxHeight(){return this.attribute.maxHeight}set maxHeight(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}get ellipsis(){var t;return null!==(t=this.attribute.ellipsis)&&void 0!==t?t:Mi.ellipsis}set ellipsis(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}get wordBreak(){var t;return null!==(t=this.attribute.wordBreak)&&void 0!==t?t:Mi.wordBreak}set wordBreak(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}get verticalDirection(){var t;return null!==(t=this.attribute.verticalDirection)&&void 0!==t?t:Mi.verticalDirection}set verticalDirection(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}get textAlign(){var t;return null!==(t=this.attribute.textAlign)&&void 0!==t?t:Mi.textAlign}set textAlign(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}get textBaseline(){var t;return null!==(t=this.attribute.textBaseline)&&void 0!==t?t:Mi.textBaseline}set textBaseline(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}get textConfig(){var t;return null!==(t=this.attribute.textConfig)&&void 0!==t?t:Mi.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}getGraphicTheme(){return Cn(this).richtext}static AllSingleCharacter(t){return t.lines?t.lines.every((t=>t.paragraphs.every((t=>!(t.text&&i.isString(t.text)&&lo.splitText(t.text).length>1))))):t.every((t=>t.isComposing||!(t.text&&i.isString(t.text)&&lo.splitText(t.text).length>1)))}static splitText(t){if(ao){const e=new Intl.Segmenter(void 0,{granularity:"grapheme"}),i=[];for(const{segment:n}of e.segment(t))i.push(n);return i}return Array.from(t)}static TransformTextConfig2SingleCharacter(t){const e=[];return t.forEach((t=>{const n=lo.splitText(t.text.toString());if(i.isString(t.text)&&n.length>1)for(let i=0;i<n.length;i++){const s=n[i];e.push(Object.assign(Object.assign({},t),{text:s}))}else e.push(t)})),e}updateAABBBounds(t,e,i){var n,s,r,a;const{width:o=e.width,height:l=e.height,maxWidth:h=e.maxWidth,maxHeight:c=e.maxHeight,textAlign:d=e.textAlign,textBaseline:u=(null!==(s=null!==(n=t.textBaseline)&&void 0!==n?n:e.textBaseline)&&void 0!==s?s:"top"),editOptions:p}=t;if(o>0&&l>0)i.set(0,0,o,l);else{const t=this.getFrameCache(),{width:e,height:n}=t.getActualSize();let s=o||e||0,r=l||n||0;r="number"==typeof c&&r>c?c:r||0,s="number"==typeof h&&s>h?h:s||0,i.set(0,0,s,r)}p&&p.keepHeightWhileEmpty&&!i.height()&&!(null===(r=t.textConfig)||void 0===r?void 0:r.length)&&(i.y2=i.y1+(null!==(a=t.fontSize)&&void 0!==a?a:12),i.x2=i.x1+2);let g=0;switch(u){case"top":g=0;break;case"middle":g=-i.height()/2;break;case"bottom":g=-i.height()}let f=0;switch(d){case"left":f=0;break;case"center":f=-i.width()/2;break;case"right":f=-i.width()}return i.translate(f,g),Xt.graphicService.updateTempAABBBounds(i),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||Xt.graphicService.updateHTMLTextAABBBounds(t,e,i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,Xt.graphicService.transformAABBBounds(t,i,e,!1,this),0===i.width()&&0===i.height()&&i.clear(),i}needUpdateTags(t){return super.needUpdateTags(t,oo)}needUpdateTag(t){return super.needUpdateTag(t,oo)}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}get cliped(){const t=this.getFrameCache();if(t.actualHeight>t.height)return!0;const{disableAutoWrapLine:e}=this.attribute;if(e)for(let e=0;e<t.lines.length;e++){const i=t.lines[e];for(let t=0;t<i.paragraphs.length;t++){const e=i.paragraphs[t];if(e.overflow&&""!==e.text)return!0}}return!1}combinedStyleToCharacter(t){const{fill:e,stroke:i,fontSize:n,fontFamily:s,fontStyle:r,fontWeight:a,lineWidth:o,opacity:l,fillOpacity:h,lineHeight:c,strokeOpacity:d,upgradeAttrs:u}=this.attribute,p=Object.assign({fill:e,stroke:i,fontSize:n,fontFamily:s,fontStyle:r,fontWeight:a,lineWidth:o,opacity:l,fillOpacity:h,strokeOpacity:d},t);return(null==u?void 0:u.lineHeight)&&(p.lineHeight=c),p}doUpdateFrameCache(t){var e;const{maxWidth:n,maxHeight:s,width:r,height:a,ellipsis:o,wordBreak:l,verticalDirection:h,textAlign:c,textBaseline:d,layoutDirection:u,singleLine:p,disableAutoWrapLine:g,editable:f,ascentDescentMode:m,upgradeAttrs:y}=this.attribute,b=y&&y.multiBreakLine;let{textConfig:v=[]}=this.attribute;f&&v.length>0&&!lo.AllSingleCharacter(v)&&(v=lo.TransformTextConfig2SingleCharacter(v),this.attribute.textConfig=v);const x=[],_=null!=t?t:v;for(let t=0;t<_.length;t++)if("image"in _[t]){const e=this.combinedStyleToCharacter(_[t]);e.lineWidth=void 0;const i=e.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(e.id);if(i)x.push(i);else{const t=new no(e);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=e.id,x.push(t)}}else{const e=this.combinedStyleToCharacter(_[t]);if(i.isNumber(e.text)&&(e.text=`${e.text}`),e.text&&e.text.includes("\n")){const i=e.text.split("\n");for(let n=0;n<i.length;n++)if(0===n)x.push(new Qa(i[n],!1,e,m));else if(i[n]||t===_.length-1)x.push(new Qa(i[n],!0,e,m));else{const e=this.combinedStyleToCharacter(_[t+1]);x.push(new Qa(i[n],!0,e,m))}}else e.text&&x.push(new Qa(e.text,!1,e,m))}const A="number"==typeof n&&Number.isFinite(n)&&n>0,S="number"==typeof s&&Number.isFinite(s)&&s>0,T="number"==typeof r&&Number.isFinite(r)&&r>0&&(!A||r<=n),w="number"==typeof a&&Number.isFinite(a)&&a>0&&(!S||a<=s),M=new Za(0,0,(T?r:A?n:0)||0,(w?a:S?s:0)||0,o,l,h,c,d,u||"horizontal",!T&&A,!w&&S,p||!1,null===(e=this._frameCache)||void 0===e?void 0:e.icons),B=new ro(M);if(B.newLine=b,g){let t=0,e=!1;for(let i=0;i<x.length;i++){const n=x[i];e?(n.overflow=!0,n.left=1/0,n.top=1/0,!n.newLine&&M.lines[M.lines.length-1].paragraphs.push(n)):B.deal(n,!0),M.lines.length!==t&&(t=M.lines.length,B.lineBuffer.length=0,n.overflow=!0,n.left=1e3,n.top=1e3,M.lines[M.lines.length-1].paragraphs.push(n),e=!0),n.newLine&&(e=!1,B.lineWidth=0),B.send()}}else for(let t=0;t<x.length;t++)B.deal(x[t]);if(B.send(),!("horizontal"===M.layoutDirection?T:w)){const t=M.getActualSizeWidthEllipsis();let e="horizontal"===M.layoutDirection?t.width:t.height;("horizontal"===M.layoutDirection?A:S)&&(e=Math.min(e,"horizontal"===M.layoutDirection?n:s)),M.lines.forEach((function(t){t.calcOffset(e,!1)}))}b&&M.lines.forEach((t=>{const e=t.paragraphs;t.paragraphs=t.paragraphs.filter((t=>""!==t.text)),0===t.paragraphs.length&&e.length&&(e[0].text="\n",t.paragraphs.push(e[0]))})),this._frameCache=M}clone(){return new lo(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e),this.getFrameCache().icons.forEach((i=>{i.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{const e=this.pickIcon(t.global);e&&e===this._currentHoverIcon||(e?this.setAttribute("hoverIconId",e.richtextId):!e&&this._currentHoverIcon&&this.setAttribute("hoverIconId",void 0))})),this.addEventListener("pointerleave",(t=>{this._currentHoverIcon&&this.setAttribute("hoverIconId",void 0)}))}updateHoverIconState(t){var e,i,n,s,r;t?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=t,this._currentHoverIcon.setHoverState(!0),null===(i=this.stage)||void 0===i||i.setCursor(t.attribute.cursor),null===(n=this.stage)||void 0===n||n.renderNextFrame()):(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(s=this.stage)||void 0===s||s.setCursor(),null===(r=this.stage)||void 0===r||r.renderNextFrame())}pickIcon(t){const e=this.getFrameCache(),{e:i,f:n}=this.globalTransMatrix;let s;return e.icons.forEach(((e,r)=>{var a,o;const l=e.AABBBounds.clone();l.translate(e._marginArray[3],e._marginArray[0]),l.containsPoint({x:t.x-i,y:t.y-n})&&(s=e,s.globalX=(null!==(a=s.attribute.x)&&void 0!==a?a:0)+i+e._marginArray[3],s.globalY=(null!==(o=s.attribute.y)&&void 0!==o?o:0)+n+e._marginArray[0])})),s}getNoWorkAnimateAttr(){return lo.NOWORK_ANIMATE_ATTR}}function ho(t){return new lo(t)}lo.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},aa);const co=["path","customPath",...ea];class uo extends oa{constructor(t){super(t),this.type="path",this.numberType=xr}get pathShape(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{path:t}=this.attribute;return null!=t&&""!==t}getParsedPathShape(){const t=this.getGraphicTheme();if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof si?e.path:(i.isNil(this.cache)&&this.doUpdatePathShape(),this.cache instanceof si?this.cache:t.path)}getGraphicTheme(){return Cn(this).path}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const t=this.getParsedPathShape();i.union(t.getBounds())}const{tb1:n,tb2:s}=Xt.graphicService.updateTempAABBBounds(i);Ia(t,e,n),i.union(n),n.setValue(s.x1,s.y1,s.x2,s.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:r=e.lineJoin}=t;return Xt.graphicService.transformAABBBounds(t,i,e,"miter"===r,this),i}doUpdateAABBBounds(t){return this.doUpdatePathShape(),super.doUpdateAABBBounds(t)}doUpdatePathShape(){const t=this.attribute;i.isString(t.path,!0)?this.cache=(new si).fromString(t.path):t.customPath&&(this.cache=new si,t.customPath(this.cache,this))}needUpdateTags(t){return super.needUpdateTags(t,co)}needUpdateTag(t){return super.needUpdateTag(t,co)}toCustomPath(){return(new si).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new uo(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return uo.NOWORK_ANIMATE_ATTR}}function po(t){return new uo(t)}uo.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},aa);const go=["segments","points","curveType","curveTension",...ea];class fo extends oa{constructor(t){super(t),this.type="area",this.numberType=mr}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&0!==t.length}getGraphicTheme(){return Cn(this).area}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i):this.updateAreaAABBBoundsByPoints(t,e,i)),Xt.graphicService.updateTempAABBBounds(i),this.setWidthHeightWithoutTransform(i);const{lineJoin:n=e.lineJoin}=t;return Xt.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updateAreaAABBBoundsByPoints(t,e,i,n){const{points:s=e.points}=t,r=i;return s.forEach((t=>{var e,i;r.add(t.x,t.y),r.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)})),r}updateAreaAABBBoundsBySegments(t,e,i,n){const{segments:s=e.segments}=t,r=i;return s.forEach((t=>{t.points.forEach((t=>{var e,i;r.add(t.x,t.y),r.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)}))})),r}_interpolate(t,e,i,n,s){"points"===t&&(s.points=Gn(i,n,e))}needUpdateTags(t){return super.needUpdateTags(t,go)}needUpdateTag(t){return super.needUpdateTag(t,go)}toCustomPath(){let t=super.toCustomPath();if(t)return t;t=new si;const e=this.attribute,i=e.segments,n=e=>{if(e&&e.length){let i=!0;const n=[];if(e.forEach((e=>{var s,r;!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),n.push({x:null!==(s=e.x1)&&void 0!==s?s:e.x,y:null!==(r=e.y1)&&void 0!==r?r:e.y}),i=!1)})),n.length){for(let e=n.length-1;e>=0;e--)t.lineTo(n[e].x,n[e].y);t.closePath()}}};return e.points?n(e.points):i&&i.length&&i.forEach((t=>{n(t.points)})),t}clone(){return new fo(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return fo.NOWORK_ANIMATE_ATTR}}fo.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},aa);const mo=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...ea];class yo extends oa{constructor(t){super(t),this.type="arc",this.numberType=gr}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:i,innerRadius:n}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(n)}getParsedCornerRadius(){const t=this.getGraphicTheme(),{cornerRadius:e=t.cornerRadius,innerPadding:n=t.innerPadding,outerPadding:s=t.outerPadding}=this.attribute;let{outerRadius:r=t.outerRadius,innerRadius:a=t.innerRadius}=this.attribute;if(r+=s,a-=n,0===e||"0%"===e)return 0;const o=Math.abs(r-a),l=t=>Math.min(i.isNumber(t,!0)?t:o*parseFloat(t)/100,o/2);if(i.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:n=t.endAngle}=this.attribute;const{cap:s=t.cap}=this.attribute,r=n-e>=0?1:-1,a=n-e;if(e=i.clampAngleByRadian(e),n=e+a,s&&i.abs(a)<i.pi2-i.epsilon){let a=1,o=1;s.length&&(a=Number(s[0]),o=Number(s[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>i.epsilon&&l>i.epsilon)return{startAngle:e-r*p*a,endAngle:n+r*p*o,sc:r*p*a,ec:r*p*o}}return{startAngle:e,endAngle:n}}getParsePadAngle(t,e){const n=this.getGraphicTheme(),{innerPadding:s=n.innerPadding,outerPadding:r=n.outerPadding,padAngle:a=n.padAngle}=this.attribute;let{outerRadius:o=n.outerRadius,innerRadius:l=n.innerRadius}=this.attribute;o+=r,l-=s;const{padRadius:h=i.sqrt(o*o+l*l)}=this.attribute,c=i.abs(e-t);let d=t,u=e,p=t,g=e;const f=a/2;let m=c,y=c;if(f>i.epsilon&&h>i.epsilon){const n=e>t?1:-1;let s=i.asin(Number(h)/l*i.sin(f)),r=i.asin(Number(h)/o*i.sin(f));return(m-=2*s)>i.epsilon?(s*=n,p+=s,g-=s):(m=0,p=g=(t+e)/2),(y-=2*r)>i.epsilon?(r*=n,d+=r,u-=r):(y=0,d=u=(t+e)/2),{outerStartAngle:d,outerEndAngle:u,innerStartAngle:p,innerEndAngle:g,innerDeltaAngle:m,outerDeltaAngle:y}}return{outerStartAngle:d,outerEndAngle:u,innerStartAngle:p,innerEndAngle:g,innerDeltaAngle:m,outerDeltaAngle:y}}getGraphicTheme(){return Cn(this).arc}updateAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i)||(n?this.updateArcAABBBoundsImprecise(t,e,i):this.updateArcAABBBoundsAccurate(t,e,i));const{tb1:s,tb2:r}=Xt.graphicService.updateTempAABBBounds(i);Ia(t,e,s),i.union(s),s.setValue(r.x1,r.y1,r.x2,r.y2),this.setWidthHeightWithoutTransform(i);const{lineJoin:a=e.lineJoin}=t;return Xt.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateArcAABBBoundsImprecise(t,e,i){let{outerRadius:n=e.outerRadius,innerRadius:s=e.innerRadius}=t;const{outerPadding:r=e.outerPadding,innerPadding:a=e.innerPadding}=t;return n+=r,s-=a,n<s&&(n=s),i.set(-n,-n,n,n),i}updateArcAABBBoundsAccurate(t,e,n){let{outerRadius:s=e.outerRadius,innerRadius:r=e.innerRadius}=t;const{outerPadding:a=e.outerPadding,innerPadding:o=e.innerPadding}=t;if(s+=a,r-=o,s<r){const t=s;s=r,r=t}let{endAngle:l=e.endAngle,startAngle:h=e.startAngle}=t;if(h>l){const t=h;h=l,l=t}return s<=i.epsilon?n.set(0,0,0,0):Math.abs(l-h)>i.pi2-i.epsilon?n.set(-s,-s,s,s):(zn(h,l,s,n),zn(h,l,r,n)),n}needUpdateTags(t){return super.needUpdateTags(t,mo)}needUpdateTag(t){return super.needUpdateTag(t,mo)}toCustomPath(){var t,e,n,s;let r=super.toCustomPath();if(r)return r;const a=this.attribute,{startAngle:o,endAngle:l}=this.getParsedAngle();let h=(null!==(t=a.innerRadius)&&void 0!==t?t:0)-(null!==(e=a.innerPadding)&&void 0!==e?e:0),c=(null!==(n=a.outerRadius)&&void 0!==n?n:0)-(null!==(s=a.outerPadding)&&void 0!==s?s:0);const d=i.abs(l-o),u=l>o;if(c<h){const t=c;c=h,h=t}if(r=new si,c<=i.epsilon)r.moveTo(0,0);else if(d>=i.pi2-i.epsilon)r.moveTo(0+c*i.cos(o),0+c*i.sin(o)),r.arc(0,0,c,o,l,!u),h>i.epsilon&&(r.moveTo(0+h*i.cos(l),0+h*i.sin(l)),r.arc(0,0,h,l,o,u));else{const t=c*i.cos(o),e=c*i.sin(o),n=h*i.cos(l),s=h*i.sin(l);r.moveTo(0+t,0+e),r.arc(0,0,c,o,l,!u),r.lineTo(0+n,0+s),r.arc(0,0,h,l,o,u),r.closePath()}return r}clone(){return new yo(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return yo.NOWORK_ANIMATE_ATTR}}function bo(t){return new yo(t)}yo.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},aa);class vo extends yo{constructor(t){super(t),this.type="arc3d",this.numberType=fr}updateAABBBounds(t,e,i){const n=this.stage;if(!n||!n.camera)return i;const{outerRadius:s=e.outerRadius,height:r=0}=t,a=s+r;return i.setValue(-a,-a,a,a),Xt.graphicService.updateTempAABBBounds(i),Xt.graphicService.transformAABBBounds(t,i,e,!1,this),i}getNoWorkAnimateAttr(){return vo.NOWORK_ANIMATE_ATTR}}function xo(t){return new vo(t)}vo.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},aa);const _o=["points","cornerRadius",...ea];class Ao extends oa{constructor(t){super(t),this.type="polygon",this.numberType=_r}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}getGraphicTheme(){return Cn(this).polygon}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||this.updatePolygonAABBBoundsImprecise(t,e,i),Xt.graphicService.updateTempAABBBounds(i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:n=e.lineJoin}=t;return Xt.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updatePolygonAABBBoundsImprecise(t,e,i){const{points:n=e.points}=t;return n.forEach((t=>{i.add(t.x,t.y)})),i}_interpolate(t,e,i,n,s){"points"===t&&(s.points=Gn(i,n,e))}needUpdateTags(t){return super.needUpdateTags(t,_o)}needUpdateTag(t){return super.needUpdateTag(t,_o)}toCustomPath(){const t=this.attribute.points,e=new si;return t.forEach(((t,i)=>{0===i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}clone(){return new Ao(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Ao.NOWORK_ANIMATE_ATTR}}function So(t){return new Ao(t)}Ao.NOWORK_ANIMATE_ATTR=aa;class To extends Ao{constructor(t){super(t),this.type="pyramid3d",this.numberType=Ar}updateAABBBounds(t,e,i){const n=this.stage;return n&&n.camera?(this.findFace().vertices.forEach((t=>{const e=t[0],n=t[1];i.add(e,n)})),Xt.graphicService.updateTempAABBBounds(i),Xt.graphicService.transformAABBBounds(t,i,e,!1,this),i):i}findFace(){const{points:t}=this.attribute,e=t.map(((e,i)=>{const n=3===i?t[0]:t[i+1],s=e.x-n.x;return 0===s?0:(e.y-n.y)/s})),n=t.map((t=>({p:t,d:0})));let s=!1,r=0;for(let t=0;t<e.length-1;t++){for(let a=t+1;a<e.length;a++){if(e[t]===e[a]){s=!0;const e=i.PointService.distancePP(n[t].p,n[t+1].p);n[t].d=e,n[t+1].d=e,r=i.max(r,e);const o=i.PointService.distancePP(n[a].p,n[a+1].p);n[a].d=o,n[a+1].d=o,r=i.max(r,o)}if(s)break}if(s)break}for(let e=t.length-1;e>=0;e--){const i=t[e];n.unshift({p:i,d:0})}for(let e=0;e<t.length;e++){const i=(r-n[e+t.length].d)/2;n[e].d+=i,n[e+t.length].d+=i}const a={polygons:[],vertices:[],edges:[]};return n.forEach((t=>{a.vertices.push([t.p.x,t.p.y,t.d])})),a.polygons.push({polygon:[0,4,5,1],normal:[0,-1,0]}),a.polygons.push({polygon:[7,6,2,3],normal:[0,1,0]}),a.polygons.push({polygon:[0,4,7,3],normal:[-1,0,0]}),a.polygons.push({polygon:[1,5,6,2],normal:[1,0,0]}),a.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),a.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),a.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],a}_isValid(){return super._isValid()&&4===this.attribute.points.length}getNoWorkAnimateAttr(){return To.NOWORK_ANIMATE_ATTR}}function wo(t){return new To(t)}To.NOWORK_ANIMATE_ATTR=aa;class Mo extends ha{constructor(t){super({x:0,y:0}),this.type="shadowroot",this.shadowHost=t}clearUpdateBoundTag(){super.clearUpdateBoundTag(),this.shadowHost&&this.shadowHost.clearUpdateBoundTag()}addUpdateBoundTag(){super.addUpdateBoundTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}addUpdateShapeAndBoundsTag(){super.addUpdateShapeAndBoundsTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}tryUpdateGlobalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){const e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}doUpdateGlobalMatrix(){if(this.shadowHost){const t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}function Bo(t){return new Mo(t)}const Co=new class{constructor(){this.store=new Map}RegisterGraphicCreator(t,e){this.store.set(t,e),this[t]=e}CreateGraphic(t,e){const i=this.store.get(t);return i?i(e):null}};let ko;function Po(t){return ko||(ko=Co.CreateGraphic("text",{})),ko.initAttributes(t),ko.AABBBounds}var Oo=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Ro=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Lo=function(t,e){return function(i,n){e(i,n,t)}};class Io{constructor(){this.time=ge.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,d,u){var p;const{background:g,backgroundOpacity:f=(null!==(p=t.attribute.fillOpacity)&&void 0!==p?p:l.backgroundOpacity),opacity:m=l.opacity,backgroundMode:y=l.backgroundMode,backgroundFit:b=l.backgroundFit,backgroundKeepAspectRatio:v=l.backgroundKeepAspectRatio,backgroundScale:x=l.backgroundScale,backgroundOffsetX:_=l.backgroundOffsetX,backgroundOffsetY:A=l.backgroundOffsetY,backgroundClip:S=l.backgroundClip}=t.attribute;if(g)if(t.backgroundImg&&t.resources){const s=t.resources.get(g);if("success"!==s.state||!s.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=Cn(t.parent).group,{scrollX:n=i.scrollX,scrollY:s=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(n,s)}S&&e.clip();const r=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,n,l),e.globalAlpha=f*m,this.doDrawImage(e,s.data,r,{backgroundMode:y,backgroundFit:b,backgroundKeepAspectRatio:v,backgroundScale:x,backgroundOffsetX:_,backgroundOffsetY:A}),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,l),e.globalAlpha=f*m,e.fillStyle=g,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,n){const{backgroundMode:s,backgroundFit:r,backgroundKeepAspectRatio:a,backgroundScale:o=1,backgroundOffsetX:l=0,backgroundOffsetY:h=0}=n,c=i.width(),d=i.height();let u=c,p=d;if("no-repeat"===s)if(r)if(a){const n=Math.max(c/e.width,d/e.height);t.drawImage(e,i.x1+l,i.y1+h,e.width*n*o,e.height*n*o)}else t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{const n=e.width*o,s=e.height*o;t.drawImage(e,i.x1+l,i.y1+h,n,s)}else{if(r&&"repeat"!==s&&(e.width||e.height)){const i=e.width,n=e.height;"repeat-x"===s?(u=i*(d/n),p=d):"repeat-y"===s&&(p=n*(c/i),u=c);const r=t.dpr,a=_n.allocate({width:u,height:p,dpr:r}),o=a.getContext("2d");o&&(o.inuse=!0,o.clearMatrix(),o.setTransformForCurrent(!0),o.clearRect(0,0,u,p),o.drawImage(e,0,0,u,p),e=a.nativeCanvas),_n.free(a)}const n=t.dpr,a=t.createPattern(e,s);a.setTransform&&a.setTransform(new DOMMatrix([1/n,0,0,1/n,0,0])),t.fillStyle=a,t.translate(i.x1,i.y1),t.fillRect(0,0,c,d),t.translate(-i.x1,-i.y1)}}}const Eo=new Io;let Do=class{constructor(t){this.subRenderContribitions=t,this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,d,u){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,n,s,r,a,o,l,h,c,d,u)}))}};Do=Oo([wt(),Lo(0,St(Wt)),Lo(0,Mt(Ma)),Ro("design:paramtypes",[Object])],Do);const Fo=new class{constructor(){this.time=ge.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,d,u){var p,g;const{clipConfig:f}=t.attribute;if(!f)return;const m=t.getClipPath();if(!m)return;const y=!(c||d),b=t.AABBBounds,v=null!==(p=t.attribute.width)&&void 0!==p?p:b.width(),x=null!==(g=t.attribute.height)&&void 0!==g?g:b.height();y&&e.save(),e.beginPath(),!1===m.draw(e,[v,x],i+v/2,n+x/2,0)&&e.closePath(),c&&c(e,t.attribute,l,!0),y&&e.clip()}};const jo=new class{constructor(){this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,d,u){const{clipConfig:p}=t.attribute;p&&t.getClipPath()&&(c||d||e.restore())}};const Uo=new class{constructor(){this.time=ge.afterFillStroke,this.useStyle=!0,this.order=10,this._tempSymbolGraphic=null}createCommonPattern(t,e,i,n,s){const r=(t-2*e)/2,a=n.dpr,o=_n.allocate({width:t,height:t,dpr:a}),l=o.getContext("2d");if(!l)return null;l.inuse=!0,l.clearMatrix(),l.setTransformForCurrent(!0),l.clearRect(0,0,t,t),s(r,l);const h=n.createPattern(o.nativeCanvas,"repeat");return h.setTransform&&h.setTransform(new DOMMatrix([1/a,0,0,1/a,0,0])),_n.free(o),h}createCirclePattern(t,e,n,s){return this.createCommonPattern(t,e,n,s,((t,e)=>{e.fillStyle=n,e.arc(t,t,t,0,i.pi2),e.fill()}))}createDiamondPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{const s=t/2,r=s;n.fillStyle=i,n.moveTo(s,r-e),n.lineTo(e+s,r),n.lineTo(s,r+e),n.lineTo(s-e,r),n.closePath(),n.fill()}))}createRectPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const s=e,r=s;n.fillStyle=i,n.fillRect(s,r,2*t,2*t)}))}createVerticalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,s)=>{const r=e;s.fillStyle=i,s.fillRect(r,0,2*n,t)}))}createHorizontalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,s)=>{const r=e;s.fillStyle=i,s.fillRect(0,r,t,2*n)}))}createBiasLRLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(0,0),n.lineTo(t,t);const s=t/2,r=-s;n.moveTo(s,r),n.lineTo(s+t,r+t),n.moveTo(-s,-r),n.lineTo(-s+t,-r+t),n.stroke()}))}createBiasRLLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(t,0),n.lineTo(0,t);const s=t/2,r=s;n.moveTo(t+s,r),n.lineTo(s,r+t),n.moveTo(t-s,-r),n.lineTo(-s,-r+t),n.stroke()}))}createGridPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const s=e,r=s;n.fillStyle=i,n.fillRect(s,r,t,t),n.fillRect(s+t,r+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,n,s,r,a,o,l,h,c,d,u){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=l.texture,textureColor:g=l.textureColor,textureSize:f=l.textureSize,texturePadding:m=l.texturePadding}=t.attribute;p&&this.drawTexture(p,t,e,i,n,l,g,f,m)}drawTexture(t,e,i,n,s,r,a,o,l){var h;const{textureRatio:c=r.textureRatio,textureOptions:d=null}=e.attribute;let u=this.textureMap.get(t);if(!u)switch(t){case"circle":u=this.createCirclePattern(o,l,a,i);break;case"diamond":u=this.createDiamondPattern(o,l,a,i);break;case"rect":u=this.createRectPattern(o,l,a,i);break;case"vertical-line":u=this.createVerticalLinePattern(o,l,a,i);break;case"horizontal-line":u=this.createHorizontalLinePattern(o,l,a,i);break;case"bias-lr":u=this.createBiasLRLinePattern(o,l,a,i);break;case"bias-rl":u=this.createBiasRLLinePattern(o,l,a,i);break;case"grid":u=this.createGridPattern(o,l,a,i)}if(d&&d.dynamicTexture){const{gridConfig:u={},useNewCanvas:p}=d,g=e.AABBBounds;n=g.x1,s=g.y1;const f=i;let m;if(p){m=_n.allocate({width:g.width(),height:g.height(),dpr:i.dpr});const t=m.getContext("2d");t.clearRect(0,0,g.width(),g.height()),n=0,s=0,i=t}if(f.save(),e.parent&&!e.transMatrix.onlyTranslate()){const{scrollX:t=0,scrollY:i=0}=e.parent.attribute;f.setTransformFromMatrix(e.parent.globalTransMatrix),f.translate(t,i,!0)}f.setCommonStyle(e,e.attribute,n,s,r),f.clip();const y=g.width(),b=g.height(),v=l,x=o,_=u.columns?u.columns:Math.ceil(y/x),A=u.rows?u.rows:Math.ceil(b/x),S=u.gutterColumn?u.gutterColumn:2*v,T=u.gutterRow?u.gutterRow:2*v;this._tempSymbolGraphic||(this._tempSymbolGraphic=Wa({}));const w=u.columns?y/u.columns:x,M=u.rows?b/u.rows:x;this._tempSymbolGraphic.setAttributes({size:[w-S,M-T],symbolType:t});const B=this._tempSymbolGraphic.getParsedPath();for(let t=0;t<A;t++)for(let r=0;r<_;r++){const o=n+x/2+r*x,l=s+x/2+t*x;null===(h=d.beforeDynamicTexture)||void 0===h||h.call(d,i,t,r,A,_,c,e,g.width(),g.height()),i.beginPath(),!1===B.draw(i,Math.min(w-S,M-T),o,l,0)&&i.closePath(),i.fillStyle=a,d.dynamicTexture(i,t,r,A,_,c,e,g.width(),g.height())}p&&(f.globalAlpha=1,f.drawImage(m.nativeCanvas,0,0,m.nativeCanvas.width,m.nativeCanvas.height,g.x1,g.y1,g.width()*f.dpr,g.height()*f.dpr)),f.restore()}else if(u)i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,n,s,r),i.fillStyle=u,i.fill(),i.highPerformanceRestore();else if("wave"===t){i.save(),i.setCommonStyle(e,e.attribute,n,s,r),i.clip();const t=e.AABBBounds;(function(t,e,i,n,s,r,a){const{fill:o="orange",percent:l=.6,frequency:h=4,opacity:c,phi:d=0}=s;let{amplitude:u=10}=s;u*=function(t){return t<=.5?4*t-1:-4*t+3}(e);const p=n*(1-l),g=i,f=Math.max(Math.round(g/70),2);t.beginPath(),t.moveTo(0+r,n+a),t.lineTo(0+r,p+a);const m=g/h*e,y=g/Math.PI/(2*h);for(let e=0;e<g;e+=f){const i=u*Math.sin((e+m+d)/y+d);t.lineTo(e+r,p+i+a)}t.lineTo(g+r,n+a),t.closePath(),t.fillStyle=o,isFinite(c)&&(t.globalAlpha=c),t.fill()})(i,c,t.width(),t.height(),Object.assign(Object.assign({},d||{}),{fill:a}),n+t.x1-n,s+t.y1-s),i.restore()}}};const No=new class{constructor(){this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,d){const{outerBorder:u,innerBorder:p}=t.attribute,g=u&&!1!==u.visible,f=p&&!1!==p.visible;if(!g&&!f)return;const{innerPadding:m=l.innerPadding,outerPadding:y=l.outerPadding,startAngle:b=l.startAngle,endAngle:v=l.endAngle,opacity:x=l.opacity,x:_=l.x,y:A=l.y,scaleX:S=l.scaleX,scaleY:T=l.scaleY,keepStrokeScale:w=l.keepStrokeScale}=t.attribute;let{innerRadius:M=l.innerRadius,outerRadius:B=l.outerRadius}=t.attribute;B+=y,M-=m;const C=(s,r)=>{const a=!(!s||!s.stroke),{distance:o=l[r].distance}=s,h=w?o:Oi(e,o,e.dpr),c=o/B,u="outerBorder"===r?1:-1;if(t.setAttributes({outerRadius:B+u*h,innerRadius:M-u*h,startAngle:b-u*c,endAngle:v+u*c}),e.beginPath(),va(t,e,i,n,B+u*h,M-u*h),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),d)d(e,s,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=x,e.setStrokeStyle(t,s,(_-i)/S,(A-n)/T,l[r]),l[r].opacity=a,e.stroke()}};g&&C(u,"outerBorder"),f&&C(p,"innerBorder"),t.setAttributes({outerRadius:B,innerRadius:M,startAngle:b,endAngle:v})}},Wo=Uo,zo=Eo,Vo=i.pi/2;function Go(t,e,n,s,r,a){let o,l=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],h=arguments.length>7?arguments[7]:void 0;if(Array.isArray(l)&&(h=l,l=!0),s<0&&(e+=s,s=-s),r<0&&(n+=r,r=-r),i.isNumber(a,!0))o=[a=i.abs(a),a,a,a];else if(Array.isArray(a)){const t=a;let e,n;switch(t.length){case 0:o=[0,0,0,0];break;case 1:e=i.abs(t[0]),o=[e,e,e,e];break;case 2:case 3:e=i.abs(t[0]),n=i.abs(t[1]),o=[e,n,e,n];break;default:o=t,o[0]=i.abs(o[0]),o[1]=i.abs(o[1]),o[2]=i.abs(o[2]),o[3]=i.abs(o[3])}}else o=[0,0,0,0];if(s<0||o[0]+o[1]+o[2]+o[3]<1e-12)return t.rect(e,n,s,r);const[c,d,u,p]=[[e,n],[e+s,n],[e+s,n+r],[e,n+r]],g=Math.min(s/2,r/2),f=[Math.min(g,o[0]),Math.min(g,o[1]),Math.min(g,o[2]),Math.min(g,o[3])],m=[c[0]+f[0],c[1]],y=[c[0],c[1]+f[0]],b=[d[0]-f[1],d[1]],v=[d[0],d[1]+f[1]],x=[u[0]-f[2],u[1]],_=[u[0],u[1]-f[2]],A=[p[0]+f[3],p[1]],S=[p[0],p[1]-f[3]];if(t.moveTo(m[0],m[1]),l){if(h&&h[0]?h[0](m[0],m[1],b[0],b[1]):t.lineTo(b[0],b[1]),!i.arrayEqual(b,v)){h&&h[0]&&t.moveTo(b[0],b[1]);const e=b[0],i=b[1]+f[1];t.arc(e,i,f[1],-Vo,0,!1)}if(h&&h[1]?h[1](v[0],v[1],_[0],_[1]):t.lineTo(_[0],_[1]),!i.arrayEqual(x,_)){const e=_[0]-f[2],i=_[1];h&&h[1]&&t.moveTo(_[0],_[1]),t.arc(e,i,f[2],0,Vo,!1)}if(h&&h[2]?h[2](x[0],x[1],A[0],A[1]):t.lineTo(A[0],A[1]),!i.arrayEqual(A,S)){const e=A[0],n=A[1]-f[3];h&&h[2]&&t.moveTo(A[0],A[1]),t.arc(e,n,f[3],Vo,i.pi,!1)}if(h&&h[3]?h[3](S[0],S[1],y[0],y[1]):t.lineTo(y[0],y[1]),!i.arrayEqual(m,y)){const e=m[0],n=m[1]+f[0];h&&h[3]&&t.moveTo(y[0],y[1]),t.arc(e,n,f[0],i.pi,i.pi+Vo,!1)}}else h&&h[0]?h[0](m[0],m[1],b[0],b[1]):t.lineTo(b[0],b[1]),h&&h[1]?h[1](b[0],b[1],x[0],x[1]):t.lineTo(x[0],x[1]),h&&h[2]?h[2](x[0],x[1],A[0],A[1]):t.lineTo(A[0],A[1]),h&&h[2]?h[2](A[0],A[1],m[0],m[1]):t.lineTo(m[0],m[1]);return!h&&t.closePath(),t}var Ho=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class Xo{constructor(){this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,s,r,a,o,l,h,c,d,u){const{outerBorder:p,innerBorder:g}=t.attribute,f=p&&!1!==p.visible,m=g&&!1!==g.visible;if(!f&&!m)return;const{cornerRadius:y=h.cornerRadius,cornerType:b=h.cornerType,opacity:v=h.opacity,x:x=h.x,y:_=h.y,scaleX:A=h.scaleX,scaleY:S=h.scaleY,x1:T,y1:w,keepStrokeScale:M=h.keepStrokeScale}=t.attribute;let{width:B,height:C}=t.attribute;B=(null!=B?B:T-n)||0,C=(null!=C?C:w-s)||0;const k=(r,a)=>{const o=!(!r||!r.stroke),l="outerBorder"===a?-1:1,{distance:c=h[a].distance}=r,d=M?c:Oi(e,c,e.dpr),p=n+l*d,g=s+l*d,f=2*d;if(0===y||i.isArray(y)&&y.every((t=>0===t))?(e.beginPath(),e.rect(p,g,B-l*f,C-l*f)):(e.beginPath(),Go(e,p,g,B-l*f,C-l*f,y,"bevel"!==b)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),u)u(e,r,h[a]);else if(o){const i=h[a].opacity;h[a].opacity=v,e.setStrokeStyle(t,r,(x-n)/A,(_-s)/S,h[a]),h[a].opacity=i,e.stroke()}};f&&k(p,"outerBorder"),m&&k(g,"innerBorder")}}let Yo=class{constructor(){this.time=ge.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,d,u){const{stroke:p=l.stroke}=t.attribute;Array.isArray(p)&&p.some((t=>!1===t))&&(u.doStroke=!1)}};Yo=Ho([wt()],Yo);let qo=class{constructor(){this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,s,r,a,o,l,h,c,d,u){const{x1:p,y1:g,x:f=h.x,y:m=h.y,stroke:y=h.stroke,cornerRadius:b=h.cornerRadius,cornerType:v=h.cornerType}=t.attribute;let{width:x,height:_}=t.attribute;if(x=(null!=x?x:p-f)||0,_=(null!=_?_:g-m)||0,Array.isArray(y)&&y.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,n,s,h),!(0===b||i.isArray(b)&&b.every((t=>0===t)))){let i,r=0;return Go(e,n,s,x,_,b,"bevel"!==v,new Array(4).fill(0).map(((a,o)=>(a,l,c,d)=>{y[o]&&(r===o-1&&y[o]===i||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:y[o]}),n,s,h),e.beginPath(),e.moveTo(a,l),i=y[o]),r=o,e.lineTo(c,d),e.stroke(),3===o&&e.beginPath())}))),void e.stroke()}if(e.beginPath(),e.moveTo(n,s),y[0]?e.lineTo(n+x,s):e.moveTo(n+x,s),y[1]?e.lineTo(n+x,s+_):e.moveTo(n+x,s+_),y[2]?e.lineTo(n,s+_):e.moveTo(n,s+_),y[3]){const t=y[0]?s-e.lineWidth/2:s;e.lineTo(n,t)}else e.moveTo(n,s);e.stroke()}}};qo=Ho([wt()],qo);const $o=new Xo,Ko=Uo,Zo=Eo;const Jo=new class extends Xo{constructor(){super(...arguments),this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,d){return super.drawShape(t,e,i,n,s,r,a,o,l,h,c,d)}},Qo=Eo;const tl=new class{constructor(){this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,d){const u=t.getParsedPath();if(!u)return;const{outerBorder:p,innerBorder:g}=t.attribute,f=p&&!1!==p.visible,m=g&&!1!==g.visible;if(!f&&!m)return;const{size:y=l.size,opacity:b=l.opacity,x:v=l.x,y:x=l.y,scaleX:_=l.scaleX,scaleY:A=l.scaleY,keepStrokeScale:S=l.keepStrokeScale}=t.attribute,T=(s,r)=>{const a=!(!s||!s.stroke),{distance:o=l[r].distance}=s,h=S?o:Oi(e,o,e.dpr),c="outerBorder"===r?1:-1;if(e.beginPath(),!1===u.drawOffset(e,y,i,n,c*h)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),d)d(e,s,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=b,e.setStrokeStyle(t,s,(v-i)/_,(x-n)/A,l[r]),l[r].opacity=a,e.stroke()}};f&&T(p,"outerBorder"),m&&T(g,"innerBorder")}},el=new class{constructor(){this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,d,u){const{clipRange:p=l.clipRange,x:g=l.x,y:f=l.y,z:m=l.z,size:y=l.size,scaleX:b=l.scaleX,scaleY:v=l.scaleY}=t.attribute,x=t.getParsedPath();x&&p<1&&p>0&&(e.beginPath(),x.drawWithClipRange&&x.drawWithClipRange(e,y,i,n,p,m,((s,r)=>{var a,h,c,u;if(t._parsedPath.svgCache){const e=Object.assign({},r);e.fill=null!==(a=r.fill)&&void 0!==a?a:t.attribute.fill,e.opacity=null!==(h=r.opacity)&&void 0!==h?h:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(c=r.stroke)&&void 0!==c?c:t.attribute.stroke,e.lineWidth=null!==(u=r.lineWidth)&&void 0!==u?u:t.attribute.lineWidth,r=e}r.stroke&&(d?d(e,t.attribute,l):o&&(e.setStrokeStyle(t,r,(g-i)/b,(f-n)/v,l),e.stroke()))})),r&&!x.isSvg&&(d?d(e,t.attribute,l):o&&(e.setStrokeStyle(t,t.attribute,(g-i)/b,(f-n)/v,l),e.stroke())))}},il=Uo,nl=Eo,sl={x:0,y:0,z:0,lastModelMatrix:null};class rl{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions||(this.builtinContributions=[]),this.builtinContributions.push(Fo),this.builtinContributions.push(jo),this.builtinContributions.forEach((t=>this._renderContribitions.push(t))),this._renderContribitions.length&&(this._renderContribitions.sort(((t,e)=>e.order-t.order)),this._beforeRenderContribitions=this._renderContribitions.filter((t=>t.time===ge.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===ge.afterFillStroke)))}beforeRenderStep(t,e,i,n,s,r,a,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,n,s,r,a,o,l,h,c,d,u)}))}afterRenderStep(t,e,i,n,s,r,a,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,n,s,r,a,o,l,h,c,d,u)}))}drawPathProxy(t,e,i,n,s,r,a,o){if(!t.pathProxy)return!1;const l=Cn(t,null==r?void 0:r.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:f=l.visible,x:m=l.x,y:y=l.y}=t.attribute,b=pa(d,u,h),v=fa(d,g),x=da(h),_=ua(c,p);if(!f)return!0;if(!x&&!_)return!0;if(!(b||v||a||o))return!0;e.beginPath();return be(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,x,_,b,v,l,s,a,o),_&&(o?o(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,i-m,n-y,l),e.stroke())),x&&(a?a(e,t.attribute,l):b&&(e.setCommonStyle(t,t.attribute,i-m,n-y,l),e.fill())),this.afterRenderStep(t,e,i,n,x,_,b,v,l,s,a,o),!0}valid(t,e,i,n){const{fill:s=e.fill,background:r,stroke:a=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=pa(o,l,s),p=fa(o,c),g=da(s,r),f=ua(a,h);return!(!t.valid||!d)&&!(!g&&!f)&&!!(u||p||i||n||r)&&{fVisible:u,sVisible:p,doFill:g,doStroke:f}}transform(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const{x:s=e.x,y:r=e.y,z:a=e.z,scaleX:o=e.scaleX,scaleY:l=e.scaleY,angle:h=e.angle,postMatrix:c}=t.attribute,d=i.modelMatrix,u=i.camera;sl.x=s,sl.y=r,sl.z=a,sl.lastModelMatrix=d;const p=u&&(n||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 n=jr.allocate(),s=jr.allocate();Ra(s,t,e),Ir(n,d||n,s),sl.x=0,sl.y=0,sl.z=0,i.modelMatrix=n,i.setTransform(1,0,0,1,0,0,!0),jr.free(s)}if(g&&!d){const n=t.getOffsetXY(e);sl.x+=n.x,sl.y+=n.y,sl.z=a,i.setTransformForCurrent()}else if(p)sl.x=0,sl.y=0,sl.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(u&&i.project){const n=t.getOffsetXY(e);sl.x+=n.x,sl.y+=n.y,this.transformWithoutTranslate(i,sl.x,sl.y,sl.z,o,l,h)}else i.transformFromMatrix(t.transMatrix,!0),sl.x=0,sl.y=0,sl.z=0;return sl}transformUseContext2d(t,e,i,n){const s=n.camera;if(this.camera=s,s){const e=t.AABBBounds,s=e.x2-e.x1,r=e.y2-e.y1,a=n.project(0,0,i),o=n.project(s,0,i),l=n.project(s,r,i),h={x:0,y:0},c={x:s,y:0},d={x:s,y:r};n.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)*a.x)*u,g=(c.y*l.y+h.y*(o.y-l.y)-d.y*o.y+(d.y-c.y)*a.y)*u,f=(h.x*(l.x-o.x)-c.x*l.x+d.x*o.x+(c.x-d.x)*a.x)*u,m=-(c.x*l.y+h.x*(o.y-l.y)-d.x*o.y+(d.x-c.x)*a.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)*a.x)*u,b=(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)*a.y)*u;n.setTransform(p,g,f,m,y,b,!0)}}restoreTransformUseContext2d(t,e,i,n){this.camera&&(n.camera=this.camera)}transformWithoutTranslate(t,e,i,n,s,r,a){const o=t.project(e,i,n);t.translate(o.x,o.y,!1),t.scale(s,r,!1),t.rotate(a,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}_draw(t,e,i,n,s,r){const{context:a}=n;if(!a)return;const{renderable:o}=t.attribute;if(!1===o)return;a.highPerformanceSave();const l=this.transform(t,e,a,i),{x:h,y:c,z:d,lastModelMatrix:u}=l;this.z=d,this.drawPathProxy(t,a,h,c,n,s)||(this.drawShape(t,a,h,c,n,s,null,null,r),this.z=0,a.modelMatrix!==u&&jr.free(a.modelMatrix),a.modelMatrix=u),a.highPerformanceRestore()}}var al=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},ol=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ll=function(t,e){return function(i,n){e(i,n,t)}};let hl=class extends rl{constructor(t){super(),this.arcRenderContribitions=t,this.numberType=gr,this.builtinContributions=[No,zo,Wo],this.init(t)}drawArcTailCapPath(t,e,n,s,r,a,o,l){const h=l-o,c=t.getParsedAngle(),d=c.startAngle;let u=c.endAngle;u=l,i.abs(u-d);const p=u>d;let g=!1;if(r<a){const t=r;r=a,a=t}const{outerDeltaAngle:f,xors:m,yors:y,xirs:b,yirs:v,limitedOcr:x,outerCornerRadiusStart:_,outerCornerRadiusEnd:A,maxOuterCornerRadius:S,xore:T,yore:w,xire:M,yire:B,limitedIcr:C,innerDeltaAngle:k,innerStartAngle:P,innerCornerRadiusStart:O,innerCornerRadiusEnd:R,maxInnerCornerRadius:L}=ba(t,d,u,a,r);if(x>i.epsilon){const t=i.min(_,x),a=i.min(A,x),o=ya(b,v,m,y,r,t,Number(p)),l=ya(T,w,M,B,r,a,Number(p));if(x<S&&t===a)e.moveTo(n+o.cx+o.x01,s+o.cy+o.y01),e.arc(n+o.cx,s+o.cy,x,i.atan2(o.y01,o.x01),i.atan2(l.y01,l.x01),!p);else{const t=u-h-.03,o=i.atan2(l.y11,l.x11);e.arc(n,s,r,t,o,!p),a>0&&e.arc(n+l.cx,s+l.cy,a,i.atan2(l.y11,l.x11),i.atan2(l.y01,l.x01),!p)}}else e.moveTo(n+m,s+y);if(!(a>i.epsilon)||k<.001)e.lineTo(n+M,s+B),g=!0;else if(C>i.epsilon){const t=i.min(O,C),r=i.min(R,C),o=ya(M,B,T,w,a,-r,Number(p)),l=ya(m,y,b,v,a,-t,Number(p));if(e.lineTo(n+o.cx+o.x01,s+o.cy+o.y01),C<L&&t===r){const t=i.atan2(l.y01,l.x01);e.arc(n+o.cx,s+o.cy,C,i.atan2(o.y01,o.x01),t,!p)}else{r>0&&e.arc(n+o.cx,s+o.cy,r,i.atan2(o.y01,o.x01),i.atan2(o.y11,o.x11),!p);const t=i.atan2(o.cy+o.y11,o.cx+o.x11),l=u-h-.03;e.arc(n,s,a,t,l,p)}}else e.lineTo(n+a*i.cos(P),s+a*i.sin(P));return g}drawShape(t,e,n,s,r,a,o,l,h){h=null!=h?h:Cn(t,null==a?void 0:a.theme).arc;const{fill:c=h.fill,stroke:d=h.stroke,x:u=h.x,y:p=h.y,fillStrokeOrder:g=h.fillStrokeOrder}=t.attribute,f=this.valid(t,h,o,l);if(!f)return;const{fVisible:m,sVisible:y,doFill:b,doStroke:v}=f,{outerPadding:x=h.outerPadding,innerPadding:_=h.innerPadding,cap:A=h.cap,forceShowCap:S=h.forceShowCap}=t.attribute;let{outerRadius:T=h.outerRadius,innerRadius:w=h.innerRadius}=t.attribute;T+=x,w-=_;let M=0;const B=(i.isBoolean(A)&&A||A[0])&&"conical"===c.gradient;if(B){const{sc:e,startAngle:n,endAngle:s}=t.getParsedAngle();i.abs(s-n)<i.pi2-i.epsilon&&(M=e||0,c.startAngle-=M,c.endAngle-=M)}let C=!1;const{isFullStroke:k,stroke:P}=(t=>{var e;let n=!0;if(i.isBoolean(t,!0)){for(let i=0;i<4;i++)Fn[i]=t,n&&(n=!(null!==(e=Fn[i])&&void 0!==e&&!e));n=t}else if(Array.isArray(t))for(let e=0;e<4;e++)Fn[e]=!!t[e],n&&(n=!!Fn[e]);else Fn[0]=!1,Fn[1]=!1,Fn[2]=!1,Fn[3]=!1;return{isFullStroke:n,stroke:Fn}})(d);if((b||k)&&(e.beginPath(),va(t,e,n,s,T,w),C=!0,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,n,s,b,v,m,y,h,r,o,l),g?(this._runStroke(t,e,n,s,h,v,k,y,l),this._runFill(t,e,n,s,h,b,m,u,p,o)):(this._runFill(t,e,n,s,h,b,m,u,p,o),this._runStroke(t,e,n,s,h,v,k,y,l))),!k&&v&&(e.beginPath(),va(t,e,n,s,T,w,P),C||this.beforeRenderStep(t,e,n,s,b,v,m,y,h,r,o,l),l?l(e,t.attribute,h):y&&(e.setStrokeStyle(t,t.attribute,n,s,h),e.stroke())),(i.isBoolean(A)&&A||A[1])&&S){const{startAngle:a,endAngle:c}=t.getParsedAngle();if(i.abs(c-a)>=i.pi2-i.epsilon){e.beginPath();const a=Math.abs(T-w)/2/T,{endAngle:c=h.endAngle,fill:d=h.fill}=t.attribute,u=c;this.drawArcTailCapPath(t,e,n,s,T,w,u,u+a),C||this.beforeRenderStep(t,e,n,s,b,v,m,y,h,r,o,l);const p=()=>{if(b){const r=d;if("conical"===r.gradient){const a=function(t,e,n,s){const{stops:r,startAngle:a,endAngle:o}=s;for(;n<0;)n+=i.pi2;for(;n>i.pi2;)n-=i.pi2;if(n<a)return r[0].color;if(n>o)return r[0].color;let l,h,c=(n-a)/(o-a);for(let t=0;t<r.length;t++)if(r[t].offset>=c){l=r[t-1],h=r[t];break}return c=(c-l.offset)/(h.offset-l.offset),Yr(l.color,h.color,c,!1)}(0,0,c,r);o||pa&&(e.setCommonStyle(t,t.attribute,n,s,h),e.fillStyle=a,e.fill())}}},g=()=>{v&&(l||y&&(e.setStrokeStyle(t,t.attribute,n,s,h),e.stroke()))};p(),g()}}this.afterRenderStep(t,e,n,s,b,v,m,y,h,r,o,l),B&&(c.startAngle+=M,c.endAngle+=M)}_runFill(t,e,i,n,s,r,a,o,l,h){r&&(h?h(e,t.attribute,s):a&&(e.setCommonStyle(t,t.attribute,o-i,l-n,s),e.fill()))}_runStroke(t,e,i,n,s,r,a,o,l){r&&a&&(l||o&&(e.setStrokeStyle(t,t.attribute,i,n,s),e.stroke()))}draw(t,e,i,n){const s=Cn(t,null==n?void 0:n.theme).arc;this._draw(t,s,!1,i,n,s)}};function cl(t,e,i,n){if(!e.p1)return;const{offsetX:s=0,offsetY:r=0,offsetZ:a=0}=n||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(s+e.p1.x,r+e.p1.y,s+e.p2.x,r+e.p2.y,s+e.p3.x,r+e.p3.y,a):t.lineTo(s+e.p1.x,r+e.p1.y,a);else if(e.p2&&e.p3){const[n]=we(e,i);t.bezierCurveTo(s+n.p1.x,r+n.p1.y,s+n.p2.x,r+n.p2.y,s+n.p3.x,r+n.p3.y,a)}else{const n=e.getPointAt(i);t.lineTo(s+n.x,r+n.y,a)}}function dl(t,e,i,n,s,r,a){var o;let l=e.p0,h=n;if(i&&i.originP1===i.originP2&&(l=i.p0),e.defined)n||(t.lineTo(l.x+s,l.y+r,a),h=!n);else{const{originP1:c,originP2:d}=e;let u;if(c&&!1!==c.defined&&!i?u=l:c&&!1!==d.defined&&(u=null!==(o=e.p3)&&void 0!==o?o:e.p1),n){h=!n;const i=u?u.x:e.p0.x,o=u?u.y:e.p0.y;t.moveTo(i+s,o+r,a)}else u&&(h=!n,t.lineTo(u.x+s,u.y+r,a))}return h}hl=al([wt(),ll(0,St(Wt)),ll(0,Mt(xa)),ol("design:paramtypes",[Object])],hl);var ul=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let pl=class extends rl{constructor(){super(...arguments),this.numberType=vr}draw(t,e,i,n){const s=Cn(t,null==n?void 0:n.theme).line;this._draw(t,s,!1,i,n)}drawSegmentItem(t,e,n,s,r,a,o,l,h,c,d,u,p,g,f){var m;if(!e)return;t.beginPath();(function(t,e,n,s,r){const{offsetX:a=0,offsetY:o=0,offsetZ:l=0,mode:h="none",drawConnect:c=!1}=r||{};if(c&&"none"===h)return;if(!e)return;let d=!0;const{curves:u}=e;if(n>=1){if(c){let e,i=!0;u.forEach(((n,s)=>{n.originP1!==n.originP2?(i=dl(t,n,e,i,a,o,l),e=n):e=n}))}else u.forEach((e=>{e.defined?(d&&t.moveTo(e.p0.x+a,e.p0.y+o,l),cl(t,e,1,r),d=!1):d=!0}));return}if(n<=0)return;let p;"x"===s?p=ue.ROW:"y"===s?p=ue.COLUMN:"auto"===s&&(p=e.direction);const g=n*e.tryUpdateLength(p);let f=0,m=!0,y=null;for(let e=0,n=u.length;e<n;e++){const n=u[e],s=n.getLength(p),h=(g-f)/s;if(f+=s,h<0)break;if(c){if(n.originP1===n.originP2){y=n;continue}m=dl(t,n,y,m,a,o,l),y=n}else{if(!n.defined){d=!0;continue}d&&t.moveTo(n.p0.x+a,n.p0.y+o,l),cl(t,n,i.min(h,1),r),d=!1}}})(t,e,h,c,{offsetX:d,offsetY:u,offsetZ:null!==(m=this.z)&&void 0!==m?m:0}),p.cache&&!i.isArray(p.cache)&&p.cache.curves.every((t=>t.defined))&&p.attribute.curveType&&p.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(p,o,l);const{x:y=0,x:b=0}=o;return!1!==n&&(g?g(t,o,l):r&&(t.setCommonStyle(p,o,y-d,b-u,l),t.fill())),!1!==s&&(f?f(t,o,l):a&&(t.setStrokeStyle(p,o,y-d,b-u,l),t.stroke())),!1}drawLinearLineHighPerformance(t,e,i,n,s,r,a,o,l,h,c,d,u){var p;e.beginPath();const g=null!==(p=this.z)&&void 0!==p?p:0,{points:f}=t.attribute,m=f[0];e.moveTo(m.x+a,m.y+o,g);for(let t=1;t<f.length;t++){const i=f[t];e.lineTo(i.x+a,i.y+o,g)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);const{x:y=0,x:b=0}=t.attribute;!1!==i&&(d?d(e,t.attribute,l):s&&(e.setCommonStyle(t,t.attribute,y-a,b-o,l),e.fill())),!1!==n&&(u?u(e,t.attribute,l):r&&(e.setStrokeStyle(t,t.attribute,y-a,b-o,l),e.stroke()))}drawShape(t,e,n,s,r,a,o,l){const h=Cn(t,null==a?void 0:a.theme).line,{fill:c=h.fill,stroke:d=h.stroke,fillOpacity:u=h.fillOpacity,strokeOpacity:p=h.strokeOpacity,segments:g,points:f,closePath:m,curveTension:y=h.curveTension,connectedType:b=h.connectedType}=t.attribute;if(!this.valid(t,h,o,l))return;let{curveType:v=h.curveType}=t.attribute;m&&"linear"===v&&(v="linearClosed");const{clipRange:x=h.clipRange,clipRangeByDimension:_=h.clipRangeByDimension}=t.attribute;if(1===x&&!g&&!f.some((t=>!1===t.defined))&&"linear"===v)return this.drawLinearLineHighPerformance(t,e,!!c,!!d,u,p,n,s,h,r,a,o,l);function A(t,e){return"none"===e?t:t.filter((t=>!1!==t.defined))}if(t.shouldUpdateShape()){const{points:e,segments:i}=t.attribute,n=e;if(i&&i.length){let e,n;if(t.cache=i.map(((t,i)=>{if(t.points.length<=1&&0===i)return t.points[0]&&(n={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===i?e={x:n.endX,y:n.endY,defined:n.curves[n.curves.length-1].defined}:i>1&&(e.x=n.endX,e.y=n.endY,e.defined=n.curves[n.curves.length-1].defined);const s=ni(A(t.points,b),v,{startPoint:e,curveTension:y});return n=s,s})).filter((t=>!!t)),"linearClosed"===v){let e;for(let i=0;i<t.cache.length;i++){const n=t.cache[i];for(let t=0;t<n.curves.length;t++)if(n.curves[t].defined){e=n.curves[t].p0;break}if(e)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(e.x,e.y,!0)}}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=ni(A(n,b),v,{curveTension:y})}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){const r=t.attribute.segments.filter((t=>t.points.length));if(1===r[0].points.length&&r.shift(),1===x){let i=!1;t.cache.forEach(((a,g)=>{i||(i=this.drawSegmentItem(e,a,!!c,!!d,u,p,r[g],[h,t.attribute],x,_,n,s,t,o,l))}))}else{const a=t.cache.reduce(((t,e)=>t+e.getLength()),0),g=x*a;let f=0,m=!1;t.cache.forEach(((a,y)=>{if(m)return;const b=a.getLength(),v=(g-f)/b;f+=b,v>0&&(m=this.drawSegmentItem(e,a,!!c,!!d,u,p,r[y],[h,t.attribute],i.min(v,1),_,n,s,t,o,l))}))}}else this.drawSegmentItem(e,t.cache,!!c,!!d,u,p,t.attribute,h,x,_,n,s,t,o,l)}};pl=ul([wt()],pl);var gl=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},fl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ml=function(t,e){return function(i,n){e(i,n,t)}};let yl=class extends rl{constructor(t){super(),this.rectRenderContribitions=t,this.type="rect",this.numberType=Sr,this.builtinContributions=[$o,Zo,Ko],this.init(t)}drawShape(t,e,n,s,r,a,o,l,h){h=null!=h?h:Cn(t,null==a?void 0:a.theme).rect;const{fill:c=h.fill,background:d,stroke:u=h.stroke,cornerRadius:p=h.cornerRadius,cornerType:g=h.cornerType,opacity:f=h.opacity,fillOpacity:m=h.fillOpacity,lineWidth:y=h.lineWidth,strokeOpacity:b=h.strokeOpacity,visible:v=h.visible,x1:x,y1:_,x:A=h.x,y:S=h.y,fillStrokeOrder:T=h.fillStrokeOrder}=t.attribute;let{width:w,height:M}=t.attribute;w=(null!=w?w:x-A)||0,M=(null!=M?M:_-S)||0;const B=ga(f,m,w,M,c),C=ma(f,b,w,M),k=da(c,d),P=ua(u,y);if(!t.valid||!v)return;if(!k&&!P)return;if(!(B||C||o||l||d))return;0===p||i.isArray(p)&&p.every((t=>0===t))?(e.beginPath(),e.rect(n,s,w,M)):(e.beginPath(),Go(e,n,s,w,M,p,"bevel"!==g));const O={doFill:k,doStroke:P};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,n,s,k,P,B,C,h,r,o,l,O),T?(this._runStroke(t,e,n,s,h,O,C,A,S,l),this._runFill(t,e,n,s,h,O,B,A,S,o)):(this._runFill(t,e,n,s,h,O,B,A,S,o),this._runStroke(t,e,n,s,h,O,C,A,S,l)),this.afterRenderStep(t,e,n,s,k,P,B,C,h,r,o,l)}_runFill(t,e,i,n,s,r,a,o,l,h){r.doFill&&(h?h(e,t.attribute,s):a&&(e.setCommonStyle(t,t.attribute,o-i,l-n,s),e.fill()))}_runStroke(t,e,i,n,s,r,a,o,l,h){r.doStroke&&(h?h(e,t.attribute,s):a&&(e.setStrokeStyle(t,t.attribute,o-i,l-n,s),e.stroke()))}draw(t,e,i,n){const s=Cn(t,null==n?void 0:n.theme).rect;this._draw(t,s,!1,i,n,s)}};yl=gl([wt(),ml(0,St(Wt)),ml(0,Mt(Sa)),fl("design:paramtypes",[Object])],yl);var bl=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},vl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xl=function(t,e){return function(i,n){e(i,n,t)}};let _l=class extends rl{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=Mr,this.builtinContributions=[tl,nl,il,el],this.init(t)}drawShape(t,e,n,s,r,a,o,l,h){var c;h=null!=h?h:Cn(t,null==a?void 0:a.theme).symbol;const{size:d=h.size,x:u=h.x,y:p=h.y,scaleX:g=h.scaleX,scaleY:f=h.scaleY,fillStrokeOrder:m=h.fillStrokeOrder,clipRange:y=h.clipRange}=t.attribute,b=this.valid(t,h,o,l);if(!b)return;const{fVisible:v,sVisible:x,doFill:_,doStroke:A}=b,S=t.getParsedPath();if(!S)return;const{keepDirIn3d:T=h.keepDirIn3d}=t.attribute,w=null!==(c=this.z)&&void 0!==c?c:0;e.beginPath();let M=n,B=s,C=w;const k=e.camera;if(T&&k&&e.project){const t=e.project(n,s,w);e.camera=null,i.isArray(d)&&(d[0],d[1]),M=t.x,B=t.y,C=void 0}!1===S.draw(e,d,M,B,C,((i,r)=>{var a,c,d,b;if(t._parsedPath.svgCache){const e=Object.assign({},r);e.fill=null!==(a=r.fill)&&void 0!==a?a:t.attribute.fill,e.opacity=null!==(c=r.opacity)&&void 0!==c?c:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(d=r.stroke)&&void 0!==d?d:t.attribute.stroke,e.lineWidth=null!==(b=r.lineWidth)&&void 0!==b?b:t.attribute.lineWidth,r=e}const v=()=>{r.fill&&(o?o(e,t.attribute,h):(e.setCommonStyle(t,r,u-n,p-s,h),e.fill()))},_=()=>{r.stroke&&(l?l(e,t.attribute,h):x&&y>=1&&(e.setStrokeStyle(t,r,(u-n)/g,(p-s)/f,h),e.stroke()))};m?(_(),v()):(v(),_())}))&&e.closePath(),e.camera=k,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,n,s,_,A,v,x,h,r,o,l),m?(this._runStroke(t,e,n,s,h,A,x,u,p,S,y,g,f,l),this._runFill(t,e,n,s,h,_,v,u,p,S,o)):(this._runFill(t,e,n,s,h,_,v,u,p,S,o),this._runStroke(t,e,n,s,h,A,x,u,p,S,y,g,f,l)),this.afterRenderStep(t,e,n,s,_,A,v,x,h,r,o,l)}_runFill(t,e,i,n,s,r,a,o,l,h,c){r&&!h.isSvg&&(c?c(e,t.attribute,s):a&&(e.setCommonStyle(t,t.attribute,o-i,l-n,s),e.fill()))}_runStroke(t,e,i,n,s,r,a,o,l,h,c,d,u,p){r&&!h.isSvg&&(p?p(e,t.attribute,s):a&&c>=1&&(e.setStrokeStyle(t,t.attribute,(o-i)/d,(l-n)/u,s),e.stroke()))}draw(t,e,i,n){const s=Cn(t,null==n?void 0:n.theme).symbol;this._draw(t,s,!1,i,n)}};_l=bl([wt(),xl(0,St(Wt)),xl(0,Mt(Ta)),vl("design:paramtypes",[Object])],_l);const Al=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new i.AABBBounds)}allocate(t,e,n,s){if(!this.pools.length)return(new i.AABBBounds).setValue(t,e,n,s);const r=this.pools.pop();return r.x1=t,r.y1=e,r.x2=n,r.y2=s,r}allocateByObj(t){if(!this.pools.length)return new i.AABBBounds(t);const e=this.pools.pop();return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}};const Sl=new class extends Io{constructor(){super(...arguments),this.time=ge.beforeFillStroke}drawShape(t,e,n,s,r,a,o,l,h,c,d,u){var p,g,f,m,y,b,v,x,_,A;const{backgroundMode:S=h.backgroundMode,backgroundFit:T=h.backgroundFit,backgroundKeepAspectRatio:w=h.backgroundKeepAspectRatio}=t.attribute;let M,{background:B}=t.attribute;if(!B)return;const C=()=>{"richtext"===t.type&&(e.restore(),e.save(),M&&e.setTransformFromMatrix(M,!0,1))};let k;"richtext"===t.type&&(M=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());const P=i.isObject(B)&&B.background,O=t.transMatrix.onlyTranslate();if(P){const e=t.AABBBounds,i=(null!==(p=B.x)&&void 0!==p?p:e.x1)+(null!==(g=B.dx)&&void 0!==g?g:0),n=(null!==(f=B.y)&&void 0!==f?f:e.y1)+(null!==(m=B.dy)&&void 0!==m?m:0),s=null!==(y=B.width)&&void 0!==y?y:e.width(),r=null!==(b=B.height)&&void 0!==b?b:e.height();if(k=Al.allocate(i,n,i+s,n+r),B=B.background,!O){const t=k.width(),e=k.height();k.set((null!==(v=B.x)&&void 0!==v?v:0)+(null!==(x=B.dx)&&void 0!==x?x:0),(null!==(_=B.y)&&void 0!==_?_:0)+(null!==(A=B.dy)&&void 0!==A?A:0),t,e)}}else k=t.AABBBounds,O||(k=Po(Object.assign(Object.assign({},t.attribute),{angle:0,scaleX:1,scaleY:1,x:0,y:0,dx:0,dy:0})).clone());if(t.backgroundImg&&t.resources){const i=t.resources.get(B);if("success"!==i.state||!i.data)return void C();e.highPerformanceSave(),O&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,n,s,h),this.doDrawImage(e,i.data,k,{backgroundMode:S,backgroundFit:T,backgroundKeepAspectRatio:w}),e.highPerformanceRestore(),e.setTransformForCurrent()}else{const{backgroundCornerRadius:i}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,s,h),e.fillStyle=B,i?(Go(e,k.x1,k.y1,k.width(),k.height(),i,!0),e.fill()):e.fillRect(k.x1,k.y1,k.width(),k.height()),e.highPerformanceRestore()}P&&Al.free(k),C()}};var Tl=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},wl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ml=function(t,e){return function(i,n){e(i,n,t)}};let Bl=class extends rl{constructor(t){super(),this.textRenderContribitions=t,this.numberType=Br,this.builtinContributions=[Sl],this.init(t)}drawShape(t,e,n,s,r,a,o,l){var h,c,d;const u=Cn(t,null==a?void 0:a.theme).text,{text:p,underline:g=u.underline,lineThrough:f=u.lineThrough,keepDirIn3d:m=u.keepDirIn3d,direction:y=u.direction,fontSize:b=u.fontSize,verticalMode:v=u.verticalMode,x:x=u.x,y:_=u.y}=t.attribute,A=null!==(h=Hn(t.attribute.lineHeight,b))&&void 0!==h?h:b,S=this.valid(t,u,o,l);if(!S)return;const{fVisible:T,sVisible:w,doFill:M,doStroke:B}=S,C=!m,k=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,n,s,M,B,T,w,u,r,o,l),C&&this.transformUseContext2d(t,u,k,e);const P=(i,r,a,h)=>{let c=n+r;const d=s+a;if(h){e.highPerformanceSave(),c+=b;const t=Fr.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,c,d),e.transformFromMatrix(t,!0),Fr.free(t)}B&&(l?l(e,t.attribute,u):w&&(e.setStrokeStyle(t,t.attribute,x-n,_-s,u),e.strokeText(i,c,d,k))),M&&(o?o(e,t.attribute,u):T&&(e.setCommonStyle(t,t.attribute,x-n,_-s,u),e.fillText(i,c,d,k))),h&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(e.setTextStyleWithoutAlignBaseline(t.attribute,u,k),"horizontal"===y){const{multilineLayout:i}=t;if(!i)return void e.highPerformanceRestore();const{xOffset:r,yOffset:a}=i.bbox;B&&(l?l(e,t.attribute,u):w&&(e.setStrokeStyle(t,t.attribute,x-n,_-s,u),i.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+r+n,(t.topOffset||0)+a+s,k)})))),M&&(o?o(e,t.attribute,u):T&&(e.setCommonStyle(t,t.attribute,x-n,_-s,u),i.lines.forEach((i=>{e.fillText(i.str,(i.leftOffset||0)+r+n,(i.topOffset||0)+a+s,k),this.drawUnderLine(g,f,t,(i.leftOffset||0)+r+n,(i.topOffset||0)+a+s,i.descent,(i.descent-i.ascent)/2,k,u,e,{width:i.width})}))))}else{let{textAlign:n=u.textAlign,textBaseline:s=u.textBaseline}=t.attribute;if(!v){const e=n;n=null!==(c=t.getBaselineMapAlign()[s])&&void 0!==c?c:"left",s=null!==(d=t.getAlignMapBaseline()[e])&&void 0!==d?d:"top"}t.tryUpdateAABBBounds();const r=t.cache,{verticalList:a}=r;e.textAlign="left",e.textBaseline="top";const o=A*a.length;let l=0;a.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);l=i.max(e,l)}));let h=0,p=0;"bottom"===s?p=-o:"middle"===s&&(p=-o/2),"center"===n?h-=l/2:"right"===n&&(h-=l),a.forEach(((t,e)=>{const i=t.reduce(((t,e)=>t+(e.width||0)),0),s=l-i;let r=h;"center"===n?r+=s/2:"right"===n&&(r+=s),t.forEach((t=>{const{text:i,width:n,direction:s}=t;P(i,o-(e+1)*A+p,r,s),r+=n}))}))}C&&this.restoreTransformUseContext2d(t,u,k,e),this.afterRenderStep(t,e,n,s,M,B,T,w,u,r,o,l)}draw(t,e,i,n){const s=Cn(t,null==n?void 0:n.theme).text,{keepDirIn3d:r=s.keepDirIn3d}=t.attribute,a=!r;this._draw(t,s,a,i,n)}drawUnderLine(t,e,n,s,r,a,o,l,h,c,d){if(e+t<=0)return;const{textAlign:u=h.textAlign,fill:p=h.fill,opacity:g=h.opacity,underlineOffset:f=h.underlineOffset,underlineDash:m=h.underlineDash,fillOpacity:y=h.fillOpacity}=n.attribute,b=!i.isNil(d),v=b?d.width:n.clipedWidth,x=b?0:Ba(u,v),_={lineWidth:0,stroke:p,opacity:g,strokeOpacity:y};if(t){_.lineWidth=t,c.setStrokeStyle(n,_,s,r,h),m&&c.setLineDash(m),c.beginPath();const e=r+a+f;c.moveTo(s+x,e,l),c.lineTo(s+x+v,e,l),c.stroke()}if(e){_.lineWidth=e,c.setStrokeStyle(n,_,s,r,h),c.beginPath();const t=r+o;c.moveTo(s+x,t,l),c.lineTo(s+x+v,t,l),c.stroke()}}};function Cl(t,e,i,n){t.moveTo(e[0].x+i,e[0].y+n);for(let s=1;s<e.length;s++)t.lineTo(e[s].x+i,e[s].y+n)}function kl(t,e){return Math.sqrt(t*t+e*e)}function Pl(t,e,i,n,s){const r=e/i;return{x:t.x-n*r,y:t.y-s*r}}Bl=Tl([wt(),Ml(0,St(Wt)),Ml(0,Mt(wa)),wl("design:paramtypes",[Object])],Bl);const Ol=Uo,Rl=Eo;var Ll=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Il=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},El=function(t,e){return function(i,n){e(i,n,t)}};let Dl=class extends rl{constructor(t){super(),this.polygonRenderContribitions=t,this.numberType=_r,this.builtinContributions=[Rl,Ol],this.init(t)}drawShape(t,e,n,s,r,a,o,l){const h=Cn(t,null==a?void 0:a.theme).polygon,{points:c=h.points,cornerRadius:d=h.cornerRadius,x:u=h.x,y:p=h.y,closePath:g=h.closePath,fillStrokeOrder:f=h.fillStrokeOrder}=t.attribute,m=this.valid(t,h,o,l);if(!m)return;const{fVisible:y,sVisible:b,doFill:v,doStroke:x}=m;e.beginPath(),d<=0||i.isArray(d)&&d.every((t=>0===t))?Cl(e.camera?e:e.nativeContext,c,n,s):function(t,e,i,n,s){let r=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];var a;if(e.length<3)return void Cl(t,e,i,n);let o=0,l=e.length-1;r||(o+=1,l-=1,t.moveTo(e[0].x+i,e[0].y+n));for(let r=o;r<=l;r++){const o=e[0===r?l:(r-1)%e.length],h=e[r%e.length],c=e[(r+1)%e.length],d=h.x-o.x,u=h.y-o.y,p=h.x-c.x,g=h.y-c.y,f=(Math.atan2(u,d)-Math.atan2(g,p))/2,m=Math.abs(Math.tan(f));let y=Array.isArray(s)?null!==(a=s[r%e.length])&&void 0!==a?a:0:s,b=y/m;const v=kl(d,u),x=kl(p,g),_=Math.min(v,x);b>_&&(b=_,y=_*m);const A=Pl(h,b,v,d,u),S=Pl(h,b,x,p,g),T=2*h.x-A.x-S.x,w=2*h.y-A.y-S.y,M=kl(T,w),B=Pl(h,kl(b,y),M,T,w);let C=Math.atan2(A.y-B.y,A.x-B.x);const k=Math.atan2(S.y-B.y,S.x-B.x);let P=k-C;P<0&&(C=k,P=-P),P>Math.PI&&(P-=Math.PI),0===r?t.moveTo(A.x+i,A.y+n):t.lineTo(A.x+i,A.y+n),P&&t.arcTo(h.x+i,h.y+n,S.x+i,S.y+n,y),t.lineTo(S.x+i,S.y+n)}r||t.lineTo(e[l+1].x+i,e[l+1].y+n)}(e.camera?e:e.nativeContext,c,n,s,d,g),g&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,n,s,v,x,y,b,h,r,o,l);const _=()=>{v&&(o?o(e,t.attribute,h):y&&(e.setCommonStyle(t,t.attribute,u-n,p-s,h),e.fill()))},A=()=>{x&&(l?l(e,t.attribute,h):b&&(e.setStrokeStyle(t,t.attribute,u-n,p-s,h),e.stroke()))};f?(A(),_()):(_(),A()),this.afterRenderStep(t,e,n,s,v,x,y,b,h,r,o,l)}draw(t,e,i,n){const s=Cn(t,null==n?void 0:n.theme).polygon;this._draw(t,s,!1,i,n)}};Dl=Ll([wt(),El(0,St(Wt)),El(0,Mt(Aa)),Il("design:paramtypes",[Object])],Dl);var Fl=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},jl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ul=function(t,e){return function(i,n){e(i,n,t)}};const Nl=["","repeat-x","repeat-y","repeat"];let Wl=class extends rl{constructor(t){super(),this.imageRenderContribitions=t,this.numberType=br,this.builtinContributions=[Jo,Qo],this.init(t)}drawShape(t,e,n,s,r,a,o,l){const h=Cn(t).image,{repeatX:c=h.repeatX,repeatY:d=h.repeatY,x:u=h.x,y:p=h.y,cornerRadius:g=h.cornerRadius,fillStrokeOrder:f=h.fillStrokeOrder,cornerType:m=h.cornerType,image:y}=t.attribute,b=this.valid(t,h,o);if(!b)return;const{fVisible:v,sVisible:x,doFill:_,doStroke:A}=b;if(!y||!t.resources)return;const S=t.resources.get(y);if("success"!==S.state)return;const T=t.width,w=t.height;e.beginPath();let M=!1;0===g||i.isArray(g)&&g.every((t=>0===t))?e.rect(n,s,T,w):(Go(e,n,s,T,w,g,"bevel"!==m),M=!0),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h);const B=()=>{if(_)if(o)o(e,t.attribute,h);else if(v){e.setCommonStyle(t,t.attribute,n,s,h);let i=0;if("repeat"===c&&(i|=1),"repeat"===d&&(i|=2),i){const t=e.createPattern(S.data,Nl[i]);e.fillStyle=t,e.translate(n,s,!0),e.fillRect(0,0,T,w),e.translate(-n,-s,!0)}else e.drawImage(S.data,n,s,T,w)}},C=()=>{A&&(l?l(e,t.attribute,h):x&&(e.setStrokeStyle(t,t.attribute,u-n,p-s,h),e.stroke()))};f?(C(),M&&(e.save(),e.clip()),this.beforeRenderStep(t,e,n,s,_,!1,v,!1,h,r,o),B(),M&&e.restore()):(M&&(e.save(),e.clip()),this.beforeRenderStep(t,e,n,s,_,!1,v,!1,h,r,o),B(),M&&e.restore(),C()),this.afterRenderStep(t,e,n,s,_,!1,v,!1,h,r,o)}draw(t,e,n){const{image:s}=t.attribute;if(!s||!t.resources)return;const r=t.resources.get(s);if("loading"===r.state&&i.isString(s))return void In.improveImageLoading(s);if("success"!==r.state)return;const{context:a}=e.drawParams;if(!a)return;const o=Cn(t).image;this._draw(t,o,!1,n)}};Wl=Fl([wt(),Ul(0,St(Wt)),Ul(0,Mt(_a)),jl("design:paramtypes",[Object])],Wl);const zl=Symbol.for("ArcRender"),Vl=Symbol.for("Arc3dRender"),Gl=Symbol.for("GraphicRender"),Hl=Symbol.for("LineRender"),Xl=Symbol.for("PolygonRender"),Yl=Symbol.for("RectRender"),ql=Symbol.for("Rect3DRender"),$l=Symbol.for("SymbolRender"),Kl=Symbol.for("TextRender"),Zl=Symbol.for("RichTextRender"),Jl=Symbol.for("Pyramid3dRender"),Ql=Symbol.for("ImageRender");var th=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let eh,ih=class extends pl{constructor(){super(...arguments),this.numberType=vr}drawShape(t,e,i,n,s,r,a,o){if(t.incremental&&s.multiGraphicOptions){const{startAtIdx:e,length:r}=s.multiGraphicOptions,{segments:l=[]}=t.attribute;if(e>l.length)return;const h=Cn(t).line,{fill:c=h.fill,stroke:d=h.stroke,opacity:u=h.opacity,fillOpacity:p=h.fillOpacity,strokeOpacity:g=h.strokeOpacity,lineWidth:f=h.lineWidth,visible:m=h.visible}=t.attribute,y=pa(u,p,c),b=fa(u,g),v=da(c),x=ua(d,f);if(!t.valid||!m)return;if(!v&&!x)return;if(!(y||b||a||o))return;const{context:_}=s;for(let s=e;s<e+r;s++)this.drawIncreaseSegment(t,_,l[s-1],l[s],t.attribute.segments[s],[h,t.attribute],i,n)}else super.drawShape(t,e,i,n,s,r,a,o)}drawIncreaseSegment(t,e,i,n,s,r,a,o){n&&(e.beginPath(),function(t,e,i,n){const{offsetX:s=0,offsetY:r=0}=n||{},a=e?e.points[e.points.length-1]:i.points[0];t.moveTo(a.x+s,a.y+r),i.points.forEach((e=>{!1!==e.defined?t.lineTo(e.x+s,e.y+r):t.moveTo(e.x+s,e.y+r)}))}(e.nativeContext,i,n,{offsetX:a,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,s,r),e.setStrokeStyle(t,s,a,o,r),e.stroke())}};ih=th([wt()],ih);class nh{static registerPlugin(t,e){nh._pluginClasses[t]=e}static getPlugin(t){return nh._pluginClasses[t]}}nh._pluginClasses={};class sh{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.8;this.dir=t,this.color=e,this.colorRgb=Hr.Get(e,Gr.Color1),this.ambient=n;const s=i.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this.formatedDir=[t[0]/s,t[1]/s,t[2]/s]}computeColor(t,e){const n=this.formatedDir,s=i.min(i.max((t[0]*n[0]+t[1]*n[1]+t[2]*n[2])*(1-this.ambient/2),0)+this.ambient,1);let r;r=i.isString(e)?Hr.Get(e,Gr.Color1):e;const a=this.colorRgb;return`rgb(${a[0]*r[0]*s}, ${a[1]*r[1]*s}, ${a[2]*r[2]*s})`}}const rh=()=>{nh.registerPlugin("DirectionalLight",sh)};class ah{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=jr.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=jr.allocate());const{pos:t,center:e,up:n}=this.params.viewParams;return function(t,e,n,s){let r,a,o,l,h,c,d,u,p,g;const f=e[0],m=e[1],y=e[2],b=s[0],v=s[1],x=s[2],_=n[0],A=n[1],S=n[2];Math.abs(f-_)<i.epsilon&&Math.abs(m-A)<i.epsilon&&Math.abs(y-S)<i.epsilon?Rr(t):(d=f-_,u=m-A,p=y-S,g=1/Math.hypot(d,u,p),d*=g,u*=g,p*=g,r=v*p-x*u,a=x*d-b*p,o=b*u-v*d,g=Math.hypot(r,a,o),g?(g=1/g,r*=g,a*=g,o*=g):(r=0,a=0,o=0),l=u*o-p*a,h=p*r-d*o,c=d*a-u*r,g=Math.hypot(l,h,c),g?(g=1/g,l*=g,h*=g,c*=g):(l=0,h=0,c=0),t[0]=r,t[1]=l,t[2]=d,t[3]=0,t[4]=a,t[5]=h,t[6]=u,t[7]=0,t[8]=o,t[9]=c,t[10]=p,t[11]=0,t[12]=-(r*f+a*m+o*y),t[13]=-(l*f+h*m+c*y),t[14]=-(d*f+u*m+p*y),t[15]=1)}(this._viewMatrixCached,t,e,n),this._vp||(this._vp=jr.allocate()),this._vp=Ir(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}getProjectionMatrix(){return this._projectionMatrixCached||(this._projectionMatrixCached=jr.allocate()),this._projectionMatrixCached}forceGetProjectionMatrix(){this._projectionMatrixCached||(this._projectionMatrixCached=jr.allocate());const{left:t,top:e,right:i,bottom:n}=this._params;return function(t,e,i,n,s,r,a){const o=1/(e-i),l=1/(n-s),h=1/(r-a);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]=(s+n)*l,t[14]=(a+r)*h,t[15]=1}(this._projectionMatrixCached,t,i,n,e,0,-2e6),this._vp||(this._vp=jr.allocate()),this._vp=Ir(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}getField(){const{fieldRatio:t=.8,fieldDepth:e,left:i,right:n}=this._params;return(null!=e?e:n-i)*t}getProjectionScale(t){const e=this.getField();return e/(e+t)}view(t,e,i){const n=[0,0,0];return Er(n,[t,e,i],this._viewMatrixCached),n}vp(t,e,i){const n=[0,0,0],{pos:s}=this._params.viewParams;Er(n,[t,e,i],this._viewMatrixCached),t=n[0],e=n[1],i=n[2];const r=this.getProjectionScale(i);return{x:t*r+s[0],y:e*r+s[1]}}}const oh=()=>{nh.registerPlugin("OrthoCamera",ah)};let lh=!1;const hh=new gt((t=>{lh||(lh=!0,t(hl).toSelf().inSingletonScope(),t(zl).to(hl).inSingletonScope(),t(Gl).toService(zl),t(xa).toService(Do),Vt(t,xa))}));let ch=!1;const dh=new gt((t=>{ch||(ch=!0,t(yl).toSelf().inSingletonScope(),t(Yl).to(yl).inSingletonScope(),t(Gl).toService(Yl),t(qo).toSelf(),t(Yo).toSelf(),t(Sa).toService(qo),t(Sa).toService(Yo),t(Sa).toService(Do),Vt(t,Sa))}));let uh=!1;const ph=new gt((t=>{uh||(uh=!0,t(pl).toSelf().inSingletonScope(),t(ih).toSelf().inSingletonScope(),t(Hl).to(pl).inSingletonScope(),t(Gl).toService(Hl))}));let gh=!1;const fh=new gt((t=>{gh||(gh=!0,t(_l).toSelf().inSingletonScope(),t($l).to(_l).inSingletonScope(),t(Gl).toService($l),t(Ta).toService(Do),Vt(t,Ta))}));let mh=!1;const yh=new gt((t=>{mh||(mh=!0,t(Kl).to(Bl).inSingletonScope(),t(Gl).toService(Kl),t(wa).toService(Do),Vt(t,wa))}));let bh=!1;const vh=new gt((t=>{bh||(bh=!0,t(Xl).to(Dl).inSingletonScope(),t(Gl).toService(Xl),t(Aa).toService(Do),Vt(t,Aa))}));var xh=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},_h=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Ah=class extends rl{constructor(){super(),this.numberType=wr,this.builtinContributions=[Sl],this.init()}drawShape(t,e,i,n,s){const r=Cn(t).richtext,{strokeOpacity:a=r.strokeOpacity,opacity:o=r.opacity,fillOpacity:l=r.fillOpacity,visible:h=r.visible}=t.attribute;if(!t.valid||!h)return;const c=pa(o,l,!0),d=pa(o,a,!0);c&&(e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,r),e.translate(i,n),this.beforeRenderStep(t,e,i,n,c,d,c,d,r,s),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,i,n,c,d,c,d,r,s))}drawIcon(t,e,i,n,s){var r;const a=Cn(t).richtextIcon,{width:o=a.width,height:l=a.height,opacity:h=a.opacity,image:c,backgroundFill:d=a.backgroundFill,backgroundFillOpacity:u=a.backgroundFillOpacity,backgroundStroke:p=a.backgroundStroke,backgroundStrokeOpacity:g=a.backgroundStrokeOpacity,backgroundRadius:f=a.backgroundRadius,margin:m}=t.attribute,{backgroundWidth:y=o,backgroundHeight:b=l}=t.attribute;if(m&&(i+=t._marginArray[3],n+=t._marginArray[0]),t._hovered){const t=(y-o)/2,s=(b-l)/2;0===f?(e.beginPath(),e.rect(i-t,n-s,y,b)):(e.beginPath(),Go(e,i-t,n-s,y,b,f,!0)),d&&(e.globalAlpha=u,e.fillStyle=d,e.fill()),p&&(e.globalAlpha=g,e.strokeStyle=p,e.stroke())}const v=c&&(null===(r=null==t?void 0:t.resources)||void 0===r?void 0:r.get(c));v&&"success"===v.state&&(e.globalAlpha=h,e.drawImage(v.data,i,n,o,l))}draw(t,e,i){const n=Cn(t).richtext;this._draw(t,n,!1,i)}};Ah=xh([wt(),_h("design:paramtypes",[])],Ah);let Sh=!1;const Th=new gt((t=>{Sh||(Sh=!0,t(Zl).to(Ah).inSingletonScope(),t(Gl).toService(Zl))}));let wh=!1;const Mh=new gt((t=>{wh||(wh=!0,t(Ql).to(Wl).inSingletonScope(),t(Gl).toService(Ql),t(_a).toService(Do),Vt(t,_a))}));class Bh extends rl{stroke(t,e,i,n,s){const r=n.vertices;n.edges.forEach((n=>{const a=r[n[0]],o={x:t+a[0],y:e+a[1],z:i+a[2]},l=r[n[1]],h={x:t+l[0],y:e+l[1],z:i+l[2]};s.beginPath(),s.moveTo(o.x,o.y,o.z),s.lineTo(h.x,h.y,h.z),s.stroke()}))}fill(t,e,i,n,s,r,a,o,l,h,c){const d=Hr.Get(r,Gr.Color255),u=n.vertices,p=u.map((t=>a.view(t[0],t[1],t[2])[2])),g=[];n.polygons.forEach(((t,e)=>{if(s&&!s[e])return;g.push({faceIdx:e,polygon:t});const{polygon:i}=t,n=p[i[0]],r=p[i[1]],a=p[i[2]],o=p[i[3]];t.ave_z=n+r+a+o})),g.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),g.forEach((n=>{const{polygon:s,normal:p}=n.polygon,g=u[s[0]],f=u[s[1]],m=u[s[2]],y=u[s[3]],b={x:t+g[0],y:e+g[1],z:i+g[2]},v={x:t+f[0],y:e+f[1],z:i+f[2]},x={x:t+m[0],y:e+m[1],z:i+m[2]},_={x:t+y[0],y:e+y[1],z:i+y[2]};a.beginPath(),a.moveTo(b.x,b.y,b.z),a.lineTo(v.x,v.y,v.z),a.lineTo(x.x,x.y,x.z),a.lineTo(_.x,_.y,_.z),a.closePath(),c?c(a,l&&l.attribute,h):(a.fillStyle=o?o.computeColor(p,d):r,a.fill())}))}}var Ch=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let kh=class extends Bh{constructor(){super(...arguments),this.type="rect3d",this.numberType=Tr}drawShape(t,e,i,n,s,r,a,o){var l;const h=Cn(t,null==r?void 0:r.theme).rect,{fill:c=h.fill,stroke:d=h.stroke,x1:u,y1:p,x:g,y:f,opacity:m=h.opacity,fillOpacity:y=h.fillOpacity,lineWidth:b=h.lineWidth,strokeOpacity:v=h.strokeOpacity,visible:x=h.visible}=t.attribute;let{width:_,height:A}=t.attribute;_=(null!=_?_:u-g)||0,A=(null!=A?A:p-f)||0;const S=null!==(l=this.z)&&void 0!==l?l:0,T=ga(m,y,_,A,c),w=ma(m,v,_,A),M=da(c),B=ua(d,b);if(!t.valid||!x)return;if(!M&&!B)return;if(!(T||w||a||o))return;const{light:C}=s.stage||{},k=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,h);let s=c;"string"!=typeof s&&(s="black"),this.fill(i,n,S,k,null,s,e,C,null,null,a)}!1!==d&&(e.setStrokeStyle(t,t.attribute,i,n,h),this.stroke(i,n,S,k,e))}draw(t,e,i){const n=Cn(t).rect;this._draw(t,n,!1,i)}};kh=Ch([wt()],kh);let Ph=!1;const Oh=new gt((t=>{Ph||(Ph=!0,t(ql).to(kh).inSingletonScope(),t(Gl).toService(ql))}));var Rh=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let Lh=class extends rl{constructor(){super(...arguments),this.numberType=fr}drawShape(t,e,n,s,r,a,o,l){var h;const c=Cn(t,null==a?void 0:a.theme).arc,{fill:d=c.fill}=t.attribute,u=this.valid(t,c,o,l);if(!u)return;const{fVisible:p,sVisible:g,doFill:f,doStroke:m}=u,y=null!==(h=this.z)&&void 0!==h?h:0,{outerPadding:b=c.outerPadding,innerPadding:v=c.innerPadding,height:x=10}=t.attribute;let{outerRadius:_=c.outerRadius,innerRadius:A=c.innerRadius}=t.attribute;_+=b,A-=v;const S=Hr.Get(d,Gr.Color255),{light:T}=r.stage||{},w=r.hack_pieFace,M={top:y,bottom:y+x},B={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===w||"top"===w?(e.beginPath(),function(t,e,n,s,r,a,o){const{startAngle:l,endAngle:h}=t.getParsedAngle(),c=i.abs(h-l),d=h>l;let u=!1;if(a<o){const t=a;a=o,o=t}if(a<=i.epsilon)e.moveTo(n,s,r);else if(c>=i.pi2-i.epsilon)e.moveTo(n+a*i.cos(l),s+a*i.sin(l),r),e.arc(n,s,a,l,h,!d,r),o>i.epsilon&&(e.moveTo(n+o*i.cos(h),s+o*i.sin(h),r),e.arc(n,s,o,h,l,d,r));else{const{outerDeltaAngle:c,innerDeltaAngle:p,outerStartAngle:g,outerEndAngle:f,innerEndAngle:m,innerStartAngle:y}=t.getParsePadAngle(l,h),b=a*i.cos(g),v=a*i.sin(g),x=o*i.cos(m),_=o*i.sin(m);c<.001?u=!0:(e.moveTo(n+b,s+v,r),e.arc(n,s,a,g,f,!d,r)),!(o>i.epsilon)||p<.001?(e.lineTo(n+x,s+_,r),u=!0):(e.lineTo(n+x,s+_,r),e.arc(n,s,o,m,y,d,r))}e.closePath()}(t,e,n,s,M[w],_,A),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,c),f&&(o?o(e,t.attribute,c):p&&(e.setCommonStyle(t,t.attribute,n,s,c),e.fillStyle=T?T.computeColor(B[w],S):d,e.fill())),m&&(l?l(e,t.attribute,c):g&&(e.setStrokeStyle(t,t.attribute,n,s,c),e.stroke()))):"outside"!==w&&"inside"!==w||("inside"===w&&(e.save(),e.beginPath(),e.arc(n,s,A,0,i.pi2,!0,M.top),e.clip()),e.beginPath(),function(t,e,n,s,r,a,o,l){const{startAngle:h,endAngle:c}=t.getParsedAngle(),d=i.abs(c-h),u=c>h;let p=!1;if(o<=i.epsilon)e.moveTo(n,s,r);else if(d>=i.pi2-i.epsilon)e.moveTo(n+o*i.cos(h),s+o*i.sin(h),r),e.arc(n,s,o,h,c,!u,r),e.lineTo(n+o*i.cos(c),s+o*i.sin(c),a),e.arc(n,s,o,c,h,u,a);else{const{innerouterDeltaAngle:t,innerouterStartAngle:d,innerouterEndAngle:g}=l(h,c),f=o*i.cos(d),m=o*i.sin(d),y=o*i.cos(g),b=o*i.sin(g);t<.001?p=!0:(e.moveTo(n+f,s+m,r),e.arc(n,s,o,d,g,!u,r),e.lineTo(n+y,s+b,a),e.arc(n,s,o,g,d,u,a))}e.closePath()}(t,e,n,s,M.top,M.bottom,"outside"===w?_:A,((e,i)=>{const{outerDeltaAngle:n,innerDeltaAngle:s,outerStartAngle:r,outerEndAngle:a,innerEndAngle:o,innerStartAngle:l}=t.getParsePadAngle(e,i);return"outside"===w?{innerouterDeltaAngle:n,innerouterEndAngle:a,innerouterStartAngle:r}:{innerouterDeltaAngle:s,innerouterEndAngle:o,innerouterStartAngle:l}})),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,c),f&&(o?o(e,t.attribute,c):p&&(e.setCommonStyle(t,t.attribute,n,s,c),e.fillStyle=T?T.computeColor(B[w],S):d,e.fill())),m&&(l?l(e,t.attribute,c):g&&(e.setStrokeStyle(t,t.attribute,n,s,c),e.stroke())),"inside"===w&&e.restore())}draw(t,e,i,n){const s=Cn(t,null==n?void 0:n.theme).arc;this._draw(t,s,!1,i,n)}};Lh=Rh([wt()],Lh);let Ih=!1;const Eh=new gt((t=>{Ih||(Ih=!0,t(Vl).to(Lh).inSingletonScope(),t(Gl).toService(Vl))}));var Dh=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let Fh=class extends Bh{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=Ar}drawShape(t,e,i,n,s,r,a,o){var l;const h=Cn(t,null==r?void 0:r.theme).polygon,{fill:c=h.fill,stroke:d=h.stroke,face:u=[!0,!0,!0,!0,!0,!0]}=t.attribute,p=null!==(l=this.z)&&void 0!==l?l:0;if(!this.valid(t,h,a,o))return;const{light:g}=s.stage||{},f=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,h);let s=c;"string"!=typeof s&&(s="black"),this.fill(i,n,p,f,u,s,e,g,t,h,a)}!1!==d&&(e.setStrokeStyle(t,t.attribute,i,n,h),this.stroke(i,n,p,f,e))}draw(t,e,i){const n=Cn(t).polygon;this._draw(t,n,!1,i)}};Fh=Dh([wt()],Fh);let jh=!1;const Uh=new gt((t=>{jh||(jh=!0,t(Jl).to(Fh).inSingletonScope(),t(Gl).toService(Jl))}));class Nh{constructor(){this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=pt.GenAutoIncrementId(),this.key=this.name+this._uid,this.onMouseDown=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!0,this.pageX=t.page.x,this.pageY=t.page.y)},this.onMouseUp=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!1)},this.onMouseMove=t=>{var e,i;const n=this.pluginService.stage;if(this.option3d||(this.option3d=n.option3d),this.option3d&&this.mousedown)if(this.pageX&&this.pageY){const s=t.page.x-this.pageX,r=t.page.y-this.pageY;this.pageX=t.page.x,this.pageY=t.page.y;const a=s/100,o=r/100;this.option3d.alpha=(null!==(e=this.option3d.alpha)&&void 0!==e?e:0)+a,this.option3d.beta=(null!==(i=this.option3d.beta)&&void 0!==i?i:0)+o,n.set3dOptions(this.option3d),n.renderNextFrame()}else this.pageX=t.page.x,this.pageY=t.page.y}}activate(t){this.pluginService=t;const e=t.stage;this.option3d=e.option3d,e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mousemove",this.onMouseMove)}deactivate(t){const e=t.stage;e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mousemove",this.onMouseMove)}}const Wh=t=>t.zField||t.series&&t.series.some((t=>t.zField));class zh extends e.BasePlugin{constructor(){super(zh.type),this.type="VChart3dPlugin"}onInit(t,e){var i,n;if(this._is3d=!!(n=e)&&((t=>"bar3d"===t||"funnel3d"===t||"histogram3d"===t||"pie3d"===t||"rangeColumn3d"===t||"wordCloud3d"===t)(n.type)||Wh(n),!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&&Wh(e)&&(e.layout={type:"layout3d"})}}zh.pluginType="chart",zh.type="VChart3dPlugin";const Vh=()=>{e.registerChartPlugin(zh),rh(),oh(),nh.registerPlugin("ViewTransform3dPlugin",Nh)},Gh={label:{name:"label",type:"text"},bar3d:{name:"bar3d",type:"rect3d"}};class Hh extends e.BarSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"bar3d")}}const Xh=Symbol.for("MathPickerContribution"),Yh=Symbol.for("MathArcPicker"),qh=Symbol.for("MathImagePicker"),$h=Symbol.for("MathLinePicker"),Kh=Symbol.for("MathRectPicker"),Zh=Symbol.for("MathSymbolPicker"),Jh=Symbol.for("MathTextPicker"),Qh=Symbol.for("MathPolygonPicker"),tc=Symbol.for("CanvasArcPicker"),ec=Symbol.for("CanvasArc3dPicker"),ic=Symbol.for("CanvasImagePicker"),nc=Symbol.for("CanvasLinePicker"),sc=Symbol.for("CanvasRectPicker"),rc=Symbol.for("CanvasRect3dPicker"),ac=Symbol.for("CanvasSymbolPicker"),oc=Symbol.for("CanvasTextPicker"),lc=Symbol.for("CanvasPolygonPicker"),hc=Symbol.for("CanvasPyramid3dPicker"),cc=Symbol.for("CanvasRichTextPicker"),dc=Symbol.for("CanvasPickerContribution");class uc{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;if(!this.canvasRenderer)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.getGraphicTheme();n.highPerformanceSave();let{x:r=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);r+=e.x,a+=e.y,n.setTransformForCurrent()}else r=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1,l=!1;return this.canvasRenderer.drawShape(t,n,r,a,{},null,((t,i,n,s)=>!(!o&&!l)||(o=t.isPointInPath(e.x,e.y),l=s||l,o)),((t,i,s,r)=>{if(o||l)return!0;const a=i.lineWidth||s.lineWidth,h=i.pickStrokeBuffer||s.pickStrokeBuffer,c=i.keepStrokeScale||s.keepStrokeScale;return n.lineWidth=c?a+h:Oi(n,a+h,n.dpr),o=t.isPointInStroke(e.x,e.y),l=r||l,o})),n.highPerformanceRestore(),o}}var pc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},gc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fc=function(t,e){return function(i,n){e(i,n,t)}};let mc=class extends uc{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=gr}};mc=pc([wt(),fc(0,St(zl)),gc("design:paramtypes",[Object])],mc);let yc=!1;const bc=new gt(((t,e,i,n)=>{yc||(yc=!0,t(Yh).to(mc).inSingletonScope(),t(Xh).toService(Yh))}));var vc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let xc=class{constructor(){this.type="image",this.numberType=br}contains(t,e,i){const{pickContext:n}=null!=i?i:{};return!!n&&!!t.AABBBounds.containsPoint(e)}};xc=vc([wt()],xc);let _c=!1;const Ac=new gt(((t,e,i,n)=>{_c||(_c=!0,t(qh).to(xc).inSingletonScope(),t(xc).toService(qh))}));var Sc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Tc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},wc=function(t,e){return function(i,n){e(i,n,t)}};let Mc=class extends uc{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=vr}};Mc=Sc([wt(),wc(0,St(Hl)),Tc("design:paramtypes",[Object])],Mc);let Bc=!1;const Cc=new gt(((t,e,i,n)=>{Bc||(Bc=!0,t($h).to(Mc).inSingletonScope(),t(Xh).toService($h))}));var kc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Pc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Oc=function(t,e){return function(i,n){e(i,n,t)}};let Rc=class extends uc{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=_r}};Rc=kc([wt(),Oc(0,St(Xl)),Pc("design:paramtypes",[Object])],Rc);let Lc=!1;const Ic=new gt(((t,e,i,n)=>{Lc||(Lc=!0,t(Qh).to(Rc).inSingletonScope(),t(Xh).toService(Qh))})),Ec=new i.AABBBounds;class Dc{constructor(){this.type="rect",this.numberType=Sr}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:s}=null!=n?n:{};if(!s)return!1;const r=t.getGraphicTheme(),{cornerRadius:a=r.cornerRadius}=t.attribute;let{x:o=r.x,y:l=r.y}=t.attribute;s.highPerformanceSave();let h=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);o+=e.x,l+=e.y,s.setTransformForCurrent()}else o=0,l=0,h=!1,s.transformFromMatrix(t.transMatrix,!0);let c=!0;if(!h||t.shadowRoot||i.isNumber(a,!0)&&0!==a||i.isArray(a)&&a.some((t=>0!==t)))c=!1,this.canvasRenderer.drawShape(t,s,o,l,{},null,((t,i,n)=>!!c||(c=t.isPointInPath(e.x,e.y),c)),((t,i,n)=>{if(c)return!0;const r=i.lineWidth||n.lineWidth,a=i.pickStrokeBuffer||n.pickStrokeBuffer,o=i.keepStrokeScale||n.keepStrokeScale;return s.lineWidth=o?r+a:Oi(s,r+a,s.dpr),c=t.isPointInStroke(e.x,e.y),c}));else{const{fill:i=r.fill,stroke:n=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(i)c=!0;else if(n){const i=t.AABBBounds;Ec.setValue(i.x1,i.y1,i.x2,i.y2),Ec.expand(-s/2),c=!Ec.containsPoint(e)}}return s.highPerformanceRestore(),c}}var Fc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},jc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Uc=function(t,e){return function(i,n){e(i,n,t)}};let Nc=class extends Dc{constructor(t){super(),this.canvasRenderer=t}};Nc=Fc([wt(),Uc(0,St(Yl)),jc("design:paramtypes",[Object])],Nc);let Wc=!1;const zc=new gt(((t,e,i,n)=>{Wc||(Wc=!0,t(Kh).to(Nc).inSingletonScope(),t(Xh).toService(Kh))}));let Vc=!1;const Gc=new gt(((t,e,i,n)=>{Vc||(Vc=!0,t(qh).to(xc).inSingletonScope(),t(xc).toService(qh))}));var Hc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Xc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Yc=function(t,e){return function(i,n){e(i,n,t)}};let qc=class extends uc{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Mr}};qc=Hc([wt(),Yc(0,St($l)),Xc("design:paramtypes",[Object])],qc);let $c=!1;const Kc=new gt(((t,e,i,n)=>{$c||($c=!0,t(Zh).to(qc).inSingletonScope(),t(Xh).toService(Zh))}));var Zc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let Jc=class{constructor(){this.type="text",this.numberType=Br}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};Jc=Zc([wt()],Jc);let Qc=!1;const td=new gt(((t,e,i,n)=>{Qc||(Qc=!0,t(Jh).to(Jc).inSingletonScope(),t(Xh).toService(Jh))}));var ed=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},id=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},nd=function(t,e){return function(i,n){e(i,n,t)}};let sd=class extends uc{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=gr}};sd=ed([wt(),nd(0,St(zl)),id("design:paramtypes",[Object])],sd);let rd=!1;const ad=new gt(((t,e,i,n)=>{rd||(rd=!0,t(tc).to(sd).inSingletonScope(),t(dc).toService(tc))}));var od=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},ld=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},hd=function(t,e){return function(i,n){e(i,n,t)}};let cd=class extends Dc{constructor(t){super(),this.canvasRenderer=t}};cd=od([wt(),hd(0,St(Yl)),ld("design:paramtypes",[Object])],cd);let dd=!1;const ud=new gt(((t,e,i,n)=>{dd||(dd=!0,t(sc).to(cd).inSingletonScope(),t(dc).toService(sc))}));class pd extends rl{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;n.highPerformanceSave();const s=t.getGraphicTheme(),r=this.transform(t,s,n),{x:a,y:o,z:l,lastModelMatrix:h}=r;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let d=!1;return this.canvasRenderer.drawShape(t,n,a,o,{},null,(t=>!!d||(d=t.isPointInPath(c.x,c.y),d)),((t,e,i)=>{if(d)return!0;const s=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer,a=e.keepStrokeScale||i.keepStrokeScale;return n.lineWidth=a?s+r:Oi(n,s+r,n.dpr),d=t.isPointInStroke(c.x,c.y),d})),this.canvasRenderer.z=0,n.modelMatrix!==h&&jr.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),d}}var gd=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},fd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},md=function(t,e){return function(i,n){e(i,n,t)}};let yd=class extends pd{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=vr}};yd=gd([wt(),md(0,St(Hl)),fd("design:paramtypes",[Object])],yd);let bd=!1;const vd=new gt(((t,e,i,n)=>{bd||(bd=!0,t(nc).to(yd).inSingletonScope(),t(dc).toService(nc))}));class xd extends rl{contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.getGraphicTheme();n.highPerformanceSave();const r=this.transform(t,s,n),{x:a,y:o,z:l,lastModelMatrix:h}=r;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let d=!1;return this.canvasRenderer.drawShape(t,n,a,o,i,null,((t,e,i)=>!!d||(d=t.isPointInPath(c.x,c.y),d))),this.canvasRenderer.z=0,n.modelMatrix!==h&&jr.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),d}}var _d=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Ad=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Sd=function(t,e){return function(i,n){e(i,n,t)}};let Td=class extends xd{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Mr}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.getParsedPath();if(!n.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(s.isSvg||"imprecise"===t.attribute.pickMode)return!0}n.highPerformanceSave();const r=t.getGraphicTheme(),a=this.transform(t,r,n),{x:o,y:l,z:h,lastModelMatrix:c}=a;let d=e;if(n.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,n,o,l,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(d.x,d.y),u)),((t,e,i)=>{if(u)return!0;const s=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer,a=e.keepStrokeScale||i.keepStrokeScale;return n.lineWidth=a?s+r:Oi(n,s+r,n.dpr),u=t.isPointInStroke(d.x,d.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==c&&jr.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),u}};Td=_d([wt(),Sd(0,St($l)),Ad("design:paramtypes",[Object])],Td);let wd=!1;const Md=new gt(((t,e,i,n)=>{wd||(wd=!0,t(ac).to(Td).inSingletonScope(),t(dc).toService(ac))}));var Bd=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Cd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},kd=function(t,e){return function(i,n){e(i,n,t)}};let Pd=class extends xd{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=Br}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.AABBBounds;if(!n.camera)return!!s.containsPoint(e);n.highPerformanceSave();const r=t.getGraphicTheme(),{keepDirIn3d:a=r.keepDirIn3d}=t.attribute,o=!a,l=this.transform(t,r,n,o),{x:h,y:c,z:d,lastModelMatrix:u}=l;this.canvasRenderer.z=d;let p=e;if(n.camera){p=e.clone();const i=t.parent.globalTransMatrix;p.x=i.a*e.x+i.c*e.y+i.e,p.y=i.b*e.x+i.d*e.y+i.f}let g=!1;return this.canvasRenderer.drawShape(t,n,h,c,{},null,((e,i,n)=>{if(g)return!0;const{fontSize:s=r.fontSize,textBaseline:a=r.textBaseline,textAlign:o=r.textAlign}=t.attribute,l=t.AABBBounds,u=l.height(),f=l.width(),m=Ca(a,u,s),y=Ba(o,f);return e.rect(y+h,m+c,f,u,d),g=e.isPointInPath(p.x,p.y),g}),((t,e,i)=>g)),this.canvasRenderer.z=0,n.modelMatrix!==u&&jr.free(n.modelMatrix),n.modelMatrix=u,n.highPerformanceRestore(),g}};Pd=Bd([wt(),kd(0,St(Kl)),Cd("design:paramtypes",[Object])],Pd);let Od=!1;const Rd=new gt(((t,e,i,n)=>{Od||(Od=!0,t(oc).to(Pd).inSingletonScope(),t(dc).toService(oc))}));var Ld=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Id=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ed=function(t,e){return function(i,n){e(i,n,t)}};let Dd=class extends uc{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=_r}};Dd=Ld([wt(),Ed(0,St(Xl)),Id("design:paramtypes",[Object])],Dd);let Fd=!1;const jd=new gt(((t,e,i,n)=>{Fd||(Fd=!0,t(lc).to(Dd).inSingletonScope(),t(dc).toService(lc))}));var Ud=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Nd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Wd=function(t,e){return function(i,n){e(i,n,t)}};let zd=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=wr}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};zd=Ud([wt(),Wd(0,St(Zl)),Nd("design:paramtypes",[Object])],zd);let Vd=!1;const Gd=new gt(((t,e,i,n)=>{Vd||(Vd=!0,t(cc).to(zd).inSingletonScope(),t(dc).toService(cc))}));var Hd=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Xd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Yd=function(t,e){return function(i,n){e(i,n,t)}};let qd=class extends uc{constructor(t){super(),this.canvasRenderer=t,this.type="image",this.numberType=br}};qd=Hd([wt(),Yd(0,St(Ql)),Xd("design:paramtypes",[Object])],qd);let $d=!1;const Kd=new gt(((t,e,i,n)=>{$d||($d=!0,t(ic).to(qd).inSingletonScope(),t(dc).toService(ic))}));var Zd=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Jd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Qd=function(t,e){return function(i,n){e(i,n,t)}};let tu=class extends xd{constructor(t){super(),this.canvasRenderer=t,this.type="rect3d",this.numberType=Tr,this.themeType="rect"}};tu=Zd([wt(),Qd(0,St(ql)),Jd("design:paramtypes",[Object])],tu);let eu=!1;const iu=new gt(((t,e,i,n)=>{eu||(eu=!0,t(rc).to(tu).inSingletonScope(),t(dc).toService(rc))}));var nu=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},su=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ru=function(t,e){return function(i,n){e(i,n,t)}};let au=class extends xd{constructor(t){super(),this.canvasRenderer=t,this.type="arc3d",this.numberType=fr,this.themeType="arc"}};au=nu([wt(),ru(0,St(Vl)),su("design:paramtypes",[Object])],au);let ou=!1;const lu=new gt(((t,e,i,n)=>{ou||(ou=!0,t(ec).to(au).inSingletonScope(),t(dc).toService(ec))}));var hu=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},cu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},du=function(t,e){return function(i,n){e(i,n,t)}};let uu=class extends xd{constructor(t){super(),this.canvasRenderer=t,this.type="pyramid3d",this.numberType=Ar,this.themeType="polygon"}};uu=hu([wt(),du(0,St(Jl)),cu("design:paramtypes",[Object])],uu);let pu=!1;const gu=new gt(((t,e,i,n)=>{pu||(pu=!0,t(hc).to(uu).inSingletonScope(),t(dc).toService(hc))})),fu=function(){!function(){if(null==eh)try{const t=document.createElement("canvas"),e=t.getContext("2d");eh=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),eh&&(eh=!!document.createElement)}catch(t){eh=!1}}();const t=Xt.global&&Xt.global.env;return t?"browser"===t:eh}();function mu(){mu.__loaded||(mu.__loaded=!0,Co.RegisterGraphicCreator("arc",bo),Vi.load(hh),Vi.load(fu?ad:bc))}mu.__loaded=!1;const yu=mu;function bu(){bu.__loaded||(bu.__loaded=!0,Co.RegisterGraphicCreator("arc3d",xo),rh(),oh(),Vi.load(Eh),Vi.load(lu))}bu.__loaded=!1;const vu=bu;function xu(){xu.__loaded||(xu.__loaded=!0,Co.RegisterGraphicCreator("group",ca))}xu.__loaded=!1;const _u=xu;function Au(){Au.__loaded||(Au.__loaded=!0,Co.RegisterGraphicCreator("image",io),Vi.load(Mh),Vi.load(fu?Kd:Ac))}Au.__loaded=!1;const Su=Au;function Tu(){Tu.__loaded||(Tu.__loaded=!0,Co.RegisterGraphicCreator("line",Ga),Vi.load(ph),Vi.load(fu?vd:Cc))}Tu.__loaded=!1;const wu=Tu;function Mu(){Mu.__loaded||(Mu.__loaded=!0,Co.RegisterGraphicCreator("polygon",So),Vi.load(vh),Vi.load(fu?jd:Ic))}Mu.__loaded=!1;const Bu=Mu;function Cu(){Cu.__loaded||(Cu.__loaded=!0,Co.RegisterGraphicCreator("pyramid3d",wo),rh(),oh(),Vi.load(Uh),Vi.load(gu))}Cu.__loaded=!1;const ku=Cu;function Pu(){Pu.__loaded||(Pu.__loaded=!0,Co.RegisterGraphicCreator("rect",Ya),Vi.load(dh),Vi.load(fu?ud:zc))}Pu.__loaded=!1;const Ou=Pu;function Ru(){Ru.__loaded||(Ru.__loaded=!0,Co.RegisterGraphicCreator("rect3d",Ka),Vi.load(Oh),Vi.load(iu))}Ru.__loaded=!1;const Lu=Ru;function Iu(){Iu.__loaded||(Iu.__loaded=!0,Co.RegisterGraphicCreator("richtext",ho),Vi.load(Th),Vi.load(fu?Gd:Gc))}Iu.__loaded=!1;const Eu=Iu;function Du(){Du.__loaded||(Du.__loaded=!0,Co.RegisterGraphicCreator("shadowRoot",Bo))}Du.__loaded=!1;const Fu=Du;function ju(){ju.__loaded||(ju.__loaded=!0,Co.RegisterGraphicCreator("symbol",Wa),Vi.load(fh),Vi.load(fu?Md:Kc))}ju.__loaded=!1;const Uu=ju;function Nu(){Nu.__loaded||(Nu.__loaded=!0,Co.RegisterGraphicCreator("text",ja),Vi.load(yh),Vi.load(fu?Rd:td))}Nu.__loaded=!1;const Wu=Nu;class zu 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=zu.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}zu.type="rect3d";const Vu=()=>{e.Factory.registerMark(zu.type,zu),Fu(),Lu(),e.registerRectAnimation(),e.Factory.registerGraphicComponent("rect3d",Ka)};class Gu extends e.BarSeries{constructor(){super(...arguments),this.type=ct.bar3d,this._barMarkName="bar3d",this._barMarkType="rect3d",this.transformerConstructor=Hh}}Gu.type=ct.bar3d,Gu.mark=Gh,Gu.builtInTheme={bar3d:{bar3d:{style:{length:3}},label:{visible:!1,style:{offset:12,position:"outside"}}}},Gu.transformerConstructor=Hh;const Hu=()=>{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)}))),Vu(),e.registerCartesianBandAxis(),e.registerCartesianLinearAxis(),e.Factory.registerSeries(Gu.type,Gu)};class Xu extends e.Layout{layoutItems(t,i,n,s){this._layoutInit(t,i,n,s);const r={recomputeWidth:this.recomputeWidth,recomputeHeight:this.recomputeHeight};this._layoutNormalItems(i,r);const a={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,r),this._processAutoIndent(c,d,u,g,p,a,r);const f=o.filter((t=>"z"!==t.layoutOrient));this.layoutAbsoluteItems(f);const m=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(m&&l.length){const t=m.getLayoutStartPoint(),e=m.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 n=m.getLayoutRect(),s=y.getLayoutRect(),r={length:l[0].getLayoutRect().width,width:n.width,height:s.height};m.model.setLayout3dBox&&m.model.setLayout3dBox(r),y.model.setLayout3dBox&&y.model.setLayout3dBox(r),l[0].model.setLayout3dBox&&l[0].model.setLayout3dBox(r),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,n=this._chartViewBox.y2-this._chartViewBox.y1-this.bottomCurrent;return t.forEach((t=>{if(!t.getModelVisible()||!t.autoIndent)return;const s="left"===t.layoutOrient||"right"===t.layoutOrient,r=t.getLastComputeOutBounds();s?(e.top=Math.max(e.top,r.y1-this.topCurrent),e.bottom=Math.max(e.bottom,r.y2-n)):(e.left=Math.max(e.left,r.x1-this.leftCurrent),e.right=Math.max(e.right,r.x2-i))})),e}}Xu.type="layout3d";const Yu=()=>{e.Factory.registerLayout(Xu.type,Xu)};class qu extends e.BarChart{constructor(){super(...arguments),this.transformerConstructor=ot,this.type="bar3d",this.seriesType=ct.bar3d}}qu.type="bar3d",qu.seriesType=ct.bar3d,qu.transformerConstructor=ot;const $u=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 Ku extends e.FunnelSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"funnel3d"),t.isTransform&&this._addMarkLabelSpec(t,"transform3d","transformLabel")}}class Zu extends e.BasePolygonMark{_getDefaultStyle(){const t=super._getDefaultStyle();return t.stroke=!1,t}constructor(t,e){super(t,e),this.type=Zu.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}Zu.type="pyramid3d";const Ju=e.getFunnelTheme(!0);class Qu extends e.FunnelSeries{constructor(){super(...arguments),this.type=ct.funnel3d,this._funnelMarkName="funnel3d",this._funnelMarkType="pyramid3d",this._transformMarkName="transform3d",this._transformMarkType="pyramid3d",this.transformerConstructor=Ku}initMark(){var t,e,i,n,s,r,a,o;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},Qu.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({},Qu.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===(n=null===(i=this._spec)||void 0===i?void 0:i.outerLabel)||void 0===n?void 0:n.visible){const{line:t}=null!==(s=this._spec.outerLabel)&&void 0!==s?s:{},{line:e}=null!==(a=null===(r=this._theme)||void 0===r?void 0:r.outerLabel)&&void 0!==a?a:{};this._funnelOuterLabelMark.label=this._createMark(Qu.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(Qu.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,n;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===(n=this._funnelOuterLabelMark)||void 0===n||n.line}}Qu.type=ct.funnel3d,Qu.mark=$u,Qu.builtInTheme={funnel3d:Ju},Qu.transformerConstructor=Ku;const tp=()=>{e.Factory.registerMark(Zu.type,Zu),Fu(),ku(),e.registerPolygonAnimation(),e.Factory.registerGraphicComponent("pyramid3d",wo),e.registerTextMark(),e.registerRuleMark(),e.Factory.registerSeries(Qu.type,Qu)};class ep extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=e.FunnelChartSpecTransformer,this.type="funnel3d",this.seriesType=ct.funnel3d}}ep.type="funnel3d",ep.seriesType=ct.funnel3d,ep.transformerConstructor=e.FunnelChartSpecTransformer;class ip extends e.BaseHistogramChart{constructor(){super(...arguments),this.transformerConstructor=e.HistogramChartSpecTransformer,this.type="histogram3d",this.seriesType=ct.bar3d}_setModelOption(){this._modelOption.getDimensionInfo=e.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=e.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=e.getCartesianCrosshairRect}}ip.type="histogram3d",ip.seriesType=ct.bar3d,ip.transformerConstructor=e.HistogramChartSpecTransformer;class np extends e.BasePieChartSpecTransformer{transformSpec(t){super.transformSpec(t),t.series.forEach((e=>{"pie3d"===e.type&&(e.angle3d=t.angle3d)}))}}class sp extends e.BaseArcMark{setDataLabelType(){return"arc"}constructor(t,e){super(t,e),this.type=sp.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}sp.type="arc3d";const rp=Object.assign(Object.assign({},e.baseSeriesMark),{pie3d:{name:"pie3d",type:"arc3d"},labelLine:{name:"labelLine",type:"path"}});class ap extends e.PieSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"pie3d")}}class op extends e.BasePieSeries{constructor(){super(...arguments),this.type=ct.pie3d,this._pieMarkName="pie3d",this._pieMarkType="arc3d",this.transformerConstructor=ap}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))}}op.type=ct.pie3d,op.mark=rp,op.builtInTheme={pie3d:{outerRadius:.6,pie3d:{style:{height:10,fillOpacity:1}},label:{visible:!1,interactive:!0,position:"outside"}}},op.transformerConstructor=ap;const lp=()=>{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(),Fu(),vu(),e.Factory.registerGraphicComponent("arc3d",xo),e.Factory.registerMark("arc3d",sp),e.Factory.registerSeries(op.type,op)};class hp extends e.BasePieChart{constructor(){super(...arguments),this.transformerConstructor=np,this.type="pie3d",this.seriesType=ct.pie3d}}hp.type="pie3d",hp.seriesType=ct.pie3d,hp.transformerConstructor=np;class cp{constructor(){}static linear(t){return t}static none(){return this.linear}static get(t){return t<-1?t=-1:t>1&&(t=1),function(e){return 0===t?e:t<0?e*(e*-t+1+t):e*((2-e)*t+(1-t))}}static getPowIn(t){return function(e){return Math.pow(e,t)}}static getPowOut(t){return function(e){return 1-Math.pow(1-e,t)}}static getPowInOut(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}static getBackIn(t){return function(e){return e*e*((t+1)*e-t)}}static getBackOut(t){return function(e){return--e*e*((t+1)*e+t)+1}}static getBackInOut(t){return t*=1.525,function(e){return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}static sineIn(t){return 1-Math.cos(t*Math.PI/2)}static sineOut(t){return Math.sin(t*Math.PI/2)}static sineInOut(t){return-(Math.cos(Math.PI*t)-1)/2}static expoIn(t){return 0===t?0:Math.pow(2,10*t-10)}static expoOut(t){return 1===t?1:1-Math.pow(2,-10*t)}static expoInOut(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}static circIn(t){return-(Math.sqrt(1-t*t)-1)}static circOut(t){return Math.sqrt(1- --t*t)}static circInOut(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}static bounceOut(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}static bounceIn(t){return 1-cp.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*cp.bounceIn(2*t):.5*cp.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(n){if(0===n||1===n)return n;const s=e/i.pi2*Math.asin(1/t);return-t*Math.pow(2,10*(n-=1))*Math.sin((n-s)*i.pi2/e)}}static getElasticOut(t,e){return function(n){if(0===n||1===n)return n;const s=e/i.pi2*Math.asin(1/t);return t*Math.pow(2,-10*n)*Math.sin((n-s)*i.pi2/e)+1}}static getElasticInOut(t,e){return function(n){const s=e/i.pi2*Math.asin(1/t);return(n*=2)<1?t*Math.pow(2,10*(n-=1))*Math.sin((n-s)*i.pi2/e)*-.5:t*Math.pow(2,-10*(n-=1))*Math.sin((n-s)*i.pi2/e)*.5+1}}static registerFunc(t,e){cp[t]=e}}function dp(t,e){const i=1/e;let n=1;for(;t>i;)t-=i,n*=-1;const s=n*t/i;return s>0?s:1+s}cp.quadIn=cp.getPowIn(2),cp.quadOut=cp.getPowOut(2),cp.quadInOut=cp.getPowInOut(2),cp.cubicIn=cp.getPowIn(3),cp.cubicOut=cp.getPowOut(3),cp.cubicInOut=cp.getPowInOut(3),cp.quartIn=cp.getPowIn(4),cp.quartOut=cp.getPowOut(4),cp.quartInOut=cp.getPowInOut(4),cp.quintIn=cp.getPowIn(5),cp.quintOut=cp.getPowOut(5),cp.quintInOut=cp.getPowInOut(5),cp.backIn=cp.getBackIn(1.7),cp.backOut=cp.getBackOut(1.7),cp.backInOut=cp.getBackInOut(1.7),cp.elasticIn=cp.getElasticIn(1,.3),cp.elasticOut=cp.getElasticOut(1,.3),cp.elasticInOut=cp.getElasticInOut(1,.3*1.5),cp.easeInOutQuad=t=>(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2),cp.easeOutElastic=t=>{const e=2*Math.PI/3;return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*e)+1},cp.easeInOutElastic=t=>{const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*e)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*e)/2+1};for(let t=0;t<10;t++)cp[`flicker${t}`]=e=>dp(e,t);for(let t=2;t<10;t++)cp[`aIn${t}`]=e=>t*e*e+(1-t)*e;function up(t,e,i){return t+(e-t)*i}const pp=new class{constructor(){this.opacity=(t,e,i,n,s,r)=>{r.attribute.opacity=up(e,i,n)},this.baseOpacity=(t,e,i,n,s,r)=>{r.attribute.baseOpacity=up(e,i,n)},this.fillOpacity=(t,e,i,n,s,r)=>{r.attribute.fillOpacity=up(e,i,n)},this.strokeOpacity=(t,e,i,n,s,r)=>{r.attribute.strokeOpacity=up(e,i,n)},this.zIndex=(t,e,i,n,s,r)=>{r.attribute.zIndex=up(e,i,n)},this.backgroundOpacity=(t,e,i,n,s,r)=>{r.attribute.backgroundOpacity=up(e,i,n)},this.shadowOffsetX=(t,e,i,n,s,r)=>{r.attribute.shadowOffsetX=up(e,i,n)},this.shadowOffsetY=(t,e,i,n,s,r)=>{r.attribute.shadowOffsetY=up(e,i,n)},this.shadowBlur=(t,e,i,n,s,r)=>{r.attribute.shadowBlur=up(e,i,n)},this.fill=(t,e,i,n,s,r)=>{r.attribute.fill=Yr(e,i,n,!1)},this.fillPure=(t,e,i,n,s,r)=>{r.attribute.fill=s.fromParsedProps.fill?$r(s.fromParsedProps.fill,s.toParsedProps.fill,n):s.toParsedProps.fill},this.stroke=(t,e,i,n,s,r)=>{r.attribute.stroke=Yr(e,i,n,!1)},this.strokePure=(t,e,i,n,s,r)=>{r.attribute.stroke=s.fromParsedProps.stroke?$r(s.fromParsedProps.stroke,s.toParsedProps.stroke,n):s.toParsedProps.stroke},this.width=(t,e,i,n,s,r)=>{r.attribute.width=up(e,i,n),r.addUpdateBoundTag()},this.height=(t,e,i,n,s,r)=>{r.attribute.height=up(e,i,n),r.addUpdateBoundTag()},this.x=(t,e,i,n,s,r)=>{r.attribute.x=up(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.y=(t,e,i,n,s,r)=>{r.attribute.y=up(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.angle=(t,e,i,n,s,r)=>{r.attribute.angle=up(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.scaleX=(t,e,i,n,s,r)=>{r.attribute.scaleX=up(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.scaleY=(t,e,i,n,s,r)=>{r.attribute.scaleY=up(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.lineWidth=(t,e,i,n,s,r)=>{r.attribute.lineWidth=up(e,i,n),r.addUpdateBoundTag()},this.startAngle=(t,e,i,n,s,r)=>{r.attribute.startAngle=up(e,i,n),r.addUpdateBoundTag()},this.endAngle=(t,e,i,n,s,r)=>{r.attribute.endAngle=up(e,i,n),r.addUpdateBoundTag()},this.radius=(t,e,i,n,s,r)=>{r.attribute.radius=up(e,i,n),r.addUpdateBoundTag()},this.outerRadius=(t,e,i,n,s,r)=>{r.attribute.outerRadius=up(e,i,n),r.addUpdateBoundTag()},this.innerRadius=(t,e,i,n,s,r)=>{r.attribute.innerRadius=up(e,i,n),r.addUpdateBoundTag()},this.size=(t,e,i,n,s,r)=>{r.attribute.size=up(e,i,n),r.addUpdateBoundTag()},this.points=(t,e,i,n,s,r)=>{r.attribute.points=Gn(e,i,n),r.addUpdateBoundTag()}}};function gp(t,e,i,n,s,r){if(Number.isFinite(i)&&Number.isFinite(e))return r.attribute[t]=e+(i-e)*n,!0;if(Array.isArray(i)&&Array.isArray(e)&&i.length===e.length){const s=[];let a=!0;for(let t=0;t<i.length;t++){const r=e[t],o=r+(i[t]-r)*n;if(!Number.isFinite(o)){a=!1;break}s.push(o)}return a&&(r.attribute[t]=s),!0}return!1}function fp(){}class mp{constructor(t,e,i,n){this._startTime=0,this._hasFirstRun=!1,this._syncAttributeUpdate=()=>{this.target.setAttributes(this.target.attribute)},this.type=t,this.props=e,this.duration=i,this.easing=n?"function"==typeof n?n:cp[n]:cp.linear,"wait"===t&&(this.onUpdate=fp),this.id=pt.GenAutoIncrementId(),this.syncAttributeUpdate=fp}bind(t,e){this.target=t,this.animate=e,this.onBind(),this.syncAttributeUpdate()}append(t){this.next=t,t.prev=this,t.setStartTime(this.getStartTime()+this.duration,!1)}updateDownstreamStartTimes(){let t=this.next,e=this._startTime+this.duration;for(;t;)t.setStartTime(e,!1),e+=t.duration,t=t.next;this.animate.updateDuration()}getLastProps(){return this.prev?this.prev.props||{}:this.animate.getStartProps()}setDuration(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.duration=t,e&&this.updateDownstreamStartTimes()}getDuration(){return this.duration}determineInterpolateUpdateFunction(){if(!this.props)return;const t=[];this.propKeys.forEach((e=>{if("fill"===e||"stroke"===e){const n=this.fromProps[e],s=this.props[e];if(i.isString(n)&&i.isString(s)){const i=Hr.Get(n,Gr.Color255),r=Hr.Get(s,Gr.Color255);this.fromParsedProps||(this.fromParsedProps={}),this.toParsedProps||(this.toParsedProps={}),this.fromParsedProps[e]=i,this.toParsedProps[e]=r,t.push(pp["fill"===e?"fillPure":"strokePure"])}else pp[e]?t.push(pp[e]):t.push(gp)}else pp[e]?t.push(pp[e]):t.push(gp)})),this.interpolateUpdateFunctions=t}setStartTime(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._startTime=t,e&&this.updateDownstreamStartTimes()}getStartTime(){return this._startTime}onBind(){"glyph"===this.target.type&&(this.syncAttributeUpdate=this._syncAttributeUpdate)}onFirstRun(){}onStart(){if(!this._hasFirstRun){this._hasFirstRun=!0,this.fromProps=this.getLastProps();const t=this.animate.getStartProps();this.propKeys&&this.propKeys.forEach((e=>{var i;this.fromProps[e]=null!==(i=this.fromProps[e])&&void 0!==i?i:t[e]})),this.determineInterpolateUpdateFunction(),this.tryPreventConflict(),this.trySyncStartProps(),this.onFirstRun()}}tryPreventConflict(){const t=this.animate;this.target.animates.forEach((e=>{if(e===t||e.priority>t.priority||e.priority===1/0)return;const i=e.getStartProps();this.propKeys.forEach((t=>{null!=i[t]&&e.preventAttr(t)}))}))}deleteSelfAttr(t){var e;delete this.props[t],this.fromProps&&delete this.fromProps[t];const i=this.propKeys.indexOf(t);-1!==i&&(this.propKeys.splice(i,1),null===(e=this.interpolateUpdateFunctions)||void 0===e||e.splice(i,1))}trySyncStartProps(){this.propKeys.forEach((t=>{this.fromProps[t]=this.animate.target.getComputedAttribute(t)}))}update(t,e,i){if(this.onStart(),!this.props||!this.propKeys)return;const n=this.easing(e);this.animate.interpolateUpdateFunction?this.animate.interpolateUpdateFunction(this.fromProps,this.props,n,this,this.target):this.interpolateUpdateFunctions.forEach(((t,e)=>{if(!this.animate.validAttr(this.propKeys[e]))return;const i=this.propKeys[e];t(i,this.fromProps[i],this.props[i],n,this,this.target)})),this.onUpdate(t,n,i),this.syncAttributeUpdate()}onUpdate(t,e,i){}onEnd(t){this.target.setAttributes(this.props),t?this._endCb=t:this._endCb&&this._endCb(this.animate,this)}getEndProps(){return this.props}getFromProps(){return this.fromProps}getMergedEndProps(){return this.getEndProps()}stop(){}}class yp extends mp{constructor(t,e,i,n){super(t,e,i,n)}onStart(){super.onStart()}onFirstRun(){const t=this.getFromProps();this.target.setAttributes(t)}update(t,e,i){this.onStart()}determineInterpolateUpdateFunction(){}}class bp extends i.EventEmitter{get animateCount(){return this._animateCount}constructor(){super(),this.head=null,this.tail=null,this.animateMap=new Map,this._animateCount=0,this._playSpeed=1,this._totalDuration=0,this._startTime=0,this._currentTime=0,this.id=pt.GenAutoIncrementId(),this.paused=!1}isRunning(){return!this.paused&&this._animateCount>0}forEachAccessAnimate(t){let e=this.head,i=0;for(;e;){const n=e.next;t(e.animate,i),i++,e=n}}addAnimate(t){const e={animate:t,next:null,prev:null};this.head?this.tail&&(this.tail.next=e,e.prev=this.tail,this.tail=e):(this.head=e,this.tail=e),this.animateMap.set(t,e),this._animateCount++,this._totalDuration=Math.max(this._totalDuration,t.getStartTime()+t.getDuration())}pause(){this.paused=!0}resume(){this.paused=!1}tick(t){if(this.paused)return;const e=t*this._playSpeed;this._currentTime+=e,this.forEachAccessAnimate(((t,i)=>{t.status===Kt.END?this.removeAnimate(t,!0):t.status!==Kt.RUNNING&&t.status!==Kt.INITIAL||t.advance(e)})),0===this._animateCount&&this.emit("animationEnd")}clear(){this.forEachAccessAnimate((t=>{t.release()})),this.head=null,this.tail=null,this.animateMap.clear(),this._animateCount=0,this._totalDuration=0}removeAnimate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=this.animateMap.get(t);i&&(e&&(t._onRemove&&t._onRemove.forEach((t=>t())),t.release()),i.prev?i.prev.next=i.next:this.head=i.next,i.next?i.next.prev=i.prev:this.tail=i.prev,this.animateMap.delete(t),this._animateCount--,t.getStartTime()+t.getDuration()>=this._totalDuration&&this.recalculateTotalDuration())}recalculateTotalDuration(){this._totalDuration=0,this.forEachAccessAnimate((t=>{this._totalDuration=Math.max(this._totalDuration,t.getStartTime()+t.getDuration())}))}getTotalDuration(){return this._totalDuration}getPlaySpeed(){return this._playSpeed}setPlaySpeed(t){this._playSpeed=t}getPlayState(){return this.paused?"paused":0===this.animateCount?"stopped":"playing"}setStartTime(t){this._startTime=t}getStartTime(){return this._startTime}getCurrentTime(){return this._currentTime}setCurrentTime(t){this._currentTime=t}}const vp=new bp;vp.isGlobal=!0;class xp{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pt.GenAutoIncrementId(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:vp,i=arguments.length>2?arguments[2]:void 0;this.id=t,this.status=Kt.INITIAL,this._timeline=e,e.addAnimate(this),this.slience=i,this._startTime=0,this._duration=0,this._totalDuration=0,this._loopCount=0,this._currentLoop=0,this._bounce=!1,this._firstStep=null,this._lastStep=null,this._startProps={},this._endProps={},this._preventAttrs=new Set,this.currentTime=0,this.interpolateUpdateFunction=null,this.priority=0}getStartProps(){return this._startProps}getEndProps(){return this._endProps}setTimeline(t){this._timeline=t}getTimeline(){return this._timeline}get timeline(){return this._timeline}bind(t){return this.target=t,this.target.onAnimateBind&&!this.slience&&this.target.onAnimateBind(this),this.target.animationAttribute||(this.target.animationAttribute={}),this}to(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"linear";const n=new mp($t.to,t,e,i);return n.bind(this.target,this),this.updateStepAfterAppend(n),this}wait(t){const e=new yp($t.wait,{},t,"linear");return e.bind(this.target,this),this.updateStepAfterAppend(e),this}updateStepAfterAppend(t){this._firstStep?(this._lastStep.append(t),this._lastStep=t):(this._firstStep=t,this._lastStep=t),this.parseStepProps(t),this.updateDuration()}parseStepProps(t){this._lastStep&&(t.propKeys=t.propKeys||Object.keys(t.props),Object.keys(this._endProps).forEach((e=>{var i;t.props[e]=null!==(i=t.props[e])&&void 0!==i?i:this._endProps[e]})),t.propKeys.forEach((e=>{this._endProps[e]=t.props[e]})))}reSyncProps(){if(!this._lastStep)return;this._endProps={};let t=this._firstStep;for(;t;)Object.keys(this._endProps).forEach((e=>{var i;t.props[e]=null!==(i=t.props[e])&&void 0!==i?i:this._endProps[e]})),t.propKeys.forEach((e=>{this._endProps[e]=t.props[e]})),t=t.next}from(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"linear";const n=new mp($t.from,t,e,i);return this._firstStep?(this._lastStep.append(n),this._lastStep=n):(this._firstStep=n,this._lastStep=n),this.updateDuration(),this}play(t){return t.bind(this.target,this),this.updateStepAfterAppend(t),this}pause(){this.status===Kt.RUNNING&&(this.status=Kt.PAUSED)}resume(){this.status===Kt.PAUSED&&(this.status=Kt.RUNNING)}onStart(t){var e;t?(this._onStart||(this._onStart=[]),this._onStart.push(t)):(null===(e=this._onStart)||void 0===e||e.forEach((t=>t())),Object.keys(this._endProps).forEach((t=>{this._startProps[t]=this.target.getComputedAttribute(t)})))}onEnd(t){var e;t?(this._onEnd||(this._onEnd=[]),this._onEnd.push(t)):null===(e=this._onEnd)||void 0===e||e.forEach((t=>t()))}onFrame(t){t&&(this._onFrame||(this._onFrame=[]),this._onFrame.push(t))}onRemove(t){var e;t?(this._onRemove||(this._onRemove=[]),this._onRemove.push(t)):null===(e=this._onRemove)||void 0===e||e.forEach((t=>t()))}preventAttr(t){this._preventAttrs.add(t),delete this._startProps[t],delete this._endProps[t];let e=this._firstStep;for(;e;)e.deleteSelfAttr(t),e=e.next}preventAttrs(t){t.forEach((t=>this._preventAttrs.add(t)))}validAttr(t){return!this._preventAttrs.has(t)}runCb(t){var e;return null===(e=this._lastStep)||void 0===e||e.onEnd(t),this}startAt(t){return this._startTime=t,this}customInterpolate(t,e,i,n,s,r){return!1}getFromValue(){return this._startProps}getToValue(){return this._endProps}stop(t){let e=this._firstStep;for(;e;)e.stop(),e=e.next;this.status!==Kt.END&&this.onEnd(),this.status=Kt.END,this.target&&("start"===t?this.target.setAttributes(this._startProps):"end"===t?this.target.setAttributes(this._endProps):t&&this.target.setAttributes(t))}release(){this.status=Kt.END,this._onRemove&&this._onRemove.forEach((t=>t())),this._onStart=[],this._onFrame=[],this._onEnd=[],this._onRemove=[]}getDuration(){return this._duration}getStartTime(){return this._startTime}afterAll(t){if(!t||0===t.length)return this;let e=0;return t.forEach((t=>{const i=t.getStartTime()+t.getTotalDuration();e=Math.max(e,i)})),this.startAt(e)}after(t){if(!t)return this;const e=t.getStartTime()+t.getTotalDuration();return this.startAt(e)}parallel(t){return t?(this.startAt(t.getStartTime()),this):this}loop(t){return!0===t?t=1/0:!1===t&&(t=0),this._loopCount=t,this.updateDuration(),this}bounce(t){return this._bounce=t,this}advance(t){var e,i,n;if(this.status===Kt.END)return void console.warn("aaa 动画已经结束,不能推进");const s=this.currentTime+t;if(s<this._startTime)return void(this.currentTime=s);if(s>=this._startTime+this._totalDuration)return null===(e=this._lastStep)||void 0===e||e.onUpdate(!0,1,{}),null===(i=this._lastStep)||void 0===i||i.onEnd(),this.onEnd(),void(this.status=Kt.END);this.status=Kt.RUNNING,this.currentTime<=this._startTime&&this.onStart(),this.currentTime=s;let r=s-this._startTime,a=!1,o=!1;if(this._loopCount>0){r=(s-this._startTime)%this._duration;const t=Math.floor((s-this._startTime)/this._duration);a=t>this._currentLoop,this._currentLoop=t,o=this._bounce&&t%2==1,o&&(r=this._duration-r)}a&&!o&&this.target.setAttributes(this._startProps);let l=null;if(this._lastStep===this._firstStep)l=this._firstStep;else{let t=this._firstStep;for(;t;){const e=t.getStartTime(),i=t.getDuration();if(r>=e&&r<=e+i){l=t;break}t=t.next}}if(!l)return;l!==this.lastRunStep&&(null===(n=this.lastRunStep)||void 0===n||n.onEnd()),this.lastRunStep=l;const h=(r-l.getStartTime())/l.getDuration(),c=h>=1;l.update(c,h,{}),c&&(l.onEnd(),this.lastRunStep=null)}updateDuration(){this._lastStep?(this._duration=this._lastStep.getStartTime()+this._lastStep.getDuration(),this._totalDuration=this._duration*(this._loopCount+1)):this._duration=0}getTotalDuration(){return this._totalDuration}getLoop(){return this._loopCount}}const _p=new class{constructor(){this.nextAnimationFrameCbs=[],this._rafHandle=null,this.runAnimationFrame=t=>{this._rafHandle=null;const e=this.nextAnimationFrameCbs;this.nextAnimationFrameCbs=[];for(let i=0;i<e.length;i++)e[i]&&e[i](t)},this.tryRunAnimationFrameNextFrame=()=>{null===this._rafHandle&&0!==this.nextAnimationFrameCbs.length&&(this._rafHandle=Xt.global.getRequestAnimationFrame()(this.runAnimationFrame))}}addAnimationFrameCb(t){return this.nextAnimationFrameCbs.push(t),this.tryRunAnimationFrameNextFrame(),this.nextAnimationFrameCbs.length-1}removeAnimationFrameCb(t){return t>=0&&t<this.nextAnimationFrameCbs.length&&(this.nextAnimationFrameCbs[t]=null,!0)}};class Ap{constructor(){this.released=!1}tick(t,e){_p.addAnimationFrameCb((()=>{if(!this.released)return e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}class Sp extends i.EventEmitter{constructor(t){super(),this.timelines=[],this.frameTimeHistory=[],this.handleTick=(t,e)=>{const{once:i=!1}=null!=e?e:{};if(this.ifCanStop())return this.stop(),!1;const n=t.getTime();this._lastTickTime=n,this.lastFrameTime<0&&(this.lastFrameTime=n-this.interval+this.timeOffset,this.frameTimeHistory.push(this.lastFrameTime));const s=n-this.lastFrameTime,r=this.checkSkip(s);return r||(this._handlerTick(s),this.lastFrameTime=n,this.frameTimeHistory.push(this.lastFrameTime)),i||t.tick(this.interval,this.handleTick),!r},this._handlerTick=t=>{this.status===qt.RUNNING&&(this.tickCounts++,this.timelines.forEach((e=>{e.tick(t)})),this.emit("tick",t))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.stage=t,this.autoStop=!0,this.interval=16,this.computeTimeOffsetAndJitter()}bindStage(t){this.stage=t}computeTimeOffsetAndJitter(){this.timeOffset=Math.floor(Math.random()*this.interval),this._jitter=Math.min(Math.max(.2*this.interval,6),.7*this.interval)}init(){this.interval=16,this.status=qt.INITIAL,Xt.global.hooks.onSetEnv.tap("graph-ticker",(()=>{this.initHandler()})),Xt.global.env&&this.initHandler()}addTimeline(t){this.timelines.push(t)}remTimeline(t){this.timelines=this.timelines.filter((e=>e!==t))}getTimelines(){return this.timelines}initHandler(){this.setupTickHandler()}setupTickHandler(){const t=new Ap;return this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0}setInterval(t){this.interval=t,this.computeTimeOffsetAndJitter()}getInterval(){return this.interval}setFPS(t){this.setInterval(Math.floor(1e3/t))}getFPS(){return 1e3/this.interval}tick(t){this.tickerHandler.tick(t,(t=>this.handleTick(t,{once:!0})))}tickTo(t){this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,(t=>{this.handleTick(t,{once:!0})}))}pause(){return this.status!==qt.INITIAL&&(this.status=qt.PAUSE,!0)}resume(){return this.status!==qt.INITIAL&&(this.status=qt.RUNNING,!0)}ifCanStop(){if(this.autoStop){if(!this.timelines.length)return!0;if(this.timelines.every((t=>!t.isRunning())))return!0}return!1}start(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.status===qt.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===qt.PAUSE)return!1;if(this.ifCanStop())return!1}return this.status=qt.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=qt.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}trySyncTickStatus(){this.status===qt.INITIAL&&this.timelines.some((t=>t.isRunning()))?this.start():this.status===qt.RUNNING&&this.timelines.every((t=>!t.isRunning()))&&this.stop()}release(){var t;this.stop(),this.timelines=[],null===(t=this.tickerHandler)||void 0===t||t.release(),this.tickerHandler=null,this.lastFrameTime=-1}checkSkip(t){return"performance"!==this.stage.params.optimize.tickRenderMode&&t<this.interval+2*(Math.random()-.5)*this._jitter}}class Tp{constructor(){this.transitions=new Map,this.registerDefaultTransitions()}static getInstance(){return Tp.instance||(Tp.instance=new Tp),Tp.instance}registerDefaultTransitions(){this.registerTransition("appear","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("appear","appear",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("appear","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("appear","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("normal","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("normal","normal",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("normal","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("normal","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("exit","*",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("exit","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("exit","enter",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("exit","exit",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("enter","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("enter","enter",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("enter","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("enter","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("disappear","*",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("disappear","appear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("update","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("update","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("update","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("state","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("state","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("state","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0})))}isTransitionAllowed(t,e,i){var n,s,r,a;let o=null===(n=this.transitions.get(t))||void 0===n?void 0:n.get(e);return o?o(i,t):(o=null===(s=this.transitions.get(t))||void 0===s?void 0:s.get("*"),o?o(i,t):(o=null===(r=this.transitions.get("*"))||void 0===r?void 0:r.get(e),o?o(i,t):(o=null===(a=this.transitions.get("*"))||void 0===a?void 0:a.get("*"),o?o(i,t):{allowTransition:!0,stopOriginalTransition:!0})))}registerTransition(t,e,i){let n=this.transitions.get(t);n||(n=new Map,this.transitions.set(t,n)),n.set(e,i)}}Tp.getInstance();class wp{static registerBuiltInAnimate(t,e){wp.builtInAnimateMap[t]=e}constructor(t){this._animates=[],this._startCallbacks=[],this._endCallbacks=[],this._started=!1,this._activeCount=0,this._target=t}onStart(t){t?(this._startCallbacks.push(t),this._started&&this._activeCount>0&&t()):this._startCallbacks.forEach((t=>{t()}))}onEnd(t){t?this._endCallbacks.push(t):this._endCallbacks.forEach((t=>{t()}))}_trackAnimation(t){this._animates.push(t),this._activeCount++,1!==this._activeCount||this._started||(this._started=!0,this.onStart()),t.onEnd((()=>{this._activeCount--;const e=this._animates.indexOf(t);e>=0&&this._animates.splice(e,1),0===this._activeCount&&this._started&&(this._started=!1,this.onEnd())}))}parseParams(t,e,n){var s,r;const a=this.resolveValue(t.totalTime,void 0,void 0),o=this.resolveValue(t.startTime,void 0,0),l=Object.assign({},t);l.oneByOneDelay=0,l.startTime=o,l.totalTime=a;const h=this.resolveValue(t.oneByOne,n,!1);if(e){const t=l.timeSlices;i.isArray(t)||(l.timeSlices=[t]);let e=0;l.timeSlices=l.timeSlices.map((t=>{const i=this.resolveValue(t.delay,n,0),s=this.resolveValue(t.delayAfter,n,0),r=this.resolveValue(t.duration,n,300);return e+=i+r+s,Object.assign(Object.assign({},t),{delay:i,delayAfter:s,duration:r})}));let s=0;h&&(s="number"==typeof h?h:h?e:0),l.oneByOneDelay=s;let r=1;if(a){const t=e+s*(this._target.count-2);r=a?a/t:1}l.timeSlices=l.timeSlices.map((t=>{let e=t.effects;return Array.isArray(e)||(e=[e]),Object.assign(Object.assign({},t),{delay:t.delay*r,delayAfter:t.delayAfter*r,duration:t.duration*r,effects:e.map((t=>{var e,n;const s=null!==(e=t.custom)&&void 0!==e?e:wp.builtInAnimateMap[null!==(n=t.type)&&void 0!==n?n:"fromTo"],r=s&&i.isFunction(s)?/^class\s/.test(Function.prototype.toString.call(s))?1:2:0;return Object.assign(Object.assign({},t),{custom:s,customType:r})}))})})),l.oneByOneDelay=s*r,l.startTime=o*r}else{const e=this.resolveValue(t.delay,n,0),c=this.resolveValue(t.delayAfter,n,0),d=this.resolveValue(t.duration,n,300);let u=0;h&&(u="number"==typeof h?h:h?e+c+d:0),l.oneByOneDelay=u,l.custom=null!==(s=t.custom)&&void 0!==s?s:wp.builtInAnimateMap[null!==(r=t.type)&&void 0!==r?r:"fromTo"];const p=l.custom&&i.isFunction(l.custom)?/^class\s/.test(Function.prototype.toString.call(l.custom))?1:2:0;if(l.customType=p,a){const t=e+c+d+u*(this._target.count-2),i=a?a/t:1;l.delay=e*i,l.delayAfter=c*i,l.duration=d*i,l.oneByOneDelay=u*i,l.startTime=o}}return l}execute(t){Array.isArray(t)?t.forEach((t=>this._execute(t))):this._execute(t)}_execute(t){if(t.selfOnly)return this._executeItem(t,this._target,0,1);const e="timeSlices"in t;let i;e&&t.partitioner&&(i=(null!=i?i:this._target.getChildren()).filter((e=>{var i,n;return t.partitioner(null===(n=null===(i=e.context)||void 0===i?void 0:i.data)||void 0===n?void 0:n[0],e,{})}))),e&&t.sort&&(i=null!=i?i:this._target.getChildren(),i.sort(((e,i)=>{var n,s,r,a;return t.sort(null===(s=null===(n=e.context)||void 0===n?void 0:n.data)||void 0===s?void 0:s[0],null===(a=null===(r=i.context)||void 0===r?void 0:r.data)||void 0===a?void 0:a[0],e,i,{})})));const n=e?(i,n,s)=>{const r=this.parseParams(t,e,i),a=this.executeTimelineItem(r,i,n,s);a&&this._trackAnimation(a)}:(i,n,s)=>{const r=this.parseParams(t,e,i),a=this.executeTypeConfigItem(r,i,n,s);a&&this._trackAnimation(a)};i?i.forEach(((t,e)=>n(t,e,i.length))):this._target.count<=1?n(this._target,0,1):this._target.forEachChildren(((t,e)=>n(t,e,this._target.count-1)))}executeTypeConfigItem(t,e,n,s){var r,a,o,l,h,c,d,u;const{type:p="fromTo",channel:g,customParameters:f,easing:m="linear",delay:y=0,delayAfter:b=0,duration:v=300,startTime:x=0,oneByOneDelay:_=0,loop:A,bounce:S,priority:T=0,options:w,custom:M,customType:B,controlOptions:C}=t,k=e.animate();k.priority=T;const P=i.isFunction(y)?y(null===(a=null===(r=e.context)||void 0===r?void 0:r.data)||void 0===a?void 0:a[0],e,{}):y,O=null===(l=null===(o=e.context)||void 0===o?void 0:o.data)||void 0===l?void 0:l[0],R=null===(h=e.context)||void 0===h?void 0:h.indexKey;O&&R&&(n=null!==(c=O[R])&&void 0!==c?c:n),k.startAt(x);const L=n*_+P;L>0&&k.wait(L);let I=null,E=t.to,D=t.from;E||(I||(I=this.createPropsFromChannel(g,e)),E=I.props),D||(I||(I=this.createPropsFromChannel(g,e)),D=I.from),this._handleRunAnimate(k,M,B,D,E,v,m,f,C,w,p,e);let F=0;_&&(F=_*(s-n-1));const j=i.isFunction(b)?b(null===(u=null===(d=e.context)||void 0===d?void 0:d.data)||void 0===u?void 0:u[0],e,{}):b;return j>0&&(F+=j),F>0&&k.wait(F),A&&A>0&&k.loop(A),S&&k.bounce(!0),k}_handleRunAnimate(t,e,n,s,r,a,o,l,h,c,d,u){var p,g,f,m;if(e&&n){const d=this.resolveValue(l,u,{}),y=i.isFunction(c)?c.call(null,null!==(g=d&&(null===(p=d.data)||void 0===p?void 0:p[0]))&&void 0!==g?g:null===(m=null===(f=u.context)||void 0===f?void 0:f.data)||void 0===m?void 0:m[0],u,d):c;d.options=y,d.controlOptions=h,1===n?this.createCustomAnimation(t,e,s,r,a,o,d):2===n&&this.createCustomInterpolatorAnimation(t,e,r,a,o,d)}else"to"===d?t.to(r,a,o):"from"===d&&t.from(r,a,o)}executeTimelineItem(t,e,i,n){var s,r,a,o;const{timeSlices:l,startTime:h=0,loop:c,bounce:d,oneByOneDelay:u,priority:p,controlOptions:g}=t,f=null===(r=null===(s=e.context)||void 0===s?void 0:s.data)||void 0===r?void 0:r[0],m=null===(a=e.context)||void 0===a?void 0:a.indexKey;f&&m&&(i=null!==(o=f[m])&&void 0!==o?o:i);const y=e.animate();return y.priority=p,y.startAt(h),y.wait(i*u),c&&c>0&&y.loop(c),d&&y.bounce(!0),(Array.isArray(l)?l:[l]).forEach((t=>{this.applyTimeSliceToAnimate(t,y,e,g)})),u&&y.wait(u*(n-i-1)),y}applyTimeSliceToAnimate(t,e,n,s){var r,a,o,l;const{effects:h,duration:c=300,delay:d=0,delayAfter:u=0}=t,p=i.isFunction(d)?d(null===(a=null===(r=n.context)||void 0===r?void 0:r.data)||void 0===a?void 0:a[0],n,{}):d,g=i.isFunction(u)?u(null===(l=null===(o=n.context)||void 0===o?void 0:o.data)||void 0===l?void 0:l[0],n,{}):u;p>0&&e.wait(p),(Array.isArray(h)?h:[h]).forEach((t=>{var i;const{type:r="fromTo",channel:a,customParameters:o,easing:l="linear",options:h}=t;let d=null,u=t.to,p=t.from;u||(d||(d=this.createPropsFromChannel(a,n)),u=d.props),p||(d||(d=this.createPropsFromChannel(a,n)),p=d.from);const g=null!==(i=t.custom)&&void 0!==i?i:wp.builtInAnimateMap[r],f=t.customType;this._handleRunAnimate(e,g,f,p,u,c,l,o,s,h,r,n)})),g>0&&e.wait(g)}createCustomInterpolatorAnimation(t,e,i,n,s,r){const a=i;Object.keys(a).forEach((e=>{t.target.getComputedAttribute(e)})),t.interpolateUpdateFunction=(i,n,s,a,o)=>{e(s,i,n,a,o,t.target,r)},t.to(i,n,s)}createCustomAnimation(t,e,i,n,s,r,a){const o=new e(i,n,s,r,a);t.play(o)}createPropsFromChannel(t,e){const i={};let n=null;return t?(Array.isArray(t)?t.forEach((t=>{var n,s;const r=null===(s=null===(n=e.context)||void 0===n?void 0:n.diffAttrs)||void 0===s?void 0:s[t];void 0!==r&&(i[t]=r)})):Object.keys(t).forEach((s=>{var r,a,o,l;const h=t[s];void 0!==h.to&&("function"==typeof h.to?i[s]=h.to(null===(a=null===(r=e.context)||void 0===r?void 0:r.data)||void 0===a?void 0:a[0],e,{}):i[s]=h.to),void 0!==h.from&&(n||(n={}),"function"==typeof h.from?n[s]=h.from(null===(l=null===(o=e.context)||void 0===o?void 0:o.data)||void 0===l?void 0:l[0],e,{}):n[s]=h.from)})),{from:n,props:i}):{from:n,props:i}}resolveValue(t,e,i){var n,s;return void 0===t?i:"function"==typeof t&&e?t(null===(s=null===(n=e.context)||void 0===n?void 0:n.data)||void 0===s?void 0:s[0],e,{}):t}executeItem(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return Array.isArray(t)?t.map((t=>this._executeItem(t,e,i,n))).filter(Boolean):[this._executeItem(t,e,i,n)].filter(Boolean)}_executeItem(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(!e)return null;const s="timeSlices"in t;let r=null;const a=this.parseParams(t,s);return r=s?this.executeTimelineItem(a,e,i,n):this.executeTypeConfigItem(a,e,i,n),r&&this._trackAnimation(r),r}stop(t){for(;this._animates.length>0;){const e=this._animates.pop();null==e||e.stop(t)}this._animates=[],this._activeCount=0,this._started&&(this._started=!1,this.onEnd())}}wp.builtInAnimateMap={};const Mp="appear",Bp="disappear",Cp="update",kp="highlight",Pp="unhighlight";class Op{constructor(t){this.graphic=t}registerState(t){this.states||(this.states=new Map),this.states.set(t.name,t)}clearStates(){var t;null===(t=this.states)||void 0===t||t.clear()}}class Rp{constructor(t){this.stateList=null,this.graphic=t}applyState(t,e,n){const s=Tp.getInstance(),r=[],a=[];if(this.stateList&&this.stateList.length?t.forEach(((t,n)=>{const o={allowTransition:!0,stopOriginalTransition:!0};this.stateList.forEach((e=>{const i=s.isTransitionAllowed(e.state,t,this.graphic);o.allowTransition=o.allowTransition&&i.allowTransition})),o.allowTransition&&(a.push({state:t,animationConfig:i.isArray(e[n])?e[n].map((t=>t.animation)):e[n].animation,executor:new wp(this.graphic)}),this.stateList.forEach((e=>{s.isTransitionAllowed(e.state,t,this.graphic).stopOriginalTransition&&r.push(e)})))})):t.forEach(((t,n)=>{a.push({state:t,animationConfig:i.isArray(e[n])?e[n].map((t=>t.animation)):e[n].animation,executor:new wp(this.graphic)})})),r.forEach((t=>{t.executor.stop()})),a.length){a[0].executor.execute(a[0].animationConfig);for(let t=0;t<a.length;t++){const e=a[t+1],i=a[t];i.executor.onEnd((()=>{e&&e.executor.execute(e.animationConfig),this.stateList=this.stateList.filter((t=>t!==i)),t===a.length-1&&n&&n(!1)}))}}else n&&n(!0);this.stateList?this.stateList=this.stateList.filter((t=>!r.includes(t))):this.stateList=[],this.stateList.push(...a)}applyAppearState(t,e){this.applyState([Mp],[{name:Mp,animation:t}],e)}applyDisappearState(t,e){this.applyState([Bp],[{name:Bp,animation:t}],e)}applyUpdateState(t,e){this.applyState([Cp],[{name:Cp,animation:t}],e)}applyHighlightState(t,e){this.applyState([kp],[{name:kp,animation:t}],e)}applyUnhighlightState(t,e){this.applyState([Pp],[{name:Pp,animation:t}],e)}stopState(t,e){var i;const n=null===(i=this.stateList)||void 0===i?void 0:i.find((e=>e.state===t));n&&n.executor.stop(e)}clearState(){var t;null===(t=this.stateList)||void 0===t||t.forEach((t=>{t.executor.stop()})),this.stateList=null}}class Lp{_getAnimationStateManager(t){return t._animationStateManager||(t._animationStateManager=new Rp(t)),t._animationStateManager}_getAnimationStateStore(t){return t._animationStateStore||(t._animationStateStore=new Op(t)),t._animationStateStore}registerAnimationState(t){return this._getAnimationStateStore(this).registerState(t),this}applyAnimationState(t,e,i){return this._getAnimationStateManager(this).applyState(t,e,i),this}applyAppearState(t,e){return this._getAnimationStateManager(this).applyAppearState(t,e),this}applyDisappearState(t,e){return this._getAnimationStateManager(this).applyDisappearState(t,e),this}applyUpdateState(t,e){return this._getAnimationStateManager(this).applyUpdateState(t,e),this}applyHighlightState(t,e){return this._getAnimationStateManager(this).applyHighlightState(t,e),this}applyUnhighlightState(t,e){return this._getAnimationStateManager(this).applyUnhighlightState(t,e),this}stopAnimationState(t,e){return this._getAnimationStateManager(this).stopState(t,e),this}clearAnimationStates(){return this._getAnimationStateManager(this).clearState(),this}static extend(t){return(new Lp)._getAnimationStateManager(t),t}}class Ip{getAttributes(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.finalAttribute?this.finalAttribute:this.attribute}animate(t){var e,i,n;this.animates||(this.animates=new Map);const s=new xp(null==t?void 0:t.id,null!==(i=null!==(e=null==t?void 0:t.timeline)&&void 0!==e?e:this.stage&&this.stage.getTimeline())&&void 0!==i?i:vp,null==t?void 0:t.slience);if(s.bind(this),t){const{onStart:e,onEnd:i,onRemove:n}=t;null!=e&&s.onStart(e),null!=i&&s.onEnd(i),null!=n&&s.onRemove(n)}return this.animates.set(s.id,s),s.onRemove((()=>{s.stop(),this.animates.delete(s.id)})),null===(n=this.stage)||void 0===n||n.ticker.start(),s}createTimeline(){return new bp}createTicker(t){return new Sp(t)}setFinalAttribute(t){this.finalAttribute||(this.finalAttribute={}),Object.assign(this.finalAttribute,t)}initFinalAttribute(t){this.finalAttribute=t}initAnimateExecutor(){this._animateExecutor||(this._animateExecutor=new wp(this))}executeAnimation(t){return this.initAnimateExecutor(),this._animateExecutor.execute(t),this}executeAnimations(t){return this.initAnimateExecutor(),t.forEach((t=>{this._animateExecutor.execute(t)})),this}getFinalAttribute(){return this.finalAttribute}getGraphicAttribute(t){return!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&this.finalAttribute?this.finalAttribute[t]:this.attribute[t]}}function Ep(){i.mixin(oa,Lp),i.mixin(oa,Ip)}class Dp extends mp{constructor(t,e,i,n,s){super("customAnimate",e,i,n),this.type="customAnimate",this.customFrom=t,this.params=s}update(t,e,i){if(this.onStart(),!this.props||!this.propKeys)return;const n=this.easing(e);this.onUpdate(t,n,i),this.syncAttributeUpdate()}setProps(t){this.props=t,this.propKeys=Object.keys(t),this.animate.reSyncProps()}}class Fp extends Dp{onStart(){const{center:t,r:e}="function"==typeof this.params?this.params():this.params,n=this.target.getComputedAttribute("x"),s=this.target.getComputedAttribute("y"),r=this.target.getComputedAttribute("z"),a=Math.acos((s-t.y)/e);let o=Math.acos((n-t.x)/e/Math.sin(a));r-t.z<0&&(o=i.pi2-o),this.theta=o,this.phi=a}onBind(){super.onBind()}onEnd(){}onUpdate(t,e,n){if(null==this.phi||null==this.theta)return;const{center:s,r:r,cb:a}="function"==typeof this.params?this.params():this.params,o=2*Math.PI*e,l=this.theta+o,h=this.phi,c=r*Math.sin(h)*Math.cos(l)+s.x,d=r*Math.cos(h)+s.y,u=r*Math.sin(h)*Math.sin(l)+s.z;for(n.x=c,n.y=d,n.z=u,n.alpha=l+i.pi/2;n.alpha>i.pi2;)n.alpha-=i.pi2;n.alpha=i.pi2-n.alpha,n.zIndex=-1e4*n.z,a&&a(n)}}const jp=t=>({custom:Fp,customParameters:()=>t,easing:"linear",loop:1/0,duration:6e3});class Up extends e.BaseWordCloudSeries{constructor(){super(...arguments),this.type=ct.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 n=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-n.left||0-n.right||0,s=e.height-n.top||0-n.bottom||0,r=Math.max(i,s)/2;return{center:{x:r,y:r,z:null!==(t=this._spec.depth_3d)&&void 0!==t?t:r},r:r}})),e.userAnimationConfig("word",this._spec,this._markAttributeContext)))}}Up.type=ct.wordCloud3d,Up.builtInTheme={wordCloud3d:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}}};const Np=()=>{e.registerTextMark(),e.Factory.registerAnimation("wordCloud3d",(t=>({enter:jp(t)}))),e.Factory.registerSeries(Up.type,Up)},Wp=()=>{Np()};class zp extends e.BaseWordCloudChartSpecTransformer{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.depth_3d=t.depth_3d,e}}class Vp extends e.BaseWordCloudChart{constructor(){super(...arguments),this.transformerConstructor=zp,this.type="wordCloud3d",this.seriesType=ct.wordCloud3d}}Vp.type="wordCloud3d",Vp.seriesType=ct.wordCloud3d,Vp.transformerConstructor=zp;const Gp=()=>{Vh(),Np(),e.Factory.registerChart(Vp.type,Vp)},Hp=(t,i)=>{var n;const s=e.getCombinedSizeOfRegions(t.getRegions()),{width:r}=t.getLayoutRect(),a=r,o=t.layout3dBox?t.layout3dBox.length:0,l=t.layout3dBox?t.layout3dBox.width:0,h={x:o,y:0},c=t.getLabelItems(a),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()};i||(d.grid={type:"line",start:{x:0,y:0},end:h,items:c[0],verticalFactor:t._axisStyle.verticalFactor,depth:l,length:i?0:s.height});const u=null!==(n=t.directionStr)&&void 0!==n?n:"r2l";let p=[0,0],g=-Math.PI/2,f=0;return"l2r"===u&&(f=t.layout3dBox.length,p=[0,0,0],g=Math.PI/2),d.z=f,d.alpha=g,d.anchor3d=p,d},Xp={label:{space:0}};class Yp extends e.CartesianBandAxis{setLayout3dBox(t){this.layout3dBox=t}_getUpdateAttribute(t){return e.isZAxis(this._orient)?Hp(this,t):super._getUpdateAttribute(t)}}Yp.builtInTheme=Object.assign(Object.assign({},e.CartesianBandAxis.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianBandAxis.builtInTheme.axisX),Xp)}),i.mixin(Yp,e.BandAxisMixin);class qp extends e.CartesianLinearAxis{setLayout3dBox(t){this.layout3dBox=t}_getUpdateAttribute(t){if(!e.isZAxis(this._orient)){const e=super._getUpdateAttribute(t);return t||(e.grid.depth=this.layout3dBox?this.layout3dBox.length:0),e}return Hp(this,t)}}qp.builtInTheme=Object.assign(Object.assign({},e.CartesianLinearAxis.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianLinearAxis.builtInTheme.axisX),Xp)}),i.mixin(qp,e.LinearAxisMixin);class $p extends e.CartesianLogAxis{setLayout3dBox(t){this.layout3dBox=t}_getUpdateAttribute(t){return e.isZAxis(this._orient)?Hp(this,t):super._getUpdateAttribute(t)}}$p.builtInTheme=Object.assign(Object.assign({},e.CartesianLogAxis.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianLogAxis.builtInTheme.axisX),Xp)}),i.mixin($p,e.LinearAxisMixin);class Kp extends e.CartesianSymlogAxis{setLayout3dBox(t){this.layout3dBox=t}_getUpdateAttribute(t){return e.isZAxis(this._orient)?Hp(this,t):super._getUpdateAttribute(t)}}Kp.builtInTheme=Object.assign(Object.assign({},e.CartesianSymlogAxis.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianSymlogAxis.builtInTheme.axisX),Xp)}),i.mixin(Kp,e.LinearAxisMixin);class Zp extends e.CartesianTimeAxis{setLayout3dBox(t){this.layout3dBox=t}_getUpdateAttribute(t){return e.isZAxis(this._orient)?Hp(this,t):super._getUpdateAttribute(t)}}Zp.builtInTheme=Object.assign(Object.assign({},e.CartesianTimeAxis.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianTimeAxis.builtInTheme.axisX),Xp)}),i.mixin(Zp,e.LinearAxisMixin);const Jp=Object.assign(Object.assign({},Gh),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}});class Qp extends e.RangeColumnSeries{constructor(){super(...arguments),this.type=ct.rangeColumn3d,this._barMarkType="rect3d",this._barName=ct.bar3d}}Qp.type=ct.rangeColumn3d,Qp.mark=Jp;const tg=()=>{Vu(),e.registerCartesianBandAxis(),e.registerCartesianLinearAxis(),e.Factory.registerSeries(Qp.type,Qp)};class eg extends e.RangeColumnSeriesSpecTransformer{_transformLabelSpec(t){var e;"bothEnd"!==(null===(e=t.label)||void 0===e?void 0:e.position)&&this._addMarkLabelSpec(t,"bar3d")}}class ig extends e.CartesianChartSpecTransformer{_getDefaultSeriesSpec(t){var e,i;const n=super._getDefaultSeriesSpec(t,["bar3d","barGapInGroup"]);return"horizontal"===t.direction?n.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:n.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],n}}class ng extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=ig,this.type="rangeColumn3d",this.seriesType=ct.rangeColumn3d}_setModelOption(){this._modelOption.getDimensionInfo=e.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=e.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=e.getCartesianCrosshairRect}}ng.type="rangeColumn3d",ng.seriesType=ct.rangeColumn3d,ng.transformerConstructor=ig;const sg="pictogram",rg="pictogram";var ag;!function(t){t.pictogram="pictogram"}(ag||(ag={}));const og=Object.assign(Object.assign({},e.baseSeriesMark),{pictogram:{name:"pictogram",type:"group"}});class lg extends e.BaseChartSpecTransformer{_isValidSeries(t){return t===rg}_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 hg=new Map;let cg;function dg(t,i){hg.has(t)&&e.warn(`svg source key of '${t}' already exists, will be overwritten.`),cg||(cg=new R,e.registerDataSetInstanceParser(cg,"svg",S));const n=new L(cg);n.parse(i,{type:"svg"}),hg.set(t,n)}function ug(t){hg.has(t)?hg.delete(t):e.warn(`map type of '${t}' does not exists.`)}function pg(t){return hg.get(t)}class gg extends e.BaseSeriesSpecTransformer{_getDefaultSpecFromChart(t){var e,n,s;const r=null!==(e=super._getDefaultSpecFromChart(t))&&void 0!==e?e:{},a=t.svg,o=null===(s=null===(n=hg.get(a))||void 0===n?void 0:n.latestData)||void 0===s?void 0:s.elements;if(o&&o.length){o.map((t=>t.name)).filter((t=>i.isValid(t))).forEach((e=>{t[e]&&(r[e]=t[e])}))}return r}}class fg 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 mg="element-highlight-by-graphic-name";class yg extends e.ElementHighlight{constructor(){super(...arguments),this.type=mg,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(i.isNil(t))return;const{interaction:e,highlightState:n,blurState:s}=this.options,r=e.getStatedGraphics(this),a=[];this.getMarks().forEach((e=>{var i;null===(i=e.getGraphics())||void 0===i||i.forEach((e=>{e.name===t&&a.push(e)}))})),e.updateStates(this,a,r,n,s),e.setStatedGraphics(this,a)}reset(){const{highlightState:t,blurState:e,interaction:i}=this.options;i.clearAllStatesOfTrigger(this,t,e),i.setStatedGraphics(this,[])}}yg.type=mg;const bg="element-select-by-graphic-name";class vg extends e.ElementSelect{constructor(){super(...arguments),this.type=bg}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)}))}))}}vg.type=bg;function xg(t){var e;return i.isValid(t)&&"none"!==t&&!(null===(e=t.includes)||void 0===e?void 0:e.call(t,"url"))}const _g=t=>{const e=parseFloat(t.strokeWidth);if(!isNaN(e))return e;const i=t.stroke;return i&&xg(i)?1:0},Ag=(t,e)=>{var i;const n=null!==(i=t.fill)&&void 0!==i?i:e;return n&&xg(n)?n:void 0},Sg=(t,e)=>{var i;const n=null!==(i=t.stroke)&&void 0!==i?i:e;return!(!n||!xg(n))&&n},Tg=t=>Object.assign(Object.assign({},t),{x:parseFloat(t.x)||void 0,y:parseFloat(t.y)||void 0,fillStrokeOrder:!1,fill:Ag(t),lineWidth:_g(t),stroke:Sg(t)}),wg={group:t=>{const e=Tg(t);return Object.assign(Object.assign({},e),{visibleAll:!1!==e.visible})},rule:t=>Object.assign(Object.assign({},Tg(t)),{x:parseFloat(t.x1),y:parseFloat(t.y1),x1:parseFloat(t.x2),y1:parseFloat(t.y2)}),rect:t=>Object.assign(Object.assign({},Tg(t)),{fill:Ag(t,"#000"),width:parseFloat(t.width),height:parseFloat(t.height)}),polygon:t=>Object.assign(Object.assign({},Tg(t)),{fill:Ag(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({},Tg(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({},Tg(t)),{path:t.d,fillStrokeOrder:!1,fill:Ag(t,"#000")}),arc:t=>{var e;return Object.assign(Object.assign({},Tg(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:Ag(t,"#000")})},text:(t,e)=>{var i,n;return Object.assign(Object.assign({},Tg(t)),{text:e,textAlign:null!==(i=t.textAlign)&&void 0!==i?i:"left",textBaseLine:null!==(n=t.textAnchor)&&void 0!==n?n:"middle",anchor:[0,0],fill:Ag(t,"#000")})}},Mg=t=>{var n,s;if(!t||!t[0])return{};const{elements:r}=t[0].latestData;if(r&&r.length){r.forEach(((t,n)=>{var s;t[e.DEFAULT_DATA_INDEX]=n,t._uniqueId=`${t.id}-${n}`,t.data=void 0;const{graphicType:r,transform:a}=t,o={visible:"hidden"!==t.attributes.visibility&&"collapse"!==t.attributes.visibility};"text"===t.graphicType?i.merge(o,t._inheritStyle,null===(s=t.parent)||void 0===s?void 0:s._textGroupStyle,t.attributes):"group"!==t.graphicType&&i.merge(o,t._inheritStyle,t.attributes),wg[r]?t._finalAttributes=wg[r](o,t.value):t._finalAttributes=o,a&&(t._finalAttributes.postMatrix=Object.assign({},a))}));const t=r.filter((t=>"text"===t.tagName));for(let i=0;i<t.length;i++){const a=t[i]._uniqueId,o=r.filter((t=>{let e=!1,i=t.parent;for(;i;){if(i._uniqueId===a){e=!0;break}i=i.parent}return e}));if(o&&o.length){const r=null!==(s=null===(n=t[i]._textGroupStyle)||void 0===n?void 0:n.x)&&void 0!==s?s:0;let a=r;for(let t=0;t<o.length;t++){const i=o[t];if("group"===i.graphicType)a=r;else if(i.value&&void 0===i.parent._textGroupStyle.x){const n=o.slice(0,t).reverse().find((t=>"text"===t.graphicType&&t.value));if(n){a+=e.measureText(n.value,n._finalAttributes).width}i._finalAttributes.x=a}}}}}return r};class Bg extends e.GeoSeries{constructor(){super(...arguments),this.type=rg,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=pg(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 n="multiple"===t.mode,s=i.isValid(t.triggerOff)?t.triggerOff:n?["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:n}}initMark(){var t;if(this._pictogramMark=this._createMark(Bg.mark.pictogram,{groupKey:this.getDimensionField()[0],isSeriesMark:!0,skipBeforeLayouted:!0},{morph:e.shouldMarkDoMorph(this._spec,Bg.mark.pictogram.name)}),this._pictogramMark){this._pictogramMark.setData(this._mapViewData),this._pictogramMark.setUserId(Bg.mark.pictogram.name);for(const i of this._mapViewData.getDataView().latestData){const{graphicType:n,name:s,parent:r,id:a,_nameFromParent:o,_uniqueId:l}=i,h=this._createMark({type:n,name:null!=s?s:o},{groupKey:l,isSeriesMark:!1,skipBeforeLayouted:!0,parent:null!==(t=this._idToMark.get(null==r?void 0:r._uniqueId))&&void 0!==t?t:this._pictogramMark},{morph:e.shouldMarkDoMorph(this._spec,Bg.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(Bg.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,viewBoxRect:n}=this._parsedSvgResult,s=this._mapViewData.getDataView().latestData;t&&(this.setMarkStyle(this._pictogramMark,wg.group(t.attributes),"normal",e.AttributeLevel.Built_In),t.transform&&this.setMarkStyle(this._pictogramMark,{postMatrix:()=>t.transform},"normal",e.AttributeLevel.Built_In),n&&this._pictogramMark.setMarkConfig({clip:!0,clipPath:[Ya(Object.assign(Object.assign({},n),{fill:!0}))]}));for(const t of s){const{_uniqueId:n,_finalAttributes:s}=t,r=this._idToMark.get(n),a=this._validElement(t);r&&(this.setMarkStyle(r,{keepStrokeScale:!0},"normal",e.AttributeLevel.Built_In),a?(this.initMarkStyleWithSpec(r,i.merge({},this._spec.pictogram,this._spec[r.name])),this.setMarkStyle(r,s,"normal",e.AttributeLevel.Series),r.setPostProcess("fill",((t,e)=>i.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 fg(this),this.getMarksWithoutRoot().forEach((t=>{t&&t.name&&this._tooltipHelper.activeTriggerSet.mark.add(t)}))}dataToPosition(t,e=!1){if(!t)return null;const n=t[this.nameField];if(!n)return null;const s=this.getMarksWithoutRoot().filter((t=>t.name===n));if(!s||0===s.length)return null;let r=new i.Bounds;e?s.forEach((t=>{r=r.union(t.getGraphics()[0].globalAABBBounds)})):s.forEach((t=>{r=r.union(t.getProduct().AABBBounds)}));const a={x:(r.x1+r.x2)/2,y:(r.y1+r.y2)/2};if(e){const{x:t,y:e}=this.getLayoutStartPoint();a.x-=t,a.y-=e}return a}coordToPosition(t){if(!t)return null;const{x:e,y:i}=t,n=this.getRootMatrix();if(!n)return null;const s={};return n.getInverse().transformPoint({x:e,y:i},s),s}getRootMatrix(){var t;return null===(t=this.getPictogramRootGraphic())||void 0===t?void 0:t.transMatrix}getPictogramRootGraphic(){return this._pictogramMark.getProduct()}initData(){var t,i;super.initData();const n=hg.get(this.svg);n||null===(t=this._option)||void 0===t||t.onError("no valid svg found!");const s=new L(this._dataSet,{name:`pictogram_${this.id}_data`});e.registerDataSetInstanceTransform(this._dataSet,"pictogram",Mg),e.registerDataSetInstanceTransform(this._dataSet,"lookup",e.lookup),s.parse([n],{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",s.reRunAllTransform),this._mapViewData=new e.CompilableData(this._option,s)}mapViewDataUpdate(){this._mapViewData.updateData()}onLayoutEnd(){var t;super.onLayoutEnd(),null===(t=this._mapViewData)||void 0===t||t.getDataView().reRunAllTransform()}updateSVGSize(){const{width:t,height:e}=this.getLayoutRect(),i=t/2,n=e/2,s=this.getPictogramRootGraphic();if(s){const r=s.AABBBounds,{x1:a,x2:o,y1:l,y2:h}=s.AABBBounds,c=(a+o)/2,d=(l+h)/2,u=t/r.width(),p=e/r.height(),g=Math.min(u,p);s.scale(g,g,{x:c,y:d}),s.translate(i-c,n-d)}}initEvent(){var t;super.initEvent(),null===(t=this._mapViewData.getDataView())||void 0===t||t.target.addListener("change",this.mapViewDataUpdate.bind(this)),this.event.on(e.ChartEvent.afterMarkLayoutEnd,this.updateSVGSize.bind(this))}handleZoom(t){const{scale:e,scaleCenter:n}=t;if(1===e)return;const s=this.getPictogramRootGraphic();s&&(s.attribute.postMatrix||s.setAttributes({postMatrix:new i.Matrix}),s.scale(e,e,n))}handlePan(t){const{delta:e}=t;if(0===e[0]&&0===e[1])return;const n=this.getPictogramRootGraphic();n&&(n.attribute.postMatrix||n.setAttributes({postMatrix:new i.Matrix}),n.translate(e[0],e[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}}Bg.type=rg,Bg.mark=og,Bg.transformerConstructor=gg;const Cg=()=>{e.Factory.registerSeries(Bg.type,Bg),e.Factory.registerImplement("registerSVG",dg),e.Factory.registerImplement("unregisterSVG",ug),e.Factory.registerInteractionTrigger(yg.type,yg),e.Factory.registerInteractionTrigger(vg.type,vg)};class kg extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=lg,this.type=sg,this.seriesType=rg}}kg.type=rg,kg.seriesType=sg,kg.transformerConstructor=lg;class Pg 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 Og="imageCloud",Rg="imageCloud";var Lg;!function(t){t.image="image",t.imageMask="imageMask"}(Lg||(Lg={}));const Ig=Object.assign(Object.assign({},e.baseSeriesMark),{image:{name:"image",type:"image"},imageMask:{name:"imageMask",type:"rect"}}),Eg={triangleForward:function(){return function(t){const e=t%(2*Math.PI/3);return 1/(Math.cos(e)+Math.sqrt(3)*Math.sin(e))}},triangleUpright:Dg,triangle:Dg,diamond:function(){return function(t){const e=t%(2*Math.PI/4);return 1/(Math.cos(e)+Math.sin(e))}},square:function(){return function(t){return Math.min(1/Math.abs(Math.cos(t)),1/Math.abs(Math.sin(t)))}},star:function(){return function(t){const e=(t+.955)%(2*Math.PI/10);return(t+.955)%(2*Math.PI/5)-2*Math.PI/10>=0?1/(Math.cos(2*Math.PI/10-e)+3.07768*Math.sin(2*Math.PI/10-e)):1/(Math.cos(e)+3.07768*Math.sin(e))}},cardioid:function(){return function(t){return 1+Math.sin(t)}},circle:function(){return function(){return 1}},pentagon:function(){return function(t){const e=(t+.955)%(2*Math.PI/5);return 1/(Math.cos(e)+.726543*Math.sin(e))}}};function Dg(){return function(t){const e=(t+3*Math.PI/2)%(2*Math.PI/3);return 1/(Math.cos(e)+Math.sqrt(3)*Math.sin(e))}}const Fg={archimedean:function(t){const e=t[0]/t[1];return t=>[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]},rectangular:function(t){const e=4*t[0]/t[1];let i=0,n=0;return t=>{const s=t<0?-1:1;switch(Math.sqrt(1+4*s*t)-s&3){case 0:i+=e;break;case 1:n+=4;break;case 2:i-=e;break;default:n-=4}return[i,n]}}};const jg=(t,e,n)=>{const{threshold:s,invert:r=!1}=null!=e?e:{};if(!t||"#fff"===t)return(t,e,n)=>{const a=t.width;if(0===t.data[e*a*4+4*n+3])return!r;const o=t.data[e*a*4+4*n+0],l=t.data[e*a*4+4*n+1],h=t.data[e*a*4+4*n+2];if(255===o&&255===l&&255===h)return!r;if(i.isValidNumber(s)){const t=.3*o+.59*l+.11*h;return r?t<=s:t>=s}return!1};const a=n({width:1,height:1}).getContext("2d",{willReadFrequently:!0});a.fillStyle=t,a.fillRect(0,0,1,1);const o=a.getImageData(0,0,1,1).data;return(t,e,i)=>{const n=t.width;return[0,1,2,3].every((s=>r?t.data[4*(e*n+i)+s]!==o[s]:t.data[4*(e*n+i)+s]===o[s]))}},Ug=(t,e,n,s,r)=>{const{fontFamily:a="sans-serif",fontWeight:o="normal",fontStyle:l="normal",fontVariant:h="normal",text:c,hollow:d}=t;let u=12;r.font=`${l} ${h} ${o} ${u}px ${a}`,r.textAlign="center",r.textBaseline="middle",r.fillStyle=e;const p=r.measureText(c),g="normal"!==l?1.1:1,f=i.isValid(p.actualBoundingBoxRight)&&i.isValid(p.actualBoundingBoxLeft)?Math.ceil(g*(Math.abs(p.actualBoundingBoxRight)+Math.abs(p.actualBoundingBoxLeft))):0,m=Math.max(Math.ceil(p.width),f,u);if(d&&(r.globalCompositeOperation="xor"),m>n){const t=Math.min(n/m,s/u);r.fillText(c,n/2,s/2),r.scale(t,t)}else u=Math.floor(u*n/m),u=Math.min(u,s),r.font=`${l} ${h} ${o} ${u}px ${a}`,r.fillText(c,Math.floor(n/2),Math.floor(s/2))},Ng=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3?arguments[3]:void 0;const r=2*Math.PI/s;return new Array(s).fill(0).map(((s,a)=>i.polarToCartesian(t,e,n+a*r)))},Wg=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3?arguments[3]:void 0;const r=2*Math.PI/s,a=(t=>Eg[t]?Eg[t]():Eg.circle())("cardioid");return new Array(s).fill(0).map(((s,o)=>{const l=n+o*r,h=e*a(l);return i.polarToCartesian(t,h,l)}))},zg=(t,e)=>{t.beginPath(),e.forEach(((e,i)=>{0===i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y)})),t.closePath(),t.fill()},Vg=(t,e,i,n,s)=>{const{hollow:r}=t,{center:a,maxRadius:o}=function(t,e){const i=e[0],n=e[1];let s=1;const r=[e[0]>>1,e[1]>>1];switch(t){case"cardioid":r[1]=~~(n/2.7*.4),s=Math.floor(Math.min(i/2.3,n/2.6));break;case"triangleForward":s=n/Math.sqrt(.75)>i?Math.floor(i/2):Math.floor(n/(2*Math.sqrt(.75)));break;case"triangle":case"triangleUpright":r[1]=~~(n/1.5),s=Math.floor(Math.min(n/1.5,i/2));break;case"circle":case"diamond":case"square":case"star":case"pentagon":s=Math.floor(Math.min(i/2,n/2));break;default:s=Math.floor(Math.max(i/2,n/2))}return{maxRadius:s,center:r}}(t.shape,[i,n]);s.fillStyle=e,r&&(s.globalCompositeOperation="xor");const l=a[0],h=a[1];if("cardioid"===t.shape)((t,e)=>{let i;t.beginPath(),e.forEach(((e,n)=>{0===n?t.moveTo(e.x,e.y):t.bezierCurveTo(e.x,e.y,i.x,i.y,e.x,e.y),i=e})),t.closePath(),t.fill()})(s,Wg({x:l,y:h},o,0,100));else if("circle"===t.shape)s.beginPath(),s.arc(l,h,o,0,2*Math.PI,!0),s.fill();else if("diamond"===t.shape)zg(s,Ng({x:l,y:h},o,-Math.PI/2,4));else if("square"===t.shape)zg(s,Ng({x:l,y:h},o,-Math.PI/4,4));else if("pentagon"===t.shape)zg(s,Ng({x:l,y:h},o,Math.PI/2,5));else if("triangle"===t.shape||"triangleUpright"===t.shape)zg(s,Ng({x:l,y:h},o,-Math.PI/2,3));else if("triangleForward"===t.shape)zg(s,Ng({x:l,y:h},o,0,3));else if("star"===t.shape){const t=Ng({x:l,y:h},o,-Math.PI/2,5),e=Ng({x:l,y:h},o/(2*Math.cos(Math.PI/5)),-Math.PI/2+Math.PI/5,5),i=[];for(let n=0;n<5;n++)i.push(t[n]),i.push(e[n]);zg(s,i)}else s.fillRect(0,0,i,n)};function Gg(t){const{size:e,maskCanvas:i}=t,n=i.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,i.width,i.height),s=new Array(e[0]*e[1]).fill(0);let r=1;const a=[[0,1],[1,0],[-1,0],[0,-1]];let o=[];for(let i=0;i<e[1];i++)for(let l=0;l<e[0];l++)if(0===s[i*e[0]+l]&&!t.isEmptyPixel(n,i,l)){s[i*e[0]+l]=r,o.push([i,l]);for(let i=0;i<o.length;i++)for(let l=0;l<4;l++){let h=o[i][0]+a[l][0],c=o[i][1]+a[l][1];h=h<0?0:h>=e[1]?e[1]-1:h,c=c<0?0:c>=e[0]?e[0]-1:c,0!==s[h*e[0]+c]||t.isEmptyPixel(n,h,c)||(s[h*e[0]+c]=r,o.push([h,c]))}r++,o=[]}const l={},h={},c={},d={},u={},p={},g={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0,width:0,height:0},f=[];for(let t=0;t<e[1];t++)for(let i=0;i<e[0];i++){const n=s[t*e[0]+i];0!==n&&(T(t,i)&&(f.push([t,i]),l[n]=l[n]||[],l[n].push([i,t]),d[n]||(d[n]=[1/0,-1/0,1/0,-1/0]),t<d[n][0]&&(d[n][0]=t),t>d[n][1]&&(d[n][1]=t),i<d[n][2]&&(d[n][2]=i),i>d[n][3]&&(d[n][3]=i),i<g.x1&&(g.x1=i),i>g.x2&&(g.x2=i),t<g.y1&&(g.y1=t),t>g.y2&&(g.y2=t)),h[n]=(h[n]||0)+1)}const m=[];for(const t in l){const e=l[t],i=~~(e.reduce(((t,e)=>t+e[0]),0)/e.length),n=~~(e.reduce(((t,e)=>t+e[1]),0)/e.length);c[t]=[i,n],m.push(...e);const[s,r,a,o]=d[t];u[t]=~~Math.max(Math.sqrt((i-a)**2+(n-s)**2),Math.sqrt((i-o)**2+(n-r)**2),Math.sqrt((i-a)**2+(n-r)**2),Math.sqrt((i-o)**2+(n-s)**2)),p[t]=(o-a)/(r-s)}const y=Object.keys(c).map((t=>({label:t-1,boundary:l[t],area:h[t],center:c[t],maxPoint:d[t],maxR:u[t],ratio:p[t]})));g.width=g.x2-g.x1+1,g.height=g.y2-g.y1+1;const b=~~(m.reduce(((t,e)=>t+e[0]),0)/m.length),v=~~(m.reduce(((t,e)=>t+e[1]),0)/m.length),x=~~Math.max(Math.sqrt((b-g.x1)**2+(v-g.y1)**2),Math.sqrt((b-g.x2)**2+(v-g.y2)**2),Math.sqrt((b-g.x1)**2+(v-g.y2)**2),Math.sqrt((b-g.x2)**2+(v-g.y1)**2)),_=g.width/g.height,A=Object.keys(h).reduce(((t,e)=>t+h[e]),0),S={regions:y,labels:s,labelNumber:r-1};if(t.blur){const i=t.blur,n=function(t,e,i,n){const s=n/3,r=Math.ceil(n/2),a=function(t,e){const i=new Array(2*t+1).fill(0),n=t;let s=0;for(let r=-t;r<=t;r++){const t=Math.exp(-r*r/(2*e*e));i[r+n]=t,s+=t}for(let t=0;t<i.length;t++)i[t]/=s;return i}(r,s),o=new Array(t.length).fill(0),l=new Array(t.length).fill(0);for(let n=0;n<i;n++)for(let i=0;i<e;i++){let s=0;for(let o=-r;o<=r;o++)s+=t[n*e+Math.min(Math.max(i+o,0),e-1)]*a[o+r];o[n*e+i]=s}for(let t=0;t<e;t++)for(let n=0;n<i;n++){let s=0;for(let l=-r;l<=r;l++)s+=o[Math.min(Math.max(n+l,0),i-1)*e+t]*a[l+r];l[n*e+t]=Math.max(0,Math.min(1,s))}return l}(s,e[0],e[1],i);(function(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;const r=new Array(t.length).fill(0);for(const[t,a]of e)if(r[t*i+a]=1,s>1)for(let e=1-s;e<=s-1;e++)for(let o=1-s;o<=s-1;o++)if(Math.sqrt(e*e+o*o)<s){const s=t+e,l=a+o;s>=0&&s<n&&l>=0&&l<i&&(r[s*i+l]=1)}return r})(s,f,e[0],e[1],Math.ceil(i/2)).forEach(((t,e)=>{1===t&&(s[e]=n[e])}))}return Object.assign(t,{segmentation:S,shapeBounds:g,shapeMaxR:x,shapeRatio:_,shapeCenter:[b,v],shapeArea:A});function T(t,i){const n=[[0,1],[1,0],[-1,0],[0,-1]];if(0===t||0===i||t===e[1]-1||i===e[0]-1)return!0;for(let r=0;r<4;r++){let a=t+n[r][0],o=i+n[r][1];if(a=a<0?0:a>=e[1]?e[1]-1:a,o=o<0?0:o>=e[0]?e[0]-1:o,0===s[a*e[0]+o])return!0}return!1}}function Hg(t,e,i){e.width=t.width,e.height=t.height;const n=e.getContext("2d",{willReadFrequently:!0});n.clearRect(0,0,e.width,e.height),n.drawImage(t,0,0);const s=e.width,r=n.getImageData(0,0,e.width,e.height);let a=0,o=r.height,l=0,h=r.width;const c=(t,e)=>{for(let n=0;n<t;++n)if(!i(r,e,n))return!1;return!0},d=(t,e,n)=>{for(let s=e;s<n;++s)if(!i(r,s,t))return!1;return!0};for(;a<o&&c(s,a);)++a;for(;o-1>a&&c(s,o-1);)--o;for(;l<h&&d(l,a,o);)++l;for(;h-1>l&&d(h-1,a,o);)--h;const u=n.getImageData(l,a,h-l,o-a);return e.width=u.width,e.height=u.height,n.clearRect(0,0,e.width,e.height),n.putImageData(u,0,0),e}function Xg(t,e){return t&&(i.isValidUrl(t)||i.isBase64(t)||t.startsWith("<svg"))?new Promise(((i,n)=>{var s;const r=e({image:t}),a=null===(s=r.resources)||void 0===s?void 0:s.get(t);a&&"success"===a.state&&a.data?i(a.data):(r.successCallback=()=>{var e;if(r){const s=null===(e=r.resources)||void 0===e?void 0:e.get(t);s&&"success"===s.state&&s.data?i(s.data):n(new Error("image load failed: "+t))}else n(new Error("image load failed: "+t))},r.failCallback=()=>{n(new Error("image load failed: "+t))})})):null}var Yg;function qg(t){return t}!function(t){t.Identity="identity",t.Linear="linear",t.Log="log",t.Pow="pow",t.Sqrt="sqrt",t.Symlog="symlog",t.Time="time",t.Quantile="quantile",t.Quantize="quantize",t.Threshold="threshold",t.Ordinal="ordinal",t.Point="point",t.Band="band"}(Yg||(Yg={})),Object.values(Yg).forEach((t=>{}));const $g=t=>t<0?-Math.sqrt(-t):Math.sqrt(t),Kg=t=>t<0?-t*t:t*t;function Zg(t,e){if(t=Number(t),e=Number(e),e-=t)return i=>(i-t)/e;const i=Number.isNaN(e)?NaN:.5;return()=>i}function Jg(t,e,i){const n=t[0],s=t[1],r=e[0],a=e[1];let o,l;return s<n?(o=Zg(s,n),l=i(a,r)):(o=Zg(n,s),l=i(r,a)),t=>l(o(t))}function Qg(t,e,n){const s=Math.min(t.length,e.length)-1,r=new Array(s),a=new Array(s);let o=-1;for(t[s]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<s;)r[o]=Zg(t[o],t[o+1]),a[o]=n(e[o],e[o+1]);return function(e){const n=i.bisect(t,e,1,s)-1;return a[n](r[n](e))}}const tf=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=Math.floor(Math.log10(t)),n=t/Math.pow(10,i);let s;return s=e?n<1.5?1:n<3?2:n<7?5:10:n<=1?1:n<=2?2:n<=5?5:10,s*Math.pow(10,i)};class ef{constructor(){this._rangeFactorStart=null,this._rangeFactorEnd=null}_calculateWholeRange(t){return this._wholeRange?this._wholeRange:i.isValid(this._rangeFactorStart)&&i.isValid(this._rangeFactorEnd)&&2===t.length?(this._wholeRange=function(t,e){const i=(t[1]-t[0])/(e[1]-e[0]),n=t[0]-i*e[0];return[n,i+n]}(t,[this._rangeFactorStart,this._rangeFactorEnd]),this._wholeRange):t}rangeFactor(t,e,n){return t?(2===t.length&&t.every((t=>t>=0&&t<=1))&&(this._wholeRange=null,0===t[0]&&1===t[1]?(this._rangeFactorStart=null,this._rangeFactorEnd=null):(this._rangeFactorStart=t[0],this._rangeFactorEnd=t[1])),this):n?(this._wholeRange=null,this._rangeFactorStart=null,this._rangeFactorEnd=null,this):i.isValid(this._rangeFactorStart)&&i.isValid(this._rangeFactorEnd)?[this._rangeFactorStart,this._rangeFactorEnd]:null}rangeFactorStart(t,e){var n;return i.isNil(t)?this._rangeFactorStart:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!i.isNil(this._rangeFactorEnd)&&1!==this._rangeFactorEnd?(this._rangeFactorStart=t,this._rangeFactorEnd=null!==(n=this._rangeFactorEnd)&&void 0!==n?n:1):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}rangeFactorEnd(t,e){var n;return i.isNil(t)?this._rangeFactorEnd:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!i.isNil(this._rangeFactorStart)&&0!==this._rangeFactorStart?(this._rangeFactorEnd=t,this._rangeFactorStart=null!==(n=this._rangeFactorStart)&&void 0!==n?n:0):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}generateFishEyeTransform(){var t;if(!this._fishEyeOptions)return void(this._fishEyeTransform=null);const{distortion:e=2,radiusRatio:n=.1,radius:s}=this._fishEyeOptions,r=this.range(),a=r[0],o=r[r.length-1],l=Math.min(a,o),h=Math.max(a,o),c=i.clamp(null!==(t=this._fishEyeOptions.focus)&&void 0!==t?t:0,l,h),d=i.isNil(s)?(h-l)*n:s;let u=Math.exp(e);u=u/(u-1)*d;const p=e/d;this._fishEyeTransform=t=>{const e=Math.abs(t-c);if(e>=d)return t;if(e<=1e-6)return c;const i=u*(1-Math.exp(-e*p))/e*.75+.25;return c+(t-c)*i}}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}get(t,e){var i;return null!==(i=null==this?void 0:this[t])&&void 0!==i?i:e}}const{interpolateRgb:nf}=i.ColorUtil;function sf(t,e){const n=typeof e;let s;if(i.isNil(e)||"boolean"===n)return()=>e;if("number"===n)return i.interpolateNumber(t,e);if("string"===n){if(s=i.ColorUtil.Color.parseColorString(e)){const e=nf(i.ColorUtil.Color.parseColorString(t),s);return t=>e(t).formatRgb()}return i.interpolateNumber(Number(t),Number(e))}return e instanceof i.ColorUtil.RGB?nf(t,e):e instanceof i.ColorUtil.Color?nf(t.color,e.color):e instanceof Date?i.interpolateDate(t,e):i.interpolateNumber(Number(t),Number(e))}class rf extends ef{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:qg,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qg;super(),this._unknown=void 0,this.transformer=t,this.untransformer=e,this._forceAlign=!0,this._domain=[0,1],this._range=[0,1],this._clamp=qg,this._piecewise=Jg,this._interpolate=sf}calculateVisibleDomain(t){var e;return i.isValid(this._rangeFactorStart)&&i.isValid(this._rangeFactorEnd)&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:null!==(e=this._niceDomain)&&void 0!==e?e:this._domain}fishEye(t,e,i){return t||i?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}scale(t){var e;if(t=Number(t),Number.isNaN(t)||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise((null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));const i=this._output(this.transformer(this._clamp(t)));return this._fishEyeTransform?this._fishEyeTransform(i):i}invert(t){var e;return this._input||(this._input=this._piecewise(this._calculateWholeRange(this._range),(null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),i.interpolateNumber)),this._clamp(this.untransformer(this._input(t)))}domain(t,e){var n;if(!t)return(null!==(n=this._niceDomain)&&void 0!==n?n:this._domain).slice();this._domainValidator=null,this._niceType=null,this._niceDomain=null;const s=Array.from(t,i.toNumber);return this._domain=s,this.rescale(e)}range(t,e){if(!t)return this._range.slice();const i=Array.from(t);return this._range=i,this.rescale(e)}rangeRound(t,e){const n=Array.from(t);return this._range=n,this._interpolate=i.interpolateNumberRound,this.rescale(e)}rescale(t){var e;if(t)return this;const n=null!==(e=this._niceDomain)&&void 0!==e?e:this._domain,s=n.length,r=this._range.length;let a=Math.min(s,r);if(s&&s<r&&this._forceAlign){const t=r-s+1,e=n[s-1],i=s>=2?(e-n[s-2])/t:0;for(let r=1;r<=t;r++)n[s-2+r]=e-i*(t-r);a=r}return this._autoClamp&&(this._clamp=i.clamper(n[0],n[a-1])),this._piecewise=a>2?Qg:Jg,this._output=this._input=null,this._wholeRange=null,this.generateFishEyeTransform(),this}clamp(t,e,i){return arguments.length?(e?(this._autoClamp=!1,this._clamp=e):(this._autoClamp=!!t,this._clamp=t?void 0:qg),this.rescale(i)):this._clamp!==qg}interpolate(t,e){return arguments.length?(this._interpolate=t,this.rescale(e)):this._interpolate}ticks(){return[]}tickData(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const e=this.ticks(t);return(null!=e?e:[]).map(((t,e)=>({index:e,tick:t,value:(this.scale(t)-this._range[0])/(this._range[1]-this._range[0])})))}rangeFactor(t,e){return t?(super.rangeFactor(t),this._output=this._input=null,this):super.rangeFactor()}rangeFactorStart(t,e){return i.isNil(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this._output=this._input=null,this)}rangeFactorEnd(t,e){return i.isNil(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this._output=this._input=null,this)}forceAlignDomainRange(t){return arguments.length?(this._forceAlign=t,this):this._forceAlign}}const af=Math.sqrt(50),of=Math.sqrt(10),lf=Math.sqrt(2),hf=[1,2,5,10],cf=(t,e,n)=>{let s=1,r=t;const a=Math.floor((e-1)/2),o=Math.abs(t);return t>=0&&t<=Number.MIN_VALUE?r=0:t<0&&t>=-Number.MIN_VALUE?r=-(e-1):!n&&o<1?s=gf(o).step:(n||o>1)&&(r=Math.floor(t)-a*s),s>0?(t>0?r=Math.max(r,0):t<0&&(r=Math.min(r,-(e-1)*s)),i.range(0,e).map((t=>r+t*s))):t>0?uf(0,-(e-1)/s,s):uf((e-1)/s,0,s)},df=i.memoize(((t,e,i,n)=>{let s,r,a,o,l=-1;if(i=+i,(t=+t)==(e=+e))return[t];if(Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return[t];if((s=e<t)&&(r=t,t=e,e=r),o=ff(t,e,i).step,!isFinite(o))return[];if(o>0){let i=Math.round(t/o),n=Math.round(e/o);for(i*o<t&&++i,n*o>e&&--n,a=new Array(r=n-i+1);++l<r;)a[l]=(i+l)*o}else if(o<0&&(null==n?void 0:n.noDecimals)){o=1;const i=Math.ceil(t),n=Math.floor(e);if(!(i<=n))return[];for(a=new Array(r=n-i+1);++l<r;)a[l]=i+l}else{o=-o;let i=Math.round(t*o),n=Math.round(e*o);for(i/o<t&&++i,n/o>e&&--n,a=new Array(r=n-i+1);++l<r;)a[l]=(i+l)/o}return s&&a.reverse(),a})),uf=(t,e,i)=>{let n,s,r=-1;if(i>0){let a=Math.floor(t/i),o=Math.ceil(e/i);for((a+1)*i<t&&++a,(o-1)*i>e&&--o,s=new Array(n=o-a+1);++r<n;)s[r]=(a+r)*i}else{i=-i;let a=Math.floor(t*i),o=Math.ceil(e*i);for((a+1)/i<t&&++a,(o-1)/i>e&&--o,s=new Array(n=o-a+1);++r<n;)s[r]=(a+r)/i}return s},pf=i.memoize(((t,e,i,n)=>{let s,r,a;if(i=+i,(t=+t)==(e=+e))return cf(t,i,null==n?void 0:n.noDecimals);if(Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return cf(t,i,null==n?void 0:n.noDecimals);(s=e<t)&&(a=t,t=e,e=a);const o=ff(t,e,i);let l=o.step;if(!isFinite(l))return[];if(l>0){let n=1;const{power:s,gap:a}=o,h=10===a?2*10**s:1*10**s;for(;n<=5&&(r=uf(t,e,l),r.length>i+1)&&i>2;)l+=h,n+=1;i>2&&r.length<i-1&&(r=((t,e,i)=>{let n;const s=t[0],r=t[t.length-1],a=e-t.length;if(r<=0){const e=[];for(n=a;n>=1;n--)e.push(s-n*i);return e.concat(t)}if(s>=0){for(n=1;n<=a;n++)t.push(r+n*i);return t}let o=[];const l=[];for(n=1;n<=a;n++)n%2==0?o=[s-Math.floor(n/2)*i].concat(o):l.push(r+Math.ceil(n/2)*i);return o.concat(t).concat(l)})(r,i,l))}else(null==n?void 0:n.noDecimals)&&l<0&&(l=1),r=uf(t,e,l);return s&&r.reverse(),r})),gf=t=>{const e=Math.floor(Math.log(t)/Math.LN10),i=t/10**e;let n=hf[0];return i>=af?n=hf[3]:i>=of?n=hf[2]:i>=lf&&(n=hf[1]),e>=0?{step:n*10**e,gap:n,power:e}:{step:-(10**-e)/n,gap:n,power:e}};function ff(t,e,i){const n=(e-t)/Math.max(0,i);return gf(n)}function mf(t,e,i){let n;if(i=+i,(t=+t)==(e=+e)&&i>0)return[t];if(i<=0||0===(n=function(t,e,i){return(e-t)/Math.max(1,i-1)}(t,e,i))||!isFinite(n))return[];const s=new Array(i);for(let e=0;e<i;e++)s[e]=t+e*n;return s}function yf(t,e,i){let n,s,r=-1;if(i=+i,(s=(e=+e)<(t=+t))&&(n=t,t=e,e=n),!isFinite(i)||e-t<=i)return[t];const a=Math.floor((e-t)/i+1),o=new Array(a);for(;++r<a;)o[r]=t+r*i;return s&&o.reverse(),o}function bf(t){let e,i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,s=0,r=t.length-1,a=t[s],o=t[r],l=10;for(o<a&&(i=a,a=o,o=i,i=s,s=r,r=i);l-- >0;){if(i=ff(a,o,n).step,i===e)return t[s]=a,t[r]=o,t;if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else{if(!(i<0))break;a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i}e=i}}const vf=(t,e,i)=>Math.abs(e-t)<1?+i.toFixed(1):Math.round(+i);i.memoize(((t,e,i,n,s,r,a)=>{let o=t,l=e;const h=l<o;h&&([o,l]=[l,o]);let c,d,u=s(o),p=s(l),g=[];if(!(n%1)&&p-u<i){if(u=Math.floor(u),p=Math.ceil(p),o>0){for(;u<=p;++u)for(c=1;c<n;++c)if(d=u<0?c/r(-u):c*r(u),!(d<o)){if(d>l)break;g.push(d)}}else for(;u<=p;++u)for(c=n-1;c>=1;--c)if(d=u>0?c/r(-u):c*r(u),!(d<o)){if(d>l)break;g.push(d)}2*g.length<i&&(g=pf(o,l,i))}else g=pf(u,p,Math.min(p-u,i)).map(r);return g=g.filter((t=>0!==t)),(null==a?void 0:a.noDecimals)&&(g=Array.from(new Set(g.map((t=>Math.floor(t)))))),h?g.reverse():g})),i.memoize(((t,e,i,n,s,r)=>{const a=[],o={},l=s(t),h=s(e);let c=[];if(Number.isInteger(n))c=pf(l,h,i);else{const t=(h-l)/(i-1);for(let e=0;e<i;e++)c.push(l+e*t)}return c.forEach((i=>{const s=r(i),l=Number.isInteger(n)?vf(t,e,s):vf(t,e,tf(s)),h=vf(t,e,((t,e)=>{let i,n;return e[0]<e[1]?(i=e[0],n=e[1]):(i=e[1],n=e[0]),Math.min(Math.max(t,i),n)})(l,[t,e]));!o[h]&&!isNaN(h)&&c.length>1&&(o[h]=1,a.push(h))})),a})),i.memoize(((t,e,i,n,s)=>mf(n(t),n(e),i).map((t=>tf(s(t)))))),i.memoize(((t,e,i,n,s)=>yf(n(t),n(e),i).map((t=>tf(s(t))))));class xf extends rf{constructor(){super(...arguments),this.type=Yg.Linear}clone(){var t;const e=new xf;return e.domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate),this._niceType&&(e._niceType=this._niceType,e._domainValidator=this._domainValidator,e._niceDomain=null===(t=this._niceDomain)||void 0===t?void 0:t.slice()),e}tickFormat(){return()=>{}}d3Ticks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=arguments.length>1?arguments[1]:void 0;const i=this.calculateVisibleDomain(this._range);return df(i[0],i[i.length-1],t,e)}ticks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=arguments.length>1?arguments[1]:void 0;var n;if(i.isFunction(null==e?void 0:e.customTicks))return e.customTicks(this,t);if(i.isValid(this._rangeFactorStart)&&i.isValid(this._rangeFactorEnd)&&(this._rangeFactorStart>0||this._rangeFactorEnd<1)&&2===this._range.length||!this._niceType)return this.d3Ticks(t,e);const s=null!==(n=this._niceDomain)&&void 0!==n?n:this._domain,r=this._domain,a=s[0],o=s[s.length-1];let l=pf(r[0],r[r.length-1],t,e);if(!l.length)return l;if(this._domainValidator)l=l.filter(this._domainValidator);else if((l[0]!==a||l[l.length-1]!==o)&&this._niceType){const t=s.slice();if("all"===this._niceType?(t[0]=l[0],t[t.length-1]=l[l.length-1],this._niceDomain=t,this.rescale()):"min"===this._niceType&&l[0]!==a?(t[0]=l[0],this._niceDomain=t,this.rescale()):"max"===this._niceType&&l[l.length-1]!==o&&(t[t.length-1]=l[l.length-1],this._niceDomain=t,this.rescale()),"all"!==this._niceType){const e=Math.min(t[0],t[t.length-1]),i=Math.max(t[0],t[t.length-1]);l=l.filter((t=>t>=e&&t<=i))}}return l}forceTicks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const e=this.calculateVisibleDomain(this._range);return mf(e[0],e[e.length-1],t)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return yf(e[0],e[e.length-1],t)}nice(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=arguments.length>1?arguments[1]:void 0;var n,s;const r=this._domain;let a=[];if(e){const t=function(t,e){const n=i.isNumber(e.forceMin),s=i.isNumber(e.forceMax);let r=null;const a=[];let o=null;const l=n&&s?t=>t>=e.forceMin&&t<=e.forceMax:n?t=>t>=e.forceMin:s?t=>t<=e.forceMax:null;return n?a[0]=e.forceMin:i.isNumber(e.min)&&e.min<=Math.min(t[0],t[t.length-1])&&(a[0]=e.min),s?a[1]=e.forceMax:i.isNumber(e.max)&&e.max>=Math.max(t[0],t[t.length-1])&&(a[1]=e.max),i.isNumber(a[0])&&i.isNumber(a[1])?(o=t.slice(),o[0]=a[0],o[o.length-1]=a[1]):r=i.isNumber(a[0])||i.isNumber(a[1])?i.isNumber(a[0])?"max":"min":"all",{niceType:r,niceDomain:o,niceMinMax:a,domainValidator:l}}(r,e);if(a=t.niceMinMax,this._domainValidator=t.domainValidator,this._niceType=t.niceType,t.niceDomain)return this._niceDomain=t.niceDomain,this.rescale(),this}else this._niceType="all";if(this._niceType){const e=bf(r.slice(),t);"min"===this._niceType?e[e.length-1]=null!==(n=a[1])&&void 0!==n?n:e[e.length-1]:"max"===this._niceType&&(e[0]=null!==(s=a[0])&&void 0!==s?s:e[0]),this._niceDomain=e,this.rescale()}return this}niceMin(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;this._niceType="min";const e=this._domain[this._domain.length-1],i=bf(this.domain(),t);return i&&(i[i.length-1]=e,this._niceDomain=i,this.rescale()),this}niceMax(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;this._niceType="max";const e=this._domain[0],i=bf(this._domain.slice(),t);return i&&(i[0]=e,this._niceDomain=i,this.rescale()),this}}class _f extends xf{constructor(){super($g,Kg),this.type=Yg.Sqrt}clone(){return(new _f).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}}var Af;function Sf(t,e){t.aspectRatio>1?(t.width=e,t.height=~~(e/t.aspectRatio)):(t.height=e,t.width=~~(e*t.aspectRatio))}!function(t){t.BEFORE_IMAGECLOUD_LAYOUT="beforeImagecloudLayout",t.AFTER_IMAGECLOUD_LAYOUT="afterImagecloudLayout",t.AFTER_IMAGECLOUD_DRAW="afterImagecloudDraw"}(Af||(Af={}));class Tf{constructor(t){this.progressiveResult=[],this.imageCollageList=[],this.options=t}preProcess(){const{imageConfig:t={},weight:e}=this.options,{padding:n=0}=t;let s=this.imageCollageList;return s.forEach(((t,s)=>{!1===t.valid?(t.x=-10,t.y=-10,t.width=0,t.height=0,t.opacity=0):(t.padding=n,t.weight=i.simpleField(e)(this.data[s]),t.datum=this.data[s])})),s=s.filter((t=>!1!==t.valid)).sort(((t,e)=>e.weight-t.weight)),s}onImageCollageInputReady(t){t.forEach(((t,e)=>{if("fulfilled"===t.status){const i=t.value,{width:n,height:s}=i;this.imageCollageList.push(Object.assign({},this.data[e],{aspectRatio:n/s}))}else this.imageCollageList.push(Object.assign({},this.data[e],{valid:!1}))}))}layout(t){this.data=t,this.loadSegmentationInput(),this.loadImageCollageInput()}loadSegmentationInput(){var t,e,n,s,r,a;const o=this.options,l=o.size,h={shapeUrl:null!==(t=o.mask)&&void 0!==t?t:{type:"geometric",shape:"rect"},size:l,ratio:o.ratio||.8,tempCanvas:void 0,boardSize:[0,0],random:!1,randomGenerator:void 0,blur:null===(e=o.maskConfig)||void 0===e?void 0:e.edgeBlur},c=this.options.createCanvas({width:l[0],height:l[1]}),d=c.getContext("2d",{willReadFrequently:!0});d.textAlign="center",d.textBaseline="middle",h.tempCanvas=c;const u=l[0]+31>>5<<5;if(h.boardSize=[u,l[1]],h.random?h.randomGenerator=Math.random:h.randomGenerator=i.fakeRandom(),this.segmentationInput=h,i.isString(h.shapeUrl)){h.isEmptyPixel=jg(void 0,{threshold:null!==(s=null===(n=o.maskConfig)||void 0===n?void 0:n.threshold)&&void 0!==s?s:200,invert:null===(r=o.maskConfig)||void 0===r?void 0:r.invert},this.options.createCanvas);const t=Xg(h.shapeUrl,this.options.createImage);t?(this.isMaskImageFinished=!1,this.isLayoutFinished=!1,t.then((t=>{var e,i;this.isMaskImageFinished=!0;const n=o.size,s=this.options.createCanvas({width:n[0],height:n[1],dpr:1});h.maskCanvas=s;const r=s.getContext("2d");(null===(e=o.maskConfig)||void 0===e?void 0:e.removeWhiteBorder)&&Hg(t,s,h.isEmptyPixel);const a=function(t,e){const i=t.width,n=t.height;let s=e[0]/i;n*s>e[1]&&(s=e[1]/n);const r=Math.floor(s*i),a=Math.floor(s*n);return{x:(e[0]-r)/2,y:(e[1]-a)/2,width:r,height:a,scale:s}}(t,n);let l;r.clearRect(0,0,n[0],n[1]),r.drawImage(t,a.x,a.y,a.width,a.height),this.segmentationOutput=Gg(this.segmentationInput),"masked"===(null===(i=this.options.layoutConfig)||void 0===i?void 0:i.placement)&&(l=this.generateTransparentMaskCanvas(t,n)),this.segmentationOutput.transparentMaskCanvas=l,this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(s,l)})).catch((t=>{this.isMaskImageFinished=!0}))):(this.isMaskImageFinished=!0,this.isLayoutFinished=!0)}else if(h.shapeUrl&&("text"===h.shapeUrl.type||"geometric"===h.shapeUrl.type)){h.isEmptyPixel=jg(h.shapeUrl.backgroundColor,void 0,this.options.createCanvas),"text"!==h.shapeUrl.type&&"geometric"!==h.shapeUrl.type||h.shapeUrl.backgroundColor||(h.shapeUrl.backgroundColor="rgba(255,255,255,255)");const t=function(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=arguments.length>5?arguments[5]:void 0,{backgroundColor:a="#fff"}=t,{fill:o="#000"}=t;s&&([a,o]=[o,a]);const l=n||r({width:e,height:i,dpr:1}),h=l.getContext("2d",{willReadFrequently:!0});if(n){const t=n.width,s=n.height;h.clearRect(0,0,t,s),n.style.width=`${e}px`,n.style.height=`${i}px`,n.width=e,n.height=i}return h.fillStyle=a,h.fillRect(0,0,l.width,l.height),"text"===t.type?Ug(t,o,l.width,l.height,h):"geometric"===t.type&&Vg(t,o,l.width,l.height,h),l}(h.shapeUrl,l[0],l[1],void 0,null===(a=o.maskConfig)||void 0===a?void 0:a.invert,this.options.createCanvas);h.maskCanvas=t,this.segmentationOutput=Gg(this.segmentationInput),this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(t,t),this.isMaskImageFinished=!0}}loadImageCollageInput(){const t=function(t,e){return Promise.allSettled(t.map((t=>Xg(t,e))))}(this.data.map((t=>i.simpleField(this.options.image)(t))),this.options.createImage);t?t.then((t=>{this.onImageCollageInputReady(t),this.isImagesFinished=!0})).catch((t=>{this.isImagesFinished=!0,this.isLayoutFinished=!0,i.Logger.getInstance().error("image load failed",t)})):(this.isImagesFinished=!0,this.isLayoutFinished=!0)}canAnimate(){return!0}unfinished(){return!this.isLayoutFinished}output(){return this.progressiveResult}progressiveRun(){if(this.isImagesFinished&&this.isMaskImageFinished&&!this.isLayoutFinished){const t=this.preProcess(),e=this.doLayout(t);this.options&&this.options.onLayoutEnd&&this.options.onLayoutEnd(e),this.progressiveResult=this.processOutput(e),this.isLayoutFinished=!0}}progressiveOutput(){return this.progressiveResult}release(){this.segmentationInput=null,this.data=null,this.progressiveResult=null,this.options=null}calculateImageSize(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.45;const{imageSizeRange:s,padding:r=0}=e,a=i.isNumber(e.imageSize)?e.imageSize:i.field(e.imageSize),o=this.options.size;if(a||s)if(a&&!i.isFunction(a))t.forEach((t=>Sf(t,a)));else if(s){const e=(new _f).domain(i.extent(t,(t=>t.weight))).range(s);t.forEach((t=>Sf(t,~~e.scale(t.weight))))}else if(a&&i.isFunction(a)&&!s){const e=.5,[s,a]=i.extent(t,(t=>t.weight)),l=t.reduce(((t,i)=>{const n=i.aspectRatio,r=(i.weight-s)/(a-s);return t+(n>1?1/n:n)*(e+(1-e)*r)**2}),0),h=~~Math.sqrt(n*o[0]*o[1]/l),c=[~~(e*h)-2*r<0?1:~~(e*h)-2*r,~~h-2*r<0?1:~~h-2*r],d=(new _f).domain(i.extent(t,(t=>t.weight))).range(c);t.forEach((t=>Sf(t,~~d.scale(t.weight))))}else console.warn("image cloud imageSize error");else{const e=t.reduce(((t,e)=>{const i=e.aspectRatio;return t+(i>1?1/i:i)}),0);let i=~~Math.sqrt(n*o[0]*o[1]/e);i=i-2*r<0?1:i-2*r,t.forEach((t=>Sf(t,i)))}return t}generateTransparentMaskCanvas(t,e){var i;const n=this.options.createCanvas({width:e[0],height:e[1],dpr:1}),s=n.getContext("2d");this.segmentationOutput.transparentMaskCanvas=n,(null===(i=this.options.maskConfig)||void 0===i?void 0:i.removeWhiteBorder)&&Hg(t,n,this.segmentationInput.isEmptyPixel);const r=s.createImageData(e[0],e[1]),a=this.segmentationOutput.segmentation.labels;for(let t=0;t<a.length;t++){const e=0===a[t]?255:0,i=255*a[t],n=4*t;r.data[n]=e,r.data[n+1]=e,r.data[n+2]=e,r.data[n+3]=i}return s.clearRect(0,0,e[0],e[1]),s.fillStyle="rgba(255,255,255,0)",s.fillRect(0,0,e[0],e[1]),s.putImageData(r,0,0),n}processOutput(t){var e;const i=null===(e=this.options)||void 0===e?void 0:e.as;return i&&Object.keys(i).forEach((e=>{t.forEach((t=>{t[i[e]]=t[e],delete t[e]}))})),t}}class wf extends Tf{preProcess(){const t=super.preProcess(),{imageConfig:e={},ratio:i=.45}=this.options;return this.calculateImageSize(t,e,i)}tryPlaceImage(t,e,i,n,s){let r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;const[a,o]=e,l=a/2,h=o/2,c=Math.sqrt(l**2+h**2),d=Fg[i](e);let u,p,g=-r;const{segmentation:f}=n,{labels:m}=f;for(;([u,p]=d(g+=r))&&!(Math.min(Math.abs(u),Math.abs(p))>=c);)if(u-=t.width/2,p-=t.height/2,t.visible=!0,t.x=~~(l+u),t.y=~~(h+p),t._left=t.x+t.padding,t._top=t.y+t.padding,t._leftWithoutPadding=t.x,t._topWithoutPadding=t.y,Mf(t,s)){const{x:e,y:i,width:n,height:s}=t;let r=!1;for(let t=0;t<n;t++){for(let n=0;n<s&&i+t<=o;n++)if(!(e+n>a||m[(i+t)*a+(e+n)])){r=!0;break}if(r)break}if(!r){const e=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x,y:t.y+t.height},{x:t.x+t.width,y:t.y+t.height}];let i=!0;for(const t of e)if(!m[t.y*a+t.x]){i=!1;break}if(!i)continue;return!0}}return!1}doLayout(t){var e;const{segmentationOutput:n}=this,{layoutConfig:s={}}=this.options,r=this.options.size,{spiralType:a="archimedean",fillingTimes:o=4,minFillingImageSize:l=10}=s,h=[],c=Object.keys(t[0]).find((t=>t.includes("VGRAMMAR")));for(const e of t)e._widthWithPadding=e.width+2*e.padding,e._heightWithPadding=e.height+2*e.padding,e.frequency=1,this.tryPlaceImage(e,r,a,n,h)&&h.push(e);const d=i.minInArray(h,((t,e)=>t.width-e.width)).width,u=i.minInArray(h,((t,e)=>t.height-e.height)).height,p=[];for(let i=0;i<o;i++){const s=.5*d-1*i,o=.5*u-1*i;for(const i of t){const t=Object.assign({},i,{visible:!0});Sf(t,Math.max(l,t.aspectRatio>1?s:o)),t._widthWithPadding=t.width+2*t.padding,t._heightWithPadding=t.height+2*t.padding,this.tryPlaceImage(t,r,a,n,[...p,...h],.5)&&(i._tempFrequency=(null!==(e=i._tempFrequency)&&void 0!==e?e:i.frequency)+1,t.frequency=i._tempFrequency,t.distance=Math.sqrt(Math.pow(t.x-r[0]/2,2)+Math.pow(t.y-r[1]/2,2)),t[c]=`${t[c]}_${t.frequency}`,p.push(t))}}return[...h,...p].filter((t=>t.visible))}}function Mf(t,e){for(let s=0;s<e.length;s++)if(i=t,n=e[s],!(i._leftWithoutPadding+i._widthWithPadding<n._leftWithoutPadding||i._topWithoutPadding+i._heightWithPadding<n._topWithoutPadding||i._leftWithoutPadding>n._leftWithoutPadding+n._widthWithPadding||i._topWithoutPadding>n._topWithoutPadding+n._heightWithPadding))return!1;var i,n;return!0}function Bf(t){const{imageConfig:e={},size:i,ratio:n=.1,layoutConfig:s={}}=t,{padding:r=0,imageSize:a}=e,[o,l]=i;let h;h=a||Math.min(o,l)*n-2*r,h<0&&(h=1);const{rectAspectRatio:c=1}=s;let d,u;c>1?(d=h,u=h/c):(u=h,d=h*c);const p=Math.ceil(l/(u+r)),g=Math.ceil(o/(d+r)),f=o/2,m=l/2,y=new Array(g*p);for(let t=0;t<p;t++)for(let e=0;e<g;e++){const i=e*(d+r)+d/2,n=t*(u+r)+u/2;y[t*g+e]={centerX:i,centerY:n,x:i-d/2,y:n-u/2,row:t,col:e,distance:Math.sqrt(Math.pow(i-f,2)+Math.pow(n-m,2))}}return{context:Object.assign({},s,{cellWidth:d,cellHeight:u,cellInfo:y,cellCount:y.length,cellType:"rect",cellPixelCount:d*u,eachPixel:(t,e)=>{const{x:i,y:n}=t;for(let t=0;t<d;t++)for(let s=0;s<u&&n+t<=l;s++)i+s>o||e((~~n+t)*o+(~~i+s))},clipPath:`M${-d/2} ${-u/2} L${d/2} ${-u/2} L${d/2} ${u/2} L${-d/2} ${u/2} Z`}),imageLength:h}}const Cf={rect:Bf,circle:function(t){const{imageConfig:e={},size:i,ratio:n=.1,layoutConfig:s={}}=t,{padding:r=0,imageSize:a=0}=e,[o,l]=i,h=o/2,c=l/2;let d=0;d=a?a/2:Math.min(o,l)*n/2,d-r<=0&&(d=r+1);const u=2*d,p=Math.sqrt(3)/2*u+r,g=[];let f=0;for(let t=0;t*p-d<l;t++){const e=t*p,i=t%2==0?0:d;for(let n=-1;n*(u+r)+i-d<o;n++){const s=n*(u+r)+i+d;g[f++]={centerX:s,centerY:e,x:s-d,y:e-d,row:t,col:n,distance:Math.sqrt(Math.pow(s-h,2)+Math.pow(e-c,2))}}}let m=0;const y=d*d;for(let t=0;t<u;t++)for(let e=0;e<u;e++){const i=t-d,n=e-d;i*i+n*n<=y&&m++}return{context:Object.assign({},s,{cellWidth:u,cellHeight:u,cellInfo:g,cellCount:g.length,cellType:"circle",cellPixelCount:m,eachPixel:(t,e)=>{const{x:i,y:n}=t;for(let t=0;t<u;t++)for(let s=0;s<u;s++){if(t+i<0||t+i>o||s+n>l||s+n<0)continue;const r=t-d,a=s-d;r*r+a*a<=y&&e((~~n+t)*o+(~~i+s))}},clipPath:"M 1 0 A 1 1 0 1 0 -1 0 A 1 1 0 1 0 1 0 Z"}),imageLength:u}},hexagonal:function(t){const{imageConfig:e={},size:i,ratio:n=.1,layoutConfig:s={}}=t,{padding:r=0,imageSize:a}=e,[o,l]=i,h=o/2,c=l/2;let d;d=a?a/2:Math.min(o,l)*n/2,d-r<=0&&(d=r+1);const u=[],p=2*Math.PI/6;for(let t=0;t<6;t++){const e=p*t;u.push({x:(d-r/2)*Math.cos(e),y:(d-r/2)*Math.sin(e)})}const g=2*d,f=Math.sin(Math.PI/6)*g,m=Math.sqrt(3)*f,y=g-f/2,b=Math.cos(Math.PI/6)*g,v=b/2,x=Math.floor(l/m),_=Math.floor(o/f),A=[];for(let t=-1;t<=x+1;t++)for(let e=-1;e<=_;e++){const i=e*y,n=t*b+(e%2?v:0);A.push({centerX:i,centerY:n,x:i-f,y:n-f,row:t,col:e,distance:Math.sqrt(Math.pow(i-h,2)+Math.pow(n-c,2))})}let S=0;const T=[];for(let t=0;t<=m;t++)for(let e=0;e<=2*f;e++){const i=e-f,n=t-m/2,s=Math.abs(i),r=Math.abs(n);s<=f&&r<=m/2&&2*r+s*Math.sqrt(3)<=m?(S++,T.push(!0)):T.push(!1)}return{context:Object.assign({},s,{cellHexSideLength:f,cellHexPoints:u,cellHeight:m,cellWidth:2*f,cellInfo:A,cellCount:A.length,cellType:"hexagonal",cellPixelCount:S,eachPixel:(t,e)=>{const{x:i,y:n}=t;let s=0;for(let t=0;t<=m;t++)for(let r=0;r<=2*f;r++)T[s++]&&e((~~n+t)*o+(~~i+r))},clipPath:"M 1 0 L 0.5 0.866 L -0.5 0.866 L -1 0 L -0.5 -0.866 L 0.5 -0.866 Z"}),imageLength:g-r}}};class kf extends Tf{preProcess(){var t;const e=super.preProcess(),{layoutConfig:i={}}=this.options,{cellType:n="rect"}=i,s=(null!==(t=Cf[n])&&void 0!==t?t:Cf.rect)(this.options),{context:r,imageLength:a}=s;return e.forEach((t=>function(t,e){t.aspectRatio>1?(t.height=e,t.width=~~(e*t.aspectRatio)):(t.width=e,t.height=~~(e/t.aspectRatio))}(t,a))),r.cellInfo.sort(((t,e)=>t.distance-e.distance)),this.layoutContext=r,e}doLayout(t){const{cellWidth:e,cellHeight:n,cellInfo:s,cellCount:r,clipPath:a,eachPixel:o,cellPixelCount:l}=this.layoutContext;if(0===t.length||0===r||0===e||0===n||0===s.length)return void(this.isLayoutFinished=!0);const{segmentationOutput:h}=this,{layoutConfig:c={}}=this.options,{placement:d="default"}=c;if("edge"===d||"default"===d){const{segmentation:t}=h,{labels:e}=t;s.forEach((t=>{let i=0;o(t,(t=>{e[t]&&i++})),t.intersectPixels=i}))}const u=t.length,p=t=>{const{intersectPixels:e}=t;return"default"===d?e>=.45*l:"edge"!==d||e>.1*l&&e<l};for(let e=0;e<u;e++){const n=t[e],r=s[e];r&&(n.x=r.centerX-n.width/2,n.y=r.centerY-n.height/2,n.clipConfig={shape:a},n.frequency=1,n.visible=p(r),n.cell=i.pickWithout(r,["image"]),n.distance=r.distance,r.image=n)}const g=Object.keys(t[0]).find((t=>t.includes("VGRAMMAR")));if(u<r)for(let e=u;e<r;e++){const n=t[e-u],r=s[e];if(r){const e=Object.assign({},n);e.x=r.centerX-e.width/2,e.y=r.centerY-e.height/2,e.frequency+=1,e[g]=`${e[g]}_${e.frequency}`,e.visible=p(r),e.distance=r.distance,e.cell=i.pickWithout(r,["image"]),r.image=e,t.push(e)}}return t.filter((t=>t.visible))}}class Pf extends Tf{preProcess(){const t=super.preProcess(),{imageConfig:e={},ratio:i=.1}=this.options,n=Bf;return this.layoutContext=n(Object.assign({},this.options,{imageConfig:{imageSize:null}})).context,this.layoutContext.cellInfo.sort(((t,e)=>t.distance-e.distance)),this.calculateImageSize(t,e,i)}doLayout(t){const{segmentationOutput:e}=this,{cellWidth:i,cellHeight:n,cellInfo:s,cellCount:r,eachPixel:a,cellPixelCount:o}=this.layoutContext;if(0===t.length||0===r||0===i||0===n||0===s.length)return void(this.isLayoutFinished=!0);const{layoutConfig:l={}}=this.options,h=this.options.size,{placement:c="default",maxAngle:d=Math.PI/180*45}=l;if("edge"===c||"default"===c){const{segmentation:t}=e,{labels:i}=t;s.forEach((t=>{let e=0;a(t,(t=>{i[t]&&e++})),t.intersectPixels=e}))}const u=t.length,p=Math.sqrt(Math.pow(h[0],2)+Math.pow(h[1],2)),g=t=>{const{intersectPixels:e}=t;return"default"===c?e>.5*o:"edge"!==c||e>.1*o&&e<o};for(let e=0;e<u;e++){const i=t[e],n=s[e];n&&(i.x=n.centerX-i.width/2,i.y=n.centerY-i.height/2,i.visible=g(n),i.cell=`${n.row}_${n.col}`,i.angle=Math.random()*(2*d)-d,i.anchor=[i.x+i.width/2,i.y+i.height/2],i.zIndex=p-n.distance,i.distance=n.distance,i.frequency=1,n.image=i)}const f=Object.keys(t[0]).find((t=>t.includes("VGRAMMAR")));if(u<r)for(let e=u;e<r;e++){const i=t[e-u],n=s[e];if(n){const e=Object.assign({},i);e.x=n.centerX-e.width/2,e.y=n.centerY-e.height/2,e.anchor=[e.x+e.width/2,e.y+e.height/2],e.angle=Math.random()*(2*d)-d,e.frequency+=1,e[f]=`${e[f]}_${e.frequency}`,e.visible=g(n),e.cell=`${n.row}_${n.col}`,e.distance=n.distance,e.zIndex=p-n.distance,n.image=e,t.push(e)}}return t.filter((t=>t.visible))}}const Of=(t,e,n)=>{var s,r;const a=i.isFunction(t.size)?t.size():t.size;if(t.size=a,!a||i.isNil(a[0])||i.isNil(a[1])||a[0]<=0||a[1]<=0)return i.Logger.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];if(t.size=[Math.ceil(a[0]),Math.ceil(a[1])],t.image||i.Logger.getInstance().error("Imagecloud: image source must be specified."),t.onBeforeLayout&&t.onBeforeLayout(),!e||0===e.length)return[];let o;switch(null!==(r=null===(s=t.layoutConfig)||void 0===s?void 0:s.layoutMode)&&void 0!==r?r:"spiral"){case"grid":o=kf;break;case"stack":o=Pf;break;default:o=wf}const l=new o(t);return l.layout(e),l.unfinished()?{progressive:l}:l.output()};class Rf extends Dp{constructor(t,e,i,n,s){var r;super(t,e,i,n,s),this._rotations=null!==(r=null==s?void 0:s.rotation)&&void 0!==r?r:1}onBind(){this._scaleX=this.target.attribute.scaleX,i.isValidNumber(this._rotations)||(this.valid=!1)}onUpdate(t,e,i){var n;if(!1===this.valid)return;if(t)return void(i.scaleX=this._scaleX);const s=360*this._rotations*e*Math.PI/180,r=Math.abs(Math.cos(s))*(null!==(n=this._scaleX)&&void 0!==n?n:1);this.target.attribute.scaleX=r,this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag()}}function Lf(t,i){switch(i){case"axialRotate":return[{custom:Rf,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 If 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:n}=this._seriesCacheInfo,s=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(n[0]&&s)return null!==(i=s[n[0]])&&void 0!==i?i:t.value},this.dimensionTooltipTitleCallback=t=>{var e;const{dimensionFields:i}=this._seriesCacheInfo,n=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(i[0]&&n)return n[i[0]]}}get defaultShapeType(){return"square"}}class Ef extends e.BaseSeries{constructor(){super(...arguments),this.type=Rg}setValueField(t){i.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(Ig.imageMask,{dataView:!1,skipBeforeLayouted:!0})),this._imageMark=this._createMark(Ig.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 If(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:io,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)}}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.isFillingImage=this.isFillingImage.bind(this)}initAnimation(){[this._imageMark].forEach((t=>{var i,n;if(t){const s=null===(n=null===(i=this._spec)||void 0===i?void 0:i.animationAppear)||void 0===n?void 0:n.preset,r={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")(r,s),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""}}Ef.type=Rg,Ef.mark=Ig;const Df=()=>{e.registerImageMark(),e.Factory.registerAnimation("imageCloud",((t,e)=>({appear:Lf(t,e),enter:Lf(t,e),exit:{type:"fadeOut"},disappear:{type:"fadeOut"}}))),e.Factory.registerSeries(Ef.type,Ef),e.Factory.registerGrammarTransform("imagecloud",{transform:Of})};class Ff extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=Ff.transformerConstructor,this.type=Og,this.seriesType=Rg}}Ff.type=Og,Ff.seriesType=Rg,Ff.transformerConstructor=Pg;const jf=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class Uf extends ha{constructor(t,e){super(t),this._skipRenderAttributes=jf,(null==e?void 0:e.mode)&&(this.mode=e.mode,this.setMode(e.mode)),(null==e?void 0:e.skipDefault)&&(this.skipDefault=!0),this.setTheme({common:{strokeBoundsBuffer:0}}),this.attribute=t,this.onSetStage((()=>{this.render(),this.bindEvents()}))}setAttribute(t,e,n,s){const r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,s);if(r)return this._setAttributes(r,n);i.isPlainObject(this.attribute[t])&&i.isPlainObject(e)&&!i.isFunction(this.attribute[t])&&!i.isFunction(e)?i.merge(this.attribute[t],e):this.attribute[t]=e,this._skipRenderAttributes.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e,i){return t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t,this._setAttributes(t,e)}_setAttributes(t,e){const i=Object.keys(t);this._mergeAttributes(t,i),i.every((t=>this._skipRenderAttributes.includes(t)))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}_mergeAttributes(t,e){i.isNil(e)&&(e=Object.keys(t));for(let n=0;n<e.length;n++){const s=e[n];!i.isPlainObject(this.attribute[s])||i.isFunction(this.attribute[s])||i.isFunction(t[s])?this.attribute[s]=t[s]:i.merge(this.attribute[s],t[s])}}bindEvents(){}_getNodeId(t){var e;return`${null!==(e=this.id)&&void 0!==e?e:this._uid}-${this.name}-${t}`}_dispatchEvent(t,e){var i;const n=new Rn(t,e);n.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(n)}}var Nf;!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(Nf||(Nf={}));const Wf={[Nf.selectedReverse]:{},[Nf.selected]:{},[Nf.hover]:{},[Nf.hoverReverse]:{}};function zf(t,e){t.forEachChildren((t=>{const i=e(t);t.isContainer&&!i&&zf(t,e)}))}function Vf(t){return t>=0&&t<Math.PI/2||t>3*Math.PI/2&&t<=2*Math.PI}function Gf(t,e,i){return Math.abs(t-e)<i}function Hf(t){return"rich"===function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"type";var n,s;return i.isObject(t.text)&&"type"in t.text?null!==(n=t.text.type)&&void 0!==n?n:"text":e in t&&null!==(s=t[e])&&void 0!==s?s:"text"}(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"type")}const Xf=(t,e)=>{const i=Math.atan2(t,e);return i<0?i+2*Math.PI:i};function Yf(){_u(),Ou(),Uu(),Eu(),Wu()}var qf=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i};Yf();class $f extends Uf{getBgRect(){return this._bgRect}getTextShape(){return this._textShape}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:i.merge({},$f.defaultAttributes,t)),this.name="tag",this._tagStates=[],this._rectStates=[],this._symbolStates=[],this._textStates=[]}render(){var t,e,n;this.cacheStates();const{text:s="",textStyle:r={},shape:a={},panel:o={},space:l=4,minWidth:h,maxWidth:c,padding:d=4,visible:u,state:p,type:g,textAlwaysCenter:f,containerTextAlign:m}=this.attribute,y=i.normalizePadding(d),b=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group");let v,x=-y[3],_=-y[0],A=y[1]+y[3],S=y[0]+y[2],T=0,w=0;const{visible:M}=a,B=qf(a,["visible"]);if(i.isBoolean(M)){const t=(null==B?void 0:B.size)||10,e=i.isNumber(t)?t:Math.max(t[0],t[1]);v=b.createOrUpdateChild("tag-shape",Object.assign(Object.assign({symbolType:"circle",size:t,strokeBoundsBuffer:0},B),{visible:M,x:e/2,y:e/2}),"symbol"),i.isEmpty(null==p?void 0:p.shape)||(v.states=p.shape),M&&(w=e+l)}let C,k,P;if(A+=w,T+=w,Hf({text:s})||"rich"===g){const t=Object.assign(Object.assign(Object.assign({},function(t){var e,n;return i.isValid(t.maxLineWidth)&&(t.maxWidth=t.maxLineWidth,delete t.maxLineWidth),t.width=null!==(e=t.width)&&void 0!==e?e:0,t.height=null!==(n=t.height)&&void 0!==n?n:0,t.textConfig=t.text.text||t.text,t}(Object.assign({type:g,text:s},r))),r),{visible:i.isValid(s)&&!1!==u,x:T,y:0});i.isNil(t.lineHeight)&&(t.lineHeight=r.fontSize),C=b.createOrUpdateChild("tag-text",t,"richtext"),k=C.AABBBounds.width(),P=C.AABBBounds.height()}else{const n=Object.assign(Object.assign({text:i.isObject(s)&&"type"in s&&"text"===s.type?s.text:s,visible:i.isValid(s)&&!1!==u,lineHeight:null==r?void 0:r.fontSize},r),{x:T,y:0});i.isNil(n.lineHeight)&&(n.lineHeight=r.fontSize),C=b.createOrUpdateChild("tag-text",n,"text");const a=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return{width:0,height:0};const n=Po({text:t,fontFamily:e.fontFamily||i.fontFamily||"PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol",fontSize:e.fontSize||i.fontSize||12,fontWeight:e.fontWeight||i.fontWeight,textAlign:e.textAlign||"center",textBaseline:e.textBaseline,ellipsis:!!e.ellipsis,maxLineWidth:e.maxLineWidth||1/0,lineHeight:e.fontSize||i.fontSize||12});return{width:n.width(),height:n.height()}}(n.text,r,null===(e=null===(t=this.stage)||void 0===t?void 0:t.getTheme())||void 0===e?void 0:e.text);k=a.width,P=a.height}A+=k;const O=null!==(n=a.size)&&void 0!==n?n:10,R=i.isNumber(O)?O:Math.max(O[0],O[1]);S+=Math.max(P,a.visible?R:0);const{textAlign:L,textBaseline:I}=r;(i.isValid(h)||i.isValid(c))&&(i.isValid(h)&&A<h&&(A=h),i.isValid(c)&&A>c&&(A=c,C.setAttribute("maxLineWidth",c-y[1]-y[2]))),x=0,_=0;let E=0;"left"===L||"start"===L?E=1:"right"===L||"end"===L?E=-1:"center"===L&&(E=0),E?E<0?(x-=A,v&&v.setAttribute("x",(v.attribute.x||0)-k),b.setAttribute("x",-y[1]-w)):E>0&&b.setAttribute("x",y[3]):(x-=A/2,v&&v.setAttribute("x",(v.attribute.x||0)-k/2),b.setAttribute("x",-w/2));const D="right"===m||"end"===m,F="left"===m||"start"===m,j=(t,e)=>{"richtext"===C.type?C.setAttributes({x:t,textAlign:e,textConfig:i.array(C.attribute.textConfig).map((t=>Object.assign(Object.assign({},t),{textAlign:e})))}):C.setAttributes({x:t,textAlign:e})};if((m?"center"===m:f)&&E){const t=A-y[1]-y[3],e=k+w,i=1===E?(t-e)/2+w+k/2:y[0]+w-(A/2+e/2-w)+k/2;if(j(i,"center"),v){const t=i-k/2-w+R/2;v.setAttributes({x:t})}}if(F&&1!==E){const t=A-y[1]-y[3],e=0===E?-t/2+w/2:-A+y[3]+y[1]+w;if(j(e+w,"left"),v){const t=e+R/2;v.setAttributes({x:t})}}if(D&&-1!==E){const t=A-y[1]-y[3],e=0===E?t/2+w/2:t;if(j(e,"right"),v){const t=e-k-w+R/2;v.setAttributes({x:t})}}"middle"===I?(_-=S/2,v&&v.setAttribute("y",0)):"bottom"===I?(_-=S,v&&v.setAttribute("y",-P/2),b.setAttribute("y",-y[2])):"top"===I&&(b.setAttribute("y",y[0]),v&&v.setAttribute("y",P/2)),i.isEmpty(null==p?void 0:p.text)||(C.states=p.text);const{visible:U}=o,N=qf(o,["visible"]);if(u&&i.isBoolean(U)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},N),{visible:U&&!!s,width:A,height:S,x:x,y:_}),"rect");if(i.isEmpty(null==p?void 0:p.panel)||(t.states=p.panel),N.customShape){const e=N.customShape;t.pathProxy=t=>e(this,t,new si)}this._bgRect=t}this._textShape=C,this._symbol=v,this.resetStates()}initAttributes(t,e){t=(null==e?void 0:e.skipDefault)?t:i.merge({},$f.defaultAttributes,t),super.initAttributes(t),this.render()}addState(t,e,i){super.addState(t,e,i),this._textShape&&this._textShape.addState(t,e,i),this._bgRect&&this._bgRect.addState(t,e,i),this._symbol&&this._symbol.addState(t,e,i)}removeState(t,e){super.removeState(t,e),this._textShape&&this._textShape.removeState(t,e),this._bgRect&&this._bgRect.removeState(t,e),this._symbol&&this._symbol.removeState(t,e)}cacheStates(){var t,e,i,n,s,r,a,o,l,h,c,d,u,p;this._tagStates=null!==(e=null===(t=this.currentStates)||void 0===t?void 0:t.slice())&&void 0!==e?e:[],this._rectStates=null!==(s=null===(n=null===(i=this._bgRect)||void 0===i?void 0:i.currentStates)||void 0===n?void 0:n.slice())&&void 0!==s?s:[],this._symbolStates=null!==(o=null===(a=null===(r=this._symbol)||void 0===r?void 0:r.currentStates)||void 0===a?void 0:a.slice())&&void 0!==o?o:[],this._textStates=null!==(c=null===(h=null===(l=this._textShape)||void 0===l?void 0:l.currentStates)||void 0===h?void 0:h.slice())&&void 0!==c?c:[],this.clearStates(),null===(d=this._bgRect)||void 0===d||d.clearStates(),null===(u=this._symbol)||void 0===u||u.clearStates(),null===(p=this._textShape)||void 0===p||p.clearStates()}resetStates(){var t,e,i;this._tagStates.length&&this.useStates(this._tagStates),this._rectStates.length&&(null===(t=this._bgRect)||void 0===t||t.useStates(this._rectStates)),this._symbolStates.length&&(null===(e=this._symbol)||void 0===e||e.useStates(this._symbolStates)),this._textStates.length&&(null===(i=this._textShape)||void 0===i||i.useStates(this._textStates))}}function Kf(){_u(),wu(),Bu(),Uu()}function Zf(){_u(),wu(),yu(),Uu()}$f.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}},Kf();class Jf extends Uf{getStartAngle(){return i.normalizeAngle(this._startAngle)}getEndAngle(){return i.normalizeAngle(this._endAngle)}getMainSegmentPoints(){return this._mainSegmentPoints}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:i.merge({},Jf.defaultAttributes,t)),this.name="segment",this.key="segment",this.lines=[]}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:n,state:s,visible:r=!0,multiSegment:a,mainSegmentIndex:o}=this.attribute;if(!r)return;this._computeLineAngle();const l=this._getMainSegmentPoints(),h=this._renderSymbol(t,l,"start"),c=this._renderSymbol(e,l,"end");if(this.startSymbol=h,this.endSymbol=c,a){const t=[...this.attribute.points];if(i.isValidNumber(o))t[o]=this._clipPoints(t[o]);else{const e=this._clipPoints(i.flattenArray(t));t[0][0]=e[0],t[t.length-1][t[t.length-1].length-1]=e[e.length-1]}t.forEach(((t,e)=>{var r,a;const o=Co.line(Object.assign(Object.assign({points:t},i.isArray(n)?null!==(r=n[e])&&void 0!==r?r:n[n.length-1]:n),{fill:!1}));o.name=`${this.name}-line`,o.id=this._getNodeId("line"+e),i.isEmpty(null==s?void 0:s.line)||(o.states=i.isArray(s.line)?null!==(a=s.line[e])&&void 0!==a?a:s.line[s.line.length-1]:s.line),this.add(o),this.lines.push(o)}))}else{let t=Co.line;i.array(n)[0].cornerRadius&&(t=Co.polygon);const e=t(Object.assign(Object.assign({points:this._clipPoints(this.attribute.points)},i.array(n)[0]),{fill:!1,closePath:!1}));e.name=`${this.name}-line`,e.id=this._getNodeId("line"),i.isEmpty(null==s?void 0:s.line)||(e.states=[].concat(s.line)[0]),this.add(e),this.lines.push(e)}}_computeStartRotate(t){return t+Math.PI/2}_computeEndRotate(t){return t+Math.PI/2}_renderSymbol(t,e,n){if(!e.length)return;const{autoRotate:s=!0}=t;let r;if(t&&t.visible){const a=this.getStartAngle(),o=this.getEndAngle(),{state:l}=this.attribute,h=e[0],c=e[e.length-1],{refX:d=0,refY:u=0,refAngle:p=0,style:g,symbolType:f,size:m=12}=t;let y,b;"start"===n?(y={x:h.x+(i.isValidNumber(a)?d*Math.cos(a)+u*Math.cos(a-Math.PI/2):0),y:h.y+(i.isValidNumber(a)?d*Math.sin(a)+u*Math.sin(a-Math.PI/2):0)},b=this._computeStartRotate(this._startAngle)):(y={x:c.x+(i.isValidNumber(o)?d*Math.cos(o)+u*Math.cos(o-Math.PI/2):0),y:c.y+(i.isValidNumber(o)?d*Math.sin(o)+u*Math.sin(o-Math.PI/2):0)},b=this._computeEndRotate(this._endAngle)),r=Co.symbol(Object.assign(Object.assign(Object.assign({},y),{symbolType:f,size:m,angle:s?b+p:0,strokeBoundsBuffer:0}),g)),r.name=`${this.name}-${n}-symbol`,r.id=this._getNodeId(`${n}-symbol`),i.isEmpty(null==l?void 0:l.symbol)||(r.states=l.symbol),"start"===n?i.isEmpty(null==l?void 0:l.startSymbol)||(r.states=l.startSymbol):i.isEmpty(null==l?void 0:l.endSymbol)||(r.states=l.endSymbol),this.add(r)}return r}_getMainSegmentPoints(){if(this._mainSegmentPoints)return this._mainSegmentPoints;const{points:t,multiSegment:e,mainSegmentIndex:n}=this.attribute;let s;return s=e?i.isValidNumber(n)?t[n]:i.flattenArray(t):t,this._mainSegmentPoints=s,s}_clipPoints(t){const{startSymbol:e={},endSymbol:i={}}=this.attribute;let n=t;if(e.visible){const i=e.clip?e.size||10:0;n=[{x:t[0].x-i/2*(Math.cos(this._startAngle)||0),y:t[0].y-i/2*(Math.sin(this._startAngle)||0)},...n.slice(1)]}if(i.visible){const e=i.clip?i.size||10:0,s={x:t[t.length-1].x-e/2*(Math.cos(this._endAngle)||0),y:t[t.length-1].y-e/2*(Math.sin(this._endAngle)||0)};n=[...n.slice(0,n.length-1),s]}return n}_computeLineAngle(){const t=this._getMainSegmentPoints();if(t.length<=1)return;const e=t[0],i=t[1],n=t[t.length-2],s=t[t.length-1],r=[e.x-i.x,e.y-i.y],a=Math.atan2(r[1],r[0]),o=[s.x-n.x,s.y-n.y],l=Math.atan2(o[1],o[0]);this._startAngle=a,this._endAngle=l}_reset(){this.startSymbol=null,this.endSymbol=null,this._startAngle=null,this._endAngle=null,this._mainSegmentPoints=null}}Jf.defaultAttributes={visible:!0,lineStyle:{lineWidth:1,stroke:"#000"},startSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}},endSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}}},Zf();class Qf extends Jf{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:i.merge({},Jf.defaultAttributes,t)),this.name="arc-segment",this.key="arc-segment",this.isReverseArc=!1}getStartAngle(){const t=this.isReverseArc?this._startAngle+Math.PI/2:this._startAngle-Math.PI/2;return t<0?t+2*Math.PI:t>2*Math.PI?t-2*Math.PI:t}getEndAngle(){const t=this.isReverseArc?this._endAngle-Math.PI/2:this._endAngle+Math.PI/2;return t<0?t+2*Math.PI:t>2*Math.PI?t-2*Math.PI:t}getMainSegmentPoints(){return this._mainSegmentPoints}_computeStartRotate(t){return this.isReverseArc?t+Math.PI:t}_computeEndRotate(t){return this.isReverseArc?t:t+Math.PI}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:n,state:s,visible:r=!0,radius:a,startAngle:o,endAngle:l,center:h}=this.attribute;if(!r)return;this._startAngle=o,this._endAngle=l,this.isReverseArc=o>l;const c={x:h.x+a*Math.cos(this._startAngle),y:h.y+a*Math.sin(this._startAngle)},d={x:h.x+a*Math.cos(this._endAngle),y:h.y+a*Math.sin(this._endAngle)};this._mainSegmentPoints=[c,d];const u=this._renderSymbol(t,this._mainSegmentPoints,"start"),p=this._renderSymbol(e,this._mainSegmentPoints,"end");this.startSymbol=u,this.endSymbol=p;const g=Co.arc(Object.assign({x:h.x,y:h.y,startAngle:o,endAngle:l,innerRadius:a,outerRadius:a},n));g.name=`${this.name}-line`,g.id=this._getNodeId("arc"),i.isEmpty(null==s?void 0:s.line)||(g.states=[].concat(s.line)[0]),this.add(g),this.line=g}}var tm,em,im,nm;!function(t){t.start="start",t.startTop="startTop",t.startBottom="startBottom",t.insideStart="insideStart",t.insideStartTop="insideStartTop",t.insideStartBottom="insideStartBottom",t.middle="middle",t.insideMiddleTop="insideMiddleTop",t.insideMiddleBottom="insideMiddleBottom",t.end="end",t.endTop="endTop",t.endBottom="endBottom",t.insideEnd="insideEnd",t.insideEndTop="insideEndTop",t.insideEndBottom="insideEndBottom"}(tm||(tm={})),function(t){t.left="left",t.right="right",t.top="top",t.bottom="bottom",t.topLeft="topLeft",t.topRight="topRight",t.bottomLeft="bottomLeft",t.bottomRight="bottomRight",t.middle="middle",t.insideLeft="insideLeft",t.insideRight="insideRight",t.insideTop="insideTop",t.insideBottom="insideBottom",t.insideTopLeft="insideTopLeft",t.insideTopRight="insideTopRight",t.insideBottomLeft="insideBottomLeft",t.insideBottomRight="insideBottomRight"}(em||(em={})),function(t){t.arcInnerStart="arcInnerStart",t.arcInnerEnd="arcInnerEnd",t.arcInnerMiddle="arcInnerMiddle",t.arcOuterStart="arcOuterStart",t.arcOuterEnd="arcOuterEnd",t.arcOuterMiddle="arcOuterMiddle",t.center="center"}(im||(im={})),function(t){t.top="top",t.bottom="bottom",t.middle="middle",t.insideTop="insideTop",t.insideBottom="insideBottom",t.insideMiddle="insideMiddle"}(nm||(nm={}));class sm extends Uf{constructor(){super(...arguments),this.name="marker",this._onHover=t=>{this._lastHover=((t,e,n)=>{const s=t.target;return s!==n&&s.name&&!i.isEmpty(s.states)?(s.addState(Nf.hover,!0),zf(e,(t=>{t!==s&&t.name&&!i.isEmpty(t.states)&&t.addState(Nf.hoverReverse,!0)})),s):n})(t,this._container,this._lastHover)},this._onUnHover=t=>{this._lastHover=((t,e,n)=>n?(zf(e,(t=>{t.name&&!i.isEmpty(t.states)&&(t.removeState(Nf.hoverReverse),t.removeState(Nf.hover))})),null):n)(0,this._container,this._lastHover)},this._onClick=t=>{this._lastSelect=((t,e,n)=>{const s=t.target;return n===s&&s.hasState(Nf.selected)?(zf(e,(t=>{t.name&&!i.isEmpty(t.states)&&(t.removeState(Nf.selectedReverse),t.removeState(Nf.selected))})),null):s.name&&!i.isEmpty(s.states)?(s.addState(Nf.selected,!0),zf(e,(t=>{t!==s&&t.name&&!i.isEmpty(t.states)&&t.addState(Nf.selectedReverse,!0)})),s):n})(t,this._container,this._lastSelect)}}transAnimationConfig(){var t,e,n;if(!1!==this.attribute.animation){const s=i.isObject(this.attribute.animation)?this.attribute.animation:{};this._animationConfig={enter:i.merge({},this.defaultUpdateAnimation,s,null!==(t=this.attribute.animationEnter)&&void 0!==t?t:{}),exit:i.merge({},this.defaultExitAnimation,s,null!==(e=this.attribute.animationExit)&&void 0!==e?e:{}),update:i.merge({},this.defaultUpdateAnimation,s,null!==(n=this.attribute.animationUpdate)&&void 0!==n?n:{})}}}setAttribute(t,e,i){super.setAttribute(t,e,i),"visible"===t&&this.render()}_bindEvent(){var t,e,i;if(!this.attribute.interactive)return;const{hover:n,select:s}=this.attribute;n&&(null===(t=this._container)||void 0===t||t.addEventListener("pointermove",this._onHover),null===(e=this._container)||void 0===e||e.addEventListener("pointerout",this._onUnHover)),s&&(null===(i=this._container)||void 0===i||i.addEventListener("pointerdown",this._onClick))}_releaseEvent(){var t,e,i;null===(t=this._container)||void 0===t||t.removeEventListener("pointermove",this._onHover),null===(e=this._container)||void 0===e||e.removeEventListener("pointerout",this._onUnHover),null===(i=this._container)||void 0===i||i.removeEventListener("pointerdown",this._onClick)}_initContainer(){var t,e;const{limitRect:i={},clipInRange:n}=this.attribute;let s;if(n){const n=Co.group(Object.assign(Object.assign({},i),{clip:!0,pickable:!1}));s=Co.group({x:-(null!==(t=i.x)&&void 0!==t?t:0),y:-(null!==(e=i.y)&&void 0!==e?e:0),pickable:!1}),n.add(s),this._containerClip=n,this.add(n)}else s=Co.group({x:0,y:0,pickable:!1}),this.add(s);s.name="marker-container",this._container=s}_updateContainer(){var t,e;const{limitRect:i={},clipInRange:n}=this.attribute;this._containerClip&&this._containerClip.setAttributes(Object.assign({},i)),this._container.setAttributes({x:n?-(null!==(t=i.x)&&void 0!==t?t:0):0,y:n?-(null!==(e=i.y)&&void 0!==e?e:0):0})}render(){var t;this.transAnimationConfig(),this.setAttribute("pickable",!1);const e=null===(t=this.attribute.visible)||void 0===t||t;!1===this.attribute.interactive&&this.setAttribute("childrenPickable",!1),e&&this.isValidPoints()?this._container?(this._updateContainer(),this.updateMarker(),this.markerAnimate("update")):(this._initContainer(),this.initMarker(this._container),this.markerAnimate("enter")):(this.markerAnimate("exit"),this._container=null,this.removeAllChild(!0)),this._releaseEvent(),this._bindEvent()}release(){this.markerAnimate("exit"),super.release(),this._releaseEvent(),this._container=null}}const rm={type:"callIn",duration:500,easing:"linear",delay:0},am={type:"fadeOut",duration:500,easing:"linear",delay:0},om=.001;tm.end,im.arcOuterMiddle,em.right,im.arcOuterMiddle;const lm={postiveXAxis:{top:{textAlign:"left",textBaseline:"bottom"},bottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"left",textBaseline:"middle"},insideTop:{textAlign:"right",textBaseline:"bottom"},insideBottom:{textAlign:"right",textBaseline:"top"},insideMiddle:{textAlign:"right",textBaseline:"middle"}},negativeXAxis:{top:{textAlign:"right",textBaseline:"bottom"},bottom:{textAlign:"right",textBaseline:"top"},middle:{textAlign:"right",textBaseline:"middle"},insideTop:{textAlign:"left",textBaseline:"bottom"},insideBottom:{textAlign:"left",textBaseline:"top"},insideMiddle:{textAlign:"left",textBaseline:"middle"}}};_u(),Yf(),Ep(),Kf(),Zf(),Uu(),Su(),wu(),Ep();class hm extends sm{markerAnimate(t){hm._animate&&this._animationConfig&&hm._animate([this._line,this._decorativeLine],this._item,this._animationConfig,t)}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:i.merge({},hm.defaultAttributes,t)),this.name="markPoint",this.defaultUpdateAnimation=rm,this.defaultExitAnimation=am,this._isArcLine=!1,this._isStraightLine=!1}setLabelPos(){}getTextAlignAttr(t,e,i,n,s){return Gf(Math.abs(n),Math.PI/2,om)||Gf(Math.abs(n),3*Math.PI/2,om)?function(t,e,i){return t?{textAlign:"right",textBaseline:"middle"}:{textAlign:e<Math.PI&&i.toLocaleLowerCase().includes("top")||e>Math.PI&&i.toLocaleLowerCase().includes("bottom")?"left":e<Math.PI&&i.toLocaleLowerCase().includes("bottom")||e>Math.PI&&i.toLocaleLowerCase().includes("top")?"right":"center",textBaseline:e<Math.PI&&i.includes("inside")||e>Math.PI&&!i.includes("inside")?"bottom":"top"}}(t,n,s):Vf(n)?lm.postiveXAxis[s]:lm.negativeXAxis[s]}setItemAttributes(t,e,n,s,r){var a,o;if(!t)return;const{autoRotate:l=!0,refX:h=0,refY:c=0,refAngle:d=0,style:u,position:p=nm.middle}=e,{state:g}=this.attribute,f=(null===(a=this._line)||void 0===a?void 0:a.getEndAngle())||0,m=h*Math.cos(f)+c*Math.cos(f-Math.PI/2),y=h*Math.sin(f)+c*Math.sin(f-Math.PI/2);if("text"===r){const r=s.x-n.x,a=s.y-n.y;t.setAttributes(Object.assign(Object.assign({},u),{textStyle:Object.assign(Object.assign({},this.getTextAlignAttr(l,r,a,f,null!==(o=e.position)&&void 0!==o?o:"end")),u.textStyle),state:{panel:i.merge({},Wf,null==g?void 0:g.textBackground),text:i.merge({},Wf,null==g?void 0:g.itemContent)}}))}else("richText"===r||"image"===r)&&(t.setAttributes({dx:this.getItemDx(t,p,u)+(u.dx||0),dy:this.getItemDy(t,p,u)+(u.dy||0)}),t.states=i.merge({},Wf,null==g?void 0:g.itemContent));const b=Vf(f)?f:f-Math.PI;t.setAttributes({x:s.x+(m||0),y:s.y+(y||0),angle:l&&b+d})}getItemDx(t,e,i){var n,s;const r=null!==(s=null===(n=null==t?void 0:t.AABBBounds)||void 0===n?void 0:n.width())&&void 0!==s?s:(null==i?void 0:i.width)||0;return e.includes("inside")?-r:0}getItemDy(t,e,i){var n,s;const r=null!==(s=null===(n=null==t?void 0:t.AABBBounds)||void 0===n?void 0:n.height())&&void 0!==s?s:(null==i?void 0:i.height)||0;return e.includes("top")||e.includes("Top")?-r:e.includes("middle")||e.includes("Middle")?-r/2:0}initItem(t,e,n){const{state:s}=this.attribute,{type:r="text",style:a,renderCustomCallback:o}=t;let l;return"symbol"===r?(l=Co.symbol(Object.assign(Object.assign({},n),a)),l.states=i.merge({},Wf,null==s?void 0:s.itemContent)):"text"===r?l=new $f(Object.assign(Object.assign({},n),{state:{panel:i.merge({},Wf,null==s?void 0:s.textBackground),text:i.merge({},Wf,null==s?void 0:s.itemContent)}})):"richText"===r?(l=Co.richtext(Object.assign(Object.assign({},n),a)),l.states=i.merge({},Wf,null==s?void 0:s.itemContent)):"image"===r?(l=Co.image(Object.assign(Object.assign({},n),a)),l.states=i.merge({},Wf,null==s?void 0:s.itemContent)):"custom"===r&&o&&(l=o(),l.states=i.merge({},Wf,null==s?void 0:s.itemContent)),l.name=`mark-point-${r}`,this.setItemAttributes(l,t,e,n,r),l}getItemLineAttr(t,e,i){let n=[],s={x:0,y:0},r=0,a=0,o=0;const{type:l="type-s",arcRatio:h=.8}=t,c=i.x-e.x,d=i.y-e.y;if(this._isStraightLine=Gf(c,0,om)||Gf(d,0,om),this._isArcLine){const{x:t,y:e}=this.attribute.position,{x:n,y:l}=i,c=(t+n)/2,d=c+h*(l>e?-1:1)*c,u=(e===l?0:-(t-n)/(e-l))*(d-c)+(e+l)/2;a=Xf(e-u,t-d),o=Xf(l-u,n-d),s={x:d,y:u};const p=Math.sqrt((d-t)*(d-t)+(u-e)*(u-e)),g=this.attribute.targetSymbol.style.size/2;a+=2*Math.acos(Math.sqrt(1-g*g/(4*p*p))),h>0?o<a&&(o+=2*Math.PI):a<o&&(a+=2*Math.PI),r=Math.sqrt((d-t)*(d-t)+(u-e)*(u-e))}else n="type-do"!==l||this._isStraightLine?"type-po"!==l||this._isStraightLine?"type-op"!==l||this._isStraightLine?[e,i]:[e,{x:e.x,y:i.y},i]:[e,{x:i.x,y:e.y},i]:[e,{x:(e.x+i.x)/2,y:i.y},i];return n=function(t){const e=[t[0]];for(let i=1;i<t.length;i++)t[i].x===t[i-1].x&&t[i].y===t[i-1].y||e.push(t[i]);return e}(n),{points:n,center:s,radius:r,startAngle:a,endAngle:o}}reDrawLine(t,e){this._line.release();const{startSymbol:n,endSymbol:s,lineStyle:r,type:a="type-s"}=t,{state:o}=this.attribute,l=this._isArcLine?Qf:Jf;this._container.removeChild(this._line),this._line=new l(Object.assign(Object.assign({},e),{pickable:!1,startSymbol:n,endSymbol:s,lineStyle:r,visible:t.visible,state:{line:i.merge({},Wf,null==o?void 0:o.line),startSymbol:i.merge({},Wf,null==o?void 0:o.lineStartSymbol),endSymbol:i.merge({},Wf,null==o?void 0:o.lineEndSymbol)}})),this._container.add(this._line)}setItemLineAttr(t,e,n){if(this._line){const{startSymbol:s,endSymbol:r,lineStyle:a,type:o="type-s"}=t,{state:l}=this.attribute,h=this.getItemLineAttr(t,e,n);this._isArcLine&&"arc-segment"===this._line.key||!this._isArcLine&&"segment"===this._line.key?this._line.setAttributes(Object.assign(Object.assign({},h),{startSymbol:s,endSymbol:r,lineStyle:a,visible:t.visible,state:{line:i.merge({},Wf,null==l?void 0:l.line),startSymbol:i.merge({},Wf,null==l?void 0:l.lineStartSymbol),endSymbol:i.merge({},Wf,null==l?void 0:l.lineEndSymbol)}})):this.reDrawLine(t,h)}}getDecorativeLineAttr(t){var e;const i=(null===(e=null==t?void 0:t.decorativeLine)||void 0===e?void 0:e.length)||10,n=this._line.getEndAngle()||0;return{startPointOffsetX:i/2*Math.cos(n-Math.PI/2),startPointOffsetY:i/2*Math.sin(n-Math.PI/2),endPointOffsetX:-i/2*Math.cos(n-Math.PI/2),endPointOffsetY:-i/2*Math.sin(n-Math.PI/2)}}setDecorativeLineAttr(t,e,n){var s;if(this._decorativeLine){const{lineStyle:r}=t,{startPointOffsetX:a,startPointOffsetY:o,endPointOffsetX:l,endPointOffsetY:h}=this.getDecorativeLineAttr(t);this._decorativeLine.setAttributes(Object.assign(Object.assign({points:[{x:e.x+a,y:e.y+o},{x:e.x+l,y:e.y+h}]},r),{visible:n})),this._decorativeLine.states=i.merge({},Wf,null===(s=this.attribute.state)||void 0===s?void 0:s.line)}}setTargetItemAttributes(t,e){var n,s;this._targetItem&&(this._targetItem.setAttributes(Object.assign({x:e.x,y:e.y,visible:null!==(n=t.visible)&&void 0!==n&&n,size:t.size},t.style)),this._targetItem.states=i.merge({},Wf,null===(s=this.attribute.state)||void 0===s?void 0:s.targetItem))}setAllOfItemsAttr(t,e){var i;const{position:n,itemLine:s={},itemContent:r={},limitRect:a,targetSymbol:o}=this.attribute,{type:l="text",confine:h}=r;if(a&&h){const{x:t,y:i,width:n,height:s}=a,{dx:r,dy:o}=function(t,e){const{x1:i,y1:n,x2:s,y2:r}=e,{x1:a,y1:o,x2:l,y2:h}=t.AABBBounds;let c=0,d=0;return a<i&&(c=i-a),o<n&&(d=n-o),l>s&&(c=s-l),h>r&&(d=r-h),{dx:c,dy:d}}(this._item,{x1:t,y1:i,x2:t+n,y2:i+s});e.x=e.x+r,e.y=e.y+o}this.setTargetItemAttributes(o,n),this.setItemLineAttr(s,t,e),this.setItemAttributes(this._item,r,t,e,l),this.setDecorativeLineAttr(s,e,null===(i=s.decorativeLine)||void 0===i?void 0:i.visible)}computeNewPositionAfterTargetItem(t){var e,i;const{itemContent:n={},targetSymbol:s,itemLine:r}=this.attribute,{offsetX:a=0,offsetY:o=0}=n,{offset:l=0,style:h,visible:c=!1,size:d}=s,u=c?null!==(i=null!==(e=h.size)&&void 0!==e?e:d)&&void 0!==i?i:20:0;let p;return p="type-do"===r.type?Xf(o,a/2):"type-po"===r.type?Xf(0,a):"type-op"===r.type?Xf(o,0):Xf(o,a),{newPosition:{x:t.x+(u/2+l)*Math.cos(p),y:t.y+(u/2+l)*Math.sin(p)},newItemPosition:{x:t.x+(u/2+l)*Math.cos(p)+a,y:t.y+(u/2+l)*Math.sin(p)+o}}}initMarker(t){const{position:e,itemContent:i={},itemLine:n}=this.attribute,{type:s="type-s",arcRatio:r=.8}=n,{offsetX:a=0,offsetY:o=0}=i;this._isStraightLine=Gf(a,0,om)||Gf(o,0,om),this._isArcLine="type-arc"===s&&0!==r&&!this._isStraightLine;const{newPosition:l,newItemPosition:h}=this.computeNewPositionAfterTargetItem(e),c=new(this._isArcLine?Qf:Jf)({points:[],pickable:!1,center:{x:0,y:0},radius:0,startAngle:0,endAngle:0});c.name="mark-point-line",this._line=c,t.add(c);const d=Co.line({points:[]});d.name="mark-point-decorativeLine",this._decorativeLine=d,t.add(d);const u=Co.symbol({});u.name="mark-point-targetItem",this._targetItem=u,t.add(this._targetItem);const p=this.initItem(i,l,h);this._item=p,t.add(p),this.setAllOfItemsAttr(l,h)}updateMarker(){const{position:t,itemContent:e={},itemLine:i}=this.attribute,{type:n="text"}=e,{type:s="type-s",arcRatio:r=.8}=i,{offsetX:a=0,offsetY:o=0}=e;this._isStraightLine=Gf(a,0,om)||Gf(o,0,om);const l="type-arc"===s&&0!==r&&!this._isStraightLine,{newPosition:h,newItemPosition:c}=this.computeNewPositionAfterTargetItem(t);l!==this._isArcLine?(this._isArcLine=l,this.reDrawLine(i,{points:[{x:0,y:0}],pickable:!1,center:{x:0,y:0},radius:0,startAngle:0,endAngle:0})):this._isArcLine=l,this.setItemAttributes(this._item,e,h,c,n),this.setAllOfItemsAttr(h,c)}isValidPoints(){const{position:t}=this.attribute;return!(!i.isValidNumber(t.x)||!i.isValidNumber(t.y))}}hm.defaultAttributes={interactive:!0,targetSymbol:{visible:!1,offset:0,style:{symbolType:"circle",size:20,fill:!1,stroke:"rgba(46, 47, 50)"}},itemLine:{visible:!0,decorativeLine:{visible:!1,length:30},startSymbol:{visible:!0,clip:!0,symbolType:"circle",size:20,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},endSymbol:{visible:!1,clip:!0,symbolType:"triangle",size:12,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},lineStyle:{stroke:"#000",lineWidth:1}},itemContent:{type:"text",position:"middle",refX:10}};const cm="seriesBreak";function dm(t,e,i,n,s=!1){const r=[],{x:a,y:o}=t,{x:l,y:h}=e,c=s?Math.floor((h-o)/(2*i)):Math.floor((l-a)/(2*i)),d=Math.PI/180*n,u=i*Math.cos(d),p=i*Math.sin(d);r.push(`M ${a} ${o}`);for(let t=0;t<=c;t++){const e=s?a+(t%2==0?u:-u):a+t*i*2,n=s?o+t*i*2:t%2==0?o-p:o+p;r.push(`L ${e} ${n}`)}return r.push(`L ${s?a:l} ${s?h:o}`),r.join(" ")}class um extends Uf{constructor(){super(...arguments),this.name=cm}render(){this.removeAllChild();const{data:t=[]}=this.attribute;if(i.isEmpty(t))return;const e=[],n=[];t.forEach((t=>{const{start:s,end:r}=t;((t,e)=>{const{start:n,end:s}=e,r=n.x===s.x,a=r?"x":"y",o=r?"y":"x";let l=!0;const h=1e-6;t.length&&t.forEach((t=>{if(i.isNumberClose(t.start[a],n[a])){const e=Math.min(n[o],s[o]),i=Math.max(n[o],s[o]),r=Math.min(t.start[o],t.end[o]),a=Math.max(t.start[o],t.end[o]);if(!(i<r-h||e>a+h))return t.start[o]=Math.min(r,e),t.end[o]=Math.max(a,i),void(l=!1)}})),l&&t.push(e)})(s.x===r.x?e:n,t)})),[...e,...n].forEach(((t,e)=>{var n;const{start:s,end:r,size:a=4,gap:o=5,style:l={}}=t,h=I(t,["start","end","size","gap","style"]),c=ca({}),d=s.x===r.x;let u,p,g,f;d?(u={x:s.x-o/2,y:s.y},p={x:r.x-o/2,y:r.y},g={x:s.x+o/2,y:s.y},f={x:r.x+o/2,y:r.y}):(u={x:s.x,y:s.y-o/2},p={x:r.x,y:r.y-o/2},g={x:s.x,y:s.y+o/2},f={x:r.x,y:r.y+o/2});const m=dm(u,p,a,d?75:15,d),y=dm(s,r,a,d?75:15,d),b=dm(g,f,a,d?75:15,d);c.add(po(Object.assign(Object.assign({path:m,stroke:"#000",lineWidth:1},l),{pickable:!1,zIndex:1}))),c.add(po(Object.assign(Object.assign({path:b,stroke:"#000",lineWidth:1},l),{pickable:!1,zIndex:1}))),c.add(po({path:y,stroke:"#fff",lineWidth:o,pickable:!1,zIndex:0})),c.name="series-break",c.data=h,i.isValid(h.axisId)&&(c.id=`${null!==(n=h.axisId)&&void 0!==n?n:""}_${e}`),this.add(c)}))}}function pm(t,e,i=1){return Math.abs(t-e)<i}function gm(t,e){return{type:"component",componentType:cm,interactive:!0,zIndex:500,style:{data:(n,s)=>{const r=[],a=s.vchart.getChart(),o="horizontal"===a.getAllSeries()[0].direction;return t.forEach(((t,n)=>{var s,l;const h=t.id,c=i.isValid(h)?a.getComponentByUserId(h):e&&i.isValid(e[n])?a.getComponentByIndex("axes",e[n]):null===(s=a.getComponentsByKey("axes").filter((e=>e.getSpec().breaks===t.breaks)))||void 0===s?void 0:s[0];if(!c)return;const d=null!=h?h:`${c.type}-${c.id}`,u=function(t){let{x:e,y:i}=t[0].getLayoutStartPoint(),n=e+t[0].getLayoutRect().width,s=i+t[0].getLayoutRect().height;for(let r=1;r<t.length;r++){const a=t[r],{x:o,y:l}=a.getLayoutStartPoint(),{width:h,height:c}=a.getLayoutRect();e=Math.min(e,o),n=Math.max(n,h+o),i=Math.min(i,l),s=Math.max(s,c+l)}return{x1:e,y1:i,x2:n,y2:s}}(c.getRegions());i.array(null===(l=c._break)||void 0===l?void 0:l.breaks).forEach((t=>{const{range:e,breakSymbol:i,gap:n=5}=t,s=c.valueToPosition(e[0]),l=c.valueToPosition(e[1]),h=(s+l)/2+(o?u.x1:u.y1);a.getAllSeries().forEach((t=>{if("bar"===t.type||"waterfall"===t.type){t.getMarkInName("bar").getGraphics().forEach((t=>{const a=t.AABBBounds;let c,p,g,f,m=!1;o?(m=a.x1<(s+l-n)/2&&a.x2>(s+l+n)/2,c=h,p=Math.max(a.y1+u.y1-2,u.y1),g=h,f=Math.min(a.y2+u.y1+2,u.y2)):(m=a.y1<(s+l-n)/2&&a.y2>(s+l+n)/2,c=Math.max(a.x1+u.x1-2,u.x1),p=h,g=Math.min(a.x2+u.x1+2,u.x2),f=h),m&&r.push({start:{x:c,y:p},end:{x:g,y:f},gap:n,style:null==i?void 0:i.style,axisId:d,data:e})}))}else if("line"===t.type){t.getMarkInName(t.type).getGraphics().forEach((t=>{mm(t,"line").forEach((t=>{fm(o?{start:{x:(s+l)/2,y:0},end:{x:(s+l)/2,y:u.y2-u.y1}}:{start:{x:0,y:(s+l)/2},end:{x:u.x2-u.x1,y:(s+l)/2}},t).forEach((t=>{let s,a;o?(s={x:h,y:Math.max(t[1]+u.y1-10,u.y1)},a={x:h,y:Math.min(t[1]+u.y1+10,u.y2)}):(s={x:Math.max(t[0]+u.x1-10,u.x1),y:h},a={x:Math.min(t[0]+u.x1+10,u.x2),y:h}),r.push({start:s,end:a,gap:n,style:null==i?void 0:i.style,axisId:d,data:e})}))}))}))}else if("area"===t.type){t.getMarkInName("area").getGraphics().forEach((t=>{mm(t,"area").forEach((t=>{const a=fm(o?{start:{x:(s+l)/2,y:0},end:{x:(s+l)/2,y:u.y2-u.y1}}:{start:{x:0,y:(s+l)/2},end:{x:u.x2-u.x1,y:(s+l)/2}},t);a.sort(((t,e)=>t[0]-e[0]));for(let s=0;s<a.length-1;s++){const l={x:a[s][0],y:a[s][1]},h={x:a[s+1][0],y:a[s+1][1]};if(ym(o?{x:l.x,y:(l.y+h.y)/2}:{x:(l.x+h.x)/2,y:l.y},t)){let t,s;o?(t={x:l.x+u.x1,y:Math.max(l.y+u.y1-0,u.y1)},s={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},s={x:Math.min(h.x+u.x1+0,u.x2),y:h.y+u.y1}),r.push({start:t,end:s,gap:n,style:null==i?void 0:i.style,axisId:d,data:e})}}}))}))}}))}))})),r}}}}function fm(t,e){const n=[];for(let s=1;s<e.length;s++){const r=i.getIntersectPoint([t.start.x,t.start.y],[t.end.x,t.end.y],[e[s].x,e[s].y],[e[s-1].x,e[s-1].y]);r&&!n.find((t=>pm(i.PointService.distancePP({x:t[0],y:t[1]},{x:r[0],y:r[1]}),0)))&&n.push(r)}return n}function mm(t,e){const{points:i,segments:n}=t.attribute,s=[];let r=[];const a=t=>{if(t&&t.length){let i=[];if(t.forEach((t=>{var n,a;if(!1===t.defined){if(s.push(r),"area"===e&&i.length){for(let t=i.length-1;t>=0;t--)r.push({x:i[t].x,y:i[t].y});r.push(r[0])}r=[],i=[]}else r.push({x:t.x,y:t.y}),"area"===e&&i.push({x:null!==(n=t.x1)&&void 0!==n?n:t.x,y:null!==(a=t.y1)&&void 0!==a?a:t.y})})),"area"===e&&i.length){for(let t=i.length-1;t>=0;t--)r.push({x:i[t].x,y:i[t].y});r.push(r[0])}s.push(r)}};return i&&i.length?a(i):n&&n.length&&n.forEach((t=>{a(t.points)})),s}function ym(t,e){const{x:i,y:n}=t;let s=!1;for(let t=0,r=e.length-1;t<e.length;r=t++){const{x:a,y:o}=e[t],{x:l,y:h}=e[r];o>n!=h>n&&i<(l-a)*(n-o)/(h-o)+a&&(s=!s)}return s}const bm="barLink";class vm extends Uf{constructor(){super(...arguments),this.name=bm}render(){const{data:t,linkStyle:n,areaStyle:s,styleMap:r,label:a,linkType:o="total"}=this.attribute;i.isEmpty(t)||(this.removeAllChild(),t.forEach(((t,l)=>{var h,c,d,u,p;const{linePoints:g,areaPoints:f,id:m=l,color:y,data:b}=t;if(f&&!1!==(null===(h=null==r?void 0:r[`area-${m}`])||void 0===h?void 0:h.visible)){const t=(v=Object.assign(Object.assign({points:f,fillOpacity:.3,fill:y,zIndex:0},s),null==r?void 0:r[`area-${m}`]),new fo(v));t.name="bar-link-area",t.id=`area-${m}`,this.add(t)}var v;if(g&&!1!==(null===(c=null==r?void 0:r[`line-${m}`])||void 0===c?void 0:c.visible)&&0!==(null===(d=null==n?void 0:n.lineStyle)||void 0===d?void 0:d.lineWidth)&&0!==(null===(u=null==r?void 0:r[`line-${m}`])||void 0===u?void 0:u.lineWidth)){const{startSymbol:t={},endSymbol:e={},lineStyle:s}=n||{},a=i.cloneDeep(t),o=i.cloneDeep(e);(null==r?void 0:r[`line-${m}`])&&r[`line-${m}`].stroke&&(a.style=Object.assign(Object.assign({},a.style),{color:r[`line-${m}`].stroke}),o.style=Object.assign(Object.assign({},o.style),{color:r[`line-${m}`].stroke})),a.symbolType||a.originSymbolType||(a.originSymbolType="solidArrow"),o.symbolType||o.originSymbolType||(o.originSymbolType="solidArrow");const l=new Jf({points:g,startSymbol:Object.assign({size:8},a),endSymbol:Object.assign({size:8},o),lineStyle:Object.assign(Object.assign({lineDash:[3,3],lineWidth:1,stroke:"#000"},s),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===(p=null==r?void 0:r[`label-${m}`])||void 0===p?void 0:p.visible)){const{style:t,formatMethod:i}=a,[n,s]=b;let l=n[e.STACK_FIELD_END],h=s[e.STACK_FIELD_END];"value"===o&&(l=n[e.STACK_FIELD_END]-n[e.STACK_FIELD_START],h=s[e.STACK_FIELD_END]-s[e.STACK_FIELD_START]);const c=h-l,d=(h-l)/l*100,u=ja(Object.assign(Object.assign({x:.5*(g[0].x+g[1].x),y:.5*(g[0].y+g[1].y),text:i?i(c,d,b):`${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 xm(t,i,n){const{isHorizontal:s,isXAxisInverse:r,isYAxisInverse:a,linkType:o,doFill:l,regionStartX:h,regionStartY:c}=n,d=t.AABBBounds,u=i.AABBBounds;let p,g;return s?(p=[{x:(d.x1+d.x2)/2+h,y:d.y1+c},{x:(u.x1+u.x2)/2+h,y:u.y2+c}],r?("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}],a?("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 _m(t={},i){const{linkType:n="total",doFill:s}=t,r=I(t,["linkType","doFill"]);return{type:"component",componentType:bm,zIndex:500,interactive:!1,style:Object.assign(Object.assign({data:(t,i)=>{const{vchart:r}=i,a=r.getChart().getAllRegions(),o=[];return a.forEach((t=>{const i=t.getSeries().filter((t=>"bar"===t.type)),{x:r,y:a}=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 n={};for(let s=0;s<t.length;s++){const r=t[s],a=e.getDatumOfGraphic(r),o=i.map((t=>a[t])).join("-");n[o]||(n[o]=[]),n[o].push(r)}return n}(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=xm(t,null!==(l=i[e])&&void 0!==l?l:i[i.length-1],{isHorizontal:d,isXAxisInverse:p,isYAxisInverse:u,doFill:s,linkType:n,regionStartX:r,regionStartY:a});o.push(h)})),e.length<i.length){const t=e[e.length-1];for(let l=e.length;l<i.length;l++){const e=xm(t,i[l],{isHorizontal:d,isXAxisInverse:p,isYAxisInverse:u,doFill:s,linkType:n,regionStartX:r,regionStartY:a});o.push(e)}}}}})),o},linkType:n},r),i)}}const Am="seriesLabel";function Sm(t,e=10,i=10,n=.1){const s=t.length;if(!t.every(isFinite))return t;if(!(s>1))return t;const r=function(t,e,i){t=+t,e=+e;let n=arguments.length;i=n<2?(e=t,t=0,1):n<3?1:+i;let s=-1;n=0|Math.max(0,Math.ceil((e-t)/i));const r=new Array(n);for(;++s<n;)r[s]=t+s*i;return r}(t.length);for(let a=0;a<i;++a){r.sort(((e,i)=>{return n=t[e],s=t[i],null==n||null==s?NaN:n<s?-1:n>s?1:n>=s?0:NaN;var n,s}));let i=0;for(let n=1;n<s;++n){let s=t[r[n]]-t[r[n-1]];s<e&&(s=(e-s)/2,i=Math.max(i,s),t[r[n-1]]-=s,t[r[n]]+=s)}if(i<n)break}return t}function Tm(t,e){return!(e.x1>t.x2||e.x2<t.x1||e.y1>t.y2||e.y2<t.y1)}function wm(t,e=10,i=10){const n=t.length;let s,r=0;do{s=!1;for(let i=0;i<n;++i)for(let r=i+1;r<n;++r){const n=t[i].AABBBounds,a=t[r].AABBBounds;if(Tm(n,a)){const i=e-(a.x1-n.x2);i>0&&(t[r].attribute.x+=i,a.x1+=i,a.x2+=i,s=!0)}}r++}while(s&&r<i)}function Mm(t,e){const{label:n,line:s}=e;return{type:"component",componentType:Am,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:(e,n)=>{var s;const r=n.vchart.getChart(),a=r.getAllSeries()[0],o="horizontal"===a.direction,l=o?a.getYAxisHelper():a.getXAxisHelper(),h=null===(s=l.getScale)||void 0===s?void 0:s.call(l,0),c=l.isInverse(),d=a.getDimensionField()[0],u=a.getSeriesField(),p=r.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 e="end"===t?i.last(h.domain()):h.domain()[0],n=a.getRegion(),{x:s,y:l}=n.getLayoutStartPoint();let f=0;r.getAllSeries().forEach((i=>{i.getMarkInName("waterfall"===p[0]?"bar":p[0]).getGraphics().forEach((n=>{var r;const a=n.context.data.find((t=>t[d]===e));if(a){const e=n.AABBBounds;let h,m,y,b;"bar"===p[0]||"waterfall"===p[0]?(h="end"===t?{x:o?(e.x1+e.x2)/2:c?e.x1:e.x2,y:o?c?e.y2:e.y1:(e.y1+e.y2)/2}:{x:o?(e.x1+e.x2)/2:c?e.x2:e.x1,y:o?c?e.y1:e.y2:(e.y1+e.y2)/2},m=n.attribute.fill):(h=i.dataToPosition(a),m=n.attribute.stroke||n.attribute.fill),"end"===t?(y=o?"center":c?"end":"start",b=o?c?"top":"bottom":"middle"):(y=o?"center":c?"start":"end",b=o?c?"bottom":"top":"middle");const v=null!==(r=a[u])&&void 0!==r?r:a[d];g.push({point:{x:h.x+s,y:h.y+l},label:v,color:m,textAlign:y,textBaseline:b,series:i,datum:a,id:`${t}-${f}`,position:t}),f++}}))}))}))}return g},line:s,label:Object.assign({space:12},n)}}}class Bm extends Uf{constructor(){super(...arguments),this.name=Am}render(){var t,e,n,s;this.removeAllChild();const{data:r,layout:a,label:o,line:l={}}=this.attribute;if(i.isEmpty(r))return;const h=null!==(t=null==o?void 0:o.styleMap)&&void 0!==t?t:{},c={},d=r.filter((t=>{var e;return!1!==(null===(e=h[t.id])||void 0===e?void 0:e.visible)}));if("vertical"===a){const t=1.5*(null!==(n=null===(e=null==o?void 0:o.style)||void 0===e?void 0:e.fontSize)&&void 0!==n?n:12),i=(t,e,i)=>{var n,s,r,a,o,l,h,c;const{label:d,color:u,textAlign:p,textBaseline:g,id:f}=t,m=null!==(s=null===(n=i[f])||void 0===n?void 0:n.formatMethod)&&void 0!==s?s:null===(r=this.attribute.label)||void 0===r?void 0:r.formatMethod,y=ja(Object.assign(Object.assign(Object.assign(Object.assign({text:m?m(d,t.datum,{series:t.series}):d},null===(a=this.attribute.label)||void 0===a?void 0:a.style),e),{textAlign:p,textBaseline:g,fill:null!==(h=null===(l=null===(o=this.attribute.label)||void 0===o?void 0:o.style)||void 0===l?void 0:l.fill)&&void 0!==h?h:u}),null===(c=i[f])||void 0===c?void 0:c.style));return y.name="series-label-text",y.id=f,this.add(y),y};["start","end"].forEach((e=>{const n=d.filter((t=>t.position===e)),s=Sm(n.map((t=>t.point.y)),t);n.forEach(((t,e)=>{var n;const r={x:t.point.x+(null!==(n=null==o?void 0:o.space)&&void 0!==n?n:8)*("start"===t.textAlign?1:-1),y:s[e]};i(t,r,h),c[t.id]=r}))}))}else{const t=[],e=[];d.forEach((i=>{var n,s,r,a,l;const{point:c,label:d,color:u,textAlign:p,textBaseline:g,id:f,position:m}=i,y={x:c.x,y:c.y},b=null!==(s=null===(n=h[f])||void 0===n?void 0:n.formatMethod)&&void 0!==s?s:null==o?void 0:o.formatMethod,v=ja(Object.assign(Object.assign(Object.assign(Object.assign({text:b?b(d,i.datum,{series:i.series}):d},null==o?void 0:o.style),y),{textAlign:p,textBaseline:g,fill:null!==(a=null===(r=null==o?void 0:o.style)||void 0===r?void 0:r.fill)&&void 0!==a?a:u}),null===(l=h[f])||void 0===l?void 0:l.style));v.id=f,v.name="series-label-text",this.add(v),"start"===m?t.push(v):"end"===m&&e.push(v)})),t.length&&wm(t,4,10),e.length&&wm(e,4,10);const i=null!==(s=null==o?void 0:o.space)&&void 0!==s?s:8;[...t,...e].forEach((t=>{const e="top"===t.attribute.textBaseline?1:-1;t.setAttribute("y",t.attribute.y+i*e),c[t.id]={x:t.attribute.x,y:t.attribute.y}}))}!1!==l.visible&&d.forEach((t=>{var e,i,n,s,r,o;const{point:d,color:u,id:p}=t,g={x:c[p].x+(null!==(n=null===(i=null===(e=h[p])||void 0===e?void 0:e.style)||void 0===i?void 0:i.dx)&&void 0!==n?n:0),y:c[p].y+(null!==(o=null===(r=null===(s=h[p])||void 0===s?void 0:s.style)||void 0===r?void 0:r.dy)&&void 0!==o?o:0)};if(!1!==l.autoVisible){if("vertical"===a&&d.y!==g.y||"horizontal"===a&&d.x!==g.x){const t=Ga(Object.assign({points:[d,g],lineWidth:1,stroke:u},l.style));t.name="series-label-line",this.add(t)}}else{const t=Ga(Object.assign({points:[d,g],lineWidth:1,stroke:u},l.style));t.name="series-label-line",this.add(t)}}))}}function Cm(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 km(t){return{x1:t.x,x2:t.x+t.width,y1:t.y,y2:t.y+t.height}}function Pm(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:km(t.rect),anchorCandidates:Dm(null!==(e=t.anchors)&&void 0!==e?e:[],t.point,t.rect,t.offset)})})),n=[];n.push(i[0].bound);for(let t=1;t<=i.length-1;t++){const s=i[t],r=s.bound;let a=n.some((t=>Cm(t,r)));if(s.anchorCandidates)if(a&&(null===(e=s.anchorCandidates)||void 0===e?void 0:e.length)>0){for(let t=0;t<s.anchorCandidates.length;t++){const e=s.anchorCandidates[t],i={x1:e.x,y1:e.y,x2:e.x+r.x2-r.x1,y2:e.y+r.y2-r.y1,anchor:e};if(!n.some((t=>Cm(t,i)))){n.push(i),a=!1;break}}a&&n.push(s.bound)}else n.push(s.bound)}return n.map((t=>function(t){return{x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}}(t)))}function Om(t,e,n){const s=t.map((t=>t.pointCoord)),{x1:r,x2:a,y1:o,y2:l}=i.getAABBFromPoints(s),h=n([(r+a)/2,(o+l)/2]);if(!h)return[];const c=t.map((t=>{const s=t.rect,r=Im(e,t.pointCoord)?n(function(t,e,n,s=200){const r=5621/s;let a=e;for(let e=1;e<=r;e++){const e=i.destination(a,s,n);if(!Im(t,e))return[e.x,e.y];a=[e.x,e.y]}return e}(e,[t.pointCoord.x,t.pointCoord.y],Rm(Lm(t.point,h)))):t.point;r&&(s.x=r.x,s.y=r.y);const a=Rm(Lm(t.point,h));let o;const l=[];return a>=-45&&a<45?(o="top",l.push("left","right")):a>=45&&a<135?o="right":a>=-135&&a<-45?(o="left",l.push("left")):(o="bottom",l.push("left","right")),t.anchors=l,t.offset=20,t.rect=Em(t.rect,o,0),t}));return Pm(c)}function Rm(t){return t>180?t-360:t}function Lm(t,e){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI+90}function Im(t,e){for(let n=0;n<t.length;n++){if(i.isPointInPolygon(e,t[n]))return!0}return!1}function Em(t,e,i=0){const n=Object.assign({},t);return"top"===e?(n.x-=t.width/2,n.y-=i+t.height/2):"bottom"===e?(n.x-=t.width/2,n.y+=i-t.height/2):"left"===e?(n.x-=i+t.width,n.y-=t.height/2):"right"===e&&(n.x+=i,n.y-=t.height/2),n}function Dm(t,e,i,n=0){const s=[];return t.forEach((t=>{const{x:r,y:a}=Em(Object.assign(Object.assign({},e),{width:i.width,height:i.height}),t,n);s.push({x:r,y:a})})),s}const Fm={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 jm extends e.BaseComponentSpecTransformer{_getDefaultSpecFromChart(){return Fm}}class Um extends e.BaseComponent{constructor(){super(...arguments),this.type="mapLabel",this.name=" mapLabel",this.specKey="mapLabel",this.transformerConstructor=jm,this.layoutType="none",this.layoutZIndex=e.LayoutZIndex.MarkPoint,this._activeDatum=[]}static getSpecInfo(t){return e.getSpecInfo(t,this.specKey,this.type,(t=>t.visible&&i.isValid(t.seriesId)))}setAttrFromSpec(){var t,e,i,n;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===(n=this._series)||void 0===n?void 0:n.getMeasureField()[0]}created(){super.created(),!1!=!!this._spec.visible&&(this.initRelatedInfo(),this.initData(),this.initEvent())}initRelatedInfo(){var t,e,i,n,s,r,a,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===(s=null===(n=(i=this._regions[0]).getSpec)||void 0===n?void 0:n.call(i))||void 0===s?void 0:s.longitudeField,this._latitudeField=null===(o=null===(a=(r=this._regions[0]).getSpec)||void 0===a?void 0:a.call(r))||void 0===o?void 0:o.latitudeField)}initData(){const t=this._series;if(!t)return;const i=t.getViewData();if(i){const t=new L(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 n=null===(i=this._data)||void 0===i?void 0:i.getLatestData()[e];this._activeDatum.includes(n)?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 e=[],i=[];this._markerComponents||(this._markerComponents=null===(t=this._data)||void 0===t?void 0:t.getLatestData().map(((t,e)=>{var i;const n=new hm({position:void 0,animation:!1});return n&&(n.name=`${this.name}_marker_${e}`,n.id=null!==(i=this._spec.id)&&void 0!==i?i:`${this.name}_marker_${this.id}`,n.setAttribute("zIndex",this.layoutZIndex)),n})));this._markerComponents.forEach(((t,n)=>{const{pairInfo:s,contentMarks:r}=this._evaluateMarker(this._data.getLatestData()[n],n);s&&e.push(s),r&&i.push(r)}));const n=this._layoutLabels(e);this._layoutMarkers(n,i),this._renderMarkers()}_evaluateMarker(t,n){var s,r,a,o,l,h,c,d,u,p,g,f,m,y;let b=0,v=0,x=0,_=0,A=0;const S=this._spec.position||"top",T=this._spec.offset,w=e.normalizeLayoutPaddingSpec(null===(s=this._spec.background)||void 0===s?void 0:s.padding),M=this._spec.space||0;v+=((null==w?void 0:w.left)||0)+((null==w?void 0:w.right)||0),x+=((null==w?void 0:w.top)||0)+((null==w?void 0:w.bottom)||0);const B={},C=this.dataToPosition(t),k=Co.group({});if(k.name=`${this.name}_marker_itemContainer_${n}`,B.container=k,null===(r=this._spec.background)||void 0===r?void 0:r.visible){const t=Co.rect(e.transformToGraphic(Object.assign({},this._spec.background.style)));t.setAttributes(C),B.labelBackground=t,k.appendChild(t)}if(null===(a=this._spec.icon)||void 0===a?void 0:a.visible){const t=Co.symbol(e.transformToGraphic(Object.assign({},this._spec.icon.style)));t.setAttributes(C),t.setAttribute("symbolType",null!==(l=null===(o=this._spec.icon.style)||void 0===o?void 0:o.symbolType)&&void 0!==l?l:null===(h=this._spec.icon.style)||void 0===h?void 0:h.shape);const i=t.AABBBounds,n=null!==(c=(null==i?void 0:i.y2)-(null==i?void 0:i.y1))&&void 0!==c?c:0,s=null!==(d=(null==i?void 0:i.x2)-(null==i?void 0:i.x1))&&void 0!==d?d:0;B.icon=t,k.appendChild(t),A=n,_+=s,b++}if(null===(u=this._spec.nameLabel)||void 0===u?void 0:u.visible){const i=Co.text(e.transformToGraphic(Object.assign({},this._spec.nameLabel.style)));i.setAttributes(C),i.setAttribute("text",t[this.nameField]);const n=i.AABBBounds,s=null!==(p=(null==n?void 0:n.y2)-(null==n?void 0:n.y1))&&void 0!==p?p:0,r=null!==(g=(null==n?void 0:n.x2)-(null==n?void 0:n.x1))&&void 0!==g?g:0;B.nameLabel=i,k.appendChild(i),A=Math.max(A,s),_+=r,b++}if((null===(f=this._spec.valueLabel)||void 0===f?void 0:f.visible)&&i.isValid(t[this.valueField])){const i=Co.text(e.transformToGraphic(Object.assign({},this._spec.valueLabel.style)));i.setAttributes(C),i.setAttribute("text",t[this.valueField]);const n=i.AABBBounds,s=null!==(m=(null==n?void 0:n.y2)-(null==n?void 0:n.y1))&&void 0!==m?m:0,r=null!==(y=(null==n?void 0:n.x2)-(null==n?void 0:n.x1))&&void 0!==y?y:0;B.valueLabel=i,k.appendChild(i),A=Math.max(A,s),_+=r,b++}const P=Object.values(B).find((t=>!!t&&"group"!==t.type)),O={x:null==P?void 0:P.getComputedAttribute("x"),y:null==P?void 0:P.getComputedAttribute("y")},R={x:O.x,y:O.y,width:0,height:0};R.width=v+_+(b-1)*M,R.height=x+A;const L={rect:R,point:O,index:n};if("outer"!==S){const t=["top","right","left","bottom"].filter((t=>t!==S));L.rect=Em(R,S,T),L.anchors=t,L.offset=T}else L.pointCoord={x:+(null==t?void 0:t[this._longitudeField]),y:+(null==t?void 0:t[this._latitudeField])};return{pairInfo:L,contentMarks:B}}_layoutMarkers(t,i){var n,s,r;for(let a=0;a<i.length;a++){if(!t[a]||!i[a])return;const{icon:o,nameLabel:l,valueLabel:h,labelBackground:c,container:d}=i[a],u=t[a],p=e.normalizeLayoutPaddingSpec(null===(n=this._spec.background)||void 0===n?void 0:n.padding),g=this._spec.space||0,f=u.height/2;let m=(null==p?void 0:p.left)||0;[o,l,h].forEach(((t,e)=>{var i,n;if(t){const s=t.AABBBounds;let r=0;"symbol"===t.type&&(r+=(null!==(i=s.x2-s.x1)&&void 0!==i?i:0)/2),t.setAttributes({x:m+r,y:f}),m+=null!==(n=s.x2-s.x1)&&void 0!==n?n:0,2!==e&&(m+=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()[a],b=this.dataToPosition(y),v=this.getRegions()[0].getLayoutStartPoint(),x=!(!(null===(s=this._spec.leader)||void 0===s?void 0:s.visible)||!(o||l||h));this._markerComponents[a].setAttributes({x:v.x,y:v.y,position:b,visible:this._activeDatum.includes(y),itemContent:{refX:0,type:"custom",renderCustomCallback:()=>d,autoRotate:!1,offsetX:u.x+u.width/2-b.x,offsetY:u.y+u.height/2-b.y},itemLine:{visible:x,type:"type-po",lineStyle:e.transformToGraphic(Object.assign({},null===(r=this._spec.leader)||void 0===r?void 0:r.style)),startSymbol:{visible:!1}}})}}_renderMarkers(){if(this._markerComponents&&this._markerComponents.length)for(let t=0;t<this._markerComponents.length;t++)this.getContainer().add(this._markerComponents[t])}_layoutLabels(t){return"outer"===this._spec.position&&this._map?Om(t,this._map,(t=>this._series.dataToPosition({[this._longitudeField]:t[0],[this._latitudeField]:t[1]}))):Pm(t)}_isRelativeModel(t){var e,i,n;const s=null!==(i=null===(e=this._series.getXAxisHelper())||void 0===e?void 0:e.getAxisId())&&void 0!==i?i:null===(n=this._series.getCoordinateHelper())||void 0===n?void 0:n.getCoordinateId();return(null==t?void 0:t.id)===s}_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}}Um.type="mapLabel",Um.specKey="mapLabel",Um.transformerConstructor=jm;t.BAR_LINK=bm,t.Bar3dChart=qu,t.Bar3dChartSpecTransformer=ot,t.Bar3dSeries=Gu,t.Bar3dSeriesSpecTransformer=Hh,t.BarLinkComponent=vm,t.ConversionFunnelChart=Y,t.ConversionFunnelSeries=q,t.DefaultBandWidth=6,t.Funnel3dChart=ep,t.Funnel3dSeries=Qu,t.Funnel3dSeriesSpecTransformer=Ku,t.Histogram3dChart=ip,t.ImageCloudChart=Ff,t.MapLabelComponent=Um,t.PictogramChart=kg,t.PictogramChartSpecTransformer=lg,t.PictogramSeries=Bg,t.Pie3dChart=hp,t.Pie3dChartSpecTransformer=np,t.Pie3dSeries=op,t.Pie3dSeriesSpecTransformer=ap,t.RangeColumn3dChart=ng,t.RangeColumn3dChartSpecTransformer=ig,t.RangeColumn3dSeries=Qp,t.RangeColumn3dSeriesSpecTransformer=eg,t.RankingBar=a,t.RankingList=g,t.SERIES_BREAK=cm,t.SequenceScatterKDE=it,t.SequenceScatterLink=Z,t.SequenceScatterPixel=at,t.SeriesBreakComponent=um,t.SeriesLabelComponent=Bm,t.WordCloud3dChart=Vp,t.WordCloud3dChartSpecTransformer=zp,t.WordCloud3dSeries=Up,t.appendBarLinkConfig=function(t,e){t.customMark=i.array(t.customMark).filter((t=>t.componentType!==bm)),t.customMark.push(_m(e))},t.appendSeriesBreakConfig=t=>{var e;if(null===(e=t.axes)||void 0===e?void 0:e.length){const e=t.axes.filter((t=>t.breaks&&t.breaks.length&&!1!==t.visible));if(e.length)return t.customMark=i.array(t.customMark).filter((t=>t.componentType!==cm)),t.customMark.push(gm(e,e.map((e=>t.axes.indexOf(e))))),!0}return!1},t.appendSeriesLabelConfig=function(t,e){var n,s,r;if(t.customMark=i.array(t.customMark).filter((t=>t.componentType!==Am)),e||(e=null!==(r=null!==(n=i.get(t,Am))&&void 0!==n?n:i.get(null===(s=t.series)||void 0===s?void 0:s[0],Am))&&void 0!==r?r:{}),e.visible){const{position:i="end"}=e,n=I(e,["position"]);t.customMark.push(Mm(i,n))}},t.clearSVGSource=function(){hg.clear(),cg=null},t.getBarLinkConfig=_m,t.getSVGSource=pg,t.getSeriesBreakConfig=gm,t.getSeriesLabelConfig=Mm,t.register3DPlugin=Vh,t.registerAxis3dPlugin=()=>{Vh(),Yu(),e.Factory.registerComponent(e.CartesianBandAxis.type,Yp,!1),e.Factory.registerComponent(e.CartesianLinearAxis.type,qp,!1),e.Factory.registerComponent(e.CartesianTimeAxis.type,Zp,!1),e.Factory.registerComponent(e.CartesianSymlogAxis.type,Kp,!1),e.Factory.registerComponent(e.CartesianLogAxis.type,$p,!1)},t.registerBar3dChart=()=>{Vh(),Yu(),Hu(),e.Factory.registerChart(qu.type,qu)},t.registerBar3dSeries=Hu,t.registerBarLink=()=>{e.Factory.registerGraphicComponent(bm,(t=>new vm(t)))},t.registerConversionFunnelChart=t=>{e.registerMarkFilterTransform();const i=(null==t?void 0:t.VChart)||e.VChart;i&&(i.useChart([Y]),i.useSeries([q]))},t.registerFunnel3dChart=()=>{e.registerMarkTooltipProcessor(),Vh(),Yu(),tp(),e.Factory.registerChart(ep.type,ep)},t.registerFunnel3dSeries=tp,t.registerHistogram3dChart=()=>{e.registerGroupTooltipProcessor(),e.registerDimensionTooltipProcessor(),e.registerMarkTooltipProcessor(),e.registerDimensionEvents(),e.registerDimensionHover(),Vh(),Yu(),Hu(),e.Factory.registerChart(ip.type,ip)},t.registerImageCloudChart=()=>{Df(),e.Factory.registerChart(Ff.type,Ff)},t.registerMapLabel=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useComponent([Um])},t.registerPictogramChart=()=>{e.registerMarkTooltipProcessor(),Cg(),e.Factory.registerChart(kg.type,kg)},t.registerPictogramSeries=Cg,t.registerPie3dChart=()=>{e.registerMarkTooltipProcessor(),Vh(),Yu(),lp(),e.Factory.registerChart(hp.type,hp)},t.registerPie3dSeries=lp,t.registerRangeColumn3dChart=()=>{e.registerDimensionTooltipProcessor(),e.registerMarkTooltipProcessor(),e.registerDimensionEvents(),e.registerDimensionHover(),Vh(),Yu(),tg(),e.Factory.registerChart(ng.type,ng)},t.registerRangeColumn3dSeries=tg,t.registerRankingBarChart=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([a])},t.registerRankingList=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([g,e.BarChart])},t.registerSVGSource=dg,t.registerSequenceScatterKDE=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([it,e.ScatterChart])},t.registerSequenceScatterLink=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([Z,e.ScatterChart])},t.registerSequenceScatterPixel=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([at,e.ScatterChart])},t.registerSeriesBreak=()=>{e.Factory.registerGraphicComponent("seriesBreak",(t=>new um(t)))},t.registerSeriesLabel=()=>{e.Factory.registerGraphicComponent("seriesLabel",(t=>new Bm(t)))},t.registerWordCloud3dChart=Gp,t.registerWordCloud3dSeries=Np,t.registerWordCloudShape3dChart=()=>{Vh(),Wp(),Gp()},t.registerWordCloudShape3dSeries=Wp,t.svgSourceMap=hg,t.unregisterSVGSource=ug}));
8
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
+ PERFORMANCE OF THIS SOFTWARE.
15
+ ***************************************************************************** */function Ve(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i}const He={cornerRadius:4,stroke:"black",strokeOpacity:1,lineWidth:1,closePath:!1,pickable:!1},Xe={symbolType:"triangle",size:8,scaleX:.7,fill:"black"},$e={fill:"#606773",fontSize:12},Ye={fill:"#eff1f9"};class qe extends e.FunnelChartSpecTransformer{transformSpec(t){const{conversionArrow:e,extensionMark:i=[],funnelBackground:n}=t;if(e&&e.arrows&&e.arrows.length){const t=function(t){const{arrows:e}=t,i=Ve(t,["arrows"]),n=e.filter((t=>"left"===t.position)),s=e.filter((t=>"right"===t.position)),r=Ke(s,i),a=Ke(n,i),o=[];r&&(r.name="arrowRight",o.push(r));a&&(a.name="arrowLeft",o.push(a));return o}(e);t&&t.length&&i.push(...t)}if(n&&n.visible){const t=function(t){const{style:e={}}=t,i=Ve(t,["style"]);return Object.assign(Object.assign({type:"rect"},i),{dataIndex:0,zIndex:0,style:Object.assign(Object.assign(Object.assign({},Ye),e),{x:0,y:(t,e)=>e.getPoints(t)[0].y,width:(t,e)=>{const i=e.getRegion(),{width:n}=i.getLayoutRect();return n},height:(t,e)=>{const i=e.getPoints(t),n=i[0];return i[3].y-n.y}})})}(n);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 Ke(t,i){if(0===(null==t?void 0:t.length))return null;const{line:n,symbol:s,text:r,margin:a}=i,l=[],h={type:"group",zIndex:e.LayoutZIndex.Mark+1,children:[]},c=function(t={},e){const{style:i={}}=t,n=Ve(t,["style"]),s=(t,e)=>{var i,n;const{from:s,to:r}=t,{vchart:a}=e,o=null===(n=null===(i=null==a?void 0:a.getChart())||void 0===i?void 0:i.getSeriesData())||void 0===n?void 0:n.latestData;return!(r>o.length-1||s>o.length-1)};return Object.assign(Object.assign({type:"polygon",interactive:!1},n),{dataKey:t=>`${t.id}`,style:Object.assign(Object.assign(Object.assign({},He),i),{renderable:s,points:(t,i)=>{if(!s(t,i))return[];let n=t.layout.points;return n=Ze(t,i,e),n}})})}(n,a);c&&l.push(c);const u=function(t={},e){const{style:i={}}=t,n=Ve(t,["style"]);return Object.assign(Object.assign({type:"symbol",interactive:!1,dataKey:t=>`${t.id}`},n),{style:Object.assign(Object.assign(Object.assign({},Xe),i),{x:(t,i)=>{var n,s;let r=t.layout.points;return r=Ze(t,i,e),null!==(s=null===(n=r[(null==r?void 0:r.length)-1])||void 0===n?void 0:n.x)&&void 0!==s?s:NaN},y:(t,i)=>{var n,s;let r=t.layout.points;return r=Ze(t,i,e),null!==(s=null===(n=r[(null==r?void 0:r.length)-1])||void 0===n?void 0:n.y)&&void 0!==s?s:NaN},angle:t=>"left"===t.position?90:-90})})}(s,a);u&&l.push(u);const d=function(t={},e){const{style:i={},formatMethod:n,textMargin:s=4}=t,r=Ve(t,["style","formatMethod","textMargin"]);return Object.assign(Object.assign({type:"text",dataKey:t=>`${t.id}`,interactive:!1,animation:!1},r),{style:Object.assign(Object.assign(Object.assign({},$e),{text:(t,e)=>{var i,s,r,a,l,h,c;const{text:u}=t;let d=u;if(o(n)){const{vchart:o}=e,{from:p,to:g}=t,{field:f}=t.context,m=null!==(r=null===(s=null===(i=null==o?void 0:o.getChart())||void 0===i?void 0:i.getSeriesData())||void 0===s?void 0:s.latestData)&&void 0!==r?r:[],y=null!==(c=null===(h=null===(l=null===(a=null==o?void 0:o.getChart())||void 0===a?void 0:a.getAllSeries()[0])||void 0===l?void 0:l.getViewData())||void 0===h?void 0:h.latestData)&&void 0!==c?c:[],b=y.find((t=>t[f]===m[p][f])),v=y.find((t=>t[f]===m[g][f]));d=n(u,{arrow:t,from:b,to:v})}return d},x:(t,i)=>{var n,r;let a=t.layout.points;return a=Ze(t,i,e),null!==(r=(null===(n=a[1])||void 0===n?void 0:n.x)+("left"===t.position?-s:s))&&void 0!==r?r:NaN},y:(t,i)=>{var n,s,r;let a=t.layout.points;return a=Ze(t,i,e),null!==(r=((null===(n=a[1])||void 0===n?void 0:n.y)+(null===(s=a[2])||void 0===s?void 0:s.y))/2)&&void 0!==r?r:NaN},textAlign:t=>"left"===t.position?"right":"left",textBaseline:"middle"}),i)})}(r,a);return d&&l.push(d),h.children=l,h}function Ze(t,e,i){var n,s,r,a,o;const{vchart:l}=e,{from:h,to:c}=t,{field:u}=t.context,d=null===(s=null===(n=null==l?void 0:l.getChart())||void 0===n?void 0:n.getSeriesData())||void 0===s?void 0:s.latestData,p=null===(o=null===(a=null===(r=null==l?void 0:l.getChart())||void 0===r?void 0:r.getAllSeries()[0])||void 0===a?void 0:a.getViewData())||void 0===o?void 0:o.latestData;let g=[];if(d&&d.length){const n=p.find((t=>t[u]===d[h][u])),s=p.find((t=>t[u]===d[c][u])),r=p[0];if(n&&s&&r){g=function(t,e,i,n,s=12){const{layout:r,distance:a,position:o}=t,{level:l,fromIndex:h,toIndex:c,fromTotal:u,toTotal:d}=r,p="right"===o,g=p?e[1]:e[0],f=p?e[2]:e[3],m=Math.abs(g.y-f.y),y=p?i[1]:i[0],b=p?i[2]:i[3],v=Math.abs(y.y-b.y),x=p?n[1]:n[0],_=m/(u+1),A=v/(d+1),S=g.y+_*(h+1),T=y.y+A*(c+1),w=p?-1:1,M=[{x:g.x-s*w,y:S},{x:x.x-(s+(l+1)*a)*w,y:S},{x:x.x-(s+(l+1)*a)*w,y:T},{x:y.x-s*w,y:T}];return M}(t,e.getPoints(n),e.getPoints(s),e.getPoints(r),i),t.layout.points=g}}return g}function Je(t,e){const{from:i,to:n}=t,{from:s,to:r}=e;return n>s&&r>i}function Qe(t,e){const{from:i,to:n}=t,{from:s,to:r}=e;return i===s&&n===r}const ti=(t,e)=>{var i,n,s;if(!t||!(null===(i=t.arrows)||void 0===i?void 0:i.length))return[];const{arrows:r}=t,a=function(t,e){return t.filter((t=>b(t.from*t.to))).map(((t,i)=>{const{from:n,to:s,position:r="right"}=t;return Object.assign(Object.assign({},t),{position:r,distance:t.distance||40,from:Math.min(n,s),to:Math.max(n,s),span:Math.abs(n-s),isLayout:!1,context:{field:e},layout:{level:0},id:`${n}-${s}-${r}-${i}`})}))}(r,e.categoryField),o=a.filter((t=>"left"===t.position)),l=a.filter((t=>"right"===t.position));return[...null!==(n=ei(o))&&void 0!==n?n:[],...null!==(s=ei(l))&&void 0!==s?s:[]]};function ei(t){if(0===(null==t?void 0:t.length))return null;const e=new Map;return t.forEach((t=>{const i=e.get(t.from);if(h(i)){const e=i.fromArrows.find((e=>Qe(e,t)));e?t.layout.duplicateNode=e:i.degree+=1,i.fromArrows.push(t)}else e.set(t.from,{fromArrows:[t],toArrows:[],totalArrows:[],degree:1});const n=e.get(t.to);if(h(n)){const e=n.toArrows.find((e=>Qe(e,t)));e?t.layout.duplicateNode=e:n.degree+=1,n.toArrows.push(t)}else e.set(t.to,{toArrows:[t],fromArrows:[],totalArrows:[],degree:1})})),e.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((i=>{var n;const s=t.filter((t=>t.layout.isLayout)),r=((t,e)=>{var i;if(0===t.length)return;let n=t[0];for(let s=1;s<t.length;s++){const r=t[s];(null!==(i=null==e?void 0:e(r,n))&&void 0!==i?i:r-n)>0&&(n=r)}return n})(s,((t,e)=>t.layout.level-e.layout.level));let a=null!==(n=null==r?void 0:r.layout.level)&&void 0!==n?n:0;for(;a>=0;){if(s.some((t=>t.layout.level===a&&Je(t,i)))){a+=1;break}--a}i.layout.level=Math.max(0,a),i.layout.fromTotal=e.get(i.from).degree,i.layout.toTotal=e.get(i.to).degree;const o=i.layout.duplicateNode;o?(i.layout.fromIndex=o.layout.fromIndex,i.layout.toIndex=o.layout.toIndex):(i.layout.fromIndex=ii(i,e.get(i.from).totalArrows),i.layout.toIndex=ii(i,e.get(i.to).totalArrows)),i.layout.isLayout=!0})),t}function ii(t,e){let i=0,n=0;for(let s=0;s<e.length;s++){const r=e[s];if(r===t){i=s-n;break}r.layout.duplicateNode&&n++}return i}class ni extends e.FunnelChart{constructor(){super(...arguments),this.type="conversionFunnel",this.transformerConstructor=qe}}ni.type="conversionFunnel",ni.transformerConstructor=qe;class si 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 Ge(this._dataSet,{name:`${e.PREFIX}_series_${this.id}_arrowData`}),this._dataSet.getTransform("conversionArrow")||this._dataSet.registerTransform("conversionArrow",ti),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 ri="dataKey";class ai extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,n,s,r;super.transformSpec(t);const a=function(t){const e=[];return Object.keys(t.data).forEach((i=>{const n=t.data[i].nodes;e.push({data:[{id:"nodes",values:n.map(((t,e)=>Object.assign(Object.assign({},t),{[ri]: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=ri,t.data=a[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:a}),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!==(s=null===(n=t.player)||void 0===n?void 0:n.duration)&&void 0!==s?s: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===(r=t.infoLabel)||void 0===r?void 0:r.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 oi extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterLink",this.transformerConstructor=ai}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,data:a}=this._spec;return s&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}oi.type="sequenceScatterLink",oi.view="singleDefault",oi.transformerConstructor=ai;const li=.2;function hi(t){const e=Math.sqrt((2*Math.PI)**2);return Math.exp(-(t**2)/2)/e}const ci="dataKey";class ui extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,n,s,r,a;super.transformSpec(t);const o=function(t){const e=[];return Object.keys(t.data).forEach((i=>{const n=t.data[i].map(((t,e)=>Object.assign(Object.assign({},t),{[ci]:e}))),s=function(t,e=100,i){const n=t.reduce(((t,e)=>{const i=e.label;return t[i]=t[i]||[],t[i].push(e),t}),{}),s=[];return Object.entries(n).forEach((([t,n])=>{const r=i||function(t){return t.length**(-1/6)}(n),a=n.map((t=>t.x)),o=n.map((t=>t.y)),l=Math.min(...a),h=Math.max(...a),c=Math.min(...o),u=Math.max(...o),d=l-(h-l)*li,p=c-(u-c)*li;for(let i=0;i<e;i++)for(let a=0;a<e;a++){const e=d+.1*i,o=p+.1*a;let l=0;for(const t of n)l+=hi(Math.sqrt((e-t.x)**2+(o-t.y)**2)/r);l/=n.length*r*r,s.push({x:e,y:o,kde:l,label:t})}})),s}(n,150);e.push({data:[{id:"nodes",values:n},{id:"iter",values:[{iter:i}]},{id:"kde",values:s}]})})),e}(t);t.type="common",t.dataKey=ci,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!==(s=null===(n=t.player)||void 0===n?void 0:n.duration)&&void 0!==s?s:2e3,easing:"linear"},t.animationUpdate={duration:null!==(a=null===(r=t.player)||void 0===r?void 0:r.duration)&&void 0!==a?a:2e3,easing:"linear"}),t.axes=[{orient:"left",type:"linear",nice:!0},{orient:"bottom",type:"linear",nice:!0,label:{visible:!0}}],super.transformSpec(t)}}class di extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterKDE",this.transformerConstructor=ui}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,data:a}=this._spec;return s&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}di.type="sequenceScatterKDE",di.view="singleDefault",di.transformerConstructor=ui;const pi="dataKey";function gi(t){const e=[];return Object.keys(t.data).forEach((i=>{let n=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 n=document.createElement("canvas");n.width=e.width,n.height=e.height;const s=n.getContext("2d");if(!s)throw new Error("Failed to get 2D rendering context from canvas");const r=s.createImageData(e.width,e.height);for(let e=0;e<300;e++)for(let n=0;n<300;n++){const s=(null===(i=t[e])||void 0===i?void 0:i[n])||[0,0,0],a=4*(300*e+n);r.data[a]=Math.round(255*s[0]),r.data[a+1]=Math.round(255*s[1]),r.data[a+2]=Math.round(255*s[2]),r.data[a+3]=255}return s.putImageData(r,0,0),n.toDataURL("image/png")}(t.backgroundColors[i],t);n={imageData:e}}e.push({data:[{id:"nodes",values:t.data[i].map(((t,e)=>Object.assign(Object.assign({},t),{[pi]:e})))},{id:"inter",values:[{inter:i}]},{id:"background",values:n?[n]:[]}]})})),e}class fi extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,n,s,r;super.transformSpec(t);const a=gi(t);t.type="common",t.dataKey=pi,t.data=a[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:a}),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!==(s=null===(n=t.player)||void 0===n?void 0:n.duration)&&void 0!==s?s: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===(r=t.infoLabel)||void 0===r?void 0:r.style)}],t.tooltip={visible:!1},super.transformSpec(t)}}class mi extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterPixel",this.transformerConstructor=fi}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,data:a}=this._spec;return s&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}mi.type="sequenceScatterPixel",mi.view="singleDefault",mi.transformerConstructor=fi;class yi 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 bi,vi,xi,_i,Ai;!function(t){t.bar3d="bar3d",t.histogram3d="histogram3d",t.rangeColumn3d="rangeColumn3d",t.pie3d="pie3d",t.wordCloud3d="wordCloud3d",t.funnel3d="funnel3d"}(bi||(bi={})),function(t){t.rect3d="rect3d",t.arc3d="arc3d",t.pyramid3d="pyramid3d"}(vi||(vi={})),function(t){t.bar3d="bar3d",t.rangeColumn3d="rangeColumn3d",t.pie3d="pie3d",t.wordCloud3d="wordCloud3d",t.funnel3d="funnel3d"}(xi||(xi={})),function(t){t.bar3d="bar3d",t.funnel3d="funnel3d",t.transform3d="transform3d",t.pie3d="pie3d"}(_i||(_i={})),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"}(Ai||(Ai={}));class Si{static GenAutoIncrementId(){return Si.auto_increment_id++}}Si.auto_increment_id=0;class Ti{constructor(t){this.id=Si.GenAutoIncrementId(),this.registry=t}}const wi="named",Mi="inject",Bi="inversify:tagged",Ci="inversify:paramtypes";class ki{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===wi?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var Pi=function(t){var e;return function(t){const e="function"==typeof Symbol&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=Object.getPrototypeOf(Function),n=("object"==typeof process&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),s=new WeakMap;function r(t,e,i){let r=s.get(t);if(h(r)){if(!i)return;r=new n,s.set(t,r)}let a=r.get(e);if(h(a)){if(!i)return;a=new n,r.set(e,a)}return a}function a(t,e,i){if(o(t,e,i))return!0;const n=f(e);return!c(n)&&a(t,n,i)}function o(t,e,i){const n=r(e,i,!1);return!h(n)&&!!n.has(t)}function l(t,e,i){if(o(t,e,i))return function(t,e,i){const n=r(e,i,!1);if(!h(n))return n.get(t)}(t,e,i);const n=f(e);return c(n)?void 0:l(t,n,i)}function h(t){return void 0===t}function c(t){return null===t}function u(t){return"object"==typeof t?null!==t:"function"==typeof t}function d(t,i){switch(function(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}const n=3===i?"string":5===i?"number":"default",s=function(t,e){const i=t[e];if(null!=i){if(!g(i))throw new TypeError;return i}}(t,e);if(void 0!==s){const e=s.call(t,n);if(u(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(g(e)){const i=e.call(t);if(!u(i))return i}const i=t.valueOf;if(g(i)){const e=i.call(t);if(!u(e))return e}}else{const e=t.valueOf;if(g(e)){const i=e.call(t);if(!u(i))return i}const i=t.toString;if(g(i)){const e=i.call(t);if(!u(e))return e}}throw new TypeError}(t,"default"===n?"number":n)}function p(t){const e=d(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function g(t){return"function"==typeof t}function f(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===i)return e;if(e!==i)return e;const n=t.prototype,s=n&&Object.getPrototypeOf(n);if(null==s||s===Object.prototype)return e;const r=s.constructor;return"function"!=typeof r||r===t?e:r}t("defineMetadata",(function(t,e,i,n){if(!u(i))throw new TypeError;return s=t,a=e,void r(i,n,!0).set(s,a);var s,a})),t("hasMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return h(i)||(i=p(i)),a(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return h(i)||(i=p(i)),o(t,e,i)})),t("getMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return h(i)||(i=p(i)),l(t,e,i)}))}((e=t,function(t,i){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:i})})),t}({});function Oi(t,e,i,n){!function(t,e,i,n){const s=[n];let r={};Pi.hasOwnMetadata(t,e)&&(r=Pi.getMetadata(t,e));let a=r[i];void 0===a&&(a=[]),a.push(...s),r[i]=a,Pi.defineMetadata(t,r,e)}(Bi,t,i.toString(),n)}function Ri(t){return(e,i,n)=>{Oi(e,0,n,t)}}const Li=(Ii=Mi,t=>(e,i,n)=>Ri(new ki(Ii,t))(e,i,n));var Ii;function Ei(){return function(t){return Pi.defineMetadata(Ci,null,t),t}}function Di(t){return Ri(new ki(wi,t))}const Fi="Singleton",ji="Transient",Ui="ConstantValue",Ni="DynamicValue",Wi="Factory",zi="Function",Gi="Instance",Vi="Invalid";class Hi{constructor(t,e){this.id=Si.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=Vi,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new Hi(this.serviceIdentifier,this.scope);return t.activated=t.scope===Fi&&this.activated,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.provider=this.provider,t.constraint=this.constraint,t.cache=this.cache,t}}class Xi{getConstructorMetadata(t){return{compilerGeneratedMetadata:Pi.getMetadata(Ci,t),userGeneratedMetadata:Pi.getMetadata(Bi,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const $i=(Yi=wi,t=>{const e=e=>{if(null==e)return!1;if(e.key===Yi&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;const i=e.constructorArgsMetadata;for(let e=0;e<i.length;e++)if(i[e].key===Yi&&i[e].value===t)return!0;return!1};return e.metaData=new ki(Yi,t),e});var Yi;class qi{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=Fi,this}inTransientScope(){return this._binding.scope=ji,this}whenTargetNamed(t){return this._binding.constraint=$i(t),this}}class Ki{constructor(t){this._binding=t}to(t){return this._binding.type=Gi,this._binding.implementationType=t,new qi(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=Ni,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new qi(this._binding)}toConstantValue(t){return this._binding.type=Ui,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=Fi,new qi(this._binding)}toFactory(t){return this._binding.type=Wi,this._binding.factory=t,this._binding.scope=Fi,new qi(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}const Zi=Symbol("ContributionProvider");class Ji{constructor(t,e){this.serviceIdentifier=t,this.container=e,tn.setStore(this.serviceIdentifier,this)}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}refresh(){this.caches&&(this.caches.length=0,this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier)))}}function Qi(t,e){t(Zi).toDynamicValue((t=>{let{container:i}=t;return new Ji(e,i)})).inSingletonScope().whenTargetNamed(e)}class tn{static getStore(t){return this.store.get(t)}static setStore(t,e){this.store.set(t,e)}static refreshAllContributions(){this.store.forEach((t=>{t.refresh()}))}}tn.store=new Map;class en{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((t=>!(t.name===i&&(!e||t.fn===e)))))}_parseOptions(t,e,i){let n;if("string"==typeof e)n={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof n.name||""===n.name)throw new Error("Missing name for tap");return n=Object.assign({type:t,fn:i},n),n}_tap(t,e,i){this._insert(this._parseOptions(t,e,i))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let i=0;"number"==typeof t.stage&&(i=t.stage);let n=this.taps.length;for(;n>0;){n--;const t=this.taps[n];this.taps[n+1]=t;const s=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(s>i)){n++;break}}this.taps[n]=t}}class nn extends en{call(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this.taps.map((t=>t.fn)).forEach((t=>t(...e)))}}const sn=new class{};var rn,an,on,ln;!function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(rn||(rn={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(an||(an={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(on||(on={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(ln||(ln={}));const hn=rt-1e-8;class cn{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,n,s,r){if(Math.abs(s-n)>hn)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let a,o,l,h,c=1/0,u=-1/0,d=1/0,p=-1/0;function g(t){l=i*Math.cos(t),h=i*Math.sin(t),l<c&&(c=l),l>u&&(u=l),h<d&&(d=h),h>p&&(p=h)}if(g(n),g(s),s!==n)if((n%=rt)<0&&(n+=rt),(s%=rt)<0&&(s+=rt),s<n&&(r=!r,a=n,n=s,s=a),r)for(s-=rt,a=n-n%st,o=0;o<4&&a>s;++o,a-=st)g(a);else for(a=n-n%st+st,o=0;o<4&&a<s;++o,a+=st)g(a);this.bounds.add(t+c,e+d),this.bounds.add(t+u,e+p)}arcTo(t,e,i,n,s){this.bounds.add(t,e)}bezierCurveTo(t,e,i,n,s,r){this.bounds.add(t,e),this.bounds.add(i,n),this.bounds.add(s,r)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,n){this.bounds.add(t,e),this.bounds.add(i,n)}rect(t,e,i,n){this.bounds.add(t,e),this.bounds.add(t+i,e+n)}clear(){this.bounds.clear()}release(){}}class un{constructor(){this._curves=[],this.bounds=new Xt}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 dn=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,pn={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},gn={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let fn,mn,yn,bn,vn,xn;var _n,An,Sn,Tn,wn,Mn;function Bn(t){const e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=t[6],l=t[7],h=l*r,c=-o*a,u=o*r,d=l*a,p=Math.cos(n),g=Math.sin(n),f=Math.cos(s),m=Math.sin(s),y=.5*(s-n),b=Math.sin(.5*y),v=8/3*b*b/Math.sin(y),x=e+p-v*g,_=i+g+v*p,A=e+f,S=i+m,T=A+v*m,w=S-v*f;return[h*x+c*_,u*x+d*_,h*T+c*w,u*T+d*w,h*A+c*S,u*A+d*S]}function Cn(t,e,i,n){const s=function(t,e,i,n,s,r,a,o,l){const h=xt(a),c=Math.sin(h),u=Math.cos(h),d=u*(o-t)*.5+c*(l-e)*.5,p=u*(l-e)*.5-c*(o-t)*.5;let g=d*d/((i=Math.abs(i))*i)+p*p/((n=Math.abs(n))*n);g>1&&(g=Math.sqrt(g),i*=g,n*=g);const f=u/i,m=c/i,y=-c/n,b=u/n,v=f*o+m*l,x=y*o+b*l,_=f*t+m*e,A=y*t+b*e;let S=1/((_-v)*(_-v)+(A-x)*(A-x))-.25;S<0&&(S=0);let T=Math.sqrt(S);r===s&&(T=-T);const w=.5*(v+_)-T*(A-x),M=.5*(x+A)+T*(_-v),B=Math.atan2(x-M,v-w);let C=Math.atan2(A-M,_-w)-B;C<0&&1===r?C+=rt:C>0&&0===r&&(C-=rt);const k=Math.ceil(Math.abs(C/(st+.001))),P=[];for(let t=0;t<k;++t){const e=B+t*C/k,s=B+(t+1)*C/k;P[t]=[w,M,e,s,i,n,c,u]}return P}(n[5],n[6],n[0],n[1],n[3],n[4],n[2],e,i);for(let e=0;e<s.length;++e){const i=Bn(s[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_LAYOUT=128]="UPDATE_LAYOUT",t[t.CLEAR_LAYOUT=127]="CLEAR_LAYOUT"}(_n||(_n={})),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"}(An||(An={})),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"}(Sn||(Sn={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(Tn||(Tn={})),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"}(wn||(wn={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(Mn||(Mn={}));const kn=[(t,e,i,n,s,r,a)=>e.arc(t[1]*s+i,t[2]*r+n,t[3]*(s+r)/2,t[4],t[5],t[6],a),(t,e,i,n,s,r,a)=>e.arcTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,t[5]*(s+r)/2,a),(t,e,i,n,s,r,a)=>e.bezierCurveTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,t[5]*s+i,t[6]*r+n,a),(t,e,i,n)=>e.closePath(),(t,e,i,n,s,r)=>e.ellipse(t[1]*s+i,t[2]*r+n,t[3]*s,t[4]*r,t[5],t[6],t[7],t[8]),(t,e,i,n,s,r,a)=>e.lineTo(t[1]*s+i,t[2]*r+n,a),(t,e,i,n,s,r,a)=>e.moveTo(t[1]*s+i,t[2]*r+n,a),(t,e,i,n,s,r,a)=>e.quadraticCurveTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,a),(t,e,i,n,s,r,a)=>e.rect(t[1]*s+i,t[2]*r+n,t[3]*s,t[4]*r,a)];function Pn(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=arguments.length>6?arguments[6]:void 0;for(let o=0;o<t.length;o++){const l=t[o];kn[l[0]](l,e,i,n,s,r,a)}}class On{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function Rn(t,e){let i=0;const n=t.length;for(let s=0;s<n;s++){const r=t[s],a=e[s],o=t[(s+1)%n],l=e[(s+1)%n];i+=vt.distanceNN(r,a,o,l)}return i/2}function Ln(t,e,i,n,s){const r=1-s;return r*r*r*t+3*e*s*r*r+3*i*s*s*r+n*s*s*s}function In(t,e,i,n,s){const r=Ln(t.x,e.x,i.x,n.x,s),a=Ln(t.y,e.y,i.y,n.y,s);return new bt(r,a)}function En(t,e,i,n){const s=1-n;return s*s*t+2*s*n*e+n*n*i}function Dn(t,e,i,n){const s=En(t.x,e.x,i.x,n),r=En(t.y,e.y,i.y,n);return new bt(s,r)}function Fn(t,e){const{p0:i,p1:n,p2:s,p3:r}=t,a=In(i,n,s,r,e),o=vt.pointAtPP(i,n,e),l=vt.pointAtPP(n,s,e),h=vt.pointAtPP(s,r,e),c=vt.pointAtPP(o,l,e),u=vt.pointAtPP(l,h,e);return[new jn(i,o,c,a),new jn(a,u,h,r)]}class jn extends On{constructor(t,e,i,n){super(),this.type=wn.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=i,this.p3=n}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}getPointAt(t){if(!1!==this.defined)return In(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,n=this.p3,Rn([t.x,e.x,i.x,n.x],[t.y,e.y,i.y,n.y])):60;var t,e,i,n}calcProjLength(t){return t===Tn.ROW?ot(this.p0.x-this.p3.x):t===Tn.COLUMN?ot(this.p0.y-this.p3.y):0}getAngleAt(t){const e=ct(t-.01,0),i=ut(t+.01,1),n=this.getPointAt(e),s=this.getPointAt(i);return lt(s.y-n.y,s.x-n.x)}draw(t,e,i,n,s,r){if(t.moveTo(this.p0.x*n+e,this.p0.y*s+i),r>=1)t.bezierCurveTo(this.p1.x*n+e,this.p1.y*s+i,this.p2.x*n+e,this.p2.y*s+i,this.p3.x*n+e,this.p3.y*s+i);else if(r>0){const[a]=Fn(this,r);t.bezierCurveTo(a.p1.x*n+e,a.p1.y*s+i,a.p2.x*n+e,a.p2.y*s+i,a.p3.x*n+e,a.p3.y*s+i)}}includeX(t){const e=ut(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=ct(this.p0.x,this.p1.x,this.p2.x,this.p3.x);return t>=e&&t<=i}getYAt(t){const e=ut(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=(t-e)/(ct(this.p0.x,this.p1.x,this.p2.x,this.p3.x)-e);return this.getPointAt(i).y}}class Un extends On{constructor(t,e){super(),this.type=wn.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return vt.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=lt(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()?vt.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===Tn.ROW?ot(this.p0.x-this.p1.x):t===Tn.COLUMN?ot(this.p0.y-this.p1.y):0}draw(t,e,i,n,s,r){if(t.moveTo(this.p0.x*n+e,this.p0.y*s+i),r>=1)t.lineTo(this.p1.x*n+e,this.p1.y*s+i);else if(r>0){const a=this.getPointAt(r);t.lineTo(a.x*n+e,a.y*s+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 n=(t-e.x)/(i.x-e.x);return e.y+n*(i.y-e.y)}return 1/0}}class Nn{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,i,n,s,r,a,o){const l=new jn(new bt(this._lastX,this._lastY),new bt(t,e),new bt(i,n),new bt(s,r));l.originP1=this._lastOriginP,l.originP2=o,l.defined=a,this.curves.push(l),this._lastX=s,this._lastY=r,this._lastOriginP=o}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,i,n){const s=this.addLinearCurve(t,e,i,this._lastOriginP,n);this.curves.push(s),this._lastX=t,this._lastY=e,this._lastOriginP=n}moveTo(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}quadraticCurveTo(t,e,i,n){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,i,n,s){const r=new Un(new bt(this._lastX,this._lastY),new bt(t,e));return r.originP1=n,r.originP2=s,r.defined=i,r}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,i;if(t===Tn.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],i=this.curves[this.curves.length-1],n=null!==(e=i.p3)&&void 0!==e?e:i.p1;return ot(t.p0.y-n.y)}if(t===Tn.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],n=null!==(i=e.p3)&&void 0!==i?i:e.p1;return ot(t.p0.x-n.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class Wn extends Nn{bezierCurveTo(t,e,i,n,s,r,a,o){return super.bezierCurveTo(e,t,n,i,r,s,a,o)}lineTo(t,e,i,n){return super.lineTo(e,t,i,n)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function zn(t,e){let i=!1;for(let n=0,s=e.length;n<=s;n++)n>=s===i&&((i=!i)?t.lineStart():t.lineEnd()),i&&t.point(e[n])}function Gn(t,e,i){const n=null!=e?e:ot(i[i.length-1].x-i[0].x)>ot(i[i.length-1].y-i[0].y)?Tn.ROW:Tn.COLUMN;return"monotoneY"===t?new Wn(t,n):new Nn(t,n)}class Vn{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 Hn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const s=Gn("linear",i,t);return function(t,e){zn(t,e)}(new Vn(s,n),t),s}function Xn(t,e,i,n,s){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,n,t.lastPoint1)}class $n{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&&Xn(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:Xn(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 Yn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return Hn(t,e);const s=Gn("basis",i,t);return function(t,e){zn(t,e)}(new $n(s,n),t),s}function qn(t){return t<0?-1:1}function Kn(t,e,i){const n=t._x1-t._x0,s=e-t._x1,r=(t._y1-t._y0)/(n||Number(s<0&&-0)),a=(i-t._y1)/(s||Number(n<0&&-0)),o=(r*s+a*n)/(n+s);return(qn(r)+qn(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(o))||0}function Zn(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function Jn(t,e,i,n,s){const r=t._x0,a=t._y0,o=t._x1,l=t._y1,h=(o-r)/3;t.context.bezierCurveTo(r+h,a+h*e,o-h,l-h*i,o,l,n,t.lastPoint1)}class Qn{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:Jn(this,this._t0,Zn(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,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,n,t);break;case 1:this._point=2;break;case 2:this._point=3,Jn(this,Zn(this,e=Kn(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:Jn(this,this._t0,e=Kn(this,i,n),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=n,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 ts extends Qn{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function es(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return Hn(t,e);const s=Gn("monotoneX",i,t);return function(t,e){zn(t,e)}(new Qn(s,n),t),s}function is(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return Hn(t,e);const s=Gn("monotoneY",i,t);return function(t,e){zn(t,e)}(new ts(s,n),t),s}let ns=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;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 n=this._x*(1-this._t)+e*this._t;.5===this._t?this.context.lineTo(n,this._y,!1!==this._lastDefined,this.lastPoint):this.context.lineTo(n,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(n,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 ss extends ns{lineEnd(){this.context.closePath()}}function rs(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:n,startPoint:s}=i;if(t.length<2-Number(!!s))return null;const r=new Nn("step",null!=n?n:ot(t[t.length-1].x-t[0].x)>ot(t[t.length-1].y-t[0].y)?Tn.ROW:Tn.COLUMN);return as(new ns(r,e,s),t),r}function as(t,e){return zn(t,e)}class os extends Vn{lineEnd(){this.context.closePath()}}function ls(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const s=Gn("linear",i,t);return function(t,e){zn(t,e)}(new os(s,n),t),s}function hs(t,e,i,n,s){let r=t._x1,a=t._y1,o=t._x2,l=t._y2;if(t._l01_a>it){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);r=(r*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,a=(a*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>it){const n=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*n+t._x1*t._l23_2a-e*t._l12_2a)/s,l=(l*n+t._y1*t._l23_2a-i*t._l12_2a)/s}t.context.bezierCurveTo(r,a,o,l,t._x2,t._y2,n,t.lastPoint1)}function cs(t,e){return function(i,n){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:r,startPoint:a}=s;if(i.length<2-Number(!!a))return null;if(i.length<3-Number(!!a))return Hn(i,s);const o=Gn(t,r,i);return zn(new e(o,n,a),i),o}}const us=cs("catmullRom",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;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,n=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+n*n,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:hs(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 ds=cs("catmullRomClosed",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;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,n=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+n*n,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:hs(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 ps extends On{constructor(t,e,i){super(),this.type=wn.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 Dn(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,Rn([t.x,e.x,i.x],[t.y,e.y,i.y])):60;var t,e,i}calcProjLength(t){return t===Tn.ROW?ot(this.p0.x-this.p2.x):t===Tn.COLUMN?ot(this.p0.y-this.p2.y):0}getAngleAt(t){const e=ct(t-.01,0),i=ut(t+.01,1),n=this.getPointAt(e),s=this.getPointAt(i);return lt(s.y-n.y,s.x-n.x)}draw(t,e,i,n,s,r){if(t.moveTo(this.p0.x*n+e,this.p0.y*s+i),r>=1)t.quadraticCurveTo(this.p1.x*n+e,this.p1.y*s+i,this.p2.x*n+e,this.p2.y*s+i);else if(r>0){const[a]=function(t,e){const{p0:i,p1:n,p2:s}=t,r=Dn(i,n,s,e),a=vt.pointAtPP(i,n,e),o=vt.pointAtPP(n,s,e);return[new ps(i,a,r),new ps(r,o,s)]}(this,r);t.quadraticCurveTo(a.p1.x*n+e,a.p1.y*s+i,a.p2.x*n+e,a.p2.y*s+i)}}getYAt(t){throw new Error("QuadraticBezierCurve暂不支持getYAt")}includeX(t){throw new Error("QuadraticBezierCurve暂不支持includeX")}}class gs{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 Un(new bt(this._lastX,this._lastY),new bt(t,e))}quadraticCurveTo(t,e,i,n){const s=new ps(new bt(this._lastX,this._lastY),new bt(t,e),new bt(i,n));this.path.addCurve(s),this._lastX=i,this._lastY=n}bezierCurveTo(t,e,i,n,s,r){const a=new jn(new bt(this._lastX,this._lastY),new bt(t,e),new bt(i,n),new bt(s,r));this.path.addCurve(a),this._lastX=s,this._lastY=r}arcTo(t,e,i,n,s){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,i,n,s,r,a,o){throw new Error("CurveContext不支持调用ellipse")}rect(t,e,i,n){throw new Error("CurveContext不支持调用rect")}arc(t,e,i,n,s,r){throw new Error("CurveContext不支持调用arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}}function fs(t,e,i){var n,s;switch(e){case"linear":default:return Hn(t,i);case"basis":return Yn(t,i);case"monotoneX":return es(t,i);case"monotoneY":return is(t,i);case"step":return rs(t,.5,i);case"stepClosed":return function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:n,startPoint:s}=i;if(t.length<2-Number(!!s))return null;const r=new Nn("step",null!=n?n:ot(t[t.length-1].x-t[0].x)>ot(t[t.length-1].y-t[0].y)?Tn.ROW:Tn.COLUMN);return as(new ss(r,e,s),t),r}(t,.5,i);case"stepBefore":return rs(t,0,i);case"stepAfter":return rs(t,1,i);case"catmullRom":return us(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"catmullRomClosed":return ds(t,null!==(s=null==i?void 0:i.curveTension)&&void 0!==s?s:.5,i);case"linearClosed":return ls(t,i)}}class ms extends un{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new cn(this.bounds)}get curves(){return this.tryBuildCurves()}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([gn.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([gn.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.commandList.push([gn.Q,t,e,i,n]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this}bezierCurveTo(t,e,i,n,s,r){return this.commandList.push([gn.C,t,e,i,n,s,r]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,s,r),this}arcTo(t,e,i,n,s){return this.commandList.push([gn.AT,t,e,i,n,s]),this._ctx&&this._ctx.arcTo(t,e,i,n,s),this}ellipse(t,e,i,n,s,r,a,o){return this.commandList.push([gn.E,t,e,i,n,s,r,a,o]),this._ctx&&this._ctx.ellipse(t,e,i,n,s,r,a,o),this}rect(t,e,i,n){return this.commandList.push([gn.R,t,e,i,n]),this._ctx&&this._ctx.rect(t,e,i,n),this}arc(t,e,i,n,s,r){return this.commandList.push([gn.A,t,e,i,n,s,r]),this._ctx&&this._ctx.arc(t,e,i,n,s,r),this}closePath(){return this.commandList.push([gn.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 gs(this);Pn(this.commandList,t,0,0,1,1)}return this._curves}toString(){if(!this.toStringCbList){const t=[];t[gn.M]=t=>`M${t[1]} ${t[2]}`,t[gn.L]=t=>`L${t[1]} ${t[2]}`,t[gn.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[gn.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[gn.A]=t=>{const e=[],i=t[1],n=t[2],s=t[3];!function(t,e,i,n,s,r,a){let o=arguments.length>7&&void 0!==arguments[7]&&arguments[7];const l=2*Math.PI,h=(e%l+l)%l;let c,u=(i%l+l)%l;o?(u>=h&&(u-=l),c=u-h):(u<=h&&(u+=l),c=u-h);const d=Math.ceil(Math.abs(c)/(.5*Math.PI)),p=c/d;for(let e=0;e<d;e++){const i=h+p*e,l=h+p*(e+1),c=4/3*Math.tan(Math.abs(p)/4),u=Math.cos(i),d=Math.sin(i),g=Math.cos(l),f=Math.sin(l),m=u*r+n,y=d*a+s,b=g*r+n,v=f*a+s,x=o?-1:1,_=r*c*x,A=a*c*x;t.push(m-_*d,y+A*u,b+_*f,v-A*g,b,v)}}(e,t[4],t[5],i,n,s,s,t[6]);let r="";for(let t=0;t<e.length;t+=6)r+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return r},t[gn.R]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[gn.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,n,s){this.clear();const r=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,n;const s=[];for(let t=0,r=e.length;t<r;t++)if(fn=e[t],mn=fn.slice(1),yn=fn[0],i=[yn],n=mn.match(dn),null!==n){for(let t=0,e=n.length;t<e;t++)bn=n[t],vn=parseFloat(bn),Number.isNaN(vn)||i.push(vn);if(xn=pn[yn],i.length-1>xn){let t,e=yn;for(let n=1,r=i.length;n<r;n+=xn){t=[e];for(let e=n,s=n+xn;e<s;e++)t.push(i[e]);s.push(t),"m"===e?e="l":"M"===e&&(e="L")}}else s.push(i)}else s.push(i);return s}(t);return this._runCommandStrList(r,e,i,n,s),this._updateBounds(),this}fromLine(t){const{points:e,curveType:i,clipRangeByDimension:n}=t.attribute;if(!e)return;const s=fs(e,i);"x"===n?this.direction=Tn.ROW:"y"===n?this.direction=Tn.COLUMN:"auto"===n&&(this.direction=s.direction),this._curves=s.curves}fromCustomPath2D(t,e,i,n,s){return this.clear(),this._runCommandList(t.commandList,e,i,n,s),this._updateBounds(),this}transform(t,e,i,n){const s=this.commandList;if(!this.transformCbList){const t=[];t[gn.M]=this.moveToTransform,t[gn.L]=this.lineToTransform,t[gn.Q]=this.quadraticCurveToTransform,t[gn.C]=this.bezierCurveToTransform,t[gn.AT]=this.arcToTransform,t[gn.E]=this.ellipseTransform,t[gn.R]=this.rectTransform,t[gn.A]=this.arcTransform,t[gn.Z]=this.closePathTransform,this.transformCbList=t}s.forEach((s=>{this.transformCbList[s[0]](s,t,e,i,n)})),this._updateBounds()}moveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i}lineToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i}quadraticCurveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i}bezierCurveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i,t[5]=t[5]*n+e,t[6]=t[6]*s+i}arcToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i,t[5]=t[5]*(n+s)/2}ellipseTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n,t[4]=t[4]*s}rectTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n,t[4]=t[4]*s}arcTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*(n+s)/2}closePathTransform(){}_runCommandStrList(t){let e,i,n,s,r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,c=null,u=0,d=0,p=0,g=0;for(let f=0,m=t.length;f<m;++f){switch(e=t[f],1===l&&1===h||(e=bs(e,l,h)),e[0]){case"l":u+=e[1],d+=e[2],this.lineTo(u+a,d+o);break;case"L":u=e[1],d=e[2],this.lineTo(u+a,d+o);break;case"h":u+=e[1],this.lineTo(u+a,d+o);break;case"H":u=e[1],this.lineTo(u+a,d+o);break;case"v":d+=e[1],this.lineTo(u+a,d+o);break;case"V":d=e[1],this.lineTo(u+a,d+o);break;case"m":u+=e[1],d+=e[2],this.moveTo(u+a,d+o);break;case"M":u=e[1],d=e[2],this.moveTo(u+a,d+o);break;case"c":i=u+e[5],n=d+e[6],p=u+e[3],g=d+e[4],this.bezierCurveTo(u+e[1]+a,d+e[2]+o,p+a,g+o,i+a,n+o),u=i,d=n;break;case"C":u=e[5],d=e[6],p=e[3],g=e[4],this.bezierCurveTo(e[1]+a,e[2]+o,p+a,g+o,u+a,d+o);break;case"s":i=u+e[3],n=d+e[4],null===c[0].match(/[CcSs]/)?(p=u,g=d):(p=2*u-p,g=2*d-g),s=u+e[1],r=d+e[2],this.bezierCurveTo(p+a,g+o,s+a,r+o,i+a,n+o),p=s,g=r,u=i,d=n;break;case"S":i=e[3],n=e[4],null===c[0].match(/[CcSs]/)?(p=u,g=d):(p=2*u-p,g=2*d-g),s=e[1],r=e[2],this.bezierCurveTo(p+a,g+o,s+a,r+o,i+a,n+o),p=s,g=r,u=i,d=n;break;case"q":i=u+e[3],n=d+e[4],p=u+e[1],g=d+e[2],this.quadraticCurveTo(p+a,g+o,i+a,n+o),u=i,d=n;break;case"Q":i=e[3],n=e[4],this.quadraticCurveTo(e[1]+a,e[2]+o,i+a,n+o),u=i,d=n,p=e[1],g=e[2];break;case"t":i=u+e[1],n=d+e[2],null===c[0].match(/[QqTt]/)?(p=u,g=d):"t"===c[0]?(p=2*u-s,g=2*d-r):"q"===c[0]&&(p=2*u-p,g=2*d-g),s=p,r=g,this.quadraticCurveTo(p+a,g+o,i+a,n+o),u=i,d=n,p=u+e[1],g=d+e[2];break;case"T":i=e[1],n=e[2],p=2*u-p,g=2*d-g,this.quadraticCurveTo(p+a,g+o,i+a,n+o),u=i,d=n;break;case"a":Cn(this,u+a,d+o,[e[1],e[2],e[3],e[4],e[5],e[6]+u+a,e[7]+d+o]),u+=e[6],d+=e[7];break;case"A":Cn(this,u+a,d+o,[e[1],e[2],e[3],e[4],e[5],e[6]+a,e[7]+o]),u=e[6],d=e[7];break;case"z":case"Z":this.closePath()}c=e}}_runCommandList(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==i||1!==n||1!==s)for(let r=0,a=t.length;r<a;++r){const a=t[r].slice();switch(a[0]){case gn.L:this.lineToTransform(a,e,i,n,s);break;case gn.M:this.moveToTransform(a,e,i,n,s);break;case gn.C:this.bezierCurveToTransform(a,e,i,n,s);break;case gn.Q:this.quadraticCurveToTransform(a,e,i,n,s);break;case gn.A:this.arcToTransform(a,e,i,n,s);break;case gn.E:this.ellipseTransform(a,e,i,n,s);break;case gn.R:this.rectTransform(a,e,i,n,s);break;case gn.AT:this.arcToTransform(a,e,i,n,s);break;case gn.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),Pn(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===Tn.COLUMN){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return ot(t.p0.y-e.p1.y)}if(this.direction===Tn.ROW){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return ot(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 n=0;n<this._curves.length;n++){e=this._curves[n];const s=e.getLength(this.direction);if(i+s>=t)break;i+=s}const n=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(n),angle:e.getAngleAt(n)}}drawWithClipRange(t,e,i,n,s){this.tryBuildCurves();const r=this.getLength()*s;let a=0;for(let s=0;s<this._curves.length;s++){const o=this._curves[s],l=o.getLength(this.direction);if(!(a+l<=r)){const s=1-(a+l-r)/l;o.draw(t,i,n,e,e,s);break}o.draw(t,i,n,e,e,1),a+=l}}}const ys=["l",0,0,0,0,0,0,0];function bs(t,e,i){const n=ys[0]=t[0];if("a"===n||"A"===n)ys[1]=e*t[1],ys[2]=i*t[2],ys[3]=t[3],ys[4]=t[4],ys[5]=t[5],ys[6]=e*t[6],ys[7]=i*t[7];else if("h"===n||"H"===n)ys[1]=e*t[1];else if("v"===n||"V"===n)ys[1]=i*t[1];else for(let n=1,s=t.length;n<s;++n)ys[n]=(n%2==1?e:i)*t[n];return ys}const vs={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 Yt},xs={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},_s=Object.assign({outerBorder:Object.assign(Object.assign({},xs),{distance:0}),innerBorder:Object.assign(Object.assign({},xs),{distance:0})},xs),As={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:rn.fontBounding,keepCenterInLine:!1},Ss=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,blur:0,filter:"",cursor:null,html:null,react:null,vue:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),_s),{alignSelf:"auto"}),{pickStrokeBuffer:0}),Ts={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},ws=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}),Ss),vs),Ms=Object.assign(Object.assign({},ws),{startAngle:0,endAngle:at,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Bs=Object.assign(Object.assign(Object.assign({},ws),Ts),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),Cs=Object.assign(Object.assign({},ws),{radius:1,startAngle:0,endAngle:at}),ks=Object.assign(Object.assign({},ws),{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"}),Ps=Object.assign(Object.assign({},ws),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Os=Object.assign(Object.assign(Object.assign({},ws),Ts),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),Rs=Object.assign(Object.assign({},ws),{path:new ms,fillStrokeOrder:1,clipRange:1,customPath:()=>{$.getInstance().warn("空函数")}}),Ls=Object.assign(Object.assign({},ws),{points:[],cornerRadius:0,closePath:!0}),Is=Object.assign(Object.assign({},ws),{width:100,height:100,spikes:5,thickness:.5}),Es=Object.assign(Object.assign({},ws),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0,cornerType:"round"});Object.assign(Object.assign({},ws),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0,cornerType:"round"});const Ds=Object.assign(Object.assign({},ws),{symbolType:"circle",size:10,keepDirIn3d:!0,clipRange:1}),Fs=Object.assign(Object.assign(Object.assign({},ws),As),{strokeBoundsBuffer:0,keepDirIn3d:!0}),js=Object.assign(Object.assign(Object.assign({},ws),As),{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}),Us=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0,maxWidth:500,maxHeight:500},ws),{fill:!0,cornerRadius:0,cornerType:"round"}),Ns=Object.assign(Object.assign({},Us),{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}),Ws=function(){const t={linearGradient:/^(linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,fromAngleValue:/^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/(^\#[0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,rgbaColor:/^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/};let e="";function i(t){const i=new Error(e+": "+t);throw i.source=e,i}function n(){return s("linear",t.linearGradient,r)||s("radial",t.radialGradient,o)||s("conic",t.conicGradient,a)}function s(e,n,s){return function(n,r){const a=y(n);if(a){y(t.startCall)||i("Missing (");const n=function(n){const r=s();return r&&(y(t.comma)||i("Missing comma before color stops")),{type:e,orientation:r,colorStops:d(p)}}();return y(t.endCall)||i("Missing )"),n}}(n)}function r(){return m("directional",t.sideOrCorner,1)||m("angular",t.angleValue,1)}function a(){return m("angular",t.fromAngleValue,1)}function o(){let i,n,s=l();return s&&(i=[],i.push(s),n=e,y(t.comma)&&(s=l(),s?i.push(s):e=n)),i}function l(){let t=function(){const t=m("shape",/^(circle)/i,0);return t&&(t.style=f()||h()),t}()||function(){const t=m("shape",/^(ellipse)/i,0);return t&&(t.style=g()||h()),t}();if(t)t.at=c();else{const e=h();if(e){t=e;const i=c();i&&(t.at=i)}else{const e=u();e&&(t={type:"default-radial",at:e})}}return t}function h(){return m("extent-keyword",t.extentKeywords,1)}function c(){if(m("position",/^at/,0)){const t=u();return t||i("Missing positioning value"),t}}function u(){const t={x:g(),y:g()};if(t.x||t.y)return{type:"position",value:t}}function d(e){let n=e();const s=[];if(n)for(s.push(n);y(t.comma);)n=e(),n?s.push(n):i("One extra comma");return s}function p(){const e=m("hex",t.hexColor,1)||m("rgba",t.rgbaColor,1)||m("rgb",t.rgbColor,1)||m("literal",t.literalColor,0);return e||i("Expected color definition"),e.length=g(),e}function g(){return m("%",t.percentageValue,1)||m("position-keyword",t.positionKeywords,1)||f()}function f(){return m("px",t.pixelValue,1)||m("em",t.emValue,1)}function m(t,e,i){const n=y(e);if(n)return{type:t,value:n[i]}}function y(t){const i=/^[\n\r\t\s]+/.exec(e);i&&b(i[0].length);const n=t.exec(e);return n&&b(n[0].length),n}function b(t){e=e.substr(t)}return function(t){return e=t.toString(),function(){const t=d(n);return e.length>0&&i("Invalid input not EOF"),t}()}}();class zs{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(zs.IsGradientStr(t))try{const e=Ws(t)[0];if(e){if("linear"===e.type)return zs.ParseLinear(e);if("radial"===e.type)return zs.ParseRadial(e);if("conic"===e.type)return zs.ParseConic(e)}}catch(e){return t}return t}static ParseConic(t){const{orientation:e,colorStops:i=[]}=t,n=nt/2,s=parseFloat(e.value)/180*nt-n;return{gradient:"conical",x:.5,y:.5,startAngle:s,endAngle:s+at,stops:i.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseRadial(t){const{colorStops:e=[]}=t;return{gradient:"radial",x0:.5,y0:.5,x1:.5,y1:.5,r0:0,r1:1,stops:e.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseLinear(t){const{orientation:e,colorStops:i=[]}=t,n=nt/2;let s="angular"===e.type?parseFloat(e.value)/180*nt:0;for(;s<0;)s+=at;for(;s>=at;)s-=at;let r=0,a=0,o=0,l=0;return s<n?(r=0,a=1,o=Math.sin(s),l=a-Math.cos(s)):s<nt?(r=0,a=0,o=Math.cos(s-n),l=Math.sin(s-n)):s<nt+n?(r=1,a=0,o=r-Math.sin(s-nt),l=Math.cos(s-nt)):(r=1,o=r-Math.cos(s-n-nt),l-=Math.sin(s-n-nt)),{gradient:"linear",x0:r,y0:a,x1:o,y1:l,stops:i.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}}function Gs(t,e,i){let n=e;const{a:s,b:r,c:a,d:o}=t.currentMatrix,l=Math.sign(s)*Math.sqrt(s*s+r*r),h=Math.sign(o)*Math.sqrt(a*a+o*o);return l+h===0?0:(n=n/Math.abs(l+h)*2*i,n)}function Vs(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;var r,a,o,l;if(!e||!0===e)return"black";let h,c;if(g(e))for(let t=0;t<e.length&&(c=e[t],!c);t++);else c=e;if(c=zs.Parse(c),"string"==typeof c)return c;if(i.AABBBounds&&(!i.attribute||0!==i.attribute.scaleX||0!==i.attribute.scaleY)){const e=i.AABBBounds;let u=e.x2-e.x1,d=e.y2-e.y1,p=e.x1-n,g=e.y1-s;if(i.attribute){const{scaleX:t=1,scaleY:e=1,angle:n=0}=i.attribute;u/=t,d/=e,p/=t,g/=e,(n||1!==t||1!==e)&&(p=null!==(r=i.x1WithoutTransform)&&void 0!==r?r:0,g=null!==(a=i.y1WithoutTransform)&&void 0!==a?a:0,u=null!==(o=i.widthWithoutTransform)&&void 0!==o?o:u,d=null!==(l=i.heightWithoutTransform)&&void 0!==l?l:d)}"linear"===c.gradient?h=function(t,e,i,n,s,r){var a,o,l,h;const c=t.createLinearGradient(i+(null!==(a=e.x0)&&void 0!==a?a:0)*s,n+(null!==(o=e.y0)&&void 0!==o?o:0)*r,i+(null!==(l=e.x1)&&void 0!==l?l:1)*s,n+(null!==(h=e.y1)&&void 0!==h?h:0)*r);return e.stops.forEach((t=>{c.addColorStop(t.offset,t.color)})),c}(t,c,p,g,u,d):"conical"===c.gradient?h=function(t,e,i,n,s,r){var a,o;const l=t.createConicGradient(i+(null!==(a=e.x)&&void 0!==a?a:0)*s,n+(null!==(o=e.y)&&void 0!==o?o:0)*r,e.startAngle,e.endAngle);return e.stops.forEach((t=>{l.addColorStop(t.offset,t.color)})),l.GetPattern?l.GetPattern(s+i,r+n,void 0):l}(t,c,p,g,u,d):"radial"===c.gradient&&(h=function(t,e,i,n,s,r){var a,o,l,h,c,u;const d=t.createRadialGradient(i+(null!==(a=e.x0)&&void 0!==a?a:.5)*s,n+(null!==(o=e.y0)&&void 0!==o?o:.5)*r,Math.max(s,r)*(null!==(l=e.r0)&&void 0!==l?l:0),i+(null!==(h=e.x1)&&void 0!==h?h:.5)*s,n+(null!==(c=e.y1)&&void 0!==c?c:.5)*r,Math.max(s,r)*(null!==(u=e.r1)&&void 0!==u?u:.5));return e.stops.forEach((t=>{d.addColorStop(t.offset,t.color)})),d}(t,c,p,g,u,d))}return h||"orange"}const Hs={horizontal:{width:"width",height:"height",left:"left",top:"top",x:"x",y:"y",bottom:"bottom"},vertical:{width:"height",height:"width",left:"top",top:"left",x:"y",y:"x",bottom:"right"}},Xs=!0,$s=!1,Ys=/\w|\(|\)|-/,qs=/[.?!,;:/,。?!、;:]/,Ks=/\S/,Zs=(t,e)=>{let i=e.fontSize||16;switch(e.script){case"super":case"sub":i*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:i,fontFamily:e.fontFamily})};function Js(t,e,i,n,s){if(t.length<=1)return 0;if(!e||e<=0)return 0;const r=sn.graphicUtil.textMeasure;let a=n,o=t.slice(0,a),l=Math.floor(r.measureText(o,i).width),h=t.slice(0,a+1),c=Math.floor(r.measureText(h,i).width);for(;l>e||c<=e;){if(l>e?a--:a++,a>t.length){a=t.length;break}if(a<0){a=0;break}o=t.slice(0,a),l=Math.floor(r.measureText(o,i).width),h=t.slice(0,a+1),c=Math.floor(r.measureText(h,i).width)}return s&&(a=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e;for(;Ys.test(t[n-1])&&Ys.test(t[n])||qs.test(t[n]);)if(n--,n<=0)return i?Qs(t,e):e;return n}(t,a)),a}function Qs(t,e){let i=e;for(;Ys.test(t[i+1])&&Ys.test(t[i])||qs.test(t[i]);)if(i++,i>=t.length)return i;return i+1}function tr(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"actual";var n;if(""===t)return{ascent:0,height:0,descent:0,width:0};const s=sn.graphicUtil.textMeasure.measureText(t,e),r={ascent:0,height:0,descent:0,width:0},a="actual"===i?s.actualBoundingBoxAscent:s.fontBoundingBoxAscent,o="actual"===i?s.actualBoundingBoxDescent:s.fontBoundingBoxDescent;"number"!=typeof a||"number"!=typeof o?(r.width=Math.floor(s.width),r.height=e.fontSize||0,r.ascent=r.height,r.descent=0):(r.width=Math.floor(s.width),r.height=Math.floor(a+o),r.ascent=Math.floor(a),r.descent=r.height-r.ascent);const l=null!==(n=e.space)&&void 0!==n?n:0;return r.width+=l,r}const er=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||ji,this.options=e,this.id=Si.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new Xi}load(t){const e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}get(t){const e=this._getNotAllArgs(t,!1);return this._get(e)}getAll(t){const e=this._getAllArgs(t);return this._get(e)}getTagged(t,e,i){const n=this._getNotAllArgs(t,!1,e,i);return this._get(n)}getNamed(t,e){return this.getTagged(t,wi,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new Hi(t,e),n=this._bindingDictionary.get(t)||[];return n.push(i),this._bindingDictionary.set(t,n),new Ki(i)}unbind(t){this._bindingDictionary.delete(t)}rebind(t){return this.unbind(t),this.bind(t)}_getContainerModuleHelpersFactory(){const t=(t,e)=>{t._binding.moduleId=e},e=e=>i=>{const n=this.bind(i);return t(n,e),n},i=()=>t=>this.unbind(t),n=()=>t=>this.isBound(t),s=e=>i=>{const n=this.rebind(i);return t(n,e),n};return t=>({bindFunction:e(t),isboundFunction:n(),rebindFunction:s(t),unbindFunction:i(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,i,n){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:n}}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_get(t){const e=[];return this._bindingDictionary.get(t.serviceIdentifier).filter((e=>e.constraint(t))).forEach((t=>{e.push(this._resolveFromBinding(t))})),t.isMultiInject||1!==e.length?e:e[0]}_getChildRequest(t){const e=t.implementationType,{userGeneratedMetadata:i}=this._metadataReader.getConstructorMetadata(e),n=Object.keys(i),s=[];for(let t=0;t<n.length;t++){const e=i[t],n={};e.forEach((t=>{n[t.key]=t.value}));const r={inject:n[Mi],multiInject:n.multi_inject},a=r.inject||r.multiInject,o={serviceIdentifier:a,constructorArgsMetadata:e},l=(this._bindingDictionary.get(a)||[]).filter((t=>t.constraint(o)));if(l.length){const t={injectIdentifier:a,metadata:e,bindings:l};s.push(t)}}return s}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case Ui:case zi:e=t.cache;break;case Gi:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}_resolveInstance(t,e){if(t.activated)return t.cache;const i=this._getChildRequest(t);return this._createInstance(e,i)}_createInstance(t,e){return e.length?new t(...this._resolveRequests(e)):new t}_resolveRequests(t){return t.map((t=>t.bindings.length>1?t.bindings.map((t=>this._resolveFromBinding(t))):this._resolveFromBinding(t.bindings[0])))}_saveToScope(t,e){t.scope===Fi&&(t.cache=e,t.activated=!0)}},ir=Symbol.for("CanvasFactory");function nr(t){return er.getNamed(ir,sn.global.env)(t)}const sr=1e-4,rr=Math.sqrt(3),ar=1/3;function or(t){return t>-xr&&t<xr}function lr(t){return t>xr||t<-xr}const hr=[0,0],cr=[0,0],ur=[0,0];function dr(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function pr(t,e,i,n){const s=1-n;return s*(s*t+2*n*e)+n*n*i}function gr(t,e,i,n,s){const r=1-s;return r*r*(r*t+3*s*e)+s*s*(s*n+3*r*i)}function fr(t){return(t%=at)<0&&(t+=at),t}function mr(t,e,i,n,s,r,a,o,l){if(0===a)return!1;const h=a;return!(l>e+h&&l>n+h&&l>r+h||l<e-h&&l<n-h&&l<r-h||o>t+h&&o>i+h&&o>s+h||o<t-h&&o<i-h&&o<s-h)&&function(t,e,i,n,s,r,a,o,l){let h=0,c=.005,u=1/0;hr[0]=a,hr[1]=o;for(let a=0;a<1;a+=.05){cr[0]=pr(t,i,s,a),cr[1]=pr(e,n,r,a);const o=dr(hr,cr);o<u&&(h=a,u=o)}u=1/0;for(let a=0;a<32&&!(c<sr);a++){const a=h-c,o=h+c;cr[0]=pr(t,i,s,a),cr[1]=pr(e,n,r,a);const l=dr(cr,hr);if(a>=0&&l<u)h=a,u=l;else{ur[0]=pr(t,i,s,o),ur[1]=pr(e,n,r,o);const a=dr(ur,hr);o<=1&&a<u?(h=o,u=a):c*=.5}}return l&&(l[0]=pr(t,i,s,h),l[1]=pr(e,n,r,h)),Math.sqrt(u)}(t,e,i,n,s,r,o,l,null)<=h/2}function yr(t,e,i,n,s,r,a,o,l,h,c){if(0===l)return!1;const u=l;return!(c>e+u&&c>n+u&&c>r+u&&c>o+u||c<e-u&&c<n-u&&c<r-u&&c<o-u||h>t+u&&h>i+u&&h>s+u&&h>a+u||h<t-u&&h<i-u&&h<s-u&&h<a-u)&&function(t,e,i,n,s,r,a,o,l,h,c){let u,d,p,g,f=0,m=.005,y=1/0;hr[0]=l,hr[1]=h;for(let l=0;l<1;l+=.05)cr[0]=gr(t,i,s,a,l),cr[1]=gr(e,n,r,o,l),p=dr(hr,cr),p<y&&(f=l,y=p);y=1/0;for(let l=0;l<32&&!(m<sr);l++)u=f-m,d=f+m,cr[0]=gr(t,i,s,a,u),cr[1]=gr(e,n,r,o,u),p=dr(cr,hr),u>=0&&p<y?(f=u,y=p):(ur[0]=gr(t,i,s,a,d),ur[1]=gr(e,n,r,o,d),g=dr(ur,hr),d<=1&&g<y?(f=d,y=g):m*=.5);return c&&(c[0]=gr(t,i,s,a,f),c[1]=gr(e,n,r,o,f)),Math.sqrt(y)}(t,e,i,n,s,r,a,o,h,c,null)<=u/2}function br(t,e,i,n,s,r,a,o,l){if(0===a)return!1;const h=a;o-=t,l-=e;const c=Math.sqrt(o*o+l*l);if(c-h>i||c+h<i)return!1;if(Math.abs(n-s)%at<1e-4)return!0;if(r){const t=n;n=fr(s),s=fr(t)}else n=fr(n),s=fr(s);n>s&&(s+=at);let u=Math.atan2(l,o);return u<0&&(u+=at),u>=n&&u<=s||u+at>=n&&u+at<=s}function vr(t,e,i,n,s,r,a){if(0===s)return!1;const o=s,l=s/2;let h=0,c=t;if(a>e+l&&a>n+l||a<e-l&&a<n-l||r>t+l&&r>i+l||r<t-l&&r<i-l)return!1;if(t===i)return Math.abs(r-t)<=o/2;h=(e-n)/(t-i),c=(t*n-i*e)/(t-i);const u=h*r-a+c;return u*u/(h*h+1)<=o/2*o/2}const xr=1e-4;function _r(t,e,i,n,s){const r=6*i-12*e+6*t,a=9*e+3*n-3*t-9*i,o=3*e-3*t;let l=0;if(or(a)){if(lr(r)){const t=-o/r;t>=0&&t<=1&&(s[l++]=t)}}else{const t=r*r-4*a*o;if(or(t))s[0]=-r/(2*a);else if(t>0){const e=Math.sqrt(t),i=(-r+e)/(2*a),n=(-r-e)/(2*a);i>=0&&i<=1&&(s[l++]=i),n>=0&&n<=1&&(s[l++]=n)}}return l}const Ar=[-1,-1,-1],Sr=[-1,-1];function Tr(){const t=Sr[0];Sr[0]=Sr[1],Sr[1]=t}function wr(t,e,i,n,s,r,a,o,l,h){if(h>e&&h>n&&h>r&&h>o||h<e&&h<n&&h<r&&h<o)return 0;const c=function(t,e,i,n,s,r){const a=n+3*(e-i)-t,o=3*(i-2*e+t),l=3*(e-t),h=t-s,c=o*o-3*a*l,u=o*l-9*a*h,d=l*l-3*o*h;let p=0;if(or(c)&&or(u))if(or(o))r[0]=0;else{const t=-l/o;t>=0&&t<=1&&(r[p++]=t)}else{const t=u*u-4*c*d;if(or(t)){const t=u/c,e=-o/a+t,i=-t/2;e>=0&&e<=1&&(r[p++]=e),i>=0&&i<=1&&(r[p++]=i)}else if(t>0){const e=Math.sqrt(t);let i=c*o+1.5*a*(-u+e),n=c*o+1.5*a*(-u-e);i=i<0?-Math.pow(-i,ar):Math.pow(i,ar),n=n<0?-Math.pow(-n,ar):Math.pow(n,ar);const s=(-o-(i+n))/(3*a);s>=0&&s<=1&&(r[p++]=s)}else{const t=(2*c*o-3*a*u)/(2*Math.sqrt(c*c*c)),e=Math.acos(t)/3,i=Math.sqrt(c),n=Math.cos(e),s=(-o-2*i*n)/(3*a),l=(-o+i*(n+rr*Math.sin(e)))/(3*a),h=(-o+i*(n-rr*Math.sin(e)))/(3*a);s>=0&&s<=1&&(r[p++]=s),l>=0&&l<=1&&(r[p++]=l),h>=0&&h<=1&&(r[p++]=h)}}return p}(e,n,r,o,h,Ar);if(0===c)return 0;let u=0,d=-1,p=0,g=0;for(let h=0;h<c;h++){const c=Ar[h],f=0===c||1===c?.5:1;gr(t,i,s,a,c)<l||(d<0&&(d=_r(e,n,r,o,Sr),Sr[1]<Sr[0]&&d>1&&Tr(),p=gr(e,n,r,o,Sr[0]),d>1&&(g=gr(e,n,r,o,Sr[1]))),2===d?c<Sr[0]?u+=p<e?f:-f:c<Sr[1]?u+=g<p?f:-f:u+=o<g?f:-f:c<Sr[0]?u+=p<e?f:-f:u+=o<p?f:-f)}return u}function Mr(t,e,i,n,s,r,a,o){if(o>e&&o>n&&o>r||o<e&&o<n&&o<r)return 0;const l=function(t,e,i,n,s){const r=t-2*e+i,a=2*(e-t),o=t-n;let l=0;if(or(r)){if(lr(a)){const t=-o/a;t>=0&&t<=1&&(s[l++]=t)}}else{const t=a*a-4*r*o;if(or(t)){const t=-a/(2*r);t>=0&&t<=1&&(s[l++]=t)}else if(t>0){const e=Math.sqrt(t),i=(-a+e)/(2*r),n=(-a-e)/(2*r);i>=0&&i<=1&&(s[l++]=i),n>=0&&n<=1&&(s[l++]=n)}}return l}(e,n,r,o,Ar);if(0===l)return 0;const h=function(t,e,i){const n=t+i-2*e;return 0===n?.5:(t-e)/n}(e,n,r);if(h>=0&&h<=1){let o=0;const c=pr(e,n,r,h);for(let n=0;n<l;n++){const l=0===Ar[n]||1===Ar[n]?.5:1;pr(t,i,s,Ar[n])<a||(Ar[n]<h?o+=c<e?l:-l:o+=r<c?l:-l)}return o}const c=0===Ar[0]||1===Ar[0]?.5:1;return pr(t,i,s,Ar[0])<a?0:r<e?c:-c}function Br(t,e,i,n,s,r,a,o){if((o-=e)>i||o<-i)return 0;const l=Math.sqrt(i*i-o*o);Ar[0]=-l,Ar[1]=l;const h=Math.abs(n-s);if(h<1e-4)return 0;if(h>=at-1e-4){n=0,s=at;const e=r?1:-1;return a>=Ar[0]+t&&a<=Ar[1]+t?e:0}if(n>s){const t=n;n=s,s=t}n<0&&(n+=at,s+=at);let c=0;for(let e=0;e<2;e++){const i=Ar[e];if(i+t>a){let t=Math.atan2(o,i),e=r?1:-1;t<0&&(t=at+t),(t>=n&&t<=s||t+at>=n&&t+at<=s)&&(t>nt/2&&t<1.5*nt&&(e=-e),c+=e)}}return c}function Cr(t){return Math.round(t/nt*1e8)/1e8%2*nt}function kr(t,e){let i=Cr(t[0]);i<0&&(i+=at);const n=i-t[0];let s=t[1];s+=n,!e&&s-i>=at?s=i+at:e&&i-s>=at?s=i-at:!e&&i>s?s=i+(at-Cr(i-s)):e&&i<s&&(s=i-(at-Cr(s-i))),t[0]=i,t[1]=s}const Pr=[0,0];function Or(t,e,i,n,s){const r=t,a=t.length;let o,l,h=0,c=0,u=0,d=0,p=0;for(let t=0;t<a;t++){const a=r[t],g=0===t;a[0]===gn.M&&t>1&&(i||(h+=Ut(c,u,d,p,n,s))),g&&(c=a[1],u=a[2],d=c,p=u);const f=a[0],m=a[1],y=a[2],b=a[3],v=a[4],x=a[5],_=a[6];let A=v,S=x;Pr[0]=A,Pr[1]=S,kr(Pr,Boolean(a[6])),A=Pr[0],S=Pr[1];const T=A,w=S-A,M=!!(1-(a[6]?0:1)),B=(n-m)*b/b+m;switch(f){case gn.M:d=m,p=y,c=d,u=p;break;case gn.L:if(i){if(vr(c,u,m,y,e,n,s))return!0}else h+=Ut(c,u,m,y,n,s)||0;c=m,u=y;break;case gn.C:if(i){if(yr(c,u,m,y,b,v,x,_,e,n,s))return!0}else h+=wr(c,u,m,y,b,v,x,_,n,s)||0;c=x,u=_;break;case gn.Q:if(i){if(mr(c,u,m,y,b,v,e,n,s))return!0}else h+=Mr(c,u,m,y,b,v,n,s)||0;c=b,u=v;break;case gn.A:if(o=Math.cos(T)*b+m,l=Math.sin(T)*b+y,g?(d=o,p=l):h+=Ut(c,u,o,l,n,s),i){if(br(m,y,b,T,T+w,M,e,B,s))return!0}else h+=Br(m,y,b,T,T+w,M,B,s);c=Math.cos(T+w)*b+m,u=Math.sin(T+w)*b+y;break;case gn.R:if(d=c=m,p=u=y,o=d+b,l=p+v,i){if(vr(d,p,o,p,e,n,s)||vr(o,p,o,l,e,n,s)||vr(o,l,d,l,e,n,s)||vr(d,l,d,p,e,n,s))return!0}else h+=Ut(o,p,o,l,n,s),h+=Ut(d,l,d,p,n,s);break;case gn.Z:if(i){if(vr(c,u,d,p,e,n,s))return!0}else h+=Ut(c,u,d,p,n,s);c=d,u=p}}return i||(g=u,f=p,Math.abs(g-f)<xr)||(h+=Ut(c,u,d,p,n,s)||0),0!==h;var g,f}const Rr=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=nr(Object.assign({nativeCanvas:sn.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=nr(Object.assign({nativeCanvas:sn.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(){this.pools=[]}},Lr={arc:Ms,area:Bs,circle:Cs,line:Os,path:Rs,symbol:Ds,text:Fs,rect:Es,polygon:Ls,star:Is,richtext:js,richtextIcon:Ns,image:Us,group:ks,glyph:Ps},Ir=Object.keys(Lr);function Er(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const Dr={arc:Object.assign({},Lr.arc),area:Object.assign({},Lr.area),circle:Object.assign({},Lr.circle),line:Object.assign({},Lr.line),path:Object.assign({},Lr.path),symbol:Object.assign({},Lr.symbol),text:Object.assign({},Lr.text),rect:Object.assign({},Lr.rect),polygon:Object.assign({},Lr.polygon),star:Object.assign({},Lr.star),richtext:Object.assign({},Lr.richtext),richtextIcon:Object.assign({},Lr.richtextIcon),image:Object.assign({},Lr.image),group:Object.assign({},Lr.group),glyph:Object.assign({},Lr.glyph)};class Fr{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},Ir.forEach((t=>{this._defaultTheme[t]=Object.create(Dr[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){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){const n=this.getParentWithTheme(t);if(n){const t=n.theme;(t.dirty||i)&&t.applyTheme(n,e,!0)}this.userTheme?this.doCombine(n&&n.theme.combinedTheme):(n?this.combinedTheme=n.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,$.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;Ir.forEach((n=>{const s=Object.create(Dr[n]);t&&t[n]&&Er(s,t[n]),i[n]&&Er(s,i[n]),e[n]&&Er(s,e[n]),this.combinedTheme[n]=s})),e.common&&Ir.forEach((t=>{Er(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))}))}}const jr=new Fr;function Ur(t,e){return t.glyphHost?Ur(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)):jr.getTheme()}return null}(t)||t.attachedThemeGraphic&&Ur(t.attachedThemeGraphic)||jr.getTheme()}var Nr=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function a(t){try{l(n.next(t))}catch(t){r(t)}}function o(t){try{l(n.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((n=n.apply(t,e||[])).next())}))};class Wr extends s{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=Si.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Nr(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];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){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&&$.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 n=this.insertInto(t,0);return this._ignoreWarn=!1,n}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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=null;return this.forEachChildren(((e,n)=>!(e===this||!t(e,n)||(i=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.find(t,!0);if(n)return i=n,!0}return!1})),i}findAll(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=[];return this.forEachChildren(((e,n)=>{e!==this&&t(e,n)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.findAll(t,!0);n.length&&(i=i.concat(n))}})),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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[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 n=a(i,!0)&&i||c(i)&&i.capture,s=c(i)&&i.once,r=o(e)?void 0:e;return t=n?`${t}capture`:t,e=o(e)?e:e.handleEvent,s?super.once(t,e,r):super.on(t,e,r),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,i){const n=a(i,!0)&&i||c(i)&&i.capture,s=o(e)?void 0:e;t=n?`${t}capture`:t,e=o(e)?e:e.handleEvent;const r=c(i)&&i.once;return super.off(t,e,s,r),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return c(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){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return super.emit(t.type,t,...i),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class zr{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=zr.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&&o(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&&o(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class Gr extends zr{constructor(t,e){super(),this.type=t,this.detail=e}}const Vr={dispatchEvent(t){var e;if(!(t instanceof zr))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 Gr(t,e))}};class Hr{static GetImage(t,e){var i;const n=Hr.cache.get(t);n?"fail"===n.loadState?sn.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,n.data):Hr.loadImage(t,e)}static GetSvg(t,e){var i;let n=Hr.cache.get(t);n?"fail"===n.loadState?sn.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,n.data):(n={type:"image",loadState:"init"},Hr.cache.set(t,n),n.dataPromise=sn.global.loadSvg(t),n.dataPromise?(n.waitingMark=[e],n.dataPromise.then((e=>{var i;n.loadState=(null==e?void 0:e.data)?"success":"fail",n.data=null==e?void 0:e.data,null===(i=n.waitingMark)||void 0===i||i.map(((i,s)=>{(null==e?void 0:e.data)?(n.loadState="success",n.data=e.data,i.imageLoadSuccess(t,e.data)):(n.loadState="fail",i.imageLoadFail(t))})),n.waitingMark&&(n.waitingMark=[])}))):(n.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=Hr.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"},Hr.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=sn.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=sn.global.loadBlob(t):"json"===e&&(i.dataPromise=sn.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!Hr.isLoading&&Hr.toLoadAueue.length){Hr.isLoading=!0;const t=Hr.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:n}=t,s={type:"image",loadState:"init"};if(Hr.cache.set(i,s),s.dataPromise=sn.global.loadImage(i),s.dataPromise){s.waitingMark=n;const t=s.dataPromise.then((t=>{var e;s.loadState=(null==t?void 0:t.data)?"success":"fail",s.data=null==t?void 0:t.data,null===(e=s.waitingMark)||void 0===e||e.map(((e,n)=>{(null==t?void 0:t.data)?(s.loadState="success",s.data=t.data,e.imageLoadSuccess(i,t.data)):(s.loadState="fail",e.imageLoadFail(i))})),s.waitingMark&&(s.waitingMark=[])}));e.push(t)}else s.loadState="fail",n.forEach((t=>t.imageLoadFail(i)))})),Promise.all(e).then((()=>{Hr.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Hr.loading()})).catch((t=>{console.error(t),Hr.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Hr.loading()}))}}),0)}static loadImage(t,e){const i=Xr(t,Hr.toLoadAueue);if(-1!==i)return Hr.toLoadAueue[i].marks.push(e),void Hr.loading();Hr.toLoadAueue.push({url:t,marks:[e]}),Hr.loading()}static improveImageLoading(t){const e=Xr(t,Hr.toLoadAueue);if(-1!==e){const t=Hr.toLoadAueue.splice(e,1);Hr.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function Xr(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return-1}var $r;Hr.cache=new Map,Hr.isLoading=!1,Hr.toLoadAueue=[],Hr.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"}($r||($r={}));const Yr=[!1,!1,!1,!1],qr=[0,0,0,0],Kr=t=>t?g(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(qr[0]=t[0],qr[2]=t[0],qr[1]=t[1],qr[3]=t[1],qr):t:t:0,Zr=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Jr=[1,2,3,0,1,2,3,0];function Qr(t,e,i,n){for(;t>=at;)t-=at;for(;t<0;)t+=at;for(;t>e;)e+=at;Zr[0].x=i,Zr[1].y=i,Zr[2].x=-i,Zr[3].y=-i;const s=Math.ceil(t/st)%4,r=Math.ceil(e/st)%4;if(n.add(ht(t)*i,dt(t)*i),n.add(ht(e)*i,dt(e)*i),s!==r||e-t>nt){let t=!1;for(let e=0;e<Jr.length;e++)if(t||s!==Jr[e]){if(t&&r===Jr[e])break;if(t){const t=Zr[Jr[e]];n.add(t.x,t.y)}}else{t=!0;const e=Zr[s];n.add(e.x,e.y)}}}function ta(t,e,i){const{x:n,y:s}=mt(t.x,t.y,e.x,e.y,i),{x:r,y:a}=mt(t.x1,t.y1,e.x1,e.y1,i),o=new bt(n,s,r,a);return o.defined=e.defined,o}function ea(t,e,i){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);let n=[];if(t.length>e.length){n=e.map((t=>{const e=new bt(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let s=0;s<e.length;s++)n[s]=ta(t[s],e[s],i)}else{n=e.map((t=>{const e=new bt(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let s=0;s<t.length;s++)n[s]=ta(t[s],e[s],i)}return n}const ia=(t,e)=>{const i=((t,e)=>p(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t)(t,e);return isNaN(i)?i:Math.max(e,i)};class na{bounds(t,e){if(y(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 y(t)?t:Math.min(t[0],t[1])}}function sa(t,e,i,n,s){return s?t.arc(i,n,e,0,rt,!1,s):t.arc(i,n,e,0,rt),!1}var ra=new class extends na{constructor(){super(...arguments),this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}draw(t,e,i,n,s){return sa(t,this.parseSize(e)/2,i,n,s)}drawOffset(t,e,i,n,s,r){return sa(t,this.parseSize(e)/2+s,i,n,r)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i} a ${s},${s} 0 1,0 ${2*s},0 a ${s},${s} 0 1,0 -${2*s},0`}};var aa=new class extends na{constructor(){super(...arguments),this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}draw(t,e,i,n,s){return function(t,e,i,n,s){return t.moveTo(-3*e+i,-e+n,s),t.lineTo(-e+i,-e+n,s),t.lineTo(-e+i,-3*e+n,s),t.lineTo(e+i,-3*e+n,s),t.lineTo(e+i,-e+n,s),t.lineTo(3*e+i,-e+n,s),t.lineTo(3*e+i,e+n,s),t.lineTo(e+i,e+n,s),t.lineTo(e+i,3*e+n,s),t.lineTo(-e+i,3*e+n,s),t.lineTo(-e+i,e+n,s),t.lineTo(-3*e+i,e+n,s),t.closePath(),!0}(t,this.parseSize(e)/6,i,n,s)}drawOffset(t,e,i,n,s,r){return function(t,e,i,n,s,r){return t.moveTo(-3*e+i-s,-e+n-s,r),t.lineTo(-e+i-s,-e+n-s,r),t.lineTo(-e+i-s,-3*e+n-s,r),t.lineTo(e+i+s,-3*e+n-s,r),t.lineTo(e+i+s,-e+n-s,r),t.lineTo(3*e+i+s,-e+n-s,r),t.lineTo(3*e+i+s,e+n+s,r),t.lineTo(e+i+s,e+n+s,r),t.lineTo(e+i+s,3*e+n+s,r),t.lineTo(-e+i-s,3*e+n+s,r),t.lineTo(-e+i-s,e+n+s,r),t.lineTo(-3*e+i-s,e+n+s,r),t.closePath(),!0}(t,this.parseSize(e)/6,i,n,s,r)}};function oa(t,e,i,n,s){return t.moveTo(i,n-e,s),t.lineTo(e+i,n,s),t.lineTo(i,n+e,s),t.lineTo(i-e,n,s),t.closePath(),!0}var la=new class extends na{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,n,s){return oa(t,this.parseSize(e)/2,i,n,s)}drawFitDir(t,e,i,n,s){return oa(t,this.parseSize(e)/2,i,n,s)}drawOffset(t,e,i,n,s,r){return oa(t,this.parseSize(e)/2+s,i,n,r)}};function ha(t,e,i,n){const s=2*e;return t.rect(i-e,n-e,s,s),!1}var ca=new class extends na{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return ha(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return ha(t,this.parseSize(e)/2+s,i,n)}};function ua(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i+e+2*s,e+n+s),t.lineTo(i-e-2*s,e+n+s),t.lineTo(i,n-e-2*s),t.closePath(),!0}class da extends na{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,i,n){return ua(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return ua(t,this.parseSize(e)/2,i,n,s)}}var pa=new da;var ga=new class extends da{constructor(){super(...arguments),this.type="triangle"}};const fa=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),ma=Math.sin(rt/10)*fa,ya=-Math.cos(rt/10)*fa;function ba(t,e,i,n){const s=ma*e,r=ya*e;t.moveTo(i,-e+n),t.lineTo(s+i,r+n);for(let a=1;a<5;++a){const o=rt*a/5,l=Math.cos(o),h=Math.sin(o);t.lineTo(h*e+i,-l*e+n),t.lineTo(l*s-h*r+i,h*s+l*r+n)}return t.closePath(),!0}var va=new class extends na{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,n){return ba(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return ba(t,this.parseSize(e)/2+s,i,n)}};const xa=pt(3);function _a(t,e,i,n){const s=e,r=s/xa,a=r/5,o=e;return t.moveTo(0+i,-s+n),t.lineTo(r/2+i,n),t.lineTo(a/2+i,n),t.lineTo(a/2+i,o+n),t.lineTo(-a/2+i,o+n),t.lineTo(-a/2+i,n),t.lineTo(-r/2+i,n),t.closePath(),!0}var Aa=new class extends na{constructor(){super(...arguments),this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}draw(t,e,i,n){return _a(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return _a(t,this.parseSize(e)/2+s,i,n)}};function Sa(t,e,i,n){const s=2*e;return t.moveTo(i,-e+n),t.lineTo(s/3/2+i,e+n),t.lineTo(-s/3/2+i,e+n),t.closePath(),!0}var Ta=new class extends na{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,n){return Sa(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Sa(t,this.parseSize(e)/2+s,i,n)}};function wa(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var Ma=new class extends na{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,n){return wa(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return wa(t,this.parseSize(e)/2+s,i,n)}};const Ba=-.5,Ca=pt(3)/2,ka=1/pt(12);function Pa(t,e,i,n){const s=e/2,r=e*ka,a=s,o=e*ka+e,l=-a,h=o;return t.moveTo(s+i,r+n),t.lineTo(a+i,o+n),t.lineTo(l+i,h+n),t.lineTo(Ba*s-Ca*r+i,Ca*s+Ba*r+n),t.lineTo(Ba*a-Ca*o+i,Ca*a+Ba*o+n),t.lineTo(Ba*l-Ca*h+i,Ca*l+Ba*h+n),t.lineTo(Ba*s+Ca*r+i,Ba*r-Ca*s+n),t.lineTo(Ba*a+Ca*o+i,Ba*o-Ca*a+n),t.lineTo(Ba*l+Ca*h+i,Ba*h-Ca*l+n),t.closePath(),!1}var Oa=new class extends na{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,n){return Pa(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Pa(t,this.parseSize(e)/2+s,i,n)}};function Ra(t,e,i,n,s){return t.moveTo(-e+i-2*s,n),t.lineTo(e+i+s,e+n+2*s),t.lineTo(e+i+s,n-e-2*s),t.closePath(),!0}var La=new class extends na{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,i,n){return Ra(t,this.parseSize(e)/2,i,n,0)}drawOffset(t,e,i,n,s){return Ra(t,this.parseSize(e)/2,i,n,s)}};function Ia(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i-e-s,e+n+2*s),t.lineTo(e+i+2*s,n),t.lineTo(i-e-s,n-e-2*s),t.closePath(),!0}var Ea=new class extends na{constructor(){super(...arguments),this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,i,n){return Ia(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Ia(t,this.parseSize(e)/2,i,n,s)}};function Da(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i-e-2*s,n-e-s),t.lineTo(i+e+2*s,n-e-s),t.lineTo(i,n+e+2*s),t.closePath(),!0}var Fa=new class extends na{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,i,n){return Da(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Da(t,this.parseSize(e)/2,i,n,s)}};const ja=pt(3);function Ua(t,e,i,n){const s=e*ja;return t.moveTo(i,n+-s/3*2),t.lineTo(e+i,n+s),t.lineTo(i-e,n+s),t.closePath(),!0}var Na=new class extends na{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,n){return Ua(t,this.parseSize(e)/2/ja,i,n)}drawOffset(t,e,i,n,s){return Ua(t,this.parseSize(e)/2/ja+s,i,n)}};function Wa(t,e,i,n){const s=2*e;return t.moveTo(e+i,n-s),t.lineTo(i-e,n),t.lineTo(e+i,s+n),!0}var za=new class extends na{constructor(){super(...arguments),this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,i,n){return Wa(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Wa(t,this.parseSize(e)/4+s,i,n)}};function Ga(t,e,i,n){const s=2*e;return t.moveTo(i-e,n-s),t.lineTo(i+e,n),t.lineTo(i-e,s+n),!0}var Va=new class extends na{constructor(){super(...arguments),this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,i,n){return Ga(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Ga(t,this.parseSize(e)/4+s,i,n)}};function Ha(t,e,i,n){const s=2*e;return t.moveTo(i-s,n+e),t.lineTo(i,n-e),t.lineTo(i+s,n+e),!0}var Xa=new class extends na{constructor(){super(...arguments),this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,i,n){return Ha(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Ha(t,this.parseSize(e)/4+s,i,n)}};function $a(t,e,i,n){const s=2*e;return t.moveTo(i-s,n-e),t.lineTo(i,n+e),t.lineTo(i+s,n-e),!0}var Ya=new class extends na{constructor(){super(...arguments),this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,i,n){return $a(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return $a(t,this.parseSize(e)/4+s,i,n)}};function qa(t,e,i,n,s){return t.moveTo(i,n-e),t.lineTo(i,n+e),!0}var Ka=new class extends na{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,n,s){return qa(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return qa(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e}, ${i-s} L ${e},${i+s}`}};function Za(t,e,i,n,s){return t.moveTo(i-e,n),t.lineTo(i+e,n),!0}var Ja=new class extends na{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,n,s){return Za(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return Za(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i} L ${e+s},${i}`}};function Qa(t,e,i,n,s){return t.moveTo(i-e,n-e),t.lineTo(i+e,n+e),t.moveTo(i+e,n-e),t.lineTo(i-e,n+e),!0}var to=new class extends na{constructor(){super(...arguments),this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,i,n,s){return Qa(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return Qa(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i-s} L ${e+s},${i+s} M ${e+s}, ${i-s} L ${e-s},${i+s}`}};function eo(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}function io(t,e,i,n){const s=e,r=e/2;return t.rect(i-s/2,n-r/2,s,r),!1}var no=new class extends na{constructor(){super(...arguments),this.type="rect",this.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z"}draw(t,e,i,n){return y(e)?io(t,e,i,n):eo(t,e,i,n)}drawWithClipRange(t,e,i,n,s,r,a){y(e)&&(e=[e,e/2]);const o=2*(e[0]+e[1])*s,l=[{x:i+e[0]/2,y:n-e[1]/2},{x:i+e[0]/2,y:n+e[1]/2},{x:i-e[0]/2,y:n+e[1]/2},{x:i-e[0]/2,y:n-e[1]/2}];let h=0,c=l[3];t.moveTo(c.x,c.y);for(let e=0;e<l.length;e++){const i=l[e],n=Math.sqrt((i.x-c.x)*(i.x-c.x)+(i.y-c.y)*(i.y-c.y));if(h+n>o){const e=(i.x-c.x)*(o-h)/n,s=(i.y-c.y)*(o-h)/n;t.lineTo(c.x+e,c.y+s);break}t.lineTo(i.x,i.y),c=i,h+=n}return!1}drawOffset(t,e,i,n,s){return y(e)?io(t,e+2*s,i,n):eo(t,[e[0]+2*s,e[1]+2*s],i,n)}};const so=new Xt;class ro{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.pathStr="",this.type=t,g(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,n,s,r,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((s=>{t.beginPath(),Pn(s.path.commandList,t,i,n,e,e),a&&a(s.path,s.attribute)})),!1):(Pn(this.path.commandList,t,i,n,e+s,e+s),!1)}draw(t,e,i,n,s,r){return e=this.parseSize(e),this.drawOffset(t,e,i,n,0,s,r)}parseSize(t){return y(t)?t:Math.min(t[0],t[1])}drawWithClipRange(t,e,i,n,s,r,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{r.path.drawWithClipRange(t,e,i,n,s),a&&a(r.path,r.attribute)})),!1):(this.path.drawWithClipRange(t,e,i,n,s),!1)}bounds(t,e){if(t=this.parseSize(t),this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((i=>{let{path:n}=i;so.x1=n.bounds.x1*t,so.y1=n.bounds.y1*t,so.x2=n.bounds.x2*t,so.y2=n.bounds.y2*t,e.union(so)}))}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 ao={};[ra,aa,la,ca,Na,ga,va,Aa,Ta,Ma,Oa,La,Ea,pa,Fa,za,Va,Xa,Ya,no,Ka,Ja,to].forEach((t=>{ao[t.type]=t}));const oo={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 lo{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 ho(t,e,i,n){const s=t.indexOf(e,i);if(-1===s)throw new Error(n);return s+e.length-1}function co(t,e,i){const n=function(t,e){let i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",s="";for(let r=e;r<t.length;r++){let e=t[r];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:s,index:r};if(t[r+1]===n[1])return{data:s,index:r}}else"\t"===e&&(e=" ");s+=e}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(!n)return;let s=n.data;const r=n.index,a=s.search(/\s/);let o=s,l=!0;-1!==a&&(o=s.substr(0,a).replace(/\s\s*$/,""),s=s.substr(a+1));const h=o;if(i){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1),l=o!==n.data.substr(t+1))}return{tagName:o,tagExp:s,closeIndex:r,attrExpPresent:l,rawTagName:h}}const uo=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class po{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,i){const n=e.tagname;"string"==typeof n?(e.tagname=n,t.addChild(e)):t.addChild(e)}buildAttributesMap(t,e,i){const n={};if(!t)return;const s=function(t,e){const i=[];let n=e.exec(t);for(;n;){const s=[];s.startIndex=e.lastIndex-n[0].length;const r=n.length;for(let t=0;t<r;t++)s.push(n[t]);i.push(s),n=e.exec(t)}return i}(t,uo),r=s.length;for(let t=0;t<r;t++){const e=s[t][1],i=s[t][4];e&&(n[e]=void 0===i||(isNaN(i)?i:Number(i)))}return n}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new lo("!xml");let i=e,n="",s="";for(let r=0;r<t.length;r++)if("<"===t[r])if("/"===t[r+1]){const e=ho(t,">",r,"Closing Tag is not closed."),a=s.lastIndexOf(".");s=s.substring(0,a),i=this.tagsNodeStack.pop(),i&&i.child&&n&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=n),n="",r=e}else if("?"===t[r+1])r=co(t,r,!1,"?>").closeIndex+1;else if("!--"===t.substr(r+1,3))r=ho(t,"--\x3e",r+4,"Comment is not closed.");else{const a=co(t,r,!1);let o=a.tagName,l=a.tagExp;const h=a.attrExpPresent,c=a.closeIndex;if(o!==e.tagname&&(s+=s?"."+o:o),l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===o[o.length-1]?(o=o.substr(0,o.length-1),s=s.substr(0,s.length-1),l=o):l=l.substr(0,l.length-1);const t=new lo(o);o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,s,o)),this.addChild(i,t,s),s=s.substr(0,s.lastIndexOf("."))}else{const t=new lo(o);this.tagsNodeStack.push(i),o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,s,o)),this.addChild(i,t,s),i=t}n="",r=c}else n+=t[r];return e.child}}function go(t,e){return fo(t)}function fo(t,e){const i={};for(let e=0;e<t.length;e++){const s=t[e],r=mo(s);if(void 0!==r&&s[r]){const t=fo(s[r]);n=t,Object.keys(n).length,s[":@"]&&yo(t,s[":@"]),void 0!==i[r]&&i.hasOwnProperty(r)?(Array.isArray(i[r])||(i[r]=[i[r]]),i[r].push(t)):i[r]=t}}var n;return i}function mo(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function yo(t,e,i){if(e){const i=Object.keys(e),n=i.length;for(let s=0;s<n;s++){const n=i[s];t[n]=e[n]}}}class bo{constructor(t){this.options=Object.assign({},bo.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return go(new po(this.options).parseXml(t),this.options)}}function vo(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+(n/2+(i?function(t,e){return t?e:0}(i,e):0))),t}bo.defaultOptions={};let xo=0;function _o(){return xo++}var Ao;!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(Ao||(Ao={}));const So=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>So.set(t,!0)));const To=new Map;function wo(t){if(So.has(t))return!0;if(To.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>To.set(t,!0)));const Mo=_o(),Bo=_o(),Co=_o();_o(),_o();const ko=_o(),Po=_o(),Oo=_o(),Ro=_o(),Lo=_o(),Io=_o(),Eo=_o(),Do=_o(),Fo=_o();_o();const jo=_o(),Uo=_o(),No=Symbol.for("GraphicCreator"),Wo={"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"},zo=Object.keys(Wo),Go={duration:200,easing:"cubicOut"};function Vo(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 Ho(t,e,i){const n=i[0],s=i[1],r=i[2];let a,o,l,h,c,u,d,p,g,f,m,y;return e===t?(t[12]=e[0]*n+e[4]*s+e[8]*r+e[12],t[13]=e[1]*n+e[5]*s+e[9]*r+e[13],t[14]=e[2]*n+e[6]*s+e[10]*r+e[14],t[15]=e[3]*n+e[7]*s+e[11]*r+e[15]):(a=e[0],o=e[1],l=e[2],h=e[3],c=e[4],u=e[5],d=e[6],p=e[7],g=e[8],f=e[9],m=e[10],y=e[11],t[0]=a,t[1]=o,t[2]=l,t[3]=h,t[4]=c,t[5]=u,t[6]=d,t[7]=p,t[8]=g,t[9]=f,t[10]=m,t[11]=y,t[12]=a*n+c*s+g*r+e[12],t[13]=o*n+u*s+f*r+e[13],t[14]=l*n+d*s+m*r+e[14],t[15]=h*n+p*s+y*r+e[15]),t}function Xo(t,e,i){const n=e[0],s=e[1],r=e[2],a=e[3],o=e[4],l=e[5],h=e[6],c=e[7],u=e[8],d=e[9],p=e[10],g=e[11],f=e[12],m=e[13],y=e[14],b=e[15];let v=i[0],x=i[1],_=i[2],A=i[3];return t[0]=v*n+x*o+_*u+A*f,t[1]=v*s+x*l+_*d+A*m,t[2]=v*r+x*h+_*p+A*y,t[3]=v*a+x*c+_*g+A*b,v=i[4],x=i[5],_=i[6],A=i[7],t[4]=v*n+x*o+_*u+A*f,t[5]=v*s+x*l+_*d+A*m,t[6]=v*r+x*h+_*p+A*y,t[7]=v*a+x*c+_*g+A*b,v=i[8],x=i[9],_=i[10],A=i[11],t[8]=v*n+x*o+_*u+A*f,t[9]=v*s+x*l+_*d+A*m,t[10]=v*r+x*h+_*p+A*y,t[11]=v*a+x*c+_*g+A*b,v=i[12],x=i[13],_=i[14],A=i[15],t[12]=v*n+x*o+_*u+A*f,t[13]=v*s+x*l+_*d+A*m,t[14]=v*r+x*h+_*p+A*y,t[15]=v*a+x*c+_*g+A*b,t}function $o(t,e,i){const n=e[0],s=e[1],r=e[2];let a=i[3]*n+i[7]*s+i[11]*r+i[15];return a=a||1,t[0]=(i[0]*n+i[4]*s+i[8]*r+i[12])/a,t[1]=(i[1]*n+i[5]*s+i[9]*r+i[13])/a,t[2]=(i[2]*n+i[6]*s+i[10]*r+i[14])/a,t}class Yo{constructor(){this.pools=[]}static identity(t){return Vo(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 Yo.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(){this.pools=[]}}const qo=new class{constructor(){this.pools=[]}allocate(t,e,i,n,s,r){if(!this.pools.length)return new Yt(t,e,i,n,s,r);const a=this.pools.pop();return a.a=t,a.b=e,a.c=i,a.d=n,a.e=s,a.f=r,a}allocateByObj(t){if(!this.pools.length)return new Yt(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(){this.pools=[]}},Ko=new Yo;var Zo=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Jo=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const Qo=new Yt(1,0,0,1,0,0),tl={x:0,y:0};let el=class{get nativeContext(){return this.path}constructor(t,e){this.matrix=new Yt(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Yt(1,0,0,1,0,0),this.path=new ms,this._clearMatrix=new Yt(1,0,0,1,0,0)}getCanvas(){throw new Error("不支持getCanvas")}getContext(){throw new Error("不支持getContext")}setTransformForCurrent(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}get currentMatrix(){return this.matrix}cloneMatrix(t){return qo.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}reset(){this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new Yt(1,0,0,1,0,0),this.stack.length=0}restore(){this.stack.length>0&&(qo.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(qo.free(this.matrix),this.matrix=this.stack.pop())}rotate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];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){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,n){let s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(i,n,!1),this.scale(t,e,!1),this.translate(-i,-n,!1),s&&this.setTransformForCurrent()}setTransform(t,e,i,n,s,r){let a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(o*t,o*e,o*i,o*n,o*s,o*r),a&&this.setTransformForCurrent()}setTransformFromMatrix(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]: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(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,n,s,r){let a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,i,n,s,r),a&&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){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}beginPath(){this.path.clear()}clip(t,e){}arc(t,e,i,n,s,r){this.path.arc(t,e,i,n,s,r)}arcTo(t,e,i,n,s){this.path.arcTo(t,e,i,n,s)}bezierCurveTo(t,e,i,n,s,r){this.path.bezierCurveTo(t,e,i,n,s,r)}closePath(){this.path.closePath()}ellipse(t,e,i,n,s,r,a,o){}lineTo(t,e){this.path.lineTo(t,e)}moveTo(t,e){this.path.moveTo(t,e)}quadraticCurveTo(t,e,i,n){this.path.quadraticCurveTo(t,e,i,n)}rect(t,e,i,n){this.path.rect(t,e,i,n)}createImageData(t,e){return null}createLinearGradient(t,e,i,n){throw new Error("不支持createLinearGradient")}createPattern(t,e){throw new Error("不支持createPattern")}createRadialGradient(t,e,i,n,s,r){throw new Error("不支持createRadialGradient")}createConicGradient(t,e,i,n){return null}fill(t,e){}fillRect(t,e,i,n){this.path.rect(t,e,i,n)}clearRect(t,e,i,n){}fillText(t,e,i){}getImageData(t,e,i,n){return null}getLineDash(){return[]}isPointInPath(t,e){return this.matrix.transformPoint({x:t,y:e},tl),function(t,e,i){return Or(t,0,!1,e,i)}(this.path.commandList,tl.x,tl.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},tl);const i=Gs(this,this.lineWidth,this.dpr);return function(t,e,i,n){return Or(t,e,!0,i,n)}(this.path.commandList,i,tl.x,tl.y)}measureText(t){throw new Error("不支持measureText")}putImageData(t,e,i){throw new Error("不支持measureText")}setLineDash(t){}stroke(t){}strokeRect(t,e,i,n){this.path.rect(t,e,i,n)}strokeText(t,e,i){}drawImage(){}setCommonStyle(t,e,i,n,s){}_setCommonStyle(t,e,i,n){}setStrokeStyle(t,e,i,n,s){}_setStrokeStyle(t,e,i,n){}setTextStyleWithoutAlignBaseline(t,e){}setTextStyle(t,e){}draw(){}clearMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(Qo,t,e)}setClearMatrix(t,e,i,n,s,r){this._clearMatrix.setValue(t,e,i,n,s,r)}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(){this.stack.forEach((t=>qo.free(t))),this.stack.length=0}};var il;el=Zo([Ei(),Jo("design:paramtypes",[Object,Number])],el),function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(il||(il={}));class nl{static Get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:il.Color1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(e===il.Color1){const e=nl.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;const n=re.parseColorString(t);if(n){const e=[n.r/255,n.g/255,n.b/255,n.opacity];nl.store1[t]=e,nl.store255[t]=[n.r,n.g,n.b,n.opacity],i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3]}return i}const n=nl.store255[t];if(n)return i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=n[3],i;const s=re.parseColorString(t);return s&&(nl.store1[t]=[s.r/255,s.g/255,s.b/255,s.opacity],nl.store255[t]=[s.r,s.g,s.b,s.opacity],i[0]=s.r,i[1]=s.g,i[2]=s.b,i[3]=s.opacity),i}static Set(t,e,i){if(e===il.Color1){if(nl.store1[t])return;nl.store1[t]=i,nl.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(nl.store255[t])return;nl.store255[t]=i,nl.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function sl(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)&&y(t[0])?e?`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])},${t[3].toFixed(2)})`:`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])})`:t}function rl(t,e,i,n,s){return Array.isArray(t)&&!y(t[0])||Array.isArray(e)&&!y(e[0])?new Array(4).fill(0).map(((s,r)=>{var a,o;return al(g(t)?null!==(a=t[r])&&void 0!==a?a:t[0]:t,g(e)?null!==(o=e[r])&&void 0!==o?o:e[0]:e,i,n)})):al(t,e,i,n,s)}function al(t,e,i,n,s){if(!t||!e)return t&&sl(t)||e&&sl(e)||!1;let r,a,o=!1,l=!1;if(Array.isArray(t)?r=t:"string"==typeof t?r=nl.Get(t,il.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=nl.Get(e,il.Color255):l=!0,o!==l){const r=o?t:e,a=o?e:t,l=Object.assign(Object.assign({},r),{stops:r.stops.map((t=>Object.assign(Object.assign({},t),{color:sl(a)})))});return o?rl(r,l,i,n,s):rl(l,r,i,n,s)}if(o){if(t.gradient===e.gradient){const n=t,s=e,r=n.stops,a=s.stops;if(r.length!==a.length)return!1;if("linear"===n.gradient)return function(t,e,i){const n=t.stops,s=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:cl(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i);if("radial"===n.gradient)return function(t,e,i){const n=t.stops,s=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,r0:t.r0+(e.r0-t.r0)*i,r1:t.r1+(e.r1-t.r1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:cl(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i);if("conical"===n.gradient)return function(t,e,i){const n=t.stops,s=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*i,endAngle:t.endAngle+(e.endAngle-t.endAngle)*i,x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:cl(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i)}return!1}return s&&s(r,a),sl(function(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}(r,a,i),n)}function ol(t,e,i){return`rgba(${t[0]+(e[0]-t[0])*i},${t[1]+(e[1]-t[1])*i},${t[2]+(e[2]-t[2])*i},${t[3]+(e[3]-t[3])*i})`}nl.store255={},nl.store1={};const ll=[0,0,0,0],hl=[0,0,0,0];function cl(t,e,i){return nl.Get(t,il.Color255,ll),nl.Get(e,il.Color255,hl),`rgba(${Math.round(ll[0]+(hl[0]-ll[0])*i)},${Math.round(ll[1]+(hl[1]-ll[1])*i)},${Math.round(ll[2]+(hl[2]-ll[2])*i)},${ll[3]+(hl[3]-ll[3])*i})`}const ul=new Xt,dl=new Yt;new Xt;const pl=["lineWidth","scaleX","scaleY","angle","anchor","visible"],gl=["x","y"],fl=["scaleX","scaleY"],ml=["angle"],yl=new bt,bl={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 vl extends Wr{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const n=e[i];Object.defineProperty(vl.prototype,n,Object.getOwnPropertyDescriptor(t,n))}}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)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;super(),this._AABBBounds=new Xt,this._updateTag=_n.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.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic)}getGraphicService(){var t,e;return null!==(e=null===(t=this.stage)||void 0===t?void 0:t.graphicService)&&void 0!==e?e:sn.graphicService}getAttributes(){return this.attribute}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var i,n;const{dx:s=t.dx,dy:r=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;yl.x=s+(null!==(i=t.scrollX)&&void 0!==i?i:0),yl.y=r+(null!==(n=t.scrollY)&&void 0!==n?n:0)}else yl.x=s,yl.y=r;return yl}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(){const t="imprecise"===this.attribute.boundsMode;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 $t),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=ao[t];if(e)return e;if(e=vl.userSymbolMap[t],e)return e;if(!0===((i=t=oo[t]||t).startsWith("<svg")||i.startsWith("<?xml"))){const e=new bo,{svg:i}=e.parse(t);if(!i)return null;const n=g(i.path)?i.path:[i.path];ul.clear();const s=[];n.forEach((t=>{const e=(new ms).fromString(t.d),i={};zo.forEach((e=>{t[e]&&(i[Wo[e]]=t[e])})),s.push({path:e,attribute:i}),ul.union(e.bounds)}));const r=ul.width(),a=ul.height(),o=1/ct(r,a);s.forEach((t=>t.path.transform(0,0,o,o)));const l=new ro(t,s,!0);return vl.userSymbolMap[t]=l,l}var i;const n=(new ms).fromString(t),s=n.bounds.width(),r=n.bounds.height(),a=1/ct(s,r);n.transform(0,0,a,a);const o=new ro(t,n);return vl.userSymbolMap[t]=o,o}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const i=this.attribute,n=this.updateAABBBounds(i,e,this._AABBBounds,t),{boundsPadding:s=e.boundsPadding}=i,r=Kr(s);return r&&n.expand(r),this.clearUpdateBoundTag(),n}updatePathProxyAABBBounds(t){const e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const i=new cn(t);return Pn(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(){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(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._transMatrix||(this._transMatrix=new Yt),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&_n.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&this.getGraphicService().validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&_n.UPDATE_BOUNDS)&&this.getGraphicService().validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&_n.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&_n.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&_n.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&_n.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=_n.CLEAR_SHAPE}containsPoint(t,e,i,n){if(!n)return!1;if(i===An.GLOBAL){const i=new bt(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),t=i.x,e=i.y}return n.containsPoint(this,{x:t,y:e})}setWidthHeightWithoutTransform(t){this.widthWithoutTransform=t.x2-t.x1,this.heightWithoutTransform=t.y2-t.y1}setAttributesAndPreventAnimate(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;this.setAttributes(t,e,i),this.animates&&this.animates.forEach((e=>{Object.keys(t).forEach((t=>{e.preventAttr(t)}))}))}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,i)}_setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;const n=Object.keys(t);for(let e=0;e<n.length;e++){const i=n[e];this.attribute[i]=t[i]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}setAttribute(t,e,i,n){var s;const r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);r?this._setAttributes(r,i,n):l(null===(s=this.normalAttrs)||void 0===s?void 0:s[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n)):this.normalAttrs[t]=e,"background"===t?this.loadImage(e,!0):"shadowGraphic"===t&&this.setShadowGraphic(e)}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pl;for(let i=0;i<e.length;i++){const n=e[i];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pl;for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(t){const e={type:Sn.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._updateTag=_n.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var i,n;if(0===t&&0===e)return this;const s={type:Sn.TRANSLATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,gl,s);r&&(t=r.x,e=r.y,delete r.x,delete r.y,this._setAttributes(r));const a=this.attribute,o=a.postMatrix;return o?sn.transformUtil.fromMatrix(o,o).translate(t,e):(a.x=(null!==(i=a.x)&&void 0!==i?i:vs.x)+t,a.y=(null!==(n=a.y)&&void 0!==n?n:vs.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}translateTo(t,e){const i=this.attribute;if(i.x===t&&i.y===e)return this;const n={type:Sn.TRANSLATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,gl,n);return s?(this._setAttributes(s,!1,n),this):(i.x=t,i.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}scale(t,e,i){var n,s;if(1===t&&1===e)return this;const r={type:Sn.SCALE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:i},this.attribute,fl,r);a&&(t=a.scaleX,e=a.scaleY,delete a.scaleX,delete a.scaleY,this._setAttributes(a));const o=this.attribute;if(i){let{postMatrix:n}=this.attribute;n||(n=new Yt,o.postMatrix=n),sn.transformUtil.fromMatrix(n,n).scale(t,e,i)}else o.scaleX=(null!==(n=o.scaleX)&&void 0!==n?n:vs.scaleX)*t,o.scaleY=(null!==(s=o.scaleY)&&void 0!==s?s:vs.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}scaleTo(t,e){const i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;const n={type:Sn.SCALE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,fl,n);return s?(this._setAttributes(s,!1,n),this):(i.scaleX=t,i.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}rotate(t,e){var i;if(0===t)return this;const n={type:Sn.ROTATE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,ml,n);s&&(delete s.angle,this._setAttributes(s,!1,n));const r=this.attribute;if(e){let{postMatrix:i}=this.attribute;i||(i=new Yt,r.postMatrix=i),sn.transformUtil.fromMatrix(i,i).rotate(t,e)}else r.angle=(null!==(i=r.angle)&&void 0!==i?i:vs.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this}rotateTo(t){const e=this.attribute;if(e.angle===t)return this;const i={type:Sn.ROTATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,ml,i);return n?(this._setAttributes(n,!1,i),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}skewTo(t,e){return this}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)&&(!!l(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(t,e,i,n){var s,r;if(i){const e=Object.keys(t),i=this.getNoWorkAnimateAttr(),a={};let o;e.forEach((e=>{i[e]?(o||(o={}),o[e]=t[e]):a[e]=n&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const l=null!==(r=null!==(s=this.context&&this.context.stateAnimateConfig)&&void 0!==s?s:this.stateAnimateConfig)&&void 0!==r?r:Go;this.applyAnimationState(["state"],[{name:"state",animation:{type:"state",to:a,duration:l.duration,easing:l.easing}}]),o&&this.setAttributesAndPreventAnimate(o,!1,{type:Sn.STATE})}else this.stopStateAnimates(),this.setAttributesAndPreventAnimate(t,!1,{type:Sn.STATE});this._emitCustomEvent("afterStateUpdate",{type:Sn.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach((t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((e=>{t[e]=this.normalAttrs[e]}))):Object.keys(t).forEach((t=>{e[t]=this.getNormalAttribute(t)})),this.normalAttrs=e}stopStateAnimates(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"end";this.animates&&this.animates.forEach((e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))}))}getNormalAttribute(t){var e,i;const n=this.attribute[t];return this.animates?null===(e=this.finalAttribute)||void 0===e?void 0:e[t]:null!=n?n:null===(i=this.finalAttribute)||void 0===i?void 0:i[t]}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if(this.currentStates){const i=g(t)?e=>!t.includes(e):e=>e!==t,n=this.currentStates.filter(i);n.length!==this.currentStates.length&&this.useStates(n,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}addState(t,e,i){var n;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const s=e&&(null===(n=this.currentStates)||void 0===n?void 0:n.length)?this.currentStates.concat([t]):[t];this.useStates(s,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if((null===(i=this.currentStates)||void 0===i?void 0:i.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const n={};t.forEach((e=>{var i;const s=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];s&&Object.assign(n,s)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,t,e)}addUpdateBoundTag(){this._updateTag|=_n.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=_n.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=_n.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&_n.UPDATE_SHAPE_AND_BOUNDS)===_n.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=_n.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=_n.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=_n.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=_n.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=_n.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=_n.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=_n.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&_n.UPDATE_LAYOUT)}getAnchor(t,e,i){const n=[0,0],s=()=>{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=s();n[0]=i.x1+(i.x2-i.x1)*e}else n[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,i=s();n[1]=i.y1+(i.y2-i.y1)*e}else n[1]=t[1];return n}doUpdateLocalMatrix(){const{x:t=vs.x,y:e=vs.y,scaleX:i=vs.scaleX,scaleY:n=vs.scaleY,angle:s=vs.angle,scaleCenter:r,anchor:a,postMatrix:o}=this.attribute;let l=[0,0];const h={};if(a&&s&&(l=this.getAnchor(a,h)),!r||1===i&&1===n)!function(t,e,i,n,s,r,a,o){const l=e.a,h=e.b,c=e.c,u=e.d,d=e.e,p=e.f,g=ht(a),f=dt(a);let m,y;o?(m=o[0],y=o[1]):(m=i,y=n);const b=m-i,v=y-n,x=l*g+c*f,_=h*g+u*f,A=c*g-l*f,S=u*g-h*f;t.a=s*x,t.b=s*_,t.c=r*A,t.d=r*S,t.e=d+l*m+c*y-x*b-A*v,t.f=p+h*m+u*y-_*b-S*v}(this._transMatrix,this._transMatrix.reset(),t,e,i,n,s,a&&l);else{const a=this._transMatrix;a.reset(),a.translate(l[0],l[1]),a.rotate(s),a.translate(-l[0],-l[1]),a.translate(t,e),l=this.getAnchor(r,h,!0),sn.transformUtil.fromMatrix(a,a).scale(i,n,{x:l[0],y:l[1]})}const c=this.getOffsetXY(vs);if(this._transMatrix.e+=c.x,this._transMatrix.f+=c.y,o){const t=dl.setValue(o.a,o.b,o.c,o.d,o.e,o.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){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.timeline.isGlobal&&(t.setTimeline(e),e.addAnimate(t))}))}this._onSetStage&&this._onSetStage(this,t,e),this.getGraphicService().onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:Sn.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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:sn.graphicService.creator.shadowRoot(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 p(t,!0)?this.pathProxy=(new ms).fromString(t):this.pathProxy=new ms,this.pathProxy}loadImage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const i=t;this.resources||(this.resources=new Map);const n={data:"init",state:null};this.resources.set(i,n),"string"==typeof t?(n.state="loading",t.startsWith("<svg")?(Hr.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(v(t)||t.includes("/")||x(t))&&(Hr.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):c(t)?(n.state="success",n.data=t,this.backgroundImg=this.backgroundImg||e):n.state="fail"}setShadowGraphic(t){t?this.attachShadow().add(t):this.detachShadow()}imageLoadSuccess(t,e,i){if(!this.resources)return;const n=this.resources.get(t);n&&(n.state="success",n.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",this.stopAnimates(),sn.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,n;if(this._events&&t in this._events){const s=new Gr(t,e);s.bubbles=!1,s.manager=null===(n=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===n?void 0:n.manager,this.dispatchEvent(s)}}toCustomPath(){var t,e,i;const n=null===(i=null===(e=(null===(t=this.stage)||void 0===t?void 0:t.renderService)||sn.renderService)||void 0===e?void 0:e.drawContribution)||void 0===i?void 0:i.getRenderContribution(this);if(n){const t=new el(null,1);return n.drawShape(this,t,0,0,{},{}),t.path}return null}}var xl;vl.userSymbolMap={},vl.mixin(Vr),function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(xl||(xl={}));class _l extends vl{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=ko,this._childUpdateTag=_n.UPDATE_BOUNDS}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}setTheme(t){return this.theme||(this.theme=new Fr),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new Fr)}visibleAll(t){this.setAttribute("visible",t),this.forEachChildren((e=>{e.isContainer&&e.visibleAll?e.visibleAll(t):e.setAttribute("visible",t)}))}hideAll(){this.visibleAll(!1)}showAll(){this.visibleAll(!0)}containsPoint(t,e,i){if(i===An.GLOBAL){const i=new bt(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),this.AABBBounds.contains(i.x,i.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&_n.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.getGraphicService().beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),this.getGraphicService().afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),"empty"===this.attribute.boundsMode&&e.clear(),e}doUpdateLocalMatrix(){const{x:t=vs.x,y:e=vs.y,dx:i=vs.dx,dy:n=vs.dy,scaleX:s=vs.scaleX,scaleY:r=vs.scaleY,angle:a=vs.angle,postMatrix:o}=this.attribute;if(0!==t||0!==e||0!==i||0!==n||1!==s||1!==r||0!==a||o)return super.doUpdateLocalMatrix();this._transMatrix.reset()}getGraphicTheme(){return Ur(this).group}updateAABBBounds(t,e,i){const n=i;i=i.clone();const{width:s,height:r,path:a,clip:o=e.clip}=t;if(a&&a.length?a.forEach((t=>{i.union(t.AABBBounds)})):null!=s&&null!=r&&i.set(0,0,Math.max(0,s),Math.max(0,r)),!o){this.forEachChildren((t=>{i.union(t.AABBBounds)}));const{scrollX:e=0,scrollY:n=0}=t;i.translate(e,n)}return sn.graphicService.updateTempAABBBounds(i),sn.graphicService.transformAABBBounds(t,i,e,!1,this),n.copy(i),n}doUpdateAABBBounds(){this.updateAABBBoundsStamp++;const t=super.doUpdateAABBBounds();return this.parent&&this.parent.addChildUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),t}clearUpdateBoundTag(){this._updateTag&=_n.CLEAR_BOUNDS,this._childUpdateTag&=_n.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=_n.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&_n.UPDATE_BOUNDS||(this._childUpdateTag|=_n.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}getTheme(){return this.theme.getTheme(this)}incrementalAppendChild(t){const e=super.appendChild(t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),this.getGraphicService().onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),this.getGraphicService().onClearIncremental(this,this.stage)}_updateChildToStage(t){return this.stage&&t&&t.setStage(this.stage,this.layer),this.addUpdateBoundTag(),t}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertBefore(t,e){return this._updateChildToStage(super.insertBefore(t,e))}insertAfter(t,e){return this._updateChildToStage(super.insertAfter(t,e))}insertInto(t,e){return this._updateChildToStage(super.insertInto(t,e))}removeChild(t){const e=super.removeChild(t);return t.stage=null,this.getGraphicService().onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.forEachChildren((e=>{this.getGraphicService().onRemove(e),t&&e.isContainer&&e.removeAllChild(t)})),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),this.getGraphicService().onSetStage(this,t),this.forEachChildren((e=>{e.setStage(t,this.layer)})))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}tryUpdateGlobalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){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();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&_n.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,i){let n=this._getChildByName(t);return n?n.setAttributes(e):(n=sn.graphicService.creator[i](e),n.name=t,this.add(n)),n}clone(){return new _l(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return _l.NOWORK_ANIMATE_ATTR}release(t){t&&this.forEachChildren((e=>{e.release(t)})),super.release()}}function Al(t){return new _l(t)}function Sl(t,e){return!(!t&&!e)}function Tl(t,e){let i;return i=g(t)?t.some((t=>t||void 0===t)):!!t,i&&e>0}function wl(t,e,i){return i&&t*e>0}function Ml(t,e,i,n,s){return s&&t*e>0&&0!==i&&0!==n}function Bl(t,e){return t*e>0}function Cl(t,e,i,n){return t*e>0&&0!==i&&0!==n}function kl(t,e,i,n,s,r,a){const o=t-i,l=e-n,h=(a?r:-r)/Math.sqrt(o*o+l*l),c=h*l,u=-h*o,d=t+c,p=e+u,g=i+c,f=n+u,m=(d+g)/2,y=(p+f)/2,b=g-d,v=f-p,x=b*b+v*v,_=s-r,A=d*f-g*p,S=(v<0?-1:1)*Math.sqrt(Math.max(0,_*_*x-A*A));let T=(A*v-b*S)/x,w=(-A*b-v*S)/x;const M=(A*v+b*S)/x,B=(-A*b+v*S)/x,C=T-m,k=w-y,P=M-m,O=B-y;return C*C+k*k>P*P+O*O&&(T=M,w=B),{cx:T,cy:w,x01:-c,y01:-u,x11:T*(s/_-1),y11:w*(s/_-1)}}function Pl(t,e,i,n,s){const r=ot(i-e),a=t.getParsedCornerRadius(),o=g(a),{outerDeltaAngle:l,innerDeltaAngle:h,outerStartAngle:c,outerEndAngle:u,innerEndAngle:d,innerStartAngle:p}=t.getParsePadAngle(e,i),f=o?a[0]:a,m=o?a[1]:a,y=o?a[2]:a,b=o?a[3]:a,v=Math.max(m,f),x=Math.max(y,b);let _=v,A=x;const S=s*ht(c),T=s*dt(c),w=n*ht(d),M=n*dt(d);let B,C,k,P;if((x>it||v>it)&&(B=s*ht(u),C=s*dt(u),k=n*ht(p),P=n*dt(p),r<nt)){const t=function(t,e,i,n,s,r,a,o){const l=i-t,h=n-e,c=a-s,u=o-r;let d=u*l-c*h;return d*d<it?[]:(d=(c*(e-r)-u*(t-s))/d,[t+d*l,e+d*h])}(S,T,k,P,B,C,w,M);if(t){const e=S-t[0],i=T-t[1],r=B-t[0],a=C-t[1],o=1/dt(((O=(e*r+i*a)/(pt(e*e+i*i)*pt(r*r+a*a)))>1?0:O<-1?nt:Math.acos(O))/2),l=pt(t[0]*t[0]+t[1]*t[1]);A=ut(x,(n-l)/(o-1)),_=ut(v,(s-l)/(o+1))}}var O;return{outerDeltaAngle:l,xors:S,yors:T,xirs:k,yirs:P,xore:B,yore:C,xire:w,yire:M,limitedOcr:_,limitedIcr:A,outerCornerRadiusStart:f,outerCornerRadiusEnd:m,maxOuterCornerRadius:v,maxInnerCornerRadius:x,outerStartAngle:c,outerEndAngle:u,innerDeltaAngle:h,innerEndAngle:d,innerStartAngle:p,innerCornerRadiusStart:b,innerCornerRadiusEnd:y}}function Ol(t,e,i,n,s,r,a){const{startAngle:o,endAngle:l}=t.getParsedAngle(),h=ot(l-o),c=l>o;let u=!1;if(s<r){const t=s;s=r,r=t}if(s<=it)e.moveTo(i,n);else if(h>=at-it)e.moveTo(i+s*ht(o),n+s*dt(o)),e.arc(i,n,s,o,l,!c),r>it&&(e.moveTo(i+r*ht(l),n+r*dt(l)),e.arc(i,n,r,l,o,c));else{const{outerDeltaAngle:h,xors:d,yors:p,xirs:g,yirs:f,limitedOcr:m,outerCornerRadiusStart:y,outerCornerRadiusEnd:b,maxOuterCornerRadius:v,xore:x,yore:_,xire:A,yire:S,outerStartAngle:T,outerEndAngle:w,limitedIcr:M,innerDeltaAngle:B,innerEndAngle:C,innerStartAngle:k,innerCornerRadiusStart:P,innerCornerRadiusEnd:O,maxInnerCornerRadius:R}=Pl(t,o,l,r,s);if(h<.001)a&&(a[3]||a[1])&&e.moveTo(i+d,n+p),u=!0;else if(m>it){const t=ut(y,m),r=ut(b,m),o=kl(g,f,d,p,s,t,Number(c)),l=kl(x,_,A,S,s,r,Number(c));m<v&&t===r?!a||a[0]?(e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),e.arc(i+o.cx,n+o.cy,m,lt(o.y01,o.x01),lt(l.y01,l.x01),!c)):e.moveTo(i+o.cx+m*ht(lt(l.y01,l.x01)),n+o.cy+m*dt(lt(l.y01,l.x01))):!a||a[0]?(e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),t>0&&e.arc(i+o.cx,n+o.cy,t,lt(o.y01,o.x01),lt(o.y11,o.x11),!c),e.arc(i,n,s,lt(o.cy+o.y11,o.cx+o.x11),lt(l.cy+l.y11,l.cx+l.x11),!c),r>0&&e.arc(i+l.cx,n+l.cy,r,lt(l.y11,l.x11),lt(l.y01,l.x01),!c)):r>0?e.moveTo(i+l.cx+r*ht(lt(l.y01,l.x01)),n+l.cy+r*dt(lt(l.y01,l.x01))):e.moveTo(i+x,n+s*dt(w))}else!a||a[0]?(e.moveTo(i+d,n+p),e.arc(i,n,s,T,w,!c)):e.moveTo(i+s*ht(w),n+s*dt(w));if(!(r>it)||B<.001)!a||a[1]?e.lineTo(i+A,n+S):e.moveTo(i+A,n+S),u=!0;else if(M>it){const t=ut(P,M),s=ut(O,M),o=kl(A,S,x,_,r,-s,Number(c)),l=kl(d,p,g,f,r,-t,Number(c));if(!a||a[1]?e.lineTo(i+o.cx+o.x01,n+o.cy+o.y01):e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),M<R&&t===s){const t=lt(l.y01,l.x01);!a||a[2]?e.arc(i+o.cx,n+o.cy,M,lt(o.y01,o.x01),t,!c):e.moveTo(i+o.cx+ht(t),n+o.cy+dt(t))}else!a||a[2]?(s>0&&e.arc(i+o.cx,n+o.cy,s,lt(o.y01,o.x01),lt(o.y11,o.x11),!c),e.arc(i,n,r,lt(o.cy+o.y11,o.cx+o.x11),lt(l.cy+l.y11,l.cx+l.x11),c),t>0&&e.arc(i+l.cx,n+l.cy,t,lt(l.y11,l.x11),lt(l.y01,l.x01),!c)):t>0?e.moveTo(i+l.cx+t*ht(lt(l.y01,l.x01)),n+l.cy+t*dt(lt(l.y01,l.x01))):e.moveTo(i+g,n+f)}else!a||a[1]?e.lineTo(i+A,n+S):e.moveTo(i+A,n+S),!a||a[2]?e.arc(i,n,r,C,k,c):e.moveTo(i+r*ht(k),n+r*dt(k))}return a?a[3]&&e.lineTo(i+s*ht(o),n+s*dt(o)):e.closePath(),u}_l.NOWORK_ANIMATE_ATTR=bl;const Rl=Symbol.for("ArcRenderContribution"),Ll=Symbol.for("ImageRenderContribution"),Il=Symbol.for("PolygonRenderContribution"),El=Symbol.for("RectRenderContribution"),Dl=Symbol.for("SymbolRenderContribution"),Fl=Symbol.for("TextRenderContribution"),jl=Symbol.for("InteractiveSubRenderContribution");function Ul(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function Nl(t,e,i){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?(arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}var Wl=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},zl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Gl=function(t,e){return function(i,n){e(i,n,t)}};function Vl(t,e,i){var n;const{x:s=i.x,y:r=i.y,z:a=i.z,dx:o=i.dx,dy:l=i.dy,dz:h=i.dz,scaleX:c=i.scaleX,scaleY:u=i.scaleY,scaleZ:d=i.scaleZ,alpha:p=i.alpha,beta:g=i.beta,angle:f=i.angle,anchor3d:m=e.attribute.anchor,anchor:y}=e.attribute,b=[0,0,0];if(m){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;b[0]=i.x1+(i.x2-i.x1)*t}else b[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;b[1]=i.x1+(i.x2-i.x1)*t}else b[1]=m[1];b[2]=null!==(n=m[2])&&void 0!==n?n:0}if(Vo(t),Ho(t,t,[s+o,r+l,a+h]),Ho(t,t,[b[0],b[1],b[2]]),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[4],a=e[5],o=e[6],l=e[7],h=e[8],c=e[9],u=e[10],d=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]=r*s+h*n,t[5]=a*s+c*n,t[6]=o*s+u*n,t[7]=l*s+d*n,t[8]=h*s-r*n,t[9]=c*s-a*n,t[10]=u*s-o*n,t[11]=d*s-l*n}(t,t,g),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[0],a=e[1],o=e[2],l=e[3],h=e[8],c=e[9],u=e[10],d=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]=r*s-h*n,t[1]=a*s-c*n,t[2]=o*s-u*n,t[3]=l*s-d*n,t[8]=r*n+h*s,t[9]=a*n+c*s,t[10]=o*n+u*s,t[11]=l*n+d*s}(t,t,p),Ho(t,t,[-b[0],-b[1],b[2]]),function(t,e,i){const n=i[0],s=i[1],r=i[2];t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*s,t[5]=e[5]*s,t[6]=e[6]*s,t[7]=e[7]*s,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[c,u,d]),f){const i=Ko.allocate(),n=[0,0];if(y){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;n[0]=i.x1+(i.x2-i.x1)*t}else n[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;n[1]=i.x1+(i.x2-i.x1)*t}else n[1]=m[1]}Ho(i,i,[n[0],n[1],0]),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[0],a=e[1],o=e[2],l=e[3],h=e[4],c=e[5],u=e[6],d=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]=r*s+h*n,t[1]=a*s+c*n,t[2]=o*s+u*n,t[3]=l*s+d*n,t[4]=h*s-r*n,t[5]=c*s-a*n,t[6]=u*s-o*n,t[7]=d*s-l*n}(i,i,f),Ho(i,i,[-n[0],-n[1],0]),Xo(t,t,i)}}let Hl=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new nn(["graphic"]),onSetStage:new nn(["graphic","stage"]),onRemove:new nn(["graphic"]),onRelease:new nn(["graphic"]),onAddIncremental:new nn(["graphic","group","stage"]),onClearIncremental:new nn(["graphic","group","stage"]),beforeUpdateAABBBounds:new nn(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new nn(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"]),clearAABBBounds:new nn(["graphic","stage","aabbBounds"])},this.tempAABBBounds1=new Xt,this.tempAABBBounds2=new Xt}onAttributeUpdate(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}onSetStage(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}onRemove(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}onRelease(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(t)}onAddIncremental(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,i,n){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,n)}afterUpdateAABBBounds(t,e,i,n,s){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,n,s)}clearAABBBounds(t,e,i){this.hooks.clearAABBBounds.taps.length&&this.hooks.clearAABBBounds.call(t,e,i)}updatePathProxyAABBBounds(t,e){const i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;const n=new cn(t);return Pn(i.commandList,n,0,0),!0}updateHTMLTextAABBBounds(t,e,i,n){const{textAlign:s,textBaseline:r}=t;if(null!=t.forceBoundsHeight){const e=y(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),n=Nl(r,e,e);i.set(i.x1,n,i.x2,n+e)}if(null!=t.forceBoundsWidth){const e=y(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),n=Ul(s,e);i.set(n,i.y1,n+e,i.y2)}}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,i,n,s){if(!e.empty()){const{scaleX:s=i.scaleX,scaleY:r=i.scaleY,stroke:a=i.stroke,shadowBlur:o=i.shadowBlur,lineWidth:l=i.lineWidth,pickStrokeBuffer:h=i.pickStrokeBuffer,strokeBoundsBuffer:c=i.strokeBoundsBuffer}=t,u=this.tempAABBBounds1,d=this.tempAABBBounds2;if(a&&l){vo(u,(l+h)/Math.abs(s+r),n,c),e.union(u),u.setValue(d.x1,d.y1,d.x2,d.y2)}if(o){const{shadowOffsetX:n=i.shadowOffsetX,shadowOffsetY:a=i.shadowOffsetY}=t;vo(u,o/Math.abs(s+r)*2,!1,c+1),u.translate(n,a),e.union(u)}}if(this.combindShadowAABBBounds(e,s),e.empty())return;let r=!0;const a=s.transMatrix;s&&s.isContainer&&(r=!(1===a.a&&0===a.b&&0===a.c&&1===a.d&&0===a.e&&0===a.f)),r&&Vt(e,e,a)}validCheck(t,e,i,n){if(!n)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(n.shadowRoot||n.isContainer)return!0;const{visible:s=e.visible}=t;return!(!n.valid||!s)||(i.empty()||(n.parent&&i.transformWithMatrix(n.parent.globalTransMatrix),this.clearAABBBounds(n,n.stage,i),i.clear()),!1)}updateTempAABBBounds(t){const e=this.tempAABBBounds1,i=this.tempAABBBounds2;return e.setValue(t.x1,t.y1,t.x2,t.y2),i.setValue(t.x1,t.y1,t.x2,t.y2),{tb1:e,tb2:i}}};Hl=Wl([Ei(),Gl(0,Li(No)),zl("design:paramtypes",[Object])],Hl);const Xl=(t,e,i)=>{const{outerBorder:n,shadowBlur:s=e.shadowBlur}=t;if(n){const t=e.outerBorder,{distance:r=t.distance,lineWidth:a=t.lineWidth}=n;i.expand(r+(s+a)/2)}return i};class $l{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i,n){if(t.xOffset="left"===e||"start"===e?0:"center"===e?t.width/-2:"right"===e||"end"===e?-t.width:0,"top"===i)t.yOffset=0;else if("middle"===i)t.yOffset=t.height/-2;else if("alphabetic"===i){let e=.79;if(1===n.length){const t=n[0];e=t.ascent/(t.ascent+t.descent)}t.yOffset=t.height*-e}else t.yOffset=-t.height;return t}GetLayoutByLines(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",r=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;const{lineWidth:o,suffixPosition:l="end",measureMode:h=rn.actualBounding,keepCenterInLine:c=!1}=null!=a?a:{};t=t.map((t=>t.toString()));const u=[],d=[0,0];if("number"==typeof o&&o!==1/0){let e;for(let i=0,n=t.length;i<n;i++){const n=this.textMeasure.measureTextPixelADscentAndWidth(t[i],this.textOptions,h);let a=t[i].toString();if(n.width>o){const n=this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,o,s,r,l);a=n.str,e=n.width}else e=n.width;u.push({str:a,width:e,ascent:n.ascent,descent:n.descent,keepCenterInLine:c})}d[0]=o}else{let e,i,n=0;for(let s=0,r=t.length;s<r;s++){i=t[s];const r=this.textMeasure.measureTextPixelADscentAndWidth(t[s],this.textOptions,h);e=r.width,n=Math.max(n,e),u.push({str:i,width:e,ascent:r.ascent,descent:r.descent,keepCenterInLine:c})}d[0]=n}d[1]=u.length*n,d[0]=u.reduce(((t,e)=>Math.max(t,e.width)),0);const p={xOffset:0,yOffset:0,width:d[0],height:d[1]};return this.LayoutBBox(p,e,i,u),this.layoutWithBBox(p,u,e,i,n)}layoutWithBBox(t,e,i,n,s){const r=[0,0],a=e.length*s;"top"===n||("middle"===n?r[1]=(t.height-a)/2:"bottom"===n&&(r[1]=t.height-a));for(let a=0;a<e.length;a++)this.lineOffset(t,e[a],i,n,s,r);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:s,textAlign:i,textBaseline:n}}lineOffset(t,e,i,n,s,r){if("left"===i||"start"===i?e.leftOffset=0:"center"===i?e.leftOffset=(t.width-e.width)/2:"right"!==i&&"end"!==i||(e.leftOffset=t.width-e.width),e.topOffset=s/2+(e.ascent-e.descent)/2+r[1],!e.keepCenterInLine){const t=0,i=e.ascent+e.descent+t;if(i<s-t&&("bottom"===n?e.topOffset+=(s-i)/2:"top"===n&&(e.topOffset-=(s-i)/2)),"alphabetic"===n){const t=s/(e.ascent+e.descent);e.topOffset=s/2+(e.ascent-e.descent)/2*t+r[1]}}return r[1]+=s,e}}const Yl=["text","maxLineWidth","maxWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...pl];class ql extends vl{get font(){const t=this.getGraphicTheme();return this._font||(this._font=zt(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,i=this.getGraphicTheme(),n=this.getMaxWidth(i);return Number.isFinite(n)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:i.text).toString()}get clipedWidth(){return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){var t,e;const i=this.getGraphicTheme(),n=this.attribute,s=this.getMaxWidth(i);if(!Number.isFinite(s))return!1;const{text:r}=this.attribute;if(this.tryUpdateAABBBounds(),null===(e=null===(t=this.cache)||void 0===t?void 0:t.layoutData)||void 0===e?void 0:e.lines){let t="";return this.cache.layoutData.lines.forEach((e=>{t+=e.str})),(Array.isArray(r)?r.join(""):r)!==t}return"vertical"===n.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map((t=>t.text)).join("")!==n.text.toString():null!=this.clipedText&&this.clipedText!==n.text.toString()}get multilineLayout(){return this.tryUpdateAABBBounds(),this.cache.layoutData}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16}),this.type="text",this.numberType=Uo,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return g(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}getGraphicTheme(){return Ur(this).text}doUpdateOBBBounds(){const t=this.getGraphicTheme();this._OBBBounds.clear();const e=this.attribute,{angle:i=t.angle}=e;if(!i){const t=this.AABBBounds;return this._OBBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._OBBBounds}this.obbText||(this.obbText=new ql({})),this.obbText.setAttributes(Object.assign(Object.assign({},e),{angle:0}));const n=this.obbText.AABBBounds,{x:s,y:r}=e,a={x:(n.x1+n.x2)/2,y:(n.y1+n.y2)/2},o=kt(a,i,{x:s,y:r});return this._OBBBounds.copy(n),this._OBBBounds.translate(o.x-a.x,o.y-a.y),this._OBBBounds.angle=i,this._OBBBounds}updateAABBBounds(t,e,i){const{text:n=e.text}=this.attribute;Array.isArray(n)?this.updateMultilineAABBBounds(n):this.updateSingallineAABBBounds(n);const{tb1:s}=sn.graphicService.updateTempAABBBounds(i),{scaleX:r=e.scaleX,scaleY:a=e.scaleY,shadowBlur:o=e.shadowBlur,strokeBoundsBuffer:l=e.strokeBoundsBuffer}=t;if(o){vo(s,o/Math.abs(r+a),!0,l),i.union(s)}return sn.graphicService.combindShadowAABBBounds(i,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||sn.graphicService.updateHTMLTextAABBBounds(t,e,i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,Vt(i,i,this.transMatrix),i}updateSingallineAABBBounds(t){this.updateMultilineAABBBounds([t]);const e=this.cache.layoutData;if(e&&e.lines&&e.lines.length){const t=e.lines[0];this.cache.clipedText=t.str,this.cache.clipedWidth=t.width}return this._AABBBounds}updateMultilineAABBBounds(t){const e=this.getGraphicTheme(),{direction:i=e.direction,underlineOffset:n=e.underlineOffset}=this.attribute,s="horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===i&&n&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+n),s}guessLineHeightBuf(t){return t?.1*t:0}updateHorizontalMultilineAABBBounds(t){var e;const i=this.getGraphicTheme(),n=this.attribute,{fontFamily:s=i.fontFamily,textAlign:r=i.textAlign,textBaseline:a=i.textBaseline,fontSize:o=i.fontSize,fontWeight:l=i.fontWeight,ellipsis:h=i.ellipsis,maxLineWidth:c,stroke:u=i.stroke,wrap:d=i.wrap,measureMode:p=i.measureMode,lineWidth:g=i.lineWidth,whiteSpace:f=i.whiteSpace,suffixPosition:m=i.suffixPosition,ignoreBuf:y=i.ignoreBuf,keepCenterInLine:b=i.keepCenterInLine}=n,v=y?0:this.guessLineHeightBuf(o),x=this.getLineHeight(n,i,v);if("normal"===f||d)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),u&&this._AABBBounds.expand(g/2),this._AABBBounds}const _=sn.graphicUtil.textMeasure,A=new $l(s,{fontSize:o,fontWeight:l,fontFamily:s,lineHeight:x},_).GetLayoutByLines(t,r,a,x,!0===h?i.ellipsis:h||void 0,!1,{lineWidth:c,suffixPosition:m,measureMode:p,keepCenterInLine:b}),{bbox:S}=A;return this.cache.layoutData=A,this.clearUpdateShapeTag(),this._AABBBounds.set(S.xOffset,S.yOffset,S.xOffset+S.width,S.yOffset+S.height),u&&this._AABBBounds.expand(g/2),this._AABBBounds}updateWrapAABBBounds(t){var e,i,n;const s=this.getGraphicTheme(),{fontFamily:r=s.fontFamily,textAlign:a=s.textAlign,textBaseline:o=s.textBaseline,fontSize:l=s.fontSize,ellipsis:h=s.ellipsis,maxLineWidth:c,stroke:u=s.stroke,lineWidth:d=s.lineWidth,wordBreak:p=s.wordBreak,fontWeight:f=s.fontWeight,ignoreBuf:m=s.ignoreBuf,measureMode:y=s.measureMode,suffixPosition:b=s.suffixPosition,heightLimit:v=0,lineClamp:x,keepCenterInLine:_=s.keepCenterInLine}=this.attribute,A=m?0:this.guessLineHeightBuf(l),S=this.getLineHeight(this.attribute,s,A);if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),u&&this._AABBBounds.expand(d/2),this._AABBBounds}const T=sn.graphicUtil.textMeasure,w={fontSize:l,fontWeight:f,fontFamily:r,lineHeight:S},M=new $l(r,w,T),B=g(t)?t.map((t=>t.toString())):[t.toString()],C=[],k=[0,0];let P=1/0;if(v>0&&(P=Math.max(Math.floor(v/S),1)),x&&(P=Math.min(P,x)),"number"==typeof c&&c!==1/0){if(c>0)for(let t=0;t<B.length;t++){const e=B[t];let s=!0;if(t===P-1){const i=T.clipTextWithSuffix(e,w,c,h,!1,b,t!==B.length-1),n=T.measureTextPixelADscentAndWidth(i.str,w,y);C.push({str:i.str,width:i.width,ascent:n.ascent,descent:n.descent,keepCenterInLine:_});break}const r=T.clipText(e,w,c,"break-all"!==p,"keep-all"===p);if(""!==e&&""===r.str||r.wordBreaked){if(h){const t=T.clipTextWithSuffix(e,w,c,h,!1,b);r.str=null!==(i=t.str)&&void 0!==i?i:"",r.width=null!==(n=t.width)&&void 0!==n?n:0}else r.str="",r.width=0;s=!1}const a=T.measureTextPixelADscentAndWidth(r.str,w,y);C.push({str:r.str,width:r.width,ascent:a.ascent,descent:a.descent,keepCenterInLine:_});let o=r.str.length;if(!r.wordBreaked||""!==e&&""===r.str||(s=!0,o=r.wordBreaked),r.str.length===e.length);else if(s){let i=e.substring(o);"keep-all"===p&&(i=i.replace(/^\s+/g,"")),B.splice(t+1,0,i)}}let t=0;C.forEach((e=>{t=Math.max(t,e.width)})),k[0]=t}else{let t,e,i=0;for(let n=0,s=B.length;n<s;n++){if(n===P-1){const t=T.clipTextWithSuffix(B[n],w,c,h,!1,b),e=T.measureTextPixelADscentAndWidth(t.str,w,y);C.push({str:t.str,width:t.width,ascent:e.ascent,descent:e.descent,keepCenterInLine:_}),i=Math.max(i,t.width);break}e=B[n],t=T.measureTextWidth(e,w),i=Math.max(i,t);const s=T.measureTextPixelADscentAndWidth(e,w,y);C.push({str:e,width:t,ascent:s.ascent,descent:s.descent,keepCenterInLine:_})}k[0]=i}k[1]=C.length*S;const O={xOffset:0,yOffset:0,width:k[0],height:k[1]};M.LayoutBBox(O,a,o,C);const R=M.layoutWithBBox(O,C,a,o,S);return this.cache.layoutData=R,this.clearUpdateShapeTag(),this._AABBBounds.set(O.xOffset,O.yOffset,O.xOffset+O.width,O.yOffset+O.height),u&&this._AABBBounds.expand(d/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e,i;const n=this.getGraphicTheme(),s=sn.graphicUtil.textMeasure;let r;const a=this.attribute,{maxLineWidth:o=n.maxLineWidth,ellipsis:l=n.ellipsis,fontFamily:h=n.fontFamily,fontSize:c=n.fontSize,fontWeight:u=n.fontWeight,stroke:d=n.stroke,lineWidth:p=n.lineWidth,verticalMode:g=n.verticalMode,suffixPosition:f=n.suffixPosition}=a,m=this.getLineHeight(a,n,0);let{textAlign:y=n.textAlign,textBaseline:b=n.textBaseline}=a;if(!g){const t=y;y=null!==(e=ql.baselineMapAlign[b])&&void 0!==e?e:"left",b=null!==(i=ql.alignMapBaseline[t])&&void 0!==i?i:"top"}if(r=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);r=ct(e,r)}));const t=Ul(y,r),e=this.cache.verticalList.length*m,i=Nl(b,e,c);return this._AABBBounds.set(i,t,i+e,t+r),d&&this._AABBBounds.expand(p/2),this._AABBBounds}const v=t.map((t=>function(t){const e=[];let i=0,n="";for(let s=0;s<t.length;s++)wo(t[s])?i?n+=t[s]:(i=1,n=t[s]):(i&&(e.push({text:n,direction:Ao.VERTICAL}),n="",i=0),e.push({text:t[s],direction:Ao.HORIZONTAL}));return n&&e.push({text:n,direction:Ao.VERTICAL}),e}(t.toString())));v.forEach(((t,e)=>{if(Number.isFinite(o))if(l){const i=!0===l?n.ellipsis:l,a=s.clipTextWithSuffixVertical(t,{fontSize:c,fontWeight:u,fontFamily:h},o,i,!1,f);v[e]=a.verticalList,r=a.width}else{const i=s.clipTextVertical(t,{fontSize:c,fontWeight:u,fontFamily:h},o,!1);v[e]=i.verticalList,r=i.width}else r=0,t.forEach((t=>{const e=t.direction===Ao.HORIZONTAL?c:s.measureTextWidth(t.text,{fontSize:c,fontWeight:u,fontFamily:h});r+=e,t.width=e}))})),this.cache.verticalList=v,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);r=ct(e,r)}));const x=Ul(y,r),_=this.cache.verticalList.length*m,A=Nl(b,_,c);return this._AABBBounds.set(A,x,A+_,x+r),d&&this._AABBBounds.expand(p/2),this._AABBBounds}getMaxWidth(t){var e,i;const n=this.attribute;return null!==(i=null!==(e=n.maxLineWidth)&&void 0!==e?e:n.maxWidth)&&void 0!==i?i:t.maxWidth}getLineHeight(t,e,i){var n;return null!==(n=ia(t.lineHeight,t.fontSize||e.fontSize))&&void 0!==n?n:(t.fontSize||e.fontSize)+i}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yl;return super.needUpdateTags(t,e)}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yl;return super.needUpdateTag(t,e)}_interpolate(t,e,i,n,s){"text"===t&&(s.text=n)}clone(){return new ql(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return ql.NOWORK_ANIMATE_ATTR}getBaselineMapAlign(){return ql.baselineMapAlign}getAlignMapBaseline(){return ql.alignMapBaseline}}function Kl(t){return new ql(t)}ql.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},bl),ql.baselineMapAlign={top:"left",bottom:"right",middle:"center"},ql.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const Zl=["symbolType","size",...pl];let Jl=class t extends vl{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"}),this.type="symbol",this.numberType=jo}getParsedPath(){return this.shouldUpdateShape()&&(this._parsedPath=this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}getParsedPath2D(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=null;try{n=new Path2D}catch(t){return null}const s=this.getParsedPath();if(!s)return null;s.draw(n,i,t,e)}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return g(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const{symbolType:t="circle"}=this.attribute;return super.parsePath(t)}getGraphicTheme(){return Ur(this).symbol}updateAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i)||(n?this.updateSymbolAABBBoundsImprecise(t,e,i):this.updateSymbolAABBBoundsAccurate(t,e,i));const{tb1:s,tb2:r}=sn.graphicService.updateTempAABBBounds(i);((t,e,i)=>{const{outerBorder:n,shadowBlur:s=e.shadowBlur,strokeBoundsBuffer:r=e.strokeBoundsBuffer}=t;if(n){const t=e.outerBorder,{distance:a=t.distance,lineWidth:o=t.lineWidth}=n;vo(i,a+(s+o)/2,!0,r)}})(t,e,s),i.union(s),s.setValue(r.x1,r.y1,r.x2,r.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,this.x1WithoutTransform=i.x1,this.y1WithoutTransform=i.y1;const{lineJoin:a=e.lineJoin}=t;return sn.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateSymbolAABBBoundsImprecise(t,e,i){const{size:n=e.size}=t;if(g(n))i.set(-n[0]/2,-n[1]/2,n[0]/2,n[1]/2);else{const t=n/2;i.set(-t,-t,t,t)}return i}updateSymbolAABBBoundsAccurate(t,e,i){const{size:n=e.size}=t;return this.getParsedPath().bounds(n,i),i}needUpdateTags(t){return super.needUpdateTags(t,Zl)}needUpdateTag(t){return super.needUpdateTag(t,Zl)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=g(e)?e:[e,e];return t.path?(new ms).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new ms).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Ql(t){return new Jl(t)}Jl.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},bl);const th=["segments","points","curveType","curveTension",...pl];let eh=class t extends vl{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),this.type="line",this.numberType=Oo}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!(!t||t.length<=1)}_interpolate(t,e,i,n,s){"points"===t&&(s.points=ea(i,n,e))}getGraphicTheme(){return Ur(this).line}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i):this.updateLineAABBBoundsByPoints(t,e,i)),sn.graphicService.updateTempAABBBounds(i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:n=e.lineJoin}=t;return sn.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updateLineAABBBoundsByPoints(t,e,i,n){const{points:s=e.points,connectedType:r}=t,a=i;return s.forEach((t=>{!1===t.defined&&"connect"!==r||a.add(t.x,t.y)})),a}updateLineAABBBoundsBySegments(t,e,i,n){const{segments:s=e.segments,connectedType:r}=t,a=i;return s.forEach((t=>{t.points.forEach((t=>{!1===t.defined&&"connect"!==r||a.add(t.x,t.y)}))})),a}needUpdateTags(t){return super.needUpdateTags(t,th)}needUpdateTag(t){return super.needUpdateTag(t,th)}toCustomPath(){let t=super.toCustomPath();if(t)return t;const e=this.attribute;t=new ms;const i=e.segments,n=e=>{if(e&&e.length){let i=!0;e.forEach((e=>{!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),i=!1)}))}};return i&&i.length?i.forEach((t=>{n(t.points)})):e.points&&n(e.points),t}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function ih(t){return new eh(t)}eh.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},bl);const nh=["width","x1","y1","height","cornerRadius",...pl];class sh extends vl{constructor(t){super(t),this.type="rect",this.numberType=Eo}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return Ur(this).rect}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){let{width:e,height:n}=t;const{x1:s,y1:r,x:a,y:o}=t;e=null!=e?e:s-a,n=null!=n?n:r-o,(isFinite(e)||isFinite(n)||isFinite(a)||isFinite(o))&&i.set(0,0,e||0,n||0)}const{tb1:n,tb2:s}=sn.graphicService.updateTempAABBBounds(i);return Xl(t,e,n),i.union(n),n.setValue(s.x1,s.y1,s.x2,s.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,sn.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,nh)}needUpdateTag(t){return super.needUpdateTag(t,nh)}toCustomPath(){let t=super.toCustomPath();if(t)return t;const e=this.attribute,{x:i,y:n,width:s,height:r}=(t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=l(t.width)?t.x1-t.x:t.width,i=l(t.height)?t.y1-t.y:t.height,n=0,s=0;return e<0?(n=e,e=-e):Number.isNaN(e)&&(e=0),i<0?(s=i,i=-i):Number.isNaN(i)&&(i=0),{x:n,y:s,width:e,height:i}})(e);return t=new ms,t.moveTo(i,n),t.rect(i,n,s,r),t}clone(){return new sh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return sh.NOWORK_ANIMATE_ATTR}}function rh(t){return new sh(t)}sh.NOWORK_ANIMATE_ATTR=bl;const ah=[[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]];class oh extends sh{constructor(t){super(t),this.type="rect3d",this.numberType=Do}findFace(){const t={polygons:[],vertices:[],edges:[]},e=this.getGraphicTheme(),{x1:i,y1:n,x:s,y:r,length:a=ut(e.width,e.height)}=this.attribute;let{width:o,height:l}=this.attribute;o=null!=o?o:i-s,l=null!=l?l:n-r;for(let e=0;e<ah.length;e++){const i=ah[e];t.vertices.push([i[0]*o,i[1]*l,i[2]*a])}return t.polygons.push({polygon:[0,1,5,4],normal:[0,-1,0]}),t.polygons.push({polygon:[2,3,7,6],normal:[0,1,0]}),t.polygons.push({polygon:[4,7,3,0],normal:[-1,0,0]}),t.polygons.push({polygon:[1,2,6,5],normal:[1,0,0]}),t.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),t.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),t.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],t}getNoWorkAnimateAttr(){return oh.NOWORK_ANIMATE_ATTR}}function lh(t){return new oh(t)}oh.NOWORK_ANIMATE_ATTR=bl;class hh{constructor(t,e,i,n,s,r,a,o,l,h,c,u,d,p){this.left=t,this.top=e,this.width=i,this.height=n,this.actualHeight=0,this.bottom=e+n,this.right=t+i,this.ellipsis=s,this.wordBreak=r,this.verticalDirection=a,this.lines=[],this.globalAlign=o,this.globalBaseline=l,this.layoutDirection=h,this.directionKey=Hs[this.layoutDirection],this.isWidthMax=c,this.isHeightMax=u,this.singleLine=d,p?(p.clear(),this.icons=p):this.icons=new Map}draw(t,e){const{width:i,height:n}=this.getActualSize(),s=this.isWidthMax?Math.min(this.width,i):this.width||i||0;let r=this.isHeightMax?Math.min(this.height,n):this.height||n||0;r=Math.min(r,n);let a=0;switch(this.globalBaseline){case"top":a=0;break;case"middle":a=-r/2;break;case"bottom":a=-r}let o=0;"right"===this.globalAlign||"end"===this.globalAlign?o=-s:"center"===this.globalAlign&&(o=-s/2);let l=this[this.directionKey.height];this.singleLine&&(l=this.lines[0].height+1);let h=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=l&&0!==l)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i];if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+l)return h;let r=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(r=!0,h=!0),this.lines[i].draw(t,r,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}else{const i=Math.floor((l-this.actualHeight)/2);"vertical"===this.layoutDirection?o+=i:a+=i;for(let i=0;i<this.lines.length;i++)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i],r=l-this.lines[i].top-this.lines[i].height;if(0===l)this.lines[i].draw(t,!1,o,r+a,this.ellipsis,e);else{if(r+s>this[this.directionKey.top]+l||r<this[this.directionKey.top])return h;{let n=!1;this.ellipsis&&this.lines[i+1]&&r-this.lines[i+1].height<this[this.directionKey.top]&&(n=!0,h=!0),this.lines[i].draw(t,n,o,r+a,this.ellipsis,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(o+=this.lines[0].height+1);for(let i=0;i<this.lines.length;i++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(o-=this.lines[i].height+this.lines[i].top);const{top:n,height:s}=this.lines[i];if(0===l)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e);else{if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+l)return h;{let n=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(n=!0,h=!0),this.lines[i].draw(t,n,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}}}}return h}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let i=0;i<this.lines.length;i++){const n=this.lines[i];n.actualWidth>t&&(t=n.actualWidth),e+=n.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:i,height:n}=this.getRawActualSize();this.width,this.height;let s=this[this.directionKey.height];if(this.singleLine&&(s=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=s&&0!==s)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i];if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+s);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+s){const n=!0===this.ellipsis?"...":this.ellipsis||"",s=this.lines[i].getWidthWithEllips(n);s>t&&(t=s),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else{Math.floor((s-this.actualHeight)/2);for(let i=0;i<this.lines.length;i++)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else if("bottom"===this.verticalDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i],a=s-this.lines[i].top-this.lines[i].height;if(0===s)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(a+r>this[this.directionKey.top]+s||a<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[i+1]&&a-this.lines[i+1].height<this[this.directionKey.top]){const n=!0===this.ellipsis?"...":this.ellipsis||"",s=this.lines[i].getWidthWithEllips(n);s>t&&(t=s),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i];if(0===s)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+s);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+s){const n=!0===this.ellipsis?"...":this.ellipsis||"",s=this.lines[i].getWidthWithEllips(n);s>t&&(t=s),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}function ch(t,e,i,n){const s=Math.round(t),r=Math.round(i),a=Math.round(e),o=Math.round(n);return{left:t>s?s:s-.5,top:i>r?r:r-.5,right:a>e?a:a+.5,bottom:o>n?o:o+.5}}class uh{constructor(t,e,i,n){var s,r;this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic",this.ascentDescentMode=n;const a=ia(i.lineHeight,this.fontSize);this.lineHeight="number"==typeof a?a>this.fontSize?a:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:o,height:l,descent:h,width:c}=tr(t,i,this.ascentDescentMode);let u=0,d=0,p=0;this.height>l&&(u=(this.height-l)/2,d=Math.ceil(u),p=Math.floor(u)),"top"===this.textBaseline?(this.ascent=u,this.descent=l-u):"bottom"===this.textBaseline?(this.ascent=l-u,this.descent=u):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=o+d,this.descent=h+p),this.length=t.length,this.width=c||0,this.text=t||"",this.newLine=e||!1,this.character=i,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,this.space=i.space,this.dx=null!==(s=i.dx)&&void 0!==s?s:0,this.dy=null!==(r=i.dy)&&void 0!==r?r:0,"vertical"===i.direction&&(this.direction=i.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height),this.ellipsisStr="..."}updateWidth(){const{width:t}=tr(this.text,this.character,this.ascentDescentMode);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}drawBackground(t,e,i,n,s,r,a){if(""===this.text||"\n"===this.text||!this.character.background||this.character.backgroundOpacity&&!(this.character.backgroundOpacity>0))return;let o=e+i,l=this.text,h=this.left+n;o+=this.top;let c=this.direction;if(this.verticalEllipsis)l=this.ellipsisStr,c="vertical",o-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)l+=this.ellipsisStr,"right"!==r&&"end"!==r||(h-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Js(l,("vertical"===c?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,l.length-1);if(l=l.slice(0,t),l+=this.ellipsisStr,"right"===r||"end"===r)if("vertical"===c);else{const{width:e}=tr(this.text.slice(t),this.character,this.ascentDescentMode);h-=this.ellipsisWidth-e}}}const u=ch(h,h+(this.widthOrigin||this.width),e,e+a);return Object.assign(Object.assign({},u),{fillStyle:this.character.background,globalAlpha:this.character.backgroundOpacity})}draw(t,e,i,n,s,r,a){var o;let l=e+i,h=this.text,c=this.left+n+(null!==(o=this.space)&&void 0!==o?o:0)/2;l+=this.top;let u=this.direction;if(this.verticalEllipsis)h=this.ellipsisStr,u="vertical",l-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)h+=this.ellipsisStr,"right"!==r&&"end"!==r||(c-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Js(h,("vertical"===u?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,h.length-1);if(h=h.slice(0,t),h+=this.ellipsisStr,"right"===r||"end"===r)if("vertical"===u);else{const{width:e}=tr(this.text.slice(t),this.character,this.ascentDescentMode);c-=this.ellipsisWidth-e}}}switch(this.character.script){case"super":l-=this.ascent*(1/3);break;case"sub":l+=this.descent/2}"vertical"===u&&(t.save(),t.rotateAbout(Math.PI/2,c,l),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(c,l),c=0,l=0);const{lineWidth:d=1}=this.character;if(this.character.stroke&&d&&t.strokeText(h,c+this.dx,l+this.dy),this.character.fill&&t.fillText(h,c+this.dx,l+this.dy),this.character.fill)if(this.character.lineThrough||this.character.underline){if(this.character.underline){const e=1+l,i=ch(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}if(this.character.lineThrough){const e=1+l-this.ascent/2,i=ch(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l-this.ascent/2,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}}else if("underline"===this.character.textDecoration){const e=1+l,i=ch(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}else if("line-through"===this.character.textDecoration){const e=1+l-this.ascent/2,i=ch(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l-this.ascent/2,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}"vertical"===u&&t.restore()}getWidthWithEllips(t){let e=this.text;const i="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return i;if("add"===this.ellipsis)return i+this.ellipsisWidth;if("replace"===this.ellipsis){const t=Js(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+=this.ellipsisStr;const{width:n}=tr(this.text.slice(t),this.character,this.ascentDescentMode);return i+this.ellipsisWidth-n}return i}}const dh=["width","height","image",...pl];class ph extends vl{constructor(t){super(t),this.type="image",this.numberType=Po,this.loadImage(this.attribute.image)}getImageElement(){const{image:t}=this.attribute;if(!t||!this.resources)return null;const e=this.resources.get(t);return"success"!==e.state?null:e.data}get width(){return this.tryUpdateAABBBounds(),this._actualWidth}get height(){return this.tryUpdateAABBBounds(),this._actualHeight}get repeatX(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,i){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()})),this.addUpdateBoundTag()}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}setAttributes(t,e,i){return t.image&&this.loadImage(t.image),super.setAttributes(t,e,i)}setAttribute(t,e,i,n){return"image"===t&&this.loadImage(e),super.setAttribute(t,e,i,n)}getGraphicTheme(){return Ur(this).image}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const{maxWidth:n=e.maxWidth,maxHeight:s=e.maxHeight}=t;let{width:r,height:a}=t;if(null==r||null==a){const t=this.getImageElement();if(t){const e=t.width,i=t.height;if(null!=r)a=r*(i/e);else if(null!=a)r=a*(e/i);else{const t=e/i;t>n/s?(r=n,a=n/t):(a=s,r=s*t)}}else r=n,a=s}this._actualWidth=r,this._actualHeight=a,i.set(0,0,r,a)}const{tb1:n,tb2:s}=sn.graphicService.updateTempAABBBounds(i);return Xl(t,e,n),i.union(n),n.setValue(s.x1,s.y1,s.x2,s.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,sn.graphicService.transformAABBBounds(t,i,e,!1,this),i}getDefaultAttribute(t){return Us[t]}needUpdateTags(t){return super.needUpdateTags(t,dh)}needUpdateTag(t){return super.needUpdateTag(t,dh)}clone(){return new ph(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return ph.NOWORK_ANIMATE_ATTR}}function gh(t){return new ph(t)}ph.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},bl);class fh extends ph{constructor(t){if(super(t),this._x=0,this._y=0,this._hovered=!1,this._marginArray=[0,0,0,0],"always"===t.backgroundShowMode&&(this._hovered=!0),t.margin){const e=Kr(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,i)=>{if(g(i)&&-1!==i.indexOf("margin")||"margin"===i)if(e.margin){const t=Kr(e.margin);this._marginArray="number"==typeof t?[t,t,t,t]:t}else this._marginArray=[0,0,0,0]}}get width(){var t;return(null!==(t=this.attribute.width)&&void 0!==t?t:0)+this._marginArray[1]+this._marginArray[3]}get height(){var t;return(null!==(t=this.attribute.height)&&void 0!==t?t:0)+this._marginArray[0]+this._marginArray[2]}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();const{width:t=Us.width,height:e=Us.height}=this.attribute,{backgroundWidth:i=t,backgroundHeight:n=e}=this.attribute,s=(i-t)/2,r=(n-e)/2;return this._AABBBounds.expand([0,2*s,2*r,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class mh{constructor(t,e,i,n,s,r,a,o){this.left=t,this.width=e,this.baseline=i,this.ascent=n,this.descent=s,this.top=i-n,this.paragraphs=r.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof fh?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=a,this.directionKey=Hs[this.direction],this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof uh){const e=Ks.exec(t.text);0!==(null==e?void 0:e.index)&&(t.text=t.text.slice(null==e?void 0:e.index),t.updateWidth())}this.actualWidth+=t[this.directionKey.width],l=Math.max(t[this.directionKey.height],l)})),this.height=l,this.blankWidth=o?0:this.width-this.actualWidth,this.calcOffset(e,o)}calcOffset(t,e){const i=this.directionKey,n=this.height;let s=this.left,r=0;this.actualWidth<t&&!e&&("right"===this.textAlign||"end"===this.textAlign?s=t-this.actualWidth:"center"===this.textAlign?s=(t-this.actualWidth)/2:"justify"===this.textAlign&&(this.paragraphs.length<2?s=(t-this.actualWidth)/2:r=(t-this.actualWidth)/(this.paragraphs.length-1))),this.paragraphs.map((function(t){t instanceof fh?(t["_"+i.x]=s,s+=t[i.width]+r,t["_"+i.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?n-t.height:(n-t.height)/2):(t[i.left]=s,s+=t[i.width]+r)}))}draw(t,e,i,n,s,r){if(s&&(e||this.paragraphs.some((t=>t.overflow)))){let t=!0,i=!1;for(let e=this.paragraphs.length-1;e>=0;e--){const n=this.paragraphs[e];if(n.overflow)t=t&&""===n.text;else if(t){i=!0;break}}let n=0;if(!i)for(let t=this.paragraphs.length-1;t>=0;t--){const i=this.paragraphs[t];if(i.overflow){if(""===i.text)break;continue}if(i instanceof fh)break;if("vertical"===this.direction&&"vertical"!==i.direction){i.verticalEllipsis=!0;break}const r=!0===s?"...":s||"";i.ellipsisStr=r;const{width:a}=tr(r,i.character,i.ascentDescentMode),o=a||0;if(o<=this.blankWidth+n){e&&(i.ellipsis="add");break}if(o<=this.blankWidth+n+i.width){i.ellipsis="replace",i.ellipsisWidth=o,i.ellipsisOtherParagraphWidth=this.blankWidth+n;break}i.ellipsis="hide",n+=i.width}}let a="",o=-1,l=[];const h=[l];this.paragraphs.forEach(((e,s)=>{if(e instanceof fh)return;const r=e.drawBackground(t,n,this.ascent,i,0===s,this.textAlign,this.height);r&&(a===r.fillStyle&&o===r.globalAlpha||(l=[],h.push(l),a=r.fillStyle,o=r.globalAlpha),l.push(r))})),h.forEach((e=>{if(0===e.length)return;const i=e[0],n=e[e.length-1];t.fillStyle=i.fillStyle,t.globalAlpha=i.globalAlpha,t.fillRect(i.left,i.top,n.right-i.left,n.bottom-i.top)})),this.paragraphs.forEach(((e,s)=>{if(e instanceof fh)return e.setAttributes({x:i+e._x,y:n+e._y}),void r(e,t,i+e._x,n+e._y,this.ascent);const a={x1:this.left,y1:this.top,x2:this.left+this.actualWidth,y2:this.top+this.height};(function(t,e){const i=e&&e.stroke||$s;if(!i)return void(t.globalAlpha=0);const{strokeOpacity:n=1,opacity:s=1}=e;t.globalAlpha=n*s,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=i,Zs(t,e)})(t,e.character),function(t,e,i){const n=e&&e.fill||Xs;if(!n)return void(t.globalAlpha=0);const{fillOpacity:s=1,opacity:r=1}=e;t.globalAlpha=s*r,t.fillStyle=i?Vs(t,n,{AABBBounds:i}):n,Zs(t,e)}(t,e.character,a),e.draw(t,n,this.ascent,i,0===s,this.textAlign,this.height)}))}getWidthWithEllips(t){let e=0;for(let i=this.paragraphs.length-1;i>=0;i--){const n=this.paragraphs[i];if(n instanceof fh)break;const{width:s}=tr(t,n.character,n.ascentDescentMode),r=s||0;if(r<=this.blankWidth+e){n.ellipsis="add",n.ellipsisWidth=r;break}if(r<=this.blankWidth+e+n.width){n.ellipsis="replace",n.ellipsisWidth=r,n.ellipsisOtherParagraphWidth=this.blankWidth+e;break}n.ellipsis="hide",e+=n.width}let i=0;return this.paragraphs.forEach(((t,e)=>{i+=t instanceof fh?t.width:t.getWidthWithEllips(this.direction)})),i}}class yh{constructor(t){this.frame=t,this.width=this.frame.width,this.height=this.frame.height,this.lineWidth=0,this.y=this.frame.top,this.maxAscent=0,this.maxDescent=0,this.maxAscentForBlank=0,this.maxDescentForBlank=0,this.lineBuffer=[],this.direction=t.layoutDirection,this.directionKey=Hs[this.direction]}store(t){if(t instanceof fh){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,i=0;"top"===t.attribute.textBaseline?(e=0,i=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,i=0):(e=t.height/2,i=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,i)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}send(){if(0===this.lineBuffer.length)return;const t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,i=new mh(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(i),this.frame.actualHeight+=i.height,this.y+=i.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t instanceof fh?"horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):0===this.lineBuffer.length?(this.store(t),this.send()):(this.send(),this.deal(t)):"number"!=typeof this.width||this.width<0||(t.newLine&&this.send(),(0!==t.text.length||this.newLine)&&("horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t,e)))}cut(t,e){const i=this[this.directionKey.width]-this.lineWidth||0,n=Math.ceil(i/t[this.directionKey.width]*t.length)||0,s=Js(t.text,i,t.character,n,"break-word"===this.frame.wordBreak);if(0!==s){const[i,n]=function(t,e){const i=t.text.slice(0,e),n=t.text.slice(e);return[new uh(i,t.newLine,t.character,t.ascentDescentMode),new uh(n,!0,t.character,t.ascentDescentMode)]}(t,s);this.store(i),e?this.send():this.deal(n)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}let bh=!1;try{bh=Intl&&"function"==typeof Intl.Segmenter}catch(t){bh=!1}const vh=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize","fontFamily","fontStyle","fontWeight","lineWidth","opacity","fillOpacity","strokeOpacity",...pl];class xh extends vl{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=Fo,this.onBeforeAttributeUpdate=(t,e,i)=>{for(const i in t)if("hoverIconId"===i){if(t[i]===e[i])continue;const n=this._frameCache.icons.get(t[i]);this.updateHoverIconState(n)}}}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:js.width}set width(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:js.height}set height(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get maxWidth(){return this.attribute.maxWidth}set maxWidth(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}get maxHeight(){return this.attribute.maxHeight}set maxHeight(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}get ellipsis(){var t;return null!==(t=this.attribute.ellipsis)&&void 0!==t?t:js.ellipsis}set ellipsis(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}get wordBreak(){var t;return null!==(t=this.attribute.wordBreak)&&void 0!==t?t:js.wordBreak}set wordBreak(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}get verticalDirection(){var t;return null!==(t=this.attribute.verticalDirection)&&void 0!==t?t:js.verticalDirection}set verticalDirection(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}get textAlign(){var t;return null!==(t=this.attribute.textAlign)&&void 0!==t?t:js.textAlign}set textAlign(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}get textBaseline(){var t;return null!==(t=this.attribute.textBaseline)&&void 0!==t?t:js.textBaseline}set textBaseline(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}get textConfig(){var t;return null!==(t=this.attribute.textConfig)&&void 0!==t?t:js.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}getGraphicTheme(){return Ur(this).richtext}static AllSingleCharacter(t){return t.lines?t.lines.every((t=>t.paragraphs.every((t=>!(t.text&&p(t.text)&&xh.splitText(t.text).length>1))))):t.every((t=>t.isComposing||!(t.text&&p(t.text)&&xh.splitText(t.text).length>1)))}static splitText(t){if(bh){const e=new Intl.Segmenter(void 0,{granularity:"grapheme"}),i=[];for(const{segment:n}of e.segment(t))i.push(n);return i}return Array.from(t)}static TransformTextConfig2SingleCharacter(t){const e=[];return t.forEach((t=>{const i=xh.splitText(t.text.toString());if(p(t.text)&&i.length>1)for(let n=0;n<i.length;n++){const s=i[n];e.push(Object.assign(Object.assign({},t),{text:s}))}else e.push(t)})),e}updateAABBBounds(t,e,i){var n,s,r,a;const{width:o=e.width,height:l=e.height,maxWidth:h=e.maxWidth,maxHeight:c=e.maxHeight,textAlign:u=e.textAlign,textBaseline:d=(null!==(s=null!==(n=t.textBaseline)&&void 0!==n?n:e.textBaseline)&&void 0!==s?s:"top"),editOptions:p}=t;if(o>0&&l>0)i.set(0,0,o,l);else{const t=this.getFrameCache(),{width:e,height:n}=t.getActualSize();let s=o||e||0,r=l||n||0;r="number"==typeof c&&r>c?c:r||0,s="number"==typeof h&&s>h?h:s||0,i.set(0,0,s,r)}p&&p.keepHeightWhileEmpty&&!i.height()&&!(null===(r=t.textConfig)||void 0===r?void 0:r.length)&&(i.y2=i.y1+(null!==(a=t.fontSize)&&void 0!==a?a:12),i.x2=i.x1+2);let g=0;switch(d){case"top":g=0;break;case"middle":g=-i.height()/2;break;case"bottom":g=-i.height()}let f=0;switch(u){case"left":f=0;break;case"center":f=-i.width()/2;break;case"right":f=-i.width()}return i.translate(f,g),sn.graphicService.updateTempAABBBounds(i),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||sn.graphicService.updateHTMLTextAABBBounds(t,e,i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,sn.graphicService.transformAABBBounds(t,i,e,!1,this),0===i.width()&&0===i.height()&&i.clear(),i}needUpdateTags(t){return super.needUpdateTags(t,vh)}needUpdateTag(t){return super.needUpdateTag(t,vh)}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}get cliped(){const t=this.getFrameCache();if(t.actualHeight>t.height)return!0;const{disableAutoWrapLine:e}=this.attribute;if(e)for(let e=0;e<t.lines.length;e++){const i=t.lines[e];for(let t=0;t<i.paragraphs.length;t++){const e=i.paragraphs[t];if(e.overflow&&""!==e.text)return!0}}return!1}combinedStyleToCharacter(t){const{fill:e,stroke:i,fontSize:n,fontFamily:s,fontStyle:r,fontWeight:a,lineWidth:o,opacity:l,fillOpacity:h,lineHeight:c,strokeOpacity:u,upgradeAttrs:d}=this.attribute,p=Object.assign({fill:e,stroke:i,fontSize:n,fontFamily:s,fontStyle:r,fontWeight:a,lineWidth:o,opacity:l,fillOpacity:h,strokeOpacity:u},t);return(null==d?void 0:d.lineHeight)&&(p.lineHeight=c),p}doUpdateFrameCache(t){var e;const{maxWidth:i,maxHeight:n,width:s,height:r,ellipsis:a,wordBreak:o,verticalDirection:l,textAlign:h,textBaseline:c,layoutDirection:u,singleLine:d,disableAutoWrapLine:p,editable:g,ascentDescentMode:f,upgradeAttrs:m}=this.attribute,b=m&&m.multiBreakLine;let{textConfig:v=[]}=this.attribute;g&&v.length>0&&!xh.AllSingleCharacter(v)&&(v=xh.TransformTextConfig2SingleCharacter(v),this.attribute.textConfig=v);const x=[],_=null!=t?t:v;for(let t=0;t<_.length;t++)if("image"in _[t]){const e=this.combinedStyleToCharacter(_[t]);e.lineWidth=void 0;const i=e.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(e.id);if(i)x.push(i);else{const t=new fh(e);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=e.id,x.push(t)}}else{const e=this.combinedStyleToCharacter(_[t]);if(y(e.text)&&(e.text=`${e.text}`),e.text&&e.text.includes("\n")){const i=e.text.split("\n");for(let n=0;n<i.length;n++)if(0===n)x.push(new uh(i[n],!1,e,f));else if(i[n]||t===_.length-1)x.push(new uh(i[n],!0,e,f));else{const e=this.combinedStyleToCharacter(_[t+1]);x.push(new uh(i[n],!0,e,f))}}else e.text&&x.push(new uh(e.text,!1,e,f))}const A="number"==typeof i&&Number.isFinite(i)&&i>0,S="number"==typeof n&&Number.isFinite(n)&&n>0,T="number"==typeof s&&Number.isFinite(s)&&s>0&&(!A||s<=i),w="number"==typeof r&&Number.isFinite(r)&&r>0&&(!S||r<=n),M=new hh(0,0,(T?s:A?i:0)||0,(w?r:S?n:0)||0,a,o,l,h,c,u||"horizontal",!T&&A,!w&&S,d||!1,null===(e=this._frameCache)||void 0===e?void 0:e.icons),B=new yh(M);if(B.newLine=b,p){let t=0,e=!1;for(let i=0;i<x.length;i++){const n=x[i];e?(n.overflow=!0,n.left=1/0,n.top=1/0,!n.newLine&&M.lines[M.lines.length-1].paragraphs.push(n)):B.deal(n,!0),M.lines.length!==t&&(t=M.lines.length,B.lineBuffer.length=0,n.overflow=!0,n.left=1e3,n.top=1e3,M.lines[M.lines.length-1].paragraphs.push(n),e=!0),n.newLine&&(e=!1,B.lineWidth=0),B.send()}}else for(let t=0;t<x.length;t++)B.deal(x[t]);if(B.send(),!("horizontal"===M.layoutDirection?T:w)){const t=M.getActualSizeWidthEllipsis();let e="horizontal"===M.layoutDirection?t.width:t.height;("horizontal"===M.layoutDirection?A:S)&&(e=Math.min(e,"horizontal"===M.layoutDirection?i:n)),M.lines.forEach((function(t){t.calcOffset(e,!1)}))}b&&M.lines.forEach((t=>{const e=t.paragraphs;t.paragraphs=t.paragraphs.filter((t=>""!==t.text)),0===t.paragraphs.length&&e.length&&(e[0].text="\n",t.paragraphs.push(e[0]))})),this._frameCache=M}clone(){return new xh(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e),this.getFrameCache().icons.forEach((i=>{i.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{const e=this.pickIcon(t.global);e&&e===this._currentHoverIcon||(e?this.setAttribute("hoverIconId",e.richtextId):!e&&this._currentHoverIcon&&this.setAttribute("hoverIconId",void 0))})),this.addEventListener("pointerleave",(t=>{this._currentHoverIcon&&this.setAttribute("hoverIconId",void 0)}))}updateHoverIconState(t){var e,i,n,s,r;t?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=t,this._currentHoverIcon.setHoverState(!0),null===(i=this.stage)||void 0===i||i.setCursor(t.attribute.cursor),null===(n=this.stage)||void 0===n||n.renderNextFrame()):(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(s=this.stage)||void 0===s||s.setCursor(),null===(r=this.stage)||void 0===r||r.renderNextFrame())}pickIcon(t){const e=this.getFrameCache(),{e:i,f:n}=this.globalTransMatrix;let s;return e.icons.forEach(((e,r)=>{var a,o;const l=e.AABBBounds.clone();l.translate(e._marginArray[3],e._marginArray[0]),l.containsPoint({x:t.x-i,y:t.y-n})&&(s=e,s.globalX=(null!==(a=s.attribute.x)&&void 0!==a?a:0)+i+e._marginArray[3],s.globalY=(null!==(o=s.attribute.y)&&void 0!==o?o:0)+n+e._marginArray[0])})),s}getNoWorkAnimateAttr(){return xh.NOWORK_ANIMATE_ATTR}}function _h(t){return new xh(t)}xh.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},bl);const Ah=["path","customPath",...pl];class Sh extends vl{constructor(t){super(t),this.type="path",this.numberType=Ro}get pathShape(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{path:t}=this.attribute;return null!=t&&""!==t}getParsedPathShape(){const t=this.getGraphicTheme();if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof ms?e.path:(l(this.cache)&&this.doUpdatePathShape(),this.cache instanceof ms?this.cache:t.path)}getGraphicTheme(){return Ur(this).path}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const t=this.getParsedPathShape();i.union(t.getBounds())}const{tb1:n,tb2:s}=sn.graphicService.updateTempAABBBounds(i);Xl(t,e,n),i.union(n),n.setValue(s.x1,s.y1,s.x2,s.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:r=e.lineJoin}=t;return sn.graphicService.transformAABBBounds(t,i,e,"miter"===r,this),i}doUpdateAABBBounds(t){return this.doUpdatePathShape(),super.doUpdateAABBBounds(t)}doUpdatePathShape(){const t=this.attribute;p(t.path,!0)?this.cache=(new ms).fromString(t.path):t.customPath&&(this.cache=new ms,t.customPath(this.cache,this))}needUpdateTags(t){return super.needUpdateTags(t,Ah)}needUpdateTag(t){return super.needUpdateTag(t,Ah)}toCustomPath(){return(new ms).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new Sh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Sh.NOWORK_ANIMATE_ATTR}}function Th(t){return new Sh(t)}Sh.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},bl);const wh=["segments","points","curveType","curveTension",...pl];class Mh extends vl{constructor(t){super(t),this.type="area",this.numberType=Co}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&0!==t.length}getGraphicTheme(){return Ur(this).area}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i):this.updateAreaAABBBoundsByPoints(t,e,i)),sn.graphicService.updateTempAABBBounds(i),this.setWidthHeightWithoutTransform(i);const{lineJoin:n=e.lineJoin}=t;return sn.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updateAreaAABBBoundsByPoints(t,e,i,n){const{points:s=e.points}=t,r=i;return s.forEach((t=>{var e,i;r.add(t.x,t.y),r.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)})),r}updateAreaAABBBoundsBySegments(t,e,i,n){const{segments:s=e.segments}=t,r=i;return s.forEach((t=>{t.points.forEach((t=>{var e,i;r.add(t.x,t.y),r.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)}))})),r}_interpolate(t,e,i,n,s){"points"===t&&(s.points=ea(i,n,e))}needUpdateTags(t){return super.needUpdateTags(t,wh)}needUpdateTag(t){return super.needUpdateTag(t,wh)}toCustomPath(){let t=super.toCustomPath();if(t)return t;t=new ms;const e=this.attribute,i=e.segments,n=e=>{if(e&&e.length){let i=!0;const n=[];if(e.forEach((e=>{var s,r;!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),n.push({x:null!==(s=e.x1)&&void 0!==s?s:e.x,y:null!==(r=e.y1)&&void 0!==r?r:e.y}),i=!1)})),n.length){for(let e=n.length-1;e>=0;e--)t.lineTo(n[e].x,n[e].y);t.closePath()}}};return e.points?n(e.points):i&&i.length&&i.forEach((t=>{n(t.points)})),t}clone(){return new Mh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Mh.NOWORK_ANIMATE_ATTR}}Mh.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},bl);const Bh=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...pl];class Ch extends vl{constructor(t){super(t),this.type="arc",this.numberType=Mo}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:i,innerRadius:n}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(n)}getParsedCornerRadius(){const t=this.getGraphicTheme(),{cornerRadius:e=t.cornerRadius,innerPadding:i=t.innerPadding,outerPadding:n=t.outerPadding}=this.attribute;let{outerRadius:s=t.outerRadius,innerRadius:r=t.innerRadius}=this.attribute;if(s+=n,r-=i,0===e||"0%"===e)return 0;const a=Math.abs(s-r),o=t=>Math.min(y(t,!0)?t:a*parseFloat(t)/100,a/2);if(g(e)){const t=e.map((t=>o(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 o(e)}getParsedAngle(){const t=this.getGraphicTheme();let{startAngle:e=t.startAngle,endAngle:i=t.endAngle}=this.attribute;const{cap:n=t.cap}=this.attribute,s=i-e>=0?1:-1,r=i-e;if(e=At(e),i=e+r,n&&ot(r)<at-it){let r=1,a=1;n.length&&(r=Number(n[0]),a=Number(n[1]));let{outerRadius:o=t.outerRadius,innerRadius:l=t.innerRadius}=this.attribute;const{outerPadding:h=t.outerPadding,innerPadding:c=t.innerPadding}=this.attribute;o+=h,l-=c;const u=Math.abs(o-l)/2,d=u/o;if(u>it&&o>it)return{startAngle:e-s*d*r,endAngle:i+s*d*a,sc:s*d*r,ec:s*d*a}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=this.getGraphicTheme(),{innerPadding:n=i.innerPadding,outerPadding:s=i.outerPadding,padAngle:r=i.padAngle}=this.attribute;let{outerRadius:a=i.outerRadius,innerRadius:o=i.innerRadius}=this.attribute;a+=s,o-=n;const{padRadius:l=pt(a*a+o*o)}=this.attribute,h=ot(e-t);let c=t,u=e,d=t,p=e;const g=r/2;let f=h,m=h;if(g>it&&l>it){const i=e>t?1:-1;let n=ft(Number(l)/o*dt(g)),s=ft(Number(l)/a*dt(g));return(f-=2*n)>it?(n*=i,d+=n,p-=n):(f=0,d=p=(t+e)/2),(m-=2*s)>it?(s*=i,c+=s,u-=s):(m=0,c=u=(t+e)/2),{outerStartAngle:c,outerEndAngle:u,innerStartAngle:d,innerEndAngle:p,innerDeltaAngle:f,outerDeltaAngle:m}}return{outerStartAngle:c,outerEndAngle:u,innerStartAngle:d,innerEndAngle:p,innerDeltaAngle:f,outerDeltaAngle:m}}getGraphicTheme(){return Ur(this).arc}updateAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i)||(n?this.updateArcAABBBoundsImprecise(t,e,i):this.updateArcAABBBoundsAccurate(t,e,i));const{tb1:s,tb2:r}=sn.graphicService.updateTempAABBBounds(i);Xl(t,e,s),i.union(s),s.setValue(r.x1,r.y1,r.x2,r.y2),this.setWidthHeightWithoutTransform(i);const{lineJoin:a=e.lineJoin}=t;return sn.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateArcAABBBoundsImprecise(t,e,i){let{outerRadius:n=e.outerRadius,innerRadius:s=e.innerRadius}=t;const{outerPadding:r=e.outerPadding,innerPadding:a=e.innerPadding}=t;return n+=r,s-=a,n<s&&(n=s),i.set(-n,-n,n,n),i}updateArcAABBBoundsAccurate(t,e,i){let{outerRadius:n=e.outerRadius,innerRadius:s=e.innerRadius}=t;const{outerPadding:r=e.outerPadding,innerPadding:a=e.innerPadding}=t;if(n+=r,s-=a,n<s){const t=n;n=s,s=t}let{endAngle:o=e.endAngle,startAngle:l=e.startAngle}=t;if(l>o){const t=l;l=o,o=t}return n<=it?i.set(0,0,0,0):Math.abs(o-l)>at-it?i.set(-n,-n,n,n):(Qr(l,o,n,i),Qr(l,o,s,i)),i}needUpdateTags(t){return super.needUpdateTags(t,Bh)}needUpdateTag(t){return super.needUpdateTag(t,Bh)}toCustomPath(){var t,e,i,n;let s=super.toCustomPath();if(s)return s;const r=this.attribute,{startAngle:a,endAngle:o}=this.getParsedAngle();let l=(null!==(t=r.innerRadius)&&void 0!==t?t:0)-(null!==(e=r.innerPadding)&&void 0!==e?e:0),h=(null!==(i=r.outerRadius)&&void 0!==i?i:0)-(null!==(n=r.outerPadding)&&void 0!==n?n:0);const c=ot(o-a),u=o>a;if(h<l){const t=h;h=l,l=t}if(s=new ms,h<=it)s.moveTo(0,0);else if(c>=at-it)s.moveTo(0+h*ht(a),0+h*dt(a)),s.arc(0,0,h,a,o,!u),l>it&&(s.moveTo(0+l*ht(o),0+l*dt(o)),s.arc(0,0,l,o,a,u));else{const t=h*ht(a),e=h*dt(a),i=l*ht(o),n=l*dt(o);s.moveTo(0+t,0+e),s.arc(0,0,h,a,o,!u),s.lineTo(0+i,0+n),s.arc(0,0,l,o,a,u),s.closePath()}return s}clone(){return new Ch(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Ch.NOWORK_ANIMATE_ATTR}}function kh(t){return new Ch(t)}Ch.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},bl);class Ph extends Ch{constructor(t){super(t),this.type="arc3d",this.numberType=Bo}updateAABBBounds(t,e,i){const n=this.stage;if(!n||!n.camera)return i;const{outerRadius:s=e.outerRadius,height:r=0}=t,a=s+r;return i.setValue(-a,-a,a,a),sn.graphicService.updateTempAABBBounds(i),sn.graphicService.transformAABBBounds(t,i,e,!1,this),i}getNoWorkAnimateAttr(){return Ph.NOWORK_ANIMATE_ATTR}}function Oh(t){return new Ph(t)}Ph.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},bl);const Rh=["points","cornerRadius",...pl];class Lh extends vl{constructor(t){super(t),this.type="polygon",this.numberType=Lo}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}getGraphicTheme(){return Ur(this).polygon}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||this.updatePolygonAABBBoundsImprecise(t,e,i),sn.graphicService.updateTempAABBBounds(i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:n=e.lineJoin}=t;return sn.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updatePolygonAABBBoundsImprecise(t,e,i){const{points:n=e.points}=t;return n.forEach((t=>{i.add(t.x,t.y)})),i}_interpolate(t,e,i,n,s){"points"===t&&(s.points=ea(i,n,e))}needUpdateTags(t){return super.needUpdateTags(t,Rh)}needUpdateTag(t){return super.needUpdateTag(t,Rh)}toCustomPath(){const t=this.attribute.points,e=new ms;return t.forEach(((t,i)=>{0===i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}clone(){return new Lh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Lh.NOWORK_ANIMATE_ATTR}}function Ih(t){return new Lh(t)}Lh.NOWORK_ANIMATE_ATTR=bl;class Eh extends Lh{constructor(t){super(t),this.type="pyramid3d",this.numberType=Io}updateAABBBounds(t,e,i){const n=this.stage;return n&&n.camera?(this.findFace().vertices.forEach((t=>{const e=t[0],n=t[1];i.add(e,n)})),sn.graphicService.updateTempAABBBounds(i),sn.graphicService.transformAABBBounds(t,i,e,!1,this),i):i}findFace(){const{points:t}=this.attribute,e=t.map(((e,i)=>{const n=3===i?t[0]:t[i+1],s=e.x-n.x;return 0===s?0:(e.y-n.y)/s})),i=t.map((t=>({p:t,d:0})));let n=!1,s=0;for(let t=0;t<e.length-1;t++){for(let r=t+1;r<e.length;r++){if(e[t]===e[r]){n=!0;const e=vt.distancePP(i[t].p,i[t+1].p);i[t].d=e,i[t+1].d=e,s=ct(s,e);const a=vt.distancePP(i[r].p,i[r+1].p);i[r].d=a,i[r+1].d=a,s=ct(s,a)}if(n)break}if(n)break}for(let e=t.length-1;e>=0;e--){const n=t[e];i.unshift({p:n,d:0})}for(let e=0;e<t.length;e++){const n=(s-i[e+t.length].d)/2;i[e].d+=n,i[e+t.length].d+=n}const r={polygons:[],vertices:[],edges:[]};return i.forEach((t=>{r.vertices.push([t.p.x,t.p.y,t.d])})),r.polygons.push({polygon:[0,4,5,1],normal:[0,-1,0]}),r.polygons.push({polygon:[7,6,2,3],normal:[0,1,0]}),r.polygons.push({polygon:[0,4,7,3],normal:[-1,0,0]}),r.polygons.push({polygon:[1,5,6,2],normal:[1,0,0]}),r.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),r.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),r.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],r}_isValid(){return super._isValid()&&4===this.attribute.points.length}getNoWorkAnimateAttr(){return Eh.NOWORK_ANIMATE_ATTR}}function Dh(t){return new Eh(t)}Eh.NOWORK_ANIMATE_ATTR=bl;class Fh extends _l{constructor(t){super({x:0,y:0}),this.type="shadowroot",this.shadowHost=t}clearUpdateBoundTag(){super.clearUpdateBoundTag(),this.shadowHost&&this.shadowHost.clearUpdateBoundTag()}addUpdateBoundTag(){super.addUpdateBoundTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}addUpdateShapeAndBoundsTag(){super.addUpdateShapeAndBoundsTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}tryUpdateGlobalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){const e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}doUpdateGlobalMatrix(){if(this.shadowHost){const t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}function jh(t){return new Fh(t)}const Uh=new class{constructor(){this.store=new Map}RegisterGraphicCreator(t,e){this.store.set(t,e),this[t]=e}CreateGraphic(t,e){const i=this.store.get(t);return i?i(e):null}};let Nh;function Wh(t){return Nh||(Nh=Uh.CreateGraphic("text",{})),Nh.initAttributes(t),Nh.AABBBounds}var zh=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Gh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Vh=function(t,e){return function(i,n){e(i,n,t)}};class Hh{constructor(){this.time=Mn.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){var p;const{background:g,backgroundOpacity:f=(null!==(p=t.attribute.fillOpacity)&&void 0!==p?p:l.backgroundOpacity),opacity:m=l.opacity,backgroundMode:y=l.backgroundMode,backgroundFit:b=l.backgroundFit,backgroundKeepAspectRatio:v=l.backgroundKeepAspectRatio,backgroundScale:x=l.backgroundScale,backgroundOffsetX:_=l.backgroundOffsetX,backgroundOffsetY:A=l.backgroundOffsetY,backgroundClip:S=l.backgroundClip}=t.attribute;if(g)if(t.backgroundImg&&t.resources){const s=t.resources.get(g);if("success"!==s.state||!s.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=Ur(t.parent).group,{scrollX:n=i.scrollX,scrollY:s=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(n,s)}S&&e.clip();const r=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,n,l),e.globalAlpha=f*m,this.doDrawImage(e,s.data,r,{backgroundMode:y,backgroundFit:b,backgroundKeepAspectRatio:v,backgroundScale:x,backgroundOffsetX:_,backgroundOffsetY:A}),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,l),e.globalAlpha=f*m,e.fillStyle=g,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,n){const{backgroundMode:s,backgroundFit:r,backgroundKeepAspectRatio:a,backgroundScale:o=1,backgroundOffsetX:l=0,backgroundOffsetY:h=0}=n,c=i.width(),u=i.height();let d=c,p=u;if("no-repeat"===s)if(r)if(a){const n=Math.max(c/e.width,u/e.height);t.drawImage(e,i.x1+l,i.y1+h,e.width*n*o,e.height*n*o)}else t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{const n=e.width*o,s=e.height*o;t.drawImage(e,i.x1+l,i.y1+h,n,s)}else{if(r&&"repeat"!==s&&(e.width||e.height)){const i=e.width,n=e.height;"repeat-x"===s?(d=i*(u/n),p=u):"repeat-y"===s&&(p=n*(c/i),d=c);const r=t.dpr,a=Rr.allocate({width:d,height:p,dpr:r}),o=a.getContext("2d");o&&(o.inuse=!0,o.clearMatrix(),o.setTransformForCurrent(!0),o.clearRect(0,0,d,p),o.drawImage(e,0,0,d,p),e=a.nativeCanvas),Rr.free(a)}const n=t.dpr,a=t.createPattern(e,s);a.setTransform&&a.setTransform(new DOMMatrix([1/n,0,0,1/n,0,0])),t.fillStyle=a,t.translate(i.x1,i.y1),t.fillRect(0,0,c,u),t.translate(-i.x1,-i.y1)}}}const Xh=new Hh;let $h=class{constructor(t){this.subRenderContribitions=t,this.time=Mn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,n,s,r,a,o,l,h,c,u,d)}))}};$h=zh([Ei(),Vh(0,Li(Zi)),Vh(0,Di(jl)),Gh("design:paramtypes",[Object])],$h);const Yh=new class{constructor(){this.time=Mn.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){var p,g;const{clipConfig:f}=t.attribute;if(!f)return;const m=t.getClipPath();if(!m)return;const y=!(c||u),b=t.AABBBounds,v=null!==(p=t.attribute.width)&&void 0!==p?p:b.width(),x=null!==(g=t.attribute.height)&&void 0!==g?g:b.height();y&&e.save(),e.beginPath(),!1===m.draw(e,[v,x],i+v/2,n+x/2,0)&&e.closePath(),c&&c(e,t.attribute,l,!0),y&&e.clip()}};const qh=new class{constructor(){this.time=Mn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){const{clipConfig:p}=t.attribute;p&&t.getClipPath()&&(c||u||e.restore())}};const Kh=new class{constructor(){this.time=Mn.afterFillStroke,this.useStyle=!0,this.order=10,this._tempSymbolGraphic=null}createCommonPattern(t,e,i,n,s){const r=(t-2*e)/2,a=n.dpr,o=Rr.allocate({width:t,height:t,dpr:a}),l=o.getContext("2d");if(!l)return null;l.inuse=!0,l.clearMatrix(),l.setTransformForCurrent(!0),l.clearRect(0,0,t,t),s(r,l);const h=n.createPattern(o.nativeCanvas,"repeat");return h.setTransform&&h.setTransform(new DOMMatrix([1/a,0,0,1/a,0,0])),Rr.free(o),h}createCirclePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,at),e.fill()}))}createDiamondPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{const s=t/2,r=s;n.fillStyle=i,n.moveTo(s,r-e),n.lineTo(e+s,r),n.lineTo(s,r+e),n.lineTo(s-e,r),n.closePath(),n.fill()}))}createRectPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const s=e,r=s;n.fillStyle=i,n.fillRect(s,r,2*t,2*t)}))}createVerticalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,s)=>{const r=e;s.fillStyle=i,s.fillRect(r,0,2*n,t)}))}createHorizontalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,s)=>{const r=e;s.fillStyle=i,s.fillRect(0,r,t,2*n)}))}createBiasLRLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(0,0),n.lineTo(t,t);const s=t/2,r=-s;n.moveTo(s,r),n.lineTo(s+t,r+t),n.moveTo(-s,-r),n.lineTo(-s+t,-r+t),n.stroke()}))}createBiasRLLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(t,0),n.lineTo(0,t);const s=t/2,r=s;n.moveTo(t+s,r),n.lineTo(s,r+t),n.moveTo(t-s,-r),n.lineTo(-s,-r+t),n.stroke()}))}createGridPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const s=e,r=s;n.fillStyle=i,n.fillRect(s,r,t,t),n.fillRect(s+t,r+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=l.texture,textureColor:g=l.textureColor,textureSize:f=l.textureSize,texturePadding:m=l.texturePadding}=t.attribute;p&&this.drawTexture(p,t,e,i,n,l,g,f,m)}drawTexture(t,e,i,n,s,r,a,o,l){var h;const{textureRatio:c=r.textureRatio,textureOptions:u=null}=e.attribute;let d=this.textureMap.get(t);if(!d)switch(t){case"circle":d=this.createCirclePattern(o,l,a,i);break;case"diamond":d=this.createDiamondPattern(o,l,a,i);break;case"rect":d=this.createRectPattern(o,l,a,i);break;case"vertical-line":d=this.createVerticalLinePattern(o,l,a,i);break;case"horizontal-line":d=this.createHorizontalLinePattern(o,l,a,i);break;case"bias-lr":d=this.createBiasLRLinePattern(o,l,a,i);break;case"bias-rl":d=this.createBiasRLLinePattern(o,l,a,i);break;case"grid":d=this.createGridPattern(o,l,a,i)}if(u&&u.dynamicTexture){const{gridConfig:d={},useNewCanvas:p}=u,g=e.AABBBounds;n=g.x1,s=g.y1;const f=i;let m;if(p){m=Rr.allocate({width:g.width(),height:g.height(),dpr:i.dpr});const t=m.getContext("2d");t.clearRect(0,0,g.width(),g.height()),n=0,s=0,i=t}if(f.save(),e.parent&&!e.transMatrix.onlyTranslate()){const{scrollX:t=0,scrollY:i=0}=e.parent.attribute;f.setTransformFromMatrix(e.parent.globalTransMatrix),f.translate(t,i,!0)}f.setCommonStyle(e,e.attribute,n,s,r),f.clip();const y=g.width(),b=g.height(),v=l,x=o,_=d.columns?d.columns:Math.ceil(y/x),A=d.rows?d.rows:Math.ceil(b/x),S=d.gutterColumn?d.gutterColumn:2*v,T=d.gutterRow?d.gutterRow:2*v;this._tempSymbolGraphic||(this._tempSymbolGraphic=Ql({}));const w=d.columns?y/d.columns:x,M=d.rows?b/d.rows:x;this._tempSymbolGraphic.setAttributes({size:[w-S,M-T],symbolType:t});const B=this._tempSymbolGraphic.getParsedPath();for(let t=0;t<A;t++)for(let r=0;r<_;r++){const o=n+x/2+r*x,l=s+x/2+t*x;null===(h=u.beforeDynamicTexture)||void 0===h||h.call(u,i,t,r,A,_,c,e,g.width(),g.height()),i.beginPath(),!1===B.draw(i,Math.min(w-S,M-T),o,l,0)&&i.closePath(),i.fillStyle=a,u.dynamicTexture(i,t,r,A,_,c,e,g.width(),g.height())}p&&(f.globalAlpha=1,f.drawImage(m.nativeCanvas,0,0,m.nativeCanvas.width,m.nativeCanvas.height,g.x1,g.y1,g.width()*f.dpr,g.height()*f.dpr)),f.restore()}else if(d)i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,n,s,r),i.fillStyle=d,i.fill(),i.highPerformanceRestore();else if("wave"===t){i.save(),i.setCommonStyle(e,e.attribute,n,s,r),i.clip();const t=e.AABBBounds;(function(t,e,i,n,s,r,a){const{fill:o="orange",percent:l=.6,frequency:h=4,opacity:c,phi:u=0}=s;let{amplitude:d=10}=s;d*=function(t){return t<=.5?4*t-1:-4*t+3}(e);const p=n*(1-l),g=i,f=Math.max(Math.round(g/70),2);t.beginPath(),t.moveTo(0+r,n+a),t.lineTo(0+r,p+a);const m=g/h*e,y=g/Math.PI/(2*h);for(let e=0;e<g;e+=f){const i=d*Math.sin((e+m+u)/y+u);t.lineTo(e+r,p+i+a)}t.lineTo(g+r,n+a),t.closePath(),t.fillStyle=o,isFinite(c)&&(t.globalAlpha=c),t.fill()})(i,c,t.width(),t.height(),Object.assign(Object.assign({},u||{}),{fill:a}),n+t.x1-n,s+t.y1-s),i.restore()}}};const Zh=new class{constructor(){this.time=Mn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,g=d&&!1!==d.visible,f=p&&!1!==p.visible;if(!g&&!f)return;const{innerPadding:m=l.innerPadding,outerPadding:y=l.outerPadding,startAngle:b=l.startAngle,endAngle:v=l.endAngle,opacity:x=l.opacity,x:_=l.x,y:A=l.y,scaleX:S=l.scaleX,scaleY:T=l.scaleY,keepStrokeScale:w=l.keepStrokeScale}=t.attribute;let{innerRadius:M=l.innerRadius,outerRadius:B=l.outerRadius}=t.attribute;B+=y,M-=m;const C=(s,r)=>{const a=!(!s||!s.stroke),{distance:o=l[r].distance}=s,h=w?o:Gs(e,o,e.dpr),c=o/B,d="outerBorder"===r?1:-1;if(t.setAttributes({outerRadius:B+d*h,innerRadius:M-d*h,startAngle:b-d*c,endAngle:v+d*c}),e.beginPath(),Ol(t,e,i,n,B+d*h,M-d*h),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,s,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=x,e.setStrokeStyle(t,s,(_-i)/S,(A-n)/T,l[r]),l[r].opacity=a,e.stroke()}};g&&C(d,"outerBorder"),f&&C(p,"innerBorder"),t.setAttributes({outerRadius:B,innerRadius:M,startAngle:b,endAngle:v})}},Jh=Kh,Qh=Xh,tc=nt/2;function ec(t,e,i,n,s,r){let a,o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],l=arguments.length>7?arguments[7]:void 0;if(Array.isArray(o)&&(l=o,o=!0),n<0&&(e+=n,n=-n),s<0&&(i+=s,s=-s),y(r,!0))a=[r=ot(r),r,r,r];else if(Array.isArray(r)){const t=r;let e,i;switch(t.length){case 0:a=[0,0,0,0];break;case 1:e=ot(t[0]),a=[e,e,e,e];break;case 2:case 3:e=ot(t[0]),i=ot(t[1]),a=[e,i,e,i];break;default:a=t,a[0]=ot(a[0]),a[1]=ot(a[1]),a[2]=ot(a[2]),a[3]=ot(a[3])}}else a=[0,0,0,0];if(n<0||a[0]+a[1]+a[2]+a[3]<1e-12)return t.rect(e,i,n,s);const[h,c,u,d]=[[e,i],[e+n,i],[e+n,i+s],[e,i+s]],p=Math.min(n/2,s/2),g=[Math.min(p,a[0]),Math.min(p,a[1]),Math.min(p,a[2]),Math.min(p,a[3])],f=[h[0]+g[0],h[1]],m=[h[0],h[1]+g[0]],b=[c[0]-g[1],c[1]],v=[c[0],c[1]+g[1]],x=[u[0]-g[2],u[1]],_=[u[0],u[1]-g[2]],A=[d[0]+g[3],d[1]],S=[d[0],d[1]-g[3]];if(t.moveTo(f[0],f[1]),o){if(l&&l[0]?l[0](f[0],f[1],b[0],b[1]):t.lineTo(b[0],b[1]),!N(b,v)){l&&l[0]&&t.moveTo(b[0],b[1]);const e=b[0],i=b[1]+g[1];t.arc(e,i,g[1],-tc,0,!1)}if(l&&l[1]?l[1](v[0],v[1],_[0],_[1]):t.lineTo(_[0],_[1]),!N(x,_)){const e=_[0]-g[2],i=_[1];l&&l[1]&&t.moveTo(_[0],_[1]),t.arc(e,i,g[2],0,tc,!1)}if(l&&l[2]?l[2](x[0],x[1],A[0],A[1]):t.lineTo(A[0],A[1]),!N(A,S)){const e=A[0],i=A[1]-g[3];l&&l[2]&&t.moveTo(A[0],A[1]),t.arc(e,i,g[3],tc,nt,!1)}if(l&&l[3]?l[3](S[0],S[1],m[0],m[1]):t.lineTo(m[0],m[1]),!N(f,m)){const e=f[0],i=f[1]+g[0];l&&l[3]&&t.moveTo(m[0],m[1]),t.arc(e,i,g[0],nt,nt+tc,!1)}}else l&&l[0]?l[0](f[0],f[1],b[0],b[1]):t.lineTo(b[0],b[1]),l&&l[1]?l[1](b[0],b[1],x[0],x[1]):t.lineTo(x[0],x[1]),l&&l[2]?l[2](x[0],x[1],A[0],A[1]):t.lineTo(A[0],A[1]),l&&l[2]?l[2](A[0],A[1],f[0],f[1]):t.lineTo(f[0],f[1]);return!l&&t.closePath(),t}var ic=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class nc{constructor(){this.time=Mn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,m=p&&!1!==p.visible;if(!f&&!m)return;const{cornerRadius:y=l.cornerRadius,cornerType:b=l.cornerType,opacity:v=l.opacity,x:x=l.x,y:_=l.y,scaleX:A=l.scaleX,scaleY:S=l.scaleY,x1:T,y1:w,keepStrokeScale:M=l.keepStrokeScale}=t.attribute;let{width:B,height:C}=t.attribute;B=(null!=B?B:T-i)||0,C=(null!=C?C:w-n)||0;const k=(s,r)=>{const a=!(!s||!s.stroke),o="outerBorder"===r?-1:1,{distance:h=l[r].distance}=s,c=M?h:Gs(e,h,e.dpr),d=i+o*c,p=n+o*c,f=2*c;if(0===y||g(y)&&y.every((t=>0===t))?(e.beginPath(),e.rect(d,p,B-o*f,C-o*f)):(e.beginPath(),ec(e,d,p,B-o*f,C-o*f,y,"bevel"!==b)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,s,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=v,e.setStrokeStyle(t,s,(x-i)/A,(_-n)/S,l[r]),l[r].opacity=a,e.stroke()}};f&&k(d,"outerBorder"),m&&k(p,"innerBorder")}}let sc=class{constructor(){this.time=Mn.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){const{stroke:p=l.stroke}=t.attribute;Array.isArray(p)&&p.some((t=>!1===t))&&(d.doStroke=!1)}};sc=ic([Ei()],sc);let rc=class{constructor(){this.time=Mn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u){const{x1:d,y1:p,x:f=l.x,y:m=l.y,stroke:y=l.stroke,cornerRadius:b=l.cornerRadius,cornerType:v=l.cornerType}=t.attribute;let{width:x,height:_}=t.attribute;if(x=(null!=x?x:d-f)||0,_=(null!=_?_:p-m)||0,Array.isArray(y)&&y.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,i,n,l),!(0===b||g(b)&&b.every((t=>0===t)))){let s,r=0;return ec(e,i,n,x,_,b,"bevel"!==v,new Array(4).fill(0).map(((a,o)=>(a,h,c,u)=>{y[o]&&(r===o-1&&y[o]===s||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:y[o]}),i,n,l),e.beginPath(),e.moveTo(a,h),s=y[o]),r=o,e.lineTo(c,u),e.stroke(),3===o&&e.beginPath())}))),void e.stroke()}if(e.beginPath(),e.moveTo(i,n),y[0]?e.lineTo(i+x,n):e.moveTo(i+x,n),y[1]?e.lineTo(i+x,n+_):e.moveTo(i+x,n+_),y[2]?e.lineTo(i,n+_):e.moveTo(i,n+_),y[3]){const t=y[0]?n-e.lineWidth/2:n;e.lineTo(i,t)}else e.moveTo(i,n);e.stroke()}}};rc=ic([Ei()],rc);const ac=new nc,oc=Kh,lc=Xh;const hc=new class extends nc{constructor(){super(...arguments),this.time=Mn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u){return super.drawShape(t,e,i,n,s,r,a,o,l,h,c,u)}},cc=Xh;const uc=new class{constructor(){this.time=Mn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u){const d=t.getParsedPath();if(!d)return;const{outerBorder:p,innerBorder:g}=t.attribute,f=p&&!1!==p.visible,m=g&&!1!==g.visible;if(!f&&!m)return;const{size:y=l.size,opacity:b=l.opacity,x:v=l.x,y:x=l.y,scaleX:_=l.scaleX,scaleY:A=l.scaleY,keepStrokeScale:S=l.keepStrokeScale}=t.attribute,T=(s,r)=>{const a=!(!s||!s.stroke),{distance:o=l[r].distance}=s,h=S?o:Gs(e,o,e.dpr),c="outerBorder"===r?1:-1;if(e.beginPath(),!1===d.drawOffset(e,y,i,n,c*h)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,s,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=b,e.setStrokeStyle(t,s,(v-i)/_,(x-n)/A,l[r]),l[r].opacity=a,e.stroke()}};f&&T(p,"outerBorder"),m&&T(g,"innerBorder")}},dc=new class{constructor(){this.time=Mn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){const{clipRange:p=l.clipRange,x:g=l.x,y:f=l.y,z:m=l.z,size:y=l.size,scaleX:b=l.scaleX,scaleY:v=l.scaleY}=t.attribute,x=t.getParsedPath();x&&p<1&&p>0&&(e.beginPath(),x.drawWithClipRange&&x.drawWithClipRange(e,y,i,n,p,m,((s,r)=>{var a,h,c,d;if(t._parsedPath.svgCache){const e=Object.assign({},r);e.fill=null!==(a=r.fill)&&void 0!==a?a:t.attribute.fill,e.opacity=null!==(h=r.opacity)&&void 0!==h?h:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(c=r.stroke)&&void 0!==c?c:t.attribute.stroke,e.lineWidth=null!==(d=r.lineWidth)&&void 0!==d?d:t.attribute.lineWidth,r=e}r.stroke&&(u?u(e,t.attribute,l):o&&(e.setStrokeStyle(t,r,(g-i)/b,(f-n)/v,l),e.stroke()))})),r&&!x.isSvg&&(u?u(e,t.attribute,l):o&&(e.setStrokeStyle(t,t.attribute,(g-i)/b,(f-n)/v,l),e.stroke())))}},pc=Kh,gc=Xh,fc={x:0,y:0,z:0,lastModelMatrix:null};class mc{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions||(this.builtinContributions=[]),this.builtinContributions.push(Yh),this.builtinContributions.push(qh),this.builtinContributions.forEach((t=>this._renderContribitions.push(t))),this._renderContribitions.length&&(this._renderContribitions.sort(((t,e)=>e.order-t.order)),this._beforeRenderContribitions=this._renderContribitions.filter((t=>t.time===Mn.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===Mn.afterFillStroke)))}reInit(){this.init(this.graphicRenderContributions)}beforeRenderStep(t,e,i,n,s,r,a,o,l,h,c,u,d){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,n,s,r,a,o,l,h,c,u,d)}))}afterRenderStep(t,e,i,n,s,r,a,o,l,h,c,u,d){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,n,s,r,a,o,l,h,c,u,d)}))}drawPathProxy(t,e,i,n,s,r,a,o){if(!t.pathProxy)return!1;const l=Ur(t,null==r?void 0:r.theme)[t.type.replace("3d","")],{fill:h=l.fill,stroke:c=l.stroke,opacity:u=l.opacity,fillOpacity:d=l.fillOpacity,lineWidth:p=l.lineWidth,strokeOpacity:g=l.strokeOpacity,visible:f=l.visible,x:m=l.x,y:y=l.y}=t.attribute,b=wl(u,d,h),v=Bl(u,g),x=Sl(h),_=Tl(c,p);if(!f)return!0;if(!x&&!_)return!0;if(!(b||v||a||o))return!0;e.beginPath();return Pn(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,x,_,b,v,l,s,a,o),_&&(o?o(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,i-m,n-y,l),e.stroke())),x&&(a?a(e,t.attribute,l):b&&(e.setCommonStyle(t,t.attribute,i-m,n-y,l),e.fill())),this.afterRenderStep(t,e,i,n,x,_,b,v,l,s,a,o),!0}valid(t,e,i,n){const{fill:s=e.fill,background:r,stroke:a=e.stroke,opacity:o=e.opacity,fillOpacity:l=e.fillOpacity,lineWidth:h=e.lineWidth,strokeOpacity:c=e.strokeOpacity,visible:u=e.visible}=t.attribute,d=wl(o,l,s),p=Bl(o,c),g=Sl(s,r),f=Tl(a,h);return!(!t.valid||!u)&&!(!g&&!f)&&!!(d||p||i||n||r)&&{fVisible:d,sVisible:p,doFill:g,doStroke:f}}transform(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const{x:s=e.x,y:r=e.y,z:a=e.z,scaleX:o=e.scaleX,scaleY:l=e.scaleY,angle:h=e.angle,postMatrix:c}=t.attribute,u=i.modelMatrix,d=i.camera;fc.x=s,fc.y=r,fc.z=a,fc.lastModelMatrix=u;const p=d&&(n||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 n=Ko.allocate(),s=Ko.allocate();Vl(s,t,e),Xo(n,u||n,s),fc.x=0,fc.y=0,fc.z=0,i.modelMatrix=n,i.setTransform(1,0,0,1,0,0,!0),Ko.free(s)}if(g&&!u){const n=t.getOffsetXY(e);fc.x+=n.x,fc.y+=n.y,fc.z=a,i.setTransformForCurrent()}else if(p)fc.x=0,fc.y=0,fc.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(d&&i.project){const n=t.getOffsetXY(e);fc.x+=n.x,fc.y+=n.y,this.transformWithoutTranslate(i,fc.x,fc.y,fc.z,o,l,h)}else i.transformFromMatrix(t.transMatrix,!0),fc.x=0,fc.y=0,fc.z=0;return fc}transformUseContext2d(t,e,i,n){const s=n.camera;if(this.camera=s,s){const e=t.AABBBounds,s=e.x2-e.x1,r=e.y2-e.y1,a=n.project(0,0,i),o=n.project(s,0,i),l=n.project(s,r,i),h={x:0,y:0},c={x:s,y:0},u={x:s,y:r};n.camera=null;const d=1/(h.x*(u.y-c.y)-c.x*u.y+u.x*c.y+(c.x-u.x)*h.y),p=-(h.y*(l.x-o.x)-c.y*l.x+u.y*o.x+(c.y-u.y)*a.x)*d,g=(c.y*l.y+h.y*(o.y-l.y)-u.y*o.y+(u.y-c.y)*a.y)*d,f=(h.x*(l.x-o.x)-c.x*l.x+u.x*o.x+(c.x-u.x)*a.x)*d,m=-(c.x*l.y+h.x*(o.y-l.y)-u.x*o.y+(u.x-c.x)*a.y)*d,y=(h.x*(u.y*o.x-c.y*l.x)+h.y*(c.x*l.x-u.x*o.x)+(u.x*c.y-c.x*u.y)*a.x)*d,b=(h.x*(u.y*o.y-c.y*l.y)+h.y*(c.x*l.y-u.x*o.y)+(u.x*c.y-c.x*u.y)*a.y)*d;n.setTransform(p,g,f,m,y,b,!0)}}restoreTransformUseContext2d(t,e,i,n){this.camera&&(n.camera=this.camera)}transformWithoutTranslate(t,e,i,n,s,r,a){const o=t.project(e,i,n);t.translate(o.x,o.y,!1),t.scale(s,r,!1),t.rotate(a,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}_draw(t,e,i,n,s,r){const{context:a}=n;if(!a)return;const{renderable:o}=t.attribute;if(!1===o)return;a.highPerformanceSave();const l=this.transform(t,e,a,i),{x:h,y:c,z:u,lastModelMatrix:d}=l;this.z=u,this.drawPathProxy(t,a,h,c,n,s)||(this.drawShape(t,a,h,c,n,s,null,null,r),this.z=0,a.modelMatrix!==d&&Ko.free(a.modelMatrix),a.modelMatrix=d),a.highPerformanceRestore()}}var yc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},bc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},vc=function(t,e){return function(i,n){e(i,n,t)}};let xc=class extends mc{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Mo,this.builtinContributions=[Zh,Qh,Jh],this.init(t)}drawArcTailCapPath(t,e,i,n,s,r,a,o){const l=o-a,h=t.getParsedAngle(),c=h.startAngle;let u=h.endAngle;u=o;const d=u>c;let p=!1;if(s<r){const t=s;s=r,r=t}const{outerDeltaAngle:g,xors:f,yors:m,xirs:y,yirs:b,limitedOcr:v,outerCornerRadiusStart:x,outerCornerRadiusEnd:_,maxOuterCornerRadius:A,xore:S,yore:T,xire:w,yire:M,limitedIcr:B,innerDeltaAngle:C,innerStartAngle:k,innerCornerRadiusStart:P,innerCornerRadiusEnd:O,maxInnerCornerRadius:R}=Pl(t,c,u,r,s);if(v>it){const t=ut(x,v),r=ut(_,v),a=kl(y,b,f,m,s,t,Number(d)),o=kl(S,T,w,M,s,r,Number(d));if(v<A&&t===r)e.moveTo(i+a.cx+a.x01,n+a.cy+a.y01),e.arc(i+a.cx,n+a.cy,v,lt(a.y01,a.x01),lt(o.y01,o.x01),!d);else{const t=u-l-.03,a=lt(o.y11,o.x11);e.arc(i,n,s,t,a,!d),r>0&&e.arc(i+o.cx,n+o.cy,r,lt(o.y11,o.x11),lt(o.y01,o.x01),!d)}}else e.moveTo(i+f,n+m);if(!(r>it)||C<.001)e.lineTo(i+w,n+M),p=!0;else if(B>it){const t=ut(P,B),s=ut(O,B),a=kl(w,M,S,T,r,-s,Number(d)),o=kl(f,m,y,b,r,-t,Number(d));if(e.lineTo(i+a.cx+a.x01,n+a.cy+a.y01),B<R&&t===s){const t=lt(o.y01,o.x01);e.arc(i+a.cx,n+a.cy,B,lt(a.y01,a.x01),t,!d)}else{s>0&&e.arc(i+a.cx,n+a.cy,s,lt(a.y01,a.x01),lt(a.y11,a.x11),!d);const t=lt(a.cy+a.y11,a.cx+a.x11),o=u-l-.03;e.arc(i,n,r,t,o,d)}}else e.lineTo(i+r*ht(k),n+r*dt(k));return p}drawShape(t,e,i,n,s,r,o,l,h){h=null!=h?h:Ur(t,null==r?void 0:r.theme).arc;const{fill:c=h.fill,stroke:u=h.stroke,x:d=h.x,y:p=h.y,fillStrokeOrder:g=h.fillStrokeOrder}=t.attribute,f=this.valid(t,h,o,l);if(!f)return;const{fVisible:m,sVisible:y,doFill:b,doStroke:v}=f,{outerPadding:x=h.outerPadding,innerPadding:_=h.innerPadding,cap:A=h.cap,forceShowCap:S=h.forceShowCap}=t.attribute;let{outerRadius:T=h.outerRadius,innerRadius:w=h.innerRadius}=t.attribute;T+=x,w-=_;let M=0;const B=(a(A)&&A||A[0])&&"conical"===c.gradient;if(B){const{sc:e,startAngle:i,endAngle:n}=t.getParsedAngle();ot(n-i)<at-it&&(M=e||0,c.startAngle-=M,c.endAngle-=M)}let C=!1;const{isFullStroke:k,stroke:P}=(t=>{var e;let i=!0;if(a(t,!0)){for(let n=0;n<4;n++)Yr[n]=t,i&&(i=!(null!==(e=Yr[n])&&void 0!==e&&!e));i=t}else if(Array.isArray(t))for(let e=0;e<4;e++)Yr[e]=!!t[e],i&&(i=!!Yr[e]);else Yr[0]=!1,Yr[1]=!1,Yr[2]=!1,Yr[3]=!1;return{isFullStroke:i,stroke:Yr}})(u);if((b||k)&&(e.beginPath(),Ol(t,e,i,n,T,w),C=!0,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,n,b,v,m,y,h,s,o,l),g?(this._runStroke(t,e,i,n,h,v,k,y,l),this._runFill(t,e,i,n,h,b,m,d,p,o)):(this._runFill(t,e,i,n,h,b,m,d,p,o),this._runStroke(t,e,i,n,h,v,k,y,l))),!k&&v&&(e.beginPath(),Ol(t,e,i,n,T,w,P),C||this.beforeRenderStep(t,e,i,n,b,v,m,y,h,s,o,l),l?l(e,t.attribute,h):y&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke())),(a(A)&&A||A[1])&&S){const{startAngle:r,endAngle:a}=t.getParsedAngle();if(ot(a-r)>=at-it){e.beginPath();const r=Math.abs(T-w)/2/T,{endAngle:a=h.endAngle,fill:c=h.fill}=t.attribute,u=a;this.drawArcTailCapPath(t,e,i,n,T,w,u,u+r),C||this.beforeRenderStep(t,e,i,n,b,v,m,y,h,s,o,l);const d=()=>{if(b){const s=c;if("conical"===s.gradient){const r=function(t,e,i,n){const{stops:s,startAngle:r,endAngle:a}=n;for(;i<0;)i+=at;for(;i>at;)i-=at;if(i<r)return s[0].color;if(i>a)return s[0].color;let o,l,h=(i-r)/(a-r);for(let t=0;t<s.length;t++)if(s[t].offset>=h){o=s[t-1],l=s[t];break}return h=(h-o.offset)/(l.offset-o.offset),rl(o.color,l.color,h,!1)}(0,0,a,s);o||wl&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=r,e.fill())}}},p=()=>{v&&(l||y&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke()))};d(),p()}}this.afterRenderStep(t,e,i,n,b,v,m,y,h,s,o,l),B&&(c.startAngle+=M,c.endAngle+=M)}_runFill(t,e,i,n,s,r,a,o,l,h){r&&(h?h(e,t.attribute,s):a&&(e.setCommonStyle(t,t.attribute,o-i,l-n,s),e.fill()))}_runStroke(t,e,i,n,s,r,a,o,l){r&&a&&(l||o&&(e.setStrokeStyle(t,t.attribute,i,n,s),e.stroke()))}draw(t,e,i,n){const s=Ur(t,null==n?void 0:n.theme).arc;this._draw(t,s,!1,i,n,s)}};function _c(t,e,i,n){if(!e.p1)return;const{offsetX:s=0,offsetY:r=0,offsetZ:a=0}=n||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(s+e.p1.x,r+e.p1.y,s+e.p2.x,r+e.p2.y,s+e.p3.x,r+e.p3.y,a):t.lineTo(s+e.p1.x,r+e.p1.y,a);else if(e.p2&&e.p3){const[n]=Fn(e,i);t.bezierCurveTo(s+n.p1.x,r+n.p1.y,s+n.p2.x,r+n.p2.y,s+n.p3.x,r+n.p3.y,a)}else{const n=e.getPointAt(i);t.lineTo(s+n.x,r+n.y,a)}}function Ac(t,e,i,n,s,r,a){var o;let l=e.p0,h=n;if(i&&i.originP1===i.originP2&&(l=i.p0),e.defined)n||(t.lineTo(l.x+s,l.y+r,a),h=!n);else{const{originP1:c,originP2:u}=e;let d;if(c&&!1!==c.defined&&!i?d=l:c&&!1!==u.defined&&(d=null!==(o=e.p3)&&void 0!==o?o:e.p1),n){h=!n;const i=d?d.x:e.p0.x,o=d?d.y:e.p0.y;t.moveTo(i+s,o+r,a)}else d&&(h=!n,t.lineTo(d.x+s,d.y+r,a))}return h}xc=yc([Ei(),vc(0,Li(Zi)),vc(0,Di(Rl)),bc("design:paramtypes",[Object])],xc);var Sc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let Tc=class extends mc{constructor(){super(...arguments),this.numberType=Oo}draw(t,e,i,n){const s=Ur(t,null==n?void 0:n.theme).line;this._draw(t,s,!1,i,n)}drawSegmentItem(t,e,i,n,s,r,a,o,l,h,c,u,d,p,f){var m;if(!e)return;t.beginPath();(function(t,e,i,n,s){const{offsetX:r=0,offsetY:a=0,offsetZ:o=0,mode:l="none",drawConnect:h=!1}=s||{};if(h&&"none"===l)return;if(!e)return;let c=!0;const{curves:u}=e;if(i>=1){if(h){let e,i=!0;u.forEach(((n,s)=>{n.originP1!==n.originP2?(i=Ac(t,n,e,i,r,a,o),e=n):e=n}))}else u.forEach((e=>{e.defined?(c&&t.moveTo(e.p0.x+r,e.p0.y+a,o),_c(t,e,1,s),c=!1):c=!0}));return}if(i<=0)return;let d;"x"===n?d=Tn.ROW:"y"===n?d=Tn.COLUMN:"auto"===n&&(d=e.direction);const p=i*e.tryUpdateLength(d);let g=0,f=!0,m=null;for(let e=0,i=u.length;e<i;e++){const i=u[e],n=i.getLength(d),l=(p-g)/n;if(g+=n,l<0)break;if(h){if(i.originP1===i.originP2){m=i;continue}f=Ac(t,i,m,f,r,a,o),m=i}else{if(!i.defined){c=!0;continue}c&&t.moveTo(i.p0.x+r,i.p0.y+a,o),_c(t,i,ut(l,1),s),c=!1}}})(t,e,l,h,{offsetX:c,offsetY:u,offsetZ:null!==(m=this.z)&&void 0!==m?m:0}),d.cache&&!g(d.cache)&&d.cache.curves.every((t=>t.defined))&&d.attribute.curveType&&d.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(d,a,o);const{x:y=0,x:b=0}=a;return!1!==i&&(p?p(t,a,o):s&&(t.setCommonStyle(d,a,y-c,b-u,o),t.fill())),!1!==n&&(f?f(t,a,o):r&&(t.setStrokeStyle(d,a,y-c,b-u,o),t.stroke())),!1}drawLinearLineHighPerformance(t,e,i,n,s,r,a,o,l,h,c,u,d){var p;e.beginPath();const g=null!==(p=this.z)&&void 0!==p?p:0,{points:f}=t.attribute,m=f[0];e.moveTo(m.x+a,m.y+o,g);for(let t=1;t<f.length;t++){const i=f[t];e.lineTo(i.x+a,i.y+o,g)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);const{x:y=0,x:b=0}=t.attribute;!1!==i&&(u?u(e,t.attribute,l):s&&(e.setCommonStyle(t,t.attribute,y-a,b-o,l),e.fill())),!1!==n&&(d?d(e,t.attribute,l):r&&(e.setStrokeStyle(t,t.attribute,y-a,b-o,l),e.stroke()))}drawShape(t,e,i,n,s,r,a,o){const l=Ur(t,null==r?void 0:r.theme).line,{fill:h=l.fill,stroke:c=l.stroke,fillOpacity:u=l.fillOpacity,strokeOpacity:d=l.strokeOpacity,segments:p,points:g,closePath:f,curveTension:m=l.curveTension,connectedType:y=l.connectedType}=t.attribute;if(!this.valid(t,l,a,o))return;let{curveType:b=l.curveType}=t.attribute;f&&"linear"===b&&(b="linearClosed");const{clipRange:v=l.clipRange,clipRangeByDimension:x=l.clipRangeByDimension}=t.attribute;if(1===v&&!p&&!g.some((t=>!1===t.defined))&&"linear"===b)return this.drawLinearLineHighPerformance(t,e,!!h,!!c,u,d,i,n,l,s,r,a,o);function _(t,e){return"none"===e?t:t.filter((t=>!1!==t.defined))}if(t.shouldUpdateShape()){const{points:e,segments:i}=t.attribute,n=e;if(i&&i.length){let e,n;if(t.cache=i.map(((t,i)=>{if(t.points.length<=1&&0===i)return t.points[0]&&(n={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===i?e={x:n.endX,y:n.endY,defined:n.curves[n.curves.length-1].defined}:i>1&&(e.x=n.endX,e.y=n.endY,e.defined=n.curves[n.curves.length-1].defined);const s=fs(_(t.points,y),b,{startPoint:e,curveTension:m});return n=s,s})).filter((t=>!!t)),"linearClosed"===b){let e;for(let i=0;i<t.cache.length;i++){const n=t.cache[i];for(let t=0;t<n.curves.length;t++)if(n.curves[t].defined){e=n.curves[t].p0;break}if(e)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(e.x,e.y,!0)}}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=fs(_(n,y),b,{curveTension:m})}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){const s=t.attribute.segments.filter((t=>t.points.length));if(1===s[0].points.length&&s.shift(),1===v){let r=!1;t.cache.forEach(((p,g)=>{r||(r=this.drawSegmentItem(e,p,!!h,!!c,u,d,s[g],[l,t.attribute],v,x,i,n,t,a,o))}))}else{const r=t.cache.reduce(((t,e)=>t+e.getLength()),0),p=v*r;let g=0,f=!1;t.cache.forEach(((r,m)=>{if(f)return;const y=r.getLength(),b=(p-g)/y;g+=y,b>0&&(f=this.drawSegmentItem(e,r,!!h,!!c,u,d,s[m],[l,t.attribute],ut(b,1),x,i,n,t,a,o))}))}}else this.drawSegmentItem(e,t.cache,!!h,!!c,u,d,t.attribute,l,v,x,i,n,t,a,o)}};Tc=Sc([Ei()],Tc);var wc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Mc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Bc=function(t,e){return function(i,n){e(i,n,t)}};let Cc=class extends mc{constructor(t){super(),this.graphicRenderContributions=t,this.type="rect",this.numberType=Eo,this.builtinContributions=[ac,lc,oc],this.init(t)}drawShape(t,e,i,n,s,r,a,o,l){l=null!=l?l:Ur(t,null==r?void 0:r.theme).rect;const{fill:h=l.fill,background:c,stroke:u=l.stroke,cornerRadius:d=l.cornerRadius,cornerType:p=l.cornerType,opacity:f=l.opacity,fillOpacity:m=l.fillOpacity,lineWidth:y=l.lineWidth,strokeOpacity:b=l.strokeOpacity,visible:v=l.visible,x1:x,y1:_,x:A=l.x,y:S=l.y,fillStrokeOrder:T=l.fillStrokeOrder}=t.attribute;let{width:w,height:M}=t.attribute;w=(null!=w?w:x-A)||0,M=(null!=M?M:_-S)||0;const B=Ml(f,m,w,M,h),C=Cl(f,b,w,M),k=Sl(h,c),P=Tl(u,y);if(!t.valid||!v)return;if(!k&&!P)return;if(!(B||C||a||o||c))return;0===d||g(d)&&d.every((t=>0===t))?(e.beginPath(),e.rect(i,n,w,M)):(e.beginPath(),ec(e,i,n,w,M,d,"bevel"!==p));const O={doFill:k,doStroke:P};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,k,P,B,C,l,s,a,o,O),T?(this._runStroke(t,e,i,n,l,O,C,A,S,o),this._runFill(t,e,i,n,l,O,B,A,S,a)):(this._runFill(t,e,i,n,l,O,B,A,S,a),this._runStroke(t,e,i,n,l,O,C,A,S,o)),this.afterRenderStep(t,e,i,n,k,P,B,C,l,s,a,o)}_runFill(t,e,i,n,s,r,a,o,l,h){r.doFill&&(h?h(e,t.attribute,s):a&&(e.setCommonStyle(t,t.attribute,o-i,l-n,s),e.fill()))}_runStroke(t,e,i,n,s,r,a,o,l,h){r.doStroke&&(h?h(e,t.attribute,s):a&&(e.setStrokeStyle(t,t.attribute,o-i,l-n,s),e.stroke()))}draw(t,e,i,n){const s=Ur(t,null==n?void 0:n.theme).rect;this._draw(t,s,!1,i,n,s)}};Cc=wc([Ei(),Bc(0,Li(Zi)),Bc(0,Di(El)),Mc("design:paramtypes",[Object])],Cc);var kc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Pc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Oc=function(t,e){return function(i,n){e(i,n,t)}};let Rc=class extends mc{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=jo,this.builtinContributions=[uc,gc,pc,dc],this.init(t)}drawShape(t,e,i,n,s,r,a,o,l){var h;l=null!=l?l:Ur(t,null==r?void 0:r.theme).symbol;const{size:c=l.size,x:u=l.x,y:d=l.y,scaleX:p=l.scaleX,scaleY:f=l.scaleY,fillStrokeOrder:m=l.fillStrokeOrder,clipRange:y=l.clipRange}=t.attribute,b=this.valid(t,l,a,o);if(!b)return;const{fVisible:v,sVisible:x,doFill:_,doStroke:A}=b,S=t.getParsedPath();if(!S)return;const{keepDirIn3d:T=l.keepDirIn3d}=t.attribute,w=null!==(h=this.z)&&void 0!==h?h:0;e.beginPath();let M=i,B=n,C=w;const k=e.camera;if(T&&k&&e.project){const t=e.project(i,n,w);e.camera=null,g(c)&&(c[0],c[1]),M=t.x,B=t.y,C=void 0}!1===S.draw(e,c,M,B,C,((s,r)=>{var h,c,g,b;if(t._parsedPath.svgCache){const e=Object.assign({},r);e.fill=null!==(h=r.fill)&&void 0!==h?h:t.attribute.fill,e.opacity=null!==(c=r.opacity)&&void 0!==c?c:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(g=r.stroke)&&void 0!==g?g:t.attribute.stroke,e.lineWidth=null!==(b=r.lineWidth)&&void 0!==b?b:t.attribute.lineWidth,r=e}const v=()=>{r.fill&&(a?a(e,t.attribute,l):(e.setCommonStyle(t,r,u-i,d-n,l),e.fill()))},_=()=>{r.stroke&&(o?o(e,t.attribute,l):x&&y>=1&&(e.setStrokeStyle(t,r,(u-i)/p,(d-n)/f,l),e.stroke()))};m?(_(),v()):(v(),_())}))&&e.closePath(),e.camera=k,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,_,A,v,x,l,s,a,o),m?(this._runStroke(t,e,i,n,l,A,x,u,d,S,y,p,f,o),this._runFill(t,e,i,n,l,_,v,u,d,S,a)):(this._runFill(t,e,i,n,l,_,v,u,d,S,a),this._runStroke(t,e,i,n,l,A,x,u,d,S,y,p,f,o)),this.afterRenderStep(t,e,i,n,_,A,v,x,l,s,a,o)}_runFill(t,e,i,n,s,r,a,o,l,h,c){r&&!h.isSvg&&(c?c(e,t.attribute,s):a&&(e.setCommonStyle(t,t.attribute,o-i,l-n,s),e.fill()))}_runStroke(t,e,i,n,s,r,a,o,l,h,c,u,d,p){r&&!h.isSvg&&(p?p(e,t.attribute,s):a&&c>=1&&(e.setStrokeStyle(t,t.attribute,(o-i)/u,(l-n)/d,s),e.stroke()))}draw(t,e,i,n){const s=Ur(t,null==n?void 0:n.theme).symbol;this._draw(t,s,!1,i,n)}};Rc=kc([Ei(),Oc(0,Li(Zi)),Oc(0,Di(Dl)),Pc("design:paramtypes",[Object])],Rc);const Lc=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new Xt)}allocate(t,e,i,n){if(!this.pools.length)return(new Xt).setValue(t,e,i,n);const s=this.pools.pop();return s.x1=t,s.y1=e,s.x2=i,s.y2=n,s}allocateByObj(t){if(!this.pools.length)return new Xt(t);const e=this.pools.pop();return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}};const Ic=new class extends Hh{constructor(){super(...arguments),this.time=Mn.beforeFillStroke}drawShape(t,e,i,n,s,r,a,o,l,h,u,d){var p,g,f,m,y,b,v,x,_,A;const{backgroundMode:S=l.backgroundMode,backgroundFit:T=l.backgroundFit,backgroundKeepAspectRatio:w=l.backgroundKeepAspectRatio}=t.attribute;let M,{background:B}=t.attribute;if(!B)return;const C=()=>{"richtext"===t.type&&(e.restore(),e.save(),M&&e.setTransformFromMatrix(M,!0,1))};let k;"richtext"===t.type&&(M=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());const P=c(B)&&B.background,O=t.transMatrix.onlyTranslate();if(P){const e=t.AABBBounds,i=(null!==(p=B.x)&&void 0!==p?p:e.x1)+(null!==(g=B.dx)&&void 0!==g?g:0),n=(null!==(f=B.y)&&void 0!==f?f:e.y1)+(null!==(m=B.dy)&&void 0!==m?m:0),s=null!==(y=B.width)&&void 0!==y?y:e.width(),r=null!==(b=B.height)&&void 0!==b?b:e.height();if(k=Lc.allocate(i,n,i+s,n+r),B=B.background,!O){const t=k.width(),e=k.height();k.set((null!==(v=B.x)&&void 0!==v?v:0)+(null!==(x=B.dx)&&void 0!==x?x:0),(null!==(_=B.y)&&void 0!==_?_:0)+(null!==(A=B.dy)&&void 0!==A?A:0),t,e)}}else k=t.AABBBounds,O||(k=Wh(Object.assign(Object.assign({},t.attribute),{angle:0,scaleX:1,scaleY:1,x:0,y:0,dx:0,dy:0})).clone());if(t.backgroundImg&&t.resources){const s=t.resources.get(B);if("success"!==s.state||!s.data)return void C();e.highPerformanceSave(),O&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,i,n,l),this.doDrawImage(e,s.data,k,{backgroundMode:S,backgroundFit:T,backgroundKeepAspectRatio:w}),e.highPerformanceRestore(),e.setTransformForCurrent()}else{const{backgroundCornerRadius:s}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,l),e.fillStyle=B,s?(ec(e,k.x1,k.y1,k.width(),k.height(),s,!0),e.fill()):e.fillRect(k.x1,k.y1,k.width(),k.height()),e.highPerformanceRestore()}P&&Lc.free(k),C()}};var Ec=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Dc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Fc=function(t,e){return function(i,n){e(i,n,t)}};let jc=class extends mc{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Uo,this.builtinContributions=[Ic],this.init(t)}drawShape(t,e,i,n,s,r,a,o){var l,h,c;const u=Ur(t,null==r?void 0:r.theme).text,{text:d,underline:p=u.underline,lineThrough:g=u.lineThrough,keepDirIn3d:f=u.keepDirIn3d,direction:m=u.direction,fontSize:y=u.fontSize,verticalMode:b=u.verticalMode,x:v=u.x,y:x=u.y}=t.attribute,_=null!==(l=ia(t.attribute.lineHeight,y))&&void 0!==l?l:y,A=this.valid(t,u,a,o);if(!A)return;const{fVisible:S,sVisible:T,doFill:w,doStroke:M}=A,B=!f,C=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,i,n,w,M,S,T,u,s,a,o),B&&this.transformUseContext2d(t,u,C,e);const k=(s,r,l,h)=>{let c=i+r;const d=n+l;if(h){e.highPerformanceSave(),c+=y;const t=qo.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,c,d),e.transformFromMatrix(t,!0),qo.free(t)}M&&(o?o(e,t.attribute,u):T&&(e.setStrokeStyle(t,t.attribute,v-i,x-n,u),e.strokeText(s,c,d,C))),w&&(a?a(e,t.attribute,u):S&&(e.setCommonStyle(t,t.attribute,v-i,x-n,u),e.fillText(s,c,d,C))),h&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(e.setTextStyleWithoutAlignBaseline(t.attribute,u,C),"horizontal"===m){const{multilineLayout:s}=t;if(!s)return void e.highPerformanceRestore();const{xOffset:r,yOffset:l}=s.bbox;M&&(o?o(e,t.attribute,u):T&&(e.setStrokeStyle(t,t.attribute,v-i,x-n,u),s.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+r+i,(t.topOffset||0)+l+n,C)})))),w&&(a?a(e,t.attribute,u):S&&(e.setCommonStyle(t,t.attribute,v-i,x-n,u),s.lines.forEach((s=>{e.fillText(s.str,(s.leftOffset||0)+r+i,(s.topOffset||0)+l+n,C),this.drawUnderLine(p,g,t,(s.leftOffset||0)+r+i,(s.topOffset||0)+l+n,s.descent,(s.descent-s.ascent)/2,C,u,e,{width:s.width})}))))}else{let{textAlign:i=u.textAlign,textBaseline:n=u.textBaseline}=t.attribute;if(!b){const e=i;i=null!==(h=t.getBaselineMapAlign()[n])&&void 0!==h?h:"left",n=null!==(c=t.getAlignMapBaseline()[e])&&void 0!==c?c:"top"}t.tryUpdateAABBBounds();const s=t.cache,{verticalList:r}=s;e.textAlign="left",e.textBaseline="top";const a=_*r.length;let o=0;r.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);o=ct(e,o)}));let l=0,d=0;"bottom"===n?d=-a:"middle"===n&&(d=-a/2),"center"===i?l-=o/2:"right"===i&&(l-=o),r.forEach(((t,e)=>{const n=t.reduce(((t,e)=>t+(e.width||0)),0),s=o-n;let r=l;"center"===i?r+=s/2:"right"===i&&(r+=s),t.forEach((t=>{const{text:i,width:n,direction:s}=t;k(i,a-(e+1)*_+d,r,s),r+=n}))}))}B&&this.restoreTransformUseContext2d(t,u,C,e),this.afterRenderStep(t,e,i,n,w,M,S,T,u,s,a,o)}draw(t,e,i,n){const s=Ur(t,null==n?void 0:n.theme).text,{keepDirIn3d:r=s.keepDirIn3d}=t.attribute,a=!r;this._draw(t,s,a,i,n)}drawUnderLine(t,e,i,n,s,r,a,o,h,c,u){if(e+t<=0)return;const{textAlign:d=h.textAlign,fill:p=h.fill,opacity:g=h.opacity,underlineOffset:f=h.underlineOffset,underlineDash:m=h.underlineDash,fillOpacity:y=h.fillOpacity}=i.attribute,b=!l(u),v=b?u.width:i.clipedWidth,x=b?0:Ul(d,v),_={lineWidth:0,stroke:p,opacity:g,strokeOpacity:y};if(t){_.lineWidth=t,c.setStrokeStyle(i,_,n,s,h),m&&c.setLineDash(m),c.beginPath();const e=s+r+f;c.moveTo(n+x,e,o),c.lineTo(n+x+v,e,o),c.stroke()}if(e){_.lineWidth=e,c.setStrokeStyle(i,_,n,s,h),c.beginPath();const t=s+a;c.moveTo(n+x,t,o),c.lineTo(n+x+v,t,o),c.stroke()}}};function Uc(t,e,i,n){t.moveTo(e[0].x+i,e[0].y+n);for(let s=1;s<e.length;s++)t.lineTo(e[s].x+i,e[s].y+n)}function Nc(t,e){return Math.sqrt(t*t+e*e)}function Wc(t,e,i,n,s){const r=e/i;return{x:t.x-n*r,y:t.y-s*r}}jc=Ec([Ei(),Fc(0,Li(Zi)),Fc(0,Di(Fl)),Dc("design:paramtypes",[Object])],jc);const zc=Kh,Gc=Xh;var Vc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Hc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Xc=function(t,e){return function(i,n){e(i,n,t)}};let $c=class extends mc{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Lo,this.builtinContributions=[Gc,zc],this.init(t)}drawShape(t,e,i,n,s,r,a,o){const l=Ur(t,null==r?void 0:r.theme).polygon,{points:h=l.points,cornerRadius:c=l.cornerRadius,x:u=l.x,y:d=l.y,closePath:p=l.closePath,fillStrokeOrder:f=l.fillStrokeOrder}=t.attribute,m=this.valid(t,l,a,o);if(!m)return;const{fVisible:y,sVisible:b,doFill:v,doStroke:x}=m;e.beginPath(),c<=0||g(c)&&c.every((t=>0===t))?Uc(e.camera?e:e.nativeContext,h,i,n):function(t,e,i,n,s){let r=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];var a;if(e.length<3)return void Uc(t,e,i,n);let o=0,l=e.length-1;r||(o+=1,l-=1,t.moveTo(e[0].x+i,e[0].y+n));for(let r=o;r<=l;r++){const o=e[0===r?l:(r-1)%e.length],h=e[r%e.length],c=e[(r+1)%e.length],u=h.x-o.x,d=h.y-o.y,p=h.x-c.x,g=h.y-c.y,f=(Math.atan2(d,u)-Math.atan2(g,p))/2,m=Math.abs(Math.tan(f));let y=Array.isArray(s)?null!==(a=s[r%e.length])&&void 0!==a?a:0:s,b=y/m;const v=Nc(u,d),x=Nc(p,g),_=Math.min(v,x);b>_&&(b=_,y=_*m);const A=Wc(h,b,v,u,d),S=Wc(h,b,x,p,g),T=2*h.x-A.x-S.x,w=2*h.y-A.y-S.y,M=Nc(T,w),B=Wc(h,Nc(b,y),M,T,w);let C=Math.atan2(A.y-B.y,A.x-B.x);const k=Math.atan2(S.y-B.y,S.x-B.x);let P=k-C;P<0&&(C=k,P=-P),P>Math.PI&&(P-=Math.PI),0===r?t.moveTo(A.x+i,A.y+n):t.lineTo(A.x+i,A.y+n),P&&t.arcTo(h.x+i,h.y+n,S.x+i,S.y+n,y),t.lineTo(S.x+i,S.y+n)}r||t.lineTo(e[l+1].x+i,e[l+1].y+n)}(e.camera?e:e.nativeContext,h,i,n,c,p),p&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,v,x,y,b,l,s,a,o);const _=()=>{v&&(a?a(e,t.attribute,l):y&&(e.setCommonStyle(t,t.attribute,u-i,d-n,l),e.fill()))},A=()=>{x&&(o?o(e,t.attribute,l):b&&(e.setStrokeStyle(t,t.attribute,u-i,d-n,l),e.stroke()))};f?(A(),_()):(_(),A()),this.afterRenderStep(t,e,i,n,v,x,y,b,l,s,a,o)}draw(t,e,i,n){const s=Ur(t,null==n?void 0:n.theme).polygon;this._draw(t,s,!1,i,n)}};$c=Vc([Ei(),Xc(0,Li(Zi)),Xc(0,Di(Il)),Hc("design:paramtypes",[Object])],$c);var Yc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},qc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Kc=function(t,e){return function(i,n){e(i,n,t)}};const Zc=["","repeat-x","repeat-y","repeat"];let Jc=class extends mc{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Po,this.builtinContributions=[hc,cc],this.init(t)}drawShape(t,e,i,n,s,r,a,o){const l=Ur(t).image,{repeatX:h=l.repeatX,repeatY:c=l.repeatY,x:u=l.x,y:d=l.y,cornerRadius:p=l.cornerRadius,fillStrokeOrder:f=l.fillStrokeOrder,cornerType:m=l.cornerType,image:y}=t.attribute,b=this.valid(t,l,a);if(!b)return;const{fVisible:v,sVisible:x,doFill:_,doStroke:A}=b;if(!y||!t.resources)return;const S=t.resources.get(y);if("success"!==S.state)return;const T=t.width,w=t.height;e.beginPath();let M=!1;0===p||g(p)&&p.every((t=>0===t))?e.rect(i,n,T,w):(ec(e,i,n,T,w,p,"bevel"!==m),M=!0),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);const B=()=>{if(_)if(a)a(e,t.attribute,l);else if(v){e.setCommonStyle(t,t.attribute,i,n,l);let s=0;if("repeat"===h&&(s|=1),"repeat"===c&&(s|=2),s){const t=e.createPattern(S.data,Zc[s]);e.fillStyle=t,e.translate(i,n,!0),e.fillRect(0,0,T,w),e.translate(-i,-n,!0)}else e.drawImage(S.data,i,n,T,w)}},C=()=>{A&&(o?o(e,t.attribute,l):x&&(e.setStrokeStyle(t,t.attribute,u-i,d-n,l),e.stroke()))};f?(C(),M&&(e.save(),e.clip()),this.beforeRenderStep(t,e,i,n,_,!1,v,!1,l,s,a),B(),M&&e.restore()):(M&&(e.save(),e.clip()),this.beforeRenderStep(t,e,i,n,_,!1,v,!1,l,s,a),B(),M&&e.restore(),C()),this.afterRenderStep(t,e,i,n,_,!1,v,!1,l,s,a)}draw(t,e,i){const{image:n}=t.attribute;if(!n||!t.resources)return;const s=t.resources.get(n);if("loading"===s.state&&p(n))return void Hr.improveImageLoading(n);if("success"!==s.state)return;const{context:r}=e.drawParams;if(!r)return;const a=Ur(t).image;this._draw(t,a,!1,i)}};Jc=Yc([Ei(),Kc(0,Li(Zi)),Kc(0,Di(Ll)),qc("design:paramtypes",[Object])],Jc);const Qc=Symbol.for("ArcRender"),tu=Symbol.for("Arc3dRender"),eu=Symbol.for("GraphicRender"),iu=Symbol.for("LineRender"),nu=Symbol.for("PolygonRender"),su=Symbol.for("RectRender"),ru=Symbol.for("Rect3DRender"),au=Symbol.for("SymbolRender"),ou=Symbol.for("TextRender"),lu=Symbol.for("RichTextRender"),hu=Symbol.for("Pyramid3dRender"),cu=Symbol.for("ImageRender");var uu=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let du,pu=class extends Tc{constructor(){super(...arguments),this.numberType=Oo}drawShape(t,e,i,n,s,r,a,o){if(t.incremental&&s.multiGraphicOptions){const{startAtIdx:e,length:r}=s.multiGraphicOptions,{segments:l=[]}=t.attribute;if(e>l.length)return;const h=Ur(t).line,{fill:c=h.fill,stroke:u=h.stroke,opacity:d=h.opacity,fillOpacity:p=h.fillOpacity,strokeOpacity:g=h.strokeOpacity,lineWidth:f=h.lineWidth,visible:m=h.visible}=t.attribute,y=wl(d,p,c),b=Bl(d,g),v=Sl(c),x=Tl(u,f);if(!t.valid||!m)return;if(!v&&!x)return;if(!(y||b||a||o))return;const{context:_}=s;for(let s=e;s<e+r;s++)this.drawIncreaseSegment(t,_,l[s-1],l[s],t.attribute.segments[s],[h,t.attribute],i,n)}else super.drawShape(t,e,i,n,s,r,a,o)}drawIncreaseSegment(t,e,i,n,s,r,a,o){n&&(e.beginPath(),function(t,e,i,n){const{offsetX:s=0,offsetY:r=0}=n||{},a=e?e.points[e.points.length-1]:i.points[0];t.moveTo(a.x+s,a.y+r),i.points.forEach((e=>{!1!==e.defined?t.lineTo(e.x+s,e.y+r):t.moveTo(e.x+s,e.y+r)}))}(e.nativeContext,i,n,{offsetX:a,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,s,r),e.setStrokeStyle(t,s,a,o,r),e.stroke())}};pu=uu([Ei()],pu);class gu{static registerPlugin(t,e){gu._pluginClasses[t]=e}static getPlugin(t){return gu._pluginClasses[t]}}gu._pluginClasses={};class fu{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.8;this.dir=t,this.color=e,this.colorRgb=nl.Get(e,il.Color1),this.ambient=i;const n=pt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this.formatedDir=[t[0]/n,t[1]/n,t[2]/n]}computeColor(t,e){const i=this.formatedDir,n=ut(ct((t[0]*i[0]+t[1]*i[1]+t[2]*i[2])*(1-this.ambient/2),0)+this.ambient,1);let s;s=p(e)?nl.Get(e,il.Color1):e;const r=this.colorRgb;return`rgb(${r[0]*s[0]*n}, ${r[1]*s[1]*n}, ${r[2]*s[2]*n})`}}const mu=()=>{gu.registerPlugin("DirectionalLight",fu)};class yu{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=Ko.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=Ko.allocate());const{pos:t,center:e,up:i}=this.params.viewParams;return function(t,e,i,n){let s,r,a,o,l,h,c,u,d,p;const g=e[0],f=e[1],m=e[2],y=n[0],b=n[1],v=n[2],x=i[0],_=i[1],A=i[2];Math.abs(g-x)<it&&Math.abs(f-_)<it&&Math.abs(m-A)<it?Vo(t):(c=g-x,u=f-_,d=m-A,p=1/Math.hypot(c,u,d),c*=p,u*=p,d*=p,s=b*d-v*u,r=v*c-y*d,a=y*u-b*c,p=Math.hypot(s,r,a),p?(p=1/p,s*=p,r*=p,a*=p):(s=0,r=0,a=0),o=u*a-d*r,l=d*s-c*a,h=c*r-u*s,p=Math.hypot(o,l,h),p?(p=1/p,o*=p,l*=p,h*=p):(o=0,l=0,h=0),t[0]=s,t[1]=o,t[2]=c,t[3]=0,t[4]=r,t[5]=l,t[6]=u,t[7]=0,t[8]=a,t[9]=h,t[10]=d,t[11]=0,t[12]=-(s*g+r*f+a*m),t[13]=-(o*g+l*f+h*m),t[14]=-(c*g+u*f+d*m),t[15]=1)}(this._viewMatrixCached,t,e,i),this._vp||(this._vp=Ko.allocate()),this._vp=Xo(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}getProjectionMatrix(){return this._projectionMatrixCached||(this._projectionMatrixCached=Ko.allocate()),this._projectionMatrixCached}forceGetProjectionMatrix(){this._projectionMatrixCached||(this._projectionMatrixCached=Ko.allocate());const{left:t,top:e,right:i,bottom:n}=this._params;return function(t,e,i,n,s,r,a){const o=1/(e-i),l=1/(n-s),h=1/(r-a);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]=(s+n)*l,t[14]=(a+r)*h,t[15]=1}(this._projectionMatrixCached,t,i,n,e,0,-2e6),this._vp||(this._vp=Ko.allocate()),this._vp=Xo(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}getField(){const{fieldRatio:t=.8,fieldDepth:e,left:i,right:n}=this._params;return(null!=e?e:n-i)*t}getProjectionScale(t){const e=this.getField();return e/(e+t)}view(t,e,i){const n=[0,0,0];return $o(n,[t,e,i],this._viewMatrixCached),n}vp(t,e,i){const n=[0,0,0],{pos:s}=this._params.viewParams;$o(n,[t,e,i],this._viewMatrixCached),t=n[0],e=n[1],i=n[2];const r=this.getProjectionScale(i);return{x:t*r+s[0],y:e*r+s[1]}}}const bu=()=>{gu.registerPlugin("OrthoCamera",yu)};let vu=!1;const xu=new Ti((t=>{vu||(vu=!0,t(xc).toSelf().inSingletonScope(),t(Qc).to(xc).inSingletonScope(),t(eu).toService(Qc),t(Rl).toService($h),Qi(t,Rl))}));let _u=!1;const Au=new Ti((t=>{_u||(_u=!0,t(Cc).toSelf().inSingletonScope(),t(su).to(Cc).inSingletonScope(),t(eu).toService(su),t(rc).toSelf(),t(sc).toSelf(),t(El).toService(rc),t(El).toService(sc),t(El).toService($h),Qi(t,El))}));let Su=!1;const Tu=new Ti((t=>{Su||(Su=!0,t(Tc).toSelf().inSingletonScope(),t(pu).toSelf().inSingletonScope(),t(iu).to(Tc).inSingletonScope(),t(eu).toService(iu))}));let wu=!1;const Mu=new Ti((t=>{wu||(wu=!0,t(Rc).toSelf().inSingletonScope(),t(au).to(Rc).inSingletonScope(),t(eu).toService(au),t(Dl).toService($h),Qi(t,Dl))}));let Bu=!1;const Cu=new Ti((t=>{Bu||(Bu=!0,t(ou).to(jc).inSingletonScope(),t(eu).toService(ou),t(Fl).toService($h),Qi(t,Fl))}));let ku=!1;const Pu=new Ti((t=>{ku||(ku=!0,t(nu).to($c).inSingletonScope(),t(eu).toService(nu),t(Il).toService($h),Qi(t,Il))}));var Ou=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Ru=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Lu=class extends mc{constructor(){super(),this.numberType=Fo,this.builtinContributions=[Ic],this.init()}drawShape(t,e,i,n,s){const r=Ur(t).richtext,{strokeOpacity:a=r.strokeOpacity,opacity:o=r.opacity,fillOpacity:l=r.fillOpacity,visible:h=r.visible}=t.attribute;if(!t.valid||!h)return;const c=wl(o,l,!0),u=wl(o,a,!0);c&&(e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,r),e.translate(i,n),this.beforeRenderStep(t,e,i,n,c,u,c,u,r,s),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,i,n,c,u,c,u,r,s))}drawIcon(t,e,i,n,s){var r;const a=Ur(t).richtextIcon,{width:o=a.width,height:l=a.height,opacity:h=a.opacity,image:c,backgroundFill:u=a.backgroundFill,backgroundFillOpacity:d=a.backgroundFillOpacity,backgroundStroke:p=a.backgroundStroke,backgroundStrokeOpacity:g=a.backgroundStrokeOpacity,backgroundRadius:f=a.backgroundRadius,margin:m}=t.attribute,{backgroundWidth:y=o,backgroundHeight:b=l}=t.attribute;if(m&&(i+=t._marginArray[3],n+=t._marginArray[0]),t._hovered){const t=(y-o)/2,s=(b-l)/2;0===f?(e.beginPath(),e.rect(i-t,n-s,y,b)):(e.beginPath(),ec(e,i-t,n-s,y,b,f,!0)),u&&(e.globalAlpha=d,e.fillStyle=u,e.fill()),p&&(e.globalAlpha=g,e.strokeStyle=p,e.stroke())}const v=c&&(null===(r=null==t?void 0:t.resources)||void 0===r?void 0:r.get(c));v&&"success"===v.state&&(e.globalAlpha=h,e.drawImage(v.data,i,n,o,l))}draw(t,e,i){const n=Ur(t).richtext;this._draw(t,n,!1,i)}};Lu=Ou([Ei(),Ru("design:paramtypes",[])],Lu);let Iu=!1;const Eu=new Ti((t=>{Iu||(Iu=!0,t(lu).to(Lu).inSingletonScope(),t(eu).toService(lu))}));let Du=!1;const Fu=new Ti((t=>{Du||(Du=!0,t(cu).to(Jc).inSingletonScope(),t(eu).toService(cu),t(Ll).toService($h),Qi(t,Ll))}));class ju extends mc{stroke(t,e,i,n,s){const r=n.vertices;n.edges.forEach((n=>{const a=r[n[0]],o={x:t+a[0],y:e+a[1],z:i+a[2]},l=r[n[1]],h={x:t+l[0],y:e+l[1],z:i+l[2]};s.beginPath(),s.moveTo(o.x,o.y,o.z),s.lineTo(h.x,h.y,h.z),s.stroke()}))}fill(t,e,i,n,s,r,a,o,l,h,c){const u=nl.Get(r,il.Color255),d=n.vertices,p=d.map((t=>a.view(t[0],t[1],t[2])[2])),g=[];n.polygons.forEach(((t,e)=>{if(s&&!s[e])return;g.push({faceIdx:e,polygon:t});const{polygon:i}=t,n=p[i[0]],r=p[i[1]],a=p[i[2]],o=p[i[3]];t.ave_z=n+r+a+o})),g.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),g.forEach((n=>{const{polygon:s,normal:p}=n.polygon,g=d[s[0]],f=d[s[1]],m=d[s[2]],y=d[s[3]],b={x:t+g[0],y:e+g[1],z:i+g[2]},v={x:t+f[0],y:e+f[1],z:i+f[2]},x={x:t+m[0],y:e+m[1],z:i+m[2]},_={x:t+y[0],y:e+y[1],z:i+y[2]};a.beginPath(),a.moveTo(b.x,b.y,b.z),a.lineTo(v.x,v.y,v.z),a.lineTo(x.x,x.y,x.z),a.lineTo(_.x,_.y,_.z),a.closePath(),c?c(a,l&&l.attribute,h):(a.fillStyle=o?o.computeColor(p,u):r,a.fill())}))}}var Uu=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let Nu=class extends ju{constructor(){super(...arguments),this.type="rect3d",this.numberType=Do}drawShape(t,e,i,n,s,r,a,o){var l;const h=Ur(t,null==r?void 0:r.theme).rect,{fill:c=h.fill,stroke:u=h.stroke,x1:d,y1:p,x:g,y:f,opacity:m=h.opacity,fillOpacity:y=h.fillOpacity,lineWidth:b=h.lineWidth,strokeOpacity:v=h.strokeOpacity,visible:x=h.visible}=t.attribute;let{width:_,height:A}=t.attribute;_=(null!=_?_:d-g)||0,A=(null!=A?A:p-f)||0;const S=null!==(l=this.z)&&void 0!==l?l:0,T=Ml(m,y,_,A,c),w=Cl(m,v,_,A),M=Sl(c),B=Tl(u,b);if(!t.valid||!x)return;if(!M&&!B)return;if(!(T||w||a||o))return;const{light:C}=s.stage||{},k=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,h);let s=c;"string"!=typeof s&&(s="black"),this.fill(i,n,S,k,null,s,e,C,null,null,a)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,h),this.stroke(i,n,S,k,e))}draw(t,e,i){const n=Ur(t).rect;this._draw(t,n,!1,i)}};Nu=Uu([Ei()],Nu);let Wu=!1;const zu=new Ti((t=>{Wu||(Wu=!0,t(ru).to(Nu).inSingletonScope(),t(eu).toService(ru))}));var Gu=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let Vu=class extends mc{constructor(){super(...arguments),this.numberType=Bo}drawShape(t,e,i,n,s,r,a,o){var l;const h=Ur(t,null==r?void 0:r.theme).arc,{fill:c=h.fill}=t.attribute,u=this.valid(t,h,a,o);if(!u)return;const{fVisible:d,sVisible:p,doFill:g,doStroke:f}=u,m=null!==(l=this.z)&&void 0!==l?l:0,{outerPadding:y=h.outerPadding,innerPadding:b=h.innerPadding,height:v=10}=t.attribute;let{outerRadius:x=h.outerRadius,innerRadius:_=h.innerRadius}=t.attribute;x+=y,_-=b;const A=nl.Get(c,il.Color255),{light:S}=s.stage||{},T=s.hack_pieFace,w={top:m,bottom:m+v},M={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===T||"top"===T?(e.beginPath(),function(t,e,i,n,s,r,a){const{startAngle:o,endAngle:l}=t.getParsedAngle(),h=ot(l-o),c=l>o;let u=!1;if(r<a){const t=r;r=a,a=t}if(r<=it)e.moveTo(i,n,s);else if(h>=at-it)e.moveTo(i+r*ht(o),n+r*dt(o),s),e.arc(i,n,r,o,l,!c,s),a>it&&(e.moveTo(i+a*ht(l),n+a*dt(l),s),e.arc(i,n,a,l,o,c,s));else{const{outerDeltaAngle:h,innerDeltaAngle:d,outerStartAngle:p,outerEndAngle:g,innerEndAngle:f,innerStartAngle:m}=t.getParsePadAngle(o,l),y=r*ht(p),b=r*dt(p),v=a*ht(f),x=a*dt(f);h<.001?u=!0:(e.moveTo(i+y,n+b,s),e.arc(i,n,r,p,g,!c,s)),!(a>it)||d<.001?(e.lineTo(i+v,n+x,s),u=!0):(e.lineTo(i+v,n+x,s),e.arc(i,n,a,f,m,c,s))}e.closePath()}(t,e,i,n,w[T],x,_),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),g&&(a?a(e,t.attribute,h):d&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=S?S.computeColor(M[T],A):c,e.fill())),f&&(o?o(e,t.attribute,h):p&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke()))):"outside"!==T&&"inside"!==T||("inside"===T&&(e.save(),e.beginPath(),e.arc(i,n,_,0,at,!0,w.top),e.clip()),e.beginPath(),function(t,e,i,n,s,r,a,o){const{startAngle:l,endAngle:h}=t.getParsedAngle(),c=ot(h-l),u=h>l;let d=!1;if(a<=it)e.moveTo(i,n,s);else if(c>=at-it)e.moveTo(i+a*ht(l),n+a*dt(l),s),e.arc(i,n,a,l,h,!u,s),e.lineTo(i+a*ht(h),n+a*dt(h),r),e.arc(i,n,a,h,l,u,r);else{const{innerouterDeltaAngle:t,innerouterStartAngle:c,innerouterEndAngle:p}=o(l,h),g=a*ht(c),f=a*dt(c),m=a*ht(p),y=a*dt(p);t<.001?d=!0:(e.moveTo(i+g,n+f,s),e.arc(i,n,a,c,p,!u,s),e.lineTo(i+m,n+y,r),e.arc(i,n,a,p,c,u,r))}e.closePath()}(t,e,i,n,w.top,w.bottom,"outside"===T?x:_,((e,i)=>{const{outerDeltaAngle:n,innerDeltaAngle:s,outerStartAngle:r,outerEndAngle:a,innerEndAngle:o,innerStartAngle:l}=t.getParsePadAngle(e,i);return"outside"===T?{innerouterDeltaAngle:n,innerouterEndAngle:a,innerouterStartAngle:r}:{innerouterDeltaAngle:s,innerouterEndAngle:o,innerouterStartAngle:l}})),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),g&&(a?a(e,t.attribute,h):d&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=S?S.computeColor(M[T],A):c,e.fill())),f&&(o?o(e,t.attribute,h):p&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke())),"inside"===T&&e.restore())}draw(t,e,i,n){const s=Ur(t,null==n?void 0:n.theme).arc;this._draw(t,s,!1,i,n)}};Vu=Gu([Ei()],Vu);let Hu=!1;const Xu=new Ti((t=>{Hu||(Hu=!0,t(tu).to(Vu).inSingletonScope(),t(eu).toService(tu))}));var $u=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let Yu=class extends ju{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=Io}drawShape(t,e,i,n,s,r,a,o){var l;const h=Ur(t,null==r?void 0:r.theme).polygon,{fill:c=h.fill,stroke:u=h.stroke,face:d=[!0,!0,!0,!0,!0,!0]}=t.attribute,p=null!==(l=this.z)&&void 0!==l?l:0;if(!this.valid(t,h,a,o))return;const{light:g}=s.stage||{},f=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,h);let s=c;"string"!=typeof s&&(s="black"),this.fill(i,n,p,f,d,s,e,g,t,h,a)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,h),this.stroke(i,n,p,f,e))}draw(t,e,i){const n=Ur(t).polygon;this._draw(t,n,!1,i)}};Yu=$u([Ei()],Yu);let qu=!1;const Ku=new Ti((t=>{qu||(qu=!0,t(hu).to(Yu).inSingletonScope(),t(eu).toService(hu))}));class Zu{constructor(){this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=Si.GenAutoIncrementId(),this.key=this.name+this._uid,this.onMouseDown=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!0,this.pageX=t.page.x,this.pageY=t.page.y)},this.onMouseUp=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!1)},this.onMouseMove=t=>{var e,i;const n=this.pluginService.stage;if(this.option3d||(this.option3d=n.option3d),this.option3d&&this.mousedown)if(this.pageX&&this.pageY){const s=t.page.x-this.pageX,r=t.page.y-this.pageY;this.pageX=t.page.x,this.pageY=t.page.y;const a=s/100,o=r/100;this.option3d.alpha=(null!==(e=this.option3d.alpha)&&void 0!==e?e:0)+a,this.option3d.beta=(null!==(i=this.option3d.beta)&&void 0!==i?i:0)+o,n.set3dOptions(this.option3d),n.renderNextFrame()}else this.pageX=t.page.x,this.pageY=t.page.y}}activate(t){this.pluginService=t;const e=t.stage;this.option3d=e.option3d,e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mousemove",this.onMouseMove)}deactivate(t){const e=t.stage;e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mousemove",this.onMouseMove)}}const Ju=t=>t.zField||t.series&&t.series.some((t=>t.zField));class Qu extends e.BasePlugin{constructor(){super(Qu.type),this.type="VChart3dPlugin"}onInit(t,e){var i,n;if(this._is3d=!!(n=e)&&((t=>"bar3d"===t||"funnel3d"===t||"histogram3d"===t||"pie3d"===t||"rangeColumn3d"===t||"wordCloud3d"===t)(n.type)||Ju(n),!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&&Ju(e)&&(e.layout={type:"layout3d"})}}Qu.pluginType="chart",Qu.type="VChart3dPlugin";const td=()=>{e.registerChartPlugin(Qu),mu(),bu(),gu.registerPlugin("ViewTransform3dPlugin",Zu)},ed={label:{name:"label",type:"text"},bar3d:{name:"bar3d",type:"rect3d"}};class id extends e.BarSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"bar3d")}}const nd=Symbol.for("MathPickerContribution"),sd=Symbol.for("MathArcPicker"),rd=Symbol.for("MathImagePicker"),ad=Symbol.for("MathLinePicker"),od=Symbol.for("MathRectPicker"),ld=Symbol.for("MathSymbolPicker"),hd=Symbol.for("MathTextPicker"),cd=Symbol.for("MathPolygonPicker"),ud=Symbol.for("CanvasArcPicker"),dd=Symbol.for("CanvasArc3dPicker"),pd=Symbol.for("CanvasImagePicker"),gd=Symbol.for("CanvasLinePicker"),fd=Symbol.for("CanvasRectPicker"),md=Symbol.for("CanvasRect3dPicker"),yd=Symbol.for("CanvasSymbolPicker"),bd=Symbol.for("CanvasTextPicker"),vd=Symbol.for("CanvasPolygonPicker"),xd=Symbol.for("CanvasPyramid3dPicker"),_d=Symbol.for("CanvasRichTextPicker"),Ad=Symbol.for("CanvasPickerContribution");class Sd{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;if(!this.canvasRenderer)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.getGraphicTheme();n.highPerformanceSave();let{x:r=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);r+=e.x,a+=e.y,n.setTransformForCurrent()}else r=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1,l=!1;return this.canvasRenderer.drawShape(t,n,r,a,{},null,((t,i,n,s)=>!(!o&&!l)||(o=t.isPointInPath(e.x,e.y),l=s||l,o)),((t,i,s,r)=>{if(o||l)return!0;const a=i.lineWidth||s.lineWidth,h=i.pickStrokeBuffer||s.pickStrokeBuffer,c=i.keepStrokeScale||s.keepStrokeScale;return n.lineWidth=c?a+h:Gs(n,a+h,n.dpr),o=t.isPointInStroke(e.x,e.y),l=r||l,o})),n.highPerformanceRestore(),o}}var Td=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},wd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Md=function(t,e){return function(i,n){e(i,n,t)}};let Bd=class extends Sd{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=Mo}};Bd=Td([Ei(),Md(0,Li(Qc)),wd("design:paramtypes",[Object])],Bd);let Cd=!1;const kd=new Ti(((t,e,i,n)=>{Cd||(Cd=!0,t(sd).to(Bd).inSingletonScope(),t(nd).toService(sd))}));var Pd=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let Od=class{constructor(){this.type="image",this.numberType=Po}contains(t,e,i){const{pickContext:n}=null!=i?i:{};return!!n&&!!t.AABBBounds.containsPoint(e)}};Od=Pd([Ei()],Od);let Rd=!1;const Ld=new Ti(((t,e,i,n)=>{Rd||(Rd=!0,t(rd).to(Od).inSingletonScope(),t(Od).toService(rd))}));var Id=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Ed=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Dd=function(t,e){return function(i,n){e(i,n,t)}};let Fd=class extends Sd{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=Oo}};Fd=Id([Ei(),Dd(0,Li(iu)),Ed("design:paramtypes",[Object])],Fd);let jd=!1;const Ud=new Ti(((t,e,i,n)=>{jd||(jd=!0,t(ad).to(Fd).inSingletonScope(),t(nd).toService(ad))}));var Nd=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Wd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},zd=function(t,e){return function(i,n){e(i,n,t)}};let Gd=class extends Sd{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=Lo}};Gd=Nd([Ei(),zd(0,Li(nu)),Wd("design:paramtypes",[Object])],Gd);let Vd=!1;const Hd=new Ti(((t,e,i,n)=>{Vd||(Vd=!0,t(cd).to(Gd).inSingletonScope(),t(nd).toService(cd))})),Xd=new Xt;class $d{constructor(){this.type="rect",this.numberType=Eo}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.getGraphicTheme(),{cornerRadius:r=s.cornerRadius}=t.attribute;let{x:a=s.x,y:o=s.y}=t.attribute;n.highPerformanceSave();let l=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);a+=e.x,o+=e.y,n.setTransformForCurrent()}else a=0,o=0,l=!1,n.transformFromMatrix(t.transMatrix,!0);let h=!0;if(!l||t.shadowRoot||y(r,!0)&&0!==r||g(r)&&r.some((t=>0!==t)))h=!1,this.canvasRenderer.drawShape(t,n,a,o,{},null,((t,i,n)=>!!h||(h=t.isPointInPath(e.x,e.y),h)),((t,i,s)=>{if(h)return!0;const r=i.lineWidth||s.lineWidth,a=i.pickStrokeBuffer||s.pickStrokeBuffer,o=i.keepStrokeScale||s.keepStrokeScale;return n.lineWidth=o?r+a:Gs(n,r+a,n.dpr),h=t.isPointInStroke(e.x,e.y),h}));else{const{fill:i=s.fill,stroke:n=s.stroke,lineWidth:r=s.lineWidth}=t.attribute;if(i)h=!0;else if(n){const i=t.AABBBounds;Xd.setValue(i.x1,i.y1,i.x2,i.y2),Xd.expand(-r/2),h=!Xd.containsPoint(e)}}return n.highPerformanceRestore(),h}}var Yd=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},qd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Kd=function(t,e){return function(i,n){e(i,n,t)}};let Zd=class extends $d{constructor(t){super(),this.canvasRenderer=t}};Zd=Yd([Ei(),Kd(0,Li(su)),qd("design:paramtypes",[Object])],Zd);let Jd=!1;const Qd=new Ti(((t,e,i,n)=>{Jd||(Jd=!0,t(od).to(Zd).inSingletonScope(),t(nd).toService(od))}));let tp=!1;const ep=new Ti(((t,e,i,n)=>{tp||(tp=!0,t(rd).to(Od).inSingletonScope(),t(Od).toService(rd))}));var ip=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},np=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},sp=function(t,e){return function(i,n){e(i,n,t)}};let rp=class extends Sd{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=jo}};rp=ip([Ei(),sp(0,Li(au)),np("design:paramtypes",[Object])],rp);let ap=!1;const op=new Ti(((t,e,i,n)=>{ap||(ap=!0,t(ld).to(rp).inSingletonScope(),t(nd).toService(ld))}));var lp=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let hp=class{constructor(){this.type="text",this.numberType=Uo}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};hp=lp([Ei()],hp);let cp=!1;const up=new Ti(((t,e,i,n)=>{cp||(cp=!0,t(hd).to(hp).inSingletonScope(),t(nd).toService(hd))}));var dp=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},pp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},gp=function(t,e){return function(i,n){e(i,n,t)}};let fp=class extends Sd{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=Mo}};fp=dp([Ei(),gp(0,Li(Qc)),pp("design:paramtypes",[Object])],fp);let mp=!1;const yp=new Ti(((t,e,i,n)=>{mp||(mp=!0,t(ud).to(fp).inSingletonScope(),t(Ad).toService(ud))}));var bp=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},vp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xp=function(t,e){return function(i,n){e(i,n,t)}};let _p=class extends $d{constructor(t){super(),this.canvasRenderer=t}};_p=bp([Ei(),xp(0,Li(su)),vp("design:paramtypes",[Object])],_p);let Ap=!1;const Sp=new Ti(((t,e,i,n)=>{Ap||(Ap=!0,t(fd).to(_p).inSingletonScope(),t(Ad).toService(fd))}));class Tp extends mc{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;n.highPerformanceSave();const s=t.getGraphicTheme(),r=this.transform(t,s,n),{x:a,y:o,z:l,lastModelMatrix:h}=r;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,n,a,o,{},null,(t=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const s=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer,a=e.keepStrokeScale||i.keepStrokeScale;return n.lineWidth=a?s+r:Gs(n,s+r,n.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==h&&Ko.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),u}}var wp=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Mp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Bp=function(t,e){return function(i,n){e(i,n,t)}};let Cp=class extends Tp{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=Oo}};Cp=wp([Ei(),Bp(0,Li(iu)),Mp("design:paramtypes",[Object])],Cp);let kp=!1;const Pp=new Ti(((t,e,i,n)=>{kp||(kp=!0,t(gd).to(Cp).inSingletonScope(),t(Ad).toService(gd))}));class Op extends mc{contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.getGraphicTheme();n.highPerformanceSave();const r=this.transform(t,s,n),{x:a,y:o,z:l,lastModelMatrix:h}=r;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,n,a,o,i,null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,n.modelMatrix!==h&&Ko.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),u}}var Rp=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Lp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ip=function(t,e){return function(i,n){e(i,n,t)}};let Ep=class extends Op{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=jo}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.getParsedPath();if(!n.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(s.isSvg||"imprecise"===t.attribute.pickMode)return!0}n.highPerformanceSave();const r=t.getGraphicTheme(),a=this.transform(t,r,n),{x:o,y:l,z:h,lastModelMatrix:c}=a;let u=e;if(n.camera){u=e.clone();const i=t.parent.globalTransMatrix;u.x=i.a*e.x+i.c*e.y+i.e,u.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let d=!1;return this.canvasRenderer.drawShape(t,n,o,l,{},null,((t,e,i)=>!!d||(d=t.isPointInPath(u.x,u.y),d)),((t,e,i)=>{if(d)return!0;const s=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer,a=e.keepStrokeScale||i.keepStrokeScale;return n.lineWidth=a?s+r:Gs(n,s+r,n.dpr),d=t.isPointInStroke(u.x,u.y),d})),this.canvasRenderer.z=0,n.modelMatrix!==c&&Ko.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),d}};Ep=Rp([Ei(),Ip(0,Li(au)),Lp("design:paramtypes",[Object])],Ep);let Dp=!1;const Fp=new Ti(((t,e,i,n)=>{Dp||(Dp=!0,t(yd).to(Ep).inSingletonScope(),t(Ad).toService(yd))}));var jp=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Up=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Np=function(t,e){return function(i,n){e(i,n,t)}};let Wp=class extends Op{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=Uo}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.AABBBounds;if(!n.camera)return!!s.containsPoint(e);n.highPerformanceSave();const r=t.getGraphicTheme(),{keepDirIn3d:a=r.keepDirIn3d}=t.attribute,o=!a,l=this.transform(t,r,n,o),{x:h,y:c,z:u,lastModelMatrix:d}=l;this.canvasRenderer.z=u;let p=e;if(n.camera){p=e.clone();const i=t.parent.globalTransMatrix;p.x=i.a*e.x+i.c*e.y+i.e,p.y=i.b*e.x+i.d*e.y+i.f}let g=!1;return this.canvasRenderer.drawShape(t,n,h,c,{},null,((e,i,n)=>{if(g)return!0;const{fontSize:s=r.fontSize,textBaseline:a=r.textBaseline,textAlign:o=r.textAlign}=t.attribute,l=t.AABBBounds,d=l.height(),f=l.width(),m=Nl(a,d,s),y=Ul(o,f);return e.rect(y+h,m+c,f,d,u),g=e.isPointInPath(p.x,p.y),g}),((t,e,i)=>g)),this.canvasRenderer.z=0,n.modelMatrix!==d&&Ko.free(n.modelMatrix),n.modelMatrix=d,n.highPerformanceRestore(),g}};Wp=jp([Ei(),Np(0,Li(ou)),Up("design:paramtypes",[Object])],Wp);let zp=!1;const Gp=new Ti(((t,e,i,n)=>{zp||(zp=!0,t(bd).to(Wp).inSingletonScope(),t(Ad).toService(bd))}));var Vp=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Hp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Xp=function(t,e){return function(i,n){e(i,n,t)}};let $p=class extends Sd{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=Lo}};$p=Vp([Ei(),Xp(0,Li(nu)),Hp("design:paramtypes",[Object])],$p);let Yp=!1;const qp=new Ti(((t,e,i,n)=>{Yp||(Yp=!0,t(vd).to($p).inSingletonScope(),t(Ad).toService(vd))}));var Kp=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Zp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Jp=function(t,e){return function(i,n){e(i,n,t)}};let Qp=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=Fo}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};Qp=Kp([Ei(),Jp(0,Li(lu)),Zp("design:paramtypes",[Object])],Qp);let tg=!1;const eg=new Ti(((t,e,i,n)=>{tg||(tg=!0,t(_d).to(Qp).inSingletonScope(),t(Ad).toService(_d))}));var ig=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},ng=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},sg=function(t,e){return function(i,n){e(i,n,t)}};let rg=class extends Sd{constructor(t){super(),this.canvasRenderer=t,this.type="image",this.numberType=Po}};rg=ig([Ei(),sg(0,Li(cu)),ng("design:paramtypes",[Object])],rg);let ag=!1;const og=new Ti(((t,e,i,n)=>{ag||(ag=!0,t(pd).to(rg).inSingletonScope(),t(Ad).toService(pd))}));var lg=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},hg=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},cg=function(t,e){return function(i,n){e(i,n,t)}};let ug=class extends Op{constructor(t){super(),this.canvasRenderer=t,this.type="rect3d",this.numberType=Do,this.themeType="rect"}};ug=lg([Ei(),cg(0,Li(ru)),hg("design:paramtypes",[Object])],ug);let dg=!1;const pg=new Ti(((t,e,i,n)=>{dg||(dg=!0,t(md).to(ug).inSingletonScope(),t(Ad).toService(md))}));var gg=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},fg=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},mg=function(t,e){return function(i,n){e(i,n,t)}};let yg=class extends Op{constructor(t){super(),this.canvasRenderer=t,this.type="arc3d",this.numberType=Bo,this.themeType="arc"}};yg=gg([Ei(),mg(0,Li(tu)),fg("design:paramtypes",[Object])],yg);let bg=!1;const vg=new Ti(((t,e,i,n)=>{bg||(bg=!0,t(dd).to(yg).inSingletonScope(),t(Ad).toService(dd))}));var xg=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},_g=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ag=function(t,e){return function(i,n){e(i,n,t)}};let Sg=class extends Op{constructor(t){super(),this.canvasRenderer=t,this.type="pyramid3d",this.numberType=Io,this.themeType="polygon"}};Sg=xg([Ei(),Ag(0,Li(hu)),_g("design:paramtypes",[Object])],Sg);let Tg=!1;const wg=new Ti(((t,e,i,n)=>{Tg||(Tg=!0,t(xd).to(Sg).inSingletonScope(),t(Ad).toService(xd))})),Mg=function(){!function(){if(null==du)try{const t=document.createElement("canvas"),e=t.getContext("2d");du=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),du&&(du=!!document.createElement)}catch(t){du=!1}}();const t=sn.global&&sn.global.env;return t?"browser"===t:du}();function Bg(){Bg.__loaded||(Bg.__loaded=!0,Uh.RegisterGraphicCreator("arc",kh),er.load(xu),er.load(Mg?yp:kd))}Bg.__loaded=!1;const Cg=Bg;function kg(){kg.__loaded||(kg.__loaded=!0,Uh.RegisterGraphicCreator("arc3d",Oh),mu(),bu(),er.load(Xu),er.load(vg))}kg.__loaded=!1;const Pg=kg;function Og(){Og.__loaded||(Og.__loaded=!0,Uh.RegisterGraphicCreator("group",Al))}Og.__loaded=!1;const Rg=Og;function Lg(){Lg.__loaded||(Lg.__loaded=!0,Uh.RegisterGraphicCreator("image",gh),er.load(Fu),er.load(Mg?og:Ld))}Lg.__loaded=!1;const Ig=Lg;function Eg(){Eg.__loaded||(Eg.__loaded=!0,Uh.RegisterGraphicCreator("line",ih),er.load(Tu),er.load(Mg?Pp:Ud))}Eg.__loaded=!1;const Dg=Eg;function Fg(){Fg.__loaded||(Fg.__loaded=!0,Uh.RegisterGraphicCreator("polygon",Ih),er.load(Pu),er.load(Mg?qp:Hd))}Fg.__loaded=!1;const jg=Fg;function Ug(){Ug.__loaded||(Ug.__loaded=!0,Uh.RegisterGraphicCreator("pyramid3d",Dh),mu(),bu(),er.load(Ku),er.load(wg))}Ug.__loaded=!1;const Ng=Ug;function Wg(){Wg.__loaded||(Wg.__loaded=!0,Uh.RegisterGraphicCreator("rect",rh),er.load(Au),er.load(Mg?Sp:Qd))}Wg.__loaded=!1;const zg=Wg;function Gg(){Gg.__loaded||(Gg.__loaded=!0,Uh.RegisterGraphicCreator("rect3d",lh),er.load(zu),er.load(pg))}Gg.__loaded=!1;const Vg=Gg;function Hg(){Hg.__loaded||(Hg.__loaded=!0,Uh.RegisterGraphicCreator("richtext",_h),er.load(Eu),er.load(Mg?eg:ep))}Hg.__loaded=!1;const Xg=Hg;function $g(){$g.__loaded||($g.__loaded=!0,Uh.RegisterGraphicCreator("shadowRoot",jh))}$g.__loaded=!1;const Yg=$g;function qg(){qg.__loaded||(qg.__loaded=!0,Uh.RegisterGraphicCreator("symbol",Ql),er.load(Mu),er.load(Mg?Fp:op))}qg.__loaded=!1;const Kg=qg;function Zg(){Zg.__loaded||(Zg.__loaded=!0,Uh.RegisterGraphicCreator("text",Kl),er.load(Cu),er.load(Mg?Gp:up))}Zg.__loaded=!1;const Jg=Zg;class Qg 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=Qg.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}Qg.type="rect3d";const tf=()=>{e.Factory.registerMark(Qg.type,Qg),Yg(),Vg(),e.registerRectAnimation(),e.Factory.registerGraphicComponent("rect3d",lh)};class ef extends e.BarSeries{constructor(){super(...arguments),this.type=xi.bar3d,this._barMarkName="bar3d",this._barMarkType="rect3d",this.transformerConstructor=id}}ef.type=xi.bar3d,ef.mark=ed,ef.builtInTheme={bar3d:{bar3d:{style:{length:3}},label:{visible:!1,style:{offset:12,position:"outside"}}}},ef.transformerConstructor=id;const nf=()=>{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)}))),tf(),e.registerCartesianBandAxis(),e.registerCartesianLinearAxis(),e.Factory.registerSeries(ef.type,ef)};class sf extends e.Layout{layoutItems(t,i,n,s){this._layoutInit(t,i,n,s);const r={recomputeWidth:this.recomputeWidth,recomputeHeight:this.recomputeHeight};this._layoutNormalItems(i,r);const a={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:u,relativeOverlapItems:d,allRelatives:p,overlapItems:g}=this._groupItems(i);this.layoutRegionItems(c,u,d,g,r),this._processAutoIndent(c,u,d,g,p,a,r);const f=o.filter((t=>"z"!==t.layoutOrient));this.layoutAbsoluteItems(f);const m=u.filter((t=>"axes"===t.model.specKey&&e.isXAxis(t.layoutOrient)))[0],y=u.filter((t=>"axes"===t.model.specKey&&e.isYAxis(t.layoutOrient)))[0];if(m&&l.length){const t=m.getLayoutStartPoint(),e=m.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 n=m.getLayoutRect(),s=y.getLayoutRect(),r={length:l[0].getLayoutRect().width,width:n.width,height:s.height};m.model.setLayout3dBox&&m.model.setLayout3dBox(r),y.model.setLayout3dBox&&y.model.setLayout3dBox(r),l[0].model.setLayout3dBox&&l[0].model.setLayout3dBox(r),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,n=this._chartViewBox.y2-this._chartViewBox.y1-this.bottomCurrent;return t.forEach((t=>{if(!t.getModelVisible()||!t.autoIndent)return;const s="left"===t.layoutOrient||"right"===t.layoutOrient,r=t.getLastComputeOutBounds();s?(e.top=Math.max(e.top,r.y1-this.topCurrent),e.bottom=Math.max(e.bottom,r.y2-n)):(e.left=Math.max(e.left,r.x1-this.leftCurrent),e.right=Math.max(e.right,r.x2-i))})),e}}sf.type="layout3d";const rf=()=>{e.Factory.registerLayout(sf.type,sf)};class af extends e.BarChart{constructor(){super(...arguments),this.transformerConstructor=yi,this.type="bar3d",this.seriesType=xi.bar3d}}af.type="bar3d",af.seriesType=xi.bar3d,af.transformerConstructor=yi;const of=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 lf extends e.FunnelSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"funnel3d"),t.isTransform&&this._addMarkLabelSpec(t,"transform3d","transformLabel")}}class hf extends e.BasePolygonMark{_getDefaultStyle(){const t=super._getDefaultStyle();return t.stroke=!1,t}constructor(t,e){super(t,e),this.type=hf.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}hf.type="pyramid3d";const cf=e.getFunnelTheme(!0);class uf extends e.FunnelSeries{constructor(){super(...arguments),this.type=xi.funnel3d,this._funnelMarkName="funnel3d",this._funnelMarkType="pyramid3d",this._transformMarkName="transform3d",this._transformMarkType="pyramid3d",this.transformerConstructor=lf}initMark(){var t,e,i,n,s,r,a,o;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},uf.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({},uf.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===(n=null===(i=this._spec)||void 0===i?void 0:i.outerLabel)||void 0===n?void 0:n.visible){const{line:t}=null!==(s=this._spec.outerLabel)&&void 0!==s?s:{},{line:e}=null!==(a=null===(r=this._theme)||void 0===r?void 0:r.outerLabel)&&void 0!==a?a:{};this._funnelOuterLabelMark.label=this._createMark(uf.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(uf.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,n;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===(n=this._funnelOuterLabelMark)||void 0===n||n.line}}uf.type=xi.funnel3d,uf.mark=of,uf.builtInTheme={funnel3d:cf},uf.transformerConstructor=lf;const df=()=>{e.Factory.registerMark(hf.type,hf),Yg(),Ng(),e.registerPolygonAnimation(),e.Factory.registerGraphicComponent("pyramid3d",Dh),e.registerTextMark(),e.registerRuleMark(),e.Factory.registerSeries(uf.type,uf)};class pf extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=e.FunnelChartSpecTransformer,this.type="funnel3d",this.seriesType=xi.funnel3d}}pf.type="funnel3d",pf.seriesType=xi.funnel3d,pf.transformerConstructor=e.FunnelChartSpecTransformer;class gf extends e.BaseHistogramChart{constructor(){super(...arguments),this.transformerConstructor=e.HistogramChartSpecTransformer,this.type="histogram3d",this.seriesType=xi.bar3d}_setModelOption(){this._modelOption.getDimensionInfo=e.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=e.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=e.getCartesianCrosshairRect}}gf.type="histogram3d",gf.seriesType=xi.bar3d,gf.transformerConstructor=e.HistogramChartSpecTransformer;class ff extends e.BasePieChartSpecTransformer{transformSpec(t){super.transformSpec(t),t.series.forEach((e=>{"pie3d"===e.type&&(e.angle3d=t.angle3d)}))}}class mf extends e.BaseArcMark{setDataLabelType(){return"arc"}constructor(t,e){super(t,e),this.type=mf.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}mf.type="arc3d";const yf=Object.assign(Object.assign({},e.baseSeriesMark),{pie3d:{name:"pie3d",type:"arc3d"},labelLine:{name:"labelLine",type:"path"}});class bf extends e.PieSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"pie3d")}}class vf extends e.BasePieSeries{constructor(){super(...arguments),this.type=xi.pie3d,this._pieMarkName="pie3d",this._pieMarkType="arc3d",this.transformerConstructor=bf}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))}}vf.type=xi.pie3d,vf.mark=yf,vf.builtInTheme={pie3d:{outerRadius:.6,pie3d:{style:{height:10,fillOpacity:1}},label:{visible:!1,interactive:!0,position:"outside"}}},vf.transformerConstructor=bf;const xf=()=>{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(),Yg(),Pg(),e.Factory.registerGraphicComponent("arc3d",Oh),e.Factory.registerMark("arc3d",mf),e.Factory.registerSeries(vf.type,vf)};class _f extends e.BasePieChart{constructor(){super(...arguments),this.transformerConstructor=ff,this.type="pie3d",this.seriesType=xi.pie3d}}_f.type="pie3d",_f.seriesType=xi.pie3d,_f.transformerConstructor=ff;class Af{constructor(){}static linear(t){return t}static none(){return this.linear}static get(t){return t<-1?t=-1:t>1&&(t=1),function(e){return 0===t?e:t<0?e*(e*-t+1+t):e*((2-e)*t+(1-t))}}static getPowIn(t){return function(e){return Math.pow(e,t)}}static getPowOut(t){return function(e){return 1-Math.pow(1-e,t)}}static getPowInOut(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}static getBackIn(t){return function(e){return e*e*((t+1)*e-t)}}static getBackOut(t){return function(e){return--e*e*((t+1)*e+t)+1}}static getBackInOut(t){return t*=1.525,function(e){return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}static sineIn(t){return 1-Math.cos(t*Math.PI/2)}static sineOut(t){return Math.sin(t*Math.PI/2)}static sineInOut(t){return-(Math.cos(Math.PI*t)-1)/2}static expoIn(t){return 0===t?0:Math.pow(2,10*t-10)}static expoOut(t){return 1===t?1:1-Math.pow(2,-10*t)}static expoInOut(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}static circIn(t){return-(Math.sqrt(1-t*t)-1)}static circOut(t){return Math.sqrt(1- --t*t)}static circInOut(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}static bounceOut(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}static bounceIn(t){return 1-Af.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Af.bounceIn(2*t):.5*Af.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const n=e/at*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*at/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const n=e/at*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-n)*at/e)+1}}static getElasticInOut(t,e){return function(i){const n=e/at*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*at/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-n)*at/e)*.5+1}}static registerFunc(t,e){Af[t]=e}}function Sf(t,e){const i=1/e;let n=1;for(;t>i;)t-=i,n*=-1;const s=n*t/i;return s>0?s:1+s}Af.quadIn=Af.getPowIn(2),Af.quadOut=Af.getPowOut(2),Af.quadInOut=Af.getPowInOut(2),Af.cubicIn=Af.getPowIn(3),Af.cubicOut=Af.getPowOut(3),Af.cubicInOut=Af.getPowInOut(3),Af.quartIn=Af.getPowIn(4),Af.quartOut=Af.getPowOut(4),Af.quartInOut=Af.getPowInOut(4),Af.quintIn=Af.getPowIn(5),Af.quintOut=Af.getPowOut(5),Af.quintInOut=Af.getPowInOut(5),Af.backIn=Af.getBackIn(1.7),Af.backOut=Af.getBackOut(1.7),Af.backInOut=Af.getBackInOut(1.7),Af.elasticIn=Af.getElasticIn(1,.3),Af.elasticOut=Af.getElasticOut(1,.3),Af.elasticInOut=Af.getElasticInOut(1,.3*1.5),Af.easeInOutQuad=t=>(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2),Af.easeOutElastic=t=>{const e=2*Math.PI/3;return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*e)+1},Af.easeInOutElastic=t=>{const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*e)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*e)/2+1};for(let t=0;t<10;t++)Af[`flicker${t}`]=e=>Sf(e,t);for(let t=2;t<10;t++)Af[`aIn${t}`]=e=>t*e*e+(1-t)*e;function Tf(t,e,i){return t+(e-t)*i}const wf=new class{constructor(){this.opacity=(t,e,i,n,s,r)=>{r.attribute.opacity=Tf(e,i,n)},this.baseOpacity=(t,e,i,n,s,r)=>{r.attribute.baseOpacity=Tf(e,i,n)},this.fillOpacity=(t,e,i,n,s,r)=>{r.attribute.fillOpacity=Tf(e,i,n)},this.strokeOpacity=(t,e,i,n,s,r)=>{r.attribute.strokeOpacity=Tf(e,i,n)},this.zIndex=(t,e,i,n,s,r)=>{r.attribute.zIndex=Tf(e,i,n)},this.backgroundOpacity=(t,e,i,n,s,r)=>{r.attribute.backgroundOpacity=Tf(e,i,n)},this.shadowOffsetX=(t,e,i,n,s,r)=>{r.attribute.shadowOffsetX=Tf(e,i,n)},this.shadowOffsetY=(t,e,i,n,s,r)=>{r.attribute.shadowOffsetY=Tf(e,i,n)},this.shadowBlur=(t,e,i,n,s,r)=>{r.attribute.shadowBlur=Tf(e,i,n)},this.fill=(t,e,i,n,s,r)=>{r.attribute.fill=rl(e,i,n,!1)},this.fillPure=(t,e,i,n,s,r)=>{r.attribute.fill=s.fromParsedProps.fill?ol(s.fromParsedProps.fill,s.toParsedProps.fill,n):s.toParsedProps.fill},this.stroke=(t,e,i,n,s,r)=>{r.attribute.stroke=rl(e,i,n,!1)},this.strokePure=(t,e,i,n,s,r)=>{r.attribute.stroke=s.fromParsedProps.stroke?ol(s.fromParsedProps.stroke,s.toParsedProps.stroke,n):s.toParsedProps.stroke},this.width=(t,e,i,n,s,r)=>{r.attribute.width=Tf(e,i,n),r.addUpdateBoundTag()},this.height=(t,e,i,n,s,r)=>{r.attribute.height=Tf(e,i,n),r.addUpdateBoundTag()},this.x=(t,e,i,n,s,r)=>{r.attribute.x=Tf(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.y=(t,e,i,n,s,r)=>{r.attribute.y=Tf(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.angle=(t,e,i,n,s,r)=>{r.attribute.angle=Tf(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.scaleX=(t,e,i,n,s,r)=>{r.attribute.scaleX=Tf(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.scaleY=(t,e,i,n,s,r)=>{r.attribute.scaleY=Tf(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.lineWidth=(t,e,i,n,s,r)=>{r.attribute.lineWidth=Tf(e,i,n),r.addUpdateBoundTag()},this.startAngle=(t,e,i,n,s,r)=>{r.attribute.startAngle=Tf(e,i,n),r.addUpdateBoundTag()},this.endAngle=(t,e,i,n,s,r)=>{r.attribute.endAngle=Tf(e,i,n),r.addUpdateBoundTag()},this.radius=(t,e,i,n,s,r)=>{r.attribute.radius=Tf(e,i,n),r.addUpdateBoundTag()},this.outerRadius=(t,e,i,n,s,r)=>{r.attribute.outerRadius=Tf(e,i,n),r.addUpdateBoundTag()},this.innerRadius=(t,e,i,n,s,r)=>{r.attribute.innerRadius=Tf(e,i,n),r.addUpdateBoundTag()},this.size=(t,e,i,n,s,r)=>{r.attribute.size=Tf(e,i,n),r.addUpdateBoundTag()},this.points=(t,e,i,n,s,r)=>{r.attribute.points=ea(e,i,n),r.addUpdateBoundTag()}}};function Mf(t,e,i,n,s,r){if(Number.isFinite(i)&&Number.isFinite(e))return r.attribute[t]=e+(i-e)*n,!0;if(Array.isArray(i)&&Array.isArray(e)&&i.length===e.length){const s=[];let a=!0;for(let t=0;t<i.length;t++){const r=e[t],o=r+(i[t]-r)*n;if(!Number.isFinite(o)){a=!1;break}s.push(o)}return a&&(r.attribute[t]=s),!0}return!1}function Bf(){}class Cf{constructor(t,e,i,n){this._startTime=0,this._hasFirstRun=!1,this._syncAttributeUpdate=()=>{this.target.setAttributes(this.target.attribute)},this.type=t,this.props=e,this.duration=i,this.easing=n?"function"==typeof n?n:Af[n]:Af.linear,"wait"===t&&(this.onUpdate=Bf),this.id=Si.GenAutoIncrementId(),this.syncAttributeUpdate=Bf}bind(t,e){this.target=t,this.animate=e,this.onBind(),this.syncAttributeUpdate()}append(t){this.next=t,t.prev=this,t.setStartTime(this.getStartTime()+this.duration,!1)}updateDownstreamStartTimes(){let t=this.next,e=this._startTime+this.duration;for(;t;)t.setStartTime(e,!1),e+=t.duration,t=t.next;this.animate.updateDuration()}getLastProps(){return this.prev?this.prev.props||{}:this.animate.getStartProps()}setDuration(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.duration=t,e&&this.updateDownstreamStartTimes()}getDuration(){return this.duration}determineInterpolateUpdateFunction(){if(!this.props)return;const t=[];this.propKeys.forEach((e=>{if("fill"===e||"stroke"===e){const i=this.fromProps[e],n=this.props[e];if(p(i)&&p(n)){const s=nl.Get(i,il.Color255),r=nl.Get(n,il.Color255);this.fromParsedProps||(this.fromParsedProps={}),this.toParsedProps||(this.toParsedProps={}),this.fromParsedProps[e]=s,this.toParsedProps[e]=r,t.push(wf["fill"===e?"fillPure":"strokePure"])}else wf[e]?t.push(wf[e]):t.push(Mf)}else wf[e]?t.push(wf[e]):t.push(Mf)})),this.interpolateUpdateFunctions=t}setStartTime(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._startTime=t,e&&this.updateDownstreamStartTimes()}getStartTime(){return this._startTime}onBind(){"glyph"===this.target.type&&(this.syncAttributeUpdate=this._syncAttributeUpdate)}onFirstRun(){}onStart(){if(!this._hasFirstRun){this._hasFirstRun=!0,this.fromProps=this.getLastProps();const t=this.animate.getStartProps();this.propKeys&&this.propKeys.forEach((e=>{var i;this.fromProps[e]=null!==(i=this.fromProps[e])&&void 0!==i?i:t[e]})),this.determineInterpolateUpdateFunction(),this.tryPreventConflict(),this.trySyncStartProps(),this.onFirstRun()}}tryPreventConflict(){const t=this.animate;this.target.animates.forEach((e=>{if(e===t||e.priority>t.priority||e.priority===1/0)return;const i=e.getStartProps();this.propKeys.forEach((t=>{null!=i[t]&&e.preventAttr(t)}))}))}deleteSelfAttr(t){var e;delete this.props[t],this.fromProps&&delete this.fromProps[t];const i=this.propKeys.indexOf(t);-1!==i&&(this.propKeys.splice(i,1),null===(e=this.interpolateUpdateFunctions)||void 0===e||e.splice(i,1))}trySyncStartProps(){this.propKeys.forEach((t=>{this.fromProps[t]=this.animate.target.getComputedAttribute(t)}))}update(t,e,i){if(this.onStart(),!this.props||!this.propKeys)return;const n=this.easing(e);this.animate.interpolateUpdateFunction?this.animate.interpolateUpdateFunction(this.fromProps,this.props,n,this,this.target):this.interpolateUpdateFunctions.forEach(((t,e)=>{if(!this.animate.validAttr(this.propKeys[e]))return;const i=this.propKeys[e];t(i,this.fromProps[i],this.props[i],n,this,this.target)})),this.onUpdate(t,n,i),this.syncAttributeUpdate()}onUpdate(t,e,i){}onEnd(t){this.target.setAttributes(this.props),t?this._endCb=t:this._endCb&&this._endCb(this.animate,this)}getEndProps(){return this.props}getFromProps(){return this.fromProps}getMergedEndProps(){return this.getEndProps()}stop(){}}class kf extends Cf{constructor(t,e,i,n){super(t,e,i,n)}onStart(){super.onStart()}onFirstRun(){const t=this.getFromProps();this.target.setAttributes(t)}update(t,e,i){this.onStart()}determineInterpolateUpdateFunction(){}}class Pf extends s{get animateCount(){return this._animateCount}constructor(){super(),this.head=null,this.tail=null,this.animateMap=new Map,this._animateCount=0,this._playSpeed=1,this._totalDuration=0,this._startTime=0,this._currentTime=0,this.id=Si.GenAutoIncrementId(),this.paused=!1}isRunning(){return!this.paused&&this._animateCount>0}forEachAccessAnimate(t){let e=this.head,i=0;for(;e;){const n=e.next;t(e.animate,i),i++,e=n}}addAnimate(t){const e={animate:t,next:null,prev:null};this.head?this.tail&&(this.tail.next=e,e.prev=this.tail,this.tail=e):(this.head=e,this.tail=e),this.animateMap.set(t,e),this._animateCount++,this._totalDuration=Math.max(this._totalDuration,t.getStartTime()+t.getDuration())}pause(){this.paused=!0}resume(){this.paused=!1}tick(t){if(this.paused)return;const e=t*this._playSpeed;this._currentTime+=e,this.forEachAccessAnimate(((t,i)=>{t.status===ln.END?this.removeAnimate(t,!0):t.status!==ln.RUNNING&&t.status!==ln.INITIAL||t.advance(e)})),0===this._animateCount&&this.emit("animationEnd")}clear(){this.forEachAccessAnimate((t=>{t.release()})),this.head=null,this.tail=null,this.animateMap.clear(),this._animateCount=0,this._totalDuration=0}removeAnimate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=this.animateMap.get(t);i&&(e&&(t._onRemove&&t._onRemove.forEach((t=>t())),t.release()),i.prev?i.prev.next=i.next:this.head=i.next,i.next?i.next.prev=i.prev:this.tail=i.prev,this.animateMap.delete(t),this._animateCount--,t.getStartTime()+t.getDuration()>=this._totalDuration&&this.recalculateTotalDuration())}recalculateTotalDuration(){this._totalDuration=0,this.forEachAccessAnimate((t=>{this._totalDuration=Math.max(this._totalDuration,t.getStartTime()+t.getDuration())}))}getTotalDuration(){return this._totalDuration}getPlaySpeed(){return this._playSpeed}setPlaySpeed(t){this._playSpeed=t}getPlayState(){return this.paused?"paused":0===this.animateCount?"stopped":"playing"}setStartTime(t){this._startTime=t}getStartTime(){return this._startTime}getCurrentTime(){return this._currentTime}setCurrentTime(t){this._currentTime=t}}const Of=new Pf;Of.isGlobal=!0;class Rf{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Si.GenAutoIncrementId(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Of,i=arguments.length>2?arguments[2]:void 0;this.id=t,this.status=ln.INITIAL,this._timeline=e,e.addAnimate(this),this.slience=i,this._startTime=0,this._duration=0,this._totalDuration=0,this._loopCount=0,this._currentLoop=0,this._bounce=!1,this._firstStep=null,this._lastStep=null,this._startProps={},this._endProps={},this._preventAttrs=new Set,this.currentTime=0,this.interpolateUpdateFunction=null,this.priority=0}getStartProps(){return this._startProps}getEndProps(){return this._endProps}setTimeline(t){this._timeline=t}getTimeline(){return this._timeline}get timeline(){return this._timeline}bind(t){return this.target=t,this.target.onAnimateBind&&!this.slience&&this.target.onAnimateBind(this),this.target.animationAttribute||(this.target.animationAttribute={}),this}to(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"linear";const n=new Cf(on.to,t,e,i);return n.bind(this.target,this),this.updateStepAfterAppend(n),this}wait(t){const e=new kf(on.wait,{},t,"linear");return e.bind(this.target,this),this.updateStepAfterAppend(e),this}updateStepAfterAppend(t){this._firstStep?(this._lastStep.append(t),this._lastStep=t):(this._firstStep=t,this._lastStep=t),this.parseStepProps(t),this.updateDuration()}parseStepProps(t){this._lastStep&&(t.propKeys=t.propKeys||Object.keys(t.props),Object.keys(this._endProps).forEach((e=>{var i;t.props[e]=null!==(i=t.props[e])&&void 0!==i?i:this._endProps[e]})),t.propKeys.forEach((e=>{this._endProps[e]=t.props[e]})))}reSyncProps(){if(!this._lastStep)return;this._endProps={};let t=this._firstStep;for(;t;)Object.keys(this._endProps).forEach((e=>{var i;t.props[e]=null!==(i=t.props[e])&&void 0!==i?i:this._endProps[e]})),t.propKeys.forEach((e=>{this._endProps[e]=t.props[e]})),t=t.next}from(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"linear";const n=new Cf(on.from,t,e,i);return this._firstStep?(this._lastStep.append(n),this._lastStep=n):(this._firstStep=n,this._lastStep=n),this.updateDuration(),this}play(t){return t.bind(this.target,this),this.updateStepAfterAppend(t),this}pause(){this.status===ln.RUNNING&&(this.status=ln.PAUSED)}resume(){this.status===ln.PAUSED&&(this.status=ln.RUNNING)}onStart(t){var e;t?(this._onStart||(this._onStart=[]),this._onStart.push(t)):(null===(e=this._onStart)||void 0===e||e.forEach((t=>t())),Object.keys(this._endProps).forEach((t=>{this._startProps[t]=this.target.getComputedAttribute(t)})))}onEnd(t){var e;t?(this._onEnd||(this._onEnd=[]),this._onEnd.push(t)):null===(e=this._onEnd)||void 0===e||e.forEach((t=>t()))}onFrame(t){t&&(this._onFrame||(this._onFrame=[]),this._onFrame.push(t))}onRemove(t){var e;t?(this._onRemove||(this._onRemove=[]),this._onRemove.push(t)):null===(e=this._onRemove)||void 0===e||e.forEach((t=>t()))}preventAttr(t){this._preventAttrs.add(t),delete this._startProps[t],delete this._endProps[t];let e=this._firstStep;for(;e;)e.deleteSelfAttr(t),e=e.next}preventAttrs(t){t.forEach((t=>this._preventAttrs.add(t)))}validAttr(t){return!this._preventAttrs.has(t)}runCb(t){var e;return null===(e=this._lastStep)||void 0===e||e.onEnd(t),this}startAt(t){return this._startTime=t,this}customInterpolate(t,e,i,n,s,r){return!1}getFromValue(){return this._startProps}getToValue(){return this._endProps}stop(t){let e=this._firstStep;for(;e;)e.stop(),e=e.next;this.status!==ln.END&&this.onEnd(),this.status=ln.END,this.target&&("start"===t?this.target.setAttributes(this._startProps):"end"===t?this.target.setAttributes(this._endProps):t&&this.target.setAttributes(t))}release(){this.status=ln.END,this._onRemove&&this._onRemove.forEach((t=>t())),this._onStart=[],this._onFrame=[],this._onEnd=[],this._onRemove=[]}getDuration(){return this._duration}getStartTime(){return this._startTime}afterAll(t){if(!t||0===t.length)return this;let e=0;return t.forEach((t=>{const i=t.getStartTime()+t.getTotalDuration();e=Math.max(e,i)})),this.startAt(e)}after(t){if(!t)return this;const e=t.getStartTime()+t.getTotalDuration();return this.startAt(e)}parallel(t){return t?(this.startAt(t.getStartTime()),this):this}loop(t){return!0===t?t=1/0:!1===t&&(t=0),this._loopCount=t,this.updateDuration(),this}bounce(t){return this._bounce=t,this}advance(t){var e,i,n;if(this.status===ln.END)return void console.warn("aaa 动画已经结束,不能推进");const s=this.currentTime+t;if(s<this._startTime)return void(this.currentTime=s);if(s>=this._startTime+this._totalDuration)return null===(e=this._lastStep)||void 0===e||e.onUpdate(!0,1,{}),null===(i=this._lastStep)||void 0===i||i.onEnd(),this.onEnd(),void(this.status=ln.END);this.status=ln.RUNNING,this.currentTime<=this._startTime&&this.onStart(),this.currentTime=s;let r=s-this._startTime,a=!1,o=!1;if(this._loopCount>0){r=(s-this._startTime)%this._duration;const t=Math.floor((s-this._startTime)/this._duration);a=t>this._currentLoop,this._currentLoop=t,o=this._bounce&&t%2==1,o&&(r=this._duration-r)}a&&!o&&this.target.setAttributes(this._startProps);let l=null;if(this._lastStep===this._firstStep)l=this._firstStep;else{let t=this._firstStep;for(;t;){const e=t.getStartTime(),i=t.getDuration();if(r>=e&&r<=e+i){l=t;break}t=t.next}}if(!l)return;l!==this.lastRunStep&&(null===(n=this.lastRunStep)||void 0===n||n.onEnd()),this.lastRunStep=l;const h=(r-l.getStartTime())/l.getDuration(),c=h>=1;l.update(c,h,{}),c&&(l.onEnd(),this.lastRunStep=null)}updateDuration(){this._lastStep?(this._duration=this._lastStep.getStartTime()+this._lastStep.getDuration(),this._totalDuration=this._duration*(this._loopCount+1)):this._duration=0}getTotalDuration(){return this._totalDuration}getLoop(){return this._loopCount}}const Lf=new class{constructor(){this.nextAnimationFrameCbs=[],this._rafHandle=null,this.runAnimationFrame=t=>{this._rafHandle=null;const e=this.nextAnimationFrameCbs;this.nextAnimationFrameCbs=[];for(let i=0;i<e.length;i++)e[i]&&e[i](t)},this.tryRunAnimationFrameNextFrame=()=>{null===this._rafHandle&&0!==this.nextAnimationFrameCbs.length&&(this._rafHandle=sn.global.getRequestAnimationFrame()(this.runAnimationFrame))}}addAnimationFrameCb(t){return this.nextAnimationFrameCbs.push(t),this.tryRunAnimationFrameNextFrame(),this.nextAnimationFrameCbs.length-1}removeAnimationFrameCb(t){return t>=0&&t<this.nextAnimationFrameCbs.length&&(this.nextAnimationFrameCbs[t]=null,!0)}};class If{constructor(){this.released=!1}tick(t,e){Lf.addAnimationFrameCb((()=>{if(!this.released)return e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}class Ef extends s{constructor(t){super(),this.timelines=[],this.frameTimeHistory=[],this.handleTick=(t,e)=>{const{once:i=!1}=null!=e?e:{};if(this.ifCanStop())return this.stop(),!1;const n=t.getTime();this._lastTickTime=n,this.lastFrameTime<0&&(this.lastFrameTime=n-this.interval+this.timeOffset,this.frameTimeHistory.push(this.lastFrameTime));const s=n-this.lastFrameTime,r=this.checkSkip(s);return r||(this._handlerTick(s),this.lastFrameTime=n,this.frameTimeHistory.push(this.lastFrameTime)),i||t.tick(this.interval,this.handleTick),!r},this._handlerTick=t=>{this.status===an.RUNNING&&(this.tickCounts++,this.timelines.forEach((e=>{e.tick(t)})),this.emit("tick",t))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.stage=t,this.autoStop=!0,this.interval=16,this.computeTimeOffsetAndJitter()}bindStage(t){this.stage=t}computeTimeOffsetAndJitter(){this.timeOffset=Math.floor(Math.random()*this.interval),this._jitter=Math.min(Math.max(.2*this.interval,6),.7*this.interval)}init(){this.interval=16,this.status=an.INITIAL,sn.global.hooks.onSetEnv.tap("graph-ticker",(()=>{this.initHandler()})),sn.global.env&&this.initHandler()}addTimeline(t){this.timelines.push(t)}remTimeline(t){this.timelines=this.timelines.filter((e=>e!==t))}getTimelines(){return this.timelines}initHandler(){this.setupTickHandler()}setupTickHandler(){const t=new If;return this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0}setInterval(t){this.interval=t,this.computeTimeOffsetAndJitter()}getInterval(){return this.interval}setFPS(t){this.setInterval(Math.floor(1e3/t))}getFPS(){return 1e3/this.interval}tick(t){this.tickerHandler.tick(t,(t=>this.handleTick(t,{once:!0})))}tickTo(t){this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,(t=>{this.handleTick(t,{once:!0})}))}pause(){return this.status!==an.INITIAL&&(this.status=an.PAUSE,!0)}resume(){return this.status!==an.INITIAL&&(this.status=an.RUNNING,!0)}ifCanStop(){if(this.autoStop){if(!this.timelines.length)return!0;if(this.timelines.every((t=>!t.isRunning())))return!0}return!1}start(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.status===an.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===an.PAUSE)return!1;if(this.ifCanStop())return!1}return this.status=an.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=an.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}trySyncTickStatus(){this.status===an.INITIAL&&this.timelines.some((t=>t.isRunning()))?this.start():this.status===an.RUNNING&&this.timelines.every((t=>!t.isRunning()))&&this.stop()}release(){var t;this.stop(),this.timelines=[],null===(t=this.tickerHandler)||void 0===t||t.release(),this.tickerHandler=null,this.lastFrameTime=-1}checkSkip(t){return"performance"!==this.stage.params.optimize.tickRenderMode&&t<this.interval+2*(Math.random()-.5)*this._jitter}}class Df{constructor(){this.transitions=new Map,this.registerDefaultTransitions()}static getInstance(){return Df.instance||(Df.instance=new Df),Df.instance}registerDefaultTransitions(){this.registerTransition("appear","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("appear","appear",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("appear","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("appear","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("normal","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("normal","normal",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("normal","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("normal","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("exit","*",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("exit","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("exit","enter",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("exit","exit",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("enter","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("enter","enter",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("enter","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("enter","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("disappear","*",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("disappear","appear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("update","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("update","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("update","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("state","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("state","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("state","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0})))}isTransitionAllowed(t,e,i){var n,s,r,a;let o=null===(n=this.transitions.get(t))||void 0===n?void 0:n.get(e);return o?o(i,t):(o=null===(s=this.transitions.get(t))||void 0===s?void 0:s.get("*"),o?o(i,t):(o=null===(r=this.transitions.get("*"))||void 0===r?void 0:r.get(e),o?o(i,t):(o=null===(a=this.transitions.get("*"))||void 0===a?void 0:a.get("*"),o?o(i,t):{allowTransition:!0,stopOriginalTransition:!0})))}registerTransition(t,e,i){let n=this.transitions.get(t);n||(n=new Map,this.transitions.set(t,n)),n.set(e,i)}}Df.getInstance();class Ff{static registerBuiltInAnimate(t,e){Ff.builtInAnimateMap[t]=e}constructor(t){this._animates=[],this._startCallbacks=[],this._endCallbacks=[],this._started=!1,this._activeCount=0,this._target=t}onStart(t){t?(this._startCallbacks.push(t),this._started&&this._activeCount>0&&t()):this._startCallbacks.forEach((t=>{t()}))}onEnd(t){t?this._endCallbacks.push(t):this._endCallbacks.forEach((t=>{t()}))}_trackAnimation(t){this._animates.push(t),this._activeCount++,1!==this._activeCount||this._started||(this._started=!0,this.onStart()),t.onEnd((()=>{this._activeCount--;const e=this._animates.indexOf(t);e>=0&&this._animates.splice(e,1),0===this._activeCount&&this._started&&(this._started=!1,this.onEnd())}))}parseParams(t,e,i){var n,s;const r=this.resolveValue(t.totalTime,void 0,void 0),a=this.resolveValue(t.startTime,void 0,0),l=Object.assign({},t);l.oneByOneDelay=0,l.startTime=a,l.totalTime=r;const h=this.resolveValue(t.oneByOne,i,!1);if(e){const t=l.timeSlices;g(t)||(l.timeSlices=[t]);let e=0;l.timeSlices=l.timeSlices.map((t=>{const n=this.resolveValue(t.delay,i,0),s=this.resolveValue(t.delayAfter,i,0),r=this.resolveValue(t.duration,i,300);return e+=n+r+s,Object.assign(Object.assign({},t),{delay:n,delayAfter:s,duration:r})}));let n=0;h&&(n="number"==typeof h?h:h?e:0),l.oneByOneDelay=n;let s=1;if(r){const t=e+n*(this._target.count-2);s=r?r/t:1}l.timeSlices=l.timeSlices.map((t=>{let e=t.effects;return Array.isArray(e)||(e=[e]),Object.assign(Object.assign({},t),{delay:t.delay*s,delayAfter:t.delayAfter*s,duration:t.duration*s,effects:e.map((t=>{var e,i;const n=null!==(e=t.custom)&&void 0!==e?e:Ff.builtInAnimateMap[null!==(i=t.type)&&void 0!==i?i:"fromTo"],s=n&&o(n)?/^class\s/.test(Function.prototype.toString.call(n))?1:2:0;return Object.assign(Object.assign({},t),{custom:n,customType:s})}))})})),l.oneByOneDelay=n*s,l.startTime=a*s}else{const e=this.resolveValue(t.delay,i,0),c=this.resolveValue(t.delayAfter,i,0),u=this.resolveValue(t.duration,i,300);let d=0;h&&(d="number"==typeof h?h:h?e+c+u:0),l.oneByOneDelay=d,l.custom=null!==(n=t.custom)&&void 0!==n?n:Ff.builtInAnimateMap[null!==(s=t.type)&&void 0!==s?s:"fromTo"];const p=l.custom&&o(l.custom)?/^class\s/.test(Function.prototype.toString.call(l.custom))?1:2:0;if(l.customType=p,r){const t=e+c+u+d*(this._target.count-2),i=r?r/t:1;l.delay=e*i,l.delayAfter=c*i,l.duration=u*i,l.oneByOneDelay=d*i,l.startTime=a}}return l}execute(t){Array.isArray(t)?t.forEach((t=>this._execute(t))):this._execute(t)}_execute(t){if(t.selfOnly)return this._executeItem(t,this._target,0,1);const e="timeSlices"in t;let i;e&&t.partitioner&&(i=(null!=i?i:this._target.getChildren()).filter((e=>{var i,n;return t.partitioner(null===(n=null===(i=e.context)||void 0===i?void 0:i.data)||void 0===n?void 0:n[0],e,{})}))),e&&t.sort&&(i=null!=i?i:this._target.getChildren(),i.sort(((e,i)=>{var n,s,r,a;return t.sort(null===(s=null===(n=e.context)||void 0===n?void 0:n.data)||void 0===s?void 0:s[0],null===(a=null===(r=i.context)||void 0===r?void 0:r.data)||void 0===a?void 0:a[0],e,i,{})})));const n=e?(i,n,s)=>{const r=this.parseParams(t,e,i),a=this.executeTimelineItem(r,i,n,s);a&&this._trackAnimation(a)}:(i,n,s)=>{const r=this.parseParams(t,e,i),a=this.executeTypeConfigItem(r,i,n,s);a&&this._trackAnimation(a)};i?i.forEach(((t,e)=>n(t,e,i.length))):this._target.count<=1?n(this._target,0,1):this._target.forEachChildren(((t,e)=>n(t,e,this._target.count-1)))}executeTypeConfigItem(t,e,i,n){var s,r,a,l,h,c,u,d;const{type:p="fromTo",channel:g,customParameters:f,easing:m="linear",delay:y=0,delayAfter:b=0,duration:v=300,startTime:x=0,oneByOneDelay:_=0,loop:A,bounce:S,priority:T=0,options:w,custom:M,customType:B,controlOptions:C}=t,k=e.animate();k.priority=T;const P=o(y)?y(null===(r=null===(s=e.context)||void 0===s?void 0:s.data)||void 0===r?void 0:r[0],e,{}):y,O=null===(l=null===(a=e.context)||void 0===a?void 0:a.data)||void 0===l?void 0:l[0],R=null===(h=e.context)||void 0===h?void 0:h.indexKey;O&&R&&(i=null!==(c=O[R])&&void 0!==c?c:i),k.startAt(x);const L=i*_+P;L>0&&k.wait(L);let I=null,E=t.to,D=t.from;E||(I||(I=this.createPropsFromChannel(g,e)),E=I.props),D||(I||(I=this.createPropsFromChannel(g,e)),D=I.from),this._handleRunAnimate(k,M,B,D,E,v,m,f,C,w,p,e);let F=0;_&&(F=_*(n-i-1));const j=o(b)?b(null===(d=null===(u=e.context)||void 0===u?void 0:u.data)||void 0===d?void 0:d[0],e,{}):b;return j>0&&(F+=j),F>0&&k.wait(F),A&&A>0&&k.loop(A),S&&k.bounce(!0),k}_handleRunAnimate(t,e,i,n,s,r,a,l,h,c,u,d){var p,g,f,m;if(e&&i){const u=this.resolveValue(l,d,{}),y=o(c)?c.call(null,null!==(g=u&&(null===(p=u.data)||void 0===p?void 0:p[0]))&&void 0!==g?g:null===(m=null===(f=d.context)||void 0===f?void 0:f.data)||void 0===m?void 0:m[0],d,u):c;u.options=y,u.controlOptions=h,1===i?this.createCustomAnimation(t,e,n,s,r,a,u):2===i&&this.createCustomInterpolatorAnimation(t,e,s,r,a,u)}else"to"===u?t.to(s,r,a):"from"===u&&t.from(s,r,a)}executeTimelineItem(t,e,i,n){var s,r,a,o;const{timeSlices:l,startTime:h=0,loop:c,bounce:u,oneByOneDelay:d,priority:p,controlOptions:g}=t,f=null===(r=null===(s=e.context)||void 0===s?void 0:s.data)||void 0===r?void 0:r[0],m=null===(a=e.context)||void 0===a?void 0:a.indexKey;f&&m&&(i=null!==(o=f[m])&&void 0!==o?o:i);const y=e.animate();return y.priority=p,y.startAt(h),y.wait(i*d),c&&c>0&&y.loop(c),u&&y.bounce(!0),(Array.isArray(l)?l:[l]).forEach((t=>{this.applyTimeSliceToAnimate(t,y,e,g)})),d&&y.wait(d*(n-i-1)),y}applyTimeSliceToAnimate(t,e,i,n){var s,r,a,l;const{effects:h,duration:c=300,delay:u=0,delayAfter:d=0}=t,p=o(u)?u(null===(r=null===(s=i.context)||void 0===s?void 0:s.data)||void 0===r?void 0:r[0],i,{}):u,g=o(d)?d(null===(l=null===(a=i.context)||void 0===a?void 0:a.data)||void 0===l?void 0:l[0],i,{}):d;p>0&&e.wait(p),(Array.isArray(h)?h:[h]).forEach((t=>{var s;const{type:r="fromTo",channel:a,customParameters:o,easing:l="linear",options:h}=t;let u=null,d=t.to,p=t.from;d||(u||(u=this.createPropsFromChannel(a,i)),d=u.props),p||(u||(u=this.createPropsFromChannel(a,i)),p=u.from);const g=null!==(s=t.custom)&&void 0!==s?s:Ff.builtInAnimateMap[r],f=t.customType;this._handleRunAnimate(e,g,f,p,d,c,l,o,n,h,r,i)})),g>0&&e.wait(g)}createCustomInterpolatorAnimation(t,e,i,n,s,r){const a=i;Object.keys(a).forEach((e=>{t.target.getComputedAttribute(e)})),t.interpolateUpdateFunction=(i,n,s,a,o)=>{e(s,i,n,a,o,t.target,r)},t.to(i,n,s)}createCustomAnimation(t,e,i,n,s,r,a){const o=new e(i,n,s,r,a);t.play(o)}createPropsFromChannel(t,e){const i={};let n=null;return t?(Array.isArray(t)?t.forEach((t=>{var n,s;const r=null===(s=null===(n=e.context)||void 0===n?void 0:n.diffAttrs)||void 0===s?void 0:s[t];void 0!==r&&(i[t]=r)})):Object.keys(t).forEach((s=>{var r,a,o,l;const h=t[s];void 0!==h.to&&("function"==typeof h.to?i[s]=h.to(null===(a=null===(r=e.context)||void 0===r?void 0:r.data)||void 0===a?void 0:a[0],e,{}):i[s]=h.to),void 0!==h.from&&(n||(n={}),"function"==typeof h.from?n[s]=h.from(null===(l=null===(o=e.context)||void 0===o?void 0:o.data)||void 0===l?void 0:l[0],e,{}):n[s]=h.from)})),{from:n,props:i}):{from:n,props:i}}resolveValue(t,e,i){var n,s;return void 0===t?i:"function"==typeof t&&e?t(null===(s=null===(n=e.context)||void 0===n?void 0:n.data)||void 0===s?void 0:s[0],e,{}):t}executeItem(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return Array.isArray(t)?t.map((t=>this._executeItem(t,e,i,n))).filter(Boolean):[this._executeItem(t,e,i,n)].filter(Boolean)}_executeItem(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(!e)return null;const s="timeSlices"in t;let r=null;const a=this.parseParams(t,s);return r=s?this.executeTimelineItem(a,e,i,n):this.executeTypeConfigItem(a,e,i,n),r&&this._trackAnimation(r),r}stop(t){for(;this._animates.length>0;){const e=this._animates.pop();null==e||e.stop(t)}this._animates=[],this._activeCount=0,this._started&&(this._started=!1,this.onEnd())}}Ff.builtInAnimateMap={};const jf="appear",Uf="disappear",Nf="update",Wf="highlight",zf="unhighlight";class Gf{constructor(t){this.graphic=t}registerState(t){this.states||(this.states=new Map),this.states.set(t.name,t)}clearStates(){var t;null===(t=this.states)||void 0===t||t.clear()}}class Vf{constructor(t){this.stateList=null,this.graphic=t}applyState(t,e,i){const n=Df.getInstance(),s=[],r=[];if(this.stateList&&this.stateList.length?t.forEach(((t,i)=>{const a={allowTransition:!0,stopOriginalTransition:!0};this.stateList.forEach((e=>{const i=n.isTransitionAllowed(e.state,t,this.graphic);a.allowTransition=a.allowTransition&&i.allowTransition})),a.allowTransition&&(r.push({state:t,animationConfig:g(e[i])?e[i].map((t=>t.animation)):e[i].animation,executor:new Ff(this.graphic)}),this.stateList.forEach((e=>{n.isTransitionAllowed(e.state,t,this.graphic).stopOriginalTransition&&s.push(e)})))})):t.forEach(((t,i)=>{r.push({state:t,animationConfig:g(e[i])?e[i].map((t=>t.animation)):e[i].animation,executor:new Ff(this.graphic)})})),s.forEach((t=>{t.executor.stop()})),r.length){r[0].executor.execute(r[0].animationConfig);for(let t=0;t<r.length;t++){const e=r[t+1],n=r[t];n.executor.onEnd((()=>{e&&e.executor.execute(e.animationConfig),this.stateList=this.stateList.filter((t=>t!==n)),t===r.length-1&&i&&i(!1)}))}}else i&&i(!0);this.stateList?this.stateList=this.stateList.filter((t=>!s.includes(t))):this.stateList=[],this.stateList.push(...r)}applyAppearState(t,e){this.applyState([jf],[{name:jf,animation:t}],e)}applyDisappearState(t,e){this.applyState([Uf],[{name:Uf,animation:t}],e)}applyUpdateState(t,e){this.applyState([Nf],[{name:Nf,animation:t}],e)}applyHighlightState(t,e){this.applyState([Wf],[{name:Wf,animation:t}],e)}applyUnhighlightState(t,e){this.applyState([zf],[{name:zf,animation:t}],e)}stopState(t,e){var i;const n=null===(i=this.stateList)||void 0===i?void 0:i.find((e=>e.state===t));n&&n.executor.stop(e)}clearState(){var t;null===(t=this.stateList)||void 0===t||t.forEach((t=>{t.executor.stop()})),this.stateList=null}}class Hf{_getAnimationStateManager(t){return t._animationStateManager||(t._animationStateManager=new Vf(t)),t._animationStateManager}_getAnimationStateStore(t){return t._animationStateStore||(t._animationStateStore=new Gf(t)),t._animationStateStore}registerAnimationState(t){return this._getAnimationStateStore(this).registerState(t),this}applyAnimationState(t,e,i){return this._getAnimationStateManager(this).applyState(t,e,i),this}applyAppearState(t,e){return this._getAnimationStateManager(this).applyAppearState(t,e),this}applyDisappearState(t,e){return this._getAnimationStateManager(this).applyDisappearState(t,e),this}applyUpdateState(t,e){return this._getAnimationStateManager(this).applyUpdateState(t,e),this}applyHighlightState(t,e){return this._getAnimationStateManager(this).applyHighlightState(t,e),this}applyUnhighlightState(t,e){return this._getAnimationStateManager(this).applyUnhighlightState(t,e),this}stopAnimationState(t,e){return this._getAnimationStateManager(this).stopState(t,e),this}clearAnimationStates(){return this._getAnimationStateManager(this).clearState(),this}static extend(t){return(new Hf)._getAnimationStateManager(t),t}}class Xf{getAttributes(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.finalAttribute?this.finalAttribute:this.attribute}animate(t){var e,i,n;this.animates||(this.animates=new Map);const s=new Rf(null==t?void 0:t.id,null!==(i=null!==(e=null==t?void 0:t.timeline)&&void 0!==e?e:this.stage&&this.stage.getTimeline())&&void 0!==i?i:Of,null==t?void 0:t.slience);if(s.bind(this),t){const{onStart:e,onEnd:i,onRemove:n}=t;null!=e&&s.onStart(e),null!=i&&s.onEnd(i),null!=n&&s.onRemove(n)}return this.animates.set(s.id,s),s.onRemove((()=>{s.stop(),this.animates.delete(s.id)})),null===(n=this.stage)||void 0===n||n.ticker.start(),s}createTimeline(){return new Pf}createTicker(t){return new Ef(t)}setFinalAttribute(t){this.finalAttribute||(this.finalAttribute={}),Object.assign(this.finalAttribute,t)}initFinalAttribute(t){this.finalAttribute=t}initAnimateExecutor(){this._animateExecutor||(this._animateExecutor=new Ff(this))}executeAnimation(t){return this.initAnimateExecutor(),this._animateExecutor.execute(t),this}executeAnimations(t){return this.initAnimateExecutor(),t.forEach((t=>{this._animateExecutor.execute(t)})),this}getFinalAttribute(){return this.finalAttribute}getGraphicAttribute(t){return!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&this.finalAttribute?this.finalAttribute[t]:this.attribute[t]}}function $f(){F(vl,Hf),F(vl,Xf)}class Yf extends Cf{constructor(t,e,i,n,s){super("customAnimate",e,i,n),this.type="customAnimate",this.customFrom=t,this.params=s}update(t,e,i){if(this.onStart(),!this.props||!this.propKeys)return;const n=this.easing(e);this.onUpdate(t,n,i),this.syncAttributeUpdate()}setProps(t){this.props=t,this.propKeys=Object.keys(t),this.animate.reSyncProps()}}class qf extends Yf{onStart(){const{center:t,r:e}="function"==typeof this.params?this.params():this.params,i=this.target.getComputedAttribute("x"),n=this.target.getComputedAttribute("y"),s=this.target.getComputedAttribute("z"),r=Math.acos((n-t.y)/e);let a=Math.acos((i-t.x)/e/Math.sin(r));s-t.z<0&&(a=at-a),this.theta=a,this.phi=r}onBind(){super.onBind()}onEnd(){}onUpdate(t,e,i){if(null==this.phi||null==this.theta)return;const{center:n,r:s,cb:r}="function"==typeof this.params?this.params():this.params,a=2*Math.PI*e,o=this.theta+a,l=this.phi,h=s*Math.sin(l)*Math.cos(o)+n.x,c=s*Math.cos(l)+n.y,u=s*Math.sin(l)*Math.sin(o)+n.z;for(i.x=h,i.y=c,i.z=u,i.alpha=o+nt/2;i.alpha>at;)i.alpha-=at;i.alpha=at-i.alpha,i.zIndex=-1e4*i.z,r&&r(i)}}const Kf=t=>({custom:qf,customParameters:()=>t,easing:"linear",loop:1/0,duration:6e3});class Zf extends e.BaseWordCloudSeries{constructor(){super(...arguments),this.type=xi.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 n=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-n.left||0-n.right||0,s=e.height-n.top||0-n.bottom||0,r=Math.max(i,s)/2;return{center:{x:r,y:r,z:null!==(t=this._spec.depth_3d)&&void 0!==t?t:r},r:r}})),e.userAnimationConfig("word",this._spec,this._markAttributeContext)))}}Zf.type=xi.wordCloud3d,Zf.builtInTheme={wordCloud3d:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}}};const Jf=()=>{e.registerTextMark(),e.Factory.registerAnimation("wordCloud3d",(t=>({enter:Kf(t)}))),e.Factory.registerSeries(Zf.type,Zf)},Qf=()=>{Jf()};class tm extends e.BaseWordCloudChartSpecTransformer{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.depth_3d=t.depth_3d,e}}class em extends e.BaseWordCloudChart{constructor(){super(...arguments),this.transformerConstructor=tm,this.type="wordCloud3d",this.seriesType=xi.wordCloud3d}}em.type="wordCloud3d",em.seriesType=xi.wordCloud3d,em.transformerConstructor=tm;const im=()=>{td(),Jf(),e.Factory.registerChart(em.type,em)},nm=(t,i)=>{var n;const s=e.getCombinedSizeOfRegions(t.getRegions()),{width:r}=t.getLayoutRect(),a=r,o=t.layout3dBox?t.layout3dBox.length:0,l=t.layout3dBox?t.layout3dBox.width:0,h={x:o,y:0},c=t.getLabelItems(a),u={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()};i||(u.grid={type:"line",start:{x:0,y:0},end:h,items:c[0],verticalFactor:t._axisStyle.verticalFactor,depth:l,length:i?0:s.height});const d=null!==(n=t.directionStr)&&void 0!==n?n:"r2l";let p=[0,0],g=-Math.PI/2,f=0;return"l2r"===d&&(f=t.layout3dBox.length,p=[0,0,0],g=Math.PI/2),u.z=f,u.alpha=g,u.anchor3d=p,u},sm={label:{space:0}};class rm extends e.CartesianBandAxis{setLayout3dBox(t){this.layout3dBox=t}_getUpdateAttribute(t){return e.isZAxis(this._orient)?nm(this,t):super._getUpdateAttribute(t)}}rm.builtInTheme=Object.assign(Object.assign({},e.CartesianBandAxis.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianBandAxis.builtInTheme.axisX),sm)}),F(rm,e.BandAxisMixin);class am extends e.CartesianLinearAxis{setLayout3dBox(t){this.layout3dBox=t}_getUpdateAttribute(t){if(!e.isZAxis(this._orient)){const e=super._getUpdateAttribute(t);return t||(e.grid.depth=this.layout3dBox?this.layout3dBox.length:0),e}return nm(this,t)}}am.builtInTheme=Object.assign(Object.assign({},e.CartesianLinearAxis.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianLinearAxis.builtInTheme.axisX),sm)}),F(am,e.LinearAxisMixin);class om extends e.CartesianLogAxis{setLayout3dBox(t){this.layout3dBox=t}_getUpdateAttribute(t){return e.isZAxis(this._orient)?nm(this,t):super._getUpdateAttribute(t)}}om.builtInTheme=Object.assign(Object.assign({},e.CartesianLogAxis.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianLogAxis.builtInTheme.axisX),sm)}),F(om,e.LinearAxisMixin);class lm extends e.CartesianSymlogAxis{setLayout3dBox(t){this.layout3dBox=t}_getUpdateAttribute(t){return e.isZAxis(this._orient)?nm(this,t):super._getUpdateAttribute(t)}}lm.builtInTheme=Object.assign(Object.assign({},e.CartesianSymlogAxis.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianSymlogAxis.builtInTheme.axisX),sm)}),F(lm,e.LinearAxisMixin);class hm extends e.CartesianTimeAxis{setLayout3dBox(t){this.layout3dBox=t}_getUpdateAttribute(t){return e.isZAxis(this._orient)?nm(this,t):super._getUpdateAttribute(t)}}hm.builtInTheme=Object.assign(Object.assign({},e.CartesianTimeAxis.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianTimeAxis.builtInTheme.axisX),sm)}),F(hm,e.LinearAxisMixin);const cm=Object.assign(Object.assign({},ed),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}});class um extends e.RangeColumnSeries{constructor(){super(...arguments),this.type=xi.rangeColumn3d,this._barMarkType="rect3d",this._barName=xi.bar3d}}um.type=xi.rangeColumn3d,um.mark=cm;const dm=()=>{tf(),e.registerCartesianBandAxis(),e.registerCartesianLinearAxis(),e.Factory.registerSeries(um.type,um)};class pm extends e.RangeColumnSeriesSpecTransformer{_transformLabelSpec(t){var e;"bothEnd"!==(null===(e=t.label)||void 0===e?void 0:e.position)&&this._addMarkLabelSpec(t,"bar3d")}}class gm extends e.CartesianChartSpecTransformer{_getDefaultSeriesSpec(t){var e,i;const n=super._getDefaultSeriesSpec(t,["bar3d","barGapInGroup"]);return"horizontal"===t.direction?n.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:n.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],n}}class fm extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=gm,this.type="rangeColumn3d",this.seriesType=xi.rangeColumn3d}_setModelOption(){this._modelOption.getDimensionInfo=e.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=e.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=e.getCartesianCrosshairRect}}fm.type="rangeColumn3d",fm.seriesType=xi.rangeColumn3d,fm.transformerConstructor=gm;const mm="pictogram",ym="pictogram";var bm;!function(t){t.pictogram="pictogram"}(bm||(bm={}));const vm=Object.assign(Object.assign({},e.baseSeriesMark),{pictogram:{name:"pictogram",type:"group"}});class xm extends e.BaseChartSpecTransformer{_isValidSeries(t){return t===ym}_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 _m=new Map;let Am;function Sm(t,i){_m.has(t)&&e.warn(`svg source key of '${t}' already exists, will be overwritten.`),Am||(Am=new ze,e.registerDataSetInstanceParser(Am,"svg",Le));const n=new Ge(Am);n.parse(i,{type:"svg"}),_m.set(t,n)}function Tm(t){_m.has(t)?_m.delete(t):e.warn(`map type of '${t}' does not exists.`)}function wm(t){return _m.get(t)}class Mm extends e.BaseSeriesSpecTransformer{_getDefaultSpecFromChart(t){var e,i,n;const s=null!==(e=super._getDefaultSpecFromChart(t))&&void 0!==e?e:{},r=t.svg,a=null===(n=null===(i=_m.get(r))||void 0===i?void 0:i.latestData)||void 0===n?void 0:n.elements;if(a&&a.length){a.map((t=>t.name)).filter((t=>h(t))).forEach((e=>{t[e]&&(s[e]=t[e])}))}return s}}class Bm 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 Cm="element-highlight-by-graphic-name";class km extends e.ElementHighlight{constructor(){super(...arguments),this.type=Cm,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(l(t))return;const{interaction:e,highlightState:i,blurState:n}=this.options,s=e.getStatedGraphics(this),r=[];this.getMarks().forEach((e=>{var i;null===(i=e.getGraphics())||void 0===i||i.forEach((e=>{e.name===t&&r.push(e)}))})),e.updateStates(this,r,s,i,n),e.setStatedGraphics(this,r)}reset(){const{highlightState:t,blurState:e,interaction:i}=this.options;i.clearAllStatesOfTrigger(this,t,e),i.setStatedGraphics(this,[])}}km.type=Cm;const Pm="element-select-by-graphic-name";class Om extends e.ElementSelect{constructor(){super(...arguments),this.type=Pm}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)}))}))}}Om.type=Pm;function Rm(t){var e;return h(t)&&"none"!==t&&!(null===(e=t.includes)||void 0===e?void 0:e.call(t,"url"))}const Lm=t=>{const e=parseFloat(t.strokeWidth);if(!isNaN(e))return e;const i=t.stroke;return i&&Rm(i)?1:0},Im=(t,e)=>{var i;const n=null!==(i=t.fill)&&void 0!==i?i:e;return n&&Rm(n)?n:void 0},Em=(t,e)=>{var i;const n=null!==(i=t.stroke)&&void 0!==i?i:e;return!(!n||!Rm(n))&&n},Dm=t=>Object.assign(Object.assign({},t),{x:parseFloat(t.x)||void 0,y:parseFloat(t.y)||void 0,fillStrokeOrder:!1,fill:Im(t),lineWidth:Lm(t),stroke:Em(t)}),Fm={group:t=>{const e=Dm(t);return Object.assign(Object.assign({},e),{visibleAll:!1!==e.visible})},rule:t=>Object.assign(Object.assign({},Dm(t)),{x:parseFloat(t.x1),y:parseFloat(t.y1),x1:parseFloat(t.x2),y1:parseFloat(t.y2)}),rect:t=>Object.assign(Object.assign({},Dm(t)),{fill:Im(t,"#000"),width:parseFloat(t.width),height:parseFloat(t.height)}),polygon:t=>Object.assign(Object.assign({},Dm(t)),{fill:Im(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({},Dm(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({},Dm(t)),{path:t.d,fillStrokeOrder:!1,fill:Im(t,"#000")}),arc:t=>{var e;return Object.assign(Object.assign({},Dm(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:Im(t,"#000")})},text:(t,e)=>{var i,n;return Object.assign(Object.assign({},Dm(t)),{text:e,textAlign:null!==(i=t.textAlign)&&void 0!==i?i:"left",textBaseLine:null!==(n=t.textAnchor)&&void 0!==n?n:"middle",anchor:[0,0],fill:Im(t,"#000")})}},jm=t=>{var i,n;if(!t||!t[0])return{};const{elements:s}=t[0].latestData;if(s&&s.length){s.forEach(((t,i)=>{var n;t[e.DEFAULT_DATA_INDEX]=i,t._uniqueId=`${t.id}-${i}`,t.data=void 0;const{graphicType:s,transform:r}=t,a={visible:"hidden"!==t.attributes.visibility&&"collapse"!==t.attributes.visibility};"text"===t.graphicType?O(a,t._inheritStyle,null===(n=t.parent)||void 0===n?void 0:n._textGroupStyle,t.attributes):"group"!==t.graphicType&&O(a,t._inheritStyle,t.attributes),Fm[s]?t._finalAttributes=Fm[s](a,t.value):t._finalAttributes=a,r&&(t._finalAttributes.postMatrix=Object.assign({},r))}));const t=s.filter((t=>"text"===t.tagName));for(let r=0;r<t.length;r++){const a=t[r]._uniqueId,o=s.filter((t=>{let e=!1,i=t.parent;for(;i;){if(i._uniqueId===a){e=!0;break}i=i.parent}return e}));if(o&&o.length){const s=null!==(n=null===(i=t[r]._textGroupStyle)||void 0===i?void 0:i.x)&&void 0!==n?n:0;let a=s;for(let t=0;t<o.length;t++){const i=o[t];if("group"===i.graphicType)a=s;else if(i.value&&void 0===i.parent._textGroupStyle.x){const n=o.slice(0,t).reverse().find((t=>"text"===t.graphicType&&t.value));if(n){a+=e.measureText(n.value,n._finalAttributes).width}i._finalAttributes.x=a}}}}}return s};class Um extends e.GeoSeries{constructor(){super(...arguments),this.type=ym,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=wm(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,n=h(t.triggerOff)?t.triggerOff:i?["empty","self"]:["empty",t.trigger];return{type:"element-select-by-graphic-name",trigger:t.trigger,triggerOff:n,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(Um.mark.pictogram,{groupKey:this.getDimensionField()[0],isSeriesMark:!0,skipBeforeLayouted:!0},{morph:e.shouldMarkDoMorph(this._spec,Um.mark.pictogram.name)}),this._pictogramMark){this._pictogramMark.setData(this._mapViewData),this._pictogramMark.setUserId(Um.mark.pictogram.name);for(const i of this._mapViewData.getDataView().latestData){const{graphicType:n,name:s,parent:r,id:a,_nameFromParent:o,_uniqueId:l}=i,h=this._createMark({type:n,name:null!=s?s:o},{groupKey:l,isSeriesMark:!1,skipBeforeLayouted:!0,parent:null!==(t=this._idToMark.get(null==r?void 0:r._uniqueId))&&void 0!==t?t:this._pictogramMark},{morph:e.shouldMarkDoMorph(this._spec,Um.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(Um.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,viewBoxRect:i}=this._parsedSvgResult,n=this._mapViewData.getDataView().latestData;t&&(this.setMarkStyle(this._pictogramMark,Fm.group(t.attributes),"normal",e.AttributeLevel.Built_In),t.transform&&this.setMarkStyle(this._pictogramMark,{postMatrix:()=>t.transform},"normal",e.AttributeLevel.Built_In),i&&this._pictogramMark.setMarkConfig({clip:!0,clipPath:[rh(Object.assign(Object.assign({},i),{fill:!0}))]}));for(const t of n){const{_uniqueId:i,_finalAttributes:n}=t,s=this._idToMark.get(i),r=this._validElement(t);s&&(this.setMarkStyle(s,{keepStrokeScale:!0},"normal",e.AttributeLevel.Built_In),r?(this.initMarkStyleWithSpec(s,O({},this._spec.pictogram,this._spec[s.name])),this.setMarkStyle(s,n,"normal",e.AttributeLevel.Series),s.setPostProcess("fill",((t,e)=>h(t)?t:this._spec.defaultFillColor))):(s.setMarkConfig({interactive:!1}),this.setMarkStyle(s,n,"normal",e.AttributeLevel.Built_In)))}this.initLabelMarkStyle()}_validElement(t){return t.name||t._nameFromParent}initTooltip(){this._tooltipHelper=new Bm(this),this.getMarksWithoutRoot().forEach((t=>{t&&t.name&&this._tooltipHelper.activeTriggerSet.mark.add(t)}))}dataToPosition(t,e=!1){if(!t)return null;const i=t[this.nameField];if(!i)return null;const n=this.getMarksWithoutRoot().filter((t=>t.name===i));if(!n||0===n.length)return null;let s=new Ht;e?n.forEach((t=>{s=s.union(t.getGraphics()[0].globalAABBBounds)})):n.forEach((t=>{s=s.union(t.getProduct().AABBBounds)}));const r={x:(s.x1+s.x2)/2,y:(s.y1+s.y2)/2};if(e){const{x:t,y:e}=this.getLayoutStartPoint();r.x-=t,r.y-=e}return r}coordToPosition(t){if(!t)return null;const{x:e,y:i}=t,n=this.getRootMatrix();if(!n)return null;const s={};return n.getInverse().transformPoint({x:e,y:i},s),s}getRootMatrix(){var t;return null===(t=this.getPictogramRootGraphic())||void 0===t?void 0:t.transMatrix}getPictogramRootGraphic(){return this._pictogramMark.getProduct()}initData(){var t,i;super.initData();const n=_m.get(this.svg);n||null===(t=this._option)||void 0===t||t.onError("no valid svg found!");const s=new Ge(this._dataSet,{name:`pictogram_${this.id}_data`});e.registerDataSetInstanceTransform(this._dataSet,"pictogram",jm),e.registerDataSetInstanceTransform(this._dataSet,"lookup",e.lookup),s.parse([n],{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",s.reRunAllTransform),this._mapViewData=new e.CompilableData(this._option,s)}mapViewDataUpdate(){this._mapViewData.updateData()}onLayoutEnd(){var t;super.onLayoutEnd(),null===(t=this._mapViewData)||void 0===t||t.getDataView().reRunAllTransform()}updateSVGSize(){const{width:t,height:e}=this.getLayoutRect(),i=t/2,n=e/2,s=this.getPictogramRootGraphic();if(s){const r=s.AABBBounds,{x1:a,x2:o,y1:l,y2:h}=s.AABBBounds,c=(a+o)/2,u=(l+h)/2,d=t/r.width(),p=e/r.height(),g=Math.min(d,p);s.scale(g,g,{x:c,y:u}),s.translate(i-c,n-u)}}initEvent(){var t;super.initEvent(),null===(t=this._mapViewData.getDataView())||void 0===t||t.target.addListener("change",this.mapViewDataUpdate.bind(this)),this.event.on(e.ChartEvent.afterMarkLayoutEnd,this.updateSVGSize.bind(this))}handleZoom(t){const{scale:e,scaleCenter:i}=t;if(1===e)return;const n=this.getPictogramRootGraphic();n&&(n.attribute.postMatrix||n.setAttributes({postMatrix:new Yt}),n.scale(e,e,i))}handlePan(t){const{delta:e}=t;if(0===e[0]&&0===e[1])return;const i=this.getPictogramRootGraphic();i&&(i.attribute.postMatrix||i.setAttributes({postMatrix:new Yt}),i.translate(e[0],e[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}}Um.type=ym,Um.mark=vm,Um.transformerConstructor=Mm;const Nm=()=>{e.Factory.registerSeries(Um.type,Um),e.Factory.registerImplement("registerSVG",Sm),e.Factory.registerImplement("unregisterSVG",Tm),e.Factory.registerInteractionTrigger(km.type,km),e.Factory.registerInteractionTrigger(Om.type,Om)};class Wm extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=xm,this.type=mm,this.seriesType=ym}}Wm.type=ym,Wm.seriesType=mm,Wm.transformerConstructor=xm;class zm 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 Gm="imageCloud",Vm="imageCloud";var Hm;!function(t){t.image="image",t.imageMask="imageMask"}(Hm||(Hm={}));const Xm=Object.assign(Object.assign({},e.baseSeriesMark),{image:{name:"image",type:"image"},imageMask:{name:"imageMask",type:"rect"}}),$m={triangleForward:function(){return function(t){const e=t%(2*Math.PI/3);return 1/(Math.cos(e)+Math.sqrt(3)*Math.sin(e))}},triangleUpright:Ym,triangle:Ym,diamond:function(){return function(t){const e=t%(2*Math.PI/4);return 1/(Math.cos(e)+Math.sin(e))}},square:function(){return function(t){return Math.min(1/Math.abs(Math.cos(t)),1/Math.abs(Math.sin(t)))}},star:function(){return function(t){const e=(t+.955)%(2*Math.PI/10);return(t+.955)%(2*Math.PI/5)-2*Math.PI/10>=0?1/(Math.cos(2*Math.PI/10-e)+3.07768*Math.sin(2*Math.PI/10-e)):1/(Math.cos(e)+3.07768*Math.sin(e))}},cardioid:function(){return function(t){return 1+Math.sin(t)}},circle:function(){return function(){return 1}},pentagon:function(){return function(t){const e=(t+.955)%(2*Math.PI/5);return 1/(Math.cos(e)+.726543*Math.sin(e))}}};function Ym(){return function(t){const e=(t+3*Math.PI/2)%(2*Math.PI/3);return 1/(Math.cos(e)+Math.sqrt(3)*Math.sin(e))}}const qm={archimedean:function(t){const e=t[0]/t[1];return t=>[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]},rectangular:function(t){const e=4*t[0]/t[1];let i=0,n=0;return t=>{const s=t<0?-1:1;switch(Math.sqrt(1+4*s*t)-s&3){case 0:i+=e;break;case 1:n+=4;break;case 2:i-=e;break;default:n-=4}return[i,n]}}};const Km=(t,e,i)=>{const{threshold:n,invert:s=!1}=null!=e?e:{};if(!t||"#fff"===t)return(t,e,i)=>{const r=t.width;if(0===t.data[e*r*4+4*i+3])return!s;const a=t.data[e*r*4+4*i+0],o=t.data[e*r*4+4*i+1],l=t.data[e*r*4+4*i+2];if(255===a&&255===o&&255===l)return!s;if(b(n)){const t=.3*a+.59*o+.11*l;return s?t<=n:t>=n}return!1};const r=i({width:1,height:1}).getContext("2d",{willReadFrequently:!0});r.fillStyle=t,r.fillRect(0,0,1,1);const a=r.getImageData(0,0,1,1).data;return(t,e,i)=>{const n=t.width;return[0,1,2,3].every((r=>s?t.data[4*(e*n+i)+r]!==a[r]:t.data[4*(e*n+i)+r]===a[r]))}},Zm=(t,e,i,n,s)=>{const{fontFamily:r="sans-serif",fontWeight:a="normal",fontStyle:o="normal",fontVariant:l="normal",text:c,hollow:u}=t;let d=12;s.font=`${o} ${l} ${a} ${d}px ${r}`,s.textAlign="center",s.textBaseline="middle",s.fillStyle=e;const p=s.measureText(c),g="normal"!==o?1.1:1,f=h(p.actualBoundingBoxRight)&&h(p.actualBoundingBoxLeft)?Math.ceil(g*(Math.abs(p.actualBoundingBoxRight)+Math.abs(p.actualBoundingBoxLeft))):0,m=Math.max(Math.ceil(p.width),f,d);if(u&&(s.globalCompositeOperation="xor"),m>i){const t=Math.min(i/m,n/d);s.fillText(c,i/2,n/2),s.scale(t,t)}else d=Math.floor(d*i/m),d=Math.min(d,n),s.font=`${o} ${l} ${a} ${d}px ${r}`,s.fillText(c,Math.floor(i/2),Math.floor(n/2))},Jm=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;const s=2*Math.PI/n;return new Array(n).fill(0).map(((n,r)=>St(t,e,i+r*s)))},Qm=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;const s=2*Math.PI/n,r=(t=>$m[t]?$m[t]():$m.circle())("cardioid");return new Array(n).fill(0).map(((n,a)=>{const o=i+a*s,l=e*r(o);return St(t,l,o)}))},ty=(t,e)=>{t.beginPath(),e.forEach(((e,i)=>{0===i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y)})),t.closePath(),t.fill()},ey=(t,e,i,n,s)=>{const{hollow:r}=t,{center:a,maxRadius:o}=function(t,e){const i=e[0],n=e[1];let s=1;const r=[e[0]>>1,e[1]>>1];switch(t){case"cardioid":r[1]=~~(n/2.7*.4),s=Math.floor(Math.min(i/2.3,n/2.6));break;case"triangleForward":s=n/Math.sqrt(.75)>i?Math.floor(i/2):Math.floor(n/(2*Math.sqrt(.75)));break;case"triangle":case"triangleUpright":r[1]=~~(n/1.5),s=Math.floor(Math.min(n/1.5,i/2));break;case"circle":case"diamond":case"square":case"star":case"pentagon":s=Math.floor(Math.min(i/2,n/2));break;default:s=Math.floor(Math.max(i/2,n/2))}return{maxRadius:s,center:r}}(t.shape,[i,n]);s.fillStyle=e,r&&(s.globalCompositeOperation="xor");const l=a[0],h=a[1];if("cardioid"===t.shape)((t,e)=>{let i;t.beginPath(),e.forEach(((e,n)=>{0===n?t.moveTo(e.x,e.y):t.bezierCurveTo(e.x,e.y,i.x,i.y,e.x,e.y),i=e})),t.closePath(),t.fill()})(s,Qm({x:l,y:h},o,0,100));else if("circle"===t.shape)s.beginPath(),s.arc(l,h,o,0,2*Math.PI,!0),s.fill();else if("diamond"===t.shape)ty(s,Jm({x:l,y:h},o,-Math.PI/2,4));else if("square"===t.shape)ty(s,Jm({x:l,y:h},o,-Math.PI/4,4));else if("pentagon"===t.shape)ty(s,Jm({x:l,y:h},o,Math.PI/2,5));else if("triangle"===t.shape||"triangleUpright"===t.shape)ty(s,Jm({x:l,y:h},o,-Math.PI/2,3));else if("triangleForward"===t.shape)ty(s,Jm({x:l,y:h},o,0,3));else if("star"===t.shape){const t=Jm({x:l,y:h},o,-Math.PI/2,5),e=Jm({x:l,y:h},o/(2*Math.cos(Math.PI/5)),-Math.PI/2+Math.PI/5,5),i=[];for(let n=0;n<5;n++)i.push(t[n]),i.push(e[n]);ty(s,i)}else s.fillRect(0,0,i,n)};function iy(t){const{size:e,maskCanvas:i}=t,n=i.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,i.width,i.height),s=new Array(e[0]*e[1]).fill(0);let r=1;const a=[[0,1],[1,0],[-1,0],[0,-1]];let o=[];for(let i=0;i<e[1];i++)for(let l=0;l<e[0];l++)if(0===s[i*e[0]+l]&&!t.isEmptyPixel(n,i,l)){s[i*e[0]+l]=r,o.push([i,l]);for(let i=0;i<o.length;i++)for(let l=0;l<4;l++){let h=o[i][0]+a[l][0],c=o[i][1]+a[l][1];h=h<0?0:h>=e[1]?e[1]-1:h,c=c<0?0:c>=e[0]?e[0]-1:c,0!==s[h*e[0]+c]||t.isEmptyPixel(n,h,c)||(s[h*e[0]+c]=r,o.push([h,c]))}r++,o=[]}const l={},h={},c={},u={},d={},p={},g={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0,width:0,height:0},f=[];for(let t=0;t<e[1];t++)for(let i=0;i<e[0];i++){const n=s[t*e[0]+i];0!==n&&(T(t,i)&&(f.push([t,i]),l[n]=l[n]||[],l[n].push([i,t]),u[n]||(u[n]=[1/0,-1/0,1/0,-1/0]),t<u[n][0]&&(u[n][0]=t),t>u[n][1]&&(u[n][1]=t),i<u[n][2]&&(u[n][2]=i),i>u[n][3]&&(u[n][3]=i),i<g.x1&&(g.x1=i),i>g.x2&&(g.x2=i),t<g.y1&&(g.y1=t),t>g.y2&&(g.y2=t)),h[n]=(h[n]||0)+1)}const m=[];for(const t in l){const e=l[t],i=~~(e.reduce(((t,e)=>t+e[0]),0)/e.length),n=~~(e.reduce(((t,e)=>t+e[1]),0)/e.length);c[t]=[i,n],m.push(...e);const[s,r,a,o]=u[t];d[t]=~~Math.max(Math.sqrt((i-a)**2+(n-s)**2),Math.sqrt((i-o)**2+(n-r)**2),Math.sqrt((i-a)**2+(n-r)**2),Math.sqrt((i-o)**2+(n-s)**2)),p[t]=(o-a)/(r-s)}const y=Object.keys(c).map((t=>({label:t-1,boundary:l[t],area:h[t],center:c[t],maxPoint:u[t],maxR:d[t],ratio:p[t]})));g.width=g.x2-g.x1+1,g.height=g.y2-g.y1+1;const b=~~(m.reduce(((t,e)=>t+e[0]),0)/m.length),v=~~(m.reduce(((t,e)=>t+e[1]),0)/m.length),x=~~Math.max(Math.sqrt((b-g.x1)**2+(v-g.y1)**2),Math.sqrt((b-g.x2)**2+(v-g.y2)**2),Math.sqrt((b-g.x1)**2+(v-g.y2)**2),Math.sqrt((b-g.x2)**2+(v-g.y1)**2)),_=g.width/g.height,A=Object.keys(h).reduce(((t,e)=>t+h[e]),0),S={regions:y,labels:s,labelNumber:r-1};if(t.blur){const i=t.blur,n=function(t,e,i,n){const s=n/3,r=Math.ceil(n/2),a=function(t,e){const i=new Array(2*t+1).fill(0),n=t;let s=0;for(let r=-t;r<=t;r++){const t=Math.exp(-r*r/(2*e*e));i[r+n]=t,s+=t}for(let t=0;t<i.length;t++)i[t]/=s;return i}(r,s),o=new Array(t.length).fill(0),l=new Array(t.length).fill(0);for(let n=0;n<i;n++)for(let i=0;i<e;i++){let s=0;for(let o=-r;o<=r;o++)s+=t[n*e+Math.min(Math.max(i+o,0),e-1)]*a[o+r];o[n*e+i]=s}for(let t=0;t<e;t++)for(let n=0;n<i;n++){let s=0;for(let l=-r;l<=r;l++)s+=o[Math.min(Math.max(n+l,0),i-1)*e+t]*a[l+r];l[n*e+t]=Math.max(0,Math.min(1,s))}return l}(s,e[0],e[1],i);(function(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;const r=new Array(t.length).fill(0);for(const[t,a]of e)if(r[t*i+a]=1,s>1)for(let e=1-s;e<=s-1;e++)for(let o=1-s;o<=s-1;o++)if(Math.sqrt(e*e+o*o)<s){const s=t+e,l=a+o;s>=0&&s<n&&l>=0&&l<i&&(r[s*i+l]=1)}return r})(s,f,e[0],e[1],Math.ceil(i/2)).forEach(((t,e)=>{1===t&&(s[e]=n[e])}))}return Object.assign(t,{segmentation:S,shapeBounds:g,shapeMaxR:x,shapeRatio:_,shapeCenter:[b,v],shapeArea:A});function T(t,i){const n=[[0,1],[1,0],[-1,0],[0,-1]];if(0===t||0===i||t===e[1]-1||i===e[0]-1)return!0;for(let r=0;r<4;r++){let a=t+n[r][0],o=i+n[r][1];if(a=a<0?0:a>=e[1]?e[1]-1:a,o=o<0?0:o>=e[0]?e[0]-1:o,0===s[a*e[0]+o])return!0}return!1}}function ny(t,e,i){e.width=t.width,e.height=t.height;const n=e.getContext("2d",{willReadFrequently:!0});n.clearRect(0,0,e.width,e.height),n.drawImage(t,0,0);const s=e.width,r=n.getImageData(0,0,e.width,e.height);let a=0,o=r.height,l=0,h=r.width;const c=(t,e)=>{for(let n=0;n<t;++n)if(!i(r,e,n))return!1;return!0},u=(t,e,n)=>{for(let s=e;s<n;++s)if(!i(r,s,t))return!1;return!0};for(;a<o&&c(s,a);)++a;for(;o-1>a&&c(s,o-1);)--o;for(;l<h&&u(l,a,o);)++l;for(;h-1>l&&u(h-1,a,o);)--h;const d=n.getImageData(l,a,h-l,o-a);return e.width=d.width,e.height=d.height,n.clearRect(0,0,e.width,e.height),n.putImageData(d,0,0),e}function sy(t,e){return t&&(v(t)||x(t)||t.startsWith("<svg"))?new Promise(((i,n)=>{var s;const r=e({image:t}),a=null===(s=r.resources)||void 0===s?void 0:s.get(t);a&&"success"===a.state&&a.data?i(a.data):(r.successCallback=()=>{var e;if(r){const s=null===(e=r.resources)||void 0===e?void 0:e.get(t);s&&"success"===s.state&&s.data?i(s.data):n(new Error("image load failed: "+t))}else n(new Error("image load failed: "+t))},r.failCallback=()=>{n(new Error("image load failed: "+t))})})):null}var ry;function ay(t){return t}!function(t){t.Identity="identity",t.Linear="linear",t.Log="log",t.Pow="pow",t.Sqrt="sqrt",t.Symlog="symlog",t.Time="time",t.Quantile="quantile",t.Quantize="quantize",t.Threshold="threshold",t.Ordinal="ordinal",t.Point="point",t.Band="band"}(ry||(ry={})),Object.values(ry).forEach((t=>{}));const oy=t=>t<0?-Math.sqrt(-t):Math.sqrt(t),ly=t=>t<0?-t*t:t*t;function hy(t,e){if(t=Number(t),e=Number(e),e-=t)return i=>(i-t)/e;const i=Number.isNaN(e)?NaN:.5;return()=>i}function cy(t,e,i){const n=t[0],s=t[1],r=e[0],a=e[1];let o,l;return s<n?(o=hy(s,n),l=i(a,r)):(o=hy(n,s),l=i(r,a)),t=>l(o(t))}function uy(t,e,i){const n=Math.min(t.length,e.length)-1,s=new Array(n),r=new Array(n);let a=-1;for(t[n]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<n;)s[a]=hy(t[a],t[a+1]),r[a]=i(e[a],e[a+1]);return function(e){const i=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;for(l(n)&&(n=t.length);i<n;){const s=i+n>>>1;z(t[s],e)>0?n=s:i=s+1}return i}(t,e,1,n)-1;return r[i](s[i](e))}}class dy{constructor(){this._rangeFactorStart=null,this._rangeFactorEnd=null}_calculateWholeRange(t){return this._wholeRange?this._wholeRange:h(this._rangeFactorStart)&&h(this._rangeFactorEnd)&&2===t.length?(this._wholeRange=function(t,e){const i=(t[1]-t[0])/(e[1]-e[0]),n=t[0]-i*e[0];return[n,i+n]}(t,[this._rangeFactorStart,this._rangeFactorEnd]),this._wholeRange):t}rangeFactor(t,e,i){return t?(2===t.length&&t.every((t=>t>=0&&t<=1))&&(this._wholeRange=null,0===t[0]&&1===t[1]?(this._rangeFactorStart=null,this._rangeFactorEnd=null):(this._rangeFactorStart=t[0],this._rangeFactorEnd=t[1])),this):i?(this._wholeRange=null,this._rangeFactorStart=null,this._rangeFactorEnd=null,this):h(this._rangeFactorStart)&&h(this._rangeFactorEnd)?[this._rangeFactorStart,this._rangeFactorEnd]:null}rangeFactorStart(t,e){var i;return l(t)?this._rangeFactorStart:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!l(this._rangeFactorEnd)&&1!==this._rangeFactorEnd?(this._rangeFactorStart=t,this._rangeFactorEnd=null!==(i=this._rangeFactorEnd)&&void 0!==i?i:1):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}rangeFactorEnd(t,e){var i;return l(t)?this._rangeFactorEnd:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!l(this._rangeFactorStart)&&0!==this._rangeFactorStart?(this._rangeFactorEnd=t,this._rangeFactorStart=null!==(i=this._rangeFactorStart)&&void 0!==i?i:0):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}generateFishEyeTransform(){var t;if(!this._fishEyeOptions)return void(this._fishEyeTransform=null);const{distortion:e=2,radiusRatio:i=.1,radius:n}=this._fishEyeOptions,s=this.range(),r=s[0],a=s[s.length-1],o=Math.min(r,a),h=Math.max(r,a),c=q(null!==(t=this._fishEyeOptions.focus)&&void 0!==t?t:0,o,h),u=l(n)?(h-o)*i:n;let d=Math.exp(e);d=d/(d-1)*u;const p=e/u;this._fishEyeTransform=t=>{const e=Math.abs(t-c);if(e>=u)return t;if(e<=1e-6)return c;const i=d*(1-Math.exp(-e*p))/e*.75+.25;return c+(t-c)*i}}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}get(t,e){var i;return null!==(i=null==this?void 0:this[t])&&void 0!==i?i:e}}const{interpolateRgb:py}=oe;function gy(t,e){const i=typeof e;let n;if(l(e)||"boolean"===i)return()=>e;if("number"===i)return K(t,e);if("string"===i){if(n=re.parseColorString(e)){const e=py(re.parseColorString(t),n);return t=>e(t).formatRgb()}return K(Number(t),Number(e))}return e instanceof ae?py(t,e):e instanceof re?py(t.color,e.color):e instanceof Date?function(t,e){const i=t.valueOf(),n=e.valueOf(),s=new Date;return t=>(s.setTime(i*(1-t)+n*t),s)}(t,e):K(Number(t),Number(e))}class fy extends dy{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ay,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ay;super(),this._unknown=void 0,this.transformer=t,this.untransformer=e,this._forceAlign=!0,this._domain=[0,1],this._range=[0,1],this._clamp=ay,this._piecewise=cy,this._interpolate=gy}calculateVisibleDomain(t){var e;return h(this._rangeFactorStart)&&h(this._rangeFactorEnd)&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:null!==(e=this._niceDomain)&&void 0!==e?e:this._domain}fishEye(t,e,i){return t||i?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}scale(t){var e;if(t=Number(t),Number.isNaN(t)||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise((null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));const i=this._output(this.transformer(this._clamp(t)));return this._fishEyeTransform?this._fishEyeTransform(i):i}invert(t){var e;return this._input||(this._input=this._piecewise(this._calculateWholeRange(this._range),(null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),K)),this._clamp(this.untransformer(this._input(t)))}domain(t,e){var i;if(!t)return(null!==(i=this._niceDomain)&&void 0!==i?i:this._domain).slice();this._domainValidator=null,this._niceType=null,this._niceDomain=null;const n=Array.from(t,G);return this._domain=n,this.rescale(e)}range(t,e){if(!t)return this._range.slice();const i=Array.from(t);return this._range=i,this.rescale(e)}rangeRound(t,e){const i=Array.from(t);return this._range=i,this._interpolate=Z,this.rescale(e)}rescale(t){var e;if(t)return this;const i=null!==(e=this._niceDomain)&&void 0!==e?e:this._domain,n=i.length,s=this._range.length;let r=Math.min(n,s);if(n&&n<s&&this._forceAlign){const t=s-n+1,e=i[n-1],a=n>=2?(e-i[n-2])/t:0;for(let s=1;s<=t;s++)i[n-2+s]=e-a*(t-s);r=s}return this._autoClamp&&(this._clamp=function(t,e){let i;return t>e&&(i=t,t=e,e=i),i=>Math.max(t,Math.min(e,i))}(i[0],i[r-1])),this._piecewise=r>2?uy:cy,this._output=this._input=null,this._wholeRange=null,this.generateFishEyeTransform(),this}clamp(t,e,i){return arguments.length?(e?(this._autoClamp=!1,this._clamp=e):(this._autoClamp=!!t,this._clamp=t?void 0:ay),this.rescale(i)):this._clamp!==ay}interpolate(t,e){return arguments.length?(this._interpolate=t,this.rescale(e)):this._interpolate}ticks(){return[]}tickData(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const e=this.ticks(t);return(null!=e?e:[]).map(((t,e)=>({index:e,tick:t,value:(this.scale(t)-this._range[0])/(this._range[1]-this._range[0])})))}rangeFactor(t,e){return t?(super.rangeFactor(t),this._output=this._input=null,this):super.rangeFactor()}rangeFactorStart(t,e){return l(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this._output=this._input=null,this)}rangeFactorEnd(t,e){return l(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this._output=this._input=null,this)}forceAlignDomainRange(t){return arguments.length?(this._forceAlign=t,this):this._forceAlign}}const my=Math.sqrt(50),yy=Math.sqrt(10),by=Math.sqrt(2),vy=[1,2,5,10],xy=(t,e,i)=>{let n=1,s=t;const r=Math.floor((e-1)/2),a=Math.abs(t);return t>=0&&t<=Number.MIN_VALUE?s=0:t<0&&t>=-Number.MIN_VALUE?s=-(e-1):!i&&a<1?n=Ty(a).step:(i||a>1)&&(s=Math.floor(t)-r*n),n>0?(t>0?s=Math.max(s,0):t<0&&(s=Math.min(s,-(e-1)*n)),function(t,e,i){h(e)||(e=t,t=0),h(i)||(i=1);let n=-1;const s=0|Math.max(0,Math.ceil((e-t)/i)),r=new Array(s);for(;++n<s;)r[n]=t+n*i;return r}(0,e).map((t=>s+t*n))):t>0?Ay(0,-(e-1)/n,n):Ay((e-1)/n,0,n)},_y=Y(((t,e,i,n)=>{let s,r,a,o,l=-1;if(i=+i,(t=+t)==(e=+e))return[t];if(Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return[t];if((s=e<t)&&(r=t,t=e,e=r),o=wy(t,e,i).step,!isFinite(o))return[];if(o>0){let i=Math.round(t/o),n=Math.round(e/o);for(i*o<t&&++i,n*o>e&&--n,a=new Array(r=n-i+1);++l<r;)a[l]=(i+l)*o}else if(o<0&&(null==n?void 0:n.noDecimals)){o=1;const i=Math.ceil(t),n=Math.floor(e);if(!(i<=n))return[];for(a=new Array(r=n-i+1);++l<r;)a[l]=i+l}else{o=-o;let i=Math.round(t*o),n=Math.round(e*o);for(i/o<t&&++i,n/o>e&&--n,a=new Array(r=n-i+1);++l<r;)a[l]=(i+l)/o}return s&&a.reverse(),a})),Ay=(t,e,i)=>{let n,s,r=-1;if(i>0){let a=Math.floor(t/i),o=Math.ceil(e/i);for((a+1)*i<t&&++a,(o-1)*i>e&&--o,s=new Array(n=o-a+1);++r<n;)s[r]=(a+r)*i}else{i=-i;let a=Math.floor(t*i),o=Math.ceil(e*i);for((a+1)/i<t&&++a,(o-1)/i>e&&--o,s=new Array(n=o-a+1);++r<n;)s[r]=(a+r)/i}return s},Sy=Y(((t,e,i,n)=>{let s,r,a;if(i=+i,(t=+t)==(e=+e))return xy(t,i,null==n?void 0:n.noDecimals);if(Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return xy(t,i,null==n?void 0:n.noDecimals);(s=e<t)&&(a=t,t=e,e=a);const o=wy(t,e,i);let l=o.step;if(!isFinite(l))return[];if(l>0){let n=1;const{power:s,gap:a}=o,h=10===a?2*10**s:1*10**s;for(;n<=5&&(r=Ay(t,e,l),r.length>i+1)&&i>2;)l+=h,n+=1;i>2&&r.length<i-1&&(r=((t,e,i)=>{let n;const s=t[0],r=t[t.length-1],a=e-t.length;if(r<=0){const e=[];for(n=a;n>=1;n--)e.push(s-n*i);return e.concat(t)}if(s>=0){for(n=1;n<=a;n++)t.push(r+n*i);return t}let o=[];const l=[];for(n=1;n<=a;n++)n%2==0?o=[s-Math.floor(n/2)*i].concat(o):l.push(r+Math.ceil(n/2)*i);return o.concat(t).concat(l)})(r,i,l))}else(null==n?void 0:n.noDecimals)&&l<0&&(l=1),r=Ay(t,e,l);return s&&r.reverse(),r})),Ty=t=>{const e=Math.floor(Math.log(t)/Math.LN10),i=t/10**e;let n=vy[0];return i>=my?n=vy[3]:i>=yy?n=vy[2]:i>=by&&(n=vy[1]),e>=0?{step:n*10**e,gap:n,power:e}:{step:-(10**-e)/n,gap:n,power:e}};function wy(t,e,i){const n=(e-t)/Math.max(0,i);return Ty(n)}function My(t,e,i){let n;if(i=+i,(t=+t)==(e=+e)&&i>0)return[t];if(i<=0||0===(n=function(t,e,i){return(e-t)/Math.max(1,i-1)}(t,e,i))||!isFinite(n))return[];const s=new Array(i);for(let e=0;e<i;e++)s[e]=t+e*n;return s}function By(t){let e,i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,s=0,r=t.length-1,a=t[s],o=t[r],l=10;for(o<a&&(i=a,a=o,o=i,i=s,s=r,r=i);l-- >0;){if(i=wy(a,o,n).step,i===e)return t[s]=a,t[r]=o,t;if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else{if(!(i<0))break;a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i}e=i}}class Cy extends fy{constructor(){super(...arguments),this.type=ry.Linear}clone(){var t;const e=new Cy;return e.domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate),this._niceType&&(e._niceType=this._niceType,e._domainValidator=this._domainValidator,e._niceDomain=null===(t=this._niceDomain)||void 0===t?void 0:t.slice()),e}tickFormat(){return()=>{}}d3Ticks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=arguments.length>1?arguments[1]:void 0;const i=this.calculateVisibleDomain(this._range);return _y(i[0],i[i.length-1],t,e)}ticks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=arguments.length>1?arguments[1]:void 0;var i;if(o(null==e?void 0:e.customTicks))return e.customTicks(this,t);if(h(this._rangeFactorStart)&&h(this._rangeFactorEnd)&&(this._rangeFactorStart>0||this._rangeFactorEnd<1)&&2===this._range.length||!this._niceType)return this.d3Ticks(t,e);const n=null!==(i=this._niceDomain)&&void 0!==i?i:this._domain,s=this._domain,r=n[0],a=n[n.length-1];let l=Sy(s[0],s[s.length-1],t,e);if(!l.length)return l;if(this._domainValidator)l=l.filter(this._domainValidator);else if((l[0]!==r||l[l.length-1]!==a)&&this._niceType){const t=n.slice();if("all"===this._niceType?(t[0]=l[0],t[t.length-1]=l[l.length-1],this._niceDomain=t,this.rescale()):"min"===this._niceType&&l[0]!==r?(t[0]=l[0],this._niceDomain=t,this.rescale()):"max"===this._niceType&&l[l.length-1]!==a&&(t[t.length-1]=l[l.length-1],this._niceDomain=t,this.rescale()),"all"!==this._niceType){const e=Math.min(t[0],t[t.length-1]),i=Math.max(t[0],t[t.length-1]);l=l.filter((t=>t>=e&&t<=i))}}return l}forceTicks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const e=this.calculateVisibleDomain(this._range);return My(e[0],e[e.length-1],t)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return function(t,e,i){let n,s,r=-1;if(i=+i,(s=(e=+e)<(t=+t))&&(n=t,t=e,e=n),!isFinite(i)||e-t<=i)return[t];const a=Math.floor((e-t)/i+1),o=new Array(a);for(;++r<a;)o[r]=t+r*i;return s&&o.reverse(),o}(e[0],e[e.length-1],t)}nice(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=arguments.length>1?arguments[1]:void 0;var i,n;const s=this._domain;let r=[];if(e){const t=function(t,e){const i=y(e.forceMin),n=y(e.forceMax);let s=null;const r=[];let a=null;const o=i&&n?t=>t>=e.forceMin&&t<=e.forceMax:i?t=>t>=e.forceMin:n?t=>t<=e.forceMax:null;return i?r[0]=e.forceMin:y(e.min)&&e.min<=Math.min(t[0],t[t.length-1])&&(r[0]=e.min),n?r[1]=e.forceMax:y(e.max)&&e.max>=Math.max(t[0],t[t.length-1])&&(r[1]=e.max),y(r[0])&&y(r[1])?(a=t.slice(),a[0]=r[0],a[a.length-1]=r[1]):s=y(r[0])||y(r[1])?y(r[0])?"max":"min":"all",{niceType:s,niceDomain:a,niceMinMax:r,domainValidator:o}}(s,e);if(r=t.niceMinMax,this._domainValidator=t.domainValidator,this._niceType=t.niceType,t.niceDomain)return this._niceDomain=t.niceDomain,this.rescale(),this}else this._niceType="all";if(this._niceType){const e=By(s.slice(),t);"min"===this._niceType?e[e.length-1]=null!==(i=r[1])&&void 0!==i?i:e[e.length-1]:"max"===this._niceType&&(e[0]=null!==(n=r[0])&&void 0!==n?n:e[0]),this._niceDomain=e,this.rescale()}return this}niceMin(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;this._niceType="min";const e=this._domain[this._domain.length-1],i=By(this.domain(),t);return i&&(i[i.length-1]=e,this._niceDomain=i,this.rescale()),this}niceMax(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;this._niceType="max";const e=this._domain[0],i=By(this._domain.slice(),t);return i&&(i[0]=e,this._niceDomain=i,this.rescale()),this}}class ky extends Cy{constructor(){super(oy,ly),this.type=ry.Sqrt}clone(){return(new ky).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}}var Py;function Oy(t,e){t.aspectRatio>1?(t.width=e,t.height=~~(e/t.aspectRatio)):(t.height=e,t.width=~~(e*t.aspectRatio))}!function(t){t.BEFORE_IMAGECLOUD_LAYOUT="beforeImagecloudLayout",t.AFTER_IMAGECLOUD_LAYOUT="afterImagecloudLayout",t.AFTER_IMAGECLOUD_DRAW="afterImagecloudDraw"}(Py||(Py={}));class Ry{constructor(t){this.progressiveResult=[],this.imageCollageList=[],this.options=t}preProcess(){const{imageConfig:t={},weight:e}=this.options,{padding:i=0}=t;let n=this.imageCollageList;return n.forEach(((t,n)=>{!1===t.valid?(t.x=-10,t.y=-10,t.width=0,t.height=0,t.opacity=0):(t.padding=i,t.weight=tt(e)(this.data[n]),t.datum=this.data[n])})),n=n.filter((t=>!1!==t.valid)).sort(((t,e)=>e.weight-t.weight)),n}onImageCollageInputReady(t){t.forEach(((t,e)=>{if("fulfilled"===t.status){const i=t.value,{width:n,height:s}=i;this.imageCollageList.push(Object.assign({},this.data[e],{aspectRatio:n/s}))}else this.imageCollageList.push(Object.assign({},this.data[e],{valid:!1}))}))}layout(t){this.data=t,this.loadSegmentationInput(),this.loadImageCollageInput()}loadSegmentationInput(){var t,e,i,n,s,r;const a=this.options,o=a.size,l={shapeUrl:null!==(t=a.mask)&&void 0!==t?t:{type:"geometric",shape:"rect"},size:o,ratio:a.ratio||.8,tempCanvas:void 0,boardSize:[0,0],random:!1,randomGenerator:void 0,blur:null===(e=a.maskConfig)||void 0===e?void 0:e.edgeBlur},h=this.options.createCanvas({width:o[0],height:o[1]}),c=h.getContext("2d",{willReadFrequently:!0});c.textAlign="center",c.textBaseline="middle",l.tempCanvas=h;const u=o[0]+31>>5<<5;if(l.boardSize=[u,o[1]],l.random?l.randomGenerator=Math.random:l.randomGenerator=(()=>{let t=-1;const e=[0,.1,.2,.3,.4,.5,.6,.7,.8,.9];return()=>(t=(t+1)%e.length,e[t])})(),this.segmentationInput=l,p(l.shapeUrl)){l.isEmptyPixel=Km(void 0,{threshold:null!==(n=null===(i=a.maskConfig)||void 0===i?void 0:i.threshold)&&void 0!==n?n:200,invert:null===(s=a.maskConfig)||void 0===s?void 0:s.invert},this.options.createCanvas);const t=sy(l.shapeUrl,this.options.createImage);t?(this.isMaskImageFinished=!1,this.isLayoutFinished=!1,t.then((t=>{var e,i;this.isMaskImageFinished=!0;const n=a.size,s=this.options.createCanvas({width:n[0],height:n[1],dpr:1});l.maskCanvas=s;const r=s.getContext("2d");(null===(e=a.maskConfig)||void 0===e?void 0:e.removeWhiteBorder)&&ny(t,s,l.isEmptyPixel);const o=function(t,e){const i=t.width,n=t.height;let s=e[0]/i;n*s>e[1]&&(s=e[1]/n);const r=Math.floor(s*i),a=Math.floor(s*n);return{x:(e[0]-r)/2,y:(e[1]-a)/2,width:r,height:a,scale:s}}(t,n);let h;r.clearRect(0,0,n[0],n[1]),r.drawImage(t,o.x,o.y,o.width,o.height),this.segmentationOutput=iy(this.segmentationInput),"masked"===(null===(i=this.options.layoutConfig)||void 0===i?void 0:i.placement)&&(h=this.generateTransparentMaskCanvas(t,n)),this.segmentationOutput.transparentMaskCanvas=h,this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(s,h)})).catch((t=>{this.isMaskImageFinished=!0}))):(this.isMaskImageFinished=!0,this.isLayoutFinished=!0)}else if(l.shapeUrl&&("text"===l.shapeUrl.type||"geometric"===l.shapeUrl.type)){l.isEmptyPixel=Km(l.shapeUrl.backgroundColor,void 0,this.options.createCanvas),"text"!==l.shapeUrl.type&&"geometric"!==l.shapeUrl.type||l.shapeUrl.backgroundColor||(l.shapeUrl.backgroundColor="rgba(255,255,255,255)");const t=function(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=arguments.length>5?arguments[5]:void 0,{backgroundColor:a="#fff"}=t,{fill:o="#000"}=t;s&&([a,o]=[o,a]);const l=n||r({width:e,height:i,dpr:1}),h=l.getContext("2d",{willReadFrequently:!0});if(n){const t=n.width,s=n.height;h.clearRect(0,0,t,s),n.style.width=`${e}px`,n.style.height=`${i}px`,n.width=e,n.height=i}return h.fillStyle=a,h.fillRect(0,0,l.width,l.height),"text"===t.type?Zm(t,o,l.width,l.height,h):"geometric"===t.type&&ey(t,o,l.width,l.height,h),l}(l.shapeUrl,o[0],o[1],void 0,null===(r=a.maskConfig)||void 0===r?void 0:r.invert,this.options.createCanvas);l.maskCanvas=t,this.segmentationOutput=iy(this.segmentationInput),this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(t,t),this.isMaskImageFinished=!0}}loadImageCollageInput(){const t=function(t,e){return Promise.allSettled(t.map((t=>sy(t,e))))}(this.data.map((t=>tt(this.options.image)(t))),this.options.createImage);t?t.then((t=>{this.onImageCollageInputReady(t),this.isImagesFinished=!0})).catch((t=>{this.isImagesFinished=!0,this.isLayoutFinished=!0,$.getInstance().error("image load failed",t)})):(this.isImagesFinished=!0,this.isLayoutFinished=!0)}canAnimate(){return!0}unfinished(){return!this.isLayoutFinished}output(){return this.progressiveResult}progressiveRun(){if(this.isImagesFinished&&this.isMaskImageFinished&&!this.isLayoutFinished){const t=this.preProcess(),e=this.doLayout(t);this.options&&this.options.onLayoutEnd&&this.options.onLayoutEnd(e),this.progressiveResult=this.processOutput(e),this.isLayoutFinished=!0}}progressiveOutput(){return this.progressiveResult}release(){this.segmentationInput=null,this.data=null,this.progressiveResult=null,this.options=null}calculateImageSize(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.45;const{imageSizeRange:n,padding:s=0}=e,r=y(e.imageSize)?e.imageSize:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(g(t)){const i=t.map((t=>Q(t,e)));return t=>i.map((e=>e(t)))}return Q(t,e)}(e.imageSize),a=this.options.size;if(r||n)if(r&&!o(r))t.forEach((t=>Oy(t,r)));else if(n){const e=(new ky).domain(et(t,(t=>t.weight))).range(n);t.forEach((t=>Oy(t,~~e.scale(t.weight))))}else if(r&&o(r)&&!n){const e=.5,[n,r]=et(t,(t=>t.weight)),o=t.reduce(((t,i)=>{const s=i.aspectRatio,a=(i.weight-n)/(r-n);return t+(s>1?1/s:s)*(e+(1-e)*a)**2}),0),l=~~Math.sqrt(i*a[0]*a[1]/o),h=[~~(e*l)-2*s<0?1:~~(e*l)-2*s,~~l-2*s<0?1:~~l-2*s],c=(new ky).domain(et(t,(t=>t.weight))).range(h);t.forEach((t=>Oy(t,~~c.scale(t.weight))))}else console.warn("image cloud imageSize error");else{const e=t.reduce(((t,e)=>{const i=e.aspectRatio;return t+(i>1?1/i:i)}),0);let n=~~Math.sqrt(i*a[0]*a[1]/e);n=n-2*s<0?1:n-2*s,t.forEach((t=>Oy(t,n)))}return t}generateTransparentMaskCanvas(t,e){var i;const n=this.options.createCanvas({width:e[0],height:e[1],dpr:1}),s=n.getContext("2d");this.segmentationOutput.transparentMaskCanvas=n,(null===(i=this.options.maskConfig)||void 0===i?void 0:i.removeWhiteBorder)&&ny(t,n,this.segmentationInput.isEmptyPixel);const r=s.createImageData(e[0],e[1]),a=this.segmentationOutput.segmentation.labels;for(let t=0;t<a.length;t++){const e=0===a[t]?255:0,i=255*a[t],n=4*t;r.data[n]=e,r.data[n+1]=e,r.data[n+2]=e,r.data[n+3]=i}return s.clearRect(0,0,e[0],e[1]),s.fillStyle="rgba(255,255,255,0)",s.fillRect(0,0,e[0],e[1]),s.putImageData(r,0,0),n}processOutput(t){var e;const i=null===(e=this.options)||void 0===e?void 0:e.as;return i&&Object.keys(i).forEach((e=>{t.forEach((t=>{t[i[e]]=t[e],delete t[e]}))})),t}}class Ly extends Ry{preProcess(){const t=super.preProcess(),{imageConfig:e={},ratio:i=.45}=this.options;return this.calculateImageSize(t,e,i)}tryPlaceImage(t,e,i,n,s){let r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;const[a,o]=e,l=a/2,h=o/2,c=Math.sqrt(l**2+h**2),u=qm[i](e);let d,p,g=-r;const{segmentation:f}=n,{labels:m}=f;for(;([d,p]=u(g+=r))&&!(Math.min(Math.abs(d),Math.abs(p))>=c);)if(d-=t.width/2,p-=t.height/2,t.visible=!0,t.x=~~(l+d),t.y=~~(h+p),t._left=t.x+t.padding,t._top=t.y+t.padding,t._leftWithoutPadding=t.x,t._topWithoutPadding=t.y,Iy(t,s)){const{x:e,y:i,width:n,height:s}=t;let r=!1;for(let t=0;t<n;t++){for(let n=0;n<s&&i+t<=o;n++)if(!(e+n>a||m[(i+t)*a+(e+n)])){r=!0;break}if(r)break}if(!r){const e=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x,y:t.y+t.height},{x:t.x+t.width,y:t.y+t.height}];let i=!0;for(const t of e)if(!m[t.y*a+t.x]){i=!1;break}if(!i)continue;return!0}}return!1}doLayout(t){var e;const{segmentationOutput:i}=this,{layoutConfig:n={}}=this.options,s=this.options.size,{spiralType:r="archimedean",fillingTimes:a=4,minFillingImageSize:o=10}=n,l=[],h=Object.keys(t[0]).find((t=>t.includes("VGRAMMAR")));for(const e of t)e._widthWithPadding=e.width+2*e.padding,e._heightWithPadding=e.height+2*e.padding,e.frequency=1,this.tryPlaceImage(e,s,r,i,l)&&l.push(e);const c=U(l,((t,e)=>t.width-e.width)).width,u=U(l,((t,e)=>t.height-e.height)).height,d=[];for(let n=0;n<a;n++){const a=.5*c-1*n,p=.5*u-1*n;for(const n of t){const t=Object.assign({},n,{visible:!0});Oy(t,Math.max(o,t.aspectRatio>1?a:p)),t._widthWithPadding=t.width+2*t.padding,t._heightWithPadding=t.height+2*t.padding,this.tryPlaceImage(t,s,r,i,[...d,...l],.5)&&(n._tempFrequency=(null!==(e=n._tempFrequency)&&void 0!==e?e:n.frequency)+1,t.frequency=n._tempFrequency,t.distance=Math.sqrt(Math.pow(t.x-s[0]/2,2)+Math.pow(t.y-s[1]/2,2)),t[h]=`${t[h]}_${t.frequency}`,d.push(t))}}return[...l,...d].filter((t=>t.visible))}}function Iy(t,e){for(let s=0;s<e.length;s++)if(i=t,n=e[s],!(i._leftWithoutPadding+i._widthWithPadding<n._leftWithoutPadding||i._topWithoutPadding+i._heightWithPadding<n._topWithoutPadding||i._leftWithoutPadding>n._leftWithoutPadding+n._widthWithPadding||i._topWithoutPadding>n._topWithoutPadding+n._heightWithPadding))return!1;var i,n;return!0}function Ey(t){const{imageConfig:e={},size:i,ratio:n=.1,layoutConfig:s={}}=t,{padding:r=0,imageSize:a}=e,[o,l]=i;let h;h=a||Math.min(o,l)*n-2*r,h<0&&(h=1);const{rectAspectRatio:c=1}=s;let u,d;c>1?(u=h,d=h/c):(d=h,u=h*c);const p=Math.ceil(l/(d+r)),g=Math.ceil(o/(u+r)),f=o/2,m=l/2,y=new Array(g*p);for(let t=0;t<p;t++)for(let e=0;e<g;e++){const i=e*(u+r)+u/2,n=t*(d+r)+d/2;y[t*g+e]={centerX:i,centerY:n,x:i-u/2,y:n-d/2,row:t,col:e,distance:Math.sqrt(Math.pow(i-f,2)+Math.pow(n-m,2))}}return{context:Object.assign({},s,{cellWidth:u,cellHeight:d,cellInfo:y,cellCount:y.length,cellType:"rect",cellPixelCount:u*d,eachPixel:(t,e)=>{const{x:i,y:n}=t;for(let t=0;t<u;t++)for(let s=0;s<d&&n+t<=l;s++)i+s>o||e((~~n+t)*o+(~~i+s))},clipPath:`M${-u/2} ${-d/2} L${u/2} ${-d/2} L${u/2} ${d/2} L${-u/2} ${d/2} Z`}),imageLength:h}}const Dy={rect:Ey,circle:function(t){const{imageConfig:e={},size:i,ratio:n=.1,layoutConfig:s={}}=t,{padding:r=0,imageSize:a=0}=e,[o,l]=i,h=o/2,c=l/2;let u=0;u=a?a/2:Math.min(o,l)*n/2,u-r<=0&&(u=r+1);const d=2*u,p=Math.sqrt(3)/2*d+r,g=[];let f=0;for(let t=0;t*p-u<l;t++){const e=t*p,i=t%2==0?0:u;for(let n=-1;n*(d+r)+i-u<o;n++){const s=n*(d+r)+i+u;g[f++]={centerX:s,centerY:e,x:s-u,y:e-u,row:t,col:n,distance:Math.sqrt(Math.pow(s-h,2)+Math.pow(e-c,2))}}}let m=0;const y=u*u;for(let t=0;t<d;t++)for(let e=0;e<d;e++){const i=t-u,n=e-u;i*i+n*n<=y&&m++}return{context:Object.assign({},s,{cellWidth:d,cellHeight:d,cellInfo:g,cellCount:g.length,cellType:"circle",cellPixelCount:m,eachPixel:(t,e)=>{const{x:i,y:n}=t;for(let t=0;t<d;t++)for(let s=0;s<d;s++){if(t+i<0||t+i>o||s+n>l||s+n<0)continue;const r=t-u,a=s-u;r*r+a*a<=y&&e((~~n+t)*o+(~~i+s))}},clipPath:"M 1 0 A 1 1 0 1 0 -1 0 A 1 1 0 1 0 1 0 Z"}),imageLength:d}},hexagonal:function(t){const{imageConfig:e={},size:i,ratio:n=.1,layoutConfig:s={}}=t,{padding:r=0,imageSize:a}=e,[o,l]=i,h=o/2,c=l/2;let u;u=a?a/2:Math.min(o,l)*n/2,u-r<=0&&(u=r+1);const d=[],p=2*Math.PI/6;for(let t=0;t<6;t++){const e=p*t;d.push({x:(u-r/2)*Math.cos(e),y:(u-r/2)*Math.sin(e)})}const g=2*u,f=Math.sin(Math.PI/6)*g,m=Math.sqrt(3)*f,y=g-f/2,b=Math.cos(Math.PI/6)*g,v=b/2,x=Math.floor(l/m),_=Math.floor(o/f),A=[];for(let t=-1;t<=x+1;t++)for(let e=-1;e<=_;e++){const i=e*y,n=t*b+(e%2?v:0);A.push({centerX:i,centerY:n,x:i-f,y:n-f,row:t,col:e,distance:Math.sqrt(Math.pow(i-h,2)+Math.pow(n-c,2))})}let S=0;const T=[];for(let t=0;t<=m;t++)for(let e=0;e<=2*f;e++){const i=e-f,n=t-m/2,s=Math.abs(i),r=Math.abs(n);s<=f&&r<=m/2&&2*r+s*Math.sqrt(3)<=m?(S++,T.push(!0)):T.push(!1)}return{context:Object.assign({},s,{cellHexSideLength:f,cellHexPoints:d,cellHeight:m,cellWidth:2*f,cellInfo:A,cellCount:A.length,cellType:"hexagonal",cellPixelCount:S,eachPixel:(t,e)=>{const{x:i,y:n}=t;let s=0;for(let t=0;t<=m;t++)for(let r=0;r<=2*f;r++)T[s++]&&e((~~n+t)*o+(~~i+r))},clipPath:"M 1 0 L 0.5 0.866 L -0.5 0.866 L -1 0 L -0.5 -0.866 L 0.5 -0.866 Z"}),imageLength:g-r}}};class Fy extends Ry{preProcess(){var t;const e=super.preProcess(),{layoutConfig:i={}}=this.options,{cellType:n="rect"}=i,s=(null!==(t=Dy[n])&&void 0!==t?t:Dy.rect)(this.options),{context:r,imageLength:a}=s;return e.forEach((t=>function(t,e){t.aspectRatio>1?(t.height=e,t.width=~~(e*t.aspectRatio)):(t.width=e,t.height=~~(e/t.aspectRatio))}(t,a))),r.cellInfo.sort(((t,e)=>t.distance-e.distance)),this.layoutContext=r,e}doLayout(t){const{cellWidth:e,cellHeight:i,cellInfo:n,cellCount:s,clipPath:r,eachPixel:a,cellPixelCount:o}=this.layoutContext;if(0===t.length||0===s||0===e||0===i||0===n.length)return void(this.isLayoutFinished=!0);const{segmentationOutput:l}=this,{layoutConfig:h={}}=this.options,{placement:c="default"}=h;if("edge"===c||"default"===c){const{segmentation:t}=l,{labels:e}=t;n.forEach((t=>{let i=0;a(t,(t=>{e[t]&&i++})),t.intersectPixels=i}))}const u=t.length,d=t=>{const{intersectPixels:e}=t;return"default"===c?e>=.45*o:"edge"!==c||e>.1*o&&e<o};for(let e=0;e<u;e++){const i=t[e],s=n[e];s&&(i.x=s.centerX-i.width/2,i.y=s.centerY-i.height/2,i.clipConfig={shape:r},i.frequency=1,i.visible=d(s),i.cell=R(s,["image"]),i.distance=s.distance,s.image=i)}const p=Object.keys(t[0]).find((t=>t.includes("VGRAMMAR")));if(u<s)for(let e=u;e<s;e++){const i=t[e-u],s=n[e];if(s){const e=Object.assign({},i);e.x=s.centerX-e.width/2,e.y=s.centerY-e.height/2,e.frequency+=1,e[p]=`${e[p]}_${e.frequency}`,e.visible=d(s),e.distance=s.distance,e.cell=R(s,["image"]),s.image=e,t.push(e)}}return t.filter((t=>t.visible))}}class jy extends Ry{preProcess(){const t=super.preProcess(),{imageConfig:e={},ratio:i=.1}=this.options,n=Ey;return this.layoutContext=n(Object.assign({},this.options,{imageConfig:{imageSize:null}})).context,this.layoutContext.cellInfo.sort(((t,e)=>t.distance-e.distance)),this.calculateImageSize(t,e,i)}doLayout(t){const{segmentationOutput:e}=this,{cellWidth:i,cellHeight:n,cellInfo:s,cellCount:r,eachPixel:a,cellPixelCount:o}=this.layoutContext;if(0===t.length||0===r||0===i||0===n||0===s.length)return void(this.isLayoutFinished=!0);const{layoutConfig:l={}}=this.options,h=this.options.size,{placement:c="default",maxAngle:u=Math.PI/180*45}=l;if("edge"===c||"default"===c){const{segmentation:t}=e,{labels:i}=t;s.forEach((t=>{let e=0;a(t,(t=>{i[t]&&e++})),t.intersectPixels=e}))}const d=t.length,p=Math.sqrt(Math.pow(h[0],2)+Math.pow(h[1],2)),g=t=>{const{intersectPixels:e}=t;return"default"===c?e>.5*o:"edge"!==c||e>.1*o&&e<o};for(let e=0;e<d;e++){const i=t[e],n=s[e];n&&(i.x=n.centerX-i.width/2,i.y=n.centerY-i.height/2,i.visible=g(n),i.cell=`${n.row}_${n.col}`,i.angle=Math.random()*(2*u)-u,i.anchor=[i.x+i.width/2,i.y+i.height/2],i.zIndex=p-n.distance,i.distance=n.distance,i.frequency=1,n.image=i)}const f=Object.keys(t[0]).find((t=>t.includes("VGRAMMAR")));if(d<r)for(let e=d;e<r;e++){const i=t[e-d],n=s[e];if(n){const e=Object.assign({},i);e.x=n.centerX-e.width/2,e.y=n.centerY-e.height/2,e.anchor=[e.x+e.width/2,e.y+e.height/2],e.angle=Math.random()*(2*u)-u,e.frequency+=1,e[f]=`${e[f]}_${e.frequency}`,e.visible=g(n),e.cell=`${n.row}_${n.col}`,e.distance=n.distance,e.zIndex=p-n.distance,n.image=e,t.push(e)}}return t.filter((t=>t.visible))}}const Uy=(t,e,i)=>{var n,s;const r=o(t.size)?t.size():t.size;if(t.size=r,!r||l(r[0])||l(r[1])||r[0]<=0||r[1]<=0)return $.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];if(t.size=[Math.ceil(r[0]),Math.ceil(r[1])],t.image||$.getInstance().error("Imagecloud: image source must be specified."),t.onBeforeLayout&&t.onBeforeLayout(),!e||0===e.length)return[];let a;switch(null!==(s=null===(n=t.layoutConfig)||void 0===n?void 0:n.layoutMode)&&void 0!==s?s:"spiral"){case"grid":a=Fy;break;case"stack":a=jy;break;default:a=Ly}const h=new a(t);return h.layout(e),h.unfinished()?{progressive:h}:h.output()};class Ny extends Yf{constructor(t,e,i,n,s){var r;super(t,e,i,n,s),this._rotations=null!==(r=null==s?void 0:s.rotation)&&void 0!==r?r:1}onBind(){this._scaleX=this.target.attribute.scaleX,b(this._rotations)||(this.valid=!1)}onUpdate(t,e,i){var n;if(!1===this.valid)return;if(t)return void(i.scaleX=this._scaleX);const s=360*this._rotations*e*Math.PI/180,r=Math.abs(Math.cos(s))*(null!==(n=this._scaleX)&&void 0!==n?n:1);this.target.attribute.scaleX=r,this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag()}}function Wy(t,i){switch(i){case"axialRotate":return[{custom:Ny,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 zy 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:n}=this._seriesCacheInfo,s=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(n[0]&&s)return null!==(i=s[n[0]])&&void 0!==i?i:t.value},this.dimensionTooltipTitleCallback=t=>{var e;const{dimensionFields:i}=this._seriesCacheInfo,n=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(i[0]&&n)return n[i[0]]}}get defaultShapeType(){return"square"}}class Gy extends e.BaseSeries{constructor(){super(...arguments),this.type=Vm}setValueField(t){h(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(Xm.imageMask,{dataView:!1,skipBeforeLayouted:!0})),this._imageMark=this._createMark(Xm.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 zy(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:gh,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)}}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.isFillingImage=this.isFillingImage.bind(this)}initAnimation(){[this._imageMark].forEach((t=>{var i,n;if(t){const s=null===(n=null===(i=this._spec)||void 0===i?void 0:i.animationAppear)||void 0===n?void 0:n.preset,r={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")(r,s),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""}}Gy.type=Vm,Gy.mark=Xm;const Vy=()=>{e.registerImageMark(),e.Factory.registerAnimation("imageCloud",((t,e)=>({appear:Wy(t,e),enter:Wy(t,e),exit:{type:"fadeOut"},disappear:{type:"fadeOut"}}))),e.Factory.registerSeries(Gy.type,Gy),e.Factory.registerGrammarTransform("imagecloud",{transform:Uy})};class Hy extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=Hy.transformerConstructor,this.type=Gm,this.seriesType=Vm}}Hy.type=Gm,Hy.seriesType=Vm,Hy.transformerConstructor=zm;const Xy=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class $y extends _l{constructor(t,e){super(t),this._skipRenderAttributes=Xy,(null==e?void 0:e.mode)&&(this.mode=e.mode,this.setMode(e.mode)),(null==e?void 0:e.skipDefault)&&(this.skipDefault=!0),this.setTheme({common:{strokeBoundsBuffer:0}}),this.attribute=t,this.onSetStage((()=>{this.render(),this.bindEvents()}))}setAttribute(t,e,i,n){const s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);if(s)return this._setAttributes(s,i);d(this.attribute[t])&&d(e)&&!o(this.attribute[t])&&!o(e)?O(this.attribute[t],e):this.attribute[t]=e,this._skipRenderAttributes.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e,i){return t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t,this._setAttributes(t,e)}_setAttributes(t,e){const i=Object.keys(t);this._mergeAttributes(t,i),i.every((t=>this._skipRenderAttributes.includes(t)))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}_mergeAttributes(t,e){l(e)&&(e=Object.keys(t));for(let i=0;i<e.length;i++){const n=e[i];!d(this.attribute[n])||o(this.attribute[n])||o(t[n])?this.attribute[n]=t[n]:O(this.attribute[n],t[n])}}bindEvents(){}_getNodeId(t){var e;return`${null!==(e=this.id)&&void 0!==e?e:this._uid}-${this.name}-${t}`}_dispatchEvent(t,e){var i;const n=new Gr(t,e);n.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(n)}}var Yy;!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(Yy||(Yy={}));const qy={[Yy.selectedReverse]:{},[Yy.selected]:{},[Yy.hover]:{},[Yy.hoverReverse]:{}};function Ky(t,e){t.forEachChildren((t=>{const i=e(t);t.isContainer&&!i&&Ky(t,e)}))}function Zy(t){return t>=0&&t<Math.PI/2||t>3*Math.PI/2&&t<=2*Math.PI}function Jy(t,e,i){return Math.abs(t-e)<i}function Qy(t){return"rich"===function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"type";var i,n;return c(t.text)&&"type"in t.text?null!==(i=t.text.type)&&void 0!==i?i:"text":e in t&&null!==(n=t[e])&&void 0!==n?n:"text"}(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"type")}const tb=(t,e)=>{const i=Math.atan2(t,e);return i<0?i+2*Math.PI:i};function eb(){Rg(),zg(),Kg(),Xg(),Jg()}var ib=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i};eb();class nb extends $y{getBgRect(){return this._bgRect}getTextShape(){return this._textShape}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:O({},nb.defaultAttributes,t)),this.name="tag",this._tagStates=[],this._rectStates=[],this._symbolStates=[],this._textStates=[]}render(){var t,e,i;this.cacheStates();const{text:n="",textStyle:s={},shape:r={},panel:o={},space:u=4,minWidth:d,maxWidth:p,padding:f=4,visible:m,state:v,type:x,textAlwaysCenter:_,containerTextAlign:A}=this.attribute,S=function(t){if(b(t))return[t,t,t,t];if(g(t)){const e=t.length;if(1===e){const e=t[0];return[e,e,e,e]}if(2===e){const[e,i]=t;return[e,i,e,i]}if(3===e){const[e,i,n]=t;return[e,i,n,i]}if(4===e)return t}if(c(t)){const{top:e=0,right:i=0,bottom:n=0,left:s=0}=t;return[e,i,n,s]}return[0,0,0,0]}(f),T=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group");let M,B=-S[3],C=-S[0],k=S[1]+S[3],P=S[0]+S[2],O=0,R=0;const{visible:L}=r,I=ib(r,["visible"]);if(a(L)){const t=(null==I?void 0:I.size)||10,e=y(t)?t:Math.max(t[0],t[1]);M=T.createOrUpdateChild("tag-shape",Object.assign(Object.assign({symbolType:"circle",size:t,strokeBoundsBuffer:0},I),{visible:L,x:e/2,y:e/2}),"symbol"),w(null==v?void 0:v.shape)||(M.states=v.shape),L&&(R=e+u)}let E,D,F;if(k+=R,O+=R,Qy({text:n})||"rich"===x){const t=Object.assign(Object.assign(Object.assign({},function(t){var e,i;return h(t.maxLineWidth)&&(t.maxWidth=t.maxLineWidth,delete t.maxLineWidth),t.width=null!==(e=t.width)&&void 0!==e?e:0,t.height=null!==(i=t.height)&&void 0!==i?i:0,t.textConfig=t.text.text||t.text,t}(Object.assign({type:x,text:n},s))),s),{visible:h(n)&&!1!==m,x:O,y:0});l(t.lineHeight)&&(t.lineHeight=s.fontSize),E=T.createOrUpdateChild("tag-text",t,"richtext"),D=E.AABBBounds.width(),F=E.AABBBounds.height()}else{const i=Object.assign(Object.assign({text:c(n)&&"type"in n&&"text"===n.type?n.text:n,visible:h(n)&&!1!==m,lineHeight:null==s?void 0:s.fontSize},s),{x:O,y:0});l(i.lineHeight)&&(i.lineHeight=s.fontSize),E=T.createOrUpdateChild("tag-text",i,"text");const r=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return{width:0,height:0};const n=Wh({text:t,fontFamily:e.fontFamily||i.fontFamily||"PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol",fontSize:e.fontSize||i.fontSize||12,fontWeight:e.fontWeight||i.fontWeight,textAlign:e.textAlign||"center",textBaseline:e.textBaseline,ellipsis:!!e.ellipsis,maxLineWidth:e.maxLineWidth||1/0,lineHeight:e.fontSize||i.fontSize||12});return{width:n.width(),height:n.height()}}(i.text,s,null===(e=null===(t=this.stage)||void 0===t?void 0:t.getTheme())||void 0===e?void 0:e.text);D=r.width,F=r.height}k+=D;const U=null!==(i=r.size)&&void 0!==i?i:10,N=y(U)?U:Math.max(U[0],U[1]);P+=Math.max(F,r.visible?N:0);const{textAlign:W,textBaseline:z}=s;(h(d)||h(p))&&(h(d)&&k<d&&(k=d),h(p)&&k>p&&(k=p,E.setAttribute("maxLineWidth",p-S[1]-S[2]))),B=0,C=0;let G=0;"left"===W||"start"===W?G=1:"right"===W||"end"===W?G=-1:"center"===W&&(G=0),G?G<0?(B-=k,M&&M.setAttribute("x",(M.attribute.x||0)-D),T.setAttribute("x",-S[1]-R)):G>0&&T.setAttribute("x",S[3]):(B-=k/2,M&&M.setAttribute("x",(M.attribute.x||0)-D/2),T.setAttribute("x",-R/2));const V="right"===A||"end"===A,H="left"===A||"start"===A,X=(t,e)=>{"richtext"===E.type?E.setAttributes({x:t,textAlign:e,textConfig:j(E.attribute.textConfig).map((t=>Object.assign(Object.assign({},t),{textAlign:e})))}):E.setAttributes({x:t,textAlign:e})};if((A?"center"===A:_)&&G){const t=k-S[1]-S[3],e=D+R,i=1===G?(t-e)/2+R+D/2:S[0]+R-(k/2+e/2-R)+D/2;if(X(i,"center"),M){const t=i-D/2-R+N/2;M.setAttributes({x:t})}}if(H&&1!==G){const t=k-S[1]-S[3],e=0===G?-t/2+R/2:-k+S[3]+S[1]+R;if(X(e+R,"left"),M){const t=e+N/2;M.setAttributes({x:t})}}if(V&&-1!==G){const t=k-S[1]-S[3],e=0===G?t/2+R/2:t;if(X(e,"right"),M){const t=e-D-R+N/2;M.setAttributes({x:t})}}"middle"===z?(C-=P/2,M&&M.setAttribute("y",0)):"bottom"===z?(C-=P,M&&M.setAttribute("y",-F/2),T.setAttribute("y",-S[2])):"top"===z&&(T.setAttribute("y",S[0]),M&&M.setAttribute("y",F/2)),w(null==v?void 0:v.text)||(E.states=v.text);const{visible:$}=o,Y=ib(o,["visible"]);if(m&&a($)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},Y),{visible:$&&!!n,width:k,height:P,x:B,y:C}),"rect");if(w(null==v?void 0:v.panel)||(t.states=v.panel),Y.customShape){const e=Y.customShape;t.pathProxy=t=>e(this,t,new ms)}this._bgRect=t}this._textShape=E,this._symbol=M,this.resetStates()}initAttributes(t,e){t=(null==e?void 0:e.skipDefault)?t:O({},nb.defaultAttributes,t),super.initAttributes(t),this.render()}addState(t,e,i){super.addState(t,e,i),this._textShape&&this._textShape.addState(t,e,i),this._bgRect&&this._bgRect.addState(t,e,i),this._symbol&&this._symbol.addState(t,e,i)}removeState(t,e){super.removeState(t,e),this._textShape&&this._textShape.removeState(t,e),this._bgRect&&this._bgRect.removeState(t,e),this._symbol&&this._symbol.removeState(t,e)}cacheStates(){var t,e,i,n,s,r,a,o,l,h,c,u,d,p;this._tagStates=null!==(e=null===(t=this.currentStates)||void 0===t?void 0:t.slice())&&void 0!==e?e:[],this._rectStates=null!==(s=null===(n=null===(i=this._bgRect)||void 0===i?void 0:i.currentStates)||void 0===n?void 0:n.slice())&&void 0!==s?s:[],this._symbolStates=null!==(o=null===(a=null===(r=this._symbol)||void 0===r?void 0:r.currentStates)||void 0===a?void 0:a.slice())&&void 0!==o?o:[],this._textStates=null!==(c=null===(h=null===(l=this._textShape)||void 0===l?void 0:l.currentStates)||void 0===h?void 0:h.slice())&&void 0!==c?c:[],this.clearStates(),null===(u=this._bgRect)||void 0===u||u.clearStates(),null===(d=this._symbol)||void 0===d||d.clearStates(),null===(p=this._textShape)||void 0===p||p.clearStates()}resetStates(){var t,e,i;this._tagStates.length&&this.useStates(this._tagStates),this._rectStates.length&&(null===(t=this._bgRect)||void 0===t||t.useStates(this._rectStates)),this._symbolStates.length&&(null===(e=this._symbol)||void 0===e||e.useStates(this._symbolStates)),this._textStates.length&&(null===(i=this._textShape)||void 0===i||i.useStates(this._textStates))}}function sb(){Rg(),Dg(),jg(),Kg()}function rb(){Rg(),Dg(),Cg(),Kg()}nb.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}},sb();class ab extends $y{getStartAngle(){return Tt(this._startAngle)}getEndAngle(){return Tt(this._endAngle)}getMainSegmentPoints(){return this._mainSegmentPoints}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:O({},ab.defaultAttributes,t)),this.name="segment",this.key="segment",this.lines=[]}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:i,state:n,visible:s=!0,multiSegment:r,mainSegmentIndex:a}=this.attribute;if(!s)return;this._computeLineAngle();const o=this._getMainSegmentPoints(),l=this._renderSymbol(t,o,"start"),h=this._renderSymbol(e,o,"end");if(this.startSymbol=l,this.endSymbol=h,r){const t=[...this.attribute.points];if(b(a))t[a]=this._clipPoints(t[a]);else{const e=this._clipPoints(W(t));t[0][0]=e[0],t[t.length-1][t[t.length-1].length-1]=e[e.length-1]}t.forEach(((t,e)=>{var s,r;const a=Uh.line(Object.assign(Object.assign({points:t},g(i)?null!==(s=i[e])&&void 0!==s?s:i[i.length-1]:i),{fill:!1}));a.name=`${this.name}-line`,a.id=this._getNodeId("line"+e),w(null==n?void 0:n.line)||(a.states=g(n.line)?null!==(r=n.line[e])&&void 0!==r?r:n.line[n.line.length-1]:n.line),this.add(a),this.lines.push(a)}))}else{let t=Uh.line;j(i)[0].cornerRadius&&(t=Uh.polygon);const e=t(Object.assign(Object.assign({points:this._clipPoints(this.attribute.points)},j(i)[0]),{fill:!1,closePath:!1}));e.name=`${this.name}-line`,e.id=this._getNodeId("line"),w(null==n?void 0:n.line)||(e.states=[].concat(n.line)[0]),this.add(e),this.lines.push(e)}}_computeStartRotate(t){return t+Math.PI/2}_computeEndRotate(t){return t+Math.PI/2}_renderSymbol(t,e,i){if(!e.length)return;const{autoRotate:n=!0}=t;let s;if(t&&t.visible){const r=this.getStartAngle(),a=this.getEndAngle(),{state:o}=this.attribute,l=e[0],h=e[e.length-1],{refX:c=0,refY:u=0,refAngle:d=0,style:p,symbolType:g,size:f=12}=t;let m,y;"start"===i?(m={x:l.x+(b(r)?c*Math.cos(r)+u*Math.cos(r-Math.PI/2):0),y:l.y+(b(r)?c*Math.sin(r)+u*Math.sin(r-Math.PI/2):0)},y=this._computeStartRotate(this._startAngle)):(m={x:h.x+(b(a)?c*Math.cos(a)+u*Math.cos(a-Math.PI/2):0),y:h.y+(b(a)?c*Math.sin(a)+u*Math.sin(a-Math.PI/2):0)},y=this._computeEndRotate(this._endAngle)),s=Uh.symbol(Object.assign(Object.assign(Object.assign({},m),{symbolType:g,size:f,angle:n?y+d:0,strokeBoundsBuffer:0}),p)),s.name=`${this.name}-${i}-symbol`,s.id=this._getNodeId(`${i}-symbol`),w(null==o?void 0:o.symbol)||(s.states=o.symbol),"start"===i?w(null==o?void 0:o.startSymbol)||(s.states=o.startSymbol):w(null==o?void 0:o.endSymbol)||(s.states=o.endSymbol),this.add(s)}return s}_getMainSegmentPoints(){if(this._mainSegmentPoints)return this._mainSegmentPoints;const{points:t,multiSegment:e,mainSegmentIndex:i}=this.attribute;let n;return n=e?b(i)?t[i]:W(t):t,this._mainSegmentPoints=n,n}_clipPoints(t){const{startSymbol:e={},endSymbol:i={}}=this.attribute;let n=t;if(e.visible){const i=e.clip?e.size||10:0;n=[{x:t[0].x-i/2*(Math.cos(this._startAngle)||0),y:t[0].y-i/2*(Math.sin(this._startAngle)||0)},...n.slice(1)]}if(i.visible){const e=i.clip?i.size||10:0,s={x:t[t.length-1].x-e/2*(Math.cos(this._endAngle)||0),y:t[t.length-1].y-e/2*(Math.sin(this._endAngle)||0)};n=[...n.slice(0,n.length-1),s]}return n}_computeLineAngle(){const t=this._getMainSegmentPoints();if(t.length<=1)return;const e=t[0],i=t[1],n=t[t.length-2],s=t[t.length-1],r=[e.x-i.x,e.y-i.y],a=Math.atan2(r[1],r[0]),o=[s.x-n.x,s.y-n.y],l=Math.atan2(o[1],o[0]);this._startAngle=a,this._endAngle=l}_reset(){this.startSymbol=null,this.endSymbol=null,this._startAngle=null,this._endAngle=null,this._mainSegmentPoints=null}}ab.defaultAttributes={visible:!0,lineStyle:{lineWidth:1,stroke:"#000"},startSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}},endSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}}},rb();class ob extends ab{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:O({},ab.defaultAttributes,t)),this.name="arc-segment",this.key="arc-segment",this.isReverseArc=!1}getStartAngle(){const t=this.isReverseArc?this._startAngle+Math.PI/2:this._startAngle-Math.PI/2;return t<0?t+2*Math.PI:t>2*Math.PI?t-2*Math.PI:t}getEndAngle(){const t=this.isReverseArc?this._endAngle-Math.PI/2:this._endAngle+Math.PI/2;return t<0?t+2*Math.PI:t>2*Math.PI?t-2*Math.PI:t}getMainSegmentPoints(){return this._mainSegmentPoints}_computeStartRotate(t){return this.isReverseArc?t+Math.PI:t}_computeEndRotate(t){return this.isReverseArc?t:t+Math.PI}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:i,state:n,visible:s=!0,radius:r,startAngle:a,endAngle:o,center:l}=this.attribute;if(!s)return;this._startAngle=a,this._endAngle=o,this.isReverseArc=a>o;const h={x:l.x+r*Math.cos(this._startAngle),y:l.y+r*Math.sin(this._startAngle)},c={x:l.x+r*Math.cos(this._endAngle),y:l.y+r*Math.sin(this._endAngle)};this._mainSegmentPoints=[h,c];const u=this._renderSymbol(t,this._mainSegmentPoints,"start"),d=this._renderSymbol(e,this._mainSegmentPoints,"end");this.startSymbol=u,this.endSymbol=d;const p=Uh.arc(Object.assign({x:l.x,y:l.y,startAngle:a,endAngle:o,innerRadius:r,outerRadius:r},i));p.name=`${this.name}-line`,p.id=this._getNodeId("arc"),w(null==n?void 0:n.line)||(p.states=[].concat(n.line)[0]),this.add(p),this.line=p}}var lb,hb,cb,ub;!function(t){t.start="start",t.startTop="startTop",t.startBottom="startBottom",t.insideStart="insideStart",t.insideStartTop="insideStartTop",t.insideStartBottom="insideStartBottom",t.middle="middle",t.insideMiddleTop="insideMiddleTop",t.insideMiddleBottom="insideMiddleBottom",t.end="end",t.endTop="endTop",t.endBottom="endBottom",t.insideEnd="insideEnd",t.insideEndTop="insideEndTop",t.insideEndBottom="insideEndBottom"}(lb||(lb={})),function(t){t.left="left",t.right="right",t.top="top",t.bottom="bottom",t.topLeft="topLeft",t.topRight="topRight",t.bottomLeft="bottomLeft",t.bottomRight="bottomRight",t.middle="middle",t.insideLeft="insideLeft",t.insideRight="insideRight",t.insideTop="insideTop",t.insideBottom="insideBottom",t.insideTopLeft="insideTopLeft",t.insideTopRight="insideTopRight",t.insideBottomLeft="insideBottomLeft",t.insideBottomRight="insideBottomRight"}(hb||(hb={})),function(t){t.arcInnerStart="arcInnerStart",t.arcInnerEnd="arcInnerEnd",t.arcInnerMiddle="arcInnerMiddle",t.arcOuterStart="arcOuterStart",t.arcOuterEnd="arcOuterEnd",t.arcOuterMiddle="arcOuterMiddle",t.center="center"}(cb||(cb={})),function(t){t.top="top",t.bottom="bottom",t.middle="middle",t.insideTop="insideTop",t.insideBottom="insideBottom",t.insideMiddle="insideMiddle"}(ub||(ub={}));class db extends $y{constructor(){super(...arguments),this.name="marker",this._onHover=t=>{this._lastHover=((t,e,i)=>{const n=t.target;return n!==i&&n.name&&!w(n.states)?(n.addState(Yy.hover,!0),Ky(e,(t=>{t!==n&&t.name&&!w(t.states)&&t.addState(Yy.hoverReverse,!0)})),n):i})(t,this._container,this._lastHover)},this._onUnHover=t=>{this._lastHover=((t,e,i)=>i?(Ky(e,(t=>{t.name&&!w(t.states)&&(t.removeState(Yy.hoverReverse),t.removeState(Yy.hover))})),null):i)(0,this._container,this._lastHover)},this._onClick=t=>{this._lastSelect=((t,e,i)=>{const n=t.target;return i===n&&n.hasState(Yy.selected)?(Ky(e,(t=>{t.name&&!w(t.states)&&(t.removeState(Yy.selectedReverse),t.removeState(Yy.selected))})),null):n.name&&!w(n.states)?(n.addState(Yy.selected,!0),Ky(e,(t=>{t!==n&&t.name&&!w(t.states)&&t.addState(Yy.selectedReverse,!0)})),n):i})(t,this._container,this._lastSelect)}}transAnimationConfig(){var t,e,i;if(!1!==this.attribute.animation){const n=c(this.attribute.animation)?this.attribute.animation:{};this._animationConfig={enter:O({},this.defaultUpdateAnimation,n,null!==(t=this.attribute.animationEnter)&&void 0!==t?t:{}),exit:O({},this.defaultExitAnimation,n,null!==(e=this.attribute.animationExit)&&void 0!==e?e:{}),update:O({},this.defaultUpdateAnimation,n,null!==(i=this.attribute.animationUpdate)&&void 0!==i?i:{})}}}setAttribute(t,e,i){super.setAttribute(t,e,i),"visible"===t&&this.render()}_bindEvent(){var t,e,i;if(!this.attribute.interactive)return;const{hover:n,select:s}=this.attribute;n&&(null===(t=this._container)||void 0===t||t.addEventListener("pointermove",this._onHover),null===(e=this._container)||void 0===e||e.addEventListener("pointerout",this._onUnHover)),s&&(null===(i=this._container)||void 0===i||i.addEventListener("pointerdown",this._onClick))}_releaseEvent(){var t,e,i;null===(t=this._container)||void 0===t||t.removeEventListener("pointermove",this._onHover),null===(e=this._container)||void 0===e||e.removeEventListener("pointerout",this._onUnHover),null===(i=this._container)||void 0===i||i.removeEventListener("pointerdown",this._onClick)}_initContainer(){var t,e;const{limitRect:i={},clipInRange:n}=this.attribute;let s;if(n){const n=Uh.group(Object.assign(Object.assign({},i),{clip:!0,pickable:!1}));s=Uh.group({x:-(null!==(t=i.x)&&void 0!==t?t:0),y:-(null!==(e=i.y)&&void 0!==e?e:0),pickable:!1}),n.add(s),this._containerClip=n,this.add(n)}else s=Uh.group({x:0,y:0,pickable:!1}),this.add(s);s.name="marker-container",this._container=s}_updateContainer(){var t,e;const{limitRect:i={},clipInRange:n}=this.attribute;this._containerClip&&this._containerClip.setAttributes(Object.assign({},i)),this._container.setAttributes({x:n?-(null!==(t=i.x)&&void 0!==t?t:0):0,y:n?-(null!==(e=i.y)&&void 0!==e?e:0):0})}render(){var t;this.transAnimationConfig(),this.setAttribute("pickable",!1);const e=null===(t=this.attribute.visible)||void 0===t||t;!1===this.attribute.interactive&&this.setAttribute("childrenPickable",!1),e&&this.isValidPoints()?this._container?(this._updateContainer(),this.updateMarker(),this.markerAnimate("update")):(this._initContainer(),this.initMarker(this._container),this.markerAnimate("enter")):(this.markerAnimate("exit"),this._container=null,this.removeAllChild(!0)),this._releaseEvent(),this._bindEvent()}release(){this.markerAnimate("exit"),super.release(),this._releaseEvent(),this._container=null}}const pb={type:"callIn",duration:500,easing:"linear",delay:0},gb={type:"fadeOut",duration:500,easing:"linear",delay:0},fb=.001;lb.end,cb.arcOuterMiddle,hb.right,cb.arcOuterMiddle;const mb={postiveXAxis:{top:{textAlign:"left",textBaseline:"bottom"},bottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"left",textBaseline:"middle"},insideTop:{textAlign:"right",textBaseline:"bottom"},insideBottom:{textAlign:"right",textBaseline:"top"},insideMiddle:{textAlign:"right",textBaseline:"middle"}},negativeXAxis:{top:{textAlign:"right",textBaseline:"bottom"},bottom:{textAlign:"right",textBaseline:"top"},middle:{textAlign:"right",textBaseline:"middle"},insideTop:{textAlign:"left",textBaseline:"bottom"},insideBottom:{textAlign:"left",textBaseline:"top"},insideMiddle:{textAlign:"left",textBaseline:"middle"}}};Rg(),eb(),$f(),sb(),rb(),Kg(),Ig(),Dg(),$f();class yb extends db{markerAnimate(t){yb._animate&&this._animationConfig&&yb._animate([this._line,this._decorativeLine],this._item,this._animationConfig,t)}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:O({},yb.defaultAttributes,t)),this.name="markPoint",this.defaultUpdateAnimation=pb,this.defaultExitAnimation=gb,this._isArcLine=!1,this._isStraightLine=!1}setLabelPos(){}getTextAlignAttr(t,e,i,n,s){return Jy(Math.abs(n),Math.PI/2,fb)||Jy(Math.abs(n),3*Math.PI/2,fb)?function(t,e,i){return t?{textAlign:"right",textBaseline:"middle"}:{textAlign:e<Math.PI&&i.toLocaleLowerCase().includes("top")||e>Math.PI&&i.toLocaleLowerCase().includes("bottom")?"left":e<Math.PI&&i.toLocaleLowerCase().includes("bottom")||e>Math.PI&&i.toLocaleLowerCase().includes("top")?"right":"center",textBaseline:e<Math.PI&&i.includes("inside")||e>Math.PI&&!i.includes("inside")?"bottom":"top"}}(t,n,s):Zy(n)?mb.postiveXAxis[s]:mb.negativeXAxis[s]}setItemAttributes(t,e,i,n,s){var r,a;if(!t)return;const{autoRotate:o=!0,refX:l=0,refY:h=0,refAngle:c=0,style:u,position:d=ub.middle}=e,{state:p}=this.attribute,g=(null===(r=this._line)||void 0===r?void 0:r.getEndAngle())||0,f=l*Math.cos(g)+h*Math.cos(g-Math.PI/2),m=l*Math.sin(g)+h*Math.sin(g-Math.PI/2);if("text"===s){const s=n.x-i.x,r=n.y-i.y;t.setAttributes(Object.assign(Object.assign({},u),{textStyle:Object.assign(Object.assign({},this.getTextAlignAttr(o,s,r,g,null!==(a=e.position)&&void 0!==a?a:"end")),u.textStyle),state:{panel:O({},qy,null==p?void 0:p.textBackground),text:O({},qy,null==p?void 0:p.itemContent)}}))}else("richText"===s||"image"===s)&&(t.setAttributes({dx:this.getItemDx(t,d,u)+(u.dx||0),dy:this.getItemDy(t,d,u)+(u.dy||0)}),t.states=O({},qy,null==p?void 0:p.itemContent));const y=Zy(g)?g:g-Math.PI;t.setAttributes({x:n.x+(f||0),y:n.y+(m||0),angle:o&&y+c})}getItemDx(t,e,i){var n,s;const r=null!==(s=null===(n=null==t?void 0:t.AABBBounds)||void 0===n?void 0:n.width())&&void 0!==s?s:(null==i?void 0:i.width)||0;return e.includes("inside")?-r:0}getItemDy(t,e,i){var n,s;const r=null!==(s=null===(n=null==t?void 0:t.AABBBounds)||void 0===n?void 0:n.height())&&void 0!==s?s:(null==i?void 0:i.height)||0;return e.includes("top")||e.includes("Top")?-r:e.includes("middle")||e.includes("Middle")?-r/2:0}initItem(t,e,i){const{state:n}=this.attribute,{type:s="text",style:r,renderCustomCallback:a}=t;let o;return"symbol"===s?(o=Uh.symbol(Object.assign(Object.assign({},i),r)),o.states=O({},qy,null==n?void 0:n.itemContent)):"text"===s?o=new nb(Object.assign(Object.assign({},i),{state:{panel:O({},qy,null==n?void 0:n.textBackground),text:O({},qy,null==n?void 0:n.itemContent)}})):"richText"===s?(o=Uh.richtext(Object.assign(Object.assign({},i),r)),o.states=O({},qy,null==n?void 0:n.itemContent)):"image"===s?(o=Uh.image(Object.assign(Object.assign({},i),r)),o.states=O({},qy,null==n?void 0:n.itemContent)):"custom"===s&&a&&(o=a(),o.states=O({},qy,null==n?void 0:n.itemContent)),o.name=`mark-point-${s}`,this.setItemAttributes(o,t,e,i,s),o}getItemLineAttr(t,e,i){let n=[],s={x:0,y:0},r=0,a=0,o=0;const{type:l="type-s",arcRatio:h=.8}=t,c=i.x-e.x,u=i.y-e.y;if(this._isStraightLine=Jy(c,0,fb)||Jy(u,0,fb),this._isArcLine){const{x:t,y:e}=this.attribute.position,{x:n,y:l}=i,c=(t+n)/2,u=c+h*(l>e?-1:1)*c,d=(e===l?0:-(t-n)/(e-l))*(u-c)+(e+l)/2;a=tb(e-d,t-u),o=tb(l-d,n-u),s={x:u,y:d};const p=Math.sqrt((u-t)*(u-t)+(d-e)*(d-e)),g=this.attribute.targetSymbol.style.size/2;a+=2*Math.acos(Math.sqrt(1-g*g/(4*p*p))),h>0?o<a&&(o+=2*Math.PI):a<o&&(a+=2*Math.PI),r=Math.sqrt((u-t)*(u-t)+(d-e)*(d-e))}else n="type-do"!==l||this._isStraightLine?"type-po"!==l||this._isStraightLine?"type-op"!==l||this._isStraightLine?[e,i]:[e,{x:e.x,y:i.y},i]:[e,{x:i.x,y:e.y},i]:[e,{x:(e.x+i.x)/2,y:i.y},i];return n=function(t){const e=[t[0]];for(let i=1;i<t.length;i++)t[i].x===t[i-1].x&&t[i].y===t[i-1].y||e.push(t[i]);return e}(n),{points:n,center:s,radius:r,startAngle:a,endAngle:o}}reDrawLine(t,e){this._line.release();const{startSymbol:i,endSymbol:n,lineStyle:s,type:r="type-s"}=t,{state:a}=this.attribute,o=this._isArcLine?ob:ab;this._container.removeChild(this._line),this._line=new o(Object.assign(Object.assign({},e),{pickable:!1,startSymbol:i,endSymbol:n,lineStyle:s,visible:t.visible,state:{line:O({},qy,null==a?void 0:a.line),startSymbol:O({},qy,null==a?void 0:a.lineStartSymbol),endSymbol:O({},qy,null==a?void 0:a.lineEndSymbol)}})),this._container.add(this._line)}setItemLineAttr(t,e,i){if(this._line){const{startSymbol:n,endSymbol:s,lineStyle:r,type:a="type-s"}=t,{state:o}=this.attribute,l=this.getItemLineAttr(t,e,i);this._isArcLine&&"arc-segment"===this._line.key||!this._isArcLine&&"segment"===this._line.key?this._line.setAttributes(Object.assign(Object.assign({},l),{startSymbol:n,endSymbol:s,lineStyle:r,visible:t.visible,state:{line:O({},qy,null==o?void 0:o.line),startSymbol:O({},qy,null==o?void 0:o.lineStartSymbol),endSymbol:O({},qy,null==o?void 0:o.lineEndSymbol)}})):this.reDrawLine(t,l)}}getDecorativeLineAttr(t){var e;const i=(null===(e=null==t?void 0:t.decorativeLine)||void 0===e?void 0:e.length)||10,n=this._line.getEndAngle()||0;return{startPointOffsetX:i/2*Math.cos(n-Math.PI/2),startPointOffsetY:i/2*Math.sin(n-Math.PI/2),endPointOffsetX:-i/2*Math.cos(n-Math.PI/2),endPointOffsetY:-i/2*Math.sin(n-Math.PI/2)}}setDecorativeLineAttr(t,e,i){var n;if(this._decorativeLine){const{lineStyle:s}=t,{startPointOffsetX:r,startPointOffsetY:a,endPointOffsetX:o,endPointOffsetY:l}=this.getDecorativeLineAttr(t);this._decorativeLine.setAttributes(Object.assign(Object.assign({points:[{x:e.x+r,y:e.y+a},{x:e.x+o,y:e.y+l}]},s),{visible:i})),this._decorativeLine.states=O({},qy,null===(n=this.attribute.state)||void 0===n?void 0:n.line)}}setTargetItemAttributes(t,e){var i,n;this._targetItem&&(this._targetItem.setAttributes(Object.assign({x:e.x,y:e.y,visible:null!==(i=t.visible)&&void 0!==i&&i,size:t.size},t.style)),this._targetItem.states=O({},qy,null===(n=this.attribute.state)||void 0===n?void 0:n.targetItem))}setAllOfItemsAttr(t,e){var i;const{position:n,itemLine:s={},itemContent:r={},limitRect:a,targetSymbol:o}=this.attribute,{type:l="text",confine:h}=r;if(a&&h){const{x:t,y:i,width:n,height:s}=a,{dx:r,dy:o}=function(t,e){const{x1:i,y1:n,x2:s,y2:r}=e,{x1:a,y1:o,x2:l,y2:h}=t.AABBBounds;let c=0,u=0;return a<i&&(c=i-a),o<n&&(u=n-o),l>s&&(c=s-l),h>r&&(u=r-h),{dx:c,dy:u}}(this._item,{x1:t,y1:i,x2:t+n,y2:i+s});e.x=e.x+r,e.y=e.y+o}this.setTargetItemAttributes(o,n),this.setItemLineAttr(s,t,e),this.setItemAttributes(this._item,r,t,e,l),this.setDecorativeLineAttr(s,e,null===(i=s.decorativeLine)||void 0===i?void 0:i.visible)}computeNewPositionAfterTargetItem(t){var e,i;const{itemContent:n={},targetSymbol:s,itemLine:r}=this.attribute,{offsetX:a=0,offsetY:o=0}=n,{offset:l=0,style:h,visible:c=!1,size:u}=s,d=c?null!==(i=null!==(e=h.size)&&void 0!==e?e:u)&&void 0!==i?i:20:0;let p;return p="type-do"===r.type?tb(o,a/2):"type-po"===r.type?tb(0,a):"type-op"===r.type?tb(o,0):tb(o,a),{newPosition:{x:t.x+(d/2+l)*Math.cos(p),y:t.y+(d/2+l)*Math.sin(p)},newItemPosition:{x:t.x+(d/2+l)*Math.cos(p)+a,y:t.y+(d/2+l)*Math.sin(p)+o}}}initMarker(t){const{position:e,itemContent:i={},itemLine:n}=this.attribute,{type:s="type-s",arcRatio:r=.8}=n,{offsetX:a=0,offsetY:o=0}=i;this._isStraightLine=Jy(a,0,fb)||Jy(o,0,fb),this._isArcLine="type-arc"===s&&0!==r&&!this._isStraightLine;const{newPosition:l,newItemPosition:h}=this.computeNewPositionAfterTargetItem(e),c=new(this._isArcLine?ob:ab)({points:[],pickable:!1,center:{x:0,y:0},radius:0,startAngle:0,endAngle:0});c.name="mark-point-line",this._line=c,t.add(c);const u=Uh.line({points:[]});u.name="mark-point-decorativeLine",this._decorativeLine=u,t.add(u);const d=Uh.symbol({});d.name="mark-point-targetItem",this._targetItem=d,t.add(this._targetItem);const p=this.initItem(i,l,h);this._item=p,t.add(p),this.setAllOfItemsAttr(l,h)}updateMarker(){const{position:t,itemContent:e={},itemLine:i}=this.attribute,{type:n="text"}=e,{type:s="type-s",arcRatio:r=.8}=i,{offsetX:a=0,offsetY:o=0}=e;this._isStraightLine=Jy(a,0,fb)||Jy(o,0,fb);const l="type-arc"===s&&0!==r&&!this._isStraightLine,{newPosition:h,newItemPosition:c}=this.computeNewPositionAfterTargetItem(t);l!==this._isArcLine?(this._isArcLine=l,this.reDrawLine(i,{points:[{x:0,y:0}],pickable:!1,center:{x:0,y:0},radius:0,startAngle:0,endAngle:0})):this._isArcLine=l,this.setItemAttributes(this._item,e,h,c,n),this.setAllOfItemsAttr(h,c)}isValidPoints(){const{position:t}=this.attribute;return!(!b(t.x)||!b(t.y))}}yb.defaultAttributes={interactive:!0,targetSymbol:{visible:!1,offset:0,style:{symbolType:"circle",size:20,fill:!1,stroke:"rgba(46, 47, 50)"}},itemLine:{visible:!0,decorativeLine:{visible:!1,length:30},startSymbol:{visible:!0,clip:!0,symbolType:"circle",size:20,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},endSymbol:{visible:!1,clip:!0,symbolType:"triangle",size:12,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},lineStyle:{stroke:"#000",lineWidth:1}},itemContent:{type:"text",position:"middle",refX:10}};const bb="seriesBreak";function vb(t,e,i,n,s=!1){const r=[],{x:a,y:o}=t,{x:l,y:h}=e,c=s?Math.floor((h-o)/(2*i)):Math.floor((l-a)/(2*i)),u=Math.PI/180*n,d=i*Math.cos(u),p=i*Math.sin(u);r.push(`M ${a} ${o}`);for(let t=0;t<=c;t++){const e=s?a+(t%2==0?d:-d):a+t*i*2,n=s?o+t*i*2:t%2==0?o-p:o+p;r.push(`L ${e} ${n}`)}return r.push(`L ${s?a:l} ${s?h:o}`),r.join(" ")}const xb=(t,e)=>{const{start:i,end:n}=e,s=i.x===n.x,r=s?"x":"y",a=s?"y":"x";let o=!0;const l=1e-6;t.length&&t.forEach((t=>{if(function(t,e){const i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e-10,n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-10)*Math.max(t,e);return Math.abs(t-e)<=Math.max(i,n)}(t.start[r],i[r])){const e=Math.min(i[a],n[a]),s=Math.max(i[a],n[a]),r=Math.min(t.start[a],t.end[a]),h=Math.max(t.start[a],t.end[a]);if(!(s<r-l||e>h+l))return t.start[a]=Math.min(r,e),t.end[a]=Math.max(h,s),void(o=!1)}})),o&&t.push(e)};class _b extends $y{constructor(){super(...arguments),this.name=bb}render(){this.removeAllChild();const{data:t=[]}=this.attribute;if(w(t))return;const e=[],i=[];t.forEach((t=>{const{start:n,end:s}=t,r=n.x===s.x;xb(r?e:i,t)})),[...e,...i].forEach(((t,e)=>{var i;const{start:n,end:s,size:r=4,gap:a=5,style:o={}}=t,l=Ve(t,["start","end","size","gap","style"]),c=Al({}),u=n.x===s.x;let d,p,g,f;u?(d={x:n.x-a/2,y:n.y},p={x:s.x-a/2,y:s.y},g={x:n.x+a/2,y:n.y},f={x:s.x+a/2,y:s.y}):(d={x:n.x,y:n.y-a/2},p={x:s.x,y:s.y-a/2},g={x:n.x,y:n.y+a/2},f={x:s.x,y:s.y+a/2});const m=vb(d,p,r,u?75:15,u),y=vb(n,s,r,u?75:15,u),b=vb(g,f,r,u?75:15,u);c.add(Th(Object.assign(Object.assign({path:m,stroke:"#000",lineWidth:1},o),{pickable:!1,zIndex:1}))),c.add(Th(Object.assign(Object.assign({path:b,stroke:"#000",lineWidth:1},o),{pickable:!1,zIndex:1}))),c.add(Th({path:y,stroke:"#fff",lineWidth:a,pickable:!1,zIndex:0})),c.name="series-break",c.data=l,h(l.axisId)&&(c.id=`${null!==(i=l.axisId)&&void 0!==i?i:""}_${e}`),this.add(c)}))}}function Ab(t,e,i=1){return Math.abs(t-e)<i}function Sb(t,e){return{type:"component",componentType:bb,interactive:!0,zIndex:500,style:{data:(i,n)=>{const s=[],r=n.vchart.getChart(),a="horizontal"===r.getAllSeries()[0].direction;return t.forEach(((t,i)=>{var n,o;const l=t.id,c=h(l)?r.getComponentByUserId(l):e&&h(e[i])?r.getComponentByIndex("axes",e[i]):null===(n=r.getComponentsByKey("axes").filter((e=>e.getSpec().breaks===t.breaks)))||void 0===n?void 0:n[0];if(!c)return;const u=null!=l?l:`${c.type}-${c.id}`,d=function(t){let{x:e,y:i}=t[0].getLayoutStartPoint(),n=e+t[0].getLayoutRect().width,s=i+t[0].getLayoutRect().height;for(let r=1;r<t.length;r++){const a=t[r],{x:o,y:l}=a.getLayoutStartPoint(),{width:h,height:c}=a.getLayoutRect();e=Math.min(e,o),n=Math.max(n,h+o),i=Math.min(i,l),s=Math.max(s,c+l)}return{x1:e,y1:i,x2:n,y2:s}}(c.getRegions());j(null===(o=c._break)||void 0===o?void 0:o.breaks).forEach((t=>{const{range:e,breakSymbol:i,gap:n=5}=t,o=c.valueToPosition(e[0]),l=c.valueToPosition(e[1]),h=(o+l)/2+(a?d.x1:d.y1);r.getAllSeries().forEach((t=>{if("bar"===t.type||"waterfall"===t.type){t.getMarkInName("bar").getGraphics().forEach((t=>{const r=t.AABBBounds;let c,p,g,f,m=!1;a?(m=r.x1<(o+l-n)/2&&r.x2>(o+l+n)/2,c=h,p=Math.max(r.y1+d.y1-2,d.y1),g=h,f=Math.min(r.y2+d.y1+2,d.y2)):(m=r.y1<(o+l-n)/2&&r.y2>(o+l+n)/2,c=Math.max(r.x1+d.x1-2,d.x1),p=h,g=Math.min(r.x2+d.x1+2,d.x2),f=h),m&&s.push({start:{x:c,y:p},end:{x:g,y:f},gap:n,style:null==i?void 0:i.style,axisId:u,data:e})}))}else if("line"===t.type){t.getMarkInName(t.type).getGraphics().forEach((t=>{wb(t,"line").forEach((t=>{Tb(a?{start:{x:(o+l)/2,y:0},end:{x:(o+l)/2,y:d.y2-d.y1}}:{start:{x:0,y:(o+l)/2},end:{x:d.x2-d.x1,y:(o+l)/2}},t).forEach((t=>{let r,o;a?(r={x:h,y:Math.max(t[1]+d.y1-10,d.y1)},o={x:h,y:Math.min(t[1]+d.y1+10,d.y2)}):(r={x:Math.max(t[0]+d.x1-10,d.x1),y:h},o={x:Math.min(t[0]+d.x1+10,d.x2),y:h}),s.push({start:r,end:o,gap:n,style:null==i?void 0:i.style,axisId:u,data:e})}))}))}))}else if("area"===t.type){t.getMarkInName("area").getGraphics().forEach((t=>{wb(t,"area").forEach((t=>{const r=Tb(a?{start:{x:(o+l)/2,y:0},end:{x:(o+l)/2,y:d.y2-d.y1}}:{start:{x:0,y:(o+l)/2},end:{x:d.x2-d.x1,y:(o+l)/2}},t);r.sort(((t,e)=>t[0]-e[0]));for(let o=0;o<r.length-1;o++){const l={x:r[o][0],y:r[o][1]},h={x:r[o+1][0],y:r[o+1][1]};if(Mb(a?{x:l.x,y:(l.y+h.y)/2}:{x:(l.x+h.x)/2,y:l.y},t)){let t,r;a?(t={x:l.x+d.x1,y:Math.max(l.y+d.y1-0,d.y1)},r={x:h.x+d.x1,y:Math.min(h.y+d.y1+0,d.y2)}):(t={x:Math.max(l.x+d.x1-0,d.x1),y:l.y+d.y1},r={x:Math.min(h.x+d.x1+0,d.x2),y:h.y+d.y1}),s.push({start:t,end:r,gap:n,style:null==i?void 0:i.style,axisId:u,data:e})}}}))}))}}))}))})),s}}}}function Tb(t,e){const i=[];for(let n=1;n<e.length;n++){const s=Mt([t.start.x,t.start.y],[t.end.x,t.end.y],[e[n].x,e[n].y],[e[n-1].x,e[n-1].y]);s&&!i.find((t=>Ab(vt.distancePP({x:t[0],y:t[1]},{x:s[0],y:s[1]}),0)))&&i.push(s)}return i}function wb(t,e){const{points:i,segments:n}=t.attribute,s=[];let r=[];const a=t=>{if(t&&t.length){let i=[];if(t.forEach((t=>{var n,a;if(!1===t.defined){if(s.push(r),"area"===e&&i.length){for(let t=i.length-1;t>=0;t--)r.push({x:i[t].x,y:i[t].y});r.push(r[0])}r=[],i=[]}else r.push({x:t.x,y:t.y}),"area"===e&&i.push({x:null!==(n=t.x1)&&void 0!==n?n:t.x,y:null!==(a=t.y1)&&void 0!==a?a:t.y})})),"area"===e&&i.length){for(let t=i.length-1;t>=0;t--)r.push({x:i[t].x,y:i[t].y});r.push(r[0])}s.push(r)}};return i&&i.length?a(i):n&&n.length&&n.forEach((t=>{a(t.points)})),s}function Mb(t,e){const{x:i,y:n}=t;let s=!1;for(let t=0,r=e.length-1;t<e.length;r=t++){const{x:a,y:o}=e[t],{x:l,y:h}=e[r];o>n!=h>n&&i<(l-a)*(n-o)/(h-o)+a&&(s=!s)}return s}const Bb="barLink";class Cb extends $y{constructor(){super(...arguments),this.name=Bb}render(){const{data:t,linkStyle:i,areaStyle:n,styleMap:s,label:r,linkType:a="total"}=this.attribute;w(t)||(this.removeAllChild(),t.forEach(((t,o)=>{var l,h,c,u,d;const{linePoints:p,areaPoints:g,id:f=o,color:m,data:y}=t;if(g&&!1!==(null===(l=null==s?void 0:s[`area-${f}`])||void 0===l?void 0:l.visible)){const t=(b=Object.assign(Object.assign({points:g,fillOpacity:.3,fill:m,zIndex:0},n),null==s?void 0:s[`area-${f}`]),new Mh(b));t.name="bar-link-area",t.id=`area-${f}`,this.add(t)}var b;if(p&&!1!==(null===(h=null==s?void 0:s[`line-${f}`])||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===(u=null==s?void 0:s[`line-${f}`])||void 0===u?void 0:u.lineWidth)){const{startSymbol:t={},endSymbol:e={},lineStyle:n}=i||{},r=B(t),a=B(e);(null==s?void 0:s[`line-${f}`])&&s[`line-${f}`].stroke&&(r.style=Object.assign(Object.assign({},r.style),{color:s[`line-${f}`].stroke}),a.style=Object.assign(Object.assign({},a.style),{color:s[`line-${f}`].stroke})),r.symbolType||r.originSymbolType||(r.originSymbolType="solidArrow"),a.symbolType||a.originSymbolType||(a.originSymbolType="solidArrow");const o=new ab({points:p,startSymbol:Object.assign({size:8},r),endSymbol:Object.assign({size:8},a),lineStyle:Object.assign(Object.assign({lineDash:[3,3],lineWidth:1,stroke:"#000"},n),null==s?void 0:s[`line-${f}`]),pickable:!0,childrenPickable:!1,zIndex:1});o.name="bar-link-line",o.id=`line-${f}`,this.add(o)}if((null==r?void 0:r.visible)&&!1!==(null===(d=null==s?void 0:s[`label-${f}`])||void 0===d?void 0:d.visible)){const{style:t,formatMethod:i}=r,[n,o]=y;let l=n[e.STACK_FIELD_END],h=o[e.STACK_FIELD_END];"value"===a&&(l=n[e.STACK_FIELD_END]-n[e.STACK_FIELD_START],h=o[e.STACK_FIELD_END]-o[e.STACK_FIELD_START]);const c=h-l,u=(h-l)/l*100,d=Kl(Object.assign(Object.assign({x:.5*(p[0].x+p[1].x),y:.5*(p[0].y+p[1].y),text:i?i(c,u,y):`${c} ${u}`,fontSize:14,fill:"#000",stroke:"#fff",lineWidth:1,textAlign:"center",textBaseline:"middle",background:"#fff",zIndex:2},t),null==s?void 0:s[`label-${f}`]));d.name="bar-link-label",d.id=`label-${f}`,this.add(d)}})))}}function kb(t,i,n){const{isHorizontal:s,isXAxisInverse:r,isYAxisInverse:a,linkType:o,doFill:l,regionStartX:h,regionStartY:c}=n,u=t.AABBBounds,d=i.AABBBounds;let p,g;return s?(p=[{x:(u.x1+u.x2)/2+h,y:u.y1+c},{x:(d.x1+d.x2)/2+h,y:d.y2+c}],r?("total"===o&&(p=[{x:u.x1+h,y:u.y1+c},{x:d.x1+h,y:d.y2+c}]),l&&(g=[{x:u.x1+h,x1:u.x2+h,y:u.y1+c},{x:d.x1+h,x1:d.x2+h,y:d.y2+c}])):("total"===o&&(p=[{x:u.x2+h,y:u.y1+c},{x:d.x2+h,y:d.y2+c}]),l&&(g=[{x:u.x2+h,x1:u.x1+h,y:u.y1+c},{x:d.x2+h,x1:d.x1+h,y:d.y2+c}]))):(p=[{x:u.x2+h,y:(u.y1+u.y2)/2+c},{x:d.x1+h,y:(d.y1+d.y2)/2+c}],a?("total"===o&&(p=[{x:u.x2+h,y:u.y2+c},{x:d.x1+h,y:d.y2+c}]),l&&(g=[{x:u.x2+h,y:u.y2+c,y1:u.y1+c},{x:d.x1+h,y:d.y2+c,y1:d.y1+c}])):("total"===o&&(p=[{x:u.x2+h,y:u.y1+c},{x:d.x1+h,y:d.y1+c}]),l&&(g=[{x:u.x2+h,y:u.y1+c,y1:u.y2+c},{x:d.x1+h,y:d.y1+c,y1:d.y2+c}]))),{areaPoints:g,linePoints:p,data:[e.getDatumOfGraphic(t),e.getDatumOfGraphic(i)],color:t.attribute.fill}}function Pb(t={},i){const{linkType:n="total",doFill:s}=t,r=Ve(t,["linkType","doFill"]);return{type:"component",componentType:Bb,zIndex:500,interactive:!1,style:Object.assign(Object.assign({data:(t,i)=>{const{vchart:r}=i,a=r.getChart().getAllRegions(),o=[];return a.forEach((t=>{const i=t.getSeries().filter((t=>"bar"===t.type)),{x:r,y:a}=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 n={};for(let s=0;s<t.length;s++){const r=t[s],a=e.getDatumOfGraphic(r),o=i.map((t=>a[t])).join("-");n[o]||(n[o]=[]),n[o].push(r)}return n}(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],u="horizontal"===c.direction,d=c.getYAxisHelper().isInverse(),p=c.getXAxisHelper().isInverse(),g=Object.values(h);if(g.length)if(u){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=kb(t,null!==(l=i[e])&&void 0!==l?l:i[i.length-1],{isHorizontal:u,isXAxisInverse:p,isYAxisInverse:d,doFill:s,linkType:n,regionStartX:r,regionStartY:a});o.push(h)})),e.length<i.length){const t=e[e.length-1];for(let l=e.length;l<i.length;l++){const e=kb(t,i[l],{isHorizontal:u,isXAxisInverse:p,isYAxisInverse:d,doFill:s,linkType:n,regionStartX:r,regionStartY:a});o.push(e)}}}}})),o},linkType:n},r),i)}}const Ob="seriesLabel";function Rb(t,e=10,i=10,n=.1){const s=t.length;if(!t.every(isFinite))return t;if(!(s>1))return t;const r=function(t,e,i){t=+t,e=+e;let n=arguments.length;i=n<2?(e=t,t=0,1):n<3?1:+i;let s=-1;n=0|Math.max(0,Math.ceil((e-t)/i));const r=new Array(n);for(;++s<n;)r[s]=t+s*i;return r}(t.length);for(let a=0;a<i;++a){r.sort(((e,i)=>{return n=t[e],s=t[i],null==n||null==s?NaN:n<s?-1:n>s?1:n>=s?0:NaN;var n,s}));let i=0;for(let n=1;n<s;++n){let s=t[r[n]]-t[r[n-1]];s<e&&(s=(e-s)/2,i=Math.max(i,s),t[r[n-1]]-=s,t[r[n]]+=s)}if(i<n)break}return t}function Lb(t,e){return!(e.x1>t.x2||e.x2<t.x1||e.y1>t.y2||e.y2<t.y1)}function Ib(t,e=10,i=10){const n=t.length;let s,r=0;do{s=!1;for(let i=0;i<n;++i)for(let r=i+1;r<n;++r){const n=t[i].AABBBounds,a=t[r].AABBBounds;if(Lb(n,a)){const i=e-(a.x1-n.x2);i>0&&(t[r].attribute.x+=i,a.x1+=i,a.x2+=i,s=!0)}}r++}while(s&&r<i)}function Eb(t,e){const{label:i,line:n}=e;return{type:"component",componentType:Ob,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:(e,i)=>{var n;const s=i.vchart.getChart(),r=s.getAllSeries()[0],a="horizontal"===r.direction,o=a?r.getYAxisHelper():r.getXAxisHelper(),l=null===(n=o.getScale)||void 0===n?void 0:n.call(o,0),h=o.isInverse(),c=r.getDimensionField()[0],u=r.getSeriesField(),d=s.getAllSeries().map((t=>t.type)).filter(((t,e,i)=>i.indexOf(t)===e)),p=[];if(1===d.length&&["bar","area","line","waterfall"].includes(d[0])){("both-ends"===t?["start","end"]:[t]).forEach((t=>{const e="end"===t?function(t){if(f(t))return t[t.length-1]}(l.domain()):l.domain()[0],i=r.getRegion(),{x:n,y:o}=i.getLayoutStartPoint();let g=0;s.getAllSeries().forEach((i=>{i.getMarkInName("waterfall"===d[0]?"bar":d[0]).getGraphics().forEach((s=>{var r;const l=s.context.data.find((t=>t[c]===e));if(l){const e=s.AABBBounds;let f,m,y,b;"bar"===d[0]||"waterfall"===d[0]?(f="end"===t?{x:a?(e.x1+e.x2)/2:h?e.x1:e.x2,y:a?h?e.y2:e.y1:(e.y1+e.y2)/2}:{x:a?(e.x1+e.x2)/2:h?e.x2:e.x1,y:a?h?e.y1:e.y2:(e.y1+e.y2)/2},m=s.attribute.fill):(f=i.dataToPosition(l),m=s.attribute.stroke||s.attribute.fill),"end"===t?(y=a?"center":h?"end":"start",b=a?h?"top":"bottom":"middle"):(y=a?"center":h?"start":"end",b=a?h?"bottom":"top":"middle");const v=null!==(r=l[u])&&void 0!==r?r:l[c];p.push({point:{x:f.x+n,y:f.y+o},label:v,color:m,textAlign:y,textBaseline:b,series:i,datum:l,id:`${t}-${g}`,position:t}),g++}}))}))}))}return p},line:n,label:Object.assign({space:12},i)}}}class Db extends $y{constructor(){super(...arguments),this.name=Ob}render(){var t,e,i,n;this.removeAllChild();const{data:s,layout:r,label:a,line:o={}}=this.attribute;if(w(s))return;const l=null!==(t=null==a?void 0:a.styleMap)&&void 0!==t?t:{},h={},c=s.filter((t=>{var e;return!1!==(null===(e=l[t.id])||void 0===e?void 0:e.visible)}));if("vertical"===r){const t=1.5*(null!==(i=null===(e=null==a?void 0:a.style)||void 0===e?void 0:e.fontSize)&&void 0!==i?i:12),n=(t,e,i)=>{var n,s,r,a,o,l,h,c;const{label:u,color:d,textAlign:p,textBaseline:g,id:f}=t,m=null!==(s=null===(n=i[f])||void 0===n?void 0:n.formatMethod)&&void 0!==s?s:null===(r=this.attribute.label)||void 0===r?void 0:r.formatMethod,y=Kl(Object.assign(Object.assign(Object.assign(Object.assign({text:m?m(u,t.datum,{series:t.series}):u},null===(a=this.attribute.label)||void 0===a?void 0:a.style),e),{textAlign:p,textBaseline:g,fill:null!==(h=null===(l=null===(o=this.attribute.label)||void 0===o?void 0:o.style)||void 0===l?void 0:l.fill)&&void 0!==h?h:d}),null===(c=i[f])||void 0===c?void 0:c.style));return y.name="series-label-text",y.id=f,this.add(y),y};["start","end"].forEach((e=>{const i=c.filter((t=>t.position===e)),s=Rb(i.map((t=>t.point.y)),t);i.forEach(((t,e)=>{var i;const r={x:t.point.x+(null!==(i=null==a?void 0:a.space)&&void 0!==i?i:8)*("start"===t.textAlign?1:-1),y:s[e]};n(t,r,l),h[t.id]=r}))}))}else{const t=[],e=[];c.forEach((i=>{var n,s,r,o,h;const{point:c,label:u,color:d,textAlign:p,textBaseline:g,id:f,position:m}=i,y={x:c.x,y:c.y},b=null!==(s=null===(n=l[f])||void 0===n?void 0:n.formatMethod)&&void 0!==s?s:null==a?void 0:a.formatMethod,v=Kl(Object.assign(Object.assign(Object.assign(Object.assign({text:b?b(u,i.datum,{series:i.series}):u},null==a?void 0:a.style),y),{textAlign:p,textBaseline:g,fill:null!==(o=null===(r=null==a?void 0:a.style)||void 0===r?void 0:r.fill)&&void 0!==o?o:d}),null===(h=l[f])||void 0===h?void 0:h.style));v.id=f,v.name="series-label-text",this.add(v),"start"===m?t.push(v):"end"===m&&e.push(v)})),t.length&&Ib(t,4,10),e.length&&Ib(e,4,10);const i=null!==(n=null==a?void 0:a.space)&&void 0!==n?n:8;[...t,...e].forEach((t=>{const e="top"===t.attribute.textBaseline?1:-1;t.setAttribute("y",t.attribute.y+i*e),h[t.id]={x:t.attribute.x,y:t.attribute.y}}))}!1!==o.visible&&c.forEach((t=>{var e,i,n,s,a,c;const{point:u,color:d,id:p}=t,g={x:h[p].x+(null!==(n=null===(i=null===(e=l[p])||void 0===e?void 0:e.style)||void 0===i?void 0:i.dx)&&void 0!==n?n:0),y:h[p].y+(null!==(c=null===(a=null===(s=l[p])||void 0===s?void 0:s.style)||void 0===a?void 0:a.dy)&&void 0!==c?c:0)};if(!1!==o.autoVisible){if("vertical"===r&&u.y!==g.y||"horizontal"===r&&u.x!==g.x){const t=ih(Object.assign({points:[u,g],lineWidth:1,stroke:d},o.style));t.name="series-label-line",this.add(t)}}else{const t=ih(Object.assign({points:[u,g],lineWidth:1,stroke:d},o.style));t.name="series-label-line",this.add(t)}}))}}function Fb(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 jb(t){return{x1:t.x,x2:t.x+t.width,y1:t.y,y2:t.y+t.height}}function Ub(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:jb(t.rect),anchorCandidates:Hb(null!==(e=t.anchors)&&void 0!==e?e:[],t.point,t.rect,t.offset)})})),n=[];n.push(i[0].bound);for(let t=1;t<=i.length-1;t++){const s=i[t],r=s.bound;let a=n.some((t=>Fb(t,r)));if(s.anchorCandidates)if(a&&(null===(e=s.anchorCandidates)||void 0===e?void 0:e.length)>0){for(let t=0;t<s.anchorCandidates.length;t++){const e=s.anchorCandidates[t],i={x1:e.x,y1:e.y,x2:e.x+r.x2-r.x1,y2:e.y+r.y2-r.y1,anchor:e};if(!n.some((t=>Fb(t,i)))){n.push(i),a=!1;break}}a&&n.push(s.bound)}else n.push(s.bound)}return n.map((t=>function(t){return{x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}}(t)))}function Nb(t,e,i){const n=t.map((t=>t.pointCoord)),{x1:s,x2:r,y1:a,y2:o}=Dt(n),l=i([(s+r)/2,(a+o)/2]);if(!l)return[];const h=t.map((t=>{const n=t.rect,s=Gb(e,t.pointCoord)?i(function(t,e,i,n=200){const s=5621/n;let r=e;for(let e=1;e<=s;e++){const e=de(r,n,i);if(!Gb(t,e))return[e.x,e.y];r=[e.x,e.y]}return e}(e,[t.pointCoord.x,t.pointCoord.y],Wb(zb(t.point,l)))):t.point;s&&(n.x=s.x,n.y=s.y);const r=Wb(zb(t.point,l));let a;const o=[];return r>=-45&&r<45?(a="top",o.push("left","right")):r>=45&&r<135?a="right":r>=-135&&r<-45?(a="left",o.push("left")):(a="bottom",o.push("left","right")),t.anchors=o,t.offset=20,t.rect=Vb(t.rect,a,0),t}));return Ub(h)}function Wb(t){return t>180?t-360:t}function zb(t,e){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI+90}function Gb(t,e){for(let i=0;i<t.length;i++){if(ue(e,t[i]))return!0}return!1}function Vb(t,e,i=0){const n=Object.assign({},t);return"top"===e?(n.x-=t.width/2,n.y-=i+t.height/2):"bottom"===e?(n.x-=t.width/2,n.y+=i-t.height/2):"left"===e?(n.x-=i+t.width,n.y-=t.height/2):"right"===e&&(n.x+=i,n.y-=t.height/2),n}function Hb(t,e,i,n=0){const s=[];return t.forEach((t=>{const{x:r,y:a}=Vb(Object.assign(Object.assign({},e),{width:i.width,height:i.height}),t,n);s.push({x:r,y:a})})),s}const Xb={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 $b extends e.BaseComponentSpecTransformer{_getDefaultSpecFromChart(){return Xb}}class Yb extends e.BaseComponent{constructor(){super(...arguments),this.type="mapLabel",this.name=" mapLabel",this.specKey="mapLabel",this.transformerConstructor=$b,this.layoutType="none",this.layoutZIndex=e.LayoutZIndex.MarkPoint,this._activeDatum=[]}static getSpecInfo(t){return e.getSpecInfo(t,this.specKey,this.type,(t=>t.visible&&h(t.seriesId)))}setAttrFromSpec(){var t,e,i,n;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===(n=this._series)||void 0===n?void 0:n.getMeasureField()[0]}created(){super.created(),!1!=!!this._spec.visible&&(this.initRelatedInfo(),this.initData(),this.initEvent())}initRelatedInfo(){var t,e,i,n,s,r,a,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===(s=null===(n=(i=this._regions[0]).getSpec)||void 0===n?void 0:n.call(i))||void 0===s?void 0:s.longitudeField,this._latitudeField=null===(o=null===(a=(r=this._regions[0]).getSpec)||void 0===a?void 0:a.call(r))||void 0===o?void 0:o.latitudeField)}initData(){const t=this._series;if(!t)return;const i=t.getViewData();if(i){const t=new Ge(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 n=null===(i=this._data)||void 0===i?void 0:i.getLatestData()[e];this._activeDatum.includes(n)?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 e=[],i=[];this._markerComponents||(this._markerComponents=null===(t=this._data)||void 0===t?void 0:t.getLatestData().map(((t,e)=>{var i;const n=new yb({position:void 0,animation:!1});return n&&(n.name=`${this.name}_marker_${e}`,n.id=null!==(i=this._spec.id)&&void 0!==i?i:`${this.name}_marker_${this.id}`,n.setAttribute("zIndex",this.layoutZIndex)),n})));this._markerComponents.forEach(((t,n)=>{const{pairInfo:s,contentMarks:r}=this._evaluateMarker(this._data.getLatestData()[n],n);s&&e.push(s),r&&i.push(r)}));const n=this._layoutLabels(e);this._layoutMarkers(n,i),this._renderMarkers()}_evaluateMarker(t,i){var n,s,r,a,o,l,c,u,d,p,g,f,m,y;let b=0,v=0,x=0,_=0,A=0;const S=this._spec.position||"top",T=this._spec.offset,w=e.normalizeLayoutPaddingSpec(null===(n=this._spec.background)||void 0===n?void 0:n.padding),M=this._spec.space||0;v+=((null==w?void 0:w.left)||0)+((null==w?void 0:w.right)||0),x+=((null==w?void 0:w.top)||0)+((null==w?void 0:w.bottom)||0);const B={},C=this.dataToPosition(t),k=Uh.group({});if(k.name=`${this.name}_marker_itemContainer_${i}`,B.container=k,null===(s=this._spec.background)||void 0===s?void 0:s.visible){const t=Uh.rect(e.transformToGraphic(Object.assign({},this._spec.background.style)));t.setAttributes(C),B.labelBackground=t,k.appendChild(t)}if(null===(r=this._spec.icon)||void 0===r?void 0:r.visible){const t=Uh.symbol(e.transformToGraphic(Object.assign({},this._spec.icon.style)));t.setAttributes(C),t.setAttribute("symbolType",null!==(o=null===(a=this._spec.icon.style)||void 0===a?void 0:a.symbolType)&&void 0!==o?o:null===(l=this._spec.icon.style)||void 0===l?void 0:l.shape);const i=t.AABBBounds,n=null!==(c=(null==i?void 0:i.y2)-(null==i?void 0:i.y1))&&void 0!==c?c:0,s=null!==(u=(null==i?void 0:i.x2)-(null==i?void 0:i.x1))&&void 0!==u?u:0;B.icon=t,k.appendChild(t),A=n,_+=s,b++}if(null===(d=this._spec.nameLabel)||void 0===d?void 0:d.visible){const i=Uh.text(e.transformToGraphic(Object.assign({},this._spec.nameLabel.style)));i.setAttributes(C),i.setAttribute("text",t[this.nameField]);const n=i.AABBBounds,s=null!==(p=(null==n?void 0:n.y2)-(null==n?void 0:n.y1))&&void 0!==p?p:0,r=null!==(g=(null==n?void 0:n.x2)-(null==n?void 0:n.x1))&&void 0!==g?g:0;B.nameLabel=i,k.appendChild(i),A=Math.max(A,s),_+=r,b++}if((null===(f=this._spec.valueLabel)||void 0===f?void 0:f.visible)&&h(t[this.valueField])){const i=Uh.text(e.transformToGraphic(Object.assign({},this._spec.valueLabel.style)));i.setAttributes(C),i.setAttribute("text",t[this.valueField]);const n=i.AABBBounds,s=null!==(m=(null==n?void 0:n.y2)-(null==n?void 0:n.y1))&&void 0!==m?m:0,r=null!==(y=(null==n?void 0:n.x2)-(null==n?void 0:n.x1))&&void 0!==y?y:0;B.valueLabel=i,k.appendChild(i),A=Math.max(A,s),_+=r,b++}const P=Object.values(B).find((t=>!!t&&"group"!==t.type)),O={x:null==P?void 0:P.getComputedAttribute("x"),y:null==P?void 0:P.getComputedAttribute("y")},R={x:O.x,y:O.y,width:0,height:0};R.width=v+_+(b-1)*M,R.height=x+A;const L={rect:R,point:O,index:i};if("outer"!==S){const t=["top","right","left","bottom"].filter((t=>t!==S));L.rect=Vb(R,S,T),L.anchors=t,L.offset=T}else L.pointCoord={x:+(null==t?void 0:t[this._longitudeField]),y:+(null==t?void 0:t[this._latitudeField])};return{pairInfo:L,contentMarks:B}}_layoutMarkers(t,i){var n,s,r;for(let a=0;a<i.length;a++){if(!t[a]||!i[a])return;const{icon:o,nameLabel:l,valueLabel:h,labelBackground:c,container:u}=i[a],d=t[a],p=e.normalizeLayoutPaddingSpec(null===(n=this._spec.background)||void 0===n?void 0:n.padding),g=this._spec.space||0,f=d.height/2;let m=(null==p?void 0:p.left)||0;[o,l,h].forEach(((t,e)=>{var i,n;if(t){const s=t.AABBBounds;let r=0;"symbol"===t.type&&(r+=(null!==(i=s.x2-s.x1)&&void 0!==i?i:0)/2),t.setAttributes({x:m+r,y:f}),m+=null!==(n=s.x2-s.x1)&&void 0!==n?n:0,2!==e&&(m+=g)}})),null==c||c.setAttributes({x:0,y:0,width:d.width,height:d.height}),null==u||u.setAttributes({dx:-d.width/2,dy:-d.height/2});const y=this._data.getLatestData()[a],b=this.dataToPosition(y),v=this.getRegions()[0].getLayoutStartPoint(),x=!(!(null===(s=this._spec.leader)||void 0===s?void 0:s.visible)||!(o||l||h));this._markerComponents[a].setAttributes({x:v.x,y:v.y,position:b,visible:this._activeDatum.includes(y),itemContent:{refX:0,type:"custom",renderCustomCallback:()=>u,autoRotate:!1,offsetX:d.x+d.width/2-b.x,offsetY:d.y+d.height/2-b.y},itemLine:{visible:x,type:"type-po",lineStyle:e.transformToGraphic(Object.assign({},null===(r=this._spec.leader)||void 0===r?void 0:r.style)),startSymbol:{visible:!1}}})}}_renderMarkers(){if(this._markerComponents&&this._markerComponents.length)for(let t=0;t<this._markerComponents.length;t++)this.getContainer().add(this._markerComponents[t])}_layoutLabels(t){return"outer"===this._spec.position&&this._map?Nb(t,this._map,(t=>this._series.dataToPosition({[this._longitudeField]:t[0],[this._latitudeField]:t[1]}))):Ub(t)}_isRelativeModel(t){var e,i,n;const s=null!==(i=null===(e=this._series.getXAxisHelper())||void 0===e?void 0:e.getAxisId())&&void 0!==i?i:null===(n=this._series.getCoordinateHelper())||void 0===n?void 0:n.getCoordinateId();return(null==t?void 0:t.id)===s}_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}}Yb.type="mapLabel",Yb.specKey="mapLabel",Yb.transformerConstructor=$b;t.BAR_LINK=Bb,t.Bar3dChart=af,t.Bar3dChartSpecTransformer=yi,t.Bar3dSeries=ef,t.Bar3dSeriesSpecTransformer=id,t.BarLinkComponent=Cb,t.ConversionFunnelChart=ni,t.ConversionFunnelSeries=si,t.DefaultBandWidth=6,t.Funnel3dChart=pf,t.Funnel3dSeries=uf,t.Funnel3dSeriesSpecTransformer=lf,t.Histogram3dChart=gf,t.ImageCloudChart=Hy,t.MapLabelComponent=Yb,t.PictogramChart=Wm,t.PictogramChartSpecTransformer=xm,t.PictogramSeries=Um,t.Pie3dChart=_f,t.Pie3dChartSpecTransformer=ff,t.Pie3dSeries=vf,t.Pie3dSeriesSpecTransformer=bf,t.RangeColumn3dChart=fm,t.RangeColumn3dChartSpecTransformer=gm,t.RangeColumn3dSeries=um,t.RangeColumn3dSeriesSpecTransformer=pm,t.RankingBar=me,t.RankingList=Te,t.SERIES_BREAK=bb,t.SequenceScatterKDE=di,t.SequenceScatterLink=oi,t.SequenceScatterPixel=mi,t.SeriesBreakComponent=_b,t.SeriesLabelComponent=Db,t.WordCloud3dChart=em,t.WordCloud3dChartSpecTransformer=tm,t.WordCloud3dSeries=Zf,t.appendBarLinkConfig=function(t,e){t.customMark=j(t.customMark).filter((t=>t.componentType!==Bb)),t.customMark.push(Pb(e))},t.appendSeriesBreakConfig=t=>{var e;if(null===(e=t.axes)||void 0===e?void 0:e.length){const e=t.axes.filter((t=>t.breaks&&t.breaks.length&&!1!==t.visible));if(e.length)return t.customMark=j(t.customMark).filter((t=>t.componentType!==bb)),t.customMark.push(Sb(e,e.map((e=>t.axes.indexOf(e))))),!0}return!1},t.appendSeriesLabelConfig=function(t,e){var i,n,s;if(t.customMark=j(t.customMark).filter((t=>t.componentType!==Ob)),e||(e=null!==(s=null!==(i=M(t,Ob))&&void 0!==i?i:M(null===(n=t.series)||void 0===n?void 0:n[0],Ob))&&void 0!==s?s:{}),e.visible){const{position:i="end"}=e,n=Ve(e,["position"]);t.customMark.push(Eb(i,n))}},t.clearSVGSource=function(){_m.clear(),Am=null},t.getBarLinkConfig=Pb,t.getSVGSource=wm,t.getSeriesBreakConfig=Sb,t.getSeriesLabelConfig=Eb,t.register3DPlugin=td,t.registerAxis3dPlugin=()=>{td(),rf(),e.Factory.registerComponent(e.CartesianBandAxis.type,rm,!1),e.Factory.registerComponent(e.CartesianLinearAxis.type,am,!1),e.Factory.registerComponent(e.CartesianTimeAxis.type,hm,!1),e.Factory.registerComponent(e.CartesianSymlogAxis.type,lm,!1),e.Factory.registerComponent(e.CartesianLogAxis.type,om,!1)},t.registerBar3dChart=()=>{td(),rf(),nf(),e.Factory.registerChart(af.type,af)},t.registerBar3dSeries=nf,t.registerBarLink=()=>{e.Factory.registerGraphicComponent(Bb,(t=>new Cb(t)))},t.registerConversionFunnelChart=t=>{e.registerMarkFilterTransform();const i=(null==t?void 0:t.VChart)||e.VChart;i&&(i.useChart([ni]),i.useSeries([si]))},t.registerFunnel3dChart=()=>{e.registerMarkTooltipProcessor(),td(),rf(),df(),e.Factory.registerChart(pf.type,pf)},t.registerFunnel3dSeries=df,t.registerHistogram3dChart=()=>{e.registerGroupTooltipProcessor(),e.registerDimensionTooltipProcessor(),e.registerMarkTooltipProcessor(),e.registerDimensionEvents(),e.registerDimensionHover(),td(),rf(),nf(),e.Factory.registerChart(gf.type,gf)},t.registerImageCloudChart=()=>{Vy(),e.Factory.registerChart(Hy.type,Hy)},t.registerMapLabel=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useComponent([Yb])},t.registerPictogramChart=()=>{e.registerMarkTooltipProcessor(),Nm(),e.Factory.registerChart(Wm.type,Wm)},t.registerPictogramSeries=Nm,t.registerPie3dChart=()=>{e.registerMarkTooltipProcessor(),td(),rf(),xf(),e.Factory.registerChart(_f.type,_f)},t.registerPie3dSeries=xf,t.registerRangeColumn3dChart=()=>{e.registerDimensionTooltipProcessor(),e.registerMarkTooltipProcessor(),e.registerDimensionEvents(),e.registerDimensionHover(),td(),rf(),dm(),e.Factory.registerChart(fm.type,fm)},t.registerRangeColumn3dSeries=dm,t.registerRankingBarChart=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([me])},t.registerRankingList=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([Te,e.BarChart])},t.registerSVGSource=Sm,t.registerSequenceScatterKDE=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([di,e.ScatterChart])},t.registerSequenceScatterLink=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([oi,e.ScatterChart])},t.registerSequenceScatterPixel=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([mi,e.ScatterChart])},t.registerSeriesBreak=()=>{e.Factory.registerGraphicComponent("seriesBreak",(t=>new _b(t)))},t.registerSeriesLabel=()=>{e.Factory.registerGraphicComponent("seriesLabel",(t=>new Db(t)))},t.registerWordCloud3dChart=im,t.registerWordCloud3dSeries=Jf,t.registerWordCloudShape3dChart=()=>{td(),Qf(),im()},t.registerWordCloudShape3dSeries=Qf,t.svgSourceMap=_m,t.unregisterSVGSource=Tm}));