UNPKG

ag-charts-community

Version:

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

5 lines 143 kB
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(n,t)=>{for(var e in t)__defProp(n,e,{get:t[e],enumerable:!0})},__copyProps=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of __getOwnPropNames(t))!__hasOwnProp.call(n,s)&&s!==e&&__defProp(n,s,{get:()=>t[s],enumerable:!(i=__getOwnPropDesc(t,s))||i.enumerable});return n},__toCommonJS=n=>__copyProps(__defProp({},"__esModule",{value:!0}),n),__decorateClass=(n,t,e,i)=>{for(var s=i>1?void 0:i?__getOwnPropDesc(t,e):t,r=n.length-1,a;r>=0;r--)(a=n[r])&&(s=(i?a(t,e,s):a(s))||s);return i&&s&&__defProp(t,e,s),s},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_core24=require("ag-charts-core"),import_ag_charts_core4=require("ag-charts-core"),import_ag_charts_core=require("ag-charts-core"),BREAK_TRANSFORM_CHAIN=Symbol("BREAK"),CONFIG_KEY="__decorator_config",ACCESSORS_KEY="__decorator_accessors";function addFakeTransformToInstanceProperty(n,t){initialiseConfig(n,t).optional=!0}function initialiseConfig(n,t){if(Object.getOwnPropertyDescriptor(n,CONFIG_KEY)==null&&Object.defineProperty(n,CONFIG_KEY,{value:{}}),Object.getOwnPropertyDescriptor(n,ACCESSORS_KEY)==null){const l=Object.getPrototypeOf(n)?.[ACCESSORS_KEY]?.slice()??[];Object.defineProperty(n,ACCESSORS_KEY,{value:l})}const e=n[CONFIG_KEY],i=t.toString();if(e[i]!=null)return e[i];e[i]={setters:[],getters:[],observers:[]};const s=Object.getOwnPropertyDescriptor(n,t);let r=s?.get,a=s?.set;if(r==null||a==null){const h=n[ACCESSORS_KEY];let l=h.indexOf(t);l===-1&&(l=h.push(t)-1),r??(r=function(){let u=this.__accessors;return u==null&&(u=h.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:u})),u[l]}),a??(a=function(u){let d=this.__accessors;d==null&&(d=h.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:d})),d[l]=u})}return Object.defineProperty(n,t,{set:function(h){const{setters:l,observers:u}=e[i];let d;l.some(f=>f.length>2)&&(d=r.call(this));for(const f of l)if(h=f(this,t,h,d),h===BREAK_TRANSFORM_CHAIN)return;a.call(this,h);for(const f of u)f(this,h,d)},get:function(){let h=r.call(this);for(const l of e[i].getters)if(h=l(this,t,h),h===BREAK_TRANSFORM_CHAIN)return;return h},enumerable:!0,configurable:!1}),e[i]}function addTransformToInstanceProperty(n,t,e){return(i,s)=>{const r=initialiseConfig(i,s);r.setters.push(n),t&&r.getters.unshift(t),e&&Object.assign(r,e)}}function addObserverToInstanceProperty(n){return(t,e)=>{initialiseConfig(t,e).observers.push(n)}}function isDecoratedObject(n){return typeof n<"u"&&CONFIG_KEY in n}function listDecoratedProperties(n){const t=new Set;for(;isDecoratedObject(n);)t.add(n?.[CONFIG_KEY]),n=Object.getPrototypeOf(n);return Array.from(t).flatMap(e=>Object.keys(e))}function objectsEqual(n,t){return Array.isArray(n)?!Array.isArray(t)||n.length!==t.length?!1:n.every((e,i)=>objectsEqual(e,t[i])):(0,import_ag_charts_core.isPlainObject)(n)?(0,import_ag_charts_core.isPlainObject)(t)?objectsEqualWith(n,t,objectsEqual):!1:n===t}function objectsEqualWith(n,t,e){if(Object.is(n,t))return!0;for(const i of Object.keys(t))if(!(i in n))return!1;for(const i of Object.keys(n))if(!(i in t)||!e(n[i],t[i]))return!1;return!0}function merge(...n){const t={};for(const e of n){if(!(0,import_ag_charts_core.isObject)(e))continue;const i=isDecoratedObject(e)?listDecoratedProperties(e):Object.keys(e);for(const s of i)(0,import_ag_charts_core.isPlainObject)(t[s])&&(0,import_ag_charts_core.isPlainObject)(e[s])?t[s]=merge(t[s],e[s]):s in t||(t[s]??(t[s]=e[s]))}return t}var import_ag_charts_core2=require("ag-charts-core"),BBoxValues={containsPoint,equals,isEmpty,normalize};function containsPoint(n,t,e){return t>=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height}function equals(n,t){return n.x===t.x&&n.y===t.y&&n.width===t.width&&n.height===t.height}function isEmpty(n){return n==null||n.height===0||n.width===0||isNaN(n.height)||isNaN(n.width)}function normalize(n){let{x:t,y:e,width:i,height:s}=n;return(i==null||i>0)&&(s==null||s>0)?n:(t!=null&&i!=null&&i<0&&(i=-i,t=t-i),e!=null&&s!=null&&s<0&&(s=-s,e=e-s),{x:t,y:e,width:i,height:s})}var interpolate=Symbol("interpolate");function nearestSquared(n,t,e,i=1/0){const s={nearest:void 0,distanceSquared:i};for(const r of e){const a=r.distanceSquared(n,t);if(a===0)return{nearest:r,distanceSquared:0};a<s.distanceSquared&&(s.nearest=r,s.distanceSquared=a)}return s}var _BBox=class q{constructor(t,e,i,s){this.x=t,this.y=e,this.width=i,this.height=s}static fromDOMRect({x:t,y:e,width:i,height:s}){return new q(t,e,i,s)}static merge(t){let e=1/0,i=1/0,s=-1/0,r=-1/0;for(const a of t)a.x<e&&(e=a.x),a.y<i&&(i=a.y),a.x+a.width>s&&(s=a.x+a.width),a.y+a.height>r&&(r=a.y+a.height);return new q(e,i,s-e,r-i)}static nearestBox(t,e,i){return nearestSquared(t,e,i)}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:e,width:i,height:s}=this;return new q(t,e,i,s)}equals(t){return BBoxValues.equals(this,t)}containsPoint(t,e){return BBoxValues.containsPoint(this,t,e)}intersection(t){if(!this.collidesBBox(t))return;const e=(0,import_ag_charts_core2.clamp)(t.x,this.x,t.x+t.width),i=(0,import_ag_charts_core2.clamp)(t.y,this.y,t.y+t.height),s=(0,import_ag_charts_core2.clamp)(t.x,this.x+this.width,t.x+t.width),r=(0,import_ag_charts_core2.clamp)(t.y,this.y+this.height,t.y+t.height);return new q(e,i,s-e,r-i)}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,e){if(this.containsPoint(t,e))return 0;const i=t-(0,import_ag_charts_core2.clamp)(this.x,t,this.x+this.width),s=e-(0,import_ag_charts_core2.clamp)(this.y,e,this.y+this.height);return i*i+s*s}shrink(t,e){if(typeof t=="number")this.applyMargin(t,e);else for(const i of Object.keys(t)){const s=t[i];typeof s=="number"&&this.applyMargin(s,i)}return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this}grow(t,e){if(typeof t=="number")this.applyMargin(-t,e);else for(const i of Object.keys(t)){const s=t[i];typeof s=="number"&&this.applyMargin(-s,i)}return this}applyMargin(t,e){switch(e){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,e){return this.x+=t,this.y+=e,this}[interpolate](t,e){return new q(this.x*(1-e)+t.x*e,this.y*(1-e)+t.y*e,this.width*(1-e)+t.width*e,this.height*(1-e)+t.height*e)}};_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_core3=require("ag-charts-core"),TRIPLE_EQ=(n,t)=>n===t;function SceneChangeDetection(n){return function(t,e){const i=`__${e}`;t[e]||prepareGetSet(t,e,i,n)}}function SceneObjectChangeDetection(n){return SceneChangeDetection(n)}function SceneArrayChangeDetection(n){const t=n??{};return t.equals=import_ag_charts_core3.arraysEqual,SceneChangeDetection(n)}function prepareGetSet(n,t,e,i){const{changeCb:s,convertor:r,checkDirtyOnAssignment:a=!1}=i??{},c={changeCb:s,checkDirtyOnAssignment:a,convertor:r},o=buildCheckDirtyChain(e,buildChangeCallbackChain(buildConvertorChain(buildSetter(e,c),c),c),c);Object.defineProperty(n,t,{set:o,get:function(){return this[e]},enumerable:!0,configurable:!0})}function buildConvertorChain(n,t){const{convertor:e}=t;return e?function(i){n.call(this,e(i))}:n}var NO_CHANGE=Symbol("no-change");function buildChangeCallbackChain(n,t){const{changeCb:e}=t;return e?function(i){const s=n.call(this,i);return s!==NO_CHANGE&&e.call(this,this),s}:n}function buildCheckDirtyChain(n,t,e){const{checkDirtyOnAssignment:i}=e;return i?function(s){const r=t.call(this,s);return s?._dirty===!0&&this.markDirty(n),r}:t}function buildSetter(n,t){const{equals:e=TRIPLE_EQ}=t;return function(i){const s=this[n];return e(i,s)?NO_CHANGE:(this[n]=i,this.onChangeDetection(n),i)}}var _Node=class X{constructor(t){this.serialNumber=X._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=(0,import_ag_charts_core4.createId)(this),this.pointerEvents=0,this.scene=void 0,this._dirty=!0,this.dirtyZIndex=!1,this.isContainerNode=!1,this.visible=!0,this.zIndex=0,this.name=t?.name,this.tag=t?.tag??NaN,this.zIndex=t?.zIndex??0,(t?.debugDirty??X._debugEnabled)&&(this._debugDirtyProperties=new Map([["__first__",[]]]))}static toSVG(t,e,i){const s=t?.toSVG();if(s==null||!s.elements.length&&!s.defs?.length)return;const r=(0,import_ag_charts_core4.createSvgElement)("svg");if(r.setAttribute("width",String(e)),r.setAttribute("height",String(i)),r.setAttribute("viewBox",`0 0 ${e} ${i}`),s.defs?.length){const a=(0,import_ag_charts_core4.createSvgElement)("defs");a.append(...s.defs),r.append(a)}return r.append(...s.elements),r.outerHTML}static*extractBBoxes(t,e){for(const i of t)if(!e||i.visible&&!i.transitionOut){const s=i.getBBox();s&&(yield s)}}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}get dirty(){return this._dirty}closestDatum(){for(const{datum:t}of this.traverseUp(!0))if(t!=null)return t}preRender(t,e=1){this.childNodeCounts.groups=0,this.childNodeCounts.nonGroups=1,this.childNodeCounts.complexity=e,this.childNodeCounts.thisComplexity=e;for(const i of this.children()){const s=i.preRender(t);this.childNodeCounts.groups+=s.groups,this.childNodeCounts.nonGroups+=s.nonGroups,this.childNodeCounts.complexity+=s.complexity}return this.childNodeCounts}render(t){const{stats:e}=t;if(this._dirty=!1,this.debugDirtyProperties(),t.debugNodeSearch){const i=this.name??this.id;t.debugNodeSearch.some(s=>typeof s=="string"?s===i:s.test(i))&&(t.debugNodes[this.name??this.id]=this)}e&&(e.nodesRendered++,e.opsPerformed+=this.childNodeCounts.thisComplexity)}setScene(t){this.scene=t,this._debug=t?.layersManager?.debug;for(const e of this.children())e.setScene(t)}sortChildren(t){if(this.dirtyZIndex=!1,!this.childNodes)return;const e=[...this.childNodes].sort(t);this.childNodes.clear();for(const i of e)this.childNodes.add(i)}*traverseUp(t){let e=this;for(t&&(yield e);e=e.parentNode;)yield e}*children(){if(this.childNodes)for(const t of this.childNodes)yield t}*descendants(){for(const t of this.children())yield t,yield*t.descendants()}isLeaf(){return!this.childNodes?.size}isRoot(){return!this.parentNode}append(t){this.childNodes??(this.childNodes=new Set);for(const e of(0,import_ag_charts_core4.toIterable)(t))e.parentNode?.removeChild(e),this.childNodes.add(e),e.parentNode=this,e.setScene(this.scene);this.invalidateCachedBBox(),this.dirtyZIndex=!0,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}`);delete t.parentNode,t.setScene(),this.invalidateCachedBBox(),this.dirtyZIndex=!0,this.markDirty()}remove(){this.parentNode?.removeChild(this)}clear(){for(const t of this.children())delete t.parentNode,t.setScene();this.childNodes?.clear(),this.invalidateCachedBBox()}destroy(){this.parentNode?.removeChild(this)}setProperties(t,e){if(e)for(const i of e)this[i]=t[i];else Object.assign(this,t);return this}containsPoint(t,e){return!1}pickNode(t,e){if(!(!this.visible||this.pointerEvents===1||!this.containsPoint(t,e))){if(this.childNodes!=null&&this.childNodes.size!==0){const i=[...this.children()];for(let s=i.length-1;s>=0;s--){const r=i[s].pickNode(t,e);if(r)return r}}else if(!this.isContainerNode)return this}}pickNodes(t,e,i=[]){if(!this.visible||this.pointerEvents===1||!this.containsPoint(t,e))return i;this.isContainerNode||i.push(this);for(const s of this.children())s.pickNodes(t,e,i);return i}invalidateCachedBBox(){this.cachedBBox!=null&&(this.cachedBBox=void 0,this.parentNode?.invalidateCachedBBox())}getBBox(){return this.cachedBBox==null&&(this.cachedBBox=Object.freeze(this.computeBBox())),this.cachedBBox}computeBBox(){}onChangeDetection(t){this.markDirty(t)}markDirty(t){const{_dirty:e}=this;t!=null&&this._debugDirtyProperties&&this.markDebugProperties(t),!(this.cachedBBox==null&&e)&&(this.invalidateCachedBBox(),this._dirty=!0,this.parentNode&&this.parentNode.markDirty())}markClean(){if(this._dirty){this._dirty=!1,this.debugDirtyProperties();for(const t of this.children())t.markClean()}}markDebugProperties(t){const e=this._debugDirtyProperties?.get(t)??[],i=new Error().stack?.split(`
`).filter(s=>s!=="Error"&&!s.includes(".markDebugProperties")&&!s.includes(".markDirty")&&!s.includes("Object.assign ")&&!s.includes(`${this.constructor.name}.`))??"unknown";e.push(i[0].replace(" at ","").trim()),this._debugDirtyProperties?.set(t,e)}debugDirtyProperties(){this._debugDirtyProperties!=null&&(this._debugDirtyProperties.has("__first__")||this._debugDirtyProperties.forEach((t,e)=>{t.length>1&&(console.groupCollapsed(`Property changed multiple times before render: ${this.constructor.name}.${e} (${t.length}x)`),t.forEach(i=>console.log(i)),console.groupEnd())}),this._debugDirtyProperties.clear())}onZIndexChange(){const{parentNode:t}=this;t&&(t.dirtyZIndex=!0)}toSVG(){}};_Node._nextSerialNumber=0,_Node._debugEnabled=!1,__decorateClass([SceneChangeDetection()],_Node.prototype,"visible",2),__decorateClass([SceneObjectChangeDetection({equals:objectsEqual,changeCb:n=>n.onZIndexChange()})],_Node.prototype,"zIndex",2);var Node=_Node,import_ag_charts_core22=require("ag-charts-core");function createCanvasContext(n=0,t=0){return new OffscreenCanvas(n,t).getContext("2d")}var LRUCache=class{constructor(n=5){this.maxCacheSize=n,this.store=new Map}get(n){if(!this.store.has(n))return;const t=this.store.get(n);return this.store.delete(n),this.store.set(n,t),t}has(n){return this.store.has(n)}set(n,t){if(this.store.set(n,t),this.store.size>this.maxCacheSize){const e=this.store.keys();let i=this.store.size-this.maxCacheSize;for(;i>0;){const s=e.next();s.done||this.store.delete(s.value),i--}}return t}clear(){this.store.clear()}},CachedTextMeasurerPool=class{static measureText(n,t){return this.getMeasurer(t).measureText(n)}static measureLines(n,t){return this.getMeasurer(t).measureLines(n)}static getMeasurer(n){const t=typeof n.font=="string"?n.font:TextUtils.toFontString(n.font),e=`${t}-${n.textAlign??"start"}-${n.textBaseline??"alphabetic"}`;return this.instanceMap.get(e)??this.createFontMeasurer(t,n,e)}static clear(){this.instanceMap.clear()}static createFontMeasurer(n,t,e){const i=createCanvasContext();i.font=n,i.textAlign=t.textAlign??"start",i.textBaseline=t.textBaseline??"alphabetic";const s=new CachedTextMeasurer(i,t);return this.instanceMap.set(e,s),s}};CachedTextMeasurerPool.instanceMap=new LRUCache(10);var CachedTextMeasurer=class{constructor(n,t){this.ctx=n,this.measureMap=new LRUCache(100),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline),n.font=typeof t.font=="string"?t.font:TextUtils.toFontString(t.font),this.textMeasurer=new SimpleTextMeasurer(e=>this.cachedCtxMeasureText(e),t.textBaseline??"alphabetic")}textWidth(n,t){return this.textMeasurer.textWidth(n,t)}measureText(n){return this.textMeasurer.measureText(n)}measureLines(n){return this.textMeasurer.measureLines(n)}cachedCtxMeasureText(n){if(!this.measureMap.has(n)){const t=this.ctx.measureText(n);this.measureMap.set(n,{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(n)}},TextUtils=class{static toFontString({fontSize:n=10,fontStyle:t,fontWeight:e,fontFamily:i,lineHeight:s}){let r="";return t&&(r+=`${t} `),e&&(r+=`${e} `),r+=`${n}px`,s&&(r+=`/${s}px`),r+=` ${i}`,r.trim()}static getLineHeight(n){return Math.ceil(n*this.defaultLineHeight)}static getVerticalModifier(n){switch(n){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(n,t="alphabetic"){this.measureTextFn=n,this.textBaseline=t,this.charMap=new Map}getMetrics(n){const t=this.measureTextFn(n);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,offsetTop:t.actualBoundingBoxAscent,offsetLeft:t.actualBoundingBoxLeft}}getMultilineMetrics(n){let t=0,e=0,i=0,s=0,r=0;const a=TextUtils.getVerticalModifier(this.textBaseline),c=[];let o=0;const h=n.length;for(const l of n){const u=this.measureTextFn(l);u.fontBoundingBoxAscent??(u.fontBoundingBoxAscent=u.emHeightAscent),u.fontBoundingBoxDescent??(u.fontBoundingBoxDescent=u.emHeightDescent),t<u.width&&(t=u.width),s<u.actualBoundingBoxLeft&&(s=u.actualBoundingBoxLeft),o===0?(e+=u.actualBoundingBoxAscent,i+=u.actualBoundingBoxAscent):r+=u.fontBoundingBoxAscent,o===h-1?e+=u.actualBoundingBoxDescent:r+=u.fontBoundingBoxDescent,c.push({text:l,width:u.width,height:u.actualBoundingBoxAscent+u.actualBoundingBoxDescent,lineHeight:u.fontBoundingBoxAscent+u.fontBoundingBoxDescent,offsetTop:u.actualBoundingBoxAscent,offsetLeft:u.actualBoundingBoxLeft}),o++}return e+=r,i+=r*a,{width:t,height:e,offsetTop:i,offsetLeft:s,lineMetrics:c}}textWidth(n,t){if(t){let e=0;for(let i=0;i<n.length;i++)e+=this.textWidth(n.charAt(i));return e}return n.length>1?this.measureTextFn(n).width:this.charMap.get(n)??this.charWidth(n)}measureText(n){return this.getMetrics(n)}measureLines(n){const t=typeof n=="string"?n.split(TextUtils.lineSplitter):n;return this.getMultilineMetrics(t)}charWidth(n){const{width:t}=this.measureTextFn(n);return this.charMap.set(n,t),t}},import_ag_charts_core6=require("ag-charts-core"),import_ag_charts_core5=require("ag-charts-core"),IDENTITY_MATRIX_ELEMENTS=[1,0,0,1,0,0],Matrix=class G{get e(){return[...this.elements]}constructor(t=IDENTITY_MATRIX_ELEMENTS){this.elements=[...t]}setElements(t){const e=this.elements;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this}get identity(){const t=this.elements;return(0,import_ag_charts_core5.isNumberEqual)(t[0],1)&&(0,import_ag_charts_core5.isNumberEqual)(t[1],0)&&(0,import_ag_charts_core5.isNumberEqual)(t[2],0)&&(0,import_ag_charts_core5.isNumberEqual)(t[3],1)&&(0,import_ag_charts_core5.isNumberEqual)(t[4],0)&&(0,import_ag_charts_core5.isNumberEqual)(t[5],0)}AxB(t,e,i){const s=t[0]*e[0]+t[2]*e[1],r=t[1]*e[0]+t[3]*e[1],a=t[0]*e[2]+t[2]*e[3],c=t[1]*e[2]+t[3]*e[3],o=t[0]*e[4]+t[2]*e[5]+t[4],h=t[1]*e[4]+t[3]*e[5]+t[5];i=i??t,i[0]=s,i[1]=r,i[2]=a,i[3]=c,i[4]=o,i[5]=h}multiplySelf(t){return this.AxB(this.elements,t.elements),this}multiply(t){const e=new Array(6);return t instanceof G?this.AxB(this.elements,t.elements,e):this.AxB(this.elements,[t.a,t.b,t.c,t.d,t.e,t.f],e),new G(e)}preMultiplySelf(t){return this.AxB(t.elements,this.elements,this.elements),this}inverse(){const t=this.elements;let e=t[0],i=t[1],s=t[2],r=t[3];const a=t[4],c=t[5],o=1/(e*r-i*s);return e*=o,i*=o,s*=o,r*=o,new G([r,-i,-s,e,s*c-r*a,i*a-e*c])}invertSelf(){const t=this.elements;let e=t[0],i=t[1],s=t[2],r=t[3];const a=t[4],c=t[5],o=1/(e*r-i*s);return e*=o,i*=o,s*=o,r*=o,t[0]=r,t[1]=-i,t[2]=-s,t[3]=e,t[4]=s*c-r*a,t[5]=i*a-e*c,this}transformPoint(t,e){const i=this.elements;return{x:t*i[0]+e*i[2]+i[4],y:t*i[1]+e*i[3]+i[5]}}transformBBox(t,e){const i=this.elements,s=i[0],r=i[1],a=i[2],c=i[3],o=t.width*.5,h=t.height*.5,l=t.x+o,u=t.y+h,d=Math.abs(o*s)+Math.abs(h*a),f=Math.abs(o*r)+Math.abs(h*c);return e??(e=new BBox(0,0,0,0)),e.x=l*s+u*a+i[4]-d,e.y=l*r+u*c+i[5]-f,e.width=d+d,e.height=f+f,e}toContext(t){if(this.identity)return;const e=this.elements;t.transform(e[0],e[1],e[2],e[3],e[4],e[5])}static updateTransformMatrix(t,e,i,s,r,a,c){const o=e,h=i;let l,u;o===1&&h===1?(l=0,u=0):(l=c?.scalingCenterX??0,u=c?.scalingCenterY??0);const d=s,f=Math.cos(d),p=Math.sin(d);let m,g;d===0?(m=0,g=0):(m=c?.rotationCenterX??0,g=c?.rotationCenterY??0);const y=r,v=a,w=l*(1-o)-m,C=u*(1-h)-g;return t.setElements([f*o,p*o,-p*h,f*h,f*w-p*C+m+y,p*w+f*C+g+v]),t}};function isMatrixTransform(n){return isMatrixTransformType(n.constructor)}var MATRIX_TRANSFORM_TYPE=Symbol("isMatrixTransform");function isMatrixTransformType(n){return n[MATRIX_TRANSFORM_TYPE]===!0}function MatrixTransform(n){var t,e;const i=n;if(isMatrixTransformType(n))return n;const s=Symbol("matrix_combined_transform");class r extends i{constructor(){super(...arguments),this[e]=new Matrix,this._dirtyTransform=!0}markDirtyTransform(){this._dirtyTransform=!0,super.markDirty()}onChangeDetection(c){super.onChangeDetection(c),this.markDirtyTransform()}updateMatrix(c){}computeTransformMatrix(){this._dirtyTransform&&(this[s].setElements(IDENTITY_MATRIX_ELEMENTS),this.updateMatrix(this[s]),this._dirtyTransform=!1)}toParent(c){return this.computeTransformMatrix(),this[s].identity?c.clone():this[s].transformBBox(c)}toParentPoint(c,o){return this.computeTransformMatrix(),this[s].identity?{x:c,y:o}:this[s].transformPoint(c,o)}fromParent(c){return this.computeTransformMatrix(),this[s].identity?c.clone():this[s].inverse().transformBBox(c)}fromParentPoint(c,o){return this.computeTransformMatrix(),this[s].identity?{x:c,y:o}:this[s].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[s];let l=!1;h.identity||(o.save(),l=!0,h.toContext(o)),super.render(c),l&&o.restore()}toSVG(){this.computeTransformMatrix();const c=super.toSVG(),o=this[s];if(o.identity||c==null)return c;const h=(0,import_ag_charts_core6.createSvgElement)("g");h.append(...c.elements);const[l,u,d,f,p,m]=o.e;return h.setAttribute("transform",`matrix(${l} ${u} ${d} ${f} ${p} ${m})`),{elements:[h],defs:c.defs}}}return t=MATRIX_TRANSFORM_TYPE,e=s,r[t]=!0,r}function Rotatable(n){var t;const e=n,i=Symbol("matrix_rotation");class s extends MatrixTransform(e){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[i],1,1,c,0,0,{rotationCenterX:o,rotationCenterY:h}),a.multiplySelf(this[i]))}}return t=i,__decorateClass([SceneChangeDetection()],s.prototype,"rotationCenterX",2),__decorateClass([SceneChangeDetection()],s.prototype,"rotationCenterY",2),__decorateClass([SceneChangeDetection()],s.prototype,"rotation",2),s}function Scalable(n){var t;const e=n,i=Symbol("matrix_scale");class s extends MatrixTransform(e){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[i],c,o,0,0,0,{scalingCenterX:h,scalingCenterY:l}),a.multiplySelf(this[i]))}}return t=i,__decorateClass([SceneChangeDetection()],s.prototype,"scalingX",2),__decorateClass([SceneChangeDetection()],s.prototype,"scalingY",2),__decorateClass([SceneChangeDetection()],s.prototype,"scalingCenterX",2),__decorateClass([SceneChangeDetection()],s.prototype,"scalingCenterY",2),s}function Translatable(n){var t;const e=n,i=Symbol("matrix_translation");class s extends MatrixTransform(e){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[i],1,1,0,c,o),a.multiplySelf(this[i]))}}return t=i,__decorateClass([SceneChangeDetection()],s.prototype,"translationX",2),__decorateClass([SceneChangeDetection()],s.prototype,"translationY",2),s}var Transformable=class{static fromCanvas(n,t){const e=[];for(const i of n.traverseUp())isMatrixTransform(i)&&e.unshift(i);for(const i of e)t=i.fromParent(t);return isMatrixTransform(n)&&(t=n.fromParent(t)),t}static toCanvas(n,t){t==null?t=n.getBBox():isMatrixTransform(n)&&(t=n.toParent(t));for(const e of n.traverseUp())isMatrixTransform(e)&&(t=e.toParent(t));return t}static fromCanvasPoint(n,t,e){const i=[];for(const s of n.traverseUp())isMatrixTransform(s)&&i.unshift(s);for(const s of i)({x:t,y:e}=s.fromParentPoint(t,e));return isMatrixTransform(n)&&({x:t,y:e}=n.fromParentPoint(t,e)),{x:t,y:e}}static toCanvasPoint(n,t,e){isMatrixTransform(n)&&({x:t,y:e}=n.toParentPoint(t,e));for(const i of n.traverseUp())isMatrixTransform(i)&&({x:t,y:e}=i.toParentPoint(t,e));return{x:t,y:e}}},import_ag_charts_core21=require("ag-charts-core"),import_ag_charts_core10=require("ag-charts-core"),twoPi=Math.PI*2,halfPi=Math.PI/2;function normalizeAngle360(n){return n%=twoPi,n+=twoPi,n%=twoPi,n}function normalizeAngle180(n){return n%=twoPi,n<-Math.PI?n+=twoPi:n>=Math.PI&&(n-=twoPi),n}function isBetweenAngles(n,t,e){const i=normalizeAngle360(n),s=normalizeAngle360(t),r=normalizeAngle360(e);return s<r?s<=i&&i<=r:s>r?s<=i||i<=r:!0}function toRadians(n){return n/180*Math.PI}function angleBetween(n,t){return n=normalizeAngle360(n),t=normalizeAngle360(t),t-n+(n>t?twoPi:0)}function normalizeAngle360FromDegrees(n){return n?normalizeAngle360(toRadians(n)):0}var import_ag_charts_core9=require("ag-charts-core"),import_ag_charts_core8=require("ag-charts-core"),import_ag_charts_core7=require("ag-charts-core"),lerp=(n,t,e)=>n*(1-e)+t*e,srgbToLinear=n=>{const t=n<0?-1:1,e=Math.abs(n);return e<=.04045?n/12.92:t*((e+.055)/1.055)**2.4},srgbFromLinear=n=>{const t=n<0?-1:1,e=Math.abs(n);return e>.0031308?t*(1.055*e**(1/2.4)-.055):12.92*n},_Color=class k{constructor(t,e,i,s=1){this.r=(0,import_ag_charts_core7.clamp)(0,t||0,1),this.g=(0,import_ag_charts_core7.clamp)(0,e||0,1),this.b=(0,import_ag_charts_core7.clamp)(0,i||0,1),this.a=(0,import_ag_charts_core7.clamp)(0,s||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 e=k.nameToHex.get(t.toLowerCase());if(e)return k.fromHexString(e);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 e;switch(t.length){case 6:case 8:e=[];for(let i=0;i<t.length;i+=2)e.push(parseInt(`${t[i]}${t[i+1]}`,16));break;case 3:case 4:e=t.split("").map(i=>parseInt(i,16)).map(i=>i+i*16);break}if(e?.length>=3&&e.every(i=>i>=0))return e.length===3&&e.push(255),e}static fromHexString(t){const e=k.parseHex(t);if(e){const[i,s,r,a]=e;return new k(i/255,s/255,r/255,a/255)}throw new Error(`Malformed hexadecimal color string: '${t}'`)}static stringToRgba(t){let e=-1,i=-1;for(let c=0;c<t.length;c++){const o=t[c];if(e===-1&&o==="(")e=c;else if(o===")"){i=c;break}}if(e===-1||i===-1)return;const r=t.substring(e+1,i).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_core7.clamp)(0,h,100),h/=100):c===3?h=(0,import_ag_charts_core7.clamp)(0,h,1):(h=(0,import_ag_charts_core7.clamp)(0,h,255),h/=255),a.push(h)}return a}static fromRgbaString(t){const e=k.stringToRgba(t);if(e){if(e.length===3)return new k(e[0],e[1],e[2]);if(e.length===4)return new k(e[0],e[1],e[2],e[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,e,i,s=1){const r=k.HSBtoRGB(t,e,i);return new k(r[0],r[1],r[2],s)}static fromHSL(t,e,i,s=1){const r=k.HSLtoRGB(t,e,i);return new k(r[0],r[1],r[2],s)}static fromOKLCH(t,e,i,s=1){const r=k.OKLCHtoRGB(t,e,i);return new k(r[0],r[1],r[2],s)}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 e=[Math.round(this.r*255),Math.round(this.g*255),Math.round(this.b*255)],i=Math.pow(10,t);return this.a!==1?(e.push(Math.round(this.a*i)/i),`rgba(${e.join(", ")})`):`rgb(${e.join(", ")})`}toString(){return this.a===1?this.toHexString():this.toRgbaString()}toHSB(){return k.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(t,e,i){const s=srgbToLinear(t),r=srgbToLinear(e),a=srgbToLinear(i),c=Math.cbrt(.4122214708*s+.5363325363*r+.0514459929*a),o=Math.cbrt(.2119034982*s+.6806995451*r+.1073969566*a),h=Math.cbrt(.0883024619*s+.2817188376*r+.6299787005*a),l=.2104542553*c+.793617785*o-.0040720468*h,u=1.9779984951*c-2.428592205*o+.4505937099*h,d=.0259040371*c+.7827717662*o-.808675766*h,f=Math.atan2(d,u)*180/Math.PI,p=l,m=Math.hypot(u,d),g=f>=0?f:f+360;return[p,m,g]}static OKLCHtoRGB(t,e,i){const s=t,r=e*Math.cos(i*Math.PI/180),a=e*Math.sin(i*Math.PI/180),c=(s+.3963377774*r+.2158037573*a)**3,o=(s-.1055613458*r-.0638541728*a)**3,h=(s-.0894841775*r-1.291485548*a)**3,l=4.0767416621*c-3.3077115913*o+.2309699292*h,u=-1.2684380046*c+2.6097574011*o-.3413193965*h,d=-.0041960863*c-.7034186147*o+1.707614701*h,f=srgbFromLinear(l),p=srgbFromLinear(u),m=srgbFromLinear(d);return[f,p,m]}static RGBtoHSL(t,e,i){const s=Math.min(t,e,i),r=Math.max(t,e,i),a=(r+s)/2;let c,o;if(r===s)c=0,o=0;else{const h=r-s;o=a>.5?h/(2-r-s):h/(r+s),r===t?c=(e-i)/h+(e<i?6:0):r===e?c=(i-t)/h+2:c=(t-e)/h+4,c*=360/6}return[c,o,a]}static HSLtoRGB(t,e,i){if(t=(t%360+360)%360,e===0)return[i,i,i];const s=i<.5?i*(1+e):i+e-i*e,r=2*i-s;function a(l){return l<0&&(l+=1),l>1&&(l-=1),l<1/6?r+(s-r)*6*l:l<1/2?s:l<2/3?r+(s-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,e,i){const s=Math.min(t,e,i),r=Math.max(t,e,i),a=r===0?0:(r-s)/r;let c=0;if(s!==r){const o=r-s,h=(r-t)/o,l=(r-e)/o,u=(r-i)/o;t===r?c=u-l:e===r?c=2+h-u:c=4+l-h,c/=6,c<0&&(c=c+1)}return[c*360,a,r]}static HSBtoRGB(t,e,i){t=(t%360+360)%360/360;let s=0,r=0,a=0;if(e===0)s=r=a=i;else{const c=(t-Math.floor(t))*6,o=c-Math.floor(c),h=i*(1-e),l=i*(1-e*o),u=i*(1-e*(1-o));switch(c>>0){case 0:s=i,r=u,a=h;break;case 1:s=l,r=i,a=h;break;case 2:s=h,r=i,a=u;break;case 3:s=h,r=l,a=i;break;case 4:s=u,r=h,a=i;break;case 5:s=i,r=h,a=l;break}}return[s,r,a]}static mix(t,e,i){return new k(lerp(t.r,e.r,i),lerp(t.g,e.g,i),lerp(t.b,e.b,i),lerp(t.a,e.a,i))}static lighten(t,e){const i=k.RGBtoOKLCH(t.r,t.g,t.b);return k.fromOKLCH((0,import_ag_charts_core7.clamp)(0,i[0]+e,1),i[1],i[2])}static darken(t,e){const i=k.RGBtoOKLCH(t.r,t.g,t.b);return k.fromOKLCH((0,import_ag_charts_core7.clamp)(0,i[0]-e,1),i[1],i[2])}static interpolate(t,e){const i=1/(t.length-1),s=t.map(r=>k.RGBtoOKLCH(r.r,r.g,r.b));return Array.from({length:e},(r,a)=>{const c=a/(e-1),o=t.length<=2?0:Math.min(Math.floor(c*(t.length-1)),t.length-2),h=(c-o*i)/i,l=s[o],u=s[o+1];return k.fromOKLCH(lerp(l[0],u[0],h),lerp(l[1],u[1],h),lerp(l[2],u[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(n,t,e){}niceDomain(n,t=this.domain){return t}tickFormatter(n){}datumFormatter(n){}get bandwidth(){}get step(){}get inset(){}},Invalidating=(n,t)=>{const e=Symbol(String(t));n[e]=void 0,Object.defineProperty(n,t,{get(){return this[e]},set(i){this[e]!==i&&(this[e]=i,this.invalid=!0)},enumerable:!0,configurable:!1})},convertColorStringToOklcha=n=>{const t=Color.fromString(n),[e,i,s]=Color.RGBtoOKLCH(t.r,t.g,t.b);return{l:e,c:i,h:s,a:t.a}},delta=1e-6,isAchromatic=n=>n.c<delta||n.l<delta||n.l>1-delta,interpolateOklch=(n,t,e)=>{e=(0,import_ag_charts_core8.clamp)(0,e,1);let i;if(isAchromatic(n))i=t.h;else if(isAchromatic(t))i=n.h;else{const c=n.h;let o=t.h;const h=t.h-n.h;h>180?o-=360:h<-180&&(o+=360),i=c*(1-e)+o*e}const s=n.c*(1-e)+t.c*e,r=n.l*(1-e)+t.l*e,a=n.a*(1-e)+t.a*e;return Color.fromOKLCH(r,s,i,a)},ColorScale=class extends AbstractScale{constructor(){super(...arguments),this.type="color",this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.parsedRange=this.range.map(convertColorStringToOklcha)}update(){const{domain:n,range:t}=this;n.length<2&&(import_ag_charts_core8.Logger.warnOnce("`colorDomain` should have at least 2 values."),n.length===0?n.push(0,1):n.length===1&&n.push(n[0]+1));for(let e=1;e<n.length;e++){const i=n[e-1],s=n[e];if(i>=s){import_ag_charts_core8.Logger.warnOnce("`colorDomain` values should be supplied in ascending order."),n.sort((r,a)=>r-a);break}}if(t.length<n.length)for(let e=t.length;e<n.length;e++)t.push(t.length>0?t[0]:"black");this.parsedRange=this.range.map(convertColorStringToOklcha)}normalizeDomains(...n){return{domain:n.flat(),animatable:!0}}toDomain(){}convert(n){this.refresh();const{domain:t,range:e,parsedRange:i}=this,s=t[0],r=t.at(-1),a=e[0],c=e[e.length-1];if(n<=s)return a;if(n>=r)return c;let o,h;if(t.length===2){const d=(n-s)/(r-s),f=1/(e.length-1);o=e.length<=2?0:Math.min(Math.floor(d*(e.length-1)),e.length-2),h=(d-o*f)/f}else{for(o=0;o<t.length-2&&!(n<t[o+1]);o++);const d=t[o],f=t[o+1];h=(n-d)/(f-d)}const l=i[o],u=i[o+1];return interpolateOklch(l,u,h).toRgbaString()}invert(){}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&import_ag_charts_core8.Logger.warnOnce("Expected update to not invalidate scale"))}};__decorateClass([Invalidating],ColorScale.prototype,"domain",2),__decorateClass([Invalidating],ColorScale.prototype,"range",2);var Gradient=class{constructor(n,t=[],e){this.colorSpace=n,this.stops=t,this.bbox=e,this._cache=void 0}createGradient(n,t,e){const i=this.bbox??t;if(isNaN(i.x)||isNaN(i.y))return;if(this._cache!=null&&this._cache.ctx===n&&this._cache.bbox.equals(i))return this._cache.gradient;const{stops:s,colorSpace:r}=this;if(s.length===0)return;if(s.length===1)return s[0].color;let a=this.createCanvasGradient(n,i,e);if(a==null)return;const c=r==="oklch",o=.05;let h=s[0];a.addColorStop(h.stop,h.color);for(let l=1;l<s.length;l+=1){const u=s[l];if(c){const d=new ColorScale;d.domain=[h.stop,u.stop],d.range=[h.color,u.color];for(let f=h.stop+o;f<u.stop;f+=o)a.addColorStop(f,d.convert(f))}a.addColorStop(u.stop,u.color),h=u}return"createPattern"in a&&(a=a.createPattern()),this._cache={ctx:n,bbox:i,gradient:a},a}toSvg(n){const t=this.bbox??n,e=this.createSvgGradient(t);return this.stops.forEach(({stop:i,color:s})=>{const r=(0,import_ag_charts_core9.createSvgElement)("stop");r.setAttribute("offset",`${i}`),r.setAttribute("stop-color",`${s}`),e.appendChild(r)}),e}},ConicGradient=class extends Gradient{constructor(n,t,e=0,i){super(n,t,i),this.angle=e}createCanvasGradient(n,t,e){const{angle:s}=this,r=normalizeAngle360FromDegrees(s+-90),a=e?.centerX??t.x+t.width*.5,c=e?.centerY??t.y+t.height*.5;return n.createConicGradient(r,a,c)}createSvgGradient(n){return(0,import_ag_charts_core10.createSvgElement)("linearGradient")}},import_ag_charts_core11=require("ag-charts-core"),LinearGradient=class extends Gradient{constructor(n,t,e=0,i){super(n,t,i),this.angle=e}getGradientPoints(n){const{angle:e}=this,i=normalizeAngle360FromDegrees(e+90),s=Math.cos(i),r=Math.sin(i),a=n.width,c=n.height,o=n.x+a*.5,h=n.y+c*.5,l=Math.sqrt(c*c+a*a)/2,u=Math.atan2(c,a);let d;i<Math.PI/2?d=i:i<Math.PI?d=Math.PI-i:i<1.5*Math.PI?d=i-Math.PI:d=2*Math.PI-i;const f=l*Math.abs(Math.cos(d-u));return{x0:o+s*f,y0:h+r*f,x1:o-s*f,y1:h-r*f}}createCanvasGradient(n,t){const{x0:e,y0:i,x1:s,y1:r}=this.getGradientPoints(t);if(!(isNaN(e)||isNaN(i)||isNaN(s)||isNaN(r)))return n.createLinearGradient(e,i,s,r)}createSvgGradient(n){const{x0:t,y0:e,x1:i,y1:s}=this.getGradientPoints(n),r=(0,import_ag_charts_core11.createSvgElement)("linearGradient");return r.setAttribute("x1",String(t)),r.setAttribute("y1",String(e)),r.setAttribute("x2",String(i)),r.setAttribute("y2",String(s)),r.setAttribute("gradientUnits","userSpaceOnUse"),r}},import_ag_charts_core12=require("ag-charts-core"),RadialGradient=class extends Gradient{constructor(n,t,e){super(n,t,e)}createCanvasGradient(n,t,e){const i=e?.centerX??t.x+t.width*.5,s=e?.centerY??t.y+t.height*.5,r=e?.innerRadius??0,a=e?.outerRadius??Math.hypot(t.width*.5,t.height*.5)/Math.SQRT2;return n.createRadialGradient(i,s,r,i,s,a)}createSvgGradient(n){const t=n.x+n.width*.5,e=n.y+n.height*.5,i=(0,import_ag_charts_core12.createSvgElement)("radialGradient");return i.setAttribute("cx",String(t)),i.setAttribute("cy",String(e)),i.setAttribute("r",String(Math.hypot(n.width*.5,n.height*.5)/Math.SQRT2)),i.setAttribute("gradientUnits","userSpaceOnUse"),i}},import_ag_charts_core14=require("ag-charts-core"),import_ag_charts_core13=require("ag-charts-core"),Property=addFakeTransformToInstanceProperty,BaseProperties=class{handleUnknownProperties(n,t){}set(n){const{className:t=this.constructor.name}=this.constructor;if(typeof n!="object")return import_ag_charts_core13.Logger.warn(`unable to set ${t} - expecting a properties object`),this;const e=new Set(Object.keys(n));for(const i of listDecoratedProperties(this))if(e.has(i)){const s=n[i],r=this;if(isProperties(r[i]))if(r[i]instanceof PropertiesArray){const a=r[i].reset(s);a!=null?r[i]=a:import_ag_charts_core13.Logger.warn(`unable to set [${i}] - expecting a properties array`)}else r[i].set(s);else(0,import_ag_charts_core13.isPlainObject)(s)?r[i]=merge(s,r[i]??{}):r[i]=s;e.delete(i)}this.handleUnknownProperties(e,n);for(const i of e)import_ag_charts_core13.Logger.warn(`unable to set [${i}] in ${t} - property is unknown`);return this}toJson(){return listDecoratedProperties(this).reduce((n,t)=>{const e=this[t];return n[t]=isProperties(e)?e.toJson():e,n},{})}},PropertiesArray=class rt extends Array{constructor(t,...e){super(e.length);const s=(r=>!!r?.prototype?.constructor?.name)(t)?r=>new t().set(r):t;Object.defineProperty(this,"itemFactory",{value:s,enumerable:!1,configurable:!1}),this.set(e)}set(t){if((0,import_ag_charts_core13.isArray)(t)){this.length=t.length;for(let e=0;e<t.length;e++)this[e]=this.itemFactory(t[e])}return this}reset(t){if(Array.isArray(t))return new rt(this.itemFactory,...t)}toJson(){return this.map(t=>t?.toJson?.()??t)}};function isProperties(n){return n instanceof BaseProperties||n 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(n){let t;for(const e of n)if(e?.stop!=null){if(t!=null&&e.stop<t)return!1;t=e.stop}return!0}function discreteColorStops(n){return n.flatMap((t,e)=>{const{stop:i}=t,s=n.at(e+1)?.color;return s!=null?[t,{stop:i,color:s}]:[t]})}function getDefaultColorStops(n,t){const e=t==="discrete"?1:0,i=n.map((s,r,{length:a})=>({stop:(r+e)/(a-1+e),color:s}));return t==="discrete"?discreteColorStops(i):i}function getColorStops(n,t,e,i="continuous"){const s=n.map(p=>typeof p=="string"?{color:p}:p);if(s.length===0)return getDefaultColorStops(t,i);if(!stopsAreAscending(s))return import_ag_charts_core14.Logger.warnOnce("[fills] must have the stops defined in ascending order"),[];const r=Math.min(...e),a=Math.max(...e),c=i==="discrete",o=new Float64Array(s.length);let h=0,l=-1;for(let p=0;p<s.length;p+=1){const m=s[p];if(p>=l){l=s.length-1;for(let y=p+1;y<s.length;y+=1)if(s[y]?.stop!=null){l=y;break}}let g=m?.stop;if(g==null){const y=s[h]?.stop,v=s[l]?.stop,w=y??r,C=v??a,x=c&&y==null?1:0;g=w+(C-w)*(p-h+x)/(l-h+x)}else h=p;o[p]=Math.max(0,Math.min(1,(g-r)/(a-r)))}let u=s.find(p=>p.color!=null)?.color,d;const f=s.map((p,m)=>{let g=p?.color;const y=o[m];return g!=null?u=g:u!=null?g=u:(d==null&&(d=new ColorScale,d.domain=[0,1],d.range=t),g=d.convert(y)),{stop:y,color:g}});return i==="discrete"?discreteColorStops(f):f}var import_ag_charts_core15=require("ag-charts-core"),Image2=class{constructor(n,t){this.imageLoader=n,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(n,t,e,i){if(!t)return null;const[s,r]=this.getSize(t.width,t.height,e,i);return s<1||r<1?(import_ag_charts_core15.Logger.warnOnce("Image fill is too small to render, ignoring."),null):n.createPattern(t,this.repeat)}getSize(n,t,e,i){const{fit:s}=this;let r=n,a=t,c=1;const o=e/i,h=n/t;return s==="stretch"||n===0||t===0?(r=e,a=i):s==="contain"?c=h>o?e/n:i/t:s==="cover"&&(c=h>o?i/t:e/n),[Math.max(1,r*c),Math.max(1,a*c)]}setImageTransform(n,t){if(typeof n=="string")return;const{url:e,rotation:i,width:s,height:r}=this,a=this.imageLoader?.loadImage(e);if(!a)return;const c=normalizeAngle360FromDegrees(i),o=Math.cos(c),h=Math.sin(c),[l,u]=this.getSize(a.width,a.height,s??t.width,r??t.height),d=l/a.width,f=u/a.height,p=t.x+t.width/2,m=t.y+t.height/2,g=o*l-h*u,y=h*l+o*u,v=g/2,w=y/2;n?.setTransform(new DOMMatrix([o*d,h*f,-h*d,o*f,p-v,m-w]))}createPattern(n,t,e,i){const s=this.width??t,r=this.height??e,a=this._cache;if(a!=null&&a.ctx===n&&a.width===s&&a.height===r)return a.pattern;const c=this.imageLoader?.loadImage(this.url,i),o=this.createCanvasImage(n,c,s,r);return o==null?this.backgroundFill:(this._cache={ctx:n,pattern:o,width:s,height:r},o)}toSvg(n,t){const{url:e,rotation:i,backgroundFill:s,backgroundFillOpacity:r}=this,{x:a,y:c,width:o,height:h}=n,l=(0,import_ag_charts_core15.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 u=(0,import_ag_charts_core15.createSvgElement)("rect");u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(o)),u.setAttribute("height",String(h)),u.setAttribute("fill",s),u.setAttribute("fill-opacity",String(r)),l.appendChild(u);const d=(0,import_ag_charts_core15.createSvgElement)("image");return d.setAttribute("href",e),d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("width",String(o)),d.setAttribute("height",String(h)),d.setAttribute("preserveAspectRatio","none"),d.setAttribute("transform",`scale(${1/t}) rotate(${i}, ${o/2}, ${h/2})`),l.appendChild(d),l}},import_ag_charts_core19=require("ag-charts-core"),import_ag_charts_core16=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(n){if(!n)return;const t=[];let e=0,i;for(;e<n.length;){const s=commandEx.exec(n.slice(e));let r;if(s==null){if(!i){import_ag_charts_core16.Logger.warnOnce(`Invalid SVG path, error at index ${e}: Missing command.`);return}r=i}else r=s[1],e+=s[0].length;const a=parseSegment(r,n,e);if(!a)return;e=a[0],i=r,t.push(a[1])}return t}function parseSegment(n,t,e){const i=pathParams[n.toLocaleLowerCase()],s={command:n,params:[]};for(const r of i){const a=t.slice(e),c=r.exec(a);if(c!=null){s.params.push(parseFloat(c[0])),e+=c[0].length;const o=commaEx.exec(a.slice(c[0].length));o!=null&&(e+=o[0].length)}else{if(s.params.length===1)return[e,s];import_ag_charts_core16.Logger.warnOnce(`Invalid SVG path, error at index ${e}: No path segment parameters for command [${n}]`);return}}return[e,s]}var import_ag_charts_core17=require("ag-charts-core"),LONG_TIME_PERIOD_THRESHOLD=2e3,timeOfLastLog=Date.now(),logTimeGap=()=>{const n=Date.now()-timeOfLastLog;if(n>LONG_TIME_PERIOD_THRESHOLD){const t=(Math.floor(n/100)/10).toFixed(1);import_ag_charts_core17.Logger.log(`**** ${t}s since last log message ****`)}timeOfLastLog=Date.now()},Debug={create(...n){return Object.assign((...e)=>{Debug.check(...n)&&(typeof e[0]=="function"&&(e=(0,import_ag_charts_core17.toArray)(e[0]())),logTimeGap(),import_ag_charts_core17.Logger.log(...e))},{check:()=>Debug.check(...n),group:(e,i)=>Debug.check(...n)?import_ag_charts_core17.Logger.logGroup(e,i):i()})},check(...n){return n.length===0&&n.push(!0),(0,import_ag_charts_core17.toArray)((0,import_ag_charts_core17.getWindow)("agChartsDebug")).some(e=>n.includes(e))},inDevelopmentMode(n){if(Debug.check("dev"))return n()}};function clearContext({context:n,pixelRatio:t,width:e,height:i}){n.save(),n.resetTransform(),n.clearRect(0,0,Math.ceil(e*t),Math.ceil(i*t)),n.restore()}function debugContext(n){if(Debug.check("canvas")){const t=n.save.bind(n),e=n.restore.bind(n);let i=0;Object.assign(n,{save(){t(),i++},restore(){if(i===0)throw new Error("AG Charts - Unable to restore() past depth 0");e(),i--},verifyDepthZero(){if(i!==0)throw new Error(`AG Charts - Save/restore depth is non-zero: ${i}`)}})}}function canvasDimensions(n,t,e){return[Math.floor(n*e),Math.floor(t*e)]}var HdpiOffscreenCanvas=class{constructor(n){const{width:t,height:e,pixelRatio:i,willReadFrequently:s=!1}=n;this.width=t,this.height=e,this.pixelRatio=i;const[r,a]=canvasDimensions(t,e,i);this.canvas=new OffscreenCanvas(r,a),this.context=this.canvas.getContext("2d",{willReadFrequently:s}),this.context.setTransform(i,0,0,i,0,0),debugContext(this.context)}drawImage(n,t=0,e=0){return n.drawImage(this.canvas,t,e)}transferToImageBitmap(){return this.canvas.transferToImageBitmap()}resize(n,t,e){if(!(n>0&&t>0))return;const{canvas:i,context:s}=this;if(n!==this.width||t!==this.height||e!==this.pixelRatio){const[r,a]=canvasDimensions(n,t,e);i.width=r,i.height=a}s.setTransform(e,0,0,e,0,0),this.width=n,this.height=t,this.pixelRatio=e}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");function pointsDistanceSquared(n,t,e,i){const s=n-e,r=t-i;return s*s+r*r}function lineDistanceSquared(n,t,e,i,s,r,a){if(e===s&&i===r)return Math.min(a,pointsDistanceSquared(n,t,e,i));const c=s-e,o=r-i,h=Math.max(0,Math.min(1,((n-e)*c+(t-i)*o)/(c*c+o*o))),l=e+h*c,u=i+h*o;return Math.min(a,pointsDistanceSquared(n,t,l,u))}function arcDistanceSquared(n,t,e,i,s,r,a,c,o){c&&([a,r]=[r,a]);const h=Math.atan2(t-i,n-e);if(!isBetweenAngles(h,r,a)){const u=e+Math.cos(r)*s,d=i+Math.sin(r)*s,f=e+Math.cos(r)*s,p=i+Math.sin(r)*s;return Math.min(o,pointsDistanceSquared(n,t,u,d),pointsDistanceSquared(n,t,f,p))}const l=s-Math.sqrt(pointsDistanceSquared(n,t,e,i));return Math.min(o,l*l)}function linearRoot(n,t){const e=-t/n;return n!==0&&e>=0&&e<=1?[e]:[]}function quadraticRoots(n,t,e){if(n===0)return linearRoot(t,e);const i=t*t-4*n*e,s=[];if(i===0){const r=-t/(2*n);r>=0&&r<=1&&s.push(r)}else if(i>0){const r=Math.sqrt(i),a=(-t-r)/(2*n),c=(-t+r)/(2*n);a>=0&&a<=1&&s.push(a),c>=0&&c<=1&&s.push(c)}return s}function cubicRoots(n,t,e,i){if(n===0)return quadraticRoots(t,e,i);const s=t/n,r=e/n,a=i/n,c=(3*r-s*s)/9,o=(9*s*r-27*a-2*s*s*s)/54,h=c*c*c+o*o,l=1/3,u=[];if(h>=0){const d=Math.sqrt(h),f=Math.sign(o+d)*Math.pow(Math.abs(o+d),l),p=Math.sign(o-d)*Math.pow(Math.abs(o-d),l),m=Math.abs(Math.sqrt(3)*(f-p)/2),g=-l*s+(f+p);if(g>=0&&g<=1&&u.push(g),m===0){const y=-l*s-(f+p)/2;y>=0&&y<=1&&u.push(y)}}else{const d=Math.acos(o/Math.sqrt(-c*c*c)),f=l*s,p=2*Math.sqrt(-c),m=p*Math.cos(l*d)-f,g=p*Math.cos(l*(d+2*Math.PI))-f,y=p*Math.cos(l*(d+4*Math.PI))-f;m>=0&&m<=1&&u.push(m),g>=0&&g<=1&&u.push(g),y>=0&&y<=1&&u.push(y)}return u}function segmentIntersection(n,t,e,i,s,r,a,c){const o=(e-n)*(c-r)-(i-t)*(a-s);if(o===0)return 0;const h=((a-s)*(t-r)-(n-s)*(c-r))/o,l=((e-n)*(t-r)-(i-t)*(n-s))/o;return h>=0&&h<=1&&l>=0&&l<=1?1:0}function cubicSegmentIntersections(n,t,e,i,s,r,a,c,o,h,l,u){let d=0;const f=h-u,p=l-o,m=o*(u-h)-h*(l-o),g=bezierCoefficients(n,e,s,a),y=bezierCoefficients(t,i,r,c),v=f*g[0]+p*y[0],w=f*g[1]+p*y[1],C=f*g[2]+p*y[2],x=f*g[3]+p*y[3]+m,S=cubicRoots(v,w,C,x);for(const M of S){const b=M*M,P=M*b,A=g[0]*P+g[1]*b+g[2]*M+g[3],F=y[0]*P+y[1]*b+y[2]*M+y[3];let D;o===l?D=(F-h)/(u-h):D=(A-o)/(l-o),D>=0&&D<=1&&d++}return d}function bezierCoefficients(n,t,e,i){return[-n+3*t-3*e+i,3*n-6*t+3*e,-3*n+3*t,n]}function arcIntersections(n,t,e,i,s,r,a,c,o,h){if(isNaN(n)||isNaN(t))return 0;r&&([s,i]=[i,s]);const l=(h-c)/(o-a),u=c-l*a,d=Math.pow(l,2)+1,f=2*(l*(u-t)-n),p=Math.pow(n,2)+Math.pow(u-t,2)-Math.pow(e,2),m=Math.pow(f,2)-4*d*p;if(m<0)return 0;const g=(-f+Math.sqrt(m))/2/d,y=(-f-Math.sqrt(m))/2/d;let v=0;return[g,y].forEach(w=>{if(!(w>=Math.min(a,o)&&w<=Math.max(a,o)))return;const x=l*w+u,S=w-n,M=x-t,b=Math.atan2(M,S);isBetweenAngles(b,i,s)&&v++}),v}function evaluateBezier(n,t,e,i,s){return(1-s)**3*n+3*(1-s)**2*s*t+3*(1-s)*s**2*e+s**3*i}function calculateDerivativeExtrema(n,t,e,i){const s=-n+3*t-3*e+i,r=2*(n-2*t+e),a=-n+t;if(s===0){if(r!==0){const o=-a/r;if(o>0&&o<1)return[o]}return[]}const c=r*r-4*s*a;if(c>=0){const o=Math.sqrt(c),h=(-r+o)/(2*s),l=(-r-o)/(2*s);return[h,l].filter(u=>u>0&&u<1)}return[]}function calculateDerivativeExtremaXY(n,t,e,i,s,r,a,c){const o=calculateDerivativeExtrema(n,e,s,a),h=calculateDerivativeExtrema(t,i,r,c);return[...o,...h]}var ExtendedPath2D=class{constructor(){this.path2d=new Path2D,this.previousCommands=[],this.previousParams=[],this.previousClosedPath=!1,this.commands=[],this.params=[],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(n,t){this.openedPath=!0,this.path2d.moveTo(n,t),this.commands.push(0),this.params.push(n,t)}lineTo(n,t){this.openedPath?(this.path2d.lineTo(n,t),this.commands.push(1),this.params.push(n,t)):this.moveTo(n,t)}rect(n,t,e,i){this.moveTo(n,t),this.lineTo(n+e,t),this.lineTo(n+e,t+i),this.lineTo(n,t+i),this.closePath()}appendSvg(n){let t=0,e=0,i,s,r=0,a=0;for(const{command:c,params:o}of n){i??(i=o[0]),s??(s=o[1]);const h=c===c.toLowerCase(),l=h?i:0,u=h?s:0;switch(c.toLowerCase()){case"m":this.moveTo(l+o[0],u+o[1]),i=l+o[0],s=u+o[1],t=i,e=s;break;case"c":this.cubicCurveTo(l+o[0],u+o[1],l+o[2],u+o[3],l+o[4],u+o[5]),r=l+o[2],a=u+o[3],i=l+o[4],s=u+o[5];break;case"s":this.cubicCurveTo(i+i-r,s+s-a,l+o[0],u+o[1],l+o[2],u+o[3]),r=l+o[0],a=u+o[1],i=l+o[2],s=u+o[3];break;case"q":this.cubicCurveTo((l+2*o[0])/3,(u+2*o[1])/3,(2*o[0]+o[2])/3,(2*o[1]+o[3])/3,o[2],o[3]),r=o[0],a=o[1],i=o[2],s=o[3];break;case"t":this.cubicCurveTo((i+2*(i+i-r))/3,(s+2*(s+s-a))/3,(2*(i+i-r)+o[0])/3,(2*(s+s-a)+o[1])/3,o[0],o[1]),r=i+i-r,a=s+s-a,i=o[0],s=o[1];break;case"a":this.ellipse(i,s,o[0],o[1],o[2]*Math.PI/180,o[3],o[4],l+o[5],u+o[6]),i=l+o[5],s=u+o[6];break;case"h":this.lineTo(l+o[0],s),i=l+o[0];break;case"l":this.lineTo(l+o[0],u+o[1]),i=l+o[0],s=u+o[1];break;case"v":this.lineTo(i,u+o[0]),s=u+o[0];break;case"z":this.closePath(),i=t,s=e;break;default:throw new Error(`Could not translate command '${c}' with '${o.join(" ")}'`)}}}ellipse(n,t,e,i,s,r,a,c,o){e=Math.abs(e),i=Math.abs(i);const h=(n-c)/2,l=(t-o)/2,u=Math.sin(s),d=Math.cos(s),f=d*h+u*l,p=-u*h+d*l,m=f/e,g=p/i;let y=m*m+g*g,v=(n+c)/2,w=(t+o)/2,C=0,x=0;y>=1?(y=Math.sqrt(y),e*=y,i*=y):(y=Math.sqrt(1/y-1),r===a&&(y=-y),C=y*e*g,x=-y*i*m,v+=d*C-u*x,w+=u*C+d*x);const S=Math.atan2((p-x)/i,(f-C)/e),M=Math.atan2((-p-x)/i,(-f-C)/e)-S,b=S+M,P=!!(1-a);this.ellipticalArc(v,w,e,i,s,S,b,P)}ellipticalArc(n,t,e,i,s,r,a,c){c&&([r,a]=[a,r]);const o=[],h=.5522847498307935,l=Math.sin(r),u=Math.cos(r),d=Math.sin(s),f=Math.cos(s);let p=f*u*e-d*l*i,m=d*u*e+f*l*i,g=-f*l*e-d*u*i,y=-d*l*e+f*u*i;o.push(p+n,m+t),a-=r,a=normalizeAngle360(a);const v=Math.PI/2,w=Math.floor(a/v),C=a%v;for(let x=0;x<w;x++)o.push(p+g*h+n,m+y*h+t,p*h+g+n,m*h+y+t,g+n,y+t),[p,g]=[g,-p],[m,y]=[y,-m];if(C>0){const x=Math.sin(C),S=Math.cos(C),M=Math.tan(C/4)*(4/3),b=S+M*x,P=x-M*S;o.push(p+g*M+n,m+y*M+t,p*b+g*P+n,m*b+y*P+t,p*S+g*x+n,m*S+y*x+t)}if(c)for(let x=0,S=o.length-2;x<S;x+=2,S-=2)[o[x],o[S]]=[o[S],o[x]],[o[x+1],o[S+1]]=[o[S+1],o[x+1]];for(let x=2;x<o.length;x+=6){const[S,M,b,P,A,F]=o.slice(x,x+6);this.cubicCurveTo(S,M,b,P,A,F)}}roundRect(n,t,e,i,s){s=Math.min(s,e/2,i/2),this.moveTo(n,t+s),this.arc(n+s,t+s,s,Math.PI,1.5*Math.PI),this.lineTo(n+s,t),this.lineTo(n+e-s,t),this.arc(n+e-s,t+s,s,1.5*Math.PI,2*Math.PI),this.lineTo(n+e,t+s),this.lineTo(n+e,t+i-s),this.arc(n+e-s,t+i-s,s,0,Math.PI/2),this.lineTo(n+e-s,t+i),this.lineTo(n+s,t+i),this.arc(n+ +s,t+i-s,s,Math.PI/2,Math.PI),this.lineTo(n,t+i-s),this.closePath()}arc(n,t,e,i,s,r){this.openedPath=!0,this.path2d.arc(n,t,e,i,s,r),this.commands.push(2),this.params.push(n,t,e,i,s,r?1:0)}cubicCurveTo(n,t,e,i,s,r){this.openedPath||this.moveTo(n,t),this.path2d.bezierCurveTo(n,t,e,i,s,r),this.commands.push(3),this.params.push(n,t,e,i,s,r)}closePath(){this.openedPath&&(this.path2d.closePath(),this.commands.push(4),this.openedPath=!1,this.closedPath=!0)}clear(n){n&&(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(n,t){const e=this.commands,i=this.params,s=e.length,r=-1e4,a=-1e4;let c=NaN,o=NaN,h=0,l=0,u=0;for(let d=0,f=0;d<s;d++)switch(e[d]){case 0:u+=segmentIntersection(c,o,h,l,r,a,n,t),h=i[f++],c=h,l=i[f++],o=l;break;case 1:u+=segmentIntersection(h,l,i[f++],i[f++],r,a,n,t),h=i[f-2],l=i[f-1];break;case 3:u+=cubicSegmentIntersections(h,l,i[f++],i[f++],i[f++],i[f++],i[f++],i[f++],r,a,n,t),h=i[f-2],l=i[f-1];break;case 2:{const p=i[f++],m=i[f++],g=i[f++],y=i[f++],v=i[f++],w=!!i[f++];if(u+=arcIntersections(p,m,g,y,v,w,r,a,n,t),!isNaN(c)){const C=p+Math.cos(y)*g,x=m+Math.sin(y)*g;u+=segmentIntersection(h,l,C,x,r,a,n,t)}h=p+Math.cos(v)*g,l=m+Math.sin(v)*g;break}case 4:u+=segmentIntersection(c,o,h,l,r,a,n,t);break}return u%2===1}distanceSquared(n,t){let e=1/0;const i=this.commands,s=this.params,r=i.length;let a=NaN,c=NaN,o=0,h=0;for(let l=0,u=0;l<r;l++)switch(i[l]){case 0:o=a=s[u++],h=c=s[u++];break;case 1:{const d=s[u++],f=s[u++];e=lineDistanceSquared(n,t,o,h,d,f,e);break}case 3:import_ag_charts_core18.Logger.error("Command.Curve distanceSquare not implemented");break;case 2:{const d=s[u++],f=s[u++],p=s[u++],m=s[u++],g=s[u++],y=d+Math.cos(m)*p,v=f+Math.sin(m)*p,w=!!s[u++];e=lineDistanceSquared(n,t,o,h,y,v,e),e=arcDistanceSquared(n,t,d,f,p,m,g,w,e),o=d+Math.cos(g)*p,h=f+Math.sin(g)*p;break}case 4:e=lineDistanceSquared(n,t,o,h,a,c,e);break}return e}toSVG(n=(t,e)=>({x:t,y:e})){const t=[],{commands:e,params:i}=this,s=(a,...c)=>{t.push(a);for(let o=0;o<c.length;o+=2){const{x:h,y:l}=n(c[o],c[o+1]);t.push(h,l)}};let r=0;for(const a of e)switch(a){case 0:s("M",i[r++],i[r++]);break;case 1:s("L",i[r++],i[r++]);break;case 3:s("C",i[r++],i[r++],i[r++],i[r++],i[r++],i[r++]);break;case 2:{const c=i[r++],o=i[r++],h=i[r++],l=i[r++],u=i[r++],d=i[r++];let f=d?l-u:u-l;f<0&&(f+=Math.ceil(-f/(2*Math.PI))*2*Math.PI),d&&(f=-f);const p=Math.max(Math.ceil(Math.abs(f)/(Math.PI/2)),1),m=f/p,g=4/3*Math.tan(m/4),y=t.length===0?"M":"L";s(y,c+Math.cos(l)*h,o+Math.sin(l)*h);for(let v=0;v<p;v+=1){const w=l+m*(v+0),C=l+m*(v+1),x=h*Math.sin(w),S=h*Math.cos(w),M=h*Math.sin(C),b=h*Math.cos(C);s("C",c+S-g*x,o+x+g*S,c+b+g*M,o+M-g*b,c+b,o+M)}break}case 4:t.push("Z");break}return t.join(" ")}computeBBox(){const{commands:n,params:t}=this;let[e,i,s,r]=[1/0,1/0,-1/0,-1/0],[a,c]=[NaN,NaN],[o,h]=[NaN,NaN];const l=(f,p,m)=>{e=Math.min(p,e),i=Math.min(f,i),s=Math.max(f,s),r=Math.max(p,r),m&&([a,c]=[f,p])},u=(f,p,m,g,y)=>{const v=f+m*Math.cos(g),w=p+m*Math.sin(g);l(v,w,y)};let d=0;for(const f of n)switch(f){case 0:l(t[d++],t[d++],!0),[o,h]=[a,c];break;case 1:l(t[d++],t[d++],!0);break;case 3:{const p=t[d++],m=t[d++],g=t[d++],y=t[d++],v=t[d++],w=t[d++];calculateDerivativeExtremaXY(a,c,p,m,g,y,v,w).forEach(x=>{const S=evaluateBezier(a,p,g,v,x),M=evaluateBezier(c,m,y,w,x);l(S,M)}),l(v,w,!0);break}case 2:{const p=t[d++],m=t[d++],g=t[d++],y=normalizeAngle360(t[d++]),v=normalizeAngle360(t[d++]),w=t[d++];u(p,m,g,y);const C=[0,Math.PI/2,Math.PI,3*Math.PI/2],[x,S]=w?[v,y]:[y,v];for(const M of C)(x<S&&x<=M&&M<=S||x>S&&(x<=M||M<=S))&&u(p,m,g,M);u(p,m,g,v,!0);break}case 4:[a,c]=[o,h];break}return new BBox(i,e,s-i,r-e)}};function align(n,t,e){const i=Math.round(t*n)/n;return e==null?i:e===0?0:e<1?Math.ceil(e*n)/n:Math.round((e+t)*n)/n-i}function alignBefore(n,t){return Math.floor(t*n)/n}function drawPatternUnitPolygon(n,t,e){const{width:i,height:s,padding:r,strokeWidth:a}=t,c=i/2,o=s/2,h=Math.max(1,i-r-a/2),l=Math.max(1,s-r-a/2);let u=!1;for(const[d,f]of e){const p=c+(d-.5)*h,m=o+(f-.5)*l;u?n.lineTo(p,m):n.moveTo(p,m),u=!0}n.closePath()}var PATTERNS={circles(n,{width:t,strokeWidth:e,padding:i}){const s=t/2,r=Math.max(1,s-i-e/2);n.arc(s,s,r,0,Math.PI*2)},squares(n,{width:t,height:e,pixelRatio:i,padding:s,strokeWidth:r}){const a=s+r/2;n.moveTo(align(i,a),align(i,a)),n.lineTo(align(i,t-a),align(i,a)),n.lineTo(align(i,t-a),align(i,e-a)),n.lineTo(align(i,a),align(i,e-a)),n.closePath()},triangles(n,t){drawPatternUnitPolygon(n,t,[[.5,0],[1,1],[0,1]])},diamonds(n,t){drawPatternUnitPolygon(n,t,[[.5,0],[1,.5],[.5,1],[0,.5]])},stars(n,{width:t,height:e,padding:i}){const r=Math.max(1,(t-i)/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,u=t/2+Math.cos(l)*h,d=e/2+Math.sin(l)*h;n.lineTo(u,d)}n.closePath()},hearts(n,{width:t,height:e,padding:i}){const s=Math.max(1,t/4-i/2),r=t/2,a=e/2+s/2;n.arc(r-s,a-s,s,toRadians(130),toRadians(330)),n.arc(r+s,a-s,s,toRadians(220),toRadians(50)),n.lineTo(r,a+s),n.closePath()},crosses(n,t){drawPatternUnitPolygon(n,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"(n,{width:t,height:e,pixelRatio:i,strokeWidth:s}){const r=align(i,t/2)-s%2/2;n.moveTo(r,0),n.lineTo(r,e)},"horizontal-lines"(n,{width:t,height:e,pixelRatio:i,strokeWidth:s}){const r=align(i,e/2)-s%2/2;n.moveTo(0,r),n.lineTo(t,r)},"forward-slanted-lines"(n,{width:t,height:e,strokeWidth:i}){const s=Math.atan2(e,t),r=i*Math.cos(s),a=i*Math.sin(s);n.moveTo(-r,a),n.lineTo(r,-a),n.moveTo(-r,e+a),n.lineTo(t+r,-a),n.moveTo(t-r,e+a),n.lineTo(t+r,e-a)},"backward-slanted-lines"(n,{width:t,height:e,strokeWidth:i}){const s=Math.atan2(e,t),r=i*Math.cos(s),a=i*Math.sin(s);n.moveTo(t-r,-a),n.lineTo(t+r,a),n.moveTo(-r,-a),n.lineTo(t+r,e+a),n.moveTo(-r,e-a),n.lineTo(r,e+a)}},Pattern=class{constructor(n){this._cache=void 0,this.width=Math.max(n?.width??10,1),this.height=Math.max(n?.height??10,1),this.fill=n.fill??"none",this.fillOpacity=n.fillOpacity??1,this.backgroundFill=n.backgroundFill??"none",this.backgroundFillOpacity=n.backgroundFillOpacity??1,this.stroke=n.stroke??"black",this.strokeOpacity=n.strokeOpacity??1,this.strokeWidth=n.strokeWidth??1,this.padding=n.padding??1,this.pattern=n.pattern??"forward-slanted-lines",this.rotation=n.rotation??0,this.scale=n.scale??1,this.path=n.path}getPath(n){const{pattern:t,width:e,height:i,padding:s,strokeWidth:r,path:a}=this,c=new ExtendedPath2D,o=parseSvg(a);return o?c.appendSvg(o):PATTERNS[t](c,{width:e,height:i,pixelRatio:n,strokeWidth:r,padding:s}),c}renderStroke(n,t){const{stroke:e,strokeWidth:i,strokeOpacity:s}=this;i&&(t.strokeStyle=e,t.lineWidth=i,t.globalAlpha=s,t.stroke(n))}renderFill(n,t){const{fill:e,fillOpacity:i}=this;e!=="none"&&(t.fillStyle=e,t.globalAlpha=i,t.fill(n))}createCanvasPattern(n,t){const{width:e,height:i,scale:s,backgroundFill:r,backgroundFillOpacity:a}=this;if(e*s<1||i*s<1)return import_ag_charts_core19.Logger.warnOnce("Pattern fill is too small to render, ignoring."),null;const c=new HdpiOffscreenCanvas({width:e,height:i,pixelRatio:t*s}),o=c.context;r!=="none"&&(o.fillStyle=r,o.globalAlpha=a,o.fillRect(0,0,e,i));const h=this.getPath(t).getPath2D();this.renderFill(h,o),this.renderStroke(h,o);const l=n.createPattern(c.canvas,"repeat");return this.setPatternTransform(l,t),c.destroy(),l}setPatternTransform(n,t,e=0,i=0){const s=normalizeAngle360FromDegrees(this.rotation),r=1/t,a=Math.cos(s)*r,c=Math.sin(s)*r;n?.setTransform(new DOMMatrix([a,c,-c,a,e,i]))}createPattern(n,t){if(this._cache!=null&&this._cache.ctx===n&&this._cache.pixelRatio===t)return this._cache.pattern;const e=this.createCanvasPattern(n,t);if(e!=null)return this._cache={ctx:n,pattern:e,pixelRatio:t},e}toSvg(){const{width:n,height:t,fill:e,fillOpacity:i,backgroundFill:s,backgroundFillOpacity:r,stroke:a,strokeWidth:c,strokeOpacity:o,rotation:h,scale:l}=this,u=(0,import_ag_charts_core19.createSvgElement)("pattern");u.setAttribute("viewBox",`0 0 ${n} ${t}`),u.setAttribute("width",String(n)),u.setAttribute("height",String(t)),u.setAttribute("patternUnits","userSpaceOnUse");const d=(0,import_ag_charts_core19.createSvgElement)("rect");d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("width",String(n)),d.setAttribute("height",String(t)),d.setAttribute("fill",s),d.setAttribute("fill-opacity",String(r)),u.appendChild(d);const f=(0,import_ag_charts_core19.createSvgElement)("path");return f.setAttribute("fill",e),f.setAttribute("fill-opacity",String(i)),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()),u.appendChild(f),u}},import_ag_charts_core20=require("ag-charts-core");function isGradientFill(n){return(0,import_ag_charts_core20.isObject)(n)&&n.type=="gradient"}function isPatternFill(n){return n!==null&&(0,import_ag_charts_core20.isObject)(n)&&n.type=="pattern"}function isImageFill(n){return n!==null&&(0,import_ag_charts_core20.isObject)(n)&&n.type=="image"}var _Shape=class N extends Node{constructor(){super(...arguments),this.fillOpacity=1,this.strokeOpacity=1,this.fill=N.defaultStyles.fill,this.stroke=N.defaultStyles.stroke,this.strokeWidth=N.defaultStyles.strokeWidth,this.lineDash=N.defaultStyles.lineDash,this.lineDashOffset=N.defaultStyles.lineDashOffset,this.lineCap=N.defaultStyles.lineCap,this.lineJoin=N.defaultStyles.lineJoin,this.miterLimit=void 0,this.opacity=N.defaultStyles.opacity,this.fillShadow=N.defaultStyles.fillShadow}restoreOwnStyles(){const{defaultStyles:t}=this.constructor;Object.assign(this,t)}getGradient(t){if(isGradientFill(t))return this.createGradient(t)}createGradient(t){const{colorSpace:e="rgb",gradient:i="linear",colorStops:s,rotation:r=0,reverse:a=!1}=t;if(s==null)return;let c=getColorStops(s,["black"],[0,1]);switch(a&&(c=c.map(o=>({color:o.color,stop:1-o.stop})).reverse()),i){case"linear":return new LinearGradient(e,c,r);case"radial":return new RadialGradient(e,c);case"conic":return new ConicGradient(e,c,r)}}getPattern(t){if(isPatternFill(t))return this.createPattern(t)}createPattern(t){return new Pattern(t)}getImage(t){if(isImageFill(t))return this.createImage(t)}createImage(t){return new Image2(this.imageLoader,t)}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(t,e){return align(this.layerManager?.canvas?.pixelRatio??1,t,e)}preRender(t,e){return this.dirty&&(this.cachedDefaultGradientFillBBox=void 0),super.preRender(t,e)}fillStroke(t,e){this.renderFill(t,e),this.renderStroke(t,e)}renderFill(t,e){const{fill:i,fillImage:s}=this;if(i&&i!=="none"){const{globalAlpha:r}=t;s&&(t.globalAlpha=s.backgroundFillOpacity,t.fillStyle=s.backgroundFill,this.executeFill(t,e),t.globalAlpha=r),this.applyFillAndAlpha(t),this.applyShadow(t),this.executeFill(t,e),t.globalAlpha=r}t.shadowColor="rgba(0, 0, 0, 0)"}executeFill(t,e){e?t.fill(e):t.fill()}applyFillAndAlpha(t){const{fill:e,fillGradient:i,fillPattern:s,fillImage:r,fillOpacity:a,opacity:c}=this;if(t.globalAlpha*=c*a,i){const{fillBBox:o=this.getDefaultGradientFillBBox()??this.getBBox(),fillParams:h}=this;t.fillStyle=i.createGradient(t,o,h)??"black"}else if(s){const{x:o,y:h}=this.getBBox(),l=this.layerManager?.canvas?.pixelRatio??1,u=s.createPattern(t,l);s.setPatternTransform(u,l,o,h),u?t.fillStyle=u:(t.fillStyle=s.fill,t.globalAlpha*=s.fillOpacity)}else if(r){const o=this.getBBox(),h=r.createPattern(t,o.width,o.height,this);r.setImageTransform(h,o),t.fillStyle=h??"transparent"}else t.fillStyle=typeof e=="string"?e:"black"}applyStrokeAndAlpha(t){const{stroke:e,strokeOpacity:i,strokeGradient:s,opacity:r}=this;t.strokeStyle=s?.createGradient(t,this.getBBox())??(typeof e=="string"?e:void 0)??"black",t.globalAlpha*=r*i}applyShadow(t){const e=this.layerManager?.canvas.pixelRatio??1,i=this.fillShadow;i?.enabled&&(t.shadowColor=i.color,t.shadowOffsetX=i.xOffset*e,t.shadowOffsetY=i.yOffset*e,t.shadowBlur=i.blur*e)}renderStroke(t,e){const{stroke:i,strokeWidth:s,lineDash:r,lineDashOffset:a,lineCap:c,lineJoin:o,miterLimit:h}=this;if(i&&s){const{globalAlpha:l}=t;this.applyStrokeAndAlpha(t),t.lineWidth=s,r&&t.setLineDash(r),a&&(t.lineDashOffset=a),c&&(t.lineCap=c),o&&(t.lineJoin=o),h!=null&&(t.miterLimit=h),this.executeStroke(t,e),t.globalAlpha=l}}executeStroke(t,e){e?t.stroke(e):t.stroke()}getDefaultGradientFillBBox(){return this.cachedDefaultGradientFillBBox==null&&(this.cachedDefaultGradientFillBBox=Object.freeze(this.computeDefaultGradientFillBBox())),this.cachedDefaultGradientFillBBox}computeDefaultGradientFillBBox(){}containsPoint(t,e){return this.isPointInPath(t,e)}applySvgFillAttributes(t,e){const{fill:i,fillOpacity:s}=this;if(typeof i=="string")t.setAttribute("fill",i);else if(isGradientFill(i)&&this.fillGradient){e??(e=[]);const r=this.fillGradient.toSvg(this.fillBBox??this.getBBox()),a=(0,import_ag_charts_core21.generateUUID)();r.setAttribute("id",a),e.push(r),t.setAttribute("fill",`url(#${a})`)}else if(isPatternFill(i)&&this.fillPattern){e??(e=[]);const r=this.fillPattern.toSvg(),a=(0,import_ag_charts_core21.generateUUID)();r.setAttribute("id",a),e.push(r),t.setAttribute("fill",`url(#${a})`)}else if(isImageFill(i)&&this.fillImage){e??(e=[]);const r=this.layerManager?.canvas?.pixelRatio??1,a=this.fillImage.toSvg(this.getBBox(),r),c=(0,import_ag_charts_core21.generateUUID)();a.setAttribute("id",c),e.push(a),t.setAttribute("fill",`url(#${c})`)}else t.setAttribute("fill","none");return t.setAttribute("fill-opacity",String(s)),e}applySvgStrokeAttributes(t){const{stroke:e,strokeOpacity:i,strokeWidth:s,lineDash:r,lineDashOffset:a}=this;if(e!=null&&(t.setAttribute("stroke",typeof e=="string"?e:"none"),t.setAttribute("stroke-opacity",String(i)),t.setAttribute("stroke-width",String(s))),r?.some(c=>c!==0)===!0){const c=r.length%2===1?[...r,...r]:r;t.setAttribute("stroke-dasharray",c.join(" ")),t.setAttribute("stroke-dashoffset",String(a))}}};_Shape.defaultStyles={fill:"black",stroke:void 0,strokeWidth:0,lineDash:void 0,lineDashOffset:0,lineCap:void 0,lineJoin:void 0,opacity:1,fillShadow:void 0},__decorateClass([SceneChangeDetection()],_Shape.prototype,"fillOpacity",2),__decorateClass([SceneChangeDetection()],_Shape.prototype,"strokeOpacity",2),__decorateClass([SceneObjectChangeDetection({equals:objectsEqual,changeCb:n=>n.onFillChange()})],_Shape.prototype,"fill",2),__decorateClass([SceneObjectChangeDetection({equals:objectsEqual,changeCb:n=>n.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:n=>(0,import_ag_charts_core21.clamp)(0,n,1)})],_Shape.prototype,"opacity",2),__decorateClass([SceneObjectChangeDetection({equals:TRIPLE_EQ,checkDirtyOnAssignment:!0})],_Shape.prototype,"fillShadow",2),__decorateClass([SceneObjectChangeDetection({equals:BBoxValues.equals,changeCb:n=>n.onFillChange()})],_Shape.prototype,"fillBBox",2),__decorateClass([SceneObjectChangeDetection({equals:objectsEqual,changeCb:n=>n.onFillChange()})],_Shape.prototype,"fillParams",2);var Shape=_Shape,_Text=class W extends Shape{constructor(){super(...arguments),this.x=0,this.y=0,this.lines=[],this.text=void 0,this.fontSize=10,this.fontFamily="sans-serif",this.textAlign=W.defaultStyles.textAlign,this.textBaseline=W.defaultStyles.textBaseline}onTextChange(){this.lines=this.text?.split(`
`).map(t=>t.trim())??[]}static computeBBox(t,e,i,s){const{offsetTop:r,offsetLeft:a,width:c,height:o}=CachedTextMeasurerPool.measureLines(t,s),h=s.lineHeight?s.lineHeight*t.length:o;return new BBox(e-a,i-r,c,h)}computeBBox(){const{x:t,y:e,lines:i,textBaseline:s,textAlign:r,lineHeight:a}=this;return W.computeBBox(i,t,e,{font:this,textBaseline:s,textAlign:r,lineHeight:a})}getTextMeasureBBox(){return this.computeBBox()}isPointInPath(t,e){const i=this.getBBox();return i?i.containsPoint(t,e):!1}render(t){const{ctx:e,stats:i}=t;if(!this.lines.length||!this.layerManager)return i&&(i.nodesSkipped+=1),super.render(t);const{fill:s,stroke:r,strokeWidth:a}=this,{globalAlpha:c}=e,{pixelRatio:o}=this.layerManager.canvas;if(!s&&!(r!=null&&a>0))return super.render(t);const h=TextUtils.toFontString(this);if(e.font!==h&&(e.font=h),e.textAlign=this.textAlign,e.textBaseline=this.textBaseline,s){this.applyFillAndAlpha(e);const{fillShadow:l}=this;l?.enabled&&(e.shadowColor=l.color,e.shadowOffsetX=l.xOffset*o,e.shadowOffsetY=l.yOffset*o,e.shadowBlur=l.blur*o),this.renderLines((u,d,f)=>e.fillText(u,d,f)),e.globalAlpha=c}if(r&&a){this.applyStrokeAndAlpha(e),e.lineWidth=a;const{lineDash:l,lineDashOffset:u,lineCap:d,lineJoin:f}=this;l&&e.setLineDash([...l]),u&&(e.lineDashOffset=u),d&&(e.lineCap=d),f&&(e.lineJoin=f),this.renderLines((p,m,g)=>e.strokeText(p,m,g)),e.globalAlpha=c}super.render(t)}renderLines(t){const{lines:e,x:i,y:s}=this,r=this.lineHeight??TextUtils.getLineHeight(this.fontSize);let a=(r-r*e.length)*TextUtils.getVerticalModifier(this.textBaseline);for(const c of e)t(c,i,s+a),a+=r}setFont(t){this.fontFamily=t.fontFamily,this.fontSize=t.fontSize,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_core22.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.defaultStyles={...Shape.defaultStyles,textAlign:"start",fontStyle:void 0,fontWeight:void 0,fontSize:10,fontFamily:"sans-serif",textBaseline:"alphabetic"},__decorateClass([SceneChangeDetection()],_Text.prototype,"x",2),__decorateClass([SceneChangeDetection()],_Text.prototype,"y",2),__decorateClass([SceneChangeDetection({convertor:n=>(0,import_ag_charts_core22.isDefined)(n)?String(n):n,changeCb:n=>n.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_core23=require("ag-charts-core");function ProxyPropertyOnWrite(n,t){return addTransformToInstanceProperty((e,i,s)=>e[n][t??i]=s)}function ObserveChanges(n){return addObserverToInstanceProperty(n)}var TextWrapper=class{static wrapText(n,t){return this.wrapLines(n,t).join(`
`)}static wrapLines(n,t){const e=this.textWrap(n,t);return t.overflow==="hide"&&e.some(i=>i.endsWith(TextUtils.EllipsisChar))?[]:e}static appendEllipsis(n){return n.replace(/[.,]{1,5}$/,"")+TextUtils.EllipsisChar}static truncateLine(n,t,e,i){const s=t.textWidth(TextUtils.EllipsisChar);let r=0,a=0;for(;a<n.length;a++){const c=t.textWidth(n.charAt(a));if(r+c>e)break;r+=c}if(n.length===a&&(!i||r+s<=e))return i?n+TextUtils.EllipsisChar:n;for(n=n.slice(0,a).trimEnd();n.length&&t.textWidth(n)+s>e;)n=n.slice(0,-1).trimEnd();return n+TextUtils.EllipsisChar}static textWrap(n,t){const e=n.split(TextUtils.lineSplitter),i=CachedTextMeasurerPool.getMeasurer(t);if(t.textWrap==="never")return e.map(c=>this.truncateLine(c.trimEnd(),i,t.maxWidth));const s=[],r=t.textWrap==="hyphenate",a=t.textWrap==null||t.textWrap==="on-space";for(const c of e){let o=c.trimEnd();if(o===""){s.push(o);continue}let h=0,l=0,u=0;for(;h<o.length;){const d=o.charAt(h);if(l+=i.textWidth(d),d===" "&&(u=h),l>t.maxWidth){if(h===0)break;const f=i.textWidth(o.slice(0,h+1));if(f<=t.maxWidth){l=f,h++;continue}if(u){const g=this.getWordAt(o,u+1),y=i.textWidth(g);if(y<=t.maxWidth){s.push(o.slice(0,u).trimEnd()),o=o.slice(u).trimStart(),h=0,l=0,u=0;continue}else a&&y>t.maxWidth&&s.push(o.slice(0,u).trimEnd(),this.truncateLine(o.slice(u).trimStart(),i,t.maxWidth,!0))}else a&&s.push(this.truncateLine(o,i,t.maxWidth,!0));if(a){o="";break}const p=r?"-":"";let m=o.slice(0,h).trim();for(;m.length&&i.textWidth(m+p)>t.maxWidth;)m=m.slice(0,-1).trimEnd();if(s.push(m+p),!m.length){o="";break}o=o.slice(m.length).trimStart(),h=-1,l=0,u=0}h++}o&&s.push(o)}return this.avoidOrphans(s,i,t),this.clipLines(s,i,t)}static getWordAt(n,t){const e=n.indexOf(" ",t);return e===-1?n.slice(t):n.slice(t,e)}static clipLines(n,t,e){if(!e.maxHeight)return n;const{height:i,lineMetrics:s}=t.measureLines(n);if(i<=e.maxHeight)return n;for(let r=0,a=0;r<s.length;r++){const{lineHeight:c}=s[r];if(a+=c,a>e.maxHeight){if(e.overflow==="hide")return[];const o=n.slice(0,r||1),h=o.pop();return o.concat(this.truncateLine(h,t,e.maxWidth,!0))}}return n}static avoidOrphans(n,t,e){if(e.avoidOrphans===!1||n.length<2)return;const{length:i}=n,s=n[i-1],r=n[i-2];if(r.length<s.length)return;const a=r.lastIndexOf(" ");if(a===-1||a===r.indexOf(" ")||s.includes(" "))return;const c=r.slice(a+1);t.textWidth(s+c)<=e.maxWidth&&(n[i-2]=r.slice(0,a),n[i-1]=c+" "+s)}},Caption=class extends BaseProperties{constructor(){super(...arguments),this.id=(0,import_ag_charts_core24.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(n,t){return n.layoutManager.addListener("layout:complete",()=>this.updateA11yText(n,t))}computeTextWrap(n,t){const{text:e,padding:i,wrapping:s}=this,r=Math.min(this.maxWidth??1/0,n)-i*2,a=this.maxHeight??t-i*2;if(!isFinite(r)&&!isFinite(a)){this.node.text=e;return}const c=TextWrapper.wrapText(e??"",{maxWidth:r,maxHeight:a,font:this,textWrap:s});this.node.text=c,this.truncated=c.includes(TextUtils.EllipsisChar)}updateA11yText(n,t){const{proxyInteractionService:e}=n;if(this.enabled&&this.text){const i=Transformable.toCanvas(this.node);if(i){const{id:s}=this;this.proxyText??(this.proxyText=e.createProxyElement({type:"text",domManagerId:s,where:t})),this.proxyText.textContent=this.text,this.proxyText.setBounds(i),this.proxyText.addListener("mousemove",r=>this.handleMouseMove(n,r)),this.proxyText.addListener("mouseleave",r=>this.handleMouseLeave(n,r))}}else this.proxyText?.destroy(),this.proxyText=void 0}handleMouseMove(n,t){if(t!=null&&this.enabled&&this.node.visible&&this.truncated){const{x:e,y:i}=Transformable.toCanvas(this.node),s=t.sourceEvent.offsetX+e,r=t.sourceEvent.offsetY+i;n.tooltipManager.updateTooltip(this.id,{canvasX:s,canvasY:r,showArrow:!1},[{type:"structured",title:this.text}])}}handleMouseLeave(n,t){n.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_core25=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(n){this._clipX=n,this.dirtyPath=!0}set clipY(n){this._clipY=n,this.dirtyPath=!0}set dirtyPath(n){this._dirtyPath!==n&&(this._dirtyPath=n,n&&this.markDirty("path"))}get dirtyPath(){return this._dirtyPath}checkPathDirty(){this._dirtyPath||(this.dirtyPath=this.path.isDirty()||(this.fillShadow?.isDirty()??!1)||(this._clipPath?.isDirty()??!1))}onChangeDetection(n){this._dirtyPath||(this._dirtyPath=!0,super.onChangeDetection(n))}computeBBox(){return this.updatePathIfDirty(),this.path.computeBBox()}isPointInPath(n,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(n,t)}distanceSquared(n,t){return this.distanceSquaredTransformedPoint(n,t)}svgPathData(n){return this.updatePathIfDirty(),this.path.toSVG(n)}distanceSquaredTransformedPoint(n,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(n,t)?0:this.path.distanceSquared(n,t)}isDirtyPath(){return!1}updatePath(){}updatePathIfDirty(){(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1)}preRender(n){return n.devicePixelRatio!==this.lastPixelRatio&&(this.dirtyPath=!0),this.lastPixelRatio=n.devicePixelRatio,this.updatePathIfDirty(),super.preRender(n,this.path.commands.length)}render(n){const{ctx:t}=n;if(this.clip&&!isNaN(this._clipX)&&!isNaN(this._clipY)){t.save();const e=this.strokeWidth/2;this._clipPath??(this._clipPath=new ExtendedPath2D),this._clipPath.clear(),this._clipPath.rect(-e,-e,this._clipX+e,this._clipY+e+e),t.clip(this._clipPath?.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(t),t.restore()}else this._clipPath=void 0,this.drawPath(t);this.fillShadow?.markClean(),super.render(n)}drawPath(n){this.fillStroke(n,this.path.getPath2D())}toSVG(){if(!this.visible)return;const n=(0,import_ag_charts_core25.createSvgElement)("path");n.setAttribute("d",this.svgPathData());const t=this.applySvgFillAttributes(n,[]);return this.applySvgStrokeAttributes(n),{elements:[n],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(n,t){const{path:e,size:i}=n,{x:s,y:r}=n;e.clear();let a=!1;for(const[c,o]of t){const h=s+(c-.5)*i,l=r+(o-.5)*i;a?e.lineTo(h,l):e.moveTo(h,l),a=!0}e.closePath()}var MARKER_SHAPES={circle({path:n,x:t,y:e,size:i}){const s=i/2;n.arc(t,e,s,0,Math.PI*2),n.closePath()},cross(n){drawMarkerUnitPolygon(n,[[.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(n){drawMarkerUnitPolygon(n,[[.5,0],[1,.5],[.5,1],[0,.5]])},heart({path:n,x:t,y:e,size:i}){const s=i/4;e=e+s/2,n.arc(t-s,e-s,s,toRadians(130),toRadians(330)),n.arc(t+s,e-s,s,toRadians(220),toRadians(50)),n.lineTo(t,e+s),n.closePath()},pin({path:n,x:t,y:e,size:i}){n.moveTo(t+(.15625-.5)*i,e+(.34375-.5)*i),n.cubicCurveTo(t+(.15625-.5)*i,e+(.151491-.5)*i,t+(.307741-.5)*i,e+(0-.5)*i,t+(.5-.5)*i,e+(0-.5)*i),n.cubicCurveTo(t+(.692259-.5)*i,e+(0-.5)*i,t+(.84375-.5)*i,e+(.151491-.5)*i,t+(.84375-.5)*i,e+(.34375-.5)*i),n.cubicCurveTo(t+(.84375-.5)*i,e+(.493824-.5)*i,t+(.784625-.5)*i,e+(.600181-.5)*i,t+(.716461-.5)*i,e+(.695393-.5)*i),n.cubicCurveTo(t+(.699009-.5)*i,e+(.719769-.5)*i,t+(.681271-.5)*i,e+(.743104-.5)*i,t+(.663785-.5)*i,e+(.766105-.5)*i),n.cubicCurveTo(t+(.611893-.5)*i,e+(.834367-.5)*i,t+(.562228-.5)*i,e+(.899699-.5)*i,t+(.528896-.5)*i,e+(.980648-.5)*i),n.cubicCurveTo(t+(.524075-.5)*i,e+(.992358-.5)*i,t+(.512663-.5)*i,e+(1-.5)*i,t+(.5-.5)*i,e+(1-.5)*i),n.cubicCurveTo(t+(.487337-.5)*i,e+(1-.5)*i,t+(.475925-.5)*i,e+(.992358-.5)*i,t+(.471104-.5)*i,e+(.980648-.5)*i),n.cubicCurveTo(t+(.487337-.5)*i,e+(1-.5)*i,t+(.475925-.5)*i,e+(.992358-.5)*i,t+(.471104-.5)*i,e+(.980648-.5)*i),n.cubicCurveTo(t+(.437772-.5)*i,e+(.899699-.5)*i,t+(.388107-.5)*i,e+(.834367-.5)*i,t+(.336215-.5)*i,e+(.766105-.5)*i),n.cubicCurveTo(t+(.318729-.5)*i,e+(.743104-.5)*i,t+(.300991-.5)*i,e+(.719769-.5)*i,t+(.283539-.5)*i,e+(.695393-.5)*i),n.cubicCurveTo(t+(.215375-.5)*i,e+(.600181-.5)*i,t+(.15625-.5)*i,e+(.493824-.5)*i,t+(.15625-.5)*i,e+(.34375-.5)*i),n.closePath()},plus(n){drawMarkerUnitPolygon(n,[[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:n,x:t,y:e,size:i,pixelRatio:s}){const r=i/2;n.moveTo(align(s,t-r),align(s,e-r)),n.lineTo(align(s,t+r),align(s,e-r)),n.lineTo(align(s,t+r),align(s,e+r)),n.lineTo(align(s,t-r),align(s,e+r)),n.closePath()},star({path:n,x:t,y:e,size:i}){const r=i/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,u=t+Math.cos(l)*h,d=e+Math.sin(l)*h;n.lineTo(u,d)}n.closePath()},triangle(n){drawMarkerUnitPolygon(n,[[.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}updatePath(){const{path:n,shape:t,x:e,y:i,size:s}=this,r=this.layerManager?.canvas?.pixelRatio??1,a=Marker.anchor(t),c={path:n,x:e-(a.x-.5)*s,y:i-(a.y-.5)*s,size:s,pixelRatio:r};n.clear(),typeof t=="string"?MARKER_SHAPES[t](c):typeof t=="function"&&t(c)}computeBBox(){const{x:n,y:t,size:e}=this,i=Marker.anchor(this.shape);return new BBox(n-e*i.x,t-e*i.y,e,e)}executeFill(n,t){if(t)return super.executeFill(n,t)}executeStroke(n,t){if(t)return super.executeStroke(n,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(n){return n==="pin"?{x:.5,y:1}:typeof n=="function"&&"anchor"in n?n.anchor:{x:.5,y:.5}}constructor(n){super(n),n?.shape!=null&&(this.shape=n.shape)}},import_ag_charts_core26=require("ag-charts-core");function findMinMax(n){if(n.length===0)return[];const t=[1/0,-1/0];for(const e of n)e<t[0]&&(t[0]=e),e>t[1]&&(t[1]=e);return t}var durationSecond=1e3,durationMinute=durationSecond*60,durationHour=durationMinute*60,durationDay=durationHour*24,durationWeek=durationDay*7,durationMonth=durationDay*30,durationYear=durationDay*365,import_ag_charts_core27=require("ag-charts-core"),TimeInterval=class Y{constructor(t,e,i,s,r,a=1,c){this.unit=t,this.milliseconds=e,this.hierarchy=i,this._encode=s,this._decode=r,this.step=a,this._rangeCallback=c}static extent(t,e,i){if(t.getTime()>e.getTime()&&([t,e]=[e,t],i!=null&&(i=[1-i[1],1-i[0]])),i!=null){const s=e.getTime()-t.getTime(),r=t.getTime();t=new Date(r+i[0]*s),e=new Date(r+i[1]*s)}return[t,e]}getOffset(t,e){return Math.floor(this._encode(new Date(t)))%e}floor(t){const e=new Date(t),i=this._encode(e);return this._decode(i)}ceil(t){const e=new Date(Number(t)-1),i=this._encode(e);return this._decode(i+1)}rangeIndices(t,e,{extend:i=!1,visibleRange:s=[0,1],limit:r}){[t,e]=Y.extent(t,e,s);const a=this._encode(i?this.floor(t):this.ceil(t));let c=this._encode(i?this.ceil(e):this.floor(e));return r!=null&&c-a>r&&(c=a+r),[a,c]}range(t,e,i={}){let s;t.getTime()>e.getTime()?s=this._rangeCallback?.(e,t):s=this._rangeCallback?.(t,e);const[r,a]=this.rangeIndices(t,e,i),c=[];for(let o=r;o<=a;o++){const h=this._decode(o);c.push(h)}return s?.(),c}previous(t){return this._decode(this._encode(this.ceil(t))-1)}next(t){return this._decode(this._encode(this.floor(t))+1)}rangeCount(t,e,i={}){const[s,r]=this.rangeIndices(t,e,i);return r-s}every(t,e){if(t===1&&e?.snapTo!=null)return this;const{unit:i,milliseconds:s,hierarchy:r,step:a}=this;let c=0,o;const h=t;t=Math.max(1,Math.round(t)),h!==t&&import_ag_charts_core27.Logger.warnOnce(`interval step of [${h}] rounded to [${t}].`);const{snapTo:l="start"}=e??{};if(typeof l=="string"){const f=c;o=(p,m)=>{const g=l==="start"?p:m;return c=this.getOffset(g,t),()=>c=f}}else typeof l=="number"?c=this.getOffset(new Date(l),t):l instanceof Date&&(c=this.getOffset(l,t));const u=f=>Math.floor((this._encode(f)-c)/t),d=f=>this._decode(f*t+c);return new Y(i,s*t,r,u,d,a*t,o)}};function encode(n){return n.getFullYear()}function decode(n){const t=new Date;return t.setFullYear(n),t.setMonth(0,1),t.setHours(0,0,0,0),t}var yearMs=(365+1/4-1/100+1/400)*24*60*60*1e3,year=new TimeInterval("year",yearMs,void 0,encode,decode);function encode2(n){return n.getFullYear()*12+n.getMonth()}function decode2(n){const t=Math.floor(n/12),e=n-t*12;return new Date(t,e,1)}var month=new TimeInterval("month",year.milliseconds/12,year,encode2,decode2);function encode3(n){const t=n.getTimezoneOffset()*durationMinute;return Math.floor((n.getTime()-t)/durationDay)}function decode3(n){const t=new Date(1970,0,1);return t.setDate(t.getDate()+n),t}var day=new TimeInterval("day",24*60*60*1e3,month,encode3,decode3),offset=new Date().getTimezoneOffset()*durationMinute;function encode4(n){return Math.floor((n.getTime()-offset)/durationSecond)}function decode4(n){return new Date(offset+n*durationSecond)}var second=new TimeInterval("second",1e3,day,encode4,decode4),offset2=new Date().getTimezoneOffset()*durationMinute;function encode5(n){return Math.floor((n.getTime()-offset2)/durationMinute)}function decode5(n){return new Date(offset2+n*durationMinute)}var minute=new TimeInterval("minute",60*1e3,day,encode5,decode5),offset3=new Date().getTimezoneOffset()*durationMinute;function encode6(n){return Math.floor((n.getTime()-offset3)/durationHour)}function decode6(n){return new Date(offset3+n*durationHour)}var hour=new TimeInterval("hour",60*60*1e3,day,encode6,decode6);function weekday(n){const e=(7+n-4)%7;function i(r){const a=r.getTimezoneOffset()*durationMinute;return Math.floor((r.getTime()-a)/durationWeek-e/7)}function s(r){const a=new Date(1970,0,1);return a.setDate(a.getDate()+r*7+e),a}return new TimeInterval("day",7*24*60*60*1e3,month,i,s,7)}var sunday=weekday(0),monday=weekday(1),tuesday=weekday(2),wednesday=weekday(3),thursday=weekday(4),friday=weekday(5),saturday=weekday(6);function dateToNumber(n){return n instanceof Date?n.getTime():n}var import_ag_charts_core28=require("ag-charts-core"),_BandScale=class at 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 at}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,e){this.refresh();const i=this.findIndex(t);return i==null||i<0||i>=this.bands.length?NaN:this.ordinalRange(i)}invertNearestIndex(t){this.refresh();const e=this.bands.length;if(e===0)return-1;let i=0,s=e-1,r=1/0,a=0;for(;i<=s;){const c=(s+i)/2|0,o=this.ordinalRange(c),h=Math.abs(o-t);if(h===0)return c;h<r&&(r=h,a=c),o<t?i=c+1:s=c-1}return a}update(){const[t,e]=this.range;let{_paddingInner:i}=this;const{_paddingOuter:s,round:r,bands:a}=this,c=a.length;if(c===0)return;const o=e-t;let h;c===1?(i=0,h=o*(1-s*2)):h=o/Math.max(1,c-i+s*2);const l=r?Math.floor(h):h;let u=t+(o-l*(c-i))/2,d=l*(1-i);r&&(u=Math.round(u),d=Math.round(d)),this._step=l,this._inset=u,this._bandwidth=d,this._rawBandwidth=h*(1-i)}ordinalRange(t){const{_inset:e,_step:i,range:s}=this,r=Math.min(s[0],s[1]),a=Math.max(s[0],s[1]);return(0,import_ag_charts_core28.clamp)(r,e+i*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(n,t,e){if(e==null||e[0]===0&&e[1]===1)return{ticks:n,count:n.length};const i=(0,import_ag_charts_core29.clamp)(0,Math.floor(e[0]*n.length),n.length),s=(0,import_ag_charts_core29.clamp)(0,Math.ceil(e[1]*n.length),n.length),r=t?n.length-s:i,a=t?n.length-i:s;return{ticks:n.slice(r,a),count:n.length}}var CategoryScale=class ot extends BandScale{constructor(){super(...arguments),this.type="band",this.index=void 0,this._domain=[]}static is(t){return t instanceof ot}set domain(t){this._domain!==t&&(this.invalid=!0,this._domain=t,this.index=void 0)}get domain(){return this._domain}get bands(){return this._domain}normalizeDomains(...t){let e;const i=new Set;let s=!0;for(const r of t)i.has(r)||(i.add(r),e==null?e=deduplicateCategories(r):(s&&(s=domainOrderedToNormalizedDomain(r,e)),e=deduplicateCategories([...e,...r])));return e??(e=[]),{domain:e,animatable:s}}toDomain(t){}invert(t,e=!1){this.refresh();const i=e?this.bandwidth/2:0,s=this.invertNearestIndex(Math.max(0,t-i));return e||t===this.ordinalRange(s)?this.domain[s]:void 0}ticks(t,e=this.domain,i){return filterVisibleTicks(e,!1,i)}findIndex(t){let{index:e}=this;if(e==null){const{domain:i}=this;e=new Map;for(let s=0;s<i.length;s++)e.set(dateToNumber(i[s]),s);this.index=e}return e.get(dateToNumber(t))}};function deduplicateCategories(n){let t;const e=new Set;for(const i of n){const s=dateToNumber(i),r=e.size;e.add(s),e.size!==r?t?.push(i):t??(t=n.slice(0,e.size))}return t??n}function domainOrderedToNormalizedDomain(n,t){let e=-1;for(const i of n){const s=t.indexOf(i);if(s===-1)e=1/0;else{if(s<=e)return!1;e=s}}return!0}var percentFormatter=new Intl.NumberFormat("en-US",{style:"percent"});function formatValue(n,t=2){return typeof n=="number"?formatNumber(n,t):typeof n=="string"?n:String(n??"")}var numberFormatters=new Map().set(2,new Intl.NumberFormat("en-US",{maximumFractionDigits:2,useGrouping:!1}));function formatNumber(n,t){let e=numberFormatters.get(t);return e||(e=new Intl.NumberFormat("en-US",{maximumFractionDigits:t,useGrouping:!1}),numberFormatters.set(t,e)),e.format(n)}var import_ag_charts_core30=require("ag-charts-core"),tInterval=(n,t,e)=>({duration:t*e,timeInterval:n,step:e}),TickIntervals=[tInterval(second,durationSecond,1),tInterval(second,durationSecond,5),tInterval(second,durationSecond,15),tInterval(second,durationSecond,30),tInterval(minute,durationMinute,1),tInterval(minute,durationMinute,5),tInterval(minute,durationMinute,15),tInterval(minute,durationMinute,30),tInterval(hour,durationHour,1),tInterval(hour,durationHour,3),tInterval(hour,durationHour,6),tInterval(hour,durationHour,12),tInterval(day,durationDay,1),tInterval(day,durationDay,2),tInterval(sunday,durationWeek,1),tInterval(sunday,durationWeek,2),tInterval(sunday,durationWeek,3),tInterval(month,durationMonth,1),tInterval(month,durationMonth,2),tInterval(month,durationMonth,3),tInterval(month,durationMonth,4),tInterval(month,durationMonth,6),tInterval(year,durationYear,1)],TickMultipliers=[1,2,5,10];function isCloseToInteger(n,t){return Math.abs(Math.round(n)-n)<t}function countTicks(n,t,e){return Math.abs(t-n)>=e?Math.abs(t-n)/e+1:1}function createTicks(n,t,e,i,s,r){if(n===t)return{ticks:[n],count:1};if(e<2)return{ticks:[n,t],count:2};const a=tickStep(n,t,e,i,s);if(!Number.isFinite(a))return{ticks:[],count:0};let c=n,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,u=t-n,d=n+u*r[0],f=n+u*r[1];r=[(d-c)/l,(f-c)/l]}const{ticks:h}=range(c,o,a,r);return{ticks:h,count:countTicks(n,t,a)}}var minPrimaryTickRatio=Math.floor(2*sunday.milliseconds/month.milliseconds*10)/10;function tickStep(n,t,e,i=0,s=1/0){if(n===t)return(0,import_ag_charts_core30.clamp)(1,i,s);if(e<1)return NaN;const r=Math.abs(t-n),a=10**Math.floor(Math.log10(r/e));let c=NaN,o=1/0,h=!1;for(const l of TickMultipliers){const u=Math.ceil(r/(l*a)),d=u>=i&&u<=s;if(h&&!d)continue;const f=Math.abs(u-e);(o>f||h!==d)&&(h||(h=d),o=f,c=l)}return c*a}function decimalPlaces(n){for(let t=n.length-1;t>=0;t-=1)if(n[t]!=="0")return t+1;return 0}function tickFormat(n,t){const e=(0,import_ag_charts_core30.parseNumberFormat)(t??",f");(e.precision==null||isNaN(e.precision))&&(!e.type||"eEFgGnprs".includes(e.type)?e.precision=Math.max(...n.map(s=>{if(!Number.isFinite(s))return 0;const[r,a]=s.toExponential((e.type?6:12)-1).split(/[.e]/g);return(r!=="1"&&r!=="-1"?1:0)+decimalPlaces(a)+1})):"f%".includes(e.type)&&(e.precision=Math.max(...n.map(s=>{if(!Number.isFinite(s)||s===0)return 0;const r=Math.floor(Math.log10(Math.abs(s))),a=e.type?6:12,c=s.toExponential(a-1).split(/[.e]/g)[1],o=decimalPlaces(c);return Math.max(0,o-r)}))));const i=(0,import_ag_charts_core30.createNumberFormatter)(e);return s=>i(Number(s))}function range(n,t,e,i){if(!Number.isFinite(e)||e<=0)return{ticks:[],count:0};if(n===t)return{ticks:[n],count:1};const s=10**(0,import_ag_charts_core30.countFractionDigits)(e),r=Math.min(n,t),a=Math.max(n,t);let c,o;if(i!=null&&(i[0]!==0||i[1]!==1)){const l=t-n,u=n+l*i[0],d=t-l*(1-i[1]);c=Math.min(u,d),o=Math.max(u,d)}else c=r,o=a;c=Math.floor(c*s)/s,o=Math.ceil(o*s)/s;const h=[];for(let l=0;;l+=1){const u=Math.round((r+e*l)*s)/s;if(u>a)break;u>=c&&u<=o&&h.push(u)}return{ticks:h,count:countTicks(r,a,e)}}function isDenseInterval(n,t){return n>=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(n,t){const e=Math.abs(t-n),i=10**Math.floor(Math.log10(e));let s=1/0,r=[n,t];for(const a of TickMultipliers){const c=a*i,o=Math.floor(n/c)*c,h=Math.ceil(t/c)*c,l=1-e/Math.abs(h-o);s>l&&(s=l,r=[o,h])}return r}var _ContinuousScale=class ct extends AbstractScale{constructor(t=[],e=[]){super(),this.domain=t,this.range=e,this.defaultClamp=!1}static is(t){return t instanceof ct}normalizeDomains(...t){return normalizeContinuousDomains(...t)}transform(t){return t}transformInvert(t){return t}calcBandwidth(t=1,e=1){const{domain:i}=this,s=this.getPixelRange();if(i.length===0)return s;let a=Math.abs(i[1].valueOf()-i[0].valueOf())/t+1;if(e!==0){const c=Math.floor(s);a=Math.min(a,c)}return s/Math.max(1,a)}convert(t,e){const{domain:i}=this;if(!i||i.length<2)return NaN;const s=e?.clamp??this.defaultClamp,r=Number(this.transform(i[0])),a=Number(this.transform(i[1])),c=Number(this.transform(t)),{range:o}=this,[h,l]=o;if(s){const[u,d]=findMinMax([r,a]);if(c<u)return h;if(c>d)return l}return r===a?(h+l)/2:c===r?h:c===a?l:h+(c-r)/(a-r)*(l-h)}invert(t,e){const i=this.domain.map(l=>this.transform(l)),[s,r]=i,{range:a}=this,[c,o]=a;let h;return c===o?h=this.toDomain((Number(s)+Number(r))/2):h=this.toDomain(Number(s)+(t-c)/(o-c)*(Number(r)-Number(s))),this.transformInvert(h)}getPixelRange(){const[t,e]=this.range;return Math.abs(e-t)}};_ContinuousScale.defaultTickCount=5;var ContinuousScale=_ContinuousScale;function normalizeContinuousDomains(...n){let t,e=1/0,i,s=-1/0;for(const r of n)for(const a of r){const c=a.valueOf();c<e&&(e=c,t=a),c>s&&(s=c,i=a)}return t!=null&&i!=null?{domain:[t,i],animatable:!0}:{domain:[],animatable:!1}}var LinearScale=class V extends ContinuousScale{constructor(){super([0,1],[0,1]),this.type="number"}static is(t){return t instanceof V}static getTickStep(t,e,i){const{interval:s,tickCount:r=ContinuousScale.defaultTickCount,minTickCount:a,maxTickCount:c}=i;return s??tickStep(t,e,r,a,c)}toDomain(t){return t}ticks({interval:t,tickCount:e=ContinuousScale.defaultTickCount,minTickCount:i,maxTickCount:s},r=this.domain,a){if(!r||r.length<2||e<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,e,i,s,a)}niceDomain(t,e=this.domain){if(e.length<2)return[];const{tickCount:i=ContinuousScale.defaultTickCount}=t;let[s,r]=e;if(i===1)[s,r]=niceTicksDomain(s,r);else if(i>1){const a=s>r?Math.ceil:Math.floor,c=s>r?Math.floor:Math.ceil,o=4;for(let h=0;h<o;h++){const l=s,u=r,d=V.getTickStep(s,r,t),[f,p]=e;if(s=a(f/d)*d,r=c(p/d)*d,s===l&&r===u)break}}return[s,r]}tickFormatter({ticks:t,fractionDigits:e,specifier:i}){return i!=null?tickFormat(t,i):s=>formatValue(s,e)}datumFormatter({ticks:t,fractionDigits:e,specifier:i}){return i!=null?tickFormat(t,i):s=>formatValue(s,e+1)}},import_ag_charts_core31=require("ag-charts-core"),cmp=(n,t)=>Math.sign(n-t);function compareZIndex(n,t){if(typeof n=="number"&&typeof t=="number")return cmp(n,t);const e=typeof n=="number"?[n]:n,i=typeof t=="number"?[t]:t,s=Math.min(e.length,i.length);for(let r=0;r<s;r+=1){const a=cmp(e[r],i[r]);if(a!==0)return a}return cmp(e.length,i.length)}var sharedOffscreenCanvas,_Group=class z extends Node{constructor(t){super(t),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 z}static computeChildrenBBox(t,e=!0){return BBox.merge(Node.extractBBoxes(t,e))}static compareChildren(t,e){return compareZIndex(t.zIndex,e.zIndex)||t.serialNumber-e.serialNumber}containsPoint(t,e){return!0}computeBBox(){return z.computeChildrenBBox(this.children())}computeSafeClippingBBox(t){const e=this.computeBBox();if(!e.isFinite())return;let i=0;const s=4;for(const d of this.descendants())d instanceof Shape&&(i=Math.max(i,d.strokeWidth));const r=Math.max(1,i/2*s),{x:a,y:c}=Transformable.toCanvasPoint(this,0,0),o=alignBefore(t,a+e.x-r)-a,h=alignBefore(t,c+e.y-r)-c,l=Math.ceil(e.x+e.width-o+r),u=Math.ceil(e.y+e.height-h+r);return new BBox(o,h,l,u)}prepareSharedCanvas(t,e,i){return sharedOffscreenCanvas==null||sharedOffscreenCanvas.pixelRatio!==i?sharedOffscreenCanvas=new HdpiOffscreenCanvas({width:t,height:e,pixelRatio:i}):sharedOffscreenCanvas.resize(t,e,i),sharedOffscreenCanvas}isDirty(t){const{width:e,height:i,devicePixelRatio:s}=t,{dirty:r,dirtyZIndex:a,layer:c}=this,o=c!=null&&(this._lastWidth!==e||this._lastHeight!==i),h=this._lastDevicePixelRatio!==s;if(this._lastWidth=e,this._lastHeight=i,this._lastDevicePixelRatio=s,r||a||o||h)return!0;for(const l of this.children())if(l.dirty)return!0;return!1}preRender(t){const e=super.preRender(t,0);return e.groups+=1,e.nonGroups-=1,this.renderToOffscreenCanvas&&!this.optimizeForInfrequentRedraws&&e.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),e}render(t){const{layer:e,renderToOffscreenCanvas:i}=this,s={...t};if(!i){this.renderInContext(s),super.render(s);return}const{ctx:r,stats:a,devicePixelRatio:c}=t;let{image:o}=this;if(this.isDirty(t)){o?.bitmap.close(),o=void 0;const l=e?void 0:this.computeSafeClippingBBox(c),u=(d,...f)=>{const p=d.context;s.ctx=p,d.clear(),p.save(),p.setTransform(...f),p.globalAlpha=1,this.renderInContext(s),p.restore(),p.verifyDepthZero?.()};if(e)u(e,r.getTransform());else if(l){const{x:d,y:f,width:p,height:m}=l,g=this.prepareSharedCanvas(p,m,c);u(g,c,0,0,c,-d*c,-f*c),o={bitmap:g.transferToImageBitmap(),x:d,y:f,width:p,height:m}}else this.dirtyZIndex&&this.sortChildren(z.compareChildren);this.image=o,a&&a.layersRendered++}else this.skipRender(s),a&&a.layersSkipped++;const{globalAlpha:h}=r;if(r.globalAlpha=h*this.opacity,e)r.save(),r.resetTransform(),e.drawImage(r),r.restore();else if(o){const{bitmap:l,x:u,y:d,width:f,height:p}=o;r.drawImage(l,0,0,f*c,p*c,u,d,f,p)}r.globalAlpha=h,super.render(s)}skipRender(t){const{stats:e}=t;for(const i of this.children())i.markClean(),e&&(e.nodesSkipped+=this.childNodeCounts.groups+this.childNodeCounts.nonGroups,e.opsSkipped+=this.childNodeCounts.complexity)}applyClip(t,e){const{x:i,y:s,width:r,height:a}=e;t.beginPath(),t.rect(i,s,r,a),t.clip()}renderInContext(t){const{ctx:e,stats:i}=t;this.dirtyZIndex&&this.sortChildren(z.compareChildren),e.save(),e.globalAlpha*=this.opacity,this.clipRect!=null&&(this.applyClip(e,this.clipRect),t.clipBBox=Transformable.toCanvas(this,this.clipRect));for(const s of this.children()){if(!s.visible){s.markClean(),i&&(i.nodesSkipped+=s.childNodeCounts.nonGroups+s.childNodeCounts.groups,i.opsSkipped+=s.childNodeCounts.complexity);continue}e.save(),s.render(t),e.restore()}e.restore()}setClipRect(t){this.clipRect=t?Transformable.fromCanvas(this,t):void 0}setClipRectCanvasSpace(t){this.clipRect=t}setScene(t){this.layer&&(this.scene?.layersManager.removeLayer(this.layer),this.layer=void 0),super.setScene(t)}getVisibility(){for(const t of this.traverseUp(!0))if(!t.visible)return!1;return!0}toSVG(){if(!this.visible)return;const t=[],e=[];for(const i of this.children()){const s=i.toSVG();s!=null&&(e.push(...s.elements),s.defs!=null&&t.push(...s.defs))}return{elements:e,defs:t}}};_Group.className="Group",__decorateClass([SceneChangeDetection({convertor:n=>(0,import_ag_charts_core31.clamp)(0,n,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)){},import_ag_charts_core35=require("ag-charts-core"),import_ag_charts_core32=require("ag-charts-core"),HdpiCanvas=class{constructor(n){this.enabled=!0,this.width=600,this.height=300;const{width:t,height:e,canvasElement:i,willReadFrequently:s=!1}=n;this.pixelRatio=n.pixelRatio??(0,import_ag_charts_core32.getWindow)("devicePixelRatio")??1,this.element=i??(0,import_ag_charts_core32.createElement)("canvas"),this.element.style.display="block",this.element.style.width=(t??this.width)+"px",this.element.style.height=(e??this.height)+"px",this.element.width=Math.round((t??this.width)*this.pixelRatio),this.element.height=Math.round((e??this.height)*this.pixelRatio),this.context=this.element.getContext("2d",{willReadFrequently:s}),this.onEnabledChange(),this.resize(t??0,e??0,this.pixelRatio),debugContext(this.context)}drawImage(n,t=0,e=0){return n.drawImage(this.context.canvas,t,e)}toDataURL(n){return this.element.toDataURL(n)}resize(n,t,e){if(!(n>0&&t>0))return;const{element:i,context:s}=this;i.width=Math.round(n*e),i.height=Math.round(t*e),s.setTransform(e,0,0,e,0,0),i.style.width=n+"px",i.style.height=t+"px",this.width=n,this.height=t,this.pixelRatio=e}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.resetTransform()}onEnabledChange(){this.element&&(this.element.style.display=this.enabled?"":"none")}};__decorateClass([ObserveChanges(n=>n.onEnabledChange())],HdpiCanvas.prototype,"enabled",2);var import_ag_charts_core33=require("ag-charts-core"),ImageLoader=class extends import_ag_charts_core33.EventEmitter{constructor(){super(...arguments),this.cache=new Map,this.imageLoadingCount=0}loadImage(n,t){const e=this.cache.get(n);if(e?.image)return e.image;if(e!=null&&t){e.nodes.add(t);return}if(!t)return;const i={image:void 0,nodes:new Set([t])},s=new Image;return this.imageLoadingCount++,s.onload=()=>{i.image=s,i.nodes.forEach(r=>r.markDirty()),i.nodes.clear(),this.imageLoadingCount--,this.emit("image-loaded",{uri:n})},s.onerror=()=>{this.imageLoadingCount--,i.nodes.clear(),this.emit("image-error",{uri:n})},s.src=n,this.cache.set(n,i),i.image}waitingToLoad(){return this.imageLoadingCount>0}destroy(){this.cache.forEach(n=>{n.nodes.clear()}),this.cache.clear()}},LayersManager=class{constructor(n){this.canvas=n,this.debug=Debug.create(!0,"scene"),this.layersMap=new Map,this.nextLayerId=0}get size(){return this.layersMap.size}resize(n,t,e){this.canvas.resize(n,t,e),this.layersMap.forEach(({canvas:i})=>i.resize(n,t,e))}addLayer(n){const{width:t,height:e,pixelRatio:i}=this.canvas,{name:s}=n,r=new HdpiOffscreenCanvas({width:t,height:e,pixelRatio:i});return this.layersMap.set(r,{id:this.nextLayerId++,name:s,canvas:r}),this.debug("Scene.addLayer() - layers",this.layersMap),r}removeLayer(n){this.layersMap.has(n)&&(this.layersMap.delete(n),n.destroy(),this.debug("Scene.removeLayer() -  layers",this.layersMap))}clear(){for(const n of this.layersMap.values())n.canvas.destroy();this.layersMap.clear()}},import_ag_charts_core34=require("ag-charts-core");function formatBytes(n){for(const t of["B","KB","MB","GB"]){if(n<1536)return`${n.toFixed(1)}${t}`;n/=1024}return`${n.toFixed(1)}TB}`}function memoryUsage(){if(!("memory"in performance))return;const{totalJSHeapSize:n,usedJSHeapSize:t,jsHeapSizeLimit:e}=performance.memory,i=[];for(const s of[t,n,e])typeof s=="number"&&i.push(formatBytes(s));return`Heap ${i.join(" / ")}`}function debugStats(n,t,e,i,s={},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:u=0}=i??{},d=performance.now(),{start:f,...p}=t,m=Object.entries(p).map(([A,F])=>time(A,F)).filter(A=>A!=null).join(" + "),g=Object.entries(s).map(([A,F])=>`${A}: ${JSON.stringify(F)}`).join(" ; "),y=Debug.check("scene:stats:verbose"),v=memoryUsage(),w=[`${time("\u23F1\uFE0F",f,d)} (${m})`,`${g}`,`Layers: ${y?pct(a,c):n.size}`,y?`Nodes: ${pct(o,h)}`:null,y?`Ops: ${pct(l,u)}`:null,y&&v?v:null].filter(import_ag_charts_core34.isString),C=new SimpleTextMeasurer(A=>e.measureText(A)),x=new Map(w.map(A=>[A,C.measureLines(A)])),S=Math.max(...Array.from(x.values(),A=>A.width)),M=accumulate(x.values(),A=>A.height),b=2+r.x;e.save(),e.fillStyle="white",e.fillRect(b,0,S,M),e.fillStyle="black";let P=0;for(const[A,F]of x.entries())P+=F.height,e.fillText(A,b,P);e.restore()}function prepareSceneNodeHighlight(n){const t=(0,import_ag_charts_core34.toArray)((0,import_ag_charts_core34.getWindow)("agChartsSceneDebug")),e=[];for(const i of t)i==="layout"?e.push("seriesRoot","legend","root",/.*Axis-\d+-axis.*/):e.push(i);n.debugNodeSearch=e}function debugSceneNodeHighlight(n,t){n.save();for(const[e,i]of Object.entries(t)){const s=Transformable.toCanvas(i);if(!s){import_ag_charts_core34.Logger.log(`Scene.render() - no bbox for debugged node [${e}].`);continue}n.globalAlpha=.8,n.strokeStyle="red",n.lineWidth=1,n.strokeRect(s.x,s.y,s.width,s.height),n.fillStyle="red",n.strokeStyle="white",n.font="16px sans-serif",n.textBaseline="top",n.textAlign="left",n.lineWidth=2,n.strokeText(e,s.x,s.y,s.width),n.fillText(e,s.x,s.y,s.width)}n.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(n){const{...t}=n;for(const e of Object.keys(t))allowedProperties.has(e)||typeof t[e]!="number"&&typeof t[e]!="string"&&typeof t[e]!="boolean"&&(skippedProperties.add(e),delete t[e]);return t}function buildTree(n,t){if(!Debug.check(!0,"scene"))return{};let e=0;return{node:t==="json"?nodeProps(n):n,name:n.name??n.id,dirty:n.dirty,...Array.from(n.children(),i=>buildTree(i,t)).reduce((i,s)=>{let{name:r}=s;const{node:{visible:a,opacity:c,zIndex:o,translationX:h,translationY:l,rotation:u,scalingX:d,scalingY:f},node:p}=s;(!a||c<=0)&&(r=`(${r})`),Group.is(p)&&p.renderToOffscreenCanvas&&(r=`*${r}*`);const m=Array.isArray(o)?`(${o.join(", ")})`:o,g=[`${(e++).toString().padStart(3,"0")}|`,`${r??"<unknown>"}`,`z: ${m}`,h&&`x: ${h}`,l&&`y: ${l}`,u&&`r: ${u}`,d!=null&&d!==1&&`sx: ${d}`,f!=null&&f!==1&&`sy: ${f}`].filter(w=>!!w).join(" ");let y=g,v=1;for(;i[y]!=null&&v<100;)y=`${g} (${v++})`;return i[y]=s,i},{})}}function buildDirtyTree(n){if(!n.dirty)return{dirtyTree:{},paths:[]};const t=Array.from(n.children(),s=>buildDirtyTree(s)).filter(s=>s.paths.length>0),e=Group.is(n)?n.name??n.id:n.id,i=t.length?t.flatMap(s=>s.paths).map(s=>`${e}.${s}`):[e];return{dirtyTree:{name:e,node:n,dirty:n.dirty,...t.map(s=>s.dirtyTree).filter(s=>s.dirty!=null).reduce((s,r)=>(s[r.name??"<unknown>"]=r,s),{})},paths:i}}function pct(n,t){const e=n+t;return`${n} / ${e} (${Math.round(100*n/e)}%)`}function time(n,t,e){const i=e!=null?e-t:t;return`${n}: ${Math.round(i*100)/100}ms`}function accumulate(n,t){let e=0;for(const i of n)e+=t(i);return e}var Scene=class extends import_ag_charts_core35.EventEmitter{constructor(n){super(),this.debug=Debug.create(!0,"scene"),this.id=(0,import_ag_charts_core35.createId)(this),this.imageLoader=new ImageLoader,this.root=null,this.pendingSize=null,this.isDirty=!1,this.destroyFns=[],this.updateDebugFlags(),this.canvas=new HdpiCanvas(n),this.layersManager=new LayersManager(this.canvas),this.destroyFns.push(this.imageLoader.on("image-loaded",()=>{this.emit("scene-changed",{})}),this.imageLoader.on("image-error",({uri:t})=>{import_ag_charts_core35.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(n){const{element:t}=this.canvas;return t.parentElement?.removeChild(t),n.appendChild(t),this}setRoot(n){return this.root===n?this:(this.isDirty=!0,this.root?.setScene(),this.root=n,n&&(n.visible=!0,n.setScene(this)),this)}updateDebugFlags(){Debug.inDevelopmentMode(()=>Node._debugEnabled=!0)}clearCanvas(){this.canvas.clear()}attachNode(n){return this.appendChild(n),()=>this.removeChild(n)}appendChild(n){return this.root?.appendChild(n),this}removeChild(n){return this.root?.removeChild(n),this}download(n,t){(0,import_ag_charts_core35.downloadUrl)(this.canvas.toDataURL(t),n?.trim()??"image")}getDataURL(n){return this.canvas.toDataURL(n)}resize(n,t,e){return n=Math.round(n),t=Math.round(t),e??(e=this.pixelRatio),n>0&&t>0&&(n!==this.width||t!==this.height||e!==this.pixelRatio)?(this.pendingSize=[n,t,e],this.isDirty=!0,!0):!1}render(n){const{debugSplitTimes:t={start:performance.now()},extraDebugStats:e,seriesRect:i}=n??{},{canvas:s,canvas:{context:r}={},root:a,pendingSize:c,width:o,height:h,pixelRatio:l}=this;if(!r)return;const u=performance.now();let d=!1;if(c&&(d=!0,this.layersManager.resize(...c),this.pendingSize=null),a&&!a.visible){this.isDirty=!1;return}if(a?.dirty===!1&&!this.isDirty){this.debug.check()&&this.debug("Scene.render() - no-op",{tree:buildTree(a,"console")}),debugStats(this.layersManager,t,r,void 0,e,i);return}const f={ctx:r,width:o,height:h,devicePixelRatio:l,debugNodes:{}};Debug.check("scene:stats:verbose")&&(f.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),prepareSceneNodeHighlight(f);let p=!1;if((a?.dirty!==!1||d)&&(p=!0,s.clear()),a&&Debug.check("scene:dirtyTree")){const{dirtyTree:m,paths:g}=buildDirtyTree(a);Debug.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:m,paths:g})}if(a&&p){if(a.visible&&a.preRender(f),this.debug.check()){const m=buildTree(a,"console");this.debug("Scene.render() - before",{canvasCleared:p,tree:m})}if(a.visible)try{r.save(),a.render(f),r.restore()}catch(m){throw this.canvas.reset(),m}}t["\u270D\uFE0F"]=performance.now()-u,r.verifyDepthZero?.(),this.isDirty=!1,debugStats(this.layersManager,t,r,f.stats,e,i),debugSceneNodeHighlight(r,f.debugNodes),a&&this.debug.check()&&this.debug("Scene.render() - after",{tree:buildTree(a,"console"),canvasCleared:p})}toSVG(){const{root:n,width:t,height:e}=this;if(n!=null)return Node.toSVG(n,t,e)}strip(){const{context:n,pixelRatio:t}=this.canvas;n.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.destroyFns.forEach(n=>n()),Object.assign(this,{canvas:void 0})}};Scene.className="Scene";var import_ag_charts_core36=require("ag-charts-core"),Arc=class extends Path{constructor(){super(),this.centerX=0,this.centerY=0,this.radius=10,this.startAngle=0,this.endAngle=Math.PI*2,this.counterClockwise=!1,this.type=0,this.restoreOwnStyles()}get fullPie(){return(0,import_ag_charts_core36.isNumberEqual)(normalizeAngle360(this.startAngle),normalizeAngle360(this.endAngle))}updatePath(){const n=this.path;n.clear(),n.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),this.type===1?n.closePath():this.type===2&&!this.fullPie&&(n.lineTo(this.centerX,this.centerY),n.closePath())}computeBBox(){return new BBox(this.centerX-this.radius,this.centerY-this.radius,this.radius*2,this.radius*2)}isPointInPath(n,t){const e=this.getBBox();return this.type!==0&&e.containsPoint(n,t)&&this.path.isPointInPath(n,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_core37=require("ag-charts-core"),Line=class extends Shape{constructor(n={}){super(n),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.restoreOwnStyles()}set x(n){this.x1=n,this.x2=n}set y(n){this.y1=n,this.y2=n}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(n,t){return this.x1===this.x2||this.y1===this.y2?this.getBBox().clone().grow(this.strokeWidth/2).containsPoint(n,t):!1}distanceSquared(n,t){const{x1:e,y1:i,x2:s,y2:r}=this;return lineDistanceSquared(n,t,e,i,s,r,1/0)}render(n){const{ctx:t,devicePixelRatio:e}=n;let{x1:i,y1:s,x2:r,y2:a}=this;if(i===r){const{strokeWidth:c}=this,o=Math.round(i*e)/e+Math.trunc(c*e)%2/(e*2);i=o,r=o}else if(s===a){const{strokeWidth:c}=this,o=Math.round(s*e)/e+Math.trunc(c*e)%2/(e*2);s=o,a=o}t.beginPath(),t.moveTo(i,s),t.lineTo(r,a),this.fillStroke(t),this.fillShadow?.markClean(),super.render(n)}toSVG(){if(!this.visible)return;const n=(0,import_ag_charts_core37.createSvgElement)("line");return n.setAttribute("x1",String(this.x1)),n.setAttribute("y1",String(this.y1)),n.setAttribute("x2",String(this.x2)),n.setAttribute("y2",String(this.y2)),this.applySvgStrokeAttributes(n),{elements:[n]}}};Line.className="Line",Line.defaultStyles={...Shape.defaultStyles,fill:void 0,strokeWidth:1},__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_core38=require("ag-charts-core");function rotatePoint(n,t,e){const i=Math.sqrt(n**2+t**2),r=Math.atan2(t,n)+e;return{x:Math.cos(r)*i,y:Math.sin(r)*i}}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(n){}computeBBox(){const{innerRadius:n,outerRadius:t,columnWidth:e}=this,i=this.getRotation(),s=-e/2,r=e/2,a=-t,c=-n;let o=1/0,h=1/0,l=-1/0,u=-1/0;for(let d=0;d<4;d+=1){const{x:f,y:p}=rotatePoint(d%2===0?s:r,d<2?a:c,i);o=Math.min(f,o),h=Math.min(p,h),l=Math.max(f,l),u=Math.max(p,u)}return new BBox(o,h,l-o,u-h)}getRotation(){const{startAngle:n,endAngle:t}=this,e=angleBetween(n,t);return normalizeAngle360(n+e/2+Math.PI/2)}updatePath(){const{isBeveled:n}=this;n?this.updateBeveledPath():this.updateRectangularPath(),this.checkPathDirty()}updateRectangularPath(){const{columnWidth:n,innerRadius:t,outerRadius:e,path:i}=this,s=-n/2,r=n/2,a=-e,c=-t,o=this.getRotation(),h=[[s,c],[s,a],[r,a],[r,c]].map(([l,u])=>rotatePoint(l,u,o));i.clear(!0),i.moveTo(h[0].x,h[0].y),i.lineTo(h[1].x,h[1].y),i.lineTo(h[2].x,h[2].y),i.lineTo(h[3].x,h[3].y),i.closePath()}updateBeveledPath(){const{columnWidth:n,path:t,outerRadius:e,innerRadius:i,axisInnerRadius:s,axisOuterRadius:r,isRadiusAxisReversed:a}=this,c=(0,import_ag_charts_core38.isNumberEqual)(i,s),o=Math.asin(n/2/i),h=this.getRotation(),l=(b,P)=>rotatePoint(b,P,h),u=(b,P)=>Math.sqrt(b**2+P**2),d=(b,P)=>P>b?0:Math.sqrt(b**2-P**2),f=(b,P,A)=>A?b<P:b>P,p=c&&!isNaN(o)&&o<Math.PI/6;let m=-n/2,g=n/2;const y=-e,v=-i*(p?Math.cos(o):1),w=f(r,u(i,n/2),!a);if(w){const b=d(r,i);m=-b,g=b}t.clear(!0);const C=l(m,v);t.moveTo(C.x,C.y);const x=(0,import_ag_charts_core38.isNumberEqual)(i,e),S=f(r,u(e,n/2),!a);if(x&&p)t.arc(0,0,i,normalizeAngle360(-o-Math.PI/2)+h,normalizeAngle360(o-Math.PI/2)+h,!1);else if(S){const b=-d(r,n/2),P=d(r,e);if(!w){const A=l(m,b);t.lineTo(A.x,A.y)}if(t.arc(0,0,r,Math.atan2(b,m)+h,Math.atan2(y,-P)+h,!1),!(0,import_ag_charts_core38.isNumberEqual)(P,0)){const A=l(P,y);t.lineTo(A.x,A.y)}t.arc(0,0,r,Math.atan2(y,P)+h,Math.atan2(b,g)+h,!1)}else{const b=l(m,y),P=l(g,y);t.lineTo(b.x,b.y),t.lineTo(P.x,P.y)}const M=l(g,v);if(t.lineTo(M.x,M.y),p)t.arc(0,0,i,normalizeAngle360(o-Math.PI/2)+h,normalizeAngle360(-o-Math.PI/2)+h,!0);else{const b=l(m,v);t.lineTo(b.x,b.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(n,t,e,i,s){const r=angleBetween(n,t),a=r*(1-i)/2;if(n+=a,t-=a,r<.001)return 2*e*s;if(r>=2*Math.PI){const f=n+r/2;n=f-Math.PI,t=f+Math.PI}const c=e*Math.cos(n),o=e*Math.sin(n),h=e*Math.cos(t),l=e*Math.sin(t),u=Math.floor(Math.sqrt((c-h)**2+(o-l)**2)),d=2*e*s;return Math.max(1,Math.min(d,u))}var drawCorner=(n,{x0:t,y0:e,x1:i,y1:s,cx:r,cy:a},c,o)=>{if(o&&n.moveTo(t,e),t!==i||e!==s){const h=Math.atan2(e-a,t-r),l=Math.atan2(s-a,i-r);n.arc(r,a,c,h,l)}else n.lineTo(t,e)},epsilon=1e-6,cornerEdges=(n,t,e,i,s)=>{let r=!1,a=!1,c=i-Math.sqrt(Math.max(s**2-e**2,0)),o=0,h=0,l=e-Math.sqrt(Math.max(s**2-i**2,0));return c>n?(r=!0,c=n,o=e-Math.sqrt(Math.max(s**2-(i-n)**2))):c<epsilon&&(c=0),l>t?(a=!0,h=i-Math.sqrt(Math.max(s**2-(e-t)**2)),l=t):l<epsilon&&(l=0),{leading0:c,leading1:o,trailing0:h,trailing1:l,leadingClipped:r,trailingClipped:a}},clippedRoundRect=(n,t,e,i,s,r,a)=>{let{topLeft:c,topRight:o,bottomRight:h,bottomLeft:l}=r;const u=Math.max(c+l,o+h),d=Math.max(c+o,l+h);if(u<=0&&d<=0){a==null?n.rect(t,e,i,s):n.rect(a.x,a.y,a.width,a.height);return}else if(a==null&&c===o&&c===h&&c===l){n.roundRect(t,e,i,s,c);return}if(i<0&&(t+=i,i=Math.abs(i)),s<0&&(e+=s,s=Math.abs(s)),i<=0||s<=0)return;if(a==null)a=new BBox(t,e,i,s);else{const M=Math.max(t,a.x),b=Math.min(t+i,a.x+a.width),P=Math.max(e,a.y),A=Math.min(e+s,a.y+a.height);a=new BBox(M,P,b-M,A-P)}const f=Math.max(u/s,d/i,1);f>1&&(c/=f,o/=f,h/=f,l/=f);let p=!0,m=!0,g=!0,y=!0,v,w,C,x;if(p){const M=cornerEdges(a.height,a.width,Math.max(t+c-a.x,0),Math.max(e+c-a.y,0),c);M.leadingClipped&&(y=!1),M.trailingClipped&&(m=!1);const b=Math.max(a.x+M.leading1,a.x),P=Math.max(a.y+M.leading0,a.y),A=Math.max(a.x+M.trailing1,a.x),F=Math.max(a.y+M.trailing0,a.y),D=t+c,I=e+c;v={x0:b,y0:P,x1:A,y1:F,cx:D,cy:I}}if(m){const M=cornerEdges(a.width,a.height,Math.max(e+o-a.y,0),Math.max(a.x+a.width-(t+i-o),0),o);M.leadingClipped&&(p=!1),M.trailingClipped&&(g=!1);const b=Math.min(a.x+a.width-M.leading0,a.x+a.width),P=Math.max(a.y+M.leading1,a.y),A=Math.min(a.x+a.width-M.trailing0,a.x+a.width),F=Math.max(a.y+M.trailing1,a.y),D=t+i-o,I=e+o;w={x0:b,y0:P,x1:A,y1:F,cx:D,cy:I}}if(g){const M=cornerEdges(a.height,a.width,Math.max(a.x+a.width-(t+i-h),0),Math.max(a.y+a.height-(e+s-h),0),h);M.leadingClipped&&(m=!1),M.trailingClipped&&(y=!1);const b=Math.min(a.x+a.width-M.leading1,a.x+a.width),P=Math.min(a.y+a.height-M.leading0,a.y+a.height),A=Math.min(a.x+a.width-M.trailing1,a.x+a.width),F=Math.min(a.y+a.height-M.trailing0,a.y+a.height),D=t+i-h,I=e+s-h;C={x0:b,y0:P,x1:A,y1:F,cx:D,cy:I}}if(y){const M=cornerEdges(a.width,a.height,Math.max(a.y+a.height-(e+s-l),0),Math.max(t+l-a.x,0),l);M.leadingClipped&&(g=!1),M.trailingClipped&&(p=!1);const b=Math.max(a.x+M.leading0,a.x),P=Math.min(a.y+a.height-M.leading1,a.y+a.height),A=Math.max(a.x+M.trailing0,a.x),F=Math.min(a.y+a.height-M.trailing1,a.y+a.height),D=t+l,I=e+s-l;x={x0:b,y0:P,x1:A,y1:F,cx:D,cy:I}}let S=!1;p&&v!=null&&(drawCorner(n,v,c,!S),S||(S=!0)),m&&w!=null&&(drawCorner(n,w,o,!S),S||(S=!0)),g&&C!=null&&(drawCorner(n,C,h,!S),S||(S=!0)),y&&x!=null&&drawCorner(n,x,l,!S),n.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=Shape.defaultStyles.strokeWidth,this.effectiveStrokeWidth=Shape.defaultStyles.strokeWidth,this.hittester=super.isPointInPath.bind(this),this.distanceCalculator=super.distanceSquaredTransformedPoint.bind(this),this.microPixelEffectOpacity=1}set cornerRadius(n){this.topLeftCornerRadius=n,this.topRightCornerRadius=n,this.bottomRightCornerRadius=n,this.bottomLeftCornerRadius=n}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.strokeWidth||!!(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){const{path:n,borderPath:t,crisp:e,topLeftCornerRadius:i,topRightCornerRadius:s,bottomRightCornerRadius:r,bottomLeftCornerRadius:a}=this;let{x:c,y:o,width:h,height:l,strokeWidth:u,clipBBox:d}=this;const p=1/(this.layerManager?.canvas.pixelRatio??1);let m=1;if(n.clear(!0),t.clear(!0),e&&(h<=p&&(m*=h/p),l<=p&&(m*=l/p),h=this.align(c,h),l=this.align(o,l),c=this.align(c),o=this.align(o),d=d!=null?new BBox(this.align(d.x),this.align(d.y),this.align(d.x,d.width),this.align(d.y,d.height)):void 0),u)if(h<p){const g=c+p/2;t.moveTo(g,o),t.lineTo(g,o+l),u=p,this.borderClipPath=void 0}else if(l<p){const g=o+p/2;t.moveTo(c,g),t.lineTo(c+h,g),u=p,this.borderClipPath=void 0}else if(u<h&&u<l){const g=u/2;c+=g,o+=g,h-=u,l-=u;const y=d?.clone().shrink(g),v={topLeft:i>0?i-u:0,topRight:s>0?s-u:0,bottomRight:r>0?r-u:0,bottomLeft:a>0?a-u:0};this.borderClipPath=void 0,h>0&&l>0&&(y==null||y?.width>0&&y?.height>0)&&(clippedRoundRect(n,c,o,h,l,v,y),clippedRoundRect(t,c,o,h,l,v,y))}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:i,topRight:s,bottomRight:r,bottomLeft:a};this.borderClipPath=void 0,clippedRoundRect(n,c,o,h,l,g,d)}if([i,s,r,a].every(g=>g===0)){const g=this.getBBox();this.hittester=g.containsPoint.bind(g),this.distanceSquared=(y,v)=>this.getBBox().distanceSquared(y,v)}else this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquaredTransformedPoint;this.effectiveStrokeWidth=u,this.lastUpdatePathStrokeWidth=u,this.microPixelEffectOpacity=m}computeBBox(){const{x:n,y:t,width:e,height:i,clipBBox:s}=this;return s?.clone()??new BBox(n,t,e,i)}isPointInPath(n,t){return this.hittester(n,t)}get midPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}}distanceSquared(n,t){return this.distanceCalculator(n,t)}applyFillAndAlpha(n){super.applyFillAndAlpha(n),n.globalAlpha*=this.microPixelEffectOpacity}applyStrokeAndAlpha(n){super.applyStrokeAndAlpha(n),n.globalAlpha*=this.microPixelEffectOpacity}renderStroke(n){const{stroke:t,effectiveStrokeWidth:e}=this;if(t&&e){const{globalAlpha:i}=n,{lineDash:s,lineDashOffset:r,lineCap:a,lineJoin:c,borderPath:o,borderClipPath:h}=this;h&&n.clip(h.getPath2D()),this.applyStrokeAndAlpha(n),n.lineWidth=e,s&&n.setLineDash(s),r&&(n.lineDashOffset=r),a&&(n.lineCap=a),c&&(n.lineJoin=c),n.stroke(o.getPath2D()),n.globalAlpha=i}}};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:BBoxValues.equals})],Rect.prototype,"clipBBox",2),__decorateClass([SceneChangeDetection()],Rect.prototype,"crisp",2);var SectorBox=class U{constructor(t,e,i,s){this.startAngle=t,this.endAngle=e,this.innerRadius=i,this.outerRadius=s}clone(){const{startAngle:t,endAngle:e,innerRadius:i,outerRadius:s}=this;return new U(t,e,i,s)}equals(t){return this.startAngle===t.startAngle&&this.endAngle===t.endAngle&&this.innerRadius===t.innerRadius&&this.outerRadius===t.outerRadius}[interpolate](t,e){return new U(this.startAngle*(1-e)+t.startAngle*e,this.endAngle*(1-e)+t.endAngle*e,this.innerRadius*(1-e)+t.innerRadius*e,this.outerRadius*(1-e)+t.outerRadius*e)}};function sectorBox({startAngle:n,endAngle:t,innerRadius:e,outerRadius:i}){let s=1/0,r=1/0,a=-1/0,c=-1/0;const o=(h,l)=>{s=Math.min(h,s),r=Math.min(l,r),a=Math.max(h,a),c=Math.max(l,c)};return o(e*Math.cos(n),e*Math.sin(n)),o(e*Math.cos(t),e*Math.sin(t)),o(i*Math.cos(n),i*Math.sin(n)),o(i*Math.cos(t),i*Math.sin(t)),isBetweenAngles(0,n,t)&&o(i,0),isBetweenAngles(Math.PI*.5,n,t)&&o(0,i),isBetweenAngles(Math.PI,n,t)&&o(-i,0),isBetweenAngles(Math.PI*1.5,n,t)&&o(0,-i),new BBox(s,r,a-s,c-r)}function isPointInSector(n,t,e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2)),{innerRadius:s,outerRadius:r}=e;if(e.startAngle===e.endAngle||i<Math.min(s,r)||i>Math.max(s,r))return!1;const a=normalizeAngle180(e.startAngle),c=normalizeAngle180(e.endAngle),o=Math.atan2(t,n);return a<c?o<=c&&o>=a:o<=c&&o>=-Math.PI||o>=a&&o<=Math.PI}function radiiScalingFactor(n,t,e,i){if(e===0&&i===0)return 0;if(Math.asin(Math.abs(1*e)/(n+1*e))+Math.asin(Math.abs(1*i)/(n+1*i))-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*e)/(n+o*e))+Math.asin(Math.abs(o*i)/(n+o*i))-t<0?r=o:a=o}return r}var delta2=1e-6;function clockwiseAngle(n,t){return angleBetween(n,t)<delta2?t:normalizeAngle360(n-t)+t}function clockwiseAngles(n,t,e=0){const s=Math.abs(t-n)>=2*Math.PI?2*Math.PI:normalizeAngle360(t-n);return n=clockwiseAngle(n,e),t=n+s,{startAngle:n,endAngle:t}}function arcRadialLineIntersectionAngle(n,t,e,i,s,r){const a=Math.sin(r),c=Math.cos(r),o=n**2+t**2-e**2;let h,l,u,d;if(c>.5){const w=a/c,C=1+w**2,x=-2*(n+t*w),S=x**2-4*C*o;if(S<0)return;const M=(-x+Math.sqrt(S))/(2*C),b=(-x-Math.sqrt(S))/(2*C);h=M,l=M*w,u=b,d=b*w}else{const w=c/a,C=1+w**2,x=-2*(t+n*w),S=x**2-4*C*o;if(S<0)return;const M=(-x+Math.sqrt(S))/(2*C),b=(-x-Math.sqrt(S))/(2*C);h=M*w,l=M,u=b*w,d=b}const f=c,p=a,m=h*f+l*p,g=u*f+d*p,y=m>0?clockwiseAngle(Math.atan2(l-t,h-n),i):NaN,v=g>0?clockwiseAngle(Math.atan2(d-t,u-n),i):NaN;if(y>=i&&y<=s)return y;if(v>=i&&v<=s)return v}function arcCircleIntersectionAngle(n,t,e,i,s,r){const a=Math.hypot(n,t),c=(a**2-e**2+r**2)/(2*a),o=a-c,h=Math.atan2(t,n),l=Math.acos(-o/e),u=clockwiseAngle(h+l,i),d=clockwiseAngle(h-l,i);if(u>=i&&u<=s)return u;if(d>=i&&d<=s)return d}var Arc2=class{constructor(n,t,e,i,s){this.cx=n,this.cy=t,this.r=e,this.a0=i,this.a1=s,this.a0>=this.a1&&(this.a0=NaN,this.a1=NaN)}isValid(){return Number.isFinite(this.a0)&&Number.isFinite(this.a1)}pointAt(n){return{x:this.cx+this.r*Math.cos(n),y:this.cy+this.r*Math.sin(n)}}clipStart(n){n==null||!this.isValid()||n<this.a0||(this.a0=n,(Number.isNaN(n)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}clipEnd(n){n==null||!this.isValid()||n>this.a1||(this.a1=n,(Number.isNaN(n)||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(n){this.concentricEdgeInset=n,this.radialEdgeInset=n}set cornerRadius(n){this.startOuterCornerRadius=n,this.endOuterCornerRadius=n,this.startInnerCornerRadius=n,this.endInnerCornerRadius=n}computeBBox(){return sectorBox(this).translate(this.centerX,this.centerY)}normalizedRadii(){const{concentricEdgeInset:n}=this;let{innerRadius:t,outerRadius:e}=this;return t=t>0?t+n:0,e=Math.max(e-n,0),{innerRadius:t,outerRadius:e}}normalizedClipSector(){const{clipSector:n}=this;if(n==null)return;const{startAngle:t,endAngle:e}=clockwiseAngles(this.startAngle,this.endAngle),{innerRadius:i,outerRadius:s}=this.normalizedRadii(),r=clockwiseAngles(n.startAngle,n.endAngle,t);return new SectorBox(Math.max(t,r.startAngle),Math.min(e,r.endAngle),Math.max(i,n.innerRadius),Math.min(s,n.outerRadius))}getAngleOffset(n){return n>0?this.radialEdgeInset/n:0}arc(n,t,e,i,s,r,a,c){if(n<=0)return;const{startAngle:o,endAngle:h}=clockwiseAngles(this.startAngle,this.endAngle),{innerRadius:l,outerRadius:u}=this.normalizedRadii(),d=this.normalizedClipSector();if(c&&l<=0)return;const f=c?this.getAngleOffset(l+n):this.getAngleOffset(u-n),p=a?o+f+t:h-f-t,m=c?l+n:u-n,g=m*Math.cos(p),y=m*Math.sin(p);if(d!=null&&(!a&&!(p>=o-1e-6&&p<=d.endAngle-1e-6)||a&&!(p>=d.startAngle+1e-6&&p<=h-1e-6)||c&&m<d.innerRadius-1e-6||!c&&m>d.outerRadius+1e-6))return;const v=new Arc2(g,y,n,e,i);if(d!=null){c?(v.clipStart(arcRadialLineIntersectionAngle(g,y,n,e,i,d.endAngle)),v.clipEnd(arcRadialLineIntersectionAngle(g,y,n,e,i,d.startAngle))):(v.clipStart(arcRadialLineIntersectionAngle(g,y,n,e,i,d.startAngle)),v.clipEnd(arcRadialLineIntersectionAngle(g,y,n,e,i,d.endAngle)));let M,b;if(a?(M=arcCircleIntersectionAngle(g,y,n,e,i,d.innerRadius),b=arcCircleIntersectionAngle(g,y,n,e,i,d.outerRadius)):(M=arcCircleIntersectionAngle(g,y,n,e,i,d.outerRadius),b=arcCircleIntersectionAngle(g,y,n,e,i,d.innerRadius)),v.clipStart(M),v.clipEnd(b),M!=null){const{x:P,y:A}=v.pointAt(M),F=clockwiseAngle(Math.atan2(A,P),o);a?r?.clipStart(F):s.clipEnd(F)}if(b!=null){const{x:P,y:A}=v.pointAt(b),F=clockwiseAngle(Math.atan2(A,P),o);a?s.clipStart(F):r?.clipEnd(F)}}if(d!=null){const{x:M,y:b}=v.pointAt((v.a0+v.a1)/2);if(!isPointInSector(M,b,d))return}const{x:w,y:C}=v.pointAt(a===c?v.a0:v.a1),x=clockwiseAngle(Math.atan2(C,w),o),S=c?r:s;return a?S?.clipStart(x):S?.clipEnd(x),v}updatePath(){const{path:t,centerX:e,centerY:i,concentricEdgeInset:s,radialEdgeInset:r}=this;let{startOuterCornerRadius:a,endOuterCornerRadius:c,startInnerCornerRadius:o,endInnerCornerRadius:h}=this;const{startAngle:l,endAngle:u}=clockwiseAngles(this.startAngle,this.endAngle),{innerRadius:d,outerRadius:f}=this.normalizedRadii(),p=this.normalizedClipSector(),m=u-l,g=m>=2*Math.PI-1e-6;if(t.clear(),d===0&&f===0||d>f)return;if((p?.startAngle??l)===(p?.endAngle??u))return;if(g&&this.clipSector==null&&a===0&&c===0&&o===0&&h===0){t.moveTo(e+f*Math.cos(l),i+f*Math.sin(l)),t.arc(e,i,f,l,u),d>s&&(t.moveTo(e+d*Math.cos(u),i+d*Math.sin(u)),t.arc(e,i,d,u,l,!0)),t.closePath();return}else if(this.clipSector==null&&Math.abs(d-f)<1e-6){t.arc(e,i,f,l,u,!1),t.arc(e,i,f,u,l,!0),t.closePath();return}const y=this.getAngleOffset(d),v=this.getAngleOffset(f);if(m<2*v)return;const C=(p?.innerRadius??d)>s,x=d<s||m<2*y,S=f-d,M=Math.max(a,o,c,h),b=M>0?Math.min(S/M,1):1;a*=b,c*=b,o*=b,h*=b;const P=radiiScalingFactor(f,m-2*v,-a,-c);if(a*=P,c*=P,!x&&C){const _=radiiScalingFactor(d,m-2*y,o,h);o*=_,h*=_}else o=0,h=0;const A=Math.max(a+o,c+h),F=A>0?Math.min(S/A,1):1;a*=F,c*=F,o*=F,h*=F;let D=0,I=0;const $=a/(f-a),H=c/(f-c);if($>=0&&$<1-1e-6)D=Math.asin($);else{D=m/2;const _=f/(1/Math.sin(D)+1);a=Math.min(_,a)}if(H>=0&&H<1-1e-6)I=Math.asin(H);else{I=m/2;const _=f/(1/Math.sin(I)+1);c=Math.min(_,c)}const K=Math.asin(o/(d+o)),J=Math.asin(h/(d+h)),Z=p?.outerRadius??f,Q=this.getAngleOffset(Z),B=new Arc2(0,0,Z,l+Q,u-Q),tt=p?.innerRadius??d,et=this.getAngleOffset(tt),O=C?new Arc2(0,0,tt,l+et,u-et):void 0;p!=null&&(B.clipStart(p.startAngle),B.clipEnd(p.endAngle),O?.clipStart(p.startAngle),O?.clipEnd(p.endAngle));const nt=this.arc(a,D,l-Math.PI*.5,l+D,B,O,!0,!1),it=this.arc(c,I,u-I,u+Math.PI*.5,B,O,!1,!1),st=this.arc(h,J,u+Math.PI*.5,u+Math.PI-J,B,O,!1,!0),j=this.arc(o,K,l+Math.PI+K,l+Math.PI*1.5,B,O,!0,!0);if(x){const _=m<Math.PI*.5?r*(1+Math.cos(m))/Math.sin(m):NaN;let T;_>0&&_<f?T=Math.max(Math.hypot(r,_),d):T=r,T=Math.max(T,d);const R=l+m*.5;t.moveTo(e+T*Math.cos(R),i+T*Math.sin(R))}else if(!(j?.isValid()===!0||O?.isValid()===!0)){const _=l+m/2,T=d*Math.cos(_),R=d*Math.sin(_);t.moveTo(e+T,i+R)}if(nt?.isValid()===!0){const{cx:_,cy:T,r:R,a0:L,a1:E}=nt;t.arc(e+_,i+T,R,L,E)}if(B.isValid()){const{r:_,a0:T,a1:R}=B;t.arc(e,i,_,T,R)}if(it?.isValid()===!0){const{cx:_,cy:T,r:R,a0:L,a1:E}=it;t.arc(e+_,i+T,R,L,E)}if(!x){if(st?.isValid()===!0){const{cx:_,cy:T,r:R,a0:L,a1:E}=st;t.arc(e+_,i+T,R,L,E)}if(O?.isValid()===!0){const{r:_,a0:T,a1:R}=O;t.arc(e,i,_,R,T,!0)}if(j?.isValid()===!0){const{cx:_,cy:T,r:R,a0:L,a1:E}=j;t.arc(e+_,i+T,R,L,E)}}t.closePath()}isPointInPath(n,t){const{startAngle:e,endAngle:i,innerRadius:s,outerRadius:r}=this.clipSector??this;return isPointInSector(n-this.centerX,t-this.centerY,{startAngle:e,endAngle:i,innerRadius:Math.min(s,r),outerRadius:Math.max(s,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:(n,t)=>n.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);