UNPKG

ag-charts-community

Version:

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

5 lines 140 kB
"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var i in t)__defProp(e,i,{get:t[i],enumerable:!0})},__copyProps=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of __getOwnPropNames(t))!__hasOwnProp.call(e,n)&&n!==i&&__defProp(e,n,{get:()=>t[n],enumerable:!(s=__getOwnPropDesc(t,n))||s.enumerable});return e},__toESM=(e,t,i)=>(i=e!=null?__create(__getProtoOf(e)):{},__copyProps(t||!e||!e.__esModule?__defProp(i,"default",{value:e,enumerable:!0}):i,e)),__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__decorateClass=(e,t,i,s)=>{for(var n=s>1?void 0:s?__getOwnPropDesc(t,i):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(n=(s?a(t,i,n):a(n))||n);return s&&n&&__defProp(t,i,n),n},integrated_charts_scene_exports={};__export(integrated_charts_scene_exports,{Arc:()=>Arc,BBox:()=>BBox,Caption:()=>Caption,CategoryScale:()=>CategoryScale,Group:()=>Group,Line:()=>Line,LinearScale:()=>LinearScale,Marker:()=>Marker,Path:()=>Path,RadialColumnShape:()=>RadialColumnShape,Rect:()=>Rect,Scene:()=>Scene,Sector:()=>Sector,Shape:()=>Shape,TranslatableGroup:()=>TranslatableGroup,getRadialColumnWidth:()=>getRadialColumnWidth,toRadians:()=>toRadians}),module.exports=__toCommonJS(integrated_charts_scene_exports);var import_ag_charts_core25=require("ag-charts-core"),import_ag_charts_core3=require("ag-charts-core"),core=__toESM(require("ag-charts-core")),BREAK_TRANSFORM_CHAIN=Symbol("BREAK"),CONFIG_KEY="__decorator_config",ACCESSORS_KEY="__decorator_accessors";function addFakeTransformToInstanceProperty(e,t){initialiseConfig(e,t).optional=!0}function initialiseConfig(e,t){if(Object.getOwnPropertyDescriptor(e,CONFIG_KEY)==null&&Object.defineProperty(e,CONFIG_KEY,{value:{}}),Object.getOwnPropertyDescriptor(e,ACCESSORS_KEY)==null){const l=Object.getPrototypeOf(e)?.[ACCESSORS_KEY]?.slice()??[];Object.defineProperty(e,ACCESSORS_KEY,{value:l})}const i=e[CONFIG_KEY],s=t.toString();if(i[s]!=null)return i[s];i[s]={setters:[],getters:[],observers:[]};const n=Object.getOwnPropertyDescriptor(e,t);let r=n?.get,a=n?.set;if(r==null||a==null){const h=e[ACCESSORS_KEY];let l=h.indexOf(t);l===-1&&(l=h.push(t)-1),r??(r=function(){let d=this.__accessors;return d==null&&(d=h.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:d})),d[l]}),a??(a=function(d){let u=this.__accessors;u==null&&(u=h.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:u})),u[l]=d})}return Object.defineProperty(e,t,{set:function(h){const{setters:l,observers:d}=i[s];let u;l.some(f=>f.length>2)&&(u=r.call(this));for(const f of l)if(h=f(this,t,h,u),h===BREAK_TRANSFORM_CHAIN)return;a.call(this,h);for(const f of d)f(this,h,u)},get:function(){let h=r.call(this);for(const l of i[s].getters)if(h=l(this,t,h),h===BREAK_TRANSFORM_CHAIN)return;return h},enumerable:!0,configurable:!1}),i[s]}function addTransformToInstanceProperty(e,t,i){return(s,n)=>{const r=initialiseConfig(s,n);r.setters.push(e),t&&r.getters.unshift(t),i&&Object.assign(r,i)}}function addObserverToInstanceProperty(e){return(t,i)=>{initialiseConfig(t,i).observers.push(e)}}function isDecoratedObject(e){return typeof e<"u"&&CONFIG_KEY in e}function listDecoratedProperties(e){const t=new Set;for(;isDecoratedObject(e);)t.add(e?.[CONFIG_KEY]),e=Object.getPrototypeOf(e);return Array.from(t).flatMap(i=>Object.keys(i))}var{entries,isArray,isObject,isPlainObject}=core;function objectsEqual(e,t){return Array.isArray(e)?!Array.isArray(t)||e.length!==t.length?!1:e.every((i,s)=>objectsEqual(i,t[s])):isPlainObject(e)?isPlainObject(t)?objectsEqualWith(e,t,objectsEqual):!1:e===t}function objectsEqualWith(e,t,i){if(Object.is(e,t))return!0;for(const s of Object.keys(t))if(!(s in e))return!1;for(const s of Object.keys(e))if(!(s in t)||!i(e[s],t[s]))return!1;return!0}function merge(...e){const t={};for(const i of e){if(!isObject(i))continue;const s=isDecoratedObject(i)?listDecoratedProperties(i):Object.keys(i);for(const n of s)isPlainObject(t[n])&&isPlainObject(i[n])?t[n]=merge(t[n],i[n]):n in t||(t[n]??(t[n]=i[n]))}return t}var import_ag_charts_core=require("ag-charts-core"),interpolate=Symbol("interpolate");function nearestSquared(e,t,i,s=1/0){const n={nearest:void 0,distanceSquared:s};for(const r of i){const a=r.distanceSquared(e,t);if(a===0)return{nearest:r,distanceSquared:0};a<n.distanceSquared&&(n.nearest=r,n.distanceSquared=a)}return n}var _BBox=class z{constructor(t,i,s,n){this.x=t,this.y=i,this.width=s,this.height=n}static fromDOMRect({x:t,y:i,width:s,height:n}){return new z(t,i,s,n)}static merge(t){let i=1/0,s=1/0,n=-1/0,r=-1/0;for(const a of t)a.x<i&&(i=a.x),a.y<s&&(s=a.y),a.x+a.width>n&&(n=a.x+a.width),a.y+a.height>r&&(r=a.y+a.height);return new z(i,s,n-i,r-s)}static nearestBox(t,i,s){return nearestSquared(t,i,s)}toDOMRect(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.y,left:this.x,right:this.x+this.width,bottom:this.y+this.height,toJSON(){return{}}}}clone(){const{x:t,y:i,width:s,height:n}=this;return new z(t,i,s,n)}equals(t){return(0,import_ag_charts_core.boxesEqual)(this,t)}containsPoint(t,i){return(0,import_ag_charts_core.boxContains)(this,t,i)}intersection(t){if(!this.collidesBBox(t))return;const i=(0,import_ag_charts_core.clamp)(t.x,this.x,t.x+t.width),s=(0,import_ag_charts_core.clamp)(t.y,this.y,t.y+t.height),n=(0,import_ag_charts_core.clamp)(t.x,this.x+this.width,t.x+t.width),r=(0,import_ag_charts_core.clamp)(t.y,this.y+this.height,t.y+t.height);return new z(i,s,n-i,r-s)}collidesBBox(t){return this.x<t.x+t.width&&this.x+this.width>t.x&&this.y<t.y+t.height&&this.y+this.height>t.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(t,i){if(this.containsPoint(t,i))return 0;const s=t-(0,import_ag_charts_core.clamp)(this.x,t,this.x+this.width),n=i-(0,import_ag_charts_core.clamp)(this.y,i,this.y+this.height);return s*s+n*n}shrink(t,i){if(typeof t=="number")this.applyMargin(t,i);else for(const s of Object.keys(t)){const n=t[s];typeof n=="number"&&this.applyMargin(n,s)}return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this}grow(t,i){if(typeof t=="number")this.applyMargin(-t,i);else for(const s of Object.keys(t)){const n=t[s];typeof n=="number"&&this.applyMargin(-n,s)}return this}applyMargin(t,i){switch(i){case"top":this.y+=t;case"bottom":this.height-=t;break;case"left":this.x+=t;case"right":this.width-=t;break;case"vertical":this.y+=t,this.height-=t*2;break;case"horizontal":this.x+=t,this.width-=t*2;break;case void 0:this.x+=t,this.y+=t,this.width-=t*2,this.height-=t*2;break}}translate(t,i){return this.x+=t,this.y+=i,this}[interpolate](t,i){return new z(this.x*(1-i)+t.x*i,this.y*(1-i)+t.y*i,this.width*(1-i)+t.width*i,this.height*(1-i)+t.height*i)}};_BBox.zero=Object.freeze(new _BBox(0,0,0,0)),_BBox.NaN=Object.freeze(new _BBox(NaN,NaN,NaN,NaN));var BBox=_BBox,import_ag_charts_core2=require("ag-charts-core"),TRIPLE_EQ=(e,t)=>e===t;function SceneChangeDetection(e){return function(t,i){const s=`__${i}`;t[i]||prepareGetSet(t,i,s,e)}}function SceneObjectChangeDetection(e){return SceneChangeDetection(e)}function SceneArrayChangeDetection(e){const t=e??{};return t.equals=import_ag_charts_core2.arraysEqual,SceneChangeDetection(e)}function prepareGetSet(e,t,i,s){const{changeCb:n,convertor:r,checkDirtyOnAssignment:a=!1}=s??{},c={changeCb:n,checkDirtyOnAssignment:a,convertor:r},o=buildCheckDirtyChain(i,buildChangeCallbackChain(buildConvertorChain(buildSetter(i,c),c),c),c);Object.defineProperty(e,t,{set:o,get:function(){return this[i]},enumerable:!0,configurable:!0})}function buildConvertorChain(e,t){const{convertor:i}=t;return i?function(s){e.call(this,i(s))}:e}var NO_CHANGE=Symbol("no-change");function buildChangeCallbackChain(e,t){const{changeCb:i}=t;return i?function(s){const n=e.call(this,s);return n!==NO_CHANGE&&i.call(this,this),n}:e}function buildCheckDirtyChain(e,t,i){const{checkDirtyOnAssignment:s}=i;return s?function(n){const r=t.call(this,n);return n?._dirty===!0&&this.markDirty(e),r}:t}function buildSetter(e,t){const{equals:i=TRIPLE_EQ}=t;return function(s){const n=this[e];return i(s,n)?NO_CHANGE:(this[e]=s,this.onChangeDetection(e),s)}}var cmp=(e,t)=>Math.sign(e-t);function compareZIndex(e,t){if(typeof e=="number"&&typeof t=="number")return cmp(e,t);const i=typeof e=="number"?[e]:e,s=typeof t=="number"?[t]:t,n=Math.min(i.length,s.length);for(let r=0;r<n;r+=1){const a=cmp(i[r],s[r]);if(a!==0)return a}return cmp(i.length,s.length)}var MAX_ERROR_COUNT=5,_Node=class V{constructor(t){this.serialNumber=V._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=(0,import_ag_charts_core3.createId)(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=t?.name,this.tag=t?.tag??NaN,this.zIndex=t?.zIndex??0,(t?.debugDirty??V._debugEnabled)&&(this._debugDirtyProperties=new Map([["__first__",[]]]))}static toSVG(t,i,s){const n=t?.toSVG();if(n==null||!n.elements.length&&!n.defs?.length)return;const r=(0,import_ag_charts_core3.createSvgElement)("svg");if(r.setAttribute("width",String(i)),r.setAttribute("height",String(s)),r.setAttribute("viewBox",`0 0 ${i} ${s}`),n.defs?.length){const a=(0,import_ag_charts_core3.createSvgElement)("defs");a.append(...n.defs),r.append(a)}return r.append(...n.elements),r.outerHTML}static*extractBBoxes(t,i){for(const s of t)if(!i||s.visible&&!s.transitionOut){const n=s.getBBox();n&&(yield n)}}get datum(){return this._datum}set datum(t){this._datum!==t&&(this._previousDatum=this._datum,this._datum=t)}get previousDatum(){return this._previousDatum}get layerManager(){return this.scene?.layersManager}get imageLoader(){return this.scene?.imageLoader}closestDatum(){for(const{datum:t}of this.traverseUp(!0))if(t!=null)return t}preRender(t,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(t){t.ctx.save();try{this.render(t)}catch(i){const s=i.errorCount??1;if(s>=MAX_ERROR_COUNT)throw i.errorCount=s,i;import_ag_charts_core3.Logger.warnOnce("Error during rendering",i,i.stack)}finally{t.ctx.restore()}}render(t){const{stats:i}=t;if(this.debugDirtyProperties(),t.debugNodeSearch){const s=this.name??this.id;t.debugNodeSearch.some(n=>typeof n=="string"?n===s:n.test(s))&&(t.debugNodes[this.name??this.id]=this)}i&&(i.nodesRendered++,i.opsPerformed+=this.childNodeCounts.thisComplexity)}setScene(t){this.scene=t}*traverseUp(t){let i=this;for(t&&(yield i);i=i.parentNode;)yield i}isRoot(){return!this.parentNode}removeChild(t){throw new Error(`AG Charts - internal error, unknown child node ${t.name??t.id} in $${this.name??this.id}`)}remove(){this.parentNode?.removeChild(this)}destroy(){this.parentNode?.removeChild(this)}batchedUpdate(t){this.batchLevel++,t(),this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}setProperties(t){return this.batchLevel++,Object.assign(this,t),this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1),this}containsPoint(t,i){return!1}pickNode(t,i){if(this.containsPoint(t,i))return this}pickNodes(t,i,s=[]){return this.containsPoint(t,i)&&s.push(this),s}getBBox(){return this.cachedBBox==null&&(this.cachedBBox=Object.freeze(this.computeBBox())),this.cachedBBox}computeBBox(){}onChangeDetection(t){this.markDirty(t)}markDirtyChildrenOrder(){this.cachedBBox=void 0}markDirty(t){if(this.batchLevel>0){this.batchDirty=!0;return}t!=null&&this._debugDirtyProperties&&this.markDebugProperties(t),this.cachedBBox=void 0,this.parentNode?.markDirty()}markDebugProperties(t){const i=this._debugDirtyProperties?.get(t)??[],s=new Error().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(t,i)}debugDirtyProperties(){this._debugDirtyProperties!=null&&(this._debugDirtyProperties.has("__first__")||this._debugDirtyProperties.forEach((t,i)=>{t.length>1&&(console.groupCollapsed(`Property changed multiple times before render: ${this.constructor.name}.${i} (${t.length}x)`),t.forEach(s=>console.log(s)),console.groupEnd())}),this._debugDirtyProperties.clear())}onZIndexChange(){this.parentNode?.markDirtyChildrenOrder()}toSVG(){}};_Node._nextSerialNumber=0,_Node._debugEnabled=!1,__decorateClass([SceneChangeDetection()],_Node.prototype,"visible",2),__decorateClass([SceneObjectChangeDetection({equals:objectsEqual,changeCb:e=>e.onZIndexChange()})],_Node.prototype,"zIndex",2);var Node=_Node,import_ag_charts_core23=require("ag-charts-core"),import_ag_charts_core4=require("ag-charts-core"),LONG_TIME_PERIOD_THRESHOLD=2e3,timeOfLastLog=Date.now(),logTimeGap=()=>{const e=Date.now()-timeOfLastLog;if(e>LONG_TIME_PERIOD_THRESHOLD){const t=(Math.floor(e/100)/10).toFixed(1);import_ag_charts_core4.Logger.log(`**** ${t}s since last log message ****`)}timeOfLastLog=Date.now()},Debug={create(...e){return Object.assign((...i)=>{Debug.check(...e)&&(typeof i[0]=="function"&&(i=(0,import_ag_charts_core4.toArray)(i[0]())),logTimeGap(),import_ag_charts_core4.Logger.log(...i))},{check:()=>Debug.check(...e),group:(i,s)=>Debug.check(...e)?import_ag_charts_core4.Logger.logGroup(i,s):s()})},check(...e){return e.length===0&&e.push(!0),(0,import_ag_charts_core4.toArray)((0,import_ag_charts_core4.getWindow)("agChartsDebug")).some(i=>e.includes(i))},inDevelopmentMode(e){if(Debug.check("dev"))return e()}};function createCanvasContext(e=0,t=0){return new OffscreenCanvas(e,t).getContext("2d")}var LRUCache=class{constructor(e=5){this.maxCacheSize=e,this.store=new Map}get(e){if(!this.store.has(e))return;const t=this.store.get(e);return this.store.delete(e),this.store.set(e,t),t}has(e){return this.store.has(e)}set(e,t){if(this.store.set(e,t),this.store.size>this.maxCacheSize){const i=this.store.keys();let s=this.store.size-this.maxCacheSize;for(;s>0;){const n=i.next();n.done||this.store.delete(n.value),s--}}return t}clear(){this.store.clear()}},CachedTextMeasurerPool=class{static measureText(e,t){return this.getMeasurer(t).measureText(e)}static measureLines(e,t){return this.getMeasurer(t).measureLines(e)}static getMeasurer(e){const t=TextUtils.toFontString(e.font),i=`${t}-${e.textAlign??"start"}-${e.textBaseline??"top"}`;return this.instanceMap.get(i)??this.createFontMeasurer(t,e,i)}static clear(){this.instanceMap.clear()}static createFontMeasurer(e,t,i){const s=createCanvasContext();s.font=e,s.textAlign=t.textAlign??"start",s.textBaseline=t.textBaseline??"top";const n=new CachedTextMeasurer(s,t);return this.instanceMap.set(i,n),n}};CachedTextMeasurerPool.instanceMap=new LRUCache(10);var CachedTextMeasurer=class{constructor(e,t){this.ctx=e,this.measureMap=new LRUCache(100),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline),e.font=TextUtils.toFontString(t.font),this.textMeasurer=new SimpleTextMeasurer(i=>this.cachedCtxMeasureText(i),t.textBaseline??"alphabetic")}textWidth(e,t){return this.textMeasurer.textWidth(e,t)}measureText(e){return this.textMeasurer.measureText(e)}measureLines(e){return this.textMeasurer.measureLines(e)}cachedCtxMeasureText(e){if(!this.measureMap.has(e)){const t=this.ctx.measureText(e);this.measureMap.set(e,{actualBoundingBoxAscent:t.actualBoundingBoxAscent,emHeightAscent:t.emHeightAscent,emHeightDescent:t.emHeightDescent,actualBoundingBoxDescent:t.actualBoundingBoxDescent,actualBoundingBoxLeft:t.actualBoundingBoxLeft,actualBoundingBoxRight:t.actualBoundingBoxRight,alphabeticBaseline:t.alphabeticBaseline,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent,hangingBaseline:t.hangingBaseline,ideographicBaseline:t.ideographicBaseline,width:t.width})}return this.measureMap.get(e)}},TextUtils=class{static toFontString({fontSize:e=10,fontStyle:t,fontWeight:i,fontFamily:s}){let n="";return t&&t!=="normal"&&(n+=`${t} `),i&&i!=="normal"&&i!==400&&(n+=`${i} `),n+=`${e}px`,n+=` ${s}`,n.trim()}static getLineHeight(e){return Math.ceil(e*this.defaultLineHeight)}static getHorizontalModifier(e){switch(e){case"left":case"start":return 0;case"center":return .5;case"right":case"end":return 1;default:return 0}}static getVerticalModifier(e){switch(e){case"hanging":case"top":return 0;case"middle":return .5;case"alphabetic":case"bottom":case"ideographic":default:return 1}}};TextUtils.EllipsisChar="\u2026",TextUtils.defaultLineHeight=1.15,TextUtils.lineSplitter=/\r?\n/g;var SimpleTextMeasurer=class{constructor(e,t="alphabetic"){this.measureTextFn=e,this.textBaseline=t,this.charMap=new Map}getMetrics(e){const t=this.measureTextFn(e);return t.fontBoundingBoxAscent??(t.fontBoundingBoxAscent=t.emHeightAscent),t.fontBoundingBoxDescent??(t.fontBoundingBoxDescent=t.emHeightDescent),{width:t.width,height:t.actualBoundingBoxAscent+t.actualBoundingBoxDescent,lineHeight:t.fontBoundingBoxAscent+t.fontBoundingBoxDescent}}getMultilineMetrics(e){let t=0,i=0,s=0,n=0,r=0,a=0;const c=TextUtils.getVerticalModifier(this.textBaseline),o=[];let h=0;const l=e.length;for(const d of e){const u=this.measureTextFn(d);u.fontBoundingBoxAscent??(u.fontBoundingBoxAscent=u.emHeightAscent),u.fontBoundingBoxDescent??(u.fontBoundingBoxDescent=u.emHeightDescent),t<u.width&&(t=u.width),n<u.actualBoundingBoxLeft&&(n=u.actualBoundingBoxLeft),h===0?(i+=u.actualBoundingBoxAscent,s+=u.actualBoundingBoxAscent,a=u.alphabeticBaseline):r+=u.fontBoundingBoxAscent,h===l-1?i+=u.actualBoundingBoxDescent:r+=u.fontBoundingBoxDescent,o.push({text:d,width:u.width,height:u.actualBoundingBoxAscent+u.actualBoundingBoxDescent,lineHeight:u.fontBoundingBoxAscent+u.fontBoundingBoxDescent,offsetTop:u.actualBoundingBoxAscent,offsetLeft:u.actualBoundingBoxLeft}),h++}return i+=r,s+=r*c,{width:t,height:i,offsetTop:s,offsetLeft:n,alphabeticBaseline:a,lineMetrics:o}}textWidth(e,t){if(t){let i=0;for(let s=0;s<e.length;s++)i+=this.textWidth(e.charAt(s));return i}return e.length>1?this.measureTextFn(e).width:this.charMap.get(e)??this.charWidth(e)}measureText(e){return this.getMetrics(e)}measureLines(e){const t=typeof e=="string"?e.split(TextUtils.lineSplitter):e;return this.getMultilineMetrics(t)}charWidth(e){const{width:t}=this.measureTextFn(e);return this.charMap.set(e,t),t}},import_ag_charts_core22=require("ag-charts-core"),import_ag_charts_core21=require("ag-charts-core");function clearContext({context:e,pixelRatio:t,width:i,height:s}){e.save();try{e.resetTransform(),e.clearRect(0,0,Math.ceil(i*t),Math.ceil(s*t))}finally{e.restore()}}function debugContext(e){if(Debug.check("canvas")){const t=e.save.bind(e),i=e.restore.bind(e);let s=0;Object.assign(e,{save(){t(),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 canvasDimensions(e,t,i){return[Math.floor(e*i),Math.floor(t*i)]}var HdpiOffscreenCanvas=class{constructor(e){const{width:t,height:i,pixelRatio:s,willReadFrequently:n=!1}=e;this.width=t,this.height=i,this.pixelRatio=s;const[r,a]=canvasDimensions(t,i,s);this.canvas=new OffscreenCanvas(r,a),this.context=this.canvas.getContext("2d",{willReadFrequently:n}),this.context.setTransform(s,0,0,s,0,0),debugContext(this.context)}drawImage(e,t=0,i=0){return e.drawImage(this.canvas,t,i)}transferToImageBitmap(){return this.canvas.transferToImageBitmap()}resize(e,t,i){if(!(e>0&&t>0))return;const{canvas:s,context:n}=this;if(e!==this.width||t!==this.height||i!==this.pixelRatio){const[r,a]=canvasDimensions(e,t,i);s.width=r,s.height=a}n.setTransform(i,0,0,i,0,0),this.width=e,this.height=t,this.pixelRatio=i}clear(){clearContext(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_ag_charts_core18=require("ag-charts-core"),import_ag_charts_core8=require("ag-charts-core"),twoPi=Math.PI*2,halfPi=Math.PI/2;function normalizeAngle360(e){return e%=twoPi,e+=twoPi,e%=twoPi,e}function normalizeAngle180(e){return e%=twoPi,e<-Math.PI?e+=twoPi:e>=Math.PI&&(e-=twoPi),e}function isBetweenAngles(e,t,i){const s=normalizeAngle360(e),n=normalizeAngle360(t),r=normalizeAngle360(i);return n<r?n<=s&&s<=r:n>r?n<=s||s<=r:!0}function toRadians(e){return e/180*Math.PI}function angleBetween(e,t){return e=normalizeAngle360(e),t=normalizeAngle360(t),t-e+(e>t?twoPi:0)}function normalizeAngle360FromDegrees(e){return e?normalizeAngle360(toRadians(e)):0}var import_ag_charts_core7=require("ag-charts-core"),import_ag_charts_core6=require("ag-charts-core"),import_ag_charts_core5=require("ag-charts-core"),lerp=(e,t,i)=>e*(1-i)+t*i,srgbToLinear=e=>{const t=e<0?-1:1,i=Math.abs(e);return i<=.04045?e/12.92:t*((i+.055)/1.055)**2.4},srgbFromLinear=e=>{const t=e<0?-1:1,i=Math.abs(e);return i>.0031308?t*(1.055*i**(1/2.4)-.055):12.92*e},_Color=class k{constructor(t,i,s,n=1){this.r=(0,import_ag_charts_core5.clamp)(0,t||0,1),this.g=(0,import_ag_charts_core5.clamp)(0,i||0,1),this.b=(0,import_ag_charts_core5.clamp)(0,s||0,1),this.a=(0,import_ag_charts_core5.clamp)(0,n||0,1)}static validColorString(t){return t.indexOf("#")>=0?!!k.parseHex(t):t.indexOf("rgb")>=0?!!k.stringToRgba(t):k.nameToHex.has(t.toLowerCase())}static fromString(t){if(t.indexOf("#")>=0)return k.fromHexString(t);const i=k.nameToHex.get(t.toLowerCase());if(i)return k.fromHexString(i);if(t.indexOf("rgb")>=0)return k.fromRgbaString(t);throw new Error(`Invalid color string: '${t}'`)}static parseHex(t){t=t.replace(/ /g,"").slice(1);let i;switch(t.length){case 6:case 8:i=[];for(let s=0;s<t.length;s+=2)i.push(parseInt(`${t[s]}${t[s+1]}`,16));break;case 3:case 4:i=t.split("").map(s=>parseInt(s,16)).map(s=>s+s*16);break}if(i?.length>=3&&i.every(s=>s>=0))return i.length===3&&i.push(255),i}static fromHexString(t){const i=k.parseHex(t);if(i){const[s,n,r,a]=i;return new k(s/255,n/255,r/255,a/255)}throw new Error(`Malformed hexadecimal color string: '${t}'`)}static stringToRgba(t){let i=-1,s=-1;for(let c=0;c<t.length;c++){const o=t[c];if(i===-1&&o==="(")i=c;else if(o===")"){s=c;break}}if(i===-1||s===-1)return;const r=t.substring(i+1,s).split(","),a=[];for(let c=0;c<r.length;c++){const o=r[c];let h=parseFloat(o);if(!Number.isFinite(h))return;o.indexOf("%")>=0?(h=(0,import_ag_charts_core5.clamp)(0,h,100),h/=100):c===3?h=(0,import_ag_charts_core5.clamp)(0,h,1):(h=(0,import_ag_charts_core5.clamp)(0,h,255),h/=255),a.push(h)}return a}static fromRgbaString(t){const i=k.stringToRgba(t);if(i){if(i.length===3)return new k(i[0],i[1],i[2]);if(i.length===4)return new k(i[0],i[1],i[2],i[3])}throw new Error(`Malformed rgb/rgba color string: '${t}'`)}static fromArray(t){if(t.length===4)return new k(t[0],t[1],t[2],t[3]);if(t.length===3)return new k(t[0],t[1],t[2]);throw new Error("The given array should contain 3 or 4 color components (numbers).")}static fromHSB(t,i,s,n=1){const r=k.HSBtoRGB(t,i,s);return new k(r[0],r[1],r[2],n)}static fromHSL(t,i,s,n=1){const r=k.HSLtoRGB(t,i,s);return new k(r[0],r[1],r[2],n)}static fromOKLCH(t,i,s,n=1){const r=k.OKLCHtoRGB(t,i,s);return new k(r[0],r[1],r[2],n)}static padHex(t){return t.length===1?"0"+t:t}toHexString(){let t="#"+k.padHex(Math.round(this.r*255).toString(16))+k.padHex(Math.round(this.g*255).toString(16))+k.padHex(Math.round(this.b*255).toString(16));return this.a<1&&(t+=k.padHex(Math.round(this.a*255).toString(16))),t}toRgbaString(t=3){const i=[Math.round(this.r*255),Math.round(this.g*255),Math.round(this.b*255)],s=Math.pow(10,t);return this.a!==1?(i.push(Math.round(this.a*s)/s),`rgba(${i.join(", ")})`):`rgb(${i.join(", ")})`}toString(){return this.a===1?this.toHexString():this.toRgbaString()}toHSB(){return k.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(t,i,s){const n=srgbToLinear(t),r=srgbToLinear(i),a=srgbToLinear(s),c=Math.cbrt(.4122214708*n+.5363325363*r+.0514459929*a),o=Math.cbrt(.2119034982*n+.6806995451*r+.1073969566*a),h=Math.cbrt(.0883024619*n+.2817188376*r+.6299787005*a),l=.2104542553*c+.793617785*o-.0040720468*h,d=1.9779984951*c-2.428592205*o+.4505937099*h,u=.0259040371*c+.7827717662*o-.808675766*h,f=Math.atan2(u,d)*180/Math.PI,p=l,y=Math.hypot(d,u),g=f>=0?f:f+360;return[p,y,g]}static OKLCHtoRGB(t,i,s){const n=t,r=i*Math.cos(s*Math.PI/180),a=i*Math.sin(s*Math.PI/180),c=(n+.3963377774*r+.2158037573*a)**3,o=(n-.1055613458*r-.0638541728*a)**3,h=(n-.0894841775*r-1.291485548*a)**3,l=4.0767416621*c-3.3077115913*o+.2309699292*h,d=-1.2684380046*c+2.6097574011*o-.3413193965*h,u=-.0041960863*c-.7034186147*o+1.707614701*h,f=srgbFromLinear(l),p=srgbFromLinear(d),y=srgbFromLinear(u);return[f,p,y]}static RGBtoHSL(t,i,s){const n=Math.min(t,i,s),r=Math.max(t,i,s),a=(r+n)/2;let c,o;if(r===n)c=0,o=0;else{const h=r-n;o=a>.5?h/(2-r-n):h/(r+n),r===t?c=(i-s)/h+(i<s?6:0):r===i?c=(s-t)/h+2:c=(t-i)/h+4,c*=360/6}return[c,o,a]}static HSLtoRGB(t,i,s){if(t=(t%360+360)%360,i===0)return[s,s,s];const n=s<.5?s*(1+i):s+i-s*i,r=2*s-n;function a(l){return l<0&&(l+=1),l>1&&(l-=1),l<1/6?r+(n-r)*6*l:l<1/2?n:l<2/3?r+(n-r)*(2/3-l)*6:r}const c=a(t/360+1/3),o=a(t/360),h=a(t/360-1/3);return[c,o,h]}static RGBtoHSB(t,i,s){const n=Math.min(t,i,s),r=Math.max(t,i,s),a=r===0?0:(r-n)/r;let c=0;if(n!==r){const o=r-n,h=(r-t)/o,l=(r-i)/o,d=(r-s)/o;t===r?c=d-l:i===r?c=2+h-d:c=4+l-h,c/=6,c<0&&(c=c+1)}return[c*360,a,r]}static HSBtoRGB(t,i,s){t=(t%360+360)%360/360;let n=0,r=0,a=0;if(i===0)n=r=a=s;else{const c=(t-Math.floor(t))*6,o=c-Math.floor(c),h=s*(1-i),l=s*(1-i*o),d=s*(1-i*(1-o));switch(c>>0){case 0:n=s,r=d,a=h;break;case 1:n=l,r=s,a=h;break;case 2:n=h,r=s,a=d;break;case 3:n=h,r=l,a=s;break;case 4:n=d,r=h,a=s;break;case 5:n=s,r=h,a=l;break}}return[n,r,a]}static mix(t,i,s){return new k(lerp(t.r,i.r,s),lerp(t.g,i.g,s),lerp(t.b,i.b,s),lerp(t.a,i.a,s))}static lighten(t,i){const s=k.RGBtoOKLCH(t.r,t.g,t.b);return k.fromOKLCH((0,import_ag_charts_core5.clamp)(0,s[0]+i,1),s[1],s[2])}static darken(t,i){const s=k.RGBtoOKLCH(t.r,t.g,t.b);return k.fromOKLCH((0,import_ag_charts_core5.clamp)(0,s[0]-i,1),s[1],s[2])}static interpolate(t,i){const s=1/(t.length-1),n=t.map(r=>k.RGBtoOKLCH(r.r,r.g,r.b));return Array.from({length:i},(r,a)=>{const c=a/(i-1),o=t.length<=2?0:Math.min(Math.floor(c*(t.length-1)),t.length-2),h=(c-o*s)/s,l=n[o],d=n[o+1];return k.fromOKLCH(lerp(l[0],d[0],h),lerp(l[1],d[1],h),lerp(l[2],d[2],h))})}};_Color.nameToHex=new Map([["aliceblue","#F0F8FF"],["antiquewhite","#FAEBD7"],["aqua","#00FFFF"],["aquamarine","#7FFFD4"],["azure","#F0FFFF"],["beige","#F5F5DC"],["bisque","#FFE4C4"],["black","#000000"],["blanchedalmond","#FFEBCD"],["blue","#0000FF"],["blueviolet","#8A2BE2"],["brown","#A52A2A"],["burlywood","#DEB887"],["cadetblue","#5F9EA0"],["chartreuse","#7FFF00"],["chocolate","#D2691E"],["coral","#FF7F50"],["cornflowerblue","#6495ED"],["cornsilk","#FFF8DC"],["crimson","#DC143C"],["cyan","#00FFFF"],["darkblue","#00008B"],["darkcyan","#008B8B"],["darkgoldenrod","#B8860B"],["darkgray","#A9A9A9"],["darkgreen","#006400"],["darkgrey","#A9A9A9"],["darkkhaki","#BDB76B"],["darkmagenta","#8B008B"],["darkolivegreen","#556B2F"],["darkorange","#FF8C00"],["darkorchid","#9932CC"],["darkred","#8B0000"],["darksalmon","#E9967A"],["darkseagreen","#8FBC8F"],["darkslateblue","#483D8B"],["darkslategray","#2F4F4F"],["darkslategrey","#2F4F4F"],["darkturquoise","#00CED1"],["darkviolet","#9400D3"],["deeppink","#FF1493"],["deepskyblue","#00BFFF"],["dimgray","#696969"],["dimgrey","#696969"],["dodgerblue","#1E90FF"],["firebrick","#B22222"],["floralwhite","#FFFAF0"],["forestgreen","#228B22"],["fuchsia","#FF00FF"],["gainsboro","#DCDCDC"],["ghostwhite","#F8F8FF"],["gold","#FFD700"],["goldenrod","#DAA520"],["gray","#808080"],["green","#008000"],["greenyellow","#ADFF2F"],["grey","#808080"],["honeydew","#F0FFF0"],["hotpink","#FF69B4"],["indianred","#CD5C5C"],["indigo","#4B0082"],["ivory","#FFFFF0"],["khaki","#F0E68C"],["lavender","#E6E6FA"],["lavenderblush","#FFF0F5"],["lawngreen","#7CFC00"],["lemonchiffon","#FFFACD"],["lightblue","#ADD8E6"],["lightcoral","#F08080"],["lightcyan","#E0FFFF"],["lightgoldenrodyellow","#FAFAD2"],["lightgray","#D3D3D3"],["lightgreen","#90EE90"],["lightgrey","#D3D3D3"],["lightpink","#FFB6C1"],["lightsalmon","#FFA07A"],["lightseagreen","#20B2AA"],["lightskyblue","#87CEFA"],["lightslategray","#778899"],["lightslategrey","#778899"],["lightsteelblue","#B0C4DE"],["lightyellow","#FFFFE0"],["lime","#00FF00"],["limegreen","#32CD32"],["linen","#FAF0E6"],["magenta","#FF00FF"],["maroon","#800000"],["mediumaquamarine","#66CDAA"],["mediumblue","#0000CD"],["mediumorchid","#BA55D3"],["mediumpurple","#9370DB"],["mediumseagreen","#3CB371"],["mediumslateblue","#7B68EE"],["mediumspringgreen","#00FA9A"],["mediumturquoise","#48D1CC"],["mediumvioletred","#C71585"],["midnightblue","#191970"],["mintcream","#F5FFFA"],["mistyrose","#FFE4E1"],["moccasin","#FFE4B5"],["navajowhite","#FFDEAD"],["navy","#000080"],["oldlace","#FDF5E6"],["olive","#808000"],["olivedrab","#6B8E23"],["orange","#FFA500"],["orangered","#FF4500"],["orchid","#DA70D6"],["palegoldenrod","#EEE8AA"],["palegreen","#98FB98"],["paleturquoise","#AFEEEE"],["palevioletred","#DB7093"],["papayawhip","#FFEFD5"],["peachpuff","#FFDAB9"],["peru","#CD853F"],["pink","#FFC0CB"],["plum","#DDA0DD"],["powderblue","#B0E0E6"],["purple","#800080"],["rebeccapurple","#663399"],["red","#FF0000"],["rosybrown","#BC8F8F"],["royalblue","#4169E1"],["saddlebrown","#8B4513"],["salmon","#FA8072"],["sandybrown","#F4A460"],["seagreen","#2E8B57"],["seashell","#FFF5EE"],["sienna","#A0522D"],["silver","#C0C0C0"],["skyblue","#87CEEB"],["slateblue","#6A5ACD"],["slategray","#708090"],["slategrey","#708090"],["snow","#FFFAFA"],["springgreen","#00FF7F"],["steelblue","#4682B4"],["tan","#D2B48C"],["teal","#008080"],["thistle","#D8BFD8"],["tomato","#FF6347"],["transparent","#00000000"],["turquoise","#40E0D0"],["violet","#EE82EE"],["wheat","#F5DEB3"],["white","#FFFFFF"],["whitesmoke","#F5F5F5"],["yellow","#FFFF00"],["yellowgreen","#9ACD32"]]);var Color=_Color,AbstractScale=class{ticks(e,t,i){}niceDomain(e,t=this.domain){return t}get bandwidth(){}get step(){}get inset(){}},Invalidating=(e,t)=>{const i=Symbol(String(t));e[i]=void 0,Object.defineProperty(e,t,{get(){return this[i]},set(s){this[i]!==s&&(this[i]=s,this.invalid=!0)},enumerable:!0,configurable:!1})},convertColorStringToOklcha=e=>{const t=Color.fromString(e),[i,s,n]=Color.RGBtoOKLCH(t.r,t.g,t.b);return{l:i,c:s,h:n,a:t.a}},delta=1e-6,isAchromatic=e=>e.c<delta||e.l<delta||e.l>1-delta,interpolateOklch=(e,t,i)=>{i=(0,import_ag_charts_core6.clamp)(0,i,1);let s;if(isAchromatic(e))s=t.h;else if(isAchromatic(t))s=e.h;else{const c=e.h;let o=t.h;const h=t.h-e.h;h>180?o-=360:h<-180&&(o+=360),s=c*(1-i)+o*i}const n=e.c*(1-i)+t.c*i,r=e.l*(1-i)+t.l*i,a=e.a*(1-i)+t.a*i;return Color.fromOKLCH(r,n,s,a)},ColorScale=class extends AbstractScale{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(convertColorStringToOklcha)}update(){const{domain:e,range:t}=this;e.length<2&&(import_ag_charts_core6.Logger.warnOnce("`colorDomain` should have at least 2 values."),e.length===0?e.push(0,1):e.length===1&&e.push(e[0]+1));for(let i=1;i<e.length;i++){const s=e[i-1],n=e[i];if(s>=n){import_ag_charts_core6.Logger.warnOnce("`colorDomain` values should be supplied in ascending order."),e.sort((r,a)=>r-a);break}}if(t.length<e.length)for(let i=t.length;i<e.length;i++)t.push(t.length>0?t[0]:"black");this.parsedRange=this.range.map(convertColorStringToOklcha)}normalizeDomains(...e){return{domain:e.flat(),animatable:!0}}toDomain(){}convert(e){this.refresh();const{domain:t,range:i,parsedRange:s}=this,n=t[0],r=t.at(-1),a=i[0],c=i[i.length-1];if(e<=n)return a;if(e>=r)return c;let o,h;if(t.length===2){const u=(e-n)/(r-n),f=1/(i.length-1);o=i.length<=2?0:Math.min(Math.floor(u*(i.length-1)),i.length-2),h=(u-o*f)/f}else{for(o=0;o<t.length-2&&!(e<t[o+1]);o++);const u=t[o],f=t[o+1];h=(e-u)/(f-u)}const l=s[o],d=s[o+1];return interpolateOklch(l,d,h).toRgbaString()}invert(){}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&import_ag_charts_core6.Logger.warnOnce("Expected update to not invalidate scale"))}};__decorateClass([Invalidating],ColorScale.prototype,"domain",2),__decorateClass([Invalidating],ColorScale.prototype,"range",2);var Gradient=class{constructor(e,t=[],i){this.colorSpace=e,this.stops=t,this.bbox=i,this._cache=void 0}createGradient(e,t,i){const s=this.bbox??t;if(!s.isFinite())return;if(this._cache!=null&&this._cache.ctx===e&&this._cache.bbox.equals(s))return this._cache.gradient;const{stops:n,colorSpace:r}=this;if(n.length===0)return;if(n.length===1)return n[0].color;let a=this.createCanvasGradient(e,s,i);if(a==null)return;const c=r==="oklch",o=.05;let h=n[0];a.addColorStop(h.stop,h.color);for(let l=1;l<n.length;l+=1){const d=n[l];if(c){const u=new ColorScale;u.domain=[h.stop,d.stop],u.range=[h.color,d.color];for(let f=h.stop+o;f<d.stop;f+=o)a.addColorStop(f,u.convert(f))}a.addColorStop(d.stop,d.color),h=d}return"createPattern"in a&&(a=a.createPattern()),this._cache={ctx:e,bbox:s,gradient:a},a}toSvg(e){const t=this.bbox??e,i=this.createSvgGradient(t);return this.stops.forEach(({stop:s,color:n})=>{const r=(0,import_ag_charts_core7.createSvgElement)("stop");r.setAttribute("offset",`${s}`),r.setAttribute("stop-color",`${n}`),i.appendChild(r)}),i}},ConicGradient=class extends Gradient{constructor(e,t,i=0,s){super(e,t,s),this.angle=i}createCanvasGradient(e,t,i){const{angle:n}=this,r=normalizeAngle360FromDegrees(n+-90),a=i?.centerX??t.x+t.width*.5,c=i?.centerY??t.y+t.height*.5;return e.createConicGradient(r,a,c)}createSvgGradient(e){return(0,import_ag_charts_core8.createSvgElement)("linearGradient")}},import_ag_charts_core9=require("ag-charts-core"),LinearGradient=class extends Gradient{constructor(e,t,i=0,s){super(e,t,s),this.angle=i}getGradientPoints(e){const{angle:i}=this,s=normalizeAngle360FromDegrees(i+90),n=Math.cos(s),r=Math.sin(s),a=e.width,c=e.height,o=e.x+a*.5,h=e.y+c*.5,l=Math.sqrt(c*c+a*a)/2,d=Math.atan2(c,a);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 f=l*Math.abs(Math.cos(u-d));return{x0:o+n*f,y0:h+r*f,x1:o-n*f,y1:h-r*f}}createCanvasGradient(e,t){const{x0:i,y0:s,x1:n,y1:r}=this.getGradientPoints(t);if(!(isNaN(i)||isNaN(s)||isNaN(n)||isNaN(r)))return e.createLinearGradient(i,s,n,r)}createSvgGradient(e){const{x0:t,y0:i,x1:s,y1:n}=this.getGradientPoints(e),r=(0,import_ag_charts_core9.createSvgElement)("linearGradient");return r.setAttribute("x1",String(t)),r.setAttribute("y1",String(i)),r.setAttribute("x2",String(s)),r.setAttribute("y2",String(n)),r.setAttribute("gradientUnits","userSpaceOnUse"),r}},import_ag_charts_core10=require("ag-charts-core"),RadialGradient=class extends Gradient{constructor(e,t,i){super(e,t,i)}createCanvasGradient(e,t,i){const s=i?.centerX??t.x+t.width*.5,n=i?.centerY??t.y+t.height*.5,r=i?.innerRadius??0,a=i?.outerRadius??Math.hypot(t.width*.5,t.height*.5)/Math.SQRT2;return e.createRadialGradient(s,n,r,s,n,a)}createSvgGradient(e){const t=e.x+e.width*.5,i=e.y+e.height*.5,s=(0,import_ag_charts_core10.createSvgElement)("radialGradient");return s.setAttribute("cx",String(t)),s.setAttribute("cy",String(i)),s.setAttribute("r",String(Math.hypot(e.width*.5,e.height*.5)/Math.SQRT2)),s.setAttribute("gradientUnits","userSpaceOnUse"),s}},import_ag_charts_core12=require("ag-charts-core"),import_ag_charts_core11=require("ag-charts-core"),Property=addFakeTransformToInstanceProperty,BaseProperties=class{handleUnknownProperties(e,t){}set(e){const{className:t=this.constructor.name}=this.constructor;if(typeof e!="object")return import_ag_charts_core11.Logger.warn(`unable to set ${t} - expecting a properties object`),this;const i=new Set(Object.keys(e));for(const s of listDecoratedProperties(this))if(i.has(s)){const n=e[s],r=this;if(isProperties(r[s]))if(r[s]instanceof PropertiesArray){const a=r[s].reset(n);a!=null?r[s]=a:import_ag_charts_core11.Logger.warn(`unable to set [${s}] - expecting a properties array`)}else r[s].set(n);else(0,import_ag_charts_core11.isPlainObject)(n)?r[s]=merge(n,r[s]??{}):r[s]=n;i.delete(s)}this.handleUnknownProperties(i,e);for(const s of i)import_ag_charts_core11.Logger.warn(`unable to set [${s}] in ${t} - property is unknown`);return this}toJson(){return listDecoratedProperties(this).reduce((e,t)=>{const i=this[t];return e[t]=isProperties(i)?i.toJson():i,e},{})}},PropertiesArray=class nt extends Array{constructor(t,...i){super(i.length);const n=(r=>!!r?.prototype?.constructor?.name)(t)?r=>new t().set(r):t;Object.defineProperty(this,"itemFactory",{value:n,enumerable:!1,configurable:!1}),this.set(i)}set(t){if((0,import_ag_charts_core11.isArray)(t)){this.length=t.length;for(let i=0;i<t.length;i++)this[i]=this.itemFactory(t[i])}return this}reset(t){if(Array.isArray(t))return new nt(this.itemFactory,...t)}toJson(){return this.map(t=>t?.toJson?.()??t)}};function isProperties(e){return e instanceof BaseProperties||e instanceof PropertiesArray}var StopProperties=class extends BaseProperties{constructor(){super(...arguments),this.color="black"}};__decorateClass([Property],StopProperties.prototype,"stop",2),__decorateClass([Property],StopProperties.prototype,"color",2);function stopsAreAscending(e){let t;for(const i of e)if(i?.stop!=null){if(t!=null&&i.stop<t)return!1;t=i.stop}return!0}function discreteColorStops(e){return e.flatMap((t,i)=>{const{stop:s}=t,n=e.at(i+1)?.color;return n!=null?[t,{stop:s,color:n}]:[t]})}function getDefaultColorStops(e,t){const i=t==="discrete"?1:0,s=e.map((n,r,{length:a})=>({stop:(r+i)/(a-1+i),color:n}));return t==="discrete"?discreteColorStops(s):s}function getColorStops(e,t,i,s="continuous"){const n=e.map(p=>typeof p=="string"?{color:p}:p);if(n.length===0)return getDefaultColorStops(t,s);if(!stopsAreAscending(n))return import_ag_charts_core12.Logger.warnOnce("[fills] must have the stops defined in ascending order"),[];const r=Math.min(...i),a=Math.max(...i),c=s==="discrete",o=new Float64Array(n.length);let h=0,l=-1;for(let p=0;p<n.length;p+=1){const y=n[p];if(p>=l){l=n.length-1;for(let m=p+1;m<n.length;m+=1)if(n[m]?.stop!=null){l=m;break}}let g=y?.stop;if(g==null){const m=n[h]?.stop,b=n[l]?.stop,S=m??r,C=b??a,P=c&&m==null?1:0;g=S+(C-S)*(p-h+P)/(l-h+P)}else h=p;o[p]=Math.max(0,Math.min(1,(g-r)/(a-r)))}let d=n.find(p=>p.color!=null)?.color,u;const f=n.map((p,y)=>{let g=p?.color;const m=o[y];return g!=null?d=g:d!=null?g=d:(u==null&&(u=new ColorScale,u.domain=[0,1],u.range=t),g=u.convert(m)),{stop:m,color:g}});return s==="discrete"?discreteColorStops(f):f}var import_ag_charts_core13=require("ag-charts-core"),Image2=class{constructor(e,t){this.imageLoader=e,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(e,t,i,s){if(!t)return null;const[n,r]=this.getSize(t.width,t.height,i,s);return n<1||r<1?(import_ag_charts_core13.Logger.warnOnce("Image fill is too small to render, ignoring."),null):e.createPattern(t,this.repeat)}getSize(e,t,i,s){const{fit:n}=this;let r=e,a=t,c=1;const o=i/s,h=e/t;return n==="stretch"||e===0||t===0?(r=i,a=s):n==="contain"?c=h>o?i/e:s/t:n==="cover"&&(c=h>o?s/t:i/e),[Math.max(1,r*c),Math.max(1,a*c)]}setImageTransform(e,t){if(typeof e=="string")return;const{url:i,rotation:s,width:n,height:r}=this,a=this.imageLoader?.loadImage(i);if(!a)return;const c=normalizeAngle360FromDegrees(s),o=Math.cos(c),h=Math.sin(c),[l,d]=this.getSize(a.width,a.height,n??t.width,r??t.height),u=l/a.width,f=d/a.height,p=t.x+t.width/2,y=t.y+t.height/2,g=o*l-h*d,m=h*l+o*d,b=g/2,S=m/2;e?.setTransform(new DOMMatrix([o*u,h*f,-h*u,o*f,p-b,y-S]))}createPattern(e,t,i,s){const n=this.width??t,r=this.height??i,a=this._cache;if(a!=null&&a.ctx===e&&a.width===n&&a.height===r)return a.pattern;const c=this.imageLoader?.loadImage(this.url,s),o=this.createCanvasImage(e,c,n,r);return o==null?this.backgroundFill:(this._cache={ctx:e,pattern:o,width:n,height:r},o)}toSvg(e,t){const{url:i,rotation:s,backgroundFill:n,backgroundFillOpacity:r}=this,{x:a,y:c,width:o,height:h}=e,l=(0,import_ag_charts_core13.createSvgElement)("pattern");l.setAttribute("viewBox",`0 0 ${o} ${h}`),l.setAttribute("x",String(a)),l.setAttribute("y",String(c)),l.setAttribute("width",String(o)),l.setAttribute("height",String(h)),l.setAttribute("patternUnits","userSpaceOnUse");const d=(0,import_ag_charts_core13.createSvgElement)("rect");d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("width",String(o)),d.setAttribute("height",String(h)),d.setAttribute("fill",n),d.setAttribute("fill-opacity",String(r)),l.appendChild(d);const u=(0,import_ag_charts_core13.createSvgElement)("image");return u.setAttribute("href",i),u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(o)),u.setAttribute("height",String(h)),u.setAttribute("preserveAspectRatio","none"),u.setAttribute("transform",`scale(${1/t}) rotate(${s}, ${o/2}, ${h/2})`),l.appendChild(u),l}},import_ag_charts_core16=require("ag-charts-core");function pointsDistanceSquared(e,t,i,s){const n=e-i,r=t-s;return n*n+r*r}function lineDistanceSquared(e,t,i,s,n,r,a){if(i===n&&s===r)return Math.min(a,pointsDistanceSquared(e,t,i,s));const c=n-i,o=r-s,h=Math.max(0,Math.min(1,((e-i)*c+(t-s)*o)/(c*c+o*o))),l=i+h*c,d=s+h*o;return Math.min(a,pointsDistanceSquared(e,t,l,d))}var import_ag_charts_core14=require("ag-charts-core"),commandEx=/^[\t\n\f\r ]*([achlmqstvz])[\t\n\f\r ]*/i,coordinateEx=/^[+-]?((\d*\.\d+)|(\d+\.)|(\d+))(e[+-]?\d+)?/i,commaEx=/[\t\n\f\r ]*,?[\t\n\f\r ]*/,flagEx=/^[01]/,pathParams={z:[],h:[coordinateEx],v:[coordinateEx],m:[coordinateEx,coordinateEx],l:[coordinateEx,coordinateEx],t:[coordinateEx,coordinateEx],s:[coordinateEx,coordinateEx,coordinateEx,coordinateEx],q:[coordinateEx,coordinateEx,coordinateEx,coordinateEx],c:[coordinateEx,coordinateEx,coordinateEx,coordinateEx,coordinateEx,coordinateEx],a:[coordinateEx,coordinateEx,coordinateEx,flagEx,flagEx,coordinateEx,coordinateEx]};function parseSvg(e){if(!e)return;const t=[];let i=0,s;for(;i<e.length;){const n=commandEx.exec(e.slice(i));let r;if(n==null){if(!s){import_ag_charts_core14.Logger.warnOnce(`Invalid SVG path, error at index ${i}: Missing command.`);return}r=s}else r=n[1],i+=n[0].length;const a=parseSegment(r,e,i);if(!a)return;i=a[0],s=r,t.push(a[1])}return t}function parseSegment(e,t,i){const s=pathParams[e.toLocaleLowerCase()],n={command:e,params:[]};for(const r of s){const a=t.slice(i),c=r.exec(a);if(c!=null){n.params.push(parseFloat(c[0])),i+=c[0].length;const o=commaEx.exec(a.slice(c[0].length));o!=null&&(i+=o[0].length)}else{if(n.params.length===1)return[i,n];import_ag_charts_core14.Logger.warnOnce(`Invalid SVG path, error at index ${i}: No path segment parameters for command [${e}]`);return}}return[i,n]}function linearRoot(e,t){const i=-t/e;return e!==0&&i>=0&&i<=1?[i]:[]}function quadraticRoots(e,t,i,s=1e-6){if(Math.abs(e)<s)return linearRoot(t,i);const n=t*t-4*e*i,r=[];if(Math.abs(n)<s){const a=-t/(2*e);a>=0&&a<=1&&r.push(a)}else if(n>0){const a=Math.sqrt(n),c=(-t-a)/(2*e),o=(-t+a)/(2*e);c>=0&&c<=1&&r.push(c),o>=0&&o<=1&&r.push(o)}return r}function cubicRoots(e,t,i,s,n=1e-6){if(Math.abs(e)<n)return quadraticRoots(t,i,s,n);const r=t/e,a=i/e,c=s/e,o=(3*a-r*r)/9,h=(9*r*a-27*c-2*r*r*r)/54,l=o*o*o+h*h,d=1/3,u=[];if(l>=0){const f=Math.sqrt(l),p=Math.sign(h+f)*Math.pow(Math.abs(h+f),d),y=Math.sign(h-f)*Math.pow(Math.abs(h-f),d),g=Math.abs(Math.sqrt(3)*(p-y)/2),m=-d*r+(p+y);if(m>=0&&m<=1&&u.push(m),Math.abs(g)<n){const b=-d*r-(p+y)/2;b>=0&&b<=1&&u.push(b)}}else{const f=Math.acos(h/Math.sqrt(-o*o*o)),p=d*r,y=2*Math.sqrt(-o),g=y*Math.cos(d*f)-p,m=y*Math.cos(d*(f+2*Math.PI))-p,b=y*Math.cos(d*(f+4*Math.PI))-p;g>=0&&g<=1&&u.push(g),m>=0&&m<=1&&u.push(m),b>=0&&b<=1&&u.push(b)}return u}function segmentIntersection(e,t,i,s,n,r,a,c){const o=(i-e)*(c-r)-(s-t)*(a-n);if(o===0)return 0;const h=((a-n)*(t-r)-(e-n)*(c-r))/o,l=((i-e)*(t-r)-(s-t)*(e-n))/o;return h>=0&&h<=1&&l>=0&&l<=1?1:0}function cubicSegmentIntersections(e,t,i,s,n,r,a,c,o,h,l,d){let u=0;const f=h-d,p=l-o,y=o*(d-h)-h*(l-o),g=bezierCoefficients(e,i,n,a),m=bezierCoefficients(t,s,r,c),b=f*g[0]+p*m[0],S=f*g[1]+p*m[1],C=f*g[2]+p*m[2],P=f*g[3]+p*m[3]+y,w=cubicRoots(b,S,C,P);for(const v of w){const x=v*v,M=v*x,A=g[0]*M+g[1]*x+g[2]*v+g[3],D=m[0]*M+m[1]*x+m[2]*v+m[3];let T;o===l?T=(D-h)/(d-h):T=(A-o)/(l-o),T>=0&&T<=1&&u++}return u}function bezierCoefficients(e,t,i,s){return[-e+3*t-3*i+s,3*e-6*t+3*i,-3*e+3*t,e]}var import_ag_charts_core15=require("ag-charts-core");function evaluateBezier(e,t,i,s,n){return(1-n)**3*e+3*(1-n)**2*n*t+3*(1-n)*n**2*i+n**3*s}function splitBezier2D(e,t,i,s,n,r,a,c,o){const h=(1-o)*e+o*i,l=(1-o)*t+o*s,d=(1-o)*i+o*n,u=(1-o)*s+o*r,f=(1-o)*n+o*a,p=(1-o)*r+o*c,y=(1-o)*h+o*d,g=(1-o)*l+o*u,m=(1-o)*d+o*f,b=(1-o)*u+o*p,S=(1-o)*y+o*m,C=(1-o)*g+o*b;return[[{x:e,y:t},{x:h,y:l},{x:y,y:g},{x:S,y:C}],[{x:S,y:C},{x:m,y:b},{x:f,y:p},{x:a,y:c}]]}function calculateDerivativeExtrema(e,t,i,s){const n=-e+3*t-3*i+s,r=2*(e-2*t+i),a=-e+t;if(n===0){if(r!==0){const o=-a/r;if(o>0&&o<1)return[o]}return[]}const c=r*r-4*n*a;if(c>=0){const o=Math.sqrt(c),h=(-r+o)/(2*n),l=(-r-o)/(2*n);return[h,l].filter(d=>d>0&&d<1)}return[]}function bezier2DExtrema(e,t,i,s,n,r,a,c){const o=calculateDerivativeExtrema(e,i,n,a),h=calculateDerivativeExtrema(t,s,r,c);return[...o,...h]}function bezierCandidate(e,t,i){const s=evaluateBezier(e[0].x,e[1].x,e[2].x,e[3].x,.5),n=evaluateBezier(e[0].y,e[1].y,e[2].y,e[3].y,.5),r=Math.hypot(s-t,n-i),a=Math.min(Math.hypot(e[0].x-t,e[0].y-i),Math.hypot(e[1].x-t,e[1].y-i),Math.hypot(e[2].x-t,e[2].y-i),Math.hypot(e[3].x-t,e[3].y-i));return{points:e,distance:r,minDistance:a}}function bezier2DDistance(e,t,i,s,n,r,a,c,o,h,l=1){let u={value:bezierCandidate([{x:e,y:t},{x:i,y:s},{x:n,y:r},{x:a,y:c}],o,h),next:null},f;for(;u!=null;){const{points:p,distance:y,minDistance:g}=u.value;if(u=u.next,(f==null||y<f.distance)&&(f={distance:y,minDistance:g}),f!=null&&f.distance-g<=l)continue;const[m,b]=splitBezier2D(p[0].x,p[0].y,p[1].x,p[1].y,p[2].x,p[2].y,p[3].x,p[3].y,.5),S=[bezierCandidate(m,o,h),bezierCandidate(b,o,h)].sort(bezierCandidateCmp);u=(0,import_ag_charts_core15.insertListItemsSorted)(u,S,bezierCandidateCmp)}return f?.distance??1/0}var bezierCandidateCmp=(e,t)=>t.minDistance-e.minDistance,ExtendedPath2D=class{constructor(){this.path2d=new Path2D,this.previousCommands=[],this.previousParams=[],this.previousClosedPath=!1,this.commands=[],this.params=[],this.cx=NaN,this.cy=NaN,this.sx=NaN,this.sy=NaN,this.openedPath=!1,this.closedPath=!1}isEmpty(){return this.commands.length===0}isDirty(){return this.closedPath!==this.previousClosedPath||this.previousCommands.length!==this.commands.length||this.previousParams.length!==this.params.length||this.previousCommands.toString()!==this.commands.toString()||this.previousParams.toString()!==this.params.toString()}getPath2D(){return this.path2d}moveTo(e,t){this.openedPath=!0,this.sx=e,this.sy=t,this.cx=e,this.cy=t,this.path2d.moveTo(e,t),this.commands.push(0),this.params.push(e,t)}lineTo(e,t){this.openedPath?(this.cx=e,this.cy=t,this.path2d.lineTo(e,t),this.commands.push(1),this.params.push(e,t)):this.moveTo(e,t)}cubicCurveTo(e,t,i,s,n,r){this.openedPath||this.moveTo(e,t),this.path2d.bezierCurveTo(e,t,i,s,n,r),this.commands.push(2),this.params.push(e,t,i,s,n,r)}closePath(){this.openedPath&&(this.cx=this.sx,this.cy=this.sy,this.sx=NaN,this.sy=NaN,this.path2d.closePath(),this.commands.push(3),this.openedPath=!1,this.closedPath=!0)}rect(e,t,i,s){this.moveTo(e,t),this.lineTo(e+i,t),this.lineTo(e+i,t+s),this.lineTo(e,t+s),this.closePath()}roundRect(e,t,i,s,n){n=Math.min(n,i/2,s/2),this.moveTo(e,t+n),this.arc(e+n,t+n,n,Math.PI,1.5*Math.PI),this.lineTo(e+n,t),this.lineTo(e+i-n,t),this.arc(e+i-n,t+n,n,1.5*Math.PI,2*Math.PI),this.lineTo(e+i,t+n),this.lineTo(e+i,t+s-n),this.arc(e+i-n,t+s-n,n,0,Math.PI/2),this.lineTo(e+i-n,t+s),this.lineTo(e+n,t+s),this.arc(e+ +n,t+s-n,n,Math.PI/2,Math.PI),this.lineTo(e,t+s-n),this.closePath()}ellipse(e,t,i,s,n,r,a,c=!1){const o=i,h=s/i,l=Math.cos(n),d=Math.sin(n),u=-h*d,f=h*l,p=o*Math.cos(r),y=o*Math.sin(r),g=e+l*p+u*y,m=t+d*p+f*y,b=(g-this.cx)**2+(m-this.cy)**2;this.openedPath?b>1e-6&&this.lineTo(g,m):this.moveTo(g,m);let S=c?-normalizeAngle360(r-a):normalizeAngle360(a-r);Math.abs(Math.abs(a-r)-2*Math.PI)<1e-6&&S<2*Math.PI&&(S+=2*Math.PI*(c?-1:1));const C=Math.max(Math.ceil(Math.abs(S)/(Math.PI/2)),1),P=S/C,w=4/3*Math.tan(P/4);for(let v=0;v<C;v+=1){const x=r+P*(v+0),M=r+P*(v+1),A=o*Math.sin(x),D=o*Math.cos(x),T=o*Math.sin(M),R=o*Math.cos(M),E=D-w*A,q=A+w*D,G=R+w*T,W=T-w*R,H=R,$=T;this.cubicCurveTo(e+l*E+u*q,t+d*E+f*q,e+l*G+u*W,t+d*G+f*W,e+l*H+u*$,t+d*H+f*$)}}arc(e,t,i,s,n,r){this.ellipse(e,t,i,i,0,s,n,r)}appendSvg(e){const t=parseSvg(e);if(t==null)return!1;let i=0,s=0,n,r,a=0,c=0;for(const{command:o,params:h}of t){n??(n=h[0]),r??(r=h[1]);const l=o===o.toLowerCase(),d=l?n:0,u=l?r:0;switch(o.toLowerCase()){case"m":this.moveTo(d+h[0],u+h[1]),n=d+h[0],r=u+h[1],i=n,s=r;break;case"c":this.cubicCurveTo(d+h[0],u+h[1],d+h[2],u+h[3],d+h[4],u+h[5]),a=d+h[2],c=u+h[3],n=d+h[4],r=u+h[5];break;case"s":this.cubicCurveTo(n+n-a,r+r-c,d+h[0],u+h[1],d+h[2],u+h[3]),a=d+h[0],c=u+h[1],n=d+h[2],r=u+h[3];break;case"q":this.cubicCurveTo((d+2*h[0])/3,(u+2*h[1])/3,(2*h[0]+h[2])/3,(2*h[1]+h[3])/3,h[2],h[3]),a=h[0],c=h[1],n=h[2],r=h[3];break;case"t":this.cubicCurveTo((n+2*(n+n-a))/3,(r+2*(r+r-c))/3,(2*(n+n-a)+h[0])/3,(2*(r+r-c)+h[1])/3,h[0],h[1]),a=n+n-a,c=r+r-c,n=h[0],r=h[1];break;case"a":this.svgEllipse(n,r,h[0],h[1],h[2]*Math.PI/180,h[3],h[4],d+h[5],u+h[6]),n=d+h[5],r=u+h[6];break;case"h":this.lineTo(d+h[0],r),n=d+h[0];break;case"l":this.lineTo(d+h[0],u+h[1]),n=d+h[0],r=u+h[1];break;case"v":this.lineTo(n,u+h[0]),r=u+h[0];break;case"z":this.closePath(),n=i,r=s;break;default:throw new Error(`Could not translate command '${o}' with '${h.join(" ")}'`)}}return!0}svgEllipse(e,t,i,s,n,r,a,c,o){i=Math.abs(i),s=Math.abs(s);const h=(e-c)/2,l=(t-o)/2,d=Math.sin(n),u=Math.cos(n),f=u*h+d*l,p=-d*h+u*l,y=f/i,g=p/s;let m=y*y+g*g,b=(e+c)/2,S=(t+o)/2,C=0,P=0;m>=1?(m=Math.sqrt(m),i*=m,s*=m):(m=Math.sqrt(1/m-1),r===a&&(m=-m),C=m*i*g,P=-m*s*y,b+=u*C-d*P,S+=d*C+u*P);const w=Math.atan2((p-P)/s,(f-C)/i),v=Math.atan2((-p-P)/s,(-f-C)/i)-w,x=w+v,M=!!(1-a);this.ellipse(b,S,i,s,n,w,x,M)}clear(e){e&&(this.previousCommands=this.commands,this.previousParams=this.params,this.previousClosedPath=this.closedPath),this.path2d=new Path2D,this.openedPath=!1,this.closedPath=!1,this.commands=[],this.params=[]}isPointInPath(e,t){const i=this.commands,s=this.params,n=i.length,r=-1e4,a=-1e4;let c=NaN,o=NaN,h=0,l=0,d=0;for(let u=0,f=0;u<n;u++)switch(i[u]){case 0:d+=segmentIntersection(c,o,h,l,r,a,e,t),h=s[f++],c=h,l=s[f++],o=l;break;case 1:d+=segmentIntersection(h,l,s[f++],s[f++],r,a,e,t),h=s[f-2],l=s[f-1];break;case 2:d+=cubicSegmentIntersections(h,l,s[f++],s[f++],s[f++],s[f++],s[f++],s[f++],r,a,e,t),h=s[f-2],l=s[f-1];break;case 3:d+=segmentIntersection(c,o,h,l,r,a,e,t);break}return d%2===1}distanceSquared(e,t){let i=1/0;const s=this.commands,n=this.params,r=s.length;let a=NaN,c=NaN,o=0,h=0;for(let l=0,d=0;l<r;l++)switch(s[l]){case 0:o=a=n[d++],h=c=n[d++];break;case 1:{const b=o,S=h;o=n[d++],h=n[d++],i=lineDistanceSquared(e,t,b,S,o,h,i);break}case 2:const u=o,f=h,p=n[d++],y=n[d++],g=n[d++],m=n[d++];o=n[d++],h=n[d++],i=bezier2DDistance(u,f,p,y,g,m,o,h,e,t)**2;break;case 3:i=lineDistanceSquared(e,t,o,h,a,c,i);break}return i}toSVG(e=(t,i)=>({x:t,y:i})){const t=[],{commands:i,params:s}=this,n=(a,c)=>{t.push(a);for(let o=0;o<c;o+=2){const{x:h,y:l}=e(s[r++],s[r++]);t.push(h,l)}};let r=0;for(const a of i)switch(a){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:e,params:t}=this;let[i,s,n,r]=[1/0,1/0,-1/0,-1/0],[a,c]=[NaN,NaN],[o,h]=[NaN,NaN];const l=(u,f)=>{i=Math.min(f,i),s=Math.min(u,s),n=Math.max(u,n),r=Math.max(f,r),a=u,c=f};let d=0;for(const u of e)switch(u){case 0:l(t[d++],t[d++]),o=a,h=c;break;case 1:l(t[d++],t[d++]);break;case 2:{const f=a,p=c,y=t[d++],g=t[d++],m=t[d++],b=t[d++],S=t[d++],C=t[d++];bezier2DExtrema(f,p,y,g,m,b,S,C).forEach(w=>{const v=evaluateBezier(f,y,m,S,w),x=evaluateBezier(p,g,b,C,w);l(v,x)}),l(S,C);break}case 3:l(o,h),o=NaN,h=NaN;break}return new BBox(s,i,n-s,r-i)}};function align(e,t,i){const s=Math.round(t*e)/e;return i==null?s:i===0?0:i<1?Math.ceil(i*e)/e:Math.round((i+t)*e)/e-s}function alignBefore(e,t){return Math.floor(t*e)/e}function drawPatternUnitPolygon(e,t,i){const{width:s,height:n,padding:r,strokeWidth:a}=t,c=s/2,o=n/2,h=Math.max(1,s-r-a/2),l=Math.max(1,n-r-a/2);let d=!1;for(const[u,f]of i){const p=c+(u-.5)*h,y=o+(f-.5)*l;d?e.lineTo(p,y):e.moveTo(p,y),d=!0}e.closePath()}var PATTERNS={circles(e,{width:t,strokeWidth:i,padding:s}){const n=t/2,r=Math.max(1,n-s-i/2);e.arc(n,n,r,0,Math.PI*2)},squares(e,{width:t,height:i,pixelRatio:s,padding:n,strokeWidth:r}){const a=n+r/2;e.moveTo(align(s,a),align(s,a)),e.lineTo(align(s,t-a),align(s,a)),e.lineTo(align(s,t-a),align(s,i-a)),e.lineTo(align(s,a),align(s,i-a)),e.closePath()},triangles(e,t){drawPatternUnitPolygon(e,t,[[.5,0],[1,1],[0,1]])},diamonds(e,t){drawPatternUnitPolygon(e,t,[[.5,0],[1,.5],[.5,1],[0,.5]])},stars(e,{width:t,height:i,padding:s}){const r=Math.max(1,(t-s)/2),a=r/2,c=Math.PI/2;for(let o=0;o<5*2;o++){const h=o%2===0?r:a,l=o*Math.PI/5-c,d=t/2+Math.cos(l)*h,u=i/2+Math.sin(l)*h;e.lineTo(d,u)}e.closePath()},hearts(e,{width:t,height:i,padding:s}){const n=Math.max(1,t/4-s/2),r=t/2,a=i/2+n/2;e.arc(r-n,a-n,n,toRadians(130),toRadians(330)),e.arc(r+n,a-n,n,toRadians(220),toRadians(50)),e.lineTo(r,a+n),e.closePath()},crosses(e,t){drawPatternUnitPolygon(e,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"(e,{width:t,height:i,pixelRatio:s,strokeWidth:n}){const r=align(s,t/2)-n%2/2;e.moveTo(r,0),e.lineTo(r,i)},"horizontal-lines"(e,{width:t,height:i,pixelRatio:s,strokeWidth:n}){const r=align(s,i/2)-n%2/2;e.moveTo(0,r),e.lineTo(t,r)},"forward-slanted-lines"(e,{width:t,height:i,strokeWidth:s}){const n=Math.atan2(i,t),r=s*Math.cos(n),a=s*Math.sin(n);e.moveTo(-r,a),e.lineTo(r,-a),e.moveTo(-r,i+a),e.lineTo(t+r,-a),e.moveTo(t-r,i+a),e.lineTo(t+r,i-a)},"backward-slanted-lines"(e,{width:t,height:i,strokeWidth:s}){const n=Math.atan2(i,t),r=s*Math.cos(n),a=s*Math.sin(n);e.moveTo(t-r,-a),e.lineTo(t+r,a),e.moveTo(-r,-a),e.lineTo(t+r,i+a),e.moveTo(-r,i-a),e.lineTo(r,i+a)}},Pattern=class{constructor(e){this._cache=void 0,this.width=Math.max(e?.width??10,1),this.height=Math.max(e?.height??10,1),this.fill=e.fill??"none",this.fillOpacity=e.fillOpacity??1,this.backgroundFill=e.backgroundFill??"none",this.backgroundFillOpacity=e.backgroundFillOpacity??1,this.stroke=e.stroke??"black",this.strokeOpacity=e.strokeOpacity??1,this.strokeWidth=e.strokeWidth??1,this.padding=e.padding??1,this.pattern=e.pattern??"forward-slanted-lines",this.rotation=e.rotation??0,this.scale=e.scale??1,this.path=e.path}getPath(e){const{pattern:t,width:i,height:s,padding:n,strokeWidth:r,path:a}=this,c=new ExtendedPath2D;let o=PATTERNS[t]!=null;return a&&o&&(o=!c.appendSvg(a)),o&&PATTERNS[t](c,{width:i,height:s,pixelRatio:e,strokeWidth:r,padding:n}),c}renderStroke(e,t){const{stroke:i,strokeWidth:s,strokeOpacity:n}=this;s&&(t.strokeStyle=i,t.lineWidth=s,t.globalAlpha=n,t.stroke(e))}renderFill(e,t){const{fill:i,fillOpacity:s}=this;i!=="none"&&(t.fillStyle=i,t.globalAlpha=s,t.fill(e))}createCanvasPattern(e,t){const{width:i,height:s,scale:n,backgroundFill:r,backgroundFillOpacity:a}=this;if(i*n<1||s*n<1)return import_ag_charts_core16.Logger.warnOnce("Pattern fill is too small to render, ignoring."),null;const c=new HdpiOffscreenCanvas({width:i,height:s,pixelRatio:t*n}),o=c.context;r!=="none"&&(o.fillStyle=r,o.globalAlpha=a,o.fillRect(0,0,i,s));const h=this.getPath(t).getPath2D();this.renderFill(h,o),this.renderStroke(h,o);const l=e.createPattern(c.canvas,"repeat");return this.setPatternTransform(l,t),c.destroy(),l}setPatternTransform(e,t,i=0,s=0){if(e==null)return;const n=normalizeAngle360FromDegrees(this.rotation),r=1/t,a=Math.cos(n)*r,c=Math.sin(n)*r;e.setTransform(new DOMMatrix([a,c,-c,a,i,s]))}createPattern(e,t){if(this._cache!=null&&this._cache.ctx===e&&this._cache.pixelRatio===t)return this._cache.pattern;const i=this.createCanvasPattern(e,t);if(i!=null)return this._cache={ctx:e,pattern:i,pixelRatio:t},i}toSvg(){const{width:e,height:t,fill:i,fillOpacity:s,backgroundFill:n,backgroundFillOpacity:r,stroke:a,strokeWidth:c,strokeOpacity:o,rotation:h,scale:l}=this,d=(0,import_ag_charts_core16.createSvgElement)("pattern");d.setAttribute("viewBox",`0 0 ${e} ${t}`),d.setAttribute("width",String(e)),d.setAttribute("height",String(t)),d.setAttribute("patternUnits","userSpaceOnUse");const u=(0,import_ag_charts_core16.createSvgElement)("rect");u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(e)),u.setAttribute("height",String(t)),u.setAttribute("fill",n),u.setAttribute("fill-opacity",String(r)),d.appendChild(u);const f=(0,import_ag_charts_core16.createSvgElement)("path");return f.setAttribute("fill",i),f.setAttribute("fill-opacity",String(s)),f.setAttribute("stroke-opacity",String(o)),f.setAttribute("stroke",a),f.setAttribute("stroke-width",String(c)),f.setAttribute("transform",`rotate(${h}) scale(${l})`),f.setAttribute("d",this.getPath(1).toSVG()),d.appendChild(f),d}},import_ag_charts_core17=require("ag-charts-core"),core2=__toESM(require("ag-charts-core")),{isArray:isArray3,isObject:isObject2}=core2;function isGradientFill(e){return isObject2(e)&&e.type=="gradient"}function isPatternFill(e){return e!==null&&isObject2(e)&&e.type=="pattern"}function isImageFill(e){return e!==null&&isObject2(e)&&e.type=="image"}var Shape=class extends Node{constructor(){super(...arguments),this.fillOpacity=1,this.strokeOpacity=1,this.fill="black",this.strokeWidth=0,this.lineDashOffset=0,this.opacity=1}getGradient(e){if(isGradientFill(e))return this.createGradient(e)}createGradient(e){const{colorSpace:t="rgb",gradient:i="linear",colorStops:s,rotation:n=0,reverse:r=!1}=e;if(s==null)return;let a=getColorStops(s,["black"],[0,1]);switch(r&&(a=a.map(c=>({color:c.color,stop:1-c.stop})).reverse()),i){case"linear":return new LinearGradient(t,a,n);case"radial":return new RadialGradient(t,a);case"conic":return new ConicGradient(t,a,n)}}getPattern(e){if(isPatternFill(e))return this.createPattern(e)}createPattern(e){return new Pattern(e)}getImage(e){if(isImageFill(e))return this.createImage(e)}createImage(e){return new Image2(this.imageLoader,e)}onFillChange(){typeof this.fill=="object"&&objectsEqual(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,t){return align(this.layerManager?.canvas?.pixelRatio??1,e,t)}markDirty(e){super.markDirty(e),this.cachedDefaultGradientFillBBox=void 0}fillStroke(e,t){this.renderFill(e,t),this.renderStroke(e,t)}renderFill(e,t){const{fill:i,fillImage:s}=this;if(i&&i!=="none"){const{globalAlpha:n}=e;s&&(e.globalAlpha=s.backgroundFillOpacity,e.fillStyle=s.backgroundFill,this.executeFill(e,t),e.globalAlpha=n),this.applyFillAndAlpha(e),this.applyShadow(e),this.executeFill(e,t),e.globalAlpha=n}e.shadowColor="rgba(0, 0, 0, 0)"}executeFill(e,t){t?e.fill(t):e.fill()}applyFillAndAlpha(e){const{fill:t,fillGradient:i,fillPattern:s,fillImage:n,fillOpacity:r=1,opacity:a=1}=this;if(e.globalAlpha*=a*r,i){const{fillBBox:c=this.getDefaultGradientFillBBox()??this.getBBox(),fillParams:o}=this;e.fillStyle=i.createGradient(e,c,o)??"black"}else if(s){const{x:c,y:o}=this.getBBox(),h=this.layerManager?.canvas?.pixelRatio??1,l=s.createPattern(e,h);s.setPatternTransform(l,h,c,o),l?e.fillStyle=l:(e.fillStyle=s.fill,e.globalAlpha*=s.fillOpacity)}else if(n){const c=this.getBBox(),o=n.createPattern(e,c.width,c.height,this);n.setImageTransform(o,c),e.fillStyle=o??"transparent"}else e.fillStyle=typeof t=="string"?t:"black"}applyStrokeAndAlpha(e){const{stroke:t,strokeOpacity:i=1,strokeGradient:s,opacity:n=1}=this;e.strokeStyle=s?.createGradient(e,this.getBBox())??(typeof t=="string"?t:void 0)??"black",e.globalAlpha*=n*i}applyShadow(e){const t=this.layerManager?.canvas.pixelRatio??1,i=this.fillShadow;i?.enabled&&(e.shadowColor=i.color,e.shadowOffsetX=i.xOffset*t,e.shadowOffsetY=i.yOffset*t,e.shadowBlur=i.blur*t)}renderStroke(e,t){const{stroke:i,strokeWidth:s,lineDash:n,lineDashOffset:r,lineCap:a,lineJoin:c,miterLimit:o}=this;if(i&&s){const{globalAlpha:h}=e;this.applyStrokeAndAlpha(e),e.lineWidth=s,n&&e.setLineDash(n),r&&(e.lineDashOffset=r),a&&(e.lineCap=a),c&&(e.lineJoin=c),o!=null&&(e.miterLimit=o),this.executeStroke(e,t),e.globalAlpha=h}}executeStroke(e,t){t?e.stroke(t):e.stroke()}getDefaultGradientFillBBox(){return this.cachedDefaultGradientFillBBox==null&&(this.cachedDefaultGradientFillBBox=Object.freeze(this.computeDefaultGradientFillBBox())),this.cachedDefaultGradientFillBBox}computeDefaultGradientFillBBox(){}containsPoint(e,t){return this.isPointInPath(e,t)}applySvgFillAttributes(e,t){const{fill:i,fillOpacity:s}=this;if(typeof i=="string")e.setAttribute("fill",i);else if(isGradientFill(i)&&this.fillGradient){t??(t=[]);const n=this.fillGradient.toSvg(this.fillBBox??this.getBBox()),r=(0,import_ag_charts_core18.generateUUID)();n.setAttribute("id",r),t.push(n),e.setAttribute("fill",`url(#${r})`)}else if(isPatternFill(i)&&this.fillPattern){t??(t=[]);const n=this.fillPattern.toSvg(),r=(0,import_ag_charts_core18.generateUUID)();n.setAttribute("id",r),t.push(n),e.setAttribute("fill",`url(#${r})`)}else if(isImageFill(i)&&this.fillImage){t??(t=[]);const n=this.layerManager?.canvas?.pixelRatio??1,r=this.fillImage.toSvg(this.getBBox(),n),a=(0,import_ag_charts_core18.generateUUID)();r.setAttribute("id",a),t.push(r),e.setAttribute("fill",`url(#${a})`)}else e.setAttribute("fill","none");return e.setAttribute("fill-opacity",String(s)),t}applySvgStrokeAttributes(e){const{stroke:t,strokeOpacity:i,strokeWidth:s,lineDash:n,lineDashOffset:r}=this;if(t!=null&&(e.setAttribute("stroke",typeof t=="string"?t:"none"),e.setAttribute("stroke-opacity",String(i)),e.setAttribute("stroke-width",String(s))),n?.some(a=>a!==0)===!0){const a=n.length%2===1?[...n,...n]:n;e.setAttribute("stroke-dasharray",a.join(" ")),e.setAttribute("stroke-dashoffset",String(r))}}};__decorateClass([SceneChangeDetection()],Shape.prototype,"fillOpacity",2),__decorateClass([SceneChangeDetection()],Shape.prototype,"strokeOpacity",2),__decorateClass([SceneObjectChangeDetection({equals:objectsEqual,changeCb:e=>e.onFillChange()})],Shape.prototype,"fill",2),__decorateClass([SceneObjectChangeDetection({equals:objectsEqual,changeCb:e=>e.onStrokeChange()})],Shape.prototype,"stroke",2),__decorateClass([SceneChangeDetection()],Shape.prototype,"strokeWidth",2),__decorateClass([SceneArrayChangeDetection()],Shape.prototype,"lineDash",2),__decorateClass([SceneChangeDetection()],Shape.prototype,"lineDashOffset",2),__decorateClass([SceneChangeDetection()],Shape.prototype,"lineCap",2),__decorateClass([SceneChangeDetection()],Shape.prototype,"lineJoin",2),__decorateClass([SceneChangeDetection()],Shape.prototype,"miterLimit",2),__decorateClass([SceneChangeDetection({convertor:e=>(0,import_ag_charts_core18.clamp)(0,e??1,1)})],Shape.prototype,"opacity",2),__decorateClass([SceneObjectChangeDetection({equals:TRIPLE_EQ,checkDirtyOnAssignment:!0})],Shape.prototype,"fillShadow",2),__decorateClass([SceneObjectChangeDetection({equals:import_ag_charts_core18.boxesEqual,changeCb:e=>e.onFillChange()})],Shape.prototype,"fillBBox",2),__decorateClass([SceneObjectChangeDetection({equals:objectsEqual,changeCb:e=>e.onFillChange()})],Shape.prototype,"fillParams",2);var import_ag_charts_core20=require("ag-charts-core"),import_ag_charts_core19=require("ag-charts-core"),IDENTITY_MATRIX_ELEMENTS=[1,0,0,1,0,0],Matrix=class X{get e(){return[...this.elements]}constructor(t=IDENTITY_MATRIX_ELEMENTS){this.elements=[...t]}setElements(t){const i=this.elements;return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],this}get identity(){const t=this.elements;return(0,import_ag_charts_core19.isNumberEqual)(t[0],1)&&(0,import_ag_charts_core19.isNumberEqual)(t[1],0)&&(0,import_ag_charts_core19.isNumberEqual)(t[2],0)&&(0,import_ag_charts_core19.isNumberEqual)(t[3],1)&&(0,import_ag_charts_core19.isNumberEqual)(t[4],0)&&(0,import_ag_charts_core19.isNumberEqual)(t[5],0)}AxB(t,i,s){const n=t[0]*i[0]+t[2]*i[1],r=t[1]*i[0]+t[3]*i[1],a=t[0]*i[2]+t[2]*i[3],c=t[1]*i[2]+t[3]*i[3],o=t[0]*i[4]+t[2]*i[5]+t[4],h=t[1]*i[4]+t[3]*i[5]+t[5];s=s??t,s[0]=n,s[1]=r,s[2]=a,s[3]=c,s[4]=o,s[5]=h}multiplySelf(t){return this.AxB(this.elements,t.elements),this}multiply(t){const i=new Array(6);return t instanceof X?this.AxB(this.elements,t.elements,i):this.AxB(this.elements,[t.a,t.b,t.c,t.d,t.e,t.f],i),new X(i)}preMultiplySelf(t){return this.AxB(t.elements,this.elements,this.elements),this}inverse(){const t=this.elements;let i=t[0],s=t[1],n=t[2],r=t[3];const a=t[4],c=t[5],o=1/(i*r-s*n);return i*=o,s*=o,n*=o,r*=o,new X([r,-s,-n,i,n*c-r*a,s*a-i*c])}invertSelf(){const t=this.elements;let i=t[0],s=t[1],n=t[2],r=t[3];const a=t[4],c=t[5],o=1/(i*r-s*n);return i*=o,s*=o,n*=o,r*=o,t[0]=r,t[1]=-s,t[2]=-n,t[3]=i,t[4]=n*c-r*a,t[5]=s*a-i*c,this}transformPoint(t,i){const s=this.elements;return{x:t*s[0]+i*s[2]+s[4],y:t*s[1]+i*s[3]+s[5]}}transformBBox(t,i){const s=this.elements,n=s[0],r=s[1],a=s[2],c=s[3],o=t.width*.5,h=t.height*.5,l=t.x+o,d=t.y+h,u=Math.abs(o*n)+Math.abs(h*a),f=Math.abs(o*r)+Math.abs(h*c);return i??(i=new BBox(0,0,0,0)),i.x=l*n+d*a+s[4]-u,i.y=l*r+d*c+s[5]-f,i.width=u+u,i.height=f+f,i}toContext(t){if(this.identity)return;const i=this.elements;t.transform(i[0],i[1],i[2],i[3],i[4],i[5])}static updateTransformMatrix(t,i,s,n,r,a,c){const o=i,h=s;let l,d;o===1&&h===1?(l=0,d=0):(l=c?.scalingCenterX??0,d=c?.scalingCenterY??0);const u=n,f=Math.cos(u),p=Math.sin(u);let y,g;u===0?(y=0,g=0):(y=c?.rotationCenterX??0,g=c?.rotationCenterY??0);const m=r,b=a,S=l*(1-o)-y,C=d*(1-h)-g;return t.setElements([f*o,p*o,-p*h,f*h,f*S-p*C+y+m,p*S+f*C+g+b]),t}};function isMatrixTransform(e){return isMatrixTransformType(e.constructor)}var MATRIX_TRANSFORM_TYPE=Symbol("isMatrixTransform");function isMatrixTransformType(e){return e[MATRIX_TRANSFORM_TYPE]===!0}function MatrixTransform(e){var t,i;const s=e;if(isMatrixTransformType(e))return e;const n=Symbol("matrix_combined_transform");class r extends s{constructor(){super(...arguments),this[i]=new Matrix,this._dirtyTransform=!0}onChangeDetection(c){super.onChangeDetection(c),this._dirtyTransform=!0,!(this.batchLevel>0)&&this.markDirty("transform")}updateMatrix(c){}computeTransformMatrix(){this._dirtyTransform&&(this[n].setElements(IDENTITY_MATRIX_ELEMENTS),this.updateMatrix(this[n]),this._dirtyTransform=!1)}toParent(c){return this.computeTransformMatrix(),this[n].identity?c.clone():this[n].transformBBox(c)}toParentPoint(c,o){return this.computeTransformMatrix(),this[n].identity?{x:c,y:o}:this[n].transformPoint(c,o)}fromParent(c){return this.computeTransformMatrix(),this[n].identity?c.clone():this[n].inverse().transformBBox(c)}fromParentPoint(c,o){return this.computeTransformMatrix(),this[n].identity?{x:c,y:o}:this[n].inverse().transformPoint(c,o)}computeBBox(){const c=super.computeBBox();return c&&this.toParent(c)}computeBBoxWithoutTransforms(){return super.computeBBox()}pickNode(c,o){return{x:c,y:o}=this.fromParentPoint(c,o),super.pickNode(c,o)}pickNodes(c,o,h){return{x:c,y:o}=this.fromParentPoint(c,o),super.pickNodes(c,o,h)}render(c){this.computeTransformMatrix();const{ctx:o}=c,h=this[n];let l=!1;try{h.identity||(o.save(),l=!0,h.toContext(o)),super.render(c)}finally{l&&o.restore()}}toSVG(){this.computeTransformMatrix();const c=super.toSVG(),o=this[n];if(o.identity||c==null)return c;const h=(0,import_ag_charts_core20.createSvgElement)("g");h.append(...c.elements);const[l,d,u,f,p,y]=o.e;return h.setAttribute("transform",`matrix(${l} ${d} ${u} ${f} ${p} ${y})`),{elements:[h],defs:c.defs}}}return t=MATRIX_TRANSFORM_TYPE,i=n,r[t]=!0,r}function Rotatable(e){var t;const i=e,s=Symbol("matrix_rotation");class n extends MatrixTransform(i){constructor(){super(...arguments),this[t]=new Matrix,this.rotationCenterX=0,this.rotationCenterY=0,this.rotation=0}updateMatrix(a){super.updateMatrix(a);const{rotation:c,rotationCenterX:o,rotationCenterY:h}=this;c!==0&&(Matrix.updateTransformMatrix(this[s],1,1,c,0,0,{rotationCenterX:o,rotationCenterY:h}),a.multiplySelf(this[s]))}}return t=s,__decorateClass([SceneChangeDetection()],n.prototype,"rotationCenterX",2),__decorateClass([SceneChangeDetection()],n.prototype,"rotationCenterY",2),__decorateClass([SceneChangeDetection()],n.prototype,"rotation",2),n}function Scalable(e){var t;const i=e,s=Symbol("matrix_scale");class n extends MatrixTransform(i){constructor(){super(...arguments),this[t]=new Matrix,this.scalingX=1,this.scalingY=1,this.scalingCenterX=0,this.scalingCenterY=0}updateMatrix(a){super.updateMatrix(a);const{scalingX:c,scalingY:o,scalingCenterX:h,scalingCenterY:l}=this;c===1&&o===1||(Matrix.updateTransformMatrix(this[s],c,o,0,0,0,{scalingCenterX:h,scalingCenterY:l}),a.multiplySelf(this[s]))}}return t=s,__decorateClass([SceneChangeDetection()],n.prototype,"scalingX",2),__decorateClass([SceneChangeDetection()],n.prototype,"scalingY",2),__decorateClass([SceneChangeDetection()],n.prototype,"scalingCenterX",2),__decorateClass([SceneChangeDetection()],n.prototype,"scalingCenterY",2),n}function Translatable(e){var t;const i=e,s=Symbol("matrix_translation");class n extends MatrixTransform(i){constructor(){super(...arguments),this[t]=new Matrix,this.translationX=0,this.translationY=0}updateMatrix(a){super.updateMatrix(a);const{translationX:c,translationY:o}=this;c===0&&o===0||(Matrix.updateTransformMatrix(this[s],1,1,0,c,o),a.multiplySelf(this[s]))}}return t=s,__decorateClass([SceneChangeDetection()],n.prototype,"translationX",2),__decorateClass([SceneChangeDetection()],n.prototype,"translationY",2),n}var Transformable=class{static fromCanvas(e,t){const i=[];for(const s of e.traverseUp())isMatrixTransform(s)&&i.unshift(s);for(const s of i)t=s.fromParent(t);return isMatrixTransform(e)&&(t=e.fromParent(t)),t}static toCanvas(e,t){t==null?t=e.getBBox():isMatrixTransform(e)&&(t=e.toParent(t));for(const i of e.traverseUp())isMatrixTransform(i)&&(t=i.toParent(t));return t}static fromCanvasPoint(e,t,i){const s=[];for(const n of e.traverseUp())isMatrixTransform(n)&&s.unshift(n);for(const n of s)({x:t,y:i}=n.fromParentPoint(t,i));return isMatrixTransform(e)&&({x:t,y:i}=e.fromParentPoint(t,i)),{x:t,y:i}}static toCanvasPoint(e,t,i){isMatrixTransform(e)&&({x:t,y:i}=e.toParentPoint(t,i));for(const s of e.traverseUp())isMatrixTransform(s)&&({x:t,y:i}=s.toParentPoint(t,i));return{x:t,y:i}}},sharedOffscreenCanvas,_Group=class j extends Node{constructor(t){super(t),this.childNodes=new Set,this.dirty=!1,this.dirtyZIndex=!1,this.clipRect=void 0,this.opacity=1,this.renderToOffscreenCanvas=!1,this.optimizeForInfrequentRedraws=!1,this.layer=void 0,this.image=void 0,this._lastWidth=NaN,this._lastHeight=NaN,this._lastDevicePixelRatio=NaN,this.isContainerNode=!0,this.renderToOffscreenCanvas=t?.renderToOffscreenCanvas===!0}static is(t){return t instanceof j}static computeChildrenBBox(t,i=!0){return BBox.merge(Node.extractBBoxes(t,i))}static compareChildren(t,i){return compareZIndex(t.zIndex,i.zIndex)||t.serialNumber-i.serialNumber}containsPoint(t,i){return!0}computeBBox(){return j.computeChildrenBBox(this.children())}computeSafeClippingBBox(t){const i=this.computeBBox();if(i?.isFinite()!==!0)return;let s=0;const n=4;for(const u of this.descendants())u instanceof Shape&&(s=Math.max(s,u.strokeWidth));const r=Math.max(1,s/2*n),{x:a,y:c}=Transformable.toCanvasPoint(this,0,0),o=alignBefore(t,a+i.x-r)-a,h=alignBefore(t,c+i.y-r)-c,l=Math.ceil(i.x+i.width-o+r),d=Math.ceil(i.y+i.height-h+r);return new BBox(o,h,l,d)}prepareSharedCanvas(t,i,s){return sharedOffscreenCanvas==null||sharedOffscreenCanvas.pixelRatio!==s?sharedOffscreenCanvas=new HdpiOffscreenCanvas({width:t,height:i,pixelRatio:s}):sharedOffscreenCanvas.resize(t,i,s),sharedOffscreenCanvas}setScene(t){super.setScene(t),this.layer&&(this.scene?.layersManager.removeLayer(this.layer),this.layer=void 0);for(const i of this.children())i.setScene(t)}markDirty(t){this.dirty=!0,super.markDirty(t)}markDirtyChildrenOrder(){super.markDirtyChildrenOrder(),this.dirtyZIndex=!0,this.markDirty()}append(t){for(const i of(0,import_ag_charts_core21.toIterable)(t))i.parentNode?.removeChild(i),this.childNodes.add(i),i.parentNode=this,i.setScene(this.scene);this.markDirtyChildrenOrder(),this.markDirty()}appendChild(t){return this.append(t),t}removeChild(t){if(!this.childNodes?.delete(t))throw new Error(`AG Charts - internal error, unknown child node ${t.name??t.id} in $${this.name??this.id}`);t.parentNode=void 0,t.setScene(),this.markDirtyChildrenOrder(),this.markDirty()}clear(){for(const t of this.children())delete t.parentNode,t.setScene();this.childNodes?.clear(),this.markDirty()}pickNode(t,i){if(!(!this.visible||this.pointerEvents===1||!this.containsPoint(t,i))){if(this.childNodes!=null&&this.childNodes.size!==0){const s=[...this.children()];for(let n=s.length-1;n>=0;n--){const a=s[n].pickNode(t,i);if(a!=null)return a}}else if(!this.isContainerNode)return this}}pickNodes(t,i,s=[]){if(!this.visible||this.pointerEvents===1||!this.containsPoint(t,i))return s;this.isContainerNode||s.push(this);for(const n of this.children())n.pickNodes(t,i,s);return s}isDirty(t){const{width:i,height:s,devicePixelRatio:n}=t,{dirty:r,layer:a}=this,c=a!=null&&(this._lastWidth!==i||this._lastHeight!==s),o=this._lastDevicePixelRatio!==n;return this._lastWidth=i,this._lastHeight=s,this._lastDevicePixelRatio=n,r||c||o}preRender(t){let i;if(this.dirty){i=super.preRender(t,0);for(const s of this.children()){const n=s.preRender(t);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(t){const{layer:i,renderToOffscreenCanvas:s}=this,n={...t},r=this.isDirty(t);if(this.dirty=!1,!s){this.renderInContext(n),super.render(n);return}const{ctx:a,stats:c,devicePixelRatio:o}=t;let{image:h}=this;if(r){h?.bitmap.close(),h=void 0;const d=i?void 0:this.computeSafeClippingBBox(o),u=(f,...p)=>{const y=f.context;n.ctx=y,f.clear(),y.save();try{y.setTransform(...p),y.globalAlpha=1,this.renderInContext(n)}finally{y.restore(),y.verifyDepthZero?.()}};if(i)u(i,a.getTransform());else if(d){const{x:f,y:p,width:y,height:g}=d,m=this.prepareSharedCanvas(y,g,o);u(m,o,0,0,o,-f*o,-p*o),h={bitmap:m.transferToImageBitmap(),x:f,y:p,width:y,height:g}}this.image=h,c&&c.layersRendered++}else c&&c.layersSkipped++;const{globalAlpha:l}=a;if(a.globalAlpha=l*this.opacity,i){a.save();try{a.resetTransform(),i.drawImage(a)}finally{a.restore()}}else if(h){const{bitmap:d,x:u,y:f,width:p,height:y}=h;a.drawImage(d,0,0,p*o,y*o,u,f,p,y)}a.globalAlpha=l,super.render(n)}applyClip(t,i){const{x:s,y:n,width:r,height:a}=i;t.beginPath(),t.rect(s,n,r,a),t.clip()}renderInContext(t){const{ctx:i,stats:s}=t;this.dirtyZIndex&&(this.sortChildren(j.compareChildren),this.dirtyZIndex=!1),i.save();try{i.globalAlpha*=this.opacity,this.clipRect!=null&&(this.applyClip(i,this.clipRect),t.clipBBox=Transformable.toCanvas(this,this.clipRect));for(const n of this.children()){if(!n.visible){s&&(s.nodesSkipped+=n.childNodeCounts.nonGroups+n.childNodeCounts.groups,s.opsSkipped+=n.childNodeCounts.complexity);continue}n.isolatedRender(t)}}finally{i.restore()}}sortChildren(t){if(!this.childNodes)return;const i=[...this.childNodes].sort(t);this.childNodes.clear();for(const s of i)this.childNodes.add(s)}*children(){yield*this.childNodes}*descendants(){for(const t of this.children())yield t,t instanceof j&&(yield*t.descendants())}setClipRect(t){this.clipRect=t?Transformable.fromCanvas(this,t):void 0}setClipRectCanvasSpace(t){this.clipRect=t}getVisibility(){for(const t of this.traverseUp(!0))if(!t.visible)return!1;return!0}toSVG(){if(!this.visible)return;const t=[],i=[];for(const s of this.children()){const n=s.toSVG();n!=null&&(i.push(...n.elements),n.defs!=null&&t.push(...n.defs))}return{elements:i,defs:t}}};_Group.className="Group",__decorateClass([SceneChangeDetection({convertor:e=>(0,import_ag_charts_core21.clamp)(0,e,1)})],_Group.prototype,"opacity",2);var Group=_Group,ScalableGroup=class extends Scalable(Group){},RotatableGroup=class extends Rotatable(Group){},TranslatableGroup=class extends Translatable(Group){},TransformableGroup=class extends Rotatable(Translatable(Group)){};function formatBytes(e){for(const t of["B","KB","MB","GB"]){if(e<1536)return`${e.toFixed(1)}${t}`;e/=1024}return`${e.toFixed(1)}TB}`}function memoryUsage(){if(!("memory"in performance))return;const{totalJSHeapSize:e,usedJSHeapSize:t,jsHeapSizeLimit:i}=performance.memory,s=[];for(const n of[t,e,i])typeof n=="number"&&s.push(formatBytes(n));return`Heap ${s.join(" / ")}`}function debugStats(e,t,i,s,n={},r=BBox.zero){if(!Debug.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:a=0,layersSkipped:c=0,nodesRendered:o=0,nodesSkipped:h=0,opsPerformed:l=0,opsSkipped:d=0}=s??{},u=performance.now(),{start:f,...p}=t,y=Object.entries(p).map(([M,A])=>time(M,A)).filter(M=>M!=null).join(" + "),g=Object.entries(n).map(([M,A])=>`${M}: ${JSON.stringify(A)}`).join(" ; "),m=Debug.check("scene:stats:verbose"),b=memoryUsage(),S=[`${time("\u23F1\uFE0F",f,u)} (${y})`,`${g}`,`Layers: ${m?pct(a,c):e.size}`,m?`Nodes: ${pct(o,h)}`:null,m?`Ops: ${pct(l,d)}`:null,m&&b?b:null].filter(import_ag_charts_core22.isString),C=new SimpleTextMeasurer(M=>i.measureText(M)),P=new Map(S.map(M=>[M,C.measureLines(M)])),w=Math.max(...Array.from(P.values(),M=>M.width)),v=accumulate(P.values(),M=>M.height),x=2+r.x;i.save();try{i.fillStyle="white",i.fillRect(x,0,w,v),i.fillStyle="black";let M=0;for(const[A,D]of P.entries())M+=D.height,i.fillText(A,x,M)}catch(M){import_ag_charts_core22.Logger.warnOnce("Error during debug stats rendering",M)}finally{i.restore()}}function prepareSceneNodeHighlight(e){const t=(0,import_ag_charts_core22.toArray)((0,import_ag_charts_core22.getWindow)("agChartsSceneDebug")),i=[];for(const s of t)s==="layout"?i.push("seriesRoot","legend","root",/.*Axis-\d+-axis.*/):i.push(s);e.debugNodeSearch=i}function debugSceneNodeHighlight(e,t){e.save();try{for(const[i,s]of Object.entries(t)){const n=Transformable.toCanvas(s);if(!n){import_ag_charts_core22.Logger.log(`Scene.render() - no bbox for debugged node [${i}].`);continue}e.globalAlpha=.8,e.strokeStyle="red",e.lineWidth=1,e.strokeRect(n.x,n.y,n.width,n.height),e.fillStyle="red",e.strokeStyle="white",e.font="16px sans-serif",e.textBaseline="top",e.textAlign="left",e.lineWidth=2,e.strokeText(i,n.x,n.y,n.width),e.fillText(i,n.x,n.y,n.width)}}catch(i){import_ag_charts_core22.Logger.warnOnce("Error during debug rendering",i)}finally{e.restore()}}var skippedProperties=new Set,allowedProperties=new Set(["gradient","zIndex","clipRect","cachedBBox","childNodeCounts","path","__zIndex","name","__scalingCenterX","__scalingCenterY","__rotationCenterX","__rotationCenterY","_previousDatum","__fill","__lineDash","borderPath","borderClipPath","_clipPath"]);function nodeProps(e){const{...t}=e;for(const i of Object.keys(t))allowedProperties.has(i)||typeof t[i]!="number"&&typeof t[i]!="string"&&typeof t[i]!="boolean"&&(skippedProperties.add(i),delete t[i]);return t}function buildTree(e,t){if(!Debug.check(!0,"scene"))return{};let i=0;return{node:t==="json"?nodeProps(e):e,name:e.name??e.id,dirty:e instanceof Group?e.dirty:void 0,...Array.from(e instanceof Group?e.children():[],s=>buildTree(s,t)).reduce((s,n)=>{let{name:r}=n;const{node:{visible:a,opacity:c,zIndex:o,translationX:h,translationY:l,rotation:d,scalingX:u,scalingY:f},node:p}=n;(!a||c<=0)&&(r=`(${r})`),Group.is(p)&&p.renderToOffscreenCanvas&&(r=`*${r}*`);const y=Array.isArray(o)?`(${o.join(", ")})`:o,g=[`${(i++).toString().padStart(3,"0")}|`,`${r??"<unknown>"}`,`z: ${y}`,h&&`x: ${h}`,l&&`y: ${l}`,d&&`r: ${d}`,u!=null&&u!==1&&`sx: ${u}`,f!=null&&f!==1&&`sy: ${f}`].filter(S=>!!S).join(" ");let m=g,b=1;for(;s[m]!=null&&b<100;)m=`${g} (${b++})`;return s[m]=n,s},{})}}function buildDirtyTree(e){const t=e instanceof Group?e.dirty:void 0;if(!t)return{dirtyTree:{},paths:[]};const i=Array.from(e instanceof Group?e.children():[],r=>buildDirtyTree(r)).filter(r=>r.paths.length>0),s=Group.is(e)?e.name??e.id:e.id,n=i.length?i.flatMap(r=>r.paths).map(r=>`${s}.${r}`):[s];return{dirtyTree:{name:s,node:e,dirty:t,...i.map(r=>r.dirtyTree).filter(r=>r.dirty!=null).reduce((r,a)=>(r[a.name??"<unknown>"]=a,r),{})},paths:n}}function pct(e,t){const i=e+t;return`${e} / ${i} (${Math.round(100*e/i)}%)`}function time(e,t,i){const s=i!=null?i-t:t;return`${e}: ${Math.round(s*100)/100}ms`}function accumulate(e,t){let i=0;for(const s of e)i+=t(s);return i}var externUseGlyphIndependentMeasurements=!1,_Text=class Y extends Shape{constructor(){super(...arguments),this.x=0,this.y=0,this.lines=[],this.text=void 0,this.fontSize=Y.defaultFontSize,this.fontFamily="sans-serif",this.textAlign="start",this.textBaseline="alphabetic"}onTextChange(){this.lines=this.text?.split(`
`).map(t=>t.trim())??[]}static computeBBox(t,i,s,n,r=!0){const{font:a,font:{fontSize:c},textAlign:o,textBaseline:h="alphabetic",lineHeight:l=r?TextUtils.getLineHeight(c):void 0}=n,{width:d,alphabeticBaseline:u,offsetLeft:f,offsetTop:p,height:y}=CachedTextMeasurerPool.measureLines(t,r?{font:a,lineHeight:l,textAlign:"start",textBaseline:"top"}:n),g=l==null?y:l*t.length;let m;l==null?m=p:h==="alphabetic"?m=(l-c)/2-u:m=TextUtils.getVerticalModifier(h)*g;const b=r?d*TextUtils.getHorizontalModifier(o):f;return new BBox(i-b,s-m,d,g)}computeBBox(t=externUseGlyphIndependentMeasurements){const{x:i,y:s,lines:n,textBaseline:r,textAlign:a,lineHeight:c}=this;return Y.computeBBox(n,i,s,{font:this,textBaseline:r,textAlign:a,lineHeight:c},t)}getBBox(t=!0){if(t){externUseGlyphIndependentMeasurements=!0;const i=this.computeBBox(!0);return externUseGlyphIndependentMeasurements=!1,i}return super.getBBox()}getTextMeasureBBox(){return this.computeBBox()}isPointInPath(t,i){const s=this.getBBox();return s?s.containsPoint(t,i):!1}render(t){const{ctx:i,stats:s}=t;if(!this.lines.length||!this.layerManager)return s&&(s.nodesSkipped+=1),super.render(t);const{fill:n,stroke:r,strokeWidth:a}=this,{globalAlpha:c}=i,{pixelRatio:o}=this.layerManager.canvas;if(!n&&!(r!=null&&a>0))return super.render(t);const h=TextUtils.toFontString(this);i.font!==h&&(i.font=h);const{fontSize:l,lineHeight:d=TextUtils.getLineHeight(l),textAlign:u,textBaseline:f}=this,p=this.lines.length,y=f==="alphabetic"?0:-TextUtils.getVerticalModifier(f)*d*(p-1);if(i.textAlign=u,i.textBaseline=f,n){this.applyFillAndAlpha(i);const{fillShadow:g}=this;g?.enabled&&(i.shadowColor=g.color,i.shadowOffsetX=g.xOffset*o,i.shadowOffsetY=g.yOffset*o,i.shadowBlur=g.blur*o),this.renderLines(y,d,(m,b,S)=>i.fillText(m,b,S)),i.globalAlpha=c}if(r&&a){this.applyStrokeAndAlpha(i),i.lineWidth=a;const{lineDash:g,lineDashOffset:m,lineCap:b,lineJoin:S}=this;g&&i.setLineDash([...g]),m&&(i.lineDashOffset=m),b&&(i.lineCap=b),S&&(i.lineJoin=S),this.renderLines(y,d,(C,P,w)=>i.strokeText(C,P,w)),i.globalAlpha=c}if(Y.debug.check()){const g=this.getBBox(!0);i.strokeStyle="red",i.lineWidth=1,i.strokeRect(g.x,g.y,g.width,g.height)}super.render(t)}renderLines(t,i,s){const{lines:n,x:r,y:a}=this;if(!(!Number.isFinite(r)||!Number.isFinite(a)||!Number.isFinite(t)||!Number.isFinite(i)))for(const c of n)s(c,r,a+t),t+=i}setFont(t){this.fontFamily=t.fontFamily,this.fontSize=t.fontSize??Y.defaultFontSize,this.fontStyle=t.fontStyle,this.fontWeight=t.fontWeight}setAlign(t){this.textAlign=t.textAlign,this.textBaseline=t.textBaseline}toSVG(){if(!this.visible||!this.text)return;const t=(0,import_ag_charts_core23.createSvgElement)("text");return this.applySvgFillAttributes(t),t.setAttribute("font-family",this.fontFamily?.split(",")[0]??""),t.setAttribute("font-size",String(this.fontSize)),t.setAttribute("font-style",this.fontStyle??""),t.setAttribute("font-weight",String(this.fontWeight??"")),t.setAttribute("text-anchor",{center:"middle",left:"start",right:"end",start:"start",end:"end"}[this.textAlign??"start"]),t.setAttribute("alignment-baseline",{alphabetic:"alphabetic",top:"top",bottom:"bottom",hanging:"hanging",middle:"middle",ideographic:"ideographic"}[this.textBaseline??"alphabetic"]),t.setAttribute("x",String(this.x)),t.setAttribute("y",String(this.y)),t.textContent=this.text??"",{elements:[t]}}};_Text.className="Text",_Text.debug=Debug.create(!0,"scene:text"),_Text.defaultFontSize=10,__decorateClass([SceneChangeDetection()],_Text.prototype,"x",2),__decorateClass([SceneChangeDetection()],_Text.prototype,"y",2),__decorateClass([SceneChangeDetection({convertor:e=>(0,import_ag_charts_core23.isDefined)(e)?String(e):e,changeCb:e=>e.onTextChange()})],_Text.prototype,"text",2),__decorateClass([SceneChangeDetection()],_Text.prototype,"fontStyle",2),__decorateClass([SceneChangeDetection()],_Text.prototype,"fontWeight",2),__decorateClass([SceneChangeDetection()],_Text.prototype,"fontSize",2),__decorateClass([SceneChangeDetection()],_Text.prototype,"fontFamily",2),__decorateClass([SceneChangeDetection()],_Text.prototype,"textAlign",2),__decorateClass([SceneChangeDetection()],_Text.prototype,"textBaseline",2),__decorateClass([SceneChangeDetection()],_Text.prototype,"lineHeight",2);var Text=_Text,RotatableText=class extends Rotatable(Text){},TransformableText=class extends Rotatable(Translatable(Text)){},import_ag_charts_core24=require("ag-charts-core");function ProxyPropertyOnWrite(e,t){return addTransformToInstanceProperty((i,s,n)=>i[e][t??s]=n)}function ObserveChanges(e){return addObserverToInstanceProperty(e)}var TextWrapper=class{static wrapText(e,t){return this.wrapLines(e,t).join(`
`)}static wrapLines(e,t){const i=this.textWrap(e,t);return t.overflow==="hide"&&i.some(s=>s.endsWith(TextUtils.EllipsisChar))?[]:i}static appendEllipsis(e){return e.replace(/[.,]{1,5}$/,"")+TextUtils.EllipsisChar}static truncateLine(e,t,i,s){const n=t.textWidth(TextUtils.EllipsisChar);let r=0,a=0;for(;a<e.length;a++){const c=t.textWidth(e.charAt(a));if(r+c>i)break;r+=c}if(e.length===a&&(!s||r+n<=i))return s?e+TextUtils.EllipsisChar:e;for(e=e.slice(0,a).trimEnd();e.length&&t.textWidth(e)+n>i;)e=e.slice(0,-1).trimEnd();return e+TextUtils.EllipsisChar}static textWrap(e,t){const i=e.split(TextUtils.lineSplitter),s=CachedTextMeasurerPool.getMeasurer(t);if(t.textWrap==="never")return i.map(c=>this.truncateLine(c.trimEnd(),s,t.maxWidth));const n=[],r=t.textWrap==="hyphenate",a=t.textWrap==null||t.textWrap==="on-space";for(const c of i){let o=c.trimEnd();if(o===""){n.push(o);continue}let h=0,l=0,d=0;for(;h<o.length;){const u=o.charAt(h);if(l+=s.textWidth(u),u===" "&&(d=h),l>t.maxWidth){if(h===0)break;const f=s.textWidth(o.slice(0,h+1));if(f<=t.maxWidth){l=f,h++;continue}if(d){const g=this.getWordAt(o,d+1),m=s.textWidth(g);if(m<=t.maxWidth){n.push(o.slice(0,d).trimEnd()),o=o.slice(d).trimStart(),h=0,l=0,d=0;continue}else a&&m>t.maxWidth&&n.push(o.slice(0,d).trimEnd(),this.truncateLine(o.slice(d).trimStart(),s,t.maxWidth,!0))}else a&&n.push(this.truncateLine(o,s,t.maxWidth,!0));if(a){o="";break}const p=r?"-":"";let y=o.slice(0,h).trim();for(;y.length&&s.textWidth(y+p)>t.maxWidth;)y=y.slice(0,-1).trimEnd();if(n.push(y+p),!y.length){o="";break}o=o.slice(y.length).trimStart(),h=-1,l=0,d=0}h++}o&&n.push(o)}return this.avoidOrphans(n,s,t),this.clipLines(n,s,t)}static getWordAt(e,t){const i=e.indexOf(" ",t);return i===-1?e.slice(t):e.slice(t,i)}static clipLines(e,t,i){if(!i.maxHeight)return e;const{height:s,lineMetrics:n}=t.measureLines(e);if(s<=i.maxHeight)return e;for(let r=0,a=0;r<n.length;r++){const{lineHeight:c}=n[r];if(a+=c,a>i.maxHeight){if(i.overflow==="hide")return[];const o=e.slice(0,r||1),h=o.pop();return o.concat(this.truncateLine(h,t,i.maxWidth,!0))}}return e}static avoidOrphans(e,t,i){if(i.avoidOrphans===!1||e.length<2)return;const{length:s}=e,n=e[s-1],r=e[s-2];if(r.length<n.length)return;const a=r.lastIndexOf(" ");if(a===-1||a===r.indexOf(" ")||n.includes(" "))return;const c=r.slice(a+1);t.textWidth(n+c)<=i.maxWidth&&(e[s-2]=r.slice(0,a),e[s-1]=c+" "+n)}},Caption=class extends BaseProperties{constructor(){super(...arguments),this.id=(0,import_ag_charts_core25.createId)(this),this.node=new RotatableText({zIndex:1}).setProperties({textAlign:"center",pointerEvents:1}),this.enabled=!1,this.textAlign="center",this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always",this.padding=0,this.layoutStyle="block",this.truncated=!1}registerInteraction(e,t){return e.eventsHub.on("layout:complete",()=>this.updateA11yText(e,t))}computeTextWrap(e,t){const{text:i,padding:s,wrapping:n}=this,r=Math.min(this.maxWidth??1/0,e)-s*2,a=this.maxHeight??t-s*2;if(!isFinite(r)&&!isFinite(a)){this.node.text=i;return}const c=TextWrapper.wrapText(i??"",{maxWidth:r,maxHeight:a,font:this,textWrap:n});this.node.text=c,this.truncated=c.includes(TextUtils.EllipsisChar)}updateA11yText(e,t){const{proxyInteractionService:i}=e;if(this.enabled&&this.text){const s=Transformable.toCanvas(this.node);if(s){const{id:n}=this;this.proxyText??(this.proxyText=i.createProxyElement({type:"text",domManagerId:n,where:t})),this.proxyText.textContent=this.text,this.proxyText.setBounds(s),this.proxyText.addListener("mousemove",r=>this.handleMouseMove(e,r)),this.proxyText.addListener("mouseleave",r=>this.handleMouseLeave(e,r))}}else this.proxyText?.destroy(),this.proxyText=void 0}handleMouseMove(e,t){if(t!=null&&this.enabled&&this.node.visible&&this.truncated){const{x:i,y:s}=Transformable.toCanvas(this.node),n=t.sourceEvent.offsetX+i,r=t.sourceEvent.offsetY+s;e.tooltipManager.updateTooltip(this.id,{canvasX:n,canvasY:r,showArrow:!1},[{type:"structured",title:this.text}])}}handleMouseLeave(e,t){e.tooltipManager.removeTooltip(this.id)}};Caption.SMALL_PADDING=10,__decorateClass([Property,ProxyPropertyOnWrite("node","visible")],Caption.prototype,"enabled",2),__decorateClass([Property,ProxyPropertyOnWrite("node")],Caption.prototype,"text",2),__decorateClass([Property,ProxyPropertyOnWrite("node")],Caption.prototype,"textAlign",2),__decorateClass([Property,ProxyPropertyOnWrite("node")],Caption.prototype,"fontStyle",2),__decorateClass([Property,ProxyPropertyOnWrite("node")],Caption.prototype,"fontWeight",2),__decorateClass([Property,ProxyPropertyOnWrite("node")],Caption.prototype,"fontSize",2),__decorateClass([Property,ProxyPropertyOnWrite("node")],Caption.prototype,"fontFamily",2),__decorateClass([Property,ProxyPropertyOnWrite("node","fill")],Caption.prototype,"color",2),__decorateClass([Property],Caption.prototype,"spacing",2),__decorateClass([Property],Caption.prototype,"maxWidth",2),__decorateClass([Property],Caption.prototype,"maxHeight",2),__decorateClass([Property],Caption.prototype,"wrapping",2),__decorateClass([Property],Caption.prototype,"padding",2),__decorateClass([Property],Caption.prototype,"layoutStyle",2);var import_ag_charts_core26=require("ag-charts-core"),Path=class extends Shape{constructor(){super(...arguments),this.path=new ExtendedPath2D,this._clipX=NaN,this._clipY=NaN,this.clip=!1,this._dirtyPath=!0,this.lastPixelRatio=NaN}set clipX(e){this._clipX=e,this.dirtyPath=!0}set clipY(e){this._clipY=e,this.dirtyPath=!0}set dirtyPath(e){this._dirtyPath!==e&&(this._dirtyPath=e,e&&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(e){this._dirtyPath||(this._dirtyPath=!0,super.onChangeDetection(e))}computeBBox(){return this.updatePathIfDirty(),this.path.computeBBox()}isPointInPath(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)}distanceSquared(e,t){return this.distanceSquaredTransformedPoint(e,t)}svgPathData(e){return this.updatePathIfDirty(),this.path.toSVG(e)}distanceSquaredTransformedPoint(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)?0:this.path.distanceSquared(e,t)}isDirtyPath(){return!1}updatePath(){}updatePathIfDirty(){(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1)}preRender(e){return e.devicePixelRatio!==this.lastPixelRatio&&(this.dirtyPath=!0),this.lastPixelRatio=e.devicePixelRatio,this.updatePathIfDirty(),super.preRender(e,this.path.commands.length)}render(e){const{ctx:t}=e;if(this.clip&&!isNaN(this._clipX)&&!isNaN(this._clipY)){t.save();try{const i=this.strokeWidth/2;this._clipPath??(this._clipPath=new ExtendedPath2D),this._clipPath.clear(),this._clipPath.rect(-i,-i,this._clipX+i,this._clipY+i+i),t.clip(this._clipPath?.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(t)}finally{t.restore()}}else this._clipPath=void 0,this.drawPath(t);this.fillShadow?.markClean(),super.render(e)}drawPath(e){this.fillStroke(e,this.path.getPath2D())}toSVG(){if(!this.visible)return;const e=(0,import_ag_charts_core26.createSvgElement)("path");e.setAttribute("d",this.svgPathData());const t=this.applySvgFillAttributes(e,[]);return this.applySvgStrokeAttributes(e),{elements:[e],defs:t}}};Path.className="Path",__decorateClass([SceneChangeDetection()],Path.prototype,"clip",2),__decorateClass([SceneChangeDetection()],Path.prototype,"clipX",1),__decorateClass([SceneChangeDetection()],Path.prototype,"clipY",1);function drawMarkerUnitPolygon(e,t){const{path:i,size:s}=e,{x:n,y:r}=e;i.clear();let a=!1;for(const[c,o]of t){const h=n+(c-.5)*s,l=r+(o-.5)*s;a?i.lineTo(h,l):i.moveTo(h,l),a=!0}i.closePath()}var MARKER_SHAPES={circle({path:e,x:t,y:i,size:s}){const n=s/2;e.arc(t,i,n,0,Math.PI*2),e.closePath()},cross(e){drawMarkerUnitPolygon(e,[[.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(e){drawMarkerUnitPolygon(e,[[.5,0],[1,.5],[.5,1],[0,.5]])},heart({path:e,x:t,y:i,size:s}){const n=s/4;i=i+n/2,e.arc(t-n,i-n,n,toRadians(130),toRadians(330)),e.arc(t+n,i-n,n,toRadians(220),toRadians(50)),e.lineTo(t,i+n),e.closePath()},pin({path:e,x:t,y:i,size:s}){e.moveTo(t+(.15625-.5)*s,i+(.34375-.5)*s),e.cubicCurveTo(t+(.15625-.5)*s,i+(.151491-.5)*s,t+(.307741-.5)*s,i+(0-.5)*s,t+(.5-.5)*s,i+(0-.5)*s),e.cubicCurveTo(t+(.692259-.5)*s,i+(0-.5)*s,t+(.84375-.5)*s,i+(.151491-.5)*s,t+(.84375-.5)*s,i+(.34375-.5)*s),e.cubicCurveTo(t+(.84375-.5)*s,i+(.493824-.5)*s,t+(.784625-.5)*s,i+(.600181-.5)*s,t+(.716461-.5)*s,i+(.695393-.5)*s),e.cubicCurveTo(t+(.699009-.5)*s,i+(.719769-.5)*s,t+(.681271-.5)*s,i+(.743104-.5)*s,t+(.663785-.5)*s,i+(.766105-.5)*s),e.cubicCurveTo(t+(.611893-.5)*s,i+(.834367-.5)*s,t+(.562228-.5)*s,i+(.899699-.5)*s,t+(.528896-.5)*s,i+(.980648-.5)*s),e.cubicCurveTo(t+(.524075-.5)*s,i+(.992358-.5)*s,t+(.512663-.5)*s,i+(1-.5)*s,t+(.5-.5)*s,i+(1-.5)*s),e.cubicCurveTo(t+(.487337-.5)*s,i+(1-.5)*s,t+(.475925-.5)*s,i+(.992358-.5)*s,t+(.471104-.5)*s,i+(.980648-.5)*s),e.cubicCurveTo(t+(.487337-.5)*s,i+(1-.5)*s,t+(.475925-.5)*s,i+(.992358-.5)*s,t+(.471104-.5)*s,i+(.980648-.5)*s),e.cubicCurveTo(t+(.437772-.5)*s,i+(.899699-.5)*s,t+(.388107-.5)*s,i+(.834367-.5)*s,t+(.336215-.5)*s,i+(.766105-.5)*s),e.cubicCurveTo(t+(.318729-.5)*s,i+(.743104-.5)*s,t+(.300991-.5)*s,i+(.719769-.5)*s,t+(.283539-.5)*s,i+(.695393-.5)*s),e.cubicCurveTo(t+(.215375-.5)*s,i+(.600181-.5)*s,t+(.15625-.5)*s,i+(.493824-.5)*s,t+(.15625-.5)*s,i+(.34375-.5)*s),e.closePath()},plus(e){drawMarkerUnitPolygon(e,[[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:e,x:t,y:i,size:s,pixelRatio:n}){const r=s/2;e.moveTo(align(n,t-r),align(n,i-r)),e.lineTo(align(n,t+r),align(n,i-r)),e.lineTo(align(n,t+r),align(n,i+r)),e.lineTo(align(n,t-r),align(n,i+r)),e.closePath()},star({path:e,x:t,y:i,size:s}){const r=s/2,a=r/2,c=Math.PI/2;for(let o=0;o<5*2;o++){const h=o%2===0?r:a,l=o*Math.PI/5-c,d=t+Math.cos(l)*h,u=i+Math.sin(l)*h;e.lineTo(d,u)}e.closePath()},triangle(e){drawMarkerUnitPolygon(e,[[.5,0],[1,.87],[0,.87]])}},InternalMarker=class extends Path{constructor(){super(...arguments),this.shape="square",this.x=0,this.y=0,this.size=12}isPointInPath(e,t){return this.distanceSquared(e,t)<=0}distanceSquared(e,t){const i=Marker.anchor(this.shape);return Math.max(Math.hypot(e-this.x+(i.x-.5)*this.size,t-this.y+(i.y-.5)*this.size)-this.size/2,0)}updatePath(){const{path:e,shape:t,x:i,y:s,size:n}=this,r=this.layerManager?.canvas?.pixelRatio??1,a=Marker.anchor(t),c={path:e,x:i-(a.x-.5)*n,y:s-(a.y-.5)*n,size:n,pixelRatio:r};e.clear(),typeof t=="string"?MARKER_SHAPES[t](c):typeof t=="function"&&t(c)}computeBBox(){const{x:e,y:t,size:i}=this,s=Marker.anchor(this.shape);return new BBox(e-i*s.x,t-i*s.y,i,i)}executeFill(e,t){if(t)return super.executeFill(e,t)}executeStroke(e,t){if(t)return super.executeStroke(e,t)}};__decorateClass([SceneObjectChangeDetection({equals:TRIPLE_EQ})],InternalMarker.prototype,"shape",2),__decorateClass([SceneChangeDetection()],InternalMarker.prototype,"x",2),__decorateClass([SceneChangeDetection()],InternalMarker.prototype,"y",2),__decorateClass([SceneChangeDetection({convertor:Math.abs})],InternalMarker.prototype,"size",2);var Marker=class extends Rotatable(Scalable(Translatable(InternalMarker))){static anchor(e){return e==="pin"?{x:.5,y:1}:typeof e=="function"&&"anchor"in e?e.anchor:{x:.5,y:.5}}constructor(e){super(e),e?.shape!=null&&(this.shape=e.shape)}},import_ag_charts_core27=require("ag-charts-core");function findMinMax(e){if(e.length===0)return[];const t=[1/0,-1/0];for(const i of e)i<t[0]&&(t[0]=i),i>t[1]&&(t[1]=i);return t}var durationSecond=1e3,durationMinute=durationSecond*60,durationHour=durationMinute*60,durationDay=durationHour*24,durationWeek=durationDay*7,durationMonth=durationDay*30,durationYear=durationDay*365,tzOffset=new Date().getTimezoneOffset()*durationMinute,unitEncoding={millisecond:{milliseconds:1,hierarchy:"day",encode(e){return e.getTime()},decode(e){return new Date(e)}},second:{milliseconds:durationSecond,hierarchy:"day",encode(e,t){const i=t?0:tzOffset;return Math.floor((e.getTime()-i)/durationSecond)},decode(e,t){const i=t?0:tzOffset;return new Date(i+e*durationSecond)}},minute:{milliseconds:durationMinute,hierarchy:"day",encode(e,t){const i=t?0:tzOffset;return Math.floor((e.getTime()-i)/durationMinute)},decode(e,t){const i=t?0:tzOffset;return new Date(i+e*durationMinute)}},hour:{milliseconds:durationHour,hierarchy:"day",encode(e,t){const i=t?0:tzOffset;return Math.floor((e.getTime()-i)/durationHour)},decode(e,t){const i=t?0:tzOffset;return new Date(i+e*durationHour)}},day:{milliseconds:durationDay,hierarchy:"month",encode(e,t){const i=t?0:e.getTimezoneOffset()*durationMinute;return Math.floor((e.getTime()-i)/durationDay)},decode(e,t){let i;return t?(i=new Date(0),i.setUTCDate(i.getUTCDate()+e),i.setUTCHours(0,0,0,0)):(i=new Date(1970,0,1),i.setDate(i.getDate()+e)),i}},month:{milliseconds:durationMonth,hierarchy:"year",encode(e,t){return t?e.getUTCFullYear()*12+e.getUTCMonth():e.getFullYear()*12+e.getMonth()},decode(e,t){if(t){const i=Math.floor(e/12),s=e-i*12;return new Date(Date.UTC(i,s,1))}else{const i=Math.floor(e/12),s=e-i*12;return new Date(i,s,1)}}},year:{milliseconds:durationYear,hierarchy:void 0,encode(e,t){return t?e.getUTCFullYear():e.getFullYear()},decode(e,t){const i=new Date;return t?(i.setUTCFullYear(e),i.setUTCMonth(0,1),i.setUTCHours(0,0,0,0)):(i.setFullYear(e),i.setMonth(0,1),i.setHours(0,0,0,0)),i}}};function intervalUnit(e){return typeof e=="string"?e:e.unit}function intervalStep(e){return typeof e=="string"?1:e.step??1}function intervalMilliseconds(e){return intervalStep(e)*unitEncoding[intervalUnit(e)].milliseconds}function dateToNumber(e){return e instanceof Date?e.getTime():e}var import_ag_charts_core28=require("ag-charts-core"),_BandScale=class rt extends AbstractScale{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(t){return t instanceof rt}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(t){t=(0,import_ag_charts_core28.clamp)(0,t,1),this._paddingInner=t,this._paddingOuter=t}get padding(){return this._paddingInner}set paddingInner(t){this.invalid=!0,this._paddingInner=(0,import_ag_charts_core28.clamp)(0,t,1)}get paddingInner(){return this._paddingInner}set paddingOuter(t){this.invalid=!0,this._paddingOuter=(0,import_ag_charts_core28.clamp)(0,t,1)}get paddingOuter(){return this._paddingOuter}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&import_ag_charts_core28.Logger.warnOnce("Expected update to not invalidate scale"))}convert(t,i){this.refresh();const s=this.findIndex(t);return s==null||s<0||s>=this.bands.length?NaN:this.ordinalRange(s)}invertNearestIndex(t){this.refresh();const i=this.bands.length;if(i===0)return-1;let s=0,n=i-1,r=1/0,a=0;for(;s<=n;){const c=(n+s)/2|0,o=this.ordinalRange(c),h=Math.abs(o-t);if(h===0)return c;h<r&&(r=h,a=c),o<t?s=c+1:n=c-1}return a}update(){const[t,i]=this.range;let{_paddingInner:s}=this;const{_paddingOuter:n,round:r,bands:a}=this,c=a.length;if(c===0)return;const o=i-t;let h;c===1?(s=0,h=o*(1-n*2)):h=o/Math.max(1,c-s+n*2);const l=r?Math.floor(h):h;let d=t+(o-l*(c-s))/2,u=l*(1-s);r&&(d=Math.round(d),u=Math.round(u)),this._step=l,this._inset=d,this._bandwidth=u,this._rawBandwidth=h*(1-s)}ordinalRange(t){const{_inset:i,_step:s,range:n}=this,r=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return(0,import_ag_charts_core28.clamp)(r,i+s*t,a)}};__decorateClass([Invalidating],_BandScale.prototype,"range",2),__decorateClass([Invalidating],_BandScale.prototype,"round",2);var BandScale=_BandScale,import_ag_charts_core29=require("ag-charts-core");function filterVisibleTicks(e,t,i){if(i==null||i[0]===0&&i[1]===1)return{ticks:e,count:e.length};const s=(0,import_ag_charts_core29.clamp)(0,Math.floor(i[0]*e.length),e.length),n=(0,import_ag_charts_core29.clamp)(0,Math.ceil(i[1]*e.length),e.length),r=t?e.length-n:s,a=t?e.length-s:n;return{ticks:e.slice(r,a),count:e.length}}var CategoryScale=class at extends BandScale{constructor(){super(...arguments),this.type="band",this.defaultTickCount=0,this.index=new Map,this.indexInitialised=!1,this._domain=[]}static is(t){return t instanceof at}set domain(t){this._domain!==t&&(this.invalid=!0,this._domain=t,this.index.clear(),this.indexInitialised=!1)}get domain(){return this._domain}get bands(){return this._domain}normalizeDomains(...t){let i;const s=new Set;let n=!0;for(const r of t)s.has(r)||(s.add(r),i==null?i=deduplicateCategories(r):(n&&(n=domainOrderedToNormalizedDomain(r,i)),i=deduplicateCategories([...i,...r])));return i??(i=[]),{domain:i,animatable:n}}toDomain(t){}invert(t,i=!1){this.refresh();const s=i?this.bandwidth/2:0,n=this.invertNearestIndex(Math.max(0,t-s));return i||t===this.ordinalRange(n)?this.domain[n]:void 0}ticks(t,i=this.domain,s){return filterVisibleTicks(i,!1,s)}findIndex(t){const{index:i,indexInitialised:s}=this;if(!s){const{domain:n}=this;for(let r=0;r<n.length;r++)i.set(dateToNumber(n[r]),r);this.indexInitialised=!0}return i.get(dateToNumber(t))}};function deduplicateCategories(e){let t;const i=new Set;for(const s of e){const n=dateToNumber(s),r=i.size;i.add(n),i.size!==r?t?.push(s):t??(t=e.slice(0,i.size))}return t??e}function domainOrderedToNormalizedDomain(e,t){let i=-1;for(const s of e){const n=t.indexOf(s);if(n===-1)i=1/0;else{if(n<=i)return!1;i=n}}return!0}var import_ag_charts_core30=require("ag-charts-core"),tInterval=(e,t)=>({duration:intervalMilliseconds(e)*t,timeInterval:e,step:t}),TickIntervals=[tInterval({unit:"second"},1),tInterval({unit:"second"},5),tInterval({unit:"second"},15),tInterval({unit:"second"},30),tInterval({unit:"minute"},1),tInterval({unit:"minute"},5),tInterval({unit:"minute"},15),tInterval({unit:"minute"},30),tInterval({unit:"hour"},1),tInterval({unit:"hour"},3),tInterval({unit:"hour"},6),tInterval({unit:"hour"},12),tInterval({unit:"day"},1),tInterval({unit:"day"},2),tInterval({unit:"day",step:7},1),tInterval({unit:"day",step:7},2),tInterval({unit:"day",step:7},3),tInterval({unit:"month"},1),tInterval({unit:"month"},2),tInterval({unit:"month"},3),tInterval({unit:"month"},4),tInterval({unit:"month"},6),tInterval({unit:"year"},1)],TickMultipliers=[1,2,5,10];function isCloseToInteger(e,t){return Math.abs(Math.round(e)-e)<t}function countTicks(e,t,i){return Math.abs(t-e)>=i?Math.abs(t-e)/i+1:1}function createTicks(e,t,i,s,n,r){if(e===t)return{ticks:[e],count:1};if(i<2)return{ticks:[e,t],count:2};const a=tickStep(e,t,i,s,n);if(!Number.isFinite(a))return{ticks:[],count:0};let c=e,o=t;if(isCloseToInteger(c/a,1e-12)||(c=Math.ceil(c/a)*a),isCloseToInteger(o/a,1e-12)||(o=Math.floor(o/a)*a),r!=null){const l=o-c,d=t-e,u=e+d*r[0],f=e+d*r[1];r=[(u-c)/l,(f-c)/l]}const{ticks:h}=range(c,o,a,r);return{ticks:h,count:countTicks(e,t,a)}}var minPrimaryTickRatio=Math.floor(2*durationWeek/durationMonth*10)/10;function tickStep(e,t,i,s=0,n=1/0){if(e===t)return(0,import_ag_charts_core30.clamp)(1,s,n);if(i<1)return NaN;const r=Math.abs(t-e),a=10**Math.floor(Math.log10(r/i));let c=NaN,o=1/0,h=!1;for(const l of TickMultipliers){const d=Math.ceil(r/(l*a)),u=d>=s&&d<=n;if(h&&!u)continue;const f=Math.abs(d-i);(o>f||h!==u)&&(h||(h=u),o=f,c=l)}return c*a}function range(e,t,i,s){if(!Number.isFinite(i)||i<=0)return{ticks:[],count:0};if(e===t)return{ticks:[e],count:1};const n=10**(0,import_ag_charts_core30.countFractionDigits)(i),r=Math.min(e,t),a=Math.max(e,t);let c,o;if(s!=null&&(s[0]!==0||s[1]!==1)){const l=t-e,d=e+l*s[0],u=t-l*(1-s[1]);c=Math.min(d,u),o=Math.max(d,u)}else c=r,o=a;c=Math.floor(c*n)/n,o=Math.ceil(o*n)/n;const h=[];for(let l=0;;l+=1){const d=Math.round((r+i*l)*n)/n;if(d>a)break;d>=c&&d<=o&&h.push(d)}return{ticks:h,count:countTicks(r,a,i)}}function isDenseInterval(e,t){return e>=t?(import_ag_charts_core30.Logger.warnOnce("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0):!1}function niceTicksDomain(e,t){const i=Math.abs(t-e),s=10**Math.floor(Math.log10(i));let n=1/0,r=[e,t];for(const a of TickMultipliers){const c=a*s,o=Math.floor(e/c)*c,h=Math.ceil(t/c)*c,l=1-i/Math.abs(h-o);n>l&&(n=l,r=[o,h])}return r}var _ContinuousScale=class K extends AbstractScale{constructor(t=[],i=[]){super(),this.domain=t,this.range=i,this.defaultTickCount=K.defaultTickCount,this.defaultClamp=!1}static is(t){return t instanceof K}normalizeDomains(...t){return normalizeContinuousDomains(...t)}calcBandwidth(t=1,i=1){const{domain:s}=this,n=this.getPixelRange();if(s.length===0)return n;let a=Math.abs(s[1].valueOf()-s[0].valueOf())/t+1;if(i!==0){const c=Math.floor(n);a=Math.min(a,c)}return n/Math.max(1,a)}convert(t,i){const{domain:s}=this;if(!s||s.length<2||t==null)return NaN;const{range:n}=this,r=i?.clamp??this.defaultClamp;let a=s[0].valueOf(),c=s[1].valueOf(),o=t.valueOf();if(this.transform&&(a=this.transform(a),c=this.transform(c),o=this.transform(o)),r){const[l,d]=findMinMax([a,c]);if(o<l)return n[0];if(o>d)return n[1]}if(a===c)return(n[0]+n[1])/2;if(o===a)return n[0];if(o===c)return n[1];const h=n[0];return h+(o-a)/(c-a)*(n[1]-h)}invert(t,i){const{domain:s}=this;if(s.length<2)return;let n=s[0].valueOf(),r=s[1].valueOf();this.transform&&(n=this.transform(n),r=this.transform(r));const{range:a}=this,[c,o]=a;let h;return c===o?h=this.toDomain((n+r)/2):h=this.toDomain(n+(t-c)/(o-c)*(r-n)),this.transformInvert?this.transformInvert(h):h}getPixelRange(){const[t,i]=this.range;return Math.abs(i-t)}};_ContinuousScale.defaultTickCount=5;var ContinuousScale=_ContinuousScale;function normalizeContinuousDomains(...e){let t,i=1/0,s,n=-1/0;for(const r of e)for(const a of r){const c=a.valueOf();c<i&&(i=c,t=a),c>n&&(n=c,s=a)}return t!=null&&s!=null?{domain:[t,s],animatable:!0}:{domain:[],animatable:!1}}var LinearScale=class J extends ContinuousScale{constructor(){super([0,1],[0,1]),this.type="number"}static is(t){return t instanceof J}static getTickStep(t,i,s){const{interval:n,tickCount:r=ContinuousScale.defaultTickCount,minTickCount:a,maxTickCount:c}=s;return n??tickStep(t,i,r,a,c)}toDomain(t){return t}ticks({interval:t,tickCount:i=ContinuousScale.defaultTickCount,minTickCount:s,maxTickCount:n},r=this.domain,a){if(!r||r.length<2||i<1||!r.every(isFinite))return{ticks:[],count:0};const[c,o]=r;if(t){const h=Math.abs(t);if(!isDenseInterval((o-c)/h,this.getPixelRange()))return range(c,o,h,a)}return createTicks(c,o,i,s,n,a)}niceDomain(t,i=this.domain){if(i.length<2)return[];const{tickCount:s=ContinuousScale.defaultTickCount}=t;let[n,r]=i;if(s===1)[n,r]=niceTicksDomain(n,r);else if(s>1){const a=n>r?Math.ceil:Math.floor,c=n>r?Math.floor:Math.ceil,o=4;for(let h=0;h<o;h++){const l=n,d=r,u=J.getTickStep(n,r,t),[f,p]=i;if(n=a(f/u)*u,r=c(p/u)*u,n===l&&r===d)break}}return[n,r]}},import_ag_charts_core33=require("ag-charts-core"),import_ag_charts_core31=require("ag-charts-core"),HdpiCanvas=class{constructor(e){this.enabled=!0,this.width=600,this.height=300;const{width:t,height:i,canvasElement:s,willReadFrequently:n=!1}=e;this.pixelRatio=e.pixelRatio??(0,import_ag_charts_core31.getWindow)("devicePixelRatio")??1,this.element=s??(0,import_ag_charts_core31.createElement)("canvas"),this.element.style.display="block",this.element.style.width=(t??this.width)+"px",this.element.style.height=(i??this.height)+"px",this.element.width=Math.round((t??this.width)*this.pixelRatio),this.element.height=Math.round((i??this.height)*this.pixelRatio),this.context=this.element.getContext("2d",{willReadFrequently:n}),this.onEnabledChange(),this.resize(t??0,i??0,this.pixelRatio),debugContext(this.context)}drawImage(e,t=0,i=0){return e.drawImage(this.context.canvas,t,i)}toDataURL(e){return this.element.toDataURL(e)}resize(e,t,i){if(!(e>0&&t>0))return;const{element:s,context:n}=this;s.width=Math.round(e*i),s.height=Math.round(t*i),n.setTransform(i,0,0,i,0,0),s.style.width=e+"px",s.style.height=t+"px",this.width=e,this.height=t,this.pixelRatio=i}clear(){clearContext(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?.()}onEnabledChange(){this.element&&(this.element.style.display=this.enabled?"":"none")}};__decorateClass([ObserveChanges(e=>e.onEnabledChange())],HdpiCanvas.prototype,"enabled",2);var import_ag_charts_core32=require("ag-charts-core"),ImageLoader=class extends import_ag_charts_core32.EventEmitter{constructor(){super(...arguments),this.cache=new Map,this.imageLoadingCount=0}loadImage(e,t){const i=this.cache.get(e);if(i?.image)return i.image;if(i!=null&&t){i.nodes.add(t);return}if(!t)return;const s={image:void 0,nodes:new Set([t])},n=new Image;return this.imageLoadingCount++,n.onload=()=>{s.image=n;for(const r of s.nodes)r.markDirty();s.nodes.clear(),this.imageLoadingCount--,this.emit("image-loaded",{uri:e})},n.onerror=()=>{this.imageLoadingCount--,s.nodes.clear(),this.emit("image-error",{uri:e})},n.src=e,this.cache.set(e,s),s.image}waitingToLoad(){return this.imageLoadingCount>0}destroy(){this.cache.forEach(e=>{e.nodes.clear()}),this.cache.clear()}},LayersManager=class{constructor(e){this.canvas=e,this.debug=Debug.create(!0,"scene"),this.layersMap=new Map,this.nextLayerId=0}get size(){return this.layersMap.size}resize(e,t,i){this.canvas.resize(e,t,i),this.layersMap.forEach(({canvas:s})=>s.resize(e,t,i))}addLayer(e){const{width:t,height:i,pixelRatio:s}=this.canvas,{name:n}=e,r=new HdpiOffscreenCanvas({width:t,height:i,pixelRatio:s});return this.layersMap.set(r,{id:this.nextLayerId++,name:n,canvas:r}),this.debug("Scene.addLayer() - layers",this.layersMap),r}removeLayer(e){this.layersMap.has(e)&&(this.layersMap.delete(e),e.destroy(),this.debug("Scene.removeLayer() -  layers",this.layersMap))}clear(){for(const e of this.layersMap.values())e.canvas.destroy();this.layersMap.clear()}},Scene=class extends import_ag_charts_core33.EventEmitter{constructor(e){super(),this.debug=Debug.create(!0,"scene"),this.id=(0,import_ag_charts_core33.createId)(this),this.imageLoader=new ImageLoader,this.root=null,this.pendingSize=null,this.isDirty=!1,this.cleanup=new import_ag_charts_core33.CleanupRegistry,this.updateDebugFlags(),this.canvas=new HdpiCanvas(e),this.layersManager=new LayersManager(this.canvas),this.cleanup.register(this.imageLoader.on("image-loaded",()=>{this.emit("scene-changed",{})}),this.imageLoader.on("image-error",({uri:t})=>{import_ag_charts_core33.Logger.warnOnce(`Unable to load image ${t}`)}))}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}setContainer(e){const{element:t}=this.canvas;return t.parentElement?.removeChild(t),e.appendChild(t),this}setRoot(e){return this.root===e?this:(this.isDirty=!0,this.root?.setScene(),this.root=e,e&&(e.visible=!0,e.setScene(this)),this)}updateDebugFlags(){Debug.inDevelopmentMode(()=>Node._debugEnabled=!0)}clearCanvas(){this.canvas.clear()}attachNode(e){return this.appendChild(e),()=>this.removeChild(e)}appendChild(e){return this.root?.appendChild(e),this}removeChild(e){return this.root?.removeChild(e),this}download(e,t){(0,import_ag_charts_core33.downloadUrl)(this.canvas.toDataURL(t),e?.trim()??"image")}getDataURL(e){return this.canvas.toDataURL(e)}resize(e,t,i){return e=Math.round(e),t=Math.round(t),i??(i=this.pixelRatio),e>0&&t>0&&(e!==this.width||t!==this.height||i!==this.pixelRatio)?(this.pendingSize=[e,t,i],this.isDirty=!0,!0):!1}render(e){const{debugSplitTimes:t={start:performance.now()},extraDebugStats:i,seriesRect:s}=e??{},{canvas:n,canvas:{context:r}={},root:a,pendingSize:c,width:o,height:h,pixelRatio:l}=this;if(!r)return;const d=performance.now();let u=!1;if(c&&(u=!0,this.layersManager.resize(...c),this.pendingSize=null),a&&!a.visible){this.isDirty=!1;return}let f;if(a instanceof Group&&(f=a.dirty),a!=null&&f===!1&&!this.isDirty){this.debug.check()&&this.debug("Scene.render() - no-op",{tree:buildTree(a,"console")}),debugStats(this.layersManager,t,r,void 0,i,s);return}const p={ctx:r,width:o,height:h,devicePixelRatio:l,debugNodes:{}};Debug.check("scene:stats:verbose")&&(p.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),prepareSceneNodeHighlight(p);let y=!1;if((f!==!1||u)&&(y=!0,n.clear()),a&&Debug.check("scene:dirtyTree")){const{dirtyTree:g,paths:m}=buildDirtyTree(a);Debug.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:g,paths:m})}if(a&&y){if(a.visible&&a.preRender(p),this.debug.check()){const g=buildTree(a,"console");this.debug("Scene.render() - before",{canvasCleared:y,tree:g})}if(a.visible)try{r.save(),a.render(p),r.restore()}catch(g){throw this.canvas.reset(),g}}t["\u270D\uFE0F"]=performance.now()-d,r.verifyDepthZero?.(),this.isDirty=!1,debugStats(this.layersManager,t,r,p.stats,i,s),debugSceneNodeHighlight(r,p.debugNodes),a&&this.debug.check()&&this.debug("Scene.render() - after",{tree:buildTree(a,"console"),canvasCleared:y})}toSVG(){const{root:e,width:t,height:i}=this;if(e!=null)return Node.toSVG(e,t,i)}strip(){const{context:e,pixelRatio:t}=this.canvas;e.setTransform(t,0,0,t,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(),Object.assign(this,{canvas:void 0})}};Scene.className="Scene";var import_ag_charts_core34=require("ag-charts-core"),Arc=class extends Path{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(0,import_ag_charts_core34.isNumberEqual)(normalizeAngle360(this.startAngle),normalizeAngle360(this.endAngle))}updatePath(){const e=this.path;e.clear(),e.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),this.type===1?e.closePath():this.type===2&&!this.fullPie&&(e.lineTo(this.centerX,this.centerY),e.closePath())}computeBBox(){return new BBox(this.centerX-this.radius,this.centerY-this.radius,this.radius*2,this.radius*2)}isPointInPath(e,t){const i=this.getBBox();return this.type!==0&&i.containsPoint(e,t)&&this.path.isPointInPath(e,t)}};Arc.className="Arc",__decorateClass([SceneChangeDetection()],Arc.prototype,"centerX",2),__decorateClass([SceneChangeDetection()],Arc.prototype,"centerY",2),__decorateClass([SceneChangeDetection()],Arc.prototype,"radius",2),__decorateClass([SceneChangeDetection()],Arc.prototype,"startAngle",2),__decorateClass([SceneChangeDetection()],Arc.prototype,"endAngle",2),__decorateClass([SceneChangeDetection()],Arc.prototype,"counterClockwise",2),__decorateClass([SceneChangeDetection()],Arc.prototype,"type",2);var import_ag_charts_core35=require("ag-charts-core"),Line=class extends Shape{constructor(e={}){super(e),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.fill=void 0,this.strokeWidth=1}set x(e){this.x1=e,this.x2=e}set y(e){this.y1=e,this.y2=e}get midPoint(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}}computeBBox(){return new BBox(Math.min(this.x1,this.x2),Math.min(this.y1,this.y2),Math.abs(this.x2-this.x1),Math.abs(this.y2-this.y1))}isPointInPath(e,t){return this.x1===this.x2||this.y1===this.y2?this.getBBox().clone().grow(this.strokeWidth/2).containsPoint(e,t):!1}distanceSquared(e,t){const{x1:i,y1:s,x2:n,y2:r}=this;return lineDistanceSquared(e,t,i,s,n,r,1/0)}render(e){const{ctx:t,devicePixelRatio:i}=e;let{x1:s,y1:n,x2:r,y2:a}=this;if(s===r){const{strokeWidth:c}=this,o=Math.round(s*i)/i+Math.trunc(c*i)%2/(i*2);s=o,r=o}else if(n===a){const{strokeWidth:c}=this,o=Math.round(n*i)/i+Math.trunc(c*i)%2/(i*2);n=o,a=o}t.beginPath(),t.moveTo(s,n),t.lineTo(r,a),this.fillStroke(t),this.fillShadow?.markClean(),super.render(e)}toSVG(){if(!this.visible)return;const e=(0,import_ag_charts_core35.createSvgElement)("line");return e.setAttribute("x1",String(this.x1)),e.setAttribute("y1",String(this.y1)),e.setAttribute("x2",String(this.x2)),e.setAttribute("y2",String(this.y2)),this.applySvgStrokeAttributes(e),{elements:[e]}}};Line.className="Line",__decorateClass([SceneChangeDetection()],Line.prototype,"x1",2),__decorateClass([SceneChangeDetection()],Line.prototype,"y1",2),__decorateClass([SceneChangeDetection()],Line.prototype,"x2",2),__decorateClass([SceneChangeDetection()],Line.prototype,"y2",2);var import_ag_charts_core36=require("ag-charts-core");function rotatePoint(e,t,i){const s=Math.sqrt(e**2+t**2),r=Math.atan2(t,e)+i;return{x:Math.cos(r)*s,y:Math.sin(r)*s}}var RadialColumnShape=class extends Path{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,this.isRadiusAxisReversed=!1}set cornerRadius(e){}computeBBox(){const{innerRadius:e,outerRadius:t,columnWidth:i}=this,s=this.getRotation(),n=-i/2,r=i/2,a=-t,c=-e;let o=1/0,h=1/0,l=-1/0,d=-1/0;for(let u=0;u<4;u+=1){const{x:f,y:p}=rotatePoint(u%2===0?n:r,u<2?a:c,s);o=Math.min(f,o),h=Math.min(p,h),l=Math.max(f,l),d=Math.max(p,d)}return new BBox(o,h,l-o,d-h)}getRotation(){const{startAngle:e,endAngle:t}=this,i=angleBetween(e,t);return normalizeAngle360(e+i/2+Math.PI/2)}updatePath(){const{isBeveled:e}=this;e?this.updateBeveledPath():this.updateRectangularPath(),this.checkPathDirty()}updateRectangularPath(){const{columnWidth:e,innerRadius:t,outerRadius:i,path:s}=this,n=-e/2,r=e/2,a=-i,c=-t,o=this.getRotation(),h=[[n,c],[n,a],[r,a],[r,c]].map(([l,d])=>rotatePoint(l,d,o));s.clear(!0),s.moveTo(h[0].x,h[0].y),s.lineTo(h[1].x,h[1].y),s.lineTo(h[2].x,h[2].y),s.lineTo(h[3].x,h[3].y),s.closePath()}updateBeveledPath(){const{columnWidth:e,path:t,outerRadius:i,innerRadius:s,axisInnerRadius:n,axisOuterRadius:r,isRadiusAxisReversed:a}=this,c=(0,import_ag_charts_core36.isNumberEqual)(s,n),o=Math.asin(e/2/s),h=this.getRotation(),l=(x,M)=>rotatePoint(x,M,h),d=(x,M)=>Math.sqrt(x**2+M**2),u=(x,M)=>M>x?0:Math.sqrt(x**2-M**2),f=(x,M,A)=>A?x<M:x>M,p=c&&!isNaN(o)&&o<Math.PI/6;let y=-e/2,g=e/2;const m=-i,b=-s*(p?Math.cos(o):1),S=f(r,d(s,e/2),!a);if(S){const x=u(r,s);y=-x,g=x}t.clear(!0);const C=l(y,b);t.moveTo(C.x,C.y);const P=(0,import_ag_charts_core36.isNumberEqual)(s,i),w=f(r,d(i,e/2),!a);if(P&&p)t.arc(0,0,s,normalizeAngle360(-o-Math.PI/2)+h,normalizeAngle360(o-Math.PI/2)+h,!1);else if(w){const x=-u(r,e/2),M=u(r,i);if(!S){const A=l(y,x);t.lineTo(A.x,A.y)}if(t.arc(0,0,r,Math.atan2(x,y)+h,Math.atan2(m,-M)+h,!1),!(0,import_ag_charts_core36.isNumberEqual)(M,0)){const A=l(M,m);t.lineTo(A.x,A.y)}t.arc(0,0,r,Math.atan2(m,M)+h,Math.atan2(x,g)+h,!1)}else{const x=l(y,m),M=l(g,m);t.lineTo(x.x,x.y),t.lineTo(M.x,M.y)}const v=l(g,b);if(t.lineTo(v.x,v.y),p)t.arc(0,0,s,normalizeAngle360(o-Math.PI/2)+h,normalizeAngle360(-o-Math.PI/2)+h,!0);else{const x=l(y,b);t.lineTo(x.x,x.y)}t.closePath()}};RadialColumnShape.className="RadialColumnShape",__decorateClass([SceneChangeDetection()],RadialColumnShape.prototype,"isBeveled",2),__decorateClass([SceneChangeDetection()],RadialColumnShape.prototype,"columnWidth",2),__decorateClass([SceneChangeDetection()],RadialColumnShape.prototype,"startAngle",2),__decorateClass([SceneChangeDetection()],RadialColumnShape.prototype,"endAngle",2),__decorateClass([SceneChangeDetection()],RadialColumnShape.prototype,"outerRadius",2),__decorateClass([SceneChangeDetection()],RadialColumnShape.prototype,"innerRadius",2),__decorateClass([SceneChangeDetection()],RadialColumnShape.prototype,"axisInnerRadius",2),__decorateClass([SceneChangeDetection()],RadialColumnShape.prototype,"axisOuterRadius",2),__decorateClass([SceneChangeDetection()],RadialColumnShape.prototype,"isRadiusAxisReversed",2);function getRadialColumnWidth(e,t,i,s,n){const r=angleBetween(e,t),a=r*(1-s)/2;if(e+=a,t-=a,r<.001)return 2*i*n;if(r>=2*Math.PI){const f=e+r/2;e=f-Math.PI,t=f+Math.PI}const c=i*Math.cos(e),o=i*Math.sin(e),h=i*Math.cos(t),l=i*Math.sin(t),d=Math.floor(Math.sqrt((c-h)**2+(o-l)**2)),u=2*i*n;return Math.max(1,Math.min(u,d))}var import_ag_charts_core37=require("ag-charts-core"),drawCorner=(e,{x0:t,y0:i,x1:s,y1:n,cx:r,cy:a},c,o)=>{if(o&&e.moveTo(t,i),t!==s||i!==n){const h=Math.atan2(i-a,t-r),l=Math.atan2(n-a,s-r);e.arc(r,a,c,h,l)}else e.lineTo(t,i)},epsilon=1e-6,cornerEdges=(e,t,i,s,n)=>{let r=!1,a=!1,c=s-Math.sqrt(Math.max(n**2-i**2,0)),o=0,h=0,l=i-Math.sqrt(Math.max(n**2-s**2,0));return c>e?(r=!0,c=e,o=i-Math.sqrt(Math.max(n**2-(s-e)**2))):c<epsilon&&(c=0),l>t?(a=!0,h=s-Math.sqrt(Math.max(n**2-(i-t)**2)),l=t):l<epsilon&&(l=0),{leading0:c,leading1:o,trailing0:h,trailing1:l,leadingClipped:r,trailingClipped:a}},clippedRoundRect=(e,t,i,s,n,r,a)=>{let{topLeft:c,topRight:o,bottomRight:h,bottomLeft:l}=r;const d=Math.max(c+l,o+h),u=Math.max(c+o,l+h);if(d<=0&&u<=0){a==null?e.rect(t,i,s,n):e.rect(a.x,a.y,a.width,a.height);return}else if(a==null&&c===o&&c===h&&c===l){e.roundRect(t,i,s,n,c);return}if(s<0&&(t+=s,s=Math.abs(s)),n<0&&(i+=n,n=Math.abs(n)),s<=0||n<=0)return;if(a==null)a=new BBox(t,i,s,n);else{const v=Math.max(t,a.x),x=Math.min(t+s,a.x+a.width),M=Math.max(i,a.y),A=Math.min(i+n,a.y+a.height);a=new BBox(v,M,x-v,A-M)}const f=Math.max(d/n,u/s,1);f>1&&(c/=f,o/=f,h/=f,l/=f);let p=!0,y=!0,g=!0,m=!0,b,S,C,P;if(p){const v=cornerEdges(a.height,a.width,Math.max(t+c-a.x,0),Math.max(i+c-a.y,0),c);v.leadingClipped&&(m=!1),v.trailingClipped&&(y=!1);const x=Math.max(a.x+v.leading1,a.x),M=Math.max(a.y+v.leading0,a.y),A=Math.max(a.x+v.trailing1,a.x),D=Math.max(a.y+v.trailing0,a.y),T=t+c,R=i+c;b={x0:x,y0:M,x1:A,y1:D,cx:T,cy:R}}if(y){const v=cornerEdges(a.width,a.height,Math.max(i+o-a.y,0),Math.max(a.x+a.width-(t+s-o),0),o);v.leadingClipped&&(p=!1),v.trailingClipped&&(g=!1);const x=Math.min(a.x+a.width-v.leading0,a.x+a.width),M=Math.max(a.y+v.leading1,a.y),A=Math.min(a.x+a.width-v.trailing0,a.x+a.width),D=Math.max(a.y+v.trailing1,a.y),T=t+s-o,R=i+o;S={x0:x,y0:M,x1:A,y1:D,cx:T,cy:R}}if(g){const v=cornerEdges(a.height,a.width,Math.max(a.x+a.width-(t+s-h),0),Math.max(a.y+a.height-(i+n-h),0),h);v.leadingClipped&&(y=!1),v.trailingClipped&&(m=!1);const x=Math.min(a.x+a.width-v.leading1,a.x+a.width),M=Math.min(a.y+a.height-v.leading0,a.y+a.height),A=Math.min(a.x+a.width-v.trailing1,a.x+a.width),D=Math.min(a.y+a.height-v.trailing0,a.y+a.height),T=t+s-h,R=i+n-h;C={x0:x,y0:M,x1:A,y1:D,cx:T,cy:R}}if(m){const v=cornerEdges(a.width,a.height,Math.max(a.y+a.height-(i+n-l),0),Math.max(t+l-a.x,0),l);v.leadingClipped&&(g=!1),v.trailingClipped&&(p=!1);const x=Math.max(a.x+v.leading0,a.x),M=Math.min(a.y+a.height-v.leading1,a.y+a.height),A=Math.max(a.x+v.trailing0,a.x),D=Math.min(a.y+a.height-v.trailing1,a.y+a.height),T=t+l,R=i+n-l;P={x0:x,y0:M,x1:A,y1:D,cx:T,cy:R}}let w=!1;p&&b!=null&&(drawCorner(e,b,c,!w),w||(w=!0)),y&&S!=null&&(drawCorner(e,S,o,!w),w||(w=!0)),g&&C!=null&&(drawCorner(e,C,h,!w),w||(w=!0)),m&&P!=null&&drawCorner(e,P,l,!w),e.closePath()},Rect=class extends Path{constructor(){super(...arguments),this.borderPath=new ExtendedPath2D,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(e){this.topLeftCornerRadius=e,this.topRightCornerRadius=e,this.bottomRightCornerRadius=e,this.bottomLeftCornerRadius=e}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.strokeWidth||!!(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){const{path:e,borderPath:t,crisp:i,topLeftCornerRadius:s,topRightCornerRadius:n,bottomRightCornerRadius:r,bottomLeftCornerRadius:a}=this;let{x:c,y:o,width:h,height:l,strokeWidth:d,clipBBox:u}=this;const p=1/(this.layerManager?.canvas.pixelRatio??1);let y=1;if(e.clear(!0),t.clear(!0),i&&(h<=p&&(y*=h/p),l<=p&&(y*=l/p),h=this.align(c,h),l=this.align(o,l),c=this.align(c),o=this.align(o),u=u!=null?new BBox(this.align(u.x),this.align(u.y),this.align(u.x,u.width),this.align(u.y,u.height)):void 0),d)if(h<p){const g=c+p/2;t.moveTo(g,o),t.lineTo(g,o+l),d=p,this.borderClipPath=void 0}else if(l<p){const g=o+p/2;t.moveTo(c,g),t.lineTo(c+h,g),d=p,this.borderClipPath=void 0}else if(d<h&&d<l){const g=d/2;c+=g,o+=g,h-=d,l-=d;const m=u?.clone().shrink(g),b={topLeft:s>0?s-d:0,topRight:n>0?n-d:0,bottomRight:r>0?r-d:0,bottomLeft:a>0?a-d:0};this.borderClipPath=void 0,h>0&&l>0&&(m==null||m?.width>0&&m?.height>0)&&(clippedRoundRect(e,c,o,h,l,b,m),clippedRoundRect(t,c,o,h,l,b,m))}else this.borderClipPath=this.borderClipPath??new ExtendedPath2D,this.borderClipPath.clear(!0),this.borderClipPath.rect(c,o,h,l),t.rect(c,o,h,l);else{const g={topLeft:s,topRight:n,bottomRight:r,bottomLeft:a};this.borderClipPath=void 0,clippedRoundRect(e,c,o,h,l,g,u)}if([s,n,r,a].every(g=>g===0)){const g=this.getBBox();this.hittester=g.containsPoint.bind(g),this.distanceSquared=(m,b)=>this.getBBox().distanceSquared(m,b)}else this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquaredTransformedPoint;this.effectiveStrokeWidth=d,this.lastUpdatePathStrokeWidth=d,this.microPixelEffectOpacity=y}computeBBox(){const{x:e,y:t,width:i,height:s,clipBBox:n}=this;return n?.clone()??new BBox(e,t,i,s)}isPointInPath(e,t){return this.hittester(e,t)}get midPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}}distanceSquared(e,t){return this.distanceCalculator(e,t)}applyFillAndAlpha(e){super.applyFillAndAlpha(e),e.globalAlpha*=this.microPixelEffectOpacity}applyStrokeAndAlpha(e){super.applyStrokeAndAlpha(e),e.globalAlpha*=this.microPixelEffectOpacity}renderStroke(e){const{stroke:t,effectiveStrokeWidth:i}=this;if(t&&i){const{globalAlpha:s}=e,{lineDash:n,lineDashOffset:r,lineCap:a,lineJoin:c,borderPath:o,borderClipPath:h}=this;h&&e.clip(h.getPath2D()),this.applyStrokeAndAlpha(e),e.lineWidth=i,n&&e.setLineDash(n),r&&(e.lineDashOffset=r),a&&(e.lineCap=a),c&&(e.lineJoin=c),e.stroke(o.getPath2D()),e.globalAlpha=s}}};Rect.className="Rect",__decorateClass([SceneChangeDetection()],Rect.prototype,"x",2),__decorateClass([SceneChangeDetection()],Rect.prototype,"y",2),__decorateClass([SceneChangeDetection()],Rect.prototype,"width",2),__decorateClass([SceneChangeDetection()],Rect.prototype,"height",2),__decorateClass([SceneChangeDetection()],Rect.prototype,"topLeftCornerRadius",2),__decorateClass([SceneChangeDetection()],Rect.prototype,"topRightCornerRadius",2),__decorateClass([SceneChangeDetection()],Rect.prototype,"bottomRightCornerRadius",2),__decorateClass([SceneChangeDetection()],Rect.prototype,"bottomLeftCornerRadius",2),__decorateClass([SceneObjectChangeDetection({equals:import_ag_charts_core37.boxesEqual})],Rect.prototype,"clipBBox",2),__decorateClass([SceneChangeDetection()],Rect.prototype,"crisp",2);var SectorBox=class Z{constructor(t,i,s,n){this.startAngle=t,this.endAngle=i,this.innerRadius=s,this.outerRadius=n}clone(){const{startAngle:t,endAngle:i,innerRadius:s,outerRadius:n}=this;return new Z(t,i,s,n)}equals(t){return this.startAngle===t.startAngle&&this.endAngle===t.endAngle&&this.innerRadius===t.innerRadius&&this.outerRadius===t.outerRadius}[interpolate](t,i){return new Z(this.startAngle*(1-i)+t.startAngle*i,this.endAngle*(1-i)+t.endAngle*i,this.innerRadius*(1-i)+t.innerRadius*i,this.outerRadius*(1-i)+t.outerRadius*i)}};function sectorBox({startAngle:e,endAngle:t,innerRadius:i,outerRadius:s}){let n=1/0,r=1/0,a=-1/0,c=-1/0;const o=(h,l)=>{n=Math.min(h,n),r=Math.min(l,r),a=Math.max(h,a),c=Math.max(l,c)};return o(i*Math.cos(e),i*Math.sin(e)),o(i*Math.cos(t),i*Math.sin(t)),o(s*Math.cos(e),s*Math.sin(e)),o(s*Math.cos(t),s*Math.sin(t)),isBetweenAngles(0,e,t)&&o(s,0),isBetweenAngles(Math.PI*.5,e,t)&&o(0,s),isBetweenAngles(Math.PI,e,t)&&o(-s,0),isBetweenAngles(Math.PI*1.5,e,t)&&o(0,-s),new BBox(n,r,a-n,c-r)}function isPointInSector(e,t,i){const s=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),{innerRadius:n,outerRadius:r}=i;if(i.startAngle===i.endAngle||s<Math.min(n,r)||s>Math.max(n,r))return!1;const a=normalizeAngle180(i.startAngle),c=normalizeAngle180(i.endAngle),o=Math.atan2(t,e);return a<c?o<=c&&o>=a:o<=c&&o>=-Math.PI||o>=a&&o<=Math.PI}function radiiScalingFactor(e,t,i,s){if(i===0&&s===0)return 0;if(Math.asin(Math.abs(1*i)/(e+1*i))+Math.asin(Math.abs(1*s)/(e+1*s))-t<0)return 1;let r=0,a=1;for(let c=0;c<8;c+=1){const o=(r+a)/2;Math.asin(Math.abs(o*i)/(e+o*i))+Math.asin(Math.abs(o*s)/(e+o*s))-t<0?r=o:a=o}return r}var delta2=1e-6;function clockwiseAngle(e,t){return angleBetween(e,t)<delta2?t:normalizeAngle360(e-t)+t}function clockwiseAngles(e,t,i=0){const n=Math.abs(t-e)>=2*Math.PI?2*Math.PI:normalizeAngle360(t-e);return e=clockwiseAngle(e,i),t=e+n,{startAngle:e,endAngle:t}}function arcRadialLineIntersectionAngle(e,t,i,s,n,r){const a=Math.sin(r),c=Math.cos(r),o=e**2+t**2-i**2;let h,l,d,u;if(c>.5){const S=a/c,C=1+S**2,P=-2*(e+t*S),w=P**2-4*C*o;if(w<0)return;const v=(-P+Math.sqrt(w))/(2*C),x=(-P-Math.sqrt(w))/(2*C);h=v,l=v*S,d=x,u=x*S}else{const S=c/a,C=1+S**2,P=-2*(t+e*S),w=P**2-4*C*o;if(w<0)return;const v=(-P+Math.sqrt(w))/(2*C),x=(-P-Math.sqrt(w))/(2*C);h=v*S,l=v,d=x*S,u=x}const f=c,p=a,y=h*f+l*p,g=d*f+u*p,m=y>0?clockwiseAngle(Math.atan2(l-t,h-e),s):NaN,b=g>0?clockwiseAngle(Math.atan2(u-t,d-e),s):NaN;if(m>=s&&m<=n)return m;if(b>=s&&b<=n)return b}function arcCircleIntersectionAngle(e,t,i,s,n,r){const a=Math.hypot(e,t),c=(a**2-i**2+r**2)/(2*a),o=a-c,h=Math.atan2(t,e),l=Math.acos(-o/i),d=clockwiseAngle(h+l,s),u=clockwiseAngle(h-l,s);if(d>=s&&d<=n)return d;if(u>=s&&u<=n)return u}var Arc2=class{constructor(e,t,i,s,n){this.cx=e,this.cy=t,this.r=i,this.a0=s,this.a1=n,this.a0>=this.a1&&(this.a0=NaN,this.a1=NaN)}isValid(){return Number.isFinite(this.a0)&&Number.isFinite(this.a1)}pointAt(e){return{x:this.cx+this.r*Math.cos(e),y:this.cy+this.r*Math.sin(e)}}clipStart(e){e==null||!this.isValid()||e<this.a0||(this.a0=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}clipEnd(e){e==null||!this.isValid()||e>this.a1||(this.a1=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}},Sector=class extends Path{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(e){this.concentricEdgeInset=e,this.radialEdgeInset=e}set cornerRadius(e){this.startOuterCornerRadius=e,this.endOuterCornerRadius=e,this.startInnerCornerRadius=e,this.endInnerCornerRadius=e}computeBBox(){return sectorBox(this).translate(this.centerX,this.centerY)}normalizedRadii(){const{concentricEdgeInset:e}=this;let{innerRadius:t,outerRadius:i}=this;return t=t>0?t+e:0,i=Math.max(i-e,0),{innerRadius:t,outerRadius:i}}normalizedClipSector(){const{clipSector:e}=this;if(e==null)return;const{startAngle:t,endAngle:i}=clockwiseAngles(this.startAngle,this.endAngle),{innerRadius:s,outerRadius:n}=this.normalizedRadii(),r=clockwiseAngles(e.startAngle,e.endAngle,t);return new SectorBox(Math.max(t,r.startAngle),Math.min(i,r.endAngle),Math.max(s,e.innerRadius),Math.min(n,e.outerRadius))}getAngleOffset(e){return e>0?this.radialEdgeInset/e:0}arc(e,t,i,s,n,r,a,c){if(e<=0)return;const{startAngle:o,endAngle:h}=clockwiseAngles(this.startAngle,this.endAngle),{innerRadius:l,outerRadius:d}=this.normalizedRadii(),u=this.normalizedClipSector();if(c&&l<=0)return;const f=c?this.getAngleOffset(l+e):this.getAngleOffset(d-e),p=a?o+f+t:h-f-t,y=c?l+e:d-e,g=y*Math.cos(p),m=y*Math.sin(p);if(u!=null&&(!a&&!(p>=o-1e-6&&p<=u.endAngle-1e-6)||a&&!(p>=u.startAngle+1e-6&&p<=h-1e-6)||c&&y<u.innerRadius-1e-6||!c&&y>u.outerRadius+1e-6))return;const b=new Arc2(g,m,e,i,s);if(u!=null){c?(b.clipStart(arcRadialLineIntersectionAngle(g,m,e,i,s,u.endAngle)),b.clipEnd(arcRadialLineIntersectionAngle(g,m,e,i,s,u.startAngle))):(b.clipStart(arcRadialLineIntersectionAngle(g,m,e,i,s,u.startAngle)),b.clipEnd(arcRadialLineIntersectionAngle(g,m,e,i,s,u.endAngle)));let v,x;if(a?(v=arcCircleIntersectionAngle(g,m,e,i,s,u.innerRadius),x=arcCircleIntersectionAngle(g,m,e,i,s,u.outerRadius)):(v=arcCircleIntersectionAngle(g,m,e,i,s,u.outerRadius),x=arcCircleIntersectionAngle(g,m,e,i,s,u.innerRadius)),b.clipStart(v),b.clipEnd(x),v!=null){const{x:M,y:A}=b.pointAt(v),D=clockwiseAngle(Math.atan2(A,M),o);a?r?.clipStart(D):n.clipEnd(D)}if(x!=null){const{x:M,y:A}=b.pointAt(x),D=clockwiseAngle(Math.atan2(A,M),o);a?n.clipStart(D):r?.clipEnd(D)}}if(u!=null){const{x:v,y:x}=b.pointAt((b.a0+b.a1)/2);if(!isPointInSector(v,x,u))return}const{x:S,y:C}=b.pointAt(a===c?b.a0:b.a1),P=clockwiseAngle(Math.atan2(C,S),o),w=c?r:n;return a?w?.clipStart(P):w?.clipEnd(P),b}updatePath(){const{path:t,centerX:i,centerY:s,concentricEdgeInset:n,radialEdgeInset:r}=this;let{startOuterCornerRadius:a,endOuterCornerRadius:c,startInnerCornerRadius:o,endInnerCornerRadius:h}=this;const{startAngle:l,endAngle:d}=clockwiseAngles(this.startAngle,this.endAngle),{innerRadius:u,outerRadius:f}=this.normalizedRadii(),p=this.normalizedClipSector(),y=d-l,g=y>=2*Math.PI-1e-6;if(t.clear(),u===0&&f===0||u>f)return;if((p?.startAngle??l)===(p?.endAngle??d))return;if(g&&this.clipSector==null&&a===0&&c===0&&o===0&&h===0){t.moveTo(i+f*Math.cos(l),s+f*Math.sin(l)),t.arc(i,s,f,l,d),u>n&&(t.moveTo(i+u*Math.cos(d),s+u*Math.sin(d)),t.arc(i,s,u,d,l,!0)),t.closePath();return}else if(this.clipSector==null&&Math.abs(u-f)<1e-6){t.arc(i,s,f,l,d,!1),t.arc(i,s,f,d,l,!0),t.closePath();return}const m=this.getAngleOffset(u),b=this.getAngleOffset(f);if(y<2*b)return;const C=(p?.innerRadius??u)>n,P=u<n||y<2*m,w=f-u,v=Math.max(a,o,c,h),x=v>0?Math.min(w/v,1):1;a*=x,c*=x,o*=x,h*=x;const M=radiiScalingFactor(f,y-2*b,-a,-c);if(a*=M,c*=M,!P&&C){const F=radiiScalingFactor(u,y-2*m,o,h);o*=F,h*=F}else o=0,h=0;const A=Math.max(a+o,c+h),D=A>0?Math.min(w/A,1):1;a*=D,c*=D,o*=D,h*=D;let T=0,R=0;const E=a/(f-a),q=c/(f-c);if(E>=0&&E<1-1e-6)T=Math.asin(E);else{T=y/2;const F=f/(1/Math.sin(T)+1);a=Math.min(F,a)}if(q>=0&&q<1-1e-6)R=Math.asin(q);else{R=y/2;const F=f/(1/Math.sin(R)+1);c=Math.min(F,c)}const G=Math.asin(o/(u+o)),W=Math.asin(h/(u+h)),H=p?.outerRadius??f,$=this.getAngleOffset(H),N=new Arc2(0,0,H,l+$,d-$),Q=p?.innerRadius??u,tt=this.getAngleOffset(Q),O=C?new Arc2(0,0,Q,l+tt,d-tt):void 0;p!=null&&(N.clipStart(p.startAngle),N.clipEnd(p.endAngle),O?.clipStart(p.startAngle),O?.clipEnd(p.endAngle));const et=this.arc(a,T,l-Math.PI*.5,l+T,N,O,!0,!1),it=this.arc(c,R,d-R,d+Math.PI*.5,N,O,!1,!1),st=this.arc(h,W,d+Math.PI*.5,d+Math.PI-W,N,O,!1,!0),U=this.arc(o,G,l+Math.PI+G,l+Math.PI*1.5,N,O,!0,!0);if(P){const F=y<Math.PI*.5?r*(1+Math.cos(y))/Math.sin(y):NaN;let _;F>0&&F<f?_=Math.max(Math.hypot(r,F),u):_=r,_=Math.max(_,u);const I=l+y*.5;t.moveTo(i+_*Math.cos(I),s+_*Math.sin(I))}else if(!(U?.isValid()===!0||O?.isValid()===!0)){const F=l+y/2,_=u*Math.cos(F),I=u*Math.sin(F);t.moveTo(i+_,s+I)}if(et?.isValid()===!0){const{cx:F,cy:_,r:I,a0:B,a1:L}=et;t.arc(i+F,s+_,I,B,L)}if(N.isValid()){const{r:F,a0:_,a1:I}=N;t.arc(i,s,F,_,I)}if(it?.isValid()===!0){const{cx:F,cy:_,r:I,a0:B,a1:L}=it;t.arc(i+F,s+_,I,B,L)}if(!P){if(st?.isValid()===!0){const{cx:F,cy:_,r:I,a0:B,a1:L}=st;t.arc(i+F,s+_,I,B,L)}if(O?.isValid()===!0){const{r:F,a0:_,a1:I}=O;t.arc(i,s,F,I,_,!0)}if(U?.isValid()===!0){const{cx:F,cy:_,r:I,a0:B,a1:L}=U;t.arc(i+F,s+_,I,B,L)}}t.closePath()}isPointInPath(e,t){const{startAngle:i,endAngle:s,innerRadius:n,outerRadius:r}=this.clipSector??this;return isPointInSector(e-this.centerX,t-this.centerY,{startAngle:i,endAngle:s,innerRadius:Math.min(n,r),outerRadius:Math.max(n,r)})}};Sector.className="Sector",__decorateClass([SceneChangeDetection()],Sector.prototype,"centerX",2),__decorateClass([SceneChangeDetection()],Sector.prototype,"centerY",2),__decorateClass([SceneChangeDetection()],Sector.prototype,"innerRadius",2),__decorateClass([SceneChangeDetection()],Sector.prototype,"outerRadius",2),__decorateClass([SceneChangeDetection()],Sector.prototype,"startAngle",2),__decorateClass([SceneChangeDetection()],Sector.prototype,"endAngle",2),__decorateClass([SceneObjectChangeDetection({equals:(e,t)=>e.equals(t)})],Sector.prototype,"clipSector",2),__decorateClass([SceneChangeDetection()],Sector.prototype,"concentricEdgeInset",2),__decorateClass([SceneChangeDetection()],Sector.prototype,"radialEdgeInset",2),__decorateClass([SceneChangeDetection()],Sector.prototype,"startOuterCornerRadius",2),__decorateClass([SceneChangeDetection()],Sector.prototype,"endOuterCornerRadius",2),__decorateClass([SceneChangeDetection()],Sector.prototype,"startInnerCornerRadius",2),__decorateClass([SceneChangeDetection()],Sector.prototype,"endInnerCornerRadius",2);