UNPKG

ag-charts-community

Version:

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

2 lines 1.15 MB
var Bh=Object.defineProperty,Hf=Object.getOwnPropertyDescriptor,VT=Object.getOwnPropertyNames,BT=Object.prototype.hasOwnProperty,nn=(i,t)=>{for(var e in t)Bh(i,e,{get:t[e],enumerable:!0})},Uf=(i,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of VT(t))!BT.call(i,n)&&n!==e&&Bh(i,n,{get:()=>t[n],enumerable:!(s=Hf(t,n))||s.enumerable});return i},zT=(i,t,e)=>(Uf(i,t,"default"),e&&Uf(e,t,"default")),x=(i,t,e,s)=>{for(var n=s>1?void 0:s?Hf(t,e):t,a=i.length-1,r;a>=0;a--)(r=i[a])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&Bh(t,e,n),n},jf={ariaInitSeriesArea:"interactive chart",ariaAnnounceHoverDatum:"${datum}",ariaAnnounceSelectedItem:"selected",ariaAnnounceUnselectedItem:"unselected",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}",ariaAnnounceOrgChartLeaf:"${description}, level ${level}[number], ${posInSet}[number] of ${setSize}[number]",ariaAnnounceOrgChartParent:"${description}, level ${level}[number], ${posInSet}[number] of ${setSize}[number], ${collapsedState}, ${childCount}[number] children, press Enter or Space to toggle",ariaAnnounceOrgChartParentSingular:"${description}, level ${level}[number], ${posInSet}[number] of ${setSize}[number], ${collapsedState}, 1 child, press Enter or Space to toggle",ariaOrgChartCollapsed:"collapsed",ariaOrgChartExpanded:"expanded",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]"},GT=void 0,HT=void 0,UT=void 0,jT=void 0,Wf=(i=>(i.POINTER="pointer",i.NODE="node",i.CHART="chart",i))(Wf||{}),$f=(i=>(i.TOP="top",i.RIGHT="right",i.BOTTOM="bottom",i.LEFT="left",i.TOP_RIGHT="top-right",i.BOTTOM_RIGHT="bottom-right",i.BOTTOM_LEFT="bottom-left",i.TOP_LEFT="top-left",i.CENTER="center",i))($f||{}),WT=void 0,$T=void 0,KT=void 0,YT=void 0;import{Logger as XT}from"ag-charts-core";function Kf(i,t,e,s){return{unit:i,step:t,epoch:e,utc:s,every(n){return Kf(this.unit,(this.step??1)*n,this.epoch,this.utc)}}}var Yf={};function Le(i,t=1,e,s=!1){XT.warnOnce("time import is deprecated, use object notation instead");const n=`${i}:${t}:${e?.getTime()??0}:${s}`;let a=Yf[n];return a==null&&(a=Kf(i,t,e,s),Yf[n]=a),a}var ZT={get millisecond(){return Le("millisecond")},get second(){return Le("second")},get minute(){return Le("minute")},get hour(){return Le("hour")},get day(){return Le("day")},get monday(){return Le("day",7,new Date(1970,0,5))},get tuesday(){return Le("day",7,new Date(1970,0,6))},get wednesday(){return Le("day",7,new Date(1970,0,7))},get thursday(){return Le("day",7,new Date(1970,0,1))},get friday(){return Le("day",7,new Date(1970,0,2))},get saturday(){return Le("day",7,new Date(1970,0,3))},get sunday(){return Le("day",7,new Date(1970,0,4))},get month(){return Le("month")},get year(){return Le("year")},get utcMillisecond(){return Le("millisecond",1,void 0,!0)},get utcSecond(){return Le("second",1,void 0,!0)},get utcMinute(){return Le("minute",1,void 0,!0)},get utcHour(){return Le("hour",1,void 0,!0)},get utcDay(){return Le("day",1,void 0,!0)},get utcMonth(){return Le("month",1,void 0,!0)},get utcYear(){return Le("year",1,void 0,!0)}};import{Debug as il,MementoCaretaker as qT,ModuleRegistry as Xf,deepClone as pa,deepFreeze as JT,enterpriseRegistry as Lr,jsonWalk as QT,strictObjectKeys as eL}from"ag-charts-core";import{ActionOnSet as ms,AgDocument as tL,AsyncAwaitQueue as Zf,ChartAxisDirection as Li,ChartUpdateType as B,CleanupRegistry as iL,Color as qf,Debug as zh,Logger as ys,ModuleRegistry as an,ModuleType as Nr,ZIndexMap as sl,callWithContext as sL,createId as nL,enterpriseRegistry as Jf,entries as Gh,getWindow as aL,isFiniteNumber as Qf,isInputPending as rL,mergeDefaults as rn,pause as em,roundTo as oL,toPlainText as lL}from"ag-charts-core";import{boxContains as cL,boxesEqual as hL,clamp as tm,nearestSquared as dL}from"ag-charts-core";var nl=Symbol("interpolate"),al=i=>i[nl]!=null,uL=(()=>{var i=class Tr{constructor(e,s,n,a){this.x=e,this.y=s,this.width=n,this.height=a}static fromObject({x:e,y:s,width:n,height:a}){return new Tr(e,s,n,a)}static merge(e){let s=1/0,n=1/0,a=-1/0,r=-1/0;for(const o of e)o.x<s&&(s=o.x),o.y<n&&(n=o.y),ht(o.x,o.width)>a&&(a=ht(o.x,o.width)),ht(o.y,o.height)>r&&(r=ht(o.y,o.height));return new Tr(s,n,a-s,r-n)}static nearestBox(e,s,n){return dL(e,s,n)}toDOMRect(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.y,left:this.x,right:ht(this.x,this.width),bottom:ht(this.y,this.height),toJSON(){return{}}}}clone(){const{x:e,y:s,width:n,height:a}=this;return new Tr(e,s,n,a)}equals(e){return hL(this,e)}containsPoint(e,s){return cL(this,e,s)}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 s=Math.max(this.x,e.x),n=Math.max(this.y,e.y),a=Math.min(ht(this.x,this.width),ht(e.x,e.width)),r=Math.min(ht(this.y,this.height),ht(e.y,e.height));if(!(s>a||n>r))return new Tr(s,n,a-s,r-n)}collidesBBox(e){return this.x<ht(e.x,e.width)&&ht(this.x,this.width)>e.x&&this.y<ht(e.y,e.height)&&ht(this.y,this.height)>e.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,s){if(this.containsPoint(e,s))return 0;const n=e-tm(this.x,e,ht(this.x,this.width)),a=s-tm(this.y,s,ht(this.y,this.height));return n*n+a*a}shrink(e,s){if(typeof e=="number")this.applyMargin(e,s);else for(const n of Object.keys(e)){const a=e[n];typeof a=="number"&&this.applyMargin(a,n)}return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this}grow(e,s){if(typeof e=="number")this.applyMargin(-e,s);else for(const n of Object.keys(e)){const a=e[n];typeof a=="number"&&this.applyMargin(-a,n)}return this}applyMargin(e,s){switch(s){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,s){return this.x+=e,this.y+=s,this}[nl](e,s){return new Tr(this.x*(1-s)+e.x*s,this.y*(1-s)+e.y*s,this.width*(1-s)+e.width*s,this.height*(1-s)+e.height*s)}};return i.zero=Object.freeze(new i(0,0,0,0)),i.NaN=Object.freeze(new i(Number.NaN,Number.NaN,Number.NaN,Number.NaN)),i})(),_=uL;function ht(i,t){return i===-1/0&&t===1/0?1/0:i+t}import{clamp as pL,toIterable as gL}from"ag-charts-core";import{getOffscreenCanvas as im}from"ag-charts-core";var sm=1e-8;function on(i,t){const e=t*i,s=e-Math.floor(e),n=Math.abs(s-.5)<sm?e+sm:e;return Math.round(n)}function nm(i,t){return on(i,t)/i}function It(i,t,e){const s=nm(i,t);return e==null?s:e===0?0:e<1?fL(i,e):nm(i,e+t)-s}function am(i,t){return Math.floor(t*i)/i}function fL(i,t){return Math.ceil(t*i)/i}import{Debug as mL}from"ag-charts-core";function rm({context:i,pixelRatio:t,width:e,height:s}){i.save();try{i.resetTransform(),i.clearRect(0,0,Math.ceil(e*t),Math.ceil(s*t))}finally{i.restore()}}function om(i){if(mL.check("canvas")){const t=i.save.bind(i),e=i.restore.bind(i);let s=0;Object.assign(i,{save(){t(),s++},restore(){if(s===0)throw new Error("AG Charts - Unable to restore() past depth 0");e(),s--},verifyDepthZero(){if(s!==0)throw new Error(`AG Charts - Save/restore depth is non-zero: ${s}`)}})}}function lm(i,t,e){return[on(e,i),on(e,t)]}var Hh;function yL(){const i=im();return Hh??(Hh=new i(1,1)),Hh}var Uh=class{constructor(i){const{width:t,height:e,pixelRatio:s,willReadFrequently:n=!1}=i;this.width=t,this.height=e,this.pixelRatio=s;const[a,r]=lm(t,e,s),o=im();this.canvas=new o(a,r),this.context=this.canvas.getContext("2d",{willReadFrequently:n}),this.context.setTransform(s,0,0,s,0,0),om(this.context)}drawImage(i,t=0,e=0){return i.drawImage(this.canvas,t,e)}transferToImageBitmap(){return this.canvas.width<1||this.canvas.height<1?yL().transferToImageBitmap():this.canvas.transferToImageBitmap()}resize(i,t,e){if(!(i>0&&t>0))return;const{canvas:s,context:n}=this;if(i!==this.width||t!==this.height||e!==this.pixelRatio){const[a,r]=lm(i,t,e);s.width=a,s.height=r}n.setTransform(e,0,0,e,0,0),this.width=i,this.height=t,this.pixelRatio=e}clear(){rm(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 cm,Logger as jh,createId as bL,createSvgElement as hm,objectsEqual as vL}from"ag-charts-core";var Wh=(i,t)=>Math.sign(i-t);function dm(i,t){if(typeof i=="number"&&typeof t=="number")return Wh(i,t);const e=typeof i=="number"?[i]:i,s=typeof t=="number"?[t]:t,n=Math.min(e.length,s.length);for(let a=0;a<n;a+=1){const r=Wh(e[a],s[a]);if(r!==0)return r}return Wh(e.length,s.length)}import{SceneChangeDetection as U}from"ag-charts-core";var um=(i=>(i[i.All=0]="All",i[i.None=1]="None",i))(um||{}),xL=5,SL=(()=>{var i=class _f{constructor(e){this.serialNumber=_f._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=bL(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??_f._debugEnabled)&&(this._debugDirtyProperties=new Map([["__first__",[]]]))}static toSVG(e,s,n){const a=e?.toSVG();if(a==null||!a.elements.length&&!a.defs?.length)return;const r=hm("svg");if(r.setAttribute("width",String(s)),r.setAttribute("height",String(n)),r.setAttribute("viewBox",`0 0 ${s} ${n}`),r.setAttribute("overflow","visible"),a.defs?.length){const o=hm("defs");o.append(...a.defs),r.append(o)}return r.append(...a.elements),r.outerHTML}static*extractBBoxes(e,s){for(const n of e)if(!s||n.visible&&!n.transitionOut){const a=n.getBBox();a&&(yield a)}}get datum(){return this._datum}set datum(e){this._datum!==e&&(this._previousDatum=this._datum,this._datum=e)}get previousDatum(){return this._previousDatum}get unsafeNonNullDatum(){return this.datum}get unsafeDatum(){return this.datum}set unsafeDatum(e){this.datum=e}get unsafePreviousDatum(){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}unsafeClosestDatum(){return this.closestDatum()}preRender(e,s=1){if(this.childNodeCounts.groups=0,this.childNodeCounts.nonGroups=1,this.childNodeCounts.complexity=s,this.childNodeCounts.thisComplexity=s,this.batchLevel>0||this.batchDirty)throw new Error("AG Charts - illegal rendering state; batched update in progress");return this.childNodeCounts}isolatedRender(e){const s=e.currentFont;e.ctx.save();try{this.render(e)}catch(n){const a=n.errorCount??1;if(a>=xL)throw n.errorCount=a,n;jh.warnOnce("Error during rendering",n,n.stack)}finally{e.ctx.restore(),e.currentFont=s}}render(e){const{stats:s}=e;if(this.debugDirtyProperties(),e.debugNodeSearch){const n=this.name??this.id;e.debugNodeSearch.some(a=>typeof a=="string"?a===n:a.test(n))&&(e.debugNodes[this.name??this.id]=this)}s&&(s.nodesRendered++,s.opsPerformed+=this.childNodeCounts.thisComplexity)}setScene(e){this.scene=e}*traverseUp(e){e&&(yield this);let s=this.parentNode;for(;s;)yield s,s=s.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{const s=this,n=e,a=Object.keys(n);for(let r=0,o=a.length;r<o;r++){const l=a[r];s[l]=n[l]}}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}return this}setPropertiesWithKeys(e,s){this.batchLevel++;try{const n=this,a=e;for(let r=0,o=s.length;r<o;r++){const l=s[r];n[l]=a[l]}}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}return this}containsPoint(e,s){return!1}distanceSquared(e,s){return 1/0}pickNode(e,s){if(!(!this.visible||this.pointerEvents===1)&&this.containsPoint(e,s))return this}pickNodes(e,s,n=[]){return!this.visible||this.pointerEvents===1||this.containsPoint(e,s)&&n.push(this),n}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 s=this._debugDirtyProperties?.get(e)??[],n=new Error("Stack trace for property change tracking").stack?.split(` `).filter(a=>a!=="Error"&&!a.includes(".markDebugProperties")&&!a.includes(".markDirty")&&!a.includes("Object.assign ")&&!a.includes(`${this.constructor.name}.`))??"unknown";s.push(n[0].replace(" at ","").trim()),this._debugDirtyProperties?.set(e,s)}debugDirtyProperties(){if(this._debugDirtyProperties!=null){if(!this._debugDirtyProperties.has("__first__"))for(const[e,s]of this._debugDirtyProperties.entries())s.length>1&&jh.logGroup(`Property changed multiple times before render: ${this.constructor.name}.${e} (${s.length}x)`,()=>{for(const n of s)jh.log(n)});this._debugDirtyProperties.clear()}}static handleNodeZIndexChange(e){e.onZIndexChange()}onZIndexChange(){this.parentNode?.markDirtyChildrenOrder()}resolveFont(){}toSVG(){}};return i.className="AbstractNode",i._nextSerialNumber=0,i._debugEnabled=!1,x([cm()],i.prototype,"visible",2),x([cm({equals:vL,changeCb:i.handleNodeZIndexChange})],i.prototype,"zIndex",2),i})(),Ni=SL;import{DeclaredSceneChangeDetection as Ki,DeclaredSceneObjectChangeDetection as $h,SceneArrayChangeDetection as IL,SceneObjectChangeDetection as pm,TRIPLE_EQ as DL,boxesEqual as ML,clamp as AL,generateUUID as Kh,isGradientFill as Yh,isImageFill as gm,isPatternFill as fm,isString as CL,objectsEqual as rl}from"ag-charts-core";import{createSvgElement as TL,normalizeAngle360FromDegrees as LL}from"ag-charts-core";import{createSvgElement as NL}from"ag-charts-core";import{Color as Xh,Logger as Zh,clamp as kL,toNumber as wL}from"ag-charts-core";var ol=class{invertWithPercentage(i){return this.invert(i,!0)}snapshotDomain(){return this.domain}restoreDomain(i){this.domain=i}get domainMin(){return this.getDomainMinMax()[0]}get domainMax(){return this.getDomainMinMax()[1]}ticks(i,t,e){}niceDomain(i,t=this.domain){return t}get bandwidth(){}get step(){}get inset(){}},kr=(i,t)=>{const e=Symbol(String(t));i[e]=void 0,Object.defineProperty(i,t,{get(){return this[e]},set(s){this[e]!==s&&(this[e]=s,this.invalid=!0)},enumerable:!0,configurable:!1})};import{clamp as mm,readIntegratedWrappedValue as ym}from"ag-charts-core";function OL(i,t,e){if(e==null||e[0]===0&&e[1]===1)return;const s=mm(0,Math.floor(e[0]*i.length),i.length),n=mm(0,Math.ceil(e[1]*i.length),i.length),a=t?i.length-n:s,r=t?i.length-s:n;return[a,r]}function bm(i,t,e){const s=OL(i,t,e);if(s==null)return{ticks:i,count:i.length,firstTickIndex:0};const[n,a]=s;return{ticks:i.slice(n,a),count:i.length,firstTickIndex:n}}function ll(i){const t=ym(i.at(0)),e=ym(i.at(-1));return t!=null&&e!=null?[t,e]:[void 0,void 0]}var vm=i=>{const t=Xh.fromString(i),[e,s,n]=Xh.RGBtoOKLCH(t.r,t.g,t.b);return{l:e,c:s,h:n,a:t.a}},qh=1e-6,xm=i=>i.c<qh||i.l<qh||i.l>1-qh,EL=(i,t,e)=>{e=kL(0,e,1);let s;if(xm(i))s=t.h;else if(xm(t))s=i.h;else{const o=i.h;let l=t.h;const c=t.h-i.h;c>180?l-=360:c<-180&&(l+=360),s=o*(1-e)+l*e}const n=i.c*(1-e)+t.c*e,a=i.l*(1-e)+t.l*e,r=i.a*(1-e)+t.a*e;return Xh.fromOKLCH(a,n,s,r)},wr=(()=>{var i=class extends ol{constructor(){super(...arguments),this.type="color",this.defaultTickCount=0,this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.mode="continuous",this.parsedRange=this.range.map(vm)}update(){const{domain:t,range:e}=this;t.length<2&&(Zh.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 n=1;n<t.length;n++){const a=t[n-1],r=t[n];if(a>r){Zh.warnOnce("`colorDomain` values should be supplied in ascending order."),t.sort((o,l)=>o-l);break}}const s=this.mode==="discrete"?t.length-1:t.length;if(e.length<s)for(let n=e.length;n<s;n++)e.push(e.length>0?e[0]:"black");this.parsedRange=this.range.map(vm)}normalizeDomains(...t){return{domain:t.map(e=>e.domain).flat(),animatable:!0}}toDomain(){}convert(t){this.refresh();const e=wL(t),{domain:s,range:n,parsedRange:a}=this,r=s[0],o=s.at(-1),l=n[0],c=n.at(-1);if(e<=r)return l;if(e>=o)return c;let h,d;if(s.length===2){const g=(e-r)/(o-r),f=1/(n.length-1);h=n.length<=2?0:Math.min(Math.floor(g*(n.length-1)),n.length-2),d=(g-h*f)/f}else{for(h=0;h<s.length-2&&!(e<s[h+1]);h++);const g=s[h],f=s[h+1];d=(e-g)/(f-g)}if(this.mode==="discrete")return n[h];const u=a[h],p=a[h+1];return EL(u,p,d).toRgbaString()}invert(){}getDomainMinMax(){return ll(this.domain)}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&Zh.warnOnce("Expected update to not invalidate scale"))}};return x([kr],i.prototype,"domain",2),x([kr],i.prototype,"range",2),x([kr],i.prototype,"mode",2),i})(),Jh=class{constructor(i,t=[],e){this.colorSpace=i,this.stops=t,this.bbox=e,this._cache=void 0}createGradient(i,t,e){const s=this.bbox??t;if(!s.isFinite())return;if(this._cache?.ctx===i&&this._cache.bbox.equals(s))return this._cache.gradient;const{stops:n,colorSpace:a}=this;if(n.length===0)return;if(n.length===1)return n[0].color;let r=this.createCanvasGradient(i,s,e);if(r==null)return;const o=a==="oklch",l=.05;let c=n[0];r.addColorStop(c.stop,c.color);for(let h=1;h<n.length;h+=1){const d=n[h];if(o){const u=new wr;u.domain=[c.stop,d.stop],u.range=[c.color,d.color];for(let p=c.stop+l;p<d.stop;p+=l)r.addColorStop(p,u.convert(p)??"transparent")}r.addColorStop(d.stop,d.color),c=d}return"createPattern"in r&&(r=r.createPattern()),this._cache={ctx:i,bbox:s,gradient:r},r}toSvg(i){const t=this.bbox??i,e=this.createSvgGradient(t);for(const{stop:s,color:n}of this.stops){const a=NL("stop");a.setAttribute("offset",`${s}`),a.setAttribute("stop-color",`${n}`),e.appendChild(a)}return e}},RL=class extends Jh{constructor(i,t,e=0,s){super(i,t,s),this.angle=e}createCanvasGradient(i,t,e){const{angle:n}=this,a=LL(n+-90),r=e?.centerX??t.x+t.width*.5,o=e?.centerY??t.y+t.height*.5;return i.createConicGradient(a,r,o)}createSvgGradient(i){return TL("linearGradient")}};import{createSvgElement as PL,normalizeAngle360FromDegrees as _L}from"ag-charts-core";var FL=class extends Jh{constructor(i,t,e=0,s){super(i,t,s),this.angle=e}getGradientPoints(i){const{angle:e}=this,s=_L(e+90),n=Math.cos(s),a=Math.sin(s),r=i.width,o=i.height,l=i.x+r*.5,c=i.y+o*.5,h=Math.hypot(o,r)/2,d=Math.atan2(o,r);let u;s<Math.PI/2?u=s:s<Math.PI?u=Math.PI-s:s<1.5*Math.PI?u=s-Math.PI:u=2*Math.PI-s;const p=h*Math.abs(Math.cos(u-d));return{x0:l+n*p,y0:c+a*p,x1:l-n*p,y1:c-a*p}}createCanvasGradient(i,t){const{x0:e,y0:s,x1:n,y1:a}=this.getGradientPoints(t);if(!(Number.isNaN(e)||Number.isNaN(s)||Number.isNaN(n)||Number.isNaN(a)))return i.createLinearGradient(e,s,n,a)}createSvgGradient(i){const{x0:t,y0:e,x1:s,y1:n}=this.getGradientPoints(i),a=PL("linearGradient");return a.setAttribute("x1",String(t)),a.setAttribute("y1",String(e)),a.setAttribute("x2",String(s)),a.setAttribute("y2",String(n)),a.setAttribute("gradientUnits","userSpaceOnUse"),a}};import{createSvgElement as VL}from"ag-charts-core";var BL=class extends Jh{constructor(i,t,e){super(i,t,e)}createCanvasGradient(i,t,e){const s=e?.centerX??t.x+t.width*.5,n=e?.centerY??t.y+t.height*.5,a=e?.innerRadius??0,r=e?.outerRadius??Math.hypot(t.width*.5,t.height*.5)/Math.SQRT2;return i.createRadialGradient(s,n,a,s,n,r)}createSvgGradient(i){const t=i.x+i.width*.5,e=i.y+i.height*.5,s=VL("radialGradient");return s.setAttribute("cx",String(t)),s.setAttribute("cy",String(e)),s.setAttribute("r",String(Math.hypot(i.width*.5,i.height*.5)/Math.SQRT2)),s.setAttribute("gradientUnits","userSpaceOnUse"),s}};import{BaseProperties as Sm,PropertiesArray as zL,Property as ln,discreteColorStops as Im,resolveStopPositions as GL}from"ag-charts-core";var Dm=(()=>{var i=class extends Sm{constructor(){super(...arguments),this.color="black"}};return x([ln],i.prototype,"stop",2),x([ln],i.prototype,"color",2),x([ln],i.prototype,"name",2),i})(),Qh=(()=>{var i=class extends Sm{constructor(){super(...arguments),this.fills=new zL(Dm),this.mode="continuous"}};return x([ln],i.prototype,"fills",2),x([ln],i.prototype,"domain",2),x([ln],i.prototype,"mode",2),x([ln],i.prototype,"missingDataFill",2),i})();function HL(i,t){const e=t==="discrete"?1:0,s=i.map((n,a,{length:r})=>({stop:(a+e)/(r-1+e),color:n}));return t==="discrete"?Im(s):s}function Mm(i,t,e,s="continuous"){const n=i.map(u=>typeof u=="string"?{color:u}:u);if(n.length===0)return HL(t,s);const a=Math.min(...e),r=Math.max(...e),l=GL(n,a,r,s==="discrete");let c=n.find(u=>u.color!=null)?.color,h;const d=n.map((u,p)=>{let g=u?.color;const f=Math.max(0,Math.min(1,(l[p]-a)/(r-a)));return g!=null?c=g:c==null?(h==null&&(h=new wr,h.domain=[0,1],h.range=t),g=h.convert(f)):g=c,{stop:f,color:g}});return s==="discrete"?Im(d):d}import{Logger as UL,createSvgElement as ed,getDOMMatrix as jL,normalizeAngle360FromDegrees as WL}from"ag-charts-core";var $L=class{constructor(i,t){this.imageLoader=i,this._cache=void 0,this.url=t.url,this.backgroundFill=t.backgroundFill??"black",this.backgroundFillOpacity=t.backgroundFillOpacity??1,this.repeat=t.repeat??"no-repeat",this.width=t.width,this.height=t.height,this.fit=t.fit??"stretch",this.rotation=t.rotation??0}createCanvasImage(i,t,e,s){if(!t)return null;const[n,a]=this.getSize(t.width,t.height,e,s);return n<1||a<1?(UL.warnOnce("Image fill is too small to render, ignoring."),null):i.createPattern(t,this.repeat)}getSize(i,t,e,s){const{fit:n}=this;let a=i,r=t,o=1;const l=e/s,c=i/t;return n==="stretch"||i===0||t===0?(a=e,r=s):n==="contain"?o=c>l?e/i:s/t:n==="cover"&&(o=c>l?s/t:e/i),[Math.max(1,a*o),Math.max(1,r*o)]}setImageTransform(i,t){if(typeof i=="string")return;const{url:e,rotation:s,width:n,height:a}=this,r=this.imageLoader?.loadImage(e);if(!r)return;const o=WL(s),l=Math.cos(o),c=Math.sin(o),[h,d]=this.getSize(r.width,r.height,n??t.width,a??t.height),u=h/r.width,p=d/r.height,g=t.x+t.width/2,f=t.y+t.height/2,m=l*h-c*d,y=c*h+l*d,b=m/2,v=y/2,S=jL();i?.setTransform(new S([l*u,c*p,-c*u,l*p,g-b,f-v]))}createPattern(i,t,e,s){const n=this.width??t,a=this.height??e,r=this._cache;if(r?.ctx===i&&r.width===n&&r.height===a)return r.pattern;const o=this.imageLoader?.loadImage(this.url,s),l=this.createCanvasImage(i,o,n,a);if(l!=null)return this._cache={ctx:i,pattern:l,width:n,height:a},l}toSvg(i,t){const{url:e,rotation:s,backgroundFill:n,backgroundFillOpacity:a}=this,{x:r,y:o,width:l,height:c}=i,h=ed("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=ed("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=ed("image");return u.setAttribute("href",e),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/t}) rotate(${s}, ${l/2}, ${c/2})`),h.appendChild(u),h}};import{Logger as KL,createSvgElement as td,getDOMMatrix as YL,normalizeAngle360FromDegrees as XL}from"ag-charts-core";import{bezier2DDistance as ZL,bezier2DExtrema as qL,evaluateBezier as Am,getPath2D as Cm,lineDistanceSquared as Tm,normalizeAngle360 as Lm}from"ag-charts-core";import{Logger as Nm}from"ag-charts-core";var JL=/^[\t\n\f\r ]*([achlmqstvz])[\t\n\f\r ]*/i,ce=/^[+-]?((\d*\.\d+)|(\d+\.)|(\d+))(e[+-]?\d+)?/i,QL=/[\t\n\f\r ]*,?[\t\n\f\r ]*/,km=/^[01]/,eN={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,km,km,ce,ce]};function tN(i){if(!i)return;const t=[];let e=0,s;for(;e<i.length;){const n=JL.exec(i.slice(e));let a;if(n==null){if(!s){Nm.warnOnce(`Invalid SVG path, error at index ${e}: Missing command.`);return}a=s}else a=n[1],e+=n[0].length;const r=iN(a,i,e);if(!r)return;e=r[0],s=a,t.push(r[1])}return t}function iN(i,t,e){const s=eN[i.toLocaleLowerCase()],n={command:i,params:[]};for(const a of s){const r=t.slice(e),o=a.exec(r);if(o!=null){n.params.push(Number.parseFloat(o[0])),e+=o[0].length;const l=QL.exec(r.slice(o[0].length));l!=null&&(e+=l[0].length)}else{if(n.params.length===1)return[e,n];Nm.warnOnce(`Invalid SVG path, error at index ${e}: No path segment parameters for command [${i}]`);return}}return[e,n]}function sN(i,t){const e=-t/i;return i!==0&&e>=0&&e<=1?[e]:[]}function nN(i,t,e,s=1e-6){if(Math.abs(i)<s)return sN(t,e);const n=t*t-4*i*e,a=[];if(Math.abs(n)<s){const r=-t/(2*i);r>=0&&r<=1&&a.push(r)}else if(n>0){const r=Math.sqrt(n),o=(-t-r)/(2*i),l=(-t+r)/(2*i);o>=0&&o<=1&&a.push(o),l>=0&&l<=1&&a.push(l)}return a}function aN(i,t,e,s,n=1e-6){if(Math.abs(i)<n)return nN(t,e,s,n);const a=t/i,r=e/i,o=s/i,l=(3*r-a*a)/9,c=(9*a*r-27*o-2*a*a*a)/54,h=l*l*l+c*c,d=1/3,u=[];if(h>=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),y=-d*a+(g+f);if(y>=0&&y<=1&&u.push(y),Math.abs(m)<n){const b=-d*a-(g+f)/2;b>=0&&b<=1&&u.push(b)}}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,y=f*Math.cos(d*(p+2*Math.PI))-g,b=f*Math.cos(d*(p+4*Math.PI))-g;m>=0&&m<=1&&u.push(m),y>=0&&y<=1&&u.push(y),b>=0&&b<=1&&u.push(b)}return u}function Gt(i,t,e,s,n,a,r,o){const l=(e-i)*(o-a)-(s-t)*(r-n);if(l===0)return 0;const c=((r-n)*(t-a)-(i-n)*(o-a))/l,h=((e-i)*(t-a)-(s-t)*(i-n))/l;return c>=0&&c<=1&&h>=0&&h<=1?1:0}function rN(i,t,e,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=wm(i,e,n,r),y=wm(t,s,a,o),b=p*m[0]+g*y[0],v=p*m[1]+g*y[1],S=p*m[2]+g*y[2],D=p*m[3]+g*y[3]+f,I=aN(b,v,S,D);for(const M of I){const A=M*M,C=M*A,T=m[0]*C+m[1]*A+m[2]*M+m[3],L=y[0]*C+y[1]*A+y[2]*M+y[3];let k;l===h?k=(L-c)/(d-c):k=(T-l)/(h-l),k>=0&&k<=1&&u++}return u}function wm(i,t,e,s){return[-i+3*t-3*e+s,3*i-6*t+3*e,-3*i+3*t,i]}var cn=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 i=Cm();this.path2d=new i}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(i,t){this.openedPath=!0,this.sx=i,this.sy=t,this.cx=i,this.cy=t,this.path2d.moveTo(i,t),this.commands[this.commandsLength++]=0,this.params[this.paramsLength++]=i,this.params[this.paramsLength++]=t}lineTo(i,t){this.openedPath?(this.cx=i,this.cy=t,this.path2d.lineTo(i,t),this.commands[this.commandsLength++]=1,this.params[this.paramsLength++]=i,this.params[this.paramsLength++]=t):this.moveTo(i,t)}cubicCurveTo(i,t,e,s,n,a){this.openedPath||this.moveTo(i,t),this.path2d.bezierCurveTo(i,t,e,s,n,a),this.commands[this.commandsLength++]=2,this.params[this.paramsLength++]=i,this.params[this.paramsLength++]=t,this.params[this.paramsLength++]=e,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(i,t,e,s){this.moveTo(i,t),this.lineTo(i+e,t),this.lineTo(i+e,t+s),this.lineTo(i,t+s),this.closePath()}roundRect(i,t,e,s,n){n=Math.min(n,e/2,s/2),this.moveTo(i,t+n),this.arc(i+n,t+n,n,Math.PI,1.5*Math.PI),this.lineTo(i+n,t),this.lineTo(i+e-n,t),this.arc(i+e-n,t+n,n,1.5*Math.PI,2*Math.PI),this.lineTo(i+e,t+n),this.lineTo(i+e,t+s-n),this.arc(i+e-n,t+s-n,n,0,Math.PI/2),this.lineTo(i+e-n,t+s),this.lineTo(i+n,t+s),this.arc(i+ +n,t+s-n,n,Math.PI/2,Math.PI),this.lineTo(i,t+s-n),this.closePath()}ellipse(i,t,e,s,n,a,r,o=!1){const l=e,c=s/e,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=i+h*g+u*f,y=t+d*g+p*f,b=(m-this.cx)**2+(y-this.cy)**2;this.openedPath?b>1e-6&&this.lineTo(m,y):this.moveTo(m,y);let v=o?-Lm(a-r):Lm(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),D=v/S,I=4/3*Math.tan(D/4);for(let M=0;M<S;M+=1){const A=a+D*(M+0),C=a+D*(M+1),T=l*Math.sin(A),L=l*Math.cos(A),k=l*Math.sin(C),w=l*Math.cos(C),O=L-I*T,N=T+I*L,R=w+I*k,P=k-I*w,E=w,F=k;this.cubicCurveTo(i+h*O+u*N,t+d*O+p*N,i+h*R+u*P,t+d*R+p*P,i+h*E+u*F,t+d*E+p*F)}}arc(i,t,e,s,n,a){this.ellipse(i,t,e,e,0,s,n,a)}appendSvg(i){const t=tN(i);if(t==null)return!1;let e=0,s=0,n,a,r=0,o=0;for(const{command:l,params:c}of t){n??(n=c[0]),a??(a=c[1]);const h=l===l.toLowerCase(),d=h?n:0,u=h?a:0;switch(l.toLowerCase()){case"m":this.moveTo(d+c[0],u+c[1]),n=d+c[0],a=u+c[1],e=n,s=a;break;case"c":this.cubicCurveTo(d+c[0],u+c[1],d+c[2],u+c[3],d+c[4],u+c[5]),r=d+c[2],o=u+c[3],n=d+c[4],a=u+c[5];break;case"s":this.cubicCurveTo(n+n-r,a+a-o,d+c[0],u+c[1],d+c[2],u+c[3]),r=d+c[0],o=u+c[1],n=d+c[2],a=u+c[3];break;case"q":this.cubicCurveTo((d+2*c[0])/3,(u+2*c[1])/3,(2*c[0]+c[2])/3,(2*c[1]+c[3])/3,c[2],c[3]),r=c[0],o=c[1],n=c[2],a=c[3];break;case"t":this.cubicCurveTo((n+2*(n+n-r))/3,(a+2*(a+a-o))/3,(2*(n+n-r)+c[0])/3,(2*(a+a-o)+c[1])/3,c[0],c[1]),r=n+n-r,o=a+a-o,n=c[0],a=c[1];break;case"a":this.svgEllipse(n,a,c[0],c[1],c[2]*Math.PI/180,c[3],c[4],d+c[5],u+c[6]),n=d+c[5],a=u+c[6];break;case"h":this.lineTo(d+c[0],a),n=d+c[0];break;case"l":this.lineTo(d+c[0],u+c[1]),n=d+c[0],a=u+c[1];break;case"v":this.lineTo(n,u+c[0]),a=u+c[0];break;case"z":this.closePath(),n=e,a=s;break;default:throw new Error(`Could not translate command '${l}' with '${c.join(" ")}'`)}}return!0}svgEllipse(i,t,e,s,n,a,r,o,l){e=Math.abs(e),s=Math.abs(s);const c=(i-o)/2,h=(t-l)/2,d=Math.sin(n),u=Math.cos(n),p=u*c+d*h,g=-d*c+u*h,f=p/e,m=g/s;let y=f*f+m*m,b=(i+o)/2,v=(t+l)/2,S=0,D=0;y>=1?(y=Math.sqrt(y),e*=y,s*=y):(y=Math.sqrt(1/y-1),a===r&&(y=-y),S=y*e*m,D=-y*s*f,b+=u*S-d*D,v+=d*S+u*D);const I=Math.atan2((g-D)/s,(p-S)/e),M=Math.atan2((-g-D)/s,(-p-S)/e)-I,A=I+M,C=!!(1-r);this.ellipse(b,v,e,s,n,I,A,C)}clear(i){i?(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 t=Cm();this.path2d=new t,this.openedPath=!1,this.closedPath=!1}isPointInPath(i,t){const e=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<n;u++)switch(e[u]){case 0:d+=Gt(o,l,c,h,a,r,i,t),c=s[p++],o=c,h=s[p++],l=h;break;case 1:d+=Gt(c,h,s[p++],s[p++],a,r,i,t),c=s[p-2],h=s[p-1];break;case 2:d+=rN(c,h,s[p++],s[p++],s[p++],s[p++],s[p++],s[p++],a,r,i,t),c=s[p-2],h=s[p-1];break;case 3:d+=Gt(o,l,c,h,a,r,i,t);break}return d%2===1}distanceSquared(i,t){let e=1/0;const s=this.commands,n=this.params,a=this.commandsLength;let r=Number.NaN,o=Number.NaN,l=0,c=0;for(let h=0,d=0;h<a;h++)switch(s[h]){case 0:l=r=n[d++],c=o=n[d++];break;case 1:{const u=l,p=c;l=n[d++],c=n[d++],e=Tm(i,t,u,p,l,c,e);break}case 2:{const u=l,p=c,g=n[d++],f=n[d++],m=n[d++],y=n[d++];l=n[d++],c=n[d++],e=ZL(u,p,g,f,m,y,l,c,i,t)**2;break}case 3:e=Tm(i,t,l,c,r,o,e);break}return e}toSVG(i=(t,e)=>({x:t,y:e})){const t=[],{commands:e,params:s}=this,n=(r,o)=>{t.push(r);for(let l=0;l<o;l+=2){const{x:c,y:h}=i(s[a++],s[a++]);t.push(c,h)}};let a=0;for(let r=0;r<this.commandsLength;r++)switch(e[r]){case 0:n("M",2);break;case 1:n("L",2);break;case 2:n("C",6);break;case 3:n("Z",0);break}return t.join(" ")}computeBBox(){const{commands:i,params:t}=this;let[e,s,n,a]=[1/0,1/0,-1/0,-1/0],[r,o]=[Number.NaN,Number.NaN],[l,c]=[Number.NaN,Number.NaN];const h=(u,p)=>{e=Math.min(p,e),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;u<this.commandsLength;u++)switch(i[u]){case 0:h(t[d++],t[d++]),l=r,c=o;break;case 1:h(t[d++],t[d++]);break;case 2:{const g=r,f=o,m=t[d++],y=t[d++],b=t[d++],v=t[d++],S=t[d++],D=t[d++],I=qL(g,f,m,y,b,v,S,D);for(const M of I){const A=Am(g,m,b,S,M),C=Am(f,y,v,D,M);h(A,C)}h(S,D);break}case 3:h(l,c),l=Number.NaN,c=Number.NaN;break}return new _(s,e,n-s,a-e)}};import{toRadians as cl}from"ag-charts-core";function id(i,t,e){const{width:s,height:n,padding:a,strokeWidth:r}=t,o=s/2,l=n/2,c=Math.max(1,s-a-r/2),h=Math.max(1,n-a-r/2);let d=!1;for(const[u,p]of e){const g=o+(u-.5)*c,f=l+(p-.5)*h;d?i.lineTo(g,f):i.moveTo(g,f),d=!0}i.closePath()}var Om={circles(i,{width:t,strokeWidth:e,padding:s}){const n=t/2,a=Math.max(1,n-s-e/2);i.arc(n,n,a,0,Math.PI*2)},squares(i,{width:t,height:e,pixelRatio:s,padding:n,strokeWidth:a}){const r=n+a/2;i.moveTo(It(s,r),It(s,r)),i.lineTo(It(s,t-r),It(s,r)),i.lineTo(It(s,t-r),It(s,e-r)),i.lineTo(It(s,r),It(s,e-r)),i.closePath()},triangles(i,t){id(i,t,[[.5,0],[1,1],[0,1]])},diamonds(i,t){id(i,t,[[.5,0],[1,.5],[.5,1],[0,.5]])},stars(i,{width:t,height:e,padding:s}){const a=Math.max(1,(t-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=t/2+Math.cos(h)*c,u=e/2+Math.sin(h)*c;i.lineTo(d,u)}i.closePath()},hearts(i,{width:t,height:e,padding:s}){const n=Math.max(1,t/4-s/2),a=t/2,r=e/2+n/2;i.arc(a-n,r-n,n,cl(130),cl(330)),i.arc(a+n,r-n,n,cl(220),cl(50)),i.lineTo(a,r+n),i.closePath()},crosses(i,t){id(i,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]])},"vertical-lines"(i,{width:t,height:e,pixelRatio:s,strokeWidth:n}){const a=It(s,t/2)-n%2/2;i.moveTo(a,0),i.lineTo(a,e)},"horizontal-lines"(i,{width:t,height:e,pixelRatio:s,strokeWidth:n}){const a=It(s,e/2)-n%2/2;i.moveTo(0,a),i.lineTo(t,a)},"forward-slanted-lines"(i,{width:t,height:e,strokeWidth:s}){const n=Math.atan2(e,t),a=s*Math.cos(n),r=s*Math.sin(n);i.moveTo(-a,r),i.lineTo(a,-r),i.moveTo(-a,e+r),i.lineTo(t+a,-r),i.moveTo(t-a,e+r),i.lineTo(t+a,e-r)},"backward-slanted-lines"(i,{width:t,height:e,strokeWidth:s}){const n=Math.atan2(e,t),a=s*Math.cos(n),r=s*Math.sin(n);i.moveTo(t-a,-r),i.lineTo(t+a,r),i.moveTo(-a,-r),i.lineTo(t+a,e+r),i.moveTo(-a,e-r),i.lineTo(a,e+r)}},oN=class{constructor(i){this._cache=void 0,this.width=Math.max(i?.width??10,1),this.height=Math.max(i?.height??10,1),this.fill=i.fill??"none",this.fillOpacity=i.fillOpacity??1,this.backgroundFill=i.backgroundFill??"none",this.backgroundFillOpacity=i.backgroundFillOpacity??1,this.stroke=i.stroke??"black",this.strokeOpacity=i.strokeOpacity??1,this.strokeWidth=i.strokeWidth??1,this.padding=i.padding??1,this.pattern=i.pattern??"forward-slanted-lines",this.rotation=i.rotation??0,this.scale=i.scale??1,this.path=i.path}getPath(i){const{pattern:t,width:e,height:s,padding:n,strokeWidth:a,path:r}=this,o=new cn;let l=Om[t]!=null;return r&&l&&(l=!o.appendSvg(r)),l&&Om[t](o,{width:e,height:s,pixelRatio:i,strokeWidth:a,padding:n}),o}renderStroke(i,t){const{stroke:e,strokeWidth:s,strokeOpacity:n}=this;s&&(t.strokeStyle=e,t.lineWidth=s,t.globalAlpha=n,t.stroke(i))}renderFill(i,t){const{fill:e,fillOpacity:s}=this;e!=="none"&&(t.fillStyle=e,t.globalAlpha=s,t.fill(i))}createCanvasPattern(i,t){const{width:e,height:s,scale:n,backgroundFill:a,backgroundFillOpacity:r}=this;if(e*n<1||s*n<1)return KL.warnOnce("Pattern fill is too small to render, ignoring."),null;const o=new Uh({width:e,height:s,pixelRatio:t*n}),l=o.context;a!=="none"&&(l.fillStyle=a,l.globalAlpha=r,l.fillRect(0,0,e,s));const c=this.getPath(t).getPath2D();this.renderFill(c,l),this.renderStroke(c,l);const h=i.createPattern(o.canvas,"repeat");return this.setPatternTransform(h,t),o.destroy(),h}setPatternTransform(i,t,e=0,s=0){if(i==null)return;const n=XL(this.rotation),a=1/t,r=Math.cos(n)*a,o=Math.sin(n)*a,l=YL();i.setTransform(new l([r,o,-o,r,e,s]))}createPattern(i,t){if(this._cache?.ctx===i&&this._cache.pixelRatio===t)return this._cache.pattern;const e=this.createCanvasPattern(i,t);if(e!=null)return this._cache={ctx:i,pattern:e,pixelRatio:t},e}toSvg(){const{width:i,height:t,fill:e,fillOpacity:s,backgroundFill:n,backgroundFillOpacity:a,stroke:r,strokeWidth:o,strokeOpacity:l,rotation:c,scale:h}=this,d=td("pattern");d.setAttribute("viewBox",`0 0 ${i} ${t}`),d.setAttribute("width",String(i)),d.setAttribute("height",String(t)),d.setAttribute("patternUnits","userSpaceOnUse");const u=td("rect");u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(i)),u.setAttribute("height",String(t)),u.setAttribute("fill",n),u.setAttribute("fill-opacity",String(a)),d.appendChild(u);const p=td("path");return p.setAttribute("fill",e),p.setAttribute("fill-opacity",String(s)),p.setAttribute("stroke-opacity",String(l)),p.setAttribute("stroke",r),p.setAttribute("stroke-width",String(o)),p.setAttribute("transform",`rotate(${c}) scale(${h})`),p.setAttribute("d",this.getPath(1).toSVG()),d.appendChild(p),d}};function Em(i,t){const{fontStyle:e,fontWeight:s,fontSize:n,fontFamily:a}=t;e&&i.setAttribute("font-style",e),s&&i.setAttribute("font-weight",String(s)),n!=null&&i.setAttribute("font-size",String(n)),a&&i.setAttribute("font-family",a)}function lN(i,t){const{stroke:e,strokeWidth:s,strokeOpacity:n}=t;e&&i.setAttribute("stroke",e),s!=null&&i.setAttribute("stroke-width",String(s)),n!=null&&i.setAttribute("stroke-opacity",String(n))}function cN(i,t){const{lineDash:e,lineDashOffset:s}=t;if(e?.some(n=>n!==0)){const n=e.length%2===1?[...e,...e]:e;i.setAttribute("stroke-dasharray",n.join(" ")),s!=null&&i.setAttribute("stroke-dashoffset",String(s))}}var hN=(()=>{var i=class extends Ni{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(Yh(e))return this.createGradient(e)}createGradient(e){const{colorSpace:s="rgb",gradient:n="linear",colorStops:a,rotation:r=0,reverse:o=!1}=e;if(a==null)return;let l=Mm(a,["black"],[0,1]);switch(o&&(l=l.map(c=>({color:c.color,stop:1-c.stop})).reverse()),n){case"linear":return new FL(s,l,r);case"radial":return new BL(s,l);case"conic":return new RL(s,l,r)}}getPattern(e){if(fm(e))return this.createPattern(e)}createPattern(e){return new oN(e)}getImage(e){if(gm(e))return this.createImage(e)}createImage(e){return new $L(this.imageLoader,e)}onFillChange(){typeof this.fill=="object"&&rl(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,s){return It(this.layerManager?.canvas?.pixelRatio??1,e,s)}markDirty(e){super.markDirty(e),this.cachedDefaultGradientFillBBox=void 0}fillStroke(e,s,n,a){this.__drawingMode==="cutout"&&(e.globalCompositeOperation="destination-out",this.executeFill(e,s),e.globalCompositeOperation="source-over"),this.renderFill(e,s,n,a),this.renderStroke(e,s,n)}renderFill(e,s,n,a){const{__fill:r,__fillOpacity:o=1,fillImage:l}=this;if(r!=null&&r!=="none"&&o>0){const c=e.globalAlpha;l&&(e.globalAlpha=l.backgroundFillOpacity,e.fillStyle=l.backgroundFill,this.executeFill(e,s),e.globalAlpha=c),this.applyFillAndAlpha(e,n,a),this.applyShadow(e),this.executeFill(e,s),e.globalAlpha=c,this.fillShadow?.enabled&&(e.shadowColor="rgba(0, 0, 0, 0)")}}executeFill(e,s){s?e.fill(s):e.fill()}applyFillAndAlpha(e,s,n){const{__fill:a,fillGradient:r,fillPattern:o,fillImage:l,__fillOpacity:c=1,__opacity:h=1}=this,d=h*c;if(d!==1&&(e.globalAlpha*=d),r){const u=n??this.fillBBox??this.getDefaultGradientFillBBox()??s??this.getBBox(),{fillParams:p}=this;e.fillStyle=r.createGradient(e,u,p)??"black"}else if(o){const{x:u,y:p}=s??this.getBBox(),g=this.layerManager?.canvas?.pixelRatio??1,f=o.createPattern(e,g);o.setPatternTransform(f,g,u,p),f?e.fillStyle=f:(e.fillStyle=o.fill,e.globalAlpha*=o.fillOpacity)}else if(l){const u=s??this.getBBox(),p=l.createPattern(e,u.width,u.height,this);l.setImageTransform(p,u),e.fillStyle=p??"transparent"}else e.fillStyle=typeof a=="string"?a:"black"}applyStrokeAndAlpha(e,s){const{__stroke:n,__strokeOpacity:a=1,strokeGradient:r,__opacity:o=1}=this;e.strokeStyle=r?.createGradient(e,s??this.getBBox())??(typeof n=="string"?n:void 0)??"black";const l=o*a;l!==1&&(e.globalAlpha*=l)}applyShadow(e){const s=this.layerManager?.canvas.pixelRatio??1,{__fillShadow:n}=this;n?.enabled&&(e.shadowColor=n.color,e.shadowOffsetX=n.xOffset*s,e.shadowOffsetY=n.yOffset*s,e.shadowBlur=n.blur*s)}renderStroke(e,s,n){const{__stroke:a,__strokeWidth:r=0,__strokeOpacity:o=1,__lineDash:l,__lineDashOffset:c,__lineCap:h,__lineJoin:d,__miterLimit:u}=this;if(a!=null&&a!=="none"&&r>0&&o>0){const{globalAlpha:p}=e;this.applyStrokeAndAlpha(e,n),e.lineWidth=r,l&&e.setLineDash(l),c&&(e.lineDashOffset=c),h&&(e.lineCap=h),d&&(e.lineJoin=d),u!=null&&(e.miterLimit=u),this.executeStroke(e,s),e.globalAlpha=p}}executeStroke(e,s){s?e.stroke(s):e.stroke()}getDefaultGradientFillBBox(){return this.cachedDefaultGradientFillBBox??(this.cachedDefaultGradientFillBBox=Object.freeze(this.computeDefaultGradientFillBBox())),this.cachedDefaultGradientFillBBox}computeDefaultGradientFillBBox(){}containsPoint(e,s){return this.isPointInPath(e,s)}applySvgFillAttributes(e,s){const{fill:n,fillOpacity:a}=this;if(typeof n=="string")e.setAttribute("fill",n);else if(Yh(n)&&this.fillGradient){s??(s=[]);const r=this.fillGradient.toSvg(this.fillBBox??this.getBBox()),o=Kh();r.setAttribute("id",o),s.push(r),e.setAttribute("fill",`url(#${o})`)}else if(fm(n)&&this.fillPattern){s??(s=[]);const r=this.fillPattern.toSvg(),o=Kh();r.setAttribute("id",o),s.push(r),e.setAttribute("fill",`url(#${o})`)}else if(gm(n)&&this.fillImage){s??(s=[]);const r=this.layerManager?.canvas?.pixelRatio??1,o=this.fillImage.toSvg(this.getBBox(),r),l=Kh();o.setAttribute("id",l),s.push(o),e.setAttribute("fill",`url(#${l})`)}else e.setAttribute("fill","none");return e.setAttribute("fill-opacity",String(a)),s}applySvgStrokeAttributes(e){const{stroke:s,strokeOpacity:n,strokeWidth:a,lineDash:r,lineDashOffset:o}=this;lN(e,{stroke:CL(s)?s:void 0,strokeOpacity:n,strokeWidth:a}),cN(e,{lineDash:r,lineDashOffset:o})}static handleFillChange(e){e.onFillChange()}static handleStrokeChange(e){e.onStrokeChange()}setStyleProperties(e,s,n){const a=e?.opacity??1,r=e?.fill,o=(e?.fillOpacity??1)*a,l=(e?.strokeOpacity??1)*a,c=e?.st