var _d=Object.defineProperty,Cm=Object.getOwnPropertyDescriptor,jC=Object.getOwnPropertyNames,WC=Object.prototype.hasOwnProperty,Un=(t,e)=>{for(var i in e)_d(t,i,{get:e[i],enumerable:!0})},Tm=(t,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of jC(e))!WC.call(t,n)&&n!==i&&_d(t,n,{get:()=>e[n],enumerable:!(s=Cm(e,n))||s.enumerable});return t},YC=(t,e,i)=>(Tm(t,e,"default"),i&&Tm(i,e,"default")),y=(t,e,i,s)=>{for(var n=s>1?void 0:s?Cm(e,i):e,a=t.length-1,r;a>=0;a--)(r=t[a])&&(n=(s?r(e,i,n):r(n))||n);return s&&n&&_d(e,i,n),n},Lm={ariaInitSeriesArea:"interactive chart",ariaAnnounceHoverDatum:"${datum}",ariaAnnounceChart:"chart, ${seriesCount}[number] series",ariaAnnounceStandaloneChart:"chart, ${caption}",ariaAnnounceHierarchyChart:"hierarchy chart, ${caption}",ariaAnnounceGaugeChart:"gauge chart, ${caption}",ariaAnnounceHierarchyDatum:"level ${level}[number], ${count}[number] children, ${description}",ariaAnnounceFlowProportionLink:"link ${index} of ${count}, from ${from} to ${to}, ${sizeName} ${size}",ariaAnnounceFlowProportionNode:"node ${index} of ${count}, ${description}",ariaDescriptionLegendItem:"Press Space or Enter to toggle visibility",ariaLabelAddHorizontalLine:"Add Horizontal Line",ariaLabelAnnotationsToolbar:"Annotations",ariaLabelAnnotationOptionsToolbar:"Annotation Options",ariaLabelAnnotationSettingsDialog:"Annotation Settings",ariaLabelColor:"Color",ariaLabelColorPicker:"Color picker",ariaLabelColorPickerAlpha:"Transparency",ariaLabelColorPickerHue:"Hue",ariaLabelColorPickerMultiColor:"Multi Color",ariaLabelColorPickerPalette:"Palette",ariaLabelFinancialCharts:"Financial Charts",ariaLabelGaugeTarget:"Target",ariaLabelGaugeValue:"Value",ariaLabelLegend:"Legend",ariaLabelLegendPagination:"Legend Pagination",ariaLabelLegendPagePrevious:"Previous Legend Page",ariaLabelLegendPageNext:"Next Legend Page",ariaLabelLegendItem:"${label}, Legend item ${index}[number] of ${count}[number]",ariaLabelLegendItemUnknown:"Unknown legend item",ariaLabelNavigator:"Navigator",ariaLabelNavigatorRange:"Range",ariaLabelScrollbarHorizontal:"X-axis scrollbar",ariaLabelScrollbarVertical:"Y-axis scrollbar",ariaLabelNavigatorMinimum:"Minimum",ariaLabelNavigatorMaximum:"Maximum",ariaLabelRangesToolbar:"Ranges",ariaLabelSettingsTabBar:"Settings",ariaLabelZoomToolbar:"Zoom",ariaRoleDescription2DSlider:"2D slider",ariaValueColorPalette:"s ${s}[percent0to2dp], v ${v}[percent0to2dp]",ariaValueColorPaletteFirstV:"v ${v}[percent0to2dp], s ${s}[percent0to2dp]",ariaValuePanRange:"${min}[percent0to2dp] to ${max}[percent0to2dp]",iconAltTextLineStyleSolid:"Solid",iconAltTextLineStyleDashed:"Long-dashed",iconAltTextLineStyleDotted:"Short-dashed",iconAltTextPositionTop:"Top",iconAltTextPositionCenter:"Center",iconAltTextPositionBottom:"Bottom",iconAltTextAlignLeft:"Left",iconAltTextAlignCenter:"Center",iconAltTextAlignRight:"Right",iconAltTextClose:"Close",overlayLoadingData:"Loading data...",overlayNoData:"No data to display",overlayNoVisibleSeries:"No visible series",overlayUnsupportedBrowser:"Incompatible browser version. Please upgrade your browser.",seriesHistogramTooltipFrequency:"Frequency",seriesHistogramTooltipSum:"${yName} (sum)",seriesHistogramTooltipCount:"${yName} (count)",seriesHistogramTooltipMean:"${yName} (mean)",toolbarSeriesTypeDropdown:"Chart Type",toolbarSeriesTypeOHLC:"OHLC",toolbarSeriesTypeHLC:"HLC",toolbarSeriesTypeHighLow:"High Low",toolbarSeriesTypeCandles:"Candles",toolbarSeriesTypeHollowCandles:"Hollow Candles",toolbarSeriesTypeLine:"Line",toolbarSeriesTypeLineWithMarkers:"Line with Markers",toolbarSeriesTypeStepLine:"Step Line",toolbarAnnotationsTrendLine:"Trend Line",toolbarAnnotationsFibonacciRetracement:"Fib Retracement",toolbarAnnotationsFibonacciRetracementTrendBased:"Fib Trend Based",toolbarAnnotationsHorizontalLine:"Horizontal Line",toolbarAnnotationsVerticalLine:"Vertical Line",toolbarAnnotationsParallelChannel:"Parallel Channel",toolbarAnnotationsDisjointChannel:"Disjoint Channel",toolbarAnnotationsClearAll:"Clear All",toolbarAnnotationsFillColor:"Fill Color",toolbarAnnotationsLineColor:"Line Color",toolbarAnnotationsLineStyle:"Line Style",toolbarAnnotationsLineStrokeWidth:"Line Stroke Width",toolbarAnnotationsSettings:"Settings",toolbarAnnotationsTextColor:"Text Color",toolbarAnnotationsTextSize:"Text Size",toolbarAnnotationsLock:"Lock",toolbarAnnotationsUnlock:"Unlock",toolbarAnnotationsDelete:"Delete",toolbarAnnotationsDragHandle:"Drag Toolbar",toolbarAnnotationsLineAnnotations:"Trend Lines",toolbarAnnotationsFibonacciAnnotations:"Fibonacci",toolbarAnnotationsTextAnnotations:"Text Annotations",toolbarAnnotationsShapeAnnotations:"Arrows",toolbarAnnotationsMeasurerAnnotations:"Measurers",toolbarAnnotationsCallout:"Callout",toolbarAnnotationsComment:"Comment",toolbarAnnotationsNote:"Note",toolbarAnnotationsText:"Text",toolbarAnnotationsArrow:"Arrow",toolbarAnnotationsArrowUp:"Arrow Up",toolbarAnnotationsArrowDown:"Arrow Down",toolbarAnnotationsDateRange:"Date Range",toolbarAnnotationsPriceRange:"Price Range",toolbarAnnotationsDatePriceRange:"Date and Price",toolbarAnnotationsQuickDatePriceRange:"Measure",toolbarRange1Month:"1M",toolbarRange1MonthAria:"1 month",toolbarRange3Months:"3M",toolbarRange3MonthsAria:"3 months",toolbarRange6Months:"6M",toolbarRange6MonthsAria:"6 months",toolbarRangeYearToDate:"YTD",toolbarRangeYearToDateAria:"Year to date",toolbarRange1Year:"1Y",toolbarRange1YearAria:"1 year",toolbarRangeAll:"All",toolbarRangeAllAria:"All",toolbarRangeSelectRange:"Select range",toolbarRangeSelectRangeAria:"Select range",toolbarZoomZoomOut:"Zoom out",toolbarZoomZoomIn:"Zoom in",toolbarZoomPanLeft:"Pan left",toolbarZoomPanRight:"Pan right",toolbarZoomPanStart:"Pan to the start",toolbarZoomPanEnd:"Pan to the end",toolbarZoomReset:"Reset the zoom",contextMenuDownload:"Download",contextMenuToggleSeriesVisibility:"Toggle Visibility",contextMenuToggleOtherSeries:"Toggle Other Series",contextMenuZoomToCursor:"Zoom to here",contextMenuPanToCursor:"Pan to here",contextMenuResetZoom:"Reset zoom",dialogHeaderChannel:"Channel",dialogHeaderLine:"Line",dialogHeaderFibonacciRange:"Fib Retracement",dialogHeaderDateRange:"Date Range",dialogHeaderPriceRange:"Price Range",dialogHeaderDatePriceRange:"Date and Price",dialogHeaderText:"Text",dialogInputAlign:"Align",dialogInputColorPicker:"Color",dialogInputColorPickerAltText:"Text Color",dialogInputFillColorPicker:"Fill",dialogInputFillColorPickerAltText:"Fill Color",dialogInputExtendChannelStart:"Extend channel start",dialogInputExtendChannelEnd:"Extend channel end",dialogInputExtendLineStart:"Extend line start",dialogInputExtendLineEnd:"Extend line end",dialogInputExtendAbove:"Extend above",dialogInputExtendBelow:"Extend below",dialogInputExtendLeft:"Extend left",dialogInputExtendRight:"Extend right",dialogInputReverse:"Reverse",dialogInputShowFill:"Show Fill",dialogInputFontSize:"Size",dialogInputFontSizeAltText:"Font Size",dialogInputLineStyle:"Dash",dialogInputPosition:"Position",dialogInputStrokeWidth:"Weight",dialogInputStrokeWidthAltText:"Line Weight",dialogInputFibonacciBands:"Bands",dialogInputFibonacciBandsAltText:"Fibonacci Bands",inputTextareaPlaceholder:"Add Text",measurerDateRangeBars:"${value}[number] bars",measurerPriceRangeValue:"${value}[number]",measurerPriceRangePercent:"${value}[percent]",measurerVolume:"Vol ${value}",tooltipPaginationStatus:"${index}[number] of ${count}[number]"},$C=void 0,KC=void 0;KC=$C;var ZC=void 0,XC=void 0;XC=ZC;var Nm=(t=>(t.POINTER="pointer",t.NODE="node",t.CHART="chart",t))(Nm||{}),km=(t=>(t.TOP="top",t.RIGHT="right",t.BOTTOM="bottom",t.LEFT="left",t.TOP_RIGHT="top-right",t.BOTTOM_RIGHT="bottom-right",t.BOTTOM_LEFT="bottom-left",t.TOP_LEFT="top-left",t.CENTER="center",t))(km||{}),qC=void 0,JC=void 0;JC=qC;var QC=void 0,eT=void 0;eT=QC;import{Logger as tT}from"ag-charts-core";function wm(t,e,i,s){return{unit:t,step:e,epoch:i,utc:s,every(n){return wm(this.unit,(this.step??1)*n,this.epoch,this.utc)}}}var Om={};function Oe(t,e=1,i,s=!1){tT.warnOnce("time import is deprecated, use object notation instead");const n=`${t}:${e}:${i?.getTime()??0}:${s}`;let a=Om[n];return a==null&&(a=wm(t,e,i,s),Om[n]=a),a}var iT={get millisecond(){return Oe("millisecond")},get second(){return Oe("second")},get minute(){return Oe("minute")},get hour(){return Oe("hour")},get day(){return Oe("day")},get monday(){return Oe("day",7,new Date(1970,0,5))},get tuesday(){return Oe("day",7,new Date(1970,0,6))},get wednesday(){return Oe("day",7,new Date(1970,0,7))},get thursday(){return Oe("day",7,new Date(1970,0,1))},get friday(){return Oe("day",7,new Date(1970,0,2))},get saturday(){return Oe("day",7,new Date(1970,0,3))},get sunday(){return Oe("day",7,new Date(1970,0,4))},get month(){return Oe("month")},get year(){return Oe("year")},get utcMillisecond(){return Oe("millisecond",1,void 0,!0)},get utcSecond(){return Oe("second",1,void 0,!0)},get utcMinute(){return Oe("minute",1,void 0,!0)},get utcHour(){return Oe("hour",1,void 0,!0)},get utcDay(){return Oe("day",1,void 0,!0)},get utcMonth(){return Oe("month",1,void 0,!0)},get utcYear(){return Oe("year",1,void 0,!0)}};import{Debug as Fd,MementoCaretaker as sT,ModuleRegistry as Em,deepClone as Ka,deepFreeze as nT,enterpriseRegistry as xo,jsonWalk as aT,strictObjectKeys as rT}from"ag-charts-core";import{ActionOnSet as qs,AgDocument as oT,AsyncAwaitQueue as Rm,ChartAxisDirection as Hn,ChartUpdateType as z,CleanupRegistry as lT,Color as Pm,Debug as Vd,Logger as jn,ModuleRegistry as Wn,ModuleType as vo,Padding as cT,Property as es,ProxyProperty as Bd,ZIndexMap as zd,callWithContext as hT,createId as dT,enterpriseRegistry as _m,entries as Fm,getWindow as uT,isFiniteNumber as Vm,isInputPending as pT,jsonApply as Gd,jsonDiff as gT,mergeDefaults as fT,pause as Bm,roundTo as mT,toPlainText as yT,without as bT}from"ag-charts-core";import{boxContains as xT,boxesEqual as vT,clamp as zm,nearestSquared as ST}from"ag-charts-core";var Zl=Symbol("interpolate"),Xl=t=>t[Zl]!=null,So=class yo{constructor(e,i,s,n){this.x=e,this.y=i,this.width=s,this.height=n}static fromObject({x:e,y:i,width:s,height:n}){return new yo(e,i,s,n)}static merge(e){let i=1/0,s=1/0,n=-1/0,a=-1/0;for(const r of e)r.xn&&(n=Tt(r.x,r.width)),Tt(r.y,r.height)>a&&(a=Tt(r.y,r.height));return new yo(i,s,n-i,a-s)}static nearestBox(e,i,s){return ST(e,i,s)}toDOMRect(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.y,left:this.x,right:Tt(this.x,this.width),bottom:Tt(this.y,this.height),toJSON(){return{}}}}clone(){const{x:e,y:i,width:s,height:n}=this;return new yo(e,i,s,n)}equals(e){return vT(this,e)}containsPoint(e,i){return xT(this,e,i)}intersectsWith(e){return!(this.x+this.width<=e.x||e.x+e.width<=this.x||this.y+this.height<=e.y||e.y+e.height<=this.y)}intersection(e){const i=Math.max(this.x,e.x),s=Math.max(this.y,e.y),n=Math.min(Tt(this.x,this.width),Tt(e.x,e.width)),a=Math.min(Tt(this.y,this.height),Tt(e.y,e.height));if(!(i>n||s>a))return new yo(i,s,n-i,a-s)}collidesBBox(e){return this.xe.x&&this.ye.y}computeCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)&&Number.isFinite(this.width)&&Number.isFinite(this.height)}distanceSquared(e,i){if(this.containsPoint(e,i))return 0;const s=e-zm(this.x,e,Tt(this.x,this.width)),n=i-zm(this.y,i,Tt(this.y,this.height));return s*s+n*n}shrink(e,i){if(typeof e=="number")this.applyMargin(e,i);else for(const s of Object.keys(e)){const n=e[s];typeof n=="number"&&this.applyMargin(n,s)}return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this}grow(e,i){if(typeof e=="number")this.applyMargin(-e,i);else for(const s of Object.keys(e)){const n=e[s];typeof n=="number"&&this.applyMargin(-n,s)}return this}applyMargin(e,i){switch(i){case"top":this.y+=e;case"bottom":this.height-=e;break;case"left":this.x+=e;case"right":this.width-=e;break;case"vertical":this.y+=e,this.height-=e*2;break;case"horizontal":this.x+=e,this.width-=e*2;break;case void 0:this.x+=e,this.y+=e,this.width-=e*2,this.height-=e*2;break}}translate(e,i){return this.x+=e,this.y+=i,this}[Zl](e,i){return new yo(this.x*(1-i)+e.x*i,this.y*(1-i)+e.y*i,this.width*(1-i)+e.width*i,this.height*(1-i)+e.height*i)}};So.zero=Object.freeze(new So(0,0,0,0)),So.NaN=Object.freeze(new So(Number.NaN,Number.NaN,Number.NaN,Number.NaN));var P=So;function Tt(t,e){return t===-1/0&&e===1/0?1/0:t+e}import{clamp as IT,toIterable as DT}from"ag-charts-core";import{getOffscreenCanvas as Gm}from"ag-charts-core";import{Debug as MT}from"ag-charts-core";function Um({context:t,pixelRatio:e,width:i,height:s}){t.save();try{t.resetTransform(),t.clearRect(0,0,Math.ceil(i*e),Math.ceil(s*e))}finally{t.restore()}}function Hm(t){if(MT.check("canvas")){const e=t.save.bind(t),i=t.restore.bind(t);let s=0;Object.assign(t,{save(){e(),s++},restore(){if(s===0)throw new Error("AG Charts - Unable to restore() past depth 0");i(),s--},verifyDepthZero(){if(s!==0)throw new Error(`AG Charts - Save/restore depth is non-zero: ${s}`)}})}}function jm(t,e,i){return[Math.floor(t*i),Math.floor(e*i)]}var Ud;function AT(){const t=Gm();return Ud??(Ud=new t(1,1)),Ud}var Hd=class{constructor(t){const{width:e,height:i,pixelRatio:s,willReadFrequently:n=!1}=t;this.width=e,this.height=i,this.pixelRatio=s;const[a,r]=jm(e,i,s),o=Gm();this.canvas=new o(a,r),this.context=this.canvas.getContext("2d",{willReadFrequently:n}),this.context.setTransform(s,0,0,s,0,0),Hm(this.context)}drawImage(t,e=0,i=0){return t.drawImage(this.canvas,e,i)}transferToImageBitmap(){return this.canvas.width<1||this.canvas.height<1?AT().transferToImageBitmap():this.canvas.transferToImageBitmap()}resize(t,e,i){if(!(t>0&&e>0))return;const{canvas:s,context:n}=this;if(t!==this.width||e!==this.height||i!==this.pixelRatio){const[a,r]=jm(t,e,i);s.width=a,s.height=r}n.setTransform(i,0,0,i,0,0),this.width=t,this.height=e,this.pixelRatio=i}clear(){Um(this)}destroy(){this.canvas.width=0,this.canvas.height=0,this.context.clearRect(0,0,0,0),this.canvas=null,this.context=null,Object.freeze(this)}};import{DeclaredSceneChangeDetection as Wm,Logger as jd,assignIfNotStrictlyEqual as Ym,createId as CT,createSvgElement as $m,objectsEqual as TT}from"ag-charts-core";var Wd=(t,e)=>Math.sign(t-e);function Km(t,e){if(typeof t=="number"&&typeof e=="number")return Wd(t,e);const i=typeof t=="number"?[t]:t,s=typeof e=="number"?[e]:e,n=Math.min(i.length,s.length);for(let a=0;a(t[t.All=0]="All",t[t.None=1]="None",t))(Zm||{}),LT=5,Yn=class Sm{constructor(e){this.serialNumber=Sm._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=CT(this),this.name=void 0,this.transitionOut=void 0,this.pointerEvents=0,this._datum=void 0,this._previousDatum=void 0,this.scene=void 0,this._debugDirtyProperties=void 0,this.parentNode=void 0,this.cachedBBox=void 0,this.isContainerNode=!1,this.visible=!0,this.zIndex=0,this.batchLevel=0,this.batchDirty=!1,this.name=e?.name,this.tag=e?.tag??Number.NaN,this.zIndex=e?.zIndex??0,this.scene=e?.scene,(e?.debugDirty??Sm._debugEnabled)&&(this._debugDirtyProperties=new Map([["__first__",[]]]))}static toSVG(e,i,s){const n=e?.toSVG();if(n==null||!n.elements.length&&!n.defs?.length)return;const a=$m("svg");if(a.setAttribute("width",String(i)),a.setAttribute("height",String(s)),a.setAttribute("viewBox",`0 0 ${i} ${s}`),a.setAttribute("overflow","visible"),n.defs?.length){const r=$m("defs");r.append(...n.defs),a.append(r)}return a.append(...n.elements),a.outerHTML}static*extractBBoxes(e,i){for(const s of e)if(!i||s.visible&&!s.transitionOut){const n=s.getBBox();n&&(yield n)}}get datum(){return this._datum}set datum(e){this._datum!==e&&(this._previousDatum=this._datum,this._datum=e)}get previousDatum(){return this._previousDatum}get layerManager(){return this.scene?.layersManager}get imageLoader(){return this.scene?.imageLoader}closestDatum(){for(const{datum:e}of this.traverseUp(!0))if(e!=null)return e}preRender(e,i=1){if(this.childNodeCounts.groups=0,this.childNodeCounts.nonGroups=1,this.childNodeCounts.complexity=i,this.childNodeCounts.thisComplexity=i,this.batchLevel>0||this.batchDirty)throw new Error("AG Charts - illegal rendering state; batched update in progress");return this.childNodeCounts}isolatedRender(e){e.ctx.save();try{this.render(e)}catch(i){const s=i.errorCount??1;if(s>=LT)throw i.errorCount=s,i;jd.warnOnce("Error during rendering",i,i.stack)}finally{e.ctx.restore()}}render(e){const{stats:i}=e;if(this.debugDirtyProperties(),e.debugNodeSearch){const s=this.name??this.id;e.debugNodeSearch.some(n=>typeof n=="string"?n===s:n.test(s))&&(e.debugNodes[this.name??this.id]=this)}i&&(i.nodesRendered++,i.opsPerformed+=this.childNodeCounts.thisComplexity)}setScene(e){this.scene=e}*traverseUp(e){e&&(yield this);let i=this.parentNode;for(;i;)yield i,i=i.parentNode}isRoot(){return!this.parentNode}removeChild(e){throw new Error(`AG Charts - internal error, unknown child node ${e.name??e.id} in $${this.name??this.id}`)}remove(){this.parentNode?.removeChild(this)}destroy(){this.parentNode&&this.remove()}batchedUpdate(e){this.batchLevel++;try{e()}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}}setProperties(e){this.batchLevel++;try{Ym(this,e)}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}return this}setPropertiesWithKeys(e,i){this.batchLevel++;try{Ym(this,e,i)}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}return this}containsPoint(e,i){return!1}pickNode(e,i){if(this.containsPoint(e,i))return this}pickNodes(e,i,s=[]){return this.containsPoint(e,i)&&s.push(this),s}getBBox(){return this.cachedBBox??(this.cachedBBox=Object.freeze(this.computeBBox())),this.cachedBBox}computeBBox(){}onChangeDetection(e){this.markDirty(e)}markDirtyChildrenOrder(){this.cachedBBox=void 0}markDirty(e){if(this.batchLevel>0){this.batchDirty=!0;return}e!=null&&this._debugDirtyProperties&&this.markDebugProperties(e),this.cachedBBox=void 0,this.parentNode?.markDirty()}markDebugProperties(e){const i=this._debugDirtyProperties?.get(e)??[],s=new Error("Stack trace for property change tracking").stack?.split(` `).filter(n=>n!=="Error"&&!n.includes(".markDebugProperties")&&!n.includes(".markDirty")&&!n.includes("Object.assign ")&&!n.includes(`${this.constructor.name}.`))??"unknown";i.push(s[0].replace(" at ","").trim()),this._debugDirtyProperties?.set(e,i)}debugDirtyProperties(){if(this._debugDirtyProperties!=null){if(!this._debugDirtyProperties.has("__first__"))for(const[e,i]of this._debugDirtyProperties.entries())i.length>1&&jd.logGroup(`Property changed multiple times before render: ${this.constructor.name}.${e} (${i.length}x)`,()=>{for(const s of i)jd.log(s)});this._debugDirtyProperties.clear()}}static handleNodeZIndexChange(e){e.onZIndexChange()}onZIndexChange(){this.parentNode?.markDirtyChildrenOrder()}resolveFont(){}toSVG(){}};Yn.className="AbstractNode",Yn._nextSerialNumber=0,Yn._debugEnabled=!1,y([Wm()],Yn.prototype,"visible",2),y([Wm({equals:TT,changeCb:Yn.handleNodeZIndexChange})],Yn.prototype,"zIndex",2);var Ms=Yn;import{DeclaredSceneChangeDetection as As,DeclaredSceneObjectChangeDetection as Yd,SceneArrayChangeDetection as NT,SceneObjectChangeDetection as Xm,TRIPLE_EQ as kT,boxesEqual as wT,clamp as OT,generateUUID as $d,isGradientFill as Kd,isImageFill as qm,isPatternFill as Jm,isString as ET,objectsEqual as ql}from"ag-charts-core";import{createSvgElement as RT,normalizeAngle360FromDegrees as PT}from"ag-charts-core";import{createSvgElement as _T}from"ag-charts-core";import{Color as Zd,Logger as Xd,clamp as FT}from"ag-charts-core";var Jl=class{ticks(t,e,i){}niceDomain(t,e=this.domain){return e}get bandwidth(){}get step(){}get inset(){}},Ql=(t,e)=>{const i=Symbol(String(e));t[i]=void 0,Object.defineProperty(t,e,{get(){return this[i]},set(s){this[i]!==s&&(this[i]=s,this.invalid=!0)},enumerable:!0,configurable:!1})};import{clamp as Qm,readIntegratedWrappedValue as ey}from"ag-charts-core";function ty(t,e,i){if(i==null||i[0]===0&&i[1]===1)return;const s=Qm(0,Math.floor(i[0]*t.length),t.length),n=Qm(0,Math.ceil(i[1]*t.length),t.length),a=e?t.length-n:s,r=e?t.length-s:n;return[a,r]}function iy(t,e,i){return ty(t,e,i)??[0,t.length]}function sy(t,e,i){const s=ty(t,e,i);if(s==null)return{ticks:t,count:t.length,firstTickIndex:0};const[n,a]=s;return{ticks:t.slice(n,a),count:t.length,firstTickIndex:n}}function ec(t){const e=ey(t.at(0)),i=ey(t.at(-1));return e!=null&&i!=null?[e,i]:[void 0,void 0]}var ny=t=>{const e=Zd.fromString(t),[i,s,n]=Zd.RGBtoOKLCH(e.r,e.g,e.b);return{l:i,c:s,h:n,a:e.a}},qd=1e-6,ay=t=>t.c1-qd,VT=(t,e,i)=>{i=FT(0,i,1);let s;if(ay(t))s=e.h;else if(ay(e))s=t.h;else{const o=t.h;let l=e.h;const c=e.h-t.h;c>180?l-=360:c<-180&&(l+=360),s=o*(1-i)+l*i}const n=t.c*(1-i)+e.c*i,a=t.l*(1-i)+e.l*i,r=t.a*(1-i)+e.a*i;return Zd.fromOKLCH(a,n,s,r)},Za=class extends Jl{constructor(){super(...arguments),this.type="color",this.defaultTickCount=0,this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.parsedRange=this.range.map(ny)}update(){const{domain:t,range:e}=this;t.length<2&&(Xd.warnOnce("`colorDomain` should have at least 2 values."),t.length===0?t.push(0,1):t.length===1&&t.push(t[0]+1));for(let i=1;in){Xd.warnOnce("`colorDomain` values should be supplied in ascending order."),t.sort((a,r)=>a-r);break}}if(e.length0?e[0]:"black");this.parsedRange=this.range.map(ny)}normalizeDomains(...t){return{domain:t.map(e=>e.domain).flat(),animatable:!0}}toDomain(){}convert(t){this.refresh();const{domain:e,range:i,parsedRange:s}=this,n=e[0],a=e.at(-1),r=i[0],o=i.at(-1);if(t<=n)return r;if(t>=a)return o;let l,c;if(e.length===2){const u=(t-n)/(a-n),p=1/(i.length-1);l=i.length<=2?0:Math.min(Math.floor(u*(i.length-1)),i.length-2),c=(u-l*p)/p}else{for(l=0;l{const{stop:s}=e,n=t.at(i+1)?.color;return n==null?[e]:[e,{stop:s,color:n}]})}function KT(t,e){const i=e==="discrete"?1:0,s=t.map((n,a,{length:r})=>({stop:(a+i)/(r-1+i),color:n}));return e==="discrete"?oy(s):s}function ly(t,e,i,s="continuous"){const n=t.map(g=>typeof g=="string"?{color:g}:g);if(n.length===0)return KT(e,s);if(!$T(n))return YT.warnOnce("[fills] must have the stops defined in ascending order"),[];const a=Math.min(...i),r=Math.max(...i),o=s==="discrete",l=new Float64Array(n.length);let c=0,h=-1;for(let g=0;g=h){h=n.length-1;for(let b=g+1;bg.color!=null)?.color,u;const p=n.map((g,f)=>{let m=g?.color;const b=l[f];return m!=null?d=m:d==null?(u==null&&(u=new Za,u.domain=[0,1],u.range=e),m=u.convert(b)):m=d,{stop:b,color:m}});return s==="discrete"?oy(p):p}import{Logger as ZT,createSvgElement as eu,getDOMMatrix as XT,normalizeAngle360FromDegrees as qT}from"ag-charts-core";var JT=class{constructor(t,e){this.imageLoader=t,this._cache=void 0,this.url=e.url,this.backgroundFill=e.backgroundFill??"black",this.backgroundFillOpacity=e.backgroundFillOpacity??1,this.repeat=e.repeat??"no-repeat",this.width=e.width,this.height=e.height,this.fit=e.fit??"stretch",this.rotation=e.rotation??0}createCanvasImage(t,e,i,s){if(!e)return null;const[n,a]=this.getSize(e.width,e.height,i,s);return n<1||a<1?(ZT.warnOnce("Image fill is too small to render, ignoring."),null):t.createPattern(e,this.repeat)}getSize(t,e,i,s){const{fit:n}=this;let a=t,r=e,o=1;const l=i/s,c=t/e;return n==="stretch"||t===0||e===0?(a=i,r=s):n==="contain"?o=c>l?i/t:s/e:n==="cover"&&(o=c>l?s/e:i/t),[Math.max(1,a*o),Math.max(1,r*o)]}setImageTransform(t,e){if(typeof t=="string")return;const{url:i,rotation:s,width:n,height:a}=this,r=this.imageLoader?.loadImage(i);if(!r)return;const o=qT(s),l=Math.cos(o),c=Math.sin(o),[h,d]=this.getSize(r.width,r.height,n??e.width,a??e.height),u=h/r.width,p=d/r.height,g=e.x+e.width/2,f=e.y+e.height/2,m=l*h-c*d,b=c*h+l*d,x=m/2,v=b/2,S=XT();t?.setTransform(new S([l*u,c*p,-c*u,l*p,g-x,f-v]))}createPattern(t,e,i,s){const n=this.width??e,a=this.height??i,r=this._cache;if(r?.ctx===t&&r.width===n&&r.height===a)return r.pattern;const o=this.imageLoader?.loadImage(this.url,s),l=this.createCanvasImage(t,o,n,a);if(l!=null)return this._cache={ctx:t,pattern:l,width:n,height:a},l}toSvg(t,e){const{url:i,rotation:s,backgroundFill:n,backgroundFillOpacity:a}=this,{x:r,y:o,width:l,height:c}=t,h=eu("pattern");h.setAttribute("viewBox",`0 0 ${l} ${c}`),h.setAttribute("x",String(r)),h.setAttribute("y",String(o)),h.setAttribute("width",String(l)),h.setAttribute("height",String(c)),h.setAttribute("patternUnits","userSpaceOnUse");const d=eu("rect");d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("width",String(l)),d.setAttribute("height",String(c)),d.setAttribute("fill",n),d.setAttribute("fill-opacity",String(a)),h.appendChild(d);const u=eu("image");return u.setAttribute("href",i),u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(l)),u.setAttribute("height",String(c)),u.setAttribute("preserveAspectRatio","none"),u.setAttribute("transform",`scale(${1/e}) rotate(${s}, ${l/2}, ${c/2})`),h.appendChild(u),h}};import{Logger as QT,createSvgElement as tu,getDOMMatrix as eL,normalizeAngle360FromDegrees as tL}from"ag-charts-core";import{bezier2DDistance as iL,bezier2DExtrema as sL,evaluateBezier as cy,getPath2D as hy,lineDistanceSquared as dy,normalizeAngle360 as uy}from"ag-charts-core";import{Logger as py}from"ag-charts-core";var nL=/^[\t\n\f\r ]*([achlmqstvz])[\t\n\f\r ]*/i,ce=/^[+-]?((\d*\.\d+)|(\d+\.)|(\d+))(e[+-]?\d+)?/i,aL=/[\t\n\f\r ]*,?[\t\n\f\r ]*/,gy=/^[01]/,rL={z:[],h:[ce],v:[ce],m:[ce,ce],l:[ce,ce],t:[ce,ce],s:[ce,ce,ce,ce],q:[ce,ce,ce,ce],c:[ce,ce,ce,ce,ce,ce],a:[ce,ce,ce,gy,gy,ce,ce]};function oL(t){if(!t)return;const e=[];let i=0,s;for(;i=0&&i<=1?[i]:[]}function hL(t,e,i,s=1e-6){if(Math.abs(t)=0&&r<=1&&a.push(r)}else if(n>0){const r=Math.sqrt(n),o=(-e-r)/(2*t),l=(-e+r)/(2*t);o>=0&&o<=1&&a.push(o),l>=0&&l<=1&&a.push(l)}return a}function dL(t,e,i,s,n=1e-6){if(Math.abs(t)=0){const p=Math.sqrt(h),g=Math.sign(c+p)*Math.pow(Math.abs(c+p),d),f=Math.sign(c-p)*Math.pow(Math.abs(c-p),d),m=Math.abs(Math.sqrt(3)*(g-f)/2),b=-d*a+(g+f);if(b>=0&&b<=1&&u.push(b),Math.abs(m)=0&&x<=1&&u.push(x)}}else{const p=Math.acos(c/Math.sqrt(-l*l*l)),g=d*a,f=2*Math.sqrt(-l),m=f*Math.cos(d*p)-g,b=f*Math.cos(d*(p+2*Math.PI))-g,x=f*Math.cos(d*(p+4*Math.PI))-g;m>=0&&m<=1&&u.push(m),b>=0&&b<=1&&u.push(b),x>=0&&x<=1&&u.push(x)}return u}function Io(t,e,i,s,n,a,r,o){const l=(i-t)*(o-a)-(s-e)*(r-n);if(l===0)return 0;const c=((r-n)*(e-a)-(t-n)*(o-a))/l,h=((i-t)*(e-a)-(s-e)*(t-n))/l;return c>=0&&c<=1&&h>=0&&h<=1?1:0}function uL(t,e,i,s,n,a,r,o,l,c,h,d){let u=0;const p=c-d,g=h-l,f=l*(d-c)-c*(h-l),m=fy(t,i,n,r),b=fy(e,s,a,o),x=p*m[0]+g*b[0],v=p*m[1]+g*b[1],S=p*m[2]+g*b[2],I=p*m[3]+g*b[3]+f,M=dL(x,v,S,I);for(const D of M){const A=D*D,C=D*A,T=m[0]*C+m[1]*A+m[2]*D+m[3],L=b[0]*C+b[1]*A+b[2]*D+b[3];let k;l===h?k=(L-c)/(d-c):k=(T-l)/(h-l),k>=0&&k<=1&&u++}return u}function fy(t,e,i,s){return[-t+3*e-3*i+s,3*t-6*e+3*i,-3*t+3*e,t]}var Xa=class{constructor(){this.previousCommands=[],this.previousParams=[],this.previousClosedPath=!1,this.commands=[],this.params=[],this.commandsLength=0,this.paramsLength=0,this.cx=Number.NaN,this.cy=Number.NaN,this.sx=Number.NaN,this.sy=Number.NaN,this.openedPath=!1,this.closedPath=!1;const t=hy();this.path2d=new t}isEmpty(){return this.commandsLength===0}isDirty(){return this.closedPath!==this.previousClosedPath||this.previousCommands.length!==this.commandsLength||this.previousParams.length!==this.paramsLength||this.previousCommands.toString()!==this.commands.slice(0,this.commandsLength).toString()||this.previousParams.toString()!==this.params.slice(0,this.paramsLength).toString()}getPath2D(){return this.path2d}moveTo(t,e){this.openedPath=!0,this.sx=t,this.sy=e,this.cx=t,this.cy=e,this.path2d.moveTo(t,e),this.commands[this.commandsLength++]=0,this.params[this.paramsLength++]=t,this.params[this.paramsLength++]=e}lineTo(t,e){this.openedPath?(this.cx=t,this.cy=e,this.path2d.lineTo(t,e),this.commands[this.commandsLength++]=1,this.params[this.paramsLength++]=t,this.params[this.paramsLength++]=e):this.moveTo(t,e)}cubicCurveTo(t,e,i,s,n,a){this.openedPath||this.moveTo(t,e),this.path2d.bezierCurveTo(t,e,i,s,n,a),this.commands[this.commandsLength++]=2,this.params[this.paramsLength++]=t,this.params[this.paramsLength++]=e,this.params[this.paramsLength++]=i,this.params[this.paramsLength++]=s,this.params[this.paramsLength++]=n,this.params[this.paramsLength++]=a}closePath(){this.openedPath&&(this.cx=this.sx,this.cy=this.sy,this.sx=Number.NaN,this.sy=Number.NaN,this.path2d.closePath(),this.commands[this.commandsLength++]=3,this.openedPath=!1,this.closedPath=!0)}rect(t,e,i,s){this.moveTo(t,e),this.lineTo(t+i,e),this.lineTo(t+i,e+s),this.lineTo(t,e+s),this.closePath()}roundRect(t,e,i,s,n){n=Math.min(n,i/2,s/2),this.moveTo(t,e+n),this.arc(t+n,e+n,n,Math.PI,1.5*Math.PI),this.lineTo(t+n,e),this.lineTo(t+i-n,e),this.arc(t+i-n,e+n,n,1.5*Math.PI,2*Math.PI),this.lineTo(t+i,e+n),this.lineTo(t+i,e+s-n),this.arc(t+i-n,e+s-n,n,0,Math.PI/2),this.lineTo(t+i-n,e+s),this.lineTo(t+n,e+s),this.arc(t+ +n,e+s-n,n,Math.PI/2,Math.PI),this.lineTo(t,e+s-n),this.closePath()}ellipse(t,e,i,s,n,a,r,o=!1){const l=i,c=s/i,h=Math.cos(n),d=Math.sin(n),u=-c*d,p=c*h,g=l*Math.cos(a),f=l*Math.sin(a),m=t+h*g+u*f,b=e+d*g+p*f,x=(m-this.cx)**2+(b-this.cy)**2;this.openedPath?x>1e-6&&this.lineTo(m,b):this.moveTo(m,b);let v=o?-uy(a-r):uy(r-a);Math.abs(Math.abs(r-a)-2*Math.PI)<1e-6&&v<2*Math.PI&&(v+=2*Math.PI*(o?-1:1));const S=Math.max(Math.ceil(Math.abs(v)/(Math.PI/2)),1),I=v/S,M=4/3*Math.tan(I/4);for(let D=0;D=1?(b=Math.sqrt(b),i*=b,s*=b):(b=Math.sqrt(1/b-1),a===r&&(b=-b),S=b*i*m,I=-b*s*f,x+=u*S-d*I,v+=d*S+u*I);const M=Math.atan2((g-I)/s,(p-S)/i),D=Math.atan2((-g-I)/s,(-p-S)/i)-M,A=M+D,C=!!(1-r);this.ellipse(x,v,i,s,n,M,A,C)}clear(t){t?(this.previousCommands=this.commands.slice(0,this.commandsLength),this.previousParams=this.params.slice(0,this.paramsLength),this.previousClosedPath=this.closedPath,this.commands=[],this.params=[],this.commandsLength=0,this.paramsLength=0):(this.commandsLength=0,this.paramsLength=0);const e=hy();this.path2d=new e,this.openedPath=!1,this.closedPath=!1}isPointInPath(t,e){const i=this.commands,s=this.params,n=this.commandsLength,a=-1e4,r=-1e4;let o=Number.NaN,l=Number.NaN,c=0,h=0,d=0;for(let u=0,p=0;u({x:e,y:i})){const e=[],{commands:i,params:s}=this,n=(r,o)=>{e.push(r);for(let l=0;l{i=Math.min(p,i),s=Math.min(u,s),n=Math.max(u,n),a=Math.max(p,a),r=u,o=p};let d=0;for(let u=0;un!==0)){const n=i.length%2===1?[...i,...i]:i;t.setAttribute("stroke-dasharray",n.join(" ")),s!=null&&t.setAttribute("stroke-dashoffset",String(s))}}var rt=class extends Ms{constructor(){super(...arguments),this.drawingMode="overlay",this.fillOpacity=1,this.strokeOpacity=1,this.fill="black",this.strokeWidth=0,this.lineDashOffset=0,this.opacity=1}getGradient(e){if(Kd(e))return this.createGradient(e)}createGradient(e){const{colorSpace:i="rgb",gradient:s="linear",colorStops:n,rotation:a=0,reverse:r=!1}=e;if(n==null)return;let o=ly(n,["black"],[0,1]);switch(r&&(o=o.map(l=>({color:l.color,stop:1-l.stop})).reverse()),s){case"linear":return new UT(i,o,a);case"radial":return new jT(i,o);case"conic":return new BT(i,o,a)}}getPattern(e){if(Jm(e))return this.createPattern(e)}createPattern(e){return new gL(e)}getImage(e){if(qm(e))return this.createImage(e)}createImage(e){return new JT(this.imageLoader,e)}onFillChange(){typeof this.fill=="object"&&ql(this._cachedFill??{},this.fill)||(this.fillGradient=this.getGradient(this.fill),this.fillPattern=this.getPattern(this.fill),this.fillImage=this.getImage(this.fill),this._cachedFill=this.fill)}onStrokeChange(){this.strokeGradient=this.getGradient(this.stroke)}align(e,i){return et(this.layerManager?.canvas?.pixelRatio??1,e,i)}markDirty(e){super.markDirty(e),this.cachedDefaultGradientFillBBox=void 0}fillStroke(e,i){this.__drawingMode==="cutout"&&(e.globalCompositeOperation="destination-out",this.executeFill(e,i),e.globalCompositeOperation="source-over"),this.renderFill(e,i),this.renderStroke(e,i)}renderFill(e,i){const{__fill:s,__fillOpacity:n=1,fillImage:a}=this;if(s!=null&&s!=="none"&&n>0){const r=e.globalAlpha;a&&(e.globalAlpha=a.backgroundFillOpacity,e.fillStyle=a.backgroundFill,this.executeFill(e,i),e.globalAlpha=r),this.applyFillAndAlpha(e),this.applyShadow(e),this.executeFill(e,i),e.globalAlpha=r,this.fillShadow?.enabled&&(e.shadowColor="rgba(0, 0, 0, 0)")}}executeFill(e,i){i?e.fill(i):e.fill()}applyFillAndAlpha(e){const{__fill:i,fillGradient:s,fillPattern:n,fillImage:a,__fillOpacity:r=1,__opacity:o=1}=this,l=o*r;if(l!==1&&(e.globalAlpha*=l),s){const{fillBBox:c=this.getDefaultGradientFillBBox()??this.getBBox(),fillParams:h}=this;e.fillStyle=s.createGradient(e,c,h)??"black"}else if(n){const{x:c,y:h}=this.getBBox(),d=this.layerManager?.canvas?.pixelRatio??1,u=n.createPattern(e,d);n.setPatternTransform(u,d,c,h),u?e.fillStyle=u:(e.fillStyle=n.fill,e.globalAlpha*=n.fillOpacity)}else if(a){const c=this.getBBox(),h=a.createPattern(e,c.width,c.height,this);a.setImageTransform(h,c),e.fillStyle=h??"transparent"}else e.fillStyle=typeof i=="string"?i:"black"}applyStrokeAndAlpha(e){const{__stroke:i,__strokeOpacity:s=1,strokeGradient:n,__opacity:a=1}=this;e.strokeStyle=n?.createGradient(e,this.getBBox())??(typeof i=="string"?i:void 0)??"black";const r=a*s;r!==1&&(e.globalAlpha*=r)}applyShadow(e){const i=this.layerManager?.canvas.pixelRatio??1,{__fillShadow:s}=this;s?.enabled&&(e.shadowColor=s.color,e.shadowOffsetX=s.xOffset*i,e.shadowOffsetY=s.yOffset*i,e.shadowBlur=s.blur*i)}renderStroke(e,i){const{__stroke:s,__strokeWidth:n=0,__strokeOpacity:a=1,__lineDash:r,__lineDashOffset:o,__lineCap:l,__lineJoin:c,__miterLimit:h}=this;if(s!=null&&s!=="none"&&n>0&&a>0){const{globalAlpha:d}=e;this.applyStrokeAndAlpha(e),e.lineWidth=n,r&&e.setLineDash(r),o&&(e.lineDashOffset=o),l&&(e.lineCap=l),c&&(e.lineJoin=c),h!=null&&(e.miterLimit=h),this.executeStroke(e,i),e.globalAlpha=d}}executeStroke(e,i){i?e.stroke(i):e.stroke()}getDefaultGradientFillBBox(){return this.cachedDefaultGradientFillBBox??(this.cachedDefaultGradientFillBBox=Object.freeze(this.computeDefaultGradientFillBBox())),this.cachedDefaultGradientFillBBox}computeDefaultGradientFillBBox(){}containsPoint(e,i){return this.isPointInPath(e,i)}applySvgFillAttributes(e,i){const{fill:s,fillOpacity:n}=this;if(typeof s=="string")e.setAttribute("fill",s);else if(Kd(s)&&this.fillGradient){i??(i=[]);const a=this.fillGradient.toSvg(this.fillBBox??this.getBBox()),r=$d();a.setAttribute("id",r),i.push(a),e.setAttribute("fill",`url(#${r})`)}else if(Jm(s)&&this.fillPattern){i??(i=[]);const a=this.fillPattern.toSvg(),r=$d();a.setAttribute("id",r),i.push(a),e.setAttribute("fill",`url(#${r})`)}else if(qm(s)&&this.fillImage){i??(i=[]);const a=this.layerManager?.canvas?.pixelRatio??1,r=this.fillImage.toSvg(this.getBBox(),a),o=$d();r.setAttribute("id",o),i.push(r),e.setAttribute("fill",`url(#${o})`)}else e.setAttribute("fill","none");return e.setAttribute("fill-opacity",String(n)),i}applySvgStrokeAttributes(e){const{stroke:i,strokeOpacity:s,strokeWidth:n,lineDash:a,lineDashOffset:r}=this;fL(e,{stroke:ET(i)?i:void 0,strokeOpacity:s,strokeWidth:n}),mL(e,{lineDash:a,lineDashOffset:r})}static handleFillChange(e){e.onFillChange()}static handleStrokeChange(e){e.onStrokeChange()}setStyleProperties(e,i,s){const n=e?.opacity??1,a=e?.fill,r=(e?.fillOpacity??1)*n,o=(e?.strokeOpacity??1)*n,l=e?.strokeWidth??0,c=e?.lineDashOffset??0;let h=!1;this.__fillOpacity!==r&&(this.__fillOpacity=r,h=!0),this.__strokeOpacity!==o&&(this.__strokeOpacity=o,h=!0),this.__strokeWidth!==l&&(this.__strokeWidth=l,h=!0),this.__lineDashOffset!==c&&(this.__lineDashOffset=c,h=!0),this.__lineDash!==e?.lineDash&&(this.__lineDash=e?.lineDash,h=!0),this.setFillProperties(a,i,s),a!==this.fill&&(this.fill=a),e?.stroke!==this.stroke&&(this.stroke=e?.stroke),h&&this.markDirty()}setFillProperties(e,i,s){const n=i==null||!Kd(e)||e.bounds==null||e.bounds==="item"?void 0:i[e.bounds];let a=!1;this.__fillBBox!==n&&(this.__fillBBox=n,a=!0),this.__fillParams!==s&&(this.__fillParams=s,a=!0),a&&(this.onFillChange(),this.markDirty())}};y([As()],rt.prototype,"drawingMode",2),y([As()],rt.prototype,"fillOpacity",2),y([As()],rt.prototype,"strokeOpacity",2),y([Yd({equals:ql,changeCb:rt.handleFillChange})],rt.prototype,"fill",2),y([Xm({equals:ql,changeCb:rt.handleStrokeChange})],rt.prototype,"stroke",2),y([As()],rt.prototype,"strokeWidth",2),y([NT()],rt.prototype,"lineDash",2),y([As()],rt.prototype,"lineDashOffset",2),y([As()],rt.prototype,"lineCap",2),y([As()],rt.prototype,"lineJoin",2),y([As()],rt.prototype,"miterLimit",2),y([As({convertor:t=>OT(0,t??1,1)})],rt.prototype,"opacity",2),y([Xm({equals:kT,checkDirtyOnAssignment:!0})],rt.prototype,"fillShadow",2),y([Yd({equals:wT,changeCb:t=>t.onFillChange()})],rt.prototype,"fillBBox",2),y([Yd({equals:ql,changeCb:t=>t.onFillChange()})],rt.prototype,"fillParams",2);var $n=rt;import{createSvgElement as yL}from"ag-charts-core";import{isNumberEqual as qa}from"ag-charts-core";var Sy=[1,0,0,1,0,0],Kn=class wd{get e(){return[...this.elements]}constructor(e=Sy){this.elements=[...e]}setElements(e){const i=this.elements;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],this}get identity(){const e=this.elements;return qa(e[0],1)&&qa(e[1],0)&&qa(e[2],0)&&qa(e[3],1)&&qa(e[4],0)&&qa(e[5],0)}AxB(e,i,s){const n=e[0]*i[0]+e[2]*i[1],a=e[1]*i[0]+e[3]*i[1],r=e[0]*i[2]+e[2]*i[3],o=e[1]*i[2]+e[3]*i[3],l=e[0]*i[4]+e[2]*i[5]+e[4],c=e[1]*i[4]+e[3]*i[5]+e[5];s=s??e,s[0]=n,s[1]=a,s[2]=r,s[3]=o,s[4]=l,s[5]=c}multiplySelf(e){return this.AxB(this.elements,e.elements),this}multiply(e){const i=[Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN];return e instanceof wd?this.AxB(this.elements,e.elements,i):this.AxB(this.elements,[e.a,e.b,e.c,e.d,e.e,e.f],i),new wd(i)}preMultiplySelf(e){return this.AxB(e.elements,this.elements,this.elements),this}inverse(){const e=this.elements;let i=e[0],s=e[1],n=e[2],a=e[3];const r=e[4],o=e[5],l=1/(i*a-s*n);return i*=l,s*=l,n*=l,a*=l,new wd([a,-s,-n,i,n*o-a*r,s*r-i*o])}invertSelf(){const e=this.elements;let i=e[0],s=e[1],n=e[2],a=e[3];const r=e[4],o=e[5],l=1/(i*a-s*n);return i*=l,s*=l,n*=l,a*=l,e[0]=a,e[1]=-s,e[2]=-n,e[3]=i,e[4]=n*o-a*r,e[5]=s*r-i*o,this}transformPoint(e,i){const s=this.elements;return{x:e*s[0]+i*s[2]+s[4],y:e*s[1]+i*s[3]+s[5]}}transformBBox(e,i){const s=this.elements,n=s[0],a=s[1],r=s[2],o=s[3],l=e.width*.5,c=e.height*.5,h=e.x+l,d=e.y+c,u=Math.abs(l*n)+Math.abs(c*r),p=Math.abs(l*a)+Math.abs(c*o);return i??(i=new P(0,0,0,0)),i.x=h*n+d*r+s[4]-u,i.y=h*a+d*o+s[5]-p,i.width=u+u,i.height=p+p,i}toContext(e){if(this.identity)return;const i=this.elements;e.transform(i[0],i[1],i[2],i[3],i[4],i[5])}static updateTransformMatrix(e,i,s,n,a,r,o){const l=i,c=s;let h,d;l===1&&c===1?(h=0,d=0):(h=o?.scalingCenterX??0,d=o?.scalingCenterY??0);const u=n,p=Math.cos(u),g=Math.sin(u);let f,m;u===0?(f=0,m=0):(f=o?.rotationCenterX??0,m=o?.rotationCenterY??0);const b=a,x=r,v=h*(1-l)-f,S=d*(1-c)-m;return e.setElements([p*l,g*l,-g*c,p*c,p*v-g*S+f+b,g*v+p*S+m+x]),e}};function Js(t){return Dy(t.constructor)}var Iy=Symbol("isMatrixTransform");function Dy(t){return t[Iy]===!0}function su(t){var e,i;const s=t;if(Dy(t))return t;const n=Symbol("matrix_combined_transform");class a extends s{constructor(){super(...arguments),this[i]=new Kn,this._dirtyTransform=!0}onChangeDetection(o){super.onChangeDetection(o),this._dirtyTransform=!0,!(this.batchLevel>0)&&this.markDirty("transform")}updateMatrix(o){}computeTransformMatrix(){this._dirtyTransform&&(this[n].setElements(Sy),this.updateMatrix(this[n]),this._dirtyTransform=!1)}toParent(o){return this.computeTransformMatrix(),this[n].identity?o.clone():this[n].transformBBox(o)}toParentPoint(o,l){return this.computeTransformMatrix(),this[n].identity?{x:o,y:l}:this[n].transformPoint(o,l)}fromParent(o){return this.computeTransformMatrix(),this[n].identity?o.clone():this[n].inverse().transformBBox(o)}fromParentPoint(o,l){return this.computeTransformMatrix(),this[n].identity?{x:o,y:l}:this[n].inverse().transformPoint(o,l)}computeBBox(){const o=super.computeBBox();return o&&this.toParent(o)}computeBBoxWithoutTransforms(){return super.computeBBox()}pickNode(o,l){return{x:o,y:l}=this.fromParentPoint(o,l),super.pickNode(o,l)}pickNodes(o,l,c){return{x:o,y:l}=this.fromParentPoint(o,l),super.pickNodes(o,l,c)}render(o){this.computeTransformMatrix();const{ctx:l}=o,c=this[n];let h=!1;try{c.identity||(l.save(),h=!0,c.toContext(l)),super.render(o)}finally{h&&l.restore()}}toSVG(){this.computeTransformMatrix();const o=super.toSVG(),l=this[n];if(l.identity||o==null)return o;const c=yL("g");c.append(...o.elements);const[h,d,u,p,g,f]=l.e;return c.setAttribute("transform",`matrix(${h} ${d} ${u} ${p} ${g} ${f})`),{elements:[c],defs:o.defs}}}return e=Iy,i=n,a[e]=!0,a}function Ja(t){var e;const i=t,s=Symbol("matrix_rotation");class n extends su(i){constructor(){super(...arguments),this[e]=new Kn,this.rotationCenterX=0,this.rotationCenterY=0,this.rotation=0}updateMatrix(r){super.updateMatrix(r);const{rotation:o,rotationCenterX:l,rotationCenterY:c}=this;o!==0&&(Kn.updateTransformMatrix(this[s],1,1,o,0,0,{rotationCenterX:l,rotationCenterY:c}),r.multiplySelf(this[s]))}}return e=s,y([X()],n.prototype,"rotationCenterX",2),y([X()],n.prototype,"rotationCenterY",2),y([X()],n.prototype,"rotation",2),n}function bL(t){return"scalingX"in t&&"scalingY"in t&&"scalingCenterX"in t&&"scalingCenterY"in t}function ic(t){var e;const i=t,s=Symbol("matrix_scale");class n extends su(i){constructor(){super(...arguments),this[e]=new Kn,this.scalingX=1,this.scalingY=1,this.scalingCenterX=0,this.scalingCenterY=0}updateMatrix(r){super.updateMatrix(r);const{scalingX:o,scalingY:l,scalingCenterX:c,scalingCenterY:h}=this;o===1&&l===1||(Kn.updateTransformMatrix(this[s],o,l,0,0,0,{scalingCenterX:c,scalingCenterY:h}),r.multiplySelf(this[s]))}resetScalingProperties(r,o,l,c){this.__scalingX=r,this.__scalingY=o,this.__scalingCenterX=l,this.__scalingCenterY=c,this.onChangeDetection("scaling")}}return e=s,y([X()],n.prototype,"scalingX",2),y([X()],n.prototype,"scalingY",2),y([X()],n.prototype,"scalingCenterX",2),y([X()],n.prototype,"scalingCenterY",2),n}function Qa(t){var e;const i=t,s=Symbol("matrix_translation");class n extends su(i){constructor(){super(...arguments),this[e]=new Kn,this.translationX=0,this.translationY=0}updateMatrix(r){super.updateMatrix(r);const{translationX:o,translationY:l}=this;o===0&&l===0||(Kn.updateTransformMatrix(this[s],1,1,0,o,l),r.multiplySelf(this[s]))}}return e=s,y([X()],n.prototype,"translationX",2),y([X()],n.prototype,"translationY",2),n}var fe=class{static fromCanvas(t,e){const i=[];for(const s of t.traverseUp())Js(s)&&i.unshift(s);for(const s of i)e=s.fromParent(e);return Js(t)&&(e=t.fromParent(e)),e}static toCanvas(t,e){e==null?e=t.getBBox():Js(t)&&(e=t.toParent(e));for(const i of t.traverseUp())Js(i)&&(e=i.toParent(e));return e}static fromCanvasPoint(t,e,i){const s=[];for(const n of t.traverseUp())Js(n)&&s.unshift(n);for(const n of s)({x:e,y:i}=n.fromParentPoint(e,i));return Js(t)&&({x:e,y:i}=t.fromParentPoint(e,i)),{x:e,y:i}}static toCanvasPoint(t,e,i){Js(t)&&({x:e,y:i}=t.toParentPoint(e,i));for(const s of t.traverseUp())Js(s)&&({x:e,y:i}=s.toParentPoint(e,i));return{x:e,y:i}}},sc,nu=class Wl extends Ms{constructor(e){super(e),this.childNodes=new Set,this.dirty=!1,this.dirtyZIndex=!1,this.clipRect=void 0,this.opacity=1,this._childFontDirty=!0,this.layer=void 0,this.image=void 0,this._lastWidth=Number.NaN,this._lastHeight=Number.NaN,this._lastDevicePixelRatio=Number.NaN,this.isContainerNode=!0,this.renderToOffscreenCanvas=e?.renderToOffscreenCanvas===!0,this.optimizeForInfrequentRedraws=e?.optimizeForInfrequentRedraws===!0}static is(e){return e instanceof Wl}static computeChildrenBBox(e,i=!0){return P.merge(Ms.extractBBoxes(e,i))}static compareChildren(e,i){return Km(e.__zIndex,i.__zIndex)||e.serialNumber-i.serialNumber}containsPoint(e,i){return!0}computeBBox(){return Wl.computeChildrenBBox(this.children())}computeSafeClippingBBox(e){const i=this.computeBBox();if(i?.isFinite()!==!0)return;let s=0;const n=4;for(const u of this.descendants())u instanceof $n&&(s=Math.max(s,u.strokeWidth));const a=Math.max(1,s/2*n),{x:r,y:o}=fe.toCanvasPoint(this,0,0),l=by(e,r+i.x-a)-r,c=by(e,o+i.y-a)-o,h=Math.ceil(i.x+i.width-l+a),d=Math.ceil(i.y+i.height-c+a);return new P(l,c,h,d)}prepareSharedCanvas(e,i,s){return sc?.pixelRatio===s?sc.resize(e,i,s):sc=new Hd({width:e,height:i,pixelRatio:s}),sc}setScene(e){const i=this.scene;super.setScene(e),this.layer&&i&&i!==e&&(i.layersManager.removeLayer(this.layer),this.layer=void 0);for(const s of this.children())s.setScene(e)}resolveFont(){if(!this.renderToOffscreenCanvas)return this.resolveChildFont()}resolveChildFont(){if(this._childFontDirty){this._cachedChildFont=void 0;for(const e of this.children()){const i=e.resolveFont();if(i!=null){this._cachedChildFont=i;break}}this._childFontDirty=!1}return this._cachedChildFont}markDirty(e){this.dirty=!0,this._childFontDirty=!0,super.markDirty(e)}markDirtyChildrenOrder(){super.markDirtyChildrenOrder(),this.dirtyZIndex=!0,this.markDirty()}append(e){for(const i of DT(e))i.remove(),this.childNodes.add(i),i.parentNode=this,i.setScene(this.scene);this.markDirtyChildrenOrder(),this.markDirty()}appendChild(e){return this.append(e),e}removeChild(e){if(!this.childNodes?.delete(e))throw new Error(`AG Charts - internal error, unknown child node ${e.name??e.id} in $${this.name??this.id}`);e.parentNode=void 0,e.setScene(),this.markDirtyChildrenOrder(),this.markDirty()}clear(){for(const e of this.children())delete e.parentNode,e.setScene();this.childNodes?.clear(),this.markDirty()}pickNode(e,i){if(!(!this.visible||this.pointerEvents===1||!this.containsPoint(e,i))){if(this.childNodes!=null&&this.childNodes.size!==0){const s=[...this.children()];for(let n=s.length-1;n>=0;n--){const r=s[n].pickNode(e,i);if(r!=null)return r}}else if(!this.isContainerNode)return this}}pickNodes(e,i,s=[]){if(!this.visible||this.pointerEvents===1||!this.containsPoint(e,i))return s;this.isContainerNode||s.push(this);for(const n of this.children())n.pickNodes(e,i,s);return s}isDirty(e){const{width:i,height:s,devicePixelRatio:n}=e,{dirty:a,layer:r}=this,o=r!=null&&(this._lastWidth!==i||this._lastHeight!==s),l=this._lastDevicePixelRatio!==n;return this._lastWidth=i,this._lastHeight=s,this._lastDevicePixelRatio=n,a||o||l}preRender(e){let i;if(this.dirty){i=super.preRender(e,0);for(const s of this.children()){const n=s.preRender(e);i.groups+=n.groups,i.nonGroups+=n.nonGroups,i.complexity+=n.complexity}i.groups+=1,i.nonGroups-=1}else i=this.childNodeCounts;return this.renderToOffscreenCanvas&&!this.optimizeForInfrequentRedraws&&i.nonGroups>0&&this.getVisibility()?this.layer??(this.layer=this.layerManager?.addLayer({name:this.name})):this.layer!=null&&(this.layerManager?.removeLayer(this.layer),this.layer=void 0),i}render(e){const{layer:i,renderToOffscreenCanvas:s}=this,n={...e},a=this.isDirty(e);if(this.dirty=!1,!s){this.renderInContext(n),super.render(n);return}const{ctx:r,stats:o,devicePixelRatio:l}=e;let{image:c}=this;if(a){c?.bitmap.close(),c=void 0;const d=i?void 0:this.computeSafeClippingBBox(l),u=(p,...g)=>{const f=p.context;f.direction=n.direction,n.ctx=f,p.clear(),f.save();try{f.setTransform(...g),f.globalAlpha=1,this.renderInContext(n)}finally{f.restore(),f.verifyDepthZero?.()}};if(i)u(i,r.getTransform());else if(d){const{x:p,y:g,width:f,height:m}=d,b=Math.floor(f*l),x=Math.floor(m*l);if(b>0&&x>0){const v=this.prepareSharedCanvas(f,m,l);u(v,l,0,0,l,-p*l,-g*l),c={bitmap:v.transferToImageBitmap(),x:p,y:g,width:f,height:m}}}this.image=c,o&&o.layersRendered++}else o&&o.layersSkipped++;const{globalAlpha:h}=r;if(r.globalAlpha=h*this.opacity,i){r.save();try{r.resetTransform(),i.drawImage(r)}finally{r.restore()}}else if(c){const{bitmap:d,x:u,y:p,width:g,height:f}=c;r.drawImage(d,0,0,g*l,f*l,u,p,g,f)}r.globalAlpha=h,super.render(n)}applyClip(e,i){const{x:s,y:n,width:a,height:r}=i;e.beginPath(),e.rect(s,n,a,r),e.clip()}renderInContext(e){const{ctx:i,stats:s}=e;this.dirtyZIndex&&(this.sortChildren(Wl.compareChildren),this.dirtyZIndex=!1),i.save();try{i.globalAlpha*=this.opacity;const n=this.resolveChildFont();n!=null&&i.font!==n&&(i.font=n),this.clipRect!=null&&(this.applyClip(i,this.clipRect),e.clipBBox=fe.toCanvas(this,this.clipRect));for(const a of this.children()){if(!a.visible){s&&(s.nodesSkipped+=a.childNodeCounts.nonGroups+a.childNodeCounts.groups,s.opsSkipped+=a.childNodeCounts.complexity);continue}a.isolatedRender(e)}}finally{i.restore()}}sortChildren(e){if(!this.childNodes)return;const i=[...this.childNodes].sort(e);this.childNodes.clear();for(const s of i)this.childNodes.add(s)}*children(){yield*this.childNodes}*excludeChildren(e){for(const i of this.children())(e.instance&&!(i instanceof e.instance)||e.name&&i.name!==e.name)&&(yield i)}*descendants(){for(const e of this.children())yield e,e instanceof Wl&&(yield*e.descendants())}setClipRect(e){this.clipRect=e?fe.fromCanvas(this,e):void 0}setClipRectCanvasSpace(e){this.clipRect=e}getVisibility(){for(const e of this.traverseUp(!0))if(!e.visible)return!1;return!0}toSVG(){if(!this.visible)return;const e=[],i=[];for(const s of this.children()){const n=s.toSVG();n!=null&&(i.push(...n.elements),n.defs!=null&&e.push(...n.defs))}return{elements:i,defs:e}}};nu.className="Group",y([X({convertor:t=>IT(0,t,1)})],nu.prototype,"opacity",2);var U=nu,xL=class extends ic(U){},KK=class extends Ja(U){},mt=class extends Qa(U){},er=class extends Ja(Qa(U)){};import{Debug as nc,DebugMetrics as vL,Logger as ac,TextMeasurer as SL,getWindow as IL,isString as DL,toArray as ML}from"ag-charts-core";var AL=class{constructor(){this.stats=new Map,this.lastLogTime=Date.now(),this.LOG_INTERVAL_MS=1e4,this.startPeriodicLogging()}startPeriodicLogging(){nc.check("scene:stats","scene:stats:verbose")&&(this.stopPeriodicLogging(),this.intervalId=setInterval(()=>{this.logAccumulatedStats()},this.LOG_INTERVAL_MS))}stopPeriodicLogging(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0)}recordTiming(t,e){const i=this.stats.get(t);i?(i.min=Math.min(i.min,e),i.max=Math.max(i.max,e),i.sum+=e,i.count+=1):this.stats.set(t,{min:e,max:e,sum:e,count:1})}recordTimings(t){for(const[e,i]of Object.entries(t))e!=="start"&&typeof i=="number"&&this.recordTiming(e,i)}logAccumulatedStats(){if(this.stats.size===0)return;const t=(Date.now()-this.lastLogTime)/1e3,e=Array.from(this.stats.keys()).sort((a,r)=>a==="\u23F1\uFE0F"?-1:r==="\u23F1\uFE0F"?1:a.localeCompare(r)),i=[];for(const a of e){const r=this.stats.get(a),o=r.sum/r.count;i.push(`${a}[${r.min.toFixed(1)}/${o.toFixed(1)}/${r.max.toFixed(1)}]ms`)}const n=this.stats.get("\u23F1\uFE0F")?.count??0;ac.log(`\u{1F4CA} Stats (${t.toFixed(0)}s, ${n} renders): ${i.join(" ")}`),this.stats.clear(),this.lastLogTime=Date.now()}destroy(){this.stopPeriodicLogging(),this.stats.clear()}},tr,Zn=0;function CL(){return tr??(tr=new AL),tr}function TL(){Zn++;let t=!1;return()=>{t||Zn===0||(t=!0,Zn--,Zn===0&&Ty())}}function LL(t){for(const e of["B","KB","MB","GB"]){if(t<1536)return`${t.toFixed(1)}${e}`;t/=1024}return`${t.toFixed(1)}TB}`}function NL(){if(!("memory"in performance))return;const{totalJSHeapSize:t,usedJSHeapSize:e,jsHeapSizeLimit:i}=performance.memory,s=[];for(const n of[e,t,i])typeof n=="number"&&s.push(LL(n));return`Heap ${s.join(" / ")}`}function My(t,e,i,s,n={},a=P.zero,r){if(!nc.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:o=0,layersSkipped:l=0,nodesRendered:c=0,nodesSkipped:h=0,opsPerformed:d=0,opsSkipped:u=0}=s??{},p=performance.now(),{start:g,...f}=e,m=p-g,b=CL();b.recordTimings(f),b.recordTiming("\u23F1\uFE0F",m);const x=Object.entries(f).map(([E,V])=>Cy(E,V)).filter(E=>E!=null).join(" + "),v=Object.entries(n).map(([E,V])=>`${E}: ${JSON.stringify(V)}`).join(" ; "),S=nc.check("scene:stats:verbose"),I=S?NL():null,M=S?vL.flush():{},D=Object.entries(M),A=[],C=[];for(const[E,V]of D)E.endsWith(":aggregation")&&Array.isArray(V)?A.push(`${E.replace(":aggregation","")}(${V.join(",")})`):E.endsWith(":nodeData")&&typeof V=="number"&&C.push(`${E.replace(":nodeData","")}(${V})`);const T=A.length>0?`Aggregation: ${A.join(", ")}`:null,L=C.length>0?`NodeData: ${C.join(", ")}`:null,k=[`${Cy("\u23F1\uFE0F",g,p)} (${x})`,`${v}`,T,L,`Layers: ${S?au(o,l):t.size}`,S?`Nodes: ${au(c,h)}`:null,S?`Ops: ${au(d,u)}`:null,I].filter(DL),O=new SL(i),N=new Map(k.map(E=>[E,O.measureText(E)])),w=Math.max(...Array.from(N.values(),E=>E.width)),R=PL(N.values(),E=>E.height),F=2+a.x;i.save();try{i.fillStyle=r?.background??"white",i.fillRect(F,0,w,R),i.fillStyle=r?.foreground??"black";let E=0;for(const[V,Z]of N.entries())E+=Z.height,i.fillText(V,F,E)}catch(E){ac.warnOnce("Error during debug stats rendering",E)}finally{i.restore()}}function kL(t){const e=ML(IL("agChartsSceneDebug")),i=[];for(const s of e)s==="layout"?i.push("seriesRoot","legend","root",/Axis-\d+-axis/):i.push(s);t.debugNodeSearch=i}function wL(t,e){t.save();try{for(const[i,s]of Object.entries(e)){const n=fe.toCanvas(s);if(!n){ac.log(`Scene.render() - no bbox for debugged node [${i}].`);continue}t.globalAlpha=.8,t.strokeStyle="red",t.lineWidth=1,t.strokeRect(n.x,n.y,n.width,n.height),t.fillStyle="red",t.strokeStyle="white",t.font="16px sans-serif",t.textBaseline="top",t.textAlign="left",t.lineWidth=2,t.strokeText(i,n.x,n.y,n.width),t.fillText(i,n.x,n.y,n.width)}}catch(i){ac.warnOnce("Error during debug rendering",i)}finally{t.restore()}}var OL=new Set,EL=new Set(["gradient","zIndex","clipRect","cachedBBox","childNodeCounts","path","__zIndex","name","__scalingCenterX","__scalingCenterY","__rotationCenterX","__rotationCenterY","_previousDatum","__fill","__lineDash","borderPath","borderClipPath","_clipPath"]);function RL(t){const{...e}=t;for(const i of Object.keys(e))EL.has(i)||typeof e[i]!="number"&&typeof e[i]!="string"&&typeof e[i]!="boolean"&&(OL.add(i),delete e[i]);return e}function rc(t,e){if(!nc.check(!0,"scene"))return{};let i=0;return{node:e==="json"?RL(t):t,name:t.name??t.id,dirty:t instanceof U?t.dirty:void 0,...Array.from(t instanceof U?t.children():[],s=>rc(s,e)).reduce((s,n)=>{let{name:a}=n;const{node:{visible:r,opacity:o,zIndex:l,translationX:c,translationY:h,rotation:d,scalingX:u,scalingY:p},node:g}=n;(!r||o<=0)&&(a=`(${a})`),U.is(g)&&g.renderToOffscreenCanvas&&(a=`*${a}*`);const f=Array.isArray(l)?`(${l.join(", ")})`:l,m=[`${(i++).toString().padStart(3,"0")}|`,`${a??""}`,`z: ${f}`,c&&`x: ${c}`,h&&`y: ${h}`,d&&`r: ${d}`,u!=null&&u!==1&&`sx: ${u}`,p!=null&&p!==1&&`sy: ${p}`].filter(v=>!!v).join(" ");let b=m,x=1;for(;s[b]!=null&&x<100;)b=`${m} (${x++})`;return s[b]=n,s},{})}}function Ay(t){const e=t instanceof U?t.dirty:void 0;if(!e)return{dirtyTree:{},paths:[]};const i=Array.from(t instanceof U?t.children():[],a=>Ay(a)).filter(a=>a.paths.length>0),s=U.is(t)?t.name??t.id:t.id,n=i.length?i.flatMap(a=>a.paths).map(a=>`${s}.${a}`):[s];return{dirtyTree:{name:s,node:t,dirty:e,...i.map(a=>a.dirtyTree).filter(a=>a.dirty!=null).reduce((a,r)=>(a[r.name??""]=r,a),{})},paths:n}}function au(t,e){const i=t+e;return`${t} / ${i} (${Math.round(100*t/i)}%)`}function Cy(t,e,i){const s=i==null?e:i-e;return`${t}: ${Math.round(s*100)/100}ms`}function PL(t,e){let i=0;for(const s of t)i+=e(s);return i}function Ty(t=!1){if(!tr){t&&(Zn=0);return}!t&&Zn>0||(tr.destroy(),tr=void 0,t&&(Zn=0))}var _L=class{constructor(){this.available=!0,this.acquireQueue=[]}acquire(t){return new Promise((e,i)=>{this.acquireQueue.push([t,e,i]),this.available&&this.dispatchNext().catch(i)})}async acquireImmediately(t){return this.available?(await this.acquire(t),!0):!1}async waitForClearAcquireQueue(){return this.acquire(()=>Promise.resolve(void 0))}async dispatchNext(){this.available=!1;let[t,e,i]=this.acquireQueue.shift()??[];for(;t;){try{await t(),e?.()}catch(s){i?.(s)}[t,e,i]=this.acquireQueue.shift()??[]}this.available=!0}},Ly=class{constructor(){this.eventListeners=new Map}addEventListener(t,e){if(typeof e!="function")throw new TypeError("AG Charts - listener must be a Function");const i=this.eventListeners.get(t);i?i.add(e):this.eventListeners.set(t,new Set([e]))}removeEventListener(t,e){const i=this.eventListeners.get(t);i!=null&&(i.delete(e),i.size===0&&this.eventListeners.delete(t))}hasEventListener(t){return this.eventListeners.has(t)}clearEventListeners(){this.eventListeners.clear()}fireEvent(t){const e=this.eventListeners.get(t.type);if(e)for(const i of e)i(t)}};import"ag-charts-core";function FL(t,e){function i(n,a){return t.requestAnimationFrame(n)}function s(n){t.cancelAnimationFrame(n)}return Ny(i,e,s)}function ru(t){function e(s,n=0){if(n===0){queueMicrotask(s);return}return setTimeout(s,n)}function i(s){clearTimeout(s)}return Ny(e,t,i)}function Ny(t,e,i){let s=0,n=!1,a,r,o;function l(){return n}function c(){n=!1,o=void 0,r?.(),r=void 0,a=void 0,s>0&&(o=t(h))}function h(){const f=s;s=0,n=!0;const m=e({count:f});if(!m){c();return}m.then(c,c)}function d(f){s===0&&!l()&&(o=t(h,f)),s++}function u(){o!=null&&i&&(i(o),o=void 0,s=0)}async function p(){if(l())for(a??(a=new Promise(g));l();)await a}function g(f){r=f}return{schedule:d,cancel:u,waitForCompletion:p}}import{AbstractModuleInstance as VL,Property as oc,ProxyPropertyOnWrite as ou,ZIndexMap as BL}from"ag-charts-core";import{DeclaredSceneChangeDetection as ts,boxesEqual as zL,isNumberEqual as ky}from"ag-charts-core";var Do=(t,{x0:e,y0:i,x1:s,y1:n,cx:a,cy:r},o,l)=>{if(l&&t.moveTo(e,i),e!==s||i!==n){const c=Math.atan2(i-r,e-a),h=Math.atan2(n-r,s-a);t.arc(a,r,o,c,h)}else t.lineTo(e,i)};import{SceneChangeDetection as lu,createSvgElement as GL}from"ag-charts-core";var Ue=class extends $n{constructor(){super(...arguments),this.path=new Xa,this._clipX=Number.NaN,this._clipY=Number.NaN,this.clip=!1,this._dirtyPath=!0,this.lastPixelRatio=Number.NaN}set clipX(t){this._clipX=t,this.dirtyPath=!0}set clipY(t){this._clipY=t,this.dirtyPath=!0}set dirtyPath(t){this._dirtyPath!==t&&(this._dirtyPath=t,t&&this.markDirty("path"))}get dirtyPath(){return this._dirtyPath}checkPathDirty(){this._dirtyPath||(this.dirtyPath=this.path.isDirty()||(this.fillShadow?.isDirty()??!1)||(this._clipPath?.isDirty()??!1))}resetPathDirty(){this.path.clear(!0),this._dirtyPath=!1}isPathDirty(){return this.path.isDirty()}onChangeDetection(t){this._dirtyPath||(this._dirtyPath=!0,super.onChangeDetection(t))}computeBBox(){return this.updatePathIfDirty(),this.path.computeBBox()}isPointInPath(t,e){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(t,e)}distanceSquared(t,e){return this.distanceSquaredTransformedPoint(t,e)}svgPathData(t){return this.updatePathIfDirty(),this.path.toSVG(t)}distanceSquaredTransformedPoint(t,e){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(t,e)?0:this.path.distanceSquared(t,e)}isDirtyPath(){return!1}updatePath(){}updatePathIfDirty(){(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1)}preRender(t){return t.devicePixelRatio!==this.lastPixelRatio&&(this.dirtyPath=!0),this.lastPixelRatio=t.devicePixelRatio,this.updatePathIfDirty(),super.preRender(t,this.path.commands.length)}render(t){const{ctx:e}=t;if(this.clip&&!Number.isNaN(this._clipX)&&!Number.isNaN(this._clipY)){e.save();try{const i=this.strokeWidth/2;this._clipPath??(this._clipPath=new Xa),this._clipPath.clear(),this._clipPath.rect(-i,-i,this._clipX+i,this._clipY+i+i),e.clip(this._clipPath?.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(e)}finally{e.restore()}}else this._clipPath=void 0,this.drawPath(e);this.fillShadow?.markClean(),super.render(t)}drawPath(t){this.fillStroke(t,this.path.getPath2D())}toSVG(){if(!this.visible)return;const t=GL("path");t.setAttribute("d",this.svgPathData());const e=this.applySvgFillAttributes(t,[]);return this.applySvgStrokeAttributes(t),{elements:[t],defs:e}}};Ue.className="Path",y([lu()],Ue.prototype,"clip",2),y([lu()],Ue.prototype,"clipX",1),y([lu()],Ue.prototype,"clipY",1);function lc(t,e,i,s,n){let a=!1,r=!1,o=s-Math.sqrt(Math.max(n**2-i**2,0)),l=0,c=0,h=i-Math.sqrt(Math.max(n**2-s**2,0));return o>t?(a=!0,o=t,l=i-Math.sqrt(Math.max(n**2-(s-t)**2))):ky(o,0)&&(o=0),h>e?(r=!0,c=s-Math.sqrt(Math.max(n**2-(i-e)**2)),h=e):ky(h,0)&&(h=0),{leading0:o,leading1:l,trailing0:c,trailing1:h,leadingClipped:a,trailingClipped:r}}function cc(t,e,i,s,n,a,r){let{topLeft:o,topRight:l,bottomRight:c,bottomLeft:h}=a;const d=Math.max(o+h,l+c),u=Math.max(o+l,h+c);if(d<=0&&u<=0){if(r==null)t.rect(e,i,s,n);else{const D=Math.max(e,r.x),A=Math.min(e+s,r.x+r.width),C=Math.max(i,r.y),T=Math.min(i+n,r.y+r.height);t.rect(D,C,A-D,T-C)}return}else if(r==null&&o===l&&o===c&&o===h){t.roundRect(e,i,s,n,o);return}if(s<0&&(e+=s,s=Math.abs(s)),n<0&&(i+=n,n=Math.abs(n)),s<=0||n<=0)return;if(r==null)r=new P(e,i,s,n);else{const D=Math.max(e,r.x),A=Math.min(e+s,r.x+r.width),C=Math.max(i,r.y),T=Math.min(i+n,r.y+r.height);r=new P(D,C,A-D,T-C)}const p=Math.max(d/n,u/s,1);p>1&&(o/=p,l/=p,c/=p,h/=p);let g=!0,f=!0,m=!0,b=!0,x,v,S,I;if(g){const D=lc(r.height,r.width,Math.max(e+o-r.x,0),Math.max(i+o-r.y,0),o);D.leadingClipped&&(b=!1),D.trailingClipped&&(f=!1);const A=Math.max(r.x+D.leading1,r.x),C=Math.max(r.y+D.leading0,r.y),T=Math.max(r.x+D.trailing1,r.x),L=Math.max(r.y+D.trailing0,r.y),k=e+o,O=i+o;x={x0:A,y0:C,x1:T,y1:L,cx:k,cy:O}}if(f){const D=lc(r.width,r.height,Math.max(i+l-r.y,0),Math.max(r.x+r.width-(e+s-l),0),l);D.leadingClipped&&(g=!1),D.trailingClipped&&(m=!1);const A=Math.min(r.x+r.width-D.leading0,r.x+r.width),C=Math.max(r.y+D.leading1,r.y),T=Math.min(r.x+r.width-D.trailing0,r.x+r.width),L=Math.max(r.y+D.trailing1,r.y),k=e+s-l,O=i+l;v={x0:A,y0:C,x1:T,y1:L,cx:k,cy:O}}if(m){const D=lc(r.height,r.width,Math.max(r.x+r.width-(e+s-c),0),Math.max(r.y+r.height-(i+n-c),0),c);D.leadingClipped&&(f=!1),D.trailingClipped&&(b=!1);const A=Math.min(r.x+r.width-D.leading1,r.x+r.width),C=Math.min(r.y+r.height-D.leading0,r.y+r.height),T=Math.min(r.x+r.width-D.trailing1,r.x+r.width),L=Math.min(r.y+r.height-D.trailing0,r.y+r.height),k=e+s-c,O=i+n-c;S={x0:A,y0:C,x1:T,y1:L,cx:k,cy:O}}if(b){const D=lc(r.width,r.height,Math.max(r.y+r.height-(i+n-h),0),Math.max(e+h-r.x,0),h);D.leadingClipped&&(m=!1),D.trailingClipped&&(g=!1);const A=Math.max(r.x+D.leading0,r.x),C=Math.min(r.y+r.height-D.leading1,r.y+r.height),T=Math.max(r.x+D.trailing0,r.x),L=Math.min(r.y+r.height-D.trailing1,r.y+r.height),k=e+h,O=i+n-h;I={x0:A,y0:C,x1:T,y1:L,cx:k,cy:O}}let M=!1;g&&x!=null&&(Do(t,x,o,!M),M||(M=!0)),f&&v!=null&&(Do(t,v,l,!M),M||(M=!0)),m&&S!=null&&(Do(t,S,c,!M),M||(M=!0)),b&&I!=null&&Do(t,I,h,!M),t.closePath()}var He=class extends Ue{constructor(){super(...arguments),this.borderPath=new Xa,this.x=0,this.y=0,this.width=10,this.height=10,this.topLeftCornerRadius=0,this.topRightCornerRadius=0,this.bottomRightCornerRadius=0,this.bottomLeftCornerRadius=0,this.clipBBox=void 0,this.crisp=!1,this.lastUpdatePathStrokeWidth=this.__strokeWidth,this.effectiveStrokeWidth=this.__strokeWidth,this.hittester=super.isPointInPath.bind(this),this.distanceCalculator=super.distanceSquaredTransformedPoint.bind(this),this.microPixelEffectOpacity=1}set cornerRadius(t){this.topLeftCornerRadius=t,this.topRightCornerRadius=t,this.bottomRightCornerRadius=t,this.bottomLeftCornerRadius=t}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.__strokeWidth||!!(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){const{path:t,borderPath:e,__crisp:i,__topLeftCornerRadius:s,__topRightCornerRadius:n,__bottomRightCornerRadius:a,__bottomLeftCornerRadius:r}=this;let{__x:o,__y:l,__width:c,__height:h,__strokeWidth:d,__clipBBox:u}=this;const g=1/(this.layerManager?.canvas.pixelRatio??1);let f=1;if(t.clear(),e.clear(),c===0||h===0){this.effectiveStrokeWidth=0,this.lastUpdatePathStrokeWidth=0,this.microPixelEffectOpacity=0;return}if(i&&(c<=g&&(f*=c/g),h<=g&&(f*=h/g),c=this.align(o,c),h=this.align(l,h),o=this.align(o),l=this.align(l),u=u==null?void 0:new P(this.align(u.x),this.align(u.y),this.align(u.x,u.width),this.align(u.y,u.height))),d)if(c0?s-d:0,topRight:n>0?n-d:0,bottomRight:a>0?a-d:0,bottomLeft:r>0?r-d:0};this.borderClipPath=void 0,c>0&&h>0&&(x==null||x?.width>0&&x?.height>0)&&(cc(t,o,l,c,h,v,x),cc(e,o,l,c,h,v,x))}else this.borderClipPath=this.borderClipPath??new Xa,this.borderClipPath.clear(),this.borderClipPath.rect(o,l,c,h),e.rect(o,l,c,h);else{const b={topLeft:s,topRight:n,bottomRight:a,bottomLeft:r};this.borderClipPath=void 0,cc(t,o,l,c,h,b,u)}if([s,n,a,r].every(UL)){let b=function(S,I){return v.getBBox().distanceSquared(S,I)};var m=b;const x=this.getBBox();this.hittester=x.containsPoint.bind(x);const v=this;this.distanceSquared=b}else this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquaredTransformedPoint;this.effectiveStrokeWidth=d,this.lastUpdatePathStrokeWidth=d,this.microPixelEffectOpacity=f}computeBBox(){const{__x:t,__y:e,__width:i,__height:s,__clipBBox:n}=this;return n?.clone()??new P(t,e,i,s)}isPointInPath(t,e){return this.hittester(t,e)}get midPoint(){return{x:this.__x+this.__width/2,y:this.__y+this.__height/2}}setStaticProperties(t,e,i,s,n,a,r,o){this.__drawingMode=t,this.__topLeftCornerRadius=e,this.__topRightCornerRadius=i,this.__bottomRightCornerRadius=s,this.__bottomLeftCornerRadius=n,this.__visible=a,this.__crisp=r,this.__fillShadow=o,this.dirtyPath=!0,this.markDirty()}resetAnimationProperties(t,e,i,s,n,a){this.__x=t,this.__y=e,this.__width=i,this.__height=s,this.__opacity=n,this.__clipBBox=a,this.dirtyPath=!0,this.markDirty()}distanceSquared(t,e){return this.distanceCalculator(t,e)}applyFillAndAlpha(t){super.applyFillAndAlpha(t),t.globalAlpha*=this.microPixelEffectOpacity}applyStrokeAndAlpha(t){super.applyStrokeAndAlpha(t),t.globalAlpha*=this.microPixelEffectOpacity}renderStroke(t){const{stroke:e,effectiveStrokeWidth:i}=this;if(e&&i){const{globalAlpha:s}=t,{lineDash:n,lineDashOffset:a,lineCap:r,lineJoin:o,borderPath:l,borderClipPath:c}=this;c&&t.clip(c.getPath2D()),this.applyStrokeAndAlpha(t),t.lineWidth=i,n&&t.setLineDash(n),a&&(t.lineDashOffset=a),r&&(t.lineCap=r),o&&(t.lineJoin=o),t.stroke(l.getPath2D()),t.globalAlpha=s}}};He.className="Rect",y([ts()],He.prototype,"x",2),y([ts()],He.prototype,"y",2),y([ts()],He.prototype,"width",2),y([ts()],He.prototype,"height",2),y([ts()],He.prototype,"topLeftCornerRadius",2),y([ts()],He.prototype,"topRightCornerRadius",2),y([ts()],He.prototype,"bottomRightCornerRadius",2),y([ts()],He.prototype,"bottomLeftCornerRadius",2),y([ts({equals:zL})],He.prototype,"clipBBox",2),y([ts()],He.prototype,"crisp",2);function UL(t){return t===0}import{Debug as HL,LineSplitter as cu,SceneRefChangeDetection as jL,cachedTextMeasurer as hu,createSvgElement as wy,isArray as Xn,measureTextSegments as hc,toFontString as WL,toPlainText as YL,toTextString as ir}from"ag-charts-core";var Ut=class ii extends $n{constructor(e){super(e),this.x=0,this.y=0,this.lines=[],this.text=void 0,this.fontCache=void 0,this.fontSize=ii.defaultFontSize,this.fontFamily="sans-serif",this.textAlign="start",this.textBaseline="alphabetic",this.boxPadding=0,this.trimText=e?.trimText??!0}onTextChange(){if(this.richText?.clear(),this.textMap?.clear(),Xn(this.text))this.lines=[],this.richText??(this.richText=new U),this.richText.setScene(this.scene),this.richText.append(this.text.flatMap(e=>ir(e.text).split(cu)).filter(Boolean).map(()=>new ii({trimText:!1})));else{const e=ir(this.text).split(cu);this.lines=this.trimText?e.map(i=>i.trim()):e}}get font(){return this.fontCache??(this.fontCache=WL(this)),this.fontCache}resolveFont(){if(this.hasRenderableText())return this.font}static measureBBox(e,i,s,n){if(Xn(e)){const{font:a,lineHeight:r,textAlign:o,textBaseline:l}=n,{width:c,height:h,lineMetrics:d}=hc(e,a),u=r?r*d.length:h,p=ii.calcTopOffset(u,d[0],l),g=ii.calcLeftOffset(c,o);return new P(i-g,s-p,c,u)}else return ii.computeBBox(ir(e).split(cu),i,s,n)}static computeBBox(e,i,s,n){const{font:a,lineHeight:r,textAlign:o,textBaseline:l,isRtl:c}=n,{width:h,height:d,lineMetrics:u}=hu(a).measureLines(e),p=r?r*u.length:d,g=ii.calcTopOffset(p,u[0],l),f=ii.calcLeftOffset(h,o,c);return new P(i-f,s-g,h,p)}static calcTopOffset(e,i,s){switch(s){case"alphabetic":return i?.ascent??0;case"middle":return e/2;case"bottom":return e;default:return 0}}static calcSegmentedTopOffset(e,i,s){switch(s){case"alphabetic":return i[0]?.ascent??0;case"middle":return i.length===1?i[0].ascent+i[0].segments.reduce((n,a)=>Math.min(n,hu(a).baselineDistance("middle")),0):e/2;case"bottom":return e;default:return 0}}static calcLeftOffset(e,i,s){let n=0;switch(i){case"center":n=.5;break;case"right":case(s?"start":"end"):n=1}return e*n}getBBox(){const e=super.getBBox();if(!this.textMap?.size||!Xn(this.text))return e;const{height:i,lineMetrics:s}=hc(this.text,this),n=ii.calcSegmentedTopOffset(i,s,this.textBaseline),a=this.y-n;return e.y===a?e:new P(e.x,a,e.width,e.height)}computeBBox(){if(!this.hasRenderableText())return new P(this.x,this.y,0,0);if(this.generateTextMap(),this.textMap?.size){const l=P.merge(this.textMap.values());return l.x=this.x-ii.calcLeftOffset(l.width,this.textAlign),l.y=this.y,l}const e=this.scene?.isRtl,{x:i,y:s,lines:n,textBaseline:a,textAlign:r}=this,o=ii.computeBBox(n,i,s,{font:this,textBaseline:a,textAlign:r,isRtl:e});return this.boxing!=null&&o.grow(this.boxPadding),o}getTextMeasureBBox(){return this.computeBBox()}getPlainText(){return YL(this.text)}isPointInPath(e,i){return this.getBBox()?.containsPoint(e,i)??!1}setScene(e){this.richText?.setScene(e),super.setScene(e)}generateTextMap(){if(!Xn(this.text)||this.textMap?.size)return;this.textMap??(this.textMap=new Map);let e=0;const i=this.richText.children();for(const{width:s,height:n,ascent:a,segments:r}of hc(this.text,this).lineMetrics){let o=0;for(const{color:l,textMetrics:c,...h}of r){const d=i.next().value;d.x=this.x-s/2+o,d.y=a+e,d.setProperties({...h,fill:l??this.fill});const u=d.getBBox();this.textMap.set(d,u),o+=c.width}e+=n}}render(e){const{ctx:i,stats:s}=e;if(!this.layerManager||!this.hasRenderableText()){s&&(s.nodesSkipped+=1);return}if(Xn(this.text)&&this.richText){this.generateTextMap();const n=this.richText.getBBox(),{width:a,height:r,lineMetrics:o}=hc(this.text,this);let l=0;switch(this.textAlign){case"left":case"start":l=a/2;break;case"right":case"end":l=a/-2}const c=this.y-ii.calcSegmentedTopOffset(r,o,this.textBaseline);this.renderBoxing(e,n.clone().translate(l,c)),i.save(),i.translate(l,c),this.richText.opacity=this.opacity,this.richText.render(e),i.restore()}else this.renderText(e);if(ii.debug.check()){const n=this.getBBox();i.lineWidth=this.textMap?.size?2:1,i.strokeStyle=this.textMap?.size?"blue":"red",i.strokeRect(n.x,n.y,n.width,n.height)}super.render(e)}markDirty(e){return this.textMap?.clear(),super.markDirty(e)}renderText(e){const{fill:i,stroke:s,strokeWidth:n,font:a,textAlign:r}=this;if(!i&&!(s&&n)||!this.layerManager)return super.render(e);const{ctx:o}=e;o.font!==a&&(o.font=a),o.textAlign=r,this.renderBoxing(e),this.fillStroke(o)}renderBoxing(e,i){if(!this.boxing)return;const s=i??ii.computeBBox(this.lines,this.x,this.y,this);if(s.width===0||s.height===0)return;const{x:n,y:a,width:r,height:o}=s.grow(this.boxPadding);this.boxing.opacity=this.opacity,this.boxing.x=n,this.boxing.y=a,this.boxing.width=r,this.boxing.height=o,this.boxing.preRender(e),this.boxing.render(e)}executeFill(e){this.renderLines((i,s,n)=>e.fillText(i,s,n))}executeStroke(e){this.renderLines((i,s,n)=>e.strokeText(i,s,n))}renderLines(e){const{x:i,y:s,lines:n}=this;if(!Number.isFinite(i)||!Number.isFinite(s))return;const a=hu(this),{lineMetrics:r}=a.measureLines(n),{textBaseline:o,lineHeight:l=a.lineHeight()}=this;let c=0;o==="top"?c=r[0].ascent:(o==="middle"||o==="bottom")&&(c=l*(1-n.length),o==="middle"?(c/=2,c-=a.baselineDistance(o)):c-=r[0].descent);for(const h of r)e(h.text,i,s+c),c+=l}setFont(e){this.fontFamily=e.fontFamily,this.fontSize=e.fontSize,this.fontStyle=e.fontStyle,this.fontWeight=e.fontWeight}setAlign(e){this.textAlign=e.textAlign,this.textBaseline=e.textBaseline}setBoxing(e){const i=e.border?.enabled?e.border?.stroke:void 0;e.fill!=null||i!=null?(this.boxing??(this.boxing=new He({scene:this.scene})),this.boxing.fill=e.fill,this.boxing.fillOpacity=e.fillOpacity??1,this.boxing.cornerRadius=e.cornerRadius??0,this.boxing.stroke=i,this.boxing.strokeWidth=e.border?.strokeWidth??0,this.boxing.strokeOpacity=e.border?.strokeOpacity??1,this.boxPadding=e.padding??0):this.boxing&&(this.boxing.destroy(),this.boxing=void 0)}hasBoxing(){return this.boxing!=null}getBoxingProperties(){const{fill:e,fillOpacity:i,cornerRadius:s,stroke:n,strokeWidth:a,strokeOpacity:r}=this.boxing??{};return{border:{enabled:n!=null,stroke:n,strokeWidth:a,strokeOpacity:r},cornerRadius:s,fill:e,fillOpacity:i,padding:this.boxPadding}}toSVG(){if(!this.visible||!this.hasRenderableText())return;const e=this.text;if(e==null)return;const i=wy("text");if(Xn(e))for(const s of e){const n=wy("tspan");vy(n,{fontSize:s.fontSize??this.fontSize,fontFamily:s.fontFamily??this.fontFamily,fontWeight:s.fontWeight??this.fontWeight,fontStyle:s.fontStyle??this.fontStyle}),this.applySvgFillAttributes(n),n.textContent=ir(s.text),i.append(n)}else this.applySvgFillAttributes(i),vy(i,this),i.setAttribute("text-anchor",{center:"middle",left:"start",right:"end",start:"start",end:"end"}[this.textAlign??"start"]),i.setAttribute("alignment-baseline",this.textBaseline),i.setAttribute("x",String(this.x)),i.setAttribute("y",String(this.y)),i.textContent=ir(e);return{elements:[i]}}hasRenderableText(){const{text:e}=this;return e==null?!1:Xn(e)?!0:ir(e)!==""}};Ut.className="Text",Ut.debug=HL.create(!0,"scene:text"),Ut.defaultFontSize=10,y([X()],Ut.prototype,"x",2),y([X()],Ut.prototype,"y",2),y([jL({changeCb:t=>t.onTextChange()})],Ut.prototype,"text",2),y([X({changeCb:t=>{t.fontCache=void 0}})],Ut.prototype,"fontStyle",2),y([X({changeCb:t=>{t.fontCache=void 0}})],Ut.prototype,"fontWeight",2),y([X({changeCb:t=>{t.fontCache=void 0}})],Ut.prototype,"fontSize",2),y([X({changeCb:t=>{t.fontCache=void 0}})],Ut.prototype,"fontFamily",2),y([X()],Ut.prototype,"textAlign",2),y([X()],Ut.prototype,"textBaseline",2),y([X()],Ut.prototype,"lineHeight",2);var Ht=Ut,Oy=class extends Ja(Ht){},sr=class extends Ja(Qa(Ht)){},nr=class extends VL{constructor(t){super(),this.ctx=t,this.rectNode=new He,this.textNode=new Ht,this.fill="white",this.node=this.createNode(),this.node.append([this.rectNode,this.textNode]),this.visible=!0,this.cleanup.register(t.scene.attachNode(this.node),t.eventsHub.on("layout:complete",e=>this.onLayoutComplete(e)))}createNode(){return new U({name:"background",zIndex:BL.CHART_BACKGROUND})}onLayoutComplete(t){const{width:e,height:i}=t.chart;this.rectNode.width=e,this.rectNode.height=i}};y([oc,ou("node","visible")],nr.prototype,"visible",2),y([oc,ou("rectNode","fill")],nr.prototype,"fill",2),y([oc],nr.prototype,"image",2),y([oc,ou("textNode")],nr.prototype,"text",2);import{BaseProperties as $L,FONT_SIZE as KL,Property as Pt,ProxyPropertyOnWrite as Qs,createId as ZL,isArray as XL,isSegmentTruncated as qL,isTextTruncated as JL,toPlainText as Ey,toTextString as QL,wrapText as eN,wrapTextSegments as tN}from"ag-charts-core";var Se=class extends $L{constructor(){super(...arguments),this.id=ZL(this),this.node=new Oy({zIndex:1}).setProperties({textAlign:"center",pointerEvents:1}),this.enabled=!1,this.textAlign="center",this.fontSize=KL.SMALLER,this.fontFamily="sans-serif",this.wrapping="always",this.truncate=!0,this.padding=0,this.layoutStyle="block",this.truncated=!1}registerInteraction(t,e){return t.eventsHub.on("layout:complete",()=>this.updateA11yText(t,e))}computeTextWrap(t,e){const{text:i,padding:s,wrapping:n,truncate:a}=this,r=a?t:1/0,o=a?e:1/0,l=Math.min(this.maxWidth??1/0,r)-s*2,c=this.maxHeight??o-s*2,h={maxWidth:l,maxHeight:c,font:this,textWrap:n};if(!Number.isFinite(l)&&!Number.isFinite(c)){this.node.text=i;return}let d;XL(i)?(d=tN(i,h),this.truncated=d.some(qL)):(d=eN(QL(i),h),this.truncated=JL(d)),this.node.text=d}updateA11yText(t,e){const{proxyInteractionService:i}=t;if(!this.enabled||!this.text){this.destroyProxyText();return}const s=fe.toCanvas(this.node);if(!s)return;const{id:n}=this;this.proxyText==null&&(this.proxyText=i.createProxyElement({type:"text",domManagerId:n,where:e}),this.proxyTextListeners=[this.proxyText.addListener("mousemove",o=>this.handleMouseMove(t,o)),this.proxyText.addListener("mouseleave",o=>this.handleMouseLeave(t,o))]);const a=Ey(this.text);a!==this.lastProxyTextContent&&(this.proxyText.textContent=a,this.lastProxyTextContent=a);const{lastProxyBBox:r}=this;(r==null||s.x!==r.x||s.y!==r.y||s.width!==r.width||s.height!==r.height)&&(this.proxyText.setBounds(s),this.lastProxyBBox={x:s.x,y:s.y,width:s.width,height:s.height})}handleMouseMove(t,e){if(e!=null&&this.enabled&&this.truncated){const{x:i,y:s}=fe.toCanvas(this.node),n=e.sourceEvent.offsetX+i,a=e.sourceEvent.offsetY+s;t.tooltipManager.updateTooltip(this.id,{canvasX:n,canvasY:a,showArrow:!1},[{type:"structured",title:Ey(this.text)}])}}handleMouseLeave(t,e){t.tooltipManager.removeTooltip(this.id,void 0,!0)}destroy(){this.destroyProxyText()}destroyProxyText(){if(this.proxyText!=null){for(const t of this.proxyTextListeners??[])t();this.proxyTextListeners=void 0,this.proxyText.destroy(),this.proxyText=void 0,this.lastProxyTextContent=void 0,this.lastProxyBBox=void 0}}};Se.className="Caption",y([Pt,Qs("node","visible")],Se.prototype,"enabled",2),y([Pt,Qs("node")],Se.prototype,"text",2),y([Pt,Qs("node")],Se.prototype,"textAlign",2),y([Pt,Qs("node")],Se.prototype,"fontStyle",2),y([Pt,Qs("node")],Se.prototype,"fontWeight",2),y([Pt,Qs("node")],Se.prototype,"fontSize",2),y([Pt,Qs("node")],Se.prototype,"fontFamily",2),y([Pt,Qs("node","fill")],Se.prototype,"color",2),y([Pt],Se.prototype,"spacing",2),y([Pt],Se.prototype,"maxWidth",2),y([Pt],Se.prototype,"maxHeight",2),y([Pt],Se.prototype,"wrapping",2),y([Pt],Se.prototype,"truncate",2),y([Pt],Se.prototype,"padding",2),y([Pt],Se.prototype,"layoutStyle",2);import{ChartAxisDirection as Ri,every as iN,isObject as sN}from"ag-charts-core";var dc=class extends Array{destroy(){for(const t of this)t.destroy();this.length=0}findById(t){return this.find(e=>e.id===t)}matches(t){return this.length===Object.keys(t).length&&iN(t,(e,i)=>sN(i)&&"type"in i&&this.findById(e)?.type===i.type)}getById(t){const e=this.findById(t);if(!e)throw new Error(`Could not find axis by id [${t}].`);return e}},nN=class extends dc{get[Ri.X](){return this.getById(Ri.X)}get[Ri.Y](){return this.getById(Ri.Y)}perpendicular(t){const e=t.direction===Ri.X?Ri.Y:Ri.X;return this[e]}},aN=class extends dc{get[Ri.Angle](){return this.getById(Ri.Angle)}get[Ri.Radius](){return this.getById(Ri.Radius)}};import{Property as du,cachedTextMeasurer as rN,isArray as Ry,measureTextSegments as oN,toTextString as lN}from"ag-charts-core";var uc=class{constructor(){this.title=new Se,this.subtitle=new Se,this.footnote=new Se}positionCaptions({layoutBox:t}){const{title:e,subtitle:i,footnote:s}=this,n=t.height/10;e.enabled&&(this.positionCaption("top",e,t,n),this.shrinkLayoutByCaption("top",e,t)),i.enabled&&(this.positionCaption("top",i,t,n),this.shrinkLayoutByCaption("top",i,t)),s.enabled&&(this.positionCaption("bottom",s,t,n),this.shrinkLayoutByCaption("bottom",s,t))}positionAbsoluteCaptions(t){const{title:e,subtitle:i,footnote:s}=this,{rect:n}=t.series;for(const a of[e,i,s])if(a.layoutStyle==="overlay"){if(a.textAlign==="left")a.node.x=n.x+a.padding;else if(a.textAlign==="right"){const r=a.node.getBBox();a.node.x=n.x+n.width-r.width-a.padding}}}computeX(t,e){return t==="left"?e.x:t==="right"?e.x+e.width:e.x+e.width/2}positionCaption(t,e,i,s){if(!e.text)return;const{lineMetrics:n}=Ry(e.text)?oN(e.text,e):rN(e).measureLines(lN(e.text)),a=Math.max(n[0].height,s);e.node.x=this.computeX(e.textAlign,i)+e.padding,e.node.y=i.y+(t==="top"?0:i.height)+e.padding,e.node.textBaseline=t,e.computeTextWrap(i.width,a)}shrinkLayoutByCaption(t,e,i){if(e.layoutStyle==="block"){const s=e.node.getBBox().clone(),{spacing:n=0}=e;t==="bottom"&&Ry(e.text)&&(s.y-=s.height),i.shrink(Math.ceil(t==="top"?s.y-i.y+s.height+n:i.y+i.height-s.y+n),t)}}};y([du],uc.prototype,"title",2),y([du],uc.prototype,"subtitle",2),y([du],uc.prototype,"footnote",2);import{CallbackCache as cN,CleanupRegistry as hN,EventEmitter as dN,ModuleRegistry as uN,ModuleType as pN}from"ag-charts-core";import{Logger as gN}from"ag-charts-core";var fN=["candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"],mN=class{constructor(t){this.chartService=t,this.mementoOriginatorKey="chartType"}createMemento(){let t=this.chartService.publicApi?.getOptions()?.chartType;return t??(t="candlestick"),t}guardMemento(t){return t==null||fN.includes(t)}restoreMemento(t,e,i){if(i==null)return;const s={chartType:i};this.chartService.publicApi?.updateDelta(s).catch(n=>gN.error("error restoring state",n))}};import{CleanupRegistry as yN,Debug as bN}from"ag-charts-core";var me="13.2.1",Py=Symbol("previous-memento-not-found"),xN=class{constructor(t){this.history=[],this.historyIndex=-1,this.originators=new Map,this.clearState=new Map,this.maxHistoryLength=100,this.debug=bN.create(!0,"history"),this.cleanup=new yN,this.cleanup.register(t.on("series:undo",this.undo.bind(this)),t.on("series:redo",this.redo.bind(this)))}destroy(){this.cleanup.flush()}addMementoOriginator(t){this.originators.set(t.mementoOriginatorKey,t),this.clearState.set(t.mementoOriginatorKey,t.createMemento()),this.debugEvent("History add originator:",t.mementoOriginatorKey)}clear(){this.debug("History clear:",Object.keys(this.originators)),this.history=[],this.historyIndex=-1;for(const[t,e]of this.originators.entries())this.clearState.set(t,e.createMemento())}record(t,...e){this.historyIndexthis.maxHistoryLength&&(this.history=this.history.slice(-this.maxHistoryLength));const i=new Map;for(const s of e){if(!this.originators.has(s.mementoOriginatorKey))throw new Error(`Originator [${s.mementoOriginatorKey}] has not been added to the HistoryManager.`);i.set(s.mementoOriginatorKey,s.createMemento())}this.history.push({label:t,mementos:i}),this.historyIndex=this.history.length-1,this.debugEvent(`History record: [${t}]`)}undo(){const t=this.history[this.historyIndex];if(t){for(const e of t.mementos.keys()){const i=this.findPreviousMemento(e);if(i===Py)throw new Error(`Could not find previous memento for [${e}].`);this.restoreMemento(e,i)}this.historyIndex-=1,this.debugEvent(`History undo: [${t.label}]`)}}redo(){const t=this.history[this.historyIndex+1];if(t){for(const[e,i]of t.mementos.entries())this.restoreMemento(e,i);this.historyIndex+=1,this.debugEvent(`History redo: [${t.label}]`)}}findPreviousMemento(t){for(let e=this.historyIndex-1;e>=0;e--)if(this.history[e].mementos.has(t))return this.history[e].mementos.get(t);return this.clearState.has(t)?this.clearState.get(t):Py}restoreMemento(t,e){this.originators.get(t)?.restoreMemento(me,me,e)}debugEvent(...t){this.debug(...t,this.history.map((e,i)=>i===this.historyIndex?`** ${e.label} **`:e.label))}};import{MementoCaretaker as vN,objectsEqual as SN}from"ag-charts-core";var IN=class{constructor(){this.caretaker=new vN(me),this.state=new Map}setState(t,e){SN(this.state.get(t.mementoOriginatorKey),e)||this.setStateAndRestore(t,e)}setStateAndRestore(t,e){this.state.set(t.mementoOriginatorKey,e),this.restoreState(t)}restoreState(t){const{caretaker:e,state:i}=this;if(!i.has(t.mementoOriginatorKey))return;const s=i.get(t.mementoOriginatorKey);e.restore({version:e.version,[t.mementoOriginatorKey]:s},t)}};import{attachListener as DN,createElement as qn,createId as MN,entries as AN,isDirectionRtl as CN,isDocumentFragment as TN,kebabCase as LN,setAttribute as NN,stopPageScrolling as kN}from"ag-charts-core";var wN=`.ag-charts-wrapper,.ag-charts-wrapper:after,.ag-charts-wrapper:before,.ag-charts-wrapper *,.ag-charts-wrapper *:after,.ag-charts-wrapper *:before{box-sizing:border-box}.ag-charts-wrapper{--align-items: center;--justify-content: center;position:relative;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ag-charts-wrapper--safe-horizontal{--justify-content: flex-start}.ag-charts-wrapper--safe-vertical{--align-items: flex-start}.ag-charts-tab-guard{width:0;height:0;position:absolute;pointer-events:none}.ag-charts-canvas-background{position:absolute}.ag-charts-canvas-center{position:absolute;touch-action:auto;pointer-events:auto;display:flex;align-items:var(--align-items);justify-content:var(--justify-content)}.ag-charts-canvas-container,.ag-charts-canvas{position:relative;user-select:none;-webkit-user-select:none}.ag-charts-canvas-container>*,.ag-charts-canvas>*{pointer-events:none}.ag-charts-canvas canvas{display:block}.ag-charts-series-area{outline:none;pointer-events:auto;position:absolute}.ag-charts-swapchain{top:0;left:0;outline:none;opacity:0;pointer-events:none;position:absolute;width:100%;height:100%}.ag-charts-swapchain:focus-visible{opacity:1}.ag-charts-canvas-proxy,.ag-charts-canvas-overlay{position:absolute;inset:0;pointer-events:none;user-select:none;-webkit-user-select:none}.ag-charts-canvas-overlay>*{position:absolute;pointer-events:auto}.ag-charts-canvas-overlay>[role=presentation]{left:0}.ag-charts-theme-default,.ag-charts-theme-default-dark{--ag-charts-accent-color: #2196f3;--ag-charts-background-color: #fff;--ag-charts-border-color: #dddddd;--ag-charts-border-radius: 4px;--ag-charts-chart-background-color: #fff;--ag-charts-chart-padding: 20px;--ag-charts-focus-color: #e4f2fe;--ag-charts-focus-shadow: 0 0 0 3px #2196f3;--ag-charts-foreground-color: #181d1f;--ag-charts-font-family: Verdana, sans-serif;--ag-charts-font-size: 12px;--ag-charts-font-weight: 400;--ag-charts-popup-shadow: 0 0 16px rgba(0, 0, 0, .15);--ag-charts-subtle-text-color: #8c8c8c;--ag-charts-text-color: #181d1f;--ag-charts-chrome-background-color: #fafafa;--ag-charts-chrome-font-family: Verdana, sans-serif;--ag-charts-chrome-font-size: 12px;--ag-charts-chrome-font-weight: 400;--ag-charts-chrome-subtle-text-color: #8c8c8c;--ag-charts-chrome-text-color: #181d1f;--ag-charts-button-background-color: #fff;--ag-charts-button-border-width: 1px;--ag-charts-button-font-weight: normal;--ag-charts-button-text-color: inherit;--ag-charts-input-background-color: #fff;--ag-charts-input-border-width: 1px;--ag-charts-input-text-color: #181d1f;--ag-charts-menu-background-color: #fafafa;--ag-charts-menu-border-width: 1px;--ag-charts-menu-text-color: #181d1f;--ag-charts-panel-background-color: #fafafa;--ag-charts-panel-text-color: #181d1f;--ag-charts-tooltip-background-color: #fafafa;--ag-charts-tooltip-border-width: 1px;--ag-charts-tooltip-text-color: #181d1f;--ag-charts-tooltip-subtle-text-color: #8c8c8c;--ag-charts-crosshair-label-background-color: #fafafa;--ag-charts-crosshair-label-text-color: #181d1f;--ag-charts-spacing: 4px;--ag-charts-icon-size: 16px;--ag-charts-input-border-radius: var(--ag-charts-border-radius);--ag-charts-input-focus-border-color: var(--ag-charts-accent-color);--ag-charts-input-focus-text-color: var(--ag-charts-accent-color);--ag-charts-input-disabled-background-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-foreground-color) 6% );--ag-charts-input-disabled-border-color: var(--ag-charts-border-color);--ag-charts-input-disabled-text-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-input-text-color) 50% );--ag-charts-input-placeholder-text-color: color-mix( in srgb, var(--ag-charts-input-background-color), var(--ag-charts-input-text-color) 60% );--ag-charts-button-border-radius: var(--ag-charts-border-radius);--ag-charts-button-focus-background-color: color-mix( in srgb, var(--ag-charts-button-background-color), var(--ag-charts-accent-color) 12% );--ag-charts-button-focus-border-color: var(--ag-charts-accent-color);--ag-charts-button-focus-text-color: var(--ag-charts-accent-color);--ag-charts-button-disabled-background-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-foreground-color) 6% );--ag-charts-button-disabled-border-color: var(--ag-charts-border-color);--ag-charts-button-disabled-text-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-chrome-text-color) 50% );--ag-charts-checkbox-background-color: color-mix( in srgb, var(--ag-charts-background-color), var(--ag-charts-foreground-color) 35% );--ag-charts-checkbox-checked-background-color: var(--ag-charts-accent-color);--ag-charts-tooltip-border-radius: var(--ag-charts-border-radius);--ag-charts-menu-border-radius: var(--ag-charts-border-radius);--ag-charts-chrome-font-size-small: var(--ag-charts-chrome-font-size);--ag-charts-chrome-font-size-medium: calc(var(--ag-charts-chrome-font-size) * (13 / 12));--ag-charts-chrome-font-size-large: calc(var(--ag-charts-chrome-font-size) * (14 / 12));--ag-charts-border-width: 1px;--ag-charts-border: var(--ag-charts-border-width) solid var(--ag-charts-border-color);--ag-charts-focus-border: 1px solid var(--ag-charts-accent-color);--ag-charts-focus-border-shadow: 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%);--ag-charts-layer-menu: 6;--ag-charts-layer-ui-overlay: 5;--ag-charts-layer-tooltip: 4;--ag-charts-layer-toolbar: 3;--ag-charts-layer-crosshair: 2;--ag-charts-layer-annotations: 1}.ag-chart-canvas-wrapper .ag-charts-theme-default{--ag-charts-border-radius: var(--ag-border-radius, 4px);--ag-charts-border: var(--ag-borders-critical, solid 1px) var(--ag-charts-border-color);--ag-charts-focus-shadow: var(--ag-focus-shadow, 0 0 0 3px var(--ag-charts-accent-color));--ag-charts-focus-border-shadow: var( --ag-focus-shadow, 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%) )}.ag-charts-icon{display:block;width:20px;height:20px;speak:none;speak:never;mask:var(--icon) center / contain no-repeat;background-color:currentColor;transition:background-color .25s ease-in-out}.ag-charts-icon-align-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNyAxMGg2djFIN3pNNCA3aDEydjFINHptMSA2aDEwdjFINXoiLz48L3N2Zz4=)}.ag-charts-icon-align-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNCAxMGg2djFINHptMC0zaDEydjFINHptMCA2aDEwdjFINHoiLz48L3N2Zz4=)}.ag-charts-icon-align-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTAgMTBoNnYxaC02ek00IDdoMTJ2MUg0em0yIDZoMTB2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-arrow-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE1LjI5MyA0LjVIMTIuNXYtMUgxN3Y0aC0xVjUuMjA3bC05LjY0NiA5LjY0Ny0uNzA4LS43MDh6IiBmaWxsPSIjMDAwIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03IDE2YTIuNSAyLjUgMCAxIDEtNSAwIDIuNSAyLjUgMCAwIDEgNSAwbS0yLjUgMS41YTEuNSAxLjUgMCAxIDAgMC0zIDEuNSAxLjUgMCAwIDAgMCAzIiBmaWxsPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-arrow-down-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02IDhMMS41IDhMMTAgMThMMTguNSA4TDE0IDhMMTQgM0w2IDNMNiA4Wk03IDRMNyA5SDMuNjYyNDRMMTAgMTYuNDU2TDE2LjMzNzYgOUwxMyA5TDEzIDRMNyA0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-arrow-up-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNCAxMkgxOC41TDEwIDJMMS41IDEySDZMNi4wMDAwMiAxN0gxNFYxMlpNMTMgMTZWMTFIMTYuMzM3NkwxMCAzLjU0NDA1TDMuNjYyNDQgMTFIN0w3LjAwMDAyIDE2SDEzWiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-callout-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtNC41MTRhMjYgMjYgMCAwIDAtMi4wMTcgMS41NGwtLjMxNC4yNmMtLjU1LjQ1Ny0xLjExNS45MjYtMS43NiAxLjQtLjY2OS40OTEtMS41NjItLjAxMi0xLjU2Mi0uOFYxNEg0LjVBMS41IDEuNSAwIDAgMSAzIDEyLjV6TTQuNSA0YS41LjUgMCAwIDAtLjUuNXY4YS41LjUgMCAwIDAgLjUuNWgxLjgzM3YzLjM3MmEzNiAzNiAwIDAgMCAxLjY3OC0xLjMzOGwuMzItLjI2NWEyNiAyNiAwIDAgMSAyLjIyNS0xLjY4NWwuMTI2LS4wODRIMTUuNWEuNS41IDAgMCAwIC41LS41di04YS41LjUgMCAwIDAtLjUtLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyAxdjNoMnYxMkg3djNINnYtM0g0VjRoMlYxek01IDVoM3YxMEg1ek0xMSAxNFY2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6bTEtN2gzdjZoLTN6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-chevron-filled-down{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMy42NjcgNS4zMzQgOCAxMC42NjdsNC4zMzQtNS4zMzN6IiBmaWxsPSIjMTgxZDFmIi8+PC9zdmc+)}.ag-charts-icon-chevron-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjQ3IDUuNDdhLjc1Ljc1IDAgMCAxIDEuMDYgMGw0IDRhLjc1Ljc1IDAgMCAxIDAgMS4wNmwtNCA0YS43NS43NSAwIDAgMS0xLjA2LTEuMDZMMTAuOTQgMTAgNy40NyA2LjUzYS43NS43NSAwIDAgMSAwLTEuMDYiIGZpbGw9IiMwMDAiLz48L3N2Zz4=)}.ag-charts-icon-close{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtNSA1IDEwIDEwTTUgMTUgMTUgNSIgc3Ryb2tlPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-comment-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy41MTMgMy45OTVhNi41IDYuNSAwIDAgMSA2LjA5OCAxMS40MWMtLjU4OC4zOTMtMS4yMTcuNTM2LTEuODI5LjU4NWExMyAxMyAwIDAgMS0xLjI3LjAxN0EyNyAyNyAwIDAgMCAxMCAxNkg0LjVhLjUuNSAwIDAgMS0uNS0uNVYxMHEwLS4yNDctLjAwNy0uNTEzYy0uMDA4LS40MTYtLjAxNi0uODU3LjAxNy0xLjI2OS4wNS0uNjEyLjE5Mi0xLjI0LjU4NS0xLjgzYTYuNSA2LjUgMCAwIDEgMi45MTgtMi4zOTNtMy41Ni42MWE1LjUgNS41IDAgMCAwLTUuNjQ2IDIuMzRjLS4yNjYuMzk3LS4zNzkuODQyLS40MiAxLjM1NC0uMDMuMzYtLjAyMi43MTgtLjAxNSAxLjEwOFE1IDkuNjg5IDUgMTB2NWg1cS4zMTEuMDAxLjU5My4wMDhjLjM5LjAwNy43NDcuMDE1IDEuMTA4LS4wMTUuNTEyLS4wNDEuOTU3LS4xNTQgMS4zNTUtLjQyYTUuNSA1LjUgMCAwIDAtMS45ODMtOS45NjciIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-crosshair-add-line{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-date-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMiAyaDF2MTZIMnptMTUgMGgxdjE2aC0xeiIgZmlsbD0iIzE4MUQxRiIvPjxwYXRoIGQ9Ik0xMy4xNTcgMTFINXYtMWg3Ljc5M0wxMSA4LjIwN2wuNzA3LS43MDcgMy4xODIgMy4xODItMy4xODIgMy4xODItLjcwNy0uNzA3eiIgZmlsbD0iIzAwMCIvPjwvc3ZnPg==)}.ag-charts-icon-date-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMyAySDJ2MTZoMXptMy41MDcgNC44OUw4LjUgNC44OTVWMTBINXYxaDMuNXY3aDF2LTdoNS4wODhsLTEuOTU3IDEuOTU3LjcwNy43MDcgMy4xODItMy4xODJMMTMuMzM4IDcuM2wtLjcwNy43MDdMMTQuNjI0IDEwSDkuNVY0LjkzMmwxLjk1NyAxLjk1Ny43MDctLjcwN0w4Ljk4MiAzIDUuOCA2LjE4MnoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-delete{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTguNDk2IDguOTk2QS41LjUgMCAwIDEgOSA5LjQ5MnY0YS41LjUgMCAxIDEtMSAuMDA4di00YS41LjUgMCAwIDEgLjQ5Ni0uNTA0TTEyIDkuNWEuNS41IDAgMCAwLTEgMHY0YS41LjUgMCAwIDAgMSAweiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTYgNVYzLjVBMi41IDIuNSAwIDAgMSA4LjUgMWgzQTIuNSAyLjUgMCAwIDEgMTQgMy41VjVoMi44MzNhLjUuNSAwIDAgMSAwIDFIMTV2MTAuMjVjMCAuNDE1LS4wNjYuODYzLS4zIDEuMjIxLS4yNTcuMzk0LS42NzIuNjEyLTEuMi42MTJoLTdjLS41MjggMC0uOTQzLS4yMTgtMS4yLS42MTItLjIzNC0uMzU4LS4zLS44MDYtLjMtMS4yMjFWNkgzLjMzM2EuNS41IDAgMCAxIDAtMXptMS0xLjVBMS41IDEuNSAwIDAgMSA4LjUgMmgzQTEuNSAxLjUgMCAwIDEgMTMgMy41VjVIN3pNNiAxNi4yNVY2aDh2MTAuMjVjMCAuMzM1LS4wNTkuNTU0LS4xMzguNjc1LS4wNTUuMDg1LS4xNC4xNTgtLjM2Mi4xNThoLTdjLS4yMjIgMC0uMzA3LS4wNzMtLjM2Mi0uMTU4LS4wOC0uMTIxLS4xMzgtLjM0LS4xMzgtLjY3NSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-disjoint-channel,.ag-charts-icon-disjoint-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTkuMDI4IDE3LjQ2YTIuMjUgMi4yNSAwIDAgMC00LjA5Mi0xLjg1bC05LjUxMS0yLjM3OGEyLjI1IDIuMjUgMCAxIDAtLjIyNS45NzRsOS40NzUgMi4zNjlhMi4yNTEgMi4yNTEgMCAwIDAgNC4zNTMuODg2bS0xLjY2Mi0xLjk2NWExLjI1IDEuMjUgMCAxIDEtLjg4NSAyLjMzOCAxLjI1IDEuMjUgMCAwIDEgLjg4NS0yLjMzOE00LjM0MyAxMy42NjlhMS4yNSAxLjI1IDAgMSAwLTIuMzM4LS44ODUgMS4yNSAxLjI1IDAgMCAwIDIuMzM4Ljg4NU0zLjk3IDguNzY5YTIuMjUgMi4yNSAwIDAgMCAxLjQ1NS0yLjExbDkuNTExLTIuMzc4YTIuMjUgMi4yNSAwIDEgMC0uMjYtLjk2NUw1LjIgNS42ODVhMi4yNSAyLjI1IDAgMSAwLTEuMjMgMy4wODRtLjM3My0yLjU0N2ExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjc1LTMuNDM4YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-drag-handle{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjcuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjxjaXJjbGUgY3g9IjEzLjc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iMTMuNzUiIGN5PSIxMS43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjExLjc1IiByPSIuNzUiIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjUiLz48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iMTEuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjwvc3ZnPg==)}.ag-charts-icon-fibonacci-retracement-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA1aDEydjFIMnoiLz48Y2lyY2xlIGN4PSIxNS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4yNSIgY3k9IjE0LjUiIHI9IjEuNzUiIHN0cm9rZT0iIzAwMCIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik0xOCAxNUg2di0xaDEyem0wLTQuNUgydi0xaDE2eiIvPjwvc3ZnPg==)}.ag-charts-icon-fibonacci-retracement-trend-based-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJtNC45OTYgMTIuNjc0IDMuMjkxLTUuNzQzLjg2OC40OTctMy4yOTEgNS43NDN6Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4zNTEiIGN5PSIxNC41IiByPSIxLjc1IiBzdHJva2U9IiMwMDAiLz48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTggNmgtN1Y1aDd6bTAgNC41aC03di0xaDd6bTAgNC41SDZ2LTFoMTJ6Ii8+PC9zdmc+)}.ag-charts-icon-fill-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtOC4wNzEgNC4wNi0uOTI0LS45MjQuNzA3LS43MDcgNy4yODggNy4yODgtNC45NSA0Ljk1YTMuNSAzLjUgMCAwIDEtNC45NSAwbC0xLjQxNC0xLjQxNGEzLjUgMy41IDAgMCAxIDAtNC45NXptLjcwNy43MDhMNC41MzYgOS4wMWEyLjUgMi41IDAgMCAwIDAgMy41MzZMNS45NSAxMy45NmEyLjUgMi41IDAgMCAwIDMuNTM1IDBsNC4yNDMtNC4yNDN6bTYuOSA3LjIwMi0uMzQ1LjM2My0uMzQ0LS4zNjNhLjUuNSAwIDAgMSAuNjg4IDBtLS4zNDUgMS4wOGE4IDggMCAwIDAtLjI4LjMyMyA0LjMgNC4zIDAgMCAwLS40MDkuNTgyYy0uMTEzLjIwMS0uMTQ0LjMyNi0uMTQ0LjM3OGEuODMzLjgzMyAwIDAgMCAxLjY2NyAwYzAtLjA1Mi0uMDMxLS4xNzctLjE0NC0uMzc4YTQuMyA0LjMgMCAwIDAtLjQxLS41ODIgOCA4IDAgMCAwLS4yOC0uMzIybS0uMzQ0LTEuMDguMzQ0LjM2My4zNDQtLjM2My4wMDIuMDAyLjAwNC4wMDQuMDEzLjAxMmE2IDYgMCAwIDEgLjIwNi4yMDhjLjEzMS4xMzYuMzA4LjMyNy40ODUuNTQ1LjE3Ni4yMTUuMzYzLjQ2Ny41MDcuNzI0LjEzNy4yNDMuMjczLjU1My4yNzMuODY4YTEuODMzIDEuODMzIDAgMSAxLTMuNjY3IDBjMC0uMzE1LjEzNi0uNjI1LjI3My0uODY4LjE0NC0uMjU3LjMzLS41MDkuNTA3LS43MjRhOSA5IDAgMCAxIC42NDUtLjcwOGwuMDQ2LS4wNDUuMDEzLS4wMTIuMDA0LS4wMDR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-high-low-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyA0aDJ2MTJINFY0aDNNNSA1aDN2MTBINXpNMTEgMTRWNmg1djhoLTVtMS03aDN2NmgtM3oiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-hlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTYzIDEuODM3LTUuMzM0IDExLjYyMUw2Ljk1NyA4LjEybC00LjE5OSA5LjYyMi0uOTE2LS40IDQuNzU2LTEwLjlMMTIuNDkgMTEuOCAxNy4yNTQgMS40MnoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjQiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTUuODI1IDIuNzA0LjU1IDEzLjc4NWwuOTAyLjQzIDQuNzI0LTkuOTE5IDYuMDM0IDUuMDI5IDMuMjU1LTguMTQtLjkyOC0uMzctMi43NDUgNi44NnptNy44NTIgMTQuNjM2IDUuNzgtMTMuMTM5LS45MTUtLjQwMi01LjIxOSAxMS44Ni02LjAwNS01LjUwNC0zLjI3OCA3LjY0OC45Mi4zOTQgMi43MjItNi4zNTJ6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-hollow-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1vcGFjaXR5PSIuMTUiIGQ9Ik01IDVoM3YxMEg1eiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTcgMXYzaDJ2MTJIN3YzSDZ2LTNINFY0aDJWMXpNNSA1aDN2MTBINXptNyAyaDN2NmgtM3ptLTEgN1Y2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-horizontal-line,.ag-charts-icon-horizontal-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNLjUgOS41aDcuMzA2YTIuMjUgMi4yNSAwIDAgMSA0LjM4OCAwSDE5LjV2MWgtNy4zMDZhMi4yNSAyLjI1IDAgMCAxLTQuMzg4IDBILjV6bTkuNSAxLjc1YTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-line-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTQuMjQyIDIuNzIyYy0uNjEyIDAtMS4yLjI0My0xLjYzMi42NzVsLTEuMzQzIDEuMzQ0YS41LjUgMCAwIDAtLjExMi4xMTJMNC4wNSAxMS45NTljLS4yMDcuMjA3LS4zNi40Ni0uNDQ2Ljc0di4wMDFsLS42OSAyLjc2N3YuMDAyYS44Mi44MiAwIDAgMCAxLjAyMiAxLjAyMWguMDAybDIuNjM0LS44MjJjLjI4LS4wODUuNTM0LS4yMzcuNzQtLjQ0M2w3LjEwNy03LjEwOGEuNS41IDAgMCAwIC4xMTItLjExMmwxLjM0My0xLjM0M2EyLjMwOCAyLjMwOCAwIDAgMC0xLjYzMi0zLjk0TTE0LjEyMiA3bDEuMDQ0LTEuMDQ1YTEuMzA4IDEuMzA4IDAgMSAwLTEuODQ5LTEuODVMMTIuMjcxIDUuMTV6bS0yLjU1OC0xLjE0Mi02LjgwNyA2LjgwOWEuOC44IDAgMCAwLS4xOTYuMzI1bC0uNzUgMi40NjggMi40Ny0uNzQ5YS44LjggMCAwIDAgLjMyNS0uMTk0bDYuODA4LTYuODF6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTcuMzYyIDQuODczLTQuNTk0IDYuNjU0LTQuODUtMy4zMTctNC4yNTEgNi45NzctLjg1NC0uNTJMNy42MTIgNi43OWw0Ljg5OSAzLjM1IDQuMDI4LTUuODM2eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-line-style-dashed{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDR2MUgyem0xMiAwaDR2MWgtNHpNOCA5aDR2MUg4eiIvPjwvc3ZnPg==)}.ag-charts-icon-line-style-dotted{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIyLjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSI4LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTAuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSIxMi41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjE0LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48L3N2Zz4=)}.ag-charts-icon-line-style-solid{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDE2djFIMnoiLz48L3N2Zz4=)}.ag-charts-icon-line-with-markers-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTk4IDQuODg4LTMuNTU2IDQuOTE4YTIuMjUgMi4yNSAwIDEgMS0zLjg2Ni43NWwtMS40MzItLjlhMi4yNCAyLjI0IDAgMCAxLTIuMDA5LjQzNWwtMy44MjggNi40MjgtLjg2LS41MTJMNi40NSA5LjYyM2EyLjI1IDIuMjUgMCAxIDEgMy41MS0uNzYxbDEuMzI5LjgzNWEyLjI0IDIuMjQgMCAwIDEgMi41NTctLjQ5N2wzLjU0Mi00Ljg5OHptLTQuOTYgNS4xNTNhMS4yNSAxLjI1IDAgMSAwLS42NCAyLjQxOSAxLjI1IDEuMjUgMCAwIDAgLjY0LTIuNDE5TTkuMSA4LjMyMXEuMDY2LS4xOTIuMDY3LS40MDRhMS4yNSAxLjI1IDAgMSAwLS4wNjcuNDA0IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-lock,.ag-charts-icon-locked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuMjA3IDMuNzY0YTIuODk0IDIuODk0IDAgMCAwLTIuODk1IDIuODk0VjloNS43ODlWNi42NThhMi44OTQgMi44OTQgMCAwIDAtMi44OTUtMi44OTRNMTQuMSA5VjYuNjU4YTMuODk0IDMuODk0IDAgMSAwLTcuNzg5IDB2Mi4zNDlBMi41IDIuNSAwIDAgMCA0IDExLjV2M0EyLjUgMi41IDAgMCAwIDYuNSAxN2g4YTIuNSAyLjUgMCAwIDAgMi41LTIuNXYtM0EyLjUgMi41IDAgMCAwIDE0LjUgOXpNNi41IDEwQTEuNSAxLjUgMCAwIDAgNSAxMS41djNBMS41IDEuNSAwIDAgMCA2LjUgMTZoOGExLjUgMS41IDAgMCAwIDEuNS0xLjV2LTNhMS41IDEuNSAwIDAgMC0xLjUtMS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-measurer-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibTQuNDYxIDEyLjcxIDEuNTMyLTEuNTMxIDEuNDE0IDEuNDE0LjcwNy0uNzA3TDYuNyAxMC40NzJsMS41MzItMS41MzMgMiAyIC43MDctLjcwNy0yLTIgNi4wMS02LjAxIDIuODMgMi44MjhMNS4wNSAxNy43NzggMi4yMjIgMTQuOTVsMS41MzItMS41MzIgMS40MTQgMS40MTQuNzA3LS43MDd6TS44MDggMTQuOTVsLjcwNy0uNzA3TDE0LjI0MyAxLjUxNWwuNzA3LS43MDcuNzA3LjcwNyAyLjgyOCAyLjgyOC43MDcuNzA3LS43MDcuNzA3TDUuNzU3IDE4LjQ4NWwtLjcwNy43MDctLjcwNy0uNzA3LTIuODI4LTIuODI4em0xMS4wNzgtNi44MzVMMTAuNDcgNi43bC43MDctLjcwNyAxLjQxNSAxLjQxNHptLjgyNC0zLjY1NCAxIDEgLjcwOC0uNzA3LTEtMXoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-note-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtMy4yMWwtMS40NjkgMi41N2ExIDEgMCAwIDEtMS42ODIuMDg1TDcuMjQzIDE0SDQuNUExLjUgMS41IDAgMCAxIDMgMTIuNXpNNC41IDRhLjUuNSAwIDAgMC0uNS41djhhLjUuNSAwIDAgMCAuNS41aDMuMjU3bDIuMTk2IDMuMDc0TDExLjcxIDEzaDMuNzlhLjUuNSAwIDAgMCAuNS0uNXYtOGEuNS41IDAgMCAwLS41LS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNi41IDYuNUEuNS41IDAgMCAxIDcgNmg2YS41LjUgMCAwIDEgMCAxSDdhLjUuNSAwIDAgMS0uNS0uNU02LjUgOS41QS41LjUgMCAwIDEgNyA5aDZhLjUuNSAwIDAgMSAwIDFIN2EuNS41IDAgMCAxLS41LS41IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-ohlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTEzIDExaC0zdi0xaDNWM2gxdjJoNHYxaC00djExaC0xek02IDE3di0yaDN2LTFINlY0SDV2MUgydjFoM3YxMXoiLz48L3N2Zz4=)}.ag-charts-icon-pan-end{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0ibTYuNjQ2IDEzLjgxMy0uMzUzLjM1NC43MDcuNzA3LjM1NC0uMzU0ek0xMS4xNjYgMTBsLjM1NC4zNTQuMzU0LS4zNTQtLjM1NC0uMzU0ek03LjM1NSA1LjQ4IDcgNS4xMjZsLS43MDcuNzA3LjM1My4zNTR6bTAgOS4wNCA0LjE2Ni00LjE2Ni0uNzA3LS43MDgtNC4xNjcgNC4xNjd6bTQuMTY2LTQuODc0TDcuMzU0IDUuNDhsLS43MDguNzA3IDQuMTY3IDQuMTY3ek0xMy4wODMgNXYxMGgxVjV6Ii8+PC9zdmc+)}.ag-charts-icon-pan-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuNzkgNS44MzMgOC42MjUgMTBsNC4xNjYgNC4xNjctLjcwNy43MDdMNy4yMSAxMGw0Ljg3My00Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy4yMSAxNC4xNjcgMTEuMzc2IDEwIDcuMjEgNS44MzNsLjcwNy0uNzA3TDEyLjc5IDEwbC00Ljg3MyA0Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-start{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgNXYxMGgxVjV6TTkuNjI0IDEwbDQuMTY2LTQuMTY3LS43MDctLjcwN0w4LjIxIDEwbDQuODc0IDQuODc0LjcwNy0uNzA3eiIvPjwvc3ZnPg==)}.ag-charts-icon-parallel-channel,.ag-charts-icon-parallel-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTcuNzIgNS4zMzFBMi4yNSAyLjI1IDAgMSAwIDE0LjcwNSAzLjZsLTkuNDkgNC41NjJhMi4yNSAyLjI1IDAgMSAwIC4yMDkgMS4wMWw5LjY2Mi00LjY0NmEyLjI1IDIuMjUgMCAwIDAgMi42MzQuODA1bS4zNzMtMi41NDdhMS4yNSAxLjI1IDAgMSAxLTIuMzM4Ljg4NSAxLjI1IDEuMjUgMCAwIDEgMi4zMzgtLjg4NU00LjM0MyA4LjY3YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODVNNS4zMDcgMTYuNzI4YTIuMjUgMi4yNSAwIDEgMS0uNTI1LS44NThsOS45MjMtNC43N2EyLjI1IDIuMjUgMCAxIDEgLjM4MS45MjZ6bS0uOTY0LjI3NGExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjAyMy01LjEwNmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-position-bottom{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzem0zLTNoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgMTNoOHYxSDZ6Ii8+PC9zdmc+)}.ag-charts-icon-position-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMyAxMGgxNHYxSDN6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDdoOHYxSDZ6bTAgNmg4djFINnoiLz48L3N2Zz4=)}.ag-charts-icon-position-top{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzeiIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik02IDdoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDEzaDh2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-price-label-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNC41IDNBMS41IDEuNSAwIDAgMCAzIDQuNVYxM2ExLjUgMS41IDAgMCAwIDEuNSAxLjVoLjgzM3YuMDU3Yy4yNDItLjI5OS41OTctLjUwMyAxLS41NDhWMTMuNUg0LjVBLjUuNSAwIDAgMSA0IDEzVjQuNWEuNS41IDAgMCAxIC41LS41aDExYS41LjUgMCAwIDEgLjUuNXY4YS41LjUgMCAwIDEtLjUuNWgtNC44MThsLS4xMjYuMDg0YTI2IDI2IDAgMCAwLTIuMjI1IDEuNjg1bC0uMzIuMjY1LS4wNjguMDU2YTEuNSAxLjUgMCAwIDEtMi42MDkgMS4zNTRjLjAzMy43NjMuOTA1IDEuMjM4IDEuNTYuNzU2LjY0Ni0uNDc0IDEuMjEtLjk0MyAxLjc2MS0xLjRsLjMxMy0uMjZBMjYgMjYgMCAwIDEgMTAuOTg2IDE0SDE1LjVhMS41IDEuNSAwIDAgMCAxLjUtMS41di04QTEuNSAxLjUgMCAwIDAgMTUuNSAzeiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNOC43MTYgMTQuODE1YTIuMjUgMi4yNSAwIDEgMS00LjIxIDEuNTkzIDIuMjUgMi4yNSAwIDAgMSA0LjIxLTEuNTkzbS0xLjY2MiAxLjk2NmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS41IDYuMjI4IDcuMTY3IDguMzc2IDYuNSA3Ljc2MiA5LjUgNWwzIDIuNzYyLS42NjcuNjE0eiIgZmlsbD0iIzAwMCIvPjxwYXRoIGQ9Ik0yIDE4di0xaDE2djF6TTIgM1YyaDE2djF6IiBmaWxsPSIjMTgxRDFGIi8+PC9zdmc+)}.ag-charts-icon-reset{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuMDQgNC40NDVhNS44MSA1LjgxIDAgMCAwLTcuMjU3IDIuNDUzLjUuNSAwIDAgMS0uODY1LS41MDJBNi44MSA2LjgxIDAgMSAxIDMgOS44MTNhLjUuNSAwIDAgMSAxIDAgNS44MSA1LjgxIDAgMSAwIDguMDQtNS4zNjgiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTQuMjg5IDMuMDAyYS41LjUgMCAwIDEgLjUuNXYyLjY1NWgyLjY1NWEuNS41IDAgMCAxIDAgMUg0LjI5YS41LjUgMCAwIDEtLjUtLjVWMy41MDJhLjUuNSAwIDAgMSAuNS0uNSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-settings{--icon: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkIj48cGF0aCBkPSJNMTAgMTNhMyAzIDAgMSAwIDAtNiAzIDMgMCAwIDAgMCA2bTAtMWEyIDIgMCAxIDEtLjAwMS0zLjk5OUEyIDIgMCAwIDEgMTAgMTIiLz48cGF0aCBkPSJNMi4zMSAxNC4zNDVjLS44MTctMS40OTEuMDI3LTIuNDk5LjQ3NC0yLjg2NS41MzEtLjQzNC45NjktLjM2NS45NzItMS40OC0uMDAzLTEuMTE1LS40NDEtMS4wNDYtLjk3Mi0xLjQ4MS0uNDU0LS4zNzEtMS4zMTctMS40MDUtLjQzNC0yLjkzNmwuMDA1LS4wMDljLjg4NC0xLjUyIDIuMjA3LTEuMjkgMi43NTUtMS4wODMuNjQxLjI0My44MDEuNjU2IDEuNzY4LjEwMS45NjQtLjU2LjY4Ni0uOTA0Ljc5Ni0xLjU4Mi4wOTQtLjU3OC41NTktMS44NDMgMi4zMjYtMS44NDNoLjAxYzEuNzU5LjAwNSAyLjIyMiAxLjI2NiAyLjMxNiAxLjg0My4xMS42NzgtLjE2OCAxLjAyMi43OTYgMS41ODIuOTY3LjU1NSAxLjEyNy4xNDIgMS43NjgtLjEwMS41NDktLjIwOCAxLjg3Ni0uNDM4IDIuNzYgMS4wOTJzLjAyIDIuNTY1LS40MzQgMi45MzZjLS41MzEuNDM1LS45NjkuMzY2LS45NzIgMS40ODEuMDAzIDEuMTE1LjQ0MSAxLjA0Ni45NzIgMS40OC40NTQuMzcyIDEuMzE3IDEuNDA2LjQzNCAyLjkzN2wtLjAwNS4wMDljLS44ODQgMS41Mi0yLjIwNyAxLjI5LTIuNzU1IDEuMDgzLS42NDEtLjI0My0uODAxLS42NTYtMS43NjgtLjEwMS0uOTY0LjU2LS42ODYuOTA0LS43OTYgMS41ODEtLjA5NC41NzktLjU1OSAxLjg0NC0yLjMyNiAxLjg0NGgtLjAxYy0xLjc1OS0uMDA1LTIuMjIyLTEuMjY2LTIuMzE2LTEuODQ0LS4xMS0uNjc3LjE2OC0xLjAyMS0uNzk2LTEuNTgxLS45NjctLjU1NS0xLjEyNy0uMTQyLTEuNzY4LjEwMS0uNTQ5LjIwOC0xLjg3Ni40MzgtMi43Ni0xLjA5MmwtLjAyLS4wMzZ6TTkuOTg0IDIuMTYySDEwYzEuMzU1IDAgMS4zNDIgMS4wMzkgMS4zNTMgMS40MjUuMDA4LjMxMi4wNCAxLjE2IDEuMjU5IDEuODcybC4wMTUuMDA4YzEuMjI1LjcgMS45NzYuMzA0IDIuMjUxLjE1NS4zMzctLjE4MyAxLjIyNi0uNzExIDEuOTAyLjQ0NWwuMDA4LjAxNGMuNjc4IDEuMTczLS4yMjkgMS42ODItLjU1OCAxLjg4NC0uMjY2LjE2My0uOTg0LjYxNS0uOTkxIDIuMDI3di4wMTZjLjAwNyAxLjQxMi43MjUgMS44NjQuOTkxIDIuMDI3LjMyOC4yMDEgMS4yMjkuNzA3LjU2NiAxLjg3bC0uMDA4LjAxNGMtLjY3NyAxLjE3NC0xLjU3MS42NDMtMS45MS40NTktLjI3NS0uMTQ5LTEuMDI2LS41NDUtMi4yNTEuMTU0bC0uMDE1LjAwOWMtMS4yMTkuNzEyLTEuMjUxIDEuNTYtMS4yNTkgMS44NzItLjAxMS4zODYuMDAyIDEuNDI1LTEuMzUzIDEuNDI1cy0xLjM0Mi0xLjAzOS0xLjM1My0xLjQyNWMtLjAwOC0uMzEyLS4wNC0xLjE2LTEuMjU5LTEuODcybC0uMDE1LS4wMDljLTEuMjI1LS42OTktMS45NzYtLjMwMy0yLjI1MS0uMTU0LS4zMzYuMTgzLTEuMjE5LjcwNi0xLjg5NC0uNDMybC0uMDE2LS4wMjdjLS42NzgtMS4xNzQuMjI5LTEuNjgyLjU1OC0xLjg4NC4yNjYtLjE2My45ODQtLjYxNS45OTEtMi4wMjd2LS4wMTZjLS4wMDctMS40MTItLjcyNS0xLjg2NC0uOTkxLTIuMDI3LS4zMjgtLjIwMS0xLjIyOS0uNzA3LS41NjYtMS44N2wuMDA4LS4wMTRjLjY3Ny0xLjE3NCAxLjU3MS0uNjQzIDEuOTEtLjQ1OS4yNzUuMTQ5IDEuMDI2LjU0NSAyLjI1MS0uMTU1bC4wMTUtLjAwOGMxLjIxOS0uNzEyIDEuMjUxLTEuNTYgMS4yNTktMS44NzIuMDEtLjM4NC0uMDAyLTEuNDE3IDEuMzM3LTEuNDI1Ii8+PC9zdmc+)}.ag-charts-icon-step-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzE4MUQxRiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNiA0aDV2OGgzVjhoNXYxaC00djRoLTVWNUg3djEwSDJ2LTFoNHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-text-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00IDRIMTZWN0gxNVY1SDEwLjVWMTVIMTRWMTZINlYxNUg5LjVWNUg1VjdINFY0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-trend-line,.ag-charts-icon-trend-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS4zMTQgMTAuOTM4YTIuMjUgMi4yNSAwIDEgMSAuMDEtMWg5LjM1MmEyLjI1IDIuMjUgMCAxIDEgLjAxIDF6bS0yLjE4OS43MjlhMS4yNSAxLjI1IDAgMSAwIDAtMi41IDEuMjUgMS4yNSAwIDAgMCAwIDIuNW0xMy43NSAwYTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-unlock,.ag-charts-icon-unlocked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNjUxIDMuNWEyLjg5NCAyLjg5NCAwIDAgMC0yLjg5NCAyLjg5NFY5SDE0LjVhMi41IDIuNSAwIDAgMSAyLjUgMi41djNhMi41IDIuNSAwIDAgMS0yLjUgMi41aC04QTIuNSAyLjUgMCAwIDEgNCAxNC41di0zQTIuNSAyLjUgMCAwIDEgNi41IDloLjI1N1Y2LjM5NGEzLjg5NCAzLjg5NCAwIDEgMSA3Ljc4OSAwIC41LjUgMCAwIDEtMSAwQTIuODk0IDIuODk0IDAgMCAwIDEwLjY1IDMuNU02LjUgMTBBMS41IDEuNSAwIDAgMCA1IDExLjV2M0ExLjUgMS41IDAgMCAwIDYuNSAxNmg4YTEuNSAxLjUgMCAwIDAgMS41LTEuNXYtM2ExLjUgMS41IDAgMCAwLTEuNS0xLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-vertical-line,.ag-charts-icon-vertical-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNSA3LjgwNmEyLjI1IDIuMjUgMCAwIDEgMCA0LjM4OFYxOS41aC0xdi03LjMwNmEyLjI1IDIuMjUgMCAwIDEgMC00LjM4OFYuNWgxem0tLjUuOTQ0YTEuMjUgMS4yNSAwIDEgMSAwIDIuNSAxLjI1IDEuMjUgMCAwIDEgMC0yLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-zoom-in{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-zoom-out{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS41IDEwYS41LjUgMCAwIDEgLjUtLjVoOGEuNS41IDAgMCAxIDAgMUg2YS41LjUgMCAwIDEtLjUtLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-zoom-in-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20taW4iPjxjaXJjbGUgY3g9IjExIiBjeT0iMTEiIHI9IjgiLz48bGluZSB4MT0iMjEiIHgyPSIxNi42NSIgeTE9IjIxIiB5Mj0iMTYuNjUiLz48bGluZSB4MT0iMTEiIHgyPSIxMSIgeTE9IjgiIHkyPSIxNCIvPjxsaW5lIHgxPSI4IiB4Mj0iMTQiIHkxPSIxMSIgeTI9IjExIi8+PC9zdmc+)}.ag-charts-icon-zoom-out-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20tb3V0Ij48Y2lyY2xlIGN4PSIxMSIgY3k9IjExIiByPSI4Ii8+PGxpbmUgeDE9IjIxIiB4Mj0iMTYuNjUiIHkxPSIyMSIgeTI9IjE2LjY1Ii8+PGxpbmUgeDE9IjgiIHgyPSIxNCIgeTE9IjExIiB5Mj0iMTEiLz48L3N2Zz4=)}.ag-charts-input{--input-layer-active: 1;--input-layer-focus: 2;--input-padding: calc(var(--ag-charts-spacing) * 2);--input-padding-large: calc(var(--ag-charts-spacing) * 2.5);color:var(--ag-charts-input-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-large);transition-duration:.25s;transition-property:none;transition-timing-function:ease-out}.ag-charts-input:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--input-layer-focus)}.ag-charts-button{background:var(--ag-charts-button-background-color);border-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-button-border-radius);border-style:solid;border-width:var(--ag-charts-button-border-width);color:var(--ag-charts-button-text-color);cursor:pointer;padding:var(--input-padding);transition-property:background,border-color}.ag-charts-button:hover{background:var(--ag-charts-focus-color)}.ag-charts-button:has(.ag-charts-icon){padding:2px}.ag-charts-checkbox{--checkbox-transition-duration: .1s;appearance:none;background:var(--ag-charts-checkbox-background-color);border-radius:calc(var(--ag-charts-border-radius) * 9);cursor:pointer;height:18px;margin:0;transition-duration:var(--checkbox-transition-duration);transition-property:margin;width:29px}.ag-charts-checkbox:before{display:block;background:var(--ag-charts-input-background-color);border-radius:calc(var(--ag-charts-border-radius) * 7);content:" ";height:14px;margin:2px;transition-duration:var(--checkbox-transition-duration);transition-property:margin;transition-timing-function:var(--ag-charts-input-transition-easing);width:14px}.ag-charts-checkbox:checked{background:var(--ag-charts-checkbox-checked-background-color)}.ag-charts-checkbox:checked:before{margin-inline-start:13px}.ag-charts-select{background:var(--ag-charts-input-background-color);border-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-input-border-radius);border-style:solid;border-width:var(--ag-charts-input-border-width);padding:3px 2px 4px;font-size:inherit}.ag-charts-textarea{--textarea-line-height: 1.38;background:var(--ag-charts-input-background-color);border-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-input-border-radius);border-style:solid;border-width:var(--ag-charts-input-border-width);line-height:var(--textarea-line-height);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-large);padding:var(--input-padding-large) var(--input-padding)}.ag-charts-textarea::placeholder{color:var(--ag-charts-input-placeholder-text-color)}.ag-charts-proxy-container{pointer-events:none;position:absolute}.ag-charts-proxy-legend-toolbar{pointer-events:auto}.ag-charts-proxy-legend-toolbar>div[role=listitem]{pointer-events:none}.ag-charts-proxy-elem{-webkit-appearance:none;appearance:none;background:none;border:none;color:#0000;overflow:hidden;pointer-events:auto;position:absolute}.ag-charts-proxy-elem::-moz-range-thumb,.ag-charts-proxy-elem::-moz-range-track{opacity:0}.ag-charts-proxy-elem::-webkit-slider-runnable-track,.ag-charts-proxy-elem::-webkit-slider-thumb{opacity:0}.ag-charts-proxy-elem[data-focus-override=true],.ag-charts-proxy-elem:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-proxy-elem[data-focus-override=false]{outline:none;box-shadow:none}.ag-charts-proxy-elem svg{display:block}.ag-charts-proxy-scrollbar-slider:focus-visible{outline:none;box-shadow:none}.ag-charts-proxy-scrollbar-thumb-focus{border:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);box-sizing:border-box;opacity:0;pointer-events:none}.ag-charts-proxy-scrollbar-slider:focus-visible~.ag-charts-proxy-scrollbar-thumb-focus{opacity:1}.ag-charts-focus-indicator{position:absolute;display:block;pointer-events:none;user-select:none;-webkit-user-select:none;width:100%;height:100%}.ag-charts-focus-indicator>div{position:absolute;outline:solid 1px var(--ag-charts-chrome-background-color);box-shadow:var(--ag-charts-focus-shadow)}.ag-charts-focus-indicator>svg{width:100%;height:100%;fill:none;overflow:visible}.ag-charts-focus-svg-outer-path{stroke:var(--ag-charts-chrome-background-color);stroke-width:4px}.ag-charts-focus-svg-inner-path{stroke:var(--ag-charts-accent-color);stroke-width:2px}.ag-charts-overlay{color:#181d1f;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay{color:#fff}.ag-charts-overlay--loading{color:#8c8c8c}.ag-charts-overlay__loading-background{background:#fff;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-overlay__loading-background{background:#192232}.ag-charts-tooltip{--tooltip-arrow-size: 8px;--tooltip-row-spacing: 8px;--tooltip-column-spacing: 16px;position:fixed;inset:unset;margin:0;padding:0;overflow:visible;top:var(--top, 0px);left:var(--left, 0px);width:max-content;max-width:100%;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);color:var(--ag-charts-tooltip-text-color);background:var(--ag-charts-tooltip-background-color);border-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-tooltip-border-radius);border-style:solid;border-width:var(--ag-charts-tooltip-border-width);box-shadow:var(--ag-charts-popup-shadow)}.ag-charts-tooltip--compact .ag-charts-tooltip-content{--tooltip-row-spacing: 2px;--tooltip-column-spacing: 8px;padding:3px 6px}.ag-charts-tooltip--arrow-top:before,.ag-charts-tooltip--arrow-right:before,.ag-charts-tooltip--arrow-bottom:before,.ag-charts-tooltip--arrow-left:before{content:"";position:absolute;display:block;width:var(--tooltip-arrow-size);height:var(--tooltip-arrow-size);border:inherit;border-bottom-color:transparent;border-right-color:transparent;background:inherit;clip-path:polygon(0 0,100% 0,100% 1px,1px 100%,0 100%)}.ag-charts-tooltip--arrow-top:before{bottom:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * .5)) rotate(45deg)}.ag-charts-tooltip--arrow-bottom:before{top:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * -.5)) rotate(225deg)}.ag-charts-tooltip--arrow-left:before{right:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * .5)) rotate(315deg)}.ag-charts-tooltip--arrow-right:before{left:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * -.5)) rotate(135deg)}.ag-charts-tooltip--no-interaction{pointer-events:none;user-select:none;-webkit-user-select:none}.ag-charts-tooltip--wrap-always{overflow-wrap:break-word;word-break:break-word;hyphens:none}.ag-charts-tooltip--wrap-hyphenate{overflow-wrap:break-word;word-break:break-word;hyphens:auto}.ag-charts-tooltip--wrap-on-space{overflow-wrap:normal;word-break:normal}.ag-charts-tooltip--wrap-never{white-space:nowrap}.ag-charts-tooltip-heading,.ag-charts-tooltip-title,.ag-charts-tooltip-label,.ag-charts-tooltip-value{overflow:hidden;text-overflow:ellipsis}.ag-charts-tooltip-content{display:grid;grid:auto-flow minmax(1em,auto) / 1fr;padding:8px 12px;gap:var(--tooltip-row-spacing)}.ag-charts-tooltip-content:has(.ag-charts-tooltip-symbol){grid:auto-flow minmax(1em,auto) / auto 1fr}.ag-charts-tooltip-heading{grid-column:1 / -1}.ag-charts-tooltip-symbol{grid-column:1 / 2;place-self:center}.ag-charts-tooltip-symbol svg{display:block}.ag-charts-tooltip-title{grid-column:-2 / -1}.ag-charts-tooltip-row{grid-column:1 / -1;display:flex;gap:var(--tooltip-column-spacing);align-items:baseline;justify-content:space-between;overflow:hidden}.ag-charts-tooltip-row--inline{grid-column:-2 / -1}.ag-charts-tooltip-label{flex:1;min-width:0}.ag-charts-tooltip-value{min-width:0}.ag-charts-tooltip-footer{grid-column:1 / -1;color:var(--ag-charts-tooltip-subtle-text-color);text-align:center}.ag-charts-popover{position:absolute;border-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-border-radius);border-style:solid;border-width:var(--ag-charts-border-width);background:var(--ag-charts-panel-background-color);color:var(--ag-charts-chrome-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);box-shadow:var(--ag-charts-popup-shadow);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-menu{--item-padding: 6px 12px;--icon-color: var(--ag-charts-menu-text-color);display:grid;grid:auto-flow auto / 1fr;column-gap:12px;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-menu:has(.ag-charts-menu__icon,.ag-charts-menu__row--stroke-width-visible){grid:auto-flow auto / auto 1fr}.ag-charts-menu__row--stroke-width-visible:before{content:"";height:var(--strokeWidth);width:12px;background:var(--icon-color)}.ag-charts-menu__row--stroke-width-visible[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-menu__row{display:grid;grid-column:1 / -1;grid-template-columns:subgrid;align-items:center;padding:var(--item-padding)}.ag-charts-menu__row:not(.ag-charts-menu__row--active){cursor:pointer}.ag-charts-menu__row:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.ag-charts-menu__row:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.ag-charts-menu__row:focus{background:var(--ag-charts-focus-color)}.ag-charts-menu__row:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--ag-charts-layer-menu)}.ag-charts-menu__row--active{--icon-color: var(--ag-charts-accent-color);background:var(--ag-charts-focus-color);color:var(--ag-charts-accent-color)}.ag-charts-menu__row[aria-disabled=true]{background:var(--ag-charts-button-disabled-background-color);color:var(--ag-charts-button-disabled-text-color);cursor:default}.ag-charts-menu__label{grid-column:-1 / span 1;text-wrap:nowrap}.ag-charts-toolbar{--toolbar-size: 34px;--toolbar-border-radius: var(--ag-charts-border-radius);--toolbar-button-background-color: var(--ag-charts-chrome-background-color);--toolbar-button-border-color: var(--ag-charts-border-color);--toolbar-button-border-width: var(--ag-charts-button-border-width);--toolbar-button-gap: 0;--toolbar-button-padding: 6px;--toolbar-button-text-color: var(--ag-charts-button-text-color);--toolbar-button-background-color--active: var(--ag-charts-focus-color);--toolbar-button-border-color--active: var(--ag-charts-accent-color);--toolbar-button-text-color--active: var(--ag-charts-accent-color);--toolbar-button-background-color--disabled: var(--ag-charts-button-disabled-background-color);--toolbar-button-border-color--disabled: var(--toolbar-button-border-color);--toolbar-button-text-color--disabled: var(--ag-charts-button-disabled-text-color);--toolbar-button-background-color--hover: var(--ag-charts-focus-color);--toolbar-button-border-color--hover: var(--toolbar-button-border-color);--toolbar-button-text-color--hover: var(--toolbar-button-text-color);align-items:center;display:flex;flex-wrap:nowrap;gap:var(--toolbar-button-gap);position:absolute}.ag-charts-toolbar__button{align-items:center;background:var(--toolbar-button-background-color);border-color:var(--toolbar-button-border-color);border-style:solid;border-width:var(--toolbar-button-border-width);color:var(--toolbar-button-text-color);cursor:pointer;display:flex;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-medium);font-weight:var(--ag-charts-chrome-font-weight);justify-content:center;min-height:var(--toolbar-size);min-width:var(--toolbar-size);padding:var(--toolbar-button-padding);position:relative;transition:background-color .25s ease-in-out,border-color .25s ease-in-out,color .25s ease-in-out;white-space:nowrap}.ag-charts-toolbar__button:hover{background:var(--toolbar-button-background-color--hover);border-color:var(--toolbar-button-border-color--hover);color:var(--toolbar-button-text-color--hover);z-index:1}.ag-charts-toolbar__button:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-toolbar__button--active,.ag-charts-toolbar__button--active:hover{background:var(--toolbar-button-background-color--active);border-color:var(--toolbar-button-border-color--active);color:var(--toolbar-button-text-color--active);z-index:2}.ag-charts-toolbar__button[aria-disabled=true]{background:var(--toolbar-button-background-color--disabled);border-color:var(--toolbar-button-border-color--disabled);color:var(--toolbar-button-text-color--disabled);cursor:default}.ag-charts-toolbar--horizontal{flex-direction:row;.ag-charts-toolbar__button{border-inline-end-width:0}.ag-charts-toolbar__button--first{border-end-start-radius:var(--toolbar-border-radius);border-start-start-radius:var(--toolbar-border-radius);margin:0}.ag-charts-toolbar__button--last{border-end-end-radius:var(--toolbar-border-radius);border-start-end-radius:var(--toolbar-border-radius);border-inline-end-width:var(--toolbar-button-border-width);margin-inline-end:0}.ag-charts-toolbar__button:hover,.ag-charts-toolbar__button--active,.ag-charts-toolbar__button--active:hover{border-inline-end-width:var(--toolbar-button-border-width);margin-inline-end:calc(-1 * var(--toolbar-button-border-width));&.ag-charts-toolbar__button--last{margin-inline-end:0}}.ag-charts-toolbar__button:hover+.ag-charts-toolbar__button:not(.ag-charts-toolbar__button--active){border-inline-start-color:var(--toolbar-button-border-color--hover)}.ag-charts-toolbar__button--active+.ag-charts-toolbar__button{border-inline-start-color:var(--toolbar-button-border-color--active)}}.ag-charts-toolbar--vertical{flex-direction:column;.ag-charts-toolbar__button{margin:-1px 0 0;max-width:100%}.ag-charts-toolbar__button--first{border-start-start-radius:var(--ag-charts-border-radius);border-start-end-radius:var(--ag-charts-border-radius);margin:0}.ag-charts-toolbar__button--last{border-end-start-radius:var(--ag-charts-border-radius);border-end-end-radius:var(--ag-charts-border-radius)}}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{margin-inline-start:calc(var(--ag-charts-spacing) * 2)}.ag-charts-toolbar__label+.ag-charts-toolbar__icon{margin-inline-start:calc(var(--ag-charts-spacing) * 2)}.ag-charts-toolbar__icon,.ag-charts-toolbar__label{pointer-events:none}.ag-charts-floating-toolbar{border:none;display:flex;.ag-charts-toolbar{align-items:unset;position:unset}.ag-charts-toolbar__button:hover{border-inline-end-width:0;margin-inline-end:0;+.ag-charts-toolbar__button:not(.ag-charts-toolbar__button--active){border-inline-start-width:var(--toolbar-button-border-width);border-inline-start-color:var(--toolbar-button-border-color--hover)}&.ag-charts-toolbar__button--last{margin-inline-end:0}}.ag-charts-toolbar__button--active,.ag-charts-toolbar__button--active:hover{border-inline-end-width:0;margin-inline-end:0;+.ag-charts-toolbar__button:not(.ag-charts-toolbar__button--active){border-inline-start-width:var(--toolbar-button-border-width);border-inline-start-color:var(--toolbar-button-border-color--active)}&.ag-charts-toolbar__button--last{margin-inline-end:0}}}.ag-charts-floating-toolbar__drag-handle{align-items:center;background:var(--ag-charts-chrome-background-color);border-color:var(--ag-charts-border-color);border-style:solid;border-width:var(--ag-charts-border-width);border-end-start-radius:var(--ag-charts-border-radius);border-start-start-radius:var(--ag-charts-border-radius);border-inline-end-width:0;cursor:grab;display:flex;justify-content:center;min-width:24px;padding-inline-start:0;padding-inline-end:0}.ag-charts-floating-toolbar__drag-handle--dragging{cursor:grabbing} `;import{CleanupRegistry as ON}from"ag-charts-core";var uu=class{constructor(){this.cleanup=new ON,this.destroyed=!1}destroy(){this.cleanup.flush(),this.destroyed=!0}};import{CleanupRegistry as EN,attachListener as RN,isHTMLElement as PN,setAttribute as _y}from"ag-charts-core";var _N=class Od{constructor(e,i,s){this.element=e,this.topTabGuard=i,this.bottomTabGuard=s,this.cleanup=new EN,this.guardTabIndex=0,this.hasFocus=!1,this.initTabGuard(this.topTabGuard,!1),this.initTabGuard(this.bottomTabGuard,!0),this.element.addEventListener("focus",()=>this.onFocus(),{capture:!0}),this.element.addEventListener("blur",n=>this.onBlur(n),{capture:!0})}set tabIndex(e){this.guardTabIndex=e,this.guardTabIndex===0?this.setGuardIndices(void 0):this.hasFocus||this.setGuardIndices(this.guardTabIndex)}destroy(){this.cleanup.flush()}initTabGuard(e,i){this.cleanup.register(RN(e,"focus",()=>this.onTab(e,i)))}setGuardIndices(e){const i=e;_y(this.topTabGuard,"tabindex",i),_y(this.bottomTabGuard,"tabindex",i)}onFocus(){this.hasFocus=!0,this.guardTabIndex!==0&&this.setGuardIndices(0)}onBlur({relatedTarget:e}){const{topTabGuard:i,bottomTabGuard:s}=this;this.hasFocus=!1,this.guardTabIndex!==0&&e!==i&&e!==s&&this.setGuardIndices(this.guardTabIndex)}onTab(e,i){if(this.guardTabIndex!==0){let s;e.tabIndex===0?(s=this.findExitTarget(!i),this.setGuardIndices(this.guardTabIndex)):s=this.findEnterTarget(i),s?.focus()}}static queryFocusable(e,i){const s=e.ownerDocument.defaultView;return Array.from(e.querySelectorAll(i)).filter(n=>{if(PN(n)){const a=s.getComputedStyle(n);return a.display!=="none"&&a.visibility!=="none"}return!1})}findEnterTarget(e){const i=Od.queryFocusable(this.element,'[tabindex="0"]'),s=e?i.length-1:0;return i[s]}findExitTarget(e){const i=Od.queryFocusable(this.element.ownerDocument.body,"[tabindex]").filter(a=>a.tabIndex>0).sort((a,r)=>a.tabIndex-r.tabIndex),{before:s,after:n}=Od.findBeforeAndAfter(i,this.guardTabIndex);return e?s:n}static findBeforeAndAfter(e,i){let s=0,n=e.length-1,a,r;for(;s<=n;){const o=Math.floor((s+n)/2),l=e[o].tabIndex;if(l===i){a=e[o-1]||void 0,r=e[o+1]||void 0;break}else l{i.matches||(this.devicePixelRatio=this.agDocument.devicePixelRatio,this.unregisterDevicePixelRatioListener(),this.registerDevicePixelRatioListener(),this.callback(this.pixelRatio))},this.devicePixelRatio=t.devicePixelRatio}get pixelRatio(){return this.devicePixelRatio}observe(){this.registerDevicePixelRatioListener()}disconnect(){this.unregisterDevicePixelRatioListener()}unregisterDevicePixelRatioListener(){this.devicePixelRatioMediaQuery?.removeEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=void 0}registerDevicePixelRatioListener(){const t=this.agDocument.matchMedia(`(resolution: ${this.pixelRatio}dppx)`);t?.addEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=t}},VN=class{constructor(t){this.elements=new Map,this.documentReady=!1,this.queuedObserveRequests=[],this.onLoad=()=>{this.documentReady=!0;for(const[i,s,n]of this.queuedObserveRequests)this.observe(i,s,n);this.queuedObserveRequests=[],this.observeWindow()},this.resizeObserver=t.createResizeObserver(i=>{for(const{target:s,contentRect:{width:n,height:a}}of i){const r=this.elements.get(s);this.checkSize(r,s,n,a)}});let e;this.pixelRatioObserver=new FN(t,()=>{clearTimeout(e),e=setTimeout(()=>this.checkPixelRatio(),0)}),this.documentReady=t.isReady(),this.documentReady?this.observeWindow():this.removeLoadListener=t.attachListener("load",this.onLoad)}destroy(){this.removeLoadListener?.(),this.removeLoadListener=void 0,this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.pixelRatioObserver?.disconnect(),this.pixelRatioObserver=void 0}observeWindow(){this.pixelRatioObserver?.observe()}checkPixelRatio(){const t=this.pixelRatioObserver?.pixelRatio??1;for(const[e,i]of this.elements)if(i.size!=null&&i.size.pixelRatio!==t){const{width:s,height:n}=i.size;i.size={width:s,height:n,pixelRatio:t},i.cb(i.size,e)}}checkSize(t,e,i,s){if(t&&(i!==t.size?.width||s!==t.size?.height)){const n=this.pixelRatioObserver?.pixelRatio??1;t.size={width:i,height:s,pixelRatio:n},t.cb(t.size,e)}}observe(t,e,i){if(!this.documentReady){this.queuedObserveRequests.push([t,e,i]);return}this.elements.has(t)?this.removeFromQueue(t):this.resizeObserver?.observe(t);const s={cb:e};if(this.elements.set(t,s),!i?.skipInitialRead){const n=t.ownerDocument.defaultView?.getComputedStyle(t),a=t.clientWidth-(Number.parseFloat(n?.paddingLeft??"0")+Number.parseFloat(n?.paddingRight??"0")),r=t.clientHeight-(Number.parseFloat(n?.paddingTop??"0")+Number.parseFloat(n?.paddingBottom??"0"));(a>0||r>0)&&this.checkSize(s,t,a,r)}}unobserve(t){this.resizeObserver?.unobserve(t),this.elements.delete(t),this.removeFromQueue(t),this.elements.size||this.destroy()}removeFromQueue(t){this.queuedObserveRequests=this.queuedObserveRequests.filter(([e])=>e!==t)}},pc=class extends Map{constructor(t,e){super(),this.defaultValue=t,this.defaultState=e}set(t,e){return this.delete(t),e!==void 0&&super.set(t,e),delete this.cachedState,delete this.cachedValue,this}delete(t){return delete this.cachedState,delete this.cachedValue,super.delete(t)}stateId(){return this.cachedState??(this.cachedState=Array.from(this.keys()).pop()??this.defaultState),this.cachedState}stateValue(){return this.cachedValue??(this.cachedValue=Array.from(this.values()).pop()??this.defaultValue),this.cachedValue}},BN=["translate"],gc=class{constructor(t,e){this.element=t,this.cache={},this.pendingWrites=new Map,this.deferredMode=e?.deferredMode,this.sizeMonitor=e?.sizeMonitor,this.skipInitialRead=e?.skipInitialRead??!1}get isConnected(){return this.element.isConnected}scheduleFlush(){this.deferredMode?this.deferredMode.scheduleFlush():this.flush()}contains(t){return this.element.contains(t)}addEventListener(t,e,i){this.element.addEventListener(t,e,i)}removeEventListener(t,e,i){this.element.removeEventListener(t,e,i)}get innerHTML(){return this.pendingWrites?this.cache.innerHTML??"":this.element.innerHTML}changed(t,e){return this.cache[t]===e?!1:(this.cache[t]=e,!0)}invalidate(t){delete this.cache[t]}setProperty(t,e){const i=`p:${t}`;if(this.changed(i,e)){if(BN.includes(t)){this.element.style.setProperty(t,e);return}this.pendingWrites.set(i,()=>{this.element.style.setProperty(t,e)}),this.scheduleFlush()}}toggleClass(t,e){const i=`c:${t}`;this.changed(i,e)&&(this.pendingWrites.set(i,()=>{this.element.classList.toggle(t,e)}),this.scheduleFlush())}setAttr(t,e){const i=`a:${t}`;this.changed(i,e)&&(this.pendingWrites.set(i,()=>{e==null?this.element.removeAttribute(t):this.element.setAttribute(t,e)}),this.scheduleFlush())}setData(t,e){const i=`d:${t}`;this.changed(i,e)&&(this.pendingWrites.set(i,()=>{this.element.dataset[t]=e}),this.scheduleFlush())}getData(t){const e=`d:${t}`;return this.pendingWrites?this.cache[e]:this.element.dataset[t]}setInnerHTML(t){return this.changed("innerHTML",t)?(this.pendingWrites.set("innerHTML",()=>{this.element.innerHTML=t}),this.scheduleFlush(),this.invalidate("contentStyles"),!0):!1}setContentStyles(t){if(this.changed("contentStyles",JSON.stringify(t))){const e=()=>{const i=this.element.firstElementChild??this.element;Object.assign(i.style,t)};this.pendingWrites.set("contentStyles",e),this.scheduleFlush()}}flush(){if(this.pendingWrites){for(const t of this.pendingWrites.values())t();this.pendingWrites.clear()}}flushKey(t){const e=this.pendingWrites.get(t);e&&(e(),this.pendingWrites.delete(t))}togglePopover(t){t?this.changed("popover",!0)&&(this.pendingWrites.set("popover",()=>{this.element.togglePopover(!0)}),this.scheduleFlush()):(this.pendingWrites.delete("popover"),this.changed("popover",!1)&&this.element.togglePopover(!1))}appendChild(t){this.element.appendChild(t)}set innerText(t){this.element.innerText=t,this.invalidate("innerHTML")}addResizeListener(t){const{sizeMonitor:e,element:i,skipInitialRead:s}=this;if(e==null)throw new Error("AG Charts - addResizeListener requires a SizeMonitor");return e.observe(i,n=>t(n),{skipInitialRead:s}),()=>e.unobserve(i)}reset(){this.cache={}}},zN='',GN=["styles","canvas","canvas-background","canvas-center","canvas-container","canvas-overlay","canvas-proxy","series-area","tooltip-container"],UN=new Set(["styles","canvas-container","canvas","tooltip-container"]),Fy={safeHorizontal:"ag-charts-wrapper--safe-horizontal",safeVertical:"ag-charts-wrapper--safe-vertical"},HN=new Map([["styles",{childElementType:"style"}],["canvas",{childElementType:"canvas"}],["canvas-proxy",{childElementType:"div"}],["canvas-overlay",{childElementType:"div"}],["canvas-center",{childElementType:"div"}],["series-area",{childElementType:"div"}],["tooltip-container",{childElementType:"div"}]]);function jN(t,e,i){const s=t.createIntersectionObserver(n=>{for(const a of n)a.target===e&&i(a.intersectionRatio)},{root:e});return s?.observe(e),s}var Vy={x:0,y:0,width:0,height:0,top:0,bottom:0,left:0,right:0,toJSON(){return Vy}};function By(t,e){const i=qn("div");return i.className="ag-charts-tab-guard",t.insertAdjacentElement(e,i),i}var fc=class Ya extends uu{constructor(e,i,s,n,a,r,o="normal"){super(),this.eventsHub=e,this.chart=i,this.agDocument=s,this.styleContainer=a,this.skipCss=r,this.mode=o,this.anchorName=`--${MN(this)}`,this.styles=new Map,this.pendingContainer=void 0,this.container=void 0,this.documentRoot=void 0,this.initiallyConnected=void 0,this.containerSize=void 0,this.cursorState=new pc("default"),this._lastCursor=void 0,this._lastCenterSize=void 0,this.deferredProxies=new Map,this.deferredMode={scheduleFlush:this.scheduleFlush.bind(this)},this.minWidth=0,this.minHeight=0,this._isRtl=!1,this._deferring=!1,this.sizeMonitor=new VN(s),this.element=this.initDOM(),this.elementProxy=new gc(this.element,{deferredMode:this.deferredMode}),this.rootElements=this.initRootElements(),this.rootElements.canvas.element.style.setProperty("anchor-name",this.anchorName),this.sizeMonitor.observe(this.rootElements.canvas.element,()=>this.invalidateRectCaches(),{skipInitialRead:this.mode==="minimal"});let l=!1;if(this.observer=jN(s,this.element,c=>{c===0&&!l&&this.eventsHub.emit("dom:hidden",null),l=c===0}),this.setSizeOptions(),this.updateContainerSize(),this.addStyles("ag-charts-community",wN),this.setContainer(n),this.cleanup.register(kN(this.element)),this.setupGlobalListeners(),this.mode==="normal"){const c=this.rootElements["canvas-center"].element;if(c==null)throw new Error("Error initializing tab guards");const h=By(c,"beforebegin"),d=By(c,"afterend");this.tabGuards=new _N(c,h,d)}}initDOM(){if(this.mode==="normal"){const s=qn("div");return s.innerHTML=zN,s.firstChild}const e=qn("div");e.role="presentation",e.dataset.agCharts="",e.classList.add("ag-charts-wrapper");const i=qn("div");return e.appendChild(i),i.role="presentation",i.classList.add("ag-charts-series-area"),e}initRootElements(){const{mode:e,element:i}=this,s={};for(const n of GN){const a=`ag-charts-${n}`;let r;if(e==="normal"?r=i.classList.contains(a)?i:i.getElementsByClassName(a)[0]:UN.has(n)?r=i:r=i.getElementsByClassName(a)[0]??qn("div"),r==null)throw new Error(`AG Charts - unable to find DOM element ${a}`);s[n]={element:r,children:new Map,listeners:[]}}return s}destroy(){super.destroy(),this.observer?.unobserve(this.element),this.sizeMonitor.unobserve(this.rootElements.canvas.element),this.container&&this.sizeMonitor.unobserve(this.container),this.pendingContainer=void 0;for(const e of Object.values(this.rootElements)){for(const i of e.children.values())i.remove();e.element.remove()}this.element.remove()}scheduleFlush(){this._deferring||this._pendingFlush==null&&(this._pendingFlush=setTimeout(()=>{this._pendingFlush=void 0,!this._deferring&&this.flushDeferredProxies()}))}flushDeferredProxies(){this._pendingFlush!=null&&(clearTimeout(this._pendingFlush),this._pendingFlush=void 0),this.elementProxy.flush();for(const e of this.deferredProxies.values())e.flush();this.updateStylesLocation(),this.mode!=="minimal"&&(this.pendingContainer==null||this.pendingContainer===this.container||(Ya.batchedUpdateContainer.length===0&&setTimeout(this.applyBatchedUpdateContainer.bind(this),0),Ya.batchedUpdateContainer.push(this)))}applyBatchedUpdateContainer(){for(const e of Ya.batchedUpdateContainer)e.destroyed||e.updateContainer();Ya.batchedUpdateContainer.splice(0)}updateStylesLocation(){if(!(this.initiallyConnected===!0||this.container?.isConnected===!1)){this.documentRoot=this.getShadowDocumentRoot(this.container),this.initiallyConnected=!0;for(const e of this.rootElements.styles.children.keys())this.removeChild("styles",e);for(const[e,i]of this.styles)this.addStyles(e,i)}}setSizeOptions(e=300,i=300,s,n){const{style:a}=this.element;this.minWidth=s??e,this.minHeight=n??i,a.minWidth=`${this.minWidth}px`,a.minHeight=`${this.minHeight}px`,this.updateContainerClassName()}updateContainerSize(){const e=this.containerSize==null?"hidden":"",i=this.containerSize?`${this.containerSize.width??0}px`:"",s=this.containerSize?`${this.containerSize.height??0}px`:"",n=this._lastCenterSize;if(n==null||n.visibility!==e||n.width!==i||n.height!==s){this._lastCenterSize={visibility:e,width:i,height:s};const{style:a}=this.rootElements["canvas-center"].element;a.visibility=e,a.width=i,a.height=s}this.updateContainerClassName()}setTabGuardIndex(e){this.tabGuards&&(this.tabGuards.tabIndex=e)}setContainer(e){e!==this.container&&(this.pendingContainer=e,(this.mode==="minimal"||this.container==null)&&this.updateContainer())}updateContainer(){const{pendingContainer:e}=this;if(!(e==null||e===this.container)){if(this.container&&(this.element.remove(),this.sizeMonitor.unobserve(this.container)),this.documentRoot!=null)for(const i of this.rootElements.styles.children.keys())this.removeChild("styles",i);this.container=e,this.pendingContainer=void 0,this.agDocument.setContainer(e),this.documentRoot=this.getShadowDocumentRoot(e),this.initiallyConnected=e.isConnected;for(const[i,s]of this.styles)this.addStyles(i,s);e.appendChild(this.element),this.sizeMonitor.observe(e,i=>{this.containerSize=i,this.updateContainerSize(),this.invalidateRectCaches(),this.eventsHub.emit("dom:resize",null)},{skipInitialRead:this.mode==="minimal"}),this.invalidateAllCaches(),this.updateRtl(),this.eventsHub.emit("dom:container-change",null)}}setThemeClass(e){const i="ag-charts-theme-";for(const s of Array.from(this.element.classList))s.startsWith(i)&&s!==e&&this.element.classList.remove(s);this.element.classList.add(e)}setThemeParameters(e){this.setCSSVariables("--ag-charts",void 0,void 0,e)}setModuleCSSVariables(e,i,s,n,a){this.setCSSVariables(`--ag-charts-${e}`,i,s,n,a)}setCSSVariables(e,i,s,n,a){for(const[r,o]of AN(n)){let l=r,c=`${o}`;r.endsWith("Size")||r.endsWith("Radius")||a?.includes(r)?c=`${o}px`:r.endsWith("Border")&&typeof o=="boolean"&&(l=`${r}Width`,c=o?"var(--ag-charts-border-width)":"0"),l=`${e}${i?"__":""}${i??""}-${LN(l)}${s?"--":""}${s??""}`,this.element.style.setProperty(l,c)}}updateCanvasLabel(e){NN(this.rootElements["canvas-proxy"].element,"aria-label",e)}getEventElement(e,i){return["focus","blur","keydown","keyup"].includes(i)?this.rootElements["series-area"].element:e}addEventListener(e,i,s){const n=this.getEventElement(this.element,e);return DN(n,e,i,s)}removeEventListener(e,i,s){this.getEventElement(this.element,e).removeEventListener(e,i,s)}getBoundingClientRect(){return this._cachedCanvasRect??(this._cachedCanvasRect=this.rootElements.canvas.element.getBoundingClientRect()),this._cachedCanvasRect}getOverlayClientRect(){const{innerWidth:e,innerHeight:i}=this.agDocument,s=new P(0,0,e,i),n=this.getRawOverlayClientRect();return s.intersection(n)?.toDOMRect()??Vy}findScrollableContainer(){if(this._cachedScrollableContainer!==void 0)return this._cachedScrollableContainer;let e=this.element;const i=this.element.getRootNode()?.fullscreenElement;for(;e!=null;){let s;if(i!=null&&e===i)s=!0;else{const a=e.computedStyleMap?.()?.get("overflow-y")?.toString();s=a==="auto"||a==="scroll"}if(s)return this._cachedScrollableContainer=e,e;e=e.parentElement}return this._cachedScrollableContainer=null,null}getRawOverlayClientRect(){if(this._cachedRawOverlayRect!=null)return this._cachedRawOverlayRect;const e=this.findScrollableContainer();if(e!=null)return this._cachedRawOverlayRect=P.fromObject(e.getBoundingClientRect()),this._cachedRawOverlayRect;if(this.documentRoot!=null)return this._cachedRawOverlayRect=P.fromObject(this.documentRoot.getBoundingClientRect()),this._cachedRawOverlayRect;const{innerWidth:i,innerHeight:s}=this.agDocument;return this._cachedRawOverlayRect=new P(0,0,i,s),this._cachedRawOverlayRect}getShadowDocumentRoot(e=this.container){const i=e?.ownerDocument?.body??this.agDocument.body;for(;e!=null;){if(e===i)return;if(TN(e.parentNode))return e;e=e.parentNode}}getParent(e){return this.rootElements[e].element}getChildBoundingClientRect(e){const{children:i}=this.rootElements[e],s=[];for(const n of i.values())s.push(P.fromObject(n.getBoundingClientRect()));return P.merge(s)}isManagedChildDOMElement(e,i,s){const{children:n}=this.rootElements[i],a=n?.get(s);return a!=null&&e.contains(a)}contains(e,i){return i==null?this.element.contains(e):this.rootElements[i].element.contains(e)}addStyles(e,i){const s="data-ag-charts";if(this.styles.set(e,i),this.container==null||this.skipCss)return;const n=o=>o.getAttribute(s)===e,a=o=>{const l=new Set(["TITLE","META"]);let c=!0,h;for(const u of o.children){if(c&&l.has(u.tagName)){h=u;continue}if(c=!1,n(u))return;u.hasAttribute(s)&&(h=u)}const d=qn("style");return this.chart.styleNonce!=null&&(d.nonce=this.chart.styleNonce),h==null?o.prepend(d):o.insertBefore(d,h.nextSibling),d};let r;this.styleContainer?r=a(this.styleContainer):this.initiallyConnected===!1?r=this.addChild("styles",e):this.documentRoot==null&&!Ya.headStyles.has(e)?(r=a(this.agDocument.head),Ya.headStyles.add(e)):this.documentRoot!=null&&(r=this.addChild("styles",e)),!(r==null||n(r))&&(r.setAttribute(s,e),r.innerHTML=i)}removeStyles(e){this.removeChild("styles",e)}updateCursor(e,i){this.cursorState.set(e,i);const s=this.cursorState.stateValue();s!==this._lastCursor&&(this._lastCursor=s,this.element.style.cursor=s)}getCursor(){return this.element.style.cursor}get isRtl(){return this._isRtl}setEnableRtl(e){this.enableRtl=e,this.updateRtl()}updateRtl(){const e=this.enableRtl??(this.mode==="minimal"?!1:CN(this.container??this.pendingContainer));e!==this._isRtl&&(this._isRtl=e,this.element.dir=e?"rtl":"ltr",this.eventsHub.emit("rtl:change",null))}addChild(e,i,s,n){const{element:a,children:r,listeners:o}=this.rootElements[e];if(!r)throw new Error("AG Charts - unable to create DOM elements after destroy()");if(r.has(i))return r.get(i);const{childElementType:l="div"}=HN.get(e)??{};if(s&&s.tagName.toLowerCase()!==l.toLowerCase())throw new Error("AG Charts - mismatching DOM element type");const c=s??qn(l);for(const[h,d,u]of o)c.addEventListener(h,d,u);if(r.set(i,c),l==="style"&&this.chart.styleNonce!=null&&(c.nonce=this.chart.styleNonce),n){const h=a.querySelector(n.query);if(h==null)throw new Error(`AG Charts - addChild query failed ${n.query}`);h.insertAdjacentElement(n.where,c)}else a?.appendChild(c);return c}addProxyChild(e,i){const s=this.addChild(e,i),n=this.mode==="minimal";return new gc(s,{sizeMonitor:this.sizeMonitor,skipInitialRead:n})}addDeferredProxyChild(e,i){const s=this.addChild(e,i),n=this.mode==="minimal",a=new gc(s,{deferredMode:this.deferredMode,sizeMonitor:this.sizeMonitor,skipInitialRead:n});return this.deferredProxies.set(`${e}:${i}`,a),a}setDeferring(e){this.mode!=="minimal"&&(this._deferring=e,e||this.flushDeferredProxies())}removeChild(e,i){const{children:s}=this.rootElements[e];s&&(s.get(i)?.remove(),s.delete(i),this.deferredProxies.delete(`${e}:${i}`))}incrementDataCounter(e){const i=this.elementProxy.getData(e)??"0";this.elementProxy.setData(e,String(Number(i)+1))}setDataBoolean(e,i){this.elementProxy.setData(e,String(i))}setDataNumber(e,i){this.elementProxy.setData(e,String(i))}getDocument(){return this.agDocument}invalidateRectCaches(){this._cachedCanvasRect=void 0,this._cachedRawOverlayRect=void 0}invalidateAllCaches(){this.invalidateRectCaches(),this._cachedScrollableContainer=void 0}setupGlobalListeners(){const e=this.element.ownerDocument.defaultView;if(e==null)return;const i=()=>this.invalidateRectCaches(),s=()=>this.invalidateAllCaches();e.addEventListener("scroll",i,{capture:!0,passive:!0}),e.addEventListener("resize",i,{capture:!0,passive:!0}),this.element.ownerDocument.addEventListener("fullscreenchange",s),this.cleanup.register(()=>{e.removeEventListener("scroll",i,{capture:!0}),e.removeEventListener("resize",i,{capture:!0}),this.element.ownerDocument.removeEventListener("fullscreenchange",s)})}updateContainerClassName(){const{element:e,containerSize:i,minWidth:s,minHeight:n}=this;e.classList.toggle(Fy.safeHorizontal,s>=(i?.width??1/0)),e.classList.toggle(Fy.safeVertical,n>=(i?.height??1/0))}};fc.className="DOMManager",fc.batchedUpdateContainer=[],fc.headStyles=new Set;var zy=fc;import{CleanupRegistry as WN,createElement as YN,setElementStyle as $N}from"ag-charts-core";import{createElement as KN,createSvgElement as Gy}from"ag-charts-core";import{getAttribute as pu,getElementBBox as ZN,setAttribute as is,setElementBBox as Uy,setElementStyle as gu,setElementStyles as XN}from"ag-charts-core";function ar(t,e,i){const{offsetX:s,offsetY:n,clientX:a,clientY:r}=e,{currentX:o,currentY:l}=en.calcCurrentXY(i,e);return{type:t,device:"mouse",offsetX:s,offsetY:n,clientX:a,clientY:r,currentX:o,currentY:l,sourceEvent:e}}function mc(t,e,i){return{type:t,sourceEvent:e}}function gZ(){}var Hy={change:{isNative:!0,allocator(t,e){return{type:"change",sourceEvent:t}}},blur:{isNative:!0,allocator(t,e){return{type:"blur",sourceEvent:t}}},focus:{isNative:!0,allocator(t,e){return{type:"focus",sourceEvent:t}}},keydown:{isNative:!0,allocator(t){return{type:"keydown",sourceEvent:t}}},keyup:{isNative:!0,allocator(t){return{type:"keyup",sourceEvent:t}}},contextmenu:{isNative:!0,allocator(t,e){return ar("contextmenu",t,e)}},click:{isNative:!0,allocator(t,e){return ar("click",t,e)}},dblclick:{isNative:!0,allocator(t,e){return ar("dblclick",t,e)}},mouseenter:{isNative:!0,allocator(t,e){return ar("mouseenter",t,e)}},mousemove:{isNative:!0,allocator(t,e){return ar("mousemove",t,e)}},mouseleave:{isNative:!0,allocator(t,e){return ar("mouseleave",t,e)}},wheel:{isNative:!0,allocator(t,e){const{offsetX:i,offsetY:s,clientX:n,clientY:a}=t,r=t.deltaMode===0?.01:1;let o=t.deltaX*r,l=t.deltaY*r;return Math.abs(t.deltaX)===0&&t.shiftKey&&([o,l]=[l,o]),{type:"wheel",offsetX:i,offsetY:s,clientX:n,clientY:a,deltaX:o,deltaY:l,sourceEvent:t}}},touchstart:{isNative:!0,allocator(t,e){return mc("touchstart",t,e)}},touchmove:{isNative:!0,allocator(t,e){return mc("touchmove",t,e)}},touchend:{isNative:!0,allocator(t,e){return mc("touchend",t,e)}},touchcancel:{isNative:!0,allocator(t,e){return mc("touchcancel",t,e)}},"drag-start":void 0,"drag-move":void 0,"drag-end":void 0,"collapse-widget":void 0,"expand-widget":void 0,"expand-controlled-widget":void 0},en=class{static alloc(t,e,i){const s=Hy[t].allocator;return s(e,i)}static isHTMLEvent(t){return Hy[t]?.isNative===!0}static calcCurrentXY(t,e){const i=t.getBoundingClientRect();return{currentX:e.clientX-i.x,currentY:e.clientY-i.y}}};import{entries as qN}from"ag-charts-core";var JN=class{constructor(){this.widgetListeners={},this.sourceListeners={}}initSourceHandler(t,e){this.sourceListeners??(this.sourceListeners={}),this.sourceListeners[t]=e}lazyGetWidgetListeners(t,e){var i;if(!(t in(this.sourceListeners??{}))){const s=a=>{const r=en.alloc(t,a,e.getElement());this.dispatch(t,e,r)},n={};(t.startsWith("touch")||t==="wheel")&&(n.passive=!1),this.initSourceHandler(t,s),e.getElement().addEventListener(t,s,n)}return this.widgetListeners??(this.widgetListeners={}),(i=this.widgetListeners)[t]??(i[t]=[]),this.widgetListeners[t]}add(t,e,i){this.lazyGetWidgetListeners(t,e).push(i)}remove(t,e,i){const s=this.lazyGetWidgetListeners(t,e),n=s.indexOf(i);n>-1&&s.splice(n,1)}destroy(t){if(this.widgetListeners=void 0,this.sourceListeners){for(const[e,i]of qN(this.sourceListeners))t.getElement().removeEventListener(e,i);this.sourceListeners=void 0}}dispatch(t,e,i){for(const s of this.widgetListeners?.[t]??[])s(i,e)}};import{CleanupRegistry as QN,attachListener as jy,boxContains as ek,partialAssign as Wy}from"ag-charts-core";import{CleanupRegistry as tk,attachListener as Jn}from"ag-charts-core";var ik=class{constructor(t,e,i,s){this.glob=t,this.self=e,this.cleanup=new tk,this.mousegeneral=l=>{l.stopPropagation(),l.stopImmediatePropagation()},this.mousemove=l=>{l.stopPropagation(),l.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mousemove(l)},this.mouseup=l=>{l.button===0&&(l.stopPropagation(),l.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mouseup(l),this.destroy())};const{mousegeneral:n,mousemove:a,mouseup:r}=this,o=s.view;this.cleanup.register(Jn(o,"mousedown",n,{capture:!0}),Jn(o,"mouseenter",n,{capture:!0}),Jn(o,"mouseleave",n,{capture:!0}),Jn(o,"mouseout",n,{capture:!0}),Jn(o,"mouseover",n,{capture:!0}),Jn(o,"mousemove",a,{capture:!0}),Jn(o,"mouseup",r,{capture:!0})),e.mouseDragger=this,t.globalMouseDragCallbacks=i,t.globalMouseDragCallbacks.mousedown(s),s.stopPropagation(),s.stopImmediatePropagation()}destroy(){this.cleanup.flush(),this.glob.globalMouseDragCallbacks=void 0,this.self.mouseDragger=void 0}};function sk(t,e,i,s){if(t.globalMouseDragCallbacks==null)return new ik(t,e,i,s)}import{CleanupRegistry as Yy,attachListener as Qn}from"ag-charts-core";var nk=500,ak=100;function rk(t,e){const i=t.clientX-e.clientX,s=t.clientY-e.clientY;return i*i+s*s}var fu=!1,ok=class{constructor(t,e,i,s,n){this.glob=t,this.self=e,this.initialTouch=s,this.target=n,this.cleanup=new Yy,this.longTapInterrupted=!1,this.longtap=()=>{const{target:o,initialTouch:l}=this;if(!this.longTapInterrupted){const c=new Yy;o.dispatchEvent(new TouchEvent("touchcancel",{touches:[l],bubbles:!0})),fu=!0;const h=f=>f.preventDefault(),d=f=>{fu=!1,f.preventDefault(),c.flush()};c.register(Qn(o,"touchmove",h,{passive:!1}),Qn(o,"touchend",d,{passive:!1}),Qn(o,"touchcancel",d,{passive:!1}));const{clientX:u,clientY:p}=l,g=new PointerEvent("contextmenu",{bubbles:!0,cancelable:!0,view:o.ownerDocument.defaultView,clientX:u,clientY:p,pointerType:"touch"});o.dispatchEvent(g)}},this.touchmove=o=>{const{glob:l,self:c,initialTouch:h}=this,d=this.findInitialFinger(o.targetTouches);d!=null&&(this.longTapInterrupted=this.longTapInterrupted||rk(h,d)>ak,c.dragTouchEnabled&&l.globalTouchDragCallbacks?.touchmove(o,d))},this.touchend=o=>{this.longTapInterrupted=!0;const l=this.findInitialFinger(o.changedTouches,o.touches);l!=null&&this.glob.globalTouchDragCallbacks?.touchend(o,l),this.destroy()},this.longtapTimer=setTimeout(this.longtap,nk);const{touchmove:a,touchend:r}=this;this.cleanup.register(Qn(n,"touchmove",a,{passive:!1}),Qn(n,"touchstart",r,{passive:!1}),Qn(n,"touchend",r,{passive:!1}),Qn(n,"touchcancel",r,{passive:!1})),e.touchDragger=this,t.globalTouchDragCallbacks=i}destroy(){clearTimeout(this.longtapTimer),this.cleanup.flush(),this.glob.globalTouchDragCallbacks=void 0,this.self.touchDragger=void 0}findInitialFinger(...t){const e=t.flatMap(i=>Array.from(i));return Array.from(e).find(i=>i.identifier===this.initialTouch.identifier)}};function lk(t,e,i,s,n){if(!(t.globalTouchDragCallbacks!=null||fu))return new ok(t,e,i,s,n)}function mu(t,e,i,s){const{currentX:n,currentY:a}=en.calcCurrentXY(t.getElement(),s),r=s.pageX-i.pageX,o=s.pageY-i.pageY;return{type:e,device:"mouse",offsetX:i.offsetX+r,offsetY:i.offsetY+o,clientX:s.clientX,clientY:s.clientY,currentX:n,currentY:a,originDeltaX:r,originDeltaY:o,sourceEvent:s}}function ck(t,{pageX:e,pageY:i}){const{x:s,y:n}=t.getElement().getBoundingClientRect();return{offsetX:e-s,offsetY:i-n}}function yu(t,e,i,s,n){const{currentX:a,currentY:r}=en.calcCurrentXY(t.getElement(),n),o=n.pageX-i.pageX,l=n.pageY-i.pageY;return{type:e,device:"touch",offsetX:i.offsetX+o,offsetY:i.offsetY+l,clientX:n.clientX,clientY:n.clientY,currentX:a,currentY:r,originDeltaX:o,originDeltaY:l,sourceEvent:s}}var $y={},Ky=class{constructor(t){this.dispatchCallback=t,this.dragTouchEnabled=!0}destroy(){this.dragTriggerRemover?.(),this.dragTriggerRemover=void 0,this.listeners?.clear(),this.mouseDragger?.destroy(),this.touchDragger?.destroy()}getListenerSet(t){this.listeners??(this.listeners=new Map);let e=this.listeners.get(t);return e===void 0&&(e=new Set,this.listeners.set(t,e)),e}add(t,e,i){switch(this.getListenerSet(t).add(i),t){case"drag-start":case"drag-move":case"drag-end":{this.registerDragTrigger(e);break}}}remove(t,e,i){this.getListenerSet(t).delete(i)}registerDragTrigger(t){if(this.dragTriggerRemover==null){const e=t.getElement(),i=new QN;i.register(jy(e,"mousedown",s=>this.triggerMouseDrag(t,s)),jy(e,"touchstart",s=>this.triggerTouchDrag(t,s),{passive:!1})),this.dragTriggerRemover=()=>i.flush()}}triggerMouseDrag(t,e){if(e.button===0){if(e.view==null){const i=t.getElement().ownerDocument.defaultView;e=new i.MouseEvent(e.type,{...e,view:i})}this.startMouseDrag(t,e)}}startMouseDrag(t,e){const i={pageX:Number.NaN,pageY:Number.NaN,offsetX:Number.NaN,offsetY:Number.NaN};Wy(["pageX","pageY","offsetX","offsetY"],i,e);const s={mousedown:n=>{const a=mu(t,"drag-start",i,n);this.dispatch("drag-start",t,a)},mousemove:n=>{const a=mu(t,"drag-move",i,n);this.dispatch("drag-move",t,a)},mouseup:n=>{const a=mu(t,"drag-end",i,n);this.dispatch("drag-end",t,a),this.endDrag(t,a)}};this.mouseDragger=sk($y,this,s,e)}endDrag(t,{sourceEvent:e,clientX:i,clientY:s}){const n=t.getElement(),a=n.getBoundingClientRect();ek(a,i,s)||(n.dispatchEvent(new MouseEvent("mouseleave",e)),e.target?.dispatchEvent(new MouseEvent("mouseenter",e)))}triggerTouchDrag(t,e){const i=e.targetTouches[0];e.targetTouches.length===1&&i!=null&&this.startOneFingerTouch(t,e,i)}startOneFingerTouch(t,e,i){const s={pageX:Number.NaN,pageY:Number.NaN,...ck(t,i)};Wy(["pageX","pageY"],s,i);const n={touchmove:(o,l)=>{const c=yu(t,"drag-move",s,o,l);this.dispatch("drag-move",t,c)},touchend:(o,l)=>{const c=yu(t,"drag-end",s,o,l);this.dispatch("drag-end",t,c)}},a=t.getElement();this.touchDragger=lk($y,this,n,i,a);const r=yu(t,"drag-start",s,e,i);this.dispatch("drag-start",t,r)}dispatch(t,e,i){for(const s of this.getListenerSet(t))s(i,e);this.dispatchCallback(t,i)}},hk=class{constructor(t){this.elem=t}setBounds(t){Uy(this.elemContainer??this.elem,t)}getBounds(){return ZN(this.elemContainer??this.elem)}static setElementContainer(t,e){const i=t.getBounds();Uy(e,i),XN(t.elem,{width:"100%",height:"100%"}),t.elem.remove(),t.elemContainer=e,t.elemContainer.replaceChildren(t.elem)}},tn=class extends hk{constructor(){super(...arguments),this.index=Number.NaN,this.children=[]}set id(t){is(this.elem,"id",t)}get id(){return pu(this.elem,"id")}getElement(){return this.elem}getBoundingClientRect(){return this.elem.getBoundingClientRect()}get clientWidth(){return this.elem.clientWidth}get clientHeight(){return this.elem.clientHeight}destroy(){this.destroyListener?.(),this.destroyListener=void 0,this.remove();for(const t of this.children)t.parent=void 0,t.destroy();this.children.length=0,this.destructor(),this.remove(),this.internalListener?.destroy(),this.htmlListener?.destroy(this)}remove(){this.elem.remove(),this.elemContainer?.remove()}setHidden(t){gu(this.elem,"display",t?"none":void 0)}isHidden(){const{defaultView:t}=this.elem.ownerDocument;return t?.getComputedStyle(this.elem).display==="none"}setCursor(t){gu(this.elem,"cursor",t)}setTextContent(t){this.elem.textContent=t??null}setAriaDescribedBy(t){is(this.elem,"aria-describedby",t)}setAriaHidden(t){is(this.elem,"aria-hidden",t)}setAriaLabel(t){is(this.elem,"aria-label",t)}setAriaExpanded(t){is(this.elem,"aria-expanded",t)}setAriaControls(t){is(this.elem,"aria-controls",t)}setAriaHasPopup(t){is(this.elem,"aria-haspopup",t)}setInnerHTML(t){this.elem.innerHTML=t}setPointerEvents(t){gu(this.elem,"pointer-events",t)}setCSSVariable(t,e){this.elem.style.setProperty(t,e)}isDisabled(){return pu(this.elem,"aria-disabled",!1)}hasPopup(){const t=pu(this.elem,"aria-haspopup");return t!==void 0&&t!=="false"}parseFloat(t){return t===""?0:Number.parseFloat(t)}cssLeft(){return this.parseFloat(this.elem.style.left)}cssTop(){return this.parseFloat(this.elem.style.top)}cssWidth(){return this.parseFloat(this.elem.style.width)}cssHeight(){return this.parseFloat(this.elem.style.height)}focus(t){this.elem.focus(t)}setFocusOverride(t){is(this.elem,"data-focus-override",t)}setPreventsDefault(t){is(this.elem,"data-preventdefault",t)}setTabIndex(t){is(this.elem,"tabindex",t)}addChild(t){this.addChildToDOM(t,this.getBefore(t)),this.children.push(t),t.index=this.children.length-1,t.parent=this,this.onChildAdded(t)}removeChild(t){const e=this.children.indexOf(t);this.children.splice(e,1),this.removeChildFromDOM(t),this.onChildRemoved(t)}moveChild(t,e){t.domIndex!==e&&(t.domIndex=e,this.removeChildFromDOM(t),this.addChildToDOM(t,this.getBefore(t)))}addClass(...t){this.elem.classList.add(...t)}removeClass(...t){this.elem.classList.remove(...t)}toggleClass(t,e){this.elem.classList.toggle(t,e)}appendOrInsert(t,e){e?e.getElement().insertAdjacentElement("beforebegin",t):this.elem.appendChild(t)}addChildToDOM(t,e){this.appendOrInsert(t.getElement(),e)}removeChildFromDOM(t){t.getElement().remove()}onChildAdded(t){}onChildRemoved(t){}getBefore({domIndex:t}){if(t!==void 0)return this.children.filter(e=>e.domIndex!==void 0&&e.domIndex>t).reduce((e,i)=>!e||i.domIndexthis.removeListener(t,e)}removeListener(t,e){en.isHTMLEvent(t)?this.htmlListener?.remove(t,this,e):this.htmlListener!=null&&this.internalListener?.remove(t,this,e)}setDragTouchEnabled(t){this.internalListener??(this.internalListener=new Ky(this.onDispatch.bind(this))),this.internalListener.dragTouchEnabled=t}onDispatch(t,e){if(!e.sourceEvent?.bubbles)return;let{parent:i}=this;for(;i!=null;){const{internalListener:s}=i;if(s!=null){const n={...e,...en.calcCurrentXY(i.getElement(),e)};s.dispatch(t,i,n)}i=i.parent}}},dk=class extends tn{constructor(){super(KN("div")),this.textElement=Gy("text"),this.textElement.role="presentation",this.svgElement=Gy("svg"),this.svgElement.appendChild(this.textElement),this.svgElement.style.width="100%",this.svgElement.style.opacity="0",this.svgElement.role="presentation",this.elem.appendChild(this.svgElement),this.elem.role="presentation"}set textContent(t){this.textElement.textContent=t;const i=this.textElement.getBBox?.();i&&this.svgElement.setAttribute("viewBox",`${i.x} ${i.y} ${i.width} ${i.height}`)}get textContent(){return this.textElement.textContent}destructor(){}};import{createElement as uk}from"ag-charts-core";import{isButtonClickEvent as pk,setAttribute as Zy}from"ag-charts-core";var gk=class{constructor(t,e){this.getDispatcher=e,this.onExpanded=()=>{this.controller.setAriaExpanded(!0);const i=this.getDispatcher();if(i&&this.controls){const s={type:"expand-controlled-widget",controlled:this.controls};i.dispatch("expand-controlled-widget",this.controller,s)}},this.onCollapsed=i=>{this.controller.setAriaExpanded(!1),i.mode==="0"&&this.controller.focus()},t.setAriaExpanded(!1),this.controller=t}destroy(){this.controls?.collapse({mode:"2"}),this.setControlled(void 0)}setControlled(t){this.controls&&(this.controls.removeListener("expand-widget",this.onExpanded),this.controls.removeListener("collapse-widget",this.onCollapsed)),this.controls=t,this.controls&&(this.controller.setAriaControls(this.controls.id),this.controls.addListener("expand-widget",this.onExpanded),this.controls.addListener("collapse-widget",this.onCollapsed))}getControlled(){return this.controls}expandControlled(t){this.controller.isDisabled()||this.controls?.expand({controller:this.controller,sourceEvent:void 0,overrideFocusVisible:t?.overrideFocusVisible})}},bu=class extends tn{constructor(t,e){super(t),Zy(this.elem,"role",e),this.setEnabled(!0),this.addListener("keydown",({sourceEvent:i})=>{pk(i)&&(i.preventDefault(),this.htmlListener?.dispatch("click",this,{type:"click",device:"keyboard",sourceEvent:i}))})}lazyControllerImpl(){return this.controllerImpl??(this.controllerImpl=new gk(this,()=>this.internalListener)),this.controllerImpl}destructor(){this.controllerImpl?.destroy()}setEnabled(t){Zy(this.elem,"aria-disabled",!t)}setControlled(t){return this.lazyControllerImpl().setControlled(t)}getControlled(){return this.lazyControllerImpl().getControlled()}expandControlled(t){return this.lazyControllerImpl().expandControlled(t)}addListener(t,e){return super.addListener(t,(i,s)=>{(t==="click"||t==="dblclick")&&this.isDisabled()||e(i,s)})}},yc=class extends bu{constructor(){super(uk("button"))}};import{createElement as fk,setAttribute as mk}from"ag-charts-core";var Xy=class extends tn{constructor(){super(fk("div")),mk(this.elem,"role","group")}destructor(){}};import{createElement as yk,setAttribute as bk,setElementStyle as xk}from"ag-charts-core";import{createElement as vk,getAttribute as Sk,getPrevNextKeys as xu,hasNoModifiers as Ik,isDirectionRtl as Dk,setAttribute as qy}from"ag-charts-core";var vu=class extends tn{constructor(t,e){super(vk("div")),this.focusedChildIndex=0,this.onChildFocus=(i,s)=>{const n=this.children[this.focusedChildIndex];this.focusedChildIndex=s.index,n?.setTabIndex(-1),s.setTabIndex(0)},this.onChildKeyDown=(i,s)=>{const n=this.orientation,a=Dk(this.elem);let r,o;n==="both"?(r=xu("horizontal",a),o=xu("vertical")):(r=xu(n,a),o=void 0);let l=-1;if(Ik(i.sourceEvent)){const c=i.sourceEvent.key;c===r.nextKey||c===o?.nextKey?l=s.index+1:(c===r.prevKey||c===o?.prevKey)&&(l=s.index-1)}this.children[l]?.focus()},qy(this.elem,"role",e),this.orientation=t}get orientation(){return Sk(this.elem,"aria-orientation")??"both"}set orientation(t){qy(this.elem,"aria-orientation",t==="both"?void 0:t)}focus(){this.children[this.focusedChildIndex]?.focus()}clear(){this.focusedChildIndex=0;for(const t of this.children)this.removeChildListeners(t),t.parent=void 0;this.elem.textContent="",this.children.length=0}addChildListeners(t){t.addListener("focus",this.onChildFocus),t.addListener("keydown",this.onChildKeyDown)}removeChildListeners(t){t.removeListener("focus",this.onChildFocus),t.removeListener("keydown",this.onChildKeyDown)}onChildAdded(t){this.addChildListeners(t),t.setTabIndex(this.children.length===1?0:-1)}onChildRemoved(t){this.removeChildListeners(t);const{focusedChildIndex:e,children:i}=this,s=e===t.index;for(let n=0;nthis.getElement().step=e.attributeValue,s=()=>this.getElement().step=this._step.attributeValue;this._keyboardStep={step:e,onKeyDown:i,onKeyUp:s,onBlur:s},this.addListener("keydown",this._keyboardStep.onKeyDown),this.addListener("keyup",this._keyboardStep.onKeyUp),this.addListener("blur",this._keyboardStep.onBlur)}}get orientation(){return Lk(this.elem,"aria-orientation")??"both"}set orientation(e){Nk(this.elem,"aria-orientation",e==="both"?void 0:e),Yl.registerDefaultPreventers(this,e)}destructor(){}clampValueRatio(e,i){const s=this.getValueRatio(),n=Ak(e,s,i);return n!==s&&this.setValueRatio(n),n}setValueRatio(e,i){const{divider:s}=this.step,n=Math.round(e*1e4)/s,{ariaValueText:a=Tk(n/s)}=i??{},r=this.getElement();r.value=`${n}`,r.ariaValueText=a,r.ariaValueNow=`${n}`}getValueRatio(){return this.getElement().valueAsNumber/this.step.divider}static registerDefaultPreventers(e,i){i==="both"?e.removeListener("keydown",Yl.onKeyDown):e.addListener("keydown",Yl.onKeyDown)}static onKeyDown(e,i){let s=[];const{orientation:n}=i;n==="horizontal"?s=["ArrowUp","ArrowDown"]:n==="vertical"&&(s=["ArrowLeft","ArrowRight"]),s.includes(e.sourceEvent.code)&&e.sourceEvent.preventDefault()}};Su.STEP_ONE={attributeValue:"1",divider:1},Su.STEP_HUNDRETH={attributeValue:"0.01",divider:100};var Iu=Su;import{setAttribute as Jy}from"ag-charts-core";var kk=class extends yc{constructor(){super(),Jy(this.elem,"role","switch"),this.setChecked(!1)}setChecked(t){Jy(this.elem,"aria-checked",t)}},bc=class extends vu{constructor(t="horizontal"){super(t,"toolbar")}destructor(){}};function or(t,e){return e.params?.type===t}function wk(t){if(t==="button")return new yc;if(t==="slider")return new Iu;if(t==="toolbar")return new bc;if(t==="group")return new Xy;if(t==="list")return new Mk;if(t==="region")return new rr(YN("div"));if(t==="text")return new dk;if(t==="listswitch")return new kk;throw new Error("AG Charts - error allocating meta")}function Qy(t){const e={params:t,result:void 0};return e.result=wk(e.params.type),e}var Ok=class{constructor(t,e,i){this.eventsHub=t,this.localeManager=e,this.domManager=i,this.cleanup=new WN}destroy(){this.cleanup.flush()}addLocalisation(t){t(),this.cleanup.register(this.eventsHub.on("locale:change",t))}createProxyContainer(t){const e=Qy(t),{params:i,result:s}=e,n=s.getElement();this.domManager.addChild("canvas-proxy",i.domManagerId,n),n.classList.add(...i.classList,"ag-charts-proxy-container"),n.role=i.role??i.type,or("toolbar",e)&&(e.result.orientation=e.params.orientation);const{ariaLabel:a}=i;return a&&this.addLocalisation(()=>{n.ariaLabel=this.localeManager.t(a.id,a.params)}),s}createProxyElement(t){const e=Qy(t);if(or("button",e)){const{params:i,result:s}=e,n=s.getElement();if(this.initInteract(i,s),typeof i.textContent=="string")n.textContent=i.textContent;else{const{textContent:a}=i;this.addLocalisation(()=>{n.textContent=this.localeManager.t(a.id,a.params)})}this.setParent(e.params,e.result)}if(or("slider",e)){const{params:i,result:s}=e,n=s.getElement();this.initInteract(i,s),n.type="range",n.role=i.role??"presentation",n.style.margin="0px",this.addLocalisation(()=>{n.ariaLabel=this.localeManager.t(i.ariaLabel.id,i.ariaLabel.params)}),this.setParent(e.params,e.result)}if(or("text",e)){const{params:i,result:s}=e;this.initElement(i,s),this.setParent(e.params,e.result)}if(or("listswitch",e)){const{params:i,result:s}=e;this.initInteract(i,s),s.setTextContent(i.textContent),s.setChecked(i.ariaChecked),s.setAriaDescribedBy(i.ariaDescribedBy),this.setParent(e.params,e.result)}if(or("region",e)){const{params:i,result:s}=e,n=s.getElement();this.initInteract(i,s),n.role=i.role??"region",this.setParent(e.params,e.result)}return e.result}initElement(t,e){const i=e.getElement();return $N(i,"cursor",t.cursor),i.classList.toggle("ag-charts-proxy-elem",!0),t.classList?.length&&i.classList.add(...t.classList),i}initInteract(t,e){const{tabIndex:i,domIndex:s}=t,n=this.initElement(t,e);i!==void 0&&(n.tabIndex=i),s!==void 0&&(e.domIndex=s)}setParent(t,e){if("parent"in t)t.parent?.addChild(e);else{const i={where:t.where,query:".ag-charts-series-area"};this.domManager.addChild("canvas-proxy",t.domManagerId,e.getElement(),i),e.destroyListener=()=>{this.domManager.removeChild("canvas-proxy",t.domManagerId)}}}};import{Logger as Ek}from"ag-charts-core";var Rk=/\$\{(\w+)}(?:\[(\w+)])?/gi,Du={number:new Intl.NumberFormat("en-US"),percent:new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}),percent0to2dp:new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:0,maximumFractionDigits:2}),date:new Intl.DateTimeFormat("en-US",{dateStyle:"full"}),time:new Intl.DateTimeFormat("en-US",{timeStyle:"full"}),datetime:new Intl.DateTimeFormat("en-US",{dateStyle:"full",timeStyle:"full"})},Pk=({defaultValue:t,variables:e})=>t?.replaceAll(Rk,(i,s,n)=>{const a=e[s],r=n==null?null:Du[n];return n!=null&&r==null&&Ek.warnOnce(`Format style [${n}] is not supported`),r!=null?r.format(a):typeof a=="number"?Du.number.format(a):a instanceof Date?Du.datetime.format(a):String(a)}),_k=class{constructor(t){this.eventsHub=t,this.localeText=void 0,this.getLocaleText=void 0}setLocaleText(t){this.localeText!==t&&(this.localeText=t,this.eventsHub.emit("locale:change",null))}setLocaleTextFormatter(t){this.getLocaleText=t,this.getLocaleText!==t&&(this.getLocaleText=t,this.eventsHub.emit("locale:change",null))}t(t,e={}){const{localeText:i=Lm,getLocaleText:s}=this,n=i[t];return String(s?.({key:t,defaultValue:n,variables:e})??Pk({key:t,defaultValue:n,variables:e})??t)}};import{CleanupRegistry as Fk,Debug as lr,EventEmitter as Vk,Logger as Bk,createId as zk,downloadUrl as Gk}from"ag-charts-core";var Uk=class{constructor(t){this.width=600,this.height=300,this.direction="ltr";const{width:e,height:i,willReadFrequently:s=!1}=t;this.element=t.canvasElement,this.pixelRatio=t.pixelRatio,this.element.style.display="block",this.element.style.width=(e??this.width)+"px",this.element.style.height=(i??this.height)+"px",this.element.width=Math.round((e??this.width)*this.pixelRatio),this.element.height=Math.round((i??this.height)*this.pixelRatio),this.context=this.element.getContext("2d",{willReadFrequently:s}),this.context.direction=this.direction,this.resize(e??0,i??0,this.pixelRatio),Hm(this.context)}drawImage(t,e=0,i=0){return t.drawImage(this.context.canvas,e,i)}toDataURL(t){return this.element.toDataURL(t)}resize(t,e,i){if(!(t>0&&e>0))return;const{element:s,context:n}=this;s.width=Math.round(t*i),s.height=Math.round(e*i),n.setTransform(i,0,0,i,0,0),s.style.width=t+"px",s.style.height=e+"px",this.width=t,this.height=e,this.pixelRatio=i}setDirection(t){this.direction=t?"rtl":"ltr",this.element.dir=this.direction,this.context.direction=this.direction}clear(){Um(this)}destroy(){this.element.remove(),this.element.width=0,this.element.height=0,this.context.clearRect(0,0,0,0),Object.freeze(this)}reset(){this.context.reset(),this.context.verifyDepthZero?.(),this.context.direction=this.direction}};import{EventEmitter as Hk,getImage as jk}from"ag-charts-core";var Wk=class extends Hk{constructor(){super(...arguments),this.cache=new Map,this.imageLoadingCount=0}loadImage(t,e){const i=this.cache.get(t);if(i?.image)return i.image;if(i!=null&&e){i.nodes.add(e);return}if(!e)return;const s={image:void 0,nodes:new Set([e])},n=jk(),a=new n;return this.imageLoadingCount++,a.onload=()=>{s.image=a;for(const r of s.nodes)r.markDirty();s.nodes.clear(),this.imageLoadingCount--,this.emit("image-loaded",{uri:t})},a.onerror=()=>{this.imageLoadingCount--,s.nodes.clear(),this.emit("image-error",{uri:t})},a.src=t,this.cache.set(t,s),s.image}waitingToLoad(){return this.imageLoadingCount>0}destroy(){for(const t of this.cache.values())t.nodes.clear();this.cache.clear()}};import{Debug as Yk}from"ag-charts-core";var $k=class{constructor(t){this.canvas=t,this.debug=Yk.create(!0,"scene"),this.layersMap=new Map,this.nextLayerId=0}get size(){return this.layersMap.size}resize(t,e,i){this.canvas.resize(t,e,i);for(const{canvas:s}of this.layersMap.values())s.resize(t,e,i)}addLayer(t){const{width:e,height:i,pixelRatio:s}=this.canvas,{name:n}=t,a=new Hd({width:e,height:i,pixelRatio:s});return this.layersMap.set(a,{id:this.nextLayerId++,name:n,canvas:a}),this.debug("Scene.addLayer() - layers",this.layersMap),a}removeLayer(t){this.layersMap.has(t)&&(this.layersMap.delete(t),t.destroy(),this.debug("Scene.removeLayer() - layers",this.layersMap))}clear(){for(const t of this.layersMap.values())t.canvas.destroy();this.layersMap.clear()}},xc=class extends Vk{constructor(t){super(),this.debug=lr.create(!0,"scene"),this.id=zk(this),this.imageLoader=new Wk,this.root=null,this.pendingSize=null,this.isDirty=!1,this.direction="ltr",this.cleanup=new Fk,this.updateDebugFlags(),this.canvas=new Uk(t),this.layersManager=new $k(this.canvas),this.cleanup.register(this.imageLoader.on("image-loaded",()=>{this.emit("scene-changed",{})}),this.imageLoader.on("image-error",({uri:e})=>{Bk.warnOnce(`Unable to load image ${e}`)}))}waitingForUpdate(){return this.imageLoader?.waitingToLoad()??!1}get width(){return this.pendingSize?.[0]??this.canvas.width}get height(){return this.pendingSize?.[1]??this.canvas.height}get pixelRatio(){return this.pendingSize?.[2]??this.canvas.pixelRatio}get isRtl(){return this.direction==="rtl"}setContainer(t){const{element:e}=this.canvas;return e.remove(),t.appendChild(e),this}setRoot(t){return this.root===t?this:(this.isDirty=!0,this.root?.setScene(),this.root=t,t&&(t.visible=!0,t.setScene(this)),this)}updateDebugFlags(){lr.inDevelopmentMode(()=>Ms._debugEnabled=!0)}clearCanvas(){this.canvas.clear()}attachNode(t){return this.appendChild(t),()=>t.remove()}appendChild(t){return this.root?.appendChild(t),this}removeChild(t){return t.remove(),this}download(t,e){Gk(this.canvas.toDataURL(e),t?.trim()??"image")}getDataURL(t){return this.canvas.toDataURL(t)}resize(t,e,i){return t=Math.round(t),e=Math.round(e),i??(i=this.pixelRatio),t>0&&e>0&&(t!==this.width||e!==this.height||i!==this.pixelRatio)?(this.pendingSize=[t,e,i],this.isDirty=!0,!0):!1}setDirection(t){this.direction=t?"rtl":"ltr",this.canvas.setDirection(t)}updateBaseFont(){const t=this.root?.resolveFont();t!=null&&t!==this._baseFont&&(this._baseFont=t,this.canvas.context.font=t)}applyPendingResize(){return this.pendingSize?(this.layersManager.resize(...this.pendingSize),this.pendingSize=null,this._baseFont!=null&&(this.canvas.context.font=this._baseFont),!0):!1}render(t){const{debugSplitTimes:e={start:performance.now()},extraDebugStats:i,seriesRect:s,debugColors:n}=t??{},{canvas:a,canvas:{context:r}={},root:o,width:l,height:c,pixelRatio:h}=this;if(!r)return;const d=lr.check("scene:stats","scene:stats:verbose");d&&this.ensureDebugStatsRegistration();const u=performance.now(),p=this.applyPendingResize();if(o&&!o.visible){this.isDirty=!1;return}let g;if(o instanceof U&&(g=o.dirty),o!=null&&g===!1&&!this.isDirty){this.debug.check()&&this.debug("Scene.render() - no-op",{tree:rc(o,"console")}),d&&My(this.layersManager,e,r,void 0,i,s,n);return}const f={ctx:r,direction:this.direction,width:l,height:c,devicePixelRatio:h,debugNodes:{}};lr.check("scene:stats:verbose")&&(f.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),kL(f);let m=!1;if((g!==!1||p)&&(m=!0,a.clear()),o&&lr.check("scene:dirtyTree")){const{dirtyTree:b,paths:x}=Ay(o);lr.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:b,paths:x})}if(o&&m){if(o.visible&&o.preRender(f),this.debug.check()){const b=rc(o,"console");this.debug("Scene.render() - before",{canvasCleared:m,tree:b})}if(o.visible)try{r.save(),o.render(f),r.restore()}catch(b){throw this.canvas.reset(),b}}e["\u270D\uFE0F"]=performance.now()-u,r.verifyDepthZero?.(),this.isDirty=!1,d&&My(this.layersManager,e,r,f.stats,i,s,n),wL(r,f.debugNodes),o&&this.debug.check()&&this.debug("Scene.render() - after",{tree:rc(o,"console"),canvasCleared:m})}ensureDebugStatsRegistration(){if(this.releaseDebugStats)return;const t=TL(),e=()=>{t(),this.releaseDebugStats=void 0};this.releaseDebugStats=e,this.cleanup.register(e)}toSVG(){const{root:t,width:e,height:i}=this;if(t!=null)return Ms.toSVG(t,e,i)}strip(){const{context:t,pixelRatio:e}=this.canvas;t.setTransform(e,0,0,e,0,0),this.layersManager.clear(),this.setRoot(null),this.isDirty=!1,this.clear()}destroy(){this.strip(),this.canvas.destroy(),this.imageLoader.destroy(),this.cleanup.flush(),Ty(),Object.assign(this,{canvas:void 0})}};xc.className="Scene";import{deepClone as Kk,isArray as Zk,mergeDefaults as Xk}from"ag-charts-core";var qk=class{constructor(t,e,i){this.eventsHub=t,this.annotationRoot=e,this.fireChartEvent=i,this.mementoOriginatorKey="annotations",this.annotations=[]}createMemento(){return this.annotations}guardMemento(t){return t==null||Zk(t)}restoreMemento(t,e,i){this.annotations=this.cleanData(i??[]).map(s=>{const n=this.getAnnotationTypeStyles(s.type);return Xk(s,n)}),this.eventsHub.emit("annotations:restore",{annotations:this.annotations})}updateData(t){this.annotations=this.cleanData(t??[])}fireChangedEvent(){this.fireChartEvent({type:"annotations",annotations:Kk([...this.annotations])})}attachNode(t){return this.annotationRoot.append(t),()=>(t.remove(),this)}setAnnotationStyles(t){this.styles=t}getAnnotationTypeStyles(t){return this.styles?.[t]}cleanData(t){for(const e of t)"textAlign"in e&&delete e.textAlign;return t}};import{ZIndexMap as cr}from"ag-charts-core";var Jk=class{constructor(t,e){this.eventsHub=t,this.sceneRoot=e,this.axes=new Map,this.axisGridGroup=new U({name:"Axes-Grids",zIndex:cr.AXIS_GRID}),this.axisGroup=new U({name:"Axes",zIndex:cr.AXIS}),this.axisLabelGroup=new U({name:"Axes-Labels",zIndex:cr.SERIES_LABEL}),this.axisCrosslineRangeGroup=new U({name:"Axes-Crosslines-Range",zIndex:cr.SERIES_CROSSLINE_RANGE}),this.axisCrosslineLineGroup=new U({name:"Axes-Crosslines-Line",zIndex:cr.SERIES_CROSSLINE_LINE}),this.axisCrosslineLabelGroup=new U({name:"Axes-Crosslines-Label",zIndex:cr.SERIES_LABEL}),this.sceneRoot.appendChild(this.axisGroup),this.sceneRoot.appendChild(this.axisGridGroup),this.sceneRoot.appendChild(this.axisLabelGroup),this.sceneRoot.appendChild(this.axisCrosslineRangeGroup),this.sceneRoot.appendChild(this.axisCrosslineLineGroup),this.sceneRoot.appendChild(this.axisCrosslineLabelGroup)}updateAxes(t,e){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const s of t)e.includes(s)||(s.detachAxis(i),s.destroy());for(const s of e)t?.includes(s)||s.attachAxis(i);this.axes.clear();for(const s of e){const n=s.createAxisContext();this.axes.has(n.direction)?this.axes.get(n.direction)?.push(n):this.axes.set(n.direction,[n])}this.eventsHub.emit("axis:change",null)}getAxisIdContext(t){for(const[,e]of this.axes)for(const i of e)if(i.axisId===t)return i}getAxisContext(t){return this.axes.get(t)??[]}destroy(){this.axes.clear(),this.axisGroup.remove(),this.axisGridGroup.remove()}};import{ActionOnSet as eb,Debug as Qk,Logger as tb,throttle as ib}from"ag-charts-core";var Mu=class{constructor(t,e,i){this.eventsHub=t,this.caller=e,this.animationManager=i,this.dispatchOnlyLatest=!0,this.dispatchThrottle=0,this.requestThrottle=300,this.isLoadingInitialData=!1,this.isLoadingData=!1,this.freshRequests=[],this.requestCounter=0,this.pendingData=void 0,this.debug=Qk.create(!0,"data-model","data-source"),this.throttledFetch=this.createThrottledFetch(this.requestThrottle),this.throttledDispatch=this.createThrottledDispatch(this.dispatchThrottle)}updateCallback(t){typeof t=="function"&&(this.debug("DataService - updated data source callback"),this.dataSourceCallback=t,this.isLoadingInitialData=!0,this.animationManager.skip(),this.eventsHub.emit("data:source-change",null))}clearCallback(){this.dataSourceCallback=void 0}load(t){const{pendingData:e}=this;if(e!=null&&(e.params.windowStart==null&&e.params.windowEnd==null||e.params.windowStart?.valueOf()===t.windowStart?.valueOf()&&e.params.windowEnd?.valueOf()===t.windowEnd?.valueOf())){const i=this.requestCounter++;this.isLoadingInitialData=!1,this.dispatch(i,e.data);return}this.isLoadingData=!0,this.throttledFetch(t)}isLazy(){return this.dataSourceCallback!=null}isLoading(){return this.isLazy()&&(this.isLoadingInitialData||this.isLoadingData)}async getData(){const{latestRequest:t}=this;if(!t)return;const{params:e,fetchRequest:i}=t,s=await i;return{params:e,data:s}}restoreData(t){this.pendingData=t}createThrottledFetch(t){return ib(e=>this.fetch(e).catch(i=>tb.error("callback failed",i)),t,{leading:!1,trailing:!0})}createThrottledDispatch(t){return ib((e,i)=>this.dispatch(e,i),t,{leading:!0,trailing:!0})}dispatch(t,e){this.debug(`DataService - dispatching 'data-load' | ${t}`),this.eventsHub.emit("data:load",{data:e})}async fetch(t){"context"in this.caller&&(t.context=this.caller.context);const e=Promise.resolve().then(async()=>{if(!this.dataSourceCallback)throw new Error("DataService - [dataSource.getData] callback not initialised");const i=performance.now(),s=this.requestCounter++;this.debug(`DataService - requesting | ${s}`);let n;try{n=await this.dataSourceCallback(t),this.debug(`DataService - response | ${performance.now()-i}ms | ${s}`)}catch(r){this.debug(`DataService - request failed | ${s}`),tb.errorOnce(`DataService - request failed | [${r}]`)}this.isLoadingInitialData=!1;const a=this.freshRequests.indexOf(e);return a===-1||this.dispatchOnlyLatest&&a!==this.freshRequests.length-1?(this.debug(`DataService - discarding stale request | ${s}`),n):(this.freshRequests=this.freshRequests.slice(a+1),this.freshRequests.length===0&&(this.isLoadingData=!1),Array.isArray(n)?this.throttledDispatch(s,n):this.eventsHub.emit("data:error",null),n)});this.latestRequest={params:t,fetchRequest:e},this.freshRequests.push(e),await e}};y([eb({newValue(t){this.throttledDispatch=this.createThrottledDispatch(t)}})],Mu.prototype,"dispatchThrottle",2),y([eb({newValue(t){this.throttledFetch=this.createThrottledFetch(t)}})],Mu.prototype,"requestThrottle",2);import{cachedTextMeasurer as ew,getResizeObserver as tw}from"ag-charts-core";var iw=class{constructor(t,e){this.domManager=t,this.eventsHub=e,this.observers=[]}updateFonts(t){if(!(!t||t.size===0)){this.loadFonts(t);for(const e of t)this.observeFontStatus(e)}}destroy(){for(const t of this.observers)t.disconnect();this.observers=[]}loadFonts(t){const e=Array.from(t).map(a=>encodeURIComponent(a)),i=":wght@100;200;300;400;500;600;700;800;900",s=`${i}&family=`,n=`@import url('https://fonts.googleapis.com/css2?family=${e.join(s)}${i}&display=swap'); `;this.domManager.addStyles(`google-font-${e.join("-")}`,n)}observeFontStatus(t){const e=tw();if(e===void 0)return;const s=this.domManager.getDocument().createElement("div",{position:"absolute",top:"0",margin:"0",padding:"0",overflow:"hidden",visibility:"hidden",width:"auto",maxWidth:"none",fontSynthesis:"none",fontFamily:t,fontSize:"16px",whiteSpace:"nowrap"});s.textContent="UVWxyz",this.domManager.addChild("canvas-container",`font-check-${encodeURIComponent(t)}`,s);const n=new e(a=>{const r=a?.at(0)?.contentBoxSize.at(0)?.inlineSize;r!=null&&r>0&&(ew.clear(),this.eventsHub.emit("font:load",null))});n.observe(s),this.observers.push(n)}};import{Logger as sw,buildDateFormatter as sb,createNumberFormatter as nw,formatValue as nb,isPlainObject as Au,parseNumberFormat as aw,simpleMemorize2 as rw,toTextString as ow}from"ag-charts-core";import{Logger as lw}from"ag-charts-core";var ab=class{constructor(){this.registeredListeners=new Map}addListener(t,e){const i={symbol:Symbol(t),handler:e};return this.registeredListeners.has(t)?this.registeredListeners.get(t).push(i):this.registeredListeners.set(t,[i]),()=>this.removeListener(i.symbol)}removeListener(t){for(const[e,i]of this.registeredListeners.entries()){const s=i.findIndex(n=>n.symbol===t);if(s>=0){i.splice(s,1),i.length===0&&this.registeredListeners.delete(e);break}}}dispatch(t,...e){for(const i of this.getListenersByType(t))try{i.handler(...e)}catch(s){lw.errorOnce(s)}}getListenersByType(t){return this.registeredListeners.get(t)??[]}destroy(){this.registeredListeners.clear()}},ss={millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e",month:"%b",year:"%Y"},cw={millisecond:"%Y %b %e %H:%M:%S.%L",second:"%Y %b %e %H:%M:%S",minute:"%Y %b %e %H:%M",hour:"%Y %b %e %H:%M",day:"%Y %b %e",month:"%Y %b",year:"%Y"},Lt={year:0,month:1,day:2,hour:3,minute:4,second:5,millisecond:6},hw=/%[-_0]?L/,dw=/%[-_0]?S/,uw=/%[-_0]?M/,pw=/%[-_0]?[HI]/,gw=/^%[-_0]?[de]$/,fw=/^%[-_0]?[Bbm]$/,mw=/^%[-_0]?[Yy]$/;function yw(t,e,i){if(typeof t=="string")return t;t??(t=ss);const{millisecond:s=ss.millisecond,second:n=ss.second,minute:a=ss.minute,hour:r=ss.hour,day:o=ss.day,month:l=ss.month,year:c=ss.year}=t,h=Lt[e],d=cw[e],u=i?Lt[i]:-1;if(u=Lt.year&&!mw.test(c)||u=Lt.month&&!fw.test(l)||u=Lt.day&&!gw.test(o))return d;let p;switch(e){case"year":return c;case"month":return u=Lt.hour&&!pw.test(p)||h>=Lt.minute&&!uw.test(p)||h>=Lt.second&&!dw.test(p)||h>=Lt.millisecond&&!hw.test(p))return d;let g;return u{const r=Ed.mergeSpecifiers(e,i)??ss;return Ed.getFormatter("date",r,s,n,{truncateDate:a})}),this.formatter=void 0}static mergeSpecifiers(...e){let i;for(const s of e)Au(s)&&Au(i)?i={...i,...s}:i=s;return i}static getFormatter(e,i,s,n="long",{truncateDate:a}={}){if(Au(i)){if(e!=="date"){sw.warn("Date formatter configuration is not supported for non-date types.");return}s??(s="millisecond");const r=n==="component"?i?.[s]??ss[s]:yw(i,s,a);return sb(r)}switch(e){case"number":{const r=aw(i);return r==null?void 0:nw(r)}case"date":return sb(i);case"category":return r=>i.replace("%s",String(r))}}setFormatter(e){this.formatter!==e&&(this.formatter=e,this.formats.clear(),this.dateFormatter.reset(),this.dispatch("format-changed"))}format(e,i,{specifier:s,truncateDate:n,allowNull:a}={}){if(i.value==null&&!a)return;const{formatter:r}=this;if(r==null)return;if(typeof r=="function"){const h=e(r,i);return h==null?void 0:String(h)}const o=r[i.property];if(o==null)return;if(typeof o=="function"){const h=e(o,i);return h==null?h:ow(h)}else if(i.type==="date"){const{unit:h,style:d}=i;return this.dateFormatter(o,s,h,d,n)?.(i.value)}const l=s??o;if(typeof l!="string")return;let c=this.formats.get(l);return c==null&&(c=Ed.getFormatter(i.type,l),this.formats.set(l,c)),c?.(i.value,i.type==="number"?i.fractionDigits:void 0)}defaultFormat(e,{specifier:i,truncateDate:s}={}){const{formatter:n}=this,a=typeof n=="function"?void 0:n?.[e.property];switch(e.type){case"date":{const{unit:r,style:o}=e,l=a!=null&&typeof a!="function"?a:void 0;return this.dateFormatter(l,i,r,o,s)?.(e.value)??String(e.value)}case"number":return nb(e.value,e.fractionDigits);case"category":return e.value==null?"":Array.isArray(e.value)?e.value.join(" - "):typeof e.value=="string"?e.value:typeof e.value=="number"?nb(e.value):String(e.value)}}};import{objectsEqual as bw,validate as xw}from"ag-charts-core";import{array as Mo,arrayOfDefs as vw,boolean as Cu,commonChartOptionsDefs as vc,defined as dr,geoJson as Sw,htmlElement as Iw,object as rb,or as Dw,positiveNumber as Mw,required as ob,strictUnion as Aw,string as ns,undocumented as lb,union as Cw}from"ag-charts-core";var cb={activeItem:{type:ob(Aw()("series-node","legend")),seriesId:ns,itemId:ob(Dw(ns,Mw))},frozen:Cu},Ao={mode:lb(Cw("integrated","standalone")),withinStudio:lb(Cu),container:Iw,context:()=>!0,theme:dr,series:Mo,annotations:dr,navigator:dr,scrollbar:dr,initialState:{active:cb,chartType:ns,annotations:dr,legend:vw({visible:Cu,seriesId:ns,itemId:ns,legendItemName:ns},"legend state array"),zoom:dr}},Tw={...vc,...Ao,axes:rb,data:Mo,dataIdKey:ns},Lw={...vc,...Ao,axes:rb,data:Mo,dataIdKey:ns},Nw={...vc,...Ao,data:Mo,dataIdKey:ns,topology:Sw},kw={...vc,...Ao,data:Mo,dataIdKey:ns},hb=(t=>(t[t.Default=64]="Default",t[t.ZoomDrag=32]="ZoomDrag",t[t.Annotations=16]="Annotations",t[t.ContextMenu=8]="ContextMenu",t[t.Animation=4]="Animation",t[t.AnnotationsSelected=2]="AnnotationsSelected",t[t.Frozen=1]="Frozen",t[t.Hoverable=82]="Hoverable",t[t.Clickable=83]="Clickable",t[t.Focusable=69]="Focusable",t[t.Keyable=87]="Keyable",t[t.ContextMenuable=72]="ContextMenuable",t[t.AnnotationsMoveable=18]="AnnotationsMoveable",t[t.AnnotationsDraggable=114]="AnnotationsDraggable",t[t.ZoomDraggable=101]="ZoomDraggable",t[t.ZoomClickable=69]="ZoomClickable",t[t.ZoomWheelable=119]="ZoomWheelable",t[t.All=126]="All",t))(hb||{}),db=class{constructor(){this.stateQueue=68}pushState(t){this.stateQueue|=t}popState(t){this.stateQueue&=~t}isState(t){return!!(this.stateQueue&-this.stateQueue&t)}},ww=class{constructor(t,e,i,s,n){this.chartService=t,this.eventsHub=e,this.interactionManager=s,this.fireEvent=n,this.mementoOriginatorKey="active",this.updateable=!0,this.didLayout=!1,this.pendingMemento=void 0;const a=i.addListener("pre-scene-render",()=>{this.didLayout=!0;const{pendingMemento:r}=this;r&&(this.restoreMemento(r.version,r.mementoVersion,r.memento),this.pendingMemento=void 0),a()})}isFrozen(){return this.interactionManager.isState(1)}clear(){return this.update(void 0,void 0)}update(t,e){return this.performUpdate("user-interaction",t,e,!1)}performUpdate(t,e,i,s){if(!this.updateable)return!1;const n=this.currentItem;let a=!1;if(s||!bw(n,e)){const{frozen:r,activeItem:o}=this.createMementoWithItem(e),{datum:l}=i??{};this.fireEvent({type:"activeChange",source:t,frozen:r,activeItem:o,datum:l,dataIdKey:i?.series.data?.dataIdKey,preventDefault:()=>{a=!0}})}return a||(this.currentItem=e,this.eventsHub.emit("active:update",e)),a}createMemento(){return this.createMementoWithItem(this.currentItem)}createMementoWithItem(t){const e=this.isFrozen();switch(t?.type){case"series-node":case"legend":{const{type:i,seriesId:s,itemId:n}=t;return{frozen:e,activeItem:{type:i,seriesId:s,itemId:n}}}default:return t?.type,{frozen:e}}}guardMemento(t,e){if(t==null)return!0;const i=xw(t,Ao.initialState.active);return e.push(...i.invalid.map(s=>s.toString())),i.invalid.length===0}restoreMemento(t,e,i){if(!this.didLayout){this.pendingMemento={version:t,mementoVersion:e,memento:i};return}this.updateable=!1;const[s,n]=this.performRestoration(i?.activeItem);this.updateable=!0;const a=this.isFrozen(),r=i?.frozen,o=r===void 0?!1:a!==r;r===!0?this.interactionManager.pushState(1):r===!1&&this.interactionManager.popState(1),this.performUpdate("state-change",s,n,o)}performRestoration(t){let e=!1;const i=()=>e=!0;let s;const n=o=>s=o,a=this.pendingMemento!==void 0,r=this.chartService.id;return this.eventsHub.emit("active:load-memento",{initialState:a,chartId:r,activeItem:t,reject:i,setDatum:n}),e?[void 0,void 0]:[t,s]}};import{Debug as Ow,EventEmitter as Ew,Logger as ub}from"ag-charts-core";import{clamp as Rw,isPlainObject as pb,linear as Pw,objectsEqualWith as _w}from"ag-charts-core";import{Color as Co}from"ag-charts-core";function Fw(t,e){return i=>Number(t)*(1-i)+Number(e)*i}function gb(t,e){if(typeof t=="string")try{t=Co.fromString(t)}catch{t=Co.fromArray([0,0,0])}if(typeof e=="string")try{e=Co.fromString(e)}catch{e=Co.fromArray([0,0,0])}return i=>Co.mix(t,e,i).toRgbaString()}var Tu=.2,To=["initial","remove","update","add","trailing","end","none"],Lo={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:Tu,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1+Tu,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}};function Vw(t){return t.every(e=>e instanceof Ms)}function Lu(t){return Vw(t)?{nodes:t,selections:[]}:{nodes:[],selections:t}}function Nu(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((i,s)=>Nu(i,e[s])):Xl(t)&&Xl(e)?t.equals(e):pb(t)&&pb(e)?_w(t,e,Nu):!1}var Bw=class{constructor(t){this.isComplete=!1,this.elapsed=0,this.iteration=0,this.isPlaying=!1,this.isReverse=!1,this.id=t.id,this.groupId=t.groupId,this.autoplay=t.autoplay??!0,this.ease=t.ease??Pw,this.phase=t.phase;const e=t.duration??Lo[this.phase].animationDuration;this.duration=e*t.defaultDuration,this.delay=(t.delay??0)*t.defaultDuration,this.onComplete=t.onComplete,this.onPlay=t.onPlay,this.onStop=t.onStop,this.onUpdate=t.onUpdate,this.interpolate=this.createInterpolator(t.from,t.to),this.from=t.from,t.skip===!0&&(this.onUpdate?.(t.to,!1,this),this.onStop?.(this),this.onComplete?.(this),this.isComplete=!0),t.collapsable!==!1&&(this.duration=this.checkCollapse(t,this.duration))}checkCollapse(t,e){return Nu(t.from,t.to)?0:e}play(t=!1){this.isPlaying||this.isComplete||(this.isPlaying=!0,this.onPlay?.(this),this.autoplay&&(this.autoplay=!1,t&&this.onUpdate?.(this.from,!0,this)))}stop(){this.isPlaying=!1,this.isComplete||(this.isComplete=!0,this.onStop?.(this))}update(t){if(this.isComplete)return t;!this.isPlaying&&this.autoplay&&this.play(!0);const e=this.elapsed;if(this.elapsed+=t,this.delay>this.elapsed)return 0;const i=this.interpolate(this.isReverse?1-this.delta:this.delta);this.onUpdate?.(i,!1,this);const s=this.delay+this.duration;return this.elapsed>=s?(this.stop(),this.isComplete=!0,this.onComplete?.(this),t-(s-e)):0}get delta(){return this.ease(Rw(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(t,e){if(typeof e!="object"||Xl(e))return this.interpolateValue(t,e);if(Array.isArray(e)){const s=[];for(let n=0;n{const a=[];for(const r of s)a.push(r(n));return a}}const i=[];for(const s of Object.keys(e)){const n=this.createInterpolator(t[s],e[s]);n!=null&&i.push([s,n])}return s=>{const n={};for(const[a,r]of i)n[a]=r(s);return n}}interpolateValue(t,e){if(!(t==null||e==null)){if(Xl(t))return i=>t[Zl](e,i);try{switch(typeof t){case"number":return Fw(t,e);case"string":return gb(t,e);case"boolean":if(t===e)return()=>t;break;case"object":return()=>t;default:throw new Error(`Unable to interpolate values: ${t}, ${e}`)}}catch{}throw new Error(`Unable to interpolate values: ${t}, ${e}`)}}};import{clamp as zw,isContinuous as Gw,isFiniteNumber as fb,isNegative as Uw,memo as No,transformIntegratedCategoryValue as mb}from"ag-charts-core";import{isFiniteNumber as yb}from"ag-charts-core";function Hw(t,e,i,s){return e=t.endIndex)return!1;if(e<=t.startIndex&&s>=t.endIndex)t.startIndex=e,t.endIndex=e;else if(e<=t.startIndex){const n=s-t.startIndex,a=t.endIndex-t.startIndex;t.startIndex=e,t.endIndex=t.startIndex+Math.max(0,a-n)}else s>=t.endIndex?t.endIndex=Math.max(t.startIndex,e):t.endIndex=Math.max(t.startIndex,t.endIndex-i);return!0}function bb(t,e){const i=Math.ceil(t/1e3);return Math.max(e,i)}function xb(t,e){return Math.max(1,Math.ceil(t/e))}function Ww(t){return t.filter(e=>e.endIndex>e.startIndex)}function Yw(t,e,i){if(!e.enableBanding||t0&&t.handleInsertion(i.index,i.insertCount),i.deleteCount>0&&t.handleRemoval(i.index,i.deleteCount)}function Kw(t,e){for(const i of e)t.handleInsertion(i,0)}function Zw(t,e){$w(t,e.spliceOps),e.updatedIndices.size>0&&Kw(t,e.updatedIndices)}var Xw=1e3,qw=10,vb=class{constructor(t={}){this.bands=[],this.dataSize=0,this.config={minDataSizeForBanding:t.minDataSizeForBanding??Xw,targetBandCount:t.targetBandCount??qw,maxBandSize:t.maxBandSize??1/0,enableBanding:t.enableBanding??!0}}applyIndexMap(t){Zw(this,t)}initializeBands(t){this.dataSize=Math.max(0,t),this.bands=Yw(this.dataSize,this.config,(e,i)=>this.createBand(e,i))}getBandCount(){return this.bands.length}handleInsertion(t,e){if(this.dataSize+=e,this.bands.length===0){this.initializeBands(this.dataSize);return}const i=bb(this.dataSize,this.config.targetBandCount),s=xb(this.dataSize,i),n=Math.ceil(s*1.1);for(let a=0;a0){r.endIndex-r.startIndex>=s?this.bands.push(this.createBand(t,t+e)):(r.endIndex+=e,r.isDirty=!0);break}Hw(r,t,e,o)&&(r.isDirty=!0,e>0&&tn&&this.splitBand(a,s))}}handleRemoval(t,e){if(e<=0||this.bands.length===0)return;const i=Math.min(e,Math.max(0,this.dataSize-t));if(!(i<=0)){this.dataSize=Math.max(0,this.dataSize-i);for(const s of this.bands)jw(s,t,i)&&(s.isDirty=!0);this.bands=Ww(this.bands)}}splitBand(t,e){const i=this.bands[t],s=i.endIndex-i.startIndex,n=Math.min(e,Math.floor(s/2)),a=i.startIndex+n,r=this.createBand(i.startIndex,a),o=this.createBand(a,i.endIndex);this.bands.splice(t,1,r,o)}getStats(){const t=this.bands.filter(e=>e.isDirty);return{totalBands:this.bands.length,dirtyBands:t.length,dataSize:this.dataSize}}markRangeDirty(t,e){for(const i of this.bands)ti.startIndex&&(i.isDirty=!0)}},ni=class MC{constructor(){this.domain=new Set,this.dateTimestamps=new Set,this.hasDateValues=!1,this.sortedValues=null,this.sortOrder=void 0,this.isSortedUnique=!1}static is(e){return e instanceof MC}setSortedUniqueMode(e,i){i&&(this.isSortedUnique=!0,this.sortOrder=e,this.sortedValues=[])}extend(e){this.isSortedUnique&&this.sortedValues?(this.sortedValues.push(e),e instanceof Date&&(this.hasDateValues=!0)):e instanceof Date?(this.hasDateValues=!0,this.dateTimestamps.add(e.valueOf())):this.domain.add(e)}getDomain(){if(this.isSortedUnique&&this.sortedValues){let e=!1;return this.sortedValues.filter(i=>{if(i==null)return e?!1:(e=!0,!0);if(i instanceof Date&&Number.isNaN(i.valueOf())){if(e)return!1;e=!0}return!0})}if(this.hasDateValues){const e=Array.from(this.dateTimestamps,i=>new Date(i));return this.domain.size>0?[...e,...Array.from(this.domain)]:e}return Array.from(this.domain)}isDateDomain(){return this.hasDateValues}isSortedUniqueMode(){return this.isSortedUnique}getSortOrder(){return this.sortOrder}mergeFrom(e){if(this.isSortedUnique&&e.isSortedUnique&&this.sortOrder===e.sortOrder&&this.sortOrder!==void 0&&e.sortedValues){e.hasDateValues&&(this.hasDateValues=!0),this.sortedValues??(this.sortedValues=[]),this.sortedValues.push(...e.sortedValues);return}if(this.convertToSetMode(),e.hasDateValues&&(this.hasDateValues=!0),e.isSortedUnique&&e.sortedValues)for(const i of e.sortedValues)i instanceof Date?this.dateTimestamps.add(i.valueOf()):this.domain.add(i);else{for(const i of e.dateTimestamps)this.dateTimestamps.add(i);for(const i of e.domain)this.domain.add(i)}}convertToSetMode(){if(this.isSortedUnique){if(this.sortedValues){for(const e of this.sortedValues)e instanceof Date?this.dateTimestamps.add(e.valueOf()):this.domain.add(e);this.sortedValues=null}this.isSortedUnique=!1,this.sortOrder=void 0}}},ai=class AC{constructor(){this.domain=[1/0,-1/0]}static is(e){return e instanceof AC}static extendDomain(e,i=[1/0,-1/0]){for(const s of e)typeof s=="number"&&(i[0]>s&&(i[0]=s),i[1]e&&(this.domain[0]=e),this.domain[1]1&&super.splitBand(t,e)}markBandsDirty(t,e){this.markRangeDirty(t,e),this.fullDomainCache=null}markAllBandsDirty(){for(const t of this.bands)t.isDirty=!0;this.fullDomainCache=null}extendBandsFromData(t,e){const i=t.length;for(const s of this.bands){if(!s.isDirty)continue;const n=this.domainFactory();this.isDiscrete&&this.sortOrder!==void 0&&this.isUnique&&ni.is(n)&&n.setSortedUniqueMode(this.sortOrder,this.isUnique),s.subDomain=n;const{startIndex:a,endIndex:r}=s;for(let o=a;ot.isDirty)}extend(t){this.markAllBandsDirty(),this.fullDomainCache=null}canUseSortedConcatenation(){if(!this.sortOrder||!this.isUnique||!this.isDiscrete)return!1;for(const t of this.bands)if(!ni.is(t.subDomain)||!t.subDomain.isSortedUniqueMode()||t.subDomain.getSortOrder()!==this.sortOrder)return!1;return!0}concatenateSortedDomains(){const t=new ni;t.setSortedUniqueMode(this.sortOrder,this.isUnique);for(const e of this.bands)ni.is(e.subDomain)&&t.mergeFrom(e.subDomain);return t.getDomain()}deduplicateNulls(t){let e=!1;return t.filter(i=>{if(i==null)return e?!1:(e=!0,!0);if(i instanceof Date&&Number.isNaN(i.valueOf())){if(e)return!1;e=!0}return!0})}getDomain(){if(this.fullDomainCache!==null)return this.fullDomainCache;if(this.bands.length===0)return this.fullDomainCache=[],[];if(this.bands.length===1){const t=this.bands[0].subDomain.getDomain();return this.fullDomainCache=this.isDiscrete?this.deduplicateNulls(t):t,this.fullDomainCache}if(this.isDiscrete){const t=this.bands[0].subDomain;if(ni.is(t))if(this.canUseSortedConcatenation())this.fullDomainCache=this.deduplicateNulls(this.concatenateSortedDomains());else{const e=new ni;for(const i of this.bands)ni.is(i.subDomain)&&e.mergeFrom(i.subDomain);this.fullDomainCache=this.deduplicateNulls(e.getDomain())}else{const e=new Set;for(const i of this.bands)for(const s of i.subDomain.getDomain())e.add(s);this.fullDomainCache=Array.from(e)}}else{let t,e;for(const i of this.bands){const s=i.subDomain.getDomain();if(s.length===2){const[n,a]=s;(t===void 0||n!=null&&t!=null&&ne)&&(e=a)}}t!==void 0&&e!==void 0?this.fullDomainCache=[t,e]:this.fullDomainCache=[]}return this.fullDomainCache}getStats(){const t=this.bands.filter(i=>i.isDirty).length,e=this.bands.reduce((i,s)=>i+(s.endIndex-s.startIndex),0);return{bandCount:this.bands.length,dirtyBandCount:t,averageBandSize:this.bands.length>0?e/this.bands.length:0,dataSize:this.dataSize}}};function Sb(t,e=[0,0]){for(const i of t)typeof i=="number"&&(i<0&&(e[0]+=i),i>0&&(e[1]+=i));return e}function Jw(t,e){const i=e?.visible??!0;return{id:t,type:"aggregate",matchGroupIds:e?.matchGroupId?[e?.matchGroupId]:void 0,aggregateFunction:s=>Sb(s),groupAggregateFunction:(s,n=[0,0])=>(i&&(n[0]+=s?.[0]??0,n[1]+=s?.[1]??0),n)}}function Qw(t,e){return{id:t,matchGroupIds:[e],type:"aggregate",aggregateFunction:s=>ai.extendDomain(s)}}function Ib(t,e){const i=e?.visible??!0;return{id:t,type:"aggregate",aggregateFunction:()=>[0,1],groupAggregateFunction:(s,n=[0,0])=>(i&&(n[0]+=s?.[0]??0,n[1]+=s?.[1]??0),n)}}function eO(t,e){const i=e?.visible??!0;return{id:t,matchGroupIds:e?.matchGroupId?[e?.matchGroupId]:void 0,type:"aggregate",aggregateFunction:n=>Sb(n),groupAggregateFunction:(n,a=[0,0,-1])=>(i&&(a[0]+=n?.[0]??0,a[2]++,a[1]+=n?.[1]??0),a),finalFunction:(n=[0,0,0])=>{const a=n[0]+n[1];return a>=0?[0,a/n[2]]:[a/n[2],0]}}}function Db(t,e,i){const s={id:t,matchGroupIds:i?[i]:void 0,type:"aggregate",aggregateFunction:(n,a=[])=>{const r=a[1]-a[0];return e.aggregateFunction(n).map(o=>o/r)}};return e.groupAggregateFunction&&(s.groupAggregateFunction=e.groupAggregateFunction),s}function tO(t){return()=>{let e=0;return i=>yb(i)?(e+=t?Math.max(0,i):i,e):i}}function iO(){return()=>{let t=0;return e=>{if(!yb(e))return e;const i=t;return t+=e,i}}}import{Debug as sO,Logger as Pi,first as Mb}from"ag-charts-core";import{first as Ab}from"ag-charts-core";import{isObject as nO}from"ag-charts-core";var ku="\0__AG_NULL__\0",wu="\0__AG_UNDEFINED__\0";function Cb(t){return t===null?ku:t===void 0?wu:Array.isArray(t)?"["+t.map(Cb).join(",")+"]":nO(t)?JSON.stringify(t):String(t)}function Ou(t){return t.map(Cb).join("-")}function jt(t){const e=t?.map(Number);return e?.every(Number.isFinite)?e:[]}function Tb(t,e){return e?.get(t.id)??0}function Eu(t){return"scopes"in t&&Array.isArray(t.scopes)}function as(t,e){const i=[];for(let s=0;s{let i=e;for(const s of t)i=i[s];return i}}var oO=class{constructor(t,e,i){this.ctx=t,this.scopeCacheManager=e,this.resolvers=i}aggregateUngroupedData(t){const e=this.ctx.aggregates.map(()=>[1/0,-1/0]);t.domain.aggValues=e;const{columns:i,dataSources:s}=t,n=Ab(s.keys()),a=t.keys.map(l=>l.get(n)),r=s.get(n)?.data??[],o=this.ctx.keys.some(l=>l.allowNullKey===!0);t.aggregation=r?.map((l,c)=>{const h=[];for(const[d,u]of this.ctx.aggregates.entries()){const p=this.valueGroupIdxLookup(u);let g=u.groupAggregateFunction?.()??[1/0,-1/0];const f=p.map(v=>i[v][c]),m=Ru(a,c,o),b=m==null?void 0:u.aggregateFunction(f,m);b&&(g=u.groupAggregateFunction?.(b,g)??ai.extendDomain(b,g));const x=u.finalFunction?.(g)??g;h[d]=x,ai.extendDomain(x,e[d])}return h})}aggregateGroupedData(t){const e=this.ctx.aggregates.map(()=>[1/0,-1/0]);t.domain.aggValues=e;const{columns:i}=t;for(const[s,n]of this.ctx.aggregates.entries()){const a=this.valueGroupIdxLookup(n);for(let r=0;ro.datumIndices[u]?.length??0));for(let u=0;u{const m=o.datumIndices[f]?.[u];if(m==null)return;const b=this.resolvers.resolveAbsoluteIndex(r,m);return i[f][b]}),g=n.aggregateFunction(p,l);g&&(c=n.groupAggregateFunction?.(g,c)??ai.extendDomain(g,c))}const d=n.finalFunction?.(c)??c;o.aggregation[s]=d,ai.extendDomain(d,e[s])}}}postProcessGroups(t){const{groupProcessors:e}=this.ctx,{columnScopes:i,columns:s,invalidData:n}=t;for(const a of e){const r=this.valueGroupIdxLookup(a),o=a.adjust()();for(let l=0;lnew ni:()=>new ai,this.ctx.bandingConfig,s),e.set(t,n)),n&&s&&n.setSortOrderMetadata(i?.sortOrder,i?.isUnique??!1),n||(s?new ni:new ai)}extendDomainFromData(t,e,i){if(t instanceof ko)t.extendBandsFromData(e,i);else for(let s=0;se.includes(i))}function kb(t,e){if(t.valueType==="category"){for(const i of e)if(i.property===t.property&&i.valueType===t.valueType&&uO(i.scopes,t.scopes)&&i.validation===t.validation)return i}}var pO=class{constructor(t,e,i){this.ctx=t,this.initializer=e,this.scopeCacheManager=i,this.processValueFactory=new dO(t)}recomputeDomains(t){const e=this.ctx.debug.check()?performance.now():0,i=t[wo];let s;const n=t[sn],a=this.setupDefinitionDomains(this.ctx.keys,i,n),r=new Map;for(const h of this.ctx.values){const d=kb(h,this.ctx.keys);d&&r.set(h,d)}const o=this.setupValueDomainsWithSharing(this.ctx.values,i,a,r),l=new Set;for(const[,h]of r){const d=a.get(h);d&&l.add(d)}this.initializeDomainBands(this.ctx.keys,a,h=>{const d=t.keys[h];return Math.max(...Array.from(d.values()).map(u=>u.length))},h=>String(h.property)),this.initializeDomainBands(this.ctx.values,o,h=>t.columns[h].length,h=>String(h.property));const c=new Map;if(i.size>0){s={totalBands:0,dirtyBands:0,totalData:0};for(const h of i.values())if(h instanceof ko){const d=h.getStats();c.set(h,d),s.totalBands+=d.bandCount,s.dirtyBands+=d.dirtyBandCount,s.totalData=Math.max(s.totalData,d.dataSize)}}if(this.extendDomainsFromData(this.ctx.keys,a,(h,d)=>t.keys[h]?.get(d),h=>h.scopes??[],h=>t.invalidKeys?.get(h)),this.extendDomainsFromData(this.ctx.values,o,(h,d)=>t.columns[h],h=>[cO(h.scopes)],h=>t.invalidKeys?.get(h),l),t.domain.keys=this.ctx.keys.map(function(d){const u=a.get(d),p=u.getDomain();return ai.is(u)&&p[0]>p[1]?[]:p}),t.domain.values=this.ctx.values.map(function(d){const u=o.get(d),p=u.getDomain();return ai.is(u)&&p[0]>p[1]?[]:p}),t.type==="grouped"&&(t.domain.groups=t.groups.map(h=>h.keys)),this.collectDomainBandingMetadata(t,a,o,i,c),this.ctx.debug.check()&&e>0){const d=performance.now()-e;if(s&&s.totalBands>0){const u=s.dirtyBands/s.totalBands,p=Math.round(u*s.totalData);this.ctx.debug(`recomputeDomains with banding: ${d.toFixed(2)}ms, bands: ${s.dirtyBands}/${s.totalBands} dirty, data scanned: ~${p}/${s.totalData} (${(u*100).toFixed(1)}%)`)}else this.ctx.debug(`recomputeDomains: ${d.toFixed(2)}ms (no banding)`)}}setupDefinitionDomains(t,e,i){const s=new Map;for(const[n,a]of t.entries()){const r=i?.get(n);s.set(a,this.initializer.setupDomainForDefinition(a,e,r))}return s}initializeDomainBands(t,e,i,s){for(const[n,a]of t.entries()){const r=e.get(a);if(!r)continue;const o=i(n);this.initializer.initializeBandedDomain(r,o,s(a))}}extendDomainsFromData(t,e,i,s,n,a){for(const[r,o]of t.entries()){const l=e.get(o);if(l&&!a?.has(l))for(const c of s(o)){if(!c)continue;const h=i(r,c);if(!h)continue;const d=n(c);this.initializer.extendDomainFromData(l,h,d)}}}setupValueDomainsWithSharing(t,e,i,s){const n=new Map;for(const a of t){const r=s.get(a);if(r){const o=i.get(r);if(o){n.set(a,o);continue}}n.set(a,this.initializer.setupDomainForDefinition(a,e))}return n}initDataDomainProcessor(t){const{keys:e,values:i}=this.ctx,s=new Set;for(const u of i)if(u.scopes)for(const p of u.scopes)s.add(p);const n=new Map,a=new Map;let r=!0;const o=()=>{for(const u of e)u.valueType==="category"?n.set(u,new ni):n.set(u,new ai);for(const u of i){const p=kb(u,e);if(p){const g=n.get(p);if(g){n.set(u,g),r&&(r=(u.scopes?.length??0)===s.size);continue}}u.valueType==="category"?n.set(u,new ni):(n.set(u,new ai),r&&(r=(u.scopes?.length??0)===s.size))}};o();const l=this.scopeCacheManager.buildAccessors(Lb(e,i)),c=new WeakMap;for(const u of Lb(e,i)){const p=l.get(u.property),g=n.get(u),f={value:void 0,missing:!1,valid:!1},m=this.processValueFactory.createProcessValueFn(u,p,g,f,a,t);c.set(u,m)}function h(u){const p=c.get(u);if(!p)throw new Error("AG Charts - missing processValue function for definition");return p}function d(u,p,g,f){return h(u)(p,g,f)}return{dataDomain:n,processValue:d,getProcessValue:h,initDataDomain:o,scopes:s,allScopesHaveSameDefs:r}}collectDomainBandingMetadata(t,e,i,s,n){t.optimizations??(t.optimizations={});const a=(l,c)=>l.map(h=>{const d=c.get(h),u=s.get(h),p=d instanceof ko;let g;p||(g=h.valueType==="category"?"discrete domain":"not configured");let f;if(p&&u){const m=n.get(u)??u.getStats(),b=m.bandCount>0?m.dirtyBandCount/m.bandCount:0;f={totalBands:m.bandCount,dirtyBands:m.dirtyBandCount,dataSize:m.dataSize,scanRatio:b}}return{property:String(h.property),applied:p,reason:g,stats:f}}),r=a(this.ctx.keys,e),o=a(this.ctx.values,i);t.optimizations.domainBanding={keyDefs:r,valueDefs:o}}};import{Logger as gO,first as fO,iterate as mO}from"ag-charts-core";function yO(){return{lastValue:void 0,sortOrder:0,isUnique:!0,isOrdered:!0}}function bO(t,e){const i=typeof e=="number"?e:e?.valueOf?.();if(typeof i!="number"||!Number.isFinite(i))return;if(t.lastValue===void 0){t.lastValue=i;return}const s=i-t.lastValue;if(s===0)t.isUnique=!1;else if(t.isOrdered){const n=s>0?1:-1;t.sortOrder===0?t.sortOrder=n:t.sortOrder!==n&&(t.isOrdered=!1)}t.lastValue=i}function xO(t){return{sortOrder:t.isOrdered&&t.sortOrder!==0?t.sortOrder:void 0,isUnique:t.isUnique,isDirty:!1}}var vO=class{constructor(t,e){this.ctx=t,this.domainManager=e}extractData(t){const{dataDomain:e,getProcessValue:i,allScopesHaveSameDefs:s}=this.domainManager.initDataDomainProcessor("extend"),{keys:n,values:a}=this.ctx,{invalidData:r,invalidKeys:o,invalidKeyCount:l,invalidDataCount:c,missingData:h,allKeyMappings:d,keySortOrders:u}=this.extractKeys(n,t,i),{columns:p,columnScopes:g,columnNeedValueOf:f,partialValidDataCount:m,maxDataLength:b}=this.extractValues(r,c,h,a,t,o,i),x=v=>{const S=e.get(v),I=S.getDomain();return ai.is(S)&&I[0]>I[1]?[]:I};return{type:"ungrouped",input:{count:b},scopes:new Set(t.keys()),dataSources:t,aggregation:void 0,keys:[...d.values()],columns:p,columnScopes:g,columnNeedValueOf:f,invalidKeys:o,invalidKeyCount:l,invalidData:r,invalidDataCount:c,missingData:h,domain:{keys:n.map(x),values:a.map(x)},defs:{allScopesHaveSameDefs:s,keys:n,values:a},partialValidDataCount:m,time:0,version:0,[_u]:new Map,[sn]:u,[Pu]:new Map,[wo]:new Map,[ea]:new Map}}extractKeys(t,e,i){const s=new Map,n=new Map,a=new Map,r=new Map,o=new Map,l=new Map,c=new Map;let h,d;const u=t.map(g=>i(g)),p=(g,f)=>{const m=d.get(g);h.set(f,h.get(m)),s.has(m)&&(s.set(f,s.get(m)),n.set(f,n.get(m)),r.set(f,r.get(m)))};for(const[g,f]of t.entries()){const{invalidValue:m,scopes:b}=f,x=u[g];h=new Map,d=new Map,l.set(f,h);const v=yO();for(const S of b??[]){const I=e.get(S)?.data??[];if(d.has(I)){p(I,S);continue}const M=[];h.set(S,M),d.set(I,S);let D,A,C=0,T;for(let L=0;Lr(p));for(const[p,g]of s.entries()){const{invalidValue:f}=g,m=u[p];if(new Set(g.scopes.map(A=>n.get(A))).size>1)throw new Error(`AG Charts - more than one data source for: ${JSON.stringify(g)}`);const x=new Set(g.scopes),v=fO(g.scopes),S=n.get(v)?.data??[],I=new Array,M=a.get(v);let D=!1;for(let A=0;A0?1-m/g:0;t.optimizations.batchMerging={originalBatchCount:g,mergedBatchCount:m,mergeRatio:v}}const b=f.length===1,x=Object.freeze(as(f[0][1].length,Nb));for(const[v,S,I,M,D,A]of f){const C=n[SO(S)];for(let T=0;TE[T]);if(L==null||L.length===0)throw new Error("AG Charts - no keys found for scope(s): "+v.join(", "));const k=e?.(L)??L,O=d==null?void 0:Ou(k);let N=d?.get(O),w,R,F=!1;if(N==null?(w={keys:k,datumIndices:[],aggregation:[],validScopes:l},R=p++,N=[R,w],F=!0,d?.set(O,N),c.push(w.keys),h.push(w)):([R,w]=N,u=!1),D?.[T]===!0){w.validScopes===l&&(w.validScopes=new Set(l.values()));for(const E of M)w.validScopes.delete(E)}if(F&&T===R&&b)w.datumIndices=x;else{!F&&w.datumIndices===x&&(w.datumIndices=x.map(E=>[...E]));for(const E of S)(i=w.datumIndices)[E]??(i[E]=[]),w.datumIndices[E].push(T-R)}}}return{...t,type:"grouped",domain:{...t.domain,groups:c},groups:h,groupsUnique:u,optimizations:t.optimizations,[wo]:t[wo],[ea]:t[ea]}}groupBatches(t,e,i,s,n,a){const r=[],o=new Set;for(const l of t){const c=e.map((g,f)=>f).filter(g=>!o.has(g)&&i[g].has(l));if(c.length===0)continue;for(const g of c)o.add(g);const h=new Set;for(const g of c)for(const f of i[g])h.add(f);const d=s.map(g=>g.get(l)).filter(g=>g!=null),u=n?.get(l),p=a?.get(l);r.push([l,c,d,h,u,p])}return this.mergeCompatibleBatches(r)}areBatchesCompatible(t,e){const[,,i,,s,n]=t,[,,a,,r,o]=e;return i.every((l,c)=>l===a[c])&&n===o&&s===r}mergeCompatibleBatches(t){const e=[],i=new Set;for(let s=0;s0}function DO(t){return t.removedIndices.size===0&&t.totalAppendCount===0&&t.totalPrependCount>0}function MO(t){return t.removedIndices.size===0}function AO(t){return t.removedIndices.size===0&&t.totalPrependCount===0&&t.totalAppendCount===0&&t.spliceOps.every(e=>e.insertCount===0&&e.deleteCount===0)}function CO(t){return t.removedIndices.size>0&&t.totalPrependCount===0&&t.totalAppendCount===0&&t.spliceOps.every(e=>e.insertCount===0)}function TO(t){return Bu(t.removedIndices)>0}function Bu(t){if(t.size===0)return 0;const e=Array.from(t).sort((i,s)=>i-s);if(e[0]!==0)return 0;for(let i=0;i0&&t.totalPrependCount===0}var NO=class{constructor(t,e){this.indexMap=t,this.prependValues=e.prependValues,this.appendValues=e.appendValues,this.insertionValues=e.insertionValues}getRemovedIndices(){return Array.from(this.indexMap.removedIndices).sort((t,e)=>t-e)}getUpdatedIndices(){return Array.from(this.indexMap.updatedIndices).sort((t,e)=>t-e)}forEachPreservedIndex(t){const{originalLength:e,removedIndices:i,totalPrependCount:s}=this.indexMap;let n=0;const a=Array.from(i).sort((o,l)=>o-l);let r=0;for(let o=0;o0?Array.from({length:r.insertCount},function(h,d){return e(r.index+d)}):[],l=t.splice(r.index,r.deleteCount,...o);i&&l.length>0&&i(l,r)}t.length!==n&&(t.length=n)}}};import{first as kO}from"ag-charts-core";var wO=class extends vb{constructor(t={}){super(t),this.lastDirtyBandCount=0,this.lastScanRatio=0,this.statsCaptured=!1}createBand(t,e){return{startIndex:t,endIndex:e,cachedResult:void 0,isDirty:!0}}initializeBands(t){super.initializeBands(t),this.statsCaptured=!1}getBands(){return this.bands}evaluateFromData(t,e,i=!1){const s=t.reducer();for(const n of this.bands){if(i&&!n.isDirty)continue;const a=t.needsOverlap&&n.startIndex>0?Math.max(0,n.startIndex-1):n.startIndex,r=this.evaluateRange(t,s,e,a,n.endIndex);n.cachedResult=r,n.isDirty=!1}}getResult(t){const e=this.bands.map(i=>i.cachedResult);return t.combineResults(e)}evaluateRange(t,e,i,s,n){let a=t.initialValue;const{keyColumns:r,keysParam:o,rawData:l}=i,c=Math.min(n,l.length);for(let h=s;hi.isDirty),e=t.reduce((i,s)=>i+(s.endIndex-s.startIndex),0);this.lastDirtyBandCount=t.length,this.lastScanRatio=this.dataSize>0?e/this.dataSize:0,this.statsCaptured=!0}getStats(){const t=this.bands.filter(s=>!s.isDirty&&s.cachedResult!==void 0);let e,i;if(this.statsCaptured)e=this.lastDirtyBandCount,i=this.lastScanRatio;else{const s=this.bands.filter(a=>a.isDirty),n=s.reduce((a,r)=>a+(r.endIndex-r.startIndex),0);e=s.length,i=this.dataSize>0?n/this.dataSize:0}return{totalBands:this.bands.length,dirtyBands:e,dataSize:this.dataSize,scanRatio:i,cacheHits:t.length}}},Ob=class{constructor(t={}){this.bandingConfig=t}static evaluateRange(t,e,i,s,n){let a=t.initialValue;const{keyColumns:r,keysParam:o,rawData:l}=i,c=Math.min(n,l.length);for(let h=s;hr.get(i)).filter(r=>r!=null),a=n.map(()=>{});return{scopeId:i,rawData:s,keyColumns:n,keysParam:a}}},OO=class{constructor(t,e){this.ctx=t,this.reducerManager=e}isReprocessingSupported(t){if(t.type==="grouped"){if(!t.groupsUnique||this.getUniqueDataSets(t).size!==1)return!1;const n=Ro(t.scopes);if(t.invalidKeys?.get(n)?.some(r=>r))return!1}return this.ctx.aggregates.length>0||this.ctx.reducers.some(s=>s.supportsBanding!==!0||typeof s.combineResults!="function")||this.ctx.processors.some(s=>s.incrementalCalculate===void 0)||this.ctx.propertyProcessors.length>0?!1:this.ctx.groupProcessors.every(s=>s.supportsReprocessing??!1)}reprocessData(t,e,i,s,n,a){const r=performance.now(),o=this.collectScopeChanges(t,e);if(o.size===0)return t;this.commitPendingTransactions(t);const l=this.buildDefinitionProcessors(this.ctx.keys,i),c=this.buildDefinitionProcessors(this.ctx.values,i),h=this.processAllInsertions(t,o,l,c);this.processAllUpdates(t,o,l,c,h),this.updateBandsForChanges(t,o);const d=this.transformKeysArrays(t,o,h);this.transformColumnsArrays(t,o,h),this.transformInvalidityArrays(t,o,h),this.reprocessBandedReducers(t,o),t.type==="grouped"&&(this.transformGroupsArray(t,o,h),this.ctx.groupProcessors.length>0&&s(t,o)),this.invalidateSortOrdersForChanges(t,o),n(t),this.reprocessProcessors(t),t.reduced?.diff!=null&&o.size>0&&this.generateDiffMetadata(t,o,d),this.updateProcessedDataMetadata(t);const u=performance.now();t.time=u-r,t.version+=1,a(t,"reprocess");const p=Sc(o);return t.changeDescription=p.size===1?p.values().next().value:void 0,t}updateBandsForChanges(t,e){const i=t[wo];if(i.size===0)return;const s=Sc(e);for(const n of s){const{indexMap:a}=n;for(const r of i.values())r.applyIndexMap(a)}}reprocessBandedReducers(t,e){if(t.type!=="ungrouped")return;const i=this.ctx.reducers.filter(s=>s.supportsBanding&&typeof s.combineResults=="function");if(i.length!==0){t.reduced??(t.reduced={});for(const s of i){const n=this.reducerManager.evaluate(s,t,{reuseCleanBands:!0,beforeEvaluate:(a,r)=>{if(!r.scopeId)return;const o=e.get(r.scopeId);o&&a.applyIndexMap(o.indexMap)}});n!==void 0&&(t.reduced[s.property]=n)}}}collectScopeChanges(t,e){const i=new Map;for(const[s,n]of t.dataSources){const a=e?.get(n)??n.getChangeDescription();a&&i.set(s,a)}return i}commitPendingTransactions(t){const e=this.getUniqueDataSets(t);for(const i of e)i.commitPendingTransactions()}buildDefinitionProcessors(t,e){return t.map((i,s)=>({def:i,index:s,processValue:e(i)}))}processAllInsertions(t,e,i,s){const n=new Map;for(const[a,r]of e){const o=t.dataSources.get(a);if(!o)continue;const l=this.processInsertionsOnce(a,r,o,i,s);n.set(a,l)}return n}processAllUpdates(t,e,i,s,n){for(const[a,r]of e){const o=t.dataSources.get(a);if(!o)continue;const l=r.getUpdatedIndices();if(l.length===0)continue;let c=n.get(a);c||(c=new Map,n.set(a,c));for(const h of l){if(h<0||h>=o.data.length)continue;const d=this.processDatum(o,h,a,i,s);d&&c.set(h,d)}}}processInsertionsOnce(t,e,i,s,n){const a=new Map,{finalLength:r}=e.indexMap;for(const o of e.indexMap.spliceOps)if(!(o.insertCount<=0))for(let l=0;l=r)continue;const h=this.processDatum(i,c,t,s,n);h&&a.set(c,h)}return a}processDatum(t,e,i,s,n){const a=t.data[e],r=new Map,o=new Map;let l=!1,c=!1,h=!1;if(a==null||typeof a!="object")l=!0,c=!0;else{for(const{index:d,def:u,processValue:p}of s){if(!u.scopes?.includes(i))continue;const g=p(a,e,i);r.set(d,{value:g.value,valid:g.valid}),g.valid||(l=!0)}for(const{index:d,def:u,processValue:p}of n){if(!u.scopes?.includes(i))continue;const g=p(a,e,u.scopes);o.set(d,{value:g.value,valid:g.valid}),g.valid||(c=!0),g.missing&&(h=!0)}}return{keys:r,values:o,hasInvalidKey:l,hasInvalidValue:c,hasMissingValue:h}}transformArraysWithCache(t,e,i,s,n,a){for(const[r,o]of t.entries())for(const l of n(o)){const c=e.get(l);if(!c)continue;const h=s(r,l);if(!h)continue;const d=i.get(l);this.applyChangeDescWithCache(c,h,d,(u,p)=>a(u,o,r))}}transformKeysArrays(t,e,i){const s=new Map,n=o=>{let l=s.get(o);return l||(l={tuples:[]},s.set(o,l)),l},a=new WeakSet;for(const[o,l]of this.ctx.keys.entries())for(const c of l.scopes??[]){const h=e.get(c);if(!h)continue;const d=t.keys[o]?.get(c);if(!d)continue;if(a.has(d)){const f=Array.from(t.keys[o].entries()).find(([m,b])=>b===d)?.[0];f&&f!==c&&s.has(f)&&s.set(c,s.get(f));continue}a.add(d);const u=i.get(c),p=n(c);let g=0;this.applyChangeDescWithCache(h,d,u,f=>{const m=f?.keys.get(o);return m?.valid?m.value:l.invalidValue},f=>{for(const m of f)p.tuples[g]||(p.tuples[g]=new Array(this.ctx.keys.length)),p.tuples[g][o]=m,g+=1})}const r=new Map;for(const[o,{tuples:l}]of s){if(l.length===0)continue;const c=new Set;for(const h of l){const d=[];for(const[u,p]of h.entries())this.ctx.keys[u].scopes?.includes(o)&&d.push(p);d.length>0&&c.add(Ou(d))}r.set(o,c)}return r}transformColumnsArrays(t,e,i){this.transformArraysWithCache(this.ctx.values,e,i,s=>t.columns[s],s=>[Ro(s.scopes)],(s,n,a)=>{if(s){if(s.hasInvalidKey)return n.invalidValue;const r=s.values.get(a);return r?.valid?r.value:n.invalidValue}return n.invalidValue})}transformInvalidityMap(t,e,i,s){const n=new Set;for(const[a,r]of e){let o=t.get(a);if(!o){const c=i.get(a);if(c&&Array.from(c.values()).some(s))o=as(r.indexMap.originalLength,!1),t.set(a,o);else continue}if(n.has(o))continue;n.add(o);const l=i.get(a);this.applyChangeDescWithCache(r,o,l,(c,h)=>s(c))}}transformInvalidityArrays(t,e,i){t.invalidKeys&&this.transformInvalidityMap(t.invalidKeys,e,i,s=>s?.hasInvalidKey??!1),t.invalidData&&this.transformInvalidityMap(t.invalidData,e,i,s=>s?s.hasInvalidKey||s.hasInvalidValue:!1),t.missingData&&this.transformInvalidityMap(t.missingData,e,i,s=>s?.hasMissingValue??!1)}applyChangeDescWithCache(t,e,i,s,n){t.applyToArray(e,r=>{const o=i?.get(r);return s(o,r)},n);const a=t.getUpdatedIndices();if(a.length!==0)for(const r of a){if(r<0||r>=e.length)continue;const o=i?.get(r);e[r]=s(o,r)}}transformGroupsArray(t,e,i){const s=Ro(t.scopes),n=e.get(s);if(!n)return;const a=i.get(s);for(const[,o]of a??[])if(o.hasInvalidKey)throw new Error("AG Charts - reprocessing grouped data with invalid keys not supported. This typically indicates a data quality issue that requires full reprocessing.");n.applyToArray(t.groups,o=>this.createDataGroupForInsertion(o,t,s,a));const r=n.getUpdatedIndices();if(r.length>0)for(const o of r)o<0||o>=t.groups.length||(t.groups[o]=this.createDataGroupForInsertion(o,t,s,a))}createDataGroupForInsertion(t,e,i,s){const n=[];for(const d of e.keys){const u=d.get(i);u&&n.push(u[t])}const a=e.groups[0],r=()=>Object.freeze(as(e.columnScopes.length,Nb)),o=a?.datumIndices??r(),c=s?.get(t)?.hasInvalidValue??!1;let h;return c?(h=new Set(e.scopes),h.delete(i)):h=e.scopes,{keys:n,datumIndices:o,aggregation:[],validScopes:h}}generateDiffMetadata(t,e,i){const s=(n,a)=>{const r=[];for(const o of t.keys){const l=o.get(n);if(!l)return;r.push(l[a])}return r.length>0?Ou(r):void 0};for(const[n,a]of e){const r={changed:!0,added:new Set,removed:i.get(n)??new Set,updated:new Set,moved:new Set};for(const c of a.indexMap.spliceOps)if(c.insertCount>0)for(let h=0;h0)for(let c=l;c0)for(let c=0;c{if(c!==h){const d=s(n,h);d&&r.moved.add(d)}});t.reduced.diff[n]=r}}updateProcessedDataMetadata(t){let e=0;for(const s of t.dataSources.values())e=Math.max(e,s.data.length);t.input.count=e;let i=0;for(const[s,n]of t.invalidData??new Map){const a=t.invalidKeys?.get(s);for(let r=0;r{if(typeof r=="number")return r;if(r instanceof Date)return r.valueOf()};let n=s(e);const a=t.sortOrder;for(const r of i){const o=s(r);if(o===void 0)continue;if(n===void 0){n=o;continue}const l=o-n;if(l===0&&(t.isUnique=!1),t.sortOrder!==void 0){let c=0;l>0?c=1:l<0&&(c=-1),c!==0&&c!==a&&(t.sortOrder=void 0)}n=o}}updateKeySortOrdersForAppend(t,e){for(const[i,s]of t.keys.entries()){const n=t[sn].get(i);if(!n)continue;const a=Ro(s.values());if(!a||a.length<=e)continue;const r=e>0?a[e-1]:void 0,o=a.slice(e);this.updateSortOrderForAppend(n,r,o)}}invalidateSortOrdersForChanges(t,e){const i=Sc(e);let s=!0,n=!1,a=!1,r,o;for(const l of i){const{indexMap:c}=l;AO(c)||(wb(c)?(n=!0,r=c.originalLength):CO(c)||(LO(c)?(a=!0,o={originalLength:c.originalLength,removedCount:c.removedIndices.size}):s=!1))}s?n&&r!==void 0?this.updateKeySortOrdersForAppend(t,r):a&&o&&this.updateKeySortOrdersForRollingWindow(t,o):(t[sn].clear(),t[Pu].clear())}updateKeySortOrdersForRollingWindow(t,e){const{originalLength:i,removedCount:s}=e;for(const[n,a]of t.keys.entries()){const r=t[sn].get(n);if(!r)continue;const o=Ro(a.values());if(!o||o.length===0)continue;const l=i-s,c=l>0?o[l-1]:void 0,h=o.slice(l);this.updateSortOrderForAppend(r,c,h)}}invalidateCachesForChanges(t){this.markDomainRangesDirty(t[_u])}markDomainRangesDirty(t){for(const e of t.values())e.isDirty=!0}recountInvalid(t,e){if(!(!t||!e))for(const[i,s]of t){const n=s.filter(Boolean).length;n===0?(t.delete(i),e.delete(i)):e.set(i,n)}}reprocessProcessors(t){if(this.ctx.processors.length!==0){t.reduced??(t.reduced={});for(const e of this.ctx.processors){const i=t.reduced[e.property],s=e.incrementalCalculate?.(t,i)??e.calculate(t,i);t.reduced[e.property]=s}}}getUniqueDataSets(t){return new Set(t.dataSources.values())}},ta=0,ia=1,rs=2,EO=class $l{constructor(e){this.isDirty=!1;const i=e.reduce((a,r)=>Math.max(a,r.length),0),{maxLevelSize:s,buffer:n}=$l.createBuffer(i);this.maxLevelSize=s,this.buffer=n,this.dataLength=i,this.populateBuffer(e)}static computeMaxLevelSize(e){let s=1<<32-Math.clz32(e);return e===s/2&&(s=s>>>1),s}static createBuffer(e){const i=$l.computeMaxLevelSize(e),s=new Float64Array((i*2-1)*2).fill(Number.NaN);return{maxLevelSize:i,buffer:s}}populateBuffer(e){const{maxLevelSize:i,buffer:s}=this,n=i-1;for(const a of e){const r=a.length;for(let o=0;od)&&(s[c+1]=l)}}for(let a=i>>>1;a>=1;a>>>=1){const r=a-1,o=r+a<<1;let l=r<<1,c=o;for(let h=0;hf?g:f,l+=2,c+=4}}}rebuild(e){const i=e.reduce((n,a)=>Math.max(n,a.length),0);if($l.computeMaxLevelSize(i)===this.maxLevelSize)this.buffer.fill(Number.NaN);else{const{maxLevelSize:n,buffer:a}=$l.createBuffer(i);this.maxLevelSize=n,this.buffer=a}this.dataLength=i,this.populateBuffer(e)}updateValue(e,i){const{maxLevelSize:s,buffer:n}=this,a=s+e-1,r=Math.trunc(a*rs)+ta,o=Math.trunc(a*rs)+ia;n[r]=Number.NaN,n[o]=Number.NaN;for(const l of i){const c=Number(l),h=n[r],d=n[o];(!Number.isFinite(h)||cd)&&(n[o]=c)}this.propagateUp(a)}updateValues(e){for(const{index:i,values:s}of e)this.updateValue(i,s)}propagateUp(e){const{buffer:i}=this;for(;e>0;){const s=Math.trunc((e-1)/2),n=2*s+1,a=2*s+2,r=i[Math.trunc(n*rs)+ta],o=i[Math.trunc(n*rs)+ia],l=i[Math.trunc(a*rs)+ta],c=i[Math.trunc(a*rs)+ia];i[Math.trunc(s*rs)+ta]=!Number.isFinite(l)||rc?o:c,e=s}}computeRangeInto(e,i,s,n,a,r,o){const l=a+r-1;if(l=s)return o;if(a>=i&&l1&&(n=Math.trunc(n*2),r=Math.trunc(r/2),this.computeRangeInto(e,i,s,Math.trunc(n+1),a,r,o),this.computeRangeInto(e,i,s,Math.trunc(n+2),a+r,r,o));return o}rangeBetween(e,i,s){const n=s??[0,0];if(e>i)return n[0]=Number.NaN,n[1]=Number.NaN,n;const{maxLevelSize:a,buffer:r}=this;return n[0]=1/0,n[1]=-1/0,this.computeRangeInto(r,e,i,0,0,a,n),n}getRange(e){const{buffer:i}=this,s=e??[0,0];return s[0]=i[ta],s[1]=i[ia],s}get range(){const{buffer:e}=this;return[e[ta],e[ia]]}get length(){return this.dataLength}};function RO(t,e){const i=t.length;if(t.length<=1)return 1;let s=0,n=t[0];for(let a=1;athis.resolveProcessedDataIndexById(t,d)),r=n.input.count;if(i<=0&&s>=r){const d=n.domain.values;let u=1/0,p=-1/0;for(const g of a){const f=d[g];f!=null&&(f[0]p&&(p=f[1]))}return this.rangeBetweenBuffer[0]=u,this.rangeBetweenBuffer[1]=p,this.rangeBetweenBuffer}const o=a.join(":"),l=n[_u],c=a.map(d=>n.columns[d]);let h=l.get(o);return h==null?(h=new EO(c),l.set(o,h)):h.isDirty&&(h.rebuild(c),h.isDirty=!1),h.rangeBetween(i,s,this.rangeBetweenBuffer)}getSortOrder(t,e,i,s){const n=i.get(e);if(n==null||n.isDirty){const a={sortOrder:RO(t,s)};return i.set(e,a),a.sortOrder}return n.sortOrder}getKeySortOrder(t,e,i){const s=this.resolveProcessedDataIndexById(t,e),n=i.keys[s]?.get(t.id);return n?this.getSortOrder(n,s,i[sn],!0):void 0}getKeySortEntry(t,e,i){const s=this.resolveProcessedDataIndexById(t,e),n=i[sn].get(s);return n?.isDirty?void 0:n}getColumnSortOrder(t,e,i){const s=this.resolveProcessedDataIndexById(t,e),n=i.columnNeedValueOf?.[s]??!0;return this.getSortOrder(i.columns[s],s,i[Pu],n)}getDomainsByType(t,e){switch(t){case"key":return e.domain.keys;case"value":return e.domain.values;case"aggregate":return e.domain.aggValues;case"group-value-processor":return e.domain.groups;default:return null}}};import{Logger as _O,iterate as FO}from"ag-charts-core";var VO=class{constructor(t){this.ctx=t}processScopeCache(){this.ctx.scopeCache.clear();for(const t of FO(this.ctx.keys,this.ctx.values,this.ctx.aggregates))if(t.idsMap)for(const[e,i]of t.idsMap)for(const s of i)if(!this.ctx.scopeCache.has(e))this.ctx.scopeCache.set(e,new Map([[s,t]]));else{if(this.ctx.scopeCache.get(e)?.has(s))throw new Error("duplicate definition ids on the same scope are not allowed.");this.ctx.scopeCache.get(e).set(s,t)}}valueGroupIdxLookup({matchGroupIds:t}){const e=[];for(const[i,s]of this.ctx.values.entries())(!t||s.groupId&&t.includes(s.groupId))&&e.push(i);return e}valueIdxLookup(t,e){const i=t==null||t.length===0,s=typeof e=="string"?e:e.id,n=r=>{if(r.idsMap){for(const[o,l]of r.idsMap)if(t?.includes(o)&&l.has(s))return!0}return!1},a=this.ctx.values.reduce((r,o,l)=>((o.scopes==null||i&&!o.scopes.length||o.scopes.some(h=>t?.includes(h)))&&(o.property===s||o.id===s||n(o))&&r.push(l),r),[]);if(a.length===0)throw new Error(`AG Charts - configuration error, unknown property ${JSON.stringify(e)} in scope(s) ${JSON.stringify(t)}`);return a}buildAccessors(t){const e=new Map;if(this.ctx.suppressFieldDotNotation)return e;for(const i of t){if(!(i.property.includes(".")||i.property.includes("[")))continue;const n=aO(i.property);if(n==null){_O.warnOnce("Invalid property path [%s]",i.property);continue}const a=rO(n);e.set(i.property,a)}return e}},zu=class{constructor(t,e="standalone",i=!1,s){this.opts=t,this.mode=e,this.suppressFieldDotNotation=i,this.eventsHub=s,this.debug=sO.create(!0,"data-model"),this.scopeCache=new Map,this.keys=[],this.values=[],this.aggregates=[],this.groupProcessors=[],this.propertyProcessors=[],this.reducers=[],this.processors=[];let n=!0;for(const c of t.props){if(c.type==="key"&&!n)throw new Error("AG Charts - internal config error: keys must come before values.");c.type==="value"&&n&&(n=!1)}const a=({matchGroupIds:c=[]})=>{for(const h of c)if(this.values.every(d=>d.groupId!==h))throw new Error(`AG Charts - internal config error: matchGroupIds properties must match defined groups (${h}).`)},r=new Set,o=new Set;for(const c of t.props){const h=c.type==="key"?r:o;if(Eu(c)&&c.scopes)for(const d of c.scopes)h.add(d);switch(c.type){case"key":this.keys.push({...c,index:this.keys.length,missing:new Map});break;case"value":if(c.property==null)throw new Error(`AG Charts - internal config error: no properties specified for value definitions: ${JSON.stringify(c)}`);this.values.push({...c,index:this.values.length,missing:new Map});break;case"aggregate":a(c),this.aggregates.push({...c,index:this.aggregates.length});break;case"group-value-processor":a(c),this.groupProcessors.push({...c,index:this.groupProcessors.length});break;case"property-value-processor":this.propertyProcessors.push({...c,index:this.propertyProcessors.length});break;case"reducer":this.reducers.push({...c,index:this.reducers.length});break;case"processor":this.processors.push({...c,index:this.processors.length});break}}if(this.opts.groupByKeys||this.opts.groupByFn!=null){const c=new Set(o.values());for(const h of r)c.delete(h);if(c.size>0)throw new Error(`AG Charts - scopes missing key for grouping, illegal configuration: ${[...c.values()]}`)}const l={keys:this.keys,values:this.values,aggregates:this.aggregates,groupProcessors:this.groupProcessors,propertyProcessors:this.propertyProcessors,reducers:this.reducers,processors:this.processors,debug:this.debug,mode:this.mode,bandingConfig:this.opts.domainBandingConfig,suppressFieldDotNotation:this.suppressFieldDotNotation,scopeCache:this.scopeCache};this.resolvers=new PO(l),this.scopeCacheManager=new VO(l),this.domainInitializer=new lO(l),this.domainManager=new pO(l,this.domainInitializer,this.scopeCacheManager),this.reducerManager=new Ob(this.opts.domainBandingConfig),this.dataExtractor=new vO(l,this.domainManager),this.dataGrouper=new IO(l),this.aggregator=new oO(l,this.scopeCacheManager,this.resolvers),this.incrementalProcessor=new OO(l,this.reducerManager)}resolveProcessedDataDefById(t,e){return this.resolvers.resolveProcessedDataDefById(t,e)}resolveProcessedDataIndexById(t,e){return this.resolvers.resolveProcessedDataIndexById(t,e)}resolveKeysById(t,e,i){return this.resolvers.resolveKeysById(t,e,i)}hasColumnById(t,e){return this.resolvers.hasColumnById(t,e)}resolveColumnById(t,e,i){return this.resolvers.resolveColumnById(t,e,i)}resolveColumnNeedsValueOf(t,e,i){return this.resolvers.resolveColumnNeedsValueOf(t,e,i)}resolveMissingDataCount(t){return this.resolvers.resolveMissingDataCount(t)}*forEachDatum(t,e,i,s){const n=e.columnScopes.findIndex(a=>a.has(t.id));for(const a of i.datumIndices[n]??[]){const r=this.resolvers.resolveAbsoluteIndex(s,a);yield e.columns[n][r]}}getUniqueDataSets(t){return new Set(t.dataSources.values())}*forEachGroupDatum(t,e){const i=e.columnScopes.findIndex(a=>a.has(t.id)),s={groupIndex:0,columnIndex:i},n=[];for(const a of e.groups){s.group=a;for(const r of a.datumIndices[i]??n)s.datumIndex=this.resolvers.resolveAbsoluteIndex(s.groupIndex,r),yield s;s.groupIndex++}}getDomain(t,e,i,s){const n=this.resolvers.getDomain(t,e,i,s);if(i==="key"&&n.length>0){const a=this.getKeySortMetadata(t,e,s);return{domain:n,sortMetadata:a}}return{domain:n}}getDomainBetweenRange(t,e,[i,s],n){return this.resolvers.getDomainBetweenRange(t,e,[i,s],n)}getKeySortOrder(t,e,i){return this.resolvers.getKeySortOrder(t,e,i)}getColumnSortOrder(t,e,i){return this.resolvers.getColumnSortOrder(t,e,i)}getKeySortMetadata(t,e,i){const s=this.resolvers.getKeySortEntry(t,e,i);if(s?.sortOrder!=null)return{sortOrder:s.sortOrder,isUnique:s.isUnique}}processData(t){const{opts:{groupByKeys:e,groupByFn:i},aggregates:s,groupProcessors:n,reducers:a,processors:r,propertyProcessors:o}=this,l=performance.now();if(e&&this.keys.length===0)return;let c=this.extractData(t);e?c=this.dataGrouper.groupData(c):i&&(c=this.dataGrouper.groupData(c,i(c))),n.length>0&&c.type==="grouped"&&this.aggregator.postProcessGroups(c),s.length>0&&c.type==="ungrouped"?this.aggregator.aggregateUngroupedData(c):s.length>0&&c.type==="grouped"&&this.aggregator.aggregateGroupedData(c),o.length>0&&this.postProcessProperties(c),a.length>0&&this.reduceData(c),r.length>0&&this.postProcessData(c),this.warnDataMissingProperties(t);const h=performance.now();return c.time=h-l,c.version+=1,this.collectOptimizationMetadata(c,"full-process"),this.debug.check()&&BO(c),this.processScopeCache(),c}isReprocessingSupported(t){return this.incrementalProcessor.isReprocessingSupported(t)}reprocessData(t,e){if(!this.isReprocessingSupported(t)){this.debug.check()&&this.debug("Falling back to full reprocessing - incremental not supported for current configuration");const a=this.getUniqueDataSets(t);for(const r of a)r.commitPendingTransactions();return this.processData(t.dataSources)}const{getProcessValue:i}=this.initDataDomainProcessor("skip"),s=this.incrementalProcessor.reprocessData(t,e,i,this.reprocessGroupProcessors.bind(this),this.recomputeDomains.bind(this),this.collectOptimizationMetadata.bind(this)),{diff:n}=s.reduced??{};return n&&this.eventsHub?.emit("datamodel:diff",{diff:n}),s}recomputeDomains(t){this.domainManager.recomputeDomains(t)}warnDataMissingProperties(t){this.dataExtractor.warnDataMissingProperties(t)}processScopeCache(){this.scopeCacheManager.processScopeCache()}valueGroupIdxLookup(t){return this.scopeCacheManager.valueGroupIdxLookup(t)}valueIdxLookup(t,e){return this.scopeCacheManager.valueIdxLookup(t,e)}extractData(t){return this.dataExtractor.extractData(t)}reprocessGroupProcessors(t,e){const{groupProcessors:i}=this,{columns:s}=t;for(const a of i)if(!a.supportsReprocessing)throw new Error("AG Charts - attempted to reprocess group processor that does not support reprocessing. This is an internal error that should not occur.");const n=Sc(e);for(const a of i){const r=this.valueGroupIdxLookup(a),o=a.adjust()();for(const l of n){const{indexMap:c}=l;for(const h of c.spliceOps)if(h.insertCount>0)for(let d=0;do.get(s)).filter(o=>o!=null),r=a.map(()=>{});return Ob.evaluateRange(t,i,{rawData:n,keyColumns:a,keysParam:r},0,n.length)}postProcessData(t){t.reduced??(t.reduced={});for(const i of this.processors)t.reduced[i.property]=i.calculate(t,t.reduced[i.property]);const{diff:e}=t.reduced;e&&this.eventsHub?.emit("datamodel:diff",{diff:e})}initDataDomainProcessor(t){return this.domainManager.initDataDomainProcessor(t)}collectOptimizationMetadata(t,e){const i=t.optimizations?.domainBanding,s=t[ea];this.reducers.length>0&&s&&this.collectReducerBandingMetadata(t,s);const n=t.optimizations?.reducerBanding;t.optimizations={performance:{processingTime:t.time,pathTaken:e},...i&&{domainBanding:i},...n&&{reducerBanding:n}};const a=this.isReprocessingSupported(t),r=e==="reprocess";let o;if(!a){const l=[];if(t.type==="grouped"){t.groupsUnique||l.push("groupsUnique=false"),this.getUniqueDataSets(t).size!==1&&l.push("multiple data sources");const h=Mb(t.scopes);t.invalidKeys?.get(h)?.some(u=>u)&&l.push("has invalid keys")}this.aggregates.length>0&&l.push("has aggregates"),this.reducers.filter(c=>!c.supportsBanding).length>0&&l.push("has reducers"),this.processors.filter(c=>c.incrementalCalculate===void 0).length>0&&l.push("has processors"),this.propertyProcessors.length>0&&l.push("has property processors"),o=l.length>0?l.join(", "):void 0}if(t.optimizations.reprocessing={applied:r,reason:o},t.type==="grouped"){let l=0;const c=t.groups[0];if(c){const h=c.datumIndices;for(const d of t.groups)d.datumIndices===h&&l++}t.optimizations.sharedDatumIndices={applied:l>0,sharedGroupCount:l,totalGroupCount:t.groups.length}}}collectReducerBandingMetadata(t,e){if(this.reducers.length===0)return;t.optimizations??(t.optimizations={});const i=[];for(const s of this.reducers){const n=e.get(s.property),a=this.shouldUseReducerBanding(s,t)&&n!=null;let r;a||(s.supportsBanding!==!0?r="reducer does not support banding":t.type!=="ungrouped"?r="grouped data not supported":s.combineResults===void 0?r="missing combineResults function":r="banding not applied");let o;a&&n&&(o=n.getStats()),i.push({property:String(s.property),applied:a,reason:r,stats:o})}t.optimizations.reducerBanding={reducers:i}}buildAccessors(t){return this.scopeCacheManager.buildAccessors(t)}};function BO(t){const e=(i,s)=>{s.length>0&&(Pi.log(`DataModel.processData() - ${i}`),Pi.table(s))};if(Pi.log("DataModel.processData() - processedData",t),e("Key Domains",t.domain.keys),e("Value Domains",t.domain.values),e("Aggregate Domains",t.domain.aggValues??[]),t.optimizations){Pi.log("DataModel.processData() - Optimization Summary");const i=t.optimizations;if(i.performance&&Pi.log(` Performance: ${i.performance.processingTime.toFixed(2)}ms (${i.performance.pathTaken})`),i.reprocessing){const s=i.reprocessing.applied?"\u2713":"\u2717",n=i.reprocessing.reason?` (${i.reprocessing.reason})`:"";Pi.log(` Reprocessing: ${s}${n}`)}if(i.domainBanding){const s=i.domainBanding.keyDefs.filter(o=>o.applied),n=i.domainBanding.valueDefs.filter(o=>o.applied),a=s.length+n.length,r=i.domainBanding.keyDefs.length+i.domainBanding.valueDefs.length;if(a>0){Pi.log(` Domain Banding: \u2713 (${a}/${r} definitions)`);for(const o of[...s,...n])if(o.stats){const l=(o.stats.scanRatio*100).toFixed(1);Pi.log(` ${o.property}: scanned ${o.stats.dirtyBands}/${o.stats.totalBands} bands (${l}%)`)}}else{const o=[...i.domainBanding.keyDefs.filter(c=>!c.applied).map(c=>c.reason),...i.domainBanding.valueDefs.filter(c=>!c.applied).map(c=>c.reason)],l=[...new Set(o)].join(", ");Pi.log(` Domain Banding: \u2717 (${l})`)}}if(i.sharedDatumIndices){const s=i.sharedDatumIndices.applied?"\u2713":"\u2717",n=`${i.sharedDatumIndices.sharedGroupCount}/${i.sharedDatumIndices.totalGroupCount}`;Pi.log(` Shared DatumIndices: ${s} (${n} groups)`)}if(i.batchMerging){const s=(i.batchMerging.mergeRatio*100).toFixed(0),n=`${i.batchMerging.originalBatchCount} \u2192 ${i.batchMerging.mergedBatchCount}`;Pi.log(` Batch Merging: ${n} (${s}% reduction)`)}}}var Eb=1e3;function Rb(t,e,i){const s=t.filter(n=>typeof n=="number"&&Number.isFinite(n));return s.length>0?i(s):e}function Mi(t){return t.input.count<=Eb}function Pb(t){return t!=null&&Gw(t)}function zO(t){return t!=null}function GO(t){return!0}function _b(t,e){switch(t){case"number":case"log":case"time":case"unit-time":case"ordinal-time":case"color":return Pb;default:return e?GO:zO}}function Fb(t){switch(t){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function nn(t,e,i={}){const s=i.allowNullKey??!1;return{property:t,type:"key",valueType:Fb(e),validation:i.validation??_b(e,s),...i}}function ye(t,e,i={}){const s=i.allowNullKey??!1;return{property:t,type:"value",valueType:Fb(e),validation:i.validation??_b(e,s),...i}}function UO(t,e={}){return{property:t,type:"value",valueType:"range",missingValue:1,processor:function(){return function(){return 1}},...e}}var HO=function(t){return t};function Vb(...t){const e=t.filter(i=>i!=null);return e.length===0?()=>HO:e.length===1?e[0]:function(){const s=e.map(n=>n());return function(a,r){return s.reduce((o,l)=>l(o,r),a)}}}function jO(t,e={}){const{min:i=-1/0,max:s=1/0,processor:n,...a}=e;return{type:"value",property:t,valueType:"range",validation:Pb,processor:Vb(n,function(){return function(l){return fb(l)?zw(i,l,s):l}}),...a}}function Gu(t,e,i={}){const{onlyPositive:s,processor:n,...a}=i;return{...ye(t,e,a),processor:Vb(n,tO(s))}}function WO(t,e,i={}){return{...ye(t,e,i),processor:iO()}}function sa(t,e,i,s){return[ye(t,s,i),iE(i.groupId,e,i.separateNegative),...i.rangeId==null?[]:[Qw(i.rangeId,i.groupId)]]}var Bb={type:"reducer",property:"smallestKeyInterval",initialValue:1/0,reducer(){let t=Number.NaN;return function(i,s){const n=s[0],a=typeof n=="number"?n:Number(n);if(!Number.isFinite(a))return i;const r=t;if(t=a,!Number.isFinite(t))return i;const o=Math.abs(a-r),l=i??1/0;return o>0&&oMath.min(...e))},needsOverlap:!0},zb={type:"reducer",property:"largestKeyInterval",initialValue:-1/0,reducer(){let t=Number.NaN;return function(i,s){const n=s[0],a=typeof n=="number"?n:Number(n);if(!Number.isFinite(a))return i;const r=t;if(t=a,!Number.isFinite(t))return i;const o=Math.abs(a-r),l=i??-1/0;return o>0&&o>l?o:l}},supportsBanding:!0,combineResults(t){return Rb(t,-1/0,e=>Math.max(...e))},needsOverlap:!0},YO={type:"processor",property:"sortedGroupDomain",calculate:function({domain:{groups:e}}){return e?.slice().sort((i,s)=>{for(let n=0;n{if(s===0)return 0;const n=(i??0)*t/s;return n>=0?Math.min(t,n):Math.max(-t,n)};return()=>()=>(i,s,n,a)=>{const r=KO(i,s,n,a);for(const o of s){const l=n.datumIndices[o];if(l!=null)for(const c of l){const h=a+c,d=i[o],u=d[h];if(u==null){d[h]=void 0;continue}d[h]=e(u,r)}}}}function KO(t,e,i,s){const n=[0,0];for(const a of e){const r=t[a],o=i.datumIndices[a];if(o!=null)for(const l of o){const c=s+l,h=r[c];if(h==null)continue;const d=typeof h=="number"?h:Math.max(...h.map(p=>p??0)),u=d<0?0:1;u===0?n[u]=Math.min(n[u],d):n[u]=Math.max(n[u],d)}}return Math.max(Math.abs(n[0]),n[1])}function Mc(t,e){return{type:"group-value-processor",matchGroupIds:t,adjust:No({normaliseTo:e},$O)}}function ZO({normaliseTo:t,zeroDomain:e,rangeMin:i,rangeMax:s}){const n=t[1]-t[0],a=function(o,l,c){const h=t[0]+(o-l)/c*n;return c===0?e:h>=t[1]?t[1]:hh.scopes.includes(t)&&h.id===e),o=n.defs.values.findIndex(h=>h.scopes.includes(t)&&h.id===i),l=n.columns[r],c=n.columns[o];if(l.length!==c.length)return!0;for(let h=0;hMath.abs(l[h]))return!0;return!1}}function qO(t,e,i){return{type:"processor",property:"filteredValueExceedUnfiltered",calculate:No([t,e,i],XO)}}var Po=1,Ac=2;function JO(t,e,i){let s=Po|Ac;if(t.valueType==="category")return e.lengthr)&&(s&=~Ac),Number.isFinite(r)&&n===r&&(s&=~Po),n=r}return s}function QO(t){return function(i,s){if(!Mi(i))return;const{keys:n,values:a}=i.defs,{input:r,domain:{values:o},columns:l}=i;let c=!0,h=!0;if(r.count!==0){const d=i[sn];for(let u=0;(c||h)&&u0){let u=Po|Ac;for(let p=0;u!==0&&px.get(t)),h=s.keys.map(x=>x.get(t)),d=e.columns,u=s.columns,p=sE(t,e,s);if(p==null)return n;const g=Math.max(e.input.count,s.input.count),f=s.defs.keys.some(x=>x.allowNullKey===!0);for(let x=0;x0||o.size>0||l.size>0,added:new Set(r.keys()),updated:new Set(o.keys()),removed:new Set(l.keys()),moved:new Set(a.keys())};return{...n,[t]:b}}}}function yt(...t){if(t.length===1){const e=mb(t[0]);if(e===null)return ku;if(e===void 0)return wu;if(typeof e=="boolean"||typeof e=="number"||typeof e=="string")return e}return t.map(e=>{const i=mb(e);return i===null?ku:i===void 0?wu:i}).join("___")}import{Debug as nE,Logger as aE}from"ag-charts-core";var Ub=class{constructor(t){this.maxAnimationTime=t,this.debug=nE.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(To.map(e=>[e,[]])),this.skipAnimations=!1,this.animationTimeConsumed=0,this.isReady=!1}get size(){return this.controllers.size}get consumedTimeMs(){return this.animationTimeConsumed}isActive(){return this.controllers.size>0}getActiveControllers(){return this.phases.get(To[this.currentPhase])??[]}checkOverlappingId(t){t!=null&&this.controllers.has(t)&&(this.controllers.get(t).stop(),this.debug(`Skipping animation batch due to update of existing animation: ${t}`),this.skip())}addAnimation(t){if(t.isComplete)return;if(To.indexOf(t.phase)=0&&e?.splice(i,1)}progress(t){if(!this.isReady)return;let e=t===0?.01:t;const i=()=>{const c=To[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:c,phaseMeta:Lo[c]}};let{phase:s,phaseControllers:n,phaseMeta:a}=i();const r=()=>To[this.currentPhase]==null,o=()=>{for({phase:s,phaseControllers:n,phaseMeta:a}=i();!r()&&n.length===0;)this.currentPhase++,{phase:s,phaseControllers:n,phaseMeta:a}=i(),this.debug(`AnimationBatch - phase changing to ${s}`,{unusedTime:e},n)},l=this.controllers.size;this.debug(`AnimationBatch - ${t}ms; phase ${s} with ${n?.length} of ${l}`);do{const c=e,h=a.skipIfNoEarlierAnimations&&this.animationTimeConsumed===0;let d=0;for(const u of n)h?u.stop():e=Math.min(u.update(c),e),u.isComplete&&(d++,this.removeAnimation(u));this.animationTimeConsumed+=c-e,this.debug(`AnimationBatch - updated ${n.length} controllers; ${d} completed`,n),this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`),o()}while(e>0&&!r());this.animationTimeConsumed>this.maxAnimationTime&&(this.debug("Animation batch exceeded max animation time, skipping",[...this.controllers]),this.stop())}ready(){if(this.isReady)return;this.isReady=!0,this.debug(`AnimationBatch - ready; skipped: ${this.skipAnimations}`,[...this.controllers]);let t=!0;for(const[,e]of this.controllers)if(e.duration>0&&Lo[e.phase].skipIfNoEarlierAnimations!==!0){t=!1;break}if(!t)for(const[,e]of this.controllers)e.autoplay&&e.play(!0)}skip(t=!0){if(this.skipAnimations===!1&&t===!0){for(const e of this.controllers.values())e.stop();this.controllers.clear()}this.skipAnimations=t}play(){for(const t of this.controllers.values())t.play()}stop(){for(const t of this.controllers.values())try{t.stop(),this.removeAnimation(t)}catch(e){aE.error("Error during animation stop",e)}this.dispatchStopped()}stopByAnimationId(t){if(t!=null&&this.controllers.has(t)){const e=this.controllers.get(t);e&&(e.stop(),this.removeAnimation(e))}}stopByAnimationGroupId(t){for(const e of this.controllers.values())e.groupId===t&&this.stopByAnimationId(e.id)}dispatchStopped(){for(const t of this.stoppedCbs)t();this.stoppedCbs.clear()}isSkipped(){return this.skipAnimations}getRemainingTime(t){if(!this.isActive())return 0;let e=0;for(const[i,s]of this.phases)s.length!==0&&(t!=null&&t!==i||(e+=Math.max(...s.map(n=>n.isComplete?0:n.delay+n.duration-(n.elapsed??0)))));return e}destroy(){this.stop(),this.controllers.clear()}};function Hb(t){return t==null?!0:!Number.isNaN(t)&&t>=0&&t<=2}var rE=class{constructor(t,e,i){this.agDocument=t,this.interactionManager=e,this.chartUpdateMutex=i,this.defaultDuration=1e3,this.maxAnimatableItems=Eb,this.batch=new Ub(this.defaultDuration*1.5),this.debug=Ow.create(!0,"animation"),this.events=new Ew,this.rafAvailable=typeof requestAnimationFrame<"u",this.isPlaying=!0,this.requestId=null,this.skipAnimations=!0,this.currentAnonymousAnimationId=0,this.cumulativeAnimationTime=0}addListener(t,e){return this.events.on(t,e)}animate(t){const e=this.batch;try{e.checkOverlappingId(t.id)}catch(o){this.failsafeOnError(o);return}let{id:i}=t;i==null&&(i=`__${this.currentAnonymousAnimationId}`,this.currentAnonymousAnimationId+=1);const s=this.isSkipped()&&!t.forceAnimation||t.phase==="none";s&&this.debug("AnimationManager - skipping animation");const{delay:n,duration:a}=t;if(!Hb(n))throw new Error(`Animation delay of ${n} is unsupported (${i})`);if(!Hb(a))throw new Error(`Animation duration of ${a} is unsupported (${i})`);const r=new Bw({...t,id:i,skip:s,autoplay:this.isPlaying?t.autoplay:!1,phase:t.phase,defaultDuration:this.defaultDuration});if(!this.forceTimeJump(r,this.defaultDuration))return this.batch.addAnimation(r),r}play(){if(!this.isPlaying){this.isPlaying=!0,this.debug("AnimationManager.play()");try{this.batch.play()}catch(t){this.failsafeOnError(t)}this.requestAnimation()}}stop(){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.stop()"),this.batch.stop()}stopByAnimationId(t){try{this.batch.stopByAnimationId(t)}catch(e){this.failsafeOnError(e)}}stopByAnimationGroupId(t){try{this.batch.stopByAnimationGroupId(t)}catch(e){this.failsafeOnError(e)}}reset(){this.isPlaying?(this.stop(),this.play()):this.stop()}skip(t=!0){this.skipAnimations=t}isSkipped(){return!this.rafAvailable||this.skipAnimations||this.batch.isSkipped()}isActive(){return this.isPlaying&&this.batch.isActive()}getRemainingTime(t){return this.batch.getRemainingTime(t)}getCumulativeAnimationTime(){return this.cumulativeAnimationTime}skipCurrentBatch(){this.debug.check()&&this.debug("AnimationManager - skipCurrentBatch()",{stack:new Error("Stack trace for animation skip tracking").stack}),this.batch.skip()}isSkippingFrames(){return!0}scheduleAnimationFrame(t){this.requestId=this.agDocument.requestAnimationFrame(e=>{t(e).catch(i=>ub.error(i))})}forceTimeJump(t,e){return!1}requestAnimation(){if(!this.rafAvailable||!this.batch.isActive()||this.requestId!==null)return;let t;const e=async i=>{await this.debug.group("AnimationManager.onAnimationFrame()",async()=>{const s=()=>{const n=i-(t??i);t=i,this.debug("AnimationManager",{controllersCount:this.batch.size,deltaTime:n}),this.interactionManager.pushState(4);try{this.batch.progress(n),this.cumulativeAnimationTime+=n}catch(a){this.failsafeOnError(a)}this.events.emit("animation-frame",{type:"animation-frame",deltaMs:n})};this.isSkippingFrames()?await this.chartUpdateMutex.acquireImmediately(s):await this.chartUpdateMutex.acquire(s),this.batch.isActive()?this.scheduleAnimationFrame(e):(this.batch.stop(),this.events.emit("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}))})};this.events.emit("animation-start",{type:"animation-start",deltaMs:0}),this.scheduleAnimationFrame(e)}cancelAnimation(){this.requestId!==null&&(this.agDocument.cancelAnimationFrame(this.requestId),this.events.emit("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}),this.requestId=null,this.startBatch())}failsafeOnError(t,e=!0){ub.error("Error during animation, skipping animations",t),e&&this.cancelAnimation()}startBatch(t){this.debug(`AnimationManager - startBatch() with skipAnimations=${t}.`),this.reset(),this.batch.destroy(),this.batch=new Ub(this.defaultDuration*1.5),t===!0&&this.batch.skip()}endBatch(){this.batch.isActive()?(this.batch.ready(),this.requestAnimation()):(this.interactionManager.popState(4),this.batch.isSkipped()&&this.batch.skip(!1))}onBatchStop(t){this.batch.stoppedCbs.add(t)}destroy(){this.stop(),this.events.clear()}},oE=class{constructor(){this.download={type:"action",showOn:"always",label:"contextMenuDownload",enabled:!0,action:void 0,items:void 0},this["zoom-to-cursor"]={type:"action",showOn:"series-area",label:"contextMenuZoomToCursor",enabled:!0,action:void 0,items:void 0},this["pan-to-cursor"]={type:"action",showOn:"series-area",label:"contextMenuPanToCursor",enabled:!0,action:void 0,items:void 0},this["reset-zoom"]={type:"action",showOn:"series-area",label:"contextMenuResetZoom",enabled:!0,action:void 0,items:void 0},this["toggle-series-visibility"]={type:"action",showOn:"legend-item",label:"contextMenuToggleSeriesVisibility",enabled:!0,action:void 0,items:void 0},this["toggle-other-series"]={type:"action",showOn:"legend-item",label:"contextMenuToggleOtherSeries",enabled:!0,action:void 0,items:void 0},this.separator={type:"separator",showOn:"always",label:"separator",enabled:!0,action:void 0,items:void 0}}},lE=class{constructor(){this.defaults=["download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series"]}},cE=class{constructor(){this.items=new oE,this.lists=new lE}},jb=class{constructor(t){this.eventsHub=t,this.builtins=new cE,this.hiddenActions=new Set,this.toggle("zoom-to-cursor","hide"),this.toggle("pan-to-cursor","hide"),this.toggle("reset-zoom","hide")}static check(t,e){return e.showOn==t}static checkCallback(t,e,i){return t===e}dispatchContext(t,e,i,s){const{widgetEvent:n}=e;if(n.sourceEvent.defaultPrevented)return;const a=s?.x??e.canvasX,r=s?.y??e.canvasY,o={showOn:t,x:a,y:r,context:i,widgetEvent:n};this.eventsHub.emit("context-menu:setup",o),this.eventsHub.emit("context-menu:complete",o)}isVisible(t){return!this.hiddenActions.has(t)}toggle(t,e){switch(e??(e=this.isVisible(t)?"hide":"show"),e){case"show":this.hiddenActions.delete(t);break;case"hide":this.hiddenActions.add(t);break}}};import{objectsEqual as hE}from"ag-charts-core";var Wb=class CC{constructor(e){this.eventsHub=e,this.highlightStates=new pc,this.pendingUnhighlights=new Map,this.unhighlightDelay=100,this.highlightInViewport=!0}updateHighlight(e,i,s=!1,n){const a=this.getActiveHighlight();if(i==null&&s&&this.unhighlightDelay>0){if(!this.pendingUnhighlights.has(e)){const o=ru(()=>{this.applyPendingUnhighlight(e)});this.pendingUnhighlights.set(e,{scheduler:o}),o.schedule(this.unhighlightDelay)}return}const r=this.pendingUnhighlights.get(e);r&&(r.scheduler.cancel(),this.pendingUnhighlights.delete(e)),i?this.highlightStates.set(e,i):this.highlightStates.delete(e),this.maybeEmitChange(e,a,n)}maybeEmitChange(e,i,s){const n=s??!0,a=this.getActiveHighlight();if(!this.isEqual(a,i)||this.highlightInViewport!==n){const r=a?.series?.isHighlightEnabled()===!1;this.highlightInViewport=n,this.eventsHub.emit(CC.HIGHLIGHT_CHANGE_EVENT,{callerId:e,currentHighlight:a,previousHighlight:i,highlightSuppressed:r,highlightInViewport:n})}}applyPendingUnhighlight(e){if(!this.pendingUnhighlights.has(e))return;this.pendingUnhighlights.delete(e);const i=this.getActiveHighlight();this.highlightStates.delete(e),this.maybeEmitChange(e,i,!0)}getActiveHighlight(){return this.highlightStates.stateValue()}destroy(){for(const{scheduler:e}of this.pendingUnhighlights.values())e.cancel();this.pendingUnhighlights.clear()}isEqual(e,i){return e===i?!0:e!=null&&i!=null&&e.series===i.series&&this.idsMatch(e,i)&&this.pointsMatch(e,i)&&e.datum===i.datum}idsMatch(e,i){return e.itemId!=null&&i.itemId!=null&&e.itemId===i.itemId||e.datumIndex!=null&&i.datumIndex!=null&&hE(e.datumIndex,i.datumIndex)}pointsMatch(e,i){return this.pointsAreEqual(e.point,i.point)&&this.pointsAreEqual(e.midPoint,i.midPoint)&&this.pointsAreEqual(e.xBar?.lowerPoint,i.xBar?.lowerPoint)&&this.pointsAreEqual(e.xBar?.upperPoint,i.xBar?.upperPoint)&&this.pointsAreEqual(e.yBar?.lowerPoint,i.yBar?.lowerPoint)&&this.pointsAreEqual(e.yBar?.upperPoint,i.yBar?.upperPoint)}pointsAreEqual(e,i){return e===i||e!==void 0&&i!==void 0&&e.x===i.x&&e.y===i.y}};Wb.HIGHLIGHT_CHANGE_EVENT="highlight:change";var Yb=Wb;import{CleanupRegistry as dE,objectsEqual as $b}from"ag-charts-core";import{Color as uE,findMaxIndex as pE,findMinIndex as gE,isString as fE}from"ag-charts-core";import{BaseProperties as na,PropertiesArray as mE,Property as _,mergeDefaults as yE}from"ag-charts-core";var Kb=(t=>(t[t.None=0]="None",t[t.Item=1]="Item",t[t.Series=2]="Series",t[t.OtherSeries=3]="OtherSeries",t[t.OtherItem=4]="OtherItem",t))(Kb||{}),ju=[0,1,2,3,4];function bE(t){switch(t){case 1:return["highlightedItem","highlightedSeries"];case 4:return["unhighlightedItem","highlightedSeries"];case 2:return["highlightedSeries"];case 3:return["unhighlightedSeries"];case 0:return[]}}function ur(t){const e=i=>i;switch(t){case 1:return"highlighted-item";case 4:return"unhighlighted-item";case 2:return"highlighted-series";case 3:return"unhighlighted-series";case 0:return"none";default:return e(t)}}var an=class extends na{};y([_],an.prototype,"fill",2),y([_],an.prototype,"fillOpacity",2),y([_],an.prototype,"stroke",2),y([_],an.prototype,"strokeWidth",2),y([_],an.prototype,"strokeOpacity",2),y([_],an.prototype,"lineDash",2),y([_],an.prototype,"lineDashOffset",2);var Cs=class extends na{constructor(){super(...arguments),this.enabled=!0,this.range="tooltip",this.bringToFront=!0,this.highlightedItem={},this.unhighlightedItem={},this.highlightedSeries={},this.unhighlightedSeries={}}getStyle(t){const e=bE(t);return e.length===0?{}:yE(...e.map(i=>this[i]))}};y([_],Cs.prototype,"enabled",2),y([_],Cs.prototype,"range",2),y([_],Cs.prototype,"bringToFront",2),y([_],Cs.prototype,"highlightedItem",2),y([_],Cs.prototype,"unhighlightedItem",2),y([_],Cs.prototype,"highlightedSeries",2),y([_],Cs.prototype,"unhighlightedSeries",2);var os=class extends na{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};y([_],os.prototype,"start",2),y([_],os.prototype,"stop",2),y([_],os.prototype,"fill",2),y([_],os.prototype,"fillOpacity",2),y([_],os.prototype,"stroke",2),y([_],os.prototype,"strokeWidth",2),y([_],os.prototype,"strokeOpacity",2),y([_],os.prototype,"lineDash",2),y([_],os.prototype,"lineDashOffset",2);var Tc=class{constructor(){this.key="x",this.segments=new mE(os)}};y([_],Tc.prototype,"enabled",2),y([_],Tc.prototype,"key",2),y([_],Tc.prototype,"segments",2);var rn=class extends na{constructor(){super(...arguments),this.type="gradient",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.reverse=!1,this.colorSpace="rgb"}};y([_],rn.prototype,"type",2),y([_],rn.prototype,"colorStops",2),y([_],rn.prototype,"bounds",2),y([_],rn.prototype,"gradient",2),y([_],rn.prototype,"rotation",2),y([_],rn.prototype,"reverse",2),y([_],rn.prototype,"colorSpace",2);var je=class extends na{constructor(){super(...arguments),this.type="pattern",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.scale=1,this.reverse=!1,this.pattern="forward-slanted-lines",this.width=26,this.height=26,this.padding=6,this.fill="black",this.fillOpacity=1,this.backgroundFill="white",this.backgroundFillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0}};y([_],je.prototype,"type",2),y([_],je.prototype,"colorStops",2),y([_],je.prototype,"bounds",2),y([_],je.prototype,"gradient",2),y([_],je.prototype,"rotation",2),y([_],je.prototype,"scale",2),y([_],je.prototype,"reverse",2),y([_],je.prototype,"path",2),y([_],je.prototype,"pattern",2),y([_],je.prototype,"width",2),y([_],je.prototype,"height",2),y([_],je.prototype,"padding",2),y([_],je.prototype,"fill",2),y([_],je.prototype,"fillOpacity",2),y([_],je.prototype,"backgroundFill",2),y([_],je.prototype,"backgroundFillOpacity",2),y([_],je.prototype,"stroke",2),y([_],je.prototype,"strokeOpacity",2),y([_],je.prototype,"strokeWidth",2);var Ts=class extends na{constructor(){super(...arguments),this.type="image",this.url="",this.rotation=0,this.scale=1,this.backgroundFill="black",this.backgroundFillOpacity=1,this.repeat="no-repeat",this.fit="contain"}};y([_],Ts.prototype,"type",2),y([_],Ts.prototype,"url",2),y([_],Ts.prototype,"rotation",2),y([_],Ts.prototype,"scale",2),y([_],Ts.prototype,"backgroundFill",2),y([_],Ts.prototype,"backgroundFillOpacity",2),y([_],Ts.prototype,"repeat",2),y([_],Ts.prototype,"fit",2);var _i=class extends na{constructor(){super(...arguments),this.visible=!0,this.focusPriority=1/0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlight=new Cs}handleUnknownProperties(t,e){"context"in e&&(this.context=e.context,t.delete("context")),"allowNullKeys"in e&&(this.allowNullKeys=e.allowNullKeys,t.delete("allowNullKeys"))}};y([_],_i.prototype,"id",2),y([_],_i.prototype,"visible",2),y([_],_i.prototype,"focusPriority",2),y([_],_i.prototype,"showInLegend",2),y([_],_i.prototype,"cursor",2),y([_],_i.prototype,"nodeClickRange",2),y([_],_i.prototype,"highlight",2);function Zb(t,e){if(e.length===0)return[!1,!1];const i=e[0],s=e.at(-1);if(typeof i=="string"||i===null||i===void 0)return[t===i,t===s];if(t==null)return[!1,!1];const n=t.valueOf();if(i==null||s==null)return[!1,!1];let a=i.valueOf(),r=s.valueOf();return a>r&&([a,r]=[r,a]),[n===a,n===r]}function Wu(t,e,i,s,n,a){const[r,o]=Zb(e,a),[l,c]=Zb(t,n);return{xKey:i,yKey:s,xValue:t,yValue:e,first:l,last:c,min:r,max:o}}function Fo(t,e,[i,s],n){let a=gE(0,e-1,o=>{const l=t===1?o:e-o,c=n(l)?.[1]??Number.NaN;return!Number.isFinite(c)||c>=i})??0,r=pE(0,e-1,o=>{const l=t===1?o:e-o,c=n(l)?.[0]??Number.NaN;return!Number.isFinite(c)||c<=s})??e-1;return t===-1&&([a,r]=[e-r,e-a]),a=Math.max(a,0),r=Math.min(r+1,e),[a,r]}function Yu(t,e,i){if(i){const{x:n,y:a,width:r,height:o}=i;return{canvasX:n+r/2,canvasY:a+o/2}}const s=e.yBar?.upperPoint??e.midPoint??t.datumMidPoint?.(e);if(s){const{x:n,y:a}=fe.toCanvasPoint(t.contentGroup,s.x,s.y);return{canvasX:Math.round(n),canvasY:Math.round(a)}}}function xE(t,e,i,s,n){let a=-1,r=0,o=0,l=!1;for(;r=0&&(o+=1),l&&o<0&&(o-=1),ce){l=!0;continue}n(c)&&(r+=1)}return r}function $u(t){const e={};for(const i of ju)e[i]=t(void 0,!1,i);return e}function vE(t,...e){const i={};for(const s of e??["default"])for(const n of ju){const a=i[s]??(i[s]={});a[n]=t(void 0,!1,n,s)}return i}function Ku(t){return(t?.opacity??1)<1||(t?.fillOpacity??1)<1||(t?.strokeOpacity??1)<1}var Xb=new Map;function SE(t){if(t==null)return!1;const e=t.fill;if(!fE(e))return!1;const i=e.trim(),s=i.toLowerCase();if(s==="transparent"||s==="none")return!1;let n=Xb.get(i);if(n==null){try{n=uE.fromString(i).a===1}catch{n=!1}Xb.set(i,n)}return n}function IE(t,e){return t!=="cutout"?t:SE(e)?"cutout":"overlay"}function qb(t,e,i){for(const s of e??[])switch(typeof t){case"string":if(s.itemId===t)return s;if(s.itemId===void 0&&i!==void 0){const n=s.datum?.[i];if(n!=null&&String(n)===t)return s}break;case"number":if(s.datumIndex===t||s.itemId===void 0&&i!==void 0&&s.datum?.[i]===t)return s;break;default:return t}}var Lc=class{constructor(t,e,i,s){this.domManager=i,this.tooltip=s,this.stateTracker=new pc,this.suppressState=new pc(!1),this.appliedState=null,this.pendingRemovals=new Map,this.removeDelay=100,this.cleanup=new dE,this.cleanup.register(s.setup(e,i),t.on("dom:hidden",()=>this.tooltip.hide()))}destroy(){for(const{scheduler:t}of this.pendingRemovals.values())t.cancel();this.pendingRemovals.clear(),this.cleanup.flush()}updateTooltip(t,e,i,s){const n=this.pendingRemovals.get(t);n&&(n.scheduler.cancel(),this.pendingRemovals.delete(t)),i??(i=this.stateTracker.get(t)?.content),this.stateTracker.set(t,{meta:e,content:i,pagination:s}),this.applyStates()}removeTooltip(t,e,i=!1){if(i&&this.removeDelay>0){const n=this.pendingRemovals.get(t);if(n){e&&(n.lastMeta=e);return}const a=ru(()=>{this.applyPendingRemoval(t)});this.pendingRemovals.set(t,{scheduler:a,lastMeta:e}),a.schedule(this.removeDelay);return}const s=this.pendingRemovals.get(t);s&&(s.scheduler.cancel(),this.pendingRemovals.delete(t)),this.stateTracker.delete(t),this.applyStates()}suppressTooltip(t){this.suppressState.set(t,!0)}unsuppressTooltip(t){this.suppressState.delete(t)}applyPendingRemoval(t){this.pendingRemovals.has(t)&&(this.pendingRemovals.delete(t),this.stateTracker.delete(t),this.applyStates())}applyStates(){const t=this.stateTracker.stateId(),e=t?this.stateTracker.get(t):void 0;if(this.suppressState.stateValue()||e?.meta==null||e?.content==null){this.appliedState=null,this.tooltip.hide();return}const i=this.domManager.getBoundingClientRect(),s=this.tooltip.bounds==="extended"?this.domManager.getOverlayClientRect():i;if($b(this.appliedState?.content,e?.content)&&$b(this.appliedState?.pagination,e?.pagination)){const n=this.tooltip.isVisible();this.tooltip.show(s,i,e?.meta,null,void 0,n)}else this.tooltip.show(s,i,e?.meta,e?.content,e?.pagination);this.appliedState=e}static makeTooltipMeta(t,e,i,s){const{canvasX:n,canvasY:a}=t,r=e.properties.tooltip,{placement:o,anchorTo:l,xOffset:c,yOffset:h}=r.position,d=Yu(e,i,s);return{canvasX:n,canvasY:a,nodeCanvasX:d?.canvasX??n,nodeCanvasY:d?.canvasY??a,enableInteraction:r.interaction?.enabled??!1,showArrow:r.showArrow,position:{placement:o,anchorTo:l,xOffset:c,yOffset:h}}}};import{CleanupRegistry as DE,EventEmitter as ME}from"ag-charts-core";var Jb=3,AE=505,Qb=30;function Zu(t,e){const{device:i,offsetX:s,offsetY:n,clientX:a,clientY:r,currentX:o,currentY:l,sourceEvent:c}=e;return{type:t,device:i,offsetX:s,offsetY:n,clientX:a,clientY:r,currentX:o,currentY:l,sourceEvent:c}}function ex(t,e){const i=t*t+e*e,s=Jb*Jb;return i>=s}function CE(t,e){const i=t.clientX-e.clientX,s=t.clientY-e.clientY,n=i*i+s*s,a=Qb*Qb;return n=2){const i=e[0];this.domainNeedsValueOf=i!=null&&typeof i=="object",this.domainNeedsValueOf?(this.d0Cache=e[0].valueOf(),this.d1Cache=e[1].valueOf()):(this.d0Cache=e[0],this.d1Cache=e[1])}else this.d0Cache=Number.NaN,this.d1Cache=Number.NaN}normalizeDomains(...e){return ax(...e)}calcBandwidth(e=1,i=1){const{domain:s}=this,n=this.getPixelRange();if(s.length===0)return n;let r=Math.abs(this.d1Cache-this.d0Cache)/e+1;if(i!==0){const o=Math.floor(n);r=Math.min(r,o)}return n/Math.max(1,r)}convert(e,i){const{domain:s}=this;if(!s||s.length<2||e==null)return Number.NaN;const{range:n}=this,a=i?.clamp??this.defaultClamp;let r=this.d0Cache,o=this.d1Cache,l=typeof e=="number"?e:e.valueOf();if(this.transform&&(r=this.transform(r),o=this.transform(o),l=this.transform(l)),a){const[h,d]=RE([r,o]);if(ld)return n[1]}if(r===o)return(n[0]+n[1])/2;if(l===r)return n[0];if(l===o)return n[1];const c=n[0];return c+(l-r)/(o-r)*(n[1]-c)}invert(e,i){const{domain:s}=this;if(s.length<2)return;let n=this.d0Cache,a=this.d1Cache;this.transform&&(n=this.transform(n),a=this.transform(a));const{range:r}=this,[o,l]=r;let c;return o===l?c=this.toDomain((n+a)/2):c=this.toDomain(n+(e-o)/(l-o)*(a-n)),this.transformInvert?this.transformInvert(c):c}getDomainMinMax(){return ec(this.domain)}getPixelRange(){const[e,i]=this.range;return Math.abs(i-e)}};nx.defaultTickCount=5;var re=nx;function ax(...t){let e,i=1/0,s,n=-1/0;for(const a of t){const r=a.domain;for(const o of r){const l=o.valueOf();ln&&(n=l,s=o)}}return e!=null&&s!=null?{domain:[e,s],animatable:!0}:{domain:[],animatable:!1}}import{ScaleAlignment as wc,findMaxIndex as PE,findMinIndex as rx}from"ag-charts-core";import{Logger as _E,clamp as Oc}from"ag-charts-core";var qu=class TC extends Jl{constructor(){super(...arguments),this.invalid=!0,this.range=[0,1],this.round=!1,this._bandwidth=1,this._step=1,this._inset=1,this._rawBandwidth=1,this._paddingInner=0,this._paddingOuter=0}static is(e){return e instanceof TC}get bandwidth(){return this.refresh(),this._bandwidth}get step(){return this.refresh(),this._step}get inset(){return this.refresh(),this._inset}get rawBandwidth(){return this.refresh(),this._rawBandwidth}set padding(e){e=Oc(0,e,1),this._paddingInner=e,this._paddingOuter=e}get padding(){return this._paddingInner}set paddingInner(e){this.invalid=!0,this._paddingInner=Oc(0,e,1)}get paddingInner(){return this._paddingInner}set paddingOuter(e){this.invalid=!0,this._paddingOuter=Oc(0,e,1)}get paddingOuter(){return this._paddingOuter}getBandCountForUpdate(){return this.bands.length}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&_E.warnOnce("Expected update to not invalidate scale"))}convert(e,i){this.refresh();const s=this.findIndex(e,i?.alignment,i?.alignmentExclusive);return s==null||s<0||s>=this.getBandCountForUpdate()?Number.NaN:this.ordinalRange(s)}getDomainMinMax(){return ec(this.domain)}invertNearestIndex(e){this.refresh();const i=this.getBandCountForUpdate();if(i===0)return-1;let s=0,n=i-1,a=1/0,r=0;for(;s<=n;){const o=Math.trunc((n+s)/2),l=this.ordinalRange(o),c=Math.abs(l-e);if(c===0)return o;c0,c=l?Math.floor(o):o;let h=e+(r-c*(a-s))/2,d=c*(1-s);l&&(h=Math.round(h),d=Math.round(d)),this._step=c,this._inset=h,this._bandwidth=d,this._rawBandwidth=o*(1-s)}ordinalRange(e){const{_inset:i,_step:s,range:n}=this,a=Math.min(n[0],n[1]),r=Math.max(n[0],n[1]);return Oc(a,i+s*e,r)}};y([Ql],qu.prototype,"range",2),y([Ql],qu.prototype,"round",2);var Fi=qu,FE=1e3,ox=20;function lx(t,e=0,i=t.length-1){const s=i-e+1;if(s<2)return{isUniform:!1};if(e<0||i>=t.length)return{isUniform:!1};const n=Array.from({length:ox},(l,c)=>e+Math.floor(c*(s-1)/(ox-1))),a=n.map(l=>t[l].valueOf()),r=(a.at(-1)-a[0])/(s-1);if(!Number.isFinite(r)||r===0)return{isUniform:!1};const o=Math.abs(r*.01);for(let l=1;lo)return{isUniform:!1}}return{isUniform:!0,interval:r}}var Ls=class LC extends Fi{static is(e){return e instanceof LC}toDomain(e){return new Date(e)}get reversed(){const{domain:e}=this;return e.length>0&&e[0].valueOf()>e.at(-1).valueOf()}get numericBands(){return this.bands.map(e=>e.valueOf())}convert(e,i){this.refresh(),e instanceof Date||(e=new Date(e));const{domain:s,reversed:n}=this,a=this.numericBands,r=a.length;if(s.length<=0)return Number.NaN;const o=this.ordinalRange(0),l=this.ordinalRange(r-1);if(r===0)return o;if(i?.clamp===!0){const{range:v}=this;if(e.valueOf()a.at(-1))return v[1]}if((i?.alignment??wc.Leading)!==wc.Interpolate){const v=super.convert(e,i);return n?l-(v-o):v}const h=e.valueOf();let d=this.findIndex(e)??0,u;n?(d=Math.min(Math.max(d,1),r-1),u=-1):(d=Math.min(Math.max(d,0),r-2),u=1);const p=a[d],g=a[d+u],f=this.ordinalRange(d),m=this.ordinalRange(d+u),x=(h-p)/(g-p)*(m-f)+f;return n?l-(x-o):x}invert(e,i=!1){this.refresh();const{domain:s}=this;if(s.length<=0)return;const n=this.bands,a=this.getBandCountForUpdate(),r=s[0].valueOf()>s.at(-1).valueOf();let o;return i?o=this.invertNearestIndex(e-this.bandwidth/2):o=rx(0,a-1,c=>this.ordinalRange(c)>=e)??a-1,n[r?a-1-o:o]}getUniformityCache(e){}findIndex(e,i=wc.Leading,s=!1){if(e==null)return;const n=this.numericBands,a=n.length;if(a===0)return;if(a===1)return 0;const r=e.valueOf();return i===wc.Trailing!==s?rx(0,a-1,l=>n[l]>=r):PE(0,a-1,l=>n[l]<=r)}};import{Vec4 as Ju,clamp as Qu}from"ag-charts-core";var cx=(t=>(t[t.None=0]="None",t[t.WhenViewportTooSmallScaleXYProportionally=1]="WhenViewportTooSmallScaleXYProportionally",t[t.WhenViewportTooSmallScaleXYDisproportionally=2]="WhenViewportTooSmallScaleXYDisproportionally",t))(cx||{});function on(t,e,i,s,n){return e+(s-e)*((n-t)/(i-t))}function hx(t,e,i,s,n){return t+(n-e)*((i-t)/(s-e))}function dx(t,e,i){return[hx(t,i.min,e,i.max,0),hx(t,i.min,e,i.max,1)]}function VE(t,e,i){const[s,n]=dx(t.x1,t.x2,e),[a,r]=dx(t.y1,t.y2,i);return{x1:s,x2:n,y1:a,y2:r}}function ux(t,e){const i=e.width>t.width,s=e.height>t.height;return{x:i,y:s}}function px(t,e,i,s,n,a){if(i<=n&&a<=s)return i;const r=n-i,o=a-s,l=Math.abs(r)kE((e,{options:i})=>!re.is(t?.scale)&&!Ls.is(t?.scale)||e==null||i.end==null?!0:e1)&&(tx.warnOnce(`Attempted to update axis (${e}) zoom to an invalid ratio of [{ min: ${s}, max: ${n} }], expecting a ratio of 0 to 1. Ignoring.`),delete t[e])}}function mx(t,e){const i={};for(const{id:s,direction:n}of t){const{min:a,max:r}=e[s]??{min:0,max:1};i[s]={min:a,max:r,direction:n}}return i}function yx(t,e){const i=ra(t),s=ra(e);if(i.length!==s.length)return!1;for(const n of i)if(!s.includes(n))return!1;for(const n of i){const a=t[n],r=e[n];if(a!==r&&(a==null||r==null||a.direction!==r.direction||a.min!==r.min||a.max!==r.max))return!1}return!0}function WE(t){return{source:"user-interaction",sourceDetail:t}}var bx=class extends uu{constructor(t,e,i){super(),this.eventsHub=t,this.fireChartEvent=i,this.mementoOriginatorKey="zoom",this.state={},this.axes=[],this.didLayoutAxes=!1,this.lastRestoredState={},this.restoreRequiredRangeIterations=0,this.independentAxes=!1,this.navigatorModule=!1,this.zoomModule=!1,this.debug=NE.create(!0,"zoom"),this.panToBBoxScalingMode=2,this.pendingMemento=void 0,this.cleanup.register(t.on("zoom:change-request",s=>{this.constrainZoomToRequiredWidth(s)}),e.addListener("pre-series-update",({requiredRangeRatio:s,requiredRangeDirection:n,requiredRange:a})=>{this.didLayoutAxes=!0;const{pendingMemento:r}=this;r?this.restoreMemento(r.version,r.mementoVersion,r.memento):this.restoreRequiredRange(s,n,a),this.updateZoom({source:"chart-update",sourceDetail:"unspecified"})}),e.addListener("update-complete",({wasShortcut:s})=>{if(!s&&this.pendingZoomEventSource){const n=this.pendingZoomEventSource;this.fireChartEvent({type:"zoom",source:n,...this.getMementoRanges()}),this.pendingZoomEventSource=void 0}}))}toCoreZoomState(t){const e={};let i;const{state:s}=this;if(this.independentAxes){const n=this.getPrimaryAxisId(Wt.X),a=this.getPrimaryAxisId(Wt.Y);i=[],n&&i.push(n),a&&i.push(a)}else i=ra(s);for(const n of i){const{direction:a}=s[n]??{};if(a!=null){const r=t[a];if(r){const{min:o,max:l}=r;e[n]={min:o,max:l,direction:a}}}}return e}toZoomState(t){let e,i;for(const s of ra(t)){const{min:n,max:a,direction:r}=t[s];r===Wt.X?e??(e={min:n,max:a}):r===Wt.Y&&(i??(i={min:n,max:a}))}if(e||i)return{x:e,y:i}}createMemento(){return this.getMementoRanges()}guardMemento(t,e){if(t==null)return!0;if(!wE(t))return!1;const i=this.getPrimaryAxis(Wt.X),s=this.getPrimaryAxis(Wt.Y),n={rangeX:{start:fx(i),end:aa},rangeY:{start:fx(s),end:aa},ratioX:{start:aa,end:aa},ratioY:{start:aa,end:aa},autoScaledAxes:aa},{invalid:a}=EE(t,n);return a.length>0?(e.push(...a.map(String)),!1):!0}restoreMemento(t,e,i){if(!this.axes||!this.didLayoutAxes){this.pendingMemento={version:t,mementoVersion:e,memento:i};return}this.pendingMemento=void 0;const s=Nc(this.getZoom());i?.rangeX?s.x=this.rangeToRatioDirection(Wt.X,i.rangeX)??{min:0,max:1}:i?.ratioX?s.x={min:i.ratioX.start??0,max:i.ratioX.end??1}:s.x={min:0,max:1};const{navigatorModule:n,zoomModule:a}=this;this.eventsHub.emit("zoom:load-memento",{zoom:s,memento:i,navigatorModule:n,zoomModule:a});const r=this.toCoreZoomState(s);this.lastRestoredState=sx(Vo(r)),this.updateChanges({source:"state-change",sourceDetail:"internal-restoreMemento",changes:r,isReset:!1})}findAxis(t){for(const e of this.axes)if(e.id===t)return e}getAxes(){return this.axes}setAxes(t){const{axes:e}=this;e.length=0;for(const n of t)"range"in n&&e.push(n);const i=this.state,s=mx(t,i);this.state=s,this.lastRestoredState=mx(t,this.lastRestoredState),this.updateChanges({source:"chart-update",sourceDetail:"internal-setAxes",changes:s,isReset:!1})}setIndependentAxes(t=!0){this.independentAxes=t}setNavigatorEnabled(t=!0){this.navigatorModule=t}setZoomModuleEnabled(t=!0){this.zoomModule=t}isNavigatorEnabled(){return this.navigatorModule}isZoomEnabled(){return this.zoomModule}updateZoom({source:t,sourceDetail:e},i){const s=this.toCoreZoomState(i??{});return this.updateChanges({source:t,sourceDetail:e,changes:s,isReset:!1})}computeChangedAxesIds(t){const e=[],i=this.state;for(const s of ra(t)){const n=t[s]??{min:0,max:1},a=i[s];(a==null||a.min!==n.min||a.max!==n.max)&&e.push(s)}return e}updateChanges(t){const{source:e,sourceDetail:i,isReset:s,changes:n}=t;jE(n);const a=this.computeChangedAxesIds(n),r=Vo(this.state),o=Vo(this.state);for(const l of a){const c=o[l];c!=null&&(c.min=n[l]?.min??0,c.max=n[l]?.max??1)}return this.state=o,this.dispatch(e,i,a,s,r)}resetZoom({source:t,sourceDetail:e}){this.updateChanges({source:t,sourceDetail:e,changes:this.getRestoredZoom(),isReset:!0})}resetAxisZoom({source:t,sourceDetail:e},i){this.updateChanges({source:t,sourceDetail:e,changes:{[i]:this.getRestoredZoom()[i]},isReset:!0})}panToBBox(t,e){if(!this.isZoomEnabled()&&!this.isNavigatorEnabled())return!1;const i=this.getZoom();if(i===void 0||!i.x&&!i.y)return!1;const{panToBBoxScalingMode:s}=this;if(!(t.width>0&&t.height>0&&(s!==0||Math.abs(e.width)<=Math.abs(t.width)&&Math.abs(e.height)<=Math.abs(t.height))))return tx.warnOnce("cannot pan to target BBox - chart too small?"),!1;const a=zE(s,t,i,e),r=this.toCoreZoomState(a);return this.updateChanges({source:"user-interaction",sourceDetail:"internal-panToBBox",changes:r,isReset:!1})}fireZoomPanStartEvent(t){this.eventsHub.emit("zoom:pan-start",{callerId:t})}updateWith({source:t,sourceDetail:e},i,s){const n=this.getPrimaryAxis(i);if(!n)return;const a=n.scale.getDomainMinMax();if(!a)return;const[r,o]=n.visibleRange,l=this.getRange(n.id,{min:r,max:o});if(!l)return;const[c,h]=a,{start:d,end:u}=l,p=s(c,h,d,u,t);if(!this.isValidUpdateWithResult(p)){this.resetZoom({source:t,sourceDetail:e});return}const[g,f]=p,m=this.rangeToRatioAxis(n,{start:g,end:f});m&&this.updateChanges({source:t,sourceDetail:e,changes:{[i]:m},isReset:!1})}isValidUpdateWith(t,e,i){const s=this.getPrimaryAxis(t);if(!s)return!0;const n=s.scale.getDomainMinMax();if(!n)return!0;const[a,r]=s.visibleRange,o=this.getRange(s.id,{min:a,max:r});if(!o)return!0;const[l,c]=n,{start:h,end:d}=o,u=e(l,c,h,d,i);if(!this.isValidUpdateWithResult(u))return!0;const[p,g]=u;let f=!0;return p!=null&&f&&(f=p>=l),g!=null&&f&&(f=g<=c),p!=null&&g!=null&&f&&(f=p<=g),f}getZoom(){return this.toZoomState(this.state)}getAxisZoom(t){return this.state[t]??{min:0,max:1}}getAxisZooms(){return this.state}getCoreZoom(){return this.state}getRestoredZoom(){return this.lastRestoredState}getPrimaryAxisId(t){return this.getPrimaryAxis(t)?.id}getBoundSeries(){const t=this.getPrimaryAxis(Wt.X),e=this.getPrimaryAxis(Wt.Y);let i;if(this.independentAxes){const s=new Set(t?.boundSeries??[]),n=new Set(e?.boundSeries??[]);i=new Set;for(const a of s)n.has(a)&&i.add(a)}else i=new Set([...t?.boundSeries??[],...e?.boundSeries??[]]);return i}constrainZoomToItemCount(t,e,i){let s=[t.x.min,t.x.max],n=i?void 0:[t.y.min,t.y.max];for(const o of this.getBoundSeries()){const l=o.getZoomRangeFittingItems(s,n,e);l!=null&&(s=l.x,n=l.y)}const a={min:s[0],max:s[1]},r=n?{min:n[0],max:n[1]}:void 0;return Nc({x:a,y:r})}isVisibleItemsCountAtLeast(t,e,i){const s=this.getBoundSeries(),n=[t.x.min,t.x.max],a=!i.includeYVisibleRange&&i.autoScaleYAxis?void 0:[t.y.min,t.y.max];let r=0;for(const o of s){const l=e-(r??0),c=o.getVisibleItems(n,a,l);if(r+=c,r>=e)return!0}return s.size===0}getMementoRanges(){const t=Nc(this.getZoom()),e={rangeX:this.getRangeDirection(Wt.X,t.x),rangeY:this.getRangeDirection(Wt.Y,t.y),ratioX:{start:t.x.min,end:t.x.max},ratioY:{start:t.y.min,end:t.y.max},autoScaledAxes:void 0};return this.eventsHub.emit("zoom:save-memento",{memento:e}),e}restoreRequiredRange(t,e,i){const{lastRestoredRequiredRange:s,lastRestoredRequiredRangeDirection:n}=this;this.lastRequiredRange!==i&&(this.lastRequiredRange=i,this.restoreRequiredRangeIterations=0),this.restoreRequiredRangeIterations+=1;const a=e!==Wt.X&&e!==Wt.Y,r=n===e&&s===t,o=t===0&&(s==null||s===0);if(a||r||o||this.restoreRequiredRangeIterations>1){this.restoreRequiredRangeIterations=0;return}const l=this.getPrimaryAxisId(e);if(!l)return;const c=this.getAxisZoom(l),h=Math.min(1,1/t);let d=0,u=1;e===Wt.X?(d=pr(0,1-h,c.min),u=pr(0,d+h,1)):(u=Math.min(1,c.max),d=u-h,d<0&&(u-=d,d=0),d=pr(0,d,1),u=pr(0,u,1)),this.lastRestoredRequiredRange=t,this.lastRestoredRequiredRangeDirection=e;const p={[e]:{min:d,max:u}},g=this.toCoreZoomState(p);this.lastRestoredState=sx(Vo(g)),this.updateChanges({source:"state-change",sourceDetail:"internal-requiredWidth",changes:g,isReset:!1})}constrainZoomToRequiredWidth(t){if(this.lastRestoredRequiredRange==null||this.lastRestoredRequiredRangeDirection==null)return;const e=this.lastRestoredRequiredRangeDirection,i=this.getPrimaryAxisId(this.lastRestoredRequiredRangeDirection);if(!i)return;const s=t.stateAsDefinedZoom(),n=t.oldState[i],a=s[e].max-s[e].min,r=1/this.lastRestoredRequiredRange;Math.abs(a-r)<1e-12||a<=r||t.constrainZoom({...s,[e]:{min:n.min,max:n.min+r}})}dispatch(t,e,i,s,n){const{x:a,y:r}=this.getZoom()??{},o=this.state;let l;const c=this.debug,h=this,d={source:t,sourceDetail:e,isReset:s,changedAxes:i,state:o,oldState:n,x:a,y:r,stateAsDefinedZoom(){return Nc(h.toZoomState(d.state))},constrainZoom(p){this.constrainChanges(h.toCoreZoomState(p))},constrainChanges(p){c.check()&&c("ZoomManager.constrainChanges()",o,"->",p,new Error().stack),l??(l=Vo(o));for(const g of ra(p)){const f=p[g],m=l[g];f&&m&&(m.min=f.min,m.max=f.max)}d.state=l}};this.eventsHub.emit("zoom:change-request",d),l&&!yx(o,l)&&(this.state=l);const u=!yx(n,this.state);if(u){const p=this.getZoom()??{};this.eventsHub.emit("zoom:change-complete",{source:t,sourceDetail:e,x:p.x}),this.pendingZoomEventSource=t}return u}getRange(t,e){return this.getRangeAxis(this.findAxis(t),e)}getRangeDirection(t,e){return this.getRangeAxis(this.getPrimaryAxis(t),e)}getRangeAxis(t,e){if(!t)return;const i=this.getDomainPixelExtents(t);if(!i)return;const[s,n]=i;let a,r;return s<=n?(a=t.scale.invert(0,!0),r=t.scale.invert(s+(n-s)*e.max,!0)):(a=t.scale.invert(s-(s-n)*e.min,!0),r=t.scale.invert(0,!0)),{start:a,end:r}}rangeToRatio(t,e){return this.rangeToRatioAxis(this.findAxis(t),e)}rangeToRatioDirection(t,e){return this.rangeToRatioAxis(this.getPrimaryAxis(t),e)}rangeToRatioAxis(t,e){if(!t)return;const i=this.getDomainPixelExtents(t);if(!i)return;const[s,n]=i,{scale:a}=t,{start:r,end:o}=e,[l=ix.Leading,c=ix.Trailing]=gx(r,o);let h=r==null?s:a.convert(r,{alignment:l,alignmentExclusive:!0}),d=o==null?n:a.convert(o,{alignment:c,alignmentExclusive:!0})+(a.bandwidth??0);if(!kc(h)||!kc(d))return;const[u,p]=[Math.min(s,n),Math.max(s,n)];h=pr(u,h,p),d=pr(u,d,p);const g=n-s;if(g===0)return;const f=Math.abs((h-s)/g),m=Math.abs((d-s)/g);if(!(f>=m))return{min:f,max:m}}getPrimaryAxis(t){return this.axes?.find(e=>e.direction===t)}getDomainPixelExtents(t){const[e,i]=t.scale.range;if(!(!kc(e)||!kc(i)))return[e,i]}isValidUpdateWithResult(t){return t==null||!Array.isArray(t)||t.length<1?!1:t.every(e=>e==null||typeof e=="number"||OE(e))}},ep=(t=>(t[t.Caption=0]="Caption",t[t.Legend=1]="Legend",t[t.ToolbarLeft=2]="ToolbarLeft",t[t.ToolbarBottom=3]="ToolbarBottom",t[t.Scrollbar=4]="Scrollbar",t[t.Navigator=5]="Navigator",t[t.Overlay=6]="Overlay",t))(ep||{}),YE=class{constructor(t){this.eventsHub=t,this.elements=new Map}registerElement(t,e){return this.elements.has(t)?this.elements.get(t).add(e):this.elements.set(t,new Set([e])),()=>this.elements.get(t)?.delete(e)}createContext(t,e){const i={width:t,height:e,layoutBox:new P(0,0,t,e),scrollbars:{}};for(const s of Object.values(ep)){if(typeof s!="number")continue;const n=this.elements.get(s);if(n)for(const a of n)a(i)}return i}emitLayoutComplete({width:t,height:e},i){this.eventsHub.emit("layout:complete",{axes:i.axes??{},chart:{width:t,height:e},clipSeries:i.clipSeries??!1,series:i.series,layoutBox:i.layoutBox})}};import{isPointLabelDatum as $E,placeLabels as KE}from"ag-charts-core";var ZE=class{constructor(){this.labelData=new Map}updateLabels(t,e,i=P.zero){const s={x:-e.left,y:-e.top,width:i.width+e.left+e.right,height:i.height+e.top+e.bottom},n=new Set(t.map(r=>r.id));for(const r of this.labelData.keys())n.has(r)||this.labelData.delete(r);for(const r of t){const o=r.getLabelData();o.every($E)&&this.labelData.set(r.id,o)}const a=KE(this.labelData,s,5);for(const r of t)r.updatePlacedLabelData?.(a.get(r.id)??[])}};import{Logger as XE,isArray as qE}from"ag-charts-core";var JE=class{constructor(t){this.eventsHub=t,this.mementoOriginatorKey="legend",this.legendDataMap=new Map}createMemento(){return this.getData().filter(({hideInLegend:t,isFixed:e})=>!t&&!e).map(({enabled:t,seriesId:e,itemId:i,legendItemName:s})=>({visible:t,seriesId:e,itemId:i,legendItemName:s}))}guardMemento(t){return t==null||qE(t)}restoreMemento(t,e,i){if(i)for(const s of i){const{seriesId:n,data:a}=this.getRestoredData(s)??{};!n||!a||this.updateData(n,a)}this.update()}getRestoredData(t){const{seriesId:e,itemId:i,legendItemName:s,visible:n}=t;if(e){const r=(this.legendDataMap.get(e)??[]).map(o=>{const l=o.seriesId===e&&(!i||o.itemId===i);return l&&o.isFixed&&this.warnFixed(o.seriesId,o.itemId),!o.isFixed&&l?{...o,enabled:n}:o});return{seriesId:e,data:r}}if(!(i==null&&s==null))for(const a of this.getData()){if(i!=null&&a.itemId!==i||s!=null&&a.legendItemName!==s)continue;if(a.isFixed){this.warnFixed(a.seriesId,i);return}const r=(this.legendDataMap.get(a.seriesId)??[]).map(o=>o.itemId===i||o.legendItemName===s?{...o,enabled:n}:o);return{seriesId:a.seriesId,data:r}}}warnFixed(t,e){XE.warnOnce(`The legend item with seriesId [${t}] and itemId [${e}] is not configurable, this series item cannot be toggled through the legend.`)}update(t){this.eventsHub.emit("legend:change",{legendData:t??this.getData()})}updateData(t,e=[]){this.eventsHub.emit("legend:change-partial",{seriesId:t,legendData:e}),this.legendDataMap.set(t,e)}clearData(){this.legendDataMap.clear()}toggleItem(t,e,i,s){if(s){for(const o of this.getData()){const l=(this.legendDataMap.get(o.seriesId)??[]).map(c=>c.legendItemName===s?{...c,enabled:t}:c);this.updateData(o.seriesId,l)}return}const n=this.getData(e),a=n.length===1,r=n.map(o=>i==null&&a||o.itemId===i?{...o,enabled:t}:o);this.updateData(e,r)}getData(t){return t?this.legendDataMap.get(t)??[]:[...this.legendDataMap].reduce((e,[i,s])=>e.concat(s),[])}getDatum({seriesId:t,itemId:e}={}){return this.getData(t).find(i=>i.itemId===e)}getSeriesEnabled(t){const e=this.getData(t);if(e.length>0)return e.some(i=>i.enabled)}getItemEnabled({seriesId:t,itemId:e}={}){return this.getDatum({seriesId:t,itemId:e})?.enabled??!0}},QE=class{updateCallback(t){this.resolvePartialCallback=t}resolvePartial(t,e,i){return this.resolvePartialCallback?.(t,e,i)}};import"ag-charts-core";var e1=class extends Fi{constructor(){super(...arguments),this.type="category",this.defaultTickCount=0,this._hasFixedWidth=!1,this._paddingInnerWidth=0,this._domain=[],this._bandRanges=new Map}set domain(t){this._domain!==t&&(t.length===0&&(this._bandRanges.clear(),this._hasFixedWidth=!1),this.invalid=!0,this._domain=t)}get domain(){return this._domain}get bands(){return this.domain}get paddingInnerWidth(){return this._hasFixedWidth?this._paddingInnerWidth:this.paddingInner*this._bandwidth}addBand(t,e,i){this._domain.push(this.getDomainValue(t,e)),this._bandRanges.has(t)||this._bandRanges.set(t,new Map),this._bandRanges.get(t).set(e,i),this._hasFixedWidth||(this._hasFixedWidth=i!=null),this.invalid=!0}getDomainValue(t,e){return`${t}-${e}`}findIndex(t){let e=0;for(const i of this._bandRanges.keys()){if(i===t)return e;e++}}convert(t){const{_bandwidth:e,_bandRanges:i,_inset:s,_paddingInnerWidth:n}=this;let a=s;const r=t.split("-"),o=Number(r[0]);if(!this._hasFixedWidth)return super.convert(o);for(let l=0;l0&&h>=0?h/a:o/s,p=u;r===s&&h>0&&(d+=h/2),this.round&&Math.floor(p)>0&&(d=Math.round(d),p=Math.round(p)),h<0&&(u=0,p=0),this._inset=d,this._bandwidth=p,this._rawBandwidth=u,this._paddingInnerWidth=l}normalizeDomains(...t){return{domain:[],animatable:!1}}toDomain(t){}},t1=class{constructor(){this.groups=new Map,this.groupScales=new Map}registerSeries({internalId:t,seriesGrouping:e,visible:i,width:s,type:n}){if(!e)return;let a=this.groups.get(n);a==null&&(a=new Map,this.groups.set(n,a)),a.set(t,{grouping:e,visible:i,width:s})}updateSeries({internalId:t,seriesGrouping:e,visible:i,width:s,type:n}){if(!e)return;const a=this.groups.get(n)?.get(t);a&&(a.grouping=e,a.width=s,a.visible=i)}deregisterSeries({internalId:t,type:e}){const i=this.groups.get(e);i!=null&&(i.delete(t),i.size===0&&this.groups.delete(e))}getVisiblePeerGroupIndex({type:t,seriesGrouping:e,visible:i}){if(!e)return{visibleGroupCount:i?1:0,visibleSameStackCount:i?1:0,index:0};const s=new Set,n=new Set,a=this.groups.get(t);for(const o of a?.values()??[])o.visible&&(s.add(o.grouping.groupIndex),o.grouping.groupIndex===e.groupIndex&&n.add(o.grouping.stackIndex));const r=Array.from(s);return r.sort((o,l)=>o-l),{visibleGroupCount:r.length,visibleSameStackCount:n.size,index:r.indexOf(e.groupIndex)}}updateGroupScale({type:t},e,i){const s=this.groupScales.get(t)??new e1;this.groupScales.set(t,s),s.domain=[];const n=this.groups.get(t);for(const a of n?.values()??[])a.visible&&s.addBand(a.grouping.groupIndex,a.grouping.stackIndex,a.width);s.domain.length===0&&s.addBand(0,0,void 0),s.range=[0,e],i.type==="grouped-category"?s.paddingInner=i.groupPaddingInner:i.type==="category"||i.type==="unit-time"?(s.paddingInner=i.groupPaddingInner,s.round=s.padding!==0):s.padding=0,s.update()}getGroupScale({type:t}){return this.groupScales.get(t)}getGroupBandWidth(t){const{seriesGrouping:e}=t;if(!e)return 0;const i=this.getGroupScale(t);if(!i)return 0;const s=this.groups.get(t.type);if(!s)return i.bandwidth;let n=0;for(const a of s.values())a.visible&&a.grouping.groupIndex===e.groupIndex&&(n=Math.max(n,a.width??i.bandwidth));return n||i.bandwidth}getGroupOffset(t){const{seriesGrouping:e}=t;if(!e)return 0;const i=this.getGroupScale(t);if(!i)return 0;const s=i.getDomainValue(e.groupIndex,e.stackIndex);return i.convert(s)}getStackOffset(t,e){const{seriesGrouping:i}=t;if(!i)return 0;const s=this.groups.get(t.type);if(!s)return 0;const n=this.getGroupScale(t);if(!n||(i.stackCount??0)<1)return 0;let r=0;for(const o of s.values())o.visible&&o.grouping.groupIndex===i.groupIndex&&(r=Math.max(r,o.width??n.bandwidth));return r===0?0:r/2-e/2}getDatumOffset(t,e,i,s){const n=this.groups.get(t.type);if(!t.visible||!t.seriesGrouping||!n||e.get(t.internalId)?.[s]||i.get(t.internalId)?.[s])return 0;const a=new Set;for(const[u,p]of n)p.visible&&!e.get(u)?.[s]&&!i.get(u)?.[s]&&a.add(p.grouping.groupIndex);if(a.size===t.seriesGrouping?.groupCount)return 0;const r=this.groupScales.get(t.type),o=new Map,l=new Map;for(const[u,p]of n)u!==t.internalId&&p.visible&&(a.has(p.grouping.groupIndex)||(t.seriesGrouping.groupIndexp.grouping.groupIndex&&o.set(p.grouping.groupIndex,Math.max(p.width??r?.bandwidth??0,o.get(p.grouping.groupIndex)??0))));let c=0;for(const[,u]of l)c+=u;for(const[,u]of o)c-=u;c/=2;const h=(r?.paddingInnerWidth??0)/2,d=(l.size-o.size)*h;return c+d}};import{EventEmitter as i1}from"ag-charts-core";var s1=class{constructor(){this.events=new i1}addListener(t,e){return this.events.on(t,e)}destroy(){this.events.clear()}dispatchUpdateComplete(t,e){this.events.emit("update-complete",{type:"update-complete",apiUpdate:t,wasShortcut:e})}dispatchPreDomUpdate(){this.events.emit("pre-dom-update",{type:"pre-dom-update"})}dispatchPreSeriesUpdate(t,e,i){this.events.emit("pre-series-update",{type:"pre-series-update",requiredRangeRatio:t,requiredRangeDirection:e,requiredRange:i})}dispatchPreSceneRender(t){this.events.emit("pre-scene-render",{type:"pre-scene-render",apiUpdate:t})}dispatchProcessData({series:t}){this.events.emit("process-data",{type:"process-data",series:t})}},n1=class{constructor(t,e){this.eventsHub=new dN,this.callbackCache=new cN,this.highlightManager=new Yb(this.eventsHub),this.formatManager=new hr,this.layoutManager=new YE(this.eventsHub),this.localeManager=new _k(this.eventsHub),this.seriesStateManager=new t1,this.stateManager=new IN,this.seriesLabelLayoutManager=new ZE,this.cleanup=new hN;const{scene:i,root:s,syncManager:n,agDocument:a,container:r,fireEvent:o,updateMutex:l,styleContainer:c,skipCss:h,chartType:d,domMode:u,withDragInterpretation:p}=e;this.chartService=t,this.syncManager=n,this.agDocument=a,this.domManager=new zy(this.eventsHub,this.chartService,this.agDocument,r,c,h,u),this.widgets=new LE(this.domManager,{withDragInterpretation:p});const g=this.agDocument.window,f=this.domManager.addChild("canvas","scene-canvas",i?.canvas.element);this.scene=i??new xc({canvasElement:f,pixelRatio:g.devicePixelRatio??1}),this.scene.setRoot(s),this.axisManager=new Jk(this.eventsHub,s),this.legendManager=new JE(this.eventsHub),this.annotationManager=new qk(this.eventsHub,t.annotationRoot,o),this.chartTypeOriginator=new mN(t),this.interactionManager=new db,this.contextMenuRegistry=new jb(this.eventsHub),this.optionsGraphService=new QE,this.updateService=new s1,this.activeManager=new ww(this.chartService,this.eventsHub,this.updateService,this.interactionManager,o),this.proxyInteractionService=new Ok(this.eventsHub,this.localeManager,this.domManager),this.fontManager=new iw(this.domManager,this.eventsHub),this.historyManager=new xN(this.eventsHub),this.animationManager=new rE(this.agDocument,this.interactionManager,l),this.dataService=new Mu(this.eventsHub,t,this.animationManager),this.tooltipManager=new Lc(this.eventsHub,this.localeManager,this.domManager,t.tooltip),this.zoomManager=new bx(this.eventsHub,this.updateService,o);for(const m of uN.listModulesByType(pN.Plugin))(!m.chartType||m.chartType===d)&&m.patchContext?.(this)}destroy(){this.animationManager.destroy(),this.axisManager.destroy(),this.callbackCache.invalidateCache(),this.domManager.destroy(),this.fontManager.destroy(),this.proxyInteractionService.destroy(),this.tooltipManager.destroy(),this.zoomManager.destroy(),this.widgets.destroy(),this.cleanup.flush()}};import{BaseProperties as a1,Property as tp}from"ag-charts-core";var Pc=class extends a1{constructor(){super(...arguments),this.enabled=!0,this.range="tooltip",this.drawingMode="cutout"}};y([tp],Pc.prototype,"enabled",2),y([tp],Pc.prototype,"range",2),y([tp],Pc.prototype,"drawingMode",2);import{arraysEqual as xx,objectsEqual as vx}from"ag-charts-core";function r1(t,e){if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0}function o1(t,e){if(t==null||e==null)return t===e;if(t.size!==e.size)return!1;for(const[i,s]of t){const n=e.get(i);if(n==null||!r1(s,n))return!1}return!0}function l1(t,e){if(t.length!==e.length)return!1;for(let i=0;ie.type==="key").map(e=>e.property).join(";")}var ip=class Ei{constructor(e,i,s){this.mode=e,this.suppressFieldDotNotation=i,this.eventsHub=s,this.debug=Sx.create(!0,"data-model"),this.requested=[],this.status="setup"}async request(e,i,s){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");return new Promise((n,a)=>{this.requested.push({id:e,opts:s,dataSet:i,resolve:n,reject:a})})}execute(e){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");this.status="executed";const i=new Map;for(const o of this.requested)o.dataSet.hasPendingTransactions()&&i.set(o.dataSet,o.dataSet.getChangeDescription()),o.dataSet.commitPendingTransactions();this.debug("DataController.execute() - requested",this.requested);const s=this.validateRequests(this.requested);this.debug("DataController.execute() - validated",s);const n=this.mergeRequested(s);this.debug("DataController.execute() - merged",n),this.debug.check()&&(Ix().processedData=[]);const a=[];for(const{dataSet:o,ids:l,opts:c,resolves:h,rejects:d}of n){let u=function(v){return h1(v,o,l,c)};var r=u;const p=e?.find(u),g=(v,S)=>{if(this.debug.check()&&Ix("processedData").push(S),S==null){for(const I of d)I(new Error("AG Charts - no processed data generated"));return}a.push({opts:c,dataSet:o,dataLength:o.data.length,ids:l,dataModel:v,processedData:S});for(const I of h)I({dataModel:v,processedData:S})},f=()=>{try{const v=new zu(c,this.mode,this.suppressFieldDotNotation,this.eventsHub),S=new Map(s.map(M=>[M.id,M.dataSet])),I=v.processData(S);return g(v,I),v}catch(v){for(const S of d)S(v)}};if(p==null){f();continue}const{dataModel:m,processedData:b}=p,x=i.get(o);if(b&&x&&m.isReprocessingSupported(b)){if(this.debug("DataController.execute() - reprocessing data",b,o),m.reprocessData(b,i),Sx.check("data-model:reprocess-diff")){const v=new zu(c,this.mode,this.suppressFieldDotNotation,this.eventsHub),S=new Map(s.map(C=>[C.id,C.dataSet])),I=v.processData(S),M=JSON.parse(JSON.stringify(b,Ei.jsonReplacer)),D=JSON.parse(JSON.stringify(I,Ei.jsonReplacer));delete M.time,delete M.optimizations,delete D.time,delete D.optimizations;const A=d1(D,M);A?(Ai.log("\u26A0\uFE0F DATA-MODEL REPROCESS DIFF DETECTED \u26A0\uFE0F"),Ai.log("Difference between incremental update and full reprocess:"),Ai.log(""),Ai.log("BASELINE (full reprocess):"),Ai.log(JSON.stringify(D,null,2)),Ai.log(""),Ai.log("REPROCESSED (incremental update):"),Ai.log(JSON.stringify(M,null,2)),Ai.log(""),Ai.log("DIFF (what changed):"),Ai.log(JSON.stringify(A,null,2))):Ai.log("\u2705 Data-model reprocess matches baseline (no diff)")}g(m,b);continue}f()}return a}validateRequests(e){const i=[];for(const[s,n]of e.entries())s>0&&n.dataSet.data.length!==e[0].dataSet.data.length&&n.opts.groupByData===!1&&n.opts.groupByKeys===!1?n.reject(new Error("all series[].data arrays must be of the same length and have matching keys.")):i.push(n);return i}mergeRequested(e){const i=[];for(const s of e){const n=i.find(Ei.groupMatch(s));n?n.push(s):i.push([s])}return i.map(Ei.mergeRequests)}static groupMatch({dataSet:e,opts:i}){const{groupByData:s,groupByKeys:n=!1,groupByFn:a,props:r}=i,o=Dx(r);return([l])=>(s===!1||l.dataSet===e)&&(l.opts.groupByKeys??!1)===n&&l.opts.groupByFn===a&&Dx(l.opts.props)===o}static mergeRequests(e){const i={ids:[],rejects:[],resolves:[],dataSet:e[0].dataSet,opts:{...e[0].opts,props:[]}},s=new Map,n=new Map;let a=0;for(const r of e){const{id:o,dataSet:l,resolve:c,reject:h,opts:{props:d,...u}}=r;i.ids.push(o),i.rejects.push(h),i.resolves.push(c),i.dataSet??(i.dataSet=l),i.opts??(i.opts={...u,props:[]});for(const p of d){const g={...p,scopes:[o],data:l.data};Ei.createIdsMap(o,g);let f;Ei.crossScopeMergableTypes.has(g.type)?f=-1:n.has(l.data)?f=n.get(l.data):(f=a++,n.set(l.data,f));const m=`${g.type}-${f}-${g.groupId}`,b=s.get(m),x=b?.find(v=>Ei.deepEqual(v,g));if(b==null){i.opts.props.push(g),s.set(m,[g]);continue}else if(x==null){i.opts.props.push(g),b.push(g);continue}g.scopes!=null&&(x.scopes??(x.scopes=[]),x.scopes.push(...g.scopes)),(x.type==="key"||x.type==="value")&&g.idsMap?.size&&(x.idsMap??(x.idsMap=new Map),Ei.mergeIdsMap(g.idsMap,x.idsMap))}}return i}static mergeIdsMap(e,i){for(const[s,n]of e){const a=i.get(s);if(a==null)i.set(s,new Set(n));else for(const r of n)a.add(r)}}static createIdsMap(e,i){i.id!=null&&(i.idsMap??(i.idsMap=new Map),i.idsMap.has(e)?i.idsMap.get(e).add(i.id):i.idsMap.set(e,new Set([i.id])))}static deepEqual(e,i){if(e===i)return!0;if(e&&i&&typeof e=="object"&&typeof i=="object"){if(e.constructor!==i.constructor)return!1;let s,n;if(Array.isArray(e)){if(n=e.length,n!==i.length)return!1;for(s=n-1;s>=0;s--)if(!Ei.deepEqual(e[s],i[s]))return!1;return!0}const a=Object.keys(e);if(n=a.length,n!==Object.keys(i).length)return!1;for(s=n-1;s>=0;s--){const r=a[s];if(!Ei.skipKeys.has(r)&&(!Object.hasOwn(i,r)||!Ei.deepEqual(e[r],i[r])))return!1}return!0}return!1}static jsonReplacer(e,i){return i instanceof Map?{__type:"Map",value:Array.from(i.entries())}:i instanceof Set?{__type:"Set",value:Array.from(i)}:i}};ip.crossScopeMergableTypes=new Set(["key","group-value-processor"]),ip.skipKeys=new Set(["id","idsMap","type","scopes","data"]);var Mx=ip;import{Logger as ln}from"ag-charts-core";var Bo=class Rd{constructor(e,i){this.data=e,this.dataIdKey=i,this.pendingTransactions=[]}static empty(e){return new Rd([],e)}static wrap(e,i){return new Rd(e,i)}netSize(){if(!this.hasPendingTransactions())return this.data.length;const e=this.getChangeDescription();return e?e.indexMap.finalLength:this.data.length}addTransaction(e){const i=this.normalizeTransaction(e);this.pendingTransactions.push(i),this.cachedChangeDescription=void 0}deepClone(){return new Rd([...this.data],this.dataIdKey)}normalizeTransaction(e){const{add:i,addIndex:s,prepend:n,append:a,remove:r,update:o}=e;if(i===void 0)return e;const l={remove:r,update:o};if(n&&(l.prepend=n),a&&(l.append=a),i&&i.length>0){const c=this.netSize();s===void 0||s>=c?l.append=a?[...a,...i]:i:s===0?l.prepend=n?[...i,...n]:i:l.insertions=[{index:s,items:i}]}return l}hasPendingTransactions(){return this.pendingTransactions.length>0}getPendingTransactionCount(){return this.pendingTransactions.length}commitPendingTransactions(){if(this.dataIdKey!=null&&this.data.length>0&&this.getIdToIndexMap(),!this.hasPendingTransactions())return!1;const e=this.getChangeDescription();if(!e)return!1;const i=e.getPrependedValues(),s=e.getInsertionValues(),n=e.getAppendedValues(),a=[...i,...s,...n];let r=0;if(e.applyToArray(this.data,function(l){if(r>=a.length)throw new Error(`AG Charts - Internal error: No insertion value found for index ${l}`);return a[r++]}),this.cachedPendingReplacements&&this.cachedPendingReplacements.size>0){const{updatedIndices:o}=e.indexMap;for(const l of o){const c=this.getIdValue(this.data[l]);c!==void 0&&this.cachedPendingReplacements.has(c)&&(this.data[l]=this.cachedPendingReplacements.get(c))}}return this.pendingTransactions=[],this.cachedChangeDescription=void 0,this.cachedPendingReplacements=void 0,this.updateItemToIndexCache(e,n,i,s),this.updateIdToIndexCache(e,n,i,s),!0}updateItemToIndexCache(e,i,s,n){if(!this.itemToIndexCache)return;if(this.dataIdKey){this.itemToIndexCache=void 0;return}const{indexMap:a}=e,{totalPrependCount:r,totalAppendCount:o,removedIndices:l}=a,c=l.size>0,h=n.length>0;if(!c&&r===0&&o===0&&!h)return;if(h){this.itemToIndexCache=void 0;return}const d=Bu(l);if(c&&d===0){this.itemToIndexCache=void 0;return}const u=this.itemToIndexCache,p=r-d;if(p!==0)for(const[f,m]of u)l.has(m)?u.delete(f):u.set(f,m+p);else if(c)for(const[f,m]of u)l.has(m)&&u.delete(f);for(let f=0;f0,h=n.length>0;if(!c&&r===0&&o===0&&!h)return;if(h){this.idToIndexCache=void 0;return}const d=Bu(l);if(c&&d===0){this.idToIndexCache=void 0;return}const u=this.idToIndexCache,p=r-d;if(p!==0)for(const[f,m]of u)l.has(m)?u.delete(f):u.set(f,m+p);else if(c)for(const[f,m]of u)l.has(m)&&u.delete(f);for(let f=s.length-1;f>=0;f--){const m=this.getIdValue(s[f]);m!==void 0&&u.set(m,f)}const g=a.finalLength-o;for(let f=0;f0;)i.has(s[n])?(i.delete(s[n]),s.splice(n,1)):n++;if(i.size===0)break}}buildIndexMap(){const e=this.data.length,i=this.collectTransactionEffects(),s=i.prependsList.flat(),n=i.appendsList.flat(),a=i.insertionsList.flat(),r=s.length,o=n.length,l=a.length,c=e-i.removedOriginalIndices.size,h=r+c+l+o,d=i.removedOriginalIndices.size>0?this.getSortedRemovedIndices(i.removedOriginalIndices):void 0,u=this.buildSpliceOperations(r,l,o,c,i.trackedInsertions,d?.desc,d?.asc),p=this.resolveUpdatedIndices(r,l,c,i.updateTracking,d?.asc,i.updatedOriginalIndices,i.trackedInsertions);return{indexMap:{originalLength:e,finalLength:h,spliceOps:u,removedIndices:i.removedOriginalIndices,updatedIndices:p,totalPrependCount:r,totalAppendCount:o},prependValues:s,appendValues:n,insertionValues:a,pendingReplacements:i.pendingReplacements}}getSortedRemovedIndices(e){const i=Array.from(e).sort((s,n)=>s-n);return{asc:i,desc:[...i].reverse()}}collectTransactionEffects(){const e={prependsList:[],appendsList:[],insertionsList:[],trackedInsertions:[],removedOriginalIndices:new Set,updatedOriginalIndices:new Set,virtualLength:this.data.length};for(const i of this.pendingTransactions){const{prepend:s,append:n,insertions:a,remove:r,update:o}=i;this.applyPrepends(s,e),this.applyInsertions(a,e),this.applyAppends(n,e),this.applyRemovals(r,e),this.applyUpdates(o,e)}return{prependsList:e.prependsList,appendsList:e.appendsList,insertionsList:e.insertionsList,trackedInsertions:e.trackedInsertions,removedOriginalIndices:e.removedOriginalIndices,updatedOriginalIndices:e.updatedOriginalIndices,updateTracking:e.updateTracking,pendingReplacements:e.pendingReplacements}}applyPrepends(e,i){!Array.isArray(e)||e.length===0||(i.prependsList.unshift([...e]),i.virtualLength+=e.length)}applyInsertions(e,i){if(Array.isArray(e))for(const{index:s,items:n}of e)s>=0&&s<=i.virtualLength&&n.length>0&&(i.trackedInsertions.push({virtualIndex:s,items:[...n]}),i.insertionsList.push([...n]),i.virtualLength+=n.length)}applyAppends(e,i){!Array.isArray(e)||e.length===0||(i.appendsList.push([...e]),i.virtualLength+=e.length)}applyRemovals(e,i){!Array.isArray(e)||e.length===0||(this.dataIdKey?this.applyRemovalsById(e,i):this.applyRemovalsByRef(e,i))}applyRemovalsByRef(e,i){const s=new Set(e);if(this.removeFromGroups(i.prependsList,s),s.size>0&&this.removeFromGroups(i.insertionsList,s),i.trackedInsertions.length>0&&this.removeFromTrackedInsertions(e,i),s.size>0&&this.removeFromGroups(i.appendsList,s),s.size>0)for(let n=0;n0;n++){const a=this.data[n];s.has(a)&&(i.removedOriginalIndices.add(n),s.delete(a),i.virtualLength--)}s.size>0&&ln.warnOnce("applyTransaction() remove includes items not present in current data; ignoring missing items.")}applyRemovalsById(e,i){const s=new Set;for(const n of e){const a=this.getIdValue(n);a===void 0?ln.warnOnce(`applyTransaction() remove item is missing '${this.dataIdKey}' field; ignoring.`):s.add(a)}if(s.size!==0){if(this.removeFromGroupsById(i.prependsList,s),s.size>0&&this.removeFromGroupsById(i.insertionsList,s),i.trackedInsertions.length>0&&this.removeFromTrackedInsertionsById(e,i),s.size>0&&this.removeFromGroupsById(i.appendsList,s),s.size>0){const n=this.getIdToIndexMap();for(const a of s){const r=n.get(a);r!==void 0&&(i.removedOriginalIndices.add(r),i.virtualLength--,s.delete(a))}}s.size>0&&ln.warnOnce("applyTransaction() remove includes items not present in current data; ignoring missing items.")}}applyUpdates(e,i){!Array.isArray(e)||e.length===0||(this.dataIdKey?this.applyUpdatesById(e,i):this.applyUpdatesByRef(e,i))}applyUpdatesByRef(e,i){const s=new Set(e),n=this.collectUpdatedIndicesFromGroups(i.prependsList,s),a=s.size>0?this.collectUpdatedIndicesFromGroups(i.insertionsList,s):[],r=s.size>0?this.collectUpdatedIndicesFromGroups(i.appendsList,s):[];s.size>0&&this.collectUpdatedOriginalIndices(s,i),i.updateTracking={updatedPrependsIndices:n,updatedAppendsIndices:r,updatedInsertionsIndices:a},s.size>0&&ln.warnOnce("applyTransaction() update includes items not present in current data; ignoring missing items.")}applyUpdatesById(e,i){const s=new Map;for(const o of e){const l=this.getIdValue(o);l===void 0?ln.warnOnce(`applyTransaction() update item is missing '${this.dataIdKey}' field; ignoring.`):s.set(l,o)}if(s.size===0)return;const n=this.collectUpdatedIndicesFromGroupsById(i.prependsList,s),a=s.size>0?this.collectUpdatedIndicesFromGroupsById(i.insertionsList,s):[],r=s.size>0?this.collectUpdatedIndicesFromGroupsById(i.appendsList,s):[];s.size>0&&this.collectUpdatedOriginalIndicesById(s,i),i.updateTracking={updatedPrependsIndices:n,updatedAppendsIndices:r,updatedInsertionsIndices:a},s.size>0&&ln.warnOnce("applyTransaction() update includes items not present in current data; ignoring missing items.")}collectUpdatedIndicesFromGroups(e,i){if(i.size===0||e.length===0)return[];const s=[];let n=0;for(const a of e){for(const r of a)i.has(r)&&(s.push(n),i.delete(r)),n++;if(i.size===0)break}return s}getItemToIndexMap(){if(this.itemToIndexCache===void 0){this.itemToIndexCache=new Map;for(let e=0;e0&&ln.warnOnce(`dataIdKey '${this.dataIdKey}' was not found on any data item.`)}return this.idToIndexCache}removeFromGroupsById(e,i){for(const s of e){let n=0;for(;n0;){const a=this.getIdValue(s[n]);a!==void 0&&i.has(a)?(i.delete(a),s.splice(n,1)):n++}if(i.size===0)break}}collectUpdatedIndicesFromGroupsById(e,i){if(i.size===0||e.length===0)return[];const s=[];let n=0;for(const a of e){for(let r=0;r0&&this.adjustLaterInsertionsAfterRemoval(i.trackedInsertions,s,n,a,r)}}removeFromTrackedInsertionsById(e,i){const s=new Set;for(const n of e){const a=this.getIdValue(n);a!==void 0&&s.add(a)}if(s.size!==0)for(let n=0;n0&&this.adjustLaterInsertionsAfterRemoval(i.trackedInsertions,n,a,r,o),s.size===0)break}}adjustLaterInsertionsAfterRemoval(e,i,s,n,a){const r=a.length;for(let o=i+1;o0&&(l.virtualIndex-=h)}}buildSpliceOperations(e,i,s,n,a,r,o){const l=[];if(e>0&&l.push({index:0,deleteCount:0,insertCount:e}),r&&r.length>0){let c=r[0],h=1;for(let d=1;d0)for(const c of a){const h=this.countRemovalsBeforeIndex(o,e,c.virtualIndex),d=c.virtualIndex-h;l.push({index:d,deleteCount:0,insertCount:c.items.length})}return s>0&&l.push({index:e+n+i,deleteCount:0,insertCount:s}),l}countRemovalsBeforeIndex(e,i,s){if(!e||e.length===0)return 0;let n=0;for(const a of e)if(a+i0){const c=Array.from(r).sort((d,u)=>d-u);let h=0;for(const d of c){if(a)for(;h0&&o.length>0){let h=0;for(const d of o){const u=this.countRemovalsBeforeIndex(a,e,d.virtualIndex),p=d.virtualIndex-u;for(let g=0;gi!==this.chart)}getGroupSyncMode(e=Zs.DEFAULT_GROUP){return this.getGroupMembers(e).some(i=>i.series.length>1)?"multi-series":"single-series"}get(e){return Zs.chartsGroups.get(e)}};sp.chartsGroups=new Map,sp.DEFAULT_GROUP=Symbol("sync-group-default");var u1=sp;import{BaseProperties as p1,Property as np}from"ag-charts-core";var _c=class extends p1{constructor(){super(...arguments),this.enabled=!1,this.initialFocus="data-start"}};y([np],_c.prototype,"enabled",2),y([np],_c.prototype,"tabIndex",2),y([np],_c.prototype,"initialFocus",2);import{ChartAxisDirection as ap,Property as Fc,StateMachine as g1,arraysEqual as f1,calcLineHeight as Ax,countLines as m1,diffArrays as y1,findMinMax as b1,isPlainObject as x1}from"ag-charts-core";var Cx={};Un(Cx,{NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Vi,fromToMotion:()=>Ee,staticFromToMotion:()=>Ns});import{easeOut as rp}from"ag-charts-core";var Vi={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function Ee(t,e,i,s,n,a,r){const{fromFn:o,toFn:l,applyFn:c=(g,f)=>g.setProperties(f)}=n,{nodes:h,selections:d}=Lu(s),u=(g,f)=>{let m,b=0,x=0;for(const v of f){const S=g[b]===v,I={last:x>=f.length-1,lastLive:b>=g.length-1,prev:f[x-1],prevFromProps:m,prevLive:g[b-1],next:f[x+1],nextLive:g[b+(S?1:0)]},M=`${t}_${e}_${v.id}`;i.stopByAnimationId(M);let D="unknown";S?a&&r&&(D=v1(v,v.datum,a,r)):D="removed",v.transitionOut=D==="removed";const{phase:A,start:C,finish:T,delay:L,duration:k,...O}=o(v,v.datum,D,I),{phase:N,start:w,finish:R,delay:F,duration:E,...V}=l(v,v.datum,D,I),Z=T==null;i.animate({id:M,groupId:t,phase:A??N??"update",duration:k??E,delay:L??F,from:O,to:V,ease:rp,collapsable:Z,onPlay:()=>{const Y={...C,...w,...O};c(v,Y,"start")},onUpdate(Y){c(v,Y,"update")},onStop:()=>{const Y={...C,...w,...O,...V,...T,...R};c(v,Y,"end")}}),S&&b++,x++,m=O}};let p=0;for(const g of d){const f=g.nodes(),m=f.filter(b=>!g.isGarbage(b));u(m,f),i.animate({id:`${t}_${e}_selection_${p}`,groupId:t,phase:"end",from:0,to:1,ease:rp,onStop(){g.cleanup()}}),p++}u(h,h)}function Ns(t,e,i,s,n,a,r){const{nodes:o,selections:l}=Lu(s),{start:c,finish:h,phase:d}=r;i.animate({id:`${t}_${e}`,groupId:t,phase:d??"update",from:n,to:a,ease:rp,onPlay:()=>{if(c){for(const u of o)u.setProperties(c);for(const u of l){const p=u.nodes();u.batchedUpdate(function(){for(const f of p)f.setProperties(c)})}}},onUpdate(u){for(const p of o)p.setProperties(u);for(const p of l){const g=p.nodes();p.batchedUpdate(function(){for(const m of g)m.setProperties(u)})}},onStop:()=>{for(const u of o)u.setProperties({...a,...h});for(const u of l){const p=u.nodes();u.batchedUpdate(function(){for(const f of p)f.setProperties({...a,...h});u.cleanup()})}}})}function v1(t,e,i,s){const n=i(t,e);return s.added.has(n)?"added":s.removed.has(n)?"removed":t.previousDatum==null&&t.datum!=null?"added":t.previousDatum!=null&&t.datum==null?"removed":"updated"}var Tx={};Un(Tx,{resetMotion:()=>ot});function ot(t,e){const{nodes:i,selections:s}=Lu(t);for(const n of s){const a=n.nodes();n.batchedUpdate(function(){for(const o of a){const l=e(o,o.datum);o.setProperties(l)}n.cleanup()})}for(const n of i){const a=e(n,n.datum);n.setProperties(a)}}import{Debug as S1}from"ag-charts-core";var Re=class $a{constructor(e,i,s=!0){this.parentNode=e,this.autoCleanup=s,this.garbageBin=new Set,this._nodesMap=new Map,this._nodes=[],this.data=[],this.debug=S1.create(!0,"scene","scene:selections"),this.nodeFactory=Object.prototype.isPrototypeOf.call(Ms,i)?()=>new i:i}static select(e,i,s=!0){return new $a(e,i,s)}static selectAll(e,i){const s=[],n=a=>{if(i(a)&&s.push(a),a instanceof U)for(const r of a.children())n(r)};return n(e),s}static selectByClass(e,...i){return $a.selectAll(e,s=>i.some(n=>s instanceof n))}static selectByTag(e,i){return $a.selectAll(e,s=>s.tag===i)}createNode(e,i,s){const n=this.nodeFactory(e);return n.datum=e,i?.(n),s==null?this._nodes.push(n):this._nodes.splice(s,0,n),this.parentNode.appendChild(n),n}update(e,i,s){if(this.garbageBin.size>0&&this.debug("Selection - update() called with pending garbage",e),s&&this._nodesMap.size===0&&this._nodes.length>0)for(const n of this._nodes)this.garbageBin.add(n);if(!s&&this._nodesMap.size>0&&this._nodesMap.clear(),s){const n=new Map,a=new Map;for(let r=0;r=e.length?this.garbageBin.add(this._nodes[a]):a>=this._nodes.length?this.createNode(e[a],i):(this._nodes[a].datum=e[a],this.garbageBin.delete(this._nodes[a]))}return this.data=e.slice(),this.autoCleanup&&this.cleanup(),this}cleanup(){if(this.garbageBin.size===0)return this;const e=this;function i(s){return e.garbageBin.has(s)?(e._nodesMap.delete(s),e.garbageBin.delete(s),s.destroy(),!1):!0}return this._nodes=this._nodes.filter(i),this}clear(){this.update([]);for(const e of this._nodesMap.keys())this.garbageBin.add(e);return this._nodesMap.clear(),this}isGarbage(e){return this.garbageBin.has(e)}each(e){const i=this._nodes;return this.parentNode.batchedUpdate(function(){for(const n of i.entries())e(n[1],n[1].datum,n[0])}),this}*[Symbol.iterator](){for(let e=0;eF1(a,s)&&!Number.isNaN(e.convert(a,{clamp:!0}));if(t.type==="range"){const[a,r]=i;return n(a)&&n(r)}else return n(i)}var V1={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:1},"top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:-1},"bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},B1={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:-1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:-1,labelV:-1},"inside-top-right":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},z1={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},G1={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:-1,labelV:-1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},la=class extends oi{constructor(){super(...arguments),this.padding=5}};y([ct],la.prototype,"enabled",2),y([ct],la.prototype,"padding",2),y([ct],la.prototype,"text",2),y([ct],la.prototype,"position",2),y([ct],la.prototype,"rotation",2),y([ct],la.prototype,"parallel",2);var Nt=class extends R1{constructor(){super(),this.id=P1(this),this.defaultColorRange=[],this.fill="#c16068",this.label=new la,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.gridPadding=0,this.position="top",this.rangeGroup=new U({name:this.id}),this.lineGroup=new U({name:this.id}),this.labelGroup=new U({name:this.id}),this.crossLineRange=this.lineGroup.appendChild(new ls),this.crossLineLabel=this.labelGroup.appendChild(new sr),this.data=void 0,this.startLine=!1,this.endLine=!1,this._isRange=void 0,this.crossLineRange.pointerEvents=1}get defaultLabelPosition(){return"top"}update(t){const{enabled:e,type:i,data:s,scale:n}=this;if(!n||!e||!t||!Px(this,n)||s==null){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.rangeGroup.visible=t,this.lineGroup.visible=t,this.labelGroup.visible=t,this.updateNodes();const a=i==="range";a!==this._isRange&&(a?this.rangeGroup.appendChild(this.crossLineRange):this.lineGroup.appendChild(this.crossLineRange)),this._isRange=a}calculateLayout(t){if(this.data=void 0,!t)return;const{type:e,range:i,value:s,scale:n,clippedRange:a,strokeWidth:r=0}=this;if(!n)return;const o=n.bandwidth??0,l=n.step??0,c=n instanceof Fi?(l-o)/2:0;let[h,d]=_1(a);h-=o,d+=o;let u,p,g,f;if(e==="line"){const m=o/2;if(u=n.convert(s)+m,p=Number.NaN,g=n.convert(s,{clamp:!0})+m,f=Number.NaN,g>=d||g<=h)return}else if(i){const[m,b]=i,[x,v]=gx(m,b);if(u=n.convert(m,{alignment:x}),p=n.convert(b,{alignment:v}),g=n.convert(m,{clamp:!0,alignment:x}),f=n.convert(b,{clamp:!0,alignment:v}),g>f&&([g,f]=[f,g],[u,p]=[p,u]),g>=d||f<=h)return;Number.isFinite(u)&&(g-=c),Number.isFinite(p)&&(p+=o,f+=o+c)}else return;g=Ox(g,a),f=Ox(f,a),u-c>=g&&(u-=c),p+c<=f&&(p+=c),this.startLine=r>0&&u>=g&&u<=g+c,this.endLine=r>0&&p>=f-o-c&&p<=f,this.data=[g,f],this.label.enabled===!1||this.label.text}updateNodes(){const{position:t,data:[e,i]=[0,0],gridLength:s,gridPadding:n}=this,a=Number.isFinite(i)?i-e:0,r=t==="bottom"||t==="right"?-1:1,o=Math.min(r*n,r*(s+n));let l;switch(t){case"top":case"bottom":l=new P(e,o,a,s);break;case"left":case"right":l=new P(o,e,s,a)}this.updateRangeNode(l);const{label:c}=this;c.enabled!==!1&&c.text&&(this.updateLabel(),this.positionLabel(l))}updateRangeNode(t){const{type:e,position:i,crossLineRange:s,startLine:n,endLine:a,fill:r,fillOpacity:o,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:d}=this;s.x1=t.x,s.x2=t.x+t.width,s.y1=t.y,s.y2=t.y+t.height,s.horizontal=i==="top"||i==="bottom",s.startLine=n,s.endLine=a,s.fill=e==="range"?r:void 0,s.fillOpacity=o??1,s.stroke=l,s.strokeWidth=c??1,s.strokeOpacity=h??1,s.lineDash=d}updateLabel(){const{crossLineLabel:t,label:e}=this;e.text&&(t.fill=e.color,t.text=e.text,t.textAlign="center",t.textBaseline="middle",t.setFont(e),t.setBoxing(e))}get anchor(){const t=this.position==="left"||this.position==="right",e=this.type==="range",{position:i=this.defaultLabelPosition}=this.label;return e?(t?z1:G1)[i]:(t?V1:B1)[i]}positionLabel(t){const{crossLineLabel:e,label:{padding:i,rotation:s},anchor:n}=this;e.rotation=Ex(s??0);const a=e.getBBox();if(!a)return;const{width:r,height:o}=a,l=typeof i=="number"?0:(i.right??0)-(i.left??0),c=typeof i=="number"?0:(i.bottom??0)-(i.top??0);let h=r/2,d=o/2;typeof i=="number"&&!e.hasBoxing()&&(h+=i,d+=i);const u=t.x+t.width*(n.rangeH+1)/2-h*n.labelH-l/2,p=t.y+t.height*(n.rangeV+1)/2-d*n.labelV-c/2;e.x=u,e.y=p,e.rotationCenterX=u,e.rotationCenterY=p}computeLabelSize(){const{label:t}=this;if(t.enabled===!1||!t.text)return;const e=new sr;e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.text=t.text,e.rotation=Ex(t.rotation??0),e.textBaseline="middle",e.textAlign="center";const i=e.getBBox();if(!i)return;const{width:s,height:n}=i;return{width:s,height:n}}calculatePadding(t){const{label:{padding:e},anchor:i}=this,s=this.computeLabelSize();if(!s)return;const{width:n,height:a}=s,r=typeof e=="number"?e*2:(e.left??0)+(e.right??0),o=typeof e=="number"?e*2:(e.top??0)+(e.bottom??0),l=r+n,c=o+a,h=this.position==="left"||this.position==="right";h&&(i.rangeH===-1&&i.labelH===1?t.left=Math.max(t.left??0,l):i.rangeH===1&&i.labelH===-1&&(t.right=Math.max(t.right??0,l))),h||(i.rangeV===-1&&i.labelV===1?t.top=Math.max(t.top??0,c):i.rangeV===1&&i.labelV===-1&&(t.bottom=Math.max(t.bottom??0,c)))}};Nt.className="CrossLine",y([ct],Nt.prototype,"enabled",2),y([ct],Nt.prototype,"type",2),y([ct],Nt.prototype,"range",2),y([ct],Nt.prototype,"value",2),y([ct],Nt.prototype,"defaultColorRange",2),y([ct],Nt.prototype,"fill",2),y([ct],Nt.prototype,"fillOpacity",2),y([ct],Nt.prototype,"stroke",2),y([ct],Nt.prototype,"strokeWidth",2),y([ct],Nt.prototype,"strokeOpacity",2),y([ct],Nt.prototype,"lineDash",2),y([ct],Nt.prototype,"label",2);import{Property as lp}from"ag-charts-core";var Bc=class{constructor(){this.enabled=!0,this.width=1,this.style=[{fill:void 0,fillOpacity:1,stroke:void 0,strokeWidth:void 0,lineDash:[]}]}};y([lp],Bc.prototype,"enabled",2),y([lp],Bc.prototype,"width",2),y([lp],Bc.prototype,"style",2);import{BaseProperties as U1,Property as Go}from"ag-charts-core";var ca=class extends U1{};y([Go],ca.prototype,"placement",2),y([Go],ca.prototype,"step",2),y([Go],ca.prototype,"values",2),y([Go],ca.prototype,"minSpacing",2),y([Go],ca.prototype,"maxSpacing",2);import{BaseProperties as H1,Property as Le,isArray as j1,objectsEqual as W1}from"ag-charts-core";var ue=class extends H1{constructor(){super(...arguments),this.enabled=!0,this.border=new oa,this.wrapping="never",this.truncate=!1,this.spacing=5,this.avoidCollisions=!0,this.mirrored=!1,this.parallel=!1,this._formatters={"component:year":void 0,"component:month":void 0,"component:day":void 0,"component:none":void 0,"long:year":void 0,"long:month":void 0,"long:day":void 0,"long:none":void 0}}getSideFlag(){return this.mirrored?1:-1}formatValue(t,e,i,s){const{formatter:n,format:a}=this,{type:r,value:o,domain:l,boundSeries:c}=e,h=e.type==="number"?e.fractionDigits:void 0,d=e.type==="date"?e.unit:void 0;let u;if(n!=null){const p=e.type==="date"?e.step:void 0,g=e.type==="number"?e.visibleDomain:void 0;u=t(n,{value:o,index:i,domain:l,fractionDigits:h,unit:d,step:p,boundSeries:c,visibleDomain:g})}if(a!=null&&u==null){const{specifier:p,dateStyle:g="long",truncateDate:f}=s??{},m=`${g}:${f??"none"}`;let b=this._formatters[m];const x=hr.mergeSpecifiers(p,a);(b?.type!==r||b?.unit!==d||!W1(b?.mergedFormat,x))&&(b={type:r,mergedFormat:x,unit:d,formatter:hr.getFormatter(r,x,d,g,{truncateDate:f})},this._formatters[m]=b),u=b.formatter?.(o,h)}return u==null||j1(u)?u:String(u)}};y([Le],ue.prototype,"enabled",2),y([Le],ue.prototype,"border",2),y([Le],ue.prototype,"cornerRadius",2),y([Le],ue.prototype,"fill",2),y([Le],ue.prototype,"fillOpacity",2),y([Le],ue.prototype,"fontStyle",2),y([Le],ue.prototype,"fontWeight",2),y([Le],ue.prototype,"fontSize",2),y([Le],ue.prototype,"fontFamily",2),y([Le],ue.prototype,"wrapping",2),y([Le],ue.prototype,"truncate",2),y([Le],ue.prototype,"spacing",2),y([Le],ue.prototype,"minSpacing",2),y([Le],ue.prototype,"color",2),y([Le],ue.prototype,"rotation",2),y([Le],ue.prototype,"avoidCollisions",2),y([Le],ue.prototype,"mirrored",2),y([Le],ue.prototype,"padding",2),y([Le],ue.prototype,"parallel",2),y([Le],ue.prototype,"itemStyler",2),y([Le],ue.prototype,"formatter",2),y([Le],ue.prototype,"format",2);import{Property as cp}from"ag-charts-core";var zc=class{constructor(){this.enabled=!0,this.width=1,this.stroke=void 0}};y([cp],zc.prototype,"enabled",2),y([cp],zc.prototype,"width",2),y([cp],zc.prototype,"stroke",2);import{BaseProperties as Y1,Property as Gc}from"ag-charts-core";var ha=class extends Y1{constructor(){super(...arguments),this.enabled=!0,this.width=1,this.size=6}};y([Gc],ha.prototype,"enabled",2),y([Gc],ha.prototype,"width",2),y([Gc],ha.prototype,"size",2),y([Gc],ha.prototype,"stroke",2);import{BaseProperties as $1,FONT_SIZE as K1,Property as ci}from"ag-charts-core";var Yt=class extends $1{constructor(){super(...arguments),this.caption=new Se,this.enabled=!1,this.fontSize=K1.SMALLER,this.fontFamily="sans-serif",this.wrapping="always",this.truncate=!0}};y([ci],Yt.prototype,"enabled",2),y([ci],Yt.prototype,"text",2),y([ci],Yt.prototype,"spacing",2),y([ci],Yt.prototype,"fontStyle",2),y([ci],Yt.prototype,"fontWeight",2),y([ci],Yt.prototype,"fontSize",2),y([ci],Yt.prototype,"fontFamily",2),y([ci],Yt.prototype,"color",2),y([ci],Yt.prototype,"maxWidth",2),y([ci],Yt.prototype,"maxHeight",2),y([ci],Yt.prototype,"wrapping",2),y([ci],Yt.prototype,"truncate",2),y([ci],Yt.prototype,"formatter",2);import{findMinMax as Z1}from"ag-charts-core";var _x=(t=>(t[t.TickAndDomain=0]="TickAndDomain",t[t.TicksOnly=1]="TicksOnly",t[t.Off=2]="Off",t))(_x||{});function X1(t){const[e,i]=Z1(t.range),s=Math.floor(e),n=Math.ceil(i);return{min:s,max:n,visible:s!==n}}var hp=Math.PI*2,q1=hp/2;function J1(t,e){return Math.abs(e-t)e?e+hp:e-hp}function Q1(t){const{min:e,max:i}=t,s=l=>li;return{tick:{fromFn(l,c,h){let{x1:d,x2:u,y1:p,y2:g}=l,f=l.opacity;return(h==="added"||s(c.offset))&&({x1:d,x2:u,y1:p,y2:g}=c,f=0),{x1:d,x2:u,y1:p,y2:g,opacity:f,phase:Vi[h]}},toFn(l,c,h){const{x1:d,x2:u,y1:p,y2:g}=c;let f=1;return h==="removed"&&(f=0),{x1:d,x2:u,y1:p,y2:g,opacity:f}},applyFn(l,c){l.setProperties(c),l.visible=!s(l.y)}},line:{fromFn(l,c){const{x1:h,x2:d,y1:u,y2:p}=l.previousDatum??c;return{x1:h,x2:d,y1:u,y2:p,phase:Vi.updated}},toFn(l,c){const{x1:h,x2:d,y1:u,y2:p}=c;return{x1:h,x2:d,y1:u,y2:p}}},label:{fromFn(l,c,h){const d=l.previousDatum??c;let{x:u,y:p,rotationCenterX:g,rotationCenterY:f,rotation:m}=d,b=l.opacity;return h==="removed"||s(d.y)?m=c.rotation:(h==="added"||s(l.datum.y))&&({x:u,y:p,rotationCenterX:g,rotationCenterY:f,rotation:m}=c,b=0),{x:u,y:p,rotationCenterX:g,rotationCenterY:f,rotation:m,opacity:b,phase:Vi[h]}},toFn(l,c,h){const{x:d,y:u,rotationCenterX:p,rotationCenterY:g}=c;let f=0,m=1;return h==="added"?f=c.rotation:h==="removed"?(m=0,f=c.rotation):f=J1(l.previousDatum?.rotation??c.rotation,c.rotation),{x:d,y:u,rotationCenterX:p,rotationCenterY:g,rotation:f,opacity:m,finish:{rotation:c.rotation}}}},group:{fromFn(l,c){const{translationX:h,translationY:d}=l;return{translationX:h,translationY:d,phase:Vi.updated}},toFn(l,c){const{translationX:h,translationY:d}=c;return{translationX:h,translationY:d}}}}}function eR(){return(t,e)=>({translationX:e.translationX,translationY:e.translationY})}function Uc(){return(t,e)=>({x:e.x,y:e.y,rotationCenterX:e.rotationCenterX,rotationCenterY:e.rotationCenterY,rotation:e.rotation})}function Fx(){return(t,e)=>{const{x1:i,x2:s,y1:n,y2:a}=e;return{x1:i,x2:s,y1:n,y2:a}}}function tR(){return(t,e)=>{const{x1:i,x2:s,y1:n,y2:a}=e;return{x:i,y:n,width:s-i,height:a-n}}}var Vx=(t=>(t[t.TickLines=0]="TickLines",t[t.AxisLine=1]="AxisLine",t[t.TickLabels=2]="TickLabels",t))(Vx||{});function Bx(t,e){return t.domain===e.domain&&t.rangeExtent===e.rangeExtent&&t.nice[0]===e.nice[0]&&t.nice[1]===e.nice[1]&&t.gridLength===e.gridLength&&t.visibleRange[0]===e.visibleRange[0]&&t.visibleRange[1]===e.visibleRange[1]&&t.scrollbarKey===e.scrollbarKey&&t.initialPrimaryTickCount?.unzoomed===e.initialPrimaryTickCount?.unzoomed&&t.initialPrimaryTickCount?.zoomed===e.initialPrimaryTickCount?.zoomed}function zx(t,e,i){const s=t.bandwidth??0,a=((t.step??0)-s)/2,r=t.convert(i),o=r-a,l=r+s+a;return[r,Nx(o,e),Nx(l,e)]}var cn=class NC{constructor(e,i){this.moduleCtx=e,this.scale=i,this.id="unknown",this._crossLines=[],this.nice=!0,this.reverse=!1,this.interval=new ca,this.dataDomain={domain:[],clipped:!1},this.allowNull=!1,this.title=new Yt,this.gridLength=0,this.gridPadding=0,this.seriesAreaPadding=0,this.layoutConstraints={stacked:!0,align:"justify",width:100,unit:"percent"},this.boundSeries=[],this.includeInvisibleDomains=!1,this.interactionEnabled=!0,this.axisGroup=new U({name:`${this.id}-axis`}),this.tickLineGroup=this.axisGroup.appendChild(new er({name:`${this.id}-Axis-tick-lines`,zIndex:0})),this.tickLabelGroup=this.axisGroup.appendChild(new er({name:`${this.id}-Axis-tick-labels`,zIndex:2})),this.labelGroup=new U({name:`${this.id}-Labels`,zIndex:zo.SERIES_ANNOTATION}),this.gridGroup=new mt({name:`${this.id}-Axis-grid`,zIndex:zo.AXIS_GRID}),this.gridFillGroup=this.gridGroup.appendChild(new U({name:`${this.id}-gridFills`})),this.gridLineGroup=this.gridGroup.appendChild(new U({name:`${this.id}-gridLines`})),this.crossLineRangeGroup=new er({name:`${this.id}-CrossLines-Range`,zIndex:zo.SERIES_CROSSLINE_RANGE}),this.crossLineLineGroup=new er({name:`${this.id}-CrossLines-Line`,zIndex:zo.SERIES_CROSSLINE_LINE}),this.crossLineLabelGroup=new er({name:`${this.id}-CrossLines-Label`,zIndex:zo.SERIES_LABEL}),this.tickLabelGroupSelection=Re.select(this.tickLabelGroup,sr,!1),this.line=new zc,this.tick=new ha,this.gridLine=new Bc,this.label=this.createLabel(),this.defaultTickMinSpacing=NC.defaultTickMinSpacing,this.translation={x:0,y:0},this.layout={label:{fractionDigits:0,spacing:this.label.spacing,format:this.label.format},labelThickness:0},this.axisContext=void 0,this.cleanup=new L1,this.isHovering=!1,this.range=[0,1],this.visibleRange=[0,1],this.animatable=!0,this.tickLayout=void 0,this.formatterBoundSeries=new k1(()=>{const{direction:s,boundSeries:n}=this;return w1(n.flatMap(a=>a.getFormatterContext(s)))}),this.moduleMap=new op,this.range=this.scale.range.slice();for(const s of this.crossLines)this.initCrossLine(s);this.cleanup.register(this.moduleCtx.widgets.containerWidget.addListener("mousemove",s=>this.onMouseMove(s)),this.moduleCtx.widgets.containerWidget.addListener("mouseleave",()=>this.endHovering()))}set crossLines(e){const{CrossLineConstructor:i}=this.constructor;for(const s of this._crossLines)this.detachCrossLine(s);this._crossLines=e.map(s=>{const n=new i;return n.set(s),n});for(const s of this._crossLines)this.attachCrossLine(s),this.initCrossLine(s)}get crossLines(){return this._crossLines}get type(){return this.constructor.type??""}get primaryLabel(){}get primaryTick(){}isCategoryLike(){return!1}resetAnimation(e){}onMouseMove(e){const s=this.tickLabelGroup.pickNode(e.currentX,e.currentY)?.datum,{textUntruncated:n=void 0}=s??{};n?(this.moduleCtx.tooltipManager.updateTooltip(this.id,{canvasX:e.currentX,canvasY:e.currentY,showArrow:!1},[{type:"structured",title:n}]),this.isHovering=!0):this.endHovering()}endHovering(){this.isHovering&&(this.moduleCtx.tooltipManager.removeTooltip(this.id,void 0,!0),this.isHovering=!1)}attachCrossLine(e){this.crossLineRangeGroup.appendChild(e.rangeGroup),this.crossLineLineGroup.appendChild(e.lineGroup),this.crossLineLabelGroup.appendChild(e.labelGroup)}detachCrossLine(e){e.rangeGroup.remove(),e.lineGroup.remove(),e.labelGroup.remove()}destroy(){this.moduleMap.destroy(),this.cleanup.flush()}setScaleRange(e){const{range:i,scale:s}=this,n=(i[1]-i[0])/(e[1]-e[0]),a=n*e[0],r=i[0]-a;s.range=[r,r+n]}updateScale(){const{range:[e,i]}=this;this.setScaleRange(this.visibleRange);for(const s of this.crossLines)s.clippedRange=[e,i]}setCrossLinesVisible(e){this.crossLineRangeGroup.visible=e,this.crossLineLineGroup.visible=e,this.crossLineLabelGroup.visible=e}attachAxis(e){e.gridNode.appendChild(this.gridGroup),e.axisNode.appendChild(this.axisGroup),e.labelNode.appendChild(this.labelGroup),e.crossLineRangeNode.appendChild(this.crossLineRangeGroup),e.crossLineLineNode.appendChild(this.crossLineLineGroup),e.crossLineLabelNode.appendChild(this.crossLineLabelGroup)}detachAxis(){this.gridGroup.remove(),this.axisGroup.remove(),this.labelGroup.remove(),this.crossLineRangeGroup.remove(),this.crossLineLineGroup.remove(),this.crossLineLabelGroup.remove()}attachLabel(e){this.labelGroup.append(e)}inRange(e,i=0){const[s,n]=kx(this.range);return e>=s-i&&e<=n+i}getRangeOverflow(e){const{range:i,visibleRange:s}=this,n=(i[1]-i[0])/(s[1]-s[0]),[a,r]=kx([i[0]-n*s[0],i[0]-n*s[0]+n]);return er?e-r:0}onGridLengthChange(e,i){i^e&&this.onGridVisibilityChange();for(const s of this.crossLines)this.initCrossLine(s)}onGridVisibilityChange(){}createLabel(){return new ue}update(){this.formatterBoundSeries.clear(),this.updatePosition(),this.updateSelections(),this.gridLineGroup.visible=this.gridLine.enabled,this.updateLabels(),this.updateCrossLines()}getLabelStyles(e,i,s=this.label){const n={border:s.border,color:s.color,cornerRadius:s.cornerRadius,fill:s.fill,fillOpacity:s.fillOpacity,fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight,padding:s.padding,spacing:s.spacing};let a;s.itemStyler&&(a=this.cachedCallWithContext(s.itemStyler,{...e,...n}));const r=E1(a,i,n);return{border:r.border,color:r.color,cornerRadius:r.cornerRadius,fill:r.fill,fillOpacity:r.fillOpacity,fontFamily:r.fontFamily,fontSize:r.fontSize,fontStyle:r.fontStyle,fontWeight:r.fontWeight,padding:r.padding,spacing:r.spacing}}getTickSize(e=this.tick){return e.enabled?e.size:0}getTickSpacing(e=this.tick){if(!e.enabled)return 0;const i=this.chartLayout?.scrollbars?.[this.id];return!i?.enabled||i.placement!=="inner"?0:i.tickSpacing??0}processData(){this.invalidateLayoutCache();const{includeInvisibleDomains:e,boundSeries:i,direction:s}=this,a=(e?i:i.filter(r=>r.isEnabled())).map(r=>r.getDomain(s));this.setDomains(...a)}getDomainExtentsNice(){return[this.nice,this.nice]}setDomains(...e){let i,s;if(e.length>0){const n=this.scale.normalizeDomains(...e);i={domain:n.domain,sortMetadata:{sortOrder:1}},s=n.animatable}else i={domain:[]},s=!0;this.dataDomain=this.normaliseDataDomain(i),this.allowNull=this.dataDomain.domain.some(function(n){return n==null}),this.reverse&&(this.dataDomain={...this.dataDomain,domain:this.dataDomain.domain.toReversed()}),this.animatable=s}calculateDomain(e,i="none"){const{dataDomain:{domain:s},range:n,scale:a,gridLength:r}=this,o=wx(n),l=[0,1],c=this.getDomainExtentsNice();this.updateScale();const{unzoomedTickLayoutCache:h}=this;let d;if(h==null||!Bx(h,{domain:s,rangeExtent:o,nice:c,gridLength:r,visibleRange:l,initialPrimaryTickCount:e,scrollbarKey:i})){const u=a.range;this.setScaleRange([0,1]);const p=c.map(g=>g?0:2);d=this.calculateTickLayout(s,p,[0,1],e),a.range=u,this.unzoomedTickLayoutCache={domain:s,rangeExtent:o,nice:c,gridLength:r,visibleRange:l,initialPrimaryTickCount:e,scrollbarKey:i,tickLayout:d}}else d=h.tickLayout;return this.updateScale(),a.domain=d.niceDomain,{unzoomedTickLayout:d,domain:a.domain}}calculateLayout(e,i){this.chartLayout=i;const s=this.getScrollbarLayoutCacheKey(i),{visibleRange:n}=this,a=n[0]===0&&n[1]===1,{unzoomedTickLayout:r,domain:o}=this.calculateDomain(e,s),l=this.getDomainExtentsNice();let c;if(a)c=r;else{const{range:f,gridLength:m}=this,b=wx(f),x=l.map(S=>S?1:2),{tickLayoutCache:v}=this;v==null||!Bx(v,{domain:o,rangeExtent:b,nice:l,gridLength:m,visibleRange:n,initialPrimaryTickCount:e,scrollbarKey:s})?(c=this.calculateTickLayout(o,x,n,e),this.tickLayoutCache={domain:o,rangeExtent:b,nice:l,gridLength:m,visibleRange:n,initialPrimaryTickCount:e,scrollbarKey:s,tickLayout:c}):c=v.tickLayout}const{rawTickCount:h=0,fractionDigits:d,bbox:u}=c,p=r.rawTickCount??0,g=h!==0&&p!==0?{zoomed:h,unzoomed:p}:void 0;return this.tickLayout=c.layout,this.layout.label={fractionDigits:d,spacing:this.label.spacing,format:this.label.format},this.layoutCrossLines(),{primaryTickCount:g,bbox:u}}invalidateLayoutCache(){this.unzoomedTickLayoutCache=void 0,this.tickLayoutCache=void 0,this.tickLayout=void 0}getScrollbarLayoutCacheKey(e){const i=e?.scrollbars?.[this.id];return i?.enabled?`${i.placement}:${i.spacing}:${i.thickness}:${i.tickSpacing}`:"none"}updateCrossLines(){const e=this.hasDefinedDomain()||this.hasVisibleSeries();for(const i of this.crossLines)i.gridPadding=this.gridPadding,i.update(e)}updatePosition(){const{crossLineRangeGroup:e,crossLineLineGroup:i,crossLineLabelGroup:s,gridGroup:n,translation:a}=this,r=Math.floor(a.x),o=Math.floor(a.y);n.setProperties({translationX:r,translationY:o}),e.setProperties({translationX:r,translationY:o}),i.setProperties({translationX:r,translationY:o}),s.setProperties({translationX:r,translationY:o})}tickFormatter(e,i,s,n,a,r="long"){const{moduleCtx:o,label:l}=this,{formatManager:c}=o,h=s?this.primaryLabel:void 0,d=this.tickFormatParams(e,i,n,a),u=this.formatterBoundSeries.get();let p,g,f;if(d.type==="number")p=d.fractionDigits;else if(d.type==="date"){const{unit:M,step:D,epoch:A}=d;g={unit:M,step:D,epoch:A},f=d.truncateDate}const m=this.uncachedCallWithContext.bind(this),b={datum:void 0,seriesId:void 0,legendItemName:void 0,key:void 0,source:"axis-label",property:this.getFormatterProperty(),domain:e,boundSeries:u},x=h??l,v=s?l.format:void 0,{allowNull:S}=this,I={specifier:hr.mergeSpecifiers(h?.format,l.format),truncateDate:f,allowNull:S};return(M,D)=>{const A=this.datumFormatParams(M,b,p,g,r);return A.value=M,x.formatValue(m,A,D,{specifier:v,dateStyle:r,truncateDate:f})??c.format(m,A,I)??c.defaultFormat(A,I)}}formatDatum(e,i,s,n,a,r,o,l,c,h,d){if(i==null&&!d)return"";const{moduleCtx:u,dataDomain:p}=this;l??(l=p.domain);const{formatManager:g}=u,f=this.formatterBoundSeries.get();let m;switch(s){case"crosshair":case"annotation-label":m=this.layout.label.fractionDigits+1;break;case"series-label":m=2;break;case"tooltip":m=3;break;case"legend-label":m=void 0;break}const b=this.datumFormatParams(i,{source:s,datum:r,seriesId:n,legendItemName:a,key:o,property:this.getFormatterProperty(),domain:l,boundSeries:f},m,void 0,"long"),{type:x,value:v}=b,S=this.createCallWithContext(e),I=c?.formatValue(S,x,v,h??b)??g.format(S,b,{allowNull:d})??this.label.formatValue(S,b,Number.NaN)??g.defaultFormat(b);return O1(I)?I:String(I)}getBBox(){return this.axisGroup.getBBox()}initCrossLine(e){e.scale=this.scale,e.gridLength=this.gridLength,e.gridPadding=this.gridPadding}hasVisibleSeries(){return this.boundSeries.some(e=>e.isEnabled())}clipTickLines(e,i,s,n){this.tickLineGroup.setClipRect(new P(e,i,s,n))}clipGrid(e,i,s,n){this.gridGroup.setClipRect(new P(e,i,s,n))}getFormatterProperty(){const{direction:e,boundSeries:i}=this;let s=e;for(const n of i){const a=n.resolveKeyDirection(e);if(a!==e){s=a;break}}return s}getTitleFormatterParams(e){const{direction:i}=this,s=this.formatterBoundSeries.get();return{domain:e,direction:i,boundSeries:s,defaultValue:this.title?.text}}normaliseDataDomain(e){return{domain:[...e.domain],clipped:!1}}getLayoutTranslation(){return this.translation}getLayoutState(){return{id:this.id,rect:this.getBBox(),translation:this.getLayoutTranslation(),gridPadding:this.gridPadding,seriesAreaPadding:this.seriesAreaPadding,tickSize:this.getTickSize(),direction:this.direction,domain:this.dataDomain.domain,scale:this.scale,...this.layout}}getModuleMap(){return this.moduleMap}getUpdateTypeOnResize(){return T1.PERFORM_LAYOUT}createModuleContext(){return this.axisContext??(this.axisContext=this.createAxisContext()),{...this.moduleCtx,parent:this.axisContext}}createAxisContext(){const{scale:e}=this;return{axisId:this.id,scale:this.scale,direction:this.direction,continuous:re.is(e)||Ls.is(e),getCanvasBounds:()=>fe.toCanvas(this.axisGroup),seriesKeyProperties:()=>this.boundSeries.reduce((i,s)=>{const n=s.getKeyProperties(this.direction);for(const a of n)i.add(a);return i},new Set),seriesIds:()=>this.boundSeries.map(i=>i.id),scaleInvert:i=>e.invert(i,!0),scaleInvertNearest:i=>e.invert(i,!0),formatScaleValue:(i,s,n)=>{const{allowNull:a}=this;return this.formatDatum(void 0,i,s,void 0,void 0,void 0,void 0,void 0,n,void 0,a)},attachLabel:i=>this.attachLabel(i),inRange:(i,s)=>this.inRange(i,s),getRangeOverflow:i=>this.getRangeOverflow(i),pickBand:i=>this.pickBand(i),measureBand:i=>this.measureBand(i)}}pickBand(e){if(!Fi.is(this.scale))return;const{scale:i,range:s,id:n}=this,a=i.invert(this.isVertical()?e.y:e.x,!0),[r,o,l]=zx(i,s,a);return{id:n,value:a,band:[o,l],position:r}}measureBand(e){if(!Fi.is(this.scale))return;const[,i,s]=zx(this.scale,this.range,e);return{band:[i,s]}}isVertical(){return this.direction===C1.Y}isReversed(){return this.reverse}cachedCallWithContext(e,i){const{callbackCache:s,chartService:n}=this.moduleCtx;return s.call([this,n],e,i)}uncachedCallWithContext(e,i){const{chartService:s}=this.moduleCtx;return Lx([this,s],e,i)}createCallWithContext(e){const{chartService:i}=this.moduleCtx;return(s,n)=>Lx([e,this,i],s,n)}};cn.defaultTickMinSpacing=50,cn.CrossLineConstructor=Nt,y([Vc],cn.prototype,"nice",2),y([Vc],cn.prototype,"reverse",2),y([Vc],cn.prototype,"interval",2),y([Vc],cn.prototype,"title",2),y([N1((t,e,i)=>t.onGridLengthChange(e,i))],cn.prototype,"gridLength",2);var dp=cn;import{Property as Gx}from"ag-charts-core";var up=class extends ue{constructor(){super(...arguments),this.autoRotateAngle=335}};y([Gx],up.prototype,"autoRotate",2),y([Gx],up.prototype,"autoRotateAngle",2);import{ScaleAlignment as Ux,cachedTextMeasurer as iR,countFractionDigits as sR,estimateTickCount as nR,findMinMax as aR,findRangeExtent as Hx,getTickTimeInterval as rR,intervalMilliseconds as jx,lowestGranularityForInterval as oR,normalizeAngle360FromDegrees as lR,rotatePoint as Wx}from"ag-charts-core";import{clamp as Yx,dateToNumber as pp,previousPowerOf2 as $x}from"ag-charts-core";var fr=class kC extends Fi{constructor(){super(...arguments),this.type="category",this.defaultTickCount=0,this.index=new Map,this.indexInitialized=!1,this._domain=[]}static is(e){return e instanceof kC}set domain(e){this._domain!==e&&(this.invalid=!0,this._domain=e,this.index.clear(),this.indexInitialized=!1)}get domain(){return this._domain}get bands(){return this._domain}normalizeDomains(...e){let i;const s=new Set;let n=!0;for(const a of e){const r=a.domain;s.has(r)||(s.add(r),i==null?i=Kx(r):(n&&(n=cR(r,i)),i=Kx([...i,...r])))}return i??(i=[]),{domain:i,animatable:n}}toDomain(e){}invert(e,i=!1){this.refresh();const s=i?this.bandwidth/2:0,n=this.invertNearestIndex(Math.max(0,e-s));return i||e===this.ordinalRange(n)?this.domain[n]:void 0}ticks(e,i=this.domain,s){const{bands:n}=this;let{tickCount:a}=e;if(a===0){const f=n.length>1?1:0;return{ticks:n[f]?[n[f]]:[],count:void 0,firstTickIndex:f}}let r=a!=null&&a!==0?Math.trunc(n.length/a):1;if(r=$x(r),r<=1)return sy(i,!1,s);a=Math.trunc(n.length/r);const o=r*a,l=$x(Math.trunc((n.length-o)/2)),c=Yx(0,Math.floor((s?.[0]??0)*n.length),n.length),h=Yx(0,Math.ceil((s?.[1]??1)*n.length),n.length),d=Math.floor((c-l)/r)*r+l,u=Math.ceil((h-l)/r)*r+l,p=[];for(let f=d;f=0&&f0?this.findIndex(p[0]):void 0;return g!=null&&(g=Math.floor((g-l)/r)),{ticks:p,count:void 0,firstTickIndex:g}}findIndex(e){const{index:i,indexInitialized:s}=this;if(!s){const{domain:n}=this;for(let a=0;ar%d.duration===0);if(o){const{timeInterval:d,step:u,duration:p}=o,g={...d,step:u*gR(d)*Math.round(r/p),epoch:uR(d,{weekStart:Hc})};return Uo(g,new Date(t),new Date(e),{visibleRange:n,extend:a})}let l=new Date(Math.min(t,e));const c=new Date(Math.max(t,e)),h=[];for(;l<=c;)h.push(l),l=new Date(l),l.setMilliseconds(l.getMilliseconds()+r);return h}function mR(t,e,i,s){const{interval:n}=i,a=Math.min(ks(t),ks(e)),r=Math.max(ks(t),ks(e));let o;if(Xx(n)||typeof n=="string")o=n;else{let d;typeof n=="number"&&(d=(r-a)/Math.max(n,1),mp(d,s)&&(d=void 0)),d??(d=i.tickCount??re.defaultTickCount),o=fp(a,r,d,i.minTickCount,i.maxTickCount,{weekStart:Hc})}if(o==null)return[t,e];const l=Uo(o,new Date(a),new Date(r),{extend:!0});if(l==null||l.length<2)return[t,e];const c=l[0],h=l.at(-1);return t<=e?[c,h]:[h,c]}var yR=1e3,hn=class OC extends Ls{constructor(){super(...arguments),this.type="ordinal-time",this.defaultTickCount=re.defaultTickCount,this._domain=[],this.isReversed=!1}static is(e){return e instanceof OC}set domain(e){e!==this._domain&&(this.invalid=!0,this._domain=e,this._bands=void 0,this._numericBands=void 0,this._uniformityCache=void 0,this.isReversed=Jx(e))}get domain(){return this._domain}get bands(){return this._bands??(this._bands=this.isReversed?this.domain.slice().reverse():this.domain),this._bands}get numericBands(){return this._numericBands??(this._numericBands=this.bands.map(e=>e.valueOf())),this._numericBands}getUniformityCache(e){const{bands:i}=this,s=i.length;if(!e||e[0]===0&&e[1]===1)return s>yR&&this._uniformityCache===void 0&&(this._uniformityCache=lx(i)),this._uniformityCache;const n=Math.floor(e[0]*s),a=Math.min(Math.ceil(e[1]*s),s-1);return lx(i,n,a)}normalizeDomains(...e){const i=e.filter(a=>a.domain.length>0);if(i.length===0)return{domain:[],animatable:!1};const s=i[0].domain,n=i.every(a=>a.domain===s);if(i.length===1||n){const a=i[0];let r=a.domain,o,l=!1;return a.sortMetadata?.sortOrder===void 0?o=hR(r):(o=a.sortMetadata.sortOrder,l=a.sortMetadata.isUnique??!1),o===-1?r=r.slice().reverse():o==null&&(r=l?r.slice().sort((c,h)=>c.valueOf()-h.valueOf()):Zx(r.slice())),{domain:r,animatable:!0}}return{domain:Zx(i.map(a=>a.domain).flat()),animatable:!0}}ticks(e,i,s=[0,1],{extend:n=!1,dropInitial:a=!1}={}){const{interval:r,maxTickCount:o,tickCount:l=o}=e,{bands:c,reversed:h}=this;if(!c.length)return;if(h&&(s=[1-s[1],1-s[0]]),this.refresh(),r==null){const{ticks:v,tickOffset:S,tickEvery:I}=this.getDefaultTicks(i,l,s,n);let M=v.length>0?this.findIndex(v[0]):void 0;return M=M==null?void 0:Math.floor((M-S)/I),{ticks:v,count:void 0,firstTickIndex:M}}let d,u;i&&i.length>=2?(d=i[0].valueOf(),u=i.at(-1).valueOf()):(d=c[0].valueOf(),u=c.at(-1).valueOf());const[p,g]=this.range,f=Math.abs(g-p),m=qx({start:d,stop:u,interval:r,availableRange:f,visibleRange:s,extend:n})??this.getDefaultTicks(i,l,s,n).ticks,b=[];let x=-1;for(const v of m){const S=this.findIndex(v,gp.Trailing)??-1,I=S===x;x=S,!(a&&S===0)&&S!==-1&&!I&&b.push(c[S])}return{ticks:b,count:void 0,firstTickIndex:void 0}}stepTicks(e,i,s=[0,1],n=!0){const a=i?this.bandDomainIndices(i):void 0,r=this.ticksEvery(a,s,e,0,!1),o=r.at(-1),l=n&&e>1?a?.[1]:void 0,c=l!=null&&o!=null?this.findIndex(o):void 0;return c!=null&&l!=null&&l-c0&&t[0]>t.at(-1)}import{Logger as Qx,ScaleAlignment as jc,decodeIntervalValue as bR,encodedToTimestamp as da,findMaxIndex as ua,findMinIndex as xR,intervalFloor as Wc,intervalMilliseconds as ev,intervalNext as vR,intervalRange as yp,intervalRangeCount as bp,intervalRangeNumeric as SR,intervalRangeStartIndex as IR,isPlainObject as tv}from"ag-charts-core";var DR=1e3,xp=5e7,dn=class EC extends Ls{constructor(){super(...arguments),this.type="unit-time",this.defaultTickCount=1/0,this._domain=[],this._bands=void 0}static is(e){return e instanceof EC}static supportsInterval(e,i){return iv(e,i)}set domain(e){if(e!==this._domain){if(e.length===this._domain.length&&e.length>=2&&e[0].valueOf()===this._domain[0].valueOf()&&e[1].valueOf()===this._domain[1].valueOf()){this._domain=e;return}this._domain=e,this.invalidateCaches()}}get domain(){return this._domain}get interval(){return this._interval}set interval(e){this._interval!==e&&(this._interval=e,this.invalidateCaches())}invalidateCaches(){this._bands=void 0,this._numericBands=void 0,this._uniformityCache=void 0,this._domainBoundaries=void 0,this._bandRangeCache=void 0,this._encodedBands=void 0,this._encodingParams=void 0,this._linearParams=void 0}get bands(){if(this._bands===void 0)if(this.ensureEncodedBands(),this._encodedBands!=null&&this._encodingParams!=null){const e=this._encodingParams;this._bands=this._encodedBands.map(i=>bR(i,e))}else this._bands=[];return this._bands}get numericBands(){if(this._numericBands===void 0)if(this.ensureEncodedBands(),this._encodedBands!=null&&this._encodingParams!=null){const e=this._encodingParams;this._numericBands=this._encodedBands.map(i=>da(i,e))}else this._numericBands=[];return this._numericBands}ensureEncodedBands(){if(this._encodedBands!==void 0)return;const{domain:e,interval:i}=this;if(e.length<2||i==null){this._encodedBands=[];return}const s=this.getCachedBandRange();if(s==null){this._encodedBands=[];return}const[n,a]=s,r={visibleRange:[0,1],extend:!1};if(bp(i,n,a,r)>xp){Qx.warnOnce("the configured unit results in too many bands, ignoring. Supply a larger unit."),this._encodedBands=[];return}const{encodedValues:o,encodingParams:l}=SR(i,n,a,r);this._encodedBands=o,this._encodingParams=l}getBandCountForUpdate(){return this.ensureEncodedBands(),this._encodedBands?.length??0}getUniformityCache(e){const i=this.getBandCountForUpdate();if(!e||e[0]===0&&e[1]===1){if(i>DR&&this._uniformityCache===void 0)if(this.ensureEncodedBands(),this._encodingParams!=null&&this._encodedBands!=null&&this._encodedBands.length>=2){const s=da(this._encodedBands[0],this._encodingParams),n=da(this._encodedBands[1],this._encodingParams);this._uniformityCache={isUniform:!0,interval:n-s}}else this._uniformityCache={isUniform:!1};return this._uniformityCache}if(this.ensureEncodedBands(),this._encodingParams!=null&&this._encodedBands!=null&&this._encodedBands.length>=2){const s=da(this._encodedBands[0],this._encodingParams);return{isUniform:!0,interval:da(this._encodedBands[1],this._encodingParams)-s}}return{isUniform:!1}}normalizeDomains(...e){return ax(...e)}getCachedBandRange(){const{domain:e,interval:i}=this;if(!(e.length<2||i==null))return this._bandRangeCache??(this._bandRangeCache={start:Wc(i,e[0]),stop:Wc(i,e[1])}),[this._bandRangeCache.start,this._bandRangeCache.stop]}getDomainBoundaries(){const{interval:e}=this;if(e!=null){if(this._domainBoundaries===void 0){const i=this.getCachedBandRange();if(i==null)return;const[s,n]=i,a=Math.min(s.valueOf(),n.valueOf()),r=Math.max(s.valueOf(),n.valueOf()),o=vR(e,new Date(r)).valueOf();this._domainBoundaries={d0:a,dNext:o}}return this._domainBoundaries}}getLinearParams(){if(this._linearParams===void 0&&(this.ensureEncodedBands(),this._encodedBands!=null&&this._encodingParams!=null&&this._encodedBands.length>=2)){const e=da(this._encodedBands[0],this._encodingParams),i=da(this._encodedBands[1],this._encodingParams);this._linearParams={firstBandTime:e,intervalMs:i-e}}return this._linearParams}isLinearUnit(){const e=this._encodingParams?.unit;return e==="millisecond"||e==="second"||e==="minute"||e==="hour"}findIndex(e,i=jc.Leading){if(e==null)return;const s=this.getBandCountForUpdate();if(s===0)return;if(s===1)return 0;const n=this.getLinearParams();if(n==null||n.intervalMs===0)return super.findIndex(e,i);const{firstBandTime:a,intervalMs:r}=n,o=e.valueOf(),l=(o-a)/r;let c=i===jc.Trailing?Math.ceil(l):Math.floor(l);if(c=Math.max(0,Math.min(c,s-1)),this.isLinearUnit()){if(i===jc.Trailing){if(a+c*ro&&c===0)return;return c}const h=this.numericBands;if(i===jc.Trailing){for(;c>0&&h[c-1]>=o;)c--;for(;c0&&h[c]>o;)c--;if(h[c]>o)return}return c}convert(e,i){this.refresh(),e instanceof Date||(e=new Date(e));const{domain:s,interval:n}=this;if(s.length<2)return Number.NaN;if(i?.clamp!==!0&&n!=null){const a=this.getDomainBoundaries();if(a!=null){const r=e.valueOf();if(r=a.dNext)return Number.NaN}}return super.convert(e,i)}calculateBands(e,i,s=!1){const n=e===this.domain&&i[0]===0&&i[1]===1&&!s;if(n&&this._bands!=null)return{bands:this._bands,firstBandIndex:0};if(e.length<2)return{bands:[],firstBandIndex:void 0};const{interval:a}=this;if(a==null)return{bands:[],firstBandIndex:void 0};const r={visibleRange:i,extend:s};if(!iv(e,a,r))return{bands:[],firstBandIndex:void 0};const o=e===this.domain?this.getCachedBandRange():vp(e,a);if(o==null)return{bands:[],firstBandIndex:void 0};const[l,c]=o;if(bp(a,l,c,r)>xp)return Qx.warnOnce("the configured unit results in too many bands, ignoring. Supply a larger unit."),{bands:[],firstBandIndex:void 0};const h=yp(a,l,c,r),d=IR(a,l,c,r);return n&&(this._bands=h),{bands:h,firstBandIndex:d}}ticks({interval:e},i=this.domain,s=[0,1],{extend:n=!1}={}){if(i.length<2)return;const a=i===this.domain&&!n;if(a&&e!=null)return this.ticksFromNumericBands(e,i,s);let r,o,l;return a?({bands:r}=this.calculateBands(i,[0,1],!1),l=iy(r,!1,s),o=l[0]):{bands:r,firstBandIndex:o}=this.calculateBands(i,s,n),e==null?{ticks:r,count:void 0,firstTickIndex:o}:this.ticksFromBands(e,r,i,s,n,l,o)}ticksFromNumericBands(e,i,s){const n=this.numericBands,a=n.length;if(a===0)return{ticks:[],count:0,firstTickIndex:void 0};const r=iy(n,!1,s),o=r[0],l=this.interval?ev(this.interval):1/0,c=Math.min(i[0].valueOf(),i[1].valueOf()),h=Math.max(i[0].valueOf(),i[1].valueOf());let d,u,p;if(tv(e)||typeof e=="string")d=yp(e,i[0],i[1],{extend:!0,visibleRange:s}).map(v=>v.valueOf()),u=0,p=d.length-1;else{const x=r[0],v=r[1]-1;d=n,u=ua(x,v,S=>n[S]<=c)??x,p=ua(x,v,S=>n[S]<=h)??v}const g=[];let f;for(let x=u;x<=p;x++){const v=d[x],S=ua(0,a-1,I=>n[I]<=v);S!=null&&S!==f&&v-n[S]<=l&&g.push(n[S]),f=S}const[m,b]=this.sliceTickWindow(g,c,h,!1);return{ticks:g.slice(m,b+1).map(x=>new Date(x)),count:g.length,firstTickIndex:o}}ticksFromBands(e,i,s,n,a,r,o){const l=this.interval?ev(this.interval):1/0,c=Math.min(s[0].valueOf(),s[1].valueOf()),h=Math.max(s[0].valueOf(),s[1].valueOf());let d,u,p;if(tv(e)||typeof e=="string")d=yp(e,s[0],s[1],{extend:!0,visibleRange:n}),u=0,p=d.length-1;else{const v=r?r[0]:0,S=r?r[1]-1:i.length-1;d=i,u=ua(v,S,I=>i[I].valueOf()<=c)??v,p=ua(v,S,I=>i[I].valueOf()<=h)??S}const g=[];let f;for(let v=u;v<=p;v++){const S=d[v].valueOf(),I=ua(0,i.length-1,D=>i[D].valueOf()<=S),M=I!=null&&I!=f?i[I]:void 0;f=I,M!=null&&S-M.getTime()<=l&&g.push(M)}const m=g.map(v=>v.valueOf()),[b,x]=this.sliceTickWindow(m,c,h,a);return{ticks:g.slice(b,x+1),count:g.length,firstTickIndex:o}}sliceTickWindow(e,i,s,n){let a,r;if(this.interval){const c=vp([new Date(i),new Date(s)],this.interval);a=c[0].valueOf(),r=c[1].valueOf()}else a=i,r=s;let o=xR(0,e.length-1,c=>e[c]>=a)??0,l=ua(0,e.length-1,c=>e[c]<=r)??e.length-1;return n&&(o=Math.max(o-1,0),l=Math.min(l+1,e.length-1)),[o,l]}};function iv(t,e,i){const[s,n]=vp(t,e);return bp(e,s,n,i)<=xp}function vp(t,e){const i=Wc(e,t[0]),s=Wc(e,t[1]);return[i,s]}import{countFractionDigits as MR,createTicks as sv,findMinMax as AR,niceTicksDomain as CR}from"ag-charts-core";function TR(t,e,i,s,n){let[a,r]=AR(e.map(Number));const o=Math.floor(i.unzoomed);if(o<=1){const[b,x]=LR(a,r),v=5*Math.pow(2,-Math.ceil(Math.log2(n[1]-n[0]))),{ticks:S}=sv(b,x,v,void 0,void 0,n),I=[t.toDomain(b),t.toDomain(x)];return s&&I.reverse(),{domain:I,ticks:S}}if(a===r){const b=Math.floor(Math.log10(a)),x=Math.pow(10,b),v=Math.min(x,1),S=o-1;a-=v*Math.floor(S/2),r=a+v*S}let l=a,c=r;l=NR(l,c,o);const h=wR(l,c,o),d=o-1;c=l+d*h;const u=Math.floor(l/h)*h,p=Math.floor(c/h)*h;u<=a&&p>=r&&(l=u,c=p);const g=[t.toDomain(l),t.toDomain(c)];s&&g.reverse();const f=h*((i.unzoomed-1)/(i.zoomed-1)),m=kR(l,f,Math.floor(i.zoomed));return{domain:g,ticks:m}}function LR(t,e){let i=t,s=e,n=0;do{[i,s]=CR(i,s);const{ticks:a}=sv(i,s,5);if(a.length%2===1)return[i,s];i-=1,s+=1}while(n++<10);return[t,e]}function NR(t,e,i){t=Math.floor(t);const s=Math.abs(e-t)/(i-1),n=Math.floor(Math.log10(s)),a=Math.pow(10,n);return Math.floor(t/a)*a}function kR(t,e,i){const s=MR(e),n=Math.pow(10,s),a=[];for(let r=0;r0&&s<=1?i:s>1&&s<=2?2*i:s>2&&s<=5?5*i:s>5&&s<=10?10*i:t}import{EllipsisChar as ER,ScaleAlignment as nv,boxCollides as RR,buildDateFormatter as av,cachedTextMeasurer as PR,compareDates as _R,createIdsGenerator as FR,dropFirstWhile as VR,dropLastWhile as BR,getMaxInnerRectSize as zR,intervalCeil as GR,intervalExtent as UR,intervalFloor as HR,intervalHierarchy as Sp,intervalMilliseconds as Yc,intervalNext as jR,intervalPrevious as WR,intervalRange as $c,intervalUnit as rv,isArray as YR,isPlainObject as $R,isSegmentTruncated as KR,isTextTruncated as ZR,measureTextSegments as XR,normalizeAngle360FromDegrees as qR,toPlainText as ov,toTextString as lv,wrapTextOrSegments as JR}from"ag-charts-core";var QR=18,eP=[1,2,3,4,6,8,9,10,12];function cv(t,e=0){const i=[];for(const s of t){const{x:n,y:a,width:r,height:o}=s;if(i.some(l=>RR(l,n,a,r+e,o+e)))return!0;i.push(s)}return!1}function tP(t,e,i,s){if(t==null)return e;if(typeof t!="number"){const o=e[0],l=typeof t=="string"?{unit:t,epoch:o}:{...t,epoch:o};return $c(l,e[0],e[1],{visibleRange:i,extend:s})}const n=[],a=e[0].valueOf(),r=e[1].valueOf();for(let o=a;o<=r;o+=t)n.push(new Date(o));return n}function hv(t,e){if(t.length!==e.length)return!1;for(let i=0;i{const v=Fi.is(c)&&c.bandwidth||1/0,S=(c.bandwidth??0)/2,I=nP(h.enabled,n,e,i,o,l,d);let M=p?g:v,D=p?v:g;if(h.rotation){const C=zR(h.rotation,M,D);M=C.width,D=C.height}const A={font:h,maxWidth:M,maxHeight:D,overflow:h.truncate?"ellipsis":"hide",textWrap:h.wrapping};for(let C=0;C(d?c:h)?.(u,p)??String(u)}function aP(t,e,i,s,n,a,r,o){if(!mr.is(t)&&!Ls.is(t))return;const l=Sp(a);if(l==null)return;r&&(e=[1-e[1],1-e[0]]);const c=Math.min(t.domain[0].valueOf(),t.domain.at(-1).valueOf()),h=Math.max(t.domain[0].valueOf(),t.domain.at(-1).valueOf());let[d,u]=UR(new Date(c),new Date(h),e);d=HR(l,d),d.valueOf()>=c&&(d=WR(l,d)),u=GR(l,u),u.valueOf()<=h&&(u=jR(l,u));const p=$c(l,d,u),g=Yc(a),f=hn.is(t),m={...n,interval:a},b=[];let x,v,S,I=0;if(hn.is(t)){const M=rv(a);v=o!=null&&Yc(o)>=Yc(M)?2:3,S=nv.Trailing;const D=i/s,A=t.bandCount(e)/(D*QR);I=eP.findLast(C=>A>=C)??1}else dn.is(t)&&(t.interval==null||Yc(t.interval)>=g)?v=1:(v=0,S=nv.Interpolate);for(let M=0;MF.valueOf(){switch(v){case 0:case 3:return F.valueOf()+g>A.valueOf();case 1:case 2:return F.valueOf()>=A.valueOf()}}),O.length===0)continue;const N=O[0],w=_R(N,D);(v===0?w===0:w<=g)&&(!f||!C)&&(x??(x=new Set),x.add(b.length)),b.push(...O)}return x?.size===1&&x.has(0)&&(x=void 0),{ticks:b,primaryTicksIndices:x,alignment:S}}function rP(t,e,i,s,n){const a=uv(t.format,s);if(a==null)return{width:0,height:0};const r=av(a),o=s?Sp(s):void 0,l=uv(e?.format,o),c=l?av(l):r,h=new Date(i[0]),d=new Date(i.at(-1)),u=o?$c(o,new Date(i[0]),new Date(i.at(-1)),{extend:!0}):void 0;let p=0,g=0;if(r!=null){const f=gr(t),m=f.left+f.right,b=f.top+f.bottom;let x,v;u!=null&&u.length>1?(x=u[0],v=u[1]):(x=h,v=d);const S=$c(s,x,v,{limit:50});for(const I of S){const M=r(I),{width:D,height:A}=n.measureLines(M);p=Math.max(p,D+m),g=Math.max(g,A+b)}}if(c!=null&&u!=null){const f=gr(e),m=f.left+f.right,b=f.top+f.bottom;for(const x of u){const v=c(x),{width:S,height:I}=n.measureLines(v);p=Math.max(p,S+m),g=Math.max(g,I+b)}}return{width:Math.ceil(p),height:Math.ceil(g)}}function oP(t,e,i,s){return t&&!e?i*s===-1?"top":"bottom":"middle"}function lP(t,e,i,s,n){const a=e>0&&e<=Math.PI,r=i>0&&i<=Math.PI,o=a||r?-1:1;if(t)if(e||i){if(s*o===-1)return"right"}else return"center";else if(s*n===-1)return"right";return"left"}function uv(t,e){if(t!=null){if(typeof t=="string")return t;if($R(t)&&e!=null)return t[rv(e)]}}function cP(t,e,i=0){const s=qR(t),n=!s&&i>=0&&i<=Math.PI?-1:1,a=!s&&i-Math.PI/2>=0&&i-Math.PI/2<=Math.PI?-1:1,r=e?n*(Math.PI/2):0;return{configuredRotation:s,defaultRotation:r,parallelFlipFlag:n,regularFlipFlag:a}}var hP=new Date(1970,0,4);function pv(t){const{label:e,domain:i,axisRotation:s,labelOffset:n,sideFlag:a}=t,{defaultRotation:r,configuredRotation:o,parallelFlipFlag:l,regularFlipFlag:c}=cP(e.rotation,e.parallel,s),h=o+r,d=(A,C=0)=>{const T=e.minSpacing??(o===0&&C===0?10:0),L=h+C,k=gr(e);return cv(pP(t,A,L),T)||cv(gP(A.ticks,n,L,k),T)},{maxTickCount:u}=gv(t),p=dP(t),g=e.enabled&&e.avoidCollisions,f=Number.isFinite(u)?u:10,m=g&&e.autoRotate&&e.rotation==null;let b=0,x=0,v=!0,S={tickDomain:[],niceDomain:i,ticks:[],rawTicks:[],rawTickCount:void 0,timeInterval:void 0,fractionDigits:0};for(;v&&b<=f;)({tickData:S,index:b}=uP(t,p,S,b)),x=m&&d(S,0)?lR(e.autoRotateAngle):0,v=g&&d(S,x);const I=lP(e.parallel,o,x,a,c),M=oP(e.parallel,o,a,l),D=o+x;return{tickData:S,textAlign:I,textBaseline:M,rotation:D}}function dP(t){return t.interval?.values?2:t.primaryTickCount!=null?1:0}function gv({scale:t,domain:e,range:i,visibleRange:s,label:n,defaultTickMinSpacing:a,interval:{minSpacing:r,maxSpacing:o}}){const{defaultTickCount:l}=t,c=Hx(i),h=Hx(s);if(fr.is(t)||hn.is(t)&&e.length<1e3){const d=fr.is(t)?e.length:Math.min(e.length,Math.max(1,Math.floor(c/(h*a)))),u=Math.ceil(c/(h*n.fontSize));return{tickCount:Math.min(u,d),minTickCount:0,maxTickCount:d}}return nR(c,h,r,o,l,a)}function uP(t,e,i,s){const{step:n,values:a}=t.interval,{maxTickCount:r,minTickCount:o,tickCount:l}=gv(t),c=C=>Math.max(l-C,o),h=n==null&&a==null&&c(s)>o,d=i.rawTicks,u=l-o,p={minTickCount:o,maxTickCount:r,tickCount:c(s)};let g=fv(t,e,p);if(h&&hv(g.rawTicks,d)){let C=s,T=u;for(;C<=T;){s=Math.trunc((C+T)/2),p.tickCount=c(s);const L=fv(t,e,p);hv(L.rawTicks,d)?C=s+1:(g=L,T=s-1)}}const{tickDomain:f,niceDomain:m,rawTicks:b,rawTickCount:x,rawFirstTickIndex:v,generatePrimaryTicks:S,primaryTicksIndices:I,alignment:M,fractionDigits:D,timeInterval:A}=g;return{tickData:{tickDomain:f,niceDomain:m,rawTicks:b,rawTickCount:x,fractionDigits:D,timeInterval:A,ticks:sP(t,{niceDomain:m,rawTicks:b,rawFirstTickIndex:v,generatePrimaryTicks:S,primaryTicksIndices:I,alignment:M,fractionDigits:D,timeInterval:A})},index:s+1}}function fv(t,e,i){const{domain:s,reverse:n,visibleRange:a,scale:r,interval:o,primaryLabel:l,niceMode:c,primaryTickCount:h,minimumTimeGranularity:d}=t,u={nice:c.map(C=>C===0),interval:o.step,...i},p={...u,nice:c.map(C=>C===0||C===1)};let g;e===1&&h!=null&&re.is(r)&&(g=TR(r,s,h,n,a));const f=c.includes(0)?g?.domain??r.niceDomain(u,s):s;let m=f,b,x,v,S,I,M;const D=l?.enabled===!0&&p.interval==null;dv(r,f,()=>{switch(e){case 2:if(m=o.values,b=o.values,x=b.length,hn.is(r)?M=Ux.Trailing:dn.is(r)&&(M=Ux.Interpolate),re.is(r)){const[C,T]=aR(f.map(Number));b=b.filter(L=>Number(L)>=C&&Number(L)<=T).sort((L,k)=>Number(L)-Number(k))}break;case 1:if(g)b=g.ticks,x=g.ticks.length;else{const C=r.ticks(p,f,a);b=C?.ticks,x=C?.count}break;default:{const{tickCount:C,minTickCount:T,maxTickCount:L}=i;if(f.length>0&&p.interval==null&&(dn.is(r)||D&&(mr.is(r)||hn.is(r)))){const N=f,w=Math.min(N[0].valueOf(),N.at(-1).valueOf()),R=Math.max(N[0].valueOf(),N.at(-1).valueOf());S=rR(w,R,C,T,L,{weekStart:l==null?hP:void 0,primaryOnly:!0})}let k;hn.is(r)?k=d:dn.is(r)&&(k=r.interval),k!=null&&S!=null&&jx(k)>=jx(S)&&(S=k);const O=S?aP(r,a,C,L,p,S,n,d):void 0;if(O)({ticks:b,primaryTicksIndices:I,alignment:M}=O);else{const N=dn.is(r)&&p.interval==null&&S!=null?{...p,interval:S}:p,w=r.ticks(N,f,a);if(b=w?.ticks,x=w?.count,v=w?.firstTickIndex,mr.is(r)||Ls.is(r)){const R=typeof p.interval=="number"?oR(p.interval):p.interval;S??(S=R??w?.timeInterval)}}}}}),b??(b=[]);let A=0;for(const C of b){if(typeof C!="number")continue;const T=sR(C);T>A&&(A=T)}return D||(I=void 0),{tickDomain:m,niceDomain:f,rawTicks:b,rawTickCount:x,rawFirstTickIndex:v,generatePrimaryTicks:D,primaryTicksIndices:I,alignment:M,fractionDigits:A,timeInterval:S}}function pP(t,e,i){const{niceDomain:s,ticks:n,timeInterval:a}=e;if(a==null)return[];const r=iP(n),{label:o,labelOffset:l,primaryLabel:c,domain:h}=t,{width:d,height:u}=rP(o,c,s??h,a,iR(o)),p=[];for(const g of[0,r]){const{x:f,y:m}=Wx(l,g,i);p.push({x:f,y:m,width:d,height:u})}return p}function gP(t,e,i,s){const n=[],a=s.left+s.right,r=s.top+s.bottom;for(const{tickLabel:o,textMetrics:l,translation:c}of t){if(!o)continue;const{x:h,y:d}=Wx(e,c,i),u=l.width+a,p=l.height+r;n.push({x:h,y:d,width:u,height:p})}return n}var Ho=class RC extends dp{constructor(e,i){super(e,i),this.maxThicknessRatio=.3,this.crossAxisTranslation={x:0,y:0},this.minimumTimeGranularity=void 0,this.headingLabelGroup=this.axisGroup.appendChild(new mt({name:`${this.id}-Axis-heading`})),this.lineNodeGroup=this.axisGroup.appendChild(new mt({name:`${this.id}-Axis-line`})),this.lineNode=this.lineNodeGroup.appendChild(new ri({zIndex:1})),this.tickLineGroupSelection=Re.select(this.tickLineGroup,ri,!1),this.gridLineGroupSelection=Re.select(this.gridLineGroup,ri,!1),this.gridFillGroupSelection=Re.select(this.gridFillGroup,He,!1),this.tempText=new sr({debugDirty:!1}),this.tempCaption=new Se,this.animationManager=e.animationManager,this.animationState=new g1("empty",{empty:{update:{target:"ready",action:()=>this.resetSelectionNodes()},reset:"empty"},ready:{update:n=>this.animateReadyUpdate(n),resize:()=>this.resetSelectionNodes(),reset:"empty"}}),this.headingLabelGroup.appendChild(this.title.caption.node);let s;this.cleanup.register(e.eventsHub.on("layout:complete",n=>{const a=[n.chart.width,n.chart.height];s!=null&&!f1(a,s)&&this.animationState.transition("resize"),s=a}),this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}static is(e){return e instanceof RC}get horizontal(){return this.position==="top"||this.position==="bottom"}onGridVisibilityChange(){}resetAnimation(e){e==="initial"&&this.animationState.transition("reset")}get direction(){return this.position==="top"||this.position==="bottom"?ap.X:ap.Y}createAxisContext(){return{...super.createAxisContext(),position:this.position}}createLabel(){return new up}updateDirection(){switch(this.position){case"top":this.label.mirrored=!0,this.label.parallel=!0;break;case"right":this.label.mirrored=!0,this.label.parallel=!1;break;case"bottom":this.label.mirrored=!1,this.label.parallel=!0;break;case"left":this.label.mirrored=!1,this.label.parallel=!1;break}this.axisContext&&(this.axisContext.position=this.position,this.axisContext.direction=this.direction)}calculateLayout(e,i){return this.updateDirection(),super.calculateLayout(e,i)}layoutCrossLines(){const e=this.hasDefinedDomain()||this.hasVisibleSeries();for(const i of this.crossLines)i.calculateLayout?.(e)}calculateTickLayout(e,i,s,n){const a=this.label.getSideFlag(),r=a*(this.getTickSize()+this.getTickSpacing()+this.label.spacing+this.seriesAreaPadding),o=this.chartLayout?.scrollbars?.[this.id],l=this.getScrollbarThickness(o);if(i[0]===2&&i[1]===2&&this.label.enabled===!1&&this.tick.enabled===!1&&this.gridLine.enabled===!1){const{bbox:ae,spacing:ke}=this.measureAxisLayout(e,[],[],o,l);return{ticks:[],rawTickCount:0,tickDomain:e,niceDomain:e,fractionDigits:0,timeInterval:void 0,bbox:ae,layout:{ticks:[],tickLines:[],gridLines:[],gridFills:[],labels:[],spacing:ke}}}const{label:c,primaryLabel:h,scale:d,range:u,interval:p,reverse:g,defaultTickMinSpacing:f,minimumTimeGranularity:m}=this,b=pv({label:c,scale:d,interval:p,primaryLabel:h,domain:e,range:u,reverse:g,niceMode:i,visibleRange:s,defaultTickMinSpacing:f,minimumTimeGranularity:m,sideFlag:a,labelOffset:r,primaryTickCount:n,axisRotation:this.horizontal?Math.PI/-2:0,isVertical:this.direction===ap.Y,sizeLimit:this.chartLayout?.sizeLimit,inRange:ae=>this.inRange(ae,.001),tickFormatter:(...ae)=>this.tickFormatter(...ae)}),{tickData:x}=b;if(this.label.avoidCollisions&&this.horizontal&&x.ticks.length>2&&(re.is(this.scale)||Ls.is(this.scale))){const ae=this.chartLayout?.padding.right??0,ke=x.ticks.at(-1);ke?.tickLabel!=null&&ke.translation+ke.textMetrics.width/2>u[1]+ae&&(ke.tickLabel=void 0,s[0]===0&&s[1]===1&&(x.ticks[0].tickLabel=void 0))}const{ticks:S,tickDomain:I,rawTicks:M,rawTickCount:D,fractionDigits:A,timeInterval:C,niceDomain:T}=x,L=S.map(ae=>this.getTickLabelProps(ae,b,l)),{position:k,gridPadding:O,gridLength:N}=this,w=k==="bottom"||k==="right"?-1:1,R=w*O,F=w*(N+O),E=this.calculateGridLines(S,R,F),V=this.calculateGridFills(S,R,F),Z=this.calculateTickLines(S,w,l),{bbox:Y,spacing:ze}=this.measureAxisLayout(I,S,L,o,l);return{ticks:M,rawTickCount:D,tickDomain:I,niceDomain:T,fractionDigits:A,timeInterval:C,bbox:Y,layout:{ticks:S,gridLines:E,gridFills:V,tickLines:Z,labels:L,spacing:ze}}}calculateGridLines(e,i,s){return e.map((n,a)=>this.calculateGridLine(n,a,i,s,e))}calculateGridLine({index:e,tickId:i,translation:s},n,a,r,o){const{gridLine:l,horizontal:c}=this,[h,d,u,p]=c?[s,a,s,r]:[a,s,r,s],{style:g}=l,{stroke:f,strokeWidth:m=0,lineDash:b}=g[e%g.length]??{};return{tickId:i,offset:s,x1:h,y1:d,x2:u,y2:p,stroke:f,strokeWidth:m,lineDash:b}}calculateGridFills(e,i,s){const{horizontal:n,range:a,type:r}=this,o=[];if(e.length==0)return o;let l=0;const c=!n&&r==="unit-time";if(c&&e[0].translationa[0]){const d={tickId:`before:${e[0].tickId}`,translation:a[0]};o.push(this.calculateGridFill(d,-1,e[0].index,i,s,e)),l=1}return o.push(...e.map((d,u)=>this.calculateGridFill(d,u,d.index+l,i,s,e))),o}calculateGridFill({tickId:e,translation:i},s,n,a,r,o){const{gridLine:l,horizontal:c,range:h}=this,d=o[s+1],u=i,p=d?d.translation:h[1],[g,f,m,b]=c?[u,Math.max(a,r),p,Math.min(a,r)]:[Math.min(a,r),Math.min(u,p),Math.max(a,r),Math.max(u,p)],{fill:x,fillOpacity:v}=l.style[n%l.style.length]??{};return{tickId:e,x1:g,y1:f,x2:m,y2:b,fill:x,fillOpacity:v}}calculateTickLines(e,i,s=0){return e.map(n=>this.calculateTickLine(n,n.index,i,e,s))}calculateTickLine({isPrimary:e,tickId:i,translation:s},n,a,r,o=0){const{horizontal:l,tick:c,primaryTick:h}=this,d=e&&h?h:c,u=this.getTickSize(d),p=this.getTickSpacing(d),g=-a*(o+p),f=-a*u,[m,b,x,v]=l?[s,g,s,g+f]:[g,s,g+f,s],{stroke:S,width:I}=d;return{tickId:i,offset:s,x1:m,y1:b,x2:x,y2:v,stroke:S,strokeWidth:I,lineDash:void 0}}update(){this.updateDirection();const e=Array.from(this.tickLabelGroupSelection.nodes(),r=>r.datum.tickId);super.update();const{tickLayout:i}=this;if(this.updateTitle(this.scale.domain,i?.spacing??0),this.animatable||this.moduleCtx.animationManager.skipCurrentBatch(),i){const{ticks:r}=i;if(this.animationManager.isSkipped())this.resetSelectionNodes();else{const o=r.map(c=>c.tickId),l=y1(e,o);this.animationState.transition("update",l)}}const{enabled:s,stroke:n,width:a}=this.line;this.lineNode.setProperties({stroke:n,strokeWidth:s?a:0}),this.updateTickLines(),this.updateGridLines(),this.updateGridFills()}getAxisTransform(){return{translationX:Math.floor(this.translation.x+this.crossAxisTranslation.x),translationY:Math.floor(this.translation.y+this.crossAxisTranslation.y)}}getLayoutTranslation(){const{translationX:e,translationY:i}=this.getAxisTransform();return{x:e,y:i}}getLayoutState(){return{...super.getLayoutState(),position:this.position}}updatePosition(){super.updatePosition();const e=this.getAxisTransform();this.tickLineGroup.datum=e,this.tickLabelGroup.datum=e,this.lineNodeGroup.datum=e,this.headingLabelGroup.datum=e}setAxisVisible(e){this.tickLineGroup.visible=e&&(this.tick.enabled||(this.primaryTick?.enabled??!1)),this.tickLabelGroup.visible=e&&(this.label.enabled||(this.primaryTick?.enabled??!1)),this.lineNodeGroup.visible=e,this.headingLabelGroup.visible=e}getAxisLineCoordinates(){const{horizontal:e}=this,[i,s]=b1(this.lineRange??this.range);return e?{x1:i,x2:s,y1:0,y2:0}:{x1:0,x2:0,y1:i,y2:s}}getTickLineBBox(e,i){const{translation:s}=e,{position:n,primaryTick:a}=this;let r=this.getTickSize();a?.enabled&&(r=Math.max(r,this.getTickSize(a)));const o=n==="bottom"||n==="right"?-1:1,l=this.getTickSpacing(this.tick),c=-o*(i+l),h=c,d=c-o*(r+l),u=Math.min(h,d),p=Math.max(h,d);switch(n){case"top":return new P(s,u,0,p-u);case"bottom":return new P(s,u,0,p-u);case"left":return new P(u,s,p-u,0);case"right":return new P(u,s,p-u,0)}}lineNodeBBox(){const{position:e,seriesAreaPadding:i}=this,{y1:s,y2:n}=this.getAxisLineCoordinates(),a=n-s;switch(e){case"top":return new P(s,-i,a,i);case"bottom":return new P(s,0,a,i);case"left":return new P(-i,s,i,a);case"right":return new P(0,s,i,a)}}titleBBox(e,i){const{tempCaption:s}=this,n=Math.abs(this.range[1]-this.range[0])||1/0;return s.node.setProperties(this.titleProps(s,e,i)),s.computeTextWrap(n,this.thickness??1/0),s.node.getBBox()}getScrollbarThickness(e){return e?.enabled&&e.placement==="inner"?e.spacing+e.thickness:0}resolveScrollbarLayout(e,i){if(!e)return;const{position:s}=this,n=s==="top"||s==="left"?-1:1;if(e.placement==="inner"){const r=n===1?e.spacing:-e.spacing-e.thickness;return{...e,offset:r}}const a=n===1?i+e.spacing:-i-e.spacing-e.thickness;return{...e,offset:a}}applyScrollbarLayout(e,i,s){const n=this.resolveScrollbarLayout(s,i);let a=i;if(n){const{offset:r,thickness:o,placement:l}=n;l==="outer"&&(a+=n.spacing+o),this.horizontal?e.push(new P(0,r,0,o)):e.push(new P(r,0,o,0))}return{spacing:a,scrollbarLayout:n}}measureAxisLayout(e,i,s,n,a){const{tick:r,primaryTick:o,label:l,primaryLabel:c,title:h,position:d,horizontal:u,seriesAreaPadding:p}=this,g=[];if(g.push(this.lineNodeBBox()),r.enabled||o?.enabled)for(const I of i)g.push(this.getTickLineBBox(I,a));const{tempText:f}=this;if(l.enabled)for(const I of s){if(!I.visible)continue;f.setProperties(I);const M=f.getBBox();M&&g.push(M)}if(c?.enabled&&d==="bottom"&&(g.push(new P(0,Ax(l.fontSize)+2,1,this.getTickSize(r)+this.getTickSpacing(r)+l.spacing+p)),c.format!=null)){const{format:M}=c,A=(x1(M)?Object.values(M):[M]).reduce((C,T)=>Math.max(C,m1(T)),0);g.push(new P(0,this.getTickSize(o??r)+this.getTickSpacing(o??r)+c.spacing+p,1,A*Ax(c.fontSize)+2))}const m=P.merge(g),b=u?m.height:m.width,{spacing:x,scrollbarLayout:v}=this.applyScrollbarLayout(g,b,n);return this.layout.labelThickness=b,this.layout.scrollbar=v,h.enabled&&g.push(this.titleBBox(e,x)),{bbox:P.merge(g),spacing:x}}titleProps(e,i,s){const{title:n}=this;if(!n.enabled)return e.enabled=!1,{visible:!1,text:"",textBaseline:"bottom",x:0,y:0,rotationCenterX:0,rotationCenterY:0,rotation:0};e.enabled=!0,e.color=n.color,e.fontFamily=n.fontFamily,e.fontSize=n.fontSize,e.fontStyle=n.fontStyle,e.fontWeight=n.fontWeight,e.wrapping=n.wrapping,e.truncate=n.truncate,e.maxWidth=n.maxWidth,e.maxHeight=n.maxHeight;const{range:a}=this,r=(a[0]+a[1])/2,o=n.spacing+s;let l,c,h,d;switch(this.position){case"top":l=r,c=-o,h=0,d="bottom";break;case"bottom":l=r,c=o,h=0,d="top";break;case"left":l=-o,c=r,h=Math.PI/-2,d="bottom";break;case"right":l=o,c=r,h=Math.PI/2,d="bottom";break}const{formatter:u=g=>g.defaultValue}=n,p=this.cachedCallWithContext(u,this.getTitleFormatterParams(i));return e.text=p,{visible:!0,text:p,textBaseline:d,x:l,y:c,rotationCenterX:l,rotationCenterY:c,rotation:h}}getTickLabelProps(e,i,s){const{horizontal:n,primaryLabel:a,primaryTick:r,seriesAreaPadding:o,scale:l}=this,{tickId:c,tickLabel:h="",translation:d,isPrimary:u,textUntruncated:p}=e,g=u&&a?.enabled?a:this.label,f=u&&r?.enabled?r:this.tick,{rotation:m,textBaseline:b,textAlign:x}=i,{range:v}=l,S=this.label.getSideFlag(),I=gr(g)[this.position];let M=S*(this.getTickSize(f)+this.getTickSpacing(f)+g.spacing+o)-I;s&&(M+=S*s);const D=h!=="",A=n?d:M,C=n?-M:d;return{...this.getLabelStyles({value:e.tick,formattedValue:h},void 0,g),tickId:c,rotation:m,text:h,textAlign:x,textBaseline:b,textUntruncated:p,visible:D,x:A,y:C,rotationCenterX:A,rotationCenterY:C,range:v}}updateSelections(){if(!this.tickLayout)return;const e=this.getAxisLineCoordinates(),{tickLines:i,gridLines:s,gridFills:n,labels:a}=this.tickLayout,r=o=>o.tickId;this.lineNode.datum=e,this.gridLineGroupSelection.update(this.gridLine.enabled?s:[],void 0,r),this.gridFillGroupSelection.update(this.gridLine.enabled?n:[],void 0,r),this.tickLineGroupSelection.update(i,void 0,r),this.tickLabelGroupSelection.update(a,void 0,r)}updateGridLines(){this.gridLineGroupSelection.each((e,i)=>{e.stroke=i.stroke,e.strokeWidth=i.strokeWidth,e.lineDash=i.lineDash})}updateGridFills(){this.gridFillGroupSelection.each((e,i)=>{e.fill=i.fill,e.fillOpacity=i.fillOpacity??1})}updateTickLines(){this.tickLineGroupSelection.each((e,i)=>{e.stroke=i.stroke,e.strokeWidth=i.strokeWidth,e.lineDash=i.lineDash})}updateTitle(e,i){const{caption:s}=this.title,n=this.titleProps(s,e,i);if(s.node.visible=n.visible,s.node.text=n.text,s.node.textBaseline=n.textBaseline,s.node.datum=n,n.visible){const a=Math.abs(this.range[1]-this.range[0])||1/0;s.computeTextWrap(a,this.thickness??1/0)}}updateLabels(){this.label.enabled&&this.tickLabelGroupSelection.each((e,i)=>{e.fill=i.color,e.text=i.text,e.textBaseline=i.textBaseline,e.textAlign=i.textAlign??"center",e.pointerEvents=i.textUntruncated==null?1:0,e.setFont(i),e.setBoxing(i)})}animateReadyUpdate(e){const{animationManager:i}=this.moduleCtx,s=X1(this),n=Q1(s);Ee(this.id,"axis-group",i,[this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],n.group),Ee(this.id,"line",i,[this.lineNode],n.line),Ee(this.id,"line-paths",i,[this.gridLineGroupSelection,this.tickLineGroupSelection],n.tick,(a,r)=>r.tickId,e),Ee(this.id,"tick-labels",i,[this.tickLabelGroupSelection],n.label,(a,r)=>r.tickId,e),Ee(this.id,"title",i,[this.title.caption.node],n.label,(a,r)=>r.tickId,e)}resetSelectionNodes(){ot([this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],eR()),ot([this.gridLineGroupSelection,this.tickLineGroupSelection],Fx()),ot([this.gridFillGroupSelection],tR()),ot([this.tickLabelGroupSelection],Uc()),ot([this.title.caption.node],Uc()),ot([this.lineNode],Fx())}};y([Fc],Ho.prototype,"thickness",2),y([Fc],Ho.prototype,"maxThicknessRatio",2),y([Fc],Ho.prototype,"position",2),y([Fc],Ho.prototype,"crossAt",2);var jo=Ho,mv=["right","top","left","bottom"];function fP(t){return typeof t=="string"&&mv.includes(t)}function mP(t){const e=[],i=[],s=[...mv];for(const n of t)n instanceof jo&&(fP(n.position)?i.push(n.position):e.push(n));for(const n of e){let a;do a=s.pop();while(a&&i.includes(a));if(a==null)break;n.position=a}}import{ModuleRegistry as yP,jsonDiff as bP}from"ag-charts-core";var yv=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo"];function xP(t,e,i){const s=new Map,n=d=>{if(d===void 0)return yv;if(s.has(d))return s.get(d);const u=yP.getSeriesModule(d)?.matchingKeys??yv;return s.set(d,u),u},a=(d,u,p)=>{const g=n(d),f=[d];for(const m of g)m in u&&u[m]!=null&&f.push(`${m}=${u[m]}`);return p?.seriesGrouping&&f.push(`seriesGrouping.groupId=${p?.seriesGrouping.groupId}`),f.join(";")},r=new Map;let o=0;for(const d of t){const u=a(d.type,d.properties,i?.[o]);r.has(u)||r.set(u,[]),r.get(u)?.push([d,o++])}const l=new Map;o=0;for(const d of e){const u=a(d.type,d,d);l.has(u)||l.set(u,[]),l.get(u)?.push([d,o++])}if(![...r.keys()].some(d=>l.has(d)))return{status:"no-overlap",oldKeys:r.keys(),newKeys:l.keys()};const h=[];for(const[d,u]of l.entries())for(const[p,g]of u){const f=r.get(d);if(f==null||f.length<1){h.push({opts:p,targetIdx:g,idx:g,status:"add"}),r.delete(d);continue}const[m,b]=f.shift(),x=i?.[b]??{},v=bP(x,p??{}),{groupIndex:S,stackIndex:I}=v?.seriesGrouping??{};S!=null||I!=null?h.push({opts:p,series:m,diff:v,targetIdx:g,idx:b,status:"series-grouping"}):v?h.push({opts:p,series:m,diff:v,targetIdx:g,idx:b,status:"update"}):h.push({opts:p,series:m,targetIdx:g,idx:b,status:"no-op"}),f.length===0&&r.delete(d)}for(const d of r.values())for(const[u,p]of d)h.push({series:u,idx:p,targetIdx:-1,status:"remove"});return{status:"overlap",changes:h}}import{ModuleRegistry as vP}from"ag-charts-core";import{ModuleType as SP}from"ag-charts-core";var un=new Map([{type:"chart",name:"cartesian",moduleId:"CartesianChartModule"},{type:"chart",name:"standalone",moduleId:"StandaloneChartModule",enterprise:!0},{type:"chart",name:"polar",moduleId:"PolarChartModule"},{type:"chart",name:"topology",moduleId:"TopologyChartModule",enterprise:!0},{type:"axis",name:"number",chartType:"cartesian",moduleId:"NumberAxisModule"},{type:"axis",name:"log",chartType:"cartesian",moduleId:"LogAxisModule"},{type:"axis",name:"time",chartType:"cartesian",moduleId:"TimeAxisModule"},{type:"axis",name:"unit-time",chartType:"cartesian",moduleId:"UnitTimeAxisModule"},{type:"axis",name:"category",chartType:"cartesian",moduleId:"CategoryAxisModule"},{type:"axis",name:"grouped-category",chartType:"cartesian",moduleId:"GroupedCategoryAxisModule"},{type:"axis",name:"ordinal-time",chartType:"cartesian",enterprise:!0,moduleId:"OrdinalTimeAxisModule"},{type:"axis",name:"angle-category",chartType:"polar",enterprise:!0,moduleId:"AngleCategoryAxisModule"},{type:"axis",name:"angle-number",chartType:"polar",enterprise:!0,moduleId:"AngleNumberAxisModule"},{type:"axis",name:"radius-category",chartType:"polar",enterprise:!0,moduleId:"RadiusCategoryAxisModule"},{type:"axis",name:"radius-number",chartType:"polar",enterprise:!0,moduleId:"RadiusNumberAxisModule"},{type:"series",name:"bar",chartType:"cartesian",moduleId:"BarSeriesModule"},{type:"series",name:"scatter",chartType:"cartesian",moduleId:"ScatterSeriesModule"},{type:"series",name:"bubble",chartType:"cartesian",moduleId:"BubbleSeriesModule"},{type:"series",name:"line",chartType:"cartesian",moduleId:"LineSeriesModule"},{type:"series",name:"area",chartType:"cartesian",moduleId:"AreaSeriesModule"},{type:"series",name:"pie",chartType:"polar",moduleId:"PieSeriesModule"},{type:"series",name:"donut",chartType:"polar",moduleId:"DonutSeriesModule"},{type:"series",name:"box-plot",chartType:"cartesian",enterprise:!0,moduleId:"BoxPlotSeriesModule"},{type:"series",name:"candlestick",chartType:"cartesian",enterprise:!0,moduleId:"CandlestickSeriesModule"},{type:"series",name:"cone-funnel",chartType:"cartesian",enterprise:!0,moduleId:"ConeFunnelSeriesModule"},{type:"series",name:"funnel",chartType:"cartesian",enterprise:!0,moduleId:"FunnelSeriesModule"},{type:"series",name:"ohlc",chartType:"cartesian",enterprise:!0,moduleId:"OhlcSeriesModule"},{type:"series",name:"heatmap",chartType:"cartesian",enterprise:!0,moduleId:"HeatmapSeriesModule"},{type:"series",name:"histogram",chartType:"cartesian",moduleId:"HistogramSeriesModule"},{type:"series",name:"range-area",chartType:"cartesian",enterprise:!0,moduleId:"RangeAreaSeriesModule"},{type:"series",name:"range-bar",chartType:"cartesian",enterprise:!0,moduleId:"RangeBarSeriesModule"},{type:"series",name:"waterfall",chartType:"cartesian",enterprise:!0,moduleId:"WaterfallSeriesModule"},{type:"series",name:"nightingale",chartType:"polar",enterprise:!0,moduleId:"NightingaleSeriesModule"},{type:"series",name:"radar-area",chartType:"polar",enterprise:!0,moduleId:"RadarAreaSeriesModule"},{type:"series",name:"radar-line",chartType:"polar",enterprise:!0,moduleId:"RadarLineSeriesModule"},{type:"series",name:"radial-bar",chartType:"polar",enterprise:!0,moduleId:"RadialBarSeriesModule"},{type:"series",name:"radial-column",chartType:"polar",enterprise:!0,moduleId:"RadialColumnSeriesModule"},{type:"series",name:"map-shape",chartType:"topology",enterprise:!0,moduleId:"MapShapeSeriesModule"},{type:"series",name:"map-line",chartType:"topology",enterprise:!0,moduleId:"MapLineSeriesModule"},{type:"series",name:"map-marker",chartType:"topology",enterprise:!0,moduleId:"MapMarkerSeriesModule"},{type:"series",name:"map-shape-background",chartType:"topology",enterprise:!0,moduleId:"MapShapeBackgroundSeriesModule"},{type:"series",name:"map-line-background",chartType:"topology",enterprise:!0,moduleId:"MapLineBackgroundSeriesModule"},{type:"series",name:"pyramid",chartType:"standalone",enterprise:!0,moduleId:"PyramidSeriesModule"},{type:"series",name:"linear-gauge",chartType:"standalone",enterprise:!0,moduleId:"LinearGaugeModule"},{type:"series",name:"radial-gauge",chartType:"standalone",enterprise:!0,moduleId:"RadialGaugeModule"},{type:"series",name:"sunburst",chartType:"standalone",enterprise:!0,moduleId:"SunburstSeriesModule"},{type:"series",name:"treemap",chartType:"standalone",enterprise:!0,moduleId:"TreemapSeriesModule"},{type:"series",name:"chord",chartType:"standalone",enterprise:!0,moduleId:"ChordSeriesModule"},{type:"series",name:"sankey",chartType:"standalone",enterprise:!0,moduleId:"SankeySeriesModule"},{type:"plugin",name:"animation",enterprise:!0,moduleId:"AnimationModule"},{type:"plugin",name:"annotations",chartType:"cartesian",enterprise:!0,moduleId:"AnnotationsModule"},{type:"plugin",name:"legend",moduleId:"LegendModule"},{type:"plugin",name:"locale",moduleId:"LocaleModule"},{type:"plugin",name:"chartToolbar",chartType:"cartesian",enterprise:!0,moduleId:"ChartToolbarModule"},{type:"plugin",name:"contextMenu",enterprise:!0,moduleId:"ContextMenuModule"},{type:"plugin",name:"statusBar",chartType:"cartesian",enterprise:!0,moduleId:"StatusBarModule"},{type:"plugin",name:"dataSource",enterprise:!0,moduleId:"DataSourceModule"},{type:"plugin",name:"sync",chartType:"cartesian",enterprise:!0,moduleId:"SyncModule"},{type:"plugin",name:"ranges",chartType:"cartesian",enterprise:!0,moduleId:"RangesModule"},{type:"plugin",name:"zoom",enterprise:!0,moduleId:"ZoomModule"},{type:"plugin",name:"flashOnUpdate",enterprise:!0,moduleId:"FlashOnUpdateModule"},{type:"plugin",name:"gradientLegend",enterprise:!0,moduleId:"GradientLegendModule"},{type:"plugin",name:"navigator",chartType:"cartesian",enterprise:!0,moduleId:"NavigatorModule"},{type:"plugin",name:"scrollbar",chartType:"cartesian",enterprise:!0,moduleId:"ScrollbarModule"},{type:"axis:plugin",name:"crosshair",chartType:"cartesian",enterprise:!0,moduleId:"CrosshairModule"},{type:"axis:plugin",name:"bandHighlight",chartType:"cartesian",enterprise:!0,moduleId:"BandHighlightModule"},{type:"series:plugin",name:"errorBar",chartType:"cartesian",enterprise:!0,moduleId:"ErrorBarsModule"},{type:"preset",name:"gauge-preset",chartType:"standalone",enterprise:!0,moduleId:"GaugePresetModule"},{type:"preset",name:"price-volume",chartType:"cartesian",enterprise:!0,moduleId:"PriceVolumePresetModule"},{type:"preset",name:"sparkline",moduleId:"SparklinePresetModule"}].map(t=>[t.name,t]));function IP(t){const e=un.get(t);return e?.type===SP.Series?e.chartType:void 0}function Wo(t){const e=t.series?.[0]?.type??"line";return vP.getSeriesModule(e)?.chartType??IP(e)??"unknown"}function DP(t){return Wo(t)==="cartesian"}import{ModuleRegistry as MP,ModuleType as AP}from"ag-charts-core";var CP=class extends op{*legends(){for(const t of MP.listModulesByType(AP.Plugin))(t.name==="legend"||t.name==="gradientLegend")&&(yield{legendType:t.name==="legend"?"category":"gradient",legend:this.getModule(t.name)})}};import{BaseProperties as TP,Property as Yo}from"ag-charts-core";import{BaseProperties as LP,Property as Ip,callWithContext as NP,createElement as Kc,isArray as bv,isHTMLElement as xv,toPlainText as kP,toTextString as vv}from"ag-charts-core";var Dp="ag-charts-overlay",wP="ag-charts-dark-overlay",pa=class extends LP{constructor(t,e){super(),this.className=t,this.defaultMessageId=e,this.enabled=!0}getText(t){return bv(this.text)?kP(this.text):this.rendererAsText?this.rendererAsText:t.t(vv(this.text)||this.defaultMessageId)}getElement(t,e,i,s){if(this.content?.remove(),this.rendererAsText=void 0,this.focusBox=s,this.renderer){const n={},a=NP(t,this.renderer,n);if(xv(a))this.content=a;else{const r=Kc("div");r.innerHTML=a;const{firstElementChild:o}=r;xv(o)&&r.childElementCount===1?this.content=o:this.content=r}this.rendererAsText=this.content?.textContent?.trim()}else{const n=Kc("div",{display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",height:"100%",margin:"8px",fontFamily:"var(--ag-charts-font-family)",fontSize:"var(--ag-charts-font-size)",fontWeight:"var(--ag-charts-font-weight)"});if(bv(this.text)){const a=Kc("div");for(const r of this.text){const o=Kc("span",{color:r.color,fontSize:`${r.fontSize}px`,fontFamily:r.fontFamily??"inherit",fontWeight:String(r.fontWeight),fontStyle:r.fontStyle});o.innerText=vv(r.text),a.appendChild(o)}n.appendChild(a)}else n.innerText=this.getText(i);this.content=n,this.content.classList.add(this.className),e?.animate({from:0,to:1,id:"overlay",phase:"add",groupId:"opacity",onUpdate(a){n.style.opacity=String(a)},onStop(){n.style.opacity="1"}})}return this.content}removeElement(t=()=>this.content?.remove(),e){if(this.content){if(e){const{content:i}=this;e.animate({from:1,to:0,phase:"remove",id:"overlay",groupId:"opacity",onUpdate(s){i.style.opacity=String(s)},onStop(){t?.()}})}else t?.();this.content=void 0,this.focusBox=void 0}}};y([Ip],pa.prototype,"enabled",2),y([Ip],pa.prototype,"text",2),y([Ip],pa.prototype,"renderer",2);var yr=class extends TP{constructor(){super(...arguments),this.darkTheme=!1,this.loading=new pa("ag-charts-loading-overlay","overlayLoadingData"),this.noData=new pa("ag-charts-no-data-overlay","overlayNoData"),this.noVisibleSeries=new pa("ag-charts-no-visible-series","overlayNoVisibleSeries"),this.unsupportedBrowser=new pa("ag-charts-unsupported-browser","overlayUnsupportedBrowser")}getFocusInfo(t){for(const e of[this.loading,this.noData,this.noVisibleSeries,this.unsupportedBrowser])if(e.focusBox!==void 0)return{text:e.getText(t),rect:e.focusBox}}destroy(){this.loading.removeElement(),this.noData.removeElement(),this.noVisibleSeries.removeElement(),this.unsupportedBrowser.removeElement()}};y([Yo],yr.prototype,"darkTheme",2),y([Yo],yr.prototype,"loading",2),y([Yo],yr.prototype,"noData",2),y([Yo],yr.prototype,"noVisibleSeries",2),y([Yo],yr.prototype,"unsupportedBrowser",2);import"ag-charts-core";function OP(t,e,i){const{animationDuration:s}=Lo.add,n=s*i,a=t.createElement("div",`${Dp}--loading`,{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",height:"100%",boxSizing:"border-box",font:"13px Verdana, sans-serif",userSelect:"none",animation:`ag-charts-loading ${n}ms linear 50ms both`}),r=t.createElement("span",{width:"45px",height:"40px",backgroundImage:["linear-gradient(#0000 calc(1 * 100% / 6), #ccc 0 calc(3 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(2 * 100% / 6), #ccc 0 calc(4 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(3 * 100% / 6), #ccc 0 calc(5 * 100% / 6), #0000 0)"].join(""),backgroundSize:"10px 400%",backgroundRepeat:"no-repeat",animation:"ag-charts-loading-matrix 1s infinite linear"}),o=t.createElement("p",{marginTop:"1em"});o.innerText=e;const l=t.createElement("div",`${Dp}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),c=t.createElement("style");return c.innerText=["@keyframes ag-charts-loading { from { opacity: 0 } to { opacity: 1 } }","@keyframes ag-charts-loading-matrix {","0% { background-position: 0% 0%, 50% 0%, 100% 0%; }","100% { background-position: 0% 100%, 50% 100%, 100% 100%; }","}"].join(" "),a.replaceChildren(c,r,o,l),a}import{BaseProperties as EP,Border as RP,CleanupRegistry as PP,Property as Zc,ProxyPropertyOnWrite as _P,ZIndexMap as FP}from"ag-charts-core";var $o=class extends EP{constructor(t){super(),this.ctx=t,this.rectNode=new He,this.border=new RP(this.rectNode),this.cornerRadius=0,this.padding=0,this.cleanup=new PP,this.node=this.createNode(),this.node.append([this.rectNode]),this.rectNode.fill=void 0,this.cleanup.register(t.scene.attachNode(this.node),t.eventsHub.on("layout:complete",e=>this.onLayoutComplete(e)))}destroy(){this.cleanup.flush()}getPadding(){const{border:t,padding:e}=this,i=t.enabled?t.strokeWidth:0;if(typeof e=="number"){const s=e+i;return{top:s,right:s,bottom:s,left:s}}return{top:(e.top??0)+i,right:(e.right??0)+i,bottom:(e.bottom??0)+i,left:(e.left??0)+i}}createNode(){return new U({name:"series-area-container",zIndex:FP.SERIES_AREA_CONTAINER})}onLayoutComplete(t){const{x:e,y:i,width:s,height:n}=t.series.paddedRect;this.rectNode.x=e,this.rectNode.y=i,this.rectNode.width=s,this.rectNode.height=n}};y([Zc],$o.prototype,"border",2),y([Zc],$o.prototype,"clip",2),y([_P("rectNode","cornerRadius"),Zc],$o.prototype,"cornerRadius",2),y([Zc],$o.prototype,"padding",2);import{ActionOnSet as VP,ChartAxisDirection as cs,CleanupRegistry as BP,EventEmitter as zP,LRUCache as GP,Logger as UP,SeriesContentZIndexMap as Xc,SeriesZIndexMap as Ko,callWithContext as Sv,createId as HP,isEmptyObject as Mp,isGradientFill as jP,isPatternFill as WP,jsonDiff as YP,mergeDefaults as Iv,nearestSquared as $P,without as Dv}from"ag-charts-core";import{objectsEqual as KP}from"ag-charts-core";function qc(t,e){if(t.itemId!==void 0)return t.itemId;if(e!==void 0){const i=t.datum?.[e];if(i!=null)return typeof i=="number"?i:String(i)}return typeof t.datumIndex=="number"?t.datumIndex:JSON.stringify(t.datumIndex)}function Ap(t,e){return t.series===e.series&&KP(t.datumIndex,e.datumIndex)}function ZP(t,e){return e==null?-1:t.findIndex(i=>Ap(i,e))}var XP=class{constructor(t,e){this.activeManager=t,this.tooltipProperties=e,this.candidates=[],this.blockEntrance=!1,this.activationPrevented=!1}clear(){this.candidates.length=0,this.pendingPickedNodes=void 0}popPendingPickedNodes(){const t=this.pendingPickedNodes;return this.pendingPickedNodes=void 0,t}getActivationArgs(t){if(t===void 0)return[void 0,void 0];{const e=t.series.id,i=qc(t,t.series.data?.dataIdKey);return[{type:"series-node",seriesId:e,itemId:i},t]}}maybeActivate(t,e,i){if(this.blockEntrance)throw new Error("PickManager.maybeActivate is not re-entrant");try{this.activationPrevented=!1,this.blockEntrance=!0;const[s,n]=this.getActivationArgs(t);this.activeManager.update(s,n)?this.activationPrevented=!0:(this.active=t,e(i?.defaultCbArg))}finally{this.blockEntrance=!1}}onClearUI(){this.activeManager.clear(),this.clear()}onClearAPI(){this.clear()}onPickedNodesHighlight(t){if(t!==void 0){const i=this.active;if(this.tooltipProperties.pagination&&i!==void 0){const s=t.matches.find(n=>Ap(n,i));if(s)return s}}return t?.matches[0]}onPickedNodesTooltip(t){if(t!==void 0&&this.tooltipProperties.pagination){const i=this.active,s=t.matches;this.candidates=s;let n=ZP(s,i);n===-1&&(n=0);const a=s[n],r={index:n,length:s.length};return{active:a,paginationState:r}}return{active:t?.matches[0]}}onPickedNodesAPI(t){return this.pendingPickedNodes=t,t.matches[0]}onPickedNodesAPIDebounced(){return{active:this.onPickedNodesHighlight(this.popPendingPickedNodes())}}nextCandidate(){if(this.tooltipProperties.pagination){const{candidates:t}=this,e=this.active,i=e==null?-1:t.findIndex(r=>Ap(r,e));if(i===-1)return{active:void 0,paginationState:void 0};let s=i+1;s>=t.length&&(s=0);const n=t[s],a={index:s,length:this.candidates.length};return{active:n,paginationState:a}}return{active:this.active}}wasActivationPrevented(){return this.activationPrevented}};import{isGradientFill as Mv,isImageFill as Av,isPatternFill as Cv}from"ag-charts-core";function Tv(t,e,i,s){if(Mv(t))return{type:"gradient",gradient:t.gradient??e.gradient,colorStops:t.colorStops??e.colorStops,bounds:t.bounds??e.bounds,rotation:t.rotation??e.rotation,reverse:t.reverse??e.reverse,colorSpace:t.colorSpace??e.colorSpace};if(Cv(t)){const n=t.pattern??i.pattern;let a=t.strokeWidth;n==="backward-slanted-lines"||n==="forward-slanted-lines"||n==="horizontal-lines"||n==="vertical-lines"?a??(a=i.strokeWidth):a??(a=0);const r=t.width??t.height??i.width,o=t.height??t.width??i.height;return{type:"pattern",pattern:n,width:r,height:o,path:t.path,padding:t.padding??i.padding,fill:t.fill??i.fill,fillOpacity:t.fillOpacity??i.fillOpacity,backgroundFill:t.backgroundFill??i.backgroundFill,backgroundFillOpacity:t.backgroundFillOpacity??i.backgroundFillOpacity,stroke:t.stroke??i.stroke,strokeOpacity:t.strokeOpacity??i.strokeOpacity,strokeWidth:a,rotation:t.rotation??i.rotation,scale:t.scale??i.scale}}return Av(t)?{type:"image",url:t.url,width:t.width,height:t.height,backgroundFill:t.backgroundFill??s.backgroundFill,backgroundFillOpacity:t.backgroundFillOpacity??s.backgroundFillOpacity,rotation:t.rotation??s.rotation,repeat:t.repeat??s.repeat,fit:t.fit??s.fit}:t}function Cp(t,e,i,s){return!Mv(t?.fill)&&!Cv(t?.fill)&&!Av(t?.fill)?t:{...t,fill:Tv(t.fill,e,i,s)}}var Lv=(t=>(t[t.EXACT_SHAPE_MATCH=0]="EXACT_SHAPE_MATCH",t[t.NEAREST_NODE=1]="NEAREST_NODE",t[t.AXIS_ALIGNED=2]="AXIS_ALIGNED",t))(Lv||{}),qP=.25,JP=.125,Jc=class{constructor(t,e,i,s){this.type=t,this.event=e,this.defaultPrevented=!1,this.datum=i.datum,this.seriesId=s.id,this.dataIdKey=s.data?.dataIdKey,this.itemId=qc(i,this.dataIdKey)}preventDefault(){this.defaultPrevented=!0}},Tp=class{constructor(t,e){this.series=t,this.seriesGrouping=e,this.type="groupingChanged"}};function Nv(t){switch(t){case"x":return cs.X;case"y":return cs.Y;case"angle":return cs.Angle;case"radius":return cs.Radius}}function Lp(t){switch(t){case cs.X:return"x";case cs.Y:return"y";case cs.Angle:return"angle";case cs.Radius:return"radius";default:return"x"}}var Zo=class extends Ly{constructor(t){super(),this.cleanup=new BP,this.usesPlacedLabels=!1,this.alwaysClip=!1,this.hasChangesOnHighlight=!1,this.seriesGrouping=void 0,this.NodeEvent=Jc,this.internalId=HP(this),this.contentGroup=new mt({name:`${this.internalId}-content`,zIndex:Ko.ANY_CONTENT}),this.highlightGroup=new mt({name:`${this.internalId}-highlight`,zIndex:Ko.ANY_CONTENT}),this.highlightNodeGroup=this.highlightGroup.appendChild(new U({name:`${this.internalId}-highlight-node`})),this.highlightLabelGroup=this.highlightGroup.appendChild(new U({name:`${this.internalId}-highlight-label`,zIndex:Xc.LABEL})),this.annotationGroup=new mt({name:`${this.internalId}-annotation`}),this.labelGroup=new mt({name:`${this.internalId}-series-labels`}),this.axes={},this.directions=[cs.X,cs.Y],this.nodeDataRefresh=!0,this.processedDataUpdated=!0,this.moduleMap=new op,this.datumCallbackCache=new Map,this.connectsToYAxis=!1,this.declarationOrder=-1,this._broughtToFront=!1,this.events=new zP,this._pickNodeCache=new GP(5),this.fireEventWrapper=l=>super.fireEvent(l);const{moduleCtx:e,pickModes:i,propertyKeys:s={},propertyNames:n={},canHaveAxes:a=!1,usesPlacedLabels:r=!1,alwaysClip:o=!1}=t;this.ctx=e,this.propertyKeys=s,this.propertyNames=n,this.canHaveAxes=a,this.usesPlacedLabels=r,this.pickModes=i,this.alwaysClip=o,this.highlightLabelGroup.pointerEvents=1,this.cleanup.register(this.ctx.eventsHub.on("data:update",l=>this.setChartData(l)),this.ctx.eventsHub.on("highlight:change",l=>this.onChangeHighlight(l)))}get pickModeAxis(){return"main"}get id(){return this.properties?.id??this.internalId}get type(){return this.constructor.type??""}get focusable(){return!0}get data(){return this._data??this._chartData}set visible(t){this.properties.visible=t,this.ctx.legendManager.toggleItem(t,this.id),this.ctx.legendManager.update(),this.visibleMaybeChanged()}get visible(){return this.ctx.legendManager.getSeriesEnabled(this.id)??this.properties.visible}get hasData(){const t=this.data;return t==null?!1:t.netSize()>0}get tooltipEnabled(){return this.properties.tooltip?.enabled}onDataChange(){this.nodeDataRefresh=!0,this.processedDataUpdated=!0,this._pickNodeCache.clear()}setOptionsData(t){this._data=t,this.onDataChange()}isHighlightEnabled(){return this.properties.highlight.enabled}setChartData(t){this._chartData=t,this.data===t&&this.onDataChange()}onSeriesGroupingChange(t,e){const{internalId:i,type:s,visible:n}=this;t&&this.ctx.seriesStateManager.deregisterSeries(this),e&&this.ctx.seriesStateManager.registerSeries({internalId:i,type:s,visible:n,seriesGrouping:e,width:"width"in this.properties?this.properties.width:0}),this.fireEvent(new Tp(this,e))}getBandScalePadding(){return{inner:1,outer:0}}attachSeries(t,e,i){t.appendChild(this.contentGroup),e.appendChild(this.highlightGroup),e.appendChild(this.labelGroup),i?.appendChild(this.annotationGroup)}detachSeries(t,e,i){this.contentGroup.remove(),this.highlightGroup.remove(),this.labelGroup.remove(),this.annotationGroup.remove()}setSeriesIndex(t,e=!1){const i=this.bringToFront();return!e&&t===this.declarationOrder&&i===this._broughtToFront?!1:(this.declarationOrder=t,this._broughtToFront=i,this.setZIndex(i?Number.MAX_VALUE:t),this.fireEvent(new Tp(this,this.seriesGrouping)),!0)}setZIndex(t){this.contentGroup.zIndex=[Ko.ANY_CONTENT,t,Xc.FOREGROUND],this.highlightGroup.zIndex=[Ko.ANY_CONTENT,t,Xc.HIGHLIGHT],this.labelGroup.zIndex=[Ko.ANY_CONTENT,t,Xc.LABEL],this.annotationGroup.zIndex=t}renderToOffscreenCanvas(){return!1}hasHighlightOpacity(){if(!this.properties.highlight.enabled)return!1;const t=this.ctx.highlightManager.getActiveHighlight();if(t==null||t.series?.isHighlightEnabled()===!1)return!1;const{unhighlightedItem:e,unhighlightedSeries:i}=this.properties.highlight;return Ku(e)||Ku(i)}getDrawingMode(t,e="cutout"){return t?e:this.hasHighlightOpacity()?this.ctx.chartService.highlight?.drawingMode??"overlay":"overlay"}getAnimationDrawingModes(){const t=this.getDrawingMode(!1);return{start:{drawingMode:"overlay"},finish:{drawingMode:t}}}addEventListener(t,e){return super.addEventListener(t,e)}removeEventListener(t,e){return super.removeEventListener(t,e)}hasEventListener(t){return super.hasEventListener(t)}updatedDomains(){}destroy(){this.cleanup.flush(),this.resetDatumCallbackCache(),this.ctx.seriesStateManager.deregisterSeries(this)}getPropertyValues(t,e){const i=Nv(t),s=i==null?t:Lp(this.resolveKeyDirection(i)),n=e?.[s],a=[];if(!n)return a;const r=(...o)=>{for(const l of o)Array.isArray(l)?r(...l):typeof l=="object"?r(...Object.values(l)):a.push(l)};return r(...n.map(o=>this.properties[o])),a}getKeyAxis(t){}getKeys(t){return this.getPropertyValues(Lp(t),this.propertyKeys)}getKeyProperties(t){return this.propertyKeys[this.resolveKeyDirection(t)]??[]}getNames(t){return this.getPropertyValues(Lp(t),this.propertyNames)}getFormatterContext(t){const{id:e}=this,i=this.getPropertyValues(t,this.propertyKeys),s=this.getPropertyValues(t,this.propertyNames),n=[];for(let a=0;as.getDomain(t)).flat();return i.length===0?e:{domain:e.domain.concat(i)}}getRange(t,e){return this.getSeriesRange(t,e)}getMinimumRangeSeries(t){}getMinimumRangeChart(t){return 0}getZoomRangeFittingItems(t,e,i){}getVisibleItems(t,e,i){return 1/0}toCanvasFromMidPoint(t){const{x:e=0,y:i=0}=t.midPoint??{};return fe.toCanvasPoint(this.contentGroup,e,i)}markNodeDataDirty(){this.nodeDataRefresh=!0,this._pickNodeCache.clear(),this.visibleMaybeChanged()}visibleMaybeChanged(){const{internalId:t,seriesGrouping:e,type:i,visible:s}=this;this.ctx.seriesStateManager.updateSeries({internalId:t,type:i,visible:s,seriesGrouping:e,width:"width"in this.properties?this.properties.width:0})}getOpacity(){if(!this.properties.highlight)return 1;const{opacity:e=1}=this.getHighlightStyle();return e}getHighlightState(t,e,i,s){return this.properties.highlight.enabled?e?1:t?.series==null||t.series.isHighlightEnabled()===!1?0:this.isSeriesHighlighted(t,s)?this.isItemHighlighted(t,i)==null?2:4:3:0}getHighlightStateString(t,e,i,s){return ur(this.getHighlightState(t,e,i,s))}onChangeHighlight(t){const e=t.previousHighlight,i=t.currentHighlight,s=this.getHighlightState(i),n=this.getHighlightState(e);this.setSeriesIndex(this.declarationOrder);const a=this.hasItemStylers();if(!a&&s===n){this.hasChangesOnHighlight=!1;return}const{highlightedSeries:r,unhighlightedItem:o,unhighlightedSeries:l}=this.properties.highlight;this.hasChangesOnHighlight=a||!Mp(r)||!Mp(o)||!Mp(l)}bringToFront(){return this.properties.highlight.enabled&&this.properties.highlight.bringToFront&&this.isSeriesHighlighted(this.ctx.highlightManager.getActiveHighlight())}isSeriesHighlighted(t,e){return this.properties.highlight.enabled?t?.series===this:!1}isItemHighlighted(t,e){if(!(t?.datumIndex==null||e==null))return t.datumIndex===e}getHighlightStyle(t,e,i,s){const n=this.ctx.highlightManager?.getActiveHighlight();return i??(i=this.getHighlightState(n,t,e,s)),this.properties.highlight.getStyle(i)}resolveMarkerDrawingModeForState(t,e){return IE(t,e)}filterItemStylerFillParams(t){return jP(t)?Dv(t,["bounds","colorSpace","gradient","reverse"]):WP(t)?Dv(t,["padding"]):t}getModuleTooltipParams(){return this.moduleMap.mapModules(t=>t.getTooltipParams()).reduce((t,e)=>Object.assign(t,e),{})}pickNodes(t,e,i=!1){const{pickModes:s,pickModeAxis:n,visible:a,contentGroup:r}=this;if(!a||!r.visible)return;let o=1/0;if(e==="tooltip"||e==="highlight-tooltip"){const{tooltip:u}=this.properties;o=typeof u.range=="number"?u.range:1/0,i||(i=u.range==="exact")}else if(e==="event"||e==="context-menu"){const{nodeClickRange:u}=this.properties;o=typeof u=="number"?u:1/0,i||(i=u==="exact")}const l=s.filter(u=>!i||u===0),{x:c,y:h}=t,d=JSON.stringify({x:c,y:h,maxDistance:o,selectedPickModes:l});if(this._pickNodeCache.has(d))return this._pickNodeCache.get(d);for(const u of l){let p;switch(u){case 0:{const g=this.pickNodesExactShape(t);p=g.length===0?void 0:{datums:g,distance:0};break}case 1:{const g=this.pickNodeClosestDatum(t),f=g?.distance===0?this.pickNodesExactShape(t):void 0;f!=null&&f.length!==0?p={datums:f,distance:0}:g?p={datums:[g.datum],distance:g.distance}:p=void 0;break}case 2:{const g=n==null?void 0:this.pickNodeMainAxisFirst(t,n==="main-category");p=g==null?void 0:{datums:[g.datum],distance:g.distance};break}}if(p&&p.distance<=o)return this._pickNodeCache.set(d,{pickMode:u,datums:p.datums,distance:p.distance})}return this._pickNodeCache.set(d,void 0)}pickNodesExactShape(t){const e=[];for(const i of this.contentGroup.pickNodes(t.x,t.y)){const s=i.closestDatum();typeof s=="object"&&s!=null&&s.missing!==!0&&e.push(s)}return e}pickNodeClosestDatum(t){throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented")}pickNodeNearestDistantObject(t,e){const i=$P(t.x,t.y,e),s=i.nearest?.closestDatum();if(typeof s=="object"&&s!=null&&s.missing!==!0)return{datum:s,distance:Math.sqrt(i.distanceSquared)}}pickNodeMainAxisFirst(t,e){throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented")}getLabelData(){return[]}updatePlacedLabelData(t){}fireEvent(t){Sv([this.properties,this.ctx.chartService],this.fireEventWrapper,t)}fireNodeClickEvent(t,e){const i=new this.NodeEvent("seriesNodeClick",t,e,this);return this.fireEvent(i),!i.defaultPrevented}fireNodeDoubleClickEvent(t,e){const i=new this.NodeEvent("seriesNodeDoubleClick",t,e,this);return this.fireEvent(i),!i.defaultPrevented}createNodeContextMenuActionEvent(t,e){return new this.NodeEvent("nodeContextMenuAction",t,e,this)}onLegendInitialState(t,e){const{visible:i=!0,itemId:s,legendItemName:n}=e??{};this.toggleSeriesItem(i,t,s,n)}onLegendItemClick(t){const{enabled:e,itemId:i,series:s,legendType:n}=t,a="legendItemName"in this.properties?this.properties.legendItemName:void 0,r="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,o=a!=null&&a===t.legendItemName;(s.id===this.id||o||r!=null)&&this.toggleSeriesItem(e,n,i,a,t)}onLegendItemDoubleClick(t){const{enabled:e,itemId:i,series:s,numVisibleItems:n,legendType:a}=t,r="legendItemName"in this.properties?this.properties.legendItemName:void 0,o="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,l=r!=null&&r===t.legendItemName;s.id===this.id||l||o!=null?this.toggleSeriesItem(!0,a,i,r,t):e&&n===1?this.toggleSeriesItem(!0,a,void 0,r):this.toggleSeriesItem(!1,a,void 0,r)}toggleSeriesItem(t,e,i,s,n){const a=this.id;(t||e!=="category")&&(this.visible=t),this.nodeDataRefresh=!0,this._pickNodeCache.clear();const r={type:"seriesVisibilityChange",seriesId:a,itemId:i,legendItemName:n?.legendItemName??s,visible:t};this.fireEvent(r),this.ctx.legendManager.toggleItem(t,a,i,s)}isEnabled(){return this.visible}getModuleMap(){return this.moduleMap}createModuleContext(){return{...this.ctx,series:this}}getAxisValueText(t,e,i,s,n,a,r){const{id:o,properties:l}=this;return t.formatDatum(l,i,e,o,a,s,n,void 0,void 0,void 0,r)}getLabelText(t,e,i,s,n,a,r,o=!1){if(t==null&&!o)return"";const{axes:l,canHaveAxes:c,ctx:h,id:d,properties:u}=this,p="series-label",g="legendItemName"in u?u.legendItemName:void 0,f={seriesId:this.id,...r},m=c?Nv(s):void 0,b=m==null?void 0:l[this.resolveKeyDirection(m)];if(b!=null)return b.formatDatum(u,t,p,d,g,e,i,n,a,f,o);const{formatManager:x}=h,v=this.callWithContext.bind(this),S=M=>a.formatValue(v,M.type,M.value,f)??x.format(v,M)??(t==null?"":String(t)),I=this.getFormatterContext(s);switch(s){case"y":case"color":case"size":return S({type:"number",value:t,datum:e,seriesId:d,legendItemName:g,key:i,source:p,property:s,domain:n,boundSeries:I,fractionDigits:void 0,visibleDomain:void 0});case"x":case"radius":case"angle":case"label":case"secondaryLabel":case"calloutLabel":case"sectorLabel":case"legendItem":return S({type:"category",value:t,datum:e,seriesId:d,legendItemName:g,key:i,source:p,property:s,domain:n,boundSeries:I})}}getMarkerStyle(t,{datumIndex:e,datum:i,point:s},n,a,r={size:s?.size??t.size??0},o){const{itemStyler:l}=t,{highlightState:c,isHighlight:h=!1,checkForHighlight:d=!0,resolveMarkerSubPath:u=["marker"],resolveStyler:p=!1}=a??{},g=["series",`${this.declarationOrder}`,...u];if(p){const x={permissivePath:!0},v=this.ctx.optionsGraphService.resolvePartial(g,r,x);v&&(r={...v,size:v.size??r.size})}const f=d?this.getHighlightStyle(h,e,c):void 0;let b=Iv(f,r,t.getStyle(),o);if(l&&n){const x=this.ctx.highlightManager?.getActiveHighlight(),v=this.getHighlightStateString(x,h,e),S=this.filterItemStylerFillParams(b.fill),I=this.cachedCallWithContext(l,{seriesId:this.id,...b,fill:S,...n,highlightState:v,datum:i}),M=this.ctx.optionsGraphService.resolvePartial(g,I);b=Iv(M,b)}return b}applyMarkerStyle(t,e,i,s,{applyTranslation:n=!0,selected:a=!0}={}){const{shape:r,size:o=0}=t,l=this.visible&&o>0&&i&&!Number.isNaN(i.x)&&!Number.isNaN(i.y);if(e.setStyleProperties(t,s),n?e.setProperties({visible:l,shape:r,size:o,x:i?.x,y:i?.y,scalingCenterX:i?.x,scalingCenterY:i?.y}):e.setProperties({visible:l,shape:r,size:o}),a||(e.fillOpacity*=qP,e.strokeOpacity*=JP),typeof r=="function"&&!e.dirtyPath){e.path.clear(!0),e.updatePath(),e.checkPathDirty();const c=e.getBBox();if(i!=null&&c.isFinite()){const h=c.computeCenter(),[d,u]=["x","y"].map(p=>(t.strokeWidth??0)+Math.abs(h[p]-i[p]));i.focusSize=Math.max(c.width+d,c.height+u)}}}get nodeDataDependencies(){return this._nodeDataDependencies??{seriesRectWidth:Number.NaN,seriesRectHeight:Number.NaN}}checkResize(t){const{width:e,height:i}=t??{width:Number.NaN,height:Number.NaN},s=t?{seriesRectWidth:e,seriesRectHeight:i}:void 0,n=YP(this.nodeDataDependencies,s)!=null;return n&&(this._nodeDataDependencies=s,this.markNodeDataDirty()),n}pickFocus(t){}pickViewportFocus(t){}resetDatumCallbackCache(){this.datumCallbackCache.clear()}cachedDatumCallback(t,e){const{datumCallbackCache:i}=this,s=i.get(t);if(s!=null)return s;try{const n=e();return i.set(t,n),n}catch(n){UP.error(String(n))}}cachedCallWithContext(t,e){return this.ctx.callbackCache.call([this.properties,this.ctx.chartService],t,e)}callWithContext(t,e){return Sv([this.properties,this.ctx.chartService],t,e)}formatTooltipWithContext(t,e,i){return t.formatTooltip([this.properties,this.ctx.chartService],e,i)}minTimeInterval(){}needsDataModelDiff(){return!this.ctx.animationManager.isSkipped()||!!this.chart?.flashOnUpdateEnabled}};Zo.className="Series",y([VP({changeValue:function(t,e){this.onSeriesGroupingChange(e,t)}})],Zo.prototype,"seriesGrouping",2);import{ChartUpdateType as Qc,Logger as kv,Vec4 as wv,clamp as QP,createId as e_}from"ag-charts-core";import{createElement as Ov,createSvgElement as Np,setElementBBox as t_}from"ag-charts-core";var i_=class{constructor(t){this.swapChain=t,this.focusVisibleStyle=!1,this.div=Ov("div"),this.svg=Np("svg"),this.outerPath=Np("path"),this.innerPath=Np("path"),this.svg.append(this.outerPath),this.svg.append(this.innerPath),this.outerPath.classList.add("ag-charts-focus-svg-outer-path"),this.innerPath.classList.add("ag-charts-focus-svg-inner-path"),this.element=Ov("div","ag-charts-focus-indicator"),this.element.ariaHidden="true",this.element.append(this.svg),this.swapChain.addListener("swap",e=>this.onSwap(e))}clear(){}update(t,e,i){if(e!=null)if(t instanceof Ue){const s=(a,r)=>{let{x:o,y:l}=fe.toCanvasPoint(t,a,r);return o-=e.x??0,l-=e.y??0,{x:o,y:l}},n=t.svgPathData(s);this.outerPath.setAttribute("d",n),this.innerPath.setAttribute("d",n),this.show(this.svg)}else{let s;if(i){const n=Math.max(t.x-e.x,0),a=Math.max(t.y-e.y,0),r=Math.min(t.x+t.width-e.x,e.width),o=Math.min(t.y+t.height-e.y,e.height);s=new P(n,a,r-n,o-a)}else s=new P(t.x-e.x,t.y-e.y,t.width,t.height);t_(this.div,s),this.show(this.div)}}onSwap(t){t!==this.element.parentElement&&(this.element.remove(),t.appendChild(this.element),this.overrideFocusVisible(this.focusVisible))}show(t){this.element.innerHTML="",this.element.append(t)}overrideFocusVisible(t){this.focusVisible=t;const e={true:"1",false:"0",undefined:""};this.element.parentElement?.style.setProperty("opacity",e[`${t}`])}isFocusVisible(){return this.focusVisible??this.focusVisibleStyle}onFocus(){this.overrideFocusVisible(void 0);const t=this.element.parentElement,e=this.element.ownerDocument.defaultView;return this.focusVisibleStyle=t!=null&&e.getComputedStyle(t).opacity==="1",this.focusVisibleStyle}onBlur(){this.overrideFocusVisible(void 0),this.focusVisibleStyle=!1}};import{createElement as s_,createElementId as Ev,setAttribute as kp,setAttributes as Rv,setElementStyle as eh}from"ag-charts-core";var n_=class{constructor(t,e,i,s){this.label1=t,this.label2=e,this.hasFocus=!1,this.skipDispatch=!1,this.listeners={blur:[],focus:[],swap:[]},this.onBlur=n=>(eh(n.target,"pointer-events",void 0),!this.skipDispatch&&this.dispatch("blur",n)),this.onFocus=n=>(eh(n.target,"pointer-events","auto"),!this.skipDispatch&&this.dispatch("focus",n)),kp(this.label1,"id",Ev()),kp(this.label2,"id",Ev()),eh(this.label1,"display","none"),eh(this.label2,"display","none"),this.label1.textContent=s,this.label2.textContent=s,this.activeAnnouncer=this.createAnnouncer(i),this.inactiveAnnouncer=this.createAnnouncer(i),kp(this.activeAnnouncer,"tabindex",0),this.label2.insertAdjacentElement("afterend",this.activeAnnouncer),this.label2.insertAdjacentElement("afterend",this.inactiveAnnouncer),this.swap(s)}createAnnouncer(t){const e=s_("div");return e.role=t,e.className="ag-charts-swapchain",e.addEventListener("blur",this.onBlur),e.addEventListener("focus",this.onFocus),e}destroy(){for(const t of[this.activeAnnouncer,this.inactiveAnnouncer])t.removeEventListener("blur",this.onBlur),t.removeEventListener("focus",this.onFocus),t.remove()}focus(t){this.focusOptions=t,this.activeAnnouncer.focus(t),this.focusOptions=void 0}update(t){this.skipDispatch=!0,this.swap(t),this.hasFocus&&this.activeAnnouncer.focus(this.focusOptions),this.skipDispatch=!1}addListener(t,e){this.listeners[t].push(e),t==="swap"&&e(this.activeAnnouncer)}dispatch(t,e){t==="focus"?this.hasFocus=!0:t==="blur"&&(this.hasFocus=!1);for(const i of this.listeners[t])i(e)}swap(t){const e=this.activeAnnouncer.tabIndex;this.label2.textContent=t,[this.inactiveAnnouncer,this.activeAnnouncer]=[this.activeAnnouncer,this.inactiveAnnouncer],[this.label1,this.label2]=[this.label2,this.label1],Rv(this.inactiveAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!0,tabindex:void 0}),Rv(this.activeAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!1,tabindex:e}),this.dispatch("swap",this.activeAnnouncer)}};import{entries as a_}from"ag-charts-core";var r_={arrowdown:{bindings:[{code:"ArrowDown"}]},arrowleft:{bindings:[{code:"ArrowLeft"}]},arrowright:{bindings:[{code:"ArrowRight"}]},arrowup:{bindings:[{code:"ArrowUp"}]},home:{bindings:[{code:"Home"}]},end:{bindings:[{code:"End"}]},delete:{bindings:[{key:"Backspace"},{key:"Delete"}],activatesFocusIndicator:!1},redo:{bindings:[{key:"y",ctrlOrMeta:!0},{key:"z",ctrlOrMeta:!0,shift:!0}],activatesFocusIndicator:!1},undo:{bindings:[{key:"z",ctrlOrMeta:!0}],activatesFocusIndicator:!1},submit:{bindings:[{key:"Enter"},{code:"Enter"},{code:"Space"}]},zoomin:{bindings:[{key:"+"},{code:"ZoomIn"},{code:"Add"}],activatesFocusIndicator:!1},zoomout:{bindings:[{key:"-"},{code:"ZoomOut"},{code:"Substract"}],activatesFocusIndicator:!1},panxleft:{bindings:[{key:"PageUp"},{code:"PageUp"}],activatesFocusIndicator:!0},panxright:{bindings:[{key:"PageDown"},{code:"PageDown"}],activatesFocusIndicator:!0}};function o_(t,e){for(const i of e)if("code"in i){if(i.code===t.code)return!0}else if(i.key===t.key&&(i.shift===void 0||i.shift===t.shiftKey)&&(i.ctrlOrMeta===void 0||i.ctrlOrMeta===t.ctrlKey||i.ctrlOrMeta===t.metaKey))return!0;return!1}function l_(t){for(const[e,{activatesFocusIndicator:i=!0,bindings:s}]of a_(r_))if(o_(t,s))return{name:e,activatesFocusIndicator:i}}function c_(t,e,i){const s=Yu(t,i.datum,i.movedBounds);if(s!=null)return{x:s.canvasX,y:s.canvasY};const n=i.bounds;if(n!=null){if(n instanceof P){const{x:a,y:r}=n.computeCenter();return{x:e.x+a,y:e.y+r}}return fe.toCanvas(n).computeCenter()}}function wp({bounds:t}){return t instanceof P?t:t!=null?fe.toCanvas(t):P.NaN}function h_(t,e,i){const{x:s,y:n}=c_(t,e,i)??{};if(s!==void 0&&n!==void 0)return{type:"keyboard",canvasX:s,canvasY:n}}import{BaseProperties as Pv,CleanupRegistry as d_,Property as $t,calculatePlacement as u_,clamp as _v,isNode as Fv}from"ag-charts-core";import{EventEmitter as p_}from"ag-charts-core";var Vv=.1,Bv=200,zv=12,g_=.5,f_=class{constructor(t){this.agDocument=t,this.events=new p_,this.x1=Number.NaN,this.y1=Number.NaN,this.x=Number.NaN,this.y=Number.NaN,this.vx=0,this.vy=0,this.t0=Number.NaN,this.animationFrameHandle=void 0}reset(){this.x=Number.NaN,this.y=Number.NaN,this.animationFrameHandle!=null&&(this.agDocument.cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0)}update(t,e){if(Number.isNaN(this.x)||Number.isNaN(this.y)){this.x=t,this.y=e,this.vx=0,this.vy=0,this.emitUpdate(),this.animationFrameHandle!=null&&(this.agDocument.cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0);return}this.x1=t,this.y1=e,this.t0=Date.now(),this.animationFrameHandle??(this.animationFrameHandle=this.agDocument.requestAnimationFrame(this.onFrame.bind(this)))}onFrame(){this.animationFrameHandle=void 0;const{x1:t,y1:e,t0:i}=this,s=Date.now(),n=s-i;this.t0=s;const a=.001,r=Math.trunc(Math.ceil(n/(a*1e3)));let{x:o,y:l,vx:c,vy:h}=this;for(let d=0;d"))}import{DeclaredSceneChangeDetection as Op,DeclaredSceneObjectChangeDetection as S_,TRIPLE_EQ as I_}from"ag-charts-core";import{toRadians as ih}from"ag-charts-core";function Xo(t,e){const{path:i,size:s}=t,{x:n,y:a}=t;i.clear();let r=!1;for(const[o,l]of e){const c=n+(o-.5)*s,h=a+(l-.5)*s;r?i.lineTo(c,h):i.moveTo(c,h),r=!0}i.closePath()}var D_={circle({path:t,x:e,y:i,size:s}){const n=s/2;t.arc(e,i,n,0,Math.PI*2),t.closePath()},cross(t){Xo(t,[[.25,0],[.5,.25],[.75,0],[1,.25],[.75,.5],[1,.75],[.75,1],[.5,.75],[.25,1],[0,.75],[.25,.5],[0,.25]])},diamond(t){Xo(t,[[.5,0],[1,.5],[.5,1],[0,.5]])},heart({path:t,x:e,y:i,size:s}){const n=s/4;i=i+n/2,t.arc(e-n,i-n,n,ih(130),ih(330)),t.arc(e+n,i-n,n,ih(220),ih(50)),t.lineTo(e,i+n),t.closePath()},pin({path:t,x:e,y:i,size:s}){t.moveTo(e+(.891-.5)*s,i+(.391-.5)*s),t.cubicCurveTo(e+(.891-.5)*s,i+(.606-.5)*s,e+(.5-.5)*s,i+(1-.5)*s,e+(.5-.5)*s,i+(1-.5)*s),t.cubicCurveTo(e+(.5-.5)*s,i+(1-.5)*s,e+(.109-.5)*s,i+(.606-.5)*s,e+(.109-.5)*s,i+(.391-.5)*s),t.cubicCurveTo(e+(.109-.5)*s,i+(.175-.5)*s,e+(.284-.5)*s,i+(0-.5)*s,e+(.5-.5)*s,i+(0-.5)*s),t.cubicCurveTo(e+(.716-.5)*s,i+(0-.5)*s,e+(.891-.5)*s,i+(.175-.5)*s,e+(.891-.5)*s,i+(.391-.5)*s),t.closePath()},plus(t){Xo(t,[[1/3,0],[2/3,0],[2/3,1/3],[1,1/3],[1,2/3],[2/3,2/3],[2/3,1],[1/3,1],[1/3,2/3],[0,2/3],[0,1/3],[1/3,1/3]])},square({path:t,x:e,y:i,size:s,pixelRatio:n}){const a=s/2;t.moveTo(et(n,e-a),et(n,i-a)),t.lineTo(et(n,e+a),et(n,i-a)),t.lineTo(et(n,e+a),et(n,i+a)),t.lineTo(et(n,e-a),et(n,i+a)),t.closePath()},star({path:t,x:e,y:i,size:s}){const a=s/2,r=a/2,o=Math.PI/2;for(let l=0;l<5*2;l++){const c=l%2===0?a:r,h=l*Math.PI/5-o,d=e+Math.cos(h)*c,u=i+Math.sin(h)*c;t.lineTo(d,u)}t.closePath()},triangle(t){Xo(t,[[.5,0],[1,.87],[0,.87]])}},qo=class extends Ue{constructor(){super(...arguments),this.shape="square",this.x=0,this.y=0,this.size=12}isPointInPath(t,e){return this.distanceSquared(t,e)<=0}get midPoint(){return{x:this.x,y:this.y}}distanceSquared(t,e){const i=We.anchor(this.shape),s=t-this.x+(i.x-.5)*this.size,n=e-this.y+(i.y-.5)*this.size,a=this.size/2;return Math.max(s*s+n*n-a*a,0)}updatePath(){const{path:t,shape:e,x:i,y:s,size:n}=this,a=this.layerManager?.canvas?.pixelRatio??1,r=We.anchor(e),o={path:t,x:i-(r.x-.5)*n,y:s-(r.y-.5)*n,size:n,pixelRatio:a};t.clear(),typeof e=="string"?D_[e](o):typeof e=="function"&&e(o)}computeBBox(){const{x:t,y:e,size:i}=this,s=We.anchor(this.shape);return new P(t-i*s.x,e-i*s.y,i,i)}executeFill(t,e){if(e)return super.executeFill(t,e)}executeStroke(t,e){if(e)return super.executeStroke(t,e)}};y([S_({equals:I_})],qo.prototype,"shape",2),y([Op()],qo.prototype,"x",2),y([Op()],qo.prototype,"y",2),y([Op({convertor:Math.abs})],qo.prototype,"size",2);var We=class extends Ja(ic(Qa(qo))){static anchor(t){return t==="pin"?{x:.5,y:1}:typeof t=="function"&&"anchor"in t?t.anchor:{x:.5,y:.5}}constructor(t){super(t),t?.shape!=null&&(this.shape=t.shape)}resetAnimationProperties(t,e,i,s,n,a){this.__x=t,this.__y=e,this.__size=i,this.__opacity=s,this.resetScalingProperties(n,a,t,e),this.dirtyPath=!0,this.markDirty()}};function M_(t,e,i=e*(5/3)){const s=new U,n=Math.min(t.marker.strokeWidth??1,2),a=t.line?.enabled?Math.min(t.line.strokeWidth,2):0,r=Math.max(t.marker.enabled===!1?0:e,t.line==null?0:i),o=Math.max(t.marker.enabled===!1?0:e,a);if(t.line?.enabled){const{stroke:l,strokeOpacity:c,lineDash:h}=t.line,d=new ri;d.x1=0,d.y1=o/2,d.x2=r,d.y2=o/2,d.stroke=l,d.strokeOpacity=c,d.strokeWidth=a,d.lineDash=h,s.append(d)}if(t.marker.enabled!==!1){const{shape:l,fill:c,fillOpacity:h,stroke:d,strokeOpacity:u,lineDash:p,lineDashOffset:g}=t.marker,f=new We;f.shape=l??"square",f.size=e,f.fill=c,f.fillOpacity=h??1,f.stroke=d,f.strokeOpacity=u??1,f.strokeWidth=n,f.lineDash=p,f.lineDashOffset=g??0;const m=We.anchor(l),b=r/2+(m.x-.5)*e,x=o/2+(m.y-.5)*e,v=e/(e+n);f.x=b,f.y=x,f.scalingCenterX=b,f.scalingCenterY=x,f.scalingX=v,f.scalingY=v,s.append(f)}return U.toSVG(s,r,o)}var ht="ag-charts-tooltip",A_="ag-charts-tooltip--dark";function ws(t){return t==null?!1:Array.isArray(t)?t.some(e=>ws(e.text)):b_(t).trim()!==""}function ga(t,e=!1){return t==null?!e:typeof t=="number"&&!Number.isFinite(t)}function C_(t){return t.type==="raw"||!t.data||t.data.length===0?!1:t.data.every(e=>e.missing===!0)}function Gv(t){const e=[],i=new Map;for(const s of t)if(!C_(s))if(s.type==="structured"){const{heading:n}=s,a=ws(n)?i.get(n):void 0,r={type:"structured",heading:n,items:[s]};a==null?(i.set(n,r),e.push(r)):a.items.push(s)}else e.push(s);return e}function T_(t){const e=y_().createElement("div");e.innerHTML=t;const i=e.textContent?.trim();return i??(m_.warnOnce("cannot retrieve tooltip textContent (required for aria-label)"),"")}function L_(t){const e=Gv(t),i=[];for(const s of e){if(s.type==="raw"){i.push(T_(s.rawHtmlString));continue}ws(s.heading)&&i.push(pn(s.heading));for(const n of s.items)if(ws(n.title)&&i.push(pn(n.title)),n.data)for(const a of n.data)a.missing!==!0&&i.push(a.label??a.fallbackLabel,pn(a.value))}return i.filter(s=>s!=="").join("; ")}function Uv(t,e,i){let s="";ws(t)?(s+=`${br(t)}`,s+=" ",s+=`${br(e)}`):s+=`${br(e)}`;const n=[`${ht}-row`];return i&&n.push(`${ht}-row--inline`),s=`
${s}
`,s}function N_(t){let e="";if(t.data?.length&&t.data.every(a=>a.missing===!0))return e;const i=ws(t.title),s=!i&&t.data?.length===1,n=t.symbol==null?void 0:M_(t.symbol,12);if(n!=null&&(i||t.data?.length)&&(e+=`${n}`),i&&(e+=`${br(t.title)}`,e+=" "),t.data)for(const a of t.data)a.missing!==!0&&(e+=Uv(a.label??a.fallbackLabel,pn(a.value),s),e+=" ");return e}function Hv(t,e){if(t==null||e.length===1)return;const i=t?.t("tooltipPaginationStatus",{index:e.index+1,count:e.length});return``}function jv(t,e,i,s){const n=e.items.length===1?e.items[0]:void 0;let a,r,o;switch(i){case"compact":a=!0,r=pn(n?.title);break;case"single":const h=ws(e.heading);a=n!=null&&(!h||n.title==null)&&n.data?.length===1&&n.data[0].label==null&&n.data[0].value!=null,o=pn(h?e.heading:n?.title);break;case"shared":a=!1}let l="";if(a&&n!=null){if(ws(r)&&(l+=`${br(r)}`),n.data)for(const h of n.data)h.missing!==!0&&(l+=Uv(h.label??o,pn(h.value),!1),l+=" ")}else{ws(e.heading)&&(l+=`${br(pn(e.heading))}`,l+=" ");for(const h of e.items)l+=N_(h)}if(l.length===0)return;const c=i!=="compact"&&s!=null?Hv(t,s):void 0;return c+null&&(l+=c),l=`
${l.trimEnd()}
`,l}function k_(t,e){const i=e==null?void 0:Hv(t,e);return i==null?"":`
${i}
`}function w_(t,e,i,s){const n=Gv(e);if(n.length!==0){if(n.length===1&&n[0].type==="structured")return jv(t,n[0],i,s);{const a=n.map(r=>r.type==="structured"?jv(t,r,i):r.rawHtmlString);return s!=null&&a.push(k_(t,s)??""),a.join("")}}}var O_={left:-1,"top-left":-1,"bottom-left":-1,top:0,center:0,bottom:0,right:1,"top-right":1,"bottom-right":1},E_={"top-left":-1,top:-1,"top-right":-1,left:0,center:0,right:0,"bottom-left":1,bottom:1,"bottom-right":1},R_={left:3,"top-left":void 0,"bottom-left":void 0,top:2,center:void 0,bottom:1,right:0,"top-right":void 0,"bottom-right":void 0},Wv={top:2,bottom:2,left:1,right:1,"top-right":3,"top-left":3,"bottom-right":3,"bottom-left":3,center:0},P_={pointer:"top",node:"top",chart:"top-left"},xr=class extends Pv{constructor(){super(...arguments),this.xOffset=0,this.yOffset=0}};y([$t],xr.prototype,"xOffset",2),y([$t],xr.prototype,"yOffset",2),y([$t],xr.prototype,"anchorTo",2),y([$t],xr.prototype,"placement",2);var Bi=class extends Pv{constructor(t){super(),this.agDocument=t,this.enabled=!0,this.mode="single",this.delay=0,this.range=void 0,this.wrapping="hyphenate",this.position=new xr,this.pagination=!1,this.darkTheme=!1,this.bounds="extended",this.cleanup=new d_,this.springAnimation=new f_(this.agDocument),this.enableInteraction=!1,this.wrapTypes=["always","hyphenate","on-space","never"],this._elementSize=void 0,this._showTimeout=void 0,this.arrowPosition=void 0,this._visible=!1,this.positionParams=void 0,this.localeManager=void 0,this.cleanup.register(this.springAnimation.events.on("update",()=>{this.updateTooltipPosition()}))}get interactive(){return this.enableInteraction}setup(t,e){this.elementProxy=e.addDeferredProxyChild("tooltip-container",ht),this.elementProxy.toggleClass(ht,!0),this.elementProxy.setProperty("position-anchor",e.anchorName),this.elementProxy.setAttr("popover","manual");const i=this.elementProxy.addResizeListener(s=>{this._elementSize=s,this.updateTooltipPosition()});return this.localeManager=t,()=>{e.removeChild("tooltip-container",ht),this.cleanup.flush(),i()}}isVisible(){return this._visible}contains(t){return this.elementProxy?.contains(t)??!1}updateTooltipPosition(){const{elementProxy:t,_elementSize:e,positionParams:i}=this;if(t==null||e==null||i==null)return;const{canvasRect:s,relativeRect:n,meta:a}=i,{x:r,y:o}=this.springAnimation,l=a.position?.anchorTo??"pointer";let c=a.position?.placement??P_[l];Array.isArray(c)||(c=[c]);const h=a.position?.xOffset??0,d=a.position?.yOffset??0,u=n.x,p=n.y,g=n.width-e.width-1+u,f=n.height-e.height+p;let m=0,b,x,v=!1;do{b=c[m],m+=1;const A=this.getTooltipBounds({elementSize:e,placement:b,anchorTo:l,canvasX:r,canvasY:o,yOffset:d,xOffset:h,canvasRect:s});x=u_(e.width,e.height,n,A),v=!1,Wv[b]&1&&(v||(v=x.xg)),Wv[b]&2&&(v||(v=x.yf))}while(m{(o.relatedTarget==null||Fv(o.relatedTarget)&&!this.contains(o.relatedTarget))&&this.popInteractiveLeaveCallback()}},a.addEventListener("focusout",this.interactiveLeave.listener),a.addEventListener("mouseout",this.interactiveLeave.listener)),r}popInteractiveLeaveCallback(){const{interactiveLeave:t,elementProxy:e}=this;this.interactiveLeave=void 0,t&&(e&&(e.removeEventListener("focusout",t.listener),e.removeEventListener("mouseout",t.listener)),t.callback())}toggle(t,e=!1){const{delay:i}=this;t&&i>0&&!e?this._showTimeout??(this._showTimeout=setTimeout(()=>{this._showTimeout=void 0,this.toggleCallback(!0)},i)):(clearTimeout(this._showTimeout),this._showTimeout=void 0,this.toggleCallback(t))}toggleCallback(t){this.elementProxy?.isConnected&&this._visible!==t&&(this._visible=t,this.elementProxy.togglePopover(t),t?this.updateTooltipPosition():(this.springAnimation.reset(),this.popInteractiveLeaveCallback(),this.elementProxy.reset()))}updateClassModifiers(){if(!this.elementProxy?.isConnected)return;const{elementProxy:t}=this,{enableInteraction:e,arrowPosition:i,mode:s,darkTheme:n,wrapping:a}=this,r=(o,l)=>t.toggleClass(`${ht}--${o}`,l);r("no-interaction",!e),r("arrow-top",i===1),r("arrow-right",i===3),r("arrow-bottom",i===2),r("arrow-left",i===0),r("compact",s==="compact"),t.toggleClass(A_,n);for(const o of this.wrapTypes)t.toggleClass(`${ht}--wrap-${o}`,o===a)}getTooltipBounds(t){const{elementSize:e,anchorTo:i,placement:s,canvasX:n,canvasY:a,yOffset:r,xOffset:o,canvasRect:l}=t,{width:c,height:h}=e,d={width:c,height:h};if(i==="node"||i==="pointer"){const u=O_[s],p=E_[s];return d.top=a+r+h*(p-1)/2+8*p,d.left=n+o+c*(u-1)/2+8*u,d}switch(s){case"top":return d.top=r,d.left=l.width/2-c/2+o,d;case"right":return d.top=l.height/2-h/2+r,d.left=l.width-c+o,d;case"left":return d.top=l.height/2-h/2+r,d.left=o,d;case"bottom":return d.top=l.height-h+r,d.left=l.width/2-c/2+o,d;case"top-left":return d.top=r,d.left=o,d;case"top-right":return d.top=r,d.left=l.width-c+o,d;case"bottom-right":return d.top=l.height-h+r,d.left=l.width-c+o,d;case"bottom-left":return d.top=l.height-h+r,d.left=o,d}return d}};y([$t],Bi.prototype,"enabled",2),y([$t],Bi.prototype,"mode",2),y([$t],Bi.prototype,"showArrow",2),y([$t],Bi.prototype,"delay",2),y([$t],Bi.prototype,"range",2),y([$t],Bi.prototype,"wrapping",2),y([$t],Bi.prototype,"position",2),y([$t],Bi.prototype,"pagination",2),y([$t],Bi.prototype,"darkTheme",2),y([$t],Bi.prototype,"bounds",2);function __(t,e){for(const i of t)if(fe.toCanvas(i.node).intersectsWith(e))return!0;return!1}function F_(t){switch(t.sourceDetail){case"keyboard-page(1)":case"keyboard-page(-1)":return"viewport-start";case"keyboard-page(home)":return"data-start";case"keyboard-page(end)":return"data-end";default:return}}var Yv=class extends uu{constructor(t){super(),this.chart=t,this.id=e_(this),this.series=[],this.announceMode="when-changed",this.highlight={pendingHoverEvent:void 0,appliedHoverEvent:void 0,stashedHoverEvent:void 0},this.tooltip={lastHover:void 0},this.activeState={lastActive:void 0,highlightInViewport:!0},this._device="pointer",this.focus={initialized:!1,sortedSeries:[],series:void 0,seriesIndex:0,datumIndex:0,datum:void 0,pendingViewportFocus:void 0},this.cachedTooltipContent=void 0,this.hoverScheduler=this.createHoverScheduler(),this.pickManager=new XP(t.ctx.activeManager,t.tooltip);const e=t.ctx.localeManager.t("ariaInitSeriesArea"),i=t.ctx.domManager.addChild("series-area","series-area-aria-label1"),s=t.ctx.domManager.addChild("series-area","series-area-aria-label2");this.swapChain=new n_(i,s,"img",e),this.swapChain.addListener("blur",o=>this.onBlur(o)),this.swapChain.addListener("focus",()=>this.onFocus()),t.ctx.domManager.mode==="normal"&&(this.focusIndicator=new i_(this.swapChain),this.focusIndicator.overrideFocusVisible(t.mode==="integrated"?!1:void 0));const{seriesDragInterpreter:n,seriesWidget:a,containerWidget:r}=t.ctx.widgets;a.setTabIndex(-1),this.cleanup.register(()=>t.ctx.domManager.removeChild("series-area","series-area-aria-label1"),()=>t.ctx.domManager.removeChild("series-area","series-area-aria-label2"),a.addListener("focus",()=>this.swapChain.focus({preventScroll:!0})),a.addListener("mousemove",o=>this.onHover(o,a)),a.addListener("wheel",o=>this.onWheel(o)),a.addListener("mouseleave",o=>this.onLeave(o)),a.addListener("keydown",o=>this.onKeyDown(o)),a.addListener("contextmenu",(o,l)=>this.onContextMenu(o,l)),r.addListener("contextmenu",(o,l)=>this.onContextMenu(o,l)),r.addListener("click",(o,l)=>this.onClick(o,l)),r.addListener("dblclick",(o,l)=>this.onClick(o,l)),t.ctx.animationManager.addListener("animation-start",()=>this.onAnimationStart()),t.ctx.eventsHub.on("active:load-memento",o=>this.onActiveLoadMemento(o)),t.ctx.eventsHub.on("active:update",o=>this.onActiveUpdate(o)),t.ctx.eventsHub.on("dom:resize",()=>this.onResize()),t.ctx.eventsHub.on("dom:container-change",()=>this.resetHoverScheduler()),t.ctx.eventsHub.on("highlight:change",o=>this.changeHighlightDatum(o)),t.ctx.eventsHub.on("highlight:selection-updated",o=>this.onHighlightSelectionUpdate(o)),t.ctx.eventsHub.on("layout:complete",o=>this.layoutComplete(o)),t.ctx.updateService.addListener("pre-scene-render",()=>this.preSceneRender()),t.ctx.updateService.addListener("update-complete",()=>this.updateComplete()),t.ctx.eventsHub.on("zoom:change-complete",o=>this.onZoomChangeComplete(o)),t.ctx.eventsHub.on("zoom:pan-start",()=>this.clearAll())),n&&this.cleanup.register(n.events.on("drag-move",o=>this.onDragMove(o,a)),n.events.on("click",o=>this.onClick(o,a)),n.events.on("dblclick",o=>this.onClick(o,a)))}get bbox(){return(this.seriesRect??P.zero).clone()}setHoverDevice(t){(t==="setState"||!this.isState(1))&&(this._device=t)}getHoverDevice(){return this._device}initFocus(t){if(!this.focus.initialized)switch(this.focus.initialized=!0,t){case"data-end":{this.focus.datumIndex=Number.MAX_VALUE;break}case"viewport-start":case"viewport-end":{this.focus.pendingViewportFocus=t;break}default:}}isState(t){return this.chart.ctx.interactionManager.isState(t)}isIgnoredTouch(t){return!(t.device!=="touch"||t.type==="click"||this.chart.ctx.chartService.touch.dragAction==="hover"||this.chart.ctx.chartService.touch.dragAction==="drag"&&this.isState(18))}dataChanged(){var t;this.cachedTooltipContent=void 0,this.highlight.appliedHoverEvent&&((t=this.highlight).stashedHoverEvent??(t.stashedHoverEvent=this.highlight.appliedHoverEvent),this.clearHighlight()),this.getHoverDevice()!=="setState"&&(this.chart.ctx.tooltipManager.removeTooltip(this.id),this.focusIndicator?.clear())}preSceneRender(){this.highlight.stashedHoverEvent!=null&&(this.highlight.pendingHoverEvent=this.tooltip.lastHover??this.highlight.stashedHoverEvent,this.highlight.stashedHoverEvent=void 0,this.handleHoverHighlight(!0)),this.tooltip.lastHover!=null&&this.handleHoverTooltip(this.tooltip.lastHover,!0),this.getHoverDevice()==="setState"&&this.refreshSetState()}updateComplete(){const{pendingViewportFocus:t}=this.focus;t&&this.focus.series!==void 0?(this.focus.pendingViewportFocus=void 0,this.pickViewportFocus(t)):this.isState(69)&&this.focusIndicator?.isFocusVisible()&&(this.announceMode!=="always"&&(this.announceMode="never"),this.refreshFocus())}update(t,e){this.chart.ctx.eventsHub.emit("chart:request-update",{type:t,opts:e})}seriesChanged(t){this.focus.sortedSeries=[...t].sort((e,i)=>{let s=e.properties.focusPriority??1/0,n=i.properties.focusPriority??1/0;return s===n&&([s,n]=[e.declarationOrder,i.declarationOrder]),sn?1:0}),this.series=t}layoutComplete(t){this.seriesRect=t.series.rect,this.hoverRect=t.series.rect,this.chart.ctx.widgets.seriesWidget.setBounds(t.series.rect),this.chart.ctx.domManager.mode==="normal"&&this.chart.ctx.widgets.chartWidget.setBounds(t.chart)}onAnimationStart(){this.getHoverDevice()!=="setState"&&this.clearAll()}onResize(){const t=this.chart.ctx.highlightManager.getActiveHighlight();this.clearAll(),this.pickManager.wasActivationPrevented()&&t!==void 0&&(this.setHoverDevice("setState"),this.activeState.lastActive={itemId:qc(t),seriesId:t.series.id})}onZoomChangeComplete(t){this.clearAll(),this.focus.pendingViewportFocus=F_(t)}onContextMenu(t,e){const{sourceEvent:i}=t;if(i.currentTarget!=e.getElement())return;if(e!==this.chart.ctx.widgets.seriesWidget){if(this.isState(72)){const{currentX:c,currentY:h}=t;this.chart.ctx.contextMenuRegistry.dispatchContext("always",{widgetEvent:t,canvasX:c,canvasY:h},void 0)}return}let s,n;if(this.focusIndicator?.isFocusVisible())s=this.chart.ctx.highlightManager.getActiveHighlight(),s&&this.seriesRect&&s.midPoint&&(n=fe.toCanvasPoint(s.series.contentGroup,s.midPoint.x,s.midPoint.y));else if(this.isState(72)){const c=this.pickNodes({x:t.currentX,y:t.currentY},"context-menu");c&&(this.pickManager.maybeActivate(void 0,()=>{this.chart.ctx.highlightManager.updateHighlight(this.id)}),s=c.matches[0])}const a=s?.series;this.clearAll();const r=t.currentX+e.cssLeft(),o=t.currentY+e.cssTop(),{datumIndex:l}=s??{};a&&s&&l!=null?this.chart.ctx.contextMenuRegistry.dispatchContext("series-node",{widgetEvent:t,canvasX:r,canvasY:o},{pickedSeries:a,pickedNode:{...s,datumIndex:l}},n):this.chart.ctx.contextMenuRegistry.dispatchContext("series-area",{widgetEvent:t,canvasX:r,canvasY:o},void 0,n)}onLeave(t){!this.isState(82)||t.sourceEvent.relatedTarget?.className==="ag-charts-text-input__textarea"||this.maybeEnterInteractiveTooltip(t.sourceEvent)||(this.chart.ctx.domManager.updateCursor(this.id),this.getHoverDevice()!=="keyboard"&&this.clearAll(!0))}onWheel(t){this.isState(82)&&(this.focusIndicator?.overrideFocusVisible(!1),this.setHoverDevice("pointer"))}onDragMove(t,e){this.isState(82)&&(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(t,e))}onHover(t,e){this.isState(83)&&this.onHoverLikeEvent(t,e)}onHoverLikeEvent(t,e){if(this.isIgnoredTouch(t)||(t.device==="touch"&&this.chart.ctx.chartService.touch.dragAction==="hover"&&t.sourceEvent.preventDefault(),e!==this.chart.ctx.widgets.seriesWidget))return;this.tooltip.lastHover=t,this.setHoverDevice("pointer"),this.highlight.pendingHoverEvent=t,this.hoverScheduler.schedule();let i;if(this.isState(65)){const{currentX:n,currentY:a}=t;i=this.pickNodes({x:n,y:a},"event");const r=i?.matches,o=r?.[0];o?.series.hasEventListener("seriesNodeClick")||o?.series.hasEventListener("seriesNodeDoubleClick")||r!=null&&r.length>1&&this.chart.tooltip.pagination?this.chart.ctx.domManager.updateCursor(this.id,"pointer"):this.chart.ctx.domManager.updateCursor(this.id)}const s=!!i?.matches.length;this.emitSeriesAreaHoverEvent(t,s)}onClick(t,e){if(t.device==="keyboard"||(e===this.chart.ctx.widgets.seriesWidget&&this.chart.ctx.animationManager.isActive()&&this.chart.ctx.animationManager.skipCurrentBatch(),t.device==="touch"&&e===this.chart.ctx.widgets.seriesWidget&&this.swapChain.focus({preventScroll:!0}),!this.isState(83)))return;if(e===this.chart.ctx.widgets.seriesWidget){if(!e.getElement().contains(t.sourceEvent.target))return}else if(t.sourceEvent.target!=e.getElement())return;this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(t,e);const i=e===this.chart.ctx.widgets.seriesWidget;if(this.isState(18)){i&&this.emitSeriesAreaClickEvent(t,!1);return}if(i){if(this.checkSeriesNodeClick(t)){this.emitSeriesAreaClickEvent(t,!0),this.update(Qc.SERIES_UPDATE),t.sourceEvent.preventDefault();return}this.emitSeriesAreaClickEvent(t,!1)}const s={type:t.type==="click"?"click":"doubleClick",event:t.sourceEvent};this.chart.fireEvent(s)}emitSeriesAreaHoverEvent(t,e){const{canvasX:i,canvasY:s}=this.toCanvasCoordinates(t),n={canvasX:i,canvasY:s,consumed:e,sourceEvent:t.sourceEvent};this.chart.ctx.eventsHub.emit("series-area:hover",n)}emitSeriesAreaClickEvent(t,e){if(!("currentX"in t))return;const{canvasX:i,canvasY:s}=this.toCanvasCoordinates(t),n={canvasX:i,canvasY:s,consumed:e,sourceEvent:t.sourceEvent};this.chart.ctx.eventsHub.emit("series-area:click",n)}toCanvasCoordinates(t){return{canvasX:t.currentX+(this.hoverRect?.x??this.seriesRect?.x??0),canvasY:t.currentY+(this.hoverRect?.y??this.seriesRect?.y??0)}}onFocus(){if(!this.isState(69)||!this.focusIndicator)return;this.initFocus(this.chart.keyboard.initialFocus);const t=this.focusIndicator.onFocus();this.setHoverDevice(t?"keyboard":"pointer");const{pendingViewportFocus:e}=this.focus;this.refreshFocus()===4&&e&&(this.focus.pendingViewportFocus=void 0,this.pickViewportFocus(e))}onBlur(t){this.isState(69)&&(this.setHoverDevice("pointer"),!this.isState(1)&&!this.maybeEnterInteractiveTooltip(t)&&this.clearAll(!0),this.focusIndicator?.onBlur())}onKeyDown(t){if(!this.isState(87))return;const e=l_(t.sourceEvent);switch(e?.activatesFocusIndicator===!1&&this.focusIndicator?.overrideFocusVisible(this.getHoverDevice()==="keyboard"),e?.name){case"redo":return this.chart.ctx.eventsHub.emit("series:redo",null);case"undo":return this.chart.ctx.eventsHub.emit("series:undo",null);case"zoomin":return this.chart.ctx.eventsHub.emit("series:keynav-zoom",{delta:1,widgetEvent:t});case"zoomout":return this.chart.ctx.eventsHub.emit("series:keynav-zoom",{delta:-1,widgetEvent:t});case"panxleft":return this.onPage(-1,t);case"panxright":return this.onPage(1,t);case"arrowup":return this.onArrow(-1,0,t);case"arrowdown":return this.onArrow(1,0,t);case"arrowleft":return this.onArrow(0,-1,t);case"arrowright":return this.onArrow(0,1,t);case"home":return this.onHome(t);case"end":return this.onEnd(t);case"submit":return this.onSubmit(t);case"delete":return;default:e?.name}}onPage(t,e){if(!this.chart.hasPgUpPgDownSupport()||!this.onNav(e))return;const i=this.focus.series?.axes.x?.reverse??!1;this.chart.ctx.eventsHub.emit("series:keynav-panx",{delta:t,reverse:i,widgetEvent:e})}onNav(t){return this.isState(69)?(this.setHoverDevice("keyboard"),this.focusIndicator?.overrideFocusVisible(!0),t.sourceEvent.preventDefault(),!0):!1}onArrow(t,e,i){this.onNav(i)&&(this.focus.seriesIndex+=t,this.focus.datumIndex+=e,this.handleFocusFromUserInput({datumIndexDelta:e,otherIndexDelta:t}))}onHome(t){if(this.chart.hasViewportSupport())return this.onPage("home",t);this.onNav(t)&&this.handleFocusFromUserInput({otherIndex:this.focus.seriesIndex,datumIndex:0})}onEnd(t){if(this.chart.hasViewportSupport())return this.onPage("end",t);if(!this.onNav(t))return;const e=this.focus.series?.data?.data.length;e!==void 0&&this.handleFocusFromUserInput({otherIndex:this.focus.seriesIndex,datumIndex:e-1})}onSubmit(t){if(!this.onNav(t))return;const{series:e,datum:i}=this.focus,s=t.sourceEvent;e!=null&&i!=null?e.fireNodeClickEvent(s,i):this.chart.fireEvent({type:"click",event:s})}checkSeriesNodeClick(t){var e;const i=this.pickNodes({x:t.currentX,y:t.currentY},"event"),s=this.pickManager.onPickedNodesTooltip(i);if(i===void 0||s.active===void 0)return!1;const n=s.paginationState==null?i.distance:0;if(t.type==="click"){if(s.active.series.fireNodeClickEvent(t.sourceEvent,s.active)){const r=this.pickManager.nextCandidate();if(r.active!==void 0){const{active:o}=r,{canvasX:l,canvasY:c}=this.toCanvasCoordinates(t);(e=this.highlight).pendingHoverEvent??(e.pendingHoverEvent=this.highlight.appliedHoverEvent),this.handleHoverHighlight(!1,{active:o,defaultCb:()=>{this.showTooltip(o,l,c,r.paginationState)}})}}return!0}return t.type==="dblclick"?(t.preventZoomDblClick=n===0,s.active.series.fireNodeDoubleClickEvent(t.sourceEvent,s.active),!0):!1}handleFocusFromUserInput(t){this.handleFocus(t),this.chart.ctx.eventsHub.emit("series:focus-change",null)}refreshFocus(){return this.handleFocus({datumIndexDelta:0,otherIndexDelta:0})}handleFocus(t){const e=this.chart.overlays.getFocusInfo(this.chart.ctx.localeManager);if(e==null){const i=this.handleSeriesFocus(t);return i===0?this.announceMode="when-changed":this.announceMode="always",i}else return this.focusIndicator?.update(e.rect,this.seriesRect,!1),this.swapChain.update(e.text),this.announceMode="always",0}handleSeriesFocus(t){return"datumIndexDelta"in t?this.handleSeriesFocusDeltas(t):this.handleSeriesFocusIndices(t)}makeUpdateFocusParamsFromDeltas(t){const{otherIndexDelta:e,datumIndexDelta:i}=t;if(this.chart.chartType==="standalone"){this.focus.series=this.focus.sortedSeries[0];const c=this.focus.datumIndex,h=this.focus.seriesIndex,d=this.focus.datumIndex-i,u=this.focus.seriesIndex-e;return{datumIndex:c,datumIndexDelta:i,oldDatumIndex:d,otherIndex:h,otherIndexDelta:e,oldOtherIndex:u}}const{focus:s}=this,n=s.sortedSeries.filter(c=>c.visible&&c.focusable);if(n.length===0)return 1;const a=s.datumIndex-i,r=s.seriesIndex-e;s.seriesIndex=QP(0,s.seriesIndex,n.length-1),s.series=n[s.seriesIndex];const o=this.focus.datumIndex,l=this.focus.seriesIndex;return{datumIndex:o,datumIndexDelta:i,oldDatumIndex:a,otherIndex:l,otherIndexDelta:e,oldOtherIndex:r}}handleSeriesFocusDeltas(t){const e=this.makeUpdateFocusParamsFromDeltas(t);return e===1?1:this.pickFocus(e)}handleSeriesFocusIndices(t){const{datumIndex:e,otherIndex:i}=t,s=this.focus.datumIndex,n=this.focus.seriesIndex;return this.pickFocus({datumIndex:e,datumIndexDelta:e-s,oldDatumIndex:s,otherIndex:i,otherIndexDelta:i-n,oldOtherIndex:n})}pickFocus(t){const{datumIndex:e,datumIndexDelta:i,otherIndex:s,otherIndexDelta:n}=t,{focus:a,hoverRect:r,seriesRect:o}=this;if(a.series==null||r==null)return 1;const l={datumIndex:e,datumIndexDelta:i,otherIndex:s,otherIndexDelta:n,seriesRect:o},c=a.series.pickFocus(l);return c?this.updatePickedFocus(t,c):2}pickViewportFocus(t){const{focus:e,hoverRect:i}=this;if(e.series==null||i==null)return 1;const s=e.series.pickViewportFocus({where:t,hoverRect:i,otherIndex:e.seriesIndex});if(!s)return 2;const n={datumIndex:s.datumIndex,datumIndexDelta:0,oldDatumIndex:this.focus.datumIndex,otherIndex:s.otherIndex??this.focus.seriesIndex,otherIndexDelta:0,oldOtherIndex:this.focus.seriesIndex};return this.updatePickedFocus(n,s)}updatePickedFocus(t,e){const{datumIndexDelta:i,oldDatumIndex:s,otherIndexDelta:n,oldOtherIndex:a}=t,{focus:r,hoverRect:o}=this;if(r.series==null||o==null)return 1;if(r.pendingViewportFocus!==void 0)return 4;const{datum:l}=e;if(r.datum=l,r.datumIndex=e.datumIndex,e.otherIndex!=null&&(r.seriesIndex=e.otherIndex),this.focusIndicator?.isFocusVisible()){this.chart.ctx.animationManager.reset();const d=wp(e),{x:u,y:p}=d.computeCenter();if(!o.containsPoint(u,p)&&this.chart.ctx.zoomManager.panToBBox(o,d))return 3;const{x1:g,x2:f,y1:m,y2:b}=wv.from(d),x=o.containsPoint(g,m),v=o.containsPoint(f,m),S=o.containsPoint(g,b),I=o.containsPoint(f,b);if(!(x||v||S||I)){const M=wv.from(o);e.movedBounds=d.clone(),gM.x2&&f>M.x2&&(e.movedBounds.x=M.x2-2,e.movedBounds.width=4),mM.y2&&b>M.y2&&(e.movedBounds.y=M.y2-2,e.movedBounds.height=4)}}this.focusIndicator?.update(e.movedBounds??e.bounds,this.seriesRect,e.clipFocusBox);const c=this.getTooltipContent(l,"aria-label"),h=h_(r.series,o,e);if(h!=null&&this.getHoverDevice()==="keyboard"&&(this.clearCachedEvents(),!this.isState(1))){const d=Lc.makeTooltipMeta(h,r.series,l,e.movedBounds);this.pickManager.maybeActivate(l,({series:u})=>{this.chart.ctx.highlightManager.updateHighlight(this.id,l),this.isTooltipEnabled(u)&&this.chart.ctx.tooltipManager.updateTooltip(this.id,d,c)},{defaultCbArg:{series:r.series}})}return this.maybeAnnouncePickedFocus(i,s,n,a,e,c),0}maybeAnnouncePickedFocus(t,e,i,s,n,a){const{focus:r}=this;let o;this.announceMode==="when-changed"?t===0&&i===0||e!==n.datumIndex||s!==(n.otherIndex??r.seriesIndex)?o="always":o="never":o=this.announceMode,o==="always"&&this.swapChain.update(this.getDatumAriaText(n.datum,a))}getDatumAriaText(t,e){const i=e==null?"":L_(e);return this.chart.ctx.localeManager.t("ariaAnnounceHoverDatum",{datum:t.series.getDatumAriaText?.(t,i)??i})}clearHighlight(t=!1){this.pickManager.maybeActivate(void 0,()=>{this.highlight.pendingHoverEvent=void 0,this.highlight.appliedHoverEvent=void 0,this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,t)})}clearTooltip(t=!1){this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0,t),this.tooltip.lastHover=void 0}clearAll(t=!1){this.isState(1)||(this.pickManager.onClearUI(),this.clearHighlight(t),this.pickManager.wasActivationPrevented()||this.clearTooltip(t),this.focusIndicator?.clear())}clearStaleHighlightTooltip(){this.getHoverDevice()==="setState"&&(this.clearCachedEvents(),this.chart.ctx.highlightManager.updateHighlight(this.id,void 0),this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0))}clearUnpreventable(){this.activeState.lastActive=void 0,this.pickManager.onClearUI(),this.clearHighlight(!1),this.clearTooltip(!1)}clearCachedEvents(){this.tooltip.lastHover=void 0,this.highlight.appliedHoverEvent=void 0,this.highlight.pendingHoverEvent=void 0,this.highlight.stashedHoverEvent=void 0}createHoverScheduler(){return FL(this.chart.ctx.domManager.getDocument(),()=>{if(this.getHoverDevice()==="setState")return this.handleHoverFromState();if(!(!this.tooltip.lastHover&&!this.highlight.pendingHoverEvent)){if(this.chart.getUpdateType()<=Qc.SERIES_UPDATE){this.hoverScheduler.schedule();return}this.highlight.pendingHoverEvent&&this.handleHoverHighlight(!1),this.tooltip.lastHover&&this.handleHoverTooltip(this.tooltip.lastHover,!1)}})}resetHoverScheduler(){this.hoverScheduler.cancel(),this.hoverScheduler=this.createHoverScheduler()}handleHoverFromState(){const{active:t,paginationState:e}=this.pickManager.onPickedNodesAPIDebounced();t!==void 0&&this.pickManager.maybeActivate(t,()=>{const i=Yu(t.series,t,void 0);if(this.chart.tooltip.enabled){if(!t.series.visible)this.clearStaleHighlightTooltip();else if(i){const{canvasX:s,canvasY:n}=i,a=this.activeState.highlightInViewport;this.chart.ctx.highlightManager.updateHighlight(this.id,t,!1,a),a?this.showTooltip(t,s,n,e):this.clearTooltip()}}})}handleHoverHighlight(t,e){this.highlight.appliedHoverEvent=this.highlight.pendingHoverEvent,this.highlight.pendingHoverEvent=void 0;const i=this.highlight.appliedHoverEvent;if(!i||!this.isState(82))return;const{canvasX:s,canvasY:n}=this.toCanvasCoordinates(i);if(t?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(s,n)){this.clearHighlight();return}const{range:a}=this.chart.highlight,r=a==="tooltip"?"highlight-tooltip":"highlight",o=e?.active??this.pickManager.onPickedNodesHighlight(this.pickNodes({x:i.currentX,y:i.currentY},r));o===void 0?this.pickManager.maybeActivate(void 0,()=>{this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,!0),e?.defaultCb()}):this.pickManager.maybeActivate(o,()=>{this.chart.ctx.highlightManager.updateHighlight(this.id,o,!1),e?.defaultCb()})}handleHoverTooltip(t,e){if(!this.isState(82))return;const{canvasX:i,canvasY:s}=this.toCanvasCoordinates(t),n=t.sourceEvent.target;if(e?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(i,s)){this.getHoverDevice()=="pointer"&&this.clearTooltip();return}if(n&&this.chart.tooltip.interactive&&this.chart.ctx.domManager.isManagedChildDOMElement(n,"canvas-overlay",ht))return;const a=this.pickNodes({x:t.currentX,y:t.currentY},"tooltip"),{active:r,paginationState:o}=this.pickManager.onPickedNodesTooltip(a);this.pickManager.wasActivationPrevented()||(r===void 0?this.getHoverDevice()=="pointer"&&this.clearTooltip(!0):this.showTooltip(r,i,s,o))}showTooltip(t,e,i,s){const n=this.getTooltipContent(t,"tooltip");if(n!=null){const{series:r}=t,o=Lc.makeTooltipMeta({type:"pointermove",canvasX:e,canvasY:i},r,t,void 0);this.chart.ctx.tooltipManager.updateTooltip(this.id,o,n,s)}else this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0,!0)}maybeEnterInteractiveTooltip(t){return this.chart.tooltip.maybeEnterInteractiveTooltip(t,()=>{this.pickManager.maybeActivate(void 0,()=>{this.tooltip.lastHover=void 0,this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0,!0),this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,!0)})})}changeHighlightDatum(t){const e=t.previousHighlight?.series,i=t.currentHighlight?.series;e?.properties.cursor&&t.previousHighlight?.datum&&this.chart.ctx.domManager.updateCursor(e.id),i?.properties.cursor&&i.properties.cursor!=="default"&&t.currentHighlight?.datum&&this.chart.ctx.domManager.updateCursor(i.id,i.properties.cursor);const s=e?.isHighlightEnabled()??!1;if(t.highlightSuppressed&&!s)return;const n=t.highlightSuppressed!==!s;this.getHoverDevice()==="setState"||i==null||e==null||n?this.update(Qc.SERIES_UPDATE,{clearCallbackCache:!0}):this.update(Qc.SERIES_UPDATE,{seriesToUpdate:new Set([e,i].filter(Boolean)),clearCallbackCache:!0})}onHighlightSelectionUpdate(t){if(!this.isState(1)||!this.seriesRect){this.activeState.highlightInViewport=!0;return}if(t.highlightSelection.length===0)return;const e=__(t.highlightSelection,this.seriesRect);this.activeState.highlightInViewport=e}pickNodes(t,e,i){const s=[...this.series].reverse(),n=e==="event"||e==="context-menu",a=e==="tooltip"||e==="highlight-tooltip",r=u=>{if(n)return u.properties.nodeClickRange;if(a)return u.properties.tooltip.range},{x:o,y:l}=t,c=new Set;for(const u of s)u.visible&&u.contentGroup.visible&&r(u)==="area"&&u.isPointInArea?.(o,l)&&c.add(u);const h=c.size>0;let d;for(const u of s){if(!u.visible||!u.contentGroup.visible||h&&!(r(u)==="area"&&c.has(u)))continue;const p=u.pickNodes(t,e,i);if(p==null||p.datums.length===0)continue;const{datums:g,distance:f}=p;if(p.datums.length!==0)if(f===0){d?.distance!==0&&(d={matches:[],distance:0});for(const m of g)d.matches.push(m)}else(d==null||d.distance>f)&&(d={matches:g,distance:f})}return d}isTooltipEnabled(t){return t.tooltipEnabled??this.chart.tooltip.enabled}getTooltipContent(t,e){const{series:i,datumIndex:s}=t;let n;if(e==="aria-label"||this.isTooltipEnabled(i)){const{cachedTooltipContent:a}=this;if(a?.series===i&&a.datumIndex===s)n=a.content;else{const r=this.chart.getTooltipContent(i,s,t,e);this.cachedTooltipContent={series:i,datumIndex:s,content:r},n=r}}else this.cachedTooltipContent=void 0;return n}onActiveLoadMemento(t){switch(t.activeItem?.type){case void 0:case"legend":return this.onActiveClear();case"series-node":return this.onActiveDatum(t.activeItem,t);default:return t.activeItem?.type}}onActiveUpdate(t){t?.type==="legend"&&(this.clearStaleHighlightTooltip(),this.activeState.lastActive="legend")}onActiveClear(){this.pickManager.onClearAPI(),this.setHoverDevice("setState"),this.activeState.lastActive=void 0,this.clearHighlight(),this.clearTooltip()}refreshSetState(){if(this.activeState.lastActive===void 0)this.pickManager.onClearUI(),this.clearHighlight(!1),this.clearTooltip(!1);else if(this.activeState.lastActive!=="legend"){const{seriesId:t,itemId:e}=this.activeState.lastActive,i=this.findPickedNodes(t,e);i===void 0?this.clearUnpreventable():i==="series-hidden"?this.isState(1)?this.clearStaleHighlightTooltip():this.pickManager.maybeActivate(void 0,()=>{this.activeState.lastActive=void 0,this.clearCachedEvents(),this.chart.ctx.highlightManager.updateHighlight(this.id,void 0),this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0)}):(this.pickManager.onPickedNodesAPI(i),this.hoverScheduler.schedule())}}onActiveDatum(t,e){const{seriesId:i,itemId:s}=t,n=this.findPickedNodes(i,s);if(n===void 0)e.reject(),this.onActiveClear();else{if(n!=="series-hidden"){const a=this.pickManager.onPickedNodesAPI(n);e.setDatum(a)}this.setHoverDevice("setState"),this.activeState.lastActive={seriesId:i,itemId:s},e.initialState?(this.chart.ctx.scene.applyPendingResize(),this.handleHoverFromState()):(this.clearCachedEvents(),this.hoverScheduler.schedule())}}findPickedNodes(t,e){const i=this.series.find(n=>n.id===t);if(i==null){kv.warn(`Cannot find seriesId: "${t}"`);return}if(!i.visible)return"series-hidden";const s=i.findNodeDatum(e);if(s==null){kv.warn(`Cannot find itemId: ${JSON.stringify(e)}`);return}return{matches:[s],distance:0}}};Yv.className="SeriesAreaManager";import{SeriesZIndexMap as $v,clamp as V_}from"ag-charts-core";var Kv=30,B_=class{constructor(t){this.seriesRoot=t,this.groups=new Map,this.series=new Map,this.expectedSeriesCount=1,this.mode="normal"}setSeriesCount(t){this.expectedSeriesCount=t}getGroupIndex(t){const{internalId:e,seriesGrouping:i}=t;return i?.groupIndex??e}getGroupType(t,e){return e?"top":t.type}requestGroup(t){const{internalId:e,contentGroup:i}=t,s=t.bringToFront(),n=this.getGroupType(t,s),a=this.getGroupIndex(t),r=this.series.get(e);if(r!=null)throw new Error(`AG Charts - series already has an allocated layer: ${JSON.stringify(r)}`);this.series.size===0&&(this.mode=this.expectedSeriesCount>=Kv?"aggressive-grouping":"normal");let o=this.groups.get(n);o==null&&(o=new Map,this.groups.set(n,o));const l=this.lookupIdx(a);let c=o.get(l);return c==null&&(c={type:n,id:l,seriesIds:[],group:this.seriesRoot.appendChild(new U({name:`${t.contentGroup.name??n}-managed-layer`,zIndex:t.contentGroup.zIndex,renderToOffscreenCanvas:!1}))},o.set(l,c)),this.series.set(e,{layerState:c,seriesConfig:t,bringToFront:s}),c.seriesIds.push(e),c.group.appendChild(i),c.group}changeGroup(t){const{internalId:e,contentGroup:i}=t,s=t.bringToFront(),n=this.getGroupType(t,s),a=this.series.get(e),r=a?this.getGroupType(a.seriesConfig,a.bringToFront):void 0,o=this.getGroupIndex(t),l=this.lookupIdx(o),c=this.groups.get(n)?.get(l);if(!(r===n&&c?.seriesIds.includes(e)===!0))return this.series.has(e)&&this._releaseGroup({internalId:e,contentGroup:i,type:r}),this.requestGroup(t)}releaseGroup(t){const{internalId:e,contentGroup:i}=t,s=this.getGroupType(t,t.bringToFront());this._releaseGroup({internalId:e,contentGroup:i,type:s})}_releaseGroup(t){const{internalId:e,contentGroup:i,type:s}=t;if(!this.series.has(e))throw new Error(`AG Charts - series doesn't have an allocated layer: ${e}`);const n=this.series.get(e)?.layerState;n&&(n.seriesIds=n.seriesIds.filter(a=>a!==e),i.remove()),n?.seriesIds.length===0?(n.group.remove(),this.groups.get(n.type)?.delete(n.id),this.groups.get(s)?.delete(e)):n!=null&&n.seriesIds.length>0&&(n.group.zIndex=this.getLowestSeriesZIndex(n.seriesIds)),this.series.delete(e)}updateLayerCompositing(){for(const t of this.groups.values())for(const e of t.values()){const{group:i,seriesIds:s}=e;let n;s.length===0?n=!1:s.length>1?n=!0:n=this.series.get(s[0])?.seriesConfig.renderToOffscreenCanvas()===!0,i.renderToOffscreenCanvas=n,i.zIndex=this.getLowestSeriesZIndex(s)}}lookupIdx(t){return this.mode==="normal"?t:typeof t=="string"&&(t=Number(t.split("-").at(-1)),!Number.isFinite(t))?0:Math.floor(V_(0,t/this.expectedSeriesCount,1)*Kv)}destroy(){for(const t of this.groups.values())for(const e of t.values())e.group.remove();this.groups.clear(),this.series.clear()}getLowestSeriesZIndex(t){let e;for(const i of t){const n=this.series.get(i)?.seriesConfig.contentGroup.zIndex??$v.ANY_CONTENT;if(e==null||n==null){e=n;continue}e=Km(e,n)<=0?e:n}return e??$v.ANY_CONTENT}};import{BaseProperties as z_,Property as G_}from"ag-charts-core";var Zv=class extends z_{constructor(){super(...arguments),this.dragAction="drag"}};y([G_],Zv.prototype,"dragAction",2);import{ChartUpdateType as Xv,CleanupRegistry as U_}from"ag-charts-core";var H_=class{constructor(t,e,i,s,n,a){this.chart=t,this.eventsHub=e,this.dataService=i,this.updateService=s,this.zoomManager=n,this.animationManager=a,this.dirtyZoom=!1,this.dirtyDataSource=!1,this.lastAxisZooms=new Map,this.cleanup=new U_,this.cleanup.register(this.eventsHub.on("data:source-change",()=>this.onDataSourceChange()),this.eventsHub.on("data:load",()=>this.onDataLoad()),this.eventsHub.on("data:error",()=>this.onDataError()),this.updateService.addListener("update-complete",r=>this.onUpdateComplete(r)),this.eventsHub.on("zoom:change-complete",()=>this.onZoomChange()))}destroy(){this.cleanup.flush()}onDataLoad(){this.animationManager.skip(),this.eventsHub.emit("chart:request-update",{type:Xv.UPDATE_DATA})}onDataError(){this.eventsHub.emit("chart:request-update",{type:Xv.PERFORM_LAYOUT})}onDataSourceChange(){this.dirtyDataSource=!0}onUpdateComplete(t){!t.apiUpdate&&!this.dirtyZoom&&!this.dirtyDataSource||t.wasShortcut||this.updateWindow(t)}onZoomChange(){this.dirtyZoom=!0}updateWindow(t){if(!this.dataService.isLazy())return;const e=this.getValidAxis();let i,s=!0;if(e){const n=this.zoomManager.getAxisZoom(e.id);i=this.getAxisWindow(e,n),s=this.shouldRefresh(t,e,n)}this.dirtyZoom=!1,this.dirtyDataSource=!1,s&&this.dataService.load({windowStart:i?.min,windowEnd:i?.max})}getValidAxis(){return this.chart.axes.find(t=>t.type==="time")}shouldRefresh(t,e,i){if(t.apiUpdate||this.dirtyDataSource)return!0;if(!this.dirtyZoom)return!1;const s=this.lastAxisZooms.get(e.id);return s&&i.min===s.min&&i.max===s.max?!1:(this.lastAxisZooms.set(e.id,i),!0)}getAxisWindow(t,e){const{domain:i}=t.scale;if(!e||i.length===0||Number.isNaN(Number(i[0])))return;const s=Number(i[1])-Number(i[0]),n=new Date(Number(i[0])+s*e.min),a=new Date(Number(i[0])+s*e.max);return{min:n,max:a}}};import{CleanupRegistry as j_}from"ag-charts-core";import{Logger as qv,getWindow as W_}from"ag-charts-core";var Y_=/^((?!chrome|android).)*safari/i,$_=/Version\/(\d+(\.\d+)?)/,K_=/Chrome/,Z_=/Chrome\/(\d+)/,X_=/Edg/,q_=/OPR/;function J_(){const{userAgent:t}=W_("navigator");if(Y_.test(t)){const e=$_.exec(t);if(e==null)return!1;const i=Number.parseFloat(e[1]),s=Math.floor(i)>16;return s||qv.warnOnce(`Unsupported Safari version: ${i}; ${t}`),!s}else if(K_.test(t)&&!X_.test(t)&&!q_.test(t)){const e=Z_.exec(t);if(e==null)return!1;const i=Number.parseInt(e[1],10),s=i>126;return s||qv.warnOnce(`Unsupported Chrome version: ${i}; ${t}`),!s}return!1}var Q_=new Set(["map-shape-background","map-line-background"]),e2=class{constructor(t,e,i,s,n,a,r){this.chartLike=t,this.overlays=e,this.eventsHub=i,this.dataService=s,this.localeManager=n,this.animationManager=a,this.domManager=r,this.cleanup=new j_,this.overlayElem=this.domManager.addProxyChild("canvas-overlay","overlay"),this.overlayElem.setAttr("role","status"),this.overlayElem.setAttr("aria-atomic","false"),this.overlayElem.setAttr("aria-live","polite"),this.overlayElem.toggleClass(Dp,!0),this.cleanup.register(this.eventsHub.on("layout:complete",o=>this.onLayoutComplete(o)))}destroy(){this.cleanup.flush(),this.domManager.removeChild("canvas-overlay","overlay")}onLayoutComplete({series:{rect:t}}){const e=this.dataService.isLoading(),i=this.chartLike.series.some(c=>c.hasData),s=this.chartLike.series.some(c=>c.visible&&!Q_.has(c.type));this.overlayElem.toggleClass(wP,this.overlays.darkTheme),this.overlayElem.setProperty("left",`${t.x}px`),this.overlayElem.setProperty("top",`${t.y}px`),this.overlayElem.setProperty("width",`${t.width}px`),this.overlayElem.setProperty("height",`${t.height}px`);const n=e,a=!e&&!i,r=i&&!s,o=this.overlays.unsupportedBrowser.enabled&&J_();n?this.showOverlay(this.overlays.loading,t):this.hideOverlay(this.overlays.loading),a?this.showOverlay(this.overlays.noData,t):this.hideOverlay(this.overlays.noData),r?this.showOverlay(this.overlays.noVisibleSeries,t):this.hideOverlay(this.overlays.noVisibleSeries),o?this.showOverlay(this.overlays.unsupportedBrowser,t):this.hideOverlay(this.overlays.unsupportedBrowser);const l=n||a||r||o;this.overlayElem.setAttr("aria-hidden",String(!l))}showOverlay(t,e){if(!t.enabled)return;const i=t.getElement(this.chartLike,this.animationManager,this.localeManager,e);this.overlayElem.appendChild(i)}hideOverlay(t){t.removeElement(()=>{this.overlayElem.innerText="\xA0"},this.animationManager)}},Ci=Vd.create(!0,"opts"),pe=class PC extends Ly{constructor(e,i){var s;super(),this.id=dT(this),this.seriesRoot=new mt({name:`${this.id}-series-root`,zIndex:zd.SERIES_LAYER}),this.annotationRoot=new mt({name:`${this.id}-annotation-root`,zIndex:zd.SERIES_ANNOTATION}),this.titleGroup=new U({name:"titles",zIndex:zd.SERIES_LABEL,renderToOffscreenCanvas:!0,optimizeForInfrequentRedraws:!0}),this.debug=Vd.create(!0,"chart"),this.extraDebugStats={},this.data=Bo.empty(),this._firstAutoSize=!0,this._autoSizeNotify=new Rm,this._requiredRange=0,this._requiredRangeDirection=Hn.X,this.chartCaptions=new uc,this.padding=new cT(20),this.keyboard=new _c,this.touch=new Zv,this.mode="standalone",this.withinStudio=void 0,this.styleNonce=void 0,this.formatter=void 0,this.suppressFieldDotNotation=!1,this.loadGoogleFonts=!1,this.dataIdKey=void 0,this.destroyed=!1,this.cleanup=new lT,this.chartAnimationPhase="initial",this.modulesManager=new CP,this.processors=[],this.queuedUserOptions=[],this.queuedChartOptions=[],this.firstApply=!0,this.syncStatus="init",this.fireEventWrapper=u=>super.fireEvent(u),this.apiUpdate=!1,this._pendingFactoryUpdatesCount=0,this._performUpdateSkipAnimations=!1,this._performUpdateNotify=new Rm,this.performUpdateType=z.NONE,this.runningUpdateType=z.NONE,this.currentProcessingUpdateType=z.NONE,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new _L,this.clearCallbackCacheOnUpdate=!1,this.updateRequestors={},this.performUpdateTrigger=ru(({count:u})=>{this.destroyed||this.updateMutex.acquire(this.tryPerformUpdate.bind(this,u)).catch(p=>jn.errorOnce(p))}),this._performUpdateSplits={},this._previousSplit=0,this.axes=this.createChartAxes(),this.series=[],this._cachedData=void 0,this.onSeriesNodeClick=u=>{this.fireEvent(u)},this.onSeriesNodeDoubleClick=u=>{this.fireEvent(u)},this.onSeriesVisibilityChange=u=>{this.fireEvent(u)},this.seriesGroupingChanged=u=>{if(!(u instanceof Tp))return;const{series:p,seriesGrouping:g}=u;if(p.contentGroup.isRoot())return;const f=this.seriesLayerManager.changeGroup({internalId:p.internalId,type:p.type,contentGroup:p.contentGroup,bringToFront:()=>p.bringToFront(),renderToOffscreenCanvas:()=>p.renderToOffscreenCanvas(),seriesGrouping:g});f!=null&&p.attachSeries(f,this.seriesRoot,this.annotationRoot)},this.chartOptions=e;const n=i?.scene,a=i?.container??e.processedOptions.container??void 0,r=i?.styleContainer??e.specialOverrides.styleContainer,o=e.specialOverrides.skipCss;n&&(this._firstAutoSize=!1,this._lastAutoSize=[n.width,n.height,n.pixelRatio]);const l=new U({name:"root"});l.visible=!1,l.append(this.seriesRoot),l.append(this.annotationRoot),l.append(this.titleGroup),this.titleGroup.append(this.title.node),this.titleGroup.append(this.subtitle.node),this.titleGroup.append(this.footnote.node);const c=new oT(e.specialOverrides.document,e.specialOverrides.window);this.tooltip=new Bi(c),this.seriesLayerManager=new B_(this.seriesRoot),this.mode=e.userOptions.mode??this.mode,this.styleNonce=e.processedOptions.styleNonce;const h=this.ctx=new n1(this,{chartType:this.getChartType(),scene:n,root:l,container:a,styleContainer:r,skipCss:o,agDocument:c,domMode:e.optionMetadata.domMode,withDragInterpretation:e.optionMetadata.withDragInterpretation??!0,syncManager:new u1(this),fireEvent:u=>this.fireEvent(u),updateMutex:this.updateMutex});e.optionMetadata.presetType==="sparkline"&&(h.highlightManager.unhighlightDelay=0,h.tooltipManager.removeDelay=0),this.cleanup.register(h.eventsHub.on("dom:resize",()=>this.parentResize(h.domManager.containerSize)),h.eventsHub.on("font:load",()=>{this.title.node.markDirty(),this.subtitle.node.markDirty(),this.footnote.node.markDirty(),this.update(z.PERFORM_LAYOUT)}),h.eventsHub.on("rtl:change",()=>{h.scene.setDirection(h.domManager.isRtl),this.update(z.PERFORM_LAYOUT)}),h.eventsHub.on("chart:request-update",u=>this.update(u.type,u.opts)),h.scene.on("scene-changed",()=>this.update(z.SCENE_RENDER))),h.scene.setDirection(h.domManager.isRtl),this.overlays=new yr,(s=this.overlays.loading).renderer??(s.renderer=()=>OP(h.agDocument,this.overlays.loading.getText(h.localeManager),h.animationManager.defaultDuration)),this.processors=[new H_(this,h.eventsHub,h.dataService,h.updateService,h.zoomManager,h.animationManager),new e2(this,this.overlays,h.eventsHub,h.dataService,h.localeManager,h.animationManager,h.domManager)],this.highlight=new Pc,this.container=a;const d=this.getModuleContext();this.background=_m.createBackground?.(d)??new nr(d),this.foreground=_m.createForeground?.(d),this.seriesArea=new $o(d),h.domManager.setDataBoolean("animating",!1),h.domManager.setDataNumber("animationTimeMs",0),this.seriesAreaManager=new Yv(this.initSeriesAreaDependencies()),this.cleanup.register(h.layoutManager.registerElement(0,u=>{u.layoutBox.shrink(this.padding.toJson()),this.chartCaptions.positionCaptions(u)}),h.eventsHub.on("layout:complete",u=>this.chartCaptions.positionAbsoluteCaptions(u)),h.eventsHub.on("data:load",u=>{this.data=this.createDataSet(u.data)}),this.title.registerInteraction(d,"beforebegin"),this.subtitle.registerInteraction(d,"beforebegin"),this.footnote.registerInteraction(d,"afterend"),()=>this.title.destroy(),()=>this.subtitle.destroy(),()=>this.footnote.destroy(),this.ctx.agDocument.attachListener("pagehide",u=>{u.persisted||this.destroy()}),h.animationManager.addListener("animation-frame",()=>{this.update(z.SCENE_RENDER),h.domManager.setDataNumber("animationTimeMs",h.animationManager.getCumulativeAnimationTime())}),h.animationManager.addListener("animation-start",()=>h.domManager.setDataBoolean("animating",!0)),h.animationManager.addListener("animation-stop",()=>{h.domManager.setDataBoolean("animating",!1),h.domManager.setDataNumber("animationTimeMs",h.animationManager.getCumulativeAnimationTime())}),h.eventsHub.on("zoom:change-complete",()=>{const u=this.chartAnimationPhase==="initial";for(const p of this.series)p.animationState?.transition("updateData");if(u)for(const p of this.axes)p.resetAnimation(this.chartAnimationPhase);this.update(z.PERFORM_LAYOUT,{forceNodeDataRefresh:!0,skipAnimations:!u})})),this.parentResize(h.domManager.containerSize)}static getInstance(e){return PC.chartsInstances.get(e)}get canvasElement(){return this.ctx.scene.canvas.element}download(e,i){this.ctx.scene.download(e,i)}getCanvasDataURL(e){return this.ctx.scene.getDataURL(e)}toSVG(){return this.ctx.scene.toSVG()}get seriesAreaBoundingBox(){return this.seriesAreaManager.bbox}getOptions(){return this.queuedUserOptions.at(-1)??this.chartOptions.userOptions}getChartOptions(){return this.queuedChartOptions.at(-1)??this.chartOptions}isDataTransactionSupported(){return!0}createDataSet(e){return new Bo(e,this.dataIdKey)}overrideFocusVisible(e){this.seriesAreaManager.focusIndicator?.overrideFocusVisible(e)}fireEvent(e){hT(this,this.fireEventWrapper,e)}initSeriesAreaDependencies(){const{ctx:e,tooltip:i,highlight:s,keyboard:n,overlays:a,seriesRoot:r,mode:o}=this,l=this.getChartType(),c=()=>this.hasViewportSupport(),h=()=>this.hasPgUpPgDownSupport(),d=this.fireEvent.bind(this);return{hasViewportSupport:c,hasPgUpPgDownSupport:h,fireEvent:d,getUpdateType:()=>this.performUpdateType,getTooltipContent:(g,f,m,b)=>this.getTooltipContent(g,f,m,b),chartType:l,ctx:e,tooltip:i,highlight:s,keyboard:n,overlays:a,seriesRoot:r,mode:o}}getModuleContext(){return this.ctx}getTooltipContent(e,i,s,n){const r=n==="aria-label"||e.properties.tooltip.enabled!==!1?e.getTooltipContent(i,s):void 0,o=r==null?[]:[r];if(this.tooltip.mode!=="shared"||this.series.length===1)return o;const l=e.getCategoryValue(i);return l==null?o:this.series.flatMap(c=>{if(c===e)return o;if(!c.isEnabled()||c.properties.tooltip.enabled===!1)return[];const h=c.datumIndexForCategoryValue(l),d=h==null?void 0:c.getTooltipContent(h,void 0);return d==null?[]:[d]})}getCaptionText(){return[this.title,this.subtitle,this.footnote].filter(e=>e.enabled&&e.text).map(e=>e.text).join(". ")}getAriaLabel(){return this.ctx.localeManager.t("ariaAnnounceChart",{seriesCount:this.series.length})}refreshSeriesUserVisibility(e,i){for(let s=0;s{if(!this.destroyed)try{await e(this)}finally{this.destroyed||this._pendingFactoryUpdatesCount--}}).catch(i=>jn.errorOnce(i)))}clearCallbackCache(){this.ctx.callbackCache.invalidateCache();for(const e of this.series)e.resetDatumCallbackCache()}update(e=z.FULL,i){if(this.destroyed)return;const{forceNodeDataRefresh:s=!1,skipAnimations:n,seriesToUpdate:a=this.series,newAnimationBatch:r,apiUpdate:o=!1,clearCallbackCache:l=!1}=i??{};if(this.apiUpdate=o,this.ctx.widgets.seriesWidget.setDragTouchEnabled(this.touch.dragAction!=="none"),s)for(const c of this.series)c.markNodeDataDirty();for(const c of a)this.seriesToUpdate.add(c);if(n&&(this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0),r&&this.ctx.animationManager.isActive()&&(this._performUpdateSkipAnimations=!0),(e===z.FULL||l)&&(this.clearCallbackCacheOnUpdate=!0),this.debug.check()){let c=new Error("Stack trace for update tracking").stack??"";c=c.replaceAll(/\([^)]*/g,""),this.updateRequestors[c]=e,this.currentProcessingUpdateType!==z.NONE&&this.currentProcessingUpdateType>=e&&this.debug.group(`Chart.update() - \u26A0\uFE0F received update for earlier update stage ${z[e]} \u26A0\uFE0F`,()=>{this.debug(`Current processing update type: ${z[this.currentProcessingUpdateType]}`),this.debug("Update from: ",c)})}e0?"\u26A0\uFE0F redo #"+this.updateShortcutCount+" \u26A0\uFE0F ":""}`;await this.debug.group(`Chart.performUpdate() ${i}`,async()=>{await this.performUpdate(e)})}catch(i){jn.error("update error",i,i.stack)}}async performUpdate(e){const{performUpdateType:i,extraDebugStats:s,_performUpdateSplits:n,ctx:a}=this,r=[...this.seriesToUpdate];switch(this.clearCallbackCacheOnUpdate&&(this.clearCallbackCacheOnUpdate=!1,this.clearCallbackCache()),this.performUpdateType=z.NONE,this.seriesToUpdate.clear(),this.runningUpdateType=i,this.currentProcessingUpdateType=i,this.updateShortcutCount===0&&ithis.chartAnimationPhase="ready")),this.ctx.scene.updateDebugFlags(),this.debug("Chart.performUpdate() - start",z[i]),this._previousSplit=performance.now(),n.start??(n.start=this._previousSplit),a.domManager.setDeferring(!0),i){case z.FULL:if(this.checkUpdateShortcut(z.FULL))break;this.ctx.updateService.dispatchPreDomUpdate(),this.updateDOM();case z.UPDATE_DATA:if(this.checkUpdateShortcut(z.UPDATE_DATA))break;this.updateData(),this.updateSplits("\u2B07\uFE0F");case z.PROCESS_DATA:if(this.checkUpdateShortcut(z.PROCESS_DATA))break;if(await this.processData(),this.seriesAreaManager.dataChanged(),this.pendingLocaleText){const l=this.modulesManager.getModule("locale");l&&"localeText"in l&&(l.localeText=this.pendingLocaleText),this.pendingLocaleText=void 0}this.updateSplits("\u{1F4CA}");case z.PROCESS_DOMAIN:if(this.checkUpdateShortcut(z.PROCESS_DOMAIN))break;await this.processDomains(),this.updateSplits("\u26F0\uFE0F");case z.PROCESS_RANGE:if(this.checkUpdateShortcut(z.PROCESS_RANGE))break;this.processRanges(),this.updateSplits("\u{1F4D0}");case z.PERFORM_LAYOUT:if(await this.checkFirstAutoSize(),this.checkUpdateShortcut(z.PERFORM_LAYOUT))break;await this.processLayout(),this.updateSplits("\u2316");case z.PRE_SERIES_UPDATE:if(this.checkUpdateShortcut(z.PRE_SERIES_UPDATE))break;this.preSeriesUpdate(),this.updateSplits("\u2753");case z.SERIES_UPDATE:{if(this.checkUpdateShortcut(z.SERIES_UPDATE))break;this.seriesRoot.renderToOffscreenCanvas=this.highlight.drawingMode==="cutout",await this.updateSeries(r),this.updateAriaLabels(),this.seriesLayerManager.updateLayerCompositing(),this.updateSplits("\u{1F914}")}case z.PRE_SCENE_RENDER:if(this.checkUpdateShortcut(z.PRE_SCENE_RENDER))break;a.updateService.dispatchPreSceneRender(this.apiUpdate),a.scene.updateBaseFont(),this.updateSplits("\u2196");case z.SCENE_RENDER:if(this.checkUpdateShortcut(z.SCENE_RENDER))break;a.animationManager.endBatch(),s.updateShortcutCount=this.updateShortcutCount,a.scene.render({debugSplitTimes:n,extraDebugStats:s,seriesRect:this.seriesRect,debugColors:Vd.check("scene:stats","scene:stats:verbose")?this.getDebugColors():void 0}),this.extraDebugStats={};for(const l of Object.keys(n))delete n[l];this.ctx.domManager.incrementDataCounter("sceneRenders");case z.NONE:this.updateShortcutCount=0,this.updateRequestors={},this.currentProcessingUpdateType=z.NONE,this._performUpdateSkipAnimations=!1,a.animationManager.endBatch()}this.destroyed||(a.updateService.dispatchUpdateComplete(this.apiUpdate,this.updateShortcutCount>0),this.apiUpdate=!1,this.ctx.domManager.setDataBoolean("updatePending",!1),this.runningUpdateType=z.NONE,this.syncStatus="ready"),this._performUpdateNotify.notify(),a.domManager.setDeferring(!1);const o=performance.now();this.debug("Chart.performUpdate() - end",{chart:this,durationMs:mT(o-n.start),count:e,performUpdateType:z[i]})}updateThemeClassName(){const e="ag-charts-theme-",i=[`${e}default`,`${e}default-dark`];let s=i[0],n=!1,{theme:a}=this.chartOptions.processedOptions;for(;typeof a!="string"&&a!=null;)a=a.baseTheme;typeof a=="string"&&(s=a.replace("ag-",e),n=a.includes("-dark")),i.includes(s)||(s=n?i[1]:i[0]),this.ctx.domManager.setThemeClass(s)}updateDOM(){this.updateThemeClassName();const{enabled:e,tabIndex:i}=this.keyboard;this.ctx.domManager.setTabGuardIndex(e?i??0:-1),this.ctx.domManager.setThemeParameters(this.chartOptions.themeParameters)}updateAriaLabels(){this.ctx.domManager.updateCanvasLabel(this.getAriaLabel())}checkUpdateShortcut(e){return this.destroyed?!0:this.updateShortcutCount>3?(jn.warn("exceeded the maximum number of simultaneous updates (4), discarding changes and rendering",this.updateRequestors),!1):this.performUpdateType<=e?(this.debug("Chart.checkUpdateShortcut() - BLOCKED AT: ",z[e]," BY REQUEST FOR: ",z[this.performUpdateType]),this.updateShortcutCount++,!0):(this.debug("Chart.checkUpdateShortcut() - PROCEEDING TO: ",z[e]),this.currentProcessingUpdateType=e,!1)}async checkFirstAutoSize(){this.width!=null&&this.height!=null||this._lastAutoSize||await this._autoSizeNotify.waitForCompletion(500)||this.debug("Chart.checkFirstAutoSize() - timeout for first size update.")}createChartAxes(){return new dc}onAxisChange(e,i){i==null&&e.length===0||this.ctx.axisManager.updateAxes(i??[],e)}onSeriesChange(e,i){const s=i?.filter(n=>!e.includes(n))??[];this.destroySeries(s),this.seriesLayerManager?.setSeriesCount(e.length);for(const n of e){if(i?.includes(n))continue;const a=this.seriesLayerManager.requestGroup(n);n.attachSeries(a,this.seriesRoot,this.annotationRoot),n.chart={},Object.defineProperty(n.chart,"mode",{get:()=>this.mode}),Object.defineProperty(n.chart,"isMiniChart",{get:()=>!1}),Object.defineProperty(n.chart,"flashOnUpdateEnabled",{get:()=>!!this.modulesManager.getModule("flashOnUpdate")?.enabled}),Object.defineProperty(n.chart,"seriesRect",{get:()=>this.seriesRect}),n.resetAnimation(this.chartAnimationPhase),this.addSeriesListeners(n)}this.seriesAreaManager?.seriesChanged(e)}destroySeries(e){if(e)for(const i of e)i.removeEventListener("seriesNodeClick",this.onSeriesNodeClick),i.removeEventListener("seriesNodeDoubleClick",this.onSeriesNodeDoubleClick),i.removeEventListener("groupingChanged",this.seriesGroupingChanged),i.destroy(),this.seriesLayerManager.releaseGroup(i),i.detachSeries(void 0,this.seriesRoot,this.annotationRoot),i.chart=void 0}addSeriesListeners(e){this.hasEventListener("seriesNodeClick")&&e.addEventListener("seriesNodeClick",this.onSeriesNodeClick),this.hasEventListener("seriesNodeDoubleClick")&&e.addEventListener("seriesNodeDoubleClick",this.onSeriesNodeDoubleClick),this.hasEventListener("seriesVisibilityChange")&&e.addEventListener("seriesVisibilityChange",this.onSeriesVisibilityChange),e.addEventListener("groupingChanged",this.seriesGroupingChanged)}assignSeriesToAxes(){for(const i of this.axes){let s=function(n){return n.axes[i.direction]===i};var e=s;i.boundSeries=this.series.filter(s)}}assignAxesToSeries(){for(const e of this.series)for(const i of e.directions){const s=e.getKeyAxis(i)??i,n=this.axes.findById(s);if(!n){jn.warnOnce(`no matching axis for direction [${i}] and id [${s}]; check series and axes configuration.`);return}e.axes[i]=n}}parentResize(e){if(e==null||this.width!=null&&this.height!=null)return;let{width:i,height:s}=e;const{pixelRatio:n}=e;if(i=Math.floor(i),s=Math.floor(s),i===0&&s===0)return;const[a=0,r=0,o=1]=this._lastAutoSize??[];a===i&&r===s&&o===n||(this._lastAutoSize=[i,s,n],this.resize("SizeMonitor",{}))}resize(e,i){const{scene:s,animationManager:n}=this.ctx,{inWidth:a,inHeight:r,inMinWidth:o,inMinHeight:l,inOverrideDevicePixelRatio:c}=i;this.ctx.domManager.setSizeOptions(o??this.minWidth,l??this.minHeight,a??this.width,r??this.height);const h=a??this.width??this._lastAutoSize?.[0],d=r??this.height??this._lastAutoSize?.[1],u=c??this.overrideDevicePixelRatio??this._lastAutoSize?.[2];if(this.debug(`Chart.resize() from ${e}`,{width:h,height:d,pixelRatio:u,stack:new Error("Stack trace for resize tracking").stack}),!(h==null||d==null||!Vm(h)||!Vm(d))&&s.resize(h,d,u)){n.reset();let p=!0;(this.width==null||this.height==null)&&this._firstAutoSize&&(p=!1,this._firstAutoSize=!1);let g=z.PERFORM_LAYOUT;for(const f of this.axes){const m=f.getUpdateTypeOnResize();ms.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes());const e=new Mx(this.mode,this.suppressFieldDotNotation,this.ctx.eventsHub),i=[];for(const s of this.series)i.push(s.processData(e)??Promise.resolve());for(const s of this.modulesManager.modules())s?.processData&&i.push(s.processData(e)??Promise.resolve());this._cachedData=e.execute(this._cachedData),this.updateSplits("\u{1F3ED}"),await Promise.all(i),this.updateLegends()}async processDomains(){for(const e of this.axes)e.processData();for(const e of this.series)e.updatedDomains()}processRanges(){var e;const i={},s={},n=new Map;this._requiredRangeDirection=Hn.X;for(const a of this.series)a.visible&&(i[e=a.type]??(i[e]=[]),a.getMinimumRangeSeries(i[a.type]),a.resolveKeyDirection(Hn.X)===Hn.Y&&(this._requiredRangeDirection=Hn.Y),n.has(a.type)||n.set(a.type,a));for(const[a,r]of n)s[a]=r.getMinimumRangeChart(i[a]);Object.keys(s).length===0?this._requiredRange=0:this._requiredRange=Math.ceil(Math.max(...Object.values(s)));for(const a of this.axes)a.requiredRange=this._requiredRange}updateLegends(e){for(const i of Wn.listModulesByType(vo.Plugin))switch(i.name){case"legend":this.setCategoryLegendData(e);break;case"gradientLegend":const s=this.modulesManager.getModule("gradientLegend");s.data=this.series.filter(n=>n.properties.showInLegend).flatMap(n=>n.getLegendData("gradient"));break}}setCategoryLegendData(e){const{legendManager:i,stateManager:s}=this.ctx;if(e)for(const a of this.series){const r=e.find(o=>o.seriesId===a.id);a.onLegendInitialState("category",r)}const n=this.series.flatMap(a=>{const r=a.getLegendData("category");return i.updateData(a.id,r),r});if(e){s.setStateAndRestore(i,e);return}if(this.mode!=="integrated"){const a={},r=new Map(this.series.map(o=>[o.id,o]));for(const{seriesId:o,symbol:{marker:l},label:c}of n.filter(h=>!h.hideInLegend)){if(l.fill==null)continue;const h=r.get(o);if(!h?.hasData)continue;const d=h.type,u=a[d]??(a[d]=new Map);u.has(c.text)?u.get(c.text)!==l.fill&&jn.warnOnce(`legend item '${yT(c.text)}' has multiple fill colours, this may cause unexpected behaviour.`):u.set(c.text,l.fill)}}i.update()}async processLayout(){const e=this.animationRect,{width:i,height:s}=this.ctx.scene,n=this.ctx.layoutManager.createContext(i,s);await this.performLayout(n),e&&!this.animationRect?.equals(e)&&this.ctx.animationManager.skipCurrentBatch(),this.debug("Chart.performUpdate() - seriesRect",this.seriesRect)}getDebugColors(){const e=this.background.fill;if(e)try{const i=Pm.fromString(e),[s]=Pm.RGBtoOKLCH(i.r,i.g,i.b);return{background:e,foreground:s>.5?"black":"white"}}catch{return{background:e}}}preSeriesUpdate(){const{_requiredRange:e,seriesRect:i}=this;if(i==null)return;const s=this._requiredRangeDirection===Hn.X?i.width:i.height,n=e/s||0;this.ctx.updateService.dispatchPreSeriesUpdate(n,this._requiredRangeDirection,e)}async updateSeries(e){const{seriesRect:i}=this;function s(n){return n.update({seriesRect:i})}await Promise.all(e.map(s).filter(n=>n!=null)),this.ctx.seriesLabelLayoutManager.updateLabels(this.series.filter(n=>n.visible&&n.usesPlacedLabels),this.padding,this.seriesRect)}async waitForUpdate(e,i){const s=uT("agChartsDebugTimeout");s==null?(e??(e=1e4),i??(i=!1)):(e=s,i??(i=!0));const n=performance.now();for(;(this._pendingFactoryUpdatesCount>0||this.performUpdateType!==z.NONE||this.runningUpdateType!==z.NONE||this.ctx.scene.waitingForUpdate()||this.data.hasPendingTransactions())&&!this.destroyed;){if(this._pendingFactoryUpdatesCount>0&&await this.updateMutex.waitForClearAcquireQueue(),(this.performUpdateType!==z.NONE||this.runningUpdateType!==z.NONE||this.data.hasPendingTransactions())&&await this._performUpdateNotify.waitForCompletion(),performance.now()-n>e){const a=`Chart.waitForUpdate() timeout of ${e} reached - first chart update taking too long.`;if(i)throw new Error(a);jn.warnOnce(a)}pT()&&await Bm(),this.ctx.scene.waitingForUpdate()&&await Bm(50)}}filterMiniChartSeries(e){return e?.filter(i=>i.showInMiniChart!==!1)}applyOptions(e){e.seriesWithUserVisibility&&this.refreshSeriesUserVisibility(this.chartOptions,e.seriesWithUserVisibility);const i=z.PERFORM_LAYOUT,s=this.firstApply?e.processedOptions:e.diffOptions(this.chartOptions);if(s==null||Object.keys(s).length===0){Ci("Chart.applyOptions() - no delta, forcing re-layout",s),this.update(i,{apiUpdate:!0,newAnimationBatch:!0});return}const n=this.firstApply?{}:this.chartOptions.processedOptions,a=e.processedOptions;Ci("Chart.applyOptions() - applying delta",s);const r=this.applyModules(),o=["type","data","series","listeners","preset","theme","legend.listeners","navigator.miniChart.series","navigator.miniChart.label","locale.localeText","axes","topology","nodes","initialState","styleContainer","formatter","displayNullData","enableRtl"];"listeners"in s&&this.registerListeners(this,s.listeners),"enableRtl"in s&&this.ctx.domManager.setEnableRtl(s.enableRtl),Gd(this,s,{skip:o});let l=!1,c="no-op";s.series!=null&&(c=this.applySeries(this,s.series,n?.series),l=!0),c==="replaced"&&this.resetAnimations(),this.applyAxes(this,a,n,c,[])&&(l=!0);const{userDeltaKeys:h}=e,d=h===void 0||h.has("data");let u=!1;if(s.data&&d){const x=s.data,v=e.userOptions.data,I=Array.isArray(x)&&x!==v?x.slice():x;this.data=this.createDataSet(I),u=!0}if("dataIdKey"in s&&!(s.data&&d)&&this.data.dataIdKey!==this.dataIdKey&&(this.data=this.createDataSet(this.data.data),u=!0),c==="replaced"&&!u&&(this.data=this.createDataSet(this.data.data)),"legend"in s&&s.legend&&"listeners"in s.legend&&this.modulesManager.isEnabled("legend")){const x=s.legend.listeners;x?Object.assign(this.legend.listeners,x):this.legend.listeners.clear()}s.locale?.localeText&&(this.pendingLocaleText=s.locale?.localeText),this.chartOptions=e;const p=this.modulesManager.getModule("navigator");this.hasViewportSupport()||this.ctx.zoomManager.updateZoom({source:"chart-update",sourceDetail:"internal-applyOptions"},{x:{min:0,max:1}});const g=p?.miniChart,f=a.navigator?.miniChart?.series??a.series;g?.enabled===!0&&f!=null?this.applyMiniChartOptions(g,f,a,n):g?.enabled===!1&&(g.series=[],g.axes=[]),this.ctx.annotationManager.setAnnotationStyles(e.annotationThemes),l||(l=this.shouldForceNodeDataRefresh(s,c));const b=l||r?z.FULL:i;if(this.maybeResetAnimations(c),this.shouldClearLegendData(a,n,c)&&this.ctx.legendManager.clearData(),this.applyInitialState(a),this.ctx.formatManager.setFormatter(a.formatter),Ci("Chart.applyOptions() - update type",z[b],{seriesStatus:c,forceNodeDataRefresh:l}),e.optionsProcessingTime!==void 0){this._performUpdateSplits["\u2699\uFE0F"]=e.optionsProcessingTime;const x=performance.now()-e.optionsProcessingTime;this._performUpdateSplits.start=x}this.update(b,{apiUpdate:!0,forceNodeDataRefresh:l,newAnimationBatch:!0,clearCallbackCache:!0}),this.firstApply=!1}applyInitialState(e){const{activeManager:i,annotationManager:s,chartTypeOriginator:n,historyManager:a,stateManager:r,zoomManager:o}=this.ctx,{initialState:l}=e;if("annotations"in e&&e.annotations?.enabled&&l?.annotations!=null){const c=l.annotations.map(h=>{const d=s.getAnnotationTypeStyles(h.type);return fT(h,d)});r.setState(s,c)}l?.chartType!=null&&r.setState(n,l.chartType),this.needsViewportSupport(e)&&l?.zoom!=null&&r.setState(o,l.zoom),l?.active!=null&&r.setState(i,l.active),l?.legend!=null&&this.updateLegends(l.legend),l!=null&&a.clear()}maybeResetAnimations(e){if(this.mode==="standalone")switch(e){case"series-grouping-change":case"replaced":this.resetAnimations();break;default:}}shouldForceNodeDataRefresh(e,i){const s=!!e.data||i==="data-change"||i==="replaced",n=["legend","gradientLegend"].some(r=>e[r]!=null),a=e.title!=null&&e.subtitle!=null||e.formatter!=null;return s||n||a}shouldClearLegendData(e,i,s){const n=s==="replaced"||s==="series-count-changed"||s==="series-grouping-change"||s==="updated"&&(e.series?.length!==i.series?.length||!e.series?.every((r,o)=>r.type===i.series?.[o].type)),a=i.legend!=null&&i.legend.enabled!==!1&&(e.legend==null||e.legend.enabled===!1);return n||a}applyMiniChartOptions(e,i,s,n){const a=n?.navigator?.miniChart?.series??n?.series,r=this.applySeries(e,this.filterMiniChartSeries(i),this.filterMiniChartSeries(a));this.applyAxes(e,s,n,r,["tick","thickness","title","crosshair","gridLine","label"]);const o=e.series;for(const h of o)h.properties.id=void 0;const l=e.axes,c=l.find(h=>h.direction===Hn.X);for(const h of l)h.nice=!1,h.gridLine.enabled=!1,h.label.enabled=h===c,h.tick.enabled=!1,h.interactionEnabled=!1;if(c!=null){const h=s.navigator?.miniChart,d=h?.label,u=h?.label?.interval;if(c.line.enabled=!1,c.label.set(bT(d,["interval","autoRotate","autoRotateAngle","itemStyler","minSpacing","rotation"])),c.type==="grouped-category"){c.label.enabled=!1,c.label.rotation=0;const{depthOptions:p}=c;if(p.length===0)p.set([{label:{enabled:!0}}]);else for(let g=1;gthis.createSeries(u));return this.initSeriesDeclarationOrder(d),e.series=d,"replaced"}Ci("Chart.applySeries() - matchResult",n);const a=[];let r=!1,o=!1,l=!1,c=!1;const h=n.changes.toSorted((d,u)=>d.targetIdx-u.targetIdx);for(const d of h)switch(o||(o=d.status==="series-grouping"),r||(r=d.diff?.data!=null),l||(l=d.status!=="no-op"),c||(c=d.status==="add"||d.status==="remove"),d.status){case"add":{const u=this.createSeries(d.opts);a.push(u),Ci("Chart.applySeries() - created new series",u);break}case"remove":Ci(`Chart.applySeries() - removing series at previous idx ${d.idx}`,d.series);break;case"no-op":a.push(d.series),Ci(`Chart.applySeries() - no change to series at previous idx ${d.idx}`,d.series);break;case"series-grouping":case"update":default:{const{series:u,diff:p,idx:g}=d;Ci(`Chart.applySeries() - applying series diff previous idx ${g}`,p,u),this.applySeriesValues(u,p),u.markNodeDataDirty(),a.push(u)}}return this.initSeriesDeclarationOrder(a),Ci("Chart.applySeries() - final series instances",a),e.series=a,o?"series-grouping-change":c?"series-count-changed":r?"data-change":l?"updated":"no-op"}applyAxes(e,i,s,n,a=[]){if(!("axes"in i)||!i.axes)return!1;a=["type",...a];const r=i.axes;if(!(n==="replaced")&&e.axes.matches(r)&&DP(s)){for(const c of e.axes){const h=s.axes?.[c.id]??{},d=gT(h,r[c.id]);Ci(`Chart.applyAxes() - applying axis diff idx ${c.id}`,d),Gd(c,d,{skip:a})}return!0}return Ci(`Chart.applyAxes() - creating new axes instances; seriesStatus: ${n}`),e.axes=this.createAxes(r,a),!0}createSeries(e){const s=Wn.getSeriesModule(e.type).create(this.getModuleContext());return this.applySeriesOptionModules(s,e),this.applySeriesValues(s,e),s}applySeriesOptionModules(e,i){const s=e.createModuleContext(),n=e.getModuleMap();for(const a of Wn.listModulesByType(vo.SeriesPlugin))a.name in i&&(a.seriesTypes?.includes(e.type)??!0)&&n.addModule(a.name,a.create(s))}applySeriesValues(e,i){const s=e.getModuleMap(),{type:n,data:a,listeners:r,seriesGrouping:o,showInMiniChart:l,...c}=i;for(const h of Wn.listModulesByType(vo.SeriesPlugin))if(h.name in c){const d=s.getModule(h.name);if(d){const u=c[h.name];d.properties.set(u),delete c[h.name]}}c.visible!=null&&(e.visible=c.visible),e.properties.set(c),"data"in i&&e.setOptionsData(a==null?void 0:Bo.wrap(a)),"listeners"in i&&(this.registerListeners(e,r),this.series.includes(e)&&this.addSeriesListeners(e)),"seriesGrouping"in i&&(o==null?e.seriesGrouping=void 0:e.seriesGrouping={...e.seriesGrouping,...o})}createAxes(e,i){const s=this.createChartAxes(),n=this.getModuleContext();for(const[a,r]of Fm(e)){const o=Wn.getAxisModule(r.type).create(n);o.id=a,this.applyAxisModules(o,r),Gd(o,r,{skip:i}),s.push(o)}return mP(s),s}applyAxisModules(e,i){const s=e.createModuleContext(),n=e.getModuleMap();for(const a of Wn.listModulesByType(vo.AxisPlugin)){const r=i[a.name]!=null;r!==n.isEnabled(a.name)&&(r?(n.addModule(a.name,a.create(s)),e[a.name]=n.getModule(a.name)):(n.removeModule(a.name),delete e[a.name]))}}registerListeners(e,i){if(e.clearEventListeners(),i&&typeof i=="object")for(const[s,n]of Fm(i))n!=null&&e.addEventListener(s,n)}async applyTransaction(e){await this.updateMutex.acquire(()=>{this.data.addTransaction(e),this.update(z.UPDATE_DATA,{apiUpdate:!0,skipAnimations:!0})}),await this.waitForUpdate()}onSyncActiveClear(){this.seriesAreaManager.onActiveClear()}needsViewportSupport(e){return!!e.navigator?.enabled||!!e.zoom?.enabled||!!e.scrollbar?.enabled}hasViewportSupport(){return this.needsViewportSupport({navigator:this.modulesManager.getModule("navigator"),zoom:this.modulesManager.getModule("zoom"),scrollbar:this.modulesManager.getModule("scrollbar")})}hasPgUpPgDownSupport(){return!0}};pe.className="Chart",pe.chartsInstances=new WeakMap,y([qs({newValue(t){this.destroyed||(this.ctx.domManager.setContainer(t),pe.chartsInstances.set(t,this))},oldValue(t){pe.chartsInstances.delete(t)}})],pe.prototype,"container",2),y([qs({newValue(t){this.resize("width option",{inWidth:t})}})],pe.prototype,"width",2),y([qs({newValue(t){this.resize("height option",{inHeight:t})}})],pe.prototype,"height",2),y([qs({newValue(t){this.resize("minWidth option",{inMinWidth:t})}})],pe.prototype,"minWidth",2),y([qs({newValue(t){this.resize("minHeight option",{inMinHeight:t})}})],pe.prototype,"minHeight",2),y([qs({newValue(t){this.resize("overrideDevicePixelRatio option",{inOverrideDevicePixelRatio:t})}})],pe.prototype,"overrideDevicePixelRatio",2),y([es],pe.prototype,"padding",2),y([es],pe.prototype,"keyboard",2),y([es],pe.prototype,"touch",2),y([es],pe.prototype,"mode",2),y([es],pe.prototype,"withinStudio",2),y([es],pe.prototype,"styleNonce",2),y([Bd("chartCaptions.title")],pe.prototype,"title",2),y([Bd("chartCaptions.subtitle")],pe.prototype,"subtitle",2),y([Bd("chartCaptions.footnote")],pe.prototype,"footnote",2),y([es],pe.prototype,"formatter",2),y([es],pe.prototype,"suppressFieldDotNotation",2),y([es],pe.prototype,"loadGoogleFonts",2),y([es],pe.prototype,"dataIdKey",2),y([qs({changeValue(t,e){this.onAxisChange(t,e)}})],pe.prototype,"axes",2),y([qs({changeValue(t,e){this.onSeriesChange(t,e)}})],pe.prototype,"series",2);var sh=pe;import{ActionOnSet as t2,ChartUpdateType as nh,Debug as Ep,ModuleRegistry as i2,deepClone as s2,getDocument as n2}from"ag-charts-core";import{ChartAxisDirection as Os,Debug as Rp,Logger as hi,ModuleRegistry as _t,ModuleType as Jo,deepClone as Qo,deepFreeze as a2,distribute as r2,entries as fa,getDocument as o2,getWindow as l2,groupBy as c2,hasRequiredInPath as Pp,isArray as h2,isKeyOf as ah,isObject as _p,isPlainObject as Jv,isSymbol as d2,joinFormatted as Qv,jsonDiff as e0,jsonPropertyCompare as u2,jsonWalk as Fp,mapValues as p2,merge as t0,mergeDefaults as el,setDocument as g2,setWindow as f2,shallowClone as rh,unique as m2,validate as tl}from"ag-charts-core";import{Logger as y2,ModuleRegistry as hs,ModuleType as Ti,deepClone as Vp,deepFreeze as Bp,groupBy as b2,isArray as x2,isDefined as i0,isObject as di,unique as v2}from"ag-charts-core";import{BASE_FONT_SIZE as S2,CARTESIAN_AXIS_TYPE as ma,Color as zp,DEFAULT_ANNOTATION_HANDLE_FILL as I2,DEFAULT_ANNOTATION_STATISTICS_COLOR as D2,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE as M2,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL as A2,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE as C2,DEFAULT_ANNOTATION_STATISTICS_FILL as T2,DEFAULT_ANNOTATION_STATISTICS_STROKE as L2,DEFAULT_CAPTION_ALIGNMENT as oh,DEFAULT_CAPTION_LAYOUT_STYLE as lh,DEFAULT_FIBONACCI_STROKES as N2,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL as k2,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR as w2,DEFAULT_POLAR_SERIES_STROKE as O2,DEFAULT_SHADOW_COLOUR as E2,DEFAULT_SPARKLINE_CROSSHAIR_STROKE as R2,DEFAULT_TEXTBOX_COLOR as P2,DEFAULT_TEXTBOX_FILL as _2,DEFAULT_TEXTBOX_STROKE as F2,DEFAULT_TEXT_ANNOTATION_COLOR as V2,DEFAULT_TOOLBAR_POSITION as B2,FONT_SIZE_RATIO as ch,IS_DARK_THEME as Gp,ModuleRegistry as zi,ModuleType as gn,PALETTE_ALT_DOWN_FILL as z2,PALETTE_ALT_DOWN_STROKE as G2,PALETTE_ALT_NEUTRAL_FILL as U2,PALETTE_ALT_NEUTRAL_STROKE as H2,PALETTE_ALT_UP_FILL as j2,PALETTE_ALT_UP_STROKE as W2,PALETTE_DOWN_FILL as Y2,PALETTE_DOWN_STROKE as $2,PALETTE_NEUTRAL_FILL as K2,PALETTE_NEUTRAL_STROKE as Z2,PALETTE_UP_FILL as X2,PALETTE_UP_STROKE as q2,POLAR_AXIS_TYPE as hh,deepClone as Up,deepFreeze as dh,getSequentialColors as J2,groupBy as Q2,isArray as eF,jsonWalk as tF,mergeDefaults as Es}from"ag-charts-core";function s0(t){return t?.up||t?.down||t?.neutral?"user-full":t?.fills||t?.strokes?"user-indexed":"inbuilt"}var Pe={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},Rs={BLUE:"#2b5c95",ORANGE:"#cc6f10",GREEN:"#1e652e",CYAN:"#18859e",YELLOW:"#a69400",VIOLET:"#603c88",GRAY:"#575757",MAGENTA:"#7d2f6d",BROWN:"#4f3508",RED:"#a82529"},Hp="white",iF={"radial-gauge":!0,"linear-gauge":!0};function vr(t){return{$some:[{$and:[{$or:[{$isSeriesType:"line"},{$isSeriesType:"scatter"},{$isSeriesType:"area"},{$isSeriesType:"radar"},{$isSeriesType:"rangeArea"}]},{$isUserOption:[`/series/$index/${t}`,{$lessThan:[{$path:`/series/$index/${t}`},1]},!1]}]},{$path:"/series"}]}}function sF(t){return iF[t]===!0}var ui=class bo{static getDefaultColors(){return{fills:Pe,fillsFallback:Object.values(Pe),strokes:Rs,sequentialColors:J2(Pe),divergingColors:[Pe.ORANGE,Pe.YELLOW,Pe.GREEN],hierarchyColors:["#fff","#e0e5ea","#c1ccd5","#a3b4c1","#859cad"],secondSequentialColors:zp.interpolate([zp.fromHexString(Pe.BLUE),zp.fromHexString("#cbdef5")],8).map(e=>e.toString()),secondDivergingColors:[Pe.GREEN,Pe.YELLOW,Pe.RED],secondHierarchyColors:["#fff","#c5cbd1","#a4b1bd","#8498a9","#648096"],up:{fill:Pe.GREEN,stroke:Rs.GREEN},down:{fill:Pe.RED,stroke:Rs.RED},neutral:{fill:Pe.GRAY,stroke:Rs.GRAY},altUp:{fill:Pe.BLUE,stroke:Rs.BLUE},altDown:{fill:Pe.ORANGE,stroke:Rs.ORANGE},altNeutral:{fill:Pe.GRAY,stroke:Rs.GRAY}}}static getDefaultPublicParameters(){return{accentColor:"#2196f3",axisColor:{$foregroundBackgroundMix:.325},backgroundColor:Hp,borderColor:{$foregroundOpacity:.15},borderRadius:4,chartBackgroundColor:{$ref:"backgroundColor"},chartPadding:20,focusShadow:"0 0 0 3px var(--ag-charts-accent-color)",foregroundColor:"#181d1f",fontFamily:"Verdana, sans-serif",fontSize:S2,fontWeight:400,gridLineColor:{$foregroundBackgroundMix:.1},popupShadow:"0 0 16px rgba(0, 0, 0, 0.15)",subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"chartBackgroundColor"},.38]},textColor:{$ref:"foregroundColor"},chromeBackgroundColor:{$foregroundBackgroundMix:.02},chromeFontFamily:{$ref:"fontFamily"},chromeFontSize:{$ref:"fontSize"},chromeFontWeight:{$ref:"fontWeight"},chromeTextColor:{$ref:"foregroundColor"},chromeSubtleTextColor:{$mix:[{$ref:"chromeTextColor"},{$ref:"backgroundColor"},.38]},buttonBackgroundColor:{$ref:"backgroundColor"},buttonBorder:!0,buttonFontWeight:400,buttonTextColor:{$ref:"textColor"},inputBackgroundColor:{$ref:"backgroundColor"},inputBorder:!0,inputTextColor:{$ref:"textColor"},menuBackgroundColor:{$ref:"chromeBackgroundColor"},menuBorder:!0,menuTextColor:{$ref:"chromeTextColor"},panelBackgroundColor:{$ref:"chromeBackgroundColor"},panelSubtleTextColor:{$ref:"chromeSubtleTextColor"},tooltipBackgroundColor:{$ref:"chromeBackgroundColor"},tooltipBorder:!0,tooltipTextColor:{$ref:"chromeTextColor"},tooltipSubtleTextColor:{$ref:"chromeSubtleTextColor"},crosshairLabelBackgroundColor:{$ref:"foregroundColor"},crosshairLabelTextColor:{$ref:"chartBackgroundColor"},separationLinesColor:{$foregroundBackgroundMix:.17}}}static getPrivateParameters(){return{focusColor:{$mix:[{$ref:"backgroundColor"},{$ref:"accentColor"},.12]}}}static getAxisDefaults({title:e,time:i},s){return Es(s,e&&{title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:ch.MEDIUM},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},i&&{parentLevel:{enabled:!1,label:{enabled:{$path:"../../label/enabled"},border:{enabled:{$or:[{$isUserOption:["../border",!0,!1]},{$path:"../../../label/border/enabled"}]},strokeWidth:{$path:"../../../label/border/strokeWidth"},stroke:{$path:"../../../label/border/stroke"}},fill:{$path:"../../label/fill"},fontSize:{$path:"../../label/fontSize"},fontFamily:{$path:"../../label/fontFamily"},fontWeight:"bold",spacing:{$path:"../../label/spacing"},color:{$path:"../../label/color"},cornerRadius:{$path:"../../label/cornerRadius"},padding:{$path:"../../label/padding"},avoidCollisions:{$path:"../../label/avoidCollisions"}},tick:{enabled:{$path:"../../tick/enabled"},width:{$path:"../../tick/width"},size:{$path:"../../tick/size"},stroke:{$path:"../../tick/stroke"}}}},{label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:11,color:{$ref:"textColor"},avoidCollisions:!0,cornerRadius:4,border:{enabled:!1,strokeWidth:1,stroke:{$foregroundOpacity:.08}},padding:{$if:[{$path:"./border/enabled"},{left:12,right:12,top:8,bottom:8},5]}},line:{enabled:!0,width:1,stroke:{$ref:"axisColor"}},tick:{enabled:!1,size:6,width:1,stroke:{$ref:"axisColor"}},gridLine:{enabled:!0,width:1,style:{$apply:[{fillOpacity:1,stroke:{$ref:"gridLineColor"},strokeWidth:{$path:"../../width"},lineDash:[]},[{fillOpacity:1,stroke:{$ref:"gridLineColor"},strokeWidth:{$path:"../../width"},lineDash:[]}]]}},crossLines:{$apply:[{enabled:!0,fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},fillOpacity:.08,strokeWidth:1,label:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},padding:{$if:[{$path:"./border/enabled"},{left:12,right:12,top:8,bottom:8},5]},color:{$ref:"textColor"},cornerRadius:4,border:{enabled:!1,stroke:{$foregroundOpacity:.08},strokeOpacity:1,strokeWidth:1}}},void 0,{$pathString:["/common/axes/$axisType/crossLines",{axisType:{$path:["../type"]}}]},{$pathString:["/$seriesType/axes/$axisType/crossLines",{seriesType:{$path:["/series/0/type","line"]},axisType:{$path:["../type"]}}]}]}})}getChartDefaults(){return{minHeight:300,minWidth:300,background:{visible:!0,fill:{$ref:"chartBackgroundColor"}},padding:{top:{$ref:"chartPadding"},right:{$ref:"chartPadding"},bottom:{$ref:"chartPadding"},left:{$ref:"chartPadding"}},seriesArea:{border:{enabled:!1,stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:1},cornerRadius:4,padding:{$if:[{$path:"./border/enabled"},5,0]}},keyboard:{enabled:!0},title:{enabled:!1,text:"Title",spacing:{$if:[{$path:"../subtitle/enabled"},10,20]},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:ch.LARGEST},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},wrapping:"hyphenate",layoutStyle:lh,textAlign:oh},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:ch.MEDIUM},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:lh,textAlign:oh},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:{$rem:ch.MEDIUM},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:lh,textAlign:oh},highlight:{enabled:!0,drawingMode:{$if:[{$or:[vr("highlight/highlightedItem/opacity"),vr("highlight/unhighlightedItem/opacity"),vr("highlight/highlightedSeries/opacity"),vr("highlight/unhighlightedSeries/opacity"),vr("fillOpacity"),vr("marker/fillOpacity")]},"overlap","cutout"]}},tooltip:{enabled:!0,darkTheme:Gp,delay:0,pagination:!1,mode:{$if:[{$or:[{$and:[{$isChartType:"cartesian"},{$not:{$hasSeriesType:"bubble"}},{$not:{$hasSeriesType:"scatter"}},{$greaterThan:[{$size:{$path:"/series"}},1]},{$lessThan:[{$size:{$path:"/series"}},4]}]},{$and:[{$isChartType:"polar"},{$greaterThan:[{$size:{$path:"/series"}},1]},{$lessThan:[{$size:{$path:"/series"}},4]}]}]},"shared","single"]}},overlays:{darkTheme:Gp},listeners:{},series:{tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","exact"]},"area"]},"exact",{$path:["/tooltip/range","exact"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","pointer"]},placement:{$path:["/tooltip/position/placement",void 0]},xOffset:{$path:["/tooltip/position/xOffset",0]},yOffset:{$path:["/tooltip/position/yOffset",0]}}}}}}constructor(e={}){const{overrides:i,palette:s,params:n}=Up(e),a=this.createChartConfigPerChartType(this.getDefaults()),r={};i&&this.processOverrides(r,i);const{fills:o,strokes:l,sequentialColors:c,...h}=this.getDefaultColors();this.palette=dh(Es(s,{fills:Object.values(o),strokes:Object.values(l),sequentialColors:Object.values(c),...h})),this.paletteType=s0(s),this.params=Es(n,this.getThemeParameters()),this.config=dh(Up(a)),this.overrides=dh(i),this.presets=dh(r)}processOverrides(e,i){for(const s of zi.listModulesByType(gn.Series)){const n=s.name,a=i[n];sF(n)&&(e[n]=a,delete i[n])}}createChartConfigPerChartType(e){var i;for(const s of zi.listModulesByType(gn.Chart))for(const n of zi.listModulesByType(gn.Series))n.chartType===s.name&&(e[i=n.name]??(e[i]=s.themeTemplate));return e}getDefaults(){const e=(n,a)=>{const r={},o=Es({axes:{}},...Array.from(zi.listModulesByType(gn.Plugin),l=>({[l.name]:l.themeTemplate})),zi.getChartModule(n)?.themeTemplate,this.getChartDefaults());for(const l of a){r[l]=Es(aF(l),r[l]??o);const{axes:c}=r[l];for(const h of zi.listModulesByType(gn.Axis))c[h.name]=Es(c[h.name],!h.chartType||h.chartType===n?nF(h.name):null,bo.axisDefault[h.name]);(l==="map-shape-background"||l==="map-line-background")&&delete r[l].series.tooltip}return r},i=[...zi.listModulesByType(gn.Series)],s=Q2(i,n=>n.chartType||"unknown");return Es(...Object.keys(s).map(n=>e(n,s[n]?.map(a=>a.name)??[])))}static applyTemplateTheme(e,i,s){if(eF(e))for(let n=0;nr.enterprise?"enterprise":"community");if(s.length){const r=hs.isEnterprise()||a.enterprise?.length?"enterprise":"community";y2.errorOnce(["required modules are not registered. Check if you have registered the modules:","",hs.isUmd()?"Install and register 'ag-charts-enterprise' before creating the chart.":hF(s.map(lF),r),"",`See ${n} for more details.`].join(` `))}}function lF(t){return t.moduleId??t.name}function a0(t){return` ${t},`}function cF(t,e){return t.length?`import { ${t.map(a0).join(` `)} } from 'ag-charts-${e}';`:null}function hF(t,e){const i=cF(["ModuleRegistry"].concat(t),e),s=t.map(a0).join(` `);return`${i} ModuleRegistry.registerModules([ ${s} ]);`}function dF(t,e){const i=new Map,s="axes"in e&&di(e.axes)?e.axes:{},n=new Set(Object.values(s).map(o=>o?.type).filter(i0)),a=new Set(e.series?.map(o=>o.type).filter(i0));function r(o){i.set(o.name,o)}for(const o of un.values())if(!hs.hasModule(o.name)&&!rF.has(o.name)&&!(t&&o.chartType&&t!==o.chartType))switch(o.type){case"chart":break;case"axis":if(n.has(o.name)){for(const h of Object.keys(s))s?.[h].type===o.name&&delete s[h];r(o)}break;case"series":a.has(o.name)&&(e.series=e.series.filter(h=>h.type!==o.name),r(o));break;case"plugin":const l=o.name,c=e[l];di(c)&&(c.enabled!==!1&&r(o),delete e[l]);break;case"axis:plugin":for(const h of Object.values(s)){const d=o.name;h?.[d]&&(h[d].enabled!==!1&&r(o),delete h[d])}break;case"series:plugin":for(const h of e.series??[])h[o.name]&&(delete h[o.name],r(o));break}for(const o of a){const l=un.get(o);l?.type===Ti.Series&&!hs.hasModule(l.name)&&!i.has(l.name)&&(e.series=e.series.filter(c=>c.type!==l.name),r(l))}return Array.from(i.values())}function r0(t,e){const i="axes"in e&&di(e.axes),s="series"in e&&x2(e.series),n=r=>t==null||!r.chartType||r.chartType===t,a=[];for(const r of hs.listModules())if(hs.isModuleType(Ti.Plugin,r))n(r)||(delete e[r.name],a.push(r.name));else if(hs.isModuleType(Ti.AxisPlugin,r)){if(i&&!n(r)){for(const o of Object.values(e.axes))delete o[r.name];a.push(r.name)}}else if(hs.isModuleType(Ti.SeriesPlugin,r)&&s&&!n(r)){for(const o of e.series)delete o[r.name];a.push(r.name)}return a}import{Debug as uF,Logger as o0,arrayOf as l0,boolean as uh,color as ee,colorUnion as pF,fontFamilyFull as c0,fontWeight as jp,gradientStrict as Wp,isObject as h0,mergeDefaults as gF,number as ph,object as d0,or as il,simpleMemorize as pi,string as Yp,union as fF,validate as u0}from"ag-charts-core";import{DEFAULT_ANNOTATION_HANDLE_FILL as mF,DEFAULT_ANNOTATION_STATISTICS_COLOR as yF,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE as bF,DEFAULT_ANNOTATION_STATISTICS_FILL as xF,DEFAULT_ANNOTATION_STATISTICS_STROKE as vF,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL as SF,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR as IF,DEFAULT_POLAR_SERIES_STROKE as DF,DEFAULT_TEXTBOX_COLOR as MF,DEFAULT_TEXTBOX_FILL as AF,DEFAULT_TEXTBOX_STROKE as CF,DEFAULT_TEXT_ANNOTATION_COLOR as TF,IS_DARK_THEME as LF,getSequentialColors as NF}from"ag-charts-core";var $p="#192232",bt={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},ya={BLUE:"#74a8e6",ORANGE:"#ffbe70",GREEN:"#6cb176",CYAN:"#75d4ef",YELLOW:"#f6e559",VIOLET:"#aa86d8",GRAY:"#a1a1a1",MAGENTA:"#ce7ab9",BROWN:"#997b52",RED:"#ff7872"},Sr=class extends Gi{getDefaultColors(){return{fills:bt,fillsFallback:Object.values(bt),strokes:ya,sequentialColors:NF(bt),divergingColors:[bt.ORANGE,bt.YELLOW,bt.GREEN],hierarchyColors:["#192834","#253746","#324859","#3f596c","#4d6a80"],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[bt.GREEN,bt.YELLOW,bt.RED],secondHierarchyColors:["#192834","#3b5164","#496275","#577287","#668399"],up:{fill:bt.GREEN,stroke:ya.GREEN},down:{fill:bt.RED,stroke:ya.RED},neutral:{fill:bt.GRAY,stroke:ya.GRAY},altUp:{fill:bt.BLUE,stroke:ya.BLUE},altDown:{fill:bt.ORANGE,stroke:ya.ORANGE},altNeutral:{fill:bt.GRAY,stroke:ya.GRAY}}}getThemeParameters(){return{...super.getThemeParameters(),axisColor:{$foregroundBackgroundMix:.737},backgroundColor:$p,borderColor:{$foregroundBackgroundMix:.216},chromeBackgroundColor:{$foregroundBackgroundMix:.07},focusColor:{$mix:[{$ref:"backgroundColor"},{$ref:"accentColor"},.22]},foregroundColor:"#fff",gridLineColor:{$foregroundBackgroundMix:.257},popupShadow:"0 0 16px rgba(0, 0, 0, 0.33)",subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"chartBackgroundColor"},.57]},separationLinesColor:{$foregroundBackgroundMix:.44},crosshairLabelBackgroundColor:{$foregroundBackgroundMix:.65}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(LF,!0),t.set(DF,$p),t.set(IF,bt.BLUE),t.set(TF,"#fff"),t.set(SF,bt.BLUE),t.set(mF,$p),t.set(xF,"#28313e"),t.set(vF,"#4b525d"),t.set(yF,"#fff"),t.set(bF,"#fff"),t.set(AF,"#28313e"),t.set(CF,"#4b525d"),t.set(MF,"#fff"),t}constructor(t){super(t)}};import{DEFAULT_CAPTION_ALIGNMENT as kF,DEFAULT_CAPTION_LAYOUT_STYLE as wF,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL as OF,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR as EF,DEFAULT_TOOLBAR_POSITION as RF,getSequentialColors as PF}from"ag-charts-core";var Kt={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},ba={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},_F=class extends Sr{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Kt},fillsFallback:Object.values({...Kt}),strokes:{...ba},sequentialColors:PF(Kt),divergingColors:[Kt.GREEN,Kt.BLUE,Kt.RED],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],up:{fill:Kt.GREEN,stroke:ba.GREEN},down:{fill:Kt.RED,stroke:ba.RED},neutral:{fill:Kt.BLUE,stroke:ba.BLUE},altUp:{fill:Kt.GREEN,stroke:ba.GREEN},altDown:{fill:Kt.RED,stroke:ba.RED},altNeutral:{fill:Kt.GRAY,stroke:ba.GRAY}}}getThemeParameters(){return{...super.getThemeParameters(),chartPadding:0,gridLineColor:{$foregroundBackgroundMix:.12}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(EF,Kt.BLUE),t.set(OF,Kt.BLUE),t.set(wF,"overlay"),t.set(kF,"left"),t.set(RF,"bottom"),t}};import{DEFAULT_CAPTION_ALIGNMENT as FF,DEFAULT_CAPTION_LAYOUT_STYLE as VF,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL as BF,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR as zF,DEFAULT_TOOLBAR_POSITION as GF,getSequentialColors as UF}from"ag-charts-core";var Zt={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},xa={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},HF=class extends Gi{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Zt},fillsFallback:Object.values({...Zt}),strokes:{...xa},sequentialColors:UF(Zt),divergingColors:[Zt.GREEN,Zt.BLUE,Zt.RED],up:{fill:Zt.GREEN,stroke:xa.GREEN},down:{fill:Zt.RED,stroke:xa.RED},neutral:{fill:Zt.BLUE,stroke:xa.BLUE},altUp:{fill:Zt.GREEN,stroke:xa.GREEN},altDown:{fill:Zt.RED,stroke:xa.RED},altNeutral:{fill:Zt.GRAY,stroke:xa.GRAY}}}getThemeParameters(){return{...super.getThemeParameters(),chartPadding:0,gridLineColor:{$foregroundBackgroundMix:.06}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(zF,Zt.BLUE),t.set(BF,Zt.BLUE),t.set(VF,"overlay"),t.set(FF,"left"),t.set(GF,"bottom"),t}};import{DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL as jF,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR as WF,getSequentialColors as YF}from"ag-charts-core";var xt={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},va={BLUE:"#90CAF9",ORANGE:"#FFCC80",GREEN:"#A5D6A7",CYAN:"#80DEEA",YELLOW:"#FFF9C4",VIOLET:"#B39DDB",GRAY:"#E0E0E0",MAGENTA:"#F48FB1",BROWN:"#A1887F",RED:"#EF9A9A"},$F=class extends Sr{getDefaultColors(){return{...super.getDefaultColors(),fills:xt,fillsFallback:Object.values(xt),strokes:va,sequentialColors:YF(xt),divergingColors:[xt.ORANGE,xt.YELLOW,xt.GREEN],secondSequentialColors:["#2196f3","#208FEC","#1E88E5","#1C7FDC","#1976d2","#176EC9","#1565c0"],secondDivergingColors:[xt.GREEN,xt.YELLOW,xt.RED],up:{fill:xt.GREEN,stroke:va.GREEN},down:{fill:xt.RED,stroke:va.RED},neutral:{fill:xt.GRAY,stroke:va.GRAY},altUp:{fill:xt.BLUE,stroke:va.BLUE},altDown:{fill:xt.RED,stroke:va.RED},altNeutral:{fill:xt.GRAY,stroke:va.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(WF,xt.BLUE),t.set(jF,xt.BLUE),t}};import{DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL as KF,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR as ZF,getSequentialColors as XF}from"ag-charts-core";var vt={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Sa={BLUE:"#1565C0",ORANGE:"#E65100",GREEN:"#2E7D32",CYAN:"#00838F",YELLOW:"#F9A825",VIOLET:"#4527A0",GRAY:"#616161",MAGENTA:"#C2185B",BROWN:"#4E342E",RED:"#B71C1C"},qF=class extends Gi{getDefaultColors(){return{...super.getDefaultColors(),fills:vt,fillsFallback:Object.values(vt),strokes:Sa,sequentialColors:XF(vt),divergingColors:[vt.ORANGE,vt.YELLOW,vt.GREEN],secondSequentialColors:["#2196f3","#329EF4","#42a5f5","#53ADF6","#64b5f6","#7AC0F8","#90caf9"],secondDivergingColors:[vt.GREEN,vt.YELLOW,vt.RED],up:{fill:vt.GREEN,stroke:Sa.GREEN},down:{fill:vt.RED,stroke:Sa.RED},neutral:{fill:vt.GRAY,stroke:Sa.GRAY},altUp:{fill:vt.BLUE,stroke:Sa.BLUE},altDown:{fill:vt.RED,stroke:Sa.RED},altNeutral:{fill:vt.GRAY,stroke:Sa.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(ZF,vt.BLUE),t.set(KF,vt.BLUE),t}};import{DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL as JF,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR as QF,getSequentialColors as eV}from"ag-charts-core";var De={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},Ia={BLUE:"#6698ff",PURPLE:"#c0a3ff",MAGENTA:"#fc8dfc",PINK:"#ff82b1",RED:"#ff9b70",ORANGE:"#ffcf4e",YELLOW:"#ffff58",GREEN:"#58dd70",CYAN:"#51e2c9",MODERATE_BLUE:"#4fd7ff",GRAY:"#eeeeee"},tV=class extends Sr{getDefaultColors(){return{fills:De,fillsFallback:Object.values(De),strokes:Ia,sequentialColors:eV(De),divergingColors:[De.BLUE,De.RED],hierarchyColors:[],secondSequentialColors:[De.BLUE,De.PURPLE,De.MAGENTA,De.PINK,De.RED,De.ORANGE,De.YELLOW,De.GREEN],secondDivergingColors:[De.BLUE,De.RED],secondHierarchyColors:[],up:{fill:De.GREEN,stroke:Ia.GREEN},down:{fill:De.RED,stroke:Ia.RED},neutral:{fill:De.GRAY,stroke:Ia.GRAY},altUp:{fill:De.BLUE,stroke:Ia.BLUE},altDown:{fill:De.RED,stroke:Ia.RED},altNeutral:{fill:De.GRAY,stroke:Ia.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(QF,De.BLUE),t.set(JF,De.BLUE),t}};import{DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL as iV,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR as sV,getSequentialColors as nV}from"ag-charts-core";var Me={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},Da={BLUE:"#2346c9",PURPLE:"#7653d4",MAGENTA:"#a73da9",PINK:"#c32d66",RED:"#c84b1c",ORANGE:"#c87f00",YELLOW:"#c1b900",GREEN:"#008c1c",CYAN:"#00927c",MODERATE_BLUE:"#0087bb",GRAY:"#888888"},aV=class extends Gi{getDefaultColors(){return{...super.getDefaultColors(),fills:Me,fillsFallback:Object.values(Me),strokes:Da,sequentialColors:nV(Me),divergingColors:[Me.BLUE,Me.RED],hierarchyColors:[],secondSequentialColors:[Me.BLUE,Me.PURPLE,Me.MAGENTA,Me.PINK,Me.RED,Me.ORANGE,Me.YELLOW,Me.GREEN],secondDivergingColors:[Me.BLUE,Me.RED],secondHierarchyColors:[],up:{fill:Me.GREEN,stroke:Da.GREEN},down:{fill:Me.RED,stroke:Da.RED},neutral:{fill:Me.GRAY,stroke:Da.GRAY},altUp:{fill:Me.BLUE,stroke:Da.BLUE},altDown:{fill:Me.RED,stroke:Da.RED},altNeutral:{fill:Me.GRAY,stroke:Da.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(sV,Me.BLUE),t.set(iV,Me.BLUE),t}};import{DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL as rV,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR as oV,getSequentialColors as lV}from"ag-charts-core";var Ye={BLUE:"#4472C4",ORANGE:"#ED7D31",GRAY:"#A5A5A5",YELLOW:"#FFC000",MODERATE_BLUE:"#5B9BD5",GREEN:"#70AD47",DARK_GRAY:"#7B7B7B",DARK_BLUE:"#264478",VERY_DARK_GRAY:"#636363",DARK_YELLOW:"#997300"},fn={BLUE:"#6899ee",ORANGE:"#ffa55d",GRAY:"#cdcdcd",YELLOW:"#ffea53",MODERATE_BLUE:"#82c3ff",GREEN:"#96d56f",DARK_GRAY:"#a1a1a1",DARK_BLUE:"#47689f",VERY_DARK_GRAY:"#878787",DARK_YELLOW:"#c0993d"},cV=class extends Sr{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Ye,RED:Ye.ORANGE},fillsFallback:Object.values({...Ye,RED:Ye.ORANGE}),strokes:{...fn,RED:fn.ORANGE},sequentialColors:lV({...Ye,RED:Ye.ORANGE}),divergingColors:[Ye.ORANGE,Ye.YELLOW,Ye.GREEN],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[Ye.GREEN,Ye.YELLOW,Ye.ORANGE],up:{fill:Ye.GREEN,stroke:fn.GREEN},down:{fill:Ye.ORANGE,stroke:fn.ORANGE},neutral:{fill:Ye.GRAY,stroke:fn.GRAY},altUp:{fill:Ye.BLUE,stroke:fn.BLUE},altDown:{fill:Ye.ORANGE,stroke:fn.ORANGE},altNeutral:{fill:Ye.GRAY,stroke:fn.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(oV,Ye.BLUE),t.set(rV,Ye.BLUE),t}};import{DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL as hV,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR as dV,getSequentialColors as uV}from"ag-charts-core";var tt={BLUE:"#5281d5",ORANGE:"#ff8d44",GRAY:"#b5b5b5",YELLOW:"#ffd02f",MODERATE_BLUE:"#6aabe6",GREEN:"#7fbd57",DARK_GRAY:"#8a8a8a",DARK_BLUE:"#335287",VERY_DARK_GRAY:"#717171",DARK_YELLOW:"#a98220"},Ps={BLUE:"#214d9b",ORANGE:"#c25600",GRAY:"#7f7f7f",YELLOW:"#d59800",MODERATE_BLUE:"#3575ac",GREEN:"#4b861a",DARK_GRAY:"#575757",DARK_BLUE:"#062253",VERY_DARK_GRAY:"#414141",DARK_YELLOW:"#734f00"},pV=class extends Gi{getDefaultColors(){return{...super.getDefaultColors(),fills:{...tt,RED:tt.ORANGE},fillsFallback:Object.values({...tt,RED:tt.ORANGE}),strokes:{...Ps,RED:Ps.ORANGE},sequentialColors:uV({...tt,RED:tt.ORANGE}),divergingColors:[tt.ORANGE,tt.YELLOW,tt.GREEN],secondSequentialColors:["#5090dc","#629be0","#73a6e3","#85b1e7","#96bcea","#a8c8ee","#b9d3f1","#cbdef5"],secondDivergingColors:[tt.GREEN,tt.YELLOW,tt.ORANGE],secondHierarchyColors:[],up:{fill:tt.GREEN,stroke:Ps.GREEN},down:{fill:tt.ORANGE,stroke:Ps.ORANGE},neutral:{fill:Ps.GRAY,stroke:Ps.GRAY},altUp:{fill:tt.BLUE,stroke:Ps.BLUE},altDown:{fill:tt.ORANGE,stroke:Ps.ORANGE},altNeutral:{fill:tt.GRAY,stroke:Ps.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(dV,tt.BLUE),t.set(hV,tt.BLUE),t}};import{array as gV,arrayOf as fV,arrayOfDefs as mV,boolean as gi,callbackOf as yV,color as gh,commonChartOptionsDefs as J,constant as p0,defined as bV,fillOptionsDef as g0,fontOptionsDef as xV,isFunction as vV,isObject as f0,isSymbol as Kp,lineDashOptionsDef as SV,linearGaugeSeriesThemeableOptionsDef as m0,linearGaugeTargetOptionsDef as IV,number as _s,numberFormatValidator as DV,optionsDefs as y0,or as Ma,positiveNumber as $e,radialGaugeSeriesThemeableOptionsDef as b0,radialGaugeTargetOptionsDef as MV,ratio as Ir,required as AV,string as fh,strokeOptionsDef as x0,textOrSegments as CV,themeOperator as v0,undocumented as S0,union as Dr,unionSymbol as TV,without as j}from"ag-charts-core";import{and as Ft,arrayLength as LV,arrayOf as Mr,arrayOfDefs as Zp,attachDescription as mh,boolean as he,borderOptionsDef as NV,callbackDefs as kV,callbackOf as yh,color as mn,constant as Ar,date as Aa,defined as Xp,fillOptionsDef as I0,fontOptionsDef as sl,greaterThan as yn,labelBoxOptionsDef as qp,lessThan as bn,lineDashOptionsDef as Jp,number as dt,numberFormatValidator as wV,object as OV,optionsDefs as D0,or as Xt,padding as EV,positiveNumber as Ke,positiveNumberNonZero as bh,ratio as Ui,required as Cr,string as Vt,strokeOptionsDef as Qp,textOrSegments as eg,themeOperator as RV,timeInterval as tg,timeIntervalUnit as ig,undocumented as M0,union as Li}from"ag-charts-core";var Tr={enabled:he,text:Vt,padding:EV,border:NV,cornerRadius:dt,...sl,...I0},Fs=mh({enabled:he,type:Cr(Li("line","range")),range:Ft(mh((t,{options:e})=>e.type==="range","crossLine type to be 'range'"),Mr(Xp),LV(2,2)),value:Ft(mh((t,{options:e})=>e.type==="line","crossLine type to be 'line'"),Xp),label:Tr,fill:mn,fillOpacity:Ui,...Qp,...Jp},"cross-line options"),A0={...Fs,label:{...Tr,position:Li("top","left","right","bottom","top-left","top-right","bottom-left","bottom-right","inside","inside-left","inside-right","inside-top","inside-bottom","inside-top-left","inside-bottom-left","inside-top-right","inside-bottom-right"),rotation:dt}},xn={enabled:he,rotation:dt,avoidCollisions:he,minSpacing:Ke,spacing:Ke,formatter:yh(eg),itemStyler:kV({...sl,...qp,spacing:dt}),...sl,...qp},xh={autoRotate:he,autoRotateAngle:dt,wrapping:Li("never","always","hyphenate","on-space"),truncate:he,...xn},C0={format:wV,...xh},vh={format:Xt(Vt,OV),...xh},T0={enabled:he,width:Ke,size:Ke,stroke:mn},sg={enabled:he,label:vh,tick:T0},L0={values:Mr(Xp),minSpacing:Ke},Lr={reverse:he,gridLine:{enabled:he,width:Ke,style:Zp({fill:mn,fillOpacity:Ke,stroke:Xt(mn,RV),strokeWidth:Ke,lineDash:Mr(Ke)},"a grid-line style object array")},interval:L0,label:xn,line:{enabled:he,width:Ke,stroke:mn},tick:T0,context:()=>!0};Lr.layoutConstraints=M0({stacked:Cr(he),align:Cr(Li("start","end")),unit:Cr(Li("percent","px")),width:Cr(Ke)});var ng={enabled:he,text:eg,spacing:Ke,maxWidth:Ke,maxHeight:Ke,wrapping:Li("never","always","hyphenate","on-space"),truncate:he,formatter:yh(eg),...sl},vn={...Lr,title:ng,crossAt:{value:Cr(Xt(dt,Aa,Vt,Mr(Vt))),sticky:he},crossLines:Zp(A0,"a cross-line options array"),position:Li("top","right","bottom","left"),thickness:Ke,maxThicknessRatio:Ui};vn.title._enabledFromTheme=M0(he);var Sh={enabled:he,...I0,...Qp,...Jp};function Ca(t,e){const i={enabled:he,xOffset:dt,yOffset:dt,formatter:yh(Vt),renderer:yh(Xt(Vt,D0({text:Vt,color:mn,backgroundColor:mn,opacity:Ui},"crosshair label renderer result object")))};let s;return t&&(s={...i,format:e?Xt(Vt,D0({millisecond:Vt,second:Vt,hour:Vt,day:Vt,month:Vt,year:Vt})):Vt}),{enabled:he,snap:he,label:s??i,...Qp,...Jp}}function nl(t,e){return{min:Ft(t,bn("max")),max:Ft(t,yn("min")),preferredMin:Ft(t,bn("preferredMax"),bn("max")),preferredMax:Ft(t,yn("preferredMin"),yn("min")),nice:he,interval:{step:e?Xt(bh,ig,tg):bh,values:Mr(t),minSpacing:Ft(Ke,bn("maxSpacing")),maxSpacing:Ft(Ke,yn("minSpacing"))}}}var N0={step:Xt(bh,ig,tg),values:Mr(Xt(dt,Aa)),minSpacing:Ft(Ke,bn("maxSpacing")),maxSpacing:Ft(Ke,yn("minSpacing")),placement:Li("on","between")},Nr={...vn,type:Ar("category"),label:xh,paddingInner:Ui,paddingOuter:Ui,groupPaddingInner:Ui,crosshair:Ca(),bandAlignment:Li("justify","start","center","end"),bandHighlight:Sh,interval:{...L0,placement:Li("on","between")},skipNullBars:he},kr={...vn,type:Ar("grouped-category"),label:xh,crosshair:Ca(),bandHighlight:Sh,paddingInner:Ui,groupPaddingInner:Ui,depthOptions:Zp({label:{enabled:he,avoidCollisions:he,wrapping:Li("never","always","hyphenate","on-space"),truncate:he,rotation:dt,spacing:dt,...sl,...qp},tick:{enabled:he,stroke:mn,width:Ke}},"depth options objects array")},wr={...vn,...nl(dt),type:Ar("number"),label:C0,crosshair:Ca(!0)},Or={...vn,...nl(dt),type:Ar("log"),base:Ft(bh,mh(t=>t!==1,"not equal to 1")),label:C0,crosshair:Ca(!0)},Er={...vn,...nl(Xt(dt,Aa),!0),type:Ar("time"),label:vh,parentLevel:sg,crosshair:Ca(!0,!0)},Rr={...vn,type:Ar("unit-time"),unit:Xt(tg,ig),label:vh,parentLevel:sg,paddingInner:Ui,paddingOuter:Ui,groupPaddingInner:Ui,crosshair:Ca(!0,!0),bandAlignment:Li("justify","start","center","end"),bandHighlight:Sh,skipNullBars:he,min:Ft(Xt(dt,Aa),bn("max")),max:Ft(Xt(dt,Aa),yn("min")),preferredMin:Ft(Xt(dt,Aa),bn("preferredMax"),bn("max")),preferredMax:Ft(Xt(dt,Aa),yn("preferredMin"),yn("min")),interval:N0};import{arrayOfDefs as Ih,boolean as PV,constant as al,number as ds,numberFormatValidator as k0,ratio as Hi,union as rl}from"ag-charts-core";var Pr={...vn,type:al("ordinal-time"),paddingInner:Hi,paddingOuter:Hi,groupPaddingInner:Hi,label:vh,parentLevel:sg,interval:N0,crosshair:Ca(!0,!0),bandHighlight:Sh,bandAlignment:rl("justify","start","center","end"),skipNullBars:PV},w0={...Lr,...nl(ds),type:al("angle-number"),crossLines:Ih(Fs),startAngle:ds,endAngle:ds,label:{...xn,orientation:rl("fixed","parallel","perpendicular"),format:k0}},ag={...Lr,type:al("angle-category"),shape:rl("polygon","circle"),crossLines:Ih(Fs),startAngle:ds,endAngle:ds,paddingInner:Hi,groupPaddingInner:Hi,label:{...xn,orientation:rl("fixed","parallel","perpendicular")}};ag.innerRadiusRatio=Hi;var O0={...Lr,...nl(ds),type:al("radius-number"),shape:rl("polygon","circle"),positionAngle:ds,innerRadiusRatio:Hi,title:ng,crossLines:Ih({...Fs,label:{...Tr,positionAngle:ds}},"cross-line options"),label:{...xn,format:k0}},E0={...Lr,type:al("radius-category"),positionAngle:ds,innerRadiusRatio:Hi,paddingInner:Hi,paddingOuter:Hi,groupPaddingInner:Hi,label:xn,title:ng,crossLines:Ih({...Fs,label:{...Tr,positionAngle:ds}},"cross-line options")};import{boolean as rg,callbackDefs as _V,commonSeriesOptionsDefs as FV,commonSeriesThemeableOptionsDefs as VV,constant as BV,fillOptionsDef as R0,interpolationOptionsDefs as zV,lineDashOptionsDef as P0,markerOptionsDefs as GV,markerStyleOptionsDefs as UV,multiSeriesHighlightOptionsDef as HV,number as jV,required as og,seriesLabelOptionsDefs as WV,shadowOptionsDefs as YV,shapeHighlightOptionsDef as _0,shapeSegmentation as $V,string as Vs,strokeOptionsDef as F0,tooltipOptionsDefsWithArea as KV,undocumented as ZV}from"ag-charts-core";var V0=HV(_0,_0),XV=_V({...F0,...R0,...P0,marker:UV}),B0={showInMiniChart:rg,connectMissingData:rg,interpolation:zV,label:WV,styler:XV,marker:GV,tooltip:KV,shadow:YV,...VV,...R0,...F0,...P0,highlight:V0,segmentation:$V},lg={...B0,...FV,highlight:V0,type:og(BV("area")),xKey:og(Vs),yKey:og(Vs),xKeyAxis:Vs,yKeyAxis:Vs,xName:Vs,yName:Vs,legendItemName:Vs,stacked:rg,stackGroup:Vs,normalizedTo:jV};lg.selectedKey=ZV(Vs);import{barHighlightOptionsDef as z0,boolean as _r,callback as qV,callbackDefs as JV,commonSeriesOptionsDefs as QV,commonSeriesThemeableOptionsDefs as eB,constant as tB,errorBarOptionsDefs as iB,errorBarThemeableOptionsDefs as sB,fillOptionsDef as G0,lineDashOptionsDef as U0,multiSeriesHighlightOptionsDef as nB,number as H0,positiveNumber as cg,positiveNumberNonZero as aB,ratio as rB,required as hg,seriesLabelOptionsDefs as oB,shadowOptionsDefs as lB,shapeSegmentation as cB,string as Bs,strokeOptionsDef as j0,tooltipOptionsDefs as hB,undocumented as ol,union as dg}from"ag-charts-core";var W0=nB(z0,z0),Y0=JV({...G0,...j0,...U0,cornerRadius:cg}),ug={direction:dg("horizontal","vertical"),showInMiniChart:_r,cornerRadius:cg,styler:Y0,itemStyler:Y0,crisp:_r,label:{...oB,placement:dg("inside-center","inside-start","inside-end","outside-start","outside-end"),spacing:cg},errorBar:sB,shadow:lB,tooltip:hB,...eB,highlight:W0,...G0,...j0,...U0,segmentation:cB,width:aB,widthRatio:rB};ug.sparklineMode=ol(_r);var Fr={...ug,...QV,highlight:W0,type:hg(tB("bar")),xKey:hg(Bs),yKey:hg(Bs),xKeyAxis:Bs,yKeyAxis:Bs,xName:Bs,yName:Bs,direction:dg("horizontal","vertical"),grouped:_r,stacked:_r,stackGroup:Bs,normalizedTo:H0,legendItemName:Bs,errorBar:iB};Fr.yFilterKey=ol(Bs),Fr.pickOutsideVisibleMinorAxis=ol(_r),Fr.focusPriority=ol(H0),Fr.simpleItemStyler=ol(qV);import{arrayOf as dB,boolean as uB,callbackDefs as pB,commonSeriesOptionsDefs as gB,commonSeriesThemeableOptionsDefs as fB,constant as mB,markerOptionsDefs as $0,multiSeriesHighlightOptionsDef as K0,number as Z0,positiveNumber as X0,required as Dh,seriesLabelOptionsDefs as yB,shapeHighlightOptionsDef as Mh,string as fi,tooltipOptionsDefs as bB,undocumented as xB,union as vB,without as SB}from"ag-charts-core";var q0={title:fi,domain:dB(Z0),maxSize:X0,showInMiniChart:uB,label:{placement:vB("top","right","bottom","left"),...yB},tooltip:bB,styler:pB({...$0,maxSize:X0}),maxRenderedItems:Z0,...fB,...SB($0,["enabled"]),highlight:K0(Mh,Mh)},J0={...q0,...gB,type:Dh(mB("bubble")),xKey:Dh(fi),yKey:Dh(fi),sizeKey:Dh(fi),labelKey:fi,xName:fi,yName:fi,sizeName:fi,labelName:fi,legendItemName:fi,xKeyAxis:fi,yKeyAxis:fi,highlight:K0(Mh,Mh)};J0.selectedKey=xB(fi);import{arrayOf as Q0,boolean as eS,commonSeriesOptionsDefs as IB,commonSeriesThemeableOptionsDefs as DB,constant as MB,fillOptionsDef as AB,lineDashOptionsDef as CB,multiSeriesHighlightOptionsDef as TB,number as LB,positiveNumber as tS,required as iS,seriesLabelOptionsDefs as NB,shadowOptionsDefs as kB,shapeHighlightOptionsDef as sS,string as Vr,strokeOptionsDef as wB,tooltipOptionsDefs as OB,union as EB}from"ag-charts-core";var nS={showInMiniChart:eS,cornerRadius:tS,label:NB,tooltip:OB,shadow:kB,...DB,...AB,...wB,...CB,highlight:TB(sS,sS),areaPlot:eS,aggregation:EB("count","sum","mean"),bins:Q0(Q0(LB)),binCount:tS},RB={...IB,...nS,type:iS(MB("histogram")),xKey:iS(Vr),yKey:Vr,xKeyAxis:Vr,yKeyAxis:Vr,xName:Vr,yName:Vr};import{boolean as ll,callbackDefs as PB,commonSeriesOptionsDefs as _B,commonSeriesThemeableOptionsDefs as FB,constant as VB,errorBarOptionsDefs as BB,errorBarThemeableOptionsDefs as zB,interpolationOptionsDefs as GB,lineDashOptionsDef as aS,lineHighlightOptionsDef as UB,lineSegmentation as HB,markerOptionsDefs as jB,markerStyleOptionsDefs as WB,multiSeriesHighlightOptionsDef as YB,number as rS,required as pg,seriesLabelOptionsDefs as $B,shapeHighlightOptionsDef as KB,string as us,strokeOptionsDef as oS,tooltipOptionsDefs as ZB,undocumented as Ah}from"ag-charts-core";var lS=YB(KB,UB),XB=PB({...oS,...aS,marker:WB}),gg={title:us,showInMiniChart:ll,connectMissingData:ll,interpolation:GB,label:$B,styler:XB,marker:jB,tooltip:ZB,errorBar:zB,...FB,...oS,...aS,highlight:lS,segmentation:HB};gg.sparklineMode=Ah(ll);var cl={...gg,..._B,highlight:lS,type:pg(VB("line")),xKey:pg(us),yKey:pg(us),xKeyAxis:us,yKeyAxis:us,xName:us,yName:us,stacked:ll,stackGroup:us,normalizedTo:rS,legendItemName:us,errorBar:BB};cl.selectedKey=Ah(us),cl.pickOutsideVisibleMinorAxis=Ah(ll),cl.focusPriority=Ah(rS);import{boolean as qB,callbackDefs as JB,commonSeriesOptionsDefs as QB,commonSeriesThemeableOptionsDefs as ez,constant as tz,errorBarOptionsDefs as iz,errorBarThemeableOptionsDefs as sz,markerOptionsDefs as cS,multiSeriesHighlightOptionsDef as hS,number as nz,required as fg,seriesLabelOptionsDefs as az,shapeHighlightOptionsDef as Ch,string as ji,tooltipOptionsDefs as rz,undocumented as oz,union as lz,without as cz}from"ag-charts-core";var dS={title:ji,showInMiniChart:qB,label:{placement:lz("top","right","bottom","left"),...az},tooltip:rz,errorBar:sz,styler:JB(cS),maxRenderedItems:nz,...ez,...cz(cS,["enabled"]),highlight:hS(Ch,Ch)},uS={...dS,...QB,type:fg(tz("scatter")),xKey:fg(ji),yKey:fg(ji),labelKey:ji,xName:ji,yName:ji,labelName:ji,legendItemName:ji,xKeyAxis:ji,yKeyAxis:ji,errorBar:iz,highlight:hS(Ch,Ch)};uS.selectedKey=oz(ji);import{arrayOfDefs as hz,constant as dz,fontOptionsDef as pS,labelBoxOptionsDef as gS,number as uz,positiveNumber as fS,ratio as mS,required as yS,string as mg,undocumented as pz}from"ag-charts-core";import{arrayOf as Br,boolean as Wi,callbackDefs as Th,callbackOf as bS,color as hl,colorUnion as gz,commonSeriesOptionsDefs as fz,commonSeriesThemeableOptionsDefs as mz,constant as yz,fillOptionsDef as xS,fontOptionsDef as dl,labelBoxOptionsDef as Lh,lineDashOptionsDef as vS,multiSeriesHighlightOptionsDef as bz,number as Nh,positiveNumber as Yi,ratio as SS,required as IS,shadowOptionsDefs as xz,shapeHighlightOptionsDef as DS,string as Bt,strokeOptionsDef as MS,textOrSegments as AS,tooltipOptionsDefs as vz,undocumented as Sn,without as CS}from"ag-charts-core";var TS=bz(DS,DS),yg={...mz,radiusMin:Yi,radiusMax:Yi,rotation:Nh,outerRadiusOffset:Nh,outerRadiusRatio:SS,hideZeroValueSectorsInLegend:Wi,sectorSpacing:Yi,cornerRadius:Yi,itemStyler:Th({...xS,...MS,...vS,cornerRadius:Yi}),title:{enabled:Wi,text:Bt,showInLegend:Wi,spacing:Yi,...dl},calloutLabel:{enabled:Wi,offset:Nh,minAngle:Yi,avoidCollisions:Wi,formatter:bS(AS),format:Bt,itemStyler:Th({enabled:Wi,...Lh,...dl}),...Lh,...dl},sectorLabel:{enabled:Wi,positionOffset:Nh,positionRatio:SS,formatter:bS(AS),format:Bt,itemStyler:Th({enabled:Wi,...Lh,...dl}),...Lh,...dl},calloutLine:{colors:Br(hl),length:Yi,strokeWidth:Yi,itemStyler:Th({color:hl,length:Yi,strokeWidth:Yi})},fills:Br(gz),strokes:Br(hl),tooltip:vz,shadow:xz,highlight:TS,...vS,...CS(xS,["fill"]),...CS(MS,["stroke"])},ps={...yg,...fz,type:IS(yz("pie")),angleKey:IS(Bt),radiusKey:Bt,calloutLabelKey:Bt,sectorLabelKey:Bt,legendItemKey:Bt,angleName:Bt,radiusName:Bt,calloutLabelName:Bt,sectorLabelName:Bt,highlight:TS};ps.angleFilterKey=Sn(Bt),ps.defaultColorRange=Sn(Br(Br(hl))),ps.defaultPatternFills=Sn(Br(hl)),ps.title._enabledFromTheme=Sn(Wi),ps.calloutLabel._enabledFromTheme=Sn(Wi),ps.sectorLabel._enabledFromTheme=Sn(Wi),ps.angleKeyAxis=Sn(Bt),ps.radiusKeyAxis=Sn(Bt);var LS={...yg,innerRadiusOffset:uz,innerRadiusRatio:mS,innerCircle:{fill:mg,fillOpacity:mS},innerLabels:{spacing:fS,...pS,...gS}},NS={...LS,...ps,type:yS(dz("donut")),innerLabels:hz({text:yS(mg),spacing:fS,...pS,...gS},"inner label options array")};NS.angleFilterKey=pz(mg);import{array as Sz,arrayOf as kS,arrayOfDefs as Iz,boolean as Q,color as wS,fillOptionsDef as $i,fontOptionsDef as zr,lineDashOptionsDef as bg,optionsDefs as OS,or as Dz,positiveNumber as ES,required as RS,string as PS,strokeOptionsDef as qt,toolbarButtonOptionsDefs as kh,undocumented as wh,union as gs}from"ag-charts-core";var Gr={lineStyle:gs("solid","dashed","dotted"),...bg},Ta={...$i,...qt,...bg},ul={visible:Q,locked:Q,readOnly:Q,handle:Ta,...zr},Oh={position:gs("top","center","bottom"),alignment:gs("left","center","right"),...zr},_S={position:gs("top","inside","bottom"),alignment:gs("left","center","right"),...zr},Mz={enabled:Q,cornerRadius:ES,...zr,...$i,...qt,...bg},Az={visible:Q,...Gr,...qt},FS={divider:qt,...$i,...qt,...zr},VS={handle:Ta,statistics:FS,...Gr,...$i,...qt},Eh={visible:Q,locked:Q,readOnly:Q,extendStart:Q,extendEnd:Q,handle:Ta,text:Oh,...Gr,...qt},xg={visible:Q,locked:Q,readOnly:Q,axisLabel:Mz,handle:Ta,text:Oh,...Gr,...qt},BS={visible:Q,locked:Q,readOnly:Q,extendStart:Q,extendEnd:Q,handle:Ta,text:_S,background:$i,...Gr,...qt},zS={...BS},GS={...BS,middle:Az},vg={label:zr,showFill:Q,isMultiColor:Q,strokes:kS(wS),rangeStroke:wS,bands:gs(4,6,10),...Eh},US={...$i,...qt,...ul},HS={...$i,...qt,...ul},jS={...$i,...qt,...ul,background:{...$i,...qt}},Sg={visible:Q,locked:Q,readOnly:Q,handle:Ta,...$i},Rh={visible:Q,locked:Q,readOnly:Q,extendStart:Q,extendEnd:Q,handle:Ta,text:Oh,background:$i,statistics:FS,...Gr,...qt},WS={visible:Q,up:VS,down:VS},Ur={enabled:Q,axesButtons:{enabled:Q,axes:gs("x","y","xy")},toolbar:{enabled:Q,padding:ES,buttons:Iz({...kh,value:gs("line-menu","fibonacci-menu","text-menu","shape-menu","measurer-menu","line","horizontal-line","vertical-line","parallel-channel","disjoint-channel","fibonacci-retracement","fibonacci-retracement-trend-based","text","comment","callout","note","clear")},"annotation toolbar buttons array")},optionsToolbar:{enabled:Q,buttons:kS(Dz(OS({...kh,value:RS(gs("line-stroke-width","line-style-type","line-color","fill-color","text-color","text-size","delete","settings"))}),OS({...kh,value:RS(gs("lock")),checkedOverrides:kh})))}};Ur.data=wh(Sz),Ur.xKey=wh(PS),Ur.volumeKey=wh(PS),Ur.snap=wh(Q);import{and as Cz,arrayOf as Ze,autoSizedLabelOptionsDefs as Ph,barHighlightOptionsDef as In,boolean as ut,callbackDefs as Xe,color as Ki,colorUnion as La,commonSeriesThemeableOptionsDefs as Ae,fillOptionsDef as K,highlightOptionsDef as Tz,interpolationOptionsDefs as Lz,lessThanOrEqual as Nz,lineDashOptionsDef as W,lineHighlightOptionsDef as Hr,markerOptionsDefs as _h,markerStyleOptionsDefs as Fh,multiSeriesHighlightOptionsDef as mi,numberFormatValidator as YS,positiveNumber as H,positiveNumberNonZero as Ig,ratio as yi,seriesLabelOptionsDefs as it,shadowOptionsDefs as pl,shapeHighlightOptionsDef as zs,shapeSegmentation as Dg,string as $S,strokeOptionsDef as B,tooltipOptionsDefs as Ce,union as oe,without as bi}from"ag-charts-core";var fs={...K,...B,opacity:yi},KS={...K,...B,...W,cornerRadius:H,whisker:{...B,...W},cap:{lengthRatio:yi}},ZS={...KS,opacity:yi},XS=Xe({...K,...B,...W,cornerRadius:H,whisker:{...B,...W},cap:{lengthRatio:yi}}),qS={direction:oe("horizontal","vertical"),showInMiniChart:ut,styler:XS,itemStyler:XS,tooltip:Ce,...Ae,...KS,highlight:mi(ZS,ZS),segmentation:Dg,width:Ig,widthRatio:yi},Mg={cornerRadius:H,wick:{...B,...W},...K,...B,...W},JS={...Mg,opacity:yi},QS={item:{up:Mg,down:Mg},itemStyler:Xe({...K,...B,...W,cornerRadius:H,wick:{...B,...W}}),showInMiniChart:ut,tooltip:Ce,...Ae,highlight:mi(JS,JS)},eI={fills:Ze(La),strokes:Ze(Ki),label:{spacing:H,maxWidth:H,...it},link:{tension:yi,itemStyler:Xe({...K,...B,...W,tension:yi}),...K,...B,...W},node:{width:H,spacing:H,itemStyler:Xe({...K,...B,...W}),...K,...B,...W},tooltip:Ce,...Ae},tI={direction:oe("horizontal","vertical"),fills:Ze(La),strokes:Ze(Ki),label:{spacing:H,placement:oe("before","middle","after"),...it},stageLabel:{placement:oe("before","after"),format:YS,...xn},tooltip:Ce,...bi(Ae,["showInLegend"]),...bi(K,["fill"]),...bi(B,["stroke"]),...W,highlight:Tz(Hr)},iI={direction:oe("horizontal","vertical"),fills:Ze(La),strokes:Ze(Ki),itemStyler:Xe({...K,...B,...W}),spacingRatio:yi,crisp:ut,dropOff:{enabled:ut,...K,...B,...W},stageLabel:{placement:oe("before","after"),format:YS,...xn},label:it,tooltip:Ce,shadow:pl,...bi(Ae,["showInLegend"]),...bi(K,["fill"]),...bi(B,["stroke"]),...W},sI={title:$S,textAlign:oe("left","center","right"),verticalAlign:oe("top","middle","bottom"),itemPadding:H,itemStyler:Xe({...K,...B}),showInMiniChart:ut,label:Ph,tooltip:Ce,...Ae,...B},nI={showInMiniChart:ut,itemStyler:Xe({...B,...W}),item:{up:{...B,...W},down:{...B,...W}},tooltip:Ce,...Ae,highlight:mi(Hr,Hr)},aI={maxStrokeWidth:H,itemStyler:Xe({...B,...W}),sizeDomain:Ze(H),label:it,tooltip:Ce,...Ae,...B,...W,highlight:mi(Hr,Hr)},rI={...B,...W},oI={colorRange:Ze(Ki),maxSize:H,sizeDomain:Ze(H),label:{placement:oe("top","bottom","left","right"),...it},tooltip:Ce,...Ae,...bi(_h,["enabled"]),highlight:mi(zs,zs)},lI={colorRange:Ze(Ki),padding:H,itemStyler:Xe({...K,...B,...W}),label:Ph,tooltip:Ce,...Ae,...K,...B,...W,highlight:mi(zs,zs)},cI={...Ae,...K,...B,...W},jr=Xe({...K,...B,...W,cornerRadius:H}),hI={cornerRadius:H,styler:jr,itemStyler:jr,label:it,tooltip:Ce,...Ae,...K,...B,...W,highlight:mi(In,In)},dI={direction:oe("horizontal","vertical"),aspectRatio:H,spacing:H,reverse:ut,itemStyler:Xe({...K,...B,...W}),fills:Ze(La),strokes:Ze(Ki),label:it,stageLabel:{spacing:H,placement:oe("before","after"),...it},tooltip:Ce,shadow:pl,...Ae,...bi(K,["fill"]),...bi(B,["stroke"]),...W},uI={connectMissingData:ut,marker:_h,styler:Xe({marker:Fh,...K,...B,...W}),label:it,tooltip:Ce,...Ae,...K,...B,...W,highlight:mi(zs,zs)},pI={connectMissingData:ut,marker:_h,styler:Xe({marker:Fh,...B,...W}),label:it,tooltip:Ce,...Ae,...B,...W,highlight:mi(zs,Hr)},gI={cornerRadius:H,styler:jr,itemStyler:jr,label:it,tooltip:Ce,...Ae,...K,...B,...W,highlight:mi(In,In)},fI={cornerRadius:H,columnWidthRatio:yi,maxColumnWidthRatio:yi,styler:jr,itemStyler:jr,label:it,tooltip:Ce,...Ae,...K,...B,...W,highlight:mi(In,In)},kz={marker:_h,...B,...W},mI={marker:{enabled:ut,...Fh},...B,...W},yI={marker:Fh,...B,...W},bI={showInMiniChart:ut,connectMissingData:ut,interpolation:Lz,label:{...it,placement:oe("inside","outside"),spacing:H},tooltip:Ce,shadow:pl,...Ae,...K,...kz,item:{low:{...mI},high:{...mI}},styler:Xe({...K,item:{low:{...yI},high:{...yI}}}),highlight:mi(zs,zs),segmentation:Dg,invertedStyle:{enabled:ut,...K}},xI=Xe({...K,...B,...W,cornerRadius:H}),vI={direction:oe("horizontal","vertical"),grouped:ut,showInMiniChart:ut,cornerRadius:H,styler:xI,itemStyler:xI,label:{...it,placement:oe("inside","outside"),spacing:H},tooltip:Ce,shadow:pl,...Ae,...K,...B,...W,highlight:mi(In,In),segmentation:Dg,width:Ig,widthRatio:yi},SI={fills:Ze(La),strokes:Ze(Ki),label:{...it,spacing:H,placement:oe("left","right","center"),edgePlacement:oe("inside","outside")},link:{itemStyler:Xe({...K,...B,...W}),...K,...B,...W},node:{width:H,spacing:H,minSpacing:Cz(H,Nz("spacing")),alignment:oe("left","center","right","justify"),verticalAlignment:oe("top","bottom","center"),sort:oe("data","ascending","descending","auto"),itemStyler:Xe({...K,...B,...W}),...K,...B,...W},tooltip:Ce,...Ae},II={fills:Ze(La),strokes:Ze(Ki),colorRange:Ze(Ki),sectorSpacing:H,cornerRadius:H,padding:H,itemStyler:Xe({...K,...B}),label:{spacing:H,...Ph},secondaryLabel:Ph,tooltip:Ce,...bi(Ae,["highlight","showInLegend"]),...bi(K,["fill"]),...bi(B,["stroke"]),highlight:{highlightedItem:fs,highlightedBranch:fs,unhighlightedItem:fs,unhighlightedBranch:fs}},DI={fills:Ze(La),strokes:Ze(Ki),colorRange:Ze(Ki),itemStyler:Xe({...K,...B}),group:{gap:H,padding:H,cornerRadius:H,textAlign:oe("left","center","right"),interactive:ut,highlight:{highlightedItem:fs,unhighlightedItem:fs},label:{...it,spacing:H},...K,...B},tile:{gap:H,padding:H,cornerRadius:H,textAlign:oe("left","center","right"),verticalAlign:oe("top","middle","bottom"),label:{...it,spacing:H,lineHeight:H,minimumFontSize:H,wrapping:oe("never","always","hyphenate","on-space"),overflowStrategy:oe("ellipsis","hide")},secondaryLabel:{...it,lineHeight:H,minimumFontSize:H,wrapping:oe("never","always","hyphenate","on-space"),overflowStrategy:oe("ellipsis","hide")},highlight:{highlightedItem:fs,highlightedBranch:fs,unhighlightedItem:fs,unhighlightedBranch:fs},...K,...B},tooltip:Ce,...bi(Ae,["highlight","showInLegend"])},Ag={name:$S,cornerRadius:H,itemStyler:Xe({...K,...B,...W,cornerRadius:H}),label:{...it,placement:oe("inside-start","inside-center","inside-end","outside-start","outside-end"),spacing:H},tooltip:Ce,shadow:pl,...K,...B,...W},MI={direction:oe("horizontal","vertical"),showInMiniChart:ut,item:{positive:Ag,negative:Ag,total:Ag},line:{enabled:ut,...B,...W},tooltip:Ce,width:Ig,widthRatio:yi,...Ae},Vh=y0({__type:AV(p0("date")),value:Ma(fh,_s)},"a serializable date object"),AI={width:$e,height:$e,grip:gi,fill:gh,stroke:gh,strokeWidth:$e,cornerRadius:$e},te={enabled:gi,height:$e,spacing:$e,cornerRadius:_s,mask:{fill:gh,fillOpacity:Ir,stroke:gh,strokeWidth:$e},minHandle:AI,maxHandle:AI,miniChart:{enabled:gi,padding:{top:$e,bottom:$e},label:{enabled:gi,avoidCollisions:gi,spacing:$e,format:DV,formatter:yV(CV),interval:{minSpacing:$e,maxSpacing:$e,values:gV,step:_s},...xV},series:bV}},Cg={...g0,...x0,...SV,cornerRadius:$e,opacity:Ir},CI={...Cg,minSize:$e,hoverStyle:{fill:g0.fill,stroke:x0.stroke}},TI={enabled:gi,thickness:$e,spacing:$e,tickSpacing:$e,visible:Dr("auto","always","never"),placement:Dr("outer","inner"),track:Cg,thumb:CI},wz={...TI,position:Dr("top","bottom")},Oz={...TI,position:Dr("left","right")},kt={enabled:gi,enableAxisScrolling:gi,enableSeriesAreaScrolling:gi,thickness:$e,spacing:$e,tickSpacing:$e,visible:Dr("auto","always","never"),placement:Dr("outer","inner"),track:Cg,thumb:CI,horizontal:wz,vertical:Oz},Na=j(A0,["type","value","range"]),wt={number:{...j(wr,["type","crossLines"]),top:j(wr,["type","crossLines","position"]),right:j(wr,["type","crossLines","position"]),bottom:j(wr,["type","crossLines","position"]),left:j(wr,["type","crossLines","position"]),crossLines:Na},log:{...j(Or,["type","crossLines"]),top:j(Or,["type","crossLines","position"]),right:j(Or,["type","crossLines","position"]),bottom:j(Or,["type","crossLines","position"]),left:j(Or,["type","crossLines","position"]),crossLines:Na},category:{...j(Nr,["type","crossLines"]),top:j(Nr,["type","crossLines","position"]),right:j(Nr,["type","crossLines","position"]),bottom:j(Nr,["type","crossLines","position"]),left:j(Nr,["type","crossLines","position"]),crossLines:Na},time:{...j(Er,["type","crossLines"]),top:j(Er,["type","crossLines","position"]),right:j(Er,["type","crossLines","position"]),bottom:j(Er,["type","crossLines","position"]),left:j(Er,["type","crossLines","position"]),crossLines:Na},"unit-time":{...j(Rr,["type","crossLines"]),top:j(Rr,["type","crossLines","position"]),right:j(Rr,["type","crossLines","position"]),bottom:j(Rr,["type","crossLines","position"]),left:j(Rr,["type","crossLines","position"]),crossLines:Na},"grouped-category":{...j(kr,["type"]),top:j(kr,["type","position"]),right:j(kr,["type","position"]),bottom:j(kr,["type","position"]),left:j(kr,["type","position"]),crossLines:Na},"ordinal-time":{...j(Pr,["type","crossLines"]),top:j(Pr,["type","crossLines","position"]),right:j(Pr,["type","crossLines","position"]),bottom:j(Pr,["type","crossLines","position"]),left:j(Pr,["type","crossLines","position"]),crossLines:Na}},Wr={"angle-category":{...j(ag,["type","crossLines"]),crossLines:j(Fs,["type"])},"angle-number":{...j(w0,["type","crossLines"]),crossLines:j(Fs,["type"])},"radius-category":{...j(E0,["type","crossLines"]),crossLines:{...j(Fs,["type"]),label:{...Tr,positionAngle:_s}}},"radius-number":{...j(O0,["type","crossLines"]),crossLines:{...j(Fs,["type"]),label:{...Tr,positionAngle:_s}}}},ie={visible:S0(gi)},Ez={common:{...J,navigator:te,scrollbar:kt,axes:{...wt,...Wr},annotations:{...Ur,line:Eh,"horizontal-line":xg,"vertical-line":xg,"disjoint-channel":zS,"parallel-channel":GS,"fibonacci-retracement":vg,"fibonacci-retracement-trend-based":vg,callout:US,comment:HS,note:jS,text:ul,arrow:Eh,"arrow-up":Sg,"arrow-down":Sg,"date-range":Rh,"price-range":Rh,"date-price-range":Rh,"quick-date-price-range":WS},chartToolbar:{enabled:gi},initialState:{legend:mV({visible:gi,seriesId:fh,itemId:fh,legendItemName:fh},"legend state array"),zoom:{rangeX:{start:Ma(_s,Vh),end:Ma(_s,Vh)},rangeY:{start:Ma(_s,Vh),end:Ma(_s,Vh)},ratioX:{start:Ir,end:Ir},ratioY:{start:Ir,end:Ir},autoScaledAxes:fV(p0("y"))}}},line:{...J,axes:wt,series:gg,navigator:te,scrollbar:kt,...ie},scatter:{...J,axes:wt,series:dS,navigator:te,scrollbar:kt,...ie,paired:S0(gi)},bubble:{...J,axes:wt,series:q0,navigator:te,scrollbar:kt,...ie},area:{...J,axes:wt,series:B0,navigator:te,scrollbar:kt,...ie},bar:{...J,axes:wt,series:ug,navigator:te,scrollbar:kt,...ie},"box-plot":{...J,axes:wt,series:qS,navigator:te,scrollbar:kt,...ie},candlestick:{...J,axes:wt,series:QS,navigator:te,scrollbar:kt,...ie},"cone-funnel":{...J,axes:wt,series:tI,navigator:te,scrollbar:kt,...ie},funnel:{...J,axes:wt,series:iI,navigator:te,scrollbar:kt,...ie},ohlc:{...J,axes:wt,series:nI,navigator:te,scrollbar:kt,...ie},histogram:{...J,axes:j(wt,["category","grouped-category","unit-time","ordinal-time"]),series:nS,navigator:te,scrollbar:kt,...ie},heatmap:{...J,axes:wt,series:sI,navigator:te,scrollbar:kt,...ie},waterfall:{...J,axes:wt,series:MI,navigator:te,scrollbar:kt,...ie},"range-bar":{...J,axes:wt,series:vI,navigator:te,scrollbar:kt,...ie},"range-area":{...J,axes:wt,series:bI,navigator:te,scrollbar:kt,...ie},donut:{...J,series:LS,navigator:te,...ie},pie:{...J,series:yg,navigator:te,...ie},"radar-line":{...J,axes:Wr,series:pI,navigator:te,...ie},"radar-area":{...J,axes:Wr,series:uI,navigator:te,...ie},"radial-bar":{...J,axes:Wr,series:gI,navigator:te,...ie},"radial-column":{...J,axes:Wr,series:fI,navigator:te,...ie},nightingale:{...J,axes:Wr,series:hI,navigator:te,...ie},sunburst:{...J,series:II,navigator:te,...ie},treemap:{...J,series:DI,navigator:te,...ie},"map-shape":{...J,series:lI,navigator:te,...ie},"map-line":{...J,series:aI,navigator:te,...ie},"map-marker":{...J,series:oI,navigator:te,...ie},"map-shape-background":{...J,series:cI,navigator:te,...ie},"map-line-background":{...J,series:rI,navigator:te,...ie},sankey:{...J,series:SI,navigator:te,...ie},chord:{...J,series:eI,navigator:te,...ie},pyramid:{...J,series:dI,navigator:te,...ie},"radial-gauge":{...J,...b0,targets:j(MV,["value"]),tooltip:{...b0.tooltip,...J.tooltip}},"linear-gauge":{...J,...m0,targets:j(IV,["value"]),tooltip:{...m0.tooltip,...J.tooltip}}};function Bh(t,e){const i={};for(const s of Reflect.ownKeys(t))i[s]=e(t[s],s,t);return i}var Rz=Bh(Ez,function t(e,i){if(Kp(i))return e;if(vV(e))return Ma(e,v0,Kp);if(f0(e))return Ma(y0(TV in e?Bh(e,s=>f0(s)?Bh(s,t):s):Bh(e,t)),v0,Kp);throw new Error(`Invalid theme override value: ${String(e)}`)});import{DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL as Pz,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR as _z,getSequentialColors as Fz}from"ag-charts-core";var St={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},ka={BLUE:"#67b7ff",ORANGE:"#ffc24d",GREEN:"#5cc86f",CYAN:"#54ebff",VIOLET:"#fff653",YELLOW:"#c18aff",GRAY:"#aeaeae",MAGENTA:"#f078d4",BROWN:"#ba8438",RED:"#ff726e"},Vz=class extends Sr{getDefaultColors(){return{fills:St,fillsFallback:Object.values(St),strokes:ka,sequentialColors:Fz(St),divergingColors:[St.ORANGE,St.YELLOW,St.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#0076e6","#0069cc","#005cb3","#004f99","#004280","#003466","#00274c"],secondDivergingColors:[St.GREEN,St.YELLOW,St.RED],secondHierarchyColors:[],up:{fill:St.GREEN,stroke:ka.GREEN},down:{fill:St.RED,stroke:ka.RED},neutral:{fill:St.GRAY,stroke:ka.GRAY},altUp:{fill:St.BLUE,stroke:ka.BLUE},altDown:{fill:St.ORANGE,stroke:ka.ORANGE},altNeutral:{fill:St.GRAY,stroke:ka.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(_z,St.BLUE),t.set(Pz,St.BLUE),t}};import{DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL as Bz,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR as zz,getSequentialColors as Gz}from"ag-charts-core";var It={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},wa={BLUE:"#0f68c0",ORANGE:"#d47100",GREEN:"#007922",CYAN:"#009ac2",VIOLET:"#bca400",YELLOW:"#753cac",GRAY:"#646464",MAGENTA:"#9b2685",BROWN:"#6c3b00",RED:"#cb0021"},Uz=class extends Gi{getDefaultColors(){return{...super.getDefaultColors(),fills:It,fillsFallback:Object.values(It),strokes:wa,sequentialColors:Gz(It),divergingColors:[It.ORANGE,It.YELLOW,It.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#1a8fff","#339cff","#4da8ff","#66b5ff","#80c1ff","#99cdff","#b3daff"],secondDivergingColors:[It.GREEN,It.YELLOW,It.RED],secondHierarchyColors:[],up:{fill:It.GREEN,stroke:wa.GREEN},down:{fill:It.RED,stroke:wa.RED},neutral:{fill:It.GRAY,stroke:wa.GRAY},altUp:{fill:It.BLUE,stroke:wa.BLUE},altDown:{fill:It.ORANGE,stroke:wa.ORANGE},altNeutral:{fill:It.GRAY,stroke:wa.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(zz,It.BLUE),t.set(Bz,It.BLUE),t}},Tg=pi(()=>new Gi),Hz=uF.create(!0,"perf"),Zi=(t,e,i)=>{Hz("[CACHE] ChartTheme",t,e.name,i)},Lg={"ag-default-dark":pi(()=>new Sr),"ag-sheets-dark":pi(()=>new cV,Zi),"ag-polychroma-dark":pi(()=>new tV,Zi),"ag-vivid-dark":pi(()=>new Vz,Zi),"ag-material-dark":pi(()=>new $F,Zi),"ag-financial-dark":pi(()=>new _F,Zi),"ag-default":Tg,"ag-sheets":pi(()=>new pV,Zi),"ag-polychroma":pi(()=>new aV,Zi),"ag-vivid":pi(()=>new Uz,Zi),"ag-material":pi(()=>new qF,Zi),"ag-financial":pi(()=>new HF,Zi)},zh=pi(jz,Zi);function jz(t){if(t instanceof Gi)return t;if(!Kz(t))return Tg();if(t==null||typeof t=="string"){const n=Lg[t??"ag-default"];if(n)return n();throw new Error(`Cannot find theme \`${t}\`.`)}const{cleared:e,invalid:i}=u0(Wz(t),Yz,"theme");for(const n of i)o0.warnOnce(String(n));const s=e?.baseTheme?zh(e.baseTheme):Tg();return e?new s.constructor(e):s}function Wz(t){if(!h0(t)||!h0(t.baseTheme))return t;let e=t,i,s;const n=[];for(;typeof e=="object";)i??(i=e.palette),s??(s=e.params),e.overrides&&n.push(e.overrides),e=e.baseTheme;return{baseTheme:e,overrides:gF(...n),params:s,palette:i}}var Yz={baseTheme:il(Yp,d0),overrides:Rz,params:{accentColor:ee,axisColor:ee,backgroundColor:ee,borderColor:ee,borderRadius:ph,chartBackgroundColor:ee,chartPadding:ph,focusShadow:Yp,foregroundColor:ee,fontFamily:c0,fontSize:ph,fontWeight:jp,gridLineColor:ee,popupShadow:Yp,subtleTextColor:ee,textColor:ee,separationLinesColor:ee,chromeBackgroundColor:ee,chromeFontFamily:c0,chromeFontSize:ph,chromeFontWeight:jp,chromeSubtleTextColor:ee,chromeTextColor:ee,buttonBackgroundColor:ee,buttonBorder:uh,buttonFontWeight:jp,buttonTextColor:ee,inputBackgroundColor:ee,inputBorder:uh,inputTextColor:ee,menuBackgroundColor:ee,menuBorder:uh,menuTextColor:ee,panelBackgroundColor:ee,panelSubtleTextColor:ee,tooltipBackgroundColor:ee,tooltipBorder:uh,tooltipTextColor:ee,tooltipSubtleTextColor:ee,crosshairLabelBackgroundColor:ee,crosshairLabelTextColor:ee},palette:{fills:l0(pF),strokes:l0(ee),up:{fill:il(ee,Wp),stroke:ee},down:{fill:il(ee,Wp),stroke:ee},neutral:{fill:il(ee,Wp),stroke:ee}}},$z=fF("ag-default","ag-default-dark","ag-sheets","ag-sheets-dark","ag-polychroma","ag-polychroma-dark","ag-vivid","ag-vivid-dark","ag-material","ag-material-dark","ag-financial","ag-financial-dark");function Kz(t){const{invalid:e}=u0({theme:t},{theme:il($z,d0)});for(const i of e)o0.warnOnce(String(i));return e.length===0}import{AdjacencyListGraph as Zz,Debug as Xz,ModuleRegistry as qz,isObject as gl,isObjectLike as LI,isPlainObject as Jz,pick as Ng,simpleMemorize as Qz,without as Oa}from"ag-charts-core";import{Color as xi,Debug as Ea,Logger as Ra,ModuleRegistry as eG,circularSliceArray as ms,isArray as tG,isGradientFill as NI,isImageFill as iG,isNumber as sG,isObjectLike as nG,isPatternFill as aG,isPlainObject as fl,isString as Yr,without as rG}from"ag-charts-core";import{isNumber as oG,isObjectLike as lG}from"ag-charts-core";var be="path",Ni="pathArray",ge="default",Jt="override",Dt="user",Dn="userPartial",ys="operation",bs="operationValue",$r="dependency",kg="autoEnable",kI="autoEnableValue",wI="prune",OI="childrenSource";function wg(t){return oG(t)&&t>=0&&t<=1}function ml(t,e){let i=t;for(const s of e){if(!(typeof s=="string"&&i!=null&&(typeof i=="object"||Array.isArray(i))&&s in i))return!1;i=i[s]}return!0}function pt(t,e){let i=t;for(const s of e){if(!(typeof s=="string"&&i!=null&&(typeof i=="object"||Array.isArray(i))&&s in i))return;i=i[s]}return i}function Kr(t,e,i){const s=e.length;if(s===0)return;let n=t;const a=s-1,r=e[a];for(let o=0;o=0;s--){const n=t[s];if(cG.test(n)&&(i++,i>e))return s}return-1}function Zr(t,e=0){const i=hG(t,e);return Number(t[i])}function Pa(t,e,i){const s=e.split("/");let n=[...t];e.startsWith("/")&&(n=[],s.shift());let a=!1;for(const r of s){if(r==="..")n.pop(),a||n.pop();else if(r===".")n.pop();else if(r==="$index"){const o=Zr(t);if(Number.isNaN(o))return xs;n.push(`${o}`)}else if(r==="$prevIndex"){const o=Zr(t);if(Number.isNaN(o)||Number(o)<=0)return xs;n.push(`${Number(o)-1}`)}else if(r.startsWith("$")){const o=i?.[r.slice(1)];if(o==null)return xs;n.push(o)}else r.length!==0&&n.push(r);a=r===".."}return n}var xs=Symbol("unresolvable-path"),Qt=Symbol("resolved-to-branch");function yl(t,e){if(t==null||typeof t!="object"||Array.isArray(t)||(e??(e=Object.keys(t)),e.length===0))return;const i=e[0];if(_I.has(i))return{operation:i,values:Array.isArray(t[i])?t[i]:[t[i]]}}function dG(t,e,i){const s=yl(t.getVertexValue(i));switch(s?.operation){case"$path":{const[n]=s.values,a=t.getPathArray(e),r=Pa(a,n);return r===xs?void 0:t.findVertexAtPath(r)}case"$value":return e}}var uG={$cacheMax:pG};function pG(t,e,i){const[s]=i,n=t.getPathArray(e),a=t.getCachedValue(n,"$cacheMax"),r=t.resolveVertexValue(e,s);if(typeof r!="number")return a;if(typeof a!="number")return t.setCachedValue(n,"$cacheMax",r),r;const o=Math.max(a,r);return t.setCachedValue(n,"$cacheMax",o),o}var gG={$hasSeriesType:{dependencies:Og,resolve:fG},$isChartType:{dependencies:Og,resolve:yG},$isSeriesType:{dependencies:Og,resolve:mG}};function Og(t,e,i){const s=t.findVertexAtPath(["series","0","type"]);s&&t.addEdge(e,s,$r)}function fG(t,e,i){const[s]=i,n=t.resolveVertexValue(e,s),a=t.getResolvedPath(["series"]);if(!Array.isArray(a))return!1;for(const r of a)if(r.type===n)return!0;return!1}function mG(t,e,i){const[s]=i,n=t.resolveVertexValue(e,s);return t.getResolvedPath(["series","0","type"])===n}function yG(t,e,i){const[s]=i,n=t.resolveVertexValue(e,s),a=t.getResolvedPath(["series","0","type"]);if(typeof a!="string")return!1;const r=eG.getSeriesModule(a);if(r==null)return!1;switch(n){case"cartesian":return r.chartType==="cartesian";case"polar":return r.chartType==="polar";case"standalone":return r.chartType==="standalone"}return!1}var bG={$foregroundBackgroundMix:xG,$foregroundOpacity:vG,$interpolate:SG,$isGradient:IG,$isImage:DG,$isPattern:MG,$mix:AG};function xG(t,e,i){const[s]=i,n=t.resolveVertexValue(e,s),a=t.getParamValue("foregroundColor"),r=t.getParamValue("backgroundColor");if(typeof a=="string"&&typeof r=="string"&&wg(n))return xi.mix(xi.fromString(a),xi.fromString(r),1-n).toString();Ea.inDevelopmentMode(()=>Ra.warnOnce(`\`$foregroundBackgroundMix\` json operation failed on [${String(n)}}}] at [${t.getPathArray(e).join(".")}], expecting a number between 0 and 1.`))}function vG(t,e,i){const[s]=i,n=t.resolveVertexValue(e,s),a=t.getParamValue("foregroundColor");if(typeof a=="string"&&wg(n)){const r=xi.fromString(a);return new xi(r.r,r.g,r.b,n).toString()}Ea.inDevelopmentMode(()=>Ra.warnOnce(`\`$foregroundOpacity\` json operation failed on [${String(n)}}}] at [${t.getPathArray(e).join(".")}], expecting a number between 0 and 1.`))}function SG(t,e,i){const[s,n]=i,a=t.resolveVertexValue(e,s),r=t.resolveVertexValue(e,n);if(!(!tG(a)||!sG(r)))return xi.interpolate(a.map(o=>xi.fromString(o)),r).map(o=>o.toString())}function IG(t,e,i){const[s]=i,n=t.resolveVertexValue(e,s);return NI(n)}function DG(t,e,i){const[s]=i,n=t.resolveVertexValue(e,s);return iG(n)}function MG(t,e,i){const[s]=i,n=t.resolveVertexValue(e,s);return aG(n)}function AG(t,e,i){const[s,n,a]=i,r=t.resolveVertexValue(e,s),o=t.resolveVertexValue(e,n),l=t.resolveVertexValue(e,a),c=t.getPathArray(e),h=`\`$mix\` json operation failed on [${String(r)}, ${String(o)}, ${String(l)}] at [${c.join(".")}], expecting`,d=`${h} two colors and a number between 0 and 1.`;if(typeof o!="string"||!wg(l)){Ea.inDevelopmentMode(()=>Ra.warnOnce(d));return}if(typeof r=="string")try{return xi.mix(xi.fromString(r),xi.fromString(o),l).toString()}catch{Ea.inDevelopmentMode(()=>Ra.warnOnce(d));return}if(!NI(r)){Ea.inDevelopmentMode(()=>Ra.warnOnce(d));return}let u=r.colorStops;try{u=u?.map(p=>{let g;return typeof p.color=="string"&&(g=xi.mix(xi.fromString(p.color),xi.fromString(o),l).toString()),{...p,color:g}})}catch{Ea.inDevelopmentMode(()=>Ra.warnOnce(`${h} a gradient, a color and a number between 0 and 1.`));return}return{...r,colorStops:u}}var CG={$rem:TG};function TG(t,e,i){const[s,n]=i,a=t.getVertexValue(s),r=n?t.getVertexValue(n):"fontSize",o=t.getParamValue(r);if(typeof o=="number"&&typeof a=="number")return Math.round(a*o);Ea.inDevelopmentMode(()=>Ra.warnOnce(`\`$rem\` json operation failed on [${String(a)}] at [${t.getPathArray(e).join(".")}], expecting a number.`))}var LG={$and:NG,$eq:kG,$every:wG,$greaterThan:OG,$if:EG,$lessThan:RG,$not:PG,$or:_G,$some:FG,$switch:VG};function NG(t,e,i){for(const s of i){const n=t.resolveVertexValue(e,s);if(i.length===1&&Array.isArray(n))return n.every(a=>!!a);if(!n)return!1}return!0}function kG(t,e,i){let s,n=!0;for(const a of i){const r=t.resolveVertexValue(e,a);if(n)s=r,n=!1;else if(r!==s)return!1}return!0}function wG(t,e,i){const[s,n]=i,a=t.getVertexValue(s),r=t.resolveVertexValue(e,n);if(!Array.isArray(r))return;let o=0;for(const l of r){if(!t.graftAndResolveOrphanValue(e,`${o}`,a,l))return!1;o++}return!0}function OG(t,e,i){const[s,n]=i;return t.resolveVertexValue(e,s)>t.resolveVertexValue(e,n)}function EG(t,e,i){const[s,n,a]=i,o=t.resolveVertexValue(e,s)?n:a,l=t.neighboursWithEdgeValue(o,be);if(l)for(const c of l)t.addEdge(e,c,be);return t.resolveVertexValue(e,o)}function RG(t,e,i){const[s,n]=i;return t.resolveVertexValue(e,s)!!a);if(n)return!0}return!1}function FG(t,e,i){const[s,n]=i,a=t.getVertexValue(s),r=t.resolveVertexValue(e,n);if(!Array.isArray(r))return;let o=0;for(const l of r){if(t.graftAndResolveOrphanValue(e,`${o}`,a,l))return!0;o++}return!1}function VG(t,e,i){const[s,n,...a]=i,r=t.resolveVertexValue(e,s);for(const o of a){const l=t.getVertexValue(o);if(!Array.isArray(l))continue;const[c,h]=l;if(r===c||Array.isArray(c)&&c.includes(r))return h}return t.resolveVertexValue(e,n)}var BG={$isUserOption:zG,$palette:GG,$mapPalette:UG,$path:{dependencies:PI,resolve:HG},$pathString:{dependencies:PI,resolve:jG},$ref:WG};function zG(t,e,i){const[s,n,a]=i,r=t.neighboursWithEdgeValue(s,be);if(r)for(const o of r){const l=t.findNeighbour(o,ge);if(l&&EI(t,e,l))return t.resolveVertexValue(e,n)}else if(EI(t,e,s))return t.resolveVertexValue(e,n);return t.resolveVertexValue(e,a)}function EI(t,e,i){const s=t.resolveVertexValue(e,i);if(!Yr(s))throw new Error(`\`$isUserOption\` json operation failed on [${String(s)}], expecting a string.`);const n=t.getPathArray(e),a=Pa(n,s);return a===xs?!1:t.hasUserOption(a)}var RI=new Set(["fill","fillFallback","stroke","gradient","range2"]);function GG(t,e,i){const[s]=i,n=t.resolveVertexValue(e,s);if(!Yr(n))return;if(RI.has(n)){const r=t.getPathArray(e),o=Zr(r);if(Number.isNaN(o))return;switch(n){case"fill":return ms(t.palette.fills,1,o)[0];case"fillFallback":return ms(t.palette.fillsFallback,1,o)[0];case"stroke":return ms(t.palette.strokes,1,o)[0];case"gradient":return ms(t.palette.sequentialColors,1,o)[0];case"range2":return ms(t.palette.fills,2,o)}return}if(n==="gradients")return t.palette.sequentialColors;if(n==="type")return t.paletteType;const a=pt(t.palette,n.split("."));return Array.isArray(a)?[...a]:typeof a=="object"?{...a}:a}function UG(t,e,i){const[s]=i,n=t.resolveVertexValue(e,s);if(!Yr(n))return;if(RI.has(n)){const r=t.getPathArray(e);let o=Zr(r),l=0;const c=["series","0","type"];for(let h=0;h1,n=i.length>2,[a,r,o]=i,l=t.resolveVertexValue(e,a),c=n?t.resolveVertexValue(e,o):null;if(!Yr(l))throw new Error(`\`$path\` json operation failed on [${String(l)}], expecting a string.`);const h=t.getPathArray(e),d=Pa(h,l);if(d===xs)return;const u=c?pt(c,d):t.getResolvedPath(d);if(u!=null)return u;if(s)return t.resolveVertexValue(e,r)}function jG(t,e,i){const[s,n]=i,a=t.resolveVertexValue(e,s);if(!Yr(a))throw new Error(`\`$path\` json operation failed on [${String(a)}], expecting a string.`);let r;n&&(r=t.graftAndResolveOrphan(e,n));const o=t.getPathArray(e),l=Pa(o,a,r);if(l===xs)throw new Error(`Unresolvable path [${a}] at [${o.join(".")}]`);return l}function WG(t,e,i){const[s]=i,n=t.getVertexValue(s);return t.getParamValue(n)}var YG={$apply:$G,$applyCycle:KG,$applySwitch:ZG,$applyTheme:XG,$clone:qG,$findFirstSiblingNotOperation:JG,$map:QG,$merge:eU,$omit:tU,$size:iU,$shallow:nU,$shallowSimple:sU,$value:aU};function $G(t,e,i){const[s,n,a,r]=i,o=t.getVertexValue(s);if(!fl(o))return;const l=n?t.getVertexValue(n):void 0,c=t.neighboursWithEdgeValue(e,be),h=c&&c.length>0;if(!h&&l==null)return Qt;const d=a?t.resolveVertexValue(e,a):void 0,u=r?t.resolveVertexValue(e,r):void 0;if(!h&&l!=null)if(yl(l)){const p=t.resolveVertexValue(e,n);fl(p)&&t.graftObject(e,p,[d,u])}else t.graftObject(e,l,[d,u]);if(!h)return Qt;for(const p of c){const g=t.neighboursWithEdgeValue(p,be);if(!g||g.length===0){const f=t.addVertex({});t.addEdge(p,f,ge)}else t.graftObject(p,o,[d,u])}return Qt}function KG(t,e,i){const[s,n,a]=i,r=t.resolveVertexValue(e,s);if(typeof r!="number")return;const o=t.getPathArray(e),l=t.dangerouslyGetUserOption(o),c=t.hasThemeOverride(o),h=l==null?void 0:Dt,d=l??t.resolveVertexValue(e,n);if(!Array.isArray(d))return;const u=a?t.getVertexValue(a):void 0;for(let p=0;p0)return;let l=0;for(const c of r)t.graftValue(e,`${l}`,a,c),l++;return Qt}function eU(t,e,i){for(const s of i){const n=t.resolveVertexValue(e,s);fl(n)&&t.graftObject(e,n)}return Qt}function tU(t,e,i){const[s,n]=i;let a=t.getVertexValue(s);if(!Array.isArray(a)){const o=dG(t,e,n);if(!o)return;a=t.resolveVertexValue(o,s)}const r=t.resolveVertexValue(e,n);if(!(!Array.isArray(a)||!fl(r)))return rG(r,a)}function iU(t,e,i){const[s]=i,n=t.resolveVertexValue(e,s);return nG(n)?"length"in n?n.length:Object.keys(n).length:0}function sU(t,e,i){const s=[];for(const n of i)s.push(t.getVertexValue(n));return s}function nU(t,e,i){const s=t.getPathArray(e),n=t.hasUserOption(s);if(!n&&i.length===1)return t.resolveVertexValue(e,i[0]);const a=[];for(const r of i)a.push(t.getVertexValue(r));return n?(t.prune(e,[Jt,ge]),Qt):(t.graftObject(e,a),Qt)}function aU(t,e,i){const[s]=i,n=t.getVertexValue(s),a=t.getPathArray(e);if(n==="$index")return Zr(a);if(n==="$parentIndex")return Zr(a,1);if(n==="$1")return t.resolveValue$1(a)}var rU={$isEven:oU};function oU(t,e,i){const[s]=i,n=t.resolveVertexValue(e,s);return Number.isNaN(Number(n))?!1:Number(n)%2===0}var bl={...uG,...gG,...bG,...CG,...BG,...LG,...rU,...YG},_I=new Set(Object.keys(bl));function xl(t){return _I.has(t)}var le=Xz.create("opts","options-graph"),lU=Qz(cU);function cU(t,e){return le.group("OptionsGraph.constructor()",()=>{const i=new FI(t.config,e,t.params,t.palette,t.overrides,t.getTemplateParameters());return{resolve(){return i.resolve()},resolveParams(){return i.resolveParams()},resolveAnnotationThemes(){return i.resolveAnnotationThemes()},resolvePartial(s,n,a){return i.resolvePartial(s,n,a)},clearSafe(){return i.clearSafe()}}})}var Mn=class ft extends Zz{constructor(e={},i={},s=void 0,n={},a=void 0,r=new Map){super(be,ys,new Set([Dn,Dt])),this.config=e,this.userOptions=i,this.palette=n,this.overrides=a,this.internalParams=r,this.edgePriority=[...ft.EDGE_PRIORITY],this.graftEdge=ft.GRAFT_EDGE,this.resolvedParams={},this.resolvedAnnotations={},this.value$1=new Map,this.cachedPathVertices=new Map,this.hasUnsafeClearKeys=!1,this.rollbackVertices=[],this.rollbackEdgesFrom=[],this.rollbackEdgesTo=[],this.rollbackEdgesValue=[],this.isRollingBack=!1,this.resolvedRootAncestorsPaths=new Set,this.EMPTY_PATH_ARRAY_VERTEX=this.addVertex([]),this.root=this.addVertex("root"),this.params=this.addVertex("params"),this.annotations=this.addVertex("annotations"),this.paletteType=gl(i?.theme)?s0(i.theme?.palette):"inbuilt";const o=i.series?.[0]?.type??"line";le("build user"),this.buildGraphFromObject(this.root,Dt,Oa(i,["theme"])),le("build defaults"),this.buildGraphFromObject(this.root,ge,Oa(e[o],ft.COMPLEX_KEYS));const l=a?Oa(a[o],ft.COMPLEX_KEYS):{};Object.keys(l).length>0&&(le("build series overrides"),this.buildGraphFromObject(this.root,Jt,l));const c=a?Oa(a.common,ft.COMPLEX_KEYS):{};Object.keys(c).length>0&&(le("build common overrides"),this.buildGraphFromObject(this.root,Jt,qz.getSeriesModule(o)?.chartType==="cartesian"?c:Oa(c,["zoom","navigator"]))),s&&(le("build params"),this.buildGraphFromObject(this.params,ge,s));const h=this.findNeighbourWithValue(this.root,"axes",be),d=this.findNeighbourWithValue(this.root,"series",be);h&&(le("build axes"),this.buildGraphFromObject(h,ge,{$applyTheme:[["/$seriesType/axes/$axisType/$position","/$seriesType/axes/$axisType"],{seriesType:{$path:["/series/0/type","line"]},axisType:{$path:["./type","category"]},position:{$path:["./position"]}},["top","right","bottom","left"]]})),d&&(le("build series"),this.buildGraphFromObject(d,ge,{$applyTheme:["/$seriesType/series",{seriesType:{$path:["./type","line"]}}]}));const u=Oa(e[o]?.annotations??{},ft.ANNOTATIONS_OPTIONS_KEYS);Object.keys(u).length>0&&(le("build annotations type config"),this.buildGraphFromObject(this.annotations,ge,u));const p=Oa(a?.common?.annotations??{},ft.ANNOTATIONS_OPTIONS_KEYS);Object.keys(p).length>0&&(le("build annotations type overrides"),this.buildGraphFromObject(this.annotations,Jt,p));const g=Ng(e[o]?.annotations??{},ft.ANNOTATIONS_OPTIONS_KEYS);Object.keys(g).length>0&&(le("build annotations config"),this.buildGraphFromObject(this.root,ge,{annotations:g}));const f=Ng(a?.common?.annotations??{},ft.ANNOTATIONS_OPTIONS_KEYS);Object.keys(f).length>0&&(le("build annotations overrides"),this.buildGraphFromObject(this.root,Jt,{annotations:f})),this.buildDependencyGraph()}static clearValueCache(){ft.valueCache.clear()}clear(){le.group("OptionsGraph.clear()",()=>{super.clear(),this.cachedPathVertices.clear(),this.root=void 0,this.params=void 0,this.annotations=void 0,le("cleared")})}clearSafe(){this.hasUnsafeClearKeys||this.clear()}resolve(){return le.group("OptionsGraph.resolve()",()=>(this.resolved={},this.resolvedParams={},this.resolvedAnnotations={},le("resolve params"),this.resolveVertex(this.params,this.resolvedParams),le("resolve annotations"),this.resolveVertex(this.annotations,this.resolvedAnnotations),le("resolve root"),this.resolveVertex(this.root),le("resolved root",this.resolved),le("vertex count",this.getVertexCount()),le("edge count",this.getEdgeCount()),this.resolved))}resolveParams(){return this.resolvedParams}resolveAnnotationThemes(){return this.resolvedAnnotations}addVertex(e){const i=super.addVertex(e);return this.isRollingBack&&this.rollbackVertices.push(i),i}addEdge(e,i,s){const n=(this.neighboursWithEdgeValue(e,s)?.indexOf(i)??-1)!==-1;this.isRollingBack&&!n&&(this.rollbackEdgesFrom.push(e),this.rollbackEdgesTo.push(i),this.rollbackEdgesValue.push(s)),super.addEdge(e,i,s)}resolvePartial(e,i,s){if(!i||!this.root)return;const{permissivePath:n,proxyPaths:a}=s??{},r=Object.keys(i);if(le.check()&&console.groupCollapsed(`OptionsGraph.resolvePartial() - ${e.join(".")} [${r}]`),r.length===0)return{};const o=this.findVertexAtPath(e);if(!o){if(n)return;throw new Error(`Could not find vertex in OptionsGraph at path [${e.join(".")}].`)}const l=this.findNeighbour(o,Ni);if(this.userPartialOptions={},Kr(this.userPartialOptions,e,i),a)for(const p of Object.keys(a)){const g=a[p],f=pt(i,[p]);f!=null&&(Kr(i,g,f),Kr(this.userPartialOptions,[...e,...g],f),delete i[p],delete this.userPartialOptions[p])}this.graftEdge=Dn,this.edgePriority=[Dn,...ft.EDGE_PRIORITY],this.snapshot(),this.buildGraphFromObject(o,Dn,i,l);for(const p of r){const g=a?.[p]?this.findVertexAtPath([...e,...a[p]]):this.findNeighbourWithValue(o,p,be);g&&this.refreshPendingProcessingEdges(g)}this.buildDependencyGraph();const c={};if(this.resolveVertex(o,c),this.rollback(),this.graftEdge=ft.GRAFT_EDGE,this.edgePriority=ft.EDGE_PRIORITY,this.userPartialOptions=void 0,a)for(const p of Object.keys(a)){const g=a[p],f=pt(c,[...e,...g]);Kr(c,[...e,p],f)}const h=pt(c,e),u=s?.pick??!0?Ng(pt(c,e),r):h;return le("vertex count",this.getVertexCount()),le("edge count",this.getEdgeCount()),le("resolved partial",u),le.check()&&console.groupEnd(),u}findVertexAtPath(e){const i=e.join(".");if(this.cachedPathVertices.has(i))return this.cachedPathVertices.get(i);const s=this.findVertexAlongEdge(this.root,e,be);if(s)return this.cachedPathVertices.set(i,s),s}hasUserOption(e){if(ml(this.userOptions,e))return!0;const s=this.findVertexAtPath(e);if(s){if(this.findNeighbour(s,Dt)!=null||this.findNeighbour(s,Dn)!=null)return!0;const n=this.findNeighbourValue(s,OI);return n===Dt||n===Dn}return!1}dangerouslyGetUserOption(e){if(this.userPartialOptions){const i=pt(this.userPartialOptions,e);if(i!=null)return i}return pt(this.userOptions,e)}hasThemeOverride(e){if(this.overrides==null)return!1;if(e[0]==="axes"&&e.length>1){const i=this.getResolvedPath(["axes",e[1],"type"]);if(ml(this.overrides,["common","axes",i,...e.slice(2)]))return!0;const s=this.getResolvedPath(["series","0","type"]);return ml(this.overrides,[s,"axes",i,...e.slice(2)])}if(e[0]==="series"&&e.length>1){const i=this.getResolvedPath(["series",e[1],"type"]);return ml(this.overrides,[i,"series",...e.slice(2)])}return ml(this.overrides,e)}getParamValue(e){if(this.resolvedParams[e]!=null)return this.resolvedParams[e];const i=this.findVertexAlongEdge(this.params,[e],be);if(!i)return;const s=this.findNeighbour(i,ge);if(!s)return;const n=this.resolveVertexValue(i,s);return this.resolvedParams[e]=n,n}getPathArray(e){return this.findNeighbourValue(e,Ni)??[]}getResolvedPath(e){return pt(this.resolved,e)}getCachedValue(e,i){const s=[...e,i].join(".");return ft.valueCache.get(s)}setCachedValue(e,i,s){const n=[...e,i].join(".");ft.valueCache.set(n,s)}prune(e,i){this.addEdge(e,this.addVertex(i),wI)}resolveVertexValue(e,i){this.resolveVertexDependencies(i);const s=this.findNeighbourValue(i,ys);if(s&&xl(s)){const a=this.neighboursWithEdgeValue(i,bs),r=bl[s],l=(typeof r=="function"?r:r.resolve)?.(this,e,a??[]);return l===Qt?void 0:l}let n=this.getVertexValue(i);if(Array.isArray(n)){const a={};this.resolveVertexChildren(i,a),n=pt(a,this.getPathArray(e))}return this.resolveValueOrSymbol(n)}resolveValue$1(e){for(let i=e.length;i>=0;i--){const s=e.slice(0,i).join("."),n=this.value$1.get(s);if(n!=null)return n}}graftConfig(e,i,s){const n=pt(this.config,i),a=this.findNeighbour(e,Ni);if(gl(n)&&this.buildGraphFromObject(e,ge,n,a,void 0,s),this.overrides){const r=pt(this.overrides,i);gl(r)&&this.buildGraphFromObject(e,Jt,r,a,void 0,s);const o=pt(this.overrides,["common",...i.slice(1)]);gl(o)&&this.buildGraphFromObject(e,Jt,o,a,void 0,s)}this.buildDependencyGraph()}graftObject(e,i,s,n=this.graftEdge){const a=this.findNeighbour(e,Ni);if(this.buildGraphFromObject(e,n,i,a),this.overrides&&s)for(const r of s){if(r==null)continue;const o=pt(this.overrides,r);o&&this.buildGraphFromObject(e,Jt,o,a)}this.buildDependencyGraph()}graftValue(e,i,s,n,a=this.graftEdge){const r=[...this.getPathArray(e),i],o=this.findVertexAtPath(r)??this.addVertex(i);this.value$1.set(r.join("."),n),this.buildGraphFromValue(e,o,a,r,s),this.buildDependencyGraph()}graftAndResolveOrphan(e,i){const s={},n=this.addVertex(s),a=this.getPathArray(e);return this.graftAndResolveChildren(i,n,a,[]),this.resolveVertex(n,s),pt(s,a)}graftAndResolveOrphanValue(e,i,s,n,a=this.graftEdge){const r={},o=this.addVertex(r),c=[...this.getPathArray(e),i],h=this.findVertexAtPath(c)??this.addVertex(i);return this.value$1.set(c.join("."),n),this.buildGraphFromValue(o,h,a,c,s),this.resolveVertex(o,r),pt(r,c)}buildGraphFromObject(e,i,s,n,a=ft.SHALLOW_KEYS,r){const o=Object.keys(s),l=yl(s,o);if(l){const g=this.addVertex(s);this.addEdge(e,g,i),this.buildGraphFromOperation(g,i,l,n);return}if(o.length===0){this.addEdge(e,this.addVertex(Array.isArray(s)?[]:{}),i),this.buildGraphAutoEnable(e,i,s,void 0);return}const c=this.getVertexChildrenByKey(e),h=n?this.getVertexValue(n):[];let d;Array.isArray(s)&&this.addEdge(e,this.addVertex(i),OI);const u=[...h],p=h.length;for(const g of o){if(r?.has(g))continue;const f=c?.get(g)??this.addVertex(g);u[p]=g,a?.has(g)?this.buildShallowGraphFromValue(e,f,i,u,s[g]):this.buildGraphFromValue(e,f,i,u,s[g],a),g==="enabled"&&(d=f)}this.buildGraphAutoEnable(e,i,s,d)}buildGraphAutoEnable(e,i,s,n){if(i===ge&&!n||i===Dt&&n||i!==ge&&i!==Dt&&i!==Dn&&i!==Jt)return;let a=this.findNeighbour(e,kg);a||(a=this.addVertex(kg),this.addEdge(e,a,kg)),n&&this.addEdge(n,a,kI);const{enabled:r,_enabledFromTheme:o}=s;this.addEdge(a,this.addVertex({enabled:r,_enabledFromTheme:o,keys:Object.keys(s).length}),i)}getVertexChildrenByKey(e){const i=this.neighboursWithEdgeValue(e,be);if(!i)return;const s=new Map;for(const n of i)s.set(this.getVertexValue(n),n);return s}buildGraphFromValue(e,i,s,n,a,r){this.addEdge(e,i,be);let o=this.findNeighbour(i,Ni);o||(o=this.addVertex([...n]),this.addEdge(i,o,Ni));const l=yl(a);if(l){const c=this.addVertex(a);this.addEdge(i,c,s),this.addEdge(c,o,Ni),this.buildGraphFromOperation(c,s,l,o)}else if(LI(a))this.buildGraphFromObject(i,s,a,o,r);else{const c=this.findNeighbour(i,s);if(c&&this.getVertexValue(c)===a)return;const h=this.addVertex(a);this.addEdge(i,h,s)}}buildShallowGraphFromValue(e,i,s,n,a){this.addEdge(e,i,be);let r=this.findNeighbour(i,Ni);r||(r=this.addVertex([...n]),this.addEdge(i,r,Ni));const o=this.addVertex(a);this.addEdge(i,o,s)}buildGraphFromOperation(e,i,s,n){const a=this.addVertex(s.operation);this.addEdge(e,a,ys);for(const r of s.values)this.buildGraphFromOperationValue(e,r,i,n)}buildGraphFromOperationValue(e,i,s,n=this.EMPTY_PATH_ARRAY_VERTEX){const a=this.addVertex(i);this.addEdge(e,n,Ni),this.addEdge(e,a,bs);const r=yl(i);r?this.buildGraphFromOperation(a,s,r,n):LI(i)&&this.buildGraphFromObject(a,s,i,n)}buildDependencyGraph(){for(let e=0;e1&&!this.resolvedRootAncestorsPaths.has(a)){const r=this.findVertexAtPath([a]);if(r){this.resolveVertex(r,i,s);return}}if(this.userPartialOptions==null&&i===this.resolved&&n.length>0){const r=pt(i,n);if(r!=null&&!Jz(r))return}this.resolveVertexInEdgePriority(e,i,n,s),this.resolveVertexAutoEnable(e,i,n),this.resolveVertexChildren(e,i,s)}resolveVertexInEdgePriority(e,i,s,n){const a=this.neighboursWithEdgeValue(e,be),[r]=this.edgePriority;for(const o of this.edgePriority){const l=this.findNeighbour(e,o);if(l==null)continue;const c=this.resolveVertexValueInternal(e,l);if(!(c==null&&o!==r)&&!(a&&a.length>0&&o!==r)&&!(Array.isArray(n)&&n.includes(o))){if(this.hasUnsafeClearKeys||(this.hasUnsafeClearKeys=c!=null&&ft.UNSAFE_CLEAR_KEYS.has(s.at(-1))),s.length===0){if(c==null)continue;this.resolved=c}else Kr(i,s,c);break}}}resolveVertexValueInternal(e,i){this.resolveVertexDependencies(i);const s=this.findNeighbourValue(i,ys);if(s&&xl(s)){const n=this.neighboursWithEdgeValue(i,bs),a=bl[s],o=(typeof a=="function"?a:a.resolve)?.(this,e,n??[]);return o===Qt?void 0:o}return this.resolveValueOrSymbol(this.getVertexValue(i))}resolveVertexAutoEnable(e,i,s){const n=this.neighboursWithEdgeValue(e,kI)?.[0];if(!n)return;const a=this.findVertexAtPath(s),r=this.findNeighbourValue(n,ge),o=this.findNeighbourValue(n,Jt),l=this.findNeighbourValue(n,Dt),h=a&&this.findNeighbour(a,Dt)!=null?void 0:this.findNeighbourValue(n,Dn);(l!=null&&l.enabled==null||h!=null&&h.enabled==null)&&!r?._enabledFromTheme&&!o?._enabledFromTheme&&Kr(i,s,!0)}resolveVertexChildren(e,i,s){const n=this.neighboursWithEdgeValue(e,be);if(n){s??(s=this.findNeighbourValue(e,wI));for(const a of n){const r=this.getVertexValue(a);n.length>1&&xl(r)||r!=="_enabledFromTheme"&&this.resolveVertex(a,i,s)}}}resolveVertexDependencies(e){const i=this.neighboursWithEdgeValue(e,$r);if(i)for(const s of i)this.resolveVertex(s)}graftAndResolveChildren(e,i,s,n){const a=this.neighboursWithEdgeValue(e,be);if(a)for(const r of a){const o=this.getVertexValue(r),l=[...s,o],c=[...n,o],h=this.addVertex(o),d=this.findNeighbourValue(r,ge);this.addEdge(i,h,be);const u=this.addVertex(l);if(this.addEdge(h,u,Ni),gl(d)){this.buildGraphFromObject(h,ge,d,u);const p=this.findNeighbour(h,ge);this.addEdge(p,this.addVertex(l),Ni);const g=this.findNeighbourValue(p,ys);if(xl(g)){const f=this.neighboursWithEdgeValue(p,bs),m=bl[g];(typeof m=="function"?void 0:m.dependencies)?.(this,p,f??[])}}this.graftAndResolveChildren(r,h,l,c)}}resolveValueOrSymbol(e){return typeof e=="symbol"&&this.internalParams?.has(e)?this.internalParams.get(e):e}snapshot(){le("snapshot"),this.isRollingBack=!0}rollback(){le(`rollback ${this.rollbackEdgesFrom.length} edges and ${this.rollbackVertices.length} vertices`);for(let e=0;e0?a.join("."):"root";this.diagramNeighbours(e,r,i,s+1,n);let o=this.diagramKeys.get(r);o||(o=this.diagramKey(r),e.push(` ${o}["${i.value}"]`))}diagramNeighbours(e,i,s,n,a){for(const p of this.neighboursWithEdgeValue(s,be)??[]){const g=this.getPathArray(p),f=g.length>0?g.join("."):"root";n${l} ${this.diagramLabel(a,r,i)}`)}diagramChildWithNeighbours(e,i,s,n,a,r,o,l){this.diagramChild(e,i,s,n,a,r),this.diagramNeighbours(e,a,r,o+1,l)}};Mn.EDGE_PRIORITY=[Dt,Jt,ge],Mn.GRAFT_EDGE=ge,Mn.SHALLOW_KEYS=new Set(["context","data","topology"]),Mn.COMPLEX_KEYS=["annotations","axes","series"],Mn.ANNOTATIONS_OPTIONS_KEYS=["axesButtons","data","enabled","optionsToolbar","snap","toolbar","xKey","volumeKey"],Mn.UNSAFE_CLEAR_KEYS=new Set(["itemStyler","styler"]),Mn.valueCache=new Map;var FI=Mn,VI=t=>`'${t}'`,Eg="__AXIS_ID_",_a={top:Os.X,bottom:Os.X,left:Os.Y,right:Os.Y},Fa=class at{constructor(e,i,s,n,a,r,o=!1,l){this.themeParameters={},this.optionMetadata=a??{},this.processedOverrides=s??{};let c=null;e instanceof at?(c=e,this.specialOverrides=c.specialOverrides,r&&(this.userDeltaKeys=new Set(Object.keys(r))),r??(r=e0(c.userOptions,i,at.JSON_DIFF_OPTS)),this.userOptions=Qo(t0(r,c.userOptions),{...at.OPTIONS_CLONE_OPTS_SLOW,seen:[]})):(this.userOptions=Qo(e??i,{...at.OPTIONS_CLONE_OPTS_SLOW,seen:[]}),this.specialOverrides=this.specialOverridesDefaults({...n})),this.findSeriesWithUserVisiblity(i,r),o&&this.removeLeftoverSymbols(this.userOptions);const h=e instanceof at&&r?.data!==void 0&&r?.data?.length!==e.userOptions.data?.length;let d,u,p,g,f,m,b;if(!o&&this.seriesWithUserVisibility==null&&r!==void 0&&at.isFastPathDelta(r)&&c!=null&&!h?({activeTheme:d,processedOptions:u,fastDelta:p}=this.fastSetup(r,c),g=c.themeParameters,f=c.annotationThemes):(at.perfDebug("ChartOptions.slowSetup()"),{activeTheme:d,processedOptions:u,themeParameters:g,annotationThemes:f,googleFonts:m,optionsGraph:b}=this.slowSetup(s,r,o)),this.activeTheme=d,this.processedOptions=u,this.fastDelta=p??void 0,this.themeParameters=g,this.annotationThemes=f,this.googleFonts=m,this.optionsGraph=b,l!==void 0&&typeof l=="number"&&!Number.isNaN(l)){const x=performance.now();this.optionsProcessingTime=x-l}Rp.inDevelopmentMode(()=>a2(this))}static isFastPathDelta(e){for(const i of Object.keys(e??{}))if(!this.FAST_PATH_OPTIONS.has(i))return at.perfDebug("ChartOptions.isFastPathDelta() - slow path required due to presence of: ",i),!1;return at.perfDebug("ChartOptions.isFastPathDelta() - fast path possible."),!0}findSeriesWithUserVisiblity(e,i){for(const s of[e,i]){const n=s?.series;if(Array.isArray(n))for(let a=0;au2(s,i.series?.[n]??{}))?delete e.series:e.series=e.series.map((s,n)=>t0(s,i.series?.[n]??{})))}slowSetup(e,i,s=!1){let n=Qo(this.userOptions,at.OPTIONS_CLONE_OPTS_FAST);i&&(n=el(i,n),s&&this.removeLeftoverSymbols(n));let a=n0(zh(n.theme));const{presetType:r}=this.optionMetadata;if(r!=null){const m=_t.getPresetModule(r);if(m){const{validate:b=tl}=m,x=n,v=n.type,S=v==null?void 0:a.presets[v],{cleared:I,invalid:M}=b(x,m.options,"");for(const D of M)hi.warn(D);Pp(M,"")?n={}:(at.debug(">>> AgCharts.createOrUpdate() - applying preset",I),n=m.create(I,S,()=>this.activeTheme),a=n0(zh(n.theme)))}}this.soloSeriesIntegrity(n),r!=null&&a.templateTheme(n,!1),r0(void 0,n);const o=this.validateSeriesOptions(n),l=Wo(n);if(this.chartDef=_t.getChartModule(l),!this.chartDef.placeholder){const{validate:m=tl}=this.chartDef,{cleared:b,invalid:x}=m(n,this.chartDef.options,"");for(const v of x)hi.warn(v);n=b}this.validateAxesOptions(n),this.removeDisabledOptions(n);let c=this.processFonts(a.params);c=this.processFonts(n,c),this.processSeriesOptions(n);const h=this.processAxesOptions(n,l),d=lU(a,n),u=d.resolve(),p=d.resolveParams(),g=d.resolveAnnotationThemes();d.clearSafe();const f=el(e,u);return r0(this.chartDef.name,f),oF(this.chartDef.name,f,o),this.validateSeriesOptions(f),this.validateAxesOptions(f,h),this.validatePluginOptions(f),this.processMiniChartSeriesOptions(f),f.loadGoogleFonts||c.clear(),at.debug(()=>["ChartOptions.slowSetup() - processed options",Qo(f)]),{activeTheme:a,processedOptions:f,themeParameters:p,annotationThemes:g,googleFonts:c,optionsGraph:d}}validatePluginOptions(e){for(const i of _t.listModulesByType(Jo.Plugin)){const s=i.name;if(s in e&&i.options!=null&&(!i.chartType||i.chartType===this.chartDef?.name)){const{cleared:n,invalid:a}=tl(e[s],i.options,i.name);for(const r of a)hi.warn(r);e[s]=n}}}validateSeriesOptions(e){const i=this.chartDef?.name,s=[],n=e.series?.length??0,a=[];let r;for(let o=0;om.type===Jo.Series&&(g||!m.enterprise)&&(!i||m.chartType===i)).map(m=>m.name),"or",VI));const f=un.get(c.type);if(c.type!=null&&f?.type===Jo.Series){a.push(f);continue}hi.warn(c.type==null?`Option \`${l}.type\` is required and has not been provided; expecting ${r}, ignoring.`:`Unknown type \`${c.type}\` at \`${l}.type\`; expecting ${r}, ignoring.`);continue}else if(i&&h.chartType!==i){hi.warn(`Series type \`${h.name}\` at \`${l}.type\` is not supported by chart type \`${i}\`, ignoring.`);continue}if(h.options==null){s.push(c);continue}const{validate:d=tl}=h,{cleared:u,invalid:p}=d(c,h.options,l);for(const g of p)hi.warn(g);Pp(p,l)||s.push(u)}return e.series=s,a}validateAxesOptions(e,i){if(!("axes"in e)||!e.axes)return;const s=this.chartDef?.name,n={};let a;for(const[r,o]of fa(e.axes)){if(!o)continue;if(o.type==null){n[r]=o;continue}const l=`axes.${i?.get(r)??r}`,c=_t.getAxisModule(o.type);if(c==null){const p=_t.isEnterprise();a??(a=Qv(Array.from(un.values()).filter(f=>f.type===Jo.Axis&&(p||!f.enterprise)&&f.chartType===s).map(f=>f.name),"or",VI)),un.get(o.type)?.type!==Jo.Axis&&hi.warn(`Unknown type \`${o.type}\` at \`${l}.type\`; expecting one of ${a}, ignoring.`);continue}else if(c.chartType!==s){hi.warn(`Axis type \`${c.name}\` at \`${l}.type\` is not supported by chart type \`${s}\`, ignoring.`);break}const{validate:h=tl}=c,{cleared:d,invalid:u}=h(o,c.options,l);for(const p of u)hi.warn(p);Pp(u,l)||(n[r]=d)}e.axes=n}diffOptions(e){return this===e?{}:e==null?this.processedOptions:this.fastDelta??e0(e.processedOptions,this.processedOptions,at.JSON_DIFF_OPTS)}optionsType(e){return e.series?.[0]?.type??"line"}processSeriesOptions(e){const i=e.displayNullData,s=e.series?.map(n=>{const r=!!_t.getSeriesModule(n.type)?.options?.visible,o={};return r&&(o.visible=!0),i!==void 0&&n.allowNullKeys===void 0&&(o.allowNullKeys=i),el(this.getSeriesGroupingOptions(n),n,o)});e.series=this.setSeriesGroupingOptions(s??[])}processAxesOptions(e,i){const s=i==="polar"?[Os.Angle,Os.Radius]:[Os.X,Os.Y],n="axes"in e&&Object.keys(e.axes??{}).length>0,a=this.countNonDefaultSeriesAxisKeys(e,s),r=a>0,o=r&&a<(e?.series?.length??0),l=e.series?.[0],c=this.optionsType(e),h=this.predictAxes(c,s,l,e.data)??this.cloneDefaultAxes(c),d=_p(l)&&"direction"in l&&l.direction==="horizontal"&&_t.getSeriesModule(l.type)?.axisKeysFlipped!=null;if(!n&&!r&&!d){e.axes=h;return}const u="axes"in e?new Set(Object.keys(e.axes??{})):new Set,p=this.getPrimaryAxisKeys(e,s,u,r),g=this.getRemappedAxisKeys(u,p,s,o),f={},m=new Map;for(const[b,x]of g)f[x]="axes"in e?rh(e.axes?.[b]):void 0,m.set(x,b);return this.remapSeriesAxisKeys(e,s,f,g,h,o),this.predictAxesMissingTypesAndPositions(e,s,f,h),this.alternateSecondaryAxisPositions(e,f,m),e.axes=f,m}getSeriesDirectionAxisKey(e,i){const s=_t.getSeriesModule(e.type);return s?"direction"in e&&e.direction==="horizontal"&&s.axisKeysFlipped?s.axisKeysFlipped[i]:s.axisKeys?.[i]:void 0}countNonDefaultSeriesAxisKeys(e,i){let s=0;for(const n of e.series??[])for(const a of i){const r=this.getSeriesDirectionAxisKey(n,a);!r||!ah(r,n)||n[r]!==a&&s++}return s}getPrimaryAxisKeys(e,i,s,n){const a=new Map;for(const r of i){let o=!1;if("axes"in e&&e.axes&&!(r in e.axes&&_p(e.axes[r])&&!("position"in e.axes[r]))){for(const[l,c]of fa(e.axes))if("position"in c&&c.position&&r===_a[c.position]){a.set(r,l),o=!0;break}}if(!o&&n)for(const l of e.series??[]){const c=this.getSeriesDirectionAxisKey(l,r);if(!c)continue;const h=l[c];if(!s.has(h)){if(!h){a.set(r,r);break}a.set(r,h);break}}}if(s.size===0||!("axes"in e)||!e.axes)return a;if(a.size===0)for(const r of i)r in e.axes&&a.set(r,r);if(a.size===0){for(const r of i)for(const[o,l]of fa(e.axes))if(l.type?.startsWith(r)){a.set(r,o);break}}if(a.size===0&&(e.series?.length??0)>0)for(const r of i)for(const o of e.series){const l=this.getSeriesDirectionAxisKey(o,r);if(!l)continue;const c=o[l];if(s.has(c)){a.set(r,c);break}}if(a.size<2){const r=new Set(a.values());for(const[o,l]of fa(e.axes))if(!(r.has(o)||"position"in l)){for(const c of i)if(!a.has(c)){a.set(c,o),r.add(o);break}if(a.size===2)break}}return a}getRemappedAxisKeys(e,i,s,n){const a=new Map;for(const[r,o]of i)a.set(o,r);for(const r of e)a.has(r)||a.set(r,`${Eg}${a.size}`);if(n)for(const r of s)a.has(r)||a.set(r,`${Eg}${a.size}`);return a}remapSeriesAxisKeys(e,i,s,n,a,r){for(const o of e.series??[])for(const l of i){const c=this.getSeriesDirectionAxisKey(o,l);if(!c)continue;s[l]??(s[l]=rh(a[l]));let h=l;if(c in o){const d=o[c];n.has(d)?h=n.get(d):(h=`${Eg}${n.size}`,n.set(d,h),s[h]=rh(a[l]))}else n.has(l)&&r&&(h=n.get(l),s[h]??(s[h]=rh(a[l])));o[c]=h}}predictAxes(e,i,s,n){if(!s)return;const a=s?.data??n;if(!a?.length)return;const r=_t.getSeriesModule(e)?.predictAxis;if(!r)return;const o=new Map,l=r2(0,a.length-1,5);for(const c of l){const h=a[c];for(const d of i){const u=r(d,h,s);if(!o.has(d)){o.set(d,u);continue}const p=o.get(d);if(!(!u&&!p)){if(!u||!p)return;for(const g of Object.keys(p))if(p[g]!==u[g])return}}}for(const[c,h]of o)h||o.delete(c);if(o.size!==0){if(o.size===1){const[c]=o.values(),h=this.cloneDefaultAxes(e);return"position"in c?p2(h,d=>"position"in d&&d.position===c.position?c:d):void 0}return Object.fromEntries(o)}}cloneDefaultAxes(e){const i=_t.getSeriesModule(e);return i?.defaultAxes?Qo(i.defaultAxes):{}}predictAxesMissingTypesAndPositions(e,i,s,n){for(const[a,r]of fa(s)){if(!Jv(r)||"type"in r&&"position"in r)continue;if(a in n){r.type??(r.type=n[a].type),r.position??(r.position=n[a].position);continue}this.predictAxisMissingTypeFromPosition(r,n)||(this.predictAxisMissingTypeAndPositionFromSeries(e,i,a,r,n),"type"in r||delete s[a])}}predictAxisMissingTypeFromPosition(e,i){if(!("position"in e)||!ah(e.position,_a))return!1;for(const s of Object.values(i))if(ah(s.position,_a)&&_a[e.position]===_a[s.position])return e.type=s.type,!0;for(const[s,n]of fa(_a))if(e.position!==s&&n===_a[e.position])return e.type=i[n].type,!0;return!1}predictAxisMissingTypeAndPositionFromSeries(e,i,s,n,a){for(const r of e.series??[])for(const o of i){const l=this.getSeriesDirectionAxisKey(r,o);if(!(!l||!ah(l,r))&&r[l]===s)return n.type??(n.type=a[o].type),n.position??(n.position=a[o].position),o===Os.Y}return!1}alternateSecondaryAxisPositions(e,i,s){let n=0,a=0;for(const[r,o]of fa(i)){if(!Jv(o)||!("position"in o))continue;const l=s.get(r),c="axes"in e&&e.axes&&l&&l in e.axes?e.axes[l]:void 0,h=c&&"position"in c?c.position:void 0;if(o.position==="top"||o.position==="bottom"?(n+=1,n===2&&h==null&&(o.position="top")):(o.position==="left"||o.position==="right")&&(a+=1,a===2&&h==null&&(o.position="right")),n>1&&a>1)break}}processMiniChartSeriesOptions(e){const i=e.navigator?.miniChart?.series;i!=null&&(e.navigator.miniChart.series=this.setSeriesGroupingOptions(i))}getSeriesGroupingOptions(e){const{groupable:i,stackable:s,stackedByDefault:n=!1}=_t.getSeriesModule(e.type);e.grouped&&!i&&hi.warnOnce(`unsupported grouping of series type "${e.type}".`),(e.stacked||e.stackGroup)&&!s&&hi.warnOnce(`unsupported stacking of series type "${e.type}".`);let{grouped:a,stacked:r}=e;return r??(r=(n||e.stackGroup!=null)&&!(i&&a)),a??(a=!0),{stacked:s&&r,grouped:i&&a&&!(s&&r)}}setSeriesGroupingOptions(e){const i=this.getSeriesGrouping(e);at.debug("ChartOptions.setSeriesGroupingOptions() - series grouping: ",i);const s={},n=i.reduce((a,r)=>{var o;return r.groupType==="default"||(a[o=r.seriesType]??(a[o]=0),a[r.seriesType]+=r.groupType==="stack"?1:r.series.length),a},{});return i.flatMap(a=>{var r;switch(s[r=a.seriesType]??(s[r]=0),a.groupType){case"stack":{const o=s[a.seriesType]++;return a.series.map((l,c)=>Object.assign(l,{seriesGrouping:{groupId:a.groupId,groupIndex:o,groupCount:n[a.seriesType],stackIndex:c,stackCount:a.series.length}}))}case"group":return a.series.map(o=>Object.assign(o,{seriesGrouping:{groupId:a.groupId,groupIndex:s[a.seriesType]++,groupCount:n[a.seriesType],stackIndex:0,stackCount:0}}))}return a.series}).map(({stacked:a,grouped:r,...o})=>o)}getSeriesGroupId(e){return[e.type,e.xKey,e.stacked?e.stackGroup??"stacked":"grouped"].filter(Boolean).join("-")}getSeriesGrouping(e){const i=new Map;return e.reduce((s,n)=>{const a=n.type;if(!n.stacked&&!n.grouped)s.push({groupType:"default",seriesType:a,series:[n],groupId:"__default__"});else{const r=this.getSeriesGroupId(n);if(!i.has(r)){const l={groupType:n.stacked?"stack":"group",seriesType:a,series:[],groupId:r};i.set(r,l),s.push(l)}i.get(r).series.push(n)}return s},[])}soloSeriesIntegrity(e){if(!h2(e.series))return;const i=n=>_t.getSeriesModule(n)?.solo??!1,s=e.series;if(s&&s.length>1&&s.some(n=>i(n.type))){const n=this.optionsType(e);if(i(n))hi.warn(`series[0] of type '${n}' is incompatible with other series types. Only processing series[0]`),e.series=s.slice(0,1);else{const{solo:a,nonSolo:r}=c2(s,l=>i(l.type)?"solo":"nonSolo"),o=m2(a.map(l=>l.type)).join(", ");hi.warn(`Unable to mix these series types with the lead series type: ${o}`),e.series=r}}}static processFontOptions(e,i,s,n=new Set){if(typeof e=="object"&&"fontFamily"in e)if(Array.isArray(e.fontFamily)){const a=[];for(const r of e.fontFamily)typeof r=="object"&&"googleFont"in r?(a.push(r.googleFont),n?.add(r.googleFont)):a.push(r);e.fontFamily=a.join(", ")}else typeof e.fontFamily=="object"&&"googleFont"in e.fontFamily&&(e.fontFamily=e.fontFamily.googleFont,n?.add(e.fontFamily));return n}processFonts(e,i=new Set){return Fp(e,at.processFontOptions,new Set(["data","theme"]),void 0,void 0,i)}static removeDisabledOptionJson(e){if("enabled"in e&&e.enabled===!1)for(const i of Object.keys(e))i!=="enabled"&&delete e[i]}removeDisabledOptions(e){Fp(e,at.removeDisabledOptionJson,new Set(["data","theme","contextMenu","ranges"]))}static removeLeftoverSymbolsJson(e){if(!(!e||!_p(e)))for(const i of Object.keys(e)){const s=e[i];d2(s)&&delete e[i]}}removeLeftoverSymbols(e){Fp(e,at.removeLeftoverSymbolsJson,new Set(["data"]))}specialOverridesDefaults(e){if(e.window==null?e.window=l2():f2(e.window),e.document==null?e.document=o2():g2(e.document),e.window==null)throw new Error("AG Charts - unable to resolve global window");if(e.document==null)throw new Error("AG Charts - unable to resolve global document");return e}};Fa.OPTIONS_CLONE_OPTS_SLOW={shallow:new Set(["data","container"]),assign:new Set(["context","theme"])},Fa.OPTIONS_CLONE_OPTS_FAST={shallow:new Set(["container"]),assign:new Set(["data","context","theme"])},Fa.JSON_DIFF_OPTS=new Set(["data","localeText"]),Fa.perfDebug=Rp.create(!0,"perf"),Fa.FAST_PATH_OPTIONS=new Set(["data","width","height","container"]),Fa.debug=Rp.create(!0,"opts");var vl=Fa,Gh=Ep.create(!0,"opts"),An="AG Charts - Chart was destroyed, cannot perform request.",Sl=class{constructor(e,i,s){this.factoryApi=i,this.licenseManager=s,this.chart=e}async update(e){if(!this.chart)throw new Error(An);return Gh.group("AgChartInstance.update()",async()=>{const i=Ep.check("scene:stats","scene:stats:verbose")?performance.now():void 0;this.factoryApi.update(e,this,void 0,i),await this.chart?.waitForUpdate()})}async updateDelta(e){if(!this.chart)throw new Error(An);return Gh.group("AgChartInstance.updateDelta()",async()=>{const i=Ep.check("scene:stats","scene:stats:verbose")?performance.now():void 0;this.factoryApi.updateUserDelta(this,e,i),await this.chart?.waitForUpdate()})}getOptions(){if(!this.chart)throw new Error(An);const e=s2(this.chart.getOptions(),vl.OPTIONS_CLONE_OPTS_FAST);for(const i of Object.keys(e))i.startsWith("_")&&delete e[i];return e}waitForUpdate(){if(!this.chart)throw new Error(An);return this.chart.waitForUpdate()}applyTransaction(e){const{chart:i}=this;if(!i)throw new Error(An);if(e==null||typeof e!="object")throw new Error("AG Charts - applyTransaction expects a transaction object.");const{add:s,addIndex:n,remove:a,update:r}=e;if(s!=null&&!Array.isArray(s))throw new Error('AG Charts - transaction "add" must be an array.');if(n!=null){if(typeof n!="number"||!Number.isSafeInteger(n)||n<0)throw new Error('AG Charts - transaction "addIndex" must be a safe non-negative integer (0 to 9007199254740991).');if(s==null||s.length===0)throw new Error('AG Charts - transaction "addIndex" requires a non-empty "add" array.')}if(a!=null&&!Array.isArray(a))throw new Error('AG Charts - transaction "remove" must be an array.');if(r!=null&&!Array.isArray(r))throw new Error('AG Charts - transaction "update" must be an array.');return Gh.group("AgChartInstance.applyTransaction()",async()=>{if(!i.isDataTransactionSupported()){const o=i.data.deepClone();return o.addTransaction(e),o.commitPendingTransactions(),this.updateDelta({data:o.data})}return Gh("transaction",e),this.chart?.applyTransaction(e)})}async download(e){if(!this.chart)throw new Error(An);const i=await this.prepareResizedChart(this,this.chart,e);try{i.chart?.download(e?.fileName,e?.fileFormat)}finally{i.destroy()}}async __toSVG(e){if(!this.chart)throw new Error(An);const i=await this.prepareResizedChart(this,this.chart,{width:600,height:300,...e});try{return i?.chart?.toSVG()}finally{i?.destroy()}}async getImageDataURL(e){if(!this.chart)throw new Error(An);const i=await this.prepareResizedChart(this,this.chart,e);try{return i.chart.getCanvasDataURL(e?.fileFormat)}finally{i.destroy()}}getState(){return this.factoryApi.caretaker.save(...this.getEnabledOriginators())}async setState(e){if(!this.chart)return;const{interactionManager:i,legendManager:s,zoomManager:n}=this.chart.ctx,a=this.getEnabledOriginators(),r=new Set(a);i.isState(2)||(r.has(s)&&r.has(n)?(r.delete(n),await this.setStateOriginators(e,Array.from(r)),await this.setStateOriginators(e,[n])):await this.setStateOriginators(e,a))}resetAnimations(){this.chart?.resetAnimations()}skipAnimations(){this.chart?.skipAnimations()}destroy(){this.releaseChart?(this.releaseChart(),this.releaseChart=void 0):this.chart&&(this.chart.publicApi=void 0,this.chart.destroy()),this.chart=void 0}async prepareResizedChart(e,i,s={}){const n=s.width??i.width??i.ctx.scene.canvas.width,a=s.height??i.height??i.ctx.scene.canvas.height,r=e.getState(),o=i.chartOptions.specialOverrides.document??n2(),l={...i.chartOptions.processedOverrides,container:o.createElement("div"),width:n,height:a};s.width!=null&&s.height!=null&&(l.overrideDevicePixelRatio=1);const c=i.getOptions();if(i2.isEnterprise()){l.animation={enabled:!1};const m=this.licenseManager?.getWatermarkForegroundConfigForBrowser();m&&(l.foreground=m)}const h={...i.chartOptions.specialOverrides},d={...i.chartOptions.optionMetadata},u=await this.chart?.ctx.dataService.getData(),p=this.factoryApi.create(c,l,h,d,u);r.legend&&this.syncLegend(i,p,r),p.chart?.update(nh.FULL,{forceNodeDataRefresh:!0}),await p.waitForUpdate(),await p.setState(r);const g={source:"chart-update",sourceDetail:"internal-prepareResizedChart"};p.chart?.ctx.zoomManager.updateZoom(g,i.ctx.zoomManager.getZoom()),p.chart?.update(nh.FULL,{forceNodeDataRefresh:!0}),await p.waitForUpdate();const f=[];for(const m of i.modulesManager.legends())f.push(m.legend.pagination?.currentPage??0);for(const m of p.chart.modulesManager.legends()){const b=f.shift()??0;m.legend.pagination&&m.legend.pagination.setPage(b)}return p.chart?.update(nh.FULL,{forceNodeDataRefresh:!0}),await p.waitForUpdate(),p}syncLegend(e,i,s){const n=new Map;for(const[a,r]of e.series.entries()){const o=i.chart?.series[a];o&&n.set(r.id,o.id)}s.legend=s.legend?.map(a=>({...a,seriesId:n.get(a.seriesId??"")??a.seriesId}))}getEnabledOriginators(){if(!this.chart)return[];const{chartOptions:{processedOptions:e,optionMetadata:i},ctx:{annotationManager:s,chartTypeOriginator:n,zoomManager:a,legendManager:r},modulesManager:o}=this.chart,l=[];return"annotations"in e&&e.annotations?.enabled&&l.push(s),i.presetType==="price-volume"&&l.push(n),(e.navigator?.enabled||e.zoom?.enabled)&&l.push(a),o.isEnabled("legend")&&e.legend?.enabled!==!1&&l.push(r),l.push(this.chart.ctx.activeManager),l}async setStateOriginators(e,i){this.factoryApi.caretaker.restore(e,...i),this.chart?.ctx.eventsHub.emit("chart:request-update",{type:nh.PROCESS_DATA,opts:{forceNodeDataRefresh:!0}}),await this.chart?.waitForUpdate()}};Sl.chartInstances=new WeakMap,y([t2({oldValue(t){t.destroyed||(t.publicApi=void 0),Sl.chartInstances.delete(t)},newValue(t){t&&(t.publicApi=this,Sl.chartInstances.set(t,this))}})],Sl.prototype,"chart",2);var BI=Sl;import{Debug as hU}from"ag-charts-core";var dU=1e3,Rg=class Fn{constructor(e,i,s,n,a,r=dU){this.name=e,this.buildItem=i,this.releaseItem=s,this.destroyItem=n,this.maxPoolSize=a,this.cleanupTimeMs=r,this.freePool=[],this.busyPool=new Set}static getPool(e,i,s,n,a){return this.pools.has(e)||this.pools.set(e,new Fn(e,i,s,n,a)),this.pools.get(e)}isFull(){return this.freePool.length+this.busyPool.size>=this.maxPoolSize}hasFree(){return this.freePool.length>0}obtain(e){if(!this.hasFree()&&this.isFull())throw new Error("AG Charts - pool exhausted");let i=this.freePool.pop();return i==null?(i=this.buildItem(e),Fn.debug(()=>[`Pool[name=${this.name}]: Created instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i])):Fn.debug(()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i]),this.busyPool.add(i),{item:i,release:()=>this.release(i)}}obtainFree(){const e=this.freePool.pop();if(e==null)throw new Error("AG Charts - pool has no free instances");return Fn.debug(()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,e]),this.busyPool.add(e),{item:e,release:()=>this.release(e)}}release(e){if(!this.busyPool.has(e))throw new Error("AG Charts - cannot free item from pool which is not tracked as busy.");Fn.debug(()=>[`Pool[name=${this.name}]: Releasing instance (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,e]),this.releaseItem(e),this.busyPool.delete(e),this.freePool.push(e),Fn.debug(()=>[`Pool[name=${this.name}]: Returned instance to free pool (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,e]);const i=Date.now(),s=i+this.cleanupTimeMs*.5;this.cleanPoolTimer&&(this.cleanPoolDue??1/0)[`Pool[name=${this.name}]: Cleaned pool of ${e.length} items (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`])}destroy(){this.cleanPool();for(const e of this.busyPool.values())this.destroyItem(e);this.busyPool.clear()}};Rg.pools=new Map,Rg.debug=hU.create(!0,"pool");var uU=Rg,Gs=Fd.create(!0,"opts"),Cn=class{static licenseCheck(t){if(t.withinStudio)return;let e=this.licenseManager;return this.licenseChecked||(e=xo.licenseManager?.(t),this.licenseManager=e,e?.validateLicense(),this.licenseChecked=!0),e}static getLicenseDetails(t){return xo.licenseManager?.({}).getLicenseDetails(t)}static getInstance(t){return zI.getInstance(t)}static create(t,e){const i=Fd.check("scene:stats","scene:stats:verbose")?performance.now():void 0;return Gs.group("AgCharts.create()",()=>{t=Fd.inDevelopmentMode(()=>nT(Ka(t)))??t,this.licenseCheck(t);const s=this.licenseCheck(t),n=zI.createOrUpdate({userOptions:t,licenseManager:s,optionsMetadata:e,apiStartTime:i});return s?.isDisplayWatermark()&&xo.injectWatermark?.(n.chart.ctx.domManager,s.getWatermarkMessage()),n})}static createFinancialChart(t){return Gs.group("AgCharts.createFinancialChart()",()=>this.create(t,{presetType:"price-volume"}))}static createGauge(t){return Gs.group("AgCharts.createGauge()",()=>this.create(t,{presetType:"gauge-preset"}))}static __createSparkline(t){return Gs.group("AgCharts.__createSparkline()",()=>{const{pool:e,...i}=t;return this.create(i,{presetType:"sparkline",pool:e??!0,domMode:"minimal",withDragInterpretation:!1})})}};Cn.licenseChecked=!1;var vs=class Kl{static getInstance(e){const i=sh.getInstance(e);return i?BI.chartInstances.get(i):void 0}static createOrUpdate(e){let{proxy:i}=e;const{userOptions:s,licenseManager:n,processedOverrides:a=i?.chart?.chartOptions.processedOverrides??{},specialOverrides:r=i?.chart?.chartOptions.specialOverrides??{},optionsMetadata:o=i?.chart?.chartOptions.optionMetadata??{},deltaOptions:l,data:c,stripSymbols:h=!1,apiStartTime:d}=e,u=xo.styles==null?[]:[["ag-charts-enterprise",xo.styles]];if(Em.listModules().next().done)throw new Error(["AG Charts - No modules have been registered.","","Call ModuleRegistry.registerModules(...) with the modules you need before using AgCharts.create().","","See https://www.ag-grid.com/charts/r/module-registry/ for more details."].join(` `));Gs(()=>[">>> AgCharts.createOrUpdate() user options",Ka(s)]);const{presetType:p}=o;let g=s;Cn.optionsMutationFn&&g&&(g=Cn.optionsMutationFn(Ka(g,vl.OPTIONS_CLONE_OPTS_FAST),p),Gs(()=>[">>> AgCharts.createOrUpdate() MUTATED user options",Ka(g)]));const f=this.getPool(o);let m=!1,b,x=i?.chart;x==null&&f?.hasFree()&&(b=f.obtainFree(),x=b.item);const{document:v,window:S,styleContainer:I,skipCss:M,...D}=g??{},A=x?.getChartOptions(),C=new vl(A,D,a,{...r,document:v,window:S,styleContainer:I,skipCss:M},o,l,h,d);(x==null||Wo(C.processedOptions)!==Wo(x.chartOptions.processedOptions))&&(b?.release(),b=this.getPool(C.optionMetadata)?.obtain(C),b?x=b.item:(m=!0,x=Kl.createChartInstance(C,x))),C.optionsGraph&&x.ctx.optionsGraphService.updateCallback((T,L,k)=>C.optionsGraph?.resolvePartial(T,L,k));for(const[T,L]of u)x.ctx.domManager.addStyles(T,L);return x.ctx.fontManager.updateFonts(C.googleFonts),c!=null&&x.ctx.dataService.restoreData(c),i==null?(i=new BI(x,Kl.callbackApi,n),i.releaseChart=b?.release):(b||m)&&(i.releaseChart?.(),i.chart=x,i.releaseChart=b?.release),Gs.check()&&typeof globalThis.window<"u"&&(globalThis.agChartInstances??(globalThis.agChartInstances={}),globalThis.agChartInstances[x.id]=x),x.queuedUserOptions.push(C.userOptions),x.queuedChartOptions.push(C),x.requestFactoryUpdate(T=>{Gs.group(">>>> Chart.applyOptions()",()=>{T.applyOptions(C);const L=T.queuedUserOptions.indexOf(C.userOptions)+1;T.queuedUserOptions.splice(0,L),T.queuedChartOptions.splice(0,L)})}),i}static updateUserDelta(e,i,s){i=Ka(i,vl.OPTIONS_CLONE_OPTS_FAST);const n=aT(i,Kl.markRemovedProperties,new Set(["data"]),void 0,void 0,!1);Gs(()=>[">>> AgCharts.updateUserDelta() user delta",Ka(i)]),Kl.createOrUpdate({proxy:e,deltaOptions:i,stripSymbols:n,apiStartTime:s})}static createChartInstance(e,i){const s=i?.destroy({keepTransferableResources:!0}),n=Wo(e.processedOptions);return Em.getChartModule(n).create(e,s)}static getPool(e){if(e.pool===!0)return uU.getPool(e.presetType??"default",this.createChartInstance,this.detachAndClear,this.destroy,1/0)}};vs.caretaker=new sT(me),vs.callbackApi={caretaker:vs.caretaker,create(t,e,i,s,n){return vs.createOrUpdate({userOptions:t,processedOverrides:e,specialOverrides:i,optionsMetadata:s,data:n})},update(t,e,i,s){return vs.createOrUpdate({userOptions:t,proxy:e,specialOverrides:i,apiStartTime:s})},updateUserDelta(t,e,i){return vs.updateUserDelta(t,e,i)}},vs.markRemovedProperties=(t,e,i,s)=>{let n=s??!1;if(typeof t!="object"||t==null)return n;for(const a of rT(t))t[a]===void 0&&(Object.assign(t,{[a]:Symbol("UNSET")}),n||(n=!0));return n},vs.detachAndClear=t=>t.detachAndClear(),vs.destroy=t=>t.destroy();var zI=vs;import{ModuleRegistry as pU}from"ag-charts-core";var GI={};Un(GI,{APPROXIMATE_THRESHOLD:()=>FE,AbstractBarSeries:()=>DD,AbstractBarSeriesProperties:()=>Tl,AggregationManager:()=>cd,AnchoredPopover:()=>kM,ApproximateOrdinalTimeScale:()=>Vj,Arc:()=>Ds,Axis:()=>dp,AxisGroupZIndexMap:()=>Vx,AxisInterval:()=>ca,AxisLabel:()=>ue,AxisTick:()=>ha,BBox:()=>P,Background:()=>nr,BandScale:()=>Fi,BaseToolbar:()=>Mf,Caption:()=>Se,CartesianAxis:()=>jo,CartesianCrossLine:()=>Nt,CartesianSeries:()=>Tn,CartesianSeriesNodeEvent:()=>Ug,CartesianSeriesProperties:()=>Xi,CategoryAxis:()=>Al,CategoryScale:()=>fr,Chart:()=>sh,ChartAxes:()=>dc,ChartOptions:()=>vl,CollapseMode:()=>PD,ColorScale:()=>Za,ContextMenuRegistry:()=>jb,ContinuousScale:()=>re,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>Jr,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>Qr,DEFAULT_POLAR_DIRECTION_KEYS:()=>tM,DEFAULT_POLAR_DIRECTION_NAMES:()=>iM,DOMElementProxy:()=>gc,DOMManager:()=>zy,DataController:()=>Mx,DataModel:()=>zu,DataModelSeries:()=>Gg,DataSet:()=>Bo,DiscreteTimeAxis:()=>cM,DraggablePopover:()=>wM,DropShadow:()=>Is,ExtendedPath2D:()=>Xa,FillGradientDefaults:()=>rn,FillImageDefaults:()=>Ts,FillPatternDefaults:()=>je,FloatingToolbar:()=>l4,FormatManager:()=>hr,Group:()=>U,GroupWidget:()=>Xy,HierarchyHighlightState:()=>aM,HierarchyNode:()=>Mj,HierarchySeries:()=>Aj,HierarchySeriesProperties:()=>wn,HighlightManager:()=>Yb,HighlightProperties:()=>Cs,HighlightState:()=>Kb,Image:()=>so,InteractionManager:()=>db,InteractionState:()=>hb,LARGEST_KEY_INTERVAL:()=>zb,Label:()=>li,LabelStyle:()=>oi,LayoutElement:()=>ep,Line:()=>ri,LinearScale:()=>Va,LogScale:()=>Vg,Marker:()=>We,Menu:()=>e4,MercatorScale:()=>Cj,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Vi,NativeWidget:()=>rr,NiceMode:()=>_x,Node:()=>Ms,OrdinalTimeScale:()=>hn,PHASE_METADATA:()=>Lo,PanToBBoxScalingModeEnum:()=>cx,Path:()=>Ue,PointerEvents:()=>Zm,PolarAxis:()=>xf,PolarSeries:()=>gf,QuadtreeNearest:()=>QI,RadialColumnShape:()=>Ji,Range:()=>ls,Rect:()=>He,Rotatable:()=>Ja,RotatableText:()=>Oy,SMALLEST_KEY_INTERVAL:()=>Bb,Scalable:()=>ic,ScalableGroup:()=>xL,Scene:()=>xc,Sector:()=>At,SectorBox:()=>yM,SegmentedPath:()=>Bg,Selection:()=>Re,Series:()=>Zo,SeriesItemHighlightStyle:()=>an,SeriesMarker:()=>zt,SeriesNodeEvent:()=>Jc,SeriesNodePickMode:()=>Lv,SeriesProperties:()=>_i,SeriesTooltip:()=>js,Shape:()=>$n,SliderWidget:()=>Iu,StopProperties:()=>Qd,SvgPath:()=>fM,Text:()=>Ht,TimeAxisParentLevel:()=>qr,TimeScale:()=>mr,Toolbar:()=>a4,ToolbarButtonWidget:()=>EM,ToolbarWidget:()=>bc,TooltipManager:()=>Lc,Transformable:()=>fe,TransformableGroup:()=>er,TransformableText:()=>sr,Translatable:()=>Qa,TranslatableGroup:()=>mt,TranslatableSvgPath:()=>Fj,UnitTimeScale:()=>dn,ZoomManager:()=>bx,accumulativeValueProperty:()=>Gu,addHitTestersToQuadtree:()=>Xh,adjustLabelPlacement:()=>hD,angleCategoryAxisOptionsDefs:()=>ag,angleNumberAxisOptionsDefs:()=>w0,animationValidation:()=>_o,annotationCalloutStylesDefs:()=>US,annotationChannelTextDefs:()=>_S,annotationCommentStylesDefs:()=>HS,annotationCrossLineStyleDefs:()=>xg,annotationDisjointChannelStyleDefs:()=>zS,annotationFibonacciStylesDefs:()=>vg,annotationLineStyleDefs:()=>Eh,annotationLineTextDefs:()=>Oh,annotationMeasurerStylesDefs:()=>Rh,annotationNoteStylesDefs:()=>jS,annotationOptionsDef:()=>Ur,annotationParallelChannelStyleDefs:()=>GS,annotationQuickMeasurerStylesDefs:()=>WS,annotationShapeStylesDefs:()=>Sg,annotationTextStylesDef:()=>ul,boxPlotSeriesThemeableOptionsDef:()=>qS,buildResetPathFn:()=>uf,calculateDataDiff:()=>QD,calculateLabelTranslation:()=>kj,calculateSegments:()=>Hh,candlestickSeriesThemeableOptionsDef:()=>QS,checkCrisp:()=>KD,chordSeriesThemeableOptionsDef:()=>eI,clippedRoundRect:()=>cc,collapsedStartingBarPosition:()=>wl,computeBarFocusBounds:()=>nf,computeMarkerFocusBounds:()=>ad,coneFunnelSeriesThemeableOptionsDef:()=>tI,createDatumId:()=>yt,diff:()=>Cc,drawCorner:()=>Do,drawMarkerUnitPolygon:()=>Xo,findNodeDatumInArray:()=>qb,findQuadtreeMatch:()=>qh,fixNumericExtent:()=>jt,fromToMotion:()=>Ee,funnelSeriesThemeableOptionsDef:()=>iI,generateTicks:()=>pv,getColorStops:()=>ly,getCrossLineValue:()=>Rx,getItemId:()=>qc,getItemStyles:()=>$u,getItemStylesPerItemId:()=>vE,getLabelStyles:()=>Ba,getMarkerStyles:()=>rd,getMissCount:()=>Tb,getRadialColumnWidth:()=>SM,getShapeFill:()=>Tv,getShapeStyle:()=>Cp,groupAccumulativeValueProperty:()=>sa,hasDimmedOpacity:()=>Ku,heatmapSeriesThemeableOptionsDef:()=>sI,initialStatePickedOptionsDef:()=>cb,interpolatePoints:()=>kl,isTooltipValueMissing:()=>ga,keyProperty:()=>nn,makeSeriesTooltip:()=>Ga,mapLineBackgroundSeriesThemeableOptionsDef:()=>rI,mapLineSeriesThemeableOptionsDef:()=>aI,mapMarkerSeriesThemeableOptionsDef:()=>oI,mapShapeBackgroundSeriesThemeableOptionsDef:()=>cI,mapShapeSeriesThemeableOptionsDef:()=>lI,markerEnabled:()=>cf,markerFadeInAnimation:()=>Rl,markerSwipeScaleInAnimation:()=>lf,midpointStartingBarPosition:()=>uj,minimumTimeAxisDatumGranularity:()=>aD,motion:()=>h4,nightingaleSeriesThemeableOptionsDef:()=>hI,normaliseGroupTo:()=>Mc,ohlcSeriesThemeableOptionsDef:()=>nI,ordinalTimeAxisOptionsDefs:()=>Pr,pairUpSpans:()=>Nl,pathFadeInAnimation:()=>df,pathMotion:()=>hd,pathSwipeInAnimation:()=>hf,plotAreaPathFill:()=>qD,plotInterpolatedLinePathStroke:()=>td,plotLinePathStroke:()=>ef,predictCartesianFinancialAxis:()=>mU,predictCartesianNonPrimitiveAxis:()=>Dl,prepareAreaFillAnimationFns:()=>JD,prepareBarAnimationFunctions:()=>Ol,prepareLinePathPropertyAnimation:()=>tf,processedDataIsAnimatable:()=>Mi,pyramidSeriesThemeableOptionsDef:()=>dI,radarAreaSeriesThemeableOptionsDef:()=>uI,radarLineSeriesThemeableOptionsDef:()=>pI,radialBarSeriesThemeableOptionsDef:()=>gI,radialColumnSeriesThemeableOptionsDef:()=>fI,radiusCategoryAxisOptionsDefs:()=>E0,radiusNumberAxisOptionsDefs:()=>O0,rangeAreaSeriesThemeableOptionsDef:()=>bI,rangeBarSeriesThemeableOptionsDef:()=>vI,resetAxisLabelSelectionFn:()=>Uc,resetBarSelectionsDirect:()=>id,resetBarSelectionsFn:()=>El,resetLabelFn:()=>za,resetMarkerFn:()=>sd,resetMarkerPositionFn:()=>Pl,resetMarkerSelectionsDirect:()=>nd,resetMotion:()=>ot,sankeySeriesThemeableOptionsDef:()=>SI,sectorBox:()=>uM,seriesLabelFadeInAnimation:()=>Te,seriesLabelFadeOutAnimation:()=>$h,stackCartesianSeries:()=>lD,standaloneChartOptionsDefs:()=>kw,sunburstSeriesThemeableOptionsDef:()=>II,toHierarchyHighlightString:()=>_l,toHighlightString:()=>ur,topologyChartOptionsDefs:()=>Nw,trailingAccumulatedValueProperty:()=>WO,treemapSeriesThemeableOptionsDef:()=>DI,updateClipPath:()=>od,updateLabelNode:()=>cD,upsertNodeDatum:()=>af,userInteraction:()=>WE,validateCrossLineValue:()=>Px,valueProperty:()=>ye,visibleRangeIndices:()=>Fo,waterfallSeriesThemeableOptionsDef:()=>MI});import{CARTESIAN_AXIS_TYPE as Il,CARTESIAN_POSITION as Uh,ChartAxisDirection as Us,isArray as gU,isDate as UI,isEmptyObject as fU,isNumber as HI,isObject as jI,isString as WI}from"ag-charts-core";function YI(t){return t.isReversed()!==t.range[1]YI(c?e:i)?c?s.width+u:s.height+p:c?-u:-p,f=()=>YI(c?e:i)?c?-u:-p:c?s.width+u:s.height+p;return(b=>{const x=[];let v=-1;for(let S=0;Sw.start!=null)?.start;let L=o.convert(M??C)-d,k=o.convert(D??T)+2*d;const O=M!=null&&Number.isNaN(L),N=D!=null&&Number.isNaN(k);O||N||(Number.isNaN(L)&&(L=g()),Number.isNaN(k)&&(k=f()),D!=null&&(v=S),x.push({start:L,stop:k,...A}))}return x})(t.segments).map(({stop:b,start:x,...v})=>{const S=c?x:-u,I=c?-p:x,M=c?b+h:s.width+u,D=c?s.height+p:b+h;return{clipRect:{x0:S,y0:I,x1:M,y1:D},...v}})}var $I=new Set(["time","timestamp","date","datetime"]);function Pg(t,e,i,{allowPrimitiveTypes:s=!0}={}){if(t!==Us.X&&t!==Us.Y||!jI(e))return;const n=KI(t,i);if(n==null||!(n in e))return;const a=e[n],r=ZI(t,i),o=yU(a);if(o)return{type:o,position:r};const l=bU(n,a);if(l)return{type:l,position:r};if(s)return typeof a=="number"?{type:Il.NUMBER,position:r}:{type:Il.CATEGORY,position:r}}function Dl(t,e,i){return Pg(t,e,i,{allowPrimitiveTypes:!1})}function mU(t,e,i){if(t!==Us.X||!jI(e))return;const s=KI(t,i);if(s==null||!(s in e))return;const n=e[s],a=ZI(t,i),r=xU(s,n);if(r)return{type:r,position:a};if(WI(n))return{type:"category",position:a}}function yU(t){if(gU(t)&&t.every(e=>WI(e)||e===null))return Il.GROUPED_CATEGORY}function bU(t,e){if(UI(e)||$I.has(t)&&HI(e))return Il.TIME}function xU(t,e){if(UI(e)||$I.has(t)&&HI(e))return Il.ORDINAL_TIME}function KI(t,e){if(t===Us.X&&"xKey"in e)return e.xKey;if(t===Us.Y&&"yKey"in e)return e.yKey}function ZI(t,e){return"direction"in e&&e.direction==="horizontal"?t===Us.X?Uh.LEFT:Uh.BOTTOM:t===Us.X?Uh.BOTTOM:Uh.LEFT}import{ChartAxisDirection as ne,Debug as vU,DebugMetrics as SU,Logger as IU,Property as Ml,StateMachine as DU,extractDomain as XI,findMaxIndex as MU,findMinIndex as AU,findMinMax as jh,isFiniteNumber as Wh}from"ag-charts-core";import{createTicks as CU,findMinMax as qI,findRangeExtent as TU,isDenseInterval as LU,isInteger as NU,range as kU}from"ag-charts-core";var wU={2:(t,e)=>Math.log2(e),[Math.E]:(t,e)=>Math.log(e),10:(t,e)=>Math.log10(e)},OU=(t,e)=>Math.log(e)/Math.log(t);function _g(t,e,i){const s=Math.min(...e),n=wU[t]??OU;return s>=0?n(t,i):-n(t,-i)}var EU={[Math.E]:(t,e)=>Math.exp(e),10:(t,e)=>e>=0?10**e:1/10**-e},RU=(t,e)=>t**e;function Fg(t,e,i){const s=Math.min(...e),n=EU[t]??RU;return s>=0?n(t,i):-n(t,-i)}var Vg=class _C extends re{constructor(e=[1,10],i=[0,1]){super(e,i),this.type="log",this.defaultClamp=!0,this.base=10,this.log=s=>_g(this.base,this.domain,s),this.pow=s=>Fg(this.base,this.domain,s)}static is(e){return e instanceof _C}transform(e){const[i,s]=qI(this.domain);return i>=0!=s>=0?Number.NaN:i>=0?Math.log(e):-Math.log(-e)}transformInvert(e){const[i,s]=qI(this.domain);return i>=0!=s>=0?Number.NaN:i>=0?Math.exp(e):-Math.exp(-e)}toDomain(e){return e}niceDomain(e,i=this.domain){if(i.length<2)return[];const{base:s}=this,[n,a]=i,r=n>a?Math.ceil:Math.floor,o=n>a?Math.floor:Math.ceil,l=Fg(s,i,r(_g(s,i,n))),c=Fg(s,i,o(_g(s,i,a)));return[e.nice[0]?l:i[0],e.nice[1]?c:i[1]]}ticks({interval:e,tickCount:i=re.defaultTickCount},s=this.domain,n){if(!s||s.length<2||i<1)return;const a=this.base,[r,o]=s,l=Math.min(r,o),c=Math.max(r,o);let h=this.log(l),d=this.log(c);if(e){const m=M=>M>=l&&M<=c,b=Math.min(Math.abs(e),Math.abs(d-h)),{ticks:x,count:v,firstTickIndex:S}=kU(h,d,b,n),I=x.map(this.pow).filter(m);if(!LU(I.length,this.getPixelRange()))return{ticks:I,count:v,firstTickIndex:S}}if(!NU(a)||d-h>=i){const m=Math.min(d-h,i),{ticks:b,count:x,firstTickIndex:v}=CU(h,d,m,void 0,void 0,n);return{ticks:b.map(this.pow),count:x,firstTickIndex:v}}const u=[],p=l>0;h=Math.floor(h)-1,d=Math.round(d)+1;const g=TU(this.range)/i;let f=1/0;for(let m=h;m<=d;m++){const b=this.convert(this.pow(m+1));for(let x=1;x=g&&D>=g;S>=l&&S<=c&&(x===1||A||u.length===0)&&(u.push(S),f=I)}}return sy(u,p,n)}};import{SceneRefChangeDetection as PU,getPath2D as _U}from"ag-charts-core";import{SceneRefChangeDetection as FU,getPath2D as VU}from"ag-charts-core";var Bg=class extends Ue{constructor(){super(...arguments),this.segmentPath=new Ue}drawPath(t){if(!this.segments||this.segments.length===0){super.drawPath(t);return}t.save();const e=VU(),i=new e;Xr(i,{x0:0,y0:0,x1:t.canvas.width,y1:t.canvas.height},!1);for(const n of this.segments)Xr(i,n.clipRect);t.clip(i),super.drawPath(t),t.restore();const{segmentPath:s}=this;s.setProperties({opacity:this.opacity,visible:this.visible,lineCap:this.lineCap,lineJoin:this.lineJoin,pointerEvents:this.pointerEvents});for(const{clipRect:n,fill:a,stroke:r,...o}of this.segments){t.save(),s.path=this.path,s.setProperties(o),s.fill=this.fill==null?"none":a,s.stroke=this.stroke==null?"none":r;const l=new e;Xr(l,n),t.clip(l),s.drawPath(t),t.restore()}}};y([FU()],Bg.prototype,"segments",2);function Xr(t,{x0:e,y0:i,x1:s,y1:n},a=!0){const r=Math.min(e,s),o=Math.min(i,n),l=Math.max(e,s),c=Math.max(i,n);t.moveTo(r,o),a?(t.lineTo(l,o),t.lineTo(l,c),t.lineTo(r,c)):(t.lineTo(r,c),t.lineTo(l,c),t.lineTo(l,o)),t.closePath()}var JI=class extends mt{constructor(){super(...arguments),this.segments=[],this.scalablePath=new(ic(Ue))}renderInContext(t){if(!this.visible)return;const{ctx:e}=t;if(!this.segments||this.segments?.length===0)return super.renderInContext(t);e.save();const i=_U(),s=new i;Xr(s,{x0:0,y0:0,x1:e.canvas.width,y1:e.canvas.height},!1);for(const a of this.segments)Xr(s,a.clipRect);e.clip(s);for(const a of this.children())a.visible&&a.render(t);e.restore();const{scalablePath:n}=this;for(const{clipRect:a,...r}of this.segments){e.save();const o=new i;Xr(o,a),e.clip(o),n.setProperties(r);for(const l of this.children())!l.visible||!(l instanceof Ue)||(n.path=l.path,n.setProperties({opacity:l.opacity,lineCap:l.lineCap,lineJoin:l.lineJoin,...bL(l)&&{scalingX:l.scalingX,scalingY:l.scalingY,scalingCenterX:l.scalingCenterX,scalingCenterY:l.scalingCenterY}}),n.render(t));e.restore()}}};y([PU()],JI.prototype,"segments",2);import{nearestSquared as BU}from"ag-charts-core";var QI=class{constructor(t,e,i){this.root=new UU(t,e,i)}clear(t){this.root.clear(t)}addValue(t,e){const i={hitTester:t,value:e,distanceSquared:(s,n)=>t.distanceSquared(s,n)};this.root.addElem(i)}find(t,e){const i={best:{nearest:void 0,distanceSquared:1/0}};return this.root.find(t,e,i),i.best}},zU=class{constructor(t,e,i,s){this.nw=t,this.ne=e,this.sw=i,this.se=s}addElem(t){this.nw.addElem(t),this.ne.addElem(t),this.sw.addElem(t),this.se.addElem(t)}find(t,e,i){this.nw.find(t,e,i),this.ne.find(t,e,i),this.sw.find(t,e,i),this.se.find(t,e,i)}},GU=class{constructor(t,e,i){this.capacity=t,this.maxdepth=e,this.boundary=i??P.NaN,this.elems=[],this.subdivisions=void 0}clear(t){this.elems.length=0,this.boundary=t,this.subdivisions=void 0}addElem(t){this.addCondition(t)&&(this.subdivisions===void 0?this.maxdepth===0||this.elems.length1){const r=n>a?Math.ceil:Math.floor,o=n>a?Math.floor:Math.ceil,l=4;for(let c=0;cMath.min(r.minTimeInterval()??1/0,a),1/0);return Number.isFinite(n)?sD(n):rD(t,e,i,s)?.unit}function rD(t,e,i,s){let n=1/0,a=-1/0,r,o=0;const l=[];for(const u of t){if(!u.visible)continue;const{extent:p}=nD(u.getDomain(e));if(p.length===0)continue;const g=p[0].valueOf(),f=p.at(-1).valueOf();l.push(g,f),n=Math.min(n??1/0,g,f),a=Math.max(a??-1/0,g,f);const m=Math.abs(f-g);if(m===0)continue;const b=u.dataCount();if(o=Math.max(o,b),b<=1)continue;const x=m/(b-1);r=Math.min(r??1/0,x)}if(n=Math.min(n,i?.valueOf()??1/0,s?.valueOf()??1/0),a=Math.max(a,i?.valueOf()??-1/0,s?.valueOf()??-1/0),!Number.isFinite(n)||!Number.isFinite(a))return;r??(r=Math.abs(a-n)),r=Math.min(r,iH(l));const c=sD(r);let h=r/zg(c);o<=2?h=Math.floor(h):h=Math.round(h),h=Math.max(h,1);const d=h===1?void 0:QU(c,n);return{unit:c,step:h,epoch:d}}function iH(t){t.sort((i,s)=>i-s);let e=1/0;for(let i=1;i0&&(e=Math.min(e,Math.abs(n-s)))}return e}import{ChartAxisDirection as oD,clamp as sH,objectsEqual as nH}from"ag-charts-core";var Gg=class extends Zo{constructor({clipFocusBox:t,categoryKey:e,...i}){super(i),this.categoryKey=e,this.clipFocusBox=t??!0}dataCount(){return this.processedData?.dataSources?.get(this.id)?.data?.length??0}invalidDataCount(){return this.processedData?.invalidDataCount?.get(this.id)??0}missingDataCount(){return this.dataModel?.resolveMissingDataCount(this)??0}get hasData(){return Math.max(0,this.dataCount()-this.invalidDataCount()-this.missingDataCount())>0}getScaleInformation({xScale:t,yScale:e}){const i=re.is(t),s=re.is(e);return{isContinuousX:i,isContinuousY:s,xScaleType:t?.type,yScaleType:e?.type}}getModulePropertyDefinitions(){const t=this.axes[oD.X]?.scale,e=this.axes[oD.Y]?.scale;return this.moduleMap.mapModules(i=>i.getPropertyDefinitions(this.getScaleInformation({xScale:t,yScale:e}))).flat()}async requestDataModel(t,e,i){i.props.push(...this.getModulePropertyDefinitions());const{dataModel:s,processedData:n}=await t.request(this.id,e??Bo.empty(),i);return this.dataModel=s,this.processedData=n,this.events.emit("data-processed",{dataModel:s,processedData:n}),{dataModel:s,processedData:n}}isProcessedDataAnimatable(){const{processedData:t,ctx:e}=this;if(!t)return!1;const i=this.getNodeData();if(i!=null&&i.length>e.animationManager.maxAnimatableItems)return!1;const s=t.reduced?.animationValidation;if(!s)return!0;const{orderedKeys:n,uniqueKeys:a}=s;return n&&a}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}findNodeDatum(t){return qb(t,this.getNodeData(),this.data?.dataIdKey)}pickFocus(t){const e=this.getNodeData();if(e===void 0||e.length===0)return;const i=this.computeFocusDatumIndex(t,e);if(i===void 0)return;const{clipFocusBox:s}=this,n=e[i],a={...t,datumIndex:i},r=this.computeFocusBounds(a);if(r!==void 0)return{bounds:r,clipFocusBox:s,datum:n,datumIndex:i}}pickNodesExactShape(t){const e=super.pickNodesExactShape(t);return e.sort((i,s)=>i.datumIndex-s.datumIndex),e}isDatumEnabled(t,e){const{missing:i=!1,enabled:s=!0,focusable:n=!0}=t[e];return!i&&s&&n}computeFocusDatumIndex(t,e){const i=(r,o)=>{for(;r>=0&&!this.isDatumEnabled(e,r);)r+=o;return r===-1?void 0:r},s=(r,o)=>{for(;r0?n=s(a,t.datumIndexDelta):n=s(a,1)??i(a,-1),n===void 0?t.datumIndexDelta===0?void 0:t.datumIndex-t.datumIndexDelta:n}dataModelPropertyIsKey(t){const{processedData:e}=this;return e?e.defs.keys.some(i=>i.id===t&&i.idsMap?.get(this.id)?.has(t)===!0):!1}keysOrValues(t){const{dataModel:e,processedData:i}=this;return!e||!i?[]:this.dataModelPropertyIsKey(t)?e.resolveKeysById(this,t,i):e.resolveColumnById(this,t,i)}sortOrder(t){const{dataModel:e,processedData:i}=this;if(!(!e||!i))return this.dataModelPropertyIsKey(t)?e.getKeySortOrder(this,t,i):e.getColumnSortOrder(this,t,i)}getCategoryKey(){return this.categoryKey}getCategoryValue(t){const{processedData:e,dataModel:i}=this,s=this.getCategoryKey();return!e||!i||!s||(e.invalidData?.get(this.id)?.[t]??!1)?void 0:this.keysOrValues(s)[t]}datumIndexForCategoryValue(t){const{processedData:e,dataModel:i}=this,s=this.getCategoryKey();if(!e||!i||!s)return;t=t.valueOf();const n=e.invalidData?.get(this.id),a=this.keysOrValues(s);for(let r=0;rthis.nodeFactory()),this.highlightLabelSelection=Re.select(this.highlightLabelGroup,Ht),this.annotationSelections=new Set,this.seriesBelowStackContext=void 0,this.debug=vU.create(),!o||!l)throw new Error(`Unable to initialise series type ${this.type}`);this.opts={pathsPerSeries:t,pathsZIndexSubOrderOffset:e,propertyKeys:o,propertyNames:l,animationResetFns:r,animationAlwaysUpdateSelections:s,animationAlwaysPopulateNodeData:n,datumSelectionGarbageCollection:i,segmentedDataNodes:a},this.paths=t.map(h=>new Bg({name:`${this.id}-${h}`})),this.datumSelection=Re.select(this.dataNodeGroup,()=>this.nodeFactory(),i),this.animationState=new DU("empty",{empty:{update:{target:"ready",action:h=>this.animateEmptyUpdateReady(h)},reset:"empty",skip:"ready",disable:"disabled"},ready:{updateData:"waiting",clear:"clearing",highlight:h=>this.animateReadyHighlight(h),resize:h=>this.animateReadyResize(h),reset:"empty",skip:"ready",disable:"disabled"},waiting:{update:{target:"ready",action:h=>{this.ctx.animationManager.isSkipped()?this.resetAllAnimation(h):this.animateWaitingUpdateReady(h)}},reset:"empty",skip:"ready",disable:"disabled"},disabled:{update:h=>this.resetAllAnimation(h),reset:"empty"},clearing:{update:{target:"empty",action:h=>this.animateClearingUpdateEmpty(h)},reset:"empty",skip:"ready"}},this.checkProcessedDataAnimatable.bind(this)),this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",h=>this.onLegendItemClick(h)),this.ctx.eventsHub.on("legend:item-double-click",h=>this.onLegendItemDoubleClick(h)))}get contextNodeData(){return this._contextNodeData}getNodeData(){return this.contextNodeData?.nodeData}getKeyAxis(t){if(this.shouldFlipXY()){if(t===ne.X)return this.properties.yKeyAxis;if(t===ne.Y)return this.properties.xKeyAxis}if(t===ne.X)return this.properties.xKeyAxis;if(t===ne.Y)return this.properties.yKeyAxis}attachSeries(t,e,i){super.attachSeries(t,e,i),this.attachPaths(this.paths)}detachSeries(t,e,i){super.detachSeries(t,e,i),this.detachPaths(this.paths)}updatedDomains(){this.animationState.transition("updateData")}attachPaths(t){for(const e of t)this.contentGroup.appendChild(e)}detachPaths(t){for(const e of t)e.remove()}renderToOffscreenCanvas(){const t=this.getNodeData();return t!=null&&t.length>Hg}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"?this.animationState.transition("skip"):t==="disabled"&&this.animationState.transition("disable")}destroy(){super.destroy(),this._contextNodeData=void 0}isSeriesHighlighted(t){if(!this.properties.highlight.enabled)return!1;const{series:e,legendItemName:i}=t??{},{legendItemName:s}=this.properties;return e===this||s!=null&&s===i}strokewidthChange(){const t=("strokeWidth"in this.properties&&this.properties.strokeWidth)??0,e=this.properties.highlight.highlightedSeries.strokeWidth??t,i=this.properties.highlight.highlightedItem?.strokeWidth??t;return t>i||e>i}update({seriesRect:t}){const{_contextNodeData:e}=this,i=this.checkResize(t),s=this.updateHighlightSelection(),n=this;this.contentGroup.batchedUpdate(function(){const o=n.updateSelections(),l=n.contextNodeData?.segments;n.opts.segmentedDataNodes?n.dataNodeGroup.segments=l??n.dataNodeGroup.segments:n.dataNodeGroup.segments=void 0,n.updateNodes(s,i||o)});const a=this.getAnimationData(t,e);a&&(i&&this.animationState.transition("resize",a),this.animationState.transition("update",a),this.processedDataUpdated=!1)}createStackContext(){}canIncrementallyUpdateNodes(t=!1){if(this.contextNodeData?.nodeData==null)return!1;const{processedData:i}=this;return i?i.changeDescription!=null||!Mi(i)||t:!1}trimIncrementalNodeArray(t,e){e{this.labelSelection=this.updateLabelSelection({labelData:a,labelSelection:e})??e})}getShapeFillBBox(){const{axes:t}=this,e=t[ne.X],i=t[ne.Y],[s,n]=jh(e?.range??[0,1]),[a,r]=jh(i?.range??[0,1]),o=XI(this.getSeriesDomain(ne.X)),l=[e?.scale.convert(o.at(0)),e?.scale.convert(o.at(-1))],c=XI(this.getSeriesDomain(ne.Y)),h=[i?.scale.convert(c.at(0)),i?.scale.convert(c.at(-1))],[d,u]=jh(l),[p,g]=jh(h);return{axis:new P(s,a,n-s,r-a),series:new P(d,p,u-d,g-p)}}updateNodes(t,e){const{highlightSelection:i,datumSelection:s}=this,n=!this.ctx.animationManager.isSkipped(),a=this.visible&&this._contextNodeData!=null;this.contentGroup.visible=n||a,this.annotationGroup.visible=n||a,this.highlightGroup.visible=(n||a)&&t,this.updateDatumStyles({datumSelection:i,isHighlight:!0});const r=this.ctx.chartService.highlight?.drawingMode??"overlay";this.updateDatumNodes({datumSelection:i,isHighlight:!0,drawingMode:r}),this.highlightLabelGroup.batchedUpdate(()=>{this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})}),this.animationState.transition("highlight",i),this.ctx.eventsHub.emit("highlight:selection-updated",{highlightSelection:i});const{dataNodeGroup:o,labelSelection:l,paths:c,labelGroup:h}=this,{itemId:d}=this.contextNodeData??{};if(this.updatePathNodes({itemId:d,paths:c,visible:a,animationEnabled:n}),o.visible=n||a,h.visible=a,!o.visible)return;this.hasItemStylers()&&this.updateDatumStyles({datumSelection:s,isHighlight:!1});const u=this.strokewidthChange()||this.hasChangesOnHighlight;(e||u)&&(this.updateDatumNodes({datumSelection:s,isHighlight:!1,drawingMode:"overlay"}),this.usesPlacedLabels||this.labelGroup.batchedUpdate(()=>{this.updateLabelNodes({labelSelection:l,isHighlight:!1})}))}getHighlightData(t,e){return e?[{...e}]:void 0}getHighlightLabelData(t,e){const i=t.filter(s=>s.datum===e.datum&&s.itemId===e.itemId);return i.length===0?void 0:i}updateHighlightSelection(){const{highlightSelection:t,highlightLabelSelection:e,_contextNodeData:i}=this;if(!i)return!1;const s=this.ctx.highlightManager?.getActiveHighlight(),a=this.isSeriesHighlighted(s)&&s?.datum?s:void 0;if(a==null)return!1;const{nodeData:r,labelData:o}=i,l=this.getHighlightData(r,a);this.highlightSelection=this.updateHighlightSelectionItem({items:l,highlightSelection:t});const c=this.getHighlightLabelData(o,a)??[];return this.highlightLabelSelection=this.updateLabelSelection({labelData:c,labelSelection:e})??e,!0}markQuadtreeDirty(){this.quadtree=void 0}*datumNodesIter(){for(const{node:t}of this.datumSelection)t.datum.missing!==!0&&(yield t)}getQuadTree(){if(this.quadtree===void 0){const t=this.ctx.scene?.canvas??{width:0,height:0},e=new P(0,0,t.width,t.height);this.quadtree=new QI(100,10,e),this.initQuadTree(this.quadtree)}return this.quadtree}initQuadTree(t){}pickViewportFocus(t){if(this.contextNodeData?.nodeData===void 0)return;const{otherIndex:e,where:i,hoverRect:s}=t;if(i==="data-start")return this.pickFocus({datumIndex:0,datumIndexDelta:0,otherIndex:e,otherIndexDelta:0});if(i==="data-end"){const x=this.contextNodeData.nodeData.length-1;return this.pickFocus({datumIndex:x,datumIndexDelta:0,otherIndex:e,otherIndexDelta:0})}let n,a=0,r,o=this.contextNodeData.nodeData.length-1;const l=this.axes.x?.reverse??!1;function c(x){const v=s.x+s.width;return x.x+x.width<=v}function h(x){return x.x>=s.x}function d(x,v){const S=wp(v);x(S)?(n=v,o=r-1):a=r+1}function u(x,v){const S=wp(v);x(S)?(n=v,a=r+1):o=r-1}const p={"viewport-start + true":{predicate:c,iterator:d},"viewport-start + false":{predicate:h,iterator:d},"viewport-end + true":{predicate:h,iterator:u},"viewport-end + false":{predicate:c,iterator:u}},{predicate:g,iterator:f}=p[`${i} + ${l}`];let m=0;const b=Math.ceil(Math.log2(this.contextNodeData.nodeData.length))+1;for(;a<=o&&m<=b;){r=Math.floor((a+o)/2);const x=this.pickFocus({datumIndex:r,datumIndexDelta:0,otherIndex:e,otherIndexDelta:0});if(x===void 0){IU.error(`pickFocus (datumIndex: ${r}) failed`);return}f(g,x),m++}return n}pickNodeDataExactShape(t){const{x:e,y:i}=t,{dataNodeGroup:s}=this,n=s.pickNodes(e,i).filter(a=>a.datum.missing!==!0);if(n.length!==0)return n.map(r=>r.datum)}pickModulesExactShape(t){for(const e of this.moduleMap.modules()){const{datum:i}=e.pickNodeExact(t)??{};if(i!=null&&i?.missing!==!0)return[i]}}pickNodesExactShape(t){const e=super.pickNodesExactShape(t);return e.length!==0?e:this.pickNodeDataExactShape(t)??this.pickModulesExactShape(t)??[]}pickNodeDataClosestDatum(t){const{x:e,y:i}=t,{axes:s,_contextNodeData:n}=this;if(!n)return;const a=s[ne.X],r=s[ne.Y],o={x:e,y:i};let l=1/0,c;for(const h of n.nodeData){const{point:{x:d=Number.NaN,y:u=Number.NaN}={}}=h;if(Number.isNaN(d)||Number.isNaN(u)||!(a?.inRange(d)&&r?.inRange(u)))continue;const g=Math.max((o.x-d)**2+(o.y-u)**2,0);gg.isCategoryLike()).map(g=>g.direction);if(e&&c.length===0)return;const[h=ne.X]=c,d=[i,s];h!==ne.X&&d.reverse();const u=[1/0,1/0];let p;for(const g of a.nodeData){const{x:f=Number.NaN,y:m=Number.NaN}=g.point??g.midPoint??{};if(Number.isNaN(f)||Number.isNaN(m)||g.missing===!0)continue;const b=[o?.inRange(f,1),l?.inRange(m,1)];if(h!==ne.X&&b.reverse(),!b[0]||!r&&!b[1])continue;const x=[f,m];h!==ne.X&&x.reverse();let v=!0;for(let S=0;Su[S]){v=!1;break}else I{const h=i?.[c]??c;return this.xCoordinateRange(a[h],r,h)});return othis.keysOrValues(g));let u=1/0,p=-1/0;for(const[g,f]of c.entries()){const[m,b]=this.xCoordinateRange(f,0,g);if(!(bl))for(let x=0;xp?[Number.NaN,Number.NaN]:[u,p]}domainForClippedRange(t,e,i){const{processedData:s,dataModel:n,axes:a}=this,r=t===ne.X?ne.Y:ne.X,o=aH(a[r]);if(!o)return e.flatMap(f=>n.getDomain(this,f,"value",s).domain);const l=this.keysOrValues(i),c=this.sortOrder(i);if(c!=null){const f=rH(c,l.length,o,m=>l[m]);return n.getDomainBetweenRange(this,e,f,s)}const h=e.map(f=>this.keysOrValues(f)),d=o[0].valueOf(),u=o[1].valueOf();let p=1/0,g=-1/0;for(const[f,m]of l.entries()){const b=m.valueOf();if(!(bu))for(let x=0;xg?[Number.NaN,Number.NaN]:[p,g]}zoomFittingVisibleItems(t,e,i,s,n){const{dataModel:a,processedData:r}=this;if(!a||!r)return;const o=this.axes[ne.X];if(s!=null)return;const l=this.sortOrder(t);if(l==null)return;const c=this.keysOrValues(t);if(n>c.length)return{x:[0,1],y:void 0};const h=o.scale,d=h.range;h.range=[0,1];let[u,p]=this.visibleRangeIndices(t,i,void 0,{sortOrder:l});p-=1;const g=0;this.xCoordinateRange(c[u],g,u)[0]i[1]&&(p-=1);let f;if(Math.abs(p-u)>=n-1)f=i;else{const m=(i[0]+i[1])/2;for(;Math.abs(p-u)0||pa.resolveColumnById(this,D,r)),c=this.shouldFlipXY(),h=c?this.axes[ne.Y]:this.axes[ne.X],d=c?this.axes[ne.X]:this.axes[ne.Y],u=c?s??[0,1]:i,p=c?i:s??[0,1];if(s==null){const D=this.sortOrder(t);if(D!=null){const A=h.scale,C=A.range;A.range=[0,1];const T=this.keysOrValues(t);let[L,k]=this.visibleRangeIndices(t,u,void 0,{sortOrder:D});if(k-=1,ku[1]&&(k-=1);const N=Math.abs(k-L)+1;return A.range=C,N}}const g=(D,A,C)=>D[0]+(C-A[0])/(A[1]-A[0])*(D[1]-D[0]),f=h.range.toSorted(),m=d.range.toSorted(),b=g(f,h.visibleRange,u[0]),x=g(f,h.visibleRange,u[1]),v=g(m,d.visibleRange,Math.min(...p)),S=g(m,d.visibleRange,Math.max(...p)),I=Math.round((u[0]+(u[1]-u[0])/2)*o.length),M=0;return xE(0,o.length-1,I,n,D=>{const[A,C]=this.xCoordinateRange(o[D],M,D),[T,L]=this.yCoordinateRange(l.map(k=>k[D]),M,D);return!Wh(A)||!Wh(C)||!Wh(T)||!Wh(L)?!1:A>=b&&C<=x&&T>=v&&L<=S})}minTimeInterval(){let t;try{t=this.keysOrValues("xValue")}catch{}if(t==null||t.length>1e3)return;let e=1/0,i=t[0],s;for(let n=1;nt.convert(s),domain:[i[0],i[1]],range:[e[0],e[1]]}}else if(t instanceof re){const{range:e,domain:i}=t;return{type:"continuous",domain:[i[0],i[1]],range:[e[0],e[1]]}}else if(t instanceof Fi){if(t instanceof dn){const e=t.getLinearParams(),i=t.getBandCountForUpdate();if(e!=null&&i>0)return{type:"category",variant:"unit-time",firstBandTime:e.firstBandTime,lastBandTime:e.firstBandTime+(i-1)*e.intervalMs,bandCount:i,intervalMs:e.intervalMs,inset:t.inset,step:t.step}}return{type:"category",domain:t.domain,inset:t.inset,step:t.step}}}calculateScaling(){const t={};for(const e of Object.values(ne)){const i=this.axes[e];if(!i)continue;const s=this.getScaling(i.scale);s!=null&&(t[e]=s)}return t}};function aH(t){let e,i;if((t instanceof vi||t instanceof Ss)&&({min:e,max:i}=t),!(e==null&&i==null))return e??(e=-1/0),i??(i=1/0),[e,i]}function rH(t,e,i,s){const n=i[0].valueOf(),a=i[1].valueOf();let r=AU(0,e-1,l=>{const c=t===1?l:e-l,h=s(c)?.valueOf();return!Number.isFinite(h)||h>=n}),o=MU(0,e-1,l=>{const c=t===1?l:e-l,h=s(c)?.valueOf();return!Number.isFinite(h)||h<=a});return r==null||o==null?[0,0]:(t===-1&&([r,o]=[e-o,e-r]),r=Math.max(r,0),o=Math.min(o+1,e),[r,o])}function lD(t){const e=new Map;for(const i of t){if(!(i instanceof Tn))continue;const n=(i.seriesGrouping?.stackCount??0)>0?i.seriesGrouping?.groupIndex:void 0;if(n==null){i.seriesBelowStackContext=void 0,i.createStackContext();continue}const a=`${i.type}-${n}`;let r=e.get(a);r==null&&(r=[],e.set(a,r)),r.push(i)}for(const i of e.values()){i.sort((n,a)=>(n.seriesGrouping?.stackIndex??0)-(a.seriesGrouping?.stackIndex??0));let s;for(const n of i)n.seriesBelowStackContext=s,s=n.createStackContext()}}import{mergeDefaults as oH}from"ag-charts-core";function Ba(t,e,i,s,n,a,r=["series",`${t.declarationOrder}`,"label"]){if(t.visible&&s.itemStyler){const o=t.getHighlightStateString(a,n||e!=null&&a?.series===e.series&&a?.datumIndex===e.datumIndex,e?.datumIndex),l=typeof e?.datumIndex=="number"?e.datumIndex:e?.itemId,c={border:s.border,color:s.color,cornerRadius:s.cornerRadius,datum:e?.datum,enabled:s.enabled,fill:s.fill,fillOpacity:s.fillOpacity,fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight,itemId:l,itemType:e?.itemType,seriesId:t.id,padding:s.padding,highlightState:o},h=t.ctx.optionsGraphService.resolvePartial(r,t.cachedCallWithContext(s.itemStyler,{...i,...c}),{pick:!1})??{};return oH(h,c)}return s}function cD(t,e,i,s,n,a,r){if(t.visible&&s.enabled&&n){const o=Ba(t,e.datum,i,s,a,r);e.visible=!0,e.x=n.x,e.y=n.y,e.text=n.text,e.fill=o.color,e.setAlign(n),e.setFont(o),e.setBoxing(o)}else e.visible=!1}var lH={"inside-start":{inside:!0,direction:-1,textAlignment:1},"inside-end":{inside:!0,direction:1,textAlignment:-1},"outside-start":{inside:!1,direction:-1,textAlignment:-1},"outside-end":{inside:!1,direction:1,textAlignment:1}};function hD({isUpward:t,isVertical:e,placement:i,spacing:s=0,rect:n}){let a=n.x+n.width/2,r=n.y+n.height/2,o="center",l="middle";if(i!=="inside-center"){const c=(t?1:-1)*(e?-1:1),{direction:h,textAlignment:d}=lH[i],u=(h+1)*.5;if(e){const p=t?n.y+n.height:n.y,g=n.height*c;r=p+g*u+s*d*c,l=d===c?"top":"bottom"}else{const p=t?n.x:n.x+n.width,g=n.width*c;a=p+g*u+s*d*c,o=d===c?"left":"right"}}return{x:a,y:r,textAlign:o,textBaseline:l}}function Te({id:t},e,i,...s){for(const n of s)n.cleanup();Ns(t,e,i,s,{opacity:0},{opacity:1},{phase:"trailing"})}function $h({id:t},e,i,...s){Ns(t,e,i,s,{opacity:1},{opacity:0},{phase:"remove"})}function za(t){return{opacity:1}}import{ChangeDetectableProperties as cH,Property as qi,SceneChangeDetection as eo,SceneObjectChangeDetection as jg,TRIPLE_EQ as dD,objectsEqual as hH}from"ag-charts-core";var zt=class extends cH{constructor(){super(...arguments),this.enabled=!0,this.shape="circle",this.size=0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(){const{size:t,shape:e,fill:i,fillOpacity:s,stroke:n,strokeWidth:a,strokeOpacity:r,lineDash:o,lineDashOffset:l}=this;return{size:t,shape:e,fill:i,fillOpacity:s,stroke:n,strokeWidth:a,strokeOpacity:r,lineDash:o,lineDashOffset:l}}getDiameter(){return this.size+this.strokeWidth}};y([qi,eo()],zt.prototype,"enabled",2),y([qi,jg({equals:dD})],zt.prototype,"shape",2),y([qi,eo()],zt.prototype,"size",2),y([qi,jg({equals:hH})],zt.prototype,"fill",2),y([qi,eo()],zt.prototype,"fillOpacity",2),y([qi,eo()],zt.prototype,"stroke",2),y([qi,eo()],zt.prototype,"strokeWidth",2),y([qi,eo()],zt.prototype,"strokeOpacity",2),y([qi],zt.prototype,"lineDash",2),y([qi],zt.prototype,"lineDashOffset",2),y([qi,jg({equals:dD})],zt.prototype,"itemStyler",2);import{BaseProperties as uD,Property as Ln,callWithContext as dH,isDate as uH,isNumber as pH,isString as gH,mergeDefaults as pD,toTextString as fH}from"ag-charts-core";function mH(t,e){if(t!=null)return{enabled:t.enabled??!0,stroke:t.stroke??e?.stroke??"transparent",strokeWidth:t.strokeWidth??e?.strokeWidth??1,strokeOpacity:t.strokeOpacity??e?.strokeOpacity??1,lineDash:t.lineDash??e?.lineDash??[]}}var gD=class extends uD{constructor(){super(...arguments),this.enabled=!1}};y([Ln],gD.prototype,"enabled",2);var js=class extends uD{constructor(){super(...arguments),this.interaction=new gD,this.position=new xr,this.range=void 0,this.class=void 0}formatTooltip(t,e,i){const s=this.renderer==null?void 0:dH(t,this.renderer,i);if(gH(s)||pH(s)||uH(s))return{type:"raw",rawHtmlString:fH(s)};if(s!=null){const n=pD(s.symbol?.marker,e.symbol?.marker),a=s.symbol?.line??e.symbol?.line?pD(s.symbol?.line,e.symbol?.line):void 0,r=e.symbol||s.symbol?{marker:n,line:mH(a,n)}:void 0;return{type:"structured",...e,...s,symbol:r}}return{type:"structured",...e}}};y([Ln],js.prototype,"enabled",2),y([Ln],js.prototype,"showArrow",2),y([Ln],js.prototype,"renderer",2),y([Ln],js.prototype,"interaction",2),y([Ln],js.prototype,"position",2),y([Ln],js.prototype,"range",2),y([Ln],js.prototype,"class",2);function Ga(){return new js}import{ChartAxisDirection as Nn,Property as Wg,extent as yH,findMinMax as bH,isFiniteNumber as xH}from"ag-charts-core";import{ActionOnSet as vH,ChartUpdateType as SH,Property as Kh,ProxyPropertyOnWrite as IH,isFiniteNumber as fD}from"ag-charts-core";var Ws=class VC extends jo{constructor(e,i=new fr,s=!0){super(e,i),this.groupPaddingInner=.1,this.includeInvisibleDomains=s,this.nice=!1}static is(e){return e instanceof VC}isCategoryLike(){return!0}hasDefinedDomain(){return!1}normaliseDataDomain(e){return{domain:e.domain,clipped:!1}}getUpdateTypeOnResize(){return this.bandAlignment==null||this.bandAlignment==="justify"?super.getUpdateTypeOnResize():SH.PROCESS_DOMAIN}updateScale(){super.updateScale();let{paddingInner:e,paddingOuter:i}=this;if(!fD(e)||!fD(i)){const s=this.reduceBandScalePadding();e??(e=s.inner),i??(i=s.outer)}this.scale.paddingInner=e??0,this.scale.paddingOuter=i??0}calculateGridLines(e,i,s){const n=super.calculateGridLines(e,i,s);return this.interval.placement==="between"&&e.length>0&&n.push(super.calculateGridLine({index:e.at(-1).index+1,tickId:`after:${e.at(-1).tickId}`,translation:this.range[1]},e.length,i,s,e)),n}calculateGridLine({index:e,tickId:i,translation:s},n,a,r,o){const{gridLine:l,horizontal:c,interval:h,scale:d}=this;if(h.placement!=="between")return super.calculateGridLine({index:e,tickId:i,translation:s},n,a,r,o);const u=sa[0]+r.step/2,h=e.at(-1),d=n&&h.translationthis.calculateGridFill(u,p,u.index,i,s,e))),d){const u={tickId:`after:${h.tickId}`,translation:h.translation+r.step};o.push(this.calculateGridFill(u,e.length,h.index+1,i,s,e))}return o}calculateGridFill({tickId:e,translation:i},s,n,a,r,o){const{gridLine:l,horizontal:c,interval:h,scale:d}=this;if(h.placement!=="between")return super.calculateGridFill({tickId:e,translation:i},s,n,a,r,o);const u=i-d.step/2,p=i+d.step/2,[g,f,m,b]=c?[u,Math.max(a,r),p,Math.min(a,r)]:[Math.min(a,r),u,Math.max(a,r),p],{fill:x,fillOpacity:v}=l.style[n%l.style.length]??{};return{tickId:e,x1:g,y1:f,x2:m,y2:b,fill:x,fillOpacity:v}}calculateTickLines(e,i,s=0){const n=super.calculateTickLines(e,i,s);return this.interval.placement==="between"&&e.length>0&&n.push(super.calculateTickLine({isPrimary:!1,tickId:`after:${e.at(-1)?.tickId}`,translation:this.range[1]},e.length,i,e,s)),n}calculateTickLine({isPrimary:e,tickId:i,translation:s},n,a,r,o=0){const{horizontal:l,interval:c,primaryTick:h,scale:d,tick:u}=this;if(c.placement!=="between")return super.calculateTickLine({isPrimary:e,tickId:i,translation:s},n,a,r,o);const p=e&&h?.enabled?h:u,g=-a*this.getTickSize(p),f=s{const s=i.getBandScalePadding?.();return s&&(e.inner>s.inner&&(e.inner=s.inner),e.outertypeof g!="string")&&(e=e.map(String)),{type:"category",value:e,datum:r,seriesId:o,legendItemName:l,key:c,source:h,property:d,domain:u,boundSeries:p}}};Ws.className="CategoryAxis",Ws.type="category",y([Kh],Ws.prototype,"groupPaddingInner",2),y([Kh],Ws.prototype,"paddingInner",2),y([Kh],Ws.prototype,"paddingOuter",2),y([IH("layoutConstraints","align")],Ws.prototype,"bandAlignment",2),y([Kh],Ws.prototype,"skipNullBars",2),y([vH({newValue(t){t==null||t<=0?(this.layoutConstraints.width=100,this.layoutConstraints.unit="percent"):(this.layoutConstraints.width=t,this.layoutConstraints.unit="px",this.animationManager.skipCurrentBatch())}})],Ws.prototype,"requiredRange",2);var Al=Ws;import{BaseProperties as Yg,PropertiesArray as DH,Property as _e,angularPadding as mD,createIdsGenerator as MH,extent as AH,extractDomain as CH,getMaxInnerRectSize as TH,inRange as LH,isArray as NH,isObject as kH,isTruncated as wH,normalizeAngle360FromDegrees as yD,sortBasedOnArray as OH,toArray as EH,toPlainText as RH,wrapTextOrSegments as PH}from"ag-charts-core";var _H=1e3,bD=class BC extends fr{constructor(){super(...arguments),this.previousDomainJson=void 0,this.animatable=!0}static is(e){return e instanceof BC}set domain(e){if(e.length<=_H){const i=JSON.stringify(e);this.animatable=this.previousDomainJson===void 0||this.previousDomainJson===i,this.previousDomainJson=i}else this.animatable=this.previousDomainJson===void 0,this.previousDomainJson="";super.domain=e}get domain(){return super.domain}normalizeDomains(...e){const{domain:i}=super.normalizeDomains(...e);return{domain:i,animatable:!1}}findIndex(e){return super.findIndex(e)??this.getMatchIndex(e)}getMatchIndex(e){const i=JSON.stringify(e),s=this._domain.find(n=>JSON.stringify(n)===i);if(s!=null)return super.findIndex(s)}},FH=class zC{constructor(e="",i,s){this.label=e,this.parent=i,this.refId=s,this.position=0,this.subtreeLeft=Number.NaN,this.subtreeRight=Number.NaN,this.children=[],this.leafCount=0,this.prelim=0,this.mod=0,this.ancestor=this,this.change=0,this.shift=0,this.index=0,this.separatorDepth=0,this.leftmostLeaf=this,this.screen=0,this.depth=i?i.depth+1:0}insertTick(e,i){let s=this,n;for(let a=0;ah.label===r);if(c&&o)s=c,n=c;else{const h=new zC(r,s,i);h.index=l.length,l.push(h),o&&(s=h),n=h}}return n}getLeftSibling(){return this.index>0?this.parent?.children[this.index-1]:void 0}getLeftmostSibling(){return this.index>0?this.parent?.children[0]:void 0}nextLeft(){return this.children[0]}nextRight(){return this.children.at(-1)}getSiblings(){return this.parent?.children.filter((e,i)=>i!==this.index)??[]}};function VH(t){const e=t.reduce((n,a)=>Math.max(n,a.length),0),i=new FH,s=new Map;for(let n=0;n=0;s--){const n=t[s];n.prelim+=e,n.mod+=e,i+=n.change,e+=n.shift+i}}function UH(t,e){const i=t.getLeftSibling();if(i){let s=t,n=t,a=i,r=n.getLeftmostSibling(),o=n.mod,l=s.mod,c=a.mod,h=r.mod;for(;a.nextRight()&&n.nextLeft();){a=a.nextRight(),n=n.nextLeft(),r=r.nextLeft(),s=s.nextRight(),s.ancestor=t;const d=a.prelim+c-(n.prelim+o)+1;d>0&&(BH(zH(a,t,e),t,d),o+=d,l+=d),c+=a.mod,o+=n.mod,h+=r.mod,l+=s.mod}a.nextRight()&&!s.nextRight()?s.mod+=c-l:(n.nextLeft()&&!r.nextLeft()&&(r.mod+=o-h),e=t)}return e}function xD(t){const{children:e}=t;if(e.length){let[i]=e;for(const a of e)xD(a),i=UH(a,i);GH(t);const s=(e[0].prelim+e.at(-1).prelim)/2,n=t.getLeftSibling();n?(t.prelim=n.prelim+1,t.mod=t.prelim-s):t.prelim=s}else{const i=t.getLeftSibling();t.prelim=i?i.prelim+1:0}}function vD(t,e,i){t.position=t.prelim+e,t.separatorDepth=t.index===0?1+(t.parent?.separatorDepth??0):0,i.insertNode(t);for(const s of t.children)vD(s,e+t.mod,i)}function SD(t){const{children:e}=t;let i=0;for(const s of e)SD(s),s.children.length?i+=s.leafCount:i++;t.leafCount=i,e.length?(t.subtreeLeft=e[0].subtreeLeft,t.subtreeRight=e.at(-1).subtreeRight,t.position=(t.subtreeLeft+t.subtreeRight)/2,t.leftmostLeaf=e[0].leftmostLeaf):(t.subtreeLeft=t.position,t.subtreeRight=t.position)}function HH(t){const e=new jH,{root:i,tickNodes:s}=VH(t);return xD(i),vD(i,-i.prelim,e),SD(i),{layout:e,tickNodes:s}}var jH=class{constructor(){this.minPosition=1/0,this.maxPosition=-1/0,this.nodes=[],this.depth=0}insertNode(t){this.depththis.maxPosition&&(this.maxPosition=t.position),this.nodes.push(t)}scaling(t,e){let i=1;return t>0&&this.maxPosition!==this.minPosition&&(i=t/(this.maxPosition-this.minPosition)),e&&(i*=-1),i}resize(t,e,i,s){const n=Math.abs(t[1]-t[0])-e,a=this.scaling(n,t[0]>t[1]),r=i+s/2;let o=0;for(const l of this.nodes){const c=l.position*a;o>c&&(o=c),l.screen=c+r}for(const l of this.nodes)l.screen-=o}},Ua=5,Ot=class extends Yg{constructor(){super(...arguments),this.enabled=!0,this.border=new oa}};y([_e],Ot.prototype,"enabled",2),y([_e],Ot.prototype,"avoidCollisions",2),y([_e],Ot.prototype,"border",2),y([_e],Ot.prototype,"color",2),y([_e],Ot.prototype,"cornerRadius",2),y([_e],Ot.prototype,"spacing",2),y([_e],Ot.prototype,"rotation",2),y([_e],Ot.prototype,"wrapping",2),y([_e],Ot.prototype,"truncate",2),y([_e],Ot.prototype,"fill",2),y([_e],Ot.prototype,"fontStyle",2),y([_e],Ot.prototype,"fontWeight",2),y([_e],Ot.prototype,"fontSize",2),y([_e],Ot.prototype,"fontFamily",2),y([_e],Ot.prototype,"padding",2);var Zh=class extends Yg{constructor(){super(...arguments),this.enabled=!0}};y([_e],Zh.prototype,"enabled",2),y([_e],Zh.prototype,"width",2),y([_e],Zh.prototype,"stroke",2);var $g=class extends Yg{constructor(){super(...arguments),this.label=new Ot,this.tick=new Zh}};y([_e],$g.prototype,"label",2),y([_e],$g.prototype,"tick",2);var Cl=class extends Al{constructor(t){super(t,new bD),this.tickScale=new bD,this.computedLayout=void 0,this.tickTreeLayout=void 0,this.tickNodes=void 0,this.leafNodeToKey=void 0,this.ftdPositions=new Map,this.ftdCandidates=new Set,this.ftdKept=new Set,this.ftdByDepth=[],this.ftdStack=[],this.depthOptions=new DH($g),this.includeInvisibleDomains=!0,this.tickScale.paddingInner=1,this.tickScale.paddingOuter=0}getDepthOptionsMap(t){const e=[],{depthOptions:i,label:s}=this,n=this.horizontal?0:-90;for(let a=0;a{t.fill=e.color,t.text=e.text,t.textBaseline=e.textBaseline,t.textAlign=e.textAlign??"center",t.pointerEvents=e.textUntruncated==null?1:0,t.setFont(e),t.setBoxing(e)})}updateAxisLine(){this.computedLayout&&(this.lineNode.visible=this.line.enabled,this.lineNode.stroke=this.line.stroke,this.lineNode.strokeWidth=this.line.width)}computeLayout(){this.updateDirection(),this.updateScale();const{step:t}=this.scale,{title:e,label:i,range:s,depthOptions:n,horizontal:a,line:r}=this,o=this.chartLayout?.scrollbars?.[this.id],l=this.getScrollbarThickness(o),c=this.getTickSpacing();if(this.lineNode.datum=a?{x1:s[0],x2:s[1],y1:0,y2:0}:{x1:0,x2:0,y1:s[0],y2:s[1]},this.lineNode.setProperties({stroke:r.stroke,strokeWidth:r.enabled?r.width:0}),this.tickTreeLayout?.resize(this.scale.range,this.scale.step,this.scale.inset,this.scale.bandwidth),!this.tickTreeLayout?.depth)return{bbox:P.zero,spacing:0,tickSizeAtDepth:[],tickLabelLayout:[]};const{depth:h,nodes:d}=this.tickTreeLayout,u=a?-i.getSideFlag():i.getSideFlag(),p=[],g=new Map,f=new sr,m=this.getDepthOptionsMap(h),b=u*(m[0].spacing+l+c),x=this.tickFormatter(this.scale.domain,this.scale.domain,!1),v=new Map,S={};for(const[V,Z]of d.entries()){const Y=h-Z.depth;if(S[Y]??(S[Y]=0),!Z.children.length&&twe){g.delete(V);continue}}const Bn=f.getPlainText(),Qi=f.getBoxingProperties();p.push({text:Bn,textUntruncated:Y.truncatedText,visible:!0,tickId:T(Bn),range:this.scale.range,border:Qi.border,color:f.fill,cornerRadius:Qi.cornerRadius,fill:Qi.fill,fontFamily:f.fontFamily,fontSize:f.fontSize,fontStyle:f.fontStyle,fontWeight:f.fontWeight,padding:Qi.padding,rotation:f.rotation,rotationCenterX:f.rotationCenterX,rotationCenterY:f.rotationCenterY,textAlign:f.textAlign,textBaseline:f.textBaseline,x:f.x,y:f.y}),g.set(V,fe.toCanvas(f))}const k=(M[h-1]??0)+l+c,O=[this.lineNodeBBox(),P.merge(g.values()),new P(0,0,k*u,0)],N=P.merge(O),w=a?N.height:N.width,{spacing:R,scrollbarLayout:F}=this.applyScrollbarLayout(O,w,o);this.layout.labelThickness=w,this.layout.scrollbar=F,e.enabled&&O.push(this.titleBBox(this.scale.domain,R));const E=P.merge(O);return this.layoutCrossLines(),{bbox:E,spacing:R,tickSizeAtDepth:M,tickLabelLayout:p}}buildDepthsMap(t){const{tickNodes:e,tickScale:i,tickTreeLayout:s}=this;if(!s||!e)return new Map;const n=s.depth,a=new Map;for(const r of t){const o=e.get(r),l=o==null?n-1:Math.min(o.separatorDepth,n-1);a.set(r,l)}if(i.step1){const r=t.at(-1);if(r&&!e.has(r)){const o=t.at(-2),l=o?a.get(o):void 0;l!=null&&a.set(r,l)}}return a}filterTicksTopDown(t,e){const{tickScale:i,tickTreeLayout:s,tickNodes:n,leafNodeToKey:a}=this;if(!s||n==null||a==null)return{ticks:t,depthsMap:new Map};const r=i.range,o=i.step,l=i.inset,c=i.bandwidth,h=e?.[0]??0,d=e?.[1]??1,u=this.filterTickCache;if(u&&u.range0===r[0]&&u.range1===r[1]&&u.step===o&&u.inset===l&&u.bandwidth===c&&u.vr0===h&&u.vr1===d)return u.result;const p=N=>(this.filterTickCache={range0:r[0],range1:r[1],step:o,inset:l,bandwidth:c,vr0:h,vr1:d,result:N},N);if(i.step>=Ua)return p({ticks:t,depthsMap:this.buildDepthsMap(t)});const g=this.ftdPositions;g.clear();const f=this.ftdCandidates;f.clear();const m=this.ftdKept;m.clear();const b=this.ftdStack;b.length=0;const x=N=>(g.has(N)||g.set(N,i.convert(N)),g.get(N)),v=N=>{let w=0;for(const R of N)if(Number.isFinite(x(R))&&(w+=1,w>1))break;return w};let S=t;if(e!=null&&(e[0]!==0||e[1]!==1)){const N=i.domain,w=N.length;if(w>0){const R=Math.max(0,Math.floor(e[0]*w)-1),F=Math.min(w-1,Math.ceil(e[1]*w));if(t.length===0)S=N.slice(R,F+1);else{const E=N[R],V=N[F],Z=t[0],Y=t.at(-1),ze=E!=null&&E!==Z,Ge=V!=null&&V!==Y;if(ze||Ge){const ae=ze?[E]:[];ae.push(...t),Ge&&ae.push(V),S=ae}}}}if(v(S)<=1)return p({ticks:S,positions:g,depthsMap:this.buildDepthsMap(S)});for(const N of S)f.add(N);for(const N of S){let R=n.get(N)?.parent;for(;R?.parent;){const F=a.get(R.leftmostLeaf);F!=null&&f.add(F),R=R.parent}}const I=Math.max(0,s.depth-1),M=N=>Math.min(I,s.depth-N.depth),D=s.nodes[0];if(!D?.children.length)return p({ticks:S,positions:g,depthsMap:this.buildDepthsMap(S)});const A=this.ftdByDepth;for(const N of A)N.positions.length=0,N.ticks.length=0;const C=(N,w)=>{const R=N.at(-1);return R!=null&&w-R{for(let R=w+1;R<=I;R++)if(C(A[R].positions,N))return!1;return!C(A[w].positions,N)},L=(N,w,R)=>{const F=A[R];F.positions.push(N),F.ticks.push(w)},k=(N,w)=>{if(w!==0)for(let R=0;R0&&N-F.positions.at(-1)=0;N--){const w=D.children[N],R=a.get(w.leftmostLeaf);R!=null&&f.has(R)&&b.push(w)}for(;b.length;){const N=b.pop(),w=a.get(N.leftmostLeaf);if(w==null||!f.has(w))continue;const R=x(w);if(R==null||!Number.isFinite(R))continue;if(m.has(w)){for(let E=N.children.length-1;E>=0;E--)b.push(N.children[E]);continue}const F=M(N);if(T(R,F)){m.add(w),L(R,w,F),k(R,F);for(let E=N.children.length-1;E>=0;E--)b.push(N.children[E])}}for(const N of S){if(n.has(N))continue;const w=x(N);if(w==null||!Number.isFinite(w)||m.has(N))continue;const R=0;T(w,R)&&(m.add(N),L(w,N,R),k(w,R))}const O=S.filter(N=>m.has(N));return p({ticks:O,positions:g,depthsMap:this.buildDepthsMap(O)})}update(){if(!this.computedLayout)return;this.scale.animatable||this.moduleCtx.animationManager.skipCurrentBatch();const{tickScale:t,tick:e,gridLine:i,gridLength:s,visibleRange:n,tickTreeLayout:a}=this;if(!a)return;const{tickSizeAtDepth:r,spacing:o}=this.computedLayout,{depth:l}=a,c=this.chartLayout?.scrollbars?.[this.id],h=this.getScrollbarThickness(c),d=this.getTickSpacing(),{position:u,horizontal:p,gridPadding:g}=this,f=u==="bottom"||u==="right"?-1:1,m=g,b=f*s-g,x={nice:[!1,!1],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0};let{ticks:v}=t.ticks(x,void 0,n);const S=this.filterTicksTopDown(v,n);v=S.ticks;const{depthsMap:I}=S,M=A=>I.get(A)??l-1,D=v.map((A,C)=>({index:t.findIndex(A),tickId:yt(C,...A),translation:Math.round(S.positions?.get(A)??t.convert(A))}));this.gridLineGroupSelection.update(i.enabled&&s?this.calculateGridLines(D,m,b):[]),this.gridFillGroupSelection.update(i.enabled&&s?this.calculateGridFills(D,m,b):[]),this.tickLineGroupSelection.update(e.enabled?v.map((A,C)=>{const{tickId:T,translation:L}=D[C],k=M(A),O=this.depthOptions[k]?.tick,N=r[k]??0,w=O?.stroke??e.stroke,R=O?.enabled===!1?0:O?.width??e.width,F=-f*N,E=-f*(h+d),[V,Z,Y,ze]=p?[L,E,L,E+F]:[E,L,E+F,L];return{tickId:T,offset:L,x1:V,y1:Z,x2:Y,y2:ze,stroke:w,strokeWidth:R,lineDash:void 0}}):[]),this.updatePosition(),this.updateCategoryLabels(),this.updateAxisLine(),this.updateGridLines(),this.updateGridFills(),this.updateTickLines(),this.updateTitle(this.scale.domain,o),this.updateCrossLines(),this.resetSelectionNodes()}calculateLayout(t,e){this.chartLayout=e;const{tickSizeAtDepth:i,tickLabelLayout:s,spacing:n,bbox:a}=this.computeLayout();return this.computedLayout={tickSizeAtDepth:i,tickLabelLayout:s,spacing:n},{bbox:a,niceDomain:this.scale.domain}}onGridVisibilityChange(){super.onGridVisibilityChange(),this.tickLabelGroupSelection.clear()}updateScale(){super.updateScale(),this.tickScale.range=this.scale.range,this.scale.paddingOuter=this.scale.paddingInner/2}processData(){const{direction:t}=this,e=this.boundSeries.filter(l=>l.visible).flatMap(l=>CH(l.getDomain(t)));this.dataDomain={domain:AH(e)??this.filterDuplicateArrays(e),clipped:!1},this.isReversed()&&(this.dataDomain={...this.dataDomain,domain:this.dataDomain.domain.toReversed()});const i=this.dataDomain.domain.map(ID),{layout:s,tickNodes:n}=HH(i);this.tickTreeLayout=s,this.tickNodes=n,this.leafNodeToKey=new Map;for(const[l,c]of n)this.leafNodeToKey.set(c,l);this.filterTickCache=void 0,this.ftdByDepth=Array.from({length:Math.max(0,s.depth-1)+1},()=>({positions:[],ticks:[]}));const a=[];for(const l of this.tickTreeLayout.nodes)l.leafCount||l.refId==null||a.push(this.dataDomain.domain[l.refId]);const r=OH(this.dataDomain.domain,a);this.scale.domain=r;const o=r.map(ID);o.push([""]),this.tickScale.domain=o}filterDuplicateArrays(t){const e=new Set;return t.filter(i=>{const s=NH(i)?JSON.stringify(i):i;return e.has(s)?!1:(e.add(s),!0)})}};Cl.className="GroupedCategoryAxis",Cl.type="grouped-category",y([_e],Cl.prototype,"depthOptions",2);function ID(t){return EH(kH(t)&&"value"in t?t.value:t)}import{Logger as WH}from"ag-charts-core";function Xh(t,e){for(const i of e){const s=i.datum;s===void 0?WH.error("undefined datum"):t.addValue(i,s)}}function qh(t,e){const{x:i,y:s}=e,{nearest:n,distanceSquared:a}=t.getQuadTree().find(i,s);if(n!==void 0)return{datum:n.value,distance:Math.sqrt(a)}}var Tl=class extends Xi{constructor(){super(...arguments),this.direction="vertical",this.width=void 0,this.widthRatio=void 0}};y([Wg],Tl.prototype,"direction",2),y([Wg],Tl.prototype,"width",2),y([Wg],Tl.prototype,"widthRatio",2);var DD=class extends Tn{constructor(){super(...arguments),this.smallestDataInterval=void 0,this.largestDataInterval=void 0}padBandExtent(t,e){const i=typeof e=="boolean"?1:.5,s=xH(this.smallestDataInterval)?this.smallestDataInterval*i:0,n=yH(t)??[Number.NaN,Number.NaN];return typeof e=="boolean"?n[e?0:1]-=(e?1:-1)*s:(n[0]-=s,n[1]+=s),jt(n)}getBandScalePadding(){return{inner:.3,outer:.15}}shouldFlipXY(){return!this.isVertical()}isVertical(){return this.properties.direction==="vertical"}getBarDirection(){return this.shouldFlipXY()?Nn.X:Nn.Y}getCategoryDirection(){return this.shouldFlipXY()?Nn.Y:Nn.X}getValueAxis(){const t=this.getBarDirection();return this.axes[t]}getCategoryAxis(){const t=this.getCategoryDirection();return this.axes[t]}getMinimumRangeSeries(t){const{width:e}=this.properties;if(e==null||!this.getCategoryAxis())return;const{index:s}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);t[s]=Math.max(t[s]??0,e)}getMinimumRangeChart(t){if(t.length===0)return 0;const e=this.getCategoryAxis();if(!(e instanceof Cl||e instanceof Al))return 0;const i=this.data?.netSize()??0;if(i===0)return 0;const s=this.getBandScalePadding(),{paddingInner:n=s.inner,paddingOuter:a=s.outer,groupPaddingInner:r}=e,o=t.reduce((u,p)=>u+p,0),l=o/t.length,{visibleGroupCount:c}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this),h=o+r*l*(c-1),d=(i-n+a*2)/(1-n);return h*d}validateCreateNodeDataPreconditions(){const t=this.getCategoryAxis(),e=this.getValueAxis();if(!(!t||!e||!this.dataModel||!this.processedData))return{xAxis:t,yAxis:e}}getBandwidth(t,e){return re.is(t.scale)?t.scale.calcBandwidth(this.smallestDataInterval,e):t.scale.bandwidth??0}xCoordinateRange(t){const e=this.axes[this.getCategoryDirection()],i=e.scale,s=this.getBandwidth(e,0),n=re.is(i)?s*-.5:0,a=i.convert(t)+n;return[a,a+s]}yCoordinateRange(t){const i=this.axes[this.getBarDirection()].scale,s=t.map(n=>i.convert(n));if(s.length===1){const n=i.convert(0);return[Math.min(s[0],n),Math.max(s[0],n)]}return bH(s)}getBarDimensions(){const t=this.getCategoryAxis(),e=this.getBandwidth(t);this.ctx.seriesStateManager.updateGroupScale(this,e,t);const i=this.getBarWidth(),s=this.getBarOffset(i);let n=this.getGroupOffset();if(this.ctx.domManager.isRtl&&this.seriesGrouping!=null){const a=this.ctx.seriesStateManager.getGroupBandWidth(this);n=e-n-a}return{groupOffset:n,barOffset:s,barWidth:i}}getGroupOffset(){return this.ctx.seriesStateManager.getGroupOffset(this)}getBarOffset(t){const e=this.ctx.seriesStateManager.getGroupScale(this),i=this.getCategoryAxis();let s=0;re.is(i.scale)?s=-t/2:this.seriesGrouping==null&&e?s=(this.getGroupScaleRangeWidth(e)-t)/2:e&&this.properties.widthRatio!=null&&(s=(e.bandwidth-t)/2);const n=this.ctx.seriesStateManager.getStackOffset(this,t);return s+n}getBarWidth(){const{seriesGrouping:t}=this,{width:e}=this.properties;let{widthRatio:i}=this.properties;const s=this.ctx.seriesStateManager.getGroupScale(this),n=s?.bandwidth??0;if(t==null&&(i??(i=1)),i!=null){let a=e;return t==null&&a==null&&s&&(a=this.getGroupScaleRangeWidth(s)),a==null&&n<1&&s?s.rawBandwidth:(a??n)*i}return e??(n<1&&s?s.rawBandwidth:n)}getGroupScaleRangeWidth(t){let e=t.range[1]-t.range[0];return t.round&&e>0&&(e=Math.floor(e)),e}getDatumOffset(t){if(!this.processedData?.invalidData||!this.processedData?.missingData||!this.getCategoryAxis()?.skipNullBars)return 0;const e=this.ctx.seriesStateManager.getDatumOffset(this,this.processedData.invalidData,this.processedData.missingData,t);return this.ctx.domManager.isRtl?-e:e}resolveKeyDirection(t){return this.getBarDirection()===Nn.X?t===Nn.X?Nn.Y:Nn.X:t}initQuadTree(t){Xh(t,this.datumNodesIter())}pickNodeClosestDatum(t){return qh(this,t)}};import{SpanJoin as Jh,areScalingEqual as MD,isScaleValid as AD,linearPoints as YH,smoothPoints as $H,spanRange as KH,stepPoints as ZH}from"ag-charts-core";import{SpanJoin as Kg,solveBezier as XH,spanRange as Zg,splitBezier2D as qH}from"ag-charts-core";function qe(t,e,i){return(e-t)*i+t}function CD(t,e){const{x0:i,y0:s,x1:n,y1:a}=t,o=(a-s)/(n-i)*(e-i)+s;return{leftCp1x:i,leftCp1y:s,leftCp2x:e,leftCp2y:o,stepX:e,stepY0:o,stepY1:o,rightCp1x:e,rightCp1y:o,rightCp2x:n,rightCp2y:a}}function JH(t,e){const{cp0x:i,cp0y:s,cp1x:n,cp1y:a,cp2x:r,cp2y:o,cp3x:l,cp3y:c}=t,h=XH(i,n,r,l,e),[d,u]=qH(i,s,n,a,r,o,l,c,h),p=d[3].y;return{leftCp1x:d[1].x,leftCp1y:d[1].y,leftCp2x:d[2].x,leftCp2y:d[2].y,stepX:e,stepY0:p,stepY1:p,rightCp1x:u[1].x,rightCp1y:u[1].y,rightCp2x:u[2].x,rightCp2y:u[2].y}}function QH(t){const{x0:e,y0:i,x1:s,y1:n,stepX:a}=t;return{leftCp1x:(e+a)/2,leftCp1y:i,leftCp2x:(e+a)/2,leftCp2y:i,stepX:a,stepY0:i,stepY1:n,rightCp1x:(a+s)/2,rightCp1y:n,rightCp2x:(a+s)/2,rightCp2y:n}}function TD(t,e){return t.type==="linear"?CD(t,e):t.type==="cubic"?JH(t,e):t.type==="step"?QH(t):CD(t,e)}function LD(t,e,i,s,n,a,r){switch(e){case Kg.MoveTo:r?t.moveTo(n,a):t.moveTo(i,s);break;case Kg.LineTo:r?t.lineTo(n,a):t.lineTo(i,s);break;case Kg.Skip:break}}function ND(t,e,i,s,n,a){a?t.lineTo(e,i):t.lineTo(s,n)}function kD(t,e,i,s,n,a,r,o,l,c){c?t.cubicCurveTo(a,r,s,n,e,i):t.cubicCurveTo(s,n,a,r,o,l)}function wD(t,e,i,s,n,a,r){r?(t.lineTo(a,n),t.lineTo(a,i),t.lineTo(e,i)):(t.lineTo(a,i),t.lineTo(a,n),t.lineTo(s,n))}function ej(t,e,i,s,n,a,r){if(r){for(let o=a.length-1;o>=0;o--){const{x:l,y:c}=a[o];t.lineTo(l,c)}t.lineTo(e,i)}else{for(const{x:o,y:l}of a)t.lineTo(o,l);t.lineTo(s,n)}}function Ll(t,e,i,s){const[n,a]=Zg(e);switch(LD(t,i,n.x,n.y,a.x,a.y,s),e.type){case"linear":ND(t,e.x0,e.y0,e.x1,e.y1,s);break;case"cubic":kD(t,e.cp0x,e.cp0y,e.cp1x,e.cp1y,e.cp2x,e.cp2y,e.cp3x,e.cp3y,s);break;case"step":wD(t,e.x0,e.y0,e.x1,e.y1,e.stepX,s);break;case"multi-line":ej(t,e.x0,e.y0,e.x1,e.y1,e.midPoints,s);break}}function OD(t,e,i){const[s,n]=Zg(t),[a,r]=Zg(e),o=qe(s.x,a.x,i),l=qe(s.y,a.y,i),c=qe(n.x,r.x,i),h=qe(n.y,r.y,i);return[{x:o,y:l},{x:c,y:h}]}function Xg(t,e,i,s,n,a){const[{x:r,y:o},{x:l,y:c}]=OD(e,i,s);if(LD(t,n,r,o,l,c,a),e.type==="cubic"&&i.type==="cubic"){const h=qe(e.cp1x,i.cp1x,s),d=qe(e.cp1y,i.cp1y,s),u=qe(e.cp2x,i.cp2x,s),p=qe(e.cp2y,i.cp2y,s);kD(t,r,o,h,d,u,p,l,c,a)}else if(e.type==="step"&&i.type==="step"){const h=qe(e.stepX,i.stepX,s);wD(t,r,o,l,c,h,a)}else if(e.type==="linear"&&i.type==="linear")ND(t,r,o,l,c,a);else{let h;e.type==="step"?h=e.stepX:i.type==="step"?h=i.stepX:h=(r+l)/2;const d=TD(e,h),u=TD(i,h),p=qe(d.leftCp1x,u.leftCp1x,s),g=qe(d.leftCp1y,u.leftCp1y,s),f=qe(d.leftCp2x,u.leftCp2x,s),m=qe(d.leftCp2y,u.leftCp2y,s),b=qe(d.stepX,u.stepX,s),x=qe(d.stepY0,u.stepY0,s),v=qe(d.stepY1,u.stepY1,s),S=qe(d.rightCp1x,u.rightCp1x,s),I=qe(d.rightCp1y,u.rightCp1y,s),M=qe(d.rightCp2x,u.rightCp2x,s),D=qe(d.rightCp2y,u.rightCp2y,s);a?(t.cubicCurveTo(M,D,S,I,b,v),t.lineTo(b,x),t.cubicCurveTo(f,m,p,g,r,o)):(t.cubicCurveTo(p,g,f,m,b,x),t.lineTo(b,v),t.cubicCurveTo(S,I,M,D,l,c))}}import{clipSpanX as ED,collapseSpanToPoint as qg,isUnitTimeCategoryScaling as Qh,rescaleSpan as Jg,spanRange as to,transformIntegratedCategoryValue as tj}from"ag-charts-core";var RD=1e3,PD=(t=>(t[t.Zero=0]="Zero",t[t.Split=1]="Split",t))(PD||{});function ij(t,e){return t==null||e==null||typeof t!="object"||typeof e!="object"?!1:"id"in t&&"id"in e?t.id===e.id:t.toString()===e.toString()}function Et(t){return tj(t).valueOf()}function Mt(t,e){if(!e)return Number.NaN;if(t instanceof Date&&(t=t.getTime()),e.type==="continuous"&&typeof t=="number")return(t-e.domain[0])/(e.domain[1]-e.domain[0])*(e.range[1]-e.range[0])+e.range[0];if(e.type==="log"&&typeof t=="number")return e.convert(t);if(e.type!=="category")return Number.NaN;if(Qh(e)){if(typeof t=="number"){const{firstBandTime:n,intervalMs:a,bandCount:r,inset:o,step:l}=e,c=Math.round((t-n)/a);if(c>=0&&cEt(n)===i);return s===-1&&(s=e.domain.findIndex(n=>ij(t,n))),s>=0?e.inset+e.step*s:Number.NaN}function _D({data:t},e){return t.map((i,s)=>({xValue0Index:e.indexOf(Et(i.xValue0)),xValue1Index:e.indexOf(Et(i.xValue1)),datumIndex:s}))}function FD(t){return Object.values(t.scales).every(e=>e.type==="category"?Qh(e)?e.bandCount({axisValue:h,value:d}));s.sort((h,d)=>Mt(h.value,t.scales.x)-Mt(d.value,t.scales.x));const n=[];for(const{xValue0:h,xValue1:d}of e.data){const u=Et(h),p=Et(d);i.has(u)||(i.set(u,h),n.push({axisValue:u,value:h})),i.has(p)||(i.set(p,d),n.push({axisValue:p,value:d}))}n.sort((h,d)=>Mt(h.value,e.scales.x)-Mt(d.value,e.scales.x));const a=s;let r=0;for(const h of n){for(let d=a.length-1;d>=r;d-=1){const u=Mt(h.value,e.scales.x),p=Mt(a[d].value,e.scales.x);if(u>p){r=d+1;break}}a.splice(r,0,h),r+=1}if(!nj(a,e))return;const o=a.map(h=>h.axisValue),l=_D(e,o),c=_D(t,o);return{axisValues:o,oldDataAxisIndices:l,newDataAxisIndices:c}}function VD(t,e,i,s,n){if(n.xValue1Index===n.xValue0Index+1)return t;const a=to(t);let r,o;if(e.scales.x?.type==="category"){const l=(a[1].x-a[0].x)/(n.xValue1Index-n.xValue0Index);r=a[0].x+(s-n.xValue0Index)*l,o=r+l}else{const l=i[s],c=i[s+1];r=Mt(l,e.scales.x),o=Mt(c,e.scales.x)}return ED(t,r,o)}function BD(t,e){const[i,s]=to(t),n=Mt(0,e.scales.y);return Jg(t,{x:i.x,y:n},{x:s.x,y:n})}function zD(t){const[e,i]=to(t);return qg(t,{x:(e.x+i.x)/2,y:(e.y+i.y)/2})}function GD(t,e,i,s,n,a){let r,o;if(n.xValue0Index>=a.xValue1Index){const d=s.findLast(p=>p.xValue1Index<=a.xValue1Index)?.datumIndex,u=d==null?void 0:i.data[d];r=u?.xValue1,o=u?.yValue1}else if(n.xValue0Index<=a.xValue0Index){const d=s.find(p=>p.xValue0Index>=a.xValue0Index)?.datumIndex,u=d==null?void 0:i.data[d];r=u?.xValue0,o=u?.yValue0}if(r==null||o==null)switch(e){case 0:return BD(t,i);case 1:return zD(t)}const l=Mt(r,i.scales.x),c=Mt(o,i.scales.y),h={x:l,y:c};return Jg(t,h,h)}function Qg(t,e){if(e==null)return;const i=Et(t.xValue0),s=Et(t.xValue1);return e.find(n=>Et(n.xValue0)===i&&Et(n.xValue1)===s)?.span}function UD(t,e,i,s,n,a,r){const o=t.data[s.datumIndex],l=o.span,c=Qg(o,n);if(c==null){const h=GD(l,e,t,i,s,a);r.added.push({from:h,to:l})}else r.removed.push({from:c,to:c}),r.moved.push({from:c,to:l}),r.added.push({from:l,to:l})}function HD(t,e,i,s,n,a,r){const o=t.data[s.datumIndex],l=o.span,c=Qg(o,n);if(c==null){const h=GD(l,e,t,i,s,a);r.removed.push({from:l,to:h})}else r.removed.push({from:l,to:l}),r.moved.push({from:l,to:c}),r.added.push({from:c,to:c})}function jD(t,e,i,s,n){const a=s.scales.x,r=e[n.xValue0Index],o=e[n.xValue1Index];let l,c;if(a?.type==="continuous"||a?.type==="log"?(l=i.data.findLast(b=>Et(b.xValue0)<=r),c=i.data.find(b=>Et(b.xValue1)>=o)):(l=i.data.find(b=>Et(b.xValue0)===r),c=i.data.find(b=>Et(b.xValue1)===o)),l==null||c==null)return;const[{x:h},{x:d}]=to(t),u=Mt(l.xValue0,i.scales.x),p=Mt(l.yValue0,i.scales.y),g=Mt(c.xValue1,i.scales.x),f=Mt(c.yValue1,i.scales.y);let m=s.data[n.datumIndex].span;return m=Jg(m,{x:u,y:p},{x:g,y:f}),m=ED(m,h,d),m}function rj(t,e,i,s,n,a,r,o,l){const c=n+1,h=r.find(v=>v.xValue0Index<=n&&v.xValue1Index>=c),d=a.find(v=>v.xValue0Index<=n&&v.xValue1Index>=c),u=e.zeroData,p=t.zeroData;if(h==null&&d!=null){UD(t,i,a,d,u,o,l);return}else if(h!=null&&d==null){HD(e,i,r,h,p,o,l);return}else if(h==null||d==null)return;let g;h.xValue0Index===d.xValue0Index&&h.xValue1Index===d.xValue1Index?g=0:h.xValue0Index<=d.xValue0Index&&h.xValue1Index>=d.xValue1Index?g=-1:h.xValue0Index>=d.xValue0Index&&h.xValue1Index<=d.xValue1Index?g=1:g=0;const f=e.data[h.datumIndex],m=VD(f.span,e,s,n,h),b=t.data[d.datumIndex],x=VD(b.span,t,s,n,d);if(g===1){const v=jD(m,s,e,t,d);v==null?HD(e,i,r,h,p,o,l):(l.removed.push({from:m,to:v}),l.moved.push({from:v,to:x}),l.added.push({from:x,to:x}))}else if(g===-1){const v=jD(x,s,t,e,h);v==null?UD(t,i,a,d,u,o,l):(l.removed.push({from:m,to:m}),l.moved.push({from:m,to:v}),l.added.push({from:v,to:x}))}else l.removed.push({from:m,to:m}),l.moved.push({from:m,to:x}),l.added.push({from:x,to:x})}function oj(t,e,i,s){const n={removed:[],moved:[],added:[]},{axisValues:a,oldDataAxisIndices:r,newDataAxisIndices:o}=t,l={xValue0Index:Math.max(r.at(0)?.xValue0Index??-1/0,o.at(0)?.xValue0Index??-1/0),xValue1Index:Math.min(r.at(-1)?.xValue1Index??1/0,o.at(-1)?.xValue1Index??1/0)};for(let c=0;ct.data.length&&t.data.length>0){const r=t.data.at(-1).span,[,o]=to(r),l=qg(r,o);for(let c=a;ce.data.length&&e.data.length>0){const r=e.data.at(-1).span,[,o]=to(r),l=qg(r,o);for(let c=a;cn.point);let s=YH(i);switch(e.type){case"linear":break;case"smooth":s=$H(i,e.tension);break;case"step":s=ZH(i,e.position);break}return s.map(function(a,r){return{span:a,xValue0:t[r].xDatum,yValue0:t[r].yDatum,xValue1:t[r+1].xDatum,yValue1:t[r+1].yDatum}})}function ed(t,e,i=.001){return Math.abs(t.x-e.x)td(l,c,e.removed),a=(l,c)=>td(l,c,e.moved),r=(l,c)=>td(l,c,e.added),o=tf(t,i,s);return{status:t,path:{addPhaseFn:r,updatePhaseFn:a,removePhaseFn:n},pathProperties:o}}function tf(t,e,i=1){const s=e==="none"?"updated":t,n={fromFn(a,r){const o={phase:Vi[s]},l=a.previousDatum??r;return l!=null&&(o.segments=l),t==="removed"?o.finish={visible:!1}:t==="added"&&(o.start={visible:!0}),o},toFn(a,r){const o={phase:Vi[s]},l=r;return l!=null&&(o.segments=l),o}};return e==="fade"?{fromFn(a,r){const o=t==="added"?0:i,l=t==="removed"?a.previousDatum??r:r;return{...n.fromFn(a,r),opacity:o,segments:l}},toFn(a,r){const o=t==="removed"?0:i,l=t==="removed"?a.previousDatum??r:r;return{...n.toFn(a,r),opacity:o,segments:l}}}:n}function hj(t,e,i,s=1){const n=t.scales.x?.type==="category",a=e.scales.x?.type==="category";if(n!==a||!AD(t.scales.x)||!AD(e.scales.x)||t.strokeData==null||e.strokeData==null)return;let r="updated";e.visible&&!t.visible?r="removed":!e.visible&&t.visible&&(r="added");const o=Nl({scales:t.scales,data:t.strokeData.spans},{scales:e.scales,data:e.strokeData.spans},1);if(o==null)return;const l=YD(r,o,"fade",s),c=(i?.changed??!0)||!MD(t.scales.x,e.scales.x)||!MD(t.scales.y,e.scales.y)||r!=="updated";return{status:r,stroke:l,hasMotion:c}}import{ChartAxisDirection as $D,isNegative as dj}from"ag-charts-core";function KD(t,e,i,s){if(e!=null){const[n,a]=e;if(n!==0||a!==1)return!1}if(re.is(t)){const n=t.calcBandwidth(s)-t.calcBandwidth(i);if(n>0&&n<1)return!1}if(Fi.is(t)){const{bandwidth:n,step:a}=t;if(n>0&&n<1)return!1;const r=a-n;if(r>0&&r<1)return!1}return!0}var sf=t=>dj(t.yValue??0);function wl(t,e,i){const{startingX:s,startingY:n}=pj(t,e);return{isVertical:t,calculate:(r,o)=>{let l=t?r.x:s,c=t?n:r.y,h=t?r.width:0,d=t?0:r.height;const{opacity:u=1}=r;o&&(Number.isNaN(l)||Number.isNaN(c))&&({x:l,y:c}=o,h=t?o.width:0,d=t?0:o.height,t&&!sf(o)?c+=o.height:!t&&sf(o)&&(l+=o.width));let p;return r.clipBBox==null?p=void 0:sf(r)?p=t?new P(l,c-d,h,d):new P(l-h,c,h,d):p=new P(l,c,h,d),{x:l,y:c,width:h,height:d,clipBBox:p,opacity:u}},mode:i}}function uj(t,e){return{isVertical:t,calculate:(i,s)=>{let n=t?i.x:i.x+i.width/2,a=t?i.y+i.height/2:i.y,r=t?i.width:0,o=t?0:i.height;return s&&(Number.isNaN(n)||Number.isNaN(a))&&(n=t?s.x:s.x+s.width/2,a=t?s.y+s.height/2:s.y,r=t?s.width:0,o=t?0:s.height),{x:n,y:a,width:r,height:o,clipBBox:i.clipBBox,opacity:i.opacity??1}},mode:e}}function Ol(t,e){const i=r=>r==null||Number.isNaN(r.x)||Number.isNaN(r.y);return{toFn:(r,o,l)=>l==="removed"&&r.datum==null&&t.mode==="fade"?{...El(r,o),opacity:0}:l==="removed"||i(o)?t.calculate(o,r.previousDatum):{x:o.x,y:o.y,width:o.width,height:o.height,clipBBox:o.clipBBox,opacity:o.opacity??1},fromFn:(r,o,l)=>{l==="updated"&&i(o)?l="removed":l==="updated"&&i(r.previousDatum)&&(l="added");let c;l==="unknown"||l==="added"?(r.previousDatum==null&&t.mode==="fade"?c={...El(r,o),opacity:0}:c=t.calculate(o,r.previousDatum),l==="unknown"&&(l=e)):c={x:r.x,y:r.y,width:r.width,height:r.height,clipBBox:r.clipBBox,opacity:r.opacity??1};const h=Vi[l];return{...c,phase:h}},applyFn:(r,o,l)=>{r.resetAnimationProperties(o.x,o.y,o.width,o.height,o.opacity??1,o.clipBBox),r.crisp=l==="end"&&(r.datum?.crisp??!1)}}}function pj(t,e){const i=e[t?$D.Y:$D.X];let s=1/0,n=0;return i?(t?n=i.scale.convert(re.is(i.scale)?0:Math.max(...i.range)):s=i.scale.convert(re.is(i.scale)?0:Math.min(...i.range)),{startingX:s,startingY:n}):{startingX:s,startingY:n}}function El(t,{x:e,y:i,width:s,height:n,clipBBox:a,opacity:r=1}){return{x:e,y:i,width:s,height:n,clipBBox:a,opacity:r,crisp:t.datum?.crisp??!1}}function id(t){for(const e of t){const i=e.nodes();e.batchedUpdate(function(){for(const n of i){const a=n.datum;a!=null&&(n.resetAnimationProperties(a.x,a.y,a.width,a.height,a.opacity??1,a.clipBBox),n.crisp=a.crisp??!1)}e.cleanup()})}}function nf(t,e){if(e===void 0)return;const{x:i,y:s,width:n,height:a}=e;return fe.toCanvas(t.contentGroup,new P(i,s,n,a))}function af(t,e,i,s){const n=t.canIncrementallyUpdate&&t.nodeIndex=s;p-=1)Ll(t,i[p].span,io.LineTo,!0);t.closePath(),Ll(t,o,io.MoveTo,!1),s=r}n=h,a=u}for(let r=e.length-1;r>=s;r-=1)Ll(t,i[r].span,io.LineTo,!0);t.closePath()}function rf(t,{path:e},i,s){for(let n=0;nrf(l,c,e.removed,i.removed),a=(l,c)=>rf(l,c,e.moved,i.moved),r=(l,c)=>rf(l,c,e.added,i.added),o=tf(t,s);return{status:t,path:{addPhaseFn:r,updatePhaseFn:a,removePhaseFn:n},pathProperties:o}}function gj(t,e){const i=t.scales.x?.type==="category",s=e.scales.x?.type==="category";if(i!==s||!ZD(t.scales.x)||!ZD(e.scales.x))return;let n="updated";e.visible&&!t.visible?n="removed":!e.visible&&t.visible&&(n="added");const a=Nl({scales:t.scales,data:t.fillData.spans},{scales:e.scales,data:e.fillData.spans},0);if(a==null)return;const r=Nl({scales:t.scales,data:t.fillData.phantomSpans},{scales:e.scales,data:e.fillData.phantomSpans},0);if(r==null)return;const o=Nl({scales:t.scales,data:t.strokeData.spans,zeroData:t.fillData.phantomSpans},{scales:e.scales,data:e.strokeData.spans,zeroData:e.fillData.phantomSpans},0);if(o==null)return;const l="none",c=JD(n,a,r,l),h=YD(n,o,l);return{status:n,fill:c,stroke:h}}import{areScalingEqual as of}from"ag-charts-core";function QD(t,e,i,s,n,a,r){let o=a?.reduced?.diff?.[t];if(o?.changed)return o;if(!r)return{changed:!1,added:new Set,updated:new Set,removed:new Set,moved:new Set};const l=fj(s,n);return o==null&&a?.reduced?.diff!=null?(o={changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set},l?o.updated=new Set(Array.from(e,({datum:c})=>i(c))):o.added=new Set(Array.from(e,({datum:c})=>i(c)))):l&&(o={changed:!0,added:new Set,updated:new Set(Array.from(e,({datum:c})=>i(c))),removed:new Set,moved:new Set}),o}function eM(t){return typeof t=="object"&&t!==null&&"groupScale"in t}function fj(t,e){if(!e)return!1;const i=t.scales,s=e.scales;if(!of(i.x,s.x)||!of(i.y,s.y))return!0;if(!eM(t)||!eM(e))return!1;const n=t.groupScale,a=e.groupScale;return!of(n,a)}import{clamp as mj,findRangeExtent as yj,inverseEaseOut as bj}from"ag-charts-core";function Rl({id:t},e,i,s,...n){const a={...s,phase:s?.phase??(i?Vi[i]:"trailing")};Ns(t,"markers",e,n,{opacity:0},{opacity:1},a);for(const r of n)r.cleanup()}function xj({id:t},e,...i){Ns(t,"markers",e,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"});for(const s of i)s.cleanup()}function lf({id:t,nodeDataDependencies:e},i,s,...n){const a=e.seriesRectWidth;Ee(t,"markers",i,n,{fromFn:(l,c)=>{const h=c.midPoint?.x??a;let d=mj(0,bj(h/a),1);return Number.isNaN(d)&&(d=0),{scalingX:0,scalingY:0,delay:s?.delay??d,duration:s?.duration??Tu,phase:s?.phase??"initial",start:s?.start,finish:s?.finish}},toFn:()=>({scalingX:1,scalingY:1})})}function sd(t){return{opacity:1,scalingX:1,scalingY:1}}function nd(t){for(const e of t){const i=e.nodes();e.batchedUpdate(function(){for(const n of i){const a=n.datum;if(a?.point==null)continue;const{x:r,y:o}=a.point;!Number.isFinite(r)||!Number.isFinite(o)||n.resetAnimationProperties(r,o,n.size,1,1,1)}e.cleanup()})}}function Pl(t,e){return{x:e.point?.x??Number.NaN,y:e.point?.y??Number.NaN,scalingCenterX:e.point?.x??Number.NaN,scalingCenterY:e.point?.y??Number.NaN}}function ad(t,{datumIndex:e}){const i=t.getNodeData();if(i===void 0)return;const s=i[e],{point:n}=s??{};if(s==null||n==null)return;const a=t.getFormattedMarkerStyle(s),r=We.anchor(a.shape),o=n.focusSize??a.size,l=4+o,c=l/2,h=(r.x-.5)*o,d=(r.y-.5)*o,u=s.point.x-c-h,p=s.point.y-c-d;return fe.toCanvas(t.contentGroup,new P(u,p,l,l))}function cf(t,e,i,s=i){if(!(s.enabled??i.enabled))return!1;const a=1;return(e.step??yj(e.range)/Math.max(1,t))>a}function rd(t,e,i,s){return s??(s={stroke:e.stroke,strokeOpacity:e.strokeOpacity,strokeWidth:e.strokeWidth}),ju.reduce((n,a)=>(n[a]=t.getMarkerStyle(i,{},void 0,{highlightState:a},void 0,s),n),{})}function hf({id:t,visible:e,nodeDataDependencies:i},s,...n){const{seriesRectWidth:a,seriesRectHeight:r}=i;Ns(t,"path_properties",s,n,{clipX:0},{clipX:a},{phase:"initial",start:{clip:!0,clipY:r,visible:e},finish:{clip:!1,visible:e}})}function df({id:t},e,i,s="add",...n){Ns(t,e,i,n,{opacity:0},{opacity:1},{phase:s})}function uf(t){return e=>({visible:t.getVisible(),opacity:t.getOpacity(),clipScalingX:1,clip:!1})}function od({nodeDataDependencies:t},e){const i=s=>Number.isFinite(s)?s:0;e.clipX=i(t.seriesRectWidth),e.clipY=i(t.seriesRectHeight)}import{ChartAxisDirection as kn,PolarZIndexMap as pf,StateMachine as vj}from"ag-charts-core";var tM={[kn.Angle]:["angleKey"],[kn.Radius]:["radiusKey"]},iM={[kn.Angle]:["angleName"],[kn.Radius]:["radiusName"]},gf=class extends Gg{constructor({categoryKey:t,pickModes:e=[1,0],canHaveAxes:i=!1,animationResetFns:s,...n}){super({...n,categoryKey:t,pickModes:e,canHaveAxes:i}),this.directions=[kn.Angle,kn.Radius],this.itemGroup=this.contentGroup.appendChild(new U({name:"items"})),this.nodeData=[],this.itemSelection=Re.select(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=Re.select(this.labelGroup,()=>this.labelFactory(),!1),this.highlightSelection=Re.select(this.highlightNodeGroup,()=>this.nodeFactory()),this.highlightLabelSelection=Re.select(this.highlightLabelGroup,()=>this.labelFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.maxChartMarkerSize=0,this.animationResetFns=s,this.animationState=new vj("empty",{empty:{update:{target:"ready",action:a=>this.animateEmptyUpdateReady(a)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:a=>this.animateReadyHighlight(a),highlightMarkers:a=>this.animateReadyHighlightMarkers(a),resize:a=>this.animateReadyResize(a),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:a=>this.animateWaitingUpdateReady(a)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:a=>this.animateClearingUpdateEmpty(a)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable()),this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",a=>this.onLegendItemClick(a)),this.ctx.eventsHub.on("legend:item-double-click",a=>this.onLegendItemDoubleClick(a)))}getItemNodes(){return[...this.itemGroup.children()]}getNodeData(){return this.nodeData}getKeyAxis(t){if(t===kn.Angle)return this.properties.angleKeyAxis;if(t===kn.Radius)return this.properties.radiusKeyAxis}setZIndex(t){super.setZIndex(t),this.contentGroup.zIndex=[t,pf.FOREGROUND],this.highlightGroup.zIndex=[t,pf.HIGHLIGHT],this.labelGroup.zIndex=[t,pf.LABEL]}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}labelFactory(){const t=new Ht;return t.pointerEvents=1,t}getInnerRadius(){return 0}computeLabelsBBox(t,e){return null}getShapeFillBBox(){const t=this.radius;return{series:new P(-t,-t,t*2,t*2),axis:new P(-t,-t,t*2,t*2)}}resetAllAnimation(){const{item:t,label:e}=this.animationResetFns??{};this.ctx.animationManager.stopByAnimationGroupId(this.id),t&&ot([this.itemSelection,this.highlightSelection],t),e&&ot([this.labelSelection,this.highlightLabelSelection],e),this.itemSelection.cleanup(),this.labelSelection.cleanup(),this.highlightSelection.cleanup(),this.highlightLabelSelection.cleanup()}animateEmptyUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateWaitingUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateReadyHighlight(t){const{item:e,label:i}=this.animationResetFns??{};e&&ot([this.highlightSelection],e),i&&ot([this.highlightLabelSelection],i)}animateReadyHighlightMarkers(t){}animateReadyResize(t){this.resetAllAnimation()}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}computeFocusBounds(t){const e=this.getNodeData()?.[t.datumIndex];if(e!==void 0)return this.itemSelection.select(i=>i instanceof Ue&&i.datum===e)[0]}getSeriesRange(){return[Number.NaN,Number.NaN]}isSeriesHighlighted(t,e){if(!this.properties.highlight.enabled)return!1;const{series:i,legendItemName:s,datumIndex:n}=t??{},a=typeof n=="number"?e?.[n]:void 0;return i===this||a!=null&&a===s}};import{Logger as Sj,StateMachine as Ij,arraysEqual as Dj,clamp as sM,mergeDefaults as nM}from"ag-charts-core";import{Property as Ha}from"ag-charts-core";var aM=(t=>(t[t.None=0]="None",t[t.Item=1]="Item",t[t.OtherItem=2]="OtherItem",t[t.Branch=3]="Branch",t[t.OtherBranch=4]="OtherBranch",t))(aM||{});function _l(t){const e=i=>i;switch(t){case 1:return"highlighted-item";case 2:return"unhighlighted-item";case 3:return"highlighted-branch";case 4:return"unhighlighted-branch";case 0:return"none";default:return e(t)}}var wn=class extends _i{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(Pe),this.strokes=Object.values(Rs)}};y([Ha],wn.prototype,"childrenKey",2),y([Ha],wn.prototype,"sizeKey",2),y([Ha],wn.prototype,"colorKey",2),y([Ha],wn.prototype,"colorName",2),y([Ha],wn.prototype,"fills",2),y([Ha],wn.prototype,"strokes",2),y([Ha],wn.prototype,"colorRange",2);var rM=class Pd{constructor(e,i,s,n,a,r,o,l,c,h,d){this.series=e,this.itemId=i,this.datumIndex=s,this.datum=n,this.sizeValue=a,this.colorValue=r,this.sumSize=o,this.depth=l,this.parent=c,this.children=h,this.style=d,this.midPoint={x:0,y:0}}get hasChildren(){return this.children.length>0}walk(e,i=Pd.Walk.PreOrder){i===Pd.Walk.PreOrder&&e(this);for(const s of this.children)s.walk(e,i);i===Pd.Walk.PostOrder&&e(this)}find(e){if(e(this))return this;for(const i of this.children){const s=i.find(e);if(s!=null)return s}}*[Symbol.iterator](){yield this;for(const e of this.children)yield*e}};rM.Walk={PreOrder:0,PostOrder:1};var Mj=rM,Aj=class extends Zo{constructor(t){super({moduleCtx:t,pickModes:[1,0]}),this.colorDomain=[0,0],this.maxDepth=0,this.colorScale=new Za,this.animationState=new Ij("empty",{empty:{update:{target:"ready",action:e=>this.animateEmptyUpdateReady(e)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:e=>this.animateReadyHighlight(e),resize:e=>this.animateReadyResize(e),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:e=>this.animateWaitingUpdateReady(e)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:e=>this.animateClearingUpdateEmpty(e)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}processData(){this.data?.commitPendingTransactions();const{NodeClass:t}=this,{childrenKey:e,sizeKey:i,colorKey:s,colorRange:n}=this.properties;let a=0,r=1/0,o=-1/0;const l=(u,p,g)=>{const f=g.depth==null?0:g.depth+1,m=e==null?void 0:u[e],b=m==null||m.length===0;let x=i==null?void 0:u[i];Number.isFinite(x)?x=Math.max(x,0):x=b?1:0;const v=x;a=Math.max(a,f);const S=s==null?void 0:u[s];typeof S=="number"&&(r=Math.min(r,S),o=Math.max(o,S));const I=this.getItemStyle({datumIndex:p,datum:u,depth:f,colorValue:S},b,!1);return c(new t(this,yt(p.join(";")),p,u,x,S,v,f,g,[],I),m)},c=(u,p)=>{const{datumIndex:g}=u;if(p)for(const[f,m]of p.entries()){const b=l(m,g.concat(f),u);u.children.push(b),u.sumSize+=b.sumSize}return u},h=c(new t(this,"root",[],void 0,0,void 0,0,void 0,void 0,[],{}),this.data?.data),d=[r,o];this.colorScale.domain=re.itemId===t)}dataCount(){return Number.NaN}getSeriesDomain(){return{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}getLegendData(t){const{colorKey:e,colorRange:i}=this.properties,{id:s,ctx:{legendManager:n},visible:a}=this;return t==="gradient"&&e!=null&&i!=null?[{legendType:"gradient",enabled:a&&n.getItemEnabled({seriesId:s}),seriesId:s,series:this.getFormatterContext("color"),colorRange:i,colorDomain:this.colorDomain}]:[]}getDatumIdFromData(t){return t.datumIndex.join(":")}getDatumId(t){return this.getDatumIdFromData(t)}removeMeIndexPathForIndex(t){return this.datumSelection.at(t+1)?.datum.datumIndex??[]}removeMeIndexForIndexPath(t){for(const{index:e,datum:i}of this.datumSelection)if(Dj(i.datumIndex,t))return e-1;return 0}pickFocus(t){if(!this.rootNode?.children.length)return;const e=sM(0,t.datumIndex-t.datumIndexDelta,this.datumSelection.length-1),{datumIndexDelta:i,otherIndexDelta:s}=t;let n=this.removeMeIndexPathForIndex(e);const a=n.reduce((l,c)=>l.children[c],this.rootNode);if(s>0&&a.hasChildren)n=[...n,0];else if(s<0&&n.length>1)n=n.slice(0,-1);else if(s===0&&i!==0){const l=a.parent.children.length-1;n=n.slice(),n[n.length-1]=sM(0,n.at(-1)+i,l)}const r=n.reduce((l,c)=>l.children[c],this.rootNode),o=this.computeFocusBounds(this.datumSelection.at(e+1));if(o!=null)return{datum:r,datumIndex:this.removeMeIndexForIndexPath(n),otherIndex:r.depth,bounds:o,clipFocusBox:!0}}getDatumAriaText(t,e){if(!(t instanceof this.NodeClass)){Sj.error(`datum is not HierarchyNode: ${JSON.stringify(t)}`);return}return this.ctx.localeManager.t("ariaAnnounceHierarchyDatum",{level:(t.depth??-1)+1,count:t.children.length,description:e})}getCategoryValue(t){}datumIndexForCategoryValue(t){}getActiveHighlightNode(){if(!this.properties.highlight.enabled)return;const t=this.ctx.highlightManager?.getActiveHighlight();if(t?.series===this)return t}getHierarchyHighlightState(t,e,i){if(t)return 1;if(e==null)return 0;const s=i.datumIndex?.[0],n=e.datumIndex?.[0];return s==null||n==null?0:s===n?3:4}getHierarchyHighlightStyles(t,e){switch(t){case 1:return nM(e.highlightedItem,e.highlightedBranch);case 3:return nM(e.unhighlightedItem,e.highlightedBranch);case 4:return e.unhighlightedBranch;default:return}}getHighlightStateString(t,e,i,s){if(!this.properties.highlight.enabled||i==null)return _l(0);const n=i.reduce((o,l)=>o?.children[l],this.rootNode),a=this.getActiveHighlightNode();if(n==null)return _l(0);const r=this.getHierarchyHighlightState(e??!1,a,n);return _l(r)}},ld=Math.PI/180,ff=t=>t*ld,mf=t=>-Math.log(Math.tan(Math.PI*.25+t*ld*.5)),yf=t=>t/ld,bf=t=>(Math.atan(Math.exp(-t))-Math.PI*.25)/(ld*.5),Cj=class Mm extends Jl{constructor(e,i){super(),this.domain=e,this.range=i,this.type="mercator",this.defaultTickCount=0,this.bounds=Mm.bounds(e)}static bounds(e){const[[i,s],[n,a]]=e,r=ff(i),o=mf(s),l=ff(n),c=mf(a);return new P(Math.min(r,l),Math.min(o,c),Math.abs(l-r),Math.abs(c-o))}static fixedScale(){return new Mm([[yf(0),bf(0)],[yf(1),bf(1)]],[[0,0],[1,1]])}toDomain(){}normalizeDomains(...e){let i=-1/0,s=1/0,n=-1/0,a=1/0;for(const r of e){const o=r.domain;for(const[l,c]of o)i=Math.min(l,i),s=Math.max(l,s),n=Math.min(c,n),a=Math.max(c,a)}return{domain:[[i,n],[s,a]],animatable:!0}}convert([e,i]){const[[s,n],[a,r]]=this.range,o=(a-s)/this.bounds.width,l=(r-n)/this.bounds.height;return[(ff(e)-this.bounds.x)*o+s,(mf(i)-this.bounds.y)*l+n]}invert([e,i]){const[[s,n],[a,r]]=this.range,o=(a-s)/this.bounds.width,l=(r-n)/this.bounds.height;return[yf((e-s)/o+this.bounds.x),bf((i-n)/l+this.bounds.y)]}getDomainMinMax(){return ec(this.domain)}},Tj=class{constructor(t){this.minimumDelay=t?.minimumDelay??50,this.timeout=t?.timeout??100}schedule(t,e){this.cancel(),this.pending={computation:t,onComplete:e},this.minimumDelay>0?this.delayTimeoutId=setTimeout(()=>{this.delayTimeoutId=void 0,this.scheduleIdleCallback()},this.minimumDelay):this.scheduleIdleCallback()}demand(){if(this.pending)return this.cancelScheduled(),this.execute()}cancel(){this.cancelScheduled(),this.pending=void 0}isPending(){return this.pending!=null}scheduleIdleCallback(){const t=Math.max(0,this.timeout-this.minimumDelay);typeof requestIdleCallback=="function"?this.idleCallbackId=requestIdleCallback(this.execute.bind(this),{timeout:t}):this.idleCallbackId=setTimeout(()=>this.execute(),t)}cancelScheduled(){this.delayTimeoutId!=null&&(clearTimeout(this.delayTimeoutId),this.delayTimeoutId=void 0),this.idleCallbackId!=null&&(typeof cancelIdleCallback=="function"?cancelIdleCallback(this.idleCallbackId):clearTimeout(this.idleCallbackId),this.idleCallbackId=void 0)}execute(){const{pending:t}=this;if(!t)return;this.pending=void 0,this.delayTimeoutId=void 0,this.idleCallbackId=void 0;const e=t.computation();return t.onComplete(e),e}},cd=class{constructor(){this._dataLength=0,this.executor=new Tj}get filters(){return this._filters}aggregate(t){if(this.executor.cancel(),t.targetRange>1&&t.computePartial){const e=t.computePartial(this._filters);if(e){const{immediate:i,computeRemaining:s}=e;return s&&this.executor.schedule(s,n=>{this.mergeFilters(n)}),this._filters=i,i}}return this._filters=t.computeFull(this._filters),this._filters}ensureLevelForRange(t){if(!this._filters?.some(i=>i.maxRange>t)&&this.executor.isPending()){const i=this.executor.demand();i&&this.mergeFilters(i)}}getFilterForRange(t){return this._filters?.find(e=>e.maxRange>t)}cancel(){this.executor.cancel()}markStale(t){const e=this._dataLength>0?t/this._dataLength:0;if(e>=2||e<=.5||this._dataLength===0)this._filters=void 0;else if(this._filters)for(const i of this._filters)i.stale=!0;this._dataLength=t,this.executor.cancel()}mergeFilters(t){if(!this._filters||t.length===0)return;const e=[...this._filters,...t];e.sort((i,s)=>i.maxRange-s.maxRange),this._filters=e}};import{ChartAxisDirection as oM,Property as lM}from"ag-charts-core";var xf=class extends dp{constructor(){super(...arguments),this.shape="polygon",this.innerRadiusRatio=0,this.defaultTickMinSpacing=20}update(){super.update(),this.tickLineGroup.visible=this.tick.enabled,this.tickLabelGroup.visible=this.label.enabled}layoutCrossLines(){const t=this.label.getSideFlag(),e=this.hasDefinedDomain()||this.hasVisibleSeries(),{rotation:i,parallelFlipRotation:s,regularFlipRotation:n}=this.calculateRotations();for(const a of this.crossLines)a.sideFlag=-t,a.direction=i===-Math.PI/2?oM.Angle:oM.Radius,a.parallelFlipRotation=s,a.regularFlipRotation=n,a.calculateLayout?.(e,this.reverse)}updatePosition(){super.updatePosition();const t=Math.floor(this.translation.x),e=Math.floor(this.translation.y);this.tickLineGroup.translationX=t,this.tickLineGroup.translationY=e,this.tickLabelGroup.translationX=t,this.tickLabelGroup.translationY=e,this.crossLineRangeGroup.translationX=t,this.crossLineRangeGroup.translationY=e,this.crossLineLineGroup.translationX=t,this.crossLineLineGroup.translationY=e,this.crossLineLabelGroup.translationX=t,this.crossLineLabelGroup.translationY=e,this.tickLabelGroupSelection.each(Uc())}computeLabelsBBox(t,e){return null}computeRange(){}getAxisLinePoints(){}};y([lM],xf.prototype,"shape",2),y([lM],xf.prototype,"innerRadiusRatio",2);var cM=class extends Al{calculateGridLine({index:t,tickId:e,translation:i},s,n,a,r){const{gridLine:o,horizontal:l,interval:c,range:h}=this;if(c.placement!=="between")return super.calculateGridLine({index:t,tickId:e,translation:i},s,n,a,r);const d=r[s-1],u=d?i-(i-d.translation)/2:h[0],[p,g,f,m]=l?[u,Math.max(n,a),u,Math.min(n,a)]:[Math.min(n,a),u,Math.max(n,a),u],{style:b}=o,{stroke:x,strokeWidth:v=0,lineDash:S}=b[t%b.length]??{};return{tickId:e,offset:u,x1:p,y1:g,x2:f,y2:m,stroke:x,strokeWidth:v,lineDash:S}}calculateGridFills(t,e,i){return this.interval.placement!=="between"?super.calculateGridFills(t,e,i):t.map((s,n)=>this.calculateGridFill(s,n,s.index,e,i,t))}calculateGridFill({tickId:t,translation:e},i,s,n,a,r){const{gridLine:o,horizontal:l,interval:c,range:h}=this;if(c.placement!=="between")return super.calculateGridFill({tickId:t,translation:e},i,s,n,a,r);const d=r[i-1],u=r[i+1],p=d?e-(e-d.translation)/2:h[0],g=u?e+(u.translation-e)/2:h[1],[f,m,b,x]=l?[p,Math.max(n,a),g,Math.min(n,a)]:[Math.min(n,a),p,Math.max(n,a),g],{fill:v,fillOpacity:S}=o.style[s%o.style.length]??{};return{tickId:t,x1:f,y1:m,x2:b,y2:x,fill:v,fillOpacity:S}}calculateTickLine({isPrimary:t,tickId:e,translation:i},s,n,a,r=0){const{horizontal:o,interval:l,primaryTick:c,range:h,tick:d}=this;if(l.placement!=="between")return super.calculateTickLine({isPrimary:t,tickId:e,translation:i},s,n,a,r);const u=t&&c?.enabled?c:d,p=-n*this.getTickSize(u),g=a[s-1],f=g?i-(i-g.translation)/2:h[0],m=-n*(r+this.getTickSpacing(u)),[b,x,v,S]=o?[f,m,f,m+p]:[m,f,m+p,f],{stroke:I,width:M}=u;return{tickId:e,offset:f,x1:b,y1:x,x2:v,y2:S,stroke:I,strokeWidth:M,lineDash:void 0}}},Lj={top:{xTranslationDirection:0,yTranslationDirection:-1},bottom:{xTranslationDirection:0,yTranslationDirection:1},left:{xTranslationDirection:-1,yTranslationDirection:0},right:{xTranslationDirection:1,yTranslationDirection:0},"top-left":{xTranslationDirection:1,yTranslationDirection:-1},"top-right":{xTranslationDirection:-1,yTranslationDirection:-1},"bottom-left":{xTranslationDirection:1,yTranslationDirection:1},"bottom-right":{xTranslationDirection:-1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},"inside-left":{xTranslationDirection:1,yTranslationDirection:0},"inside-right":{xTranslationDirection:-1,yTranslationDirection:0},"inside-top":{xTranslationDirection:0,yTranslationDirection:1},"inside-bottom":{xTranslationDirection:0,yTranslationDirection:-1},"inside-top-left":{xTranslationDirection:1,yTranslationDirection:1},"inside-bottom-left":{xTranslationDirection:1,yTranslationDirection:-1},"inside-top-right":{xTranslationDirection:-1,yTranslationDirection:1},"inside-bottom-right":{xTranslationDirection:-1,yTranslationDirection:-1}},Nj={top:{xTranslationDirection:1,yTranslationDirection:0},bottom:{xTranslationDirection:-1,yTranslationDirection:0},left:{xTranslationDirection:0,yTranslationDirection:-1},right:{xTranslationDirection:0,yTranslationDirection:1},"top-left":{xTranslationDirection:-1,yTranslationDirection:-1},"top-right":{xTranslationDirection:-1,yTranslationDirection:1},"bottom-left":{xTranslationDirection:1,yTranslationDirection:-1},"bottom-right":{xTranslationDirection:1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},"inside-left":{xTranslationDirection:0,yTranslationDirection:1},"inside-right":{xTranslationDirection:0,yTranslationDirection:-1},"inside-top":{xTranslationDirection:-1,yTranslationDirection:0},"inside-bottom":{xTranslationDirection:1,yTranslationDirection:0},"inside-top-left":{xTranslationDirection:-1,yTranslationDirection:1},"inside-bottom-left":{xTranslationDirection:1,yTranslationDirection:1},"inside-top-right":{xTranslationDirection:-1,yTranslationDirection:-1},"inside-bottom-right":{xTranslationDirection:1,yTranslationDirection:-1}};function kj({yDirection:t,padding:e=0,position:i="top",bbox:s}){const n=t?Lj:Nj,{xTranslationDirection:a,yTranslationDirection:r}=n[i],o=a*(e+s.width/2),l=r*(e+s.height/2);return{xTranslation:o,yTranslation:l}}import{easeOut as wj}from"ag-charts-core";function hd(t,e,i,s,n){const a=(d,u,p,g)=>{i.animate({id:`${t}_${e}_${u.id}_${d}`,groupId:t,from:p?1:0,to:1,ease:wj,collapsable:p,onUpdate(f,m){m&&d!=="removed"||(u.path.clear(!0),g(f,u),u.checkPathDirty())},onStop(){d==="added"&&(u.path.clear(!0),g(1,u),u.checkPathDirty())},phase:Vi[d]})},r=new Ue,o=d=>(r.resetPathDirty(),d(0,r),r.resetPathDirty(),d(1,r),r.checkPathDirty(),r.isPathDirty()),{addPhaseFn:l,updatePhaseFn:c,removePhaseFn:h}=n;for(const d of s)i.isSkipped()||(a("removed",d,!o(h),h),a("updated",d,!o(c),c)),a("added",d,!o(l),l)}import{ChangeDetectableProperties as Oj,Property as Fl}from"ag-charts-core";var Is=class extends Oj{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};y([Fl,X()],Is.prototype,"enabled",2),y([Fl,X()],Is.prototype,"color",2),y([Fl,X()],Is.prototype,"xOffset",2),y([Fl,X()],Is.prototype,"yOffset",2),y([Fl,X()],Is.prototype,"blur",2);import{angleBetween as Ej,isBetweenAngles as Vl,normalizeAngle180 as hM,normalizeAngle360 as dM}from"ag-charts-core";function uM({startAngle:t,endAngle:e,innerRadius:i,outerRadius:s}){let n=1/0,a=1/0,r=-1/0,o=-1/0;const l=(c,h)=>{n=Math.min(c,n),a=Math.min(h,a),r=Math.max(c,r),o=Math.max(h,o)};return l(i*Math.cos(t),i*Math.sin(t)),l(i*Math.cos(e),i*Math.sin(e)),l(s*Math.cos(t),s*Math.sin(t)),l(s*Math.cos(e),s*Math.sin(e)),Vl(0,t,e)&&l(s,0),Vl(Math.PI*.5,t,e)&&l(0,s),Vl(Math.PI,t,e)&&l(-s,0),Vl(Math.PI*1.5,t,e)&&l(0,-s),new P(n,a,r-n,o-a)}function vf(t,e,i){const s=Math.sqrt(Math.pow(t,2)+Math.pow(e,2)),{innerRadius:n,outerRadius:a}=i;if(i.startAngle===i.endAngle||sMath.max(n,a))return!1;const r=hM(i.startAngle),o=hM(i.endAngle),l=Math.atan2(e,t);return r=r:l<=o&&l>=-Math.PI||l>=r&&l<=Math.PI}function Rj(t,e,i,s,n,a,r,o,l,c){if(Number.isNaN(t)||Number.isNaN(e))return 0;a&&([n,s]=[s,n]);const h=(c-o)/(l-r),d=o-h*r,u=Math.pow(h,2)+1,p=2*(h*(d-e)-t),g=Math.pow(t,2)+Math.pow(d-e,2)-Math.pow(i,2),f=Math.pow(p,2)-4*u*g;if(f<0)return 0;const m=(-p+Math.sqrt(f))/2/u,b=(-p-Math.sqrt(f))/2/u;let x=0;for(const v of[m,b]){if(!(v>=Math.min(r,l)&&v<=Math.max(r,l)))continue;const I=h*v+d,M=v-t,D=I-e,A=Math.atan2(D,M);Vl(A,s,n)&&x++}return x}function pM(t,e){const{startAngle:i,endAngle:s,innerRadius:n,outerRadius:a}=e,r={x:a*Math.cos(i),y:a*Math.sin(i)},o={x:a*Math.cos(s),y:a*Math.sin(s)},l=n===0?{x:0,y:0}:{x:n*Math.cos(i),y:n*Math.sin(i)},c=n===0?{x:0,y:0}:{x:n*Math.cos(s),y:n*Math.sin(s)};return Io(t.start.x,t.start.y,t.end.x,t.end.y,r.x,r.y,l.x,l.y)||Io(t.start.x,t.start.y,t.end.x,t.end.y,o.x,o.y,c.x,c.y)||Rj(0,0,a,i,s,!0,t.start.x,t.start.y,t.end.x,t.end.y)}function Pj(t,e){const i={x:t.x,y:t.y},s={x:t.x+t.width,y:t.y},n={x:t.x,y:t.y+t.height},a={x:t.x+t.width,y:t.y+t.height};return pM({start:i,end:s},e)||pM({start:n,end:a},e)}function gM(t,e,i,s){if(i===0&&s===0)return 0;if(Math.asin(Math.abs(1*i)/(t+1*i))+Math.asin(Math.abs(1*s)/(t+1*s))-e<0)return 1;let a=0,r=1;for(let o=0;o<8;o+=1){const l=(a+r)/2;Math.asin(Math.abs(l*i)/(t+l*i))+Math.asin(Math.abs(l*s)/(t+l*s))-e<0?a=l:r=l}return a}var _j=1e-6;function On(t,e){return Ej(t,e)<_j?e:dM(t-e)+e}function dd(t,e,i=0){const n=Math.abs(e-t)>=2*Math.PI?2*Math.PI:dM(e-t);return t=On(t,i),e=t+n,{startAngle:t,endAngle:e}}function ud(t,e,i,s,n,a){const r=Math.sin(a),o=Math.cos(a),l=t**2+e**2-i**2;let c,h,d,u;if(o>.5){const v=r/o,S=1+v**2,I=-2*(t+e*v),M=I**2-4*S*l;if(M<0)return;const D=(-I+Math.sqrt(M))/(2*S),A=(-I-Math.sqrt(M))/(2*S);c=D,h=D*v,d=A,u=A*v}else{const v=o/r,S=1+v**2,I=-2*(e+t*v),M=I**2-4*S*l;if(M<0)return;const D=(-I+Math.sqrt(M))/(2*S),A=(-I-Math.sqrt(M))/(2*S);c=D*v,h=D,d=A*v,u=A}const p=o,g=r,f=c*p+h*g,m=d*p+u*g,b=f>0?On(Math.atan2(h-e,c-t),s):Number.NaN,x=m>0?On(Math.atan2(u-e,d-t),s):Number.NaN;if(b>=s&&b<=n)return b;if(x>=s&&x<=n)return x}function pd(t,e,i,s,n,a){const r=Math.hypot(t,e),o=(r**2-i**2+a**2)/(2*r),l=r-o,c=Math.atan2(e,t),h=Math.acos(-l/i),d=On(c+h,s),u=On(c-h,s);if(d>=s&&d<=n)return d;if(u>=s&&u<=n)return u}var fM=class extends Ue{constructor(t=""){super(),this._d="",this.d=t}get d(){return this._d}set d(t){t!==this._d&&(this._d=t,this.path.clear(),this.path.appendSvg(t),this.checkPathDirty())}},Fj=class extends Qa(fM){isPointInPath(t,e){return super.isPointInPath(t-this.translationX,e-this.translationY)}};import{ScaleAlignment as mM}from"ag-charts-core";var Vj=class GC extends hn{static is(e){return e instanceof GC}setSourceScale(e){this._sourceScale=e;const i=n=>{Object.defineProperty(this,n,{get:()=>e[n],set:a=>{e[n]=a},configurable:!0})};i("domain"),i("range"),i("paddingInner"),i("paddingOuter"),i("round");const s=n=>{Object.defineProperty(this,n,{get:()=>e[n],configurable:!0})};s("bandwidth"),s("step"),s("inset"),s("rawBandwidth")}get bands(){return this._sourceScale?.bands??super.bands}refresh(){this._sourceScale?.refresh?.()}ordinalRange(e){return this._sourceScale?this._sourceScale.ordinalRange(e):super.ordinalRange(e)}convert(e,i){this.refresh();const s=this.findIndex(e,i?.alignment);return s==null||s<0||s>=this.bands.length?Number.NaN:this.ordinalRange(s)}findIndex(e,i=mM.Leading){if(e==null)return;const{bands:s,reversed:n}=this,a=s.length;if(a===0)return;if(a===1)return 0;const r=s[0],o=s[a-1];if(r==null||o==null)return this._sourceScale?.findIndex(e,i);const l=e.valueOf(),c=r.valueOf(),h=o.valueOf(),d=(l-c)/(h-c),u=n?(1-d)*(a-1):d*(a-1);return i===mM.Leading?Math.max(0,Math.min(a-1,Math.floor(u))):Math.max(0,Math.min(a-1,Math.ceil(u)))}},yM=class Am{constructor(e,i,s,n){this.startAngle=e,this.endAngle=i,this.innerRadius=s,this.outerRadius=n}clone(){const{startAngle:e,endAngle:i,innerRadius:s,outerRadius:n}=this;return new Am(e,i,s,n)}equals(e){return this.startAngle===e.startAngle&&this.endAngle===e.endAngle&&this.innerRadius===e.innerRadius&&this.outerRadius===e.outerRadius}[Zl](e,i){return new Am(this.startAngle*(1-i)+e.startAngle*i,this.endAngle*(1-i)+e.endAngle*i,this.innerRadius*(1-i)+e.innerRadius*i,this.outerRadius*(1-i)+e.outerRadius*i)}},so=class extends Ms{constructor(t){super(),this.sourceImage=t,this.x=0,this.y=0,this.width=0,this.height=0,this.opacity=1}render(t){const{ctx:e}=t,i=this.sourceImage;i&&(e.globalAlpha=this.opacity,e.drawImage(i,0,0,i.width,i.height,this.x,this.y,this.width,this.height)),super.render(t)}};y([X()],so.prototype,"x",2),y([X()],so.prototype,"y",2),y([X()],so.prototype,"width",2),y([X()],so.prototype,"height",2),y([X()],so.prototype,"opacity",2);import{SceneChangeDetection as ja,isNumberEqual as Bj,normalizeAngle360 as bM}from"ag-charts-core";var Ds=class extends Ue{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.radius=10,this.startAngle=0,this.endAngle=Math.PI*2,this.counterClockwise=!1,this.type=0}get fullPie(){return Bj(bM(this.startAngle),bM(this.endAngle))}updatePath(){const t=this.path;t.clear(),t.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),this.type===1?t.closePath():this.type===2&&!this.fullPie&&(t.lineTo(this.centerX,this.centerY),t.closePath())}computeBBox(){return new P(this.centerX-this.radius,this.centerY-this.radius,this.radius*2,this.radius*2)}isPointInPath(t,e){const i=this.getBBox();return this.type!==0&&i.containsPoint(t,e)&&this.path.isPointInPath(t,e)}};Ds.className="Arc",y([ja()],Ds.prototype,"centerX",2),y([ja()],Ds.prototype,"centerY",2),y([ja()],Ds.prototype,"radius",2),y([ja()],Ds.prototype,"startAngle",2),y([ja()],Ds.prototype,"endAngle",2),y([ja()],Ds.prototype,"counterClockwise",2),y([ja()],Ds.prototype,"type",2);import{SceneChangeDetection as En,angleBetween as xM,isNumberEqual as vM,normalizeAngle360 as zj}from"ag-charts-core";function gd(t,e,i){const s=Math.hypot(t,e),a=Math.atan2(e,t)+i;return{x:Math.cos(a)*s,y:Math.sin(a)*s}}var Ji=class extends Ue{constructor(){super(...arguments),this.isBeveled=!0,this.columnWidth=0,this.startAngle=0,this.endAngle=0,this.outerRadius=0,this.innerRadius=0,this.axisInnerRadius=0,this.axisOuterRadius=0}set cornerRadius(t){}computeBBox(){const{columnWidth:t}=this,[e,i]=this.normalizeRadii(this.innerRadius,this.outerRadius),s=this.getRotation(),n=-t/2,a=t/2,r=-i,o=-e;let l=1/0,c=1/0,h=-1/0,d=-1/0;for(let u=0;u<4;u+=1){const{x:p,y:g}=gd(u%2===0?n:a,u<2?r:o,s);l=Math.min(p,l),c=Math.min(g,c),h=Math.max(p,h),d=Math.max(g,d)}return new P(l,c,h-l,d-c)}getRotation(){const{startAngle:t,endAngle:e}=this,i=xM(t,e);return zj(t+i/2+Math.PI/2)}normalizeRadii(t,e){return t>e?[e,t]:[t,e]}updatePath(){const{isBeveled:t}=this;t?this.updateBeveledPath():this.updateRectangularPath(),this.checkPathDirty()}updateRectangularPath(){const{columnWidth:t,path:e}=this,[i,s]=this.normalizeRadii(this.innerRadius,this.outerRadius),n=-t/2,a=t/2,r=-s,o=-i,l=this.getRotation(),c=[[n,o],[n,r],[a,r],[a,o]].map(([h,d])=>gd(h,d,l));e.clear(!0),e.moveTo(c[0].x,c[0].y),e.lineTo(c[1].x,c[1].y),e.lineTo(c[2].x,c[2].y),e.lineTo(c[3].x,c[3].y),e.closePath()}calculateCircleIntersection(t,e){const i=t*t;if(es||Math.hypot(o,l)>s;if(!d&&!u&&!p){this.updateRectangularPath();return}const g=d?this.calculateBothIntersections(r,o,n):null,f=u?this.calculateBothIntersections(r,o,a):null,m=p?this.calculateAxisOuterIntersections(r,o,s):null;if(d&&!g||u&&!f||p&&!m){this.updateRectangularPath();return}e.clear(!0);const b={left:r,right:o,top:l,bottom:c,rotation:h};g?this.moveToRotated(r,g.left.y,h):this.moveToRotated(r,c,h),g?e.arc(0,0,n,h+g.left.angle,h+g.right.angle,!1):this.lineToRotated(o,c,h),f?(this.lineToRotated(o,f.right.y,h),e.arc(0,0,a,h+f.right.angle,h+f.left.angle,!0)):m?this.renderTopWithCornerClipping(s,m,b):(this.lineToRotated(o,l,h),this.lineToRotated(r,l,h)),e.closePath()}};Ji.className="RadialColumnShape",y([En()],Ji.prototype,"isBeveled",2),y([En()],Ji.prototype,"columnWidth",2),y([En()],Ji.prototype,"startAngle",2),y([En()],Ji.prototype,"endAngle",2),y([En()],Ji.prototype,"outerRadius",2),y([En()],Ji.prototype,"innerRadius",2),y([En()],Ji.prototype,"axisInnerRadius",2),y([En()],Ji.prototype,"axisOuterRadius",2);function SM(t,e,i,s,n){const a=xM(t,e),r=a*(1-s)/2;if(t+=r,e-=r,a<.001)return 2*i*n;if(a>=2*Math.PI){const p=t+a/2;t=p-Math.PI,e=p+Math.PI}const o=i*Math.cos(t),l=i*Math.sin(t),c=i*Math.cos(e),h=i*Math.sin(e),d=Math.floor(Math.hypot(o-c,l-h)),u=2*i*n;return Math.max(1,Math.min(u,d))}import{SceneChangeDetection as ki,SceneObjectChangeDetection as Gj}from"ag-charts-core";var Sf=class{constructor(t,e,i,s,n){this.cx=t,this.cy=e,this.r=i,this.a0=s,this.a1=n,this.a0>=this.a1&&(this.a0=Number.NaN,this.a1=Number.NaN)}isValid(){return Number.isFinite(this.a0)&&Number.isFinite(this.a1)}pointAt(t){return{x:this.cx+this.r*Math.cos(t),y:this.cy+this.r*Math.sin(t)}}clipStart(t){t==null||!this.isValid()||t=this.a1)&&(this.a0=Number.NaN,this.a1=Number.NaN))}clipEnd(t){t==null||!this.isValid()||t>this.a1||(this.a1=t,(Number.isNaN(t)||this.a0>=this.a1)&&(this.a0=Number.NaN,this.a1=Number.NaN))}},At=class extends Ue{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.innerRadius=10,this.outerRadius=20,this.startAngle=0,this.endAngle=Math.PI*2,this.clipSector=void 0,this.concentricEdgeInset=0,this.radialEdgeInset=0,this.startOuterCornerRadius=0,this.endOuterCornerRadius=0,this.startInnerCornerRadius=0,this.endInnerCornerRadius=0}set inset(t){this.concentricEdgeInset=t,this.radialEdgeInset=t}set cornerRadius(t){this.startOuterCornerRadius=t,this.endOuterCornerRadius=t,this.startInnerCornerRadius=t,this.endInnerCornerRadius=t}computeBBox(){return uM(this).translate(this.centerX,this.centerY)}normalizedRadii(){const{concentricEdgeInset:t}=this;let{innerRadius:e,outerRadius:i}=this;return e=e>0?e+t:0,i=Math.max(i-t,0),{innerRadius:e,outerRadius:i}}normalizedClipSector(){const{clipSector:t}=this;if(t==null)return;const{startAngle:e,endAngle:i}=dd(this.startAngle,this.endAngle),{innerRadius:s,outerRadius:n}=this.normalizedRadii(),a=dd(t.startAngle,t.endAngle,e);return new yM(Math.max(e,a.startAngle),Math.min(i,a.endAngle),Math.max(s,t.innerRadius),Math.min(n,t.outerRadius))}getAngleOffset(t){return t>0?this.radialEdgeInset/t:0}arc(t,e,i,s,n,a,r,o){if(t<=0)return;const{startAngle:l,endAngle:c}=dd(this.startAngle,this.endAngle),{innerRadius:h,outerRadius:d}=this.normalizedRadii(),u=this.normalizedClipSector();if(o&&h<=0)return;const p=o?this.getAngleOffset(h+t):this.getAngleOffset(d-t),g=r?l+p+e:c-p-e,f=o?h+t:d-t,m=f*Math.cos(g),b=f*Math.sin(g);if(u!=null&&(!r&&!(g>=l-1e-6&&g<=u.endAngle-1e-6)||r&&!(g>=u.startAngle+1e-6&&g<=c-1e-6)||o&&fu.outerRadius+1e-6))return;const x=new Sf(m,b,t,i,s);if(u!=null){o?(x.clipStart(ud(m,b,t,i,s,u.endAngle)),x.clipEnd(ud(m,b,t,i,s,u.startAngle))):(x.clipStart(ud(m,b,t,i,s,u.startAngle)),x.clipEnd(ud(m,b,t,i,s,u.endAngle)));let D,A;if(r?(D=pd(m,b,t,i,s,u.innerRadius),A=pd(m,b,t,i,s,u.outerRadius)):(D=pd(m,b,t,i,s,u.outerRadius),A=pd(m,b,t,i,s,u.innerRadius)),x.clipStart(D),x.clipEnd(A),D!=null){const{x:C,y:T}=x.pointAt(D),L=On(Math.atan2(T,C),l);r?a?.clipStart(L):n.clipEnd(L)}if(A!=null){const{x:C,y:T}=x.pointAt(A),L=On(Math.atan2(T,C),l);r?n.clipStart(L):a?.clipEnd(L)}}if(u!=null){const{x:D,y:A}=x.pointAt((x.a0+x.a1)/2);if(!vf(D,A,u))return}const{x:v,y:S}=x.pointAt(r===o?x.a0:x.a1),I=On(Math.atan2(S,v),l),M=o?a:n;return r?M?.clipStart(I):M?.clipEnd(I),x}updatePath(){const{path:e,centerX:i,centerY:s,concentricEdgeInset:n,radialEdgeInset:a}=this;let{startOuterCornerRadius:r,endOuterCornerRadius:o,startInnerCornerRadius:l,endInnerCornerRadius:c}=this;const{startAngle:h,endAngle:d}=dd(this.startAngle,this.endAngle),{innerRadius:u,outerRadius:p}=this.normalizedRadii(),g=this.normalizedClipSector(),f=d-h,m=f>=2*Math.PI-1e-6;e.clear();const b=this.getAngleOffset(u),x=f-2*b,v=p-u,S=u>0&&x>0?2*u*Math.sin(x/2):0,I=p>0&&x>0?2*p*Math.sin(x/2):0;if(r=Math.floor(Math.max(0,Math.min(r,I/2,v/2))),o=Math.floor(Math.max(0,Math.min(o,I/2,v/2))),l=Math.floor(Math.max(0,Math.min(l,S/2,v/2))),c=Math.floor(Math.max(0,Math.min(c,S/2,v/2))),u===0&&p===0||u>p||S<0||I<=0)return;if((g?.startAngle??h)===(g?.endAngle??d))return;if(m&&this.clipSector==null&&r===0&&o===0&&l===0&&c===0){e.moveTo(i+p*Math.cos(h),s+p*Math.sin(h)),e.arc(i,s,p,h,d),u>n&&(e.moveTo(i+u*Math.cos(d),s+u*Math.sin(d)),e.arc(i,s,u,d,h,!0)),e.closePath();return}else if(this.clipSector==null&&Math.abs(u-p)<1e-6){e.arc(i,s,p,h,d,!1),e.arc(i,s,p,d,h,!0),e.closePath();return}const D=this.getAngleOffset(p);if(f<2*D)return;const C=(g?.innerRadius??u)>n,T=u0?Math.min(v/L,1):1;r*=k,o*=k,l*=k,c*=k;const O=gM(p,f-2*D,-r,-o);if(r*=O,o*=O,!T&&C){const se=gM(u,f-2*b,l,c);l*=se,c*=se}else l=0,c=0;const N=Math.max(r+l,o+c),w=N>0?Math.min(v/N,1):1;r*=w,o*=w,l*=w,c*=w;let R=0,F=0;const E=r/(p-r),V=o/(p-o);if(E>=0&&E<1-1e-6)R=Math.asin(E);else{R=f/2;const se=p/(1/Math.sin(R)+1);r=Math.min(se,r)}if(V>=0&&V<1-1e-6)F=Math.asin(V);else{F=f/2;const se=p/(1/Math.sin(F)+1);o=Math.min(se,o)}const Z=Math.asin(l/(u+l)),Y=Math.asin(c/(u+c)),ze=g?.outerRadius??p,Ge=this.getAngleOffset(ze),ae=new Sf(0,0,ze,h+Ge,d-Ge),ke=g?.innerRadius??u,Gt=this.getAngleOffset(ke),si=C?new Sf(0,0,ke,h+Gt,d-Gt):void 0;g!=null&&(ae.clipStart(g.startAngle),ae.clipEnd(g.endAngle),si?.clipStart(g.startAngle),si?.clipEnd(g.endAngle));const Vn=this.arc(r,R,h-Math.PI*.5,h+R,ae,si,!0,!1),Bn=this.arc(o,F,d-F,d+Math.PI*.5,ae,si,!1,!1),Qi=this.arc(c,Y,d+Math.PI*.5,d+Math.PI-Y,ae,si,!1,!0),Xs=this.arc(l,Z,h+Math.PI+Z,h+Math.PI*1.5,ae,si,!0,!0);if(!(T&&C)){if(T){const se=f0&&set.equals(e)})],At.prototype,"clipSector",2),y([ki()],At.prototype,"concentricEdgeInset",2),y([ki()],At.prototype,"radialEdgeInset",2),y([ki()],At.prototype,"startOuterCornerRadius",2),y([ki()],At.prototype,"endOuterCornerRadius",2),y([ki()],At.prototype,"startInnerCornerRadius",2),y([ki()],At.prototype,"endInnerCornerRadius",2);import{createElement as IM,getIconClassNames as Uj}from"ag-charts-core";import{createElement as DM,setAttribute as Hj}from"ag-charts-core";var If=class extends bu{constructor(){super(DM("div"),"menuitem")}},MM=class extends bu{constructor(){super(DM("div"),"menuitemradio")}setChecked(t){Hj(this.elem,"aria-checked",t)}};import{CleanupRegistry as jj,addEscapeEventListener as Wj,addMouseCloseListener as Yj,addOverrideFocusVisibleEventListener as $j,addTouchCloseListener as Kj,createElementId as Zj,getLastFocus as Xj,hasNoModifiers as qj,isDirectionRtl as AM,setAttribute as Df}from"ag-charts-core";var CM=class UC extends vu{constructor(e="vertical"){super(e,"menu"),this.handleMouseEnter=(i,s)=>{s.hasPopup()||this.expandSubMenu(i,void 0)},this.handleMouseMove=(i,s)=>{s.focus({preventScroll:!0})}}destructor(){this.collapse({mode:"2"})}addSeparator(){const e=this.elem.ownerDocument.createElement("div");return Df(e,"role","separator"),this.elem.appendChild(e),e}toggleChildEnabledByIndex(e,i){this.children.at(e)?.setEnabled(i)}onChildAdded(e){super.onChildAdded(e),e.addListener("mouseenter",this.handleMouseEnter),e.addListener("mousemove",this.handleMouseMove)}onChildRemoved(e){super.onChildRemoved(e),e.removeListener("mouseenter",this.handleMouseEnter),e.removeListener("mousemove",this.handleMouseMove)}addSubMenu(){const e=new If,i=new UC(this.orientation);i.id=Zj();const s=()=>{this.collapseExpandedSubMenu(i),e.expandControlled()},n=a=>{const r=AM(this.elem)?"ArrowLeft":"ArrowRight";qj(a.sourceEvent)&&a.sourceEvent.code===r&&(this.collapseExpandedSubMenu(i),e.expandControlled())};return e.setControlled(i),e.setAriaHasPopup("menu"),e.addListener("click",s),e.addListener("mouseenter",s),e.addListener("keydown",n),this.addChild(e),{subMenuButton:e,subMenu:i}}expandSubMenu(e,i){const{expansionScope:s}=this;s&&(this.collapseExpandedSubMenu(i),i?.expand(e))}collapseExpandedSubMenu(e){const{expansionScope:i}=this;i&&(i.expandedSubMenu?.collapse({mode:"4"}),i.expandedSubMenu=e)}getCloseKeys(){return AM(this.elem)?["Escape","ArrowRight"]:["Escape","ArrowLeft"]}expand(e){if(this.expansionScope!=null)return;this.expansionScope={lastFocus:Xj(e.sourceEvent),expandedSubMenu:void 0,abort:()=>this.collapse({mode:"1"}),close:()=>this.collapse({mode:"0"}),removers:new jj};const i=this.expansionScope,s=this.children.map(n=>n.getElement());Df(i.lastFocus,"aria-expanded",!0),i.removers.register(Yj(this.elem,i.abort),Kj(this.elem,i.abort),...this.children.map(n=>Wj(n.getElement(),i.close,()=>this.getCloseKeys())),e?.overrideFocusVisible&&$j(this.elem,s,e.overrideFocusVisible)),this.internalListener?.dispatch("expand-widget",this,{type:"expand-widget"}),this.children[0]?.focus({preventScroll:!0})}collapse(e){const{mode:i="0"}=e??{};if(this.expansionScope===void 0)return;const{lastFocus:s,removers:n,expandedSubMenu:a}=this.expansionScope;this.expansionScope=void 0,a?.collapse({mode:"3"}),Df(s,"aria-expanded",!1),i==="0"&&s?.focus({preventScroll:!0}),n.flush(),this.internalListener?.dispatch("collapse-widget",this,{type:"collapse-widget",mode:i})}};import{clamp as fd}from"ag-charts-core";import{AbstractModuleInstance as Jj,createElement as TM,getLastFocus as Qj}from"ag-charts-core";var LM="canvas-overlay",NM=class extends Jj{constructor(t,e,i){super(),this.ctx=t,this.hideFns=[],this.setOwnedWidget=(()=>{let s;return n=>{s?.destroy(),s=n}})(),this.moduleId=`popover-${e}`,i?.detached?this.element=TM("div"):this.element=t.domManager.addChild(LM,this.moduleId),this.element.setAttribute("role","presentation"),this.hideFns.push(()=>this.setOwnedWidget(void 0)),this.cleanup.register(()=>t.domManager.removeChild(LM,this.moduleId))}attachTo(t){this.element.parentElement||t.element.append(this.element)}hide(t){const{lastFocus:e=this.lastFocus}=t??{};if(this.element.children.length!==0){for(const i of this.hideFns)i();e?.focus(),this.lastFocus=void 0}}removeChildren(){this.element.replaceChildren()}initPopoverElement(t,e){if(!this.element.parentElement)throw new Error("Can not show popover that has not been attached to a parent.");return t??(t=TM("div","ag-charts-popover")),t.classList.toggle("ag-charts-popover",!0),e.ariaLabel!=null&&t.setAttribute("aria-label",e.ariaLabel),e.class!=null&&t.classList.add(e.class),e.minWidth!=null&&(t.style.minWidth=`${e.minWidth}px`),this.element.replaceChildren(t),t}showWidget(t,e,i){this.setOwnedWidget(e),this.initPopoverElement(e.getElement(),i),e.addListener("collapse-widget",()=>{this.hide(),t.setControlled(void 0),this.setOwnedWidget(void 0)}),t.setControlled(e),t.expandControlled(),i.onHide&&this.hideFns.push(i.onHide)}showWithChildren(t,e){const i=this.initPopoverElement(void 0,e);if(i.replaceChildren(...t),this.hideFns.push(()=>this.removeChildren()),e.onHide&&this.hideFns.push(e.onHide),e.initialFocus&&e.sourceEvent){const s=Qj(e.sourceEvent);s!==void 0&&(this.lastFocus=s,this.initialFocus=e.initialFocus)}return i}getPopoverElement(){return this.element.firstElementChild}updatePosition(t){const e=this.getPopoverElement();e&&(e.style.setProperty("right","unset"),e.style.setProperty("bottom","unset"),t.x!=null&&e.style.setProperty("left",`${t.x}px`),t.y!=null&&e.style.setProperty("top",`${t.y}px`),this.initialFocus?.focus(),this.initialFocus=void 0)}},kM=class extends NM{setAnchor(t,e){this.anchor=t,this.fallbackAnchor=e,this.updatePosition(t),this.repositionWithinBounds()}updateAnchor(t){const e=t.anchor??this.anchor,i=t.fallbackAnchor??this.fallbackAnchor;e&&this.setAnchor(e,i)}showWidget(t,e,i){super.showWidget(t,e,i),this.updateAfterShow(i)}showWithChildren(t,e){const i=super.showWithChildren(t,e);return this.updateAfterShow(e),i}repositionWithinBounds(){const{anchor:t,ctx:e,fallbackAnchor:i}=this,s=this.getPopoverElement();if(!t||!s)return;const n=e.domManager.getBoundingClientRect(),{offsetWidth:a,offsetHeight:r}=s,{isRtl:o}=e.domManager,l=o?t.x-a:t.x;let c=fd(0,l,n.width-a),h=fd(0,t.y,n.height-r);if(c!==l&&i?.x!=null){const d=o?i.x:i.x-a;c=fd(0,d,n.width-a)}h!==t.y&&i?.y!=null&&(h=fd(0,i.y-r,n.height-r)),this.updatePosition({x:c,y:h})}updateAfterShow(t){this.updateAnchor(t),this.ctx.agDocument.requestAnimationFrame(()=>{this.repositionWithinBounds()})}},e4=class extends kM{show(t,e){const i=new CM("vertical");for(const s of e.items)i.addChild(this.createRow(e,s,i));i.addClass("ag-charts-menu"),this.showWidget(t,i,e)}allocRow(t,e){if(t.menuItemRole==null||t.menuItemRole==="menuitem")return new If;{t.menuItemRole;const i=new MM;return i.setChecked(t.value===e.value),i}}createRow(t,e,i){const s=e.value===t.value,n=this.allocRow(t,e);if(e.enabled!=null&&n.setEnabled(e.enabled),n.addClass("ag-charts-menu__row"),n.toggleClass("ag-charts-menu__row--active",s),typeof e.value=="string"&&(n.getElement().dataset.popoverId=e.value),e.icon!=null){const r=IM("span",`ag-charts-menu__icon ${Uj(e.icon)}`);n.getElement().appendChild(r)}const a=e.strokeWidth!=null;if(a&&(n.toggleClass("ag-charts-menu__row--stroke-width-visible",a),n.setCSSVariable("--strokeWidth",a?`${e.strokeWidth}px`:null)),e.label!=null){const r=IM("span","ag-charts-menu__label");r.textContent=this.ctx.localeManager.t(e.label),n.getElement().appendChild(r)}return"altText"in e&&n.setAriaLabel(this.ctx.localeManager.t(e.altText)),n.addListener("click",({sourceEvent:r})=>{t.onPress?.(e),r.preventDefault(),r.stopPropagation(),i.collapse()}),n}};import{Vec2 as Bl}from"ag-charts-core";var wM=class extends NM{constructor(){super(...arguments),this.dragged=!1}setDragHandle(t){t.addListener("drag-start",e=>{t.addClass(this.dragHandleDraggingClass),this.onDragStart(e)}),t.addListener("drag-move",this.onDragMove.bind(this)),t.addListener("drag-end",()=>{t.removeClass(this.dragHandleDraggingClass),this.onDragEnd.bind(this)})}onDragStart(t){const e=this.getPopoverElement();e&&(t.sourceEvent.preventDefault(),this.dragged=!0,this.dragStartState={client:Bl.from(t.clientX,t.clientY),position:Bl.from(Number(e.style.getPropertyValue("left").replace("px","")),Number(e.style.getPropertyValue("top").replace("px","")))})}onDragMove(t){const{dragStartState:e}=this,i=this.getPopoverElement();if(!e||!i)return;const s=Bl.sub(Bl.from(t.clientX,t.clientY),e.client),n=Bl.add(e.position,s),a=this.ctx.domManager.getBoundingClientRect(),r={};n.x>=0&&n.x+i.offsetWidth<=a.width&&(r.x=n.x),n.y>=0&&n.y+i.offsetHeight<=a.height&&(r.y=n.y),this.updatePosition(r)}onDragEnd(){this.dragStartState=void 0}};import{getIconClassNames as OM,setAttribute as t4}from"ag-charts-core";var i4={"disjoint-channel":"false","fibonacci-menu":"menu","fibonacci-retracement":"false","fibonacci-retracement-trend-based":"false","fill-color":"dialog","horizontal-line":"false","line-color":"dialog","line-menu":"menu","line-stroke-width":"menu","line-style-type":"menu","measurer-menu":"menu","pan-end":"false","pan-left":"false","pan-right":"false","pan-start":"false","parallel-channel":"false","shape-menu":"menu","text-color":"dialog","text-menu":"menu","text-size":"menu","vertical-line":"false","zoom-in":"false","zoom-out":"false",callout:"false",clear:"false",comment:"false",delete:"false",line:"false",lock:"false",menu:"menu",note:"false",reset:"false",settings:"dialog",text:"false",millisecond:"false",second:"false",minute:"false",hour:"false",day:"false",month:"false",year:"false"};function s4(t){return typeof t!="string"?"false":i4[t]}var EM=class extends yc{constructor(t){super(),this.localeManager=t}update(t){const{localeManager:e}=this;if(t.tooltip){const n=e.t(t.tooltip);n!==this.lastTooltip&&(this.elem.title=n,this.lastTooltip=n)}let i="";if(t.icon!=null&&t.iconPosition!=="after"&&(i=``),t.label!=null){const n=e.t(t.label);i=`${i}${n}`}t.icon!=null&&t.iconPosition==="after"&&(i=`${i}`);const s=s4(t.value);s=="false"?(this.setAriaHasPopup(void 0),this.setAriaExpanded(void 0)):(this.setAriaHasPopup(s),this.setAriaExpanded(!1)),i!==this.lastInnerHTML&&(this.elem.innerHTML=i,this.lastInnerHTML=i)}setChecked(t){t4(this.elem,"aria-checked",t)}};import{BaseProperties as n4}from"ag-charts-core";var RM="ag-charts-toolbar__button--active",Mf=class extends bc{constructor({eventsHub:t,localeManager:e},i,s){super(s),this.ariaLabelId=i,this.horizontalSpacing=10,this.verticalSpacing=10,this.events=new ab,this.hasPrefix=!1,this.buttonWidgets=[],this.updateAriaLabel=()=>this.setAriaLabel(this.localeManager.t(this.ariaLabelId)),this.eventsHub=t,this.localeManager=e,this.addClass("ag-charts-toolbar"),this.toggleClass("ag-charts-toolbar--horizontal",s==="horizontal"),this.toggleClass("ag-charts-toolbar--vertical",s==="vertical"),this.eventsHub.on("locale:change",this.updateAriaLabel),this.updateAriaLabel()}setAriaLabelId(t){this.ariaLabelId=t,this.updateAriaLabel()}addToolbarListener(t,e){return this.events.addListener(t,e)}clearButtons(){this.expanded?.collapse({mode:"2"});for(const t of this.buttonWidgets)t.destroy();this.buttonWidgets.splice(0)}updateButtons(t){const{buttonWidgets:e}=this;for(const[i,s]of t.entries())(this.buttonWidgets.at(i)??this.createButton(i,s)).update(s);for(let i=t.length;ithis.getButtonWidgetBounds(t))}getButtonWidget(t){return this.buttonWidgets.at(t)}setButtonHiddenByIndex(t,e){this.buttonWidgets.at(t)?.setHidden(e)}getButtonWidgetBounds(t){const e=this.getBounds(),i=t.getBounds(),s=t.getBoundingClientRect(),n=s.x-Math.floor(s.x),a=s.y-Math.floor(s.y);return new P(i.x+e.x+n,i.y+e.y+a,s.width,s.height)}refreshButtonClasses(){const{buttonWidgets:t,hasPrefix:e}=this;let i,s,n;for(const[a,r]of t.entries())i=!e&&a===0||n!=r.section,s=a===t.length-1||r.section!=t.at(a+1)?.section,r.toggleClass("ag-charts-toolbar__button--first",i),r.toggleClass("ag-charts-toolbar__button--last",s),r.toggleClass("ag-charts-toolbar__button--group-first",a>0&&i),n=r.section}createButton(t,e){const i=this.createButtonWidget();return i.addClass("ag-charts-toolbar__button"),i.addListener("click",s=>{const n={index:t,...e instanceof n4?e.toJson():e},a=this.getButtonWidgetBounds(i),r={event:s,button:n,buttonBounds:a,buttonWidget:i};this.events.dispatch("button-pressed",r)}),i.addListener("focus",()=>{const s={button:{index:t}};this.events.dispatch("button-focused",s)}),i.addListener("expand-controlled-widget",s=>{this.expanded?.collapse({mode:"4"}),this.expanded=s.controlled;const n=this.expanded.addListener("collapse-widget",()=>{this.expanded=void 0,n()})}),e.section&&(i.section=e.section),this.buttonWidgets.push(i),this.addChild(i),i}},a4=class extends Mf{createButtonWidget(){return new EM(this.localeManager)}};import{clamp as PM,createElement as _M,getIconClassNames as r4}from"ag-charts-core";var o4=class extends wM{constructor(t,e,i){super(t,e),this.onPopoverMoved=i,this.dragHandleDraggingClass="ag-charts-floating-toolbar__drag-handle--dragging"}show(t,e={}){this.showWithChildren(t,{...e,class:"ag-charts-floating-toolbar"})}hide(){this.dragged=!1,super.hide()}getBounds(){const t=this.getPopoverElement();return new P(t?.offsetLeft??0,t?.offsetTop??0,t?.offsetWidth??0,t?.offsetHeight??0)}hasBeenDragged(){return this.dragged}setAnchor(t,e,i){const s=this.getPopoverElement();if(!s)return;const n=t.position??"above",{offsetWidth:a,offsetHeight:r}=s;let o=t.y-r-i,l=t.x-a/2;n==="below"?o=t.y+i:n==="right"?(o=t.y-r/2,l=t.x+e):n==="above-left"&&(l=t.x),this.updatePosition({x:l,y:o})}ignorePointerEvents(){const t=this.getPopoverElement();t&&(t.style.pointerEvents="none")}capturePointerEvents(){const t=this.getPopoverElement();t&&(t.style.pointerEvents="unset")}updatePosition(t){const e=this.getBounds(),i=this.ctx.domManager.getBoundingClientRect();t.x=Math.floor(PM(0,t.x,i.width-e.width)),t.y=Math.floor(PM(0,t.y,i.height-e.height)),super.updatePosition(t),this.onPopoverMoved()}},l4=class extends Mf{constructor(t,e,i){super(t,e,"horizontal"),this.hasPrefix=!0,this.popover=new o4(t,i,this.onPopoverMoved.bind(this)),this.dragHandle=new c4(t.localeManager.t("toolbarAnnotationsDragHandle")),this.popover.setDragHandle(this.dragHandle)}destroy(){super.destroy(),this.popover.destroy()}show(t={}){this.popover.show([this.dragHandle.getElement(),this.getElement()],t)}hide(){this.popover.hide()}setAnchor(t){this.popover.setAnchor(t,this.horizontalSpacing,this.verticalSpacing)}hasBeenDragged(){return this.popover.hasBeenDragged()}ignorePointerEvents(){this.popover.ignorePointerEvents()}capturePointerEvents(){this.popover.capturePointerEvents()}onPopoverMoved(){const t=this.popover.getBounds();if(this.popoverBounds?.equals(t))return;this.popoverBounds=t.clone();const e=this.getButtonBounds();this.events.dispatch("toolbar-moved",{popoverBounds:t,buttonBounds:e})}getButtonWidgetBounds(t){const e=this.popover.getBounds(),i=super.getButtonWidgetBounds(t),s=this.dragHandle.getBounds();return new P(i.x+e.x-s.width,i.y+e.y,i.width,i.height)}},c4=class extends rr{constructor(t){super(_M("div","ag-charts-floating-toolbar__drag-handle"));const e=new rr(_M("span",`${r4("drag-handle")} ag-charts-toolbar__icon`));e.setAriaHidden(!0),this.addChild(e),this.elem.title=t}},h4={...Cx,...Tx},FM={};Un(FM,{ButtonWidget:()=>yc,MenuItemRadioWidget:()=>MM,MenuItemWidget:()=>If,MenuWidget:()=>CM,NativeWidget:()=>rr,SliderWidget:()=>Iu,ToolbarWidget:()=>bc,Widget:()=>tn,WidgetEventUtil:()=>en});import{and as no,boolean as md,color as d4,date as VM,defined as Si,greaterThan as Af,lessThan as Cf,lineDashOptionsDef as u4,number as Wa,or as BM,positiveNumber as p4,ratio as zM,string as Tf,strokeOptionsDef as g4,typeUnion as GM,undocumented as UM,without as Lf}from"ag-charts-core";import{DEFAULT_SPARKLINE_CROSSHAIR_STROKE as f4,isDate as m4,isNumber as y4,isString as b4,simpleMemorize as HM,toTextString as x4}from"ag-charts-core";var jM={title:{enabled:!1},label:{enabled:!1},line:{enabled:!1},gridLine:{enabled:!1},crosshair:{enabled:!1,stroke:f4,lineDash:[0],label:{enabled:!1}}},Nf={...jM,nice:!1},yd={mode:"compact",position:{anchorTo:"node",placement:["right","left"]},showArrow:!1},kf={style:[{stroke:{$ref:"gridLineColor"}}],width:2},v4={number:{gridLine:kf},time:{gridLine:kf},category:{gridLine:kf}},S4={overrides:{common:{animation:{enabled:!1},contextMenu:{enabled:!1},keyboard:{enabled:!1},background:{visible:!1},navigator:{enabled:!1},padding:{top:0,right:0,bottom:0,left:0},axes:{number:{...Nf,interval:{values:[0]}},log:{...Nf},time:{...Nf},category:{...jM}}},bar:{series:{crisp:!1,label:{placement:"inside-end",padding:4},sparklineMode:!0},tooltip:{...yd,position:{...yd.position,anchorTo:"pointer"},range:"nearest"},axes:v4},line:{seriesArea:{padding:{top:2,right:2,bottom:2,left:2}},series:{sparklineMode:!0,strokeWidth:1,marker:{enabled:!1,size:3}},tooltip:yd},area:{seriesArea:{padding:{top:1,right:0,bottom:1,left:0}},series:{strokeWidth:1,fillOpacity:.4},tooltip:yd}}},WM=HM(I4);function I4(t,e){return typeof t=="string"?{...e,baseTheme:t}:t!=null?{...t,baseTheme:WM(t.baseTheme,e)}:e}function YM(t){if(Array.isArray(t)&&t.length!==0){const e=t.find(i=>i!=null);if(typeof e=="number")return{data:t.map((s,n)=>({x:n,y:s})),series:[{xKey:"x",yKey:"y"}],datumKey:"y"};if(Array.isArray(e))return{data:t.map(s=>({x:s?.[0],y:s?.[1],datum:s})),series:[{xKey:"x",yKey:"y"}],datumKey:"datum"}}else if(t?.length===0)return{data:t,series:[{xKey:"x",yKey:"y"}],datumKey:"y"};return{data:t}}function D4(t){switch(t?.type){case"number":{const{reverse:e,min:i,max:s}=t??{};return{type:"number",reverse:e,min:i,max:s}}case"time":{const{reverse:e,min:i,max:s}=t??{};return{type:"time",reverse:e,min:i,max:s}}case"category":default:{if(t==null)return{type:"category"};const{reverse:e,paddingInner:i,paddingOuter:s}=t;return{type:"category",reverse:e,paddingInner:i,paddingOuter:s}}}}function M4(t,e,i){const s={};return t?.stroke!=null&&(s.style=[{stroke:t?.stroke}],s.enabled??(s.enabled=!0)),t?.strokeWidth!=null&&(s.width=t?.strokeWidth,s.enabled??(s.enabled=!0)),i.type==="bar"&&i.direction!=="horizontal"&&(s.enabled??(s.enabled=!0)),t?.visible!=null&&(s.enabled=t.visible),s.enabled??(s.enabled=e),s}var A4=HM((t,e,i)=>s=>{const n=s.datum[s.xKey],a=s.datum[s.yKey],r=i==null?s.datum:s.datum[i],o=e?.renderer?.({context:t,datum:r,xValue:n,yValue:a});if(b4(o)||y4(o)||m4(o))return x4(o);const l=o?.content??a.toFixed(2);return o?.title?{heading:void 0,title:void 0,data:[{label:o.title,value:l}]}:{heading:void 0,title:l,data:[]}});function C4(t){const{background:e,container:i,foreground:s,height:n,listeners:a,locale:r,minHeight:o,minWidth:l,overrideDevicePixelRatio:c,padding:h,width:d,theme:u,data:p,crosshair:g,axis:f,min:m,max:b,tooltip:x,context:v,styleNonce:S,...I}=t,M={background:e,container:i,foreground:s,height:n,listeners:a,locale:r,minHeight:o,minWidth:l,overrideDevicePixelRatio:c,padding:h,width:d,styleNonce:S},{data:D,series:[A]=[],datumKey:C}=YM(p),T=I;A!=null&&Object.assign(T,A),T.tooltip={...x,renderer:A4(v,x,C)},M.theme=WM(u,S4),M.data=D,M.series=[T];const L=T.type==="bar"&&T.direction==="horizontal",[k,O]=L?["left","bottom"]:["bottom","left"],N={...D4(f),position:k,...g==null?{}:{crosshair:g}},w={type:"number",gridLine:M4(f,!1,t),position:O,...m==null?{}:{min:m},...b==null?{}:{max:b}};return M.axes=L?{x:w,y:N}:{x:N,y:w},M}var wf=["showInLegend","showInMiniChart","grouped","stacked","stackGroup","tooltip","listeners","errorBar","xKey","yKey","type"],Of={visible:md,reverse:md,stroke:d4,strokeWidth:p4},zl={context:()=>!0,tooltip:Si,theme:Si,background:Si,container:Si,width:Si,height:Si,minWidth:Si,minHeight:Si,padding:Si,listeners:Si,locale:Si,data:Si,styleNonce:Tf,axis:GM({number:{...Of,min:no(Wa,Cf("max")),max:no(Wa,Af("min"))},category:{...Of,paddingInner:zM,paddingOuter:zM},time:{...Of,min:no(BM(Wa,VM),Cf("max")),max:no(BM(Wa,VM),Af("min"))}},"axis options","category"),min:no(Wa,Cf("max")),max:no(Wa,Af("min")),crosshair:{enabled:md,snap:md,...g4,...u4},xKey:Tf,yKey:Tf};zl.overrideDevicePixelRatio=UM(Wa),zl.foreground=UM(Si);var $M={type:"preset",name:"sparkline",version:me,options:GM({area:{...zl,...Lf(lg,wf)},bar:{...zl,...Lf(Fr,wf)},line:{...zl,...Lf(cl,wf)}},"sparkline options"),create:C4,processData:YM};import{ValidationError as T4,isObject as L4,validate as N4,without as k4}from"ag-charts-core";import{ActionOnSet as w4,ChartAxisDirection as ao,Logger as O4,clampArray as E4,entries as Ef,fromPairs as R4,groupBy as P4}from"ag-charts-core";var _4=["top","right","bottom","left"],Gl=class HC extends sh{constructor(e,i){super(e,i),this.paired=!0,this.axes=this.createChartAxes(),this.lastUpdateClipRect=void 0,this.lastLayoutWidth=Number.NaN,this.lastLayoutHeight=Number.NaN}createChartAxes(){return new nN}onAxisChange(e,i){super.onAxisChange(e,i),this.syncAxisChanges(e,i),this.ctx!=null&&this.ctx.zoomManager.setAxes(e)}destroySeries(e){super.destroySeries(e),this.lastLayoutWidth=Number.NaN,this.lastLayoutHeight=Number.NaN}getChartType(){return"cartesian"}setRootClipRects(e){const{seriesRoot:i,annotationRoot:s}=this;i.setClipRect(e),s.setClipRect(e)}async processData(){await super.processData(),this.syncStatus==="init"&&(this.syncStatus="domains-calculated"),this.ctx.updateService.dispatchProcessData({series:{shouldFlipXY:this.shouldFlipXY()}})}async processDomains(){await super.processDomains();for(const e of this.axes){const i=await this.getSyncedDomain(e);i!=null&&e.setDomains({domain:i})}}performLayout(e){const{seriesRoot:i,annotationRoot:s}=this,{clipSeries:n,seriesRect:a,visible:r}=this.updateAxes(e);this.seriesRoot.visible=r,this.seriesRect=a,this.animationRect=e.layoutBox;const{x:o,y:l}=a;if(e.width!==this.lastLayoutWidth||e.height!==this.lastLayoutHeight)for(const g of[i,s])g.translationX=Math.floor(o),g.translationY=Math.floor(l);else{const{translationX:g,translationY:f}=i;Ns(this.id,"seriesRect",this.ctx.animationManager,[i,s],{translationX:g,translationY:f},{translationX:Math.floor(o),translationY:Math.floor(l)},{phase:"update"})}this.lastLayoutWidth=e.width,this.lastLayoutHeight=e.height;const c=a.clone().grow(this.seriesArea.getPadding()),u=this.series.some(g=>g.alwaysClip)||(this.seriesArea.clip??!1)||n?c:void 0,{lastUpdateClipRect:p}=this;this.lastUpdateClipRect=u,this.ctx.animationManager.isActive()&&p!=null?this.ctx.animationManager.animate({id:this.id,groupId:"clip-rect",phase:"update",from:p,to:c,onUpdate:g=>this.setRootClipRects(g),onStop:()=>this.setRootClipRects(u),onComplete:()=>this.setRootClipRects(u)}):this.setRootClipRects(u),this.ctx.layoutManager.emitLayoutComplete(e,{axes:R4(this.axes.map(g=>[g.id,g.getLayoutState()])),series:{visible:r,rect:a,paddedRect:c},clipSeries:n,layoutBox:e.layoutBox}),lD(this.series)}updateAxes(e){const{layoutBox:i,scrollbars:s}=e,{clipSeries:n,seriesRect:a,overflows:r}=this.resolveAxesLayout(i,s);for(const o of this.axes)o.update(),o.setCrossLinesVisible(!r),this.clipAxis(o,a,i);return{clipSeries:n,seriesRect:a,visible:!r}}resolveAxesLayout(e,i){let s,n,a=0;const r=10,o=this.axes.filter(l=>l.crossAt?.value!=null);do if(n=s??this.getDefaultState(),s=this.updateAxesPass(new Map(n.axisAreaWidths),e.clone(),o,i),a++>r){O4.warn("Max iterations reached. Unable to stabilize axes layout.");break}while(!this.isLayoutStable(s,n));return this.lastAreaWidths=s.axisAreaWidths,s}updateAxesPass(e,i,s,n){const a=new Map,r={};let o=!1,l=!1;const c=this.seriesArea.getPadding();for(const I of _4){const M=c[I]??0,D=this.axes.findLast(A=>A.position===I);D?D.seriesAreaPadding=M:i.shrink(M,I)}const h=(e.get("left")??0)+(e.get("right")??0),d=(e.get("top")??0)+(e.get("bottom")??0),u=this.buildCrossLinePadding(e),p=u.left+u.right,g=u.top+u.bottom;i.width<=h+p||i.height<=d+g?o=!0:i.shrink(u);const{scene:f}=this.ctx,m=i.clone().shrink(Object.fromEntries(e));for(const I of this.axes){const{position:M="left",direction:D}=I,A=D===ao.Y;let C;this.sizeAxis(I,m,M),I.thickness==null?C=Rf(A,f)*(I.maxThicknessRatio??1):C=I.thickness;const T={sizeLimit:C-I.label.spacing,padding:this.padding,scrollbars:n},{primaryTickCount:L,bbox:k}=I.calculateLayout(I.nice?r[D]:void 0,T);r[D]??(r[D]=L),l||(l=I.dataDomain.clipped||I.visibleRange[0]>0||I.visibleRange[1]<1),I.thickness==null&&(C=Math.min(Rf(A,k)??0,C)),a.set(I.id,Math.ceil(C))}let b;s.length>0&&(b=this.calculateAxesCrossPositions(a,m,s));const x=P4(this.axes,I=>I.position??"left"),v=new Map,S=new Map;for(const[I,M]of Ef(x)){let D=Rf(I!=="left"&&I!=="right",f)%f.pixelRatio,A=0;for(const C of M??[]){S.set(C.id,D);const T=a.get(C.id)??0;A=Math.max(A,D+T),C.layoutConstraints.stacked&&(D+=T+HC.AxesPadding)}v.set(I,Math.ceil(A))}for(const[I,M]of Ef(x))this.positionAxes({axes:M??[],position:I,axisWidths:a,axisOffsets:S,axisAreaWidths:v,axisBound:i,seriesRect:m});return b!=null&&this.applyAxisCrossing(m,b),{clipSeries:l,seriesRect:m,axisAreaWidths:v,overflows:o}}calculateAxesCrossPositions(e,i,s){const n=new Map;for(const a of s){const{crossPosition:r,visible:o}=this.calculateAxisCrossPosition(a);a.setAxisVisible(o),this.adjustAxisWidth(a,e,r,i,o),r!=null&&n.set(a.id,r)}return n}calculateAxisCrossPosition(e){const i=this.axes.perpendicular(e),{scale:{domain:s,bandwidth:n},range:a}=i,r=(n??0)/2,o=i.scale.convert(e.crossAt?.value,{clamp:!1})+r;return i.inRange(o)?{crossPosition:o,visible:!0}:e.crossAt?.sticky===!1?{crossPosition:void 0,visible:!1}:{crossPosition:Number.isNaN(o)?a[s[0]]:E4(o,a),visible:!0}}adjustAxisWidth(e,i,s,n,a){if(e.getModuleMap().getModule("crosshair")?.enabled||this.modulesManager.getModule("annotations")?.enabled===!0||this.ctx.annotationManager.createMemento().some(d=>{switch(d.type){case"vertical-line":return e.direction===ao.X;case"horizontal-line":return e.direction===ao.Y}}))return;const c=i.get(e.id)??0,h=a?this.calculateAxisBleedingWidth(e,c,s,n):0;i.set(e.id,h)}calculateAxisBleedingWidth(e,i,s,n){if(s==null)return i;switch(e.position){case"left":case"top":return Math.max(0,i-s);case"right":return Math.max(0,s+i-n.width);case"bottom":return Math.max(0,s+i-n.height);default:return i}}applyAxisCrossing(e,i){for(const s of this.axes){const n=i.get(s.id);if(n==null){s.crossAxisTranslation.x=0,s.crossAxisTranslation.y=0;continue}const a=s.direction===ao.X;s.crossAxisTranslation.x=a?0:e.x+n-s.translation.x,s.crossAxisTranslation.y=a?e.y+n-s.translation.y:0}}buildCrossLinePadding(e){var i;const s={top:0,right:0,bottom:0,left:0};for(const n of this.axes){const{position:a,label:r}=n;if(n.crossLines)for(const o of n.crossLines)o instanceof Nt&&(o.position=a??"top",(i=o.label).parallel??(i.parallel=r.parallel)),o.calculatePadding?.(s)}for(const[n,a=0]of Ef(s))s[n]=Math.max(a-(e.get(n)??0),0);return s}clampToOutsideSeriesRect(e,i,s,n){const a=s==="x"?e.x:e.y,r=s==="x"?e.width:e.height;return n===1?Math.min(i,a+r):Math.max(i,a)}async getSyncedDomain(e){const i=this.modulesManager.getModule("sync");if(i?.enabled)return await i.getSyncedDomain(e)}syncAxisChanges(e,i){const s=this.modulesManager.getModule("sync");if(!s?.enabled)return;const n=new Set(i??[]);for(const a of e)n.delete(a);for(const a of n)s.removeAxis(a)}sizeAxis(e,i,s){const n=e instanceof vi,a=s==="left"||s==="right",{width:r,height:o}=i,l=a?o:r;let c=0,h=l,{min:d,max:u}=this.ctx.zoomManager.getAxisZoom(e.id);const{width:p,unit:g,align:f}=e.layoutConstraints;g==="px"?h=c+p:h=h*p/100;const m=h-c;if(f==="end")c=l-m,h=l;else if(f==="center"){const b=c+(l-c)/2;c=b-m/2,h=b+m/2}else f==="justify"&&(h=l);a&&(n?[c,h]=[h,c]:[d,u]=[1-u,1-d]),e.range=[c,h],e.visibleRange=[d,u],e.gridLength=a?r:o,e.lineRange=a?[o,0]:[0,r]}positionAxes(e){const{axes:i,axisBound:s,axisWidths:n,axisOffsets:a,axisAreaWidths:r,seriesRect:o,position:l}=e,c=r.get(l)??0;let h="x",d="y",u=1;(l==="top"||l==="bottom")&&(h="y",d="x");let p=s[h];(l==="right"||l==="bottom")&&(u=-1,p+=h==="x"?s.width:s.height);for(const g of i){const f=r.get(d==="x"?"left":"top")??0,m=n.get(g.id)??0,b=a.get(g.id)??0;g.gridPadding=c-b-m,g.translation[d]=s[d]+f,g.translation[h]=this.clampToOutsideSeriesRect(o,p+u*(b+m),h,u)}}shouldFlipXY(){return this.series.every(e=>e instanceof Tn&&e.shouldFlipXY())}getDefaultState(){const e=new Map;if(this.lastAreaWidths)for(const{position:i="left"}of this.axes){const s=this.lastAreaWidths.get(i);s!=null&&e.set(i,s)}return{axisAreaWidths:e,clipSeries:!1,overflows:!1}}isLayoutStable(e,i){if(i.overflows!==e.overflows||i.clipSeries!==e.clipSeries)return!1;for(const s of e.axisAreaWidths.keys())if(!i.axisAreaWidths.has(s))return!1;for(const[s,n]of i.axisAreaWidths.entries()){const a=e.axisAreaWidths.get(s);if((n!=null||a!=null)&&n!==a)return!1}return!0}clipAxis(e,i,s){const n=Math.ceil(e.gridLine?.width??0),a=Math.ceil(e.line?.width??0);let{width:r,height:o}=i;switch(r+=e.direction===ao.X?n:a,o+=e.direction===ao.Y?n:a,e.clipGrid(i.x,i.y,r,o),e.position){case"left":case"right":e.clipTickLines(s.x,i.y-n,s.width+n,i.height+n*2);break;case"top":case"bottom":e.clipTickLines(i.x-n,s.y,i.width+n*2,s.height+n);break}}};Gl.className="CartesianChart",Gl.type="cartesian",Gl.AxesPadding=15,y([w4({changeValue(t,e){this.onAxisChange(t,e)}})],Gl.prototype,"axes",2);var F4=Gl;function Rf(t,e){return t?e?.width:e?.height}var V4=new Set(["number","log","time"]),B4=t=>L4(t)&&t.type!=null&&!V4.has(t.type),Ii={type:"chart",name:"cartesian",version:me,options:Tw,create(t,e){return new F4(t,e)},validate(t,e,i){const s=[];t?.series?.[0]?.type==="histogram"&&Object.values(t?.axes??{}).some(B4)&&(s.push(new T4("invalid","only continuous axis types when histogram series is used",t.axes,i,"axes")),t=k4(t,["axes"]));const n=N4(t,e,i);return n.invalid.push(...s),n}};import{UnknownError as z4,validate as G4,without as U4}from"ag-charts-core";import{ChartAxisDirection as KM,Padding as H4,ZIndexMap as j4,iterate as ZM}from"ag-charts-core";var Pf=class extends sh{constructor(t,e){super(t,e),this.axes=this.createChartAxes(),this.padding=new H4(40),this.ctx.axisManager.axisGroup.zIndex=j4.AXIS_FOREGROUND}createChartAxes(){return new aN}getChartType(){return"polar"}isDataTransactionSupported(){return!this.series.some(t=>t.type==="pie"||t.type==="donut")}async performLayout(t){const e=t.layoutBox.clone().shrink(this.seriesArea.getPadding());this.seriesRect=e,this.animationRect=e,this.seriesRoot.translationX=e.x,this.seriesRoot.translationY=e.y,await this.computeCircle(e);for(const s of this.axes)s.update();let i=0;for(const s of this.series)i=Math.max(i,s.properties.marker?.size??0);for(const s of this.series.filter(XM))s.maxChartMarkerSize=i;this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:!0,rect:e,paddedRect:t.layoutBox},layoutBox:t.layoutBox})}updateAxes(t,e,i,s){if(this.axes.length===0)return;const n=this.axes[KM.Angle],a=this.axes[KM.Radius],r=n.scale,o=a.innerRadiusRatio;n.innerRadiusRatio=o,n.computeRange(),n.gridLength=s,a.gridAngles=r.ticks({nice:[n.nice,n.nice],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(l=>r.convert(l)),a.gridRange=n.range,a.range=[s,s*o];for(const l of[n,a])l.translation.x=t.x+e,l.translation.y=t.y+i,l.calculateLayout()}async computeCircle(t){const e=this.series.filter(XM),i=(l,c,h)=>{this.updateAxes(t,l,c,h);for(const u of e)u.centerX=l,u.centerY=c,u.radius=h;const d=e.filter(u=>u.type==="donut"||u.type==="pie");if(d.length>1){const u=d.map(p=>{const g=p.getInnerRadius();return{series:p,innerRadius:g}}).sort((p,g)=>p.innerRadius-g.innerRadius);u.at(-1).series.surroundingRadius=void 0;for(let p=0;p{const c=[];for(const u of ZM(this.axes,e)){const p=await u.computeLabelsBBox({hideWhenNecessary:l},t);p&&c.push(p)}if(c.length===0){i(s,n,a);return}const h=P.merge(c),d=this.refineCircle(h,r,t);i(d.centerX,d.centerY,d.radius),r=d.radius};await o(),await o(),await o(),await o({hideWhenNecessary:!0}),await o({hideWhenNecessary:!0});for(const l of ZM(this.axes,e))await l.computeLabelsBBox({hideWhenNecessary:!0},t);return{radius:r,centerX:s,centerY:n}}refineCircle(t,e,i){const n=-e,a=-e,r=e,o=e;let l=Math.max(0,n-t.x),c=Math.max(0,a-t.y),h=Math.max(0,t.x+t.width-r),d=Math.max(0,t.y+t.height-o);l=h=Math.max(l,h),c=d=Math.max(c,d);const u=i.width-l-h,p=i.height-c-d;let g=Math.min(u,p)/2;const f=.5*i.width/2,m=.5*i.height/2,b=Math.min(f,m);if(gi.height){const M=i.height-2*g;Math.min(c,d)*2>M?(c=M/2,d=M/2):c>d?c=M-d:d=M-c}if(2*g+S>i.width){const M=i.width-2*g;Math.min(l,h)*2>M?(l=M/2,h=M/2):l>h?l=M-h:h=M-l}}const x=l+2*g+h,v=c+2*g+d;return{centerX:(i.width-x)/2+l+g,centerY:(i.height-v)/2+c+g,radius:g}}};Pf.className="PolarChart",Pf.type="polar";function XM(t){return t instanceof gf}var bd={type:"chart",name:"polar",version:me,options:Lw,create(t,e){return new Pf(t,e)},validate(t,e,i){const s=[],n=t?.series?.[0]?.type;(n==="pie"||n==="donut")&&t?.axes&&(s.push(new z4([],t.axes,i,"axes")),t=U4(t,["axes"]));const a=G4(t,e,i);return a.invalid.push(...s),a}};import{CARTESIAN_POSITION as Di,FONT_SIZE_RATIO as W4,LEGEND_CONTAINER_THEME as Y4,boolean as Ul,borderOptionsDef as $4,callback as _f,colorUnion as K4,fillOptionsDef as Ff,fontOptionsDef as qM,legendPositionValidator as Z4,number as X4,padding as q4,positiveNumber as ei,ratio as J4,shapeValidator as JM,strokeOptionsDef as Vf,union as Q4}from"ag-charts-core";import{BaseProperties as ro,Border as eW,ChartUpdateType as xd,CleanupRegistry as tW,FONT_SIZE as iW,LineSplitter as sW,Logger as Bf,ObserveChanges as nW,Property as $,ZIndexMap as aW,cachedTextMeasurer as rW,callWithContext as QM,clamp as oW,createId as lW,deepClone as cW,expandLegendPosition as zf,isImageFill as hW,isPatternFill as dW,isTextTruncated as uW,objectsEqual as pW,toPlainText as gW,truncateLine as fW}from"ag-charts-core";function mW({orientation:t,bboxes:e,maxHeight:i,maxWidth:s,itemPaddingY:n=0,itemPaddingX:a=0,forceResult:r=!1}){const o=t==="horizontal",l={max:o?s:i,fn:o?u=>u.width:u=>u.height,padding:o?a:n},c={max:o?i:s,fn:o?u=>u.height:u=>u.width,padding:o?n:a};let h=0;const d=[];for(;h=1;){const l=bW(t,e,o,i,s,n);if(l==null&&o<=1)return;if(l==null){o--;continue}if(typeof l=="number"){if(l<=1)return;o=l1?l:o,o--;continue}return{processedBBoxCount:l.length*l[0].length,pageIndices:l}}}function bW(t,e,i,s,n,a){const r=[];let o=0,l=0,c=[];const h=[];for(let d=0;d0&&r.push(c),c=[]);const p=s.fn(t[d])+s.padding;h[u]=Math.max(h[u]??0,p),l=Math.max(l,n.fn(t[d])+n.padding);const g=o+l,f=!a||r.length>0;if(g>n.max&&f){c=[];break}if(h.reduce((b,x)=>b+x,0)>s.max&&!a)return h.length0&&r.push(c),r.length>0?r:void 0}function xW(t,e,i,s,n){let a=0,r=0;return{pages:t.map(l=>{e==="horizontal"&&(l=vW(l));let c=0;const h=l.map(p=>{const g=p.map(b=>(c=Math.max(b,c),i[b]));let f=0,m=0;for(const b of g)f+=b.height+s,m=Math.max(m,b.width+n);return{indices:p,bboxes:g,columnHeight:Math.ceil(f),columnWidth:Math.ceil(m)}});let d=0,u=0;for(const p of h)d+=p.columnWidth,u=Math.max(u,p.columnHeight);return a=Math.max(d,a),r=Math.max(u,r),{columns:h,startIndex:l[0][0],endIndex:c,pageWidth:d,pageHeight:u}}),maxPageWidth:a,maxPageHeight:r}}function vW(t){const e=[];for(const i of t[0])e.push([]);for(const[i,s]of t.entries())for(const[n,a]of s.entries())e[n][i]=a;return e}function SW(t,e){const i=t.length;let s=0;for(let n=0;ne.max)return i/n<2?Math.ceil(i/2):n;return i}import{ActionOnSet as IW,BaseProperties as vd,FONT_SIZE as eA,ObserveChanges as tA,Property as gt,clamp as DW,createId as MW}from"ag-charts-core";var oo=class extends vd{constructor(){super(...arguments),this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=eA.SMALL,this.fontFamily="Verdana, sans-serif"}};y([gt],oo.prototype,"color",2),y([gt],oo.prototype,"fontStyle",2),y([gt],oo.prototype,"fontWeight",2),y([gt],oo.prototype,"fontSize",2),y([gt],oo.prototype,"fontFamily",2);var Ys=class extends vd{constructor(){super(...arguments),this.size=15,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=1,this.strokeOpacity=1}};y([gt],Ys.prototype,"size",2),y([gt],Ys.prototype,"fill",2),y([gt],Ys.prototype,"fillOpacity",2),y([gt],Ys.prototype,"stroke",2),y([gt],Ys.prototype,"strokeWidth",2),y([gt],Ys.prototype,"strokeOpacity",2);var Sd=class extends vd{constructor(t){super(),this.parent=t,this.shape="triangle",this.size=15,this.padding=8}};y([IW({changeValue(){this.parent.marker===this&&this.parent.onMarkerShapeChange()}})],Sd.prototype,"shape",2),y([gt],Sd.prototype,"size",2),y([gt],Sd.prototype,"padding",2);var $s=class extends vd{constructor(t,e){super(),this.chartUpdateCallback=t,this.pageUpdateCallback=e,this.id=MW(this),this.marker=new Sd(this),this.activeStyle=new Ys,this.inactiveStyle=new Ys,this.highlightStyle=new Ys,this.label=new oo,this.group=new mt({name:"pagination"}),this.labelNode=new Ht,this.totalPages=0,this.currentPage=0,this.translationX=0,this.translationY=0,this.nextButtonDisabled=!1,this.previousButtonDisabled=!1,this._visible=!0,this._enabled=!0,this.nextButton=new We,this.previousButton=new We,this.isRtl=!1,this.orientation="vertical",this.labelNode.setProperties({textBaseline:"middle",textAlign:"left",fontSize:eA.SMALL,fontFamily:"Verdana, sans-serif",fill:"black",y:1}),this.group.append([this.nextButton,this.previousButton,this.labelNode]),this.update(),this.updateMarkers()}set visible(t){this._visible=t,this.updateGroupVisibility()}get visible(){return this._visible}set enabled(t){this._enabled=t,this.updateGroupVisibility()}get enabled(){return this._enabled}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible}applyRotations(){const{isRtl:t}=this;switch(this.orientation){case"horizontal":{this.previousButton.rotation=t?Math.PI/2:-Math.PI/2,this.nextButton.rotation=t?-Math.PI/2:Math.PI/2;break}case"vertical":default:this.previousButton.rotation=0,this.nextButton.rotation=Math.PI}}update(){this.updateLabel(),this.updatePositions(),this.enableOrDisableButtons()}updatePositions(){this.group.translationX=this.translationX,this.group.translationY=this.translationY,this.updateLabelPosition(),this.updateButtonPositions()}updateLabelPosition(){const{size:t,padding:e}=this.marker;this.nextButton.size=t,this.previousButton.size=t,this.labelNode.x=t/2+e}updateButtonPositions(){const e=this.labelNode.getBBox().width+(this.marker.size/2+this.marker.padding)*2;this.isRtl&&this.orientation==="horizontal"?(this.nextButton.translationX=0,this.previousButton.translationX=e):(this.previousButton.translationX=0,this.nextButton.translationX=e)}updateLabel(){const{isRtl:t,labelNode:e,currentPage:i,totalPages:s,label:{color:n,fontStyle:a,fontWeight:r,fontSize:o,fontFamily:l}}=this,c=[i+1,s];t&&c.reverse(),e.text=c.join(" / "),e.fill=n,e.fontStyle=a,e.fontWeight=r,e.fontSize=o,e.fontFamily=l}updateMarkers(){const{nextButton:t,previousButton:e,nextButtonDisabled:i,previousButtonDisabled:s,activeStyle:n,inactiveStyle:a,highlightStyle:r,highlightActive:o}=this,l=(c,h)=>h?a:c===o?r:n;this.updateMarker(t,l("next",i)),this.updateMarker(e,l("previous",s))}updateMarker(t,e){const{shape:i,size:s}=this.marker;t.shape=i,t.size=s,t.fill=e.fill,t.fillOpacity=e.fillOpacity??1,t.stroke=e.stroke,t.strokeWidth=e.strokeWidth,t.strokeOpacity=e.strokeOpacity}enableOrDisableButtons(){const{currentPage:t,totalPages:e}=this,i=e===0,s=t===e-1,n=t===0;this.nextButtonDisabled=s||i,this.previousButtonDisabled=n||i}setPage(t){t=DW(0,t,Math.max(0,this.totalPages-1)),this.currentPage!==t&&(this.currentPage=t,this.onPaginationChanged())}getCursor(t){return{previous:this.previousButtonDisabled,next:this.nextButtonDisabled}[t]?void 0:"pointer"}onClick(t,e){t.preventDefault(),e==="next"&&!this.nextButtonDisabled?(this.incrementPage(),this.onPaginationChanged()):e==="previous"&&!this.previousButtonDisabled&&(this.decrementPage(),this.onPaginationChanged())}onMouseHover(t){this.highlightActive=t,this.updateMarkers(),this.chartUpdateCallback()}onPaginationChanged(){this.pageUpdateCallback(this.currentPage)}incrementPage(){this.currentPage=Math.min(this.currentPage+1,this.totalPages-1)}decrementPage(){this.currentPage=Math.max(this.currentPage-1,0)}onMarkerShapeChange(){this.updatePositions(),this.updateMarkers(),this.chartUpdateCallback()}attachPagination(t){t.append(this.group)}getBBox(){return this.group.getBBox()}computeCSSBounds(){const t=fe.toCanvas(this.previousButton),e=fe.toCanvas(this.nextButton);return{prev:t,next:e}}};$s.className="Pagination",y([gt],$s.prototype,"marker",2),y([gt],$s.prototype,"activeStyle",2),y([gt],$s.prototype,"inactiveStyle",2),y([gt],$s.prototype,"highlightStyle",2),y([gt],$s.prototype,"label",2),y([tA(t=>{t.applyRotations(),t.updatePositions()})],$s.prototype,"isRtl",2),y([tA(t=>t.applyRotations())],$s.prototype,"orientation",2);import{createElementId as AW,toPlainText as iA}from"ag-charts-core";var CW=class{constructor(t,e){this.dirty=!0,this.itemList=t.proxyInteractionService.createProxyContainer({type:"list",domManagerId:`${e}-toolbar`,classList:["ag-charts-proxy-legend-toolbar"],ariaLabel:{id:"ariaLabelLegend"}}),this.paginationGroup=t.proxyInteractionService.createProxyContainer({type:"group",domManagerId:`${e}-pagination`,classList:["ag-charts-proxy-legend-pagination"],ariaLabel:{id:"ariaLabelLegendPagination"}}),this.itemDescription=t.agDocument.createElement("p"),this.itemDescription.style.display="none",this.itemDescription.id=AW(),this.itemDescription.textContent=this.getItemAriaDescription(t.localeManager),this.itemList.getElement().append(this.itemDescription)}shouldApplyHoverOnFocus(t){const e=t.getElement();return[":hover",":focus-visible"].some(i=>e.matches(i))}initLegendList(t){if(!this.dirty)return;const{ctx:e,itemSelection:i,datumReader:s,itemListener:n}=t,a=e.localeManager,r=i.length;i.each((o,l,c)=>{o.proxyButton?.destroy(),o.proxyButton=e.proxyInteractionService.createProxyElement({type:"listswitch",textContent:this.getItemAriaText(a,iA(s.getItemLabel(l)),c,r),ariaChecked:!!o.datum.enabled,ariaDescribedBy:this.itemDescription.id,parent:this.itemList});const h=o.proxyButton;h.addListener("click",d=>n.onClick(d.sourceEvent,o.datum,h)),h.addListener("dblclick",d=>n.onDoubleClick(d.sourceEvent,o.datum)),h.addListener("mouseenter",d=>n.onHover(d.sourceEvent,o)),h.addListener("mouseleave",()=>n.onLeave()),h.addListener("contextmenu",d=>n.onContextClick(d,o)),h.addListener("blur",()=>n.onLeave()),h.addListener("focus",d=>this.shouldApplyHoverOnFocus(h)?n.onHover(d.sourceEvent,o):n.onLeave()),h.addListener("drag-start",()=>{})}),this.dirty=!1}update(t){t.visible&&(this.initLegendList(t),this.updateItemProxyButtons(t),this.updatePaginationProxyButtons(t,!0)),this.updateVisibility(t.visible)}updateVisibility(t){this.itemList.setHidden(!t),this.paginationGroup.setHidden(!t)}updateItemProxyButtons({itemSelection:t,group:e,pagination:i,interactive:s}){const n=fe.toCanvas(e);this.itemList.setBounds(n);const a=Math.max(...t.nodes().map(r=>r.getTextMeasureBBox().height));t.each((r,o)=>{if(r.proxyButton){const l=r.pageIndex===i.currentPage,{x:c,y:h,height:d,width:u}=fe.toCanvas(r,r.getTextMeasureBBox()),p=(a-d)/2,g={x:c-n.x,y:h-p-n.y,height:a,width:u},f=s&&l;r.proxyButton.setCursor("pointer"),r.proxyButton.setEnabled(f),r.proxyButton.setPointerEvents(f?void 0:"none"),r.proxyButton.setBounds(g)}})}updatePaginationProxyButtons(t,e){const{pagination:i}=t;if(this.paginationGroup.setHidden(!i.visible),e&&"ctx"in t){const{oldPages:s,newPages:n}=t,a=(s?.length??n.length)>1,r=n.length>1;a!==r&&(r?this.createPaginationButtons(t):this.destroyPaginationButtons()),this.paginationGroup.setAriaHidden(r?void 0:!0)}if(this.prevButton&&this.nextButton){const{prev:s,next:n}=i.computeCSSBounds(),a=P.merge([s,n]);s.x-=a.x,s.y-=a.y,n.x-=a.x,n.y-=a.y,this.paginationGroup.setBounds(a),this.prevButton.setBounds(s),this.nextButton.setBounds(n),this.prevButton.setEnabled(i.currentPage!==0),this.nextButton.setEnabled(i.currentPage!==i.totalPages-1),this.nextButton.setCursor(i.getCursor("next")),this.prevButton.setCursor(i.getCursor("previous"))}}createPaginationButtons(t){const{ctx:e,pagination:i}=t;this.prevButton||(this.prevButton=e.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPagePrevious"},tabIndex:0,parent:this.paginationGroup}),this.prevButton.addListener("click",s=>this.onPageButton(t,s,"previous")),this.prevButton.addListener("mouseenter",()=>i.onMouseHover("previous")),this.prevButton.addListener("mouseleave",()=>i.onMouseHover(void 0))),this.nextButton||(this.nextButton=e.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPageNext"},tabIndex:0,parent:this.paginationGroup}),this.nextButton.addListener("click",s=>this.onPageButton(t,s,"next")),this.nextButton.addListener("mouseenter",()=>i.onMouseHover("next")),this.nextButton.addListener("mouseleave",()=>i.onMouseHover(void 0)))}destroyPaginationButtons(){this.nextButton?.destroy(),this.prevButton?.destroy(),this.nextButton=void 0,this.prevButton=void 0}onPageButton(t,e,i){t.pagination.onClick(e.sourceEvent,i),this.updatePaginationProxyButtons(t,!1)}onDataUpdate(t,e){this.dirty=t.length!==e.length||t.some((i,s,n)=>{const[a,r]=[e[s],t[s]];return a.id!==r.id})}onLocaleChanged(t,e,i){const s=e.length;e.each(({proxyButton:n},a,r)=>{const o=n?.getElement();if(o!=null){const l=iA(i.getItemLabel(a));o.textContent=this.getItemAriaText(t,l,r,s)}}),this.itemDescription.textContent=this.getItemAriaDescription(t)}onPageChange(t){this.updateItemProxyButtons(t),this.updatePaginationProxyButtons(t,!1)}getItemAriaText(t,e,i,s){return i>=0&&e?(i++,t.t("ariaLabelLegendItem",{label:e,index:i,count:s})):t.t("ariaLabelLegendItemUnknown")}getItemAriaDescription(t){return t.t("ariaDescriptionLegendItem")}};import{toPlainText as TW}from"ag-charts-core";function sA(t,{itemId:e,seriesId:i,label:{text:s}},n){const a={defaultPrevented:!1,apiEvent:{type:t,itemId:e,seriesId:i,event:n,text:TW(s),preventDefault:()=>a.defaultPrevented=!0}};return a}import{ObserveChanges as Gf,ProxyPropertyOnWrite as lo,SceneChangeDetection as LW}from"ag-charts-core";var wi=class extends mt{constructor(){super({name:"markerLabelGroup"}),this.symbolsGroup=this.appendChild(new U({name:"legend-markerLabel-symbols",renderToOffscreenCanvas:!0,optimizeForInfrequentRedraws:!0})),this.label=this.appendChild(new Ht),this.enabled=!0,this.pageIndex=Number.NaN,this.spacing=0,this.length=0,this.isCustomMarker=!1,this.isRtl=!1,this.marker=this.symbolsGroup.appendChild(new We({zIndex:1})),this.line=this.symbolsGroup.appendChild(new ri({zIndex:0})),this.line.visible=!1,this.label.textBaseline="middle",this.label.y=1}destroy(){super.destroy(),this.proxyButton?.destroy()}setEnabled(t){this.enabled=t,this.refreshVisibilities()}getTextMeasureBBox(){return this.layout(),P.merge([this.symbolsGroup.getBBox(),this.label.getTextMeasureBBox()])}refreshVisibilities(){const t=this.enabled?1:.5;this.label.opacity=t,this.opacity=t}layout(){const{marker:t,line:e,length:i,isCustomMarker:s}=this;let n=0,a=0;if(t.visible){const{size:r}=t,o=We.anchor(t.shape);n=(o.x-.5)*r+i/2,a=(o.y-.5)*r,s?(t.x=0,t.y=0,t.translationX=n,t.translationY=a):(t.x=n,t.y=a,t.translationX=0,t.translationY=0)}e.visible&&(e.x1=0,e.x2=i,e.y1=0,e.y2=0)}preRender(t){const e=super.preRender(t);return this.layout(),e}layoutLabel(){const{length:t,spacing:e,isRtl:i}=this;this.label.x=i?-e:t+e,this.label.textAlign=i?"right":"left"}computeBBox(){return this.layout(),super.computeBBox()}};wi.className="MarkerLabel",y([lo("label")],wi.prototype,"text",2),y([lo("label")],wi.prototype,"fontStyle",2),y([lo("label")],wi.prototype,"fontWeight",2),y([lo("label")],wi.prototype,"fontSize",2),y([lo("label")],wi.prototype,"fontFamily",2),y([lo("label","fill")],wi.prototype,"color",2),y([Gf(t=>t.layoutLabel())],wi.prototype,"spacing",2),y([Gf(t=>t.layoutLabel())],wi.prototype,"length",2),y([LW()],wi.prototype,"isCustomMarker",2),y([Gf(t=>t.layoutLabel())],wi.prototype,"isRtl",2);function NW(t,e){switch(typeof e.itemId){case"number":return{series:t,itemId:void 0,datum:void 0,datumIndex:e.itemId,legendItemName:e.legendItemName};case"string":return{series:t,itemId:e.itemId,datum:void 0,datumIndex:void 0,legendItemName:e.legendItemName};default:return e.itemId}}var Rn=class extends ro{constructor(){super(...arguments),this.maxLength=void 0,this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=iW.SMALL,this.fontFamily="Verdana, sans-serif"}};y([$],Rn.prototype,"maxLength",2),y([$],Rn.prototype,"color",2),y([$],Rn.prototype,"fontStyle",2),y([$],Rn.prototype,"fontWeight",2),y([$],Rn.prototype,"fontSize",2),y([$],Rn.prototype,"fontFamily",2),y([$],Rn.prototype,"formatter",2);var co=class extends ro{constructor(){super(...arguments),this.shape=void 0,this.size=15,this.padding=8}};y([$],co.prototype,"shape",2),y([$],co.prototype,"size",2),y([$],co.prototype,"padding",2),y([$],co.prototype,"strokeWidth",2),y([$],co.prototype,"enabled",2);var Uf=class extends ro{};y([$],Uf.prototype,"strokeWidth",2),y([$],Uf.prototype,"length",2);var Pn=class extends ro{constructor(){super(...arguments),this.paddingX=16,this.paddingY=8,this.showSeriesStroke=!1,this.marker=new co,this.label=new Rn,this.line=new Uf}};y([$],Pn.prototype,"maxWidth",2),y([$],Pn.prototype,"paddingX",2),y([$],Pn.prototype,"paddingY",2),y([$],Pn.prototype,"showSeriesStroke",2),y([$],Pn.prototype,"marker",2),y([$],Pn.prototype,"label",2),y([$],Pn.prototype,"line",2);var Hf=class extends ro{};y([$],Hf.prototype,"legendItemClick",2),y([$],Hf.prototype,"legendItemDoubleClick",2);var nA={type:"gradient",bounds:"item",gradient:"linear",colorStops:[{color:"black"}],rotation:0,reverse:!1,colorSpace:"rgb"},aA={type:"pattern",pattern:"forward-slanted-lines",width:8,height:8,padding:1,fill:"black",fillOpacity:1,backgroundFill:"white",backgroundFillOpacity:1,stroke:"black",strokeOpacity:1,strokeWidth:1,rotation:0,scale:1},rA={type:"image",backgroundFill:"black",backgroundFillOpacity:1,rotation:0,repeat:"no-repeat",fit:"contain",width:8,height:8},Fe=class extends ro{constructor(t){super(),this.ctx=t,this.id=lW(this),this.group=new mt({name:"legend",zIndex:aW.LEGEND}),this.itemSelection=Re.select(this.group,wi),this.containerNode=this.group.appendChild(new He({name:"legend-container"})),this.oldSize=[0,0],this.pages=[],this.paginationItemsOffsetX=0,this.maxPageSize=[0,0],this.paginationTrackingIndex=0,this.truncatedItems=new Set,this._data=[],this.toggleSeries=!0,this.item=new Pn,this.listeners=new Hf,this.enabled=!1,this.position="bottom",this.border=new eW(this.containerNode),this.cornerRadius=0,this.fillOpacity=1,this.padding=4,this.spacing=0,this.cleanup=new tW,this.size=[0,0],this._visible=!0,this.pagination=new $s(()=>t.eventsHub.emit("chart:request-update",{type:xd.SCENE_RENDER}),i=>this.updatePageNumber(i)),this.pagination.attachPagination(this.group);const{items:e}=t.contextMenuRegistry.builtins;e["toggle-series-visibility"].action=i=>this.contextToggleVisibility(i),e["toggle-other-series"].action=i=>this.contextToggleOtherSeries(i),this.cleanup.register(t.eventsHub.on("active:load-memento",i=>this.onActiveLoadMemento(i)),t.eventsHub.on("active:update",i=>this.onActiveUpdate(i)),t.eventsHub.on("legend:change",this.onLegendDataChange.bind(this)),t.eventsHub.on("legend:change-partial",this.onLegendDataChangePartial.bind(this)),t.layoutManager.registerElement(1,i=>this.positionLegend(i)),t.eventsHub.on("locale:change",()=>this.onLocaleChanged()),()=>delete e["toggle-series-visibility"].action,()=>delete e["toggle-other-series"].action,()=>this.group.remove()),this.domProxy=new CW(this.ctx,this.id),this.ctx.historyManager.addMementoOriginator(t.legendManager)}set data(t){pW(t,this._data)||(this.domProxy.onDataUpdate(this._data,t),this._data=t,this.updateGroupVisibility())}get data(){return this._data}onLegendDataChange({legendData:t=[]}){this.data=t.filter(e=>!e.hideInLegend)}onLegendDataChangePartial(t){this.itemSelection.each(({proxyButton:e},{itemId:i})=>{if(e!=null)for(const s of t.legendData)s.itemId===i&&e.setChecked(s.enabled)})}destroy(){this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-toolbar`),this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-pagination`),this.cleanup.flush(),this.itemSelection.clear()}getOrientation(){return this.orientation??"horizontal"}set visible(t){this._visible=t,this.updateGroupVisibility()}get visible(){return this._visible}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible&&this.data.length>0}updateItemSelection(){const t=[...this.data];this.reverseOrder&&t.reverse(),this.itemSelection.update(t)}isInteractive(){const{toggleSeries:t,listeners:{legendItemClick:e,legendItemDoubleClick:i}}=this;return t||i!=null||e!=null}checkInteractionState(){return this.ctx.interactionManager.isState(1)}attachLegend(t){t.appendChild(this.group)}getItemLabel(t){const{formatter:e}=this.item.label;if(e){const i=t.datum;return this.cachedCallWithContext(e,{itemId:t.itemId,value:t.label.text,seriesId:t.seriesId,...i&&{datum:i}})}return t.label.text}calcLayout(t,e){const{paddingX:i,paddingY:s,label:n,maxWidth:a,label:{maxLength:r=1/0,fontStyle:o,fontWeight:l,fontSize:c,fontFamily:h}}=this.item;this.updateItemSelection();const d=[],u=rW(n),g=a??t*.8,{markerWidth:f,anyLineEnabled:m}=this.calculateMarkerWidth(),{isRtl:b}=this.ctx.domManager;if(this.itemSelection.each((T,L)=>{T.fontStyle=o,T.fontWeight=l,T.fontSize=c,T.fontFamily=h,T.isRtl=b;const k=this.updateMarkerLabel(T,L,f,m),O=L.itemId??L.id,N=this.getItemLabel(L),w=gW(N,"").replace(sW," ");T.text=this.truncate(w,r,g,k,u,O),d.push(T.getTextMeasureBBox())}),t=Math.max(1,t),e=Math.max(1,e),!Number.isFinite(t))return{};[t,e]=this.updateContainer(t,e);const x=this.size,v=this.oldSize;x[0]=t,x[1]=e,(x[0]!==v[0]||x[1]!==v[1])&&(v[0]=x[0],v[1]=x[1]);const{pages:S,maxPageHeight:I,maxPageWidth:M}=this.updatePagination(d,t,e),D=this.pages;this.pages=S,this.maxPageSize=[M-i,I-s];const A=this.pagination.currentPage,C=this.pages[A];return this.pages.length<1||!C?(this.visible=!1,{oldPages:D}):(this.visible=!0,this.updatePositions(A),this.update(),{oldPages:D})}isCustomMarker(t,e){return t&&e!==void 0&&typeof e!="string"}calcSymbolsEnabled(t){const{showSeriesStroke:e,marker:i}=this.item,s=!!i.enabled||!e||(t.marker.enabled??!0),n=!!(t.line&&e),a=this.isCustomMarker(s,t.marker.shape);return{markerEnabled:s,lineEnabled:n,isCustomMarker:a}}calcSymbolsLengths(t,e,i){const{marker:s,line:n}=this.item;let a;const{shape:r}=t.marker;if(this.isCustomMarker(e,r)){const c=new We;c.shape=r,c.updatePath();const h=c.getBBox();a=Math.max(h.width,h.height)}const o=e?s.size:0,l=i?n.length??25:0;return{markerLength:o,lineLength:l,customMarkerSize:a}}calculateMarkerWidth(){let t=0,e=!1;return this.itemSelection.each((i,s)=>{const{symbol:n}=s,{lineEnabled:a,markerEnabled:r}=this.calcSymbolsEnabled(n),{markerLength:o,lineLength:l,customMarkerSize:c=-1/0}=this.calcSymbolsLengths(n,r,a);t=Math.max(t,l,c,o),e||(e=a)}),{markerWidth:t,anyLineEnabled:e}}updateMarkerLabel(t,e,i,s){const{marker:n,paddingX:a}=this.item,{symbol:r}=e;let o=a;const{markerEnabled:l,isCustomMarker:c}=this.calcSymbolsEnabled(r),h=n.padding;(l||s)&&(o+=h+i);const{marker:d,line:u}=t;return d.visible=l,d.visible&&(d.shape=n.shape??r.marker.shape??"square",d.size=n.size,d.setStyleProperties(this.getMarkerStyles(cW(r)))),u.visible=s,u.visible&&u.setStyleProperties(this.getLineStyles(r)),t.length=i,t.spacing=h,t.isCustomMarker=c,o}updateContainer(t,e){const i=this.getContainerStyles();return this.containerNode.width=0,this.containerNode.height=0,this.containerNode.setStyleProperties(i),this.containerNode.cornerRadius=i.cornerRadius,t-=i.strokeWidth*2+i.padding.left+i.padding.right,e-=i.strokeWidth*2+i.padding.top+i.padding.bottom,[t,e]}truncate(t,e,i,s,n,a){let r=!1;t.length>e&&(t=t.substring(0,e),r=!0);const o=fW(t,n,i-s,r);return uW(o)?this.truncatedItems.add(a):this.truncatedItems.delete(a),o}updatePagination(t,e,i){const s=this.getOrientation(),n=Math.min(this.paginationTrackingIndex,t.length),{isRtl:a}=this.ctx.domManager;this.pagination.orientation=s,this.pagination.isRtl=a,this.pagination.translationX=0,this.pagination.translationY=0;const{pages:r,maxPageHeight:o,maxPageWidth:l,paginationBBox:c,paginationVertical:h}=this.calculatePagination(t,e,i),d=r.findIndex(S=>S.endIndex>=n);this.pagination.currentPage=oW(0,d,Math.max(0,r.length-1));const{paddingX:u,paddingY:p}=this.item,g=8,f=l-u,m=o-p;let b=0,x=-c.y-this.item.marker.size/2;h?(a&&(b=e-c.width+c.x),x+=m+g):a?(b=-c.x,x+=(m-c.height)/2):(b+=-c.x+f+g,x+=(m-c.height)/2),this.paginationItemsOffsetX=a&&!h&&this.pagination.visible?c.width+g:0,this.pagination.translationX=b,this.pagination.translationY=x,this.pagination.update(),this.pagination.updateMarkers();let v=0;return this.itemSelection.each((S,I,M)=>{M>(r[v]?.endIndex??1/0)&&v++,S.pageIndex=v}),{maxPageHeight:o,maxPageWidth:l,pages:r}}calculatePagination(t,e,i){const{paddingX:s,paddingY:n}=this.item,a=["left","left-top","left-bottom","right","right-top","right-bottom"],{placement:r}=zf(this.position),o=this.getOrientation(),l=a.includes(r);let c=this.pagination.getBBox(),h=new P(0,0,0,0),d=[],u=0,p=0,g=0;const f=b=>b.width===c.width&&b.height===c.height,m=this.maxWidth!==void 0&&this.maxHeight!==void 0;do{if(g++>10){Bf.warn("unable to find stable legend layout.");break}c=h;const b=e-(l?0:c.width),x=i-(l?c.height:0),v=mW({orientation:o,bboxes:t,maxHeight:x,maxWidth:b,itemPaddingY:n,itemPaddingX:s,forceResult:m});d=v?.pages??[],u=v?.maxPageWidth??0,p=v?.maxPageHeight??0;const S=d.length;if(this.pagination.visible=S>1,this.pagination.totalPages=S,this.pagination.update(),this.pagination.updateMarkers(),h=this.pagination.getBBox(),!this.pagination.visible)break}while(!f(h));return{maxPageWidth:u,maxPageHeight:p,pages:d,paginationBBox:h,paginationVertical:l}}updatePositions(t=0){const{item:{paddingY:e},itemSelection:i,pages:s}=this;if(s.length<1||!s[t])return;const{columns:n,startIndex:a,endIndex:r}=s[t];let o=0,l=0;const c=n.length,h=n[0].indices.length,d=this.getOrientation()==="horizontal",u=n[0].bboxes[0].height+e,{isRtl:p}=this.ctx.domManager,g=[],f=n.reduce((m,b)=>m+b.columnWidth,0);i.each((m,b,x)=>{if(xr){m.visible=!1;return}const v=x-a;let S,I;d?(S=v%c,I=Math.floor(v/c)):(S=Math.floor(v/h),I=v%h),m.visible=!0;const M=n[S];M&&(l=Math.floor(u*I),p?o=Math.floor(f-(g[I]??0)):o=Math.floor(g[I]??0),g[I]=(g[I]??0)+M.columnWidth,m.translationX=o+this.paginationItemsOffsetX,m.translationY=l)})}updatePageNumber(t){const{itemSelection:e,group:i,pagination:s,pages:n}=this,a=n[t];if(!a)return;const{startIndex:r,endIndex:o}=a;r===0?this.paginationTrackingIndex=0:t===n.length-1?this.paginationTrackingIndex=o:this.paginationTrackingIndex=Math.floor((r+o)/2),this.pagination.update(),this.pagination.updateMarkers(),this.updatePositions(t),this.domProxy.onPageChange({itemSelection:e,group:i,pagination:s,interactive:this.isInteractive()}),this.ctx.eventsHub.emit("chart:request-update",{type:xd.SCENE_RENDER})}update(){const{label:{color:t}}=this.item;this.itemSelection.each((e,i)=>{e.setEnabled(i.enabled),e.color=t}),this.updateContextMenu()}updateContextMenu(){const t=this.toggleSeries?"show":"hide";this.ctx.contextMenuRegistry.toggle("toggle-series-visibility",t),this.ctx.contextMenuRegistry.toggle("toggle-other-series",t)}getLineStyles(t){const{stroke:e,strokeOpacity:i=1,strokeWidth:s,lineDash:n}=t.line??{},a=Math.min(2,s??1);return{stroke:e,strokeOpacity:i,strokeWidth:this.item.line.strokeWidth??a,lineDash:n}}getMarkerStyles({marker:t}){const{fill:e,stroke:i,strokeOpacity:s=1,fillOpacity:n=1,strokeWidth:a,lineDash:r,lineDashOffset:o}=t,l=Math.min(2,a??1);return dW(e)&&(e.width=8,e.height=8,e.padding=1,e.strokeWidth=Math.min(2,e.strokeWidth??2)),hW(e)&&(e.fit="contain",e.width=void 0,e.height=void 0,e.repeat="no-repeat"),Cp({fill:e,stroke:i,strokeOpacity:s,fillOpacity:n,strokeWidth:this.item.marker.strokeWidth??l,lineDash:r,lineDashOffset:o},nA,aA,rA)}getContainerStyles(){const{stroke:t,strokeOpacity:e,strokeWidth:i}=this.border,{cornerRadius:s,fill:n,fillOpacity:a,padding:r}=this,o=typeof r=="number";return Cp({cornerRadius:s,fill:n,fillOpacity:a,padding:{top:o?r:r.top??0,right:o?r:r.right??0,bottom:o?r:r.bottom??0,left:o?r:r.left??0},stroke:t,strokeOpacity:e,strokeWidth:this.border.enabled?i:0},nA,aA,rA)}computePagedBBox(){const t=U.computeChildrenBBox(this.group.excludeChildren({name:"legend-container"}));if(this.pages.length>1){const[s,n]=this.maxPageSize;t.height=Math.max(n,t.height),t.width=Math.max(s,t.width)}const{strokeWidth:e,padding:i}=this.getContainerStyles();return t.grow(i).grow(e),t}findNode(t){const{datum:e,proxyButton:i}=this.itemSelection.select(s=>s.datum?.itemId===t.itemId)[0]??{};if(e===void 0||i===void 0)throw new Error(`AG Charts - Missing required properties { datum: ${e}, proxyButton: ${JSON.stringify(i)} }`);return{datum:e,proxyButton:i}}contextToggleVisibility(t){const{datum:e,proxyButton:i}=this.findNode(t);this.doClick(t.event,e,i),this.clearHighlight()}contextToggleOtherSeries(t){this.doDoubleClick(t.event,this.findNode(t).datum),this.clearHighlight()}onContextClick(t,e){if(this.checkInteractionState())return;const{sourceEvent:i}=t,s=e.datum;this.clearHighlight(),this.preventHidingAll&&this.contextMenuDatum?.enabled&&this.getVisibleItemCount()<=1?this.ctx.contextMenuRegistry.builtins.items["toggle-series-visibility"].enabled=!1:this.ctx.contextMenuRegistry.builtins.items["toggle-series-visibility"].enabled=!0;const a=this.ctx.chartService.series.length>1&&this.ctx.chartService.series[0]?.getLegendData("category")[0]?.hideToggleOtherSeries!==!0?"show":"hide";this.ctx.contextMenuRegistry.toggle("toggle-other-series",a);const{offsetX:r,offsetY:o}=i,{x:l,y:c}=fe.toCanvasPoint(e,r,o);this.ctx.contextMenuRegistry.dispatchContext("legend-item",{widgetEvent:t,canvasX:l,canvasY:c},{legendItem:s})}onClick(t,e,i){this.doClick(t,e,i)&&t.preventDefault()}getVisibleItemCount(){return this.ctx.chartService.series.flatMap(t=>t.getLegendData("category")).filter(t=>t.enabled).length}doClick(t,e,i){const{listeners:{legendItemClick:s},ctx:{chartService:n},preventHidingAll:a,toggleSeries:r}=this;if(!e)return!1;const{legendType:o,seriesId:l,itemId:c,enabled:h,legendItemName:d}=e,u=n.series.find(f=>f.id===l);if(!u)return!1;let p=h;const g=sA("click",e,t);return s&&QM([u.properties,this.ctx.chartService],s,g.apiEvent),g.defaultPrevented||(r&&(p=!h,a&&!p&&this.getVisibleItemCount()<2&&(p=!0),i.setChecked(p),this.ctx.eventsHub.emit("legend:item-click",{legendType:o,series:u,itemId:c,enabled:p,legendItemName:d})),this.updateHighlight(p,e,u),this.ctx.legendManager.update(),this.ctx.eventsHub.emit("chart:request-update",{type:xd.PROCESS_DATA,opts:{forceNodeDataRefresh:!0,skipAnimations:e.skipAnimations??!1}})),!0}onDoubleClick(t,e){this.doDoubleClick(t,e)&&t.preventDefault()}doDoubleClick(t,e){const{listeners:{legendItemDoubleClick:i},ctx:{chartService:s},toggleSeries:n}=this;if(!e)return!1;const{legendType:a,id:r,itemId:o,seriesId:l}=e,c=s.series.find(d=>d.id===r);if(!c)return!1;const h=sA("dblclick",e,t);if(i&&QM([c.properties,this.ctx.chartService],i,h.apiEvent),h.defaultPrevented)return!0;if(n){const d=s.series.flatMap(f=>f.getLegendData("category"));let u=0;const p=new Set;for(const f of d)f.enabled&&(u+=1,f.legendItemName!=null&&p.add(f.legendItemName));p.size>0&&(u=p.size);const g=d.find(f=>f.itemId===o&&f.seriesId===l);this.ctx.eventsHub.emit("legend:item-double-click",{legendType:a,series:c,itemId:o,numVisibleItems:u,enabled:g?.enabled??!1,legendItemName:g?.legendItemName})}return this.ctx.legendManager.update(),this.ctx.eventsHub.emit("chart:request-update",{type:xd.PROCESS_DATA,opts:{forceNodeDataRefresh:!0}}),!0}toTooltipMeta(t,e){let i;return t instanceof FocusEvent?i=fe.toCanvas(e).computeCenter():(t.preventDefault(),i=fe.toCanvasPoint(e,t.offsetX,t.offsetY)),{canvasX:i.x,canvasY:i.y,showArrow:!1}}onHover(t,e){if(this.checkInteractionState())return;if(!this.enabled)throw new Error("AG Charts - onHover handler called on disabled legend");this.pagination.setPage(e.pageIndex);const i=e.datum,s=i?this.ctx.chartService.series.find(n=>n.id===i?.id):void 0;if(i&&this.truncatedItems.has(i.itemId??i.id)){const n=this.toTooltipMeta(t,e);this.ctx.tooltipManager.updateTooltip(this.id,n,[{type:"structured",title:this.getItemLabel(i)}])}else this.ctx.tooltipManager.removeTooltip(this.id,void 0,!0);this.updateHighlight(i?.enabled,i,s)}onLeave(){this.checkInteractionState()||(this.ctx.tooltipManager.removeTooltip(this.id,void 0,!0),this.clearHighlight())}clearHighlight(){this.updateHighlight(void 0,void 0,void 0)}updateHighlight(t,e,i,s){if(this.checkInteractionState())return;const n=o=>{if(o===void 0)return this.ctx.activeManager.clear();{const l=o.nodeDatum.series.id,c=o.itemId;return this.ctx.activeManager.update({type:"legend",seriesId:l,itemId:c},void 0)}},a=o=>{n(o)||this.ctx.highlightManager.updateHighlight(this.id,o?.nodeDatum)},r=o=>{this.ctx.interactionManager.isState(64)||s?.initialState?a(o):this.ctx.interactionManager.isState(4)?this.ctx.animationManager.onBatchStop(()=>{a(o)}):o===void 0&&a(o)};if(t===!0&&i!==void 0&&e!==void 0){const o=e.itemId,l=NW(i,e);r({itemId:o,nodeDatum:l})}else r(void 0)}onActiveUpdate(t){t?.type==="series-node"&&this.ctx.highlightManager.updateHighlight(this.id,void 0)}onActiveLoadMemento(t){const{activeItem:e}=t;if(e?.type!=="legend")return this.ctx.highlightManager.updateHighlight(this.id,void 0);const i=this.data.find(n=>n.seriesId===e.seriesId&&n.itemId===e.itemId),s=this.ctx.chartService.series.find(n=>n.id===e.seriesId);if(s===void 0)Bf.warn(`Cannot find seriesId: "${e.seriesId}"`),t.reject();else if(i===void 0){const n=JSON.stringify({seriesId:e.seriesId,itemId:e.itemId});Bf.warn(`cannot find legend item: ${n}`),t.reject()}else this.updateHighlight(i.enabled,i,s,t)}onLocaleChanged(){this.updateItemSelection(),this.domProxy.onLocaleChanged(this.ctx.localeManager,this.itemSelection,this)}positionLegend(t){const e=this.positionLegendScene(t);this.positionLegendDOM(e)}positionLegendScene(t){if(!this.enabled||!this.data.length)return;const{placement:e,floating:i,xOffset:s,yOffset:n}=zf(this.position),a=i?new P(0,0,t.width,t.height):t.layoutBox,{x:r,y:o,width:l,height:c}=a,[h,d]=this.calculateLegendDimensions(a),{oldPages:u}=this.calcLayout(h,d),p=this.computePagedBBox();if(this.visible){let f=function(v){};var g=f;const m=this.spacing;let b,x;switch(e){case"top":b=(l-p.width)/2,x=0;break;case"bottom":b=(l-p.width)/2,x=c-p.height;break;case"right":b=l-p.width,x=(c-p.height)/2;break;case"left":b=0,x=(c-p.height)/2;break;case"top-right":case"right-top":b=l-p.width,x=0;break;case"top-left":case"left-top":b=0,x=0;break;case"bottom-right":case"right-bottom":b=l-p.width,x=c-p.height;break;case"bottom-left":case"left-bottom":b=0,x=c-p.height;break;default:f(e)}if(!i){let v,S;switch(e){case"top":case"top-right":case"top-left":v=p.height+m,S="top";break;case"bottom":case"bottom-right":case"bottom-left":v=p.height+m,S="bottom";break;case"left":case"left-top":case"left-bottom":v=p.width+m,S="left";break;case"right":case"right-top":case"right-bottom":v=p.width+m,S="right";break;default:f(e)}a.shrink(v,S)}b+=s,x+=n,this.group.translationX=Math.floor(r+b-p.x),this.group.translationY=Math.floor(o+x-p.y),this.containerNode.x=p.x,this.containerNode.y=p.y,this.containerNode.width=p.width,this.containerNode.height=p.height}return u}positionLegendDOM(t){const{ctx:e,itemSelection:i,pagination:s,pages:n,group:a}=this,r=this.visible&&this.enabled,o=this.isInteractive();this.domProxy.update({visible:r,interactive:o,ctx:e,itemSelection:i,group:a,pagination:s,oldPages:t,newPages:n,datumReader:this,itemListener:this})}calculateLegendDimensions(t){const{width:e,height:i}=t,{placement:s}=zf(this.position),n=e/i,a=.5,r=.2,o=.25;let l,c;function h(d){}switch(s){case"top":case"top-left":case"top-right":case"bottom":case"bottom-left":case"bottom-right":{const d=n<1?Math.min(a,r*(1/n)):r;l=this.maxWidth?Math.min(this.maxWidth,e):e,c=this.maxHeight?Math.min(this.maxHeight,i):Math.round(i*d);break}case"left":case"left-top":case"left-bottom":case"right":case"right-top":case"right-bottom":{const d=n>1?Math.min(a,o*n):o;l=this.maxWidth?Math.min(this.maxWidth,e):Math.round(e*d),c=this.maxHeight?Math.min(this.maxHeight,i):i;break}default:}return[l,c]}cachedCallWithContext(t,e){const{callbackCache:i,chartService:s}=this.ctx;return i.call([this,s],t,e)}};Fe.className="Legend",y([$],Fe.prototype,"toggleSeries",2),y([$],Fe.prototype,"pagination",2),y([$],Fe.prototype,"item",2),y([$],Fe.prototype,"listeners",2),y([nW((t,e,i)=>{if(t.updateGroupVisibility(),e===i)return;const{ctx:{legendManager:s,stateManager:n}}=t;i===!1&&e===!0&&n.restoreState(s)}),$],Fe.prototype,"enabled",2),y([$],Fe.prototype,"position",2),y([$],Fe.prototype,"maxWidth",2),y([$],Fe.prototype,"maxHeight",2),y([$],Fe.prototype,"reverseOrder",2),y([$],Fe.prototype,"orientation",2),y([$],Fe.prototype,"preventHidingAll",2),y([$],Fe.prototype,"border",2),y([$],Fe.prototype,"cornerRadius",2),y([$],Fe.prototype,"fill",2),y([$],Fe.prototype,"fillOpacity",2),y([$],Fe.prototype,"padding",2),y([$],Fe.prototype,"spacing",2),y([$],Fe.prototype,"xOffset",2),y([$],Fe.prototype,"yOffset",2);var jf={type:"plugin",name:"legend",version:me,options:{enabled:Ul,position:Z4,orientation:Q4("horizontal","vertical"),maxWidth:ei,maxHeight:ei,spacing:ei,border:$4,cornerRadius:X4,padding:q4,fill:K4,fillOpacity:J4,preventHidingAll:Ul,reverseOrder:Ul,toggleSeries:Ul,item:{marker:{size:ei,shape:JM,padding:ei,strokeWidth:ei},line:{length:ei,strokeWidth:ei},label:{maxLength:ei,formatter:_f,...qM},maxWidth:ei,paddingX:ei,paddingY:ei,showSeriesStroke:Ul},pagination:{marker:{size:ei,shape:JM,padding:ei},activeStyle:{...Ff,...Vf},inactiveStyle:{...Ff,...Vf},highlightStyle:{...Ff,...Vf},label:qM},listeners:{legendItemClick:_f,legendItemDoubleClick:_f}},themeTemplate:{...Y4,enabled:{$and:[{$greaterThan:[{$size:{$path:"/series"}},1]},{$or:[{$isChartType:"cartesian"},{$isChartType:"standalone"},{$and:[{$isChartType:"polar"},{$not:{$isSeriesType:"pie"}},{$not:{$isSeriesType:"donut"}}]}]}]},position:Di.BOTTOM,orientation:{$if:[{$or:[{$eq:[{$path:"./position"},Di.LEFT]},{$eq:[{$path:"./position"},Di.LEFT_TOP]},{$eq:[{$path:"./position"},Di.LEFT_BOTTOM]},{$eq:[{$path:"./position"},Di.RIGHT]},{$eq:[{$path:"./position"},Di.RIGHT_TOP]},{$eq:[{$path:"./position"},Di.RIGHT_BOTTOM]},{$eq:[{$path:"./position/placement"},Di.LEFT]},{$eq:[{$path:"./position/placement"},Di.LEFT_TOP]},{$eq:[{$path:"./position/placement"},Di.LEFT_BOTTOM]},{$eq:[{$path:"./position/placement"},Di.RIGHT]},{$eq:[{$path:"./position/placement"},Di.RIGHT_TOP]},{$eq:[{$path:"./position/placement"},Di.RIGHT_BOTTOM]}]},"vertical","horizontal"]},spacing:30,listeners:{},toggleSeries:!0,item:{paddingX:16,paddingY:8,marker:{size:15,padding:8},showSeriesStroke:!0,label:{color:{$ref:"textColor"},fontSize:{$rem:W4.SMALL},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"}}},reverseOrder:!1,pagination:{marker:{size:12},activeStyle:{fill:{$ref:"foregroundColor"}},inactiveStyle:{fill:{$ref:"subtleTextColor"}},highlightStyle:{fill:{$ref:"foregroundColor"}},label:{color:{$ref:"textColor"}}},fill:{$if:[{$path:["./position/floating",!1]},{$ref:"chartBackgroundColor"},"transparent"]}},create:t=>{const e=new Fe(t);return e.attachLegend(t.scene),e}};import{CARTESIAN_AXIS_TYPE as oA,CARTESIAN_POSITION as lA,ChartAxisDirection as cA,DEFAULT_SHADOW_COLOUR as kW,FILL_GRADIENT_LINEAR_DEFAULTS as wW,FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS as OW,FILL_IMAGE_DEFAULTS as EW,FILL_PATTERN_DEFAULTS as hA,LABEL_BOXING_DEFAULTS as RW,MARKER_SERIES_HIGHLIGHT_STYLE as PW,SEGMENTATION_DEFAULTS as _W}from"ag-charts-core";import{ChartAxisDirection as st,DebugMetrics as FW,SeriesContentZIndexMap as Wf,SeriesZIndexMap as Hl,extent as VW,isContinuous as BW,isDefined as Yf,mergeDefaults as zW}from"ag-charts-core";import{Logger as dA,normalisedExtentWithMetadata as GW}from"ag-charts-core";var ho=class extends vi{getVisibleDomain(t){const[e,i]=t,[s,n]=this.visibleRange;if(t.length<2)return[e,i];const a=Math.min(e,i),r=Math.max(e,i);if(a>=0){const o=Math.log(e),c=Math.log(i)-o;return[Math.exp(o+s*c),Math.exp(o+n*c)]}if(r<=0){const o=-Math.log(-e),c=-Math.log(-i)-o;return[-Math.exp(-(o+s*c)),-Math.exp(-(o+n*c))]}return[Number.NaN,Number.NaN]}normaliseDataDomain(t){const{min:e,max:i,preferredMin:s,preferredMax:n}=this,{extent:a,clipped:r}=GW(t.domain,e,i,s,n,void 0,t.sortMetadata?.sortOrder);return a[0]<0&&a[1]>0||t.domain[0]<0&&t.domain[1]>0?(dA.warn("The log axis domain crosses zero, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:r}):a[0]===0||a[1]===0||t.domain[0]===0||t.domain[1]===0?(dA.warn("The log axis domain contains a value of 0, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:r}):{domain:a,clipped:r}}set base(t){this.scale.base=t}get base(){return this.scale.base}constructor(t){super(t,new Vg)}};ho.className="LogAxis",ho.type="log";import{AGGREGATION_INDEX_X_MAX as UW,AGGREGATION_INDEX_X_MIN as HW,AGGREGATION_INDEX_Y_MAX as jW,AGGREGATION_INDEX_Y_MIN as WW,AGGREGATION_MIN_RANGE as uA,AGGREGATION_THRESHOLD as pA,aggregationDomain as $f,aggregationIndexForXRatio as YW,aggregationRangeFittingPoints as gA,aggregationXRatioForDatumIndex as $W,aggregationXRatioForXValue as KW,compactAggregationIndices as ZW,createAggregationIndices as fA,nextPowerOf2 as XW,simpleMemorize2 as qW}from"ag-charts-core";var JW=10;function Id(t,e,i,s,n,a,r){const o=t[a];if(o===void 0)return-1;const l=Number.isFinite(e)?KW(o,e,i,r):$W(a,t.length),c=YW(l,n);return a===s[c+HW]||a===s[c+UW]||a===s[c+WW]||a===s[c+jW]?c:-1}function mA(t,e,i,s,n,a,r,o,l){let c=0,h=0,d=-1;for(let m=0;mb.maxRange===h);let{indexData:u,valueData:p}=fA(e,i,i,a,r,h,{xNeedsValueOf:o,yNeedsValueOf:l,reuseIndexData:d?.indexData,reuseValueData:d?.valueData}),{indices:g,metaIndices:f}=mA(e,a,r,u,h,o,n,d?.indices,d?.metaIndices);const m=[{maxRange:h,metaIndices:f,indices:g,indexData:u,valueData:p}];for(;g.length>JW&&h>uA;){const b=h,x=Math.trunc(b/2),v=c?.find(O=>O.maxRange===x),S=ZW(u,p,b,{reuseIndexData:v?.indexData,reuseValueData:v?.valueData});h=S.maxRange,u=S.indexData,p=S.valueData;const I=g;let M=0,D=0,A=-1;for(const O of I){const N=Id(e,a,r,u,h,O,o);N!==-1&&(M++,N!==A&&(D++,A=N))}D++;const C=v?.indices?.length===M?v.indices:new Uint32Array(M),T=v?.metaIndices?.length===D?v.metaIndices:new Uint32Array(D);let L=0,k=0;A=-1;for(const O of I){const N=Id(e,a,r,u,h,O,o);N!==-1&&(N!==A&&(T[k++]=L,A=N),C[L++]=O)}T[k]=M-1,g=C,f=T,m.push({maxRange:h,metaIndices:f,indices:g,indexData:u,valueData:p})}return m.reverse(),m}function QW(t,e,i,s){const n=e.length;if(nS.maxRange===u),{indexData:g,valueData:f}=fA(e,i,i,a,r,u,{xNeedsValueOf:o,yNeedsValueOf:l,reuseIndexData:p?.indexData,reuseValueData:p?.valueData}),{indices:m,metaIndices:b}=mA(e,a,r,g,u,o,n,p?.indices,p?.metaIndices),x={maxRange:u,indices:m,metaIndices:b,indexData:g,valueData:f};function v(){return Kf([a,r],e,i,{xNeedsValueOf:o,yNeedsValueOf:l,existingFilters:h})?.filter(I=>I.maxRange!==u)??[]}return{immediate:[x],computeRemaining:v}}function e3(t,e,i,s,n,a){const[r,o]=$f(t,s);return Kf([r,o],e,i,{xNeedsValueOf:n,yNeedsValueOf:a})}var t3=qW(e3);function i3(t,e,i,s,n,a){const r=e.resolveKeysById(n,"xValue",i),o=e.resolveColumnById(n,s,i),l=e.getDomain(n,"xValue","key",i),c=e.resolveColumnNeedsValueOf(n,"xValue",i),h=e.resolveColumnNeedsValueOf(n,s,i);if(a){const[d,u]=$f(t,l);return Kf([d,u],r,o,{xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:a})}return t3(t,r,o,l,c,h)}function s3(t,e,i,s,n,a,r){const o=e.resolveKeysById(n,"xValue",i),l=e.resolveColumnById(n,s,i),c=e.getDomain(n,"xValue","key",i),h=e.resolveColumnNeedsValueOf(n,"xValue",i),d=e.resolveColumnNeedsValueOf(n,s,i),[u,p]=$f(t,c);return QW([u,p],o,l,{xNeedsValueOf:h,yNeedsValueOf:d,targetRange:a,existingFilters:r})}import{InterpolationProperties as n3,Property as Ve}from"ag-charts-core";var Ne=class extends Xi{constructor(){super(...arguments),this.xName=void 0,this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new n3,this.shadow=new Is,this.marker=new zt,this.label=new li,this.tooltip=Ga(),this.connectMissingData=!1}};y([Ve],Ne.prototype,"xKey",2),y([Ve],Ne.prototype,"xName",2),y([Ve],Ne.prototype,"yKey",2),y([Ve],Ne.prototype,"yName",2),y([Ve],Ne.prototype,"selectedKey",2),y([Ve],Ne.prototype,"stackGroup",2),y([Ve],Ne.prototype,"normalizedTo",2),y([Ve],Ne.prototype,"fill",2),y([Ve],Ne.prototype,"fillOpacity",2),y([Ve],Ne.prototype,"stroke",2),y([Ve],Ne.prototype,"strokeWidth",2),y([Ve],Ne.prototype,"strokeOpacity",2),y([Ve],Ne.prototype,"lineDash",2),y([Ve],Ne.prototype,"lineDashOffset",2),y([Ve],Ne.prototype,"interpolation",2),y([Ve],Ne.prototype,"styler",2),y([Ve],Ne.prototype,"shadow",2),y([Ve],Ne.prototype,"marker",2),y([Ve],Ne.prototype,"label",2),y([Ve],Ne.prototype,"tooltip",2),y([Ve],Ne.prototype,"connectMissingData",2);var Zf=class extends Tn{constructor(t){super({moduleCtx:t,propertyKeys:Jr,propertyNames:Qr,categoryKey:"xValue",pathsPerSeries:["fill","stroke"],pathsZIndexSubOrderOffset:[0,1e3],datumSelectionGarbageCollection:!1,segmentedDataNodes:!1,pickModes:[2,0],animationResetFns:{path:uf({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:za,datum:(e,i)=>({...sd(e),...Pl(e,i)})},clipFocusBox:!1}),this.properties=new Ne,this.connectsToYAxis=!0,this.aggregationManager=new cd,this.backgroundGroup=new U({name:`${this.id}-background`,zIndex:Hl.BACKGROUND}),this._isStacked=void 0,this.fillSpans=[],this.phantomSpans=[],this.strokeSpans=[]}get pickModeAxis(){return"main"}renderToOffscreenCanvas(){const t=(this.contextNodeData?.nodeData?.length??0)>0;return super.renderToOffscreenCanvas()||t&&this.getDrawingMode(!1)==="cutout"||this.contextNodeData!=null&&(this.contextNodeData.fillData.spans.length>Hg||this.contextNodeData.strokeData.spans.length>Hg)}attachSeries(t,e,i){super.attachSeries(t,e,i),t.appendChild(this.backgroundGroup)}detachSeries(t,e,i){super.detachSeries(t,e,i),this.backgroundGroup.remove()}attachPaths([t,e]){this.backgroundGroup.appendChild(t),this.contentGroup.appendChild(e),e.zIndex=-1}detachPaths([t,e]){t.remove(),e.remove()}isStacked(){return(this.seriesGrouping?.stackCount??1)>1}isNormalized(){return this.properties.normalizedTo!=null}setSeriesIndex(t){const i=this.isStacked()===this._isStacked;return this._isStacked=i,super.setSeriesIndex(t,i)}setZIndex(t){super.setZIndex(t),this.isStacked()?(this.backgroundGroup.zIndex=[Hl.BACKGROUND,t],this.contentGroup.zIndex=[Hl.ANY_CONTENT,t,Wf.FOREGROUND]):(this.backgroundGroup.zIndex=[Hl.ANY_CONTENT,t,Wf.FOREGROUND,0],this.contentGroup.zIndex=[Hl.ANY_CONTENT,t,Wf.FOREGROUND,1])}async processData(t){if(this.data==null)return;const{data:e,visible:i,seriesGrouping:{groupIndex:s=this.id,stackCount:n=1}={}}=this,{xKey:a,yKey:r,selectedKey:o,connectMissingData:l,normalizedTo:c}=this.properties,h=!this.ctx.animationManager.isSkipped(),d=this.axes[st.X]?.scale,u=this.axes[st.Y]?.scale,{xScaleType:p,yScaleType:g}=this.getScaleInformation({xScale:d,yScale:u}),f=n>1||c!=null,m={value:`area-stack-${s}-yValue`,marker:`area-stack-${s}-yValues-marker`},b={invalidValue:null};(Yf(c)||l)&&n>1&&(b.invalidValue=0),i||(b.forceValue=0);const x=this.properties.allowNullKeys??!1,v=[nn(a,p,{id:"xValue",allowNullKey:x}),ye(r,g,{id:"yValueRaw",...b}),...o==null?[]:[ye(o,"category",{id:"selectedRaw"})]];f&&v.push(...sa(r,"normal",{id:"yValueCumulative",...b,groupId:m.marker},g)),Yf(c)&&v.push(ye(r,g,{id:"yValue",...b,groupId:m.value}),Mc(Object.values(m),c)),h&&v.push(_o());const{dataModel:S,processedData:I}=await this.requestDataModel(t,e,{props:v,groupByKeys:f,groupByData:!f});this.aggregateData(S,I),this.animationState.transition("updateData")}xCoordinateRange(t,e){const{marker:i}=this.properties,s=this.axes[st.X].scale.convert(t),n=i.enabled?.5*i.size*e:0;return[s-n,s+n]}yCoordinateRange(t,e){const{marker:i}=this.properties,s=this.axes[st.Y].scale.convert(t[0]),n=i.enabled?.5*i.size*e:0;return[s-n,s+n]}yValueKey(){return this.isNormalized()?"yValue":"yValueRaw"}yCumulativeKey(t){return t.type==="grouped"?"yValueCumulative":this.yValueKey()}getSeriesDomain(t){const{dataModel:e,processedData:i,axes:s}=this;if(!e||!i)return{domain:[]};const n=s[st.Y];if(t===st.X){const r=e.resolveProcessedDataDefById(this,"xValue"),o=e.getDomain(this,"xValue","key",i);return r?.def.type==="key"&&r.def.valueType==="category"?o:{domain:jt(VW(o.domain))}}const a=this.domainForClippedRange(st.Y,[this.yCumulativeKey(i)],"xValue");if(n instanceof vi&&!(n instanceof ho)){const r=Number.isFinite(a[1]-a[0])?[Math.min(a[0],0),Math.max(a[1],0)]:[];return{domain:jt(r)}}else return{domain:jt(a)}}getSeriesRange(t,e){const[i,s]=this.domainForVisibleRange(st.Y,[this.yCumulativeKey(this.processedData)],"xValue",e);return[Math.min(i,0),Math.max(s,0)]}getZoomRangeFittingItems(t,e,i){return this.zoomFittingVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],t,e,i)}getVisibleItems(t,e,i){return this.countVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],t,e,i)}aggregateData(t,e){if(this.aggregationManager.markStale(e.input.count),Mi(e))return;const i=this.axes[st.X];if(i==null)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>s3(i.scale.type,t,e,this.yCumulativeKey(e),this,s,a),computeFull:a=>i3(i.scale.type,t,e,this.yCumulativeKey(e),this,a),targetRange:s});const n=this.aggregationManager.filters;n&&n.length>0&&FW.record(`${this.type}:aggregation`,n.map(a=>a.maxRange))}estimateTargetRange(){const t=this.axes[st.X];if(t?.scale?.range){const[e,i]=t.scale.range;return Math.abs(i-e)}return this.ctx.scene?.canvas?.width??800}stackAggregatedData(t){const{indices:e,metaIndices:i}=t,{visible:s,axes:n,dataModel:a,processedData:r,seriesBelowStackContext:o}=this,l=n[st.X],c=n[st.Y];if(!s)return this.phantomSpans=[],this.fillSpans=[],this.strokeSpans=[],o;if(l==null||c==null||a==null||r==null)return;const{scale:h}=l,{scale:d}=c,u=(h.bandwidth??0)/2,p=!this.isStacked()&&this.properties.connectMissingData,g=r.invalidData?.get(this.id),f=a.resolveKeysById(this,"xValue",r),m=a.resolveColumnById(this,this.yCumulativeKey(r),r);let[b,x]=Fo(1,i.length-1,l.range,D=>{const A=i[D],C=i[D+1],T=e[A],L=e[C],k=f[T],O=f[L],{0:N}=this.xCoordinateRange(k,0),{1:w}=this.xCoordinateRange(O,0);return[N,w]});b=Math.max(b-1,0),x=Math.min(x+1,i.length-1);let v=[];if(o?.fillSpans)v=o?.fillSpans;else for(let D=b;DZ.point),V={span:{type:"multi-line",moveTo:!1,x0:w.point.x,y0:w.point.y,x1:R.point.x,y1:R.point.y,midPoints:F},xValue0:w.xDatum,xValue1:R.xDatum,yValue0:w.yDatum,yValue1:R.yDatum};S.push(V),I.push(V)}return this.fillSpans=S,this.strokeSpans=I,{stack:[],fillSpans:S,strokeSpans:I}}hasInvalidDatumsInRange(t,e,i,s){const n=Math.min(i,s),a=Math.max(i,s);for(let r=n;r<=a;r++){if(t?.[r])return!0;const o=e[r];if(!Number.isFinite(o))return!0}return!1}stackYValueData(){const{visible:t,axes:e,dataModel:i,processedData:s,seriesBelowStackContext:n,properties:a}=this,r=e[st.X],o=e[st.Y];if(r==null||o==null||i==null||s==null)return;const{interpolation:l}=a,{scale:c}=r,{scale:h}=o,d=(c.bandwidth??0)/2;let u=i.resolveKeysById(this,"xValue",s),p=i.resolveColumnById(this,this.yValueKey(),s);const g=!this.isStacked()&&this.properties.connectMissingData,f=s.invalidKeys?.get(this.id),b=(g?s.invalidData?.get(this.id):void 0)??f;b!=null&&(u=u.filter((L,k)=>b[k]===!1),p=p.filter((L,k)=>b[k]===!1));let[x,v]=Fo(1,u.length,r.range,L=>this.xCoordinateRange(u[L],0));x=Math.max(x-2,0),v=Math.min(v+2,u.length);let S;if(n?.fillSpans)S=n?.fillSpans;else{const L=[];for(let k=x;k0,crossFiltering:this.properties.selectedKey!=null,styles:rd(this,this.properties,this.properties.marker),segments:void 0}}assembleResult(t,e){return e.segments=Hh(this.properties.segmentation,t.xAxis,t.yAxis,this.chart.seriesRect,this.ctx.scene,!1),e}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(t){const{paths:[e,i],visible:s,animationEnabled:n}=t,a=this.contextNodeData?.segments,r=zW(this.getHighlightStyle(),this.getStyle()),{strokeWidth:o,stroke:l,strokeOpacity:c,lineDash:h,lineDashOffset:d,fill:u,fillOpacity:p,opacity:g}=r;i.setProperties({segments:a,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:1,stroke:l,strokeWidth:o,strokeOpacity:c,lineDash:h,lineDashOffset:d,opacity:g,visible:s||n}),i.datum=a,e.setStyleProperties({fill:u,stroke:void 0,fillOpacity:p},this.getShapeFillBBox()),e.setProperties({segments:a,lineJoin:"round",pointerEvents:1,fillShadow:this.properties.shadow,opacity:g,visible:s||n}),e.datum=a,od(this,i),od(this,e)}updatePaths(t){this.updateAreaPaths(t.paths,t.contextData)}updateAreaPaths(t,e){for(const i of t)i.visible=e.visible;if(e.visible)this.updateFillPath(t,e),this.updateStrokePath(t,e);else for(const i of t)i.path.clear(),i.markDirty("AreaSeries")}updateFillPath(t,e){const[i]=t;i.path.clear(),qD(i,e.fillData),i.markDirty("AreaSeries")}updateStrokePath(t,e){const{spans:i}=e.strokeData,[,s]=t;s.path.clear(),ef(s,i),s.markDirty("AreaSeries")}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,{contextNodeData:s,processedData:n,axes:a,properties:r}=this,{marker:o,styler:l}=r,c=l?this.getStyle().marker:void 0,h=s?.crossFiltering===!0||cf(n.input.count,a[st.X].scale,o,c);o.isDirty()&&(i.clear(),i.cleanup());const d=h?e:[];return Mi(this.processedData)?i.update(d,void 0,u=>yt(u.xValue)):i.update(d)}updateDatumStyles(t){const{datumSelection:e,isHighlight:i}=t,{marker:s}=this.properties,n=this.ctx.highlightManager.getActiveHighlight();e.each((a,r)=>{if(!e.isGarbage(a)){const o=this.getHighlightState(n,t.isHighlight,r.datumIndex),l=this.getStyle(o),{stroke:c,strokeWidth:h,strokeOpacity:d}=l,u=this.makeItemStylerParams(this.dataModel,this.processedData,r.datumIndex,l.marker);r.style=this.getMarkerStyle(s,r,u,{isHighlight:i,highlightState:o},l.marker,{stroke:c,strokeWidth:h,strokeOpacity:d})}})}updateDatumNodes(t){const{contextNodeData:e}=this;if(!e)return;const{datumSelection:i,isHighlight:s}=t,n=this.getShapeFillBBox(),a=this.ctx.highlightManager.getActiveHighlight(),r=this.getDrawingMode(s,t.drawingMode);i.each((o,l)=>{const c=this.getHighlightState(a,s,l.datumIndex),h=l.style??e.styles[c];this.applyMarkerStyle(h,o,l.point,n,{selected:l.selected}),o.drawingMode=this.resolveMarkerDrawingModeForState(r,h)}),s||this.properties.marker.markClean()}updateLabelSelection(t){return t.labelSelection.update(this.isLabelEnabled()?t.labelData:[])}updateLabelNodes(t){const{isHighlight:e=!1}=t,i=this.ctx.highlightManager?.getActiveHighlight(),s=this.makeLabelFormatterParams();t.labelSelection.each((n,a)=>{const r=Ba(this,a,s,this.properties.label,e,i),{enabled:o,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d,color:u}=r;o&&a?.labelText?(n.fontStyle=l,n.fontWeight=c,n.fontSize=h,n.fontFamily=d,n.textAlign="center",n.textBaseline="bottom",n.text=a.labelText,n.x=a.x,n.y=a.y-10,n.fill=u,n.visible=!0,n.fillOpacity=this.getHighlightStyle(e,a.datumIndex).opacity??1,n.setBoxing(r)):n.visible=!1})}makeStylerParams(t){const{id:e}=this,{marker:i,fill:s,fillOpacity:n,lineDash:a,lineDashOffset:r,stroke:o,strokeOpacity:l,strokeWidth:c,xKey:h,yKey:d}=this.properties,u=ur(t??0);return{marker:{fill:i.fill,fillOpacity:i.fillOpacity,size:i.size,shape:i.shape,stroke:i.stroke,strokeOpacity:i.strokeOpacity,strokeWidth:i.strokeWidth,lineDash:i.lineDash,lineDashOffset:i.lineDashOffset},highlightState:u,fill:s,fillOpacity:n,lineDash:a,lineDashOffset:r,seriesId:e,stroke:o,strokeOpacity:l,strokeWidth:c,xKey:h,yKey:d}}makeItemStylerParams(t,e,i,s){const{xKey:n,yKey:a}=this.properties,r=t.resolveKeysById(this,"xValue",e)[i],o=t.resolveColumnById(this,"yValueRaw",e)[i],l=t.getDomain(this,"xValue","key",e).domain,c=t.getDomain(this,this.yCumulativeKey(e),"value",e).domain,h=this.filterItemStylerFillParams(s.fill)??s.fill;return{...Wu(r,o,n,a,l,c),xValue:r,yValue:o,...s,fill:h}}makeLabelFormatterParams(){const{xKey:t,xName:e,yKey:i,yName:s,legendItemName:n}=this.properties;return{xKey:t,xName:e,yKey:i,yName:s,legendItemName:n}}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a}=this,{xKey:r,xName:o,yKey:l,yName:c,tooltip:h,legendItemName:d}=a,u=a.allowNullKeys??!1,p=n[st.X],g=n[st.Y];if(!i||!s||!p||!g)return;const f=s.dataSources.get(this.id)?.data?.[t],m=i.resolveKeysById(this,"xValue",s)[t],b=i.resolveColumnById(this,"yValueRaw",s)[t];if(m===void 0&&!u)return;const x=this.getStyle(),v=this.makeItemStylerParams(i,s,t,x.marker),S=this.getMarkerStyle(this.properties.marker,{datumIndex:t,datum:f},v,{isHighlight:!1},x.marker);return this.formatTooltipWithContext(h,{heading:this.getAxisValueText(p,"tooltip",m,f,r,d,u),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(g,"tooltip",b,f,l,d),missing:ga(b)}]},{seriesId:e,datum:f,title:c,xKey:r,xName:o,yKey:l,yName:c,...S,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:t,stroke:e,fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:a,marker:r}=this.getStyle(),o=!r.enabled||r.fill==null,l=o?t:r.fill;return{marker:{...this.getMarkerStyle(this.properties.marker,{},void 0,{isHighlight:!1,checkForHighlight:!1},{size:r.size,shape:r.shape,fill:l,fillOpacity:o?i:r.fillOpacity,stroke:r.stroke}),enabled:r.enabled||n<=0},line:{enabled:!0,stroke:e,strokeOpacity:s,strokeWidth:n,lineDash:a}}}getLegendData(t){if(t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{yKey:n,yName:a,legendItemName:r,showInLegend:o}=this.properties;return[{legendType:t,id:e,itemId:n,legendItemName:r,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:r??a??n},symbol:this.legendItemSymbol(),hideInLegend:!o}]}resetDatumAnimation(t){nd([t.datumSelection])}animateEmptyUpdateReady(t){const{datumSelection:e,labelSelection:i,contextData:s,paths:n}=t,{animationManager:a}=this.ctx;this.updateAreaPaths(n,s),hf(this,a,...n),ot([e],Pl),lf(this,a,{...this.getAnimationDrawingModes(),phase:"initial"},e),Te(this,"labels",a,i)}animateReadyResize(t){const{contextData:e,paths:i}=t;this.updateAreaPaths(i,e),super.animateReadyResize(t)}animateWaitingUpdateReady(t){const{animationManager:e}=this.ctx,{datumSelection:i,labelSelection:s,contextData:n,paths:a,previousContextData:r}=t,[o,l]=a;if(n.visible===!1&&r?.visible===!1||o==null&&l==null)return;this.resetDatumAnimation(t),this.resetLabelAnimation(t);const c=()=>{this.resetPathAnimation(t),this.updateAreaPaths(a,n)},h=()=>{e.skipCurrentBatch(),c()};if(n==null||r==null){c(),Rl(this,e,"added",this.getAnimationDrawingModes(),i),df(this,"fill_path_properties",e,"add",o),df(this,"stroke_path_properties",e,"add",l),Te(this,"labels",e,s);return}if(n.crossFiltering!==r.crossFiltering){h();return}const d=gj(n,r);if(d===void 0){h();return}else if(d.status==="no-op")return;Rl(this,e,void 0,this.getAnimationDrawingModes(),i),Ee(this.id,"fill_path_properties",e,[o],d.fill.pathProperties),hd(this.id,"fill_path_update",e,[o],d.fill.path),Ee(this.id,"stroke_path_properties",e,[l],d.stroke.pathProperties),hd(this.id,"stroke_path_update",e,[l],d.stroke.path),Te(this,"labels",e,s),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(a,n)})}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new We}getStyle(t){const{styler:e,marker:i,fill:s,fillOpacity:n,lineDash:a,lineDashOffset:r,stroke:o,strokeOpacity:l,strokeWidth:c}=this.properties,{size:h,shape:d,fill:u="transparent",fillOpacity:p}=i;let g={};if(e){const f=this.makeStylerParams(t),m=this.cachedCallWithContext(e,f)??{};g=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],m,{pick:!1})??{}}return g.marker??(g.marker={}),{fill:g.fill??s,fillOpacity:g.fillOpacity??n,lineDash:g.lineDash??a,lineDashOffset:g.lineDashOffset??r,stroke:g.stroke??o,strokeOpacity:g.strokeOpacity??l,strokeWidth:g.strokeWidth??c,marker:{enabled:g.marker.enabled??i.enabled,fill:g.marker.fill??u,fillOpacity:g.marker.fillOpacity??p,shape:g.marker.shape??d,size:g.marker.size??h,lineDash:g.marker.lineDash??i.lineDash??a,lineDashOffset:g.marker.lineDashOffset??i.lineDashOffset??r,stroke:g.marker.stroke??i.stroke??o,strokeOpacity:g.marker.strokeOpacity??i.strokeOpacity??l,strokeWidth:g.marker.strokeWidth??i.strokeWidth??c}}}getFormattedMarkerStyle(t){const e=this.getStyle(),i=this.makeItemStylerParams(this.dataModel,this.processedData,t.datumIndex,e.marker);return this.getMarkerStyle(this.properties.marker,t,i,{isHighlight:!0},void 0,e)}isPointInArea(t,e){let i;for(const s of this.backgroundGroup.children())if(s instanceof Ue){i=s;break}return i?.getBBox().containsPoint(t,e)?i.isPointInPath(t,e):!1}computeFocusBounds(t){return ad(this,t)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};Zf.className="AreaSeries",Zf.type="area";var a3={series:{nodeClickRange:"nearest",fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",wW],["image",EW],["pattern",hA]]},stroke:{$palette:"stroke"},fillOpacity:.8,strokeOpacity:1,strokeWidth:{$isUserOption:["./stroke",2,0]},lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:kW,xOffset:3,yOffset:3,blur:5},interpolation:{type:"linear"},marker:{enabled:!1,shape:"circle",size:7,strokeWidth:{$isUserOption:["./stroke",1,0]},fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",OW],["pattern",hA]]},stroke:{$palette:"stroke"}},label:{...RW,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$path:["/tooltip/range","nearest"]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:PW,segmentation:_W}},yA={type:"series",name:"area",chartType:"cartesian",stackable:!0,version:me,dependencies:[Ii],options:lg,predictAxis:Dl,defaultAxes:{y:{type:oA.NUMBER,position:lA.LEFT},x:{type:oA.CATEGORY,position:lA.BOTTOM}},axisKeys:{[cA.X]:"xKeyAxis",[cA.Y]:"yKeyAxis"},themeTemplate:a3,create:t=>new Zf(t)};import{ChartAxisDirection as Dd,DEFAULT_SHADOW_COLOUR as r3,DIRECTION_SWAP_AXES as o3,FILL_GRADIENT_LINEAR_DEFAULTS as l3,FILL_IMAGE_DEFAULTS as c3,FILL_PATTERN_DEFAULTS as h3,LABEL_BOXING_DEFAULTS as d3,MULTI_SERIES_HIGHLIGHT_STYLE as u3,SEGMENTATION_DEFAULTS as p3}from"ag-charts-core";import{AGGREGATION_INDEX_UNSET as g3,AGGREGATION_INDEX_X_MAX as f3,AGGREGATION_INDEX_X_MIN as m3,AGGREGATION_INDEX_Y_MAX as bA,AGGREGATION_INDEX_Y_MIN as xA,AGGREGATION_SPAN as y3,ChartAxisDirection as _n,DebugMetrics as b3,areScalingEqual as x3,isFiniteNumber as v3,mergeDefaults as Xf}from"ag-charts-core";import{DeclaredSceneChangeDetection as vA}from"ag-charts-core";var S3=.001,qf=class extends He{constructor(){super(...arguments),this.direction="x",this.featherRatio=0}setStaticProperties(t,e,i,s,n,a,r,o,l,c){this.__direction=l??"x",this.__featherRatio=c??0,super.setStaticProperties(t,e,i,s,n,a,r,o)}get feathered(){return Math.abs(this.featherRatio)>S3}isPointInPath(t,e){return this.feathered?this.getBBox().containsPoint(t,e):super.isPointInPath(t,e)}updatePath(){if(!this.feathered){super.updatePath();return}const{path:t,borderPath:e,__direction:i,__featherRatio:s,__x:n,__y:a,__width:r,__height:o}=this;if(t.clear(),e.clear(),i==="x"){const l=Math.abs(s)*r;s>0?(t.moveTo(n,a),t.lineTo(n+r-l,a),t.lineTo(n+r,a+o/2),t.lineTo(n+r-l,a+o),t.lineTo(n,a+o),t.closePath()):(t.moveTo(n+l,a),t.lineTo(n+r,a),t.lineTo(n+r,a+o),t.lineTo(n+l,a+o),t.lineTo(n,a+o/2),t.closePath())}else{const l=Math.abs(s)*o;s>0?(t.moveTo(n,a+l),t.lineTo(n+r/2,a),t.lineTo(n+r,a+l),t.lineTo(n+r,a+o),t.lineTo(n,a+o),t.closePath()):(t.moveTo(n,a),t.lineTo(n+r,a),t.lineTo(n+r,a+o-l),t.lineTo(n+r/2,a+o),t.lineTo(n,a+o-l),t.closePath())}}renderStroke(t){if(!this.feathered){super.renderStroke(t);return}const{__stroke:e,__strokeWidth:i,__lineDash:s,__lineDashOffset:n,__lineCap:a,__lineJoin:r,path:o}=this;if(e&&i){const{globalAlpha:l}=t;this.applyStrokeAndAlpha(t),t.lineWidth=i,s&&t.setLineDash(s),n&&(t.lineDashOffset=n),a&&(t.lineCap=a),r&&(t.lineJoin=r),t.stroke(o.getPath2D()),t.globalAlpha=l}}};y([vA()],qf.prototype,"direction",2),y([vA()],qf.prototype,"featherRatio",2);import{AGGREGATION_MIN_RANGE as I3,AGGREGATION_THRESHOLD as SA,aggregationDomain as Jf,aggregationRangeFittingPoints as IA,compactAggregationIndices as DA,createAggregationIndices as MA,getMidpointsForIndices as uo,nextPowerOf2 as D3,simpleMemorize2 as M3}from"ag-charts-core";function Qf(t,e,i,s,n){if(e.lengthS.maxRange===d);let{indexData:p,valueData:g,negativeIndexData:f,negativeValueData:m}=MA(e,s,i??s,a,r,d,{split:!0,xNeedsValueOf:l,yNeedsValueOf:c,reuseIndexData:u?.positiveIndexData,reuseValueData:u?.positiveValueData,reuseNegativeIndexData:u?.negativeIndexData,reuseNegativeValueData:u?.negativeValueData});if(!f||!m)throw new Error("Negative aggregation data missing in split mode");let b=uo(d,p,u?.positiveIndices),x=uo(d,f,u?.negativeIndices);const v=[{maxRange:d,positiveIndices:b,positiveIndexData:p,positiveValueData:g,negativeIndices:x,negativeIndexData:f,negativeValueData:m}];for(;d>64;){const S=d,I=Math.trunc(S/2),M=h?.find(C=>C.maxRange===I),D=DA(p,g,S,{reuseIndexData:M?.positiveIndexData,reuseValueData:M?.positiveValueData}),A=DA(f,m,S,{reuseIndexData:M?.negativeIndexData,reuseValueData:M?.negativeValueData});d=D.maxRange,p=D.indexData,g=D.valueData,b=D.midpointData??uo(d,p,M?.positiveIndices),f=A.indexData,m=A.valueData,x=A.midpointData??uo(d,f,M?.negativeIndices),v.push({maxRange:d,positiveIndices:b,positiveIndexData:p,positiveValueData:g,negativeIndices:x,negativeIndexData:f,negativeValueData:m})}return v.reverse(),v}function A3(t,e,i,s,n){if(e.lengthI.maxRange===p),{indexData:f,valueData:m,negativeIndexData:b,negativeValueData:x}=MA(e,s,i??s,a,r,p,{split:!0,xNeedsValueOf:l,yNeedsValueOf:c,reuseIndexData:g?.positiveIndexData,reuseValueData:g?.positiveValueData,reuseNegativeIndexData:g?.negativeIndexData,reuseNegativeValueData:g?.negativeValueData});if(!b||!x)throw new Error("Negative aggregation data missing in split mode");const v={maxRange:p,positiveIndices:uo(p,f,g?.positiveIndices),positiveIndexData:f,positiveValueData:m,negativeIndices:uo(p,b,g?.negativeIndices),negativeIndexData:b,negativeValueData:x};function S(){return Qf([a,r],e,i,s,{smallestKeyInterval:o,xNeedsValueOf:l,yNeedsValueOf:c,existingFilters:d})?.filter(M=>M.maxRange!==p)??[]}return{immediate:[v],computeRemaining:S}}function C3(t,e,i,s,n,a,r,o){const[l,c]=Jf(t,n);return Qf([l,c],e,i,s,{smallestKeyInterval:a,xNeedsValueOf:r,yNeedsValueOf:o})}var T3=M3(C3);function L3(t,e,i,s,n){const a=e.resolveKeysById(s,"xValue",i),r=e.hasColumnById(s,"yValue-start"),o=r?e.resolveColumnById(s,"yValue-start",i):void 0,l=r?e.resolveColumnById(s,"yValue-end",i):e.resolveColumnById(s,"yValue-raw",i),c=e.getDomain(s,"xValue","key",i),h=e.resolveColumnNeedsValueOf(s,"xValue",i),d=e.resolveColumnNeedsValueOf(s,r?"yValue-end":"yValue-raw",i);if(n){const[u,p]=Jf(t,c);return Qf([u,p],a,o,l,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:h,yNeedsValueOf:d,existingFilters:n})}return T3(t,a,o,l,c,i.reduced?.smallestKeyInterval,h,d)}function N3(t,e,i,s,n,a){const r=e.resolveKeysById(s,"xValue",i),o=e.hasColumnById(s,"yValue-start"),l=o?e.resolveColumnById(s,"yValue-start",i):void 0,c=o?e.resolveColumnById(s,"yValue-end",i):e.resolveColumnById(s,"yValue-raw",i),h=e.getDomain(s,"xValue","key",i),d=e.resolveColumnNeedsValueOf(s,"xValue",i),u=e.resolveColumnNeedsValueOf(s,o?"yValue-end":"yValue-raw",i),[p,g]=Jf(t,h);return A3([p,g],r,l,c,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:d,yNeedsValueOf:u,targetRange:n,existingFilters:a})}import{Property as xe}from"ag-charts-core";var em=class extends li{constructor(){super(...arguments),this.placement="inside-center",this.spacing=0}};y([xe],em.prototype,"placement",2),y([xe],em.prototype,"spacing",2);var Ie=class extends Tl{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.crisp=void 0,this.shadow=new Is,this.label=new em,this.tooltip=Ga(),this.sparklineMode=!1}};y([xe],Ie.prototype,"xKey",2),y([xe],Ie.prototype,"xName",2),y([xe],Ie.prototype,"yKey",2),y([xe],Ie.prototype,"yName",2),y([xe],Ie.prototype,"yFilterKey",2),y([xe],Ie.prototype,"stackGroup",2),y([xe],Ie.prototype,"normalizedTo",2),y([xe],Ie.prototype,"fill",2),y([xe],Ie.prototype,"fillOpacity",2),y([xe],Ie.prototype,"stroke",2),y([xe],Ie.prototype,"strokeWidth",2),y([xe],Ie.prototype,"strokeOpacity",2),y([xe],Ie.prototype,"lineDash",2),y([xe],Ie.prototype,"lineDashOffset",2),y([xe],Ie.prototype,"cornerRadius",2),y([xe],Ie.prototype,"crisp",2),y([xe],Ie.prototype,"styler",2),y([xe],Ie.prototype,"itemStyler",2),y([xe],Ie.prototype,"simpleItemStyler",2),y([xe],Ie.prototype,"shadow",2),y([xe],Ie.prototype,"label",2),y([xe],Ie.prototype,"tooltip",2),y([xe],Ie.prototype,"sparklineMode",2);var tm=class extends DD{constructor(t){super({moduleCtx:t,propertyKeys:Jr,propertyNames:Qr,categoryKey:"xValue",pickModes:[2,1,0],pathsPerSeries:[],datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:El,label:za}}),this.properties=new Ie,this.connectsToYAxis=!0,this.aggregationManager=new cd,this.phantomGroup=this.contentGroup.appendChild(new U({name:"phantom",zIndex:-1})),this.phantomSelection=Re.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.phantomHighlightGroup=this.highlightGroup.appendChild(new U({name:`${this.internalId}-highlight-node`})),this.phantomHighlightSelection=Re.select(this.phantomHighlightGroup,()=>this.nodeFactory(),!1),this.phantomGroup.opacity=.2,this.phantomHighlightGroup.opacity=.2}get pickModeAxis(){return this.properties.sparklineMode?"main":void 0}async processData(t){if(!this.data)return;const{xKey:e,yKey:i,yFilterKey:s,normalizedTo:n}=this.properties,{seriesGrouping:{groupIndex:a=this.id}={},data:r}=this,l=(this.seriesGrouping?.stackCount??0)>1||n!=null,c=l,h=!this.ctx.animationManager.isSkipped(),d=this.getCategoryAxis()?.scale,u=this.getValueAxis()?.scale,{isContinuousX:p,xScaleType:g,yScaleType:f}=this.getScaleInformation({xScale:d,yScale:u}),m=this.visible?{}:{forceValue:0},b=this.properties.allowNullKeys??!1,x=[nn(e,g,{id:"xValue",allowNullKey:b}),ye(i,f,{id:"yValue-raw",invalidValue:null,...m})],v=[];if(l){const M=`bar-stack-${a}-yValues`,D=`${M}-trailing`;v.push(M,D),x.push(...sa(i,"normal",{id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:M,separateNegative:!0,...m},f),...sa(i,"trailing",{id:"yValue-start",invalidValue:null,missingValue:0,groupId:D,separateNegative:!0,...m},f))}if(s!=null&&(x.push(ye(s,f,{id:"yFilterValue-raw",invalidValue:null,...m})),l)){const M=`bar-stack-${a}-yFilterValues`,D=`${M}-trailing`;v.push(M,D),x.push(...sa(s,"normal",{id:"yFilterValue-end",rangeId:"yFilterValue-range",invalidValue:null,missingValue:0,groupId:M,separateNegative:!0,...m},f),...sa(s,"trailing",{id:"yFilterValue-start",invalidValue:null,missingValue:0,groupId:D,separateNegative:!0,...m},f),qO(this.id,"yValue-raw","yFilterValue-raw"))}p&&x.push(Bb,zb),v3(n)&&x.push(Mc(v,Math.abs(n))),this.needsDataModelDiff()&&this.processedData&&x.push(Cc(this.id,this.processedData)),(h||!c)&&x.push(_o());const{dataModel:S,processedData:I}=await this.requestDataModel(t,r,{props:x,groupByKeys:c,groupByData:!c});this.aggregateData(S,I),this.smallestDataInterval=I.reduced?.smallestKeyInterval,this.largestDataInterval=I.reduced?.largestKeyInterval,this.animationState.transition("updateData")}yCumulativeKey(t){return t.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw"}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(i==null||e==null)return{domain:[]};if(t===this.getCategoryDirection()){const a=i.resolveProcessedDataDefById(this,"xValue"),r=i.getDomain(this,"xValue","key",e);return a?.def.type==="key"&&a.def.valueType==="category"?r:{domain:this.padBandExtent(r.domain)}}let s;if(e.reduced?.filteredValueExceedUnfiltered===!0)s=this.domainForClippedRange(t,["yFilterValue-end"],"xValue");else{const a=this.yCumulativeKey(i);s=this.domainForClippedRange(t,[a],"xValue");const r=i.hasColumnById(this,"yFilterValue-raw")?i.getDomain(this,"yFilterValue-raw","value",e).domain:void 0;r!=null&&(s=[Math.min(s[0],r[0]),Math.max(s[1],r[1])])}const n=this.getValueAxis();if(n instanceof vi&&!(n instanceof ho)){const a=Number.isFinite(s[1]-s[0])?[Math.min(0,s[0]),Math.max(0,s[1])]:[];return{domain:jt(a)}}else return{domain:jt(s)}}getSeriesRange(t,e){if((this.properties.direction==="horizontal"?_n.X:_n.Y)!==t)return[];const s=this.yCumulativeKey(this.dataModel),[n,a]=this.domainForVisibleRange(_n.Y,[s],"xValue",e);return[Math.min(n,0),Math.max(a,0)]}getZoomRangeFittingItems(t,e,i){const s=this.yCumulativeKey(this.dataModel);return this.zoomFittingVisibleItems("xValue",[s],t,e,i)}getVisibleItems(t,e,i){const s=this.yCumulativeKey(this.dataModel);return this.countVisibleItems("xValue",[s],t,e,i)}aggregateData(t,e){if(this.aggregationManager.markStale(e.input.count),Mi(e))return;const i=this.axes[_n.X];if(i==null)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>N3(i.scale.type,t,e,this,s,a),computeFull:a=>L3(i.scale.type,t,e,this,a),targetRange:s});const n=this.aggregationManager.filters;n&&n.length>0&&b3.record(`${this.type}:aggregation`,n.map(a=>a.maxRange))}estimateTargetRange(){const t=this.axes[_n.X];if(t?.scale?.range){const[e,i]=t.scale.range;return Math.abs(i-e)}return this.ctx.scene?.canvas?.width??800}createNodeDatumContext(t,e){const{dataModel:i,processedData:s}=this;if(!i||!s)return;const n=s.dataSources?.get(this.id);if(n==null)return;const a=t.scale,r=e.scale,o=Math.abs(a.range[1]-a.range[0]);this.aggregationManager.ensureLevelForRange(o);const l=this.aggregationManager.getFilterForRange(o),c=s.reduced?.filteredValueExceedUnfiltered??!1,h=i.hasColumnById(this,"yValue-start"),{label:d}=this.properties,u=this.canIncrementallyUpdateNodes(l!=null),{groupOffset:p,barOffset:g,barWidth:f}=this.getBarDimensions();let m,b,x;if(c)m=i.resolveColumnById(this,"yFilterValue-start",s),b=i.resolveColumnById(this,"yFilterValue-end",s),x=void 0;else{const v=i.hasColumnById(this,"yFilterValue-raw");m=h?i.resolveColumnById(this,"yValue-start",s):void 0,b=h?i.resolveColumnById(this,"yValue-end",s):void 0,x=v?i.resolveColumnById(this,"yFilterValue-raw",s):void 0}return{dataSource:n,rawData:n.data,xValues:i.resolveKeysById(this,"xValue",s),yRawValues:i.resolveColumnById(this,"yValue-raw",s),yStartValues:m,yEndValues:b,yFilterValues:x,xScale:a,yScale:r,xAxis:t,yAxis:e,groupOffset:p,barOffset:g,barWidth:f,range:o,yReversed:e.isReversed(),bboxBottom:r.convert(0),labelSpacing:d.spacing+(typeof d.padding=="number"?d.padding:0),crisp:l==null&&(this.properties.crisp??KD(t?.scale,t?.visibleRange,this.smallestDataInterval,this.largestDataInterval)),isStacked:h,filteredValueExceedUnfiltered:c,animationEnabled:!this.ctx.animationManager.isSkipped(),dataAggregationFilter:l,canIncrementallyUpdate:u,phantomNodes:u?this.contextNodeData.phantomNodeData??[]:[],nodes:u?this.contextNodeData.nodeData:[],labels:u?this.contextNodeData.labelData:[],nodeIndex:0,phantomIndex:0,barAlongX:this.getBarDirection()===_n.X,shouldFlipXY:this.shouldFlipXY(),xKey:this.properties.xKey,yKey:this.properties.yKey,xName:this.properties.xName,yName:this.properties.yName,legendItemName:this.properties.legendItemName,label:d,yDomain:this.getSeriesDomain(_n.Y).domain}}computeXPosition(t,e){const i=t.xScale.convert(t.xValues[e]);return Number.isFinite(i)?i+t.groupOffset+t.barOffset+this.getDatumOffset(e):Number.NaN}prepareNodeDatumState(t,e,i,s,n){if(!Number.isFinite(n))return;const a=t.xValues[i];if(a===void 0&&!this.properties.allowNullKeys)return;const r=t.dataSource?.data[i],o=t.yRawValues[i],l=t.yFilterValues==null?void 0:Number(t.yFilterValues[i]);if(l!=null&&!Number.isFinite(l))return;const c=t.label.enabled&&o!=null?this.getLabelText(l??o,r,t.yKey,"y",t.yDomain,t.label,{datum:r,value:l??o,xKey:t.xKey,yKey:t.yKey,xName:t.xName,yName:t.yName,legendItemName:t.legendItemName}):void 0,h=o>=0&&!Object.is(o,-0);return e.datum=r,e.xValue=a,e.yRawValue=o,e.yFilterValue=l,e.labelText=c,e.inset=l!=null&&l>o,e.isPositive=h,e.precomputedBottomY=l==null?void 0:t.yScale.convert(s),e.precomputedIsUpward=l==null?void 0:h!==t.yReversed,e}createSkeletonNodeDatum(t,e,i){const s=e.nodeDatumScratch;return{series:this,datum:s.datum,datumIndex:e.datumIndex,cumulativeValue:0,phantom:i,xValue:s.xValue??"",yValue:0,yKey:t.yKey,xKey:t.xKey,capDefaults:{lengthRatioMultiplier:0,lengthMax:0},x:0,y:0,width:0,height:0,midPoint:{x:0,y:0},opacity:e.opacity,featherRatio:e.featherRatio,topLeftCornerRadius:!1,topRightCornerRadius:!1,bottomRightCornerRadius:!1,bottomLeftCornerRadius:!1,clipBBox:void 0,crisp:t.crisp,label:void 0,missing:!1,focusable:!i}}createNodeDatum(t,e){const i=this.prepareNodeDatumState(t,e.nodeDatumScratch,e.datumIndex,e.yStart,e.yEnd);if(!i)return{nodeData:void 0,phantomNodeData:void 0};const s=this.createSkeletonNodeDatum(t,e,!1);this.updateNodeDatum(t,s,e,i);let n;return i.yFilterValue!=null&&(n=this.createSkeletonNodeDatum(t,e,!0),this.updateNodeDatum(t,n,e)),{nodeData:s,phantomNodeData:n}}updateNodeDatum(t,e,i,s){if(s??(s=this.prepareNodeDatumState(t,i.nodeDatumScratch,i.datumIndex,i.yStart,i.yEnd)),!s)return;const n=e,a=e.phantom,r=i.yStart,o=a?s.yFilterValue:s.yFilterValue??s.yRawValue,l=a?s.yFilterValue:s.yFilterValue??i.yEnd,c=a?void 0:s.labelText;let h;a||s.yFilterValue==null?h=i.yEnd:h=i.yStart+s.yFilterValue;let d;a?d=i.yRange:d=Math.max(i.yStart+(s.yFilterValue??-1/0),i.yRange);let u;a?u=void 0:s.inset?u=.6:u=void 0;const p=s.precomputedIsUpward??s.isPositive!==t.yReversed,g=t.yScale.convert(h),f=s.precomputedBottomY??t.yScale.convert(r),m=t.yScale.convert(d),b=i.width*.5*(1-(u??1)),x=t.barAlongX?Math.min(g,f):i.x+b,v=t.barAlongX?i.x+b:Math.min(g,f),S=t.barAlongX?Math.abs(f-g):i.width*(u??1),I=t.barAlongX?i.width*(u??1):Math.abs(f-g),M=t.barAlongX?Math.min(t.bboxBottom,m):i.x+b,D=t.barAlongX?i.x+b:Math.min(t.bboxBottom,m),A=t.barAlongX?Math.abs(t.bboxBottom-m):i.width*(u??1),C=t.barAlongX?i.width*(u??1):Math.abs(t.bboxBottom-m);n.datum=s.datum,n.datumIndex=i.datumIndex,n.cumulativeValue=l,n.xValue=s.xValue,n.yValue=o,n.x=M,n.y=D,n.width=A,n.height=C;const T=n.midPoint;T.x=x+S/2,T.y=v+I/2;const L=t.shouldFlipXY?I:S;n.capDefaults.lengthRatioMultiplier=L,n.capDefaults.lengthMax=L,n.opacity=i.opacity,n.featherRatio=i.featherRatio,n.topLeftCornerRadius=t.barAlongX!==p,n.topRightCornerRadius=p,n.bottomRightCornerRadius=t.barAlongX===p,n.bottomLeftCornerRadius=!p;const k=n.clipBBox;if(k?(k.x=x,k.y=v,k.width=S,k.height=I):n.clipBBox=new P(x,v,S,I),n.crisp=t.crisp,c==null)n.label=void 0;else{const O=hD({isUpward:p,isVertical:!t.barAlongX,placement:t.label.placement,spacing:t.labelSpacing,rect:{x,y:v,width:S,height:I}}),N=n.label;N?(N.text=c,N.x=O.x,N.y=O.y,N.textAlign=O.textAlign,N.textBaseline=O.textBaseline):n.label={text:c,...O}}n.missing=ga(o)}createNodeDataWithAggregation(t,e,i){const s=t.yReversed?-1:1;for(let n=0;n<2;n+=1){const a=n===0,r=a?t.dataAggregationFilter.positiveIndices:t.dataAggregationFilter.negativeIndices,o=a?t.dataAggregationFilter.positiveIndexData:t.dataAggregationFilter.negativeIndexData,l=a?xA:bA,c=a?bA:xA,h=this.visibleRangeIndices("xValue",t.xAxis.range,r),d=h[0],u=h[1];for(let p=d;pt.range)continue;const I=Math.abs(m-f)+1,M=Fi.is(t.xScale)?Math.min(t.xScale.bandwidth*Math.max(I-1,1)/(t.xScale.step*I),1):1;if(i.datumIndex=x,i.x=v,i.width=S,i.opacity=M,t.isStacked)i.yStart=Number(t.yStartValues[b]),i.yEnd=Number(t.yEndValues[x]),i.featherRatio=0;else{const D=Number(t.yRawValues[x]),A=Number(t.yRawValues[b]);i.yStart=0,i.yEnd=D,i.featherRatio=(a?1:-1)*s*(1-A/D)}i.yRange=i.yEnd,this.upsertNodeDatum(t,i)}}}createNodeDataGrouped(t,e,i){const s=this.processedData,n=s.invalidData?.get(this.id),a=t.barWidth;let r;t.filteredValueExceedUnfiltered?r=this.dataModel.resolveProcessedDataIndexById(this,"yFilterValue-range"):t.isStacked?r=this.dataModel.resolveProcessedDataIndexById(this,"yValue-range"):r=-1;const o=s.columnScopes.findIndex(u=>u.has(this.id)),l=s.groups,c=Fo(1,l.length,t.xAxis.range,u=>{const g=l[u].keys[0];return this.xCoordinateRange(g)}),h=c[0],d=c[1];for(let u=h;u=0&&!Object.is(v,-0),I=t.isStacked?Number(t.yStartValues?.[b]):0,M=t.isStacked?Number(t.yEndValues?.[b]):v;let D=M;t.isStacked&&(D=g[r][S?1:0]),i.datumIndex=b,i.x=x,i.width=a,i.yStart=I,i.yEnd=M,i.yRange=D,i.featherRatio=0,i.opacity=1,this.upsertNodeDatum(t,i)}}}createNodeDataSimple(t,e,i){const s=this.processedData.invalidData?.get(this.id),n=t.barWidth,a=this.visibleRangeIndices("xValue",t.xAxis.range);let r=a[0],o=a[1];this.processedData.input.count<1e3&&(r=0,o=this.processedData.input.count);for(let l=r;l=t.labels.length&&t.labels.push(a);else{const o=this.createNodeDatum(t,e);o.nodeData&&(t.nodes.push(o.nodeData),t.labels.push(o.nodeData)),r=o.phantomNodeData}if(t.nodeIndex++,!s)return{nodeData:t.nodes[t.nodeIndex]};if(n)r=t.phantomNodes[t.phantomIndex],this.updateNodeDatum(t,r,e);else if(r)t.phantomNodes.push(r);else{const o=this.createNodeDatum(t,e);o.phantomNodeData&&t.phantomNodes.push(o.phantomNodeData)}return t.phantomIndex++,{nodeData:a,phantomNodeData:r}}populateNodeData(t){const e=s=>this.computeXPosition(t,s),i={nodeDatumScratch:{datum:void 0,xValue:void 0,yRawValue:0,yFilterValue:void 0,labelText:void 0,inset:!1,isPositive:!1,precomputedBottomY:void 0,precomputedIsUpward:void 0},datumIndex:0,x:0,width:0,yStart:0,yEnd:0,yRange:0,featherRatio:0,opacity:1};t.dataAggregationFilter!=null?this.createNodeDataWithAggregation(t,e,i):this.processedData.type==="grouped"?this.createNodeDataGrouped(t,e,i):this.createNodeDataSimple(t,e,i)}initializeResult(t){return{itemId:this.properties.yKey,nodeData:t.nodes,phantomNodeData:t.phantomNodes,labelData:t.labels,scales:this.calculateScaling(),visible:this.visible||t.animationEnabled,groupScale:this.getScaling(this.ctx.seriesStateManager.getGroupScale(this)),styles:$u(this.getItemStyle.bind(this)),segments:void 0}}finalizeNodeData(t){t.canIncrementallyUpdate&&(this.trimIncrementalNodeArray(t.nodes,t.nodeIndex),this.trimIncrementalNodeArray(t.phantomNodes,t.phantomIndex),this.trimIncrementalNodeArray(t.labels,t.nodes.length))}assembleResult(t,e){return e.segments=Hh(this.properties.segmentation,t.xAxis,t.yAxis,this.chart.seriesRect,this.ctx.scene),e}nodeFactory(){return new qf}updateSeriesSelections(){super.updateSeriesSelections(),this.phantomSelection=this.updateDatumSelection({nodeData:this.contextNodeData?.phantomNodeData??[],datumSelection:this.phantomSelection})}updateHighlightSelectionItem(t){const e=super.updateHighlightSelectionItem(t),i=this.ctx.highlightManager?.getActiveHighlight(),n=this.isSeriesHighlighted(i)&&i?.datum?i:void 0;return this.phantomHighlightSelection=this.updateDatumSelection({nodeData:n?this.getHighlightData(this.contextNodeData?.phantomNodeData??[],n)??[]:[],datumSelection:this.phantomHighlightSelection}),e}updateNodes(t,e){super.updateNodes(t,e),this.updateDatumNodes({datumSelection:this.phantomSelection,isHighlight:!1,drawingMode:"overlay"}),this.updateDatumNodes({datumSelection:this.phantomHighlightSelection,isHighlight:!0,drawingMode:"overlay"})}getHighlightData(t,e){const i=t.find(s=>s.datum===e.datum);return i==null?void 0:[{...i}]}updateDatumSelection(t){return Mi(this.processedData)?t.datumSelection.update(t.nodeData,void 0,this.getDatumId.bind(this)):t.datumSelection.update(t.nodeData)}makeStylerParams(t){const{id:e}=this,{cornerRadius:i,fill:s,fillOpacity:n,lineDash:a,lineDashOffset:r,stackGroup:o,stroke:l,strokeOpacity:c,strokeWidth:h,xKey:d,yKey:u}=this.properties,p=ur(t??0);return{cornerRadius:i,fill:s,fillOpacity:n,highlightState:p,lineDash:a,lineDashOffset:r,seriesId:e,stackGroup:o,stroke:l,strokeOpacity:c,strokeWidth:h,xKey:d,yKey:u}}makeItemStylerParams(t,e,i,s,n,a){const{id:r}=this,{xKey:o,yKey:l,stackGroup:c}=this.properties,h=e.dataSources.get(r)?.data?.[i],d=t.resolveColumnById(this,"yValue-raw",e)[i],u=t.getDomain(this,"xValue","key",e).domain,p=t.getDomain(this,this.yCumulativeKey(t),"value",e).domain,g=this.ctx.highlightManager?.getActiveHighlight(),f=this.getHighlightStateString(g,n,i),m=this.filterItemStylerFillParams(a.fill)??a.fill;return{seriesId:r,...Wu(s,d,o,l,u,p),datum:h,xValue:s,yValue:d,stackGroup:c,highlightState:f,...a,fill:m}}getStyle(t,e){const{cornerRadius:i,fill:s,fillOpacity:n,lineDash:a,lineDashOffset:r,stroke:o,strokeOpacity:l,strokeWidth:c,styler:h}=this.properties;let d={};if(!t&&h){const u=this.makeStylerParams(e);d=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(h,u)??{},{pick:!1})??{}}return{cornerRadius:d.cornerRadius??i,fill:d.fill??s,fillOpacity:d.fillOpacity??n,lineDash:d.lineDash??a,lineDashOffset:d.lineDashOffset??r,opacity:1,stroke:d.stroke??o,strokeOpacity:d.strokeOpacity??l,strokeWidth:d.strokeWidth??c}}getItemStyle(t,e,i){const{properties:s,dataModel:n,processedData:a}=this,{itemStyler:r,simpleItemStyler:o}=s,l=this.getHighlightStyle(e,t,i);if(o&&a!=null&&t!=null){const h=a.dataSources.get(this.id)?.data?.[t],d=o(h);return Xf(d,l,this.getStyle(!1,i))}let c=Xf(l,this.getStyle(t===void 0,i));if(r&&n!=null&&a!=null&&t!=null){const h=n.resolveKeysById(this,"xValue",a)[t],d=this.cachedDatumCallback(yt(this.getDatumId({xValue:h,phantom:!1}),e?"highlight":"node"),()=>{const u=this.makeItemStylerParams(n,a,t,h,e,c);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(r,u))});d&&(c=Xf(d,c))}return c}updateDatumStyles(t){const e=this.ctx.highlightManager.getActiveHighlight(),i=this;function s(n,a){if(!t.datumSelection.isGarbage(n)){const r=i.getHighlightState(e,t.isHighlight,a.datumIndex);a.style=i.getItemStyle(a.datumIndex,t.isHighlight,r)}}t.datumSelection.each(s)}updateDatumNodes(t){const{contextNodeData:e}=this;if(!e)return;const i=this.ctx.highlightManager.getActiveHighlight(),{shadow:s}=this.properties,n=this.getCategoryDirection()===_n.X,a=this.getShapeFillBBox(),r=this.getBarDirection(),{drawingMode:o,isHighlight:l}=t,c=this,h=e.styles;function d(u,p){const g=p.style??h[c.getHighlightState(i,l,p.datumIndex)];u.setStyleProperties(g,a);const f=g.cornerRadius??0,m=n?(p.clipBBox?.width??p.width)>0:(p.clipBBox?.height??p.height)>0;u.setStaticProperties(o,p.topLeftCornerRadius?f:0,p.topRightCornerRadius?f:0,p.bottomRightCornerRadius?f:0,p.bottomLeftCornerRadius?f:0,m,p.crisp,s,r,p.featherRatio)}t.datumSelection.each(d)}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e,i=>{i.pointerEvents=1})}updateLabelNodes(t){const{isHighlight:e=!1}=t,i={xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xKey,yKey:this.properties.yKey,yName:this.properties.yName??this.properties.yKey,legendItemName:this.properties.legendItemName??this.properties.xName??this.properties.xKey},s=this.ctx.highlightManager?.getActiveHighlight();t.labelSelection.each((n,a)=>{n.fillOpacity=this.getHighlightStyle(e,a?.datumIndex).opacity??1,cD(this,n,i,this.properties.label,a.label,e,s)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{xKey:a,xName:r,yKey:o,yName:l,legendItemName:c,stackGroup:h,tooltip:d}=n,u=n.allowNullKeys??!1,p=this.getCategoryAxis(),g=this.getValueAxis();if(!i||!s||!p||!g)return;const f=s.dataSources.get(this.id)?.data?.[t],m=i.resolveKeysById(this,"xValue",s)[t],b=i.resolveColumnById(this,"yValue-raw",s)[t];if(m===void 0&&!u)return;const x=this.getItemStyle(t,!1);return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(p,"tooltip",m,f,a,c,u),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:o,value:this.getAxisValueText(g,"tooltip",b,f,o,c),missing:ga(b)}]},{seriesId:e,datum:f,title:l,xKey:a,xName:r,yKey:o,yName:l,legendItemName:c,stackGroup:h,...x,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:t,stroke:e,strokeWidth:i,fillOpacity:s,strokeOpacity:n,lineDash:a,lineDashOffset:r}=this.getStyle(!1,0);return{marker:{fill:t??"rgba(0, 0, 0, 0)",stroke:e??"rgba(0, 0, 0, 0)",fillOpacity:s,strokeOpacity:n,strokeWidth:i,lineDash:a,lineDashOffset:r}}}getLegendData(t){const{showInLegend:e}=this.properties;if(t!=="category")return[];const{id:i,ctx:{legendManager:s},visible:n}=this,{yKey:a,yName:r,legendItemName:o}=this.properties;return[{legendType:"category",id:i,itemId:a,seriesId:i,enabled:n&&s.getItemEnabled({seriesId:i,itemId:a}),label:{text:o??r??a},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!e}]}resetDatumAnimation(t){id([t.datumSelection,this.phantomSelection])}animateReadyHighlight(t){id([t,this.phantomHighlightSelection])}animateEmptyUpdateReady({datumSelection:t,labelSelection:e,annotationSelections:i}){const{phantomSelection:s}=this,n=Ol(wl(this.isVertical(),this.axes,"normal"),"unknown");Ee(this.id,"nodes",this.ctx.animationManager,[t,s],n),Te(this,"labels",this.ctx.animationManager,e),Te(this,"annotations",this.ctx.animationManager,...i)}animateWaitingUpdateReady(t){const{phantomSelection:e}=this,{datumSelection:i,labelSelection:s,annotationSelections:n,contextData:a,previousContextData:r}=t;this.ctx.animationManager.stopByAnimationGroupId(this.id);const o=QD(this.id,i,this.getDatumId.bind(this),t.contextData,r,this.processedData,this.processedDataUpdated),l=r==null?"fade":"normal",c=Ol(wl(this.isVertical(),this.axes,l),"added");Ee(this.id,"nodes",this.ctx.animationManager,[i,e],c,(h,d)=>this.getDatumId(d),o),(!o||o?.changed||!x3(a.groupScale,r?.groupScale))&&(Te(this,"labels",this.ctx.animationManager,s),Te(this,"annotations",this.ctx.animationManager,...n))}getDatumId(t){return yt(t.xValue,t.phantom)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){const e=this.contextNodeData?.nodeData[t].clipBBox;return nf(this,e)}hasItemStylers(){return this.properties.styler!=null||this.properties.itemStyler!=null||this.properties.simpleItemStyler!=null||this.properties.label.itemStyler!=null}};tm.className="BarSeries",tm.type="bar";var k3={series:{direction:"vertical",fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",l3],["image",c3],["pattern",h3]]},stroke:{$palette:"stroke"},fillOpacity:1,strokeWidth:{$isUserOption:["./stroke",2,0]},lineDash:[0],lineDashOffset:0,label:{...d3,padding:{$isUserOption:["./spacing",0,8]},enabled:!1,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$if:[{$or:[{$eq:[{$path:"./placement"},"outside-start"]},{$eq:[{$path:"./placement"},"outside-end"]}]},{$ref:"textColor"},{$ref:"chartBackgroundColor"}]},placement:"inside-center"},shadow:{enabled:!1,color:r3,xOffset:3,yOffset:3,blur:5},highlight:u3,segmentation:p3}},AA={type:"series",name:"bar",chartType:"cartesian",stackable:!0,groupable:!0,version:me,dependencies:[Ii],options:Fr,predictAxis:Dl,defaultAxes:o3,axisKeys:{[Dd.X]:"xKeyAxis",[Dd.Y]:"yKeyAxis"},axisKeysFlipped:{[Dd.X]:"yKeyAxis",[Dd.Y]:"xKeyAxis"},themeTemplate:k3,create:t=>new tm(t)};import{CARTESIAN_AXIS_TYPE as CA,CARTESIAN_POSITION as TA,ChartAxisDirection as LA,FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS as w3,FILL_IMAGE_DEFAULTS as O3,FILL_PATTERN_DEFAULTS as E3,LABEL_BOXING_DEFAULTS as R3,MULTI_SERIES_HIGHLIGHT_STYLE as P3}from"ag-charts-core";import{ChartAxisDirection as Rt,cachedTextMeasurer as _3,clamp as F3,dateToNumber as Md,extent as V3,formatValue as NA,isArray as B3,measureTextSegments as z3,rescaleVisibleRange as kA,toPlainText as G3}from"ag-charts-core";import{aggregationDomain as wA,aggregationXRatioForXValue as po,clamp as U3}from"ag-charts-core";var Ad=3,H3=5,OA=.05;function j3(t,e,i){const{xValues:s,yValues:n,xDomain:a,yDomain:r,xNeedsValueOf:o,yNeedsValueOf:l}=t,{x0:c,y0:h,x1:d,y1:u}=i;let p=0,g=1/0;const f=(c+d)/2,m=(h+u)/2;for(const b of e){const x=s[b],v=n[b];if(x==null||v==null)continue;const S=po(x,a.min,a.max,o),I=po(v,r.min,r.max,l),M=(S-f)**2+(I-m)**2;M=c&&b<=d&&x>=h&&x<=u&&(p+=1)}return p}function Y3(t,e,i){const{xValues:s,yValues:n,xDomain:a,yDomain:r,xNeedsValueOf:o,yNeedsValueOf:l}=t,{x0:c,y0:h,x1:d,y1:u}=i,p=[{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]}],g=(c+d)/2,f=(h+u)/2;for(const b of e){const x=s[b],v=n[b];if(x==null||v==null)continue;const S=po(x,a.min,a.max,o),I=po(v,r.min,r.max,l),M=(S>g?1:0)+(I>f?2:0),D=p[M];D.indices.push(b),D.x0=Math.min(D.x0,S),D.y0=Math.min(D.y0,I),D.x1=Math.max(D.x1,S),D.y1=Math.max(D.y1,I)}const m=[];for(const b of p){const{indices:x,x0:v,x1:S,y0:I,y1:M}=b;if(x.length===0)continue;const D=im(t,x,{x0:v,y0:I,x1:S,y1:M});m.push(D)}return m}function im(t,e,i){const{x0:s,y0:n,x1:a,y1:r}=i;let l=e.lengthd){const b=Array.from({length:Ad},()=>[]);for(let x=0;x=0&&IS),x=im(f,b,{x0:0,y0:0,x1:1,y1:1});x!=null&&m.push({sizeRatio:0,node:x})}return m.length>0?{xValues:i,yValues:s,xd0:o,xd1:l,yd0:c,yd1:h,filters:m,xNeedsValueOf:p,yNeedsValueOf:g}:void 0}function K3(t,e,i,s,n,a,r,o,l,c){const[h,d]=wA(t,a),[u,p]=wA(e,r);return $3([h,d],[u,p],i,s,n,[o[0],o[1]],{xNeedsValueOf:l,yNeedsValueOf:c})}function Z3(t,e,i,s,n,a,r){const o=i.resolveColumnById(r,"xValue",s),l=i.resolveColumnById(r,"yValue",s),c=a?i.resolveColumnById(r,"sizeValue",s):void 0,h=i.getDomain(r,"xValue","value",s),d=i.getDomain(r,"yValue","value",s),u=a?n.domain:[0,0],p=i.resolveColumnNeedsValueOf(r,"xValue",s),g=i.resolveColumnNeedsValueOf(r,"yValue",s);return K3(t,e,o,l,c,h,d,u,p,g)}function EA(t,e,i,s,n,a){const{xRange:r,yRange:o,xVisibleRange:[l,c],yVisibleRange:[h,d],minSize:u,maxSize:p}=i,{xValues:g,yValues:f,xd0:m,xd1:b,yd0:x,yd1:v,xNeedsValueOf:S,yNeedsValueOf:I}=e,M=1/Math.min(r/(c-l),o/(d-h)),D={xValues:g,yValues:f,xDomain:{min:m,max:b},yDomain:{min:x,max:v},xNeedsValueOf:S,yNeedsValueOf:I};for(const{sizeRatio:A,node:C}of e.filters){const T=.5*(u+A*(p-u)),L=T*M,k=t*L,O=l-T/r,N=c+T/r,w=h-T/o,R=d+T/o,F=[C];for(;F.length>0;){const E=F.pop();if(!(E.x1N||E.y1R))if(t!==1&&E.scale<=k)s!=null&&(s.count+=1),n?.push({datumIndex:E.primaryDatumIndex,count:E.indices.length,area:(E.x1-E.x0)*(E.y1-E.y0),dilation:U3(1,E.scale/L,t)});else if(E.children==null){const{indices:V}=E;if(s!=null){const Y=E.x0>=l&&E.x1<=c&&E.y0>=h&&E.y1<=d?V.length:W3(D,V,{x0:l,y0:h,x1:c,y1:d});s.count+=Y}a?.push(...V)}else F.push(...E.children)}}}function Cd(t,e,i){const s={count:0};return EA(t,e,i,s,void 0,void 0),s.count}var X3=100,q3=12;function J3(t,e,i){if(Cd(1,t,e)<=i)return 1;let s=1,n=2;for(;Cd(n,t,e)>i&&ni?s=r:n=r}return(s+n)/2}function Q3(t,e,i){const s=[],n=[];return EA(t,e,i,void 0,s,n),{groupedAggregation:s,singleDatumIndices:n}}import{Property as Ct,ProxyProperty as Oi,SceneArrayChangeDetection as eY,SceneChangeDetection as tY}from"ag-charts-core";var sm=class extends zt{constructor(){super(...arguments),this.maxSize=30}};y([Ct,tY()],sm.prototype,"maxSize",2),y([Ct,eY()],sm.prototype,"domain",2);var RA=class extends li{constructor(){super(...arguments),this.placement="top"}};y([Ct],RA.prototype,"placement",2);var de=class extends Xi{constructor(){super(...arguments),this.label=new RA,this.tooltip=Ga(),this.maxRenderedItems=1/0,this.marker=new sm}};y([Ct],de.prototype,"xKey",2),y([Ct],de.prototype,"yKey",2),y([Ct],de.prototype,"sizeKey",2),y([Ct],de.prototype,"labelKey",2),y([Ct],de.prototype,"selectedKey",2),y([Ct],de.prototype,"xName",2),y([Ct],de.prototype,"yName",2),y([Ct],de.prototype,"sizeName",2),y([Ct],de.prototype,"labelName",2),y([Ct],de.prototype,"title",2),y([Oi("marker.shape")],de.prototype,"shape",2),y([Oi("marker.size")],de.prototype,"size",2),y([Oi("marker.maxSize")],de.prototype,"maxSize",2),y([Oi("marker.domain")],de.prototype,"domain",2),y([Oi("marker.fill")],de.prototype,"fill",2),y([Oi("marker.fillOpacity")],de.prototype,"fillOpacity",2),y([Oi("marker.stroke")],de.prototype,"stroke",2),y([Oi("marker.strokeWidth")],de.prototype,"strokeWidth",2),y([Oi("marker.strokeOpacity")],de.prototype,"strokeOpacity",2),y([Oi("marker.lineDash")],de.prototype,"lineDash",2),y([Oi("marker.lineDashOffset")],de.prototype,"lineDashOffset",2),y([Oi("marker.itemStyler")],de.prototype,"itemStyler",2),y([Ct],de.prototype,"styler",2),y([Ct],de.prototype,"label",2),y([Ct],de.prototype,"tooltip",2),y([Ct],de.prototype,"maxRenderedItems",2);var iY=class extends Ug{constructor(t,e,i,s){super(t,e,i,s),this.sizeKey=s.properties.sizeKey}},Td=class extends Tn{constructor(t){super({moduleCtx:t,propertyKeys:{...Jr,label:["labelKey"],size:["sizeKey"]},propertyNames:{...Qr,label:["labelName"],size:["sizeName"]},categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],datumSelectionGarbageCollection:!1,animationResetFns:{label:za,datum:sd},usesPlacedLabels:!0,clipFocusBox:!1}),this.NodeEvent=iY,this.properties=new de,this.dataAggregation=void 0,this.sizeScale=new Va,this.placedLabelData=[]}get pickModeAxis(){return"main-category"}get type(){return super.type}async processData(t){if(this.data==null||!this.visible)return;const e=this.axes[Rt.X]?.scale,i=this.axes[Rt.Y]?.scale,{xScaleType:s,yScaleType:n}=this.getScaleInformation({xScale:e,yScale:i}),a=this.sizeScale.type,{xKey:r,yKey:o,sizeKey:l,selectedKey:c,labelKey:h,marker:d}=this.properties,u=this.properties.allowNullKeys??!1,{dataModel:p,processedData:g}=await this.requestDataModel(t,this.data,{props:[ye(r,s,{id:"xValue",allowNullKey:u}),ye(o,n,{id:"yValue",allowNullKey:u}),...c==null?[]:[ye(c,"category",{id:"selectedValue"})],...l?[ye(l,a,{id:"sizeValue"})]:[],...h?[ye(h,"category",{id:"labelValue"})]:[]]}),f=l?p.resolveProcessedDataIndexById(this,"sizeValue"):void 0,m=d.domain?[d.domain[0],d.domain[1]]:void 0;this.sizeScale.domain=m??(f==null?void 0:g.domain.values[f])??[],this.dataAggregation=this.aggregateData(p,g),this.animationState.transition("updateData")}xCoordinateRange(t,e,i){const{properties:s,sizeScale:n}=this,{size:a,sizeKey:r}=s,o=this.axes[Rt.X].scale.convert(t),l=r==null?void 0:this.dataModel.resolveColumnById(this,"sizeValue",this.processedData),h=.5*(l==null?a:n.convert(l[i]))*e;return[o-h,o+h]}yCoordinateRange(t,e,i){const{properties:s,sizeScale:n}=this,{size:a,sizeKey:r}=s,o=this.axes[Rt.Y].scale.convert(t[0]),l=r==null?void 0:this.dataModel.resolveColumnById(this,"sizeValue",this.processedData),h=.5*(l==null?a:n.convert(l[i]))*e;return[o-h,o+h]}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return{domain:[]};const s={[Rt.X]:"xValue",[Rt.Y]:"yValue"},n=s[t],a=e.resolveProcessedDataDefById(this,n),r=e.getDomain(this,n,"value",i);if(a?.def.type==="value"&&a?.def.valueType==="category")return{domain:r.domain};const o=t===Rt.X?Rt.Y:Rt.X,l=s[o],c=this.domainForClippedRange(t,[n],l);return{domain:jt(V3(c))}}getSeriesRange(t,e){return this.domainForVisibleRange(Rt.Y,["yValue"],"xValue",e)}getVisibleItems(t,e,i){const{dataAggregation:s,axes:n}=this,a=n[Rt.X],r=n[Rt.Y];if(s==null||a==null||r==null)return this.countVisibleItems("xValue",["yValue"],t,e,i);const o=this.aggregationOptions(a,r,t,e??[0,1]);return Cd(0,s,o)}aggregateData(t,e){if(e.type==="grouped"||e.input.count<=this.properties.maxRenderedItems)return;const i=this.axes[Rt.X],s=this.axes[Rt.Y];if(i==null||s==null)return;const n=i.scale,a=s.scale;if(!(!re.is(n)||!re.is(a)))return Z3(n.type,a.type,t,e,this.sizeScale,this.properties.sizeKey!=null,this)}aggregationOptions(t,e,i=t.visibleRange,s=e.visibleRange){const{processedData:n,dataModel:a}=this,{sizeKey:r}=this.properties,[o,l]=this.getSizeRange(),c=Math.abs(t.range[1]-t.range[0]),h=Math.abs(e.range[1]-e.range[0]),d=Math.max(o,1),u=r?Math.max(l,1):d,p=t.scale,g=e.scale;return n!=null&&a!=null&&(re.is(p)&&(i=kA(i,p.domain.map(Md),a.getDomain(this,"xValue","value",n).domain.map(Md))),re.is(g)&&(s=kA(s,g.domain.map(Md),a.getDomain(this,"yValue","value",n).domain.map(Md)))),{xRange:c,yRange:h,minSize:d,maxSize:u,xVisibleRange:i,yVisibleRange:s}}createNodeDatumContext(t,e){const{dataModel:i,processedData:s,sizeScale:n,visible:a}=this;if(!i||!s)return;const r=s.dataSources.get(this.id)?.data;if(r==null)return;const{xKey:o,yKey:l,sizeKey:c,selectedKey:h,labelKey:d,xName:u,yName:p,sizeName:g,labelName:f,label:m,legendItemName:b,marker:x}=this.properties,v=t.scale,S=e.scale,I=s.changeDescription!=null&&this.contextNodeData?.nodeData!=null;let M;d?M=[]:c?M=i.getDomain(this,"sizeValue","value",s).domain:M=[];const D=i.resolveColumnById(this,"xValue",s);return{xAxis:t,yAxis:e,rawData:r,xValues:D,xDataValues:D,yDataValues:i.resolveColumnById(this,"yValue",s),sizeDataValues:c==null?void 0:i.resolveColumnById(this,"sizeValue",s),labelDataValues:d==null?void 0:i.resolveColumnById(this,"labelValue",s),selectedDataValues:h==null?void 0:i.resolveColumnById(this,"selectedValue",s),xScale:v,yScale:S,sizeScale:n,xOffset:(v.bandwidth??0)/2,yOffset:(S.bandwidth??0)/2,xKey:o,yKey:l,sizeKey:c,labelKey:d,xName:u,yName:p,sizeName:g,labelName:f,legendItemName:b,labelsEnabled:m.enabled,labelPlacement:m.placement,labelAnchor:We.anchor(x.shape),labelTextDomain:M,labelPadding:gr(m),labelTextMeasurer:_3(m),label:m,animationEnabled:!this.ctx.animationManager.isSkipped(),visible:a,canIncrementallyUpdate:I,nodes:I?this.contextNodeData.nodeData:[],nodeIndex:0}}populateNodeData(t){this.sizeScale.range=this.getSizeRange();const e={datum:void 0,xDatum:void 0,yDatum:void 0,sizeValue:void 0,x:0,y:0,selected:void 0,nodeLabel:{text:"",width:0,height:0},markerSize:0,count:1,dilation:1,area:0},{dataAggregation:i}=this;i==null?this.createNodeDataSimple(t,e):this.createNodeDataWithAggregation(t,e,t.xAxis,t.yAxis,i)}initializeResult(t){const{marker:e}=this.properties;return{itemId:t.yKey,nodeData:t.nodes,labelData:t.labelsEnabled?t.nodes:[],scales:this.calculateScaling(),visible:this.visible||t.animationEnabled,styles:rd(this,this.properties,e)}}upsertBubbleNodeDatum(t,e,i){this.prepareNodeDatumState(t,e,i)&&af(t,{scratch:e,datumIndex:i},(s,n)=>{const a=this.createSkeletonNodeDatum(s,n.scratch,n.datumIndex);return this.updateNodeDatum(s,a,n.scratch,n.datumIndex),a},(s,n,a)=>this.updateNodeDatum(s,n,a.scratch,a.datumIndex))}createNodeDataSimple(t,e){const i=t.rawData.length;for(let s=0;syt(a.xValue,a.yValue,a.sizeValue,G3(a.label.text))),i.update(e,void 0,n)}updateDatumStyles(t){const{datumSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,sizeKey:a,labelKey:r,marker:o}=this.properties,l={xKey:s,yKey:n,sizeKey:a,labelKey:r},c=this.ctx.highlightManager.getActiveHighlight();e.each((h,d)=>{if(!e.isGarbage(h)){const u=this.getHighlightState(c,t.isHighlight,d.datumIndex),p=this.getStyle(u);d.style=this.getMarkerStyle(o,d,l,{isHighlight:i,highlightState:u,resolveMarkerSubPath:[]},p)}})}updateDatumNodes(t){const{contextNodeData:e}=this;if(!e)return;const{datumSelection:i,isHighlight:s,drawingMode:n}=t;this.sizeScale.range=this.getSizeRange();const a=this.getShapeFillBBox(),r=this.dataAggregation!=null,o=this.ctx.highlightManager.getActiveHighlight();i.each((l,c,h)=>{const{point:{size:d},count:u,area:p,dilation:g}=c,f=this.getHighlightState(o,s,c.datumIndex),m={...c.style??e.styles[f]};if(m.size=d,g>1){const b=m.fillOpacity??0,x=.269669+683e-6*u+-37.534348*p+.004449*u*p+-0*u**2+44.428603*p**2;m.fillOpacity=F3(b/g,b/.1*x,1)}this.applyMarkerStyle(m,l,c.point,a,{selected:c.selected}),l.drawingMode=this.resolveMarkerDrawingModeForState(n,m),l.zIndex=r?[-u,h]:0}),s||this.properties.marker.markClean()}updatePlacedLabelData(t){this.placedLabelData=t,this.labelSelection.update(t.map(e=>({...e.datum,point:{x:e.x,y:e.y,size:e.datum.point.size}})),e=>{e.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.updateHighlightLabelSelection()}updateHighlightLabelSelection(){const t=this.ctx.highlightManager?.getActiveHighlight(),e=this.isSeriesHighlighted(t)&&t?.datum?t:void 0,i=e==null?[]:this.placedLabelData.filter(s=>s.datum.datumIndex===e.datumIndex).map(s=>({...s.datum,point:{x:s.x,y:s.y,size:s.datum.point.size}}));this.highlightLabelSelection=this.updateLabelSelection({labelData:i,labelSelection:this.highlightLabelSelection})??this.highlightLabelSelection,this.highlightLabelGroup.visible=i.length>0,this.highlightLabelGroup.batchedUpdate(()=>{this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})})}updateLabelNodes(t){const{isHighlight:e=!1}=t,i=this.ctx.highlightManager?.getActiveHighlight(),s=this.makeLabelFormatterParams();t.labelSelection.each((n,a)=>{const r=Ba(this,a,s,this.properties.label,e,i);n.text=a.label.text,n.fill=r.color,n.x=a.point?.x??0,n.y=a.point?.y??0,n.fontStyle=r.fontStyle,n.fontWeight=r.fontWeight,n.fontSize=r.fontSize,n.fontFamily=r.fontFamily,n.textBaseline="top",n.fillOpacity=this.getHighlightStyle(e,a.datumIndex).opacity??1,n.setBoxing(r)})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e,s=>{s.pointerEvents=1})}makeStylerParams(t){const{id:e,properties:{size:i,maxSize:s,shape:n,fill:a,fillOpacity:r,lineDash:o,lineDashOffset:l,stroke:c,strokeOpacity:h,strokeWidth:d,xKey:u,yKey:p,sizeKey:g,labelKey:f}}=this,m=ur(t??0);return this.type==="bubble"?{highlightState:m,size:i,maxSize:s,shape:n,fill:a,fillOpacity:r,lineDash:o,lineDashOffset:l,seriesId:e,sizeKey:g,stroke:c,strokeOpacity:h,strokeWidth:d,xKey:u,yKey:p,labelKey:f}:this.type==="scatter"?{highlightState:m,size:i,shape:n,fill:a,fillOpacity:r,lineDash:o,lineDashOffset:l,seriesId:e,stroke:c,strokeOpacity:h,strokeWidth:d,xKey:u,yKey:p,labelKey:f}:this.type}makeLabelFormatterParams(){const{xKey:t,xName:e,yKey:i,yName:s,sizeKey:n,sizeName:a,labelKey:r,labelName:o,legendItemName:l}=this.properties;return{xKey:t,xName:e,yKey:i,yName:s,sizeKey:n,sizeName:a,labelKey:r,labelName:o,legendItemName:l}}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a,ctx:r}=this,{formatManager:o}=r,{xKey:l,xName:c,yKey:h,yName:d,sizeKey:u,sizeName:p,labelKey:g,labelName:f,title:m,tooltip:b,marker:x,legendItemName:v}=a,S=n[Rt.X],I=n[Rt.Y];if(!i||!s||!S||!I)return;const M=s.dataSources.get(this.id)?.data?.[t],D=i.resolveColumnById(this,"xValue",s)[t],A=i.resolveColumnById(this,"yValue",s)[t],C=this.properties.allowNullKeys??!1;if(D===void 0&&!C)return;const T=[];if(this.isLabelEnabled()&&g!=null){const k=i.resolveColumnById(this,"labelValue",s)[t],O=o.format(this.callWithContext.bind(this),{type:"category",value:k,datum:M,seriesId:e,legendItemName:v,key:g,source:"tooltip",property:"label",domain:[],boundSeries:this.getFormatterContext("label")});T.push({label:f,fallbackLabel:g,value:O??NA(k)})}if(T.push({label:c,fallbackLabel:l,value:this.getAxisValueText(S,"tooltip",D,M,l,v,C),missing:ga(D,C)},{label:d,fallbackLabel:h,value:this.getAxisValueText(I,"tooltip",A,M,h,v,C),missing:ga(A,C)}),u!=null){const k=i.resolveColumnById(this,"sizeValue",s)[t];if(k!=null){const O=i.getDomain(this,"sizeValue","value",s).domain,N=o.format(this.callWithContext.bind(this),{type:"number",value:k,datum:M,seriesId:e,legendItemName:v,key:u,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:O,fractionDigits:void 0,visibleDomain:void 0});T.push({label:p,fallbackLabel:u,value:N??NA(k)})}}const L=this.getMarkerStyle(x,{datum:M,datumIndex:t},{xKey:l,yKey:h,sizeKey:u,labelKey:g},{resolveMarkerSubPath:[]});return this.formatTooltipWithContext(b,{title:m,symbol:this.legendItemSymbol(),data:T},{seriesId:e,datum:M,title:h,xKey:l,xName:c,yKey:h,yName:d,sizeKey:u,sizeName:p,labelKey:g,labelName:f,legendItemName:v,...L,...this.getModuleTooltipParams()})}legendItemSymbol(){const t=this.getStyle();return{marker:this.getMarkerStyle(this.properties.marker,{},void 0,{isHighlight:!1,checkForHighlight:!1,resolveMarkerSubPath:[]},t)}}getLegendData(){const{id:t,ctx:{legendManager:e},visible:i}=this,{yKey:s,yName:n,legendItemName:a,title:r,showInLegend:o}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:i&&e.getItemEnabled({seriesId:t,itemId:s}),label:{text:a??r??n??s},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!o}]}animateEmptyUpdateReady({datumSelection:t,labelSelection:e}){xj(this,this.ctx.animationManager,t),Te(this,"labels",this.ctx.animationManager,e)}resetDatumAnimation(t){nd([t.datumSelection])}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new We}getStyle(t){const{properties:e}=this;let i={};if(e.styler){const s=this.makeStylerParams(t),n=this.cachedCallWithContext(e.styler,s)??{};i=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],n,{pick:!1})??{}}return{fill:i.fill??e.fill,fillOpacity:i.fillOpacity??e.fillOpacity,lineDash:i.lineDash??e.lineDash,lineDashOffset:i.lineDashOffset??e.lineDashOffset,shape:i.shape??e.shape,size:i.size??e.size,maxSize:i.maxSize??e.maxSize,stroke:i.stroke??e.stroke,strokeOpacity:i.strokeOpacity??e.strokeOpacity,strokeWidth:i.strokeWidth??e.strokeWidth}}getSizeRange(){const{size:t,maxSize:e}=this.getStyle();return[t,e]}getFormattedMarkerStyle(t){const{xKey:e,yKey:i,sizeKey:s,labelKey:n,marker:a}=this.properties;return this.getMarkerStyle(a,t,{xKey:e,yKey:i,sizeKey:s,labelKey:n},{resolveMarkerSubPath:[]})}computeFocusBounds(t){return ad(this,t)}hasItemStylers(){const{styler:t,itemStyler:e,marker:i,label:s}=this.properties;return!!(t??e??i.itemStyler??s.itemStyler)}initQuadTree(t){Xh(t,this.datumNodesIter())}pickNodeDataClosestDatum(t){return qh(this,t)}};Td.className="BubbleSeries",Td.type="bubble";var sY={series:{shape:"circle",size:7,maxSize:30,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",w3],["image",O3],["pattern",E3]]},stroke:{$palette:"stroke"},fillOpacity:.8,maxRenderedItems:2e3,label:{...R3,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","nearest"]},"area"]},"nearest",{$path:["/tooltip/range","nearest"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:P3}},PA={type:"series",name:"bubble",chartType:"cartesian",version:me,dependencies:[Ii],options:J0,predictAxis:Pg,defaultAxes:{x:{type:CA.NUMBER,position:TA.BOTTOM},y:{type:CA.NUMBER,position:TA.LEFT}},axisKeys:{[LA.X]:"xKeyAxis",[LA.Y]:"yKeyAxis"},themeTemplate:sY,create:t=>new Td(t)};import{CARTESIAN_AXIS_TYPE as _A,CARTESIAN_POSITION as FA,ChartAxisDirection as VA,DEFAULT_SHADOW_COLOUR as nY,FILL_GRADIENT_LINEAR_DEFAULTS as aY,FILL_IMAGE_DEFAULTS as rY,FILL_PATTERN_DEFAULTS as oY,LABEL_BOXING_DEFAULTS as lY,MULTI_SERIES_HIGHLIGHT_STYLE as cY}from"ag-charts-core";import{ChartAxisDirection as go,createTicks as hY,deepClone as dY,findMinMax as uY,isDate as pY,isNumber as BA,mergeDefaults as gY,tickStep as fY}from"ag-charts-core";import{Property as nt}from"ag-charts-core";var Je=class extends Xi{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.areaPlot=!1,this.aggregation="sum",this.shadow=new Is,this.label=new li,this.tooltip=Ga()}getStyle(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:r,cornerRadius:o}=this;return{fill:t,fillOpacity:e,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:r,cornerRadius:o,opacity:1}}};y([nt],Je.prototype,"xKey",2),y([nt],Je.prototype,"yKey",2),y([nt],Je.prototype,"xName",2),y([nt],Je.prototype,"yName",2),y([nt],Je.prototype,"fill",2),y([nt],Je.prototype,"fillOpacity",2),y([nt],Je.prototype,"stroke",2),y([nt],Je.prototype,"strokeWidth",2),y([nt],Je.prototype,"strokeOpacity",2),y([nt],Je.prototype,"lineDash",2),y([nt],Je.prototype,"lineDashOffset",2),y([nt],Je.prototype,"cornerRadius",2),y([nt],Je.prototype,"areaPlot",2),y([nt],Je.prototype,"bins",2),y([nt],Je.prototype,"aggregation",2),y([nt],Je.prototype,"binCount",2),y([nt],Je.prototype,"shadow",2),y([nt],Je.prototype,"label",2),y([nt],Je.prototype,"tooltip",2);var zA=10,nm=class extends Tn{constructor(t){super({moduleCtx:t,propertyKeys:Jr,propertyNames:Qr,categoryKey:void 0,pickModes:[1,0],datumSelectionGarbageCollection:!0,animationAlwaysPopulateNodeData:!0,alwaysClip:!0,animationResetFns:{datum:El,label:za}}),this.properties=new Je,this.calculatedBins=[]}get hasData(){return this.calculatedBins.length>0}deriveBins(t){const e=hY(t[0],t[1],zA).ticks,i=fY(t[0],t[1],zA),[s]=e,n=a=>[a,a+i];return[[s-i,s],...e.map(n)]}calculateNiceBins(t,e){const i=Math.floor(t[0]),s=t[1],n=e||1,{start:a,binSize:r}=this.calculateNiceStart(i,s,n);return this.getBins(a,s,r,n)}getBins(t,e,i,s){const n=[],a=this.calculatePrecision(i);for(let r=0;r0)for(;t<1;)e*=10,t*=10;return e}calculateNiceStart(t,e,i){const s=Math.abs(e-t)/i,n=Math.floor(Math.log10(s)),a=Math.pow(10,n);return{start:Math.floor(t/a)*a,binSize:s}}async processData(t){const{visible:e}=this,{xKey:i,yKey:s,areaPlot:n,aggregation:a}=this.properties,r=this.axes[go.X]?.scale,o=this.axes[go.Y]?.scale,{xScaleType:l,yScaleType:c}=this.getScaleInformation({yScale:o,xScale:r}),h=e?{}:{forceValue:0},d=[nn(i,l),YO];if(s){let x=Ib("groupAgg",{visible:e});a==="count"||(a==="sum"?x=Jw("groupAgg",{visible:e}):a==="mean"&&(x=eO("groupAgg",{visible:e}))),n&&(x=Db("groupAgg",x)),d.push(ye(s,c,{invalidValue:void 0,...h}),x)}else{d.push(UO("count"));let x=Ib("groupAgg",{visible:e});n&&(x=Db("groupAgg",x)),d.push(x)}let u=[];const p=x=>{const v=jt(x.domain.keys[0]);if(v.length===0)return x.domain.groups=[],()=>[];const S=BA(this.properties.binCount)?this.calculateNiceBins(v,this.properties.binCount):this.properties.bins??this.deriveBins(v),I=S.length;return u=[...S],M=>{let D=M[0];if(pY(D)&&(D=D.getTime()),!BA(D))return[];for(let A=0;A=C[0]&&D{const v=b.get(yt(...x));if(v){const{group:S,groupIndex:I}=v,[[M,D]=[0,0]]=S.aggregation,A=[...g.forEachDatum(this,m,S,I)],C=this.frequency(S),T=M+D;return{domain:x,datum:A,groupIndex:I,frequency:C,total:T}}else return{domain:x,datum:[],groupIndex:-1,frequency:0,total:0}}),this.animationState.transition("updateData")}xCoordinateRange(){return[Number.NaN,Number.NaN]}yCoordinateRange(){return[Number.NaN,Number.NaN]}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!e||!i||!this.calculatedBins.length)return{domain:[]};const s=i.getDomain(this,"groupAgg","aggregate",e).domain,n=this.calculatedBins[0].domain[0],a=this.calculatedBins[(this.calculatedBins?.length??0)-1].domain[1];return t===go.X?{domain:jt([n,a])}:{domain:jt(s)}}getSeriesRange(t,[e,i]){const{dataModel:s,processedData:n}=this;if(!s||n?.type!=="grouped")return[Number.NaN,Number.NaN];const a=this.axes[go.X].scale,r=0;let o=-1/0;for(const{keys:l,aggregation:c}of n.groups){const[[h,d]=[0,0]]=c,[u,p]=l,[g,f]=uY([a.convert(u),a.convert(p)]);if(f>=e&&g<=i){const m=h+d;o=Math.max(o,m)}}return r>o?[Number.NaN,Number.NaN]:[r,o]}frequency(t){return t.datumIndices.reduce((e,i)=>e+i.length,0)}createNodeDatumContext(t,e){const{xKey:i,yKey:s,xName:n,yName:a,label:r}=this.properties,{contextNodeData:o,processedData:l}=this,c=o?.nodeData!=null&&l?.changeDescription!=null;return{xAxis:t,yAxis:e,xScale:t.scale,yScale:e.scale,yAxisReversed:e.isReversed(),rawData:[],xValues:[],xKey:i,yKey:s,xName:n,yName:a,label:r,animationEnabled:!this.ctx.animationManager.isSkipped(),canIncrementallyUpdate:c,nodes:c?o.nodeData:[],nodeIndex:0}}createLabelData(t,e,i,s,n,a){const{label:r,yKey:o,xKey:l,xName:c,yName:h}=t,{total:d,datum:u}=e;if(!(!r.enabled||d===0))return{x:i+n/2,y:s+a/2,text:this.getLabelText(d,u,o,"y",[],r,{value:d,datum:u,xKey:l,yKey:o,xName:c,yName:h})}}createSkeletonNodeDatum(t,e){const{xKey:i,yKey:s}=t,{domain:n,datum:a,groupIndex:r,frequency:o,total:l}=e;return{series:this,datumIndex:r,datum:a,aggregatedValue:l,frequency:o,domain:n,yKey:s,xKey:i,x:0,y:0,xValue:0,yValue:0,width:0,height:0,midPoint:{x:0,y:0},topLeftCornerRadius:!1,topRightCornerRadius:!1,bottomRightCornerRadius:!1,bottomLeftCornerRadius:!1,label:void 0,crisp:!0}}updateNodeDatum(t,e,i){const{xScale:s,yScale:n,yAxisReversed:a}=t,{domain:r,datum:o,groupIndex:l,frequency:c,total:h}=i,d=e,[u,p]=r,g=s.convert(u),f=s.convert(p),m=n.convert(0),b=n.convert(h),x=Math.abs(f-g),v=Math.abs(b-m),S=Math.min(g,f),I=Math.min(m,b);d.datumIndex=l,d.datum=o,d.aggregatedValue=h,d.frequency=c,d.domain=r,d.x=S,d.y=I,d.xValue=g,d.yValue=b,d.width=x,d.height=v,d.midPoint?(d.midPoint.x=S+x/2,d.midPoint.y=I+v/2):d.midPoint={x:S+x/2,y:I+v/2},d.topLeftCornerRadius=!a,d.topRightCornerRadius=!a,d.bottomRightCornerRadius=a,d.bottomLeftCornerRadius=a,d.label=this.createLabelData(t,i,S,I,x,v)}createNodeDatum(t,e){const i=this.createSkeletonNodeDatum(t,e);return this.updateNodeDatum(t,i,e),i}populateNodeData(t){const{processedData:e}=this;if(e?.type==="grouped")for(const i of this.calculatedBins)af(t,i,(s,n)=>this.createNodeDatum(s,n),(s,n,a)=>this.updateNodeDatum(s,n,a))}initializeResult(t){return{itemId:this.properties.yKey??this.id,nodeData:t.nodes,labelData:t.nodes,scales:this.calculateScaling(),animationValid:!0,visible:this.visible||t.animationEnabled,styles:$u(this.getItemStyle.bind(this))}}finalizeNodeData(t){super.finalizeNodeData(t),t.nodes.sort((e,i)=>e.x-i.x)}nodeFactory(){return new He}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t;return Mi(this.processedData)?i.update(e,void 0,s=>yt(...s.domain)):i.update(e)}getItemStyle(t,e,i){const{properties:s}=this,n=this.getHighlightStyle(e,t,i);return gY(n,s.getStyle())}updateDatumStyles(t){const{datumSelection:e,isHighlight:i}=t;e.each((s,n)=>{e.isGarbage(s)||(n.style=this.getItemStyle(n.datumIndex,i))})}updateDatumNodes(t){const{contextNodeData:e}=this;if(!e)return;const i=this.ctx.highlightManager.getActiveHighlight(),{shadow:s}=this.properties,n=this.getShapeFillBBox();t.datumSelection.each((a,r)=>{const o=r.style??e.styles[this.getHighlightState(i,t.isHighlight,r.datumIndex)],{cornerRadius:l=0}=o,{topLeftCornerRadius:c,topRightCornerRadius:h,bottomRightCornerRadius:d,bottomLeftCornerRadius:u}=r;a.setStyleProperties(o,n),a.topLeftCornerRadius=c?l:0,a.topRightCornerRadius=h?l:0,a.bottomRightCornerRadius=d?l:0,a.bottomLeftCornerRadius=u?l:0,a.crisp=r.crisp,a.fillShadow=s})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e,s=>{s.pointerEvents=1,s.textAlign="center",s.textBaseline="middle"})}updateLabelNodes(t){const e=this.isLabelEnabled(),{isHighlight:i=!1}=t,s=this.ctx.highlightManager?.getActiveHighlight();t.labelSelection.each((n,a)=>{const r=Ba(this,a,this.properties,this.properties.label,i,s),{enabled:o,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d,color:u}=r;o&&e&&a?.label?(n.text=a.label.text,n.x=a.label.x,n.y=a.label.y,n.fontStyle=l,n.fontWeight=c,n.fontFamily=d,n.fontSize=h,n.fill=u,n.visible=!0,n.fillOpacity=this.getHighlightStyle(i,a.datumIndex).opacity??1,n.setBoxing(r)):n.visible=!1})}initQuadTree(t){const{value:e}=this.contentGroup.children().next();e instanceof U&&Xh(t,e.children())}pickNodeClosestDatum(t){return qh(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a,ctx:{localeManager:r}}=this,{xKey:o,xName:l,yKey:c,yName:h,tooltip:d,legendItemName:u}=a,p=n[go.X],g=n[go.Y];if(!i||s?.type!=="grouped"||!p||!g)return;const f=s.groups[t],{aggregation:m,keys:b}=f,[[x,v]=[0,0]]=m,S=this.frequency(f),I=b,[M,D]=I,A=x+v,C={data:[...i.forEachDatum(this,s,f,t)],aggregatedValue:A,frequency:S,domain:I},T=[{label:l,fallbackLabel:o,value:`${this.getAxisValueText(p,"tooltip",M,C,o,u)} - ${this.getAxisValueText(p,"tooltip",D,C,o,u)}`},{label:r.t("seriesHistogramTooltipFrequency"),value:this.getAxisValueText(g,"tooltip",S,C,c,u)}];if(c!=null){let L;switch(a.aggregation){case"sum":L=r.t("seriesHistogramTooltipSum",{yName:h??c});break;case"mean":L=r.t("seriesHistogramTooltipMean",{yName:h??c});break;case"count":L=r.t("seriesHistogramTooltipCount",{yName:h??c});break}T.push({label:L,value:this.getAxisValueText(g,"tooltip",A,C,c,u)})}return this.formatTooltipWithContext(d,{symbol:this.legendItemSymbol(),data:T},{seriesId:e,datum:C,title:h,xKey:o,xName:l,yKey:c,yName:h,xRange:[M,D],frequency:S,...this.getItemStyle(t,!1)})}legendItemSymbol(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:r}=this.properties;return{marker:{fill:dY(t)??"rgba(0, 0, 0, 0)",stroke:i??"rgba(0, 0, 0, 0)",fillOpacity:e,strokeOpacity:n,strokeWidth:s,lineDash:a,lineDashOffset:r}}}getLegendData(t){if(t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{xKey:n,yName:a,showInLegend:r}=this.properties;return[{legendType:"category",id:e,itemId:n,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:a??n??"Frequency"},symbol:this.legendItemSymbol(),hideInLegend:!r}]}resetDatumAnimation(t){id([t.datumSelection])}animateEmptyUpdateReady({datumSelection:t,labelSelection:e}){const i=Ol(wl(!0,this.axes,"normal"),"unknown");Ee(this.id,"datums",this.ctx.animationManager,[t],i),Te(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(t){const e=Ol(wl(!0,this.axes,"normal"),"added"),i={changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set};Ee(this.id,"datums",this.ctx.animationManager,[t.datumSelection],e,(s,n)=>yt(...n.domain),i),i?.changed&&Te(this,"labels",this.ctx.animationManager,t.labelSelection)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){return nf(this,this.contextNodeData?.nodeData[t])}hasItemStylers(){return this.properties.label.itemStyler!=null}};nm.className="HistogramSeries",nm.type="histogram";var mY={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",aY],["image",rY],["pattern",oY]]},stroke:{$palette:"stroke"},strokeWidth:1,fillOpacity:1,strokeOpacity:1,lineDash:[0],lineDashOffset:0,label:{...lY,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},shadow:{enabled:!1,color:nY,xOffset:3,yOffset:3,blur:5},highlight:cY}},GA={type:"series",name:"histogram",chartType:"cartesian",version:me,dependencies:[Ii],options:RB,predictAxis:Dl,defaultAxes:{x:{type:_A.NUMBER,position:FA.BOTTOM},y:{type:_A.NUMBER,position:FA.LEFT}},axisKeys:{[VA.X]:"xKeyAxis",[VA.Y]:"yKeyAxis"},themeTemplate:mY,create:t=>new nm(t)};import{CARTESIAN_AXIS_TYPE as UA,CARTESIAN_POSITION as HA,ChartAxisDirection as jA,FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS as yY,FILL_IMAGE_DEFAULTS as bY,FILL_PATTERN_DEFAULTS as xY,LABEL_BOXING_DEFAULTS as vY,MARKER_SERIES_HIGHLIGHT_STYLE as SY,SAFE_STROKE_FILL_OPERATION as IY,SEGMENTATION_DEFAULTS as DY}from"ag-charts-core";import{ChartAxisDirection as ti,DebugMetrics as MY,extent as AY,isDefined as CY,mergeDefaults as TY}from"ag-charts-core";import{AGGREGATION_INDEX_X_MAX as LY,AGGREGATION_INDEX_X_MIN as NY,AGGREGATION_INDEX_Y_MAX as kY,AGGREGATION_INDEX_Y_MIN as wY,AGGREGATION_MIN_RANGE as OY,AGGREGATION_THRESHOLD as WA,aggregationDomain as am,aggregationIndexForXRatio as EY,aggregationRangeFittingPoints as YA,aggregationXRatioForDatumIndex as RY,aggregationXRatioForXValue as PY,compactAggregationIndices as _Y,createAggregationIndices as $A,nextPowerOf2 as FY,simpleMemorize2 as VY}from"ag-charts-core";var BY=10;function Ld(t,e,i,s,n,a,r,o){const l=t[a];if(l===void 0)return!1;const c=Number.isFinite(e)?PY(l,e,i,r):RY(a,o),h=EY(c,n);return a===s[h+NY]||a===s[h+LY]||a===s[h+wY]||a===s[h+kY]}function KA(t,e,i,s,n,a,r,o){let l=0;for(let d=0;dm.maxRange===h);let{indexData:u,valueData:p}=$A(e,i,i,a,r,h,{xNeedsValueOf:o,yNeedsValueOf:l,reuseIndexData:d?.indexData,reuseValueData:d?.valueData}),g=KA(e,a,r,u,h,o,n,d?.indices);const f=[{maxRange:h,indices:g,indexData:u,valueData:p}];for(;g.length>BY&&h>64;){const m=h,b=Math.trunc(m/2),x=c?.find(S=>S.maxRange===b),v=_Y(u,p,m,{reuseIndexData:x?.indexData,reuseValueData:x?.valueData});h=v.maxRange,u=v.indexData,p=v.valueData,g=zY(g,e,a,r,u,h,o,n,x?.indices),f.push({maxRange:h,indices:g,indexData:u,valueData:p})}return f.reverse(),f}function GY(t,e,i,s){const n=e.length;if(nv.maxRange===u),{indexData:g,valueData:f}=$A(e,i,i,a,r,u,{xNeedsValueOf:o,yNeedsValueOf:l,reuseIndexData:p?.indexData,reuseValueData:p?.valueData}),m=KA(e,a,r,g,u,o,n,p?.indices),b={maxRange:u,indices:m,indexData:g,valueData:f};function x(){return rm([a,r],e,i,{xNeedsValueOf:o,yNeedsValueOf:l,existingFilters:h})?.filter(S=>S.maxRange!==u)??[]}return{immediate:[b],computeRemaining:x}}function UY(t,e,i,s,n,a){const[r,o]=am(t,s);return rm([r,o],e,i,{xNeedsValueOf:n,yNeedsValueOf:a})}var HY=VY(UY);function jY(t,e,i,s,n,a){const r=e.resolveColumnById(n,"xValue",i),o=e.resolveColumnById(n,s,i),l=e.getDomain(n,"xValue","value",i),c=e.resolveColumnNeedsValueOf(n,"xValue",i),h=e.resolveColumnNeedsValueOf(n,s,i);if(a){const[d,u]=am(t,l);return rm([d,u],r,o,{xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:a})}return HY(t,r,o,l,c,h)}function WY(t,e,i,s,n,a,r){const o=e.resolveColumnById(n,"xValue",i),l=e.resolveColumnById(n,s,i),c=e.getDomain(n,"xValue","value",i),h=e.resolveColumnNeedsValueOf(n,"xValue",i),d=e.resolveColumnNeedsValueOf(n,s,i),[u,p]=am(t,c);return GY([u,p],o,l,{xNeedsValueOf:h,yNeedsValueOf:d,targetRange:a,existingFilters:r})}import{InterpolationProperties as YY,Property as Qe}from"ag-charts-core";var Be=class extends Xi{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new YY,this.marker=new zt,this.label=new li,this.tooltip=Ga(),this.connectMissingData=!1,this.sparklineMode=!1}};y([Qe],Be.prototype,"xKey",2),y([Qe],Be.prototype,"yKey",2),y([Qe],Be.prototype,"xName",2),y([Qe],Be.prototype,"yName",2),y([Qe],Be.prototype,"selectedKey",2),y([Qe],Be.prototype,"stackGroup",2),y([Qe],Be.prototype,"normalizedTo",2),y([Qe],Be.prototype,"title",2),y([Qe],Be.prototype,"stroke",2),y([Qe],Be.prototype,"strokeWidth",2),y([Qe],Be.prototype,"strokeOpacity",2),y([Qe],Be.prototype,"lineDash",2),y([Qe],Be.prototype,"lineDashOffset",2),y([Qe],Be.prototype,"interpolation",2),y([Qe],Be.prototype,"styler",2),y([Qe],Be.prototype,"marker",2),y([Qe],Be.prototype,"label",2),y([Qe],Be.prototype,"tooltip",2),y([Qe],Be.prototype,"connectMissingData",2),y([Qe],Be.prototype,"sparklineMode",2);var om=class extends Tn{constructor(t){super({moduleCtx:t,propertyKeys:Jr,propertyNames:Qr,categoryKey:"xValue",pickModes:[2,1,0],datumSelectionGarbageCollection:!1,segmentedDataNodes:!1,animationResetFns:{path:uf({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:za,datum:(e,i)=>({...sd(e),...Pl(e,i)})},clipFocusBox:!1}),this.properties=new Be,this.aggregationManager=new cd}get pickModeAxis(){return this.properties.sparklineMode?"main":"main-category"}isNormalized(){return this.properties.normalizedTo!=null}renderToOffscreenCanvas(){return(this.contextNodeData?.nodeData?.length??0)>0&&this.getDrawingMode(!1)==="cutout"||super.renderToOffscreenCanvas()}async processData(t){if(this.data==null)return;const{data:e,visible:i,seriesGrouping:{groupIndex:s=this.id,stackCount:n=0}={}}=this,{xKey:a,yKey:r,selectedKey:o,connectMissingData:l,normalizedTo:c}=this.properties,h=this.axes[ti.X]?.scale,d=this.axes[ti.Y]?.scale,{isContinuousX:u,xScaleType:p,yScaleType:g}=this.getScaleInformation({xScale:h,yScale:d}),f=n>1||c!=null,m={invalidValue:null};l&&f&&(m.invalidValue=0),f&&!i&&(m.forceValue=0);const b={value:`area-stack-${s}-yValue`,marker:`area-stack-${s}-yValues-marker`},x=[],v=this.properties.allowNullKeys??!1;(!u||f)&&x.push(nn(a,p,{id:"xKey",allowNullKey:v})),x.push(ye(a,p,{id:"xValue",allowNullKey:v}),ye(r,g,{id:"yValueRaw",...m,invalidValue:void 0})),o!=null&&x.push(ye(o,"category",{id:"selectedRaw"})),f&&x.push(...sa(r,"normal",{id:"yValueCumulative",...m,groupId:b.marker},g)),CY(c)&&x.push(ye(r,g,{id:"yValue",...m,groupId:b.value}),Mc(Object.values(b),c)),this.needsDataModelDiff()&&(x.push(_o(u?["xValue"]:void 0)),this.processedData&&x.push(Cc(this.id,this.processedData)));const{dataModel:S,processedData:I}=await this.requestDataModel(t,e,{props:x,groupByKeys:f,groupByData:!f});this.aggregateData(S,I),this.animationState.transition("updateData")}yValueKey(){return this.isNormalized()?"yValue":"yValueRaw"}yCumulativeKey(t){return t.type==="grouped"?"yValueCumulative":this.yValueKey()}xCoordinateRange(t,e){const{marker:i}=this.properties,s=this.axes[ti.X].scale.convert(t),n=i.enabled?.5*i.size*e:0;return[s-n,s+n]}yCoordinateRange(t,e){const{marker:i}=this.properties,s=this.axes[ti.Y].scale.convert(t[0]),n=i.enabled?.5*i.size*e:0;return[s-n,s+n]}getSeriesDomain(t){const{dataModel:e,processedData:i,axes:s}=this;if(!e||!i)return{domain:[]};const n=s[ti.Y];if(t===ti.X){const r=e.resolveProcessedDataDefById(this,"xValue"),o=e.getDomain(this,"xValue","value",i);if(r?.def.type==="value"&&r.def.valueType==="category"){const l=e.getKeySortMetadata(this,"xValue",i);return{domain:o.domain,sortMetadata:l}}return{domain:jt(AY(o.domain))}}const a=this.domainForClippedRange(ti.Y,[this.yCumulativeKey(i)],"xValue");if(this.isNormalized()&&n instanceof vi&&!(n instanceof ho)){const r=Number.isFinite(a[1]-a[0])?[Math.min(a[0],0),Math.max(a[1],0)]:[];return{domain:jt(r)}}else return{domain:jt(a)}}getSeriesRange(t,e){return this.domainForVisibleRange(ti.Y,[this.yCumulativeKey(this.processedData)],"xValue",e)}getZoomRangeFittingItems(t,e,i){return this.zoomFittingVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],t,e,i)}getVisibleItems(t,e,i){return this.countVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],t,e,i)}aggregateData(t,e){if(this.aggregationManager.markStale(e.input.count),e.type!=="ungrouped"||Mi(e))return;const i=this.axes[ti.X];if(i==null)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>WY(i.scale.type,t,e,this.yCumulativeKey(e),this,s,a),computeFull:a=>jY(i.scale.type,t,e,this.yCumulativeKey(e),this,a),targetRange:s});const n=this.aggregationManager.filters;n&&n.length>0&&MY.record(`${this.type}:aggregation`,n.map(a=>a.maxRange))}estimateTargetRange(){const t=this.axes[ti.X];if(t?.scale?.range){const[e,i]=t.scale.range;return Math.abs(i-e)}return this.ctx.scene?.canvas?.width??800}createNodeDatumContext(t,e){const{dataModel:i,processedData:s}=this;if(!i||!s)return;const n=t.scale,a=e.scale,r=s.dataSources.get(this.id)?.data??[],[o,l]=n.range,c=Math.abs(l-o);this.aggregationManager.ensureLevelForRange(c);const h=this.aggregationManager.getFilterForRange(c),d=this.canIncrementallyUpdateNodes(h!=null);return{xAxis:t,yAxis:e,rawData:r,xValues:i.resolveColumnById(this,"xValue",s),yRawValues:i.resolveColumnById(this,"yValueRaw",s),yCumulativeValues:i.resolveColumnById(this,this.yCumulativeKey(s),s),selectionValues:this.properties.selectedKey?i.resolveColumnById(this,"selectedRaw",s):void 0,xScale:n,yScale:a,xOffset:(n.bandwidth??0)/2,yOffset:(a.bandwidth??0)/2,size:this.properties.marker.enabled?this.properties.marker.size:0,yDomain:this.getSeriesDomain(ti.Y).domain,labelsEnabled:this.properties.label.enabled,animationEnabled:!this.ctx.animationManager.isSkipped(),canIncrementallyUpdate:d,dataAggregationFilter:h,range:c,xKey:this.properties.xKey,yKey:this.properties.yKey,xName:this.properties.xName,yName:this.properties.yName,legendItemName:this.properties.legendItemName,connectMissingData:this.properties.connectMissingData,capDefaults:{lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},nodes:d?this.contextNodeData.nodeData:[],spanPoints:[],nodeIndex:0}}handleDatum(t,e,i){if(e.datum=t.rawData[i],e.xDatum=t.xValues[i],e.yDatum=t.yRawValues[i],e.yCumulative=t.yCumulativeValues[i],e.selected=t.selectionValues?.[i],e.x=t.xScale.convert(e.xDatum)+t.xOffset,e.y=t.yScale.convert(e.yCumulative)+t.yOffset,!!Number.isFinite(e.x)){if(e.yDatum!=null){const s=t.labelsEnabled?this.getLabelText(e.yDatum,e.datum,t.yKey,"y",t.yDomain,this.properties.label,{value:e.yDatum,datum:e.datum,xKey:t.xKey,yKey:t.yKey,xName:t.xName,yName:t.yName,legendItemName:t.legendItemName}):void 0;if(t.canIncrementallyUpdate&&t.nodeIndexArray.isArray(s)?kl(s,this.properties.interpolation):[]);return e.strokeData={itemId:t.yKey,spans:i},e.crossFiltering=this.properties.selectedKey!=null,e.segments=Hh(this.properties.segmentation,t.xAxis,t.yAxis,this.chart.seriesRect,this.ctx.scene,!1),e}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(t){const{paths:[e],visible:i,animationEnabled:s}=t,n=TY(this.getHighlightStyle(),this.getStyle()),{strokeWidth:a,stroke:r,strokeOpacity:o,lineDash:l,lineDashOffset:c,opacity:h}=n,d=this.contextNodeData?.segments;e.setProperties({segments:d,fill:void 0,lineJoin:"round",pointerEvents:1,opacity:h,stroke:r,strokeWidth:a,strokeOpacity:o,lineDash:l,lineDashOffset:c}),e.datum=d,s||(e.visible=i),od(this,e)}updateDatumSelection(t){let{nodeData:e}=t;const{datumSelection:i}=t,{contextNodeData:s,processedData:n,axes:a,properties:r}=this,{marker:o}=r;return e=s?.crossFiltering===!0||cf(n.input.count,a[ti.X].scale,o)?e:[],o.isDirty()&&(i.clear(),i.cleanup()),Mi(this.processedData)?i.update(e,void 0,c=>yt(c.xValue)):i.update(e)}updateDatumStyles(t){const{datumSelection:e,isHighlight:i}=t,{marker:s}=this.properties,n=this.ctx.highlightManager.getActiveHighlight();e.each((a,r)=>{if(!e.isGarbage(a)){const o=this.getHighlightState(n,t.isHighlight,r.datumIndex),l=this.getStyle(o),{stroke:c,strokeWidth:h,strokeOpacity:d}=l,u=this.makeItemStylerParams(this.dataModel,this.processedData,r.datumIndex,l.marker);r.style=this.getMarkerStyle(s,r,u,{isHighlight:i,highlightState:o},l.marker,{stroke:c,strokeWidth:h,strokeOpacity:d})}})}updateDatumNodes(t){const{contextNodeData:e}=this;if(!e)return;const{datumSelection:i,isHighlight:s}=t,n=this.ctx.animationManager.isSkipped(),a=this.getShapeFillBBox(),r=this.ctx.highlightManager.getActiveHighlight(),o=this.getDrawingMode(s,t.drawingMode);i.each((l,c)=>{const h=this.getHighlightState(r,s,c.datumIndex),d=c.style??e.styles[h];this.applyMarkerStyle(d,l,c.point,a,{applyTranslation:n,selected:c.selected}),l.drawingMode=this.resolveMarkerDrawingModeForState(o,d)}),s||this.properties.marker.markClean()}updateLabelSelection(t){return t.labelSelection.update(this.isLabelEnabled()?t.labelData:[])}updateLabelNodes(t){const{isHighlight:e=!1}=t,i=this.ctx.highlightManager?.getActiveHighlight(),s=this.makeLabelFormatterParams();t.labelSelection.each((n,a)=>{const r=Ba(this,a,s,this.properties.label,e,i),{enabled:o,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d,color:u}=r;o&&a?.labelText?(n.fontStyle=l,n.fontWeight=c,n.fontSize=h,n.fontFamily=d,n.textAlign="center",n.textBaseline="bottom",n.text=a.labelText,n.x=a.point.x,n.y=a.point.y-10,n.fill=u,n.visible=!0,n.fillOpacity=this.getHighlightStyle(e,a.datumIndex).opacity??1,n.setBoxing(r)):n.visible=!1})}makeStylerParams(t){const{id:e}=this,{marker:i,lineDash:s,lineDashOffset:n,stroke:a,strokeOpacity:r,strokeWidth:o,xKey:l,yKey:c}=this.properties,h=ur(t??0);return{marker:{fill:i.fill,fillOpacity:i.fillOpacity,size:i.size,shape:i.shape,stroke:i.stroke,strokeOpacity:i.strokeOpacity,strokeWidth:i.strokeWidth,lineDash:i.lineDash,lineDashOffset:i.lineDashOffset},highlightState:h,lineDash:s,lineDashOffset:n,seriesId:e,stroke:a,strokeOpacity:r,strokeWidth:o,xKey:l,yKey:c}}makeItemStylerParams(t,e,i,s){const{xKey:n,yKey:a}=this.properties,r=t.resolveColumnById(this,"xValue",e)[i],o=t.resolveColumnById(this,"yValueRaw",e)[i],l=t.getDomain(this,"xValue","key",e).domain,c=t.getDomain(this,this.yCumulativeKey(e),"value",e).domain,h=this.filterItemStylerFillParams(s.fill)??s.fill;return{...Wu(r,o,n,a,l,c),xValue:r,yValue:o,...s,fill:h}}makeLabelFormatterParams(){const{xKey:t,xName:e,yKey:i,yName:s,legendItemName:n}=this.properties;return{xKey:t,xName:e,yKey:i,yName:s,legendItemName:n}}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a}=this,{xKey:r,xName:o,yKey:l,yName:c,tooltip:h,legendItemName:d}=a,u=a.allowNullKeys??!1,p=n[ti.X],g=n[ti.Y];if(!i||!s||!p||!g)return;const f=s.dataSources.get(this.id)?.data?.[t],m=i.resolveColumnById(this,"xValue",s)[t],b=i.resolveColumnById(this,"yValueRaw",s)[t];if(m===void 0&&!u)return;const x=this.getStyle(),v=this.makeItemStylerParams(i,s,t,x.marker),S=this.getMarkerStyle(this.properties.marker,{datumIndex:t,datum:f},v,{isHighlight:!1},x.marker);return this.formatTooltipWithContext(h,{heading:this.getAxisValueText(p,"tooltip",m,f,r,d,u),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(g,"tooltip",b,f,l,d),missing:ga(b)}]},{seriesId:e,datum:f,title:c,xKey:r,xName:o,yKey:l,yName:c,...S,...this.getModuleTooltipParams()})}legendItemSymbol(){const{stroke:t,strokeOpacity:e,strokeWidth:i,lineDash:s,marker:n}=this.getStyle();return{marker:{...this.getMarkerStyle(this.properties.marker,{},void 0,{isHighlight:!1,checkForHighlight:!1},{size:n.size,shape:n.shape,fill:n.fill,fillOpacity:n.fillOpacity,stroke:n.stroke,strokeOpacity:n.strokeOpacity,strokeWidth:n.strokeWidth,lineDash:n.lineDash,lineDashOffset:n.lineDashOffset}),enabled:this.properties.marker.enabled},line:{enabled:!0,stroke:t,strokeOpacity:e,strokeWidth:i,lineDash:s}}}getLegendData(t){if(t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{yKey:n,yName:a,title:r,legendItemName:o,showInLegend:l}=this.properties;return[{legendType:t,id:e,itemId:n,legendItemName:o,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:o??r??a??n},symbol:this.legendItemSymbol(),hideInLegend:!l}]}updatePaths(t){this.updateLinePaths(t.paths,t.contextData)}updateLinePaths(t,e){const i=e.strokeData.spans,[s]=t;s.path.clear(),ef(s,i),s.markDirty("LineSeries")}resetDatumAnimation(t){nd([t.datumSelection])}animateEmptyUpdateReady(t){const{datumSelection:e,labelSelection:i,annotationSelections:s,contextData:n,paths:a}=t,{animationManager:r}=this.ctx;this.updateLinePaths(a,n),hf(this,r,...a),ot([e],Pl),lf(this,r,{...this.getAnimationDrawingModes(),phase:"initial"},e),Te(this,"labels",r,i),Te(this,"annotations",r,...s)}animateReadyResize(t){const{contextData:e,paths:i}=t;this.updateLinePaths(i,e),super.animateReadyResize(t)}animateWaitingUpdateReady(t){const{animationManager:e}=this.ctx,{datumSelection:i,labelSelection:s,annotationSelections:n,contextData:a,paths:r,previousContextData:o}=t,[l]=r;if(a.visible===!1&&o?.visible===!1)return;this.resetDatumAnimation(t),this.resetLabelAnimation(t);const c=()=>{this.resetPathAnimation(t),this.updateLinePaths(r,a)},h=()=>{e.skipCurrentBatch(),c()};if(a==null||o==null){c(),Rl(this,e,"added",this.getAnimationDrawingModes(),i),Ns(this.id,"path_properties",e,[l],{opacity:0},{opacity:this.getOpacity()},{phase:"add"}),Te(this,"labels",e,s),Te(this,"annotations",e,...n);return}if(a.crossFiltering!==o.crossFiltering){h();return}const d=hj(a,o,this.processedData?.reduced?.diff?.[this.id],this.getOpacity());if(d===void 0){h();return}else if(d.status==="no-op")return;Ee(this.id,"path_properties",e,[l],d.stroke.pathProperties),d.status==="added"?this.updateLinePaths(r,a):d.status==="removed"?this.updateLinePaths(r,o):hd(this.id,"path_update",e,[l],d.stroke.path),d.hasMotion&&(Rl(this,e,void 0,this.getAnimationDrawingModes(),i),Te(this,"labels",e,s),Te(this,"annotations",e,...n)),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateLinePaths(r,a)})}isLabelEnabled(){return this.properties.label.enabled}getBandScalePadding(){return{inner:1,outer:.1}}nodeFactory(){return new We}getStyle(t){const{styler:e,marker:i,lineDash:s,lineDashOffset:n,stroke:a,strokeOpacity:r,strokeWidth:o}=this.properties,{size:l,shape:c,fill:h="transparent",fillOpacity:d}=i;let u={};if(e){const p=this.makeStylerParams(t),g=this.cachedCallWithContext(e,p)??{};u=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],g,{pick:!1})??{}}return u.marker??(u.marker={}),{lineDash:u.lineDash??s,lineDashOffset:u.lineDashOffset??n,stroke:u.stroke??a,strokeOpacity:u.strokeOpacity??r,strokeWidth:u.strokeWidth??o,marker:{fill:u.marker.fill??h,fillOpacity:u.marker.fillOpacity??d,shape:u.marker.shape??c,size:u.marker.size??l,lineDash:u.marker.lineDash??i.lineDash??s,lineDashOffset:u.marker.lineDashOffset??i.lineDashOffset??n,stroke:u.marker.stroke??i.stroke??a,strokeOpacity:u.marker.strokeOpacity??i.strokeOpacity??r,strokeWidth:u.marker.strokeWidth??i.strokeWidth??o}}}getFormattedMarkerStyle(t){const e=this.getStyle(),i=this.makeItemStylerParams(this.dataModel,this.processedData,t.datumIndex,e.marker);return this.getMarkerStyle(this.properties.marker,t,i,{isHighlight:!0},void 0,e)}computeFocusBounds(t){return ad(this,t)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};om.className="LineSeries",om.type="line";var $Y={series:{stroke:IY,strokeWidth:2,strokeOpacity:1,lineDash:[0],lineDashOffset:0,interpolation:{type:"linear"},marker:{shape:"circle",size:7,strokeWidth:{$isUserOption:["./stroke",1,0]},fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",yY],["image",bY],["pattern",xY]]},stroke:{$palette:"stroke"}},label:{...vY,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","nearest"]},"area"]},"nearest",{$path:["/tooltip/range","nearest"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:SY,segmentation:DY}},ZA={type:"series",name:"line",chartType:"cartesian",stackable:!0,version:me,dependencies:[Ii],options:cl,predictAxis:Dl,defaultAxes:{y:{type:UA.NUMBER,position:HA.LEFT},x:{type:UA.CATEGORY,position:HA.BOTTOM}},axisKeys:{[jA.X]:"xKeyAxis",[jA.Y]:"yKeyAxis"},themeTemplate:$Y,create:t=>new om(t)};import{CARTESIAN_AXIS_TYPE as XA,CARTESIAN_POSITION as qA,ChartAxisDirection as JA,FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS as KY,FILL_IMAGE_DEFAULTS as ZY,FILL_PATTERN_DEFAULTS as XY,LABEL_BOXING_DEFAULTS as qY,MULTI_SERIES_HIGHLIGHT_STYLE as JY}from"ag-charts-core";var lm=class extends Td{};lm.className="ScatterSeries",lm.type="scatter";var QY={series:{shape:"circle",size:7,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",KY],["image",ZY],["pattern",XY]]},stroke:{$palette:"stroke"},fillOpacity:.8,maxRenderedItems:2e3,label:{...qY,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","nearest"]},"area"]},"nearest",{$path:["/tooltip/range","nearest"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:JY}},QA={type:"series",name:"scatter",chartType:"cartesian",version:me,dependencies:[Ii],options:uS,predictAxis:Pg,defaultAxes:{x:{type:XA.NUMBER,position:qA.BOTTOM},y:{type:XA.NUMBER,position:qA.LEFT}},axisKeys:{[JA.X]:"xKeyAxis",[JA.Y]:"yKeyAxis"},themeTemplate:QY,create:t=>new lm(t)};import{ChartAxisDirection as e$,ChartUpdateType as t$,DebugMetrics as i$,Logger as s$,PolarZIndexMap as eC,extractDomain as n$,formatValue as a$,isGradientFill as tC,isStringFillArray as r$,jsonDiff as o$,mergeDefaults as l$,modulus as c$,normalizeAngle180 as h$,toPlainText as iC,toRadians as cm,wrapTextOrSegments as d$}from"ag-charts-core";import{BaseProperties as sC,PropertiesArray as u$,Property as G}from"ag-charts-core";var nC=class extends Se{constructor(){super(...arguments),this.showInLegend=!1}};y([G],nC.prototype,"showInLegend",2);var hm=class extends li{constructor(){super(...arguments),this.spacing=2}set(t,e){return super.set(t)}};y([G],hm.prototype,"text",2),y([G],hm.prototype,"spacing",2);var dm=class extends sC{constructor(){super(...arguments),this.fill="transparent",this.fillOpacity=1}};y([G],dm.prototype,"fill",2),y([G],dm.prototype,"fillOpacity",2);var fo=class extends li{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};y([G],fo.prototype,"offset",2),y([G],fo.prototype,"minAngle",2),y([G],fo.prototype,"minSpacing",2),y([G],fo.prototype,"maxCollisionOffset",2),y([G],fo.prototype,"avoidCollisions",2);var um=class extends li{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};y([G],um.prototype,"positionOffset",2),y([G],um.prototype,"positionRatio",2);var jl=class extends sC{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};y([G],jl.prototype,"colors",2),y([G],jl.prototype,"length",2),y([G],jl.prototype,"strokeWidth",2),y([G],jl.prototype,"itemStyler",2);var q=class extends _i{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(Pe),this.strokes=Object.values(Rs),this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.outerRadiusOffset=0,this.outerRadiusRatio=1,this.strokeWidth=1,this.sectorSpacing=0,this.hideZeroValueSectorsInLegend=!1,this.innerLabels=new u$(hm),this.title=new nC,this.innerCircle=new dm,this.shadow=new Is,this.calloutLabel=new fo,this.sectorLabel=new um,this.calloutLine=new jl,this.tooltip=Ga()}};y([G],q.prototype,"angleKey",2),y([G],q.prototype,"angleName",2),y([G],q.prototype,"angleFilterKey",2),y([G],q.prototype,"radiusKey",2),y([G],q.prototype,"radiusName",2),y([G],q.prototype,"radiusMin",2),y([G],q.prototype,"radiusMax",2),y([G],q.prototype,"calloutLabelKey",2),y([G],q.prototype,"calloutLabelName",2),y([G],q.prototype,"sectorLabelKey",2),y([G],q.prototype,"sectorLabelName",2),y([G],q.prototype,"legendItemKey",2),y([G],q.prototype,"defaultColorRange",2),y([G],q.prototype,"defaultPatternFills",2),y([G],q.prototype,"fills",2),y([G],q.prototype,"strokes",2),y([G],q.prototype,"fillOpacity",2),y([G],q.prototype,"strokeOpacity",2),y([G],q.prototype,"lineDash",2),y([G],q.prototype,"lineDashOffset",2),y([G],q.prototype,"cornerRadius",2),y([G],q.prototype,"itemStyler",2),y([G],q.prototype,"rotation",2),y([G],q.prototype,"outerRadiusOffset",2),y([G],q.prototype,"outerRadiusRatio",2),y([G],q.prototype,"innerRadiusOffset",2),y([G],q.prototype,"innerRadiusRatio",2),y([G],q.prototype,"strokeWidth",2),y([G],q.prototype,"sectorSpacing",2),y([G],q.prototype,"hideZeroValueSectorsInLegend",2),y([G],q.prototype,"innerLabels",2),y([G],q.prototype,"title",2),y([G],q.prototype,"innerCircle",2),y([G],q.prototype,"shadow",2),y([G],q.prototype,"calloutLabel",2),y([G],q.prototype,"sectorLabel",2),y([G],q.prototype,"calloutLine",2),y([G],q.prototype,"tooltip",2);import{isBetweenAngles as p$,toRadians as g$}from"ag-charts-core";function pm(t,e,i,s){const n=[i.convert(0),i.convert(1)],a=[s.convert(0),s.convert(1)],r=Math.PI/-2+g$(e),o=t?"initial":"update",l=({radius:g})=>({innerRadius:n[0],outerRadius:n[0]+(n[1]-n[0])*g}),c=({radius:g})=>({innerRadius:a[0],outerRadius:a[0]+(a[1]-a[0])*g});return{nodes:{toFn:(g,f,m,{prevLive:b})=>{let{startAngle:x,endAngle:v,innerRadius:S,outerRadius:I}=f;const{stroke:M,fill:D}=f.sectorFormat;if(m==="removed"&&b?(x=b.datum?.endAngle,v=b.datum?.endAngle):m==="removed"&&!b&&(x=r,v=r),m==="removed"){const C=l(f);S=C.innerRadius,I=C.outerRadius}return{startAngle:x,endAngle:v,outerRadius:I,innerRadius:S,stroke:M,...typeof D=="string"?{fill:D}:{}}},fromFn:(g,f,m,{prevFromProps:b})=>{let{startAngle:x,endAngle:v,innerRadius:S,outerRadius:I}=g,{fill:M,stroke:D}=f.sectorFormat;if(m==="updated"&&g.previousDatum==null&&(m="added"),m==="unknown"||m==="added"&&!b?(x=r,v=r,S=f.innerRadius,I=f.outerRadius):m==="added"&&b&&(x=b.endAngle??r,v=b.endAngle??r,S=b.innerRadius??f.innerRadius,I=b.outerRadius??f.outerRadius),m==="added"&&!t){const C=c(f);S=C.innerRadius,I=C.outerRadius}return m==="updated"&&(M=g.fill??M,D=(typeof g.stroke=="string"?g.stroke:void 0)??D),{startAngle:x,endAngle:v,innerRadius:S,outerRadius:I,stroke:D,phase:o,...typeof M=="string"?{fill:M}:{}}}},innerCircle:{fromFn:(g,f)=>({size:g.previousDatum?.radius??g.size??0,phase:o}),toFn:(g,f)=>({size:f.radius??0})}}}function f$(t,e){return{startAngle:e.startAngle,endAngle:e.endAngle,innerRadius:e.innerRadius,outerRadius:e.outerRadius,stroke:e.sectorFormat.stroke}}function m$(t,e){const i=e.y-t.centerY,s=e.x-t.centerX,n=Math.atan2(i,s),a=t.getItemNodes();for(const r of a)if(r.datum.missing!==!0&&p$(n,r.startAngle,r.endAngle)){const o=Math.hypot(s,i);let l=0;return or.outerRadius&&(l=o-r.outerRadius),{datum:r.datum,distance:l}}}var y$=class extends Jc{constructor(t,e,i,s){super(t,e,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey,this.calloutLabelKey=s.properties.calloutLabelKey,this.sectorLabelKey=s.properties.sectorLabelKey}},Nd=class extends gf{constructor(t){super({moduleCtx:t,categoryKey:void 0,propertyKeys:{...tM,sectorLabel:["sectorLabelKey"],calloutLabel:["calloutLabelKey"]},propertyNames:{...iM,sectorLabel:["sectorLabelName"],calloutLabel:["calloutLabelName"]},pickModes:[1,0],animationResetFns:{item:f$,label:za}}),this.properties=new q,this.phantomNodeData=void 0,this.backgroundGroup=new mt({name:`${this.id}-background`,zIndex:eC.BACKGROUND}),this.noVisibleData=!1,this.previousRadiusScale=new Va,this.radiusScale=new Va,this.phantomGroup=this.contentGroup.appendChild(new U({name:"phantom",zIndex:-1})),this.phantomSelection=Re.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.phantomHighlightGroup=this.highlightGroup.appendChild(new U({name:"phantom",zIndex:-1})),this.phantomHighlightSelection=Re.select(this.phantomHighlightGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new U({name:"pieCalloutLabels"})),this.calloutLabelSelection=new Re(this.calloutLabelGroup,U),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new U({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new We({shape:"circle"})),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new We({shape:"circle"})),this.innerLabelsGroup=this.contentGroup.appendChild(new U({name:"innerLabels"})),this.innerCircleGroup=this.backgroundGroup.appendChild(new U({name:`${this.id}-innerCircle`})),this.innerLabelsSelection=Re.select(this.innerLabelsGroup,Ht),this.innerCircleSelection=Re.select(this.innerCircleGroup,()=>new We({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=y$,this.angleScale=new Va,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2),this.phantomGroup.opacity=.2,this.phantomHighlightGroup.opacity=.2,this.innerLabelsGroup.pointerEvents=1}get calloutNodeData(){return this.phantomNodeData??this.nodeData}attachSeries(t,e,i){super.attachSeries(t,e,i),t?.appendChild(this.backgroundGroup)}detachSeries(t,e,i){super.detachSeries(t,e,i),this.backgroundGroup.remove()}setZIndex(t){super.setZIndex(t),this.backgroundGroup.zIndex=[eC.BACKGROUND,t]}nodeFactory(){const t=new At;return t.miterLimit=1e9,t}getSeriesDomain(t){return t===e$.Angle?{domain:this.angleScale.domain}:{domain:this.radiusScale.domain}}async processData(t){if(this.data==null)return;const{visible:e,id:i,ctx:{legendManager:s}}=this,{angleKey:n,angleFilterKey:a,radiusKey:r,calloutLabelKey:o,sectorLabelKey:l,legendItemKey:c}=this.properties,h=()=>(b,x)=>e&&s.getItemEnabled({seriesId:i,itemId:x})?b:0,d=!this.ctx.animationManager.isSkipped(),u=this.properties.allowNullKeys??!1,p=[],g=[];c?p.push(nn(c,"category",{id:"legendItemKey",allowNullKey:u})):o?p.push(nn(o,"category",{id:"calloutLabelKey",allowNullKey:u})):l&&p.push(nn(l,"category",{id:"sectorLabelKey",allowNullKey:u}));const f=this.radiusScale.type,m=this.angleScale.type;r&&g.push(jO(r,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,missingValue:this.properties.radiusMax??1,processor:h}),ye(r,f,{id:"radiusRaw",processor:h}),Uu("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),o&&g.push(ye(o,"category",{id:"calloutLabelValue",allowNullKey:u})),l&&g.push(ye(l,"category",{id:"sectorLabelValue",allowNullKey:u})),c&&g.push(ye(c,"category",{id:"legendItemValue",allowNullKey:u})),a&&g.push(Gu(a,m,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:h}),ye(a,m,{id:"angleFilterRaw"}),Uu("angleFilterValue",[0,1],0,0)),d&&this.processedData?.reduced?.animationValidation?.uniqueKeys&&p.length>0&&g.push(Cc(this.id,this.processedData)),g.push(_o()),await this.requestDataModel(t,this.data,{props:[...p,Gu(n,m,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:h}),ye(n,m,{id:"angleRaw"}),Uu("angleValue",[0,1],0,0),...g]});for(const b of this.processedData?.defs?.values??[]){const{id:x,missing:v,property:S}=b,I=Tb(this,v);x!=="angleRaw"&&I>0&&s$.warnOnce(`no value was found for the key '${String(S)}' on ${I} data element${I>1?"s":""}`)}this.animationState.transition("updateData")}maybeRefreshNodeData(){if(!this.nodeDataRefresh)return;const{nodeData:t=[],phantomNodeData:e}=this.createNodeData()??{};this.nodeData=t,this.phantomNodeData=e,t.length>0&&i$.record(`${this.type}:nodeData`,t.length),this.nodeDataRefresh=!1}getProcessedDataValues(t,e){const i=t.resolveColumnById(this,"angleValue",e),s=t.resolveColumnById(this,"angleRaw",e),n=this.properties.angleFilterKey==null?void 0:t.resolveColumnById(this,"angleFilterValue",e),a=this.properties.angleFilterKey==null?void 0:t.resolveColumnById(this,"angleFilterRaw",e),r=this.properties.radiusKey?t.resolveColumnById(this,"radiusValue",e):void 0,o=this.properties.radiusKey?t.resolveColumnById(this,"radiusRaw",e):void 0,l=this.properties.calloutLabelKey?t.resolveColumnById(this,"calloutLabelValue",e):void 0,c=this.properties.sectorLabelKey?t.resolveColumnById(this,"sectorLabelValue",e):void 0,h=this.properties.legendItemKey?t.resolveColumnById(this,"legendItemValue",e):void 0;return{angleValues:i,angleRawValues:s,angleFilterValues:n,angleFilterRawValues:a,radiusValues:r,radiusRawValues:o,calloutLabelValues:l,sectorLabelValues:c,legendItemValues:h}}createNodeData(){const{id:t,processedData:e,dataModel:i,angleScale:s,ctx:{legendManager:n},visible:a}=this,{rotation:r,innerRadiusRatio:o}=this.properties;if(!i||e?.type!=="ungrouped")return;const l=this.getProcessedDataValues(i,e),{angleValues:c,angleRawValues:h,angleFilterValues:d,angleFilterRawValues:u,radiusValues:p,radiusRawValues:g,legendItemValues:f}=l,m=u?.some((D,A)=>D>h[A])??!1;let b=0,x=0;const v=[],S=u==null?void 0:[],I=e.dataSources.get(this.id)?.data??[],M=e.invalidData?.get(this.id);for(const[D,A]of I.entries()){if(M?.[D]===!0)continue;const C=m?d[D]:c[D],T=u!=null&&!m?Math.sqrt(u[D]/h[D]):1,L=s.convert(b)+cm(r);b=C,x+=C;const k=s.convert(b)+cm(r),O=Math.abs(k-L),N=L+O/2,w=h[D],F=(p?.[D]??1)*T,E=g?.[D],V=f?.[D],Z=this.getLabels(D,A,N,O,l),Y=this.getItemStyle({datum:A,datumIndex:D},!1),ze={series:this,datum:A,datumIndex:D,angleValue:w,midAngle:N,midCos:Math.cos(N),midSin:Math.sin(N),startAngle:L,endAngle:k,radius:F,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(F),0),sectorFormat:Y,radiusValue:E,legendItemValue:V,enabled:a&&n.getItemEnabled({seriesId:t,itemId:D}),focusable:!0,...Z};v.push(ze),S?.push({...ze,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0),focusable:!1})}return this.zerosumOuterRing.visible=x===0,this.zerosumInnerRing.visible=x===0&&o!=null&&o!==1&&o>0,{itemId:t,nodeData:v,labelData:v,phantomNodeData:S}}getLabelContent(t,e,i){const{id:s,ctx:n,properties:a}=this,{formatManager:r}=n,{calloutLabel:o,sectorLabel:l,calloutLabelKey:c,sectorLabelKey:h,legendItemKey:d}=a,u=a.allowNullKeys??!1,p=i.calloutLabelValues?.[t],g=i.sectorLabelValues?.[t],f=i.legendItemValues?.[t],m={datum:e,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},b={callout:void 0,sector:void 0,legendItem:void 0};if(c&&(b.callout=this.getLabelText(p,e,c,"calloutLabel",[],o,{...m,value:p},u)),h&&(b.sector=this.getLabelText(g,e,h,"sectorLabel",[],l,{...m,value:g},u)),d!=null&&(f!=null||u)){const x=f??"";b.legendItem=r.format(this.callWithContext.bind(this),{type:"category",value:u?f:x,datum:e,seriesId:s,legendItemName:void 0,key:d,source:"legend-label",property:"legendItem",domain:[],boundSeries:this.getFormatterContext("legendItem")})??x}return b}getLabels(t,e,i,s,n){const{properties:a}=this,{calloutLabel:r,sectorLabel:o,legendItemKey:l}=a,c=this.getLabelContent(t,e,n),h={};return r.enabled&&c.callout&&s>=cm(r.minAngle)&&(h.calloutLabel={...this.getTextAlignment(i),text:c.callout,hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),o.enabled&&c.sector&&(h.sectorLabel={text:c.sector}),l&&c.legendItem&&(h.legendItem={key:l,text:c.legendItem}),h}getTextAlignment(t){const e=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"top"},{textAlign:"right",textBaseline:"middle"}],i=h$(t),s=-.75*Math.PI,n=i-s,a=Math.floor(n/(Math.PI/2)),r=c$(a,e.length);return e[r]}getFillParams(t,e,i){if(!(!tC(t)||t.bounds==="item"))return{centerX:0,centerY:0,innerRadius:e,outerRadius:i}}getItemStyle({datum:t,datumIndex:e},i,s,n){const{fills:a,strokes:r,itemStyler:o}=this.properties,l=r[e],c=a[e],{fill:h,fillOpacity:d,stroke:u,strokeWidth:p,strokeOpacity:g,lineDash:f,lineDashOffset:m,cornerRadius:b,opacity:x}=l$(this.getHighlightStyle(i,e,s,n),{fill:c,stroke:l},this.properties);let v;return o&&(v=this.cachedDatumCallback(this.getDatumId(e)+(i?"-highlight":"-hide"),()=>{const S=this.makeItemStylerParams(t,e,i,{fill:h,fillOpacity:d,stroke:u,strokeWidth:p,strokeOpacity:g,lineDash:f,lineDashOffset:m,cornerRadius:b});return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(o,S),{proxyPaths:{fill:["fills",`${e}`],stroke:["strokes",`${e}`]}})})),{fill:v?.fill??h,fillOpacity:v?.fillOpacity??d,stroke:v?.stroke??u,strokeWidth:v?.strokeWidth??p,strokeOpacity:v?.strokeOpacity??g,lineDash:v?.lineDash??f,lineDashOffset:v?.lineDashOffset??m,cornerRadius:v?.cornerRadius??b,opacity:x}}makeItemStylerParams(t,e,i,s){const{angleKey:n,radiusKey:a,calloutLabelKey:r,sectorLabelKey:o,legendItemKey:l}=this.properties,c=this.filterItemStylerFillParams(s.fill)??s.fill;return{datum:t,angleKey:n,radiusKey:a,calloutLabelKey:r,sectorLabelKey:o,legendItemKey:l,...s,fill:c,highlightState:this.getHighlightStateString(this.ctx.highlightManager?.getActiveHighlight(),i,e),seriesId:this.id}}getCalloutLineStyle(t,e){const{properties:i}=this;let s={};if(i.calloutLine.itemStyler){const n=this.getHighlightStateString(this.ctx.highlightManager?.getActiveHighlight(),e,t.datumIndex),a={angleKey:i.angleKey,angleName:i.angleName??i.angleKey,calloutLabelKey:i.calloutLabelKey,calloutLabelName:i.calloutLabelName??i.calloutLabelKey,datum:t.datum,highlightState:n,legendItemKey:i.legendItemKey,radiusKey:i.radiusKey,radiusName:i.radiusName??i.radiusKey,sectorLabelKey:i.sectorLabelKey,sectorLabelName:i.sectorLabelName??i.sectorLabelKey,seriesId:this.id};s=this.cachedCallWithContext(i.calloutLine.itemStyler,a)??{}}return{length:s.length??i.calloutLine.length,strokeWidth:s.strokeWidth??i.calloutLine.strokeWidth,color:s.color,colors:i.calloutLine.colors}}getInnerRadius(){const{radius:t}=this,{innerRadiusRatio:e=1,innerRadiusOffset:i=0}=this.properties,s=t*e+i;return s===t||s<0?0:s}getOuterRadius(){const{outerRadiusRatio:t,outerRadiusOffset:e}=this.properties;return Math.max(this.radius*t+e,0)}updateRadiusScale(t){const e=[this.getInnerRadius(),this.getOuterRadius()];this.radiusScale.range=e,t&&(this.previousRadiusScale.range=e);const i=s=>({...s,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(s.radius),0)});this.nodeData=this.nodeData.map(i),this.phantomNodeData=this.phantomNodeData?.map(i)}getTitleTranslationY(){const t=Math.max(0,this.radiusScale.range[1]);if(t===0)return Number.NaN;const i=2+(this.properties.title?.spacing??0),s=Math.max(0,-t);return-t-i-s}update({seriesRect:t}){const{title:e}=this.properties,i={seriesRectWidth:t?.width,seriesRectHeight:t?.height},s=o$(this.nodeDataDependencies,i)!=null;if(s&&(this._nodeDataDependencies=i),this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(s),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),e){const n=this.getTitleTranslationY();e.node.y=Number.isFinite(n)?n:0;const a=e.node.getBBox();e.node.visible=e.enabled&&Number.isFinite(n)&&!this.bboxIntersectsSurroundingSeries(a)}for(const n of[this.zerosumInnerRing,this.zerosumOuterRing])n.fillOpacity=0,n.stroke=this.properties.calloutLabel.color,n.strokeWidth=1,n.strokeOpacity=1;this.updateNodeMidPoint(),this.updateSelections(),this.updateNodes(t)}updateTitleNodes(){const{oldTitle:t}=this,{title:e}=this.properties;t!==e&&(t&&t.node.remove(),e&&(e.node.textBaseline="bottom",this.labelGroup?.appendChild(e.node)),this.oldTitle=e)}updateNodeMidPoint(){const t=e=>{const i=e.innerRadius+(e.outerRadius-e.innerRadius)/2;e.midPoint={x:e.midCos*Math.max(0,i),y:e.midSin*Math.max(0,i)}};for(const e of this.nodeData)t(e);if(this.phantomNodeData)for(const e of this.phantomNodeData)t(e)}updateSelections(){this.updateGroupSelection(),this.updateInnerCircleSelection()}updateGroupSelection(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,phantomHighlightSelection:s,calloutLabelSelection:n,labelSelection:a,highlightLabelSelection:r,innerLabelsSelection:o}=this,l=this.nodeData.map(d=>({...d,sectorFormat:{...d.sectorFormat}})),c=this.phantomNodeData?.map(d=>({...d,sectorFormat:{...d.sectorFormat}})),h=(d,u)=>{d.update(u,void 0,p=>this.getDatumId(p.datumIndex)),this.ctx.animationManager.isSkipped()&&d.cleanup()};h(t,this.nodeData),h(e,l),h(i,this.phantomNodeData??[]),h(s,c??[]),n.update(this.calloutNodeData,d=>{const u=new ri;u.tag=0,u.pointerEvents=1,d.appendChild(u);const p=new Ht;p.tag=1,p.pointerEvents=1,d.appendChild(p)}),a.update(this.nodeData),r.update(l),o.update(this.properties.innerLabels,d=>{d.pointerEvents=1})}updateInnerCircleSelection(){const{innerCircle:t}=this.properties;let e=0;const i=this.getInnerRadius();if(i>0){const n=Math.min(i,this.getOuterRadius()),a=1;e=Math.ceil(n*2+a)}const s=t?[{radius:e}]:[];this.innerCircleSelection.update(s)}updateNodes(t){const e=this.ctx.highlightManager.getActiveHighlight(),{visible:i,dataModel:s,processedData:n}=this;if(this.backgroundGroup.visible=i,this.contentGroup.visible=i,!s||!n)return;const{legendItemValues:a}=this.getProcessedDataValues(s,n),r=this.isSeriesHighlighted(e,a),o=this.ctx.chartService.highlight?.drawingMode??"overlay";this.highlightGroup.visible=i&&r,this.labelGroup.visible=i,this.innerCircleSelection.each((p,{radius:g})=>{p.setProperties({fill:this.properties.innerCircle?.fill,opacity:this.properties.innerCircle?.fillOpacity,size:g})});const l=this.radiusScale.range[0],c=this.radiusScale.range[1],h=this.getShapeFillBBox(),d=this.ctx.animationManager.isSkipped(),u=(p,g,f,m,b)=>{const x=this.getItemStyle(g,m,void 0,a);g.sectorFormat.fill=x.fill,g.sectorFormat.stroke=x.stroke,d&&(p.startAngle=g.startAngle,p.endAngle=g.endAngle,p.innerRadius=g.innerRadius,p.outerRadius=g.outerRadius),(m||d)&&(p.fill=x.fill,p.stroke=x.stroke);const v=this.getFillParams(x.fill,l,c);p.setStyleProperties(x,h,v),p.drawingMode=b,p.cornerRadius=x.cornerRadius,p.fillShadow=this.properties.shadow;const S=Math.max((this.properties.sectorSpacing+(x.stroke==null?0:x.strokeWidth))/2,0);p.inset=S,p.lineJoin=this.properties.sectorSpacing>=0||S>0?"miter":"round"};this.itemSelection.each((p,g,f)=>u(p,g,f,!1,"overlay")),this.phantomSelection.each((p,g,f)=>u(p,g,f,!1,"overlay")),this.highlightSelection.each((p,g,f)=>{u(p,g,f,!0,o),p.visible=g.datumIndex===e?.datumIndex}),this.phantomHighlightSelection.each((p,g,f)=>{u(p,g,f,!0,o),p.visible=g.datumIndex===e?.datumIndex}),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(t),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{strokes:t}=this.properties,{offset:e}=this.properties.calloutLabel,i=this.ctx.highlightManager?.getActiveHighlight(),s=this.isSeriesHighlighted(i);for(const n of this.calloutLabelSelection.selectByTag(0)){const a=n.closestDatum(),r=s&&this.isItemHighlighted(i,a.datumIndex)===!0,{length:o,strokeWidth:l,color:c,colors:h}=this.getCalloutLineStyle(a,!1),d=l,u=r$(h)?h:t,{calloutLabel:p,outerRadius:g,datumIndex:f}=a;if(p?.text&&!p.hidden&&g!==0){n.visible=!0,n.strokeWidth=d,n.stroke=c??u[f%u.length],n.strokeOpacity=this.getHighlightStyle(r,a.datumIndex).opacity??1,n.fill=void 0;const m=a.midCos*g,b=a.midSin*g;let x=a.midCos*(g+o),v=a.midSin*(g+o);if((p.collisionTextAlign??p.collisionOffsetY!==0)&&p.box!=null){const I=p.box;let M=x,D=v;xI.x+I.width&&(M=I.x+I.width),vI.y+I.height&&(D=I.y+I.height);const A=M-x,C=D-v,T=Math.sqrt(Math.pow(A,2)+Math.pow(C,2)),L=T-e;L>0&&(x=x+A*L/T,v=v+C*L/T)}n.x1=m,n.y1=b,n.x2=x,n.y2=v}else n.visible=!1}}getLabelOverflow(t,e){const i=-this.centerX,s=i+e.width,n=-this.centerY,a=n+e.height,r=1;let o=t.width;t.x+rs&&(o=(s-t.x)/t.width);const l=t.y+ra,c=this.bboxIntersectsSurroundingSeries(t);return{maxWidth:o,hasVerticalOverflow:l,hasSurroundingSeriesOverflow:c}}bboxIntersectsSurroundingSeries(t){const{surroundingRadius:e}=this;if(e==null)return!1;const i=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],s=e**2;return i.some(n=>n.x**2+n.y**2>s)}computeCalloutLabelCollisionOffsets(){const{radiusScale:t}=this,{calloutLabel:e}=this.properties,{offset:i,minSpacing:s}=e,n=t.convert(0),a=m=>!m.calloutLabel||m.outerRadius===0,r=this.calloutNodeData,o=r.filter(m=>!a(m));for(const m of o){const b=m.calloutLabel;b!=null&&(b.hidden=!1,b.collisionTextAlign=void 0,b.collisionOffsetY=0)}if(o.length<=1)return;const l=o.filter(m=>m.midCos<0).sort((m,b)=>m.midSin-b.midSin),c=o.filter(m=>m.midCos>=0).sort((m,b)=>m.midSin-b.midSin),h=o.filter(m=>m.midSin<0&&m.calloutLabel?.textAlign==="center").sort((m,b)=>m.midCos-b.midCos),d=o.filter(m=>m.midSin>=0&&m.calloutLabel?.textAlign==="center").sort((m,b)=>m.midCos-b.midCos),u=m=>{const b=m.calloutLabel;if(b==null)return P.zero.clone();const x=this.getLabelStyle(m,e,"calloutLabel"),v=gr(x),S=this.getCalloutLineStyle(m,!1).length,I=m.outerRadius+S+i,M=m.midCos*I,D=m.midSin*I+b.collisionOffsetY,A=b.collisionTextAlign??b.textAlign,C=b.textBaseline;return Ht.measureBBox(b.text,M,D,{font:this.properties.calloutLabel,textAlign:A,textBaseline:C}).grow(v)},p=(m,b,x)=>{const v=u(m).grow(s/2),S=u(b).grow(s/2);v.xS.x&&(x==="to-top"?v.yS.y)&&(b.calloutLabel.collisionOffsetY=x==="to-top"?v.y-S.y-S.height:v.y+v.height-S.y)},g=m=>{const b=m.slice().sort((v,S)=>Math.abs(v.midSin)-Math.abs(S.midSin))[0],x=m.indexOf(b);for(let v=x-1;v>=0;v--){const S=m[v+1],I=m[v];p(S,I,"to-top")}for(let v=x+1;v{const b=o.some(D=>D.calloutLabel.collisionOffsetY!==0),x=m.map(D=>u(D)),v=x.map(D=>D.clone().grow(s/2));let S=!1;for(let D=0;D{const{startAngle:A,endAngle:C,outerRadius:T}=D;return{startAngle:A,endAngle:C,innerRadius:n,outerRadius:T}}),M=x.some(D=>I.some(A=>Pj(D,A)));if(!(!S&&!b&&!M))for(const D of m){if(D.calloutLabel.textAlign!=="center")continue;const A=D.calloutLabel;D.midCos<0?A.collisionTextAlign="right":D.midCos>0?A.collisionTextAlign="left":A.collisionTextAlign="center"}};g(l),g(c),f(h),f(d)}getLabelStyle(t,e,i,s=!1){const n=this.ctx.highlightManager?.getActiveHighlight();return Ba(this,t,this.properties,e,s,n,["series",`${this.declarationOrder}`,i])}updateCalloutLabelNodes(t){const{radiusScale:e}=this,{calloutLabel:i}=this.properties,s=new Ht,n=this.ctx.highlightManager?.getActiveHighlight(),a=this.isSeriesHighlighted(n);for(const r of this.calloutLabelSelection.selectByTag(1)){const o=r.closestDatum(),l=o.calloutLabel,c=e.convert(o.radius),h=Math.max(0,c);if(!l?.text||h===0||l.hidden){r.visible=!1;continue}const d=a&&this.isItemHighlighted(n,o.datumIndex)===!0,u=this.getLabelStyle(o,i,"calloutLabel",d),p=this.getCalloutLineStyle(o,!1).length,g=h+p+i.offset,f=o.midCos*g,m=o.midSin*g+l.collisionOffsetY,b={textAlign:l.collisionTextAlign??l.textAlign,textBaseline:l.textBaseline};s.text=l.text,s.x=f,s.y=m,s.setFont(u),s.setAlign(b),s.setBoxing(u);const x=s.getBBox();let v=l.text,S=!0;if(i.avoidCollisions){const{maxWidth:I,hasVerticalOverflow:M}=this.getLabelOverflow(x,t);if(x.width>I){const D={font:this.properties.calloutLabel,textWrap:"on-space",overflow:"hide",maxWidth:I};v=d$(l.text,D)}S=!M}r.text=v,r.x=f,r.y=m,r.setFont(u),r.setAlign(b),r.setBoxing(u),r.fill=u.color,r.fillOpacity=this.getHighlightStyle(d,o.datumIndex).opacity??1,r.visible=S}}computeLabelsBBox(t,e){const{calloutLabel:i}=this.properties,{offset:s,maxCollisionOffset:n,minSpacing:a}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const r=[],o=new Ht;let l;const{title:c}=this.properties;if(c?.text&&c.enabled){const h=this.getTitleTranslationY();Number.isFinite(h)&&(o.text=c.text,o.x=0,o.y=h,o.setFont(c),o.setAlign({textBaseline:"bottom",textAlign:"center"}),l=o.getBBox(),r.push(l))}for(const h of this.calloutNodeData){const d=h.calloutLabel;if(!d||h.outerRadius===0)continue;const u=this.getLabelStyle(h,i,"calloutLabel"),p=this.getCalloutLineStyle(h,!1).length,g=h.outerRadius+p+s,f=h.midCos*g,m=h.midSin*g+d.collisionOffsetY;o.text=d.text,o.x=f,o.y=m,o.setFont(u),o.setAlign({textAlign:d.collisionTextAlign??d.textAlign,textBaseline:d.textBaseline}),o.setBoxing(u);const b=o.getBBox();if(d.box=b,Math.abs(d.collisionOffsetY)>n){d.hidden=!0;continue}if(l){const x=-this.centerY,v=new P(l.x-a,x,l.width+2*a,l.y+l.height+a-x);if(b.collidesBBox(v)){d.hidden=!0;continue}}if(t.hideWhenNecessary){const{maxWidth:x,hasVerticalOverflow:v,hasSurroundingSeriesOverflow:S}=this.getLabelOverflow(b,e),I=b.width>x;if(v||I||S){d.hidden=!0;continue}}d.hidden=!1,r.push(b)}return r.length===0?null:P.merge(r)}updateSectorLabelNodes(){const{properties:t}=this,{positionOffset:e,positionRatio:i}=this.properties.sectorLabel,s=this.ctx.highlightManager?.getActiveHighlight(),n=this.isSeriesHighlighted(s),a=this.radiusScale.convert(0),r=a<=0&&this.ctx.legendManager.getData(this.id)?.filter(c=>c.enabled).length===1,o={textAlign:"center",textBaseline:"middle"},l=c=>c.each((h,d)=>{const{outerRadius:u,startAngle:p,endAngle:g}=d,f=n&&this.isItemHighlighted(s,d.datumIndex)===!0;let m=!1;if(d.sectorLabel&&u!==0){const b=this.getLabelStyle(d,t.sectorLabel,"sectorLabel",f),x=a*(1-i)+u*i+e;h.fill=b.color,h.fillOpacity=this.getHighlightStyle(f,d.datumIndex).opacity??1,h.text=d.sectorLabel.text,r?(h.x=0,h.y=0):(h.x=d.midCos*x,h.y=d.midSin*x),h.setFont(b),h.setAlign(o),h.setBoxing(b);const v=h.getBBox(),S=[[v.x,v.y],[v.x+v.width,v.y],[v.x+v.width,v.y+v.height],[v.x,v.y+v.height]],I={startAngle:p,endAngle:g,innerRadius:a,outerRadius:u};S.every(([M,D])=>vf(M,D,I))&&(m=!0)}h.visible=m});l(this.labelSelection),l(this.highlightLabelSelection)}updateInnerLabelNodes(){const t=[],e=[];this.innerLabelsSelection.each((h,d)=>{const{fontStyle:u,fontWeight:p,fontSize:g,fontFamily:f,color:m}=d;h.fontStyle=u,h.fontWeight=p,h.fontSize=g,h.fontFamily=f,h.text=d.text,h.x=0,h.y=0,h.fill=m,h.textAlign="center",t.push(h.getBBox()),e.push(d.spacing)});const i=h=>h===0?0:e[h],s=h=>h===e.length-1?0:e[h],n=t.reduce((h,d)=>Math.max(h,d.width),0),a=t.reduce((h,d,u)=>h+d.height+i(u)+s(u),0),r=this.getInnerRadius(),l=Math.sqrt(Math.pow(n/2,2)+Math.pow(a/2,2))<=(r>0?r:this.getOuterRadius()),c=[];for(let h=0,d=-a/2;h{h.visible=l,Array.isArray(h.text)?h.y=c[u]-t[u].height:h.y=c[u]})}updateZerosumRings(){this.zerosumOuterRing.size=this.getOuterRadius()*2,this.zerosumInnerRing.size=this.getInnerRadius()*2}pickNodeClosestDatum(t){return m$(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n,ctx:{formatManager:a}}=this,{legendItemKey:r,calloutLabelKey:o,calloutLabelName:l,sectorLabelKey:c,sectorLabelName:h,angleKey:d,angleName:u,radiusKey:p,radiusName:g,tooltip:f}=n,m=this.properties.title.node.getPlainText();if(!i||!s)return;const b=s.dataSources.get(this.id)?.data?.[t],x=this.getProcessedDataValues(i,s),{angleRawValues:v}=x,S=v[t],I=this.getLabelContent(t,b,x),M=I.legendItem??I.callout??I.sector??u,D=n$(i.getDomain(this,"angleRaw","value",s)),A=a.format(this.callWithContext.bind(this),{type:"number",value:S,datum:b,seriesId:e,legendItemName:void 0,key:d,source:"tooltip",property:"angle",domain:D,boundSeries:this.getFormatterContext("angle"),fractionDigits:void 0,visibleDomain:void 0})??a$(S,3);return this.formatTooltipWithContext(f,{title:m,symbol:this.legendItemSymbol(t),data:[{label:iC(M),fallbackLabel:d,value:A}]},{seriesId:e,datum:b,title:u,legendItemKey:r,calloutLabelKey:o,calloutLabelName:l,sectorLabelKey:c,sectorLabelName:h,angleKey:d,angleName:u,radiusKey:p,radiusName:g,...this.getItemStyle({datum:b,datumIndex:t},!1)})}legendItemSymbol(t){const e=this.processedData?.dataSources.get(this.id)?.data?.[t],i=this.getItemStyle({datum:e,datumIndex:t},!1),{fillOpacity:s,strokeOpacity:n,strokeWidth:a,lineDash:r,lineDashOffset:o}=this.properties;let{fill:l}=i;const{stroke:c}=i;return tC(l)&&(l={...l,gradient:"linear",rotation:0,reverse:!1}),{marker:{fill:l,stroke:c,fillOpacity:s,strokeOpacity:n,strokeWidth:a,lineDash:r,lineDashOffset:o}}}getLegendData(t){const{visible:e,processedData:i,dataModel:s,id:n,ctx:{legendManager:a}}=this;if(!s||!i||t!=="category")return[];const{angleKey:r,calloutLabelKey:o,sectorLabelKey:l,legendItemKey:c,showInLegend:h}=this.properties;if(!c&&(!o||o===r)&&(!l||l===r))return[];const d=this.getProcessedDataValues(s,i),{angleRawValues:u}=d,p=this.properties.title?.showInLegend&&this.properties.title.text,g=[],f=this.properties.hideZeroValueSectorsInLegend,m=i.dataSources.get(this.id)?.data,b=i.invalidData?.get(this.id);for(let x=0;xiC(D)).join(" - ")},symbol:this.legendItemSymbol(x),legendItemName:c==null?void 0:v[c],hideInLegend:!h})}return g}setLegendState(t){const{id:e,ctx:{legendManager:i,eventsHub:s}}=this;for(const[n,a]of t.entries())i.toggleItem(a,e,n);i.update(),s.emit("chart:request-update",{type:t$.SERIES_UPDATE})}animateEmptyUpdateReady(t){const{animationManager:e}=this.ctx,i=pm(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);Ee(this.id,"nodes",e,[this.itemSelection,this.highlightSelection,this.phantomSelection,this.phantomHighlightSelection],i.nodes,(s,n)=>this.getDatumId(n.datumIndex)),Ee(this.id,"innerCircle",e,[this.innerCircleSelection],i.innerCircle),Te(this,"callout",e,this.calloutLabelSelection),Te(this,"sector",e,this.labelSelection,this.highlightLabelSelection),Te(this,"inner",e,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,phantomHighlightSelection:s,processedData:n,radiusScale:a,previousRadiusScale:r}=this,{animationManager:o}=this.ctx,l=n?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const c=(l?.moved.size??0)===0,h=(n?.defs.keys.length??0)>0,d=n?.reduced?.animationValidation?.uniqueKeys??!0;(!c||!h||!d)&&this.ctx.animationManager.skipCurrentBatch();const u=!this.nodeData.some(g=>g.enabled),p=pm(!1,this.properties.rotation,a,r);Ee(this.id,"nodes",o,[t,e,i,s],p.nodes,(g,f)=>this.getDatumId(f.datumIndex),l),Ee(this.id,"innerCircle",o,[this.innerCircleSelection],p.innerCircle),Te(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Te(this,"sector",this.ctx.animationManager,this.labelSelection,this.highlightLabelSelection),this.noVisibleData!==u&&(this.noVisibleData=u,Te(this,"inner",this.ctx.animationManager,this.innerLabelsSelection)),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,phantomHighlightSelection:s,radiusScale:n,previousRadiusScale:a}=this,{animationManager:r}=this.ctx,o=pm(!1,this.properties.rotation,n,a);Ee(this.id,"nodes",r,[t,e,i,s],o.nodes,(l,c)=>this.getDatumId(c.datumIndex)),Ee(this.id,"innerCircle",r,[this.innerCircleSelection],o.innerCircle),$h(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),$h(this,"sector",this.ctx.animationManager,this.labelSelection,this.highlightLabelSelection),$h(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(t){const{dataModel:e,processedData:i}=this;if(!e||!i)return`${t}`;const{calloutLabelKey:s,sectorLabelKey:n,legendItemKey:a}=this.properties;if(!i.reduced?.animationValidation?.uniqueKeys)return`${t}`;if(a){const r=e.resolveKeysById(this,"legendItemKey",i);return yt(r[t])}else if(s){const r=e.resolveKeysById(this,"calloutLabelKey",i);return yt(r[t])}else if(n){const r=e.resolveKeysById(this,"sectorLabelKey",i);return yt(r[t])}return`${t}`}hasItemStylers(){return!(this.properties.itemStyler==null&&this.properties.calloutLabel.itemStyler==null&&this.properties.sectorLabel.itemStyler==null&&this.properties.innerLabels.every(t=>t.itemStyler==null))}};Nd.className="DonutSeries",Nd.type="donut";import{LABEL_BOXING_DEFAULTS as b$,PART_WHOLE_HIGHLIGHT_STYLE as x$}from"ag-charts-core";import{DEFAULT_SHADOW_COLOUR as v$,FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS as S$,FILL_IMAGE_DEFAULTS as I$,FILL_PATTERN_DEFAULTS as D$,FONT_SIZE_RATIO as M$,LABEL_BOXING_DEFAULTS as aC,PART_WHOLE_HIGHLIGHT_STYLE as A$}from"ag-charts-core";var gm={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:M$.LARGE},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{...aC,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{...aC,enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"chartBackgroundColor"},positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2,colors:{$map:[{$if:[{$or:[{$isGradient:{$value:"$1"}},{$isPattern:{$value:"$1"}},{$isImage:{$value:"$1"}}]},{$path:["../../strokes/$index",{$ref:"foregroundColor"}]},{$value:"$1"}]},{$if:[{$eq:[{$path:"../strokeWidth"},0]},{$path:"../fills"},{$path:"../strokes"}]}]}},fills:{$applyCycle:[{$cacheMax:{$size:{$path:["./data",{$path:"/data"}]}}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",S$],["pattern",D$],["image",I$]]}]},strokes:{$applyCycle:[{$cacheMax:{$size:{$path:["./data",{$path:"/data"}]}}},{$palette:"strokes"}]},fillOpacity:1,strokeOpacity:1,strokeWidth:{$isUserOption:["./strokes/0",2,0]},lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,shadow:{enabled:!1,color:v$,xOffset:3,yOffset:3,blur:5},highlight:A$},legend:{enabled:!0}},C$={...gm,series:{...gm.series,innerRadiusRatio:{$if:[{$eq:[{$path:["./innerRadiusOffset",void 0]},void 0]},.7,void 0]},innerLabels:{$apply:{...b$,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:2}},highlight:x$}},rC={type:"series",name:"donut",chartType:"polar",version:me,dependencies:[bd],options:NS,themeTemplate:C$,create:t=>new Nd(t)},fm=class extends Nd{};fm.className="PieSeries",fm.type="pie";var oC={type:"series",name:"pie",chartType:"polar",version:me,dependencies:[bd],options:ps,themeTemplate:gm,create:t=>new fm(t)};import{callbackOf as T$,object as L$,string as N$}from"ag-charts-core";import{AbstractModuleInstance as k$,ObserveChanges as lC,Property as cC}from"ag-charts-core";var mm=class extends k${constructor(t){super(),this.ctx=t,this.localeText=void 0}};y([lC(t=>{t.ctx.localeManager.setLocaleText(t.localeText)}),cC],mm.prototype,"localeText",2),y([lC(t=>{t.ctx.localeManager.setLocaleTextFormatter(t.getLocaleText)}),cC],mm.prototype,"getLocaleText",2);var ym={type:"plugin",name:"locale",version:me,options:{localeText:L$,getLocaleText:T$(N$)},create:t=>new mm(t)};import"ag-charts-core";var hC={type:"axis",name:"number",chartType:"cartesian",version:me,dependencies:[Ii],options:wr,themeTemplate:{line:{enabled:!1}},create:t=>new vi(t)};import"ag-charts-core";var dC={type:"axis",name:"log",chartType:"cartesian",version:me,dependencies:[Ii],options:Or,themeTemplate:{base:10,line:{enabled:!1}},create:t=>new ho(t)};import"ag-charts-core";var uC={type:"axis",name:"time",chartType:"cartesian",version:me,dependencies:[Ii],options:Er,themeTemplate:{gridLine:{enabled:!1}},create:t=>new Ss(t)};import"ag-charts-core";var pC={type:"axis",name:"category",chartType:"cartesian",version:me,dependencies:[Ii],options:Nr,themeTemplate:{groupPaddingInner:.1,label:{autoRotate:!0,wrapping:"on-space"},gridLine:{enabled:!1},interval:{placement:"between"}},create:t=>new Al(t)};import"ag-charts-core";var gC={type:"axis",name:"grouped-category",chartType:"cartesian",version:me,dependencies:[Ii],options:kr,themeTemplate:{tick:{enabled:!0,stroke:{$ref:"separationLinesColor"}},label:{spacing:10,rotation:270,wrapping:"on-space"},maxThicknessRatio:.5,paddingInner:.4,groupPaddingInner:.2},create:t=>new Cl(t)};import"ag-charts-core";import{Property as mo,dateTruncationForDomain as w$,intervalEpoch as fC,intervalFloor as O$,intervalStep as mC,intervalUnit as yC,lowestGranularityUnitForTicks as E$,lowestGranularityUnitForValue as R$,normalisedTimeExtentWithMetadata as P$,objectsEqual as _$}from"ag-charts-core";var Ks=class extends cM{constructor(t){super(t,new dn,!1),this.defaultTickMinSpacing=20,this.parentLevel=new qr,this.min=void 0,this.max=void 0,this.preferredMin=void 0,this.preferredMax=void 0,this.unit=void 0,this.defaultUnit=void 0}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}hasDefinedDomain(){const{min:t,max:e}=this;return t!=null&&e!=null&&tnew Ks(t)};import"ag-charts-core";var xC=[hC,dC,uC,pC,gC,bC],vC=[yA,AA,PA,GA,ZA,QA],SC=[xC,vC,jf,ym].flat(),IC=[bd,rC,oC,jf,ym],DC=[SC,IC,$M].flat();import{ModuleRegistry as bm}from"ag-charts-core";var xm={};Un(xm,{Arc:()=>Ds,BBox:()=>P,Caption:()=>Se,CategoryScale:()=>fr,Group:()=>U,Line:()=>ri,LinearScale:()=>Va,Marker:()=>We,Path:()=>Ue,RadialColumnShape:()=>Ji,Rect:()=>He,Scene:()=>xc,Sector:()=>At,Shape:()=>$n,TranslatableGroup:()=>mt,getRadialColumnWidth:()=>SM,toRadians:()=>F$});import{toRadians as F$}from"ag-charts-core";var kd={};Un(kd,{ChartTheme:()=>Gi,getChartTheme:()=>zh,resolveOperation:()=>vK,themeNames:()=>xK,themeSymbols:()=>bK,themes:()=>Lg});import{DEFAULT_ANNOTATION_HANDLE_FILL as V$,DEFAULT_ANNOTATION_STATISTICS_COLOR as B$,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE as z$,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL as G$,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE as U$,DEFAULT_ANNOTATION_STATISTICS_FILL as H$,DEFAULT_ANNOTATION_STATISTICS_STROKE as j$,DEFAULT_CAPTION_ALIGNMENT as W$,DEFAULT_CAPTION_LAYOUT_STYLE as Y$,DEFAULT_FIBONACCI_STROKES as $$,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL as K$,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR as Z$,DEFAULT_POLAR_SERIES_STROKE as X$,DEFAULT_SHADOW_COLOUR as q$,DEFAULT_SPARKLINE_CROSSHAIR_STROKE as J$,DEFAULT_TEXTBOX_COLOR as Q$,DEFAULT_TEXTBOX_FILL as eK,DEFAULT_TEXTBOX_STROKE as tK,DEFAULT_TEXT_ANNOTATION_COLOR as iK,DEFAULT_TOOLBAR_POSITION as sK,IS_DARK_THEME as nK,PALETTE_ALT_DOWN_FILL as aK,PALETTE_ALT_DOWN_STROKE as rK,PALETTE_ALT_NEUTRAL_FILL as oK,PALETTE_ALT_NEUTRAL_STROKE as lK,PALETTE_ALT_UP_FILL as cK,PALETTE_ALT_UP_STROKE as hK,PALETTE_DOWN_FILL as dK,PALETTE_DOWN_STROKE as uK,PALETTE_NEUTRAL_FILL as pK,PALETTE_NEUTRAL_STROKE as gK,PALETTE_UP_FILL as fK,PALETTE_UP_STROKE as mK}from"ag-charts-core";YC(kd,yK);import*as yK from"ag-charts-core";var bK={DEFAULT_ANNOTATION_HANDLE_FILL:V$,DEFAULT_ANNOTATION_STATISTICS_COLOR:B$,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:z$,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:G$,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:U$,DEFAULT_ANNOTATION_STATISTICS_FILL:H$,DEFAULT_ANNOTATION_STATISTICS_STROKE:j$,DEFAULT_CAPTION_ALIGNMENT:W$,DEFAULT_CAPTION_LAYOUT_STYLE:Y$,DEFAULT_FIBONACCI_STROKES:$$,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:K$,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:Z$,DEFAULT_POLAR_SERIES_STROKE:X$,DEFAULT_SHADOW_COLOUR:q$,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:J$,DEFAULT_TEXTBOX_COLOR:Q$,DEFAULT_TEXTBOX_FILL:eK,DEFAULT_TEXTBOX_STROKE:tK,DEFAULT_TEXT_ANNOTATION_COLOR:iK,DEFAULT_TOOLBAR_POSITION:sK,IS_DARK_THEME:nK,PALETTE_ALT_DOWN_FILL:aK,PALETTE_ALT_DOWN_STROKE:rK,PALETTE_ALT_NEUTRAL_FILL:oK,PALETTE_ALT_NEUTRAL_STROKE:lK,PALETTE_ALT_UP_FILL:cK,PALETTE_ALT_UP_STROKE:hK,PALETTE_DOWN_FILL:dK,PALETTE_DOWN_STROKE:uK,PALETTE_NEUTRAL_FILL:pK,PALETTE_NEUTRAL_STROKE:gK,PALETTE_UP_FILL:fK,PALETTE_UP_STROKE:mK},xK=Object.keys(Lg);function vK(t){const e=Gi.getDefaultPublicParameters(),i=Gi.getDefaultColors();return new FI({line:{operation:t}},{series:[{type:"line"}]},e,i).resolve().operation}var vm={};Un(vm,{Color:()=>SK,interpolateColor:()=>gb});import{Color as SK}from"ag-charts-core";var IK={VERSION:me,_Scene:xm,_Theme:kd,_Util:vm,create:Cn.create.bind(Cn),createSparkline:Cn.__createSparkline.bind(Cn),setup:()=>{bm.setRegistryMode(bm.RegistryMode.Integrated),bm.registerModules(DC)},isEnterprise:!1};export{Lm as AG_CHARTS_LOCALE_EN_US,Cn as AgCharts,IK as AgChartsCommunityModule,Nm as AgTooltipAnchorToType,km as AgTooltipPlacementType,xC as AllCartesianAxesModule,SC as AllCartesianModule,vC as AllCartesianSeriesModule,DC as AllCommunityModule,IC as AllPolarModule,yA as AreaSeriesModule,AA as BarSeriesModule,PA as BubbleSeriesModule,Ii as CartesianChartModule,pC as CategoryAxisModule,rC as DonutSeriesModule,gC as GroupedCategoryAxisModule,GA as HistogramSeriesModule,jf as LegendModule,ZA as LineSeriesModule,ym as LocaleModule,dC as LogAxisModule,pU as ModuleRegistry,hC as NumberAxisModule,oC as PieSeriesModule,bd as PolarChartModule,QA as ScatterSeriesModule,$M as SparklinePresetModule,uC as TimeAxisModule,bC as UnitTimeAxisModule,me as VERSION,GI as _ModuleSupport,xm as _Scene,kd as _Theme,vm as _Util,FM as _Widget,iT as time};