ag-charts-enterprise
Version:
Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue
1 lines • 432 kB
JavaScript
var Pu=Object.defineProperty,Lu=Object.getOwnPropertyDescriptor,h=(e,t,i,s)=>{for(var o=s>1?void 0:s?Lu(t,i):t,a=e.length-1,r;a>=0;a--)(r=e[a])&&(o=(s?r(t,i,o):r(o))||o);return s&&o&&Pu(t,i,o),o};import{_ModuleSupport as Ru}from"ag-charts-community";import{_ModuleSupport as Ou}from"ag-charts-community";import"ag-charts-core";import{_ModuleSupport as Cu}from"ag-charts-community";import{isNumberEqual as qn}from"ag-charts-core";function Aa(e,t,i){const s=(a,r,n,l)=>{let c=e[0];for(let p=a;n>0?p<=r:p>r;p+=n){const d=e[p];if(l(c,d))return!0;c=d}return!1},o=Math.floor(e.length/2);return s(t,o,t,i)?!0:s(e.length-t,o,-t,i)}import{_ModuleSupport as Tu}from"ag-charts-community";var{AxisInterval:wu,Property:_u}=Tu,Na=class extends wu{};h([_u],Na.prototype,"minSpacing",2);import{_ModuleSupport as Bs}from"ag-charts-community";import{countFractionDigits as Fu,isNumberEqual as Ri}from"ag-charts-core";import{_ModuleSupport as Un}from"ag-charts-community";import{isNumberEqual as jn}from"ag-charts-core";import{_ModuleSupport as Eu}from"ag-charts-community";import{createId as Bu}from"ag-charts-core";var{BaseProperties:Jn,ChartAxisDirection:Gu,Property:Ae,Group:Pa,FONT_SIZE:Wu}=Eu,Mt=class extends Jn{constructor(){super(...arguments),this.fontSize=Wu.LARGE,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}};h([Ae],Mt.prototype,"enabled",2),h([Ae],Mt.prototype,"text",2),h([Ae],Mt.prototype,"fontStyle",2),h([Ae],Mt.prototype,"fontWeight",2),h([Ae],Mt.prototype,"fontSize",2),h([Ae],Mt.prototype,"fontFamily",2),h([Ae],Mt.prototype,"padding",2),h([Ae],Mt.prototype,"color",2),h([Ae],Mt.prototype,"parallel",2);var Ze=class extends Jn{constructor(){super(...arguments),this.id=Bu(this),this.defaultColorRange=[],this.shape="polygon",this.label=new Mt,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction=Gu.Angle,this.axisInnerRadius=0,this.axisOuterRadius=0,this.lineGroup=new Pa({name:this.id}),this.rangeGroup=new Pa({name:this.id}),this.labelGroup=new Pa({name:this.id}),this._isRange=void 0}assignCrossLineGroup(e,t){e!==this._isRange&&(e?this.rangeGroup.appendChild(t):this.lineGroup.appendChild(t)),this._isRange=e}setSectorNodeProps(e){e.fill=this.fill,e.fillOpacity=this.fillOpacity??1,e.stroke=this.stroke,e.strokeOpacity=this.strokeOpacity??1,e.strokeWidth=this.strokeWidth??1,e.lineDash=this.lineDash}setLabelNodeProps(e,t,i,s,o){const{label:a}=this;e.x=t,e.y=i,e.text=a.text,e.textAlign="center",e.textBaseline=s,e.rotation=o,e.rotationCenterX=t,e.rotationCenterY=i,e.fill=a.color,e.fontFamily=a.fontFamily,e.fontSize=a.fontSize,e.fontStyle=a.fontStyle,e.visible=!0}};h([Ae],Ze.prototype,"enabled",2),h([Ae],Ze.prototype,"type",2),h([Ae],Ze.prototype,"range",2),h([Ae],Ze.prototype,"value",2),h([Ae],Ze.prototype,"defaultColorRange",2),h([Ae],Ze.prototype,"fill",2),h([Ae],Ze.prototype,"fillOpacity",2),h([Ae],Ze.prototype,"stroke",2),h([Ae],Ze.prototype,"strokeWidth",2),h([Ae],Ze.prototype,"strokeOpacity",2),h([Ae],Ze.prototype,"lineDash",2),h([Ae],Ze.prototype,"shape",2),h([Ae],Ze.prototype,"label",2);var{ChartAxisDirection:Vu,getCrossLineValue:Ku,validateCrossLineValue:zu,normalizeAngle360:La,Group:$u,Path:Zn,Sector:Hu,RotatableText:Xu,ContinuousScale:Yu}=Un,Ra=class extends Ze{constructor(){super(),this.direction=Vu.Angle,this.polygonNode=new Zn,this.sectorNode=new Hu,this.lineNode=new Zn,this.crossLineRange=new $u,this.labelNode=new Xu,this.ticks=[],this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.crossLineRange.append(this.lineNode),this.labelGroup.append(this.labelNode)}visibilityCheck(){if(!Yu.is(this.scale))return!0;const[e,t]=this.scale.domain,i=Ku(this);if(this.type==="range"){const[s,o]=i;return s>=e&&s<=t&&o>=s&&o<=t}else return i>=e&&i<=t}update(e){const{scale:t}=this;if(!t||!zu(this,t)||!this.visibilityCheck()){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updateLineNode(e),this.updatePolygonNode(e),this.updateSectorNode(e),this.updateLabelNode(e)}updateLineNode(e){const{scale:t,type:i,value:s,lineNode:o}=this;if(!e||i!=="line"||!t){o.visible=!1;return}const a=t.convert(s);if(isNaN(a)){o.visible=!1;return}const{axisInnerRadius:r,axisOuterRadius:n}=this;o.visible=!0,o.stroke=this.stroke,o.strokeOpacity=this.strokeOpacity??1,o.strokeWidth=this.strokeWidth??1,o.fill=void 0,o.lineDash=this.lineDash;const l=n*Math.cos(a),c=n*Math.sin(a),p=r*Math.cos(a),d=r*Math.sin(a);o.path.clear(!0),o.path.moveTo(p,d),o.path.lineTo(l,c),this.assignCrossLineGroup(!1,this.crossLineRange)}updatePolygonNode(e){const{polygonNode:t,range:i,scale:s,shape:o,type:a,ticks:r}=this;if(!e||a!=="range"||o!=="polygon"||!s||!i){t.visible=!1;return}const{axisInnerRadius:n,axisOuterRadius:l}=this,c=r.indexOf(i[0]),p=r.indexOf(i[1]),u=(c<=p?r.slice(c,p+1):r.slice(c).concat(r.slice(0,p+1))).map(y=>s.convert(y));t.visible=!0,this.setSectorNodeProps(t);const{path:f}=t;f.clear(!0),u.forEach((y,g)=>{const m=l*Math.cos(y),S=l*Math.sin(y);g===0?f.moveTo(m,S):f.lineTo(m,S)}),n===0?f.lineTo(0,0):u.slice().reverse().forEach(y=>{const g=n*Math.cos(y),m=n*Math.sin(y);f.lineTo(g,m)}),t.path.closePath(),this.assignCrossLineGroup(!0,this.crossLineRange)}updateSectorNode(e){const{sectorNode:t,range:i,scale:s,shape:o,type:a}=this;if(!e||a!=="range"||o!=="circle"||!s||!i){t.visible=!1;return}const{axisInnerRadius:r,axisOuterRadius:n}=this,l=i.map(d=>s.convert(d)),c=s.step??0,p=s instanceof Un.BandScale?c/2:0;t.visible=!0,this.setSectorNodeProps(t),t.centerX=0,t.centerY=0,t.innerRadius=r,t.outerRadius=n,t.startAngle=l[0]-p,t.endAngle=l[1]+p,this.assignCrossLineGroup(!0,this.crossLineRange)}updateLabelNode(e){const{label:t,labelNode:i,range:s,scale:o,type:a,ticks:r}=this;if(!e||t.enabled===!1||!t.text||!o||a==="range"&&!s){i.visible=!1;return}i.visible=!0;const{axisInnerRadius:n,axisOuterRadius:l}=this;let c,p,d,u;if(a==="line"){const f=La(o.convert(this.value)),y=1.5*Math.PI,g=jn(f,y)||f>y||f<Math.PI/2,m=(n+l)/2*Math.cos(f),S=(n+l)/2*Math.sin(f);c=m+t.padding*Math.cos(f+Math.PI/2),p=S+t.padding*Math.sin(f+Math.PI/2),u=g?"top":"bottom",d=g?f:f-Math.PI}else{const[f,y]=s.map(x=>La(o.convert(x)));let g=(f+y)/2;f>y&&(g-=Math.PI),g=La(g);const m=(jn(g,0)||g>0)&&g<Math.PI;let S;this.shape==="circle"||r.length<3?S=l-t.padding:S=l*Math.cos(Math.PI/r.length)-t.padding,c=S*Math.cos(g),p=S*Math.sin(g),u=m?"bottom":"top",d=m?g-Math.PI/2:g+Math.PI/2}this.setLabelNodeProps(i,c,p,u,d)}};Ra.className="AngleCrossLine";var{ChartAxisDirection:qu,TextWrapper:Uu,TextUtils:ju,Property:Oa,toRadians:is,normalizeAngle360:Ut,normalizeAngle360Inclusive:Ju,Path:Zu,RotatableText:Qu,Transformable:ef,BBox:tf,Selection:Qn,Line:el}=Bs,Ca=class extends Bs.AxisLabel{constructor(){super(...arguments),this.orientation="fixed"}};h([Oa],Ca.prototype,"orientation",2);var ss=class extends Bs.PolarAxis{constructor(e,t){super(e,t),this.startAngle=0,this.endAngle=void 0,this.tickLineGroupSelection=Qn.select(this.tickLineGroup,el,!1),this.gridLineGroupSelection=Qn.select(this.gridLineGroup,el,!1),this.labelData=[],this.tickData=[],this.radiusLineGroup=this.axisGroup.appendChild(new Bs.TransformableGroup),this.radiusLine=this.radiusLineGroup.appendChild(new Zu),this.includeInvisibleDomains=!0}get direction(){return qu.Angle}createLabel(){return new Ca}calculateRotations(){const e=is(this.startAngle),t=Ut(e),i=Ut(e-Math.PI/2);return{rotation:e,parallelFlipRotation:t,regularFlipRotation:i}}calculateTickLayout(e){const{nice:t,scale:i}=this,s={nice:t,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0},o=t?i.niceDomain(s,e):e,a=this.generateAngleTicks(o);this.tickData=a;const r=a.map(l=>l.value),n=r.reduce((l,c)=>Math.max(typeof c=="number"?Fu(c):0,l),0);return{niceDomain:o,tickDomain:o,ticks:r,rawTickCount:void 0,fractionDigits:n,timeInterval:void 0,bbox:this.getBBox()}}update(){super.update(),this.updateRadiusLine(),this.updateGridLines(),this.updateTickLines()}normalizedAngles(){const e=Ut(-Math.PI/2+is(this.startAngle)),t=this.endAngle!=null?Ju(is(this.endAngle)-is(this.startAngle)):2*Math.PI,i=e+t;return[e,i]}computeRange(){this.range=this.normalizedAngles()}updateSelections(){const e=this.tickData;this.gridLineGroupSelection.update(this.gridLength&&this.gridLine.enabled?e:[]),this.tickLineGroupSelection.update(this.tick.enabled?e:[]),this.tickLabelGroupSelection.update(this.label.enabled?e:[]),this.gridLineGroupSelection.cleanup(),this.tickLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup()}updatePosition(){super.updatePosition();const{translation:e,radiusLineGroup:t}=this,i=Math.floor(e.x),s=Math.floor(e.y);t.translationX=i,t.translationY=s}updateRadiusLine(){const e=this.radiusLine,{path:t}=e;t.clear(!0);const{points:i,closePath:s}=this.getAxisLinePoints();i.forEach(({x:o,y:a,moveTo:r,arc:n,radius:l=0,startAngle:c=0,endAngle:p=0})=>{n?t.arc(o,a,l,c,p):r?t.moveTo(o,a):t.lineTo(o,a)}),s&&t.closePath(),e.visible=this.line.enabled,e.stroke=this.line.stroke,e.strokeWidth=this.line.width,e.fill=void 0}getAxisLinePoints(){const{scale:e,shape:t,gridLength:i}=this,[s,o]=this.range,a=Ri(o-s,2*Math.PI),r=[];if(t==="circle")a?r.push({x:i,y:0,moveTo:!0},{x:0,y:0,radius:i,startAngle:0,endAngle:2*Math.PI,arc:!0,moveTo:!1}):r.push({x:i*Math.cos(s),y:i*Math.sin(s),moveTo:!0},{x:0,y:0,radius:i,startAngle:Ut(s),endAngle:Ut(o),arc:!0,moveTo:!1});else if(t==="polygon"){const n=e.ticks({nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(l=>e.convert(l));n&&n.length>2&&n.forEach((l,c)=>{const p=i*Math.cos(l),d=i*Math.sin(l),u=c===0;r.push({x:p,y:d,moveTo:u})})}return{points:r,closePath:a}}updateGridLines(){const{scale:e,gridLength:t,gridLine:{style:i,width:s},innerRadiusRatio:o}=this;if(!(i&&t>0))return;const a=t*o,r=i.length;this.gridLineGroupSelection.each((n,l,c)=>{const{value:p}=l,{stroke:d,lineDash:u}=i[c%r],f=e.convert(p);n.x1=a*Math.cos(f),n.y1=a*Math.sin(f),n.x2=t*Math.cos(f),n.y2=t*Math.sin(f),n.stroke=d,n.strokeWidth=s,n.lineDash=u,n.fill=void 0}),this.gridLineGroupSelection.cleanup()}updateLabels(){const{label:e,tickLabelGroupSelection:t}=this;t.each((i,s,o)=>{const a=this.labelData[o];if(!a||a.hidden){i.visible=!1;return}i.text=a.text,i.setFont(e),i.fill=e.color,i.x=a.x,i.y=a.y,i.textAlign=a.textAlign,i.textBaseline=a.textBaseline,i.visible=!0,a.rotation?(i.rotation=a.rotation,i.rotationCenterX=a.x,i.rotationCenterY=a.y):i.rotation=0})}updateTickLines(){const{scale:e,gridLength:t,tick:i,tickLineGroupSelection:s}=this;s.each((o,a)=>{const{value:r}=a,n=e.convert(r),l=Math.cos(n),c=Math.sin(n);o.x1=t*l,o.y1=t*c,o.x2=(t+i.size)*l,o.y2=(t+i.size)*c,o.stroke=i.stroke,o.strokeWidth=i.width})}createLabelNodeData(e,t,i){const{label:s,gridLength:o,scale:a,tick:r}=this;if(!s.enabled)return[];const n=new Qu,l=i.x-this.translation.x,c=i.x+i.width-this.translation.x,{fractionDigits:p}=this.layout.label,d=this.tickFormatter(this.scale.domain,this.tickData,!1,p),u=e.map((f,y)=>{const{value:g}=f,m=o+s.spacing+r.size,S=a.convert(g),x=Math.cos(S),b=Math.sin(S),v=m*x,k=m*b,{textAlign:L,textBaseline:A}=this.getLabelAlign(S),D=y===e.length-1&&g!==e[0]&&Ri(Ut(S),Ut(a.convert(e[0]))),I=this.getLabelRotation(S);let M=d(g,y);n.text=M,n.x=v,n.y=k,n.setFont(s),n.textAlign=L,n.textBaseline=A,n.rotation=I,I&&(n.rotationCenterX=v,n.rotationCenterY=k);let P=I?ef.toCanvas(n):n.getBBox();if(P&&t.hideWhenNecessary&&!I){const R=l-P.x,w=P.x+P.width-c,N=1;if(R>N||w>N){const C=P.width-Math.max(R,w);M=Uu.wrapText(M,{maxWidth:C,font:s,textWrap:"never"}),M===ju.EllipsisChar&&(M=""),n.text=M,P=n.getBBox()}}return{text:M,x:v,y:k,textAlign:L,textBaseline:A,hidden:M===""||f.hidden||D,rotation:I,box:P}});return s.avoidCollisions&&this.avoidLabelCollisions(u),u}computeLabelsBBox(e,t){this.labelData=this.createLabelNodeData(this.tickData,e,t);const i=this.labelData.map(({box:s})=>s).filter(s=>s!=null);return!this.label.enabled||i.length===0?null:tf.merge(i)}getLabelOrientation(){const{label:e}=this;return e instanceof Ca?e.orientation:"fixed"}getLabelRotation(e){let t=is(this.label.rotation??0);e=Ut(e);const i=this.getLabelOrientation();return i==="parallel"?(t+=e,e>=0&&e<Math.PI?t-=Math.PI/2:t+=Math.PI/2):i==="perpendicular"&&(t+=e,e>=Math.PI/2&&e<1.5*Math.PI&&(t+=Math.PI)),t}getLabelAlign(e){const t=Math.cos(e),i=Math.sin(e);let s,o;const a=this.getLabelOrientation(),r=Ri(t,0),n=Ri(i,0),l=Ri(t,1),c=Ri(i,-1),p=t>0&&!r,d=i>0&&!n;return a==="parallel"?(s="center",o=l&&n||d?"top":"bottom"):a==="perpendicular"?(s=c||p?"left":"right",o="middle"):(s="right",r?s="center":p&&(s="left"),o="bottom",n?o="middle":d&&(o="top")),{textAlign:s,textBaseline:o}}updateCrossLines(){const{shape:e,gridLength:t,innerRadiusRatio:i}=this;this.crossLines.forEach(s=>{s instanceof Ra&&(s.ticks=this.tickData.map(o=>o.value),s.shape=e,s.axisOuterRadius=t,s.axisInnerRadius=t*i)}),super.updateCrossLines()}};ss.CrossLineConstructor=Ra,h([Oa],ss.prototype,"startAngle",2),h([Oa],ss.prototype,"endAngle",2);var{Property:Ta,CategoryScale:sf}=Cu,ni=class extends ss{constructor(e){super(e,new sf),this.groupPaddingInner=0,this.paddingInner=0,this.interval=new Na}generateAngleTicks(e){const{scale:t,gridLength:i}=this,{values:s,minSpacing:o}=this.interval,a={nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0},r=s??t.ticks(a,e)?.ticks??[];if(r.length<2||o==null)return r.map(d=>({value:d,visible:!0}));const n=r[0],l=t.convert(n),c=i*Math.cos(l),p=i*Math.sin(l);for(let d=1;d<r.length-1;d++){const u=r[d],f=t.convert(u);if(f-l>Math.PI)break;const y=i*Math.cos(f),g=i*Math.sin(f);if(Math.sqrt((y-c)**2+(g-p)**2)>o){const S=new Set([n]);return Aa(r,d,(x,b)=>{S.add(b)}),r.map(x=>{const b=S.has(x);return{value:x,visible:b}})}}return[{value:n,visible:!0}]}avoidLabelCollisions(e){const{minSpacing:t}=this.label;if(e.length<3)return;const i=(l,c)=>{if(l.hidden||c.hidden)return!1;if(t==null)return l.box.collidesBBox(c.box);const p=l.box.clone().grow(t/2),d=c.box.clone().grow(t/2);return p.collidesBBox(d)},s=e[0],o=e.at(-1),a=new Set([s]),r=qn(s.x,o.x)&&qn(s.y,o.y),n=Math.floor(e.length/2);for(let l=1;l<=n;l++){const c=r?e.slice(0,-1):e;if(!Aa(c,l,i)){Aa(c,l,(d,u)=>{a.add(u)});break}}e.forEach(l=>{a.has(l)||(l.hidden=!0,l.box=void 0)})}tickFormatParams(){return{type:"category"}}datumFormatParams(e,t){const{datum:i,seriesId:s,legendItemName:o,key:a,source:r,property:n,domain:l,boundSeries:c}=t;return{type:"category",value:e,datum:i,seriesId:s,legendItemName:o,key:a,source:r,property:n,domain:l,boundSeries:c}}};ni.className="AngleCategoryAxis",ni.type="angle-category",h([Ta],ni.prototype,"groupPaddingInner",2),h([Ta],ni.prototype,"paddingInner",2),h([Ta],ni.prototype,"interval",2);import{_ModuleSupport as of}from"ag-charts-community";import{isNumberEqual as tl}from"ag-charts-core";import{_ModuleSupport as af}from"ag-charts-community";import{isNumberEqual as rf}from"ag-charts-core";var{range:il,isDenseInterval:nf,LinearScale:wa}=af,sl=class Yn extends wa{constructor(){super(...arguments),this.arcLength=0}static getNiceStepAndTickCount(t,i){const[s,o]=i;let a=wa.getTickStep(s,o,t);const r=isNaN(t.maxTickCount)?1/0:t.maxTickCount,n=Math.abs(o-s)/a;let l=Math.pow(2,Math.ceil(Math.log(n)/Math.log(2)));return l>r&&(l/=2,a*=2),{count:l,step:a}}ticks(t,i=this.domain){const{arcLength:s}=this;if(!i||i.length<2||i.some(c=>!isFinite(c))||s<=0)return{ticks:[],count:0};const{nice:o,interval:a}=t,[r,n]=i;if(a){const c=Math.abs(a),p=this.getPixelRange();if(!nf((n-r)/c,p))return il(r,n,c)}let l;if(o&&this.hasNiceRange()){const c=super.niceDomain(t,i);l=Yn.getNiceStepAndTickCount(t,c).step}else l=wa.getTickStep(r,n,t);return il(r,n,l)}hasNiceRange(){const t=this.range.slice().sort((s,o)=>s-o);return[Math.PI,2*Math.PI].some(s=>rf(s,t[1]-t[0]))}niceDomain(t,i=this.domain){const s=super.niceDomain(t,i);if(!this.hasNiceRange())return s;const o=s[0]>s[1],a=o?s[1]:s[0],{step:r,count:n}=Yn.getNiceStepAndTickCount(t,s),l=1/r,c=r>=1?Math.ceil(a/r+n)*r:Math.ceil((a+n*r)*l)/l;return o?[c,a]:[a,c]}getPixelRange(){return this.arcLength}},{Property:_a,angleBetween:lf,normalisedExtentWithMetadata:cf,findMinMax:pf}=of,Oi=class extends ss{constructor(e){super(e,new sl),this.shape="circle",this.interval=new Na}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:s,clipped:o}=cf(e,t,i);return{domain:s,clipped:o}}updateScale(){super.updateScale(),this.scale.arcLength=this.getRangeArcLength()}getRangeArcLength(){const{range:e}=this,t=Math.min(...e),i=Math.max(...e),s=lf(t,i)||2*Math.PI,o=this.gridLength;return s*o}generateAngleTicks(e){const{scale:t,range:i,nice:s}=this,{values:o,step:a,minSpacing:r,maxSpacing:n}=this.interval;let l;if(o==null){const{arcLength:c}=t,p=n?Math.floor(c/n):1,d=r?Math.floor(c/r):1/0,u=Math.floor(4/Math.PI*Math.abs(i[0]-i[1])),f=Math.max(p,Math.min(d,u)),y={nice:s,interval:a,tickCount:f,minTickCount:p,maxTickCount:d};l=t.ticks(y,e)?.ticks??[]}else{const[c,p]=pf(e.map(Number));l=o.filter(d=>d>=c&&d<=p).sort((d,u)=>d-u)}return l.map(c=>({value:c,visible:!0}))}avoidLabelCollisions(e){const{minSpacing:t}=this.label,i=(a,r)=>{if(a.hidden||r.hidden)return!1;if(t==null)return a.box.collidesBBox(r.box);const n=a.box.clone().grow(t/2),l=r.box.clone().grow(t/2);return n.collidesBBox(l)},s=e[0],o=e.at(-1);s!==o&&tl(s.x,o.x)&&tl(s.y,o.y)&&(o.hidden=!0);for(let a=1;a<e.length;a*=2){let r=!1;for(let n=a;n<e.length;n+=a){const l=e[n],c=e[n-a];if(i(c,l)){r=!0;break}}if(!r){e.forEach((n,l)=>{l%a>0&&(n.hidden=!0,n.box=void 0)});return}}e.forEach((a,r)=>{r>0&&(a.hidden=!0,a.box=void 0)})}tickFormatParams(e,t,i){return{type:"number",fractionDigits:i}}datumFormatParams(e,t,i){const{datum:s,seriesId:o,legendItemName:a,key:r,source:n,property:l,domain:c,boundSeries:p}=t;return{type:"number",value:e,datum:s,seriesId:o,legendItemName:a,key:r,source:n,property:l,domain:c,boundSeries:p,fractionDigits:i}}};Oi.className="AngleNumberAxis",Oi.type="angle-number",h([_a],Oi.prototype,"min",2),h([_a],Oi.prototype,"max",2),h([_a],Oi.prototype,"interval",2);import{_ModuleSupport as ol}from"ag-charts-community";var{OrdinalTimeScale:hf,Property:df,TimeAxisParentLevel:uf,lowestGranularityUnitForTicks:ff,lowestGranularityUnitForValue:gf,minimumTimeAxisDatumGranularity:yf,dateTruncationForDomain:mf,intervalUnit:al,intervalStep:rl,intervalEpoch:nl,intervalMilliseconds:ll}=ol,Gs=class extends ol.CategoryAxis{constructor(e){super(e,new hf),this.parentLevel=new uf,this.minGranularity=void 0}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}updateScale(){super.updateScale();const{boundSeries:e,direction:t}=this;this.minGranularity=yf(e,t,void 0,void 0)}tickFormatParams(e,t,i,s){s??(s=ff(t));const o=mf(e),a=al(s),r=rl(s),n=nl(s);return{type:"date",unit:a,step:r,epoch:n,truncateDate:o}}datumFormatParams(e,t,i,s,o){if(typeof e=="number"&&(e=new Date(e)),s==null){const{minGranularity:m}=this,S=gf(e);m!=null&&ll(m)<ll(S)?s=m:s=S}const{datum:a,seriesId:r,legendItemName:n,key:l,source:c,property:p,domain:d,boundSeries:u}=t,f=al(s),y=rl(s),g=nl(s);return{type:"date",value:e,datum:a,seriesId:r,legendItemName:n,key:l,source:c,property:p,domain:d,boundSeries:u,unit:f,step:y,epoch:g,style:o}}};Gs.className="OrdinalTimeAxis",Gs.type="ordinal-time",h([df],Gs.prototype,"parentLevel",2);import{_ModuleSupport as Sf}from"ag-charts-community";import{_ModuleSupport as Ws}from"ag-charts-community";import{isNumberEqual as xf}from"ag-charts-core";import{_ModuleSupport as cl}from"ag-charts-community";import{clamp as pl,isNumberEqual as bf}from"ag-charts-core";var{ChartAxisDirection:Df,Property:vf,validateCrossLineValue:kf,normalizeAngle360FromDegrees:Mf,Group:If,Path:Af,Sector:Nf,RotatableText:Pf}=cl,hl=class extends Mt{constructor(){super(...arguments),this.positionAngle=void 0}};h([vf],hl.prototype,"positionAngle",2);var Fa=class extends Ze{constructor(){super(),this.direction=Df.Radius,this.label=new hl,this.polygonNode=new Af,this.sectorNode=new Nf,this.crossLineRange=new If,this.labelNode=new Pf,this.outerRadius=0,this.innerRadius=0,this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.labelGroup.append(this.labelNode)}update(e){const{scale:t}=this;if(!t||!kf(this,t)){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.updateRadii();const{innerRadius:i,outerRadius:s}=this;e&&(e=i>=this.axisInnerRadius&&s<=this.axisOuterRadius),this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updatePolygonNode(e),this.updateSectorNode(e),this.updateLabelNode(e),this.assignCrossLineGroup(this.type==="range",this.crossLineRange)}updateRadii(){const{range:e,scale:t,type:i,axisInnerRadius:s,axisOuterRadius:o}=this;if(!t)return{innerRadius:0,outerRadius:0};const a=l=>o+s-l;let r,n;if(i==="line")r=a(t.convert(this.value)),n=r;else{const l=Math.abs(t?.bandwidth??0),c=e.map(p=>t.convert(p));r=a(Math.max(...c)),n=a(Math.min(...c))+l}this.outerRadius=r,this.innerRadius=n}drawPolygon(e,t,i){t.forEach((s,o)=>{const a=e*Math.cos(s),r=e*Math.sin(s);o===0?i.path.moveTo(a,r):i.path.lineTo(a,r)}),i.path.closePath()}updatePolygonNode(e){const{gridAngles:t,polygonNode:i,scale:s,shape:o,type:a,innerRadius:r,outerRadius:n}=this;if(!e||o!=="polygon"||!s||!t){i.visible=!1;return}i.visible=!0;const l=this.getPadding();i.path.clear(!0),this.drawPolygon(n-l,t,i);const c=t.slice().reverse(),p=a==="line"?n-l:r+l;this.drawPolygon(p,c,i),this.setSectorNodeProps(i)}updateSectorNode(e){const{axisInnerRadius:t,axisOuterRadius:i,scale:s,sectorNode:o,shape:a,innerRadius:r,outerRadius:n}=this;if(!e||a!=="circle"||!s){o.visible=!1;return}o.visible=!0,o.startAngle=0,o.endAngle=2*Math.PI;const l=this.getPadding(),c=pl(t,r+l,i),p=pl(t,n-l,i);o.innerRadius=Math.min(c,p),o.outerRadius=Math.max(c,p),this.setSectorNodeProps(o)}updateLabelNode(e){const{innerRadius:t,label:i,labelNode:s,scale:o,shape:a,type:r}=this;if(!e||i.enabled===!1||!i.text||!o){s.visible=!1;return}const n=Mf((i.positionAngle??0)-90),l=(bf(n,0)||n>0)&&n<Math.PI,c=l?n-Math.PI/2:n+Math.PI/2;let p;const d=this.gridAngles??[];r==="line"?p=t+i.padding:a==="circle"||d.length<3?p=t-i.padding:p=t*Math.cos(Math.PI/d.length)-i.padding;const u=p*Math.cos(n),f=p*Math.sin(n);let y;r==="line"?y=l?"top":"bottom":y=l?"bottom":"top",this.setLabelNodeProps(s,u,f,y,c)}getPadding(){const{scale:e}=this;if(!e)return 0;const t=Math.abs(e.bandwidth??0),i=Math.abs(e.step??0);return e instanceof cl.BandScale?(i-t)/2:0}};Fa.className="RadiusCrossLine";var{ChartAxisDirection:Lf,ZIndexMap:Rf,Property:Ea,normalizeAngle360:dl,toRadians:Of,Caption:Cf,Group:Tf,TransformableGroup:ul,Path:wf,Line:fl,Selection:gl,AxisTickGenerator:_f,AxisGroupZIndexMap:Ff}=Ws,Ba=class extends Ws.AxisLabel{constructor(){super(...arguments),this.autoRotateAngle=335}};h([Ea],Ba.prototype,"autoRotate",2),h([Ea],Ba.prototype,"autoRotateAngle",2);var Vs=class extends Ws.PolarAxis{constructor(e,t){super(e,t),this.positionAngle=0,this.gridLineGroupSelection=gl.select(this.gridLineGroup,fl,!1),this.tickGenerator=new _f(this),this.generatedTicks=void 0,this.headingLabelGroup=this.axisGroup.appendChild(new ul({name:`${this.id}-Axis-heading`})),this.lineNodeGroup=this.axisGroup.appendChild(new ul({name:`${this.id}-Axis-line`})),this.lineNode=this.lineNodeGroup.appendChild(new fl({name:`${this.id}-Axis-line`,zIndex:Ff.AxisLine})),this.gridPathGroup=this.gridGroup.appendChild(new Tf({name:`${this.id}-gridPaths`,zIndex:Rf.AXIS_GRID})),this.gridPathSelection=gl.select(this.gridPathGroup,wf),this.headingLabelGroup.appendChild(this.title.caption.node),this.cleanup.register(this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}get direction(){return Lf.Radius}getAxisTransform(){const e=this.scale.range[0],{translation:t,positionAngle:i,innerRadiusRatio:s}=this,o=e*s,a=Of(i);return{translationX:t.x,translationY:t.y-e-o,rotation:a,rotationCenterX:0,rotationCenterY:e+o}}update(){super.update(),this.updateTitle(),this.updateGridLines();const{enabled:e,stroke:t,width:i}=this.line;this.lineNode.setProperties({stroke:t,strokeWidth:e?i:0,x1:0,y1:this.range[0],x2:0,y2:this.range[1]})}updatePosition(){super.updatePosition();const e=this.getAxisTransform();this.tickLineGroup.setProperties(e),this.tickLabelGroup.setProperties(e),this.lineNodeGroup.setProperties(e),this.headingLabelGroup.setProperties(e)}calculateRotations(){return{rotation:0,parallelFlipRotation:0,regularFlipRotation:-Math.PI/2}}calculateTickLayout(e,t,i){const o=-Math.PI/2,a=[0,1],r=this.label.getSideFlag(),n=r*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding),{range:l,reverse:c,defaultTickMinSpacing:p}=this,d=this.tickGenerator.generateTicks({domain:e,range:l,reverse:c,niceMode:t,visibleRange:a,primaryTickCount:void 0,defaultTickMinSpacing:p,parallelFlipRotation:0,regularFlipRotation:o,labelX:n,sideFlag:r,removeOverflowLabels:!1}),{tickData:u}=d,{ticks:f,rawTicks:y,rawTickCount:g,tickDomain:m,fractionDigits:S,niceDomain:x=e}=u,b=f.map(v=>this.getTickLabelProps(v,d));return this.generatedTicks={ticks:f,labels:b},{ticks:y,tickDomain:m,niceDomain:x,rawTickCount:g,fractionDigits:S,timeInterval:void 0}}updateSelections(){const{generatedTicks:e}=this;if(!e)return;const{ticks:t,labels:i}=e;this.gridLineGroupSelection.update(this.gridLength?t:[]),this.tickLabelGroupSelection.update(i),this.gridPathSelection.update(this.gridLine.enabled?this.prepareGridPathTickData(t):[]),this.gridLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup(),this.gridPathSelection.cleanup()}updateLabels(){if(!this.label.enabled)return;const e=Ws.resetAxisLabelSelectionFn();this.tickLabelGroupSelection.each((t,i)=>{t.fill=i.fill,t.fontFamily=i.fontFamily,t.fontSize=i.fontSize,t.fontStyle=i.fontStyle,t.fontWeight=i.fontWeight,t.text=i.text,t.textBaseline=i.textBaseline,t.textAlign=i.textAlign??"center",t.setProperties(e(t,i))})}updateGridLines(){const{gridLine:{style:e,width:t},shape:i,generatedTicks:s}=this;if(!e||!s)return;const o=e.length,a=(u,f)=>{const{stroke:y,lineDash:g}=e[f%o];u.stroke=y,u.strokeWidth=t,u.lineDash=g,u.fill=void 0},[r,n]=this.gridRange??[0,2*Math.PI],l=xf(n-r,2*Math.PI),d=i==="circle"?(u,f)=>{const{path:y}=u;y.clear(!0);const g=this.getTickRadius(f);l?(y.moveTo(g,0),y.arc(0,0,g,0,2*Math.PI)):(y.moveTo(g*Math.cos(r),g*Math.sin(r)),y.arc(0,0,g,dl(r),dl(n))),l&&y.closePath()}:(u,f)=>{const{path:y}=u,g=this.gridAngles;if(y.clear(!0),!g||g.length<3)return;const m=this.getTickRadius(f);g.forEach((S,x)=>{const b=m*Math.cos(S),v=m*Math.sin(S);x===0?y.moveTo(b,v):y.lineTo(b,v),g.forEach((k,L)=>{const A=m*Math.cos(k),D=m*Math.sin(k);L===0?y.moveTo(A,D):y.lineTo(A,D)}),y.closePath()}),y.closePath()};this.gridPathSelection.each((u,f,y)=>{a(u,y),d(u,f)})}updateTitle(){const e=r=>r.defaultValue,{title:t,range:i}=this,{formatter:s=e}=this.title;t.caption.enabled=t.enabled,t.caption.fontFamily=t.fontFamily,t.caption.fontSize=t.fontSize,t.caption.fontStyle=t.fontStyle,t.caption.fontWeight=t.fontWeight,t.caption.color=t.color,t.caption.wrapping=t.wrapping;let o=!1;const a=t.caption.node;t.enabled&&(o=!0,a.rotation=Math.PI/2,a.x=Math.floor((i[0]+i[1])/2),a.y=-Cf.SMALL_PADDING,a.textAlign="center",a.textBaseline="bottom",a.text=this.callWithContext(s,this.getTitleFormatterParams(this.scale.domain))),a.visible=o}updateCrossLines(){this.crossLines.forEach(e=>{if(e instanceof Fa){const{shape:t,gridAngles:i,range:s,innerRadiusRatio:o}=this,a=s[0];e.shape=t,e.gridAngles=i,e.axisOuterRadius=a,e.axisInnerRadius=a*o}}),super.updateCrossLines()}createLabel(){return new Ba}getTickLabelProps(e,t){const{label:i}=this,{rotation:s,textBaseline:o,textAlign:a}=t,r=this.scale.range,n=e.tickLabel??"",c=i.getSideFlag()*(this.getTickSize()+i.spacing+this.seriesAreaPadding),p=n!==""&&n!=null,d=s;return{...this.getLabelStyles({value:e.tickLabel}),tickId:e.tickId,rotation:d,text:n,textAlign:a,textBaseline:o,visible:p,x:c,y:e.translation,rotationCenterX:c,rotationCenterY:e.translation,range:r}}};Vs.CrossLineConstructor=Fa,h([Ea],Vs.prototype,"positionAngle",2);var{ProxyPropertyOnWrite:yl,Property:Ga,CategoryScale:ml}=Sf,li=class extends Vs{constructor(e){super(e,new ml),this.shape="circle",this.groupPaddingInner=0,this.paddingInner=0,this.paddingOuter=0}normaliseDataDomain(e){return{domain:e,clipped:!1}}prepareGridPathTickData(e){return e.slice().reverse()}getTickRadius(e){const{scale:t,innerRadiusRatio:i}=this,s=t.range[0],o=s*i;if(ml.is(t)){const a=t.domain,r=a.length-1-a.indexOf(e.tick);return r===0?o:t.inset+t.step*(r-.5)+t.bandwidth/2}else{const a=(s-o)/t.domain.length;return s-e.translation+o-a/2}}tickFormatParams(){return{type:"category"}}datumFormatParams(e,t){const{datum:i,seriesId:s,legendItemName:o,key:a,source:r,property:n,domain:l,boundSeries:c}=t;return{type:"category",value:e,datum:i,seriesId:s,legendItemName:o,key:a,source:r,property:n,domain:l,boundSeries:c}}};li.className="RadiusCategoryAxis",li.type="radius-category",h([Ga],li.prototype,"groupPaddingInner",2),h([yl("scale","paddingInner"),Ga],li.prototype,"paddingInner",2),h([yl("scale","paddingOuter"),Ga],li.prototype,"paddingOuter",2);import{_ModuleSupport as Ef}from"ag-charts-community";var{Property:Sl,normalisedExtentWithMetadata:Bf,LinearScale:Gf}=Ef,os=class extends Vs{constructor(e){super(e,new Gf),this.shape="polygon"}prepareGridPathTickData(e){const{scale:t}=this,i=t.domain[1];return e.filter(({tick:s})=>s!==i).sort((s,o)=>o.tick-s.tick)}getTickRadius(e){const{scale:t}=this,i=t.range[0],s=i*this.innerRadiusRatio;return i-e.translation+s}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:s,clipped:o}=Bf(e,t,i);return{domain:s,clipped:o}}tickFormatParams(e,t,i){return{type:"number",fractionDigits:i}}datumFormatParams(e,t,i){const{datum:s,seriesId:o,legendItemName:a,key:r,source:n,property:l,domain:c,boundSeries:p}=t;return{type:"number",value:e,datum:s,seriesId:o,legendItemName:a,key:r,source:n,property:l,domain:c,boundSeries:p,fractionDigits:i}}};os.className="RadiusNumberAxis",os.type="radius-number",h([Sl],os.prototype,"min",2),h([Sl],os.prototype,"max",2);var{ordinalTimeAxisOptionsDefs:Wf,angleNumberAxisOptionsDefs:Vf,angleCategoryAxisOptionsDefs:Kf,radiusNumberAxisOptionsDefs:zf,radiusCategoryAxisOptionsDefs:$f}=Ou,xl={type:"axis",name:"ordinal-time",chartType:"cartesian",enterprise:!0,options:Wf,create:e=>new Gs(e)},bl={type:"axis",name:"angle-number",chartType:"polar",enterprise:!0,options:Vf,create:e=>new Oi(e)},Dl={type:"axis",name:"angle-category",chartType:"polar",enterprise:!0,options:Kf,create:e=>new ni(e)},vl={type:"axis",name:"radius-number",chartType:"polar",enterprise:!0,options:zf,create:e=>new os(e)},kl={type:"axis",name:"radius-category",chartType:"polar",enterprise:!0,options:$f,create:e=>new li(e)};import{_ModuleSupport as Hf}from"ag-charts-community";import{_ModuleSupport as Xf}from"ag-charts-community";var{Chart:Yf,Property:qf}=Xf;function Uf(e){return e.type==="sankey"||e.type==="chord"}var Ks=class extends Yf{getChartType(){return"flow-proportion"}async updateData(){await super.updateData();const e=this.getOptions();this.nodes!==e.nodes&&(this.nodes=e.nodes);const{nodes:t}=this;this.series.forEach(i=>{Uf(i)&&i.setChartNodes(t)})}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:s}=e;s.shrink(this.seriesArea.padding.toJson());const o=s.clone();this.seriesRect=o,this.animationRect=o,t.visible=this.series.some(a=>a.visible);for(const a of[t,i])a.translationX=Math.floor(o.x),a.translationY=Math.floor(o.y);this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:t.visible,rect:o,paddedRect:o}})}};Ks.className="FlowProportionChart",Ks.type="flow-proportion",h([qf],Ks.prototype,"nodes",2);var{isAgFlowProportionChartOptions:jf,flowProportionChartOptionsDefs:Jf}=Hf,Ml={type:"chart",name:"flow-proportion",enterprise:!0,options:Jf,detect:jf,create(e,t){return new Ks(e,t)}};import{_ModuleSupport as Zf}from"ag-charts-community";import{_ModuleSupport as Qf}from"ag-charts-community";var{Chart:eg}=Qf,Wa=class extends eg{getChartType(){return"gauge"}performLayout(e){const{seriesRoot:t,annotationRoot:i,series:s,seriesArea:o}=this,{layoutBox:a}=e,r=a.clone();a.shrink(o.padding.toJson()),this.seriesRect=r.clone().translate(r.x-a.x,r.y-a.y),this.animationRect=a,t.visible=s.some(n=>n.visible);for(const n of[t,i])n.translationX=Math.floor(a.x),n.translationY=Math.floor(a.y);this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:t.visible,rect:r,paddedRect:a}})}getAriaLabel(){const e=[],t=this.getCaptionText();t.length!==0&&e.push(t);for(const s of this.series)e.push(s.getCaptionText());const i=e.join(". ");return this.ctx.localeManager.t("ariaAnnounceGaugeChart",{caption:i})}};Wa.className="GaugeChart",Wa.type="gauge";var{isAgGaugeChartOptions:tg,gaugeChartOptionsDefs:ig}=Zf,Il={type:"chart",name:"gauge",enterprise:!0,options:ig,detect:tg,create(e,t){return new Wa(e,t)}};import{_ModuleSupport as sg}from"ag-charts-community";import{_ModuleSupport as og}from"ag-charts-community";var{Chart:ag}=og,Va=class extends ag{getChartType(){return"hierarchy"}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:s}=e;s.shrink(this.seriesArea.padding.toJson());const o=s.clone();this.seriesRect=o,this.animationRect=o;for(const a of[t,i])a.translationX=Math.floor(o.x),a.translationY=Math.floor(o.y);t.visible=this.series[0].visible,t.setClipRect(o.clone()),this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:o,paddedRect:o}})}getAriaLabel(){const e=this.getCaptionText();return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:e})}};Va.className="HierarchyChart",Va.type="hierarchy";var{isAgHierarchyChartOptions:rg,hierarchyChartOptionsDefs:ng}=sg,Al={type:"chart",name:"hierarchy",enterprise:!0,options:ng,detect:rg,create(e,t){return new Va(e,t)}};import{_ModuleSupport as lg}from"ag-charts-community";import{_ModuleSupport as cg}from"ag-charts-community";var{Chart:pg}=cg,Ka=class extends pg{getChartType(){return"standalone"}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:s}=e;s.shrink(this.seriesArea.padding.toJson());const o=s.clone();this.seriesRect=o,this.animationRect=o;for(const a of[t,i])a.translationX=Math.floor(s.x),a.translationY=Math.floor(s.y);t.visible=this.series[0].visible,this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:o,paddedRect:s}})}getAriaLabel(){const e=this.getCaptionText();return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:e})}};Ka.className="StandaloneChart",Ka.type="standalone";var{isAgStandaloneChartOptions:hg,standaloneChartOptionsDefs:dg}=lg,Nl={type:"chart",name:"standalone",enterprise:!0,options:dg,detect:hg,create(e,t){return new Ka(e,t)}};import{_ModuleSupport as ug}from"ag-charts-community";import{_ModuleSupport as fg}from"ag-charts-community";var{Chart:gg,MercatorScale:Pl,NumberAxis:Ll,Property:yg}=fg;function Rl(e){return e.type==="map-shape"||e.type==="map-line"||e.type==="map-marker"||e.type==="map-shape-background"||e.type==="map-line-background"}var zs=class extends gg{constructor(e,t){super(e,t),this.xAxis=new Ll(this.getModuleContext()),this.xAxis.position="bottom",this.yAxis=new Ll(this.getModuleContext()),this.yAxis.position="left",this.ctx.zoomManager.updateAxes([this.xAxis,this.yAxis])}getChartType(){return"topology"}async updateData(){await super.updateData();const e=this.getOptions();this.topology!==e.topology&&(this.topology=e.topology);const{topology:t}=this;this.series.forEach(i=>{Rl(i)&&i.setChartTopology(t)})}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:s}=e;s.shrink(this.seriesArea.padding.toJson());const o=s.clone();this.seriesRect=o,this.animationRect=o;const a=this.series.filter(Rl),r=a.reduce((c,p)=>{if(!p.visible)return c;const d=p.topologyBounds;return d==null?c:c==null?d:c.merge(d)},void 0);let n;if(r!=null){const{lon0:c,lat0:p,lon1:d,lat1:u}=r,f=[[c,p],[d,u]],y=Pl.bounds(f),{width:g,height:m}=o,S=Math.min(g/y.width,m/y.height),x=y.width*S,b=y.height*S,v=(g-x)/2,k=(m-b)/2,L=v,A=k,D=v+x,I=k+b,M=this.ctx.zoomManager.getAxisZoom(this.xAxis.id),P=this.ctx.zoomManager.getAxisZoom(this.yAxis.id),R=(D-L)/(M.max-M.min),w=L-R*M.min,N=(I-A)/(1-P.min-(1-P.max)),C=A-N*(1-P.max);n=new Pl(f,[[w,C],[w+R,C+N]])}a.forEach(c=>{c.scale=n});const l=this.series.some(c=>c.visible);t.visible=l;for(const c of[t,i])c.translationX=Math.floor(o.x),c.translationY=Math.floor(o.y),c.setClipRect(o.clone());this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:l,rect:o,paddedRect:o}})}};zs.className="TopologyChart",zs.type="topology",h([yg],zs.prototype,"topology",2);var{isAgTopologyChartOptions:mg,topologyChartOptionsDefs:Sg}=ug,Ol={type:"chart",name:"topology",enterprise:!0,options:Sg,detect:mg,create(e,t){return new zs(e,t)}};import{_ModuleSupport as xg}from"ag-charts-community";import{_ModuleSupport as bg}from"ag-charts-community";import{and as $s,arrayOf as Dg,arrayOfDefs as Cl,boolean as ci,constant as Tl,greaterThan as wl,lessThan as _l,number as pi,numberRange as vg,optionsDefs as Fl,or as hi,positiveNumber as za,ratio as Hs,required as kg,string as It,typeUnion as Mg,union as Ig}from"ag-charts-core";var{annotationCalloutStylesDefs:Ag,annotationNoteStylesDefs:Ng,annotationTextStylesDef:Pg,annotationCommentStylesDefs:Lg,annotationMeasurerStylesDefs:$a,annotationShapeStylesDefs:El,annotationChannelTextDefs:Rg,annotationCrossLineStyleDefs:Bl,annotationFibonacciStylesDefs:Gl,annotationLineStyleDefs:Wl,annotationLineTextDefs:Og,annotationDisjointChannelStyleDefs:Cg,annotationParallelChannelStyleDefs:Tg}=bg,as=Fl({__type:kg(Tl("date")),value:hi(It,pi)},"a serializable date object"),Vl=hi(It,pi,as),Ha=hi(Vl,Fl({value:Vl,groupPercentage:vg(-1,1)})),Kl={...Rg,label:It},Kt={...Og,label:It},fe={x:Ha,y:pi},wg=Mg({line:{...Wl,start:fe,end:fe,text:Kt},"horizontal-line":{...Bl,value:Ha,text:Kt},"vertical-line":{...Bl,value:Ha,text:Kt},"disjoint-channel":{...Cg,startHeight:za,endHeight:za,start:fe,end:fe,text:Kl},"parallel-channel":{...Tg,height:za,start:fe,end:fe,text:Kl},"fibonacci-retracement":{...Gl,start:fe,end:fe,text:Kt,reverse:ci},"fibonacci-retracement-trend-based":{...Gl,start:fe,end:fe,endRetracement:fe,text:Kt,reverse:ci},callout:{...Ag,start:fe,end:fe,text:It},comment:{...Lg,...fe,text:It},note:{...Ng,...fe,text:It},text:{...Pg,...fe,text:It},arrow:{...Wl,text:Kt,start:fe,end:fe},"arrow-up":{...El,...fe},"arrow-down":{...El,...fe},"date-range":{...$a,extendAbove:ci,extendBelow:ci,text:Kt,start:fe,end:fe},"price-range":{...$a,extendLeft:ci,extendRight:ci,text:Kt,start:fe,end:fe},"date-price-range":{...$a,text:Kt,start:fe,end:fe}},"an annotation initial state object"),_g={chartType:Ig("candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"),annotations:Cl(wg),legend:Cl({visible:ci,seriesId:It,itemId:It,legendItemName:It},"legend state array"),zoom:{rangeX:{start:hi(pi,as),end:hi(pi,as)},rangeY:{start:hi(pi,as),end:hi(pi,as)},ratioX:{start:$s(Hs,_l("end")),end:$s(Hs,wl("start"))},ratioY:{start:$s(Hs,_l("end")),end:$s(Hs,wl("start"))},autoScaledAxes:Dg(Tl("y"))}};import{_ModuleSupport as Fg}from"ag-charts-community";import{array as Eg,arrayOfDefs as Bg,boolean as rs,callback as Gg,color as Xs,fontOptionsDef as Wg,number as zl,positiveNumber as ft,ratio as Vg,typeUnion as Kg}from"ag-charts-core";import{_ModuleSupport as zg}from"ag-charts-community";import{_ModuleSupport as Xa}from"ag-charts-community";import"ag-charts-core";function $l(e){return typeof e?.datum=="object"?e.datum:null}function $g(e){return{from:e?{scalingX:1,scalingY:0}:{scalingX:0,scalingY:1},to:{scalingX:1,scalingY:1}}}function Hg(e){return(t,i)=>e?{scalingCenterY:i.scaledValues.medianValue}:{scalingCenterX:i.scaledValues.medianValue}}import{_ModuleSupport as Hl}from"ag-charts-community";import{Logger as Xg}from"ag-charts-core";var{ScalableGroup:Yg,Rect:ns,Line:ls,BBox:qg,Selection:Xl,applyShapeFillBBox:Ug}=Hl,jg=class extends Yg{constructor(){super(),this.append([new ns({tag:0}),new ns({tag:2}),new ns({tag:1}),new ls({tag:3}),new ls({tag:3}),new ls({tag:4}),new ls({tag:4})])}updateDatumStyles(e,t,i,s,o){const{bandwidth:a,scaledValues:{xValue:r,medianValue:n}}=e;let{minValue:l,q1Value:c,q3Value:p,maxValue:d}=e.scaledValues;(i&&!s||!i&&s)&&([d,p,c,l]=[l,c,p,d]);const u=(G,W,V,K)=>i?{y:G,x:W,width:K,height:V}:{x:G,y:W,width:V,height:K},f=(G,W,V)=>i?{y1:G,y2:W,x:V}:{x1:G,x2:W,y:V},y=(G,W,V)=>i?{x1:W,x2:V,y:G}:{x:G,y1:W,y2:V},g=(G,W,V,K)=>({x:G,y:W,width:V,height:K}=u(G,W,V,K),new qg(G,W,V,K)),{opacity:m,fill:S,fillOpacity:x,stroke:b,strokeWidth:v,strokeOpacity:k,lineDash:L,lineDashOffset:A,cornerRadius:D,cap:I,whisker:M}=t;this.opacity=m??1;const P=Xl.select(this,ns),[R]=P.selectByTag(0),[w]=P.selectByTag(2),[N]=P.selectByTag(1),C=P.selectByTag(3),T=P.selectByTag(4);M.strokeWidth>a&&(M.strokeWidth=a);const O=u(c,r,p-c,a);w.setProperties(O),R.setProperties(O),R.setProperties({cornerRadius:D});const _=Math.max(Math.round(n-v/2),c+v),F=Math.min(Math.round(n+v/2),p-v);N.setProperties(O),N.setProperties({visible:_<F,cornerRadius:D,clipBBox:g(_,r+v,F-_,Math.max(0,a-v*2))});const E=Math.floor(r+a*(1-I.lengthRatio)/2),B=Math.ceil(r+a*(1+I.lengthRatio)/2);T[0].setProperties(y(l,E,B)),T[1].setProperties(y(d,E,B)),C[0].setProperties(f(Math.round(l+M.strokeWidth/2),c,Math.floor(r+a/2))),C[1].setProperties(f(p,Math.round(d-M.strokeWidth/2),Math.floor(r+a/2))),Ug(R,S,o),R.setProperties({fill:S,fillOpacity:x,strokeWidth:v*2,strokeOpacity:0}),N.setProperties({fill:b,fillOpacity:k,strokeWidth:0});for(const G of[...C,...T])G.setProperties(M);w.setProperties({stroke:b,strokeWidth:v,strokeOpacity:k,lineDash:L,lineDashOffset:A,cornerRadius:D,fillOpacity:0})}distanceSquared(e,t){const i=Xl.selectByClass(this,ns,ls);return Hl.nearestSquared(e,t,i).distanceSquared}get midPoint(){const e=this.datum;return e.midPoint===void 0?(Xg.error("BoxPlotGroup.datum.midPoint is undefined"),{x:NaN,y:NaN}):e.midPoint}};import{_ModuleSupport as Jg}from"ag-charts-community";var{BaseProperties:Yl,FillGradientDefaults:Zg,FillPatternDefaults:Qg,FillImageDefaults:ey,AbstractBarSeriesProperties:ty,makeSeriesTooltip:iy,Property:ne,mergeDefaults:sy}=Jg,ql=class extends Yl{constructor(){super(...arguments),this.lengthRatio=.5}};h([ne],ql.prototype,"lengthRatio",2);var Ci=class extends Yl{};h([ne],Ci.prototype,"stroke",2),h([ne],Ci.prototype,"strokeWidth",2),h([ne],Ci.prototype,"strokeOpacity",2),h([ne],Ci.prototype,"lineDash",2),h([ne],Ci.prototype,"lineDashOffset",2);var ce=class extends ty{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new Zg,this.fillPatternDefaults=new Qg,this.fillImageDefaults=new ey,this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.cap=new ql,this.whisker=new Ci,this.tooltip=iy()}toJson(){const{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,lineDashOffset:o}=this,a=super.toJson();return a.whisker=sy(a.whisker,{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,lineDashOffset:o}),a}};h([ne],ce.prototype,"xKey",2),h([ne],ce.prototype,"minKey",2),h([ne],ce.prototype,"q1Key",2),h([ne],ce.prototype,"medianKey",2),h([ne],ce.prototype,"q3Key",2),h([ne],ce.prototype,"maxKey",2),h([ne],ce.prototype,"xName",2),h([ne],ce.prototype,"yName",2),h([ne],ce.prototype,"minName",2),h([ne],ce.prototype,"q1Name",2),h([ne],ce.prototype,"medianName",2),h([ne],ce.prototype,"q3Name",2),h([ne],ce.prototype,"maxName",2),h([ne],ce.prototype,"fill",2),h([ne],ce.prototype,"fillGradientDefaults",2),h([ne],ce.prototype,"fillPatternDefaults",2),h([ne],ce.prototype,"fillImageDefaults",2),h([ne],ce.prototype,"fillOpacity",2),h([ne],ce.prototype,"stroke",2),h([ne],ce.prototype,"strokeWidth",2),h([ne],ce.prototype,"strokeOpacity",2),h([ne],ce.prototype,"lineDash",2),h([ne],ce.prototype,"lineDashOffset",2),h([ne],ce.prototype,"cornerRadius",2),h([ne],ce.prototype,"itemStyler",2),h([ne],ce.prototype,"cap",2),h([ne],ce.prototype,"whisker",2),h([ne],ce.prototype,"tooltip",2);var{extractDecoratedProperties:Ul,fixNumericExtent:oy,keyProperty:ay,mergeDefaults:Ya,SeriesNodePickMode:jl,SMALLEST_KEY_INTERVAL:ry,valueProperty:cs,diff:ny,animationValidation:ly,computeBarFocusBounds:cy,createDatumId:Jl,ContinuousScale:py,ChartAxisDirection:hy,motion:Zl,isGradientFill:dy,getShapeStyle:ps}=Xa,uy=class extends Xa.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.minKey=s.properties.minKey,this.q1Key=s.properties.q1Key,this.medianKey=s.properties.medianKey,this.q3Key=s.properties.q3Key,this.maxKey=s.properties.maxKey}},Ys=class extends Xa.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[jl.NEAREST_NODE,jl.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["medianKey","q1Key","q3Key","minKey","maxKey"]},propertyNames:{x:["xName"],y:["medianName","q1Name","q3Name","minName","maxName"]},categoryKey:"xValue",pathsPerSeries:[],hasHighlightedLabels:!0}),this.properties=new ce,this.NodeEvent=uy}async processData(e){if(!this.visible)return;const{xKey:t,minKey:i,q1Key:s,medianKey:o,q3Key:a,maxKey:r}=this.properties,n=!this.ctx.animationManager.isSkipped(),l=this.getCategoryAxis()?.scale,c=this.getValueAxis()?.scale,{isContinuousX:p,xScaleType:d,yScaleType:u}=this.getScaleInformation({xScale:l,yScale:c}),f=[];n&&this.processedData&&f.push(ny(this.id,this.processedData)),n&&f.push(ly());const{processedData:y}=await this.requestDataModel(e,this.data,{props:[ay(t,d,{id:"xValue"}),cs(i,u,{id:"minValue"}),cs(s,u,{id:"q1Value"}),cs(o,u,{id:"medianValue"}),cs(a,u,{id:"q3Value"}),cs(r,u,{id:"maxValue"}),...p?[ry]:[],...f]});this.smallestDataInterval=y.reduced?.smallestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return[];if(e!==this.getBarDirection()){const{index:o,def:a}=i.resolveProcessedDataDefById(this,"xValue"),r=t.domain.keys[o];return a.type==="key"&&a.valueType==="category"?r:this.padBandExtent(r)}const s=this.domainForClippedRange(e,["minValue","maxValue"],"xValue");return oy(s)}getSeriesRange(e,t){return this.domainForVisibleRange(hy.Y,["maxValue","minValue"],"xValue",t)}createNodeData(){const{visible:e,dataModel:t,processedData:i}=this,s=this.getCategoryAxis(),o=this.getValueAxis();if(!(t&&i&&s&&o))return;const{xKey:a,fill:r,fillOpacity:n,stroke:l,strokeWidth:c,strokeOpacity:p,lineDash:d,lineDashOffset:u,cap:f,whisker:y}=this.properties,g=[],m=t.resolveKeysById(this,"xValue",i),S=t.resolveColumnById(this,"minValue",i),x=t.resolveColumnById(this,"q1Value",i),b=t.resolveColumnById(this,"medianValue",i),v=t.resolveColumnById(this,"q3Value",i),k=t.resolveColumnById(this,"maxValue",i),{barWidth:L,groupIndex:A}=this.updateGroupScale(s),D=py.is(s.scale)?L*-.5:0,{groupScale:I}=this,M=this.isVertical(),P={itemId:a,nodeData:g,labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible};return e&&(i.dataSources.get(this.id)??[]).forEach((w,N)=>{const C=m[N];if(C==null)return;const T=S[N],O=x[N],_=b[N],F=v[N],E=k[N];if([T,O,_,F,E].some(U=>typeof U!="number")||T>O||O>_||_>F||F>E)return;const B={xValue:Math.round(s.scale.convert(C)),minValue:Math.round(o.scale.convert(T)),q1Value:Math.round(o.scale.convert(O)),medianValue:Math.round(o.scale.convert(_)),q3Value:Math.round(o.scale.convert(F)),maxValue:Math.round(o.scale.convert(E))};B.xValue+=Math.round(I.convert(String(A)))+D;const G=Math.round(L),W=Math.abs(B.q3Value-B.q1Value),V=B.xValue+G/2,K=Math.min(B.q3Value,B.q1Value)+W/2,$={x:M?V:K,y:M?K:V};let X;M?X={x:$.x-G/2,y:B.minValue,width:G,height:B.maxValue-B.minValue}:X={x:B.minValue,y:$.y-G/2,width:B.maxValue-B.minValue,height:G},g.push({series:this,itemId:C,datum:w,datumIndex:N,xKey:a,bandwidth:G,scaledValues:B,cap:f,whisker:y,fill:r,fillOpacity:n,stroke:l,strokeWidth:c,strokeOpacity:p,lineDash:d,lineDashOffset:u,midPoint:$,focusRect:X})}),P}legendItemSymbol(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:r,fillGradientDefaults:n,fillPatternDefaults:l,fillImageDefaults:c}=this.properties;return{marker:ps({fill:e,fillOpacity:t,stroke:i,strokeOpacity:o,strokeWidth:s,lineDash:a,lineDashOffset:r},n,l,c)}}getLegendData(e){const{id:t,ctx:{legendManager:i},visible:s}=this,{xKey:o,yName:a,showInLegend:r,legendItemName:n}=this.properties;return!o||e!=="category"?[]:[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:t}),label:{text:n??a??t},symbol:this.legendItemSymbol(),legendItemName:n,hideInLegend:!r}]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:o}=this,{xKey:a,xName:r,yName:n,medianKey:l,medianName:c,q1Key:p,q1Name:d,q3Key:u,q3Name:f,minKey:y,minName:g,maxKey:m,maxName:S,legendItemName:x,tooltip:b}=o,v=this.getCategoryAxis(),k=this.getValueAxis();if(!i||!s||!v||!k)return;const L=s.dataSources.get(this.id)?.[e],A=i.resolveKeysById(this,"xValue",s)[e],D=i.resolveColumnById(this,"minValue",s)[e],I=i.resolveColumnById(this,"q1Value",s)[e],M=i.resolveColumnById(this,"medianValue",s)[e],P=i.resolveColumnById(this,"q3Value",s)[e],R=i.resolveColumnById(this,"maxValue",s)[e];if(A==null)return;const w=this.getItemBaseStyle(!1);Object.assign(w,this.getItemStyleOverrides(String(e),L,w,!1));const N=[{label:g,fallbackLabel:y,value:k.formatDatum(D,"tooltip",t,x,L,y)},{label:d,fallbackLabel:p,value:k.formatDatum(I,"tooltip",t,x,L,p)},{label:c,fallbackLabel:l,value:k.formatDatum(M,"tooltip",t,x,L,l)},{label:f,fallbackLabel:u,value:k.formatDatum(P,"tooltip",t,x,L,u)},{label:S,fallbackLabel:m,value:k.formatDatum(R,"tooltip",t,x,L,m)}];return this.formatTooltipWithContext(b,{heading:v.formatDatum(A,"tooltip",t,x,L,a),title:x??n,symbol:this.legendItemSymbol(),data:N},{seriesId:t,datum:L,title:n,xKey:a,xName:r,yName:n,medianKey:l,medianName:c,q1Key:p,q1Name:d,q3Key:u,q3Name:f,minKey:y,minName:g,maxKey:m,maxName:S,.