UNPKG

ag-charts-enterprise

Version:

Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue

1 lines 422 kB
var bd=Object.defineProperty,Dd=Object.getOwnPropertyDescriptor,p=(e,t,i,s)=>{for(var o=s>1?void 0:s?Dd(t,i):t,a=e.length-1,n;a>=0;a--)(n=e[a])&&(o=(s?n(t,i,o):n(o))||o);return s&&o&&bd(t,i,o),o};import{_ModuleSupport as vd}from"ag-charts-community";import{_ModuleSupport as kd}from"ag-charts-community";import{_ModuleSupport as Id}from"ag-charts-community";import{isNumberEqual as Or}from"ag-charts-core";function Ma(e,t,i){const s=(a,n,r,l)=>{let c=e[0];for(let h=a;r>0?h<=n:h>n;h+=r){const u=e[h];if(l(c,u))return!0;c=u}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 Ad}from"ag-charts-community";var{AxisInterval:Md,Property:Nd}=Ad,Na=class extends Md{};p([Nd],Na.prototype,"minSpacing",2);import{_ModuleSupport as Ys}from"ag-charts-community";import{countFractionDigits as Ld,isNumberEqual as Li}from"ag-charts-core";import{_ModuleSupport as Fr}from"ag-charts-community";import{isNumberEqual as Br}from"ag-charts-core";import{_ModuleSupport as Td}from"ag-charts-community";import{createId as Rd}from"ag-charts-core";var{BaseProperties:Gr,ChartAxisDirection:Pd,Property:Ne,Group:La,FONT_SIZE:Cd}=Td,Dt=class extends Gr{constructor(){super(...arguments),this.fontSize=Cd.LARGE,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}};p([Ne],Dt.prototype,"enabled",2),p([Ne],Dt.prototype,"text",2),p([Ne],Dt.prototype,"fontStyle",2),p([Ne],Dt.prototype,"fontWeight",2),p([Ne],Dt.prototype,"fontSize",2),p([Ne],Dt.prototype,"fontFamily",2),p([Ne],Dt.prototype,"padding",2),p([Ne],Dt.prototype,"color",2),p([Ne],Dt.prototype,"parallel",2);var Qe=class extends Gr{constructor(){super(...arguments),this.id=Rd(this),this.defaultColorRange=[],this.shape="polygon",this.label=new Dt,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction=Pd.Angle,this.axisInnerRadius=0,this.axisOuterRadius=0,this.lineGroup=new La({name:this.id}),this.rangeGroup=new La({name:this.id}),this.labelGroup=new La({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}};p([Ne],Qe.prototype,"enabled",2),p([Ne],Qe.prototype,"type",2),p([Ne],Qe.prototype,"range",2),p([Ne],Qe.prototype,"value",2),p([Ne],Qe.prototype,"defaultColorRange",2),p([Ne],Qe.prototype,"fill",2),p([Ne],Qe.prototype,"fillOpacity",2),p([Ne],Qe.prototype,"stroke",2),p([Ne],Qe.prototype,"strokeWidth",2),p([Ne],Qe.prototype,"strokeOpacity",2),p([Ne],Qe.prototype,"lineDash",2),p([Ne],Qe.prototype,"shape",2),p([Ne],Qe.prototype,"label",2);var{ChartAxisDirection:_d,getCrossLineValue:wd,validateCrossLineValue:Ed,normalizeAngle360:Ta,Group:Od,Path:Vr,Sector:Fd,RotatableText:Bd,ContinuousScale:Gd}=Fr,Ra=class extends Qe{constructor(){super(),this.direction=_d.Angle,this.polygonNode=new Vr,this.sectorNode=new Fd,this.lineNode=new Vr,this.crossLineRange=new Od,this.labelNode=new Bd,this.ticks=[],this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.crossLineRange.append(this.lineNode),this.labelGroup.append(this.labelNode)}visibilityCheck(){if(!Gd.is(this.scale))return!0;const[e,t]=this.scale.domain,i=wd(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||!Ed(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:n,axisOuterRadius:r}=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=r*Math.cos(a),c=r*Math.sin(a),h=n*Math.cos(a),u=n*Math.sin(a);o.path.clear(!0),o.path.moveTo(h,u),o.path.lineTo(l,c),this.assignCrossLineGroup(!1,this.crossLineRange)}updatePolygonNode(e){const{polygonNode:t,range:i,scale:s,shape:o,type:a,ticks:n}=this;if(!e||a!=="range"||o!=="polygon"||!s||!i){t.visible=!1;return}const{axisInnerRadius:r,axisOuterRadius:l}=this,c=n.indexOf(i[0]),h=n.indexOf(i[1]),d=(c<=h?n.slice(c,h+1):n.slice(c).concat(n.slice(0,h+1))).map(y=>s.convert(y));t.visible=!0,this.setSectorNodeProps(t);const{path:g}=t;g.clear(!0),d.forEach((y,f)=>{const m=l*Math.cos(y),S=l*Math.sin(y);f===0?g.moveTo(m,S):g.lineTo(m,S)}),r===0?g.lineTo(0,0):d.slice().reverse().forEach(y=>{const f=r*Math.cos(y),m=r*Math.sin(y);g.lineTo(f,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:n,axisOuterRadius:r}=this,l=i.map(u=>s.convert(u)),c=s.step??0,h=s instanceof Fr.BandScale?c/2:0;t.visible=!0,this.setSectorNodeProps(t),t.centerX=0,t.centerY=0,t.innerRadius=n,t.outerRadius=r,t.startAngle=l[0]-h,t.endAngle=l[1]+h,this.assignCrossLineGroup(!0,this.crossLineRange)}updateLabelNode(e){const{label:t,labelNode:i,range:s,scale:o,type:a,ticks:n}=this;if(!e||t.enabled===!1||!t.text||!o||a==="range"&&!s){i.visible=!1;return}i.visible=!0;const{axisInnerRadius:r,axisOuterRadius:l}=this;let c,h,u,d;if(a==="line"){const g=Ta(o.convert(this.value)),y=1.5*Math.PI,f=Br(g,y)||g>y||g<Math.PI/2,m=(r+l)/2*Math.cos(g),S=(r+l)/2*Math.sin(g);c=m+t.padding*Math.cos(g+Math.PI/2),h=S+t.padding*Math.sin(g+Math.PI/2),d=f?"top":"bottom",u=f?g:g-Math.PI}else{const[g,y]=s.map(D=>Ta(o.convert(D)));let f=(g+y)/2;g>y&&(f-=Math.PI),f=Ta(f);const m=(Br(f,0)||f>0)&&f<Math.PI;let S;this.shape==="circle"||n.length<3?S=l-t.padding:S=l*Math.cos(Math.PI/n.length)-t.padding,c=S*Math.cos(f),h=S*Math.sin(f),d=m?"bottom":"top",u=m?f-Math.PI/2:f+Math.PI/2}this.setLabelNodeProps(i,c,h,d,u)}};Ra.className="AngleCrossLine";var{ChartAxisDirection:Vd,TextWrapper:Kd,TextUtils:Wd,Property:Pa,toRadians:ps,normalizeAngle360:Ht,normalizeAngle360Inclusive:zd,Path:Hd,RotatableText:$d,Transformable:Xd,BBox:Yd,Selection:Kr,Line:Wr}=Ys,Ca=class extends Ys.AxisLabel{constructor(){super(...arguments),this.orientation="fixed"}};p([Pa],Ca.prototype,"orientation",2);var hs=class extends Ys.PolarAxis{constructor(e,t){super(e,t),this.startAngle=0,this.endAngle=void 0,this.tickLineGroupSelection=Kr.select(this.tickLineGroup,Wr,!1),this.gridLineGroupSelection=Kr.select(this.gridLineGroup,Wr,!1),this.labelData=[],this.tickData=[],this.radiusLineGroup=this.axisGroup.appendChild(new Ys.TransformableGroup),this.radiusLine=this.radiusLineGroup.appendChild(new Hd),this.includeInvisibleDomains=!0}get direction(){return Vd.Angle}createLabel(){return new Ca}calculateRotations(){const e=ps(this.startAngle),t=Ht(e),i=Ht(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 n=a.map(l=>l.value),r=n.reduce((l,c)=>Math.max(typeof c=="number"?Ld(c):0,l),0);return{niceDomain:o,tickDomain:o,ticks:n,rawTickCount:void 0,fractionDigits:r,timeInterval:void 0,bbox:this.getBBox()}}update(){super.update(),this.updateRadiusLine(),this.updateGridLines(),this.updateTickLines()}normalizedAngles(){const e=Ht(-Math.PI/2+ps(this.startAngle)),t=this.endAngle!=null?zd(ps(this.endAngle)-ps(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:n,arc:r,radius:l=0,startAngle:c=0,endAngle:h=0})=>{r?t.arc(o,a,l,c,h):n?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=Li(o-s,2*Math.PI),n=[];if(t==="circle")a?n.push({x:i,y:0,moveTo:!0},{x:0,y:0,radius:i,startAngle:0,endAngle:2*Math.PI,arc:!0,moveTo:!1}):n.push({x:i*Math.cos(s),y:i*Math.sin(s),moveTo:!0},{x:0,y:0,radius:i,startAngle:Ht(s),endAngle:Ht(o),arc:!0,moveTo:!1});else if(t==="polygon"){const r=e.ticks({nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(l=>e.convert(l));r&&r.length>2&&r.forEach((l,c)=>{const h=i*Math.cos(l),u=i*Math.sin(l),d=c===0;n.push({x:h,y:u,moveTo:d})})}return{points:n,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,n=i.length;this.gridLineGroupSelection.each((r,l,c)=>{const{value:h}=l,{stroke:u,lineDash:d}=i[c%n],g=e.convert(h);r.x1=a*Math.cos(g),r.y1=a*Math.sin(g),r.x2=t*Math.cos(g),r.y2=t*Math.sin(g),r.stroke=u,r.strokeWidth=s,r.lineDash=d,r.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.setAlign(a),i.setBoxing(e),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:n}=a,r=e.convert(n),l=Math.cos(r),c=Math.sin(r);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:n}=this;if(!s.enabled)return[];const r=new $d,l=i.x-this.translation.x,c=i.x+i.width-this.translation.x,{fractionDigits:h}=this.layout.label,u=this.tickFormatter(this.scale.domain,this.tickData,!1,h),d=e.map((g,y)=>{const{value:f}=g,m=o+s.spacing+n.size,S=a.convert(f),D=Math.cos(S),b=Math.sin(S),x=m*D,k=m*b,{textAlign:I,textBaseline:A}=this.getLabelAlign(S),v=y===e.length-1&&f!==e[0]&&Li(Ht(S),Ht(a.convert(e[0]))),N=this.getLabelRotation(S);let L=u(f,y);r.text=L,r.x=x,r.y=k,r.setFont(s),r.textAlign=I,r.textBaseline=A,r.rotation=N,N&&(r.rotationCenterX=x,r.rotationCenterY=k);let M=N?Xd.toCanvas(r):r.getBBox();if(M&&t.hideWhenNecessary&&!N){const R=l-M.x,C=M.x+M.width-c,w=1;if(R>w||C>w){const T=M.width-Math.max(R,C);L=Kd.wrapText(L,{maxWidth:T,font:s,textWrap:"never"}),L===Wd.EllipsisChar&&(L=""),r.text=L,M=r.getBBox()}}return{text:L,x,y:k,textAlign:I,textBaseline:A,hidden:L===""||g.hidden||v,rotation:N,box:M}});return s.avoidCollisions&&this.avoidLabelCollisions(d),d}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:Yd.merge(i)}getLabelOrientation(){const{label:e}=this;return e instanceof Ca?e.orientation:"fixed"}getLabelRotation(e){let t=ps(this.label.rotation??0);e=Ht(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(),n=Li(t,0),r=Li(i,0),l=Li(t,1),c=Li(i,-1),h=t>0&&!n,u=i>0&&!r;return a==="parallel"?(s="center",o=l&&r||u?"top":"bottom"):a==="perpendicular"?(s=c||h?"left":"right",o="middle"):(s="right",n?s="center":h&&(s="left"),o="bottom",r?o="middle":u&&(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()}};hs.CrossLineConstructor=Ra,p([Pa],hs.prototype,"startAngle",2),p([Pa],hs.prototype,"endAngle",2);var{Property:_a,CategoryScale:Ud}=Id,ai=class extends hs{constructor(e){super(e,new Ud),this.groupPaddingInner=0,this.paddingInner=0,this.interval=new Na}hasDefinedDomain(){return!1}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},n=s??t.ticks(a,e)?.ticks??[];if(n.length<2||o==null)return n.map(u=>({value:u,visible:!0}));const r=n[0],l=t.convert(r),c=i*Math.cos(l),h=i*Math.sin(l);for(let u=1;u<n.length-1;u++){const d=n[u],g=t.convert(d);if(g-l>Math.PI)break;const y=i*Math.cos(g),f=i*Math.sin(g);if(Math.sqrt((y-c)**2+(f-h)**2)>o){const S=new Set([r]);return Ma(n,u,(D,b)=>{S.add(b)}),n.map(D=>{const b=S.has(D);return{value:D,visible:b}})}}return[{value:r,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 h=l.box.clone().grow(t/2),u=c.box.clone().grow(t/2);return h.collidesBBox(u)},s=e[0],o=e.at(-1),a=new Set([s]),n=Or(s.x,o.x)&&Or(s.y,o.y),r=Math.floor(e.length/2);for(let l=1;l<=r;l++){const c=n?e.slice(0,-1):e;if(!Ma(c,l,i)){Ma(c,l,(u,d)=>{a.add(d)});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:n,property:r,domain:l,boundSeries:c}=t;return{type:"category",value:e,datum:i,seriesId:s,legendItemName:o,key:a,source:n,property:r,domain:l,boundSeries:c}}};ai.className="AngleCategoryAxis",ai.type="angle-category",p([_a],ai.prototype,"groupPaddingInner",2),p([_a],ai.prototype,"paddingInner",2),p([_a],ai.prototype,"interval",2);import{_ModuleSupport as qd}from"ag-charts-community";import{isNumberEqual as zr}from"ag-charts-core";import{_ModuleSupport as jd}from"ag-charts-community";import{isNumberEqual as Jd}from"ag-charts-core";var{range:Hr,isDenseInterval:Zd,LinearScale:wa}=jd,$r=class Er extends wa{constructor(){super(...arguments),this.arcLength=0}static getNiceStepAndTickCount(t,i){const[s,o]=i;let a=wa.getTickStep(s,o,t);const n=isNaN(t.maxTickCount)?1/0:t.maxTickCount,r=Math.abs(o-s)/a;let l=Math.pow(2,Math.ceil(Math.log(r)/Math.log(2)));return l>n&&(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,[n,r]=i;if(a){const c=Math.abs(a),h=this.getPixelRange();if(!Zd((r-n)/c,h))return Hr(n,r,c)}let l;if(o&&this.hasNiceRange()){const c=super.niceDomain(t,i);l=Er.getNiceStepAndTickCount(t,c).step}else l=wa.getTickStep(n,r,t);return Hr(n,r,l)}hasNiceRange(){const t=this.range.slice().sort((s,o)=>s-o);return[Math.PI,2*Math.PI].some(s=>Jd(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:n,count:r}=Er.getNiceStepAndTickCount(t,s),l=1/n,c=n>=1?Math.ceil(a/n+r)*n:Math.ceil((a+r*n)*l)/l;return o?[c,a]:[a,c]}getPixelRange(){return this.arcLength}},{Property:Ea,angleBetween:Qd,normalisedExtentWithMetadata:eg,findMinMax:tg}=qd,Ti=class extends hs{constructor(e){super(e,new $r),this.shape="circle",this.interval=new Na}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&e<t}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:s,clipped:o}=eg(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=Qd(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:n,maxSpacing:r}=this.interval;let l;if(o==null){const{arcLength:c}=t,h=r?Math.floor(c/r):1,u=n?Math.floor(c/n):1/0,d=Math.floor(4/Math.PI*Math.abs(i[0]-i[1])),g=Math.max(h,Math.min(u,d)),y={nice:s,interval:a,tickCount:g,minTickCount:h,maxTickCount:u};l=t.ticks(y,e)?.ticks??[]}else{const[c,h]=tg(e.map(Number));l=o.filter(u=>u>=c&&u<=h).sort((u,d)=>u-d)}return l.map(c=>({value:c,visible:!0}))}avoidLabelCollisions(e){const{minSpacing:t}=this.label,i=(a,n)=>{if(a.hidden||n.hidden)return!1;if(t==null)return a.box.collidesBBox(n.box);const r=a.box.clone().grow(t/2),l=n.box.clone().grow(t/2);return r.collidesBBox(l)},s=e[0],o=e.at(-1);s!==o&&zr(s.x,o.x)&&zr(s.y,o.y)&&(o.hidden=!0);for(let a=1;a<e.length;a*=2){let n=!1;for(let r=a;r<e.length;r+=a){const l=e[r],c=e[r-a];if(i(c,l)){n=!0;break}}if(!n){e.forEach((r,l)=>{l%a>0&&(r.hidden=!0,r.box=void 0)});return}}e.forEach((a,n)=>{n>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:n,source:r,property:l,domain:c,boundSeries:h}=t;return{type:"number",value:e,datum:s,seriesId:o,legendItemName:a,key:n,source:r,property:l,domain:c,boundSeries:h,fractionDigits:i}}};Ti.className="AngleNumberAxis",Ti.type="angle-number",p([Ea],Ti.prototype,"min",2),p([Ea],Ti.prototype,"max",2),p([Ea],Ti.prototype,"interval",2);import{_ModuleSupport as Xr}from"ag-charts-community";var{OrdinalTimeScale:ig,Property:sg,TimeAxisParentLevel:og,lowestGranularityUnitForTicks:ag,lowestGranularityUnitForValue:ng,minimumTimeAxisDatumGranularity:rg,dateTruncationForDomain:lg,intervalUnit:Yr,intervalStep:Ur,intervalEpoch:qr,intervalMilliseconds:jr}=Xr,Us=class extends Xr.DiscreteTimeAxis{constructor(e){super(e,new ig),this.parentLevel=new og,this.minimumTimeGranularity=void 0}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}processData(){super.processData();const{boundSeries:e,direction:t}=this;this.minimumTimeGranularity=rg(e,t,void 0,void 0)}tickFormatParams(e,t,i,s){s??(s=ag(t));const o=lg(e),a=Yr(s),n=Ur(s),r=qr(s);return{type:"date",unit:a,step:n,epoch:r,truncateDate:o}}datumFormatParams(e,t,i,s,o){if(typeof e=="number"&&(e=new Date(e)),s==null){const{minimumTimeGranularity:m}=this,S=ng(e);m!=null&&jr(m)<jr(S)?s=m:s=S}const{datum:a,seriesId:n,legendItemName:r,key:l,source:c,property:h,domain:u,boundSeries:d}=t,g=Yr(s),y=Ur(s),f=qr(s);return{type:"date",value:e,datum:a,seriesId:n,legendItemName:r,key:l,source:c,property:h,domain:u,boundSeries:d,unit:g,step:y,epoch:f,style:o}}};Us.className="OrdinalTimeAxis",Us.type="ordinal-time",p([sg],Us.prototype,"parentLevel",2);import{_ModuleSupport as cg}from"ag-charts-community";import{_ModuleSupport as qs}from"ag-charts-community";import{isNumberEqual as pg}from"ag-charts-core";import{_ModuleSupport as Jr}from"ag-charts-community";import{clamp as Zr,isNumberEqual as hg}from"ag-charts-core";var{ChartAxisDirection:ug,Property:dg,validateCrossLineValue:gg,normalizeAngle360FromDegrees:fg,Group:yg,Path:mg,Sector:Sg,RotatableText:xg}=Jr,Qr=class extends Dt{constructor(){super(...arguments),this.positionAngle=void 0}};p([dg],Qr.prototype,"positionAngle",2);var Oa=class extends Qe{constructor(){super(),this.direction=ug.Radius,this.label=new Qr,this.polygonNode=new mg,this.sectorNode=new Sg,this.crossLineRange=new yg,this.labelNode=new xg,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||!gg(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 n,r;if(i==="line")n=a(t.convert(this.value)),r=n;else{const l=Math.abs(t?.bandwidth??0),c=e.map(h=>t.convert(h));n=a(Math.max(...c)),r=a(Math.min(...c))+l}this.outerRadius=n,this.innerRadius=r}drawPolygon(e,t,i){t.forEach((s,o)=>{const a=e*Math.cos(s),n=e*Math.sin(s);o===0?i.path.moveTo(a,n):i.path.lineTo(a,n)}),i.path.closePath()}updatePolygonNode(e){const{gridAngles:t,polygonNode:i,scale:s,shape:o,type:a,innerRadius:n,outerRadius:r}=this;if(!e||o!=="polygon"||!s||!t){i.visible=!1;return}i.visible=!0;const l=this.getPadding();i.path.clear(!0),this.drawPolygon(r-l,t,i);const c=t.slice().reverse(),h=a==="line"?r-l:n+l;this.drawPolygon(h,c,i),this.setSectorNodeProps(i)}updateSectorNode(e){const{axisInnerRadius:t,axisOuterRadius:i,scale:s,sectorNode:o,shape:a,innerRadius:n,outerRadius:r}=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=Zr(t,n+l,i),h=Zr(t,r-l,i);o.innerRadius=Math.min(c,h),o.outerRadius=Math.max(c,h),this.setSectorNodeProps(o)}updateLabelNode(e){const{innerRadius:t,label:i,labelNode:s,scale:o,shape:a,type:n}=this;if(!e||i.enabled===!1||!i.text||!o){s.visible=!1;return}const r=fg((i.positionAngle??0)-90),l=(hg(r,0)||r>0)&&r<Math.PI,c=l?r-Math.PI/2:r+Math.PI/2;let h;const u=this.gridAngles??[];n==="line"?h=t+i.padding:a==="circle"||u.length<3?h=t-i.padding:h=t*Math.cos(Math.PI/u.length)-i.padding;const d=h*Math.cos(r),g=h*Math.sin(r);let y;n==="line"?y=l?"top":"bottom":y=l?"bottom":"top",this.setLabelNodeProps(s,d,g,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 Jr.BandScale?(i-t)/2:0}};Oa.className="RadiusCrossLine";var{ChartAxisDirection:bg,ZIndexMap:Dg,Property:Fa,normalizeAngle360:el,toRadians:vg,Caption:kg,Group:Ig,TransformableGroup:tl,Path:Ag,Line:il,Selection:sl,AxisTickGenerator:Mg,AxisGroupZIndexMap:Ng}=qs,Ba=class extends qs.AxisLabel{constructor(){super(...arguments),this.autoRotateAngle=335}};p([Fa],Ba.prototype,"autoRotate",2),p([Fa],Ba.prototype,"autoRotateAngle",2);var js=class extends qs.PolarAxis{constructor(e,t){super(e,t),this.positionAngle=0,this.gridLineGroupSelection=sl.select(this.gridLineGroup,il,!1),this.tickGenerator=new Mg(this),this.generatedTicks=void 0,this.headingLabelGroup=this.axisGroup.appendChild(new tl({name:`${this.id}-Axis-heading`})),this.lineNodeGroup=this.axisGroup.appendChild(new tl({name:`${this.id}-Axis-line`})),this.lineNode=this.lineNodeGroup.appendChild(new il({name:`${this.id}-Axis-line`,zIndex:Ng.AxisLine})),this.gridPathGroup=this.gridGroup.appendChild(new Ig({name:`${this.id}-gridPaths`,zIndex:Dg.AXIS_GRID})),this.gridPathSelection=sl.select(this.gridPathGroup,Ag),this.headingLabelGroup.appendChild(this.title.caption.node),this.cleanup.register(this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}get direction(){return bg.Radius}getAxisTransform(){const e=this.scale.range[0],{translation:t,positionAngle:i,innerRadiusRatio:s}=this,o=e*s,a=vg(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],n=this.label.getSideFlag(),r=n*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding),{range:l,reverse:c,defaultTickMinSpacing:h}=this,u=this.tickGenerator.generateTicks({domain:e,range:l,reverse:c,niceMode:t,visibleRange:a,primaryTickCount:void 0,defaultTickMinSpacing:h,parallelFlipRotation:0,regularFlipRotation:o,labelX:r,sideFlag:n,sizeLimit:void 0,removeOverflowLabels:!1}),{tickData:d}=u,{ticks:g,rawTicks:y,rawTickCount:f,tickDomain:m,fractionDigits:S,niceDomain:D=e}=d,b=g.map(x=>this.getTickLabelProps(x,u));return this.generatedTicks={ticks:g,labels:b},{ticks:y,tickDomain:m,niceDomain:D,rawTickCount:f,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=qs.resetAxisLabelSelectionFn();this.tickLabelGroupSelection.each((t,i)=>{t.fill=i.color,t.text=i.text,t.textBaseline=i.textBaseline,t.textAlign=i.textAlign??"center",t.setFont(i),t.setBoxing(i),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=(d,g)=>{const{stroke:y,lineDash:f}=e[g%o];d.stroke=y,d.strokeWidth=t,d.lineDash=f,d.fill=void 0},[n,r]=this.gridRange??[0,2*Math.PI],l=pg(r-n,2*Math.PI),u=i==="circle"?(d,g)=>{const{path:y}=d;y.clear(!0);const f=this.getTickRadius(g);l?(y.moveTo(f,0),y.arc(0,0,f,0,2*Math.PI)):(y.moveTo(f*Math.cos(n),f*Math.sin(n)),y.arc(0,0,f,el(n),el(r))),l&&y.closePath()}:(d,g)=>{const{path:y}=d,f=this.gridAngles;if(y.clear(!0),!f||f.length<3)return;const m=this.getTickRadius(g);f.forEach((S,D)=>{const b=m*Math.cos(S),x=m*Math.sin(S);D===0?y.moveTo(b,x):y.lineTo(b,x),f.forEach((k,I)=>{const A=m*Math.cos(k),v=m*Math.sin(k);I===0?y.moveTo(A,v):y.lineTo(A,v)}),y.closePath()}),y.closePath()};this.gridPathSelection.each((d,g,y)=>{a(d,y),u(d,g)})}updateTitle(){const e=n=>n.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=-kg.SMALL_PADDING,a.textAlign="center",a.textBaseline="bottom",a.text=this.cachedCallWithContext(s,this.getTitleFormatterParams(this.scale.domain))),a.visible=o}updateCrossLines(){this.crossLines.forEach(e=>{if(e instanceof Oa){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,n=this.scale.range,r=e.tickLabel??"",c=i.getSideFlag()*(this.getTickSize()+i.spacing+this.seriesAreaPadding),h=r!==""&&r!=null,u=s;return{...this.getLabelStyles({value:e.tickLabel}),tickId:e.tickId,rotation:u,text:r,textAlign:a,textBaseline:o,visible:h,x:c,y:e.translation,rotationCenterX:c,rotationCenterY:e.translation,range:n}}};js.CrossLineConstructor=Oa,p([Fa],js.prototype,"positionAngle",2);var{ProxyPropertyOnWrite:ol,Property:Ga,CategoryScale:al}=cg,ni=class extends js{constructor(e){super(e,new al),this.shape="circle",this.groupPaddingInner=0,this.paddingInner=0,this.paddingOuter=0}hasDefinedDomain(){return!1}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(al.is(t)){const a=t.domain,n=a.length-1-a.indexOf(e.tick);return n===0?o:t.inset+t.step*(n-.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:n,property:r,domain:l,boundSeries:c}=t;return{type:"category",value:e,datum:i,seriesId:s,legendItemName:o,key:a,source:n,property:r,domain:l,boundSeries:c}}};ni.className="RadiusCategoryAxis",ni.type="radius-category",p([Ga],ni.prototype,"groupPaddingInner",2),p([ol("scale","paddingInner"),Ga],ni.prototype,"paddingInner",2),p([ol("scale","paddingOuter"),Ga],ni.prototype,"paddingOuter",2);import{_ModuleSupport as Lg}from"ag-charts-community";var{Property:nl,normalisedExtentWithMetadata:Tg,LinearScale:Rg}=Lg,us=class extends js{constructor(e){super(e,new Rg),this.shape="polygon"}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&e<t}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}=Tg(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:n,source:r,property:l,domain:c,boundSeries:h}=t;return{type:"number",value:e,datum:s,seriesId:o,legendItemName:a,key:n,source:r,property:l,domain:c,boundSeries:h,fractionDigits:i}}};us.className="RadiusNumberAxis",us.type="radius-number",p([nl],us.prototype,"min",2),p([nl],us.prototype,"max",2);var{ordinalTimeAxisOptionsDefs:Pg,angleNumberAxisOptionsDefs:Cg,angleCategoryAxisOptionsDefs:_g,radiusNumberAxisOptionsDefs:wg,radiusCategoryAxisOptionsDefs:Eg}=kd,rl={type:"axis",name:"ordinal-time",chartType:"cartesian",enterprise:!0,options:Pg,create:e=>new Us(e)},ll={type:"axis",name:"angle-number",chartType:"polar",enterprise:!0,options:Cg,create:e=>new Ti(e)},cl={type:"axis",name:"angle-category",chartType:"polar",enterprise:!0,options:_g,create:e=>new ai(e)},pl={type:"axis",name:"radius-number",chartType:"polar",enterprise:!0,options:wg,create:e=>new us(e)},hl={type:"axis",name:"radius-category",chartType:"polar",enterprise:!0,options:Eg,create:e=>new ni(e)};import{_ModuleSupport as Og}from"ag-charts-community";import{_ModuleSupport as Fg}from"ag-charts-community";var{Chart:Bg}=Fg,Va=class extends Bg{getChartType(){return"standalone"}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:s}=e,o=s.clone().shrink(this.modulesManager.getModule("seriesArea").getPadding());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,this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:o,paddedRect:s}})}getAriaLabel(){const e=this.series[0]?.type;if(e==null)return"";const t=this.getCaptionText();switch(e){case"radial-gauge":case"linear-gauge":{const i=[];t.length!==0&&i.push(t);for(const s of this.series)i.push(s.getCaptionText());return this.ctx.localeManager.t("ariaAnnounceGaugeChart",{caption:i.join(". ")})}case"treemap":case"sunburst":return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:t});default:return this.ctx.localeManager.t("ariaAnnounceStandaloneChart",{caption:t})}}};Va.className="StandaloneChart",Va.type="standalone";var{isAgStandaloneChartOptions:Gg,standaloneChartOptionsDefs:Vg}=Og,ul={type:"chart",name:"standalone",enterprise:!0,options:Vg,detect:Gg,create(e,t){return new Va(e,t)}};import{_ModuleSupport as Kg}from"ag-charts-community";import{_ModuleSupport as Wg}from"ag-charts-community";var{Chart:zg,MercatorScale:dl,NumberAxis:gl,Property:Hg}=Wg;function fl(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 Js=class extends zg{constructor(e,t){super(e,t),this.xAxis=new gl(this.getModuleContext()),this.xAxis.position="bottom",this.yAxis=new gl(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=>{fl(i)&&i.setChartTopology(t)})}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:s}=e,o=s.clone().shrink(this.modulesManager.getModule("seriesArea").getPadding());this.seriesRect=o,this.animationRect=o;const a=this.series.filter(fl),n=a.reduce((c,h)=>{if(!h.visible)return c;const u=h.topologyBounds;return u==null?c:c==null?u:c.merge(u)},void 0);let r;if(n!=null){const{lon0:c,lat0:h,lon1:u,lat1:d}=n,g=[[c,h],[u,d]],y=dl.bounds(g),{width:f,height:m}=o,S=Math.min(f/y.width,m/y.height),D=y.width*S,b=y.height*S,x=(f-D)/2,k=(m-b)/2,I=x,A=k,v=x+D,N=k+b,L=this.ctx.zoomManager.getAxisZoom(this.xAxis.id),M=this.ctx.zoomManager.getAxisZoom(this.yAxis.id),R=(v-I)/(L.max-L.min),C=I-R*L.min,w=(N-A)/(1-M.min-(1-M.max)),T=A-w*(1-M.max);r=new dl(g,[[C,T],[C+R,T+w]])}a.forEach(c=>{c.scale=r});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:s}})}};Js.className="TopologyChart",Js.type="topology",p([Hg],Js.prototype,"topology",2);var{isAgTopologyChartOptions:$g,topologyChartOptionsDefs:Xg}=Kg,yl={type:"chart",name:"topology",enterprise:!0,options:Xg,detect:$g,create(e,t){return new Js(e,t)}};import{_ModuleSupport as Yg}from"ag-charts-community";import{_ModuleSupport as Ug}from"ag-charts-community";import{and as Zs,arrayOf as qg,arrayOfDefs as ml,boolean as ri,constant as Sl,greaterThan as xl,lessThan as bl,number as Ct,numberRange as jg,optionsDefs as Dl,or as li,ratio as Qs,required as Jg,string as vt,typeUnion as Zg,union as Qg}from"ag-charts-core";var{annotationCalloutStylesDefs:ef,annotationNoteStylesDefs:tf,annotationTextStylesDef:sf,annotationCommentStylesDefs:of,annotationMeasurerStylesDefs:Ka,annotationShapeStylesDefs:vl,annotationChannelTextDefs:af,annotationCrossLineStyleDefs:kl,annotationFibonacciStylesDefs:Il,annotationLineStyleDefs:Al,annotationLineTextDefs:nf,annotationDisjointChannelStyleDefs:rf,annotationParallelChannelStyleDefs:lf}=Ug,ds=Dl({__type:Jg(Sl("date")),value:li(vt,Ct)},"a serializable date object"),Ml=li(vt,Ct,ds),Wa=li(Ml,Dl({value:Ml,groupPercentage:jg(-1,2)})),Nl={...af,label:vt},Bt={...nf,label:vt},de={x:Wa,y:Ct},cf=Zg({line:{...Al,start:de,end:de,text:Bt},"horizontal-line":{...kl,value:Wa,text:Bt},"vertical-line":{...kl,value:Wa,text:Bt},"disjoint-channel":{...rf,startHeight:Ct,endHeight:Ct,start:de,end:de,text:Nl},"parallel-channel":{...lf,height:Ct,start:de,end:de,text:Nl},"fibonacci-retracement":{...Il,start:de,end:de,text:Bt,reverse:ri},"fibonacci-retracement-trend-based":{...Il,start:de,end:de,endRetracement:de,text:Bt,reverse:ri},callout:{...ef,start:de,end:de,text:vt},comment:{...of,...de,text:vt},note:{...tf,...de,text:vt},text:{...sf,...de,text:vt},arrow:{...Al,text:Bt,start:de,end:de},"arrow-up":{...vl,...de},"arrow-down":{...vl,...de},"date-range":{...Ka,extendAbove:ri,extendBelow:ri,text:Bt,start:de,end:de},"price-range":{...Ka,extendLeft:ri,extendRight:ri,text:Bt,start:de,end:de},"date-price-range":{...Ka,text:Bt,start:de,end:de}},"an annotation initial state object"),pf={chartType:Qg("candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"),annotations:ml(cf),legend:ml({visible:ri,seriesId:vt,itemId:vt,legendItemName:vt},"legend state array"),zoom:{rangeX:{start:li(Ct,ds),end:li(Ct,ds)},rangeY:{start:li(Ct,ds),end:li(Ct,ds)},ratioX:{start:Zs(Qs,bl("end")),end:Zs(Qs,xl("start"))},ratioY:{start:Zs(Qs,bl("end")),end:Zs(Qs,xl("start"))},autoScaledAxes:qg(Sl("y"))}};import{_ModuleSupport as hf}from"ag-charts-community";import{array as uf,arrayOfDefs as df,boolean as gs,callback as gf,color as eo,fontOptionsDef as ff,number as Ll,positiveNumber as dt,ratio as yf,typeUnion as mf}from"ag-charts-core";import{_ModuleSupport as Sf}from"ag-charts-community";import{_ModuleSupport as za}from"ag-charts-community";function xf(e){return{from:e?{scalingX:1,scalingY:0}:{scalingX:0,scalingY:1},to:{scalingX:1,scalingY:1}}}function bf(e){return(t,i)=>e?{scalingCenterY:i.scaledValues.medianValue}:{scalingCenterX:i.scaledValues.medianValue}}import{_ModuleSupport as Tl}from"ag-charts-community";import{Logger as Df}from"ag-charts-core";var{ScalableGroup:vf,Rect:fs,Line:ys,BBox:kf,Selection:Rl,applyShapeFillBBox:If}=Tl,Af=class extends vf{constructor(){super(),this.append([new fs({tag:0}),new fs({tag:2}),new fs({tag:1}),new ys({tag:3}),new ys({tag:3}),new ys({tag:4}),new ys({tag:4})])}updateDatumStyles(e,t,i,s,o){const{bandwidth:a,scaledValues:{xValue:n,medianValue:r}}=e;let{minValue:l,q1Value:c,q3Value:h,maxValue:u}=e.scaledValues;(i&&!s||!i&&s)&&([u,h,c,l]=[l,c,h,u]);const d=(G,V,K,W)=>i?{y:G,x:V,width:W,height:K}:{x:G,y:V,width:K,height:W},g=(G,V,K)=>i?{y1:G,y2:V,x:K}:{x1:G,x2:V,y:K},y=(G,V,K)=>i?{x1:V,x2:K,y:G}:{x:G,y1:V,y2:K},f=(G,V,K,W)=>({x:G,y:V,width:K,height:W}=d(G,V,K,W),new kf(G,V,K,W)),{opacity:m,fill:S,fillOpacity:D,stroke:b,strokeWidth:x,strokeOpacity:k,lineDash:I,lineDashOffset:A,cornerRadius:v,cap:N,whisker:L}=t;this.opacity=m??1;const M=Rl.select(this,fs),[R]=M.selectByTag(0),[C]=M.selectByTag(2),[w]=M.selectByTag(1),T=M.selectByTag(3),_=M.selectByTag(4);L.strokeWidth>a&&(L.strokeWidth=a);const P=d(c,n,h-c,a);C.setProperties(P),R.setProperties(P),R.setProperties({cornerRadius:v});const O=Math.max(Math.round(r-x/2),c+x),E=Math.min(Math.round(r+x/2),h-x);w.setProperties(P),w.setProperties({visible:O<E,cornerRadius:v,clipBBox:f(O,n+x,E-O,Math.max(0,a-x*2))});const F=Math.floor(n+a*(1-N.lengthRatio)/2),B=Math.ceil(n+a*(1+N.lengthRatio)/2);_[0].setProperties(y(l,F,B)),_[1].setProperties(y(u,F,B)),T[0].setProperties(g(Math.round(l+L.strokeWidth/2),c,Math.floor(n+a/2))),T[1].setProperties(g(h,Math.round(u-L.strokeWidth/2),Math.floor(n+a/2))),If(R,S,o),R.setProperties({fill:S,fillOpacity:D,strokeWidth:x*2,strokeOpacity:0}),w.setProperties({fill:b,fillOpacity:k,strokeWidth:0});for(const G of[...T,..._])G.setProperties(L);C.setProperties({stroke:b,strokeWidth:x,strokeOpacity:k,lineDash:I,lineDashOffset:A,cornerRadius:v,fillOpacity:0})}distanceSquared(e,t){const i=Rl.selectByClass(this,fs,ys);return Tl.nearestSquared(e,t,i).distanceSquared}get midPoint(){const e=this.datum;return e.midPoint===void 0?(Df.error("BoxPlotGroup.datum.midPoint is undefined"),{x:NaN,y:NaN}):e.midPoint}};import{_ModuleSupport as Mf}from"ag-charts-community";var{BaseProperties:Pl,FillGradientDefaults:Nf,FillPatternDefaults:Lf,FillImageDefaults:Tf,AbstractBarSeriesProperties:Rf,makeSeriesTooltip:Pf,Property:re,mergeDefaults:Cf}=Mf,Cl=class extends Pl{constructor(){super(...arguments),this.lengthRatio=.5}};p([re],Cl.prototype,"lengthRatio",2);var Ri=class extends Pl{};p([re],Ri.prototype,"stroke",2),p([re],Ri.prototype,"strokeWidth",2),p([re],Ri.prototype,"strokeOpacity",2),p([re],Ri.prototype,"lineDash",2),p([re],Ri.prototype,"lineDashOffset",2);var pe=class extends Rf{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new Nf,this.fillPatternDefaults=new Lf,this.fillImageDefaults=new Tf,this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.cap=new Cl,this.whisker=new Ri,this.tooltip=Pf()}toJson(){const{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,lineDashOffset:o}=this,a=super.toJson();return a.whisker=Cf(a.whisker,{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,lineDashOffset:o}),a}getStyle(){const{fill:e,fillOpacity:t,strokeWidth:i,strokeOpacity:s,stroke:o,lineDash:a,lineDashOffset:n,cornerRadius:r,cap:l,whisker:c}=this;return{fill:e,fillOpacity:t,strokeWidth:i,strokeOpacity:s,stroke:o,lineDash:a,lineDashOffset:n,cornerRadius:r,cap:l,whisker:c,opacity:1}}};p([re],pe.prototype,"xKey",2),p([re],pe.prototype,"minKey",2),p([re],pe.prototype,"q1Key",2),p([re],pe.prototype,"medianKey",2),p([re],pe.prototype,"q3Key",2),p([re],pe.prototype,"maxKey",2),p([re],pe.prototype,"xName",2),p([re],pe.prototype,"yName",2),p([re],pe.prototype,"minName",2),p([re],pe.prototype,"q1Name",2),p([re],pe.prototype,"medianName",2),p([re],pe.prototype,"q3Name",2),p([re],pe.prototype,"maxName",2),p([re],pe.prototype,"fill",2),p([re],pe.prototype,"fillGradientDefaults",2),p([re],pe.prototype,"fillPatternDefaults",2),p([re],pe.prototype,"fillImageDefaults",2),p([re],pe.prototype,"fillOpacity",2),p([re],pe.prototype,"stroke",2),p([re],pe.prototype,"strokeWidth",2),p([re],pe.prototype,"strokeOpacity",2),p([re],pe.prototype,"lineDash",2),p([re],pe.prototype,"lineDashOffset",2),p([re],pe.prototype,"cornerRadius",2),p([re],pe.prototype,"itemStyler",2),p([re],pe.prototype,"cap",2),p([re],pe.prototype,"whisker",2),p([re],pe.prototype,"tooltip",2);var{fixNumericExtent:_f,keyProperty:wf,mergeDefaults:Ha,SeriesNodePickMode:_l,SMALLEST_KEY_INTERVAL:Ef,valueProperty:ms,diff:Of,animationValidation:Ff,computeBarFocusBounds:Bf,createDatumId:Gf,ContinuousScale:Vf,ChartAxisDirection:Kf,motion:wl,getShapeStyle:$a}=za,Wf=class extends za.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}},to=class extends za.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[_l.NEAREST_NODE,_l.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["medianKey","q1Key","q3Key","minKey","maxKey"]},propertyNames:{x:["xName"],y:["medianName","q1Name","q3Name","minName","maxName"]},categoryKey:"xValue",pathsPerSeries:[]}),this.properties=new pe,this.NodeEvent=Wf}async processData(e){if(!this.visible)return;const{xKey:t,minKey:i,q1Key:s,medianKey:o,q3Key:a,maxKey:n}=this.properties,r=!this.ctx.animationManager.isSkipped(),l=this.getCategoryAxis()?.scale,c=this.getValueAxis()?.scale,{isContinuousX:h,xScaleType:u,yScaleType:d}=this.getScaleInformation({xScale:l,yScale:c}),g=[];r&&this.processedData&&g.push(Of(this.id,this.processedData)),r&&g.push(Ff());const{processedData:y}=await this.requestDataModel(e,this.data,{props:[wf(t,u,{id:"xValue"}),ms(i,d,{id:"minValue"}),ms(s,d,{id:"q1Value"}),ms(o,d,{id:"medianValue"}),ms(a,d,{id:"q3Value"}),ms(n,d,{id:"maxValue"}),...h?[Ef]:[],...g]});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"),n=t.domain.keys[o];return a.type==="key"&&a.valueType==="category"?n:this.padBandExtent(n)}const s=this.domainForClippedRange(e,["minValue","maxValue"],"xValue");return _f(s)}getSeriesRange(e,t){return this.domainForVisibleRange(Kf.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}=this.properties,n=[],r=t.resolveKeysById(this,"xValue",i),l=t.resolveColumnById(this,"minValue",i),c=t.resolveColumnById(this,"q1Value",i),h=t.resolveColumnById(this,"medianValue",i),u=t.resolveColumnById(this,"q3Value",i),d=t.resolveColumnById(this,"maxValue",i),{barWidth:g,groupIndex:y}=this.updateGroupScale(s),f=Vf.is(s.scale)?g*-.5:0,{groupScale:m}=this,S=this.isVertical(),D={itemId:a,nodeData:n,labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible};return e&&(i.dataSources.get(this.id)??[]).forEach((x,k)=>{const I=r[k];if(I==null)return;const A=l[k],v=c[k],N=h[k],L=u[k],M=d[k];if([A,v,N,L,M].some(E=>typeof E!="number")||A>v||v>N||N>L||L>M)return;const R={xValue:Math.round(s.scale.convert(I)),minValue:Math.round(o.scale.convert(A)),q1Value:Math.round(o.scale.convert(v)),medianValue:Math.round(o.scale.convert(N)),q3Value:Math.round(o.scale.convert(L)),maxValue:Math.round(o.scale.convert(M))};R.xValue+=Math.round(m.convert(String(y)))+f;const C=Math.round(g),w=Math.abs(R.q3Value-R.q1Value),T=R.xValue+C/2,_=Math.min(R.q3Value,R.q1Value)+w/2,P={x:S?T:_,y:S?_:T};let O;S?O={x:P.x-C/2,y:R.minValue,width:C,height:R.maxValue-R.minValue}:O={x:R.minValue,y:P.y-C/2,width:R.maxValue-R.minValue,height:C},n.push({series:this,itemId:I,datum:x,datumIndex:k,xKey:a,bandwidth:C,scaledValues:R,midPoint:P,focusRect:O})}),D}legendItemSymbol(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:n,fillGradientDefaults:r,fillPatternDefaults:l,fillImageDefaults:c}=this.properties;return{marker:$a({fill:e,fillOpacity:t,stroke:i,strokeOpacity:o,strokeWidth:s,lineDash:a,lineDashOffset:n},r,l,c)}}getLegendData(e){const{id:t,ctx:{legendManager:i},visible:s}=this,{xKey:o,yName:a,showInLegend:n,legendItemName:r}=this.properties;return!o||e!=="category"?[]:[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:t}),label:{text:r??a??t},symbol:this.legendItemSymbol(),legendItemName:r,hideInLegend:!n}]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:o}=this,{xKey:a,xName:n,yName:r,medianKey:l,medianName:c,q1Key:h,q1Name:u,q3Key:d,q3Name:g,minKey:y,minName:f,maxKey:m,maxName:S,legendItemName:D,tooltip:b}=o,x=this.getCategoryAxis(),k=this.getValueAxis();if(!i||!s||!x||!k)return;const I=s.dataSources.get(this.id)?.[e],A=i.resolveKeysById(this,"xValue",s)[e],v=i.resolveColumnById(this,"minValue",s)[e],N=i.resolveColumnById(this,"q1Value",s)[e],L=i.resolveColumnById(this,"medianValue",s)[e],M=i.resolveColumnById(this,"q3Value",s)[e],R=i.resolveColumnById(this,"maxValue",s)[e];if(A==null)return;const C=this.getItemStyle({datumIndex:e,datum:I},!1),w=[{label:f,fallbackLabel:y,value:this.getAxisValueText(k,"tooltip",v,I,y,D)},{label:u,fallbackLabel:h,value:this.getAxisValueText(k,"tooltip",N,I,h,D)},{label:c,fallbackLabel:l,value:this.getAxisValueText(k,"tooltip",L,I,l,D)},{label:g,fallbackLabel:d,value:this.getAxisValueText(k,"tooltip",M,I,d,D)},{label:S,fallbackLabel:m,value:this.getAxisValueText(k,"tooltip",R,I,m,D)}];return this.formatTooltipWithContext(b,{heading:this.getAxisValueText(x,"tooltip",A,I,a,D),title:D??r,symbol:this.legendItemSymbol(),data:w},{seriesId:t,datum:I,title:r,xKey:a,xName:n,yName:r,medianKey:l,medianName:c,q1Key:h,q1Name:u,q3Key:d,q3Name:g,minKey:y,minName:f,maxKey:m,maxName:S,...C})}animateEmptyUpdateReady({datumSelection:e}){const t=this.isVertical(),{from:i,to:s}=xf(t);wl.resetMotion([e],bf(t)),wl.staticFromToMotion(this.id,"datums",this.ctx.animationManager,[e],i,s,{phase:"initial"})}isLabelEnabled(){return!1}updateDatumSelection(e){const t=e.nodeData??[];return e.datumSelection.update(t)}getItemStyle({datumIndex:e,datum:t},i){const{id:s,properties:o}=this,{xKey:a,minKey:n,q1Key:r,medianKey:l,q3Key:c,maxKey:h,fillGradientDefaults:u,fillPatternDefaults:d,fillImageDefaults:g,itemStyler:y}=o,f=this.getHighlightStyle(i);let m=$a(Ha(f,o.getStyle()),u,d,g);if(y!=null&&e!=null){const I=this.cachedDatumCallback(Gf(e,i?"highlight":"node"),()=>{const A=this.ctx.highlightManager?.getActiveHighlight(),v=this.getHighlightStateString(A,i,e);return this.callWithContext(y,{seriesId:s,datum:t,xKey:a,minKey:n,q1Key:r,medianKey:l,q3Key:c,maxKey:h,highlighted:i,highlightState:v,...m})});I&&(m=$a(Ha(I,m),u,d,g))}const{stroke:S,strokeWidth:D,strokeOpacity:b,lineDash:x,lineDashOffset:k}=m;return m.whisker=Ha(m.whisker,{stroke:S,strokeWidth:D,strokeOpacity:b,lineDash:x,lineDashOffset:k}),m}updateDatumNodes({datumSelection:e,isHighlight:t}){const i=this.isVertical(),s=this.getValueAxis()?.isReversed();e.each((o,a)=>{const n=this.getItemStyle(a,t),r=this.getShapeFillBBox();o.updateDatumStyles(a,n,i,s,r)})}updateLabelNodes(){}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}nodeFactory(){return new Af}computeFocusBounds({datumIndex:e}){return Bf(this,this.contextNodeData?.nodeData[e].focusRect)}hasItemStylers(){return this.properties.itemStyler!=null}};to.className="BoxPlotSeries",to.type="box-plot";import{_ModuleSupport as zf}from"ag-charts-community";import{boolean as Hf,constant as $f,required as ci,string as st}from"ag-charts-core";var{boxPlotSeriesThemeableOptionsDef:Xf,commonSeriesOptionsDefs:Yf}=zf,Uf={...Yf,...Xf,type:ci($f("box-plot")),xKey:ci(st),minKey:ci(st),q1Key:ci(st),medianKey:ci(st),q3Key:ci(st),maxKey:ci(st),xName:st,yName:st,minName:st,q1Name:st,medianName:st,q3Name:st,maxName:st,grouped:Hf,legendItemName:st};import{_ModuleSupport as Ss}from"ag-charts-community";var{ThemeConstants:{CARTESIAN_AXIS_TYPE:El},multiSeriesHighlightStyle:qf}=Ss,jf={series:{direction:"vertical",fill:{$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$palette:"fill"}}]},{$palette:"fill"},{$mix:[Ss.SAFE_FILL_OPERATION,{$ref:"chartBackgroundColor"},.7]}]},stroke:{$palette:"stroke"},fillGradientDefaults:Ss.FILL_GRADIENT_LINEAR_DEFAULTS,fillPatternDefaults:Ss.FILL_PATTERN_DEFAULTS,fillImageDefaults:Ss