UNPKG

ag-charts-community

Version:

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

2 lines 681 kB
var pf=Object.defineProperty,gf=Object.getOwnPropertyDescriptor,g=(e,t,i,s)=>{for(var n=s>1?void 0:s?gf(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(n=(s?a(t,i,n):a(n))||n);return s&&n&&pf(t,i,n),n};import{Logger as ff,arraysEqual as mf,entries as cr,groupBy as yf}from"ag-charts-core";import{clamp as xf,isPlainObject as _c}from"ag-charts-core";import{createSvgElement as Yc,toIterable as bf}from"ag-charts-core";var Wc=new Map;function ii(e){const t=e.constructor,i=Object.hasOwn(t,"className")?t.className:t.name;if(!i)throw new Error(`The ${t} is missing the 'className' property.`);const s=(Wc.get(i)??0)+1;return Wc.set(i,s),`${i}-${s}`}function Zc(){return crypto.randomUUID?.()??vf()}function vf(){const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let i=0;i<e.length;i++)(i===4||i===6||i===8||i===10)&&(t+="-"),t+=e[i].toString(16).padStart(2,"0");return t}import{clamp as Ds}from"ag-charts-core";var hr={containsPoint:Mf,isEmpty:Sf,normalize:If};function Mf(e,t,i){return t>=e.x&&t<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}function Sf(e){return e==null||e.height===0||e.width===0||isNaN(e.height)||isNaN(e.width)}function If(e){let{x:t,y:i,width:s,height:n}=e;return(s==null||s>0)&&(n==null||n>0)?e:(t!=null&&s!=null&&s<0&&(s=-s,t=t-s),i!=null&&n!=null&&n<0&&(n=-n,i=i-n),{x:t,y:i,width:s,height:n})}var go=Symbol("interpolate"),fo=e=>e[go]!=null;function ur(e,t,i,s=1/0){const n={nearest:void 0,distanceSquared:s};for(const o of i){const a=o.distanceSquared(e,t);if(a===0)return{nearest:o,distanceSquared:0};a<n.distanceSquared&&(n.nearest=o,n.distanceSquared=a)}return n}var hn=class cn{constructor(t,i,s,n){this.x=t,this.y=i,this.width=s,this.height=n}static fromDOMRect({x:t,y:i,width:s,height:n}){return new cn(t,i,s,n)}static merge(t){let i=1/0,s=1/0,n=-1/0,o=-1/0;for(const a of t)a.x<i&&(i=a.x),a.y<s&&(s=a.y),a.x+a.width>n&&(n=a.x+a.width),a.y+a.height>o&&(o=a.y+a.height);return new cn(i,s,n-i,o-s)}static nearestBox(t,i,s){return ur(t,i,s)}toDOMRect(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.y,left:this.x,right:this.x+this.width,bottom:this.y+this.height,toJSON(){return{}}}}clone(){const{x:t,y:i,width:s,height:n}=this;return new cn(t,i,s,n)}equals(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}containsPoint(t,i){return hr.containsPoint(this,t,i)}intersection(t){if(!this.collidesBBox(t))return;const i=Ds(t.x,this.x,t.x+t.width),s=Ds(t.y,this.y,t.y+t.height),n=Ds(t.x,this.x+this.width,t.x+t.width),o=Ds(t.y,this.y+this.height,t.y+t.height);return new cn(i,s,n-i,o-s)}collidesBBox(t){return this.x<t.x+t.width&&this.x+this.width>t.x&&this.y<t.y+t.height&&this.y+this.height>t.y}computeCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)&&Number.isFinite(this.width)&&Number.isFinite(this.height)}distanceSquared(t,i){if(this.containsPoint(t,i))return 0;const s=t-Ds(this.x,t,this.x+this.width),n=i-Ds(this.y,i,this.y+this.height);return s*s+n*n}shrink(t,i){if(typeof t=="number")this.applyMargin(t,i);else for(const s of Object.keys(t)){const n=t[s];typeof n=="number"&&this.applyMargin(n,s)}return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this}grow(t,i){if(typeof t=="number")this.applyMargin(-t,i);else for(const s of Object.keys(t)){const n=t[s];typeof n=="number"&&this.applyMargin(-n,s)}return this}applyMargin(t,i){switch(i){case"top":this.y+=t;case"bottom":this.height-=t;break;case"left":this.x+=t;case"right":this.width-=t;break;case"vertical":this.y+=t,this.height-=t*2;break;case"horizontal":this.x+=t,this.width-=t*2;break;case void 0:this.x+=t,this.y+=t,this.width-=t*2,this.height-=t*2;break}}translate(t,i){return this.x+=t,this.y+=i,this}[go](t,i){return new cn(this.x*(1-i)+t.x*i,this.y*(1-i)+t.y*i,this.width*(1-i)+t.width*i,this.height*(1-i)+t.height*i)}};hn.zero=Object.freeze(new hn(0,0,0,0)),hn.NaN=Object.freeze(new hn(NaN,NaN,NaN,NaN));var B=hn;function P(e){return function(t,i){const s=`__${i}`;t[i]||Df(t,i,s,e)}}function Df(e,t,i,s){const{type:n="normal",changeCb:o,convertor:a,checkDirtyOnAssignment:r=!1}=s??{},l={type:n,changeCb:o,checkDirtyOnAssignment:r,convertor:a};let c;switch(n){case"normal":c=Cf(i,l);break;case"transform":c=kf(i);break;case"path":c=Nf(i);break}c=Lf(i,Af(wf(c,l),l),l),Object.defineProperty(e,t,{set:c,get:function(){return this[i]},enumerable:!0,configurable:!0})}function wf(e,t){const{convertor:i}=t;return i?function(s){e.call(this,i(s))}:e}var mo=Symbol("no-change");function Af(e,t){const{changeCb:i}=t;return i?function(s){const n=e.call(this,s);return n!==mo&&i.call(this,this),n}:e}function Lf(e,t,i){const{checkDirtyOnAssignment:s}=i;return s?function(n){const o=t.call(this,n);return n?._dirty===!0&&this.markDirty(e),o}:t}function Cf(e,t){const{changeCb:i}=t;return function(s){const n=this[e];return s!==n?(this[e]=s,this.markDirty(e),i?.(this),s):mo}}function kf(e){return function(t){const i=this[e];return t!==i?(this[e]=t,this.markDirtyTransform(),t):mo}}function Nf(e){return function(t){const i=this[e];return t!==i?(this[e]=t,this._dirtyPath||(this._dirtyPath=!0,this.markDirty(e)),t):mo}}var un=class zc{constructor(t){this.serialNumber=zc._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=ii(this),this.pointerEvents=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??zc._debugEnabled)&&(this._debugDirtyProperties=new Map([["__first__",[]]]))}static toSVG(t,i,s){const n=t?.toSVG();if(n==null||!n.elements.length&&!n.defs?.length)return;const o=Yc("svg");if(o.setAttribute("width",String(i)),o.setAttribute("height",String(s)),o.setAttribute("viewBox",`0 0 ${i} ${s}`),n.defs?.length){const a=Yc("defs");a.append(...n.defs),o.append(a)}return o.append(...n.elements),o.outerHTML}static*extractBBoxes(t,i){for(const s of t)if(!i||s.visible&&!s.transitionOut){const n=s.getBBox();n&&(yield n)}}get datum(){return this._datum}set datum(t){this._datum!==t&&(this._previousDatum=this._datum,this._datum=t)}get previousDatum(){return this._previousDatum}get layerManager(){return this._layerManager}get dirty(){return this._dirty}closestDatum(){for(const{datum:t}of this.traverseUp(!0))if(t!=null)return t}preRender(t,i=1){this.childNodeCounts.groups=0,this.childNodeCounts.nonGroups=1,this.childNodeCounts.complexity=i,this.childNodeCounts.thisComplexity=i;for(const s of this.children()){const n=s.preRender(t);this.childNodeCounts.groups+=n.groups,this.childNodeCounts.nonGroups+=n.nonGroups,this.childNodeCounts.complexity+=n.complexity}return this.childNodeCounts}render(t){const{stats:i}=t;if(this._dirty=!1,this.debugDirtyProperties(),t.debugNodeSearch){const s=this.name??this.id;t.debugNodeSearch.some(n=>typeof n=="string"?n===s:n.test(s))&&(t.debugNodes[this.name??this.id]=this)}i&&(i.nodesRendered++,i.opsPerformed+=this.childNodeCounts.thisComplexity)}_setLayerManager(t){this._layerManager=t,this._debug=t?.debug;for(const i of this.children())i._setLayerManager(t)}sortChildren(t){if(this.dirtyZIndex=!1,!this.childNodes)return;const i=[...this.childNodes].sort(t);this.childNodes.clear();for(const s of i)this.childNodes.add(s)}*traverseUp(t){let i=this;for(t&&(yield i);i=i.parentNode;)yield i}*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 i of bf(t))i.parentNode?.removeChild(i),this.childNodes.add(i),i.parentNode=this,i._setLayerManager(this.layerManager);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._setLayerManager(),this.invalidateCachedBBox(),this.dirtyZIndex=!0,this.markDirty()}remove(){this.parentNode?.removeChild(this)}clear(){for(const t of this.children())delete t.parentNode,t._setLayerManager();this.childNodes?.clear(),this.invalidateCachedBBox()}destroy(){this.parentNode?.removeChild(this)}setProperties(t,i){if(i)for(const s of i)this[s]=t[s];else Object.assign(this,t);return this}containsPoint(t,i){return!1}pickNode(t,i){if(!(!this.visible||this.pointerEvents===1||!this.containsPoint(t,i))){if(this.childNodes!=null&&this.childNodes.size!==0){const s=[...this.children()];for(let n=s.length-1;n>=0;n--){const o=s[n].pickNode(t,i);if(o)return o}}else if(!this.isContainerNode)return this}}pickNodes(t,i,s=[]){if(!this.visible||this.pointerEvents===1||!this.containsPoint(t,i))return s;this.isContainerNode||s.push(this);for(const n of this.children())n.pickNodes(t,i,s);return s}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(){}markDirty(t){const{_dirty:i}=this;t!=null&&this._debugDirtyProperties&&this.markDebugProperties(t),!(this.cachedBBox==null&&i)&&(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 i=this._debugDirtyProperties?.get(t)??[],s=new Error().stack?.split(` `).filter(n=>n!=="Error"&&!n.includes(".markDebugProperties")&&!n.includes(".markDirty")&&!n.includes("Object.assign ")&&!n.includes(`${this.constructor.name}.`))??"unknown";i.push(s[0].replace(" at ","").trim()),this._debugDirtyProperties?.set(t,i)}debugDirtyProperties(){this._debugDirtyProperties!=null&&(this._debugDirtyProperties.has("__first__")||this._debugDirtyProperties.forEach((t,i)=>{t.length>1&&(console.groupCollapsed(`Property changed multiple times before render: ${this.constructor.name}.${i} (${t.length}x)`),t.forEach(s=>console.log(s)),console.groupEnd())}),this._debugDirtyProperties.clear())}onZIndexChange(){const{parentNode:t}=this;t&&(t.dirtyZIndex=!0)}toSVG(){}};un._nextSerialNumber=0,un._debugEnabled=!1,g([P()],un.prototype,"visible",2),g([P({changeCb:e=>e.onZIndexChange()})],un.prototype,"zIndex",2);var _i=un;import{clamp as si}from"ag-charts-core";var Yi=(e,t,i)=>e*(1-i)+t*i,dr=e=>{const t=e<0?-1:1,i=Math.abs(e);return i<=.04045?e/12.92:t*((i+.055)/1.055)**2.4},pr=e=>{const t=e<0?-1:1,i=Math.abs(e);return i>.0031308?t*(1.055*i**(1/2.4)-.055):12.92*e},Hc=class ct{constructor(t,i,s,n=1){this.r=si(0,t||0,1),this.g=si(0,i||0,1),this.b=si(0,s||0,1),this.a=si(0,n||0,1)}static validColorString(t){return t.indexOf("#")>=0?!!ct.parseHex(t):t.indexOf("rgb")>=0?!!ct.stringToRgba(t):ct.nameToHex.has(t.toLowerCase())}static fromString(t){if(t.indexOf("#")>=0)return ct.fromHexString(t);const i=ct.nameToHex.get(t.toLowerCase());if(i)return ct.fromHexString(i);if(t.indexOf("rgb")>=0)return ct.fromRgbaString(t);throw new Error(`Invalid color string: '${t}'`)}static parseHex(t){t=t.replace(/ /g,"").slice(1);let i;switch(t.length){case 6:case 8:i=[];for(let s=0;s<t.length;s+=2)i.push(parseInt(`${t[s]}${t[s+1]}`,16));break;case 3:case 4:i=t.split("").map(s=>parseInt(s,16)).map(s=>s+s*16);break}if(i?.length>=3&&i.every(s=>s>=0))return i.length===3&&i.push(255),i}static fromHexString(t){const i=ct.parseHex(t);if(i){const[s,n,o,a]=i;return new ct(s/255,n/255,o/255,a/255)}throw new Error(`Malformed hexadecimal color string: '${t}'`)}static stringToRgba(t){let i=-1,s=-1;for(let r=0;r<t.length;r++){const l=t[r];if(i===-1&&l==="(")i=r;else if(l===")"){s=r;break}}if(i===-1||s===-1)return;const o=t.substring(i+1,s).split(","),a=[];for(let r=0;r<o.length;r++){const l=o[r];let c=parseFloat(l);if(!Number.isFinite(c))return;l.indexOf("%")>=0?(c=si(0,c,100),c/=100):r===3?c=si(0,c,1):(c=si(0,c,255),c/=255),a.push(c)}return a}static fromRgbaString(t){const i=ct.stringToRgba(t);if(i){if(i.length===3)return new ct(i[0],i[1],i[2]);if(i.length===4)return new ct(i[0],i[1],i[2],i[3])}throw new Error(`Malformed rgb/rgba color string: '${t}'`)}static fromArray(t){if(t.length===4)return new ct(t[0],t[1],t[2],t[3]);if(t.length===3)return new ct(t[0],t[1],t[2]);throw new Error("The given array should contain 3 or 4 color components (numbers).")}static fromHSB(t,i,s,n=1){const o=ct.HSBtoRGB(t,i,s);return new ct(o[0],o[1],o[2],n)}static fromHSL(t,i,s,n=1){const o=ct.HSLtoRGB(t,i,s);return new ct(o[0],o[1],o[2],n)}static fromOKLCH(t,i,s,n=1){const o=ct.OKLCHtoRGB(t,i,s);return new ct(o[0],o[1],o[2],n)}static padHex(t){return t.length===1?"0"+t:t}toHexString(){let t="#"+ct.padHex(Math.round(this.r*255).toString(16))+ct.padHex(Math.round(this.g*255).toString(16))+ct.padHex(Math.round(this.b*255).toString(16));return this.a<1&&(t+=ct.padHex(Math.round(this.a*255).toString(16))),t}toRgbaString(t=3){const i=[Math.round(this.r*255),Math.round(this.g*255),Math.round(this.b*255)],s=Math.pow(10,t);return this.a!==1?(i.push(Math.round(this.a*s)/s),`rgba(${i.join(", ")})`):`rgb(${i.join(", ")})`}toString(){return this.a===1?this.toHexString():this.toRgbaString()}toHSB(){return ct.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(t,i,s){const n=dr(t),o=dr(i),a=dr(s),r=Math.cbrt(.4122214708*n+.5363325363*o+.0514459929*a),l=Math.cbrt(.2119034982*n+.6806995451*o+.1073969566*a),c=Math.cbrt(.0883024619*n+.2817188376*o+.6299787005*a),h=.2104542553*r+.793617785*l-.0040720468*c,u=1.9779984951*r-2.428592205*l+.4505937099*c,d=.0259040371*r+.7827717662*l-.808675766*c,p=Math.atan2(d,u)*180/Math.PI,f=h,y=Math.hypot(u,d),b=p>=0?p:p+360;return[f,y,b]}static OKLCHtoRGB(t,i,s){const n=t,o=i*Math.cos(s*Math.PI/180),a=i*Math.sin(s*Math.PI/180),r=(n+.3963377774*o+.2158037573*a)**3,l=(n-.1055613458*o-.0638541728*a)**3,c=(n-.0894841775*o-1.291485548*a)**3,h=4.0767416621*r-3.3077115913*l+.2309699292*c,u=-1.2684380046*r+2.6097574011*l-.3413193965*c,d=-.0041960863*r-.7034186147*l+1.707614701*c,p=pr(h),f=pr(u),y=pr(d);return[p,f,y]}static RGBtoHSL(t,i,s){const n=Math.min(t,i,s),o=Math.max(t,i,s),a=(o+n)/2;let r,l;if(o===n)r=0,l=0;else{const c=o-n;l=a>.5?c/(2-o-n):c/(o+n),o===t?r=(i-s)/c+(i<s?6:0):o===i?r=(s-t)/c+2:r=(t-i)/c+4,r*=360/6}return[r,l,a]}static HSLtoRGB(t,i,s){if(t=(t%360+360)%360,i===0)return[s,s,s];const n=s<.5?s*(1+i):s+i-s*i,o=2*s-n;function a(h){return h<0&&(h+=1),h>1&&(h-=1),h<1/6?o+(n-o)*6*h:h<1/2?n:h<2/3?o+(n-o)*(2/3-h)*6:o}const r=a(t/360+1/3),l=a(t/360),c=a(t/360-1/3);return[r,l,c]}static RGBtoHSB(t,i,s){const n=Math.min(t,i,s),o=Math.max(t,i,s),a=o===0?0:(o-n)/o;let r=0;if(n!==o){const l=o-n,c=(o-t)/l,h=(o-i)/l,u=(o-s)/l;t===o?r=u-h:i===o?r=2+c-u:r=4+h-c,r/=6,r<0&&(r=r+1)}return[r*360,a,o]}static HSBtoRGB(t,i,s){t=(t%360+360)%360/360;let n=0,o=0,a=0;if(i===0)n=o=a=s;else{const r=(t-Math.floor(t))*6,l=r-Math.floor(r),c=s*(1-i),h=s*(1-i*l),u=s*(1-i*(1-l));switch(r>>0){case 0:n=s,o=u,a=c;break;case 1:n=h,o=s,a=c;break;case 2:n=c,o=s,a=u;break;case 3:n=c,o=h,a=s;break;case 4:n=u,o=c,a=s;break;case 5:n=s,o=c,a=h;break}}return[n,o,a]}static mix(t,i,s){return new ct(Yi(t.r,i.r,s),Yi(t.g,i.g,s),Yi(t.b,i.b,s),Yi(t.a,i.a,s))}static lighten(t,i){const s=ct.RGBtoOKLCH(t.r,t.g,t.b);return ct.fromOKLCH(si(0,s[0]+i,1),s[1],s[2])}static darken(t,i){const s=ct.RGBtoOKLCH(t.r,t.g,t.b);return ct.fromOKLCH(si(0,s[0]-i,1),s[1],s[2])}static interpolate(t,i){const s=1/(t.length-1),n=t.map(o=>ct.RGBtoOKLCH(o.r,o.g,o.b));return Array.from({length:i},(o,a)=>{const r=a/(i-1),l=t.length<=2?0:Math.min(Math.floor(r*(t.length-1)),t.length-2),c=(r-l*s)/s,h=n[l],u=n[l+1];return ct.fromOKLCH(Yi(h[0],u[0],c),Yi(h[1],u[1],c),Yi(h[2],u[2],c))})}};Hc.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 wt=Hc;function Tf(e,t){return i=>Number(e)*(1-i)+Number(t)*i}function Ef(e,t){if(typeof e=="string")try{e=wt.fromString(e)}catch{e=wt.fromArray([0,0,0])}if(typeof t=="string")try{t=wt.fromString(t)}catch{t=wt.fromArray([0,0,0])}return i=>wt.mix(e,t,i).toRgbaString()}import{isArray as Uc,isObject as Kc,isPlainObject as ws}from"ag-charts-core";var $c=Symbol("BREAK"),As="__decorator_config";function Of(e,t){gr(e,t).optional=!0}function gr(e,t){Object.getOwnPropertyDescriptor(e,As)==null&&Object.defineProperty(e,As,{value:{}});const i=e[As],s=t.toString();if(typeof i[s]<"u")return i[s];const n=new WeakMap;i[s]={setters:[],getters:[],observers:[],valuesMap:n};const o=Object.getOwnPropertyDescriptor(e,t),a=o?.set,r=o?.get;return Object.defineProperty(e,t,{set:function(h){const{setters:u,observers:d}=i[s];let p;u.some(f=>f.length>2)&&(p=r?r.call(this):n.get(this));for(const f of u)if(h=f(this,t,h,p),h===$c)return;a?a.call(this,h):n.set(this,h);for(const f of d)f(this,h,p)},get:function(){let h=r?r.call(this):n.get(this);for(const u of i[s].getters)if(h=u(this,t,h),h===$c)return;return h},enumerable:!0,configurable:!1}),i[s]}function Ls(e,t,i){return(s,n)=>{const o=gr(s,n);o.setters.push(e),t&&o.getters.unshift(t),i&&Object.assign(o,i)}}function Rf(e){return(t,i)=>{gr(t,i).observers.push(e)}}function yo(e){return typeof e<"u"&&As in e}function Wi(e){const t=new Set;for(;yo(e);)t.add(e?.[As]),e=Object.getPrototypeOf(e);return Array.from(t).flatMap(i=>Object.keys(i))}function Pf(e){return Wi(e).reduce((t,i)=>(t[i]=e[i]??null,t),{})}function Ff(e,t){const i=t.toString();for(;yo(e);){const s=e[As];if(Object.hasOwn(s,i))return s[i];e=Object.getPrototypeOf(e)}}function fi(e,t){return Array.isArray(e)?!Array.isArray(t)||e.length!==t.length?!1:e.every((i,s)=>fi(i,t[s])):ws(e)?ws(t)?Xc(e,t,fi):!1:e===t}function Xc(e,t,i){for(const s of Object.keys(t))if(!(s in e))return!1;for(const s of Object.keys(e))if(!(s in t)||!i(e[s],t[s]))return!1;return!0}function ce(...e){const t={};for(const i of e){if(!Kc(i))continue;const s=yo(i)?Wi(i):Object.keys(i);for(const n of s)ws(t[n])&&ws(i[n])?t[n]=ce(t[n],i[n]):t[n]??(t[n]=i[n])}return t}function qc(...e){const t={};for(const i of e){if(!Kc(i))continue;const s=yo(i)?Wi(i):Object.keys(i);for(const n of s)ws(t[n])&&ws(i[n])?t[n]=qc(t[n],i[n]):n in t||(t[n]??(t[n]=i[n]))}return t}function Zi(e,t){const i={...e};for(const s of t)delete i[s];return i}function xo(e,t){return(Uc(t)?t:t.split(".")).reduce((s,n)=>s[n],e)}var Jc=new Set(["__proto__","constructor","prototype"]);function jf(e,t,i){const s=Uc(t)?t.slice():t.split("."),n=s.pop();if(s.some(a=>Jc.has(a)))return;const o=s.reduce((a,r)=>a[r],e);return o[n]=i,o[n]}function Qc(e,t,i){if(i===void 0)return t;for(const s of e){const n=i[s];n!==void 0&&(t[s]=n)}return t}var zf=e=>e,bo=e=>Math.sin(e*Math.PI/2),Bf=e=>2*Math.asin(e)/Math.PI,fr=.2,dn=["initial","remove","update","add","trailing","end","none"],vo={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:fr,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1+fr,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}};function Vf(e){return e.every(t=>t instanceof _i)}function mr(e){return Vf(e)?{nodes:e,selections:[]}:{nodes:[],selections:e}}function yr(e,t){return e===t?!0:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((i,s)=>yr(i,t[s])):fo(e)&&fo(t)?e.equals(t):_c(e)&&_c(t)?Xc(e,t,yr):!1}var Gf=class{constructor(e){this.isComplete=!1,this.elapsed=0,this.iteration=0,this.isPlaying=!1,this.isReverse=!1,this.id=e.id,this.groupId=e.groupId,this.autoplay=e.autoplay??!0,this.ease=e.ease??zf,this.phase=e.phase;const t=e.duration??vo[this.phase].animationDuration;this.duration=t*e.defaultDuration,this.delay=(e.delay??0)*e.defaultDuration,this.onComplete=e.onComplete,this.onPlay=e.onPlay,this.onStop=e.onStop,this.onUpdate=e.onUpdate,this.interpolate=this.createInterpolator(e.from,e.to),this.from=e.from,e.skip===!0&&(this.onUpdate?.(e.to,!1,this),this.onStop?.(this),this.onComplete?.(this),this.isComplete=!0),e.collapsable!==!1&&(this.duration=this.checkCollapse(e,this.duration))}checkCollapse(e,t){return yr(e.from,e.to)?0:t}play(e=!1){this.isPlaying||this.isComplete||(this.isPlaying=!0,this.onPlay?.(this),this.autoplay&&(this.autoplay=!1,e&&this.onUpdate?.(this.from,!0,this)))}stop(){this.isPlaying=!1,this.isComplete||(this.isComplete=!0,this.onStop?.(this))}update(e){if(this.isComplete)return e;!this.isPlaying&&this.autoplay&&this.play(!0);const t=this.elapsed;if(this.elapsed+=e,this.delay>this.elapsed)return 0;const i=this.interpolate(this.isReverse?1-this.delta:this.delta);this.onUpdate?.(i,!1,this);const s=this.delay+this.duration;return this.elapsed>=s?(this.stop(),this.isComplete=!0,this.onComplete?.(this),e-(s-t)):0}get delta(){return this.ease(xf(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(e,t){if(typeof t!="object"||fo(t))return this.interpolateValue(e,t);const i=[];for(const s of Object.keys(t)){const n=this.interpolateValue(e[s],t[s]);n!=null&&i.push([s,n])}return s=>{const n={};for(const[o,a]of i)n[o]=a(s);return n}}interpolateValue(e,t){if(!(e==null||t==null)){if(fo(e))return i=>e[go](t,i);try{switch(typeof e){case"number":return Tf(e,t);case"string":return Ef(e,t);case"boolean":if(e===t)return()=>e;break;case"object":return()=>e}}catch{}throw new Error(`Unable to interpolate values: ${e}, ${t}`)}}},ni={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function jt(e,t,i,s,n,o,a){const{fromFn:r,toFn:l,applyFn:c=(f,y)=>f.setProperties(y)}=n,{nodes:h,selections:u}=mr(s),d=(f,y)=>{let b,m=0,v=0;for(const S of y){const M=f[m]===S,I={last:v>=y.length-1,lastLive:m>=f.length-1,prev:y[v-1],prevFromProps:b,prevLive:f[m-1],next:y[v+1],nextLive:f[m+(M?1:0)]},A=`${e}_${t}_${S.id}`;i.stopByAnimationId(A);let w="unknown";M?o&&a&&(w=_f(S,S.datum,o,a)):w="removed",S.transitionOut=w==="removed";const{phase:D,start:L,finish:C,delay:N,duration:E,...G}=r(S,S.datum,w,I),{phase:ut,start:V,finish:U,delay:$,duration:et,...J}=l(S,S.datum,w,I),F=C==null;i.animate({id:A,groupId:e,phase:D??ut??"update",duration:E??et,delay:N??$,from:G,to:J,ease:bo,collapsable:F,onPlay:()=>{const j={...L,...V,...G};c(S,j,"start")},onUpdate(j){c(S,j,"update")},onStop:()=>{const j={...L,...V,...G,...J,...C,...U};c(S,j,"end")}}),M&&m++,v++,b=G}};let p=0;for(const f of u){const y=f.nodes(),b=y.filter(m=>!f.isGarbage(m));d(b,y),i.animate({id:`${e}_${t}_selection_${p}`,groupId:e,phase:"end",from:0,to:1,ease:bo,onStop(){f.cleanup()}}),p++}d(h,h)}function Hi(e,t,i,s,n,o,a){const{nodes:r,selections:l}=mr(s),{start:c,finish:h,phase:u}=a;i.animate({id:`${e}_${t}`,groupId:e,phase:u??"update",from:n,to:o,ease:bo,onPlay:()=>{if(c){for(const d of r)d.setProperties(c);for(const d of l)for(const p of d.nodes())p.setProperties(c)}},onUpdate(d){for(const p of r)p.setProperties(d);for(const p of l)for(const f of p.nodes())f.setProperties(d)},onStop:()=>{for(const d of r)d.setProperties({...o,...h});for(const d of l){for(const p of d.nodes())p.setProperties({...o,...h});d.cleanup()}}})}function _f(e,t,i,s){const n=i(e,t);return s.added.has(n)?"added":s.removed.has(n)?"removed":"updated"}import{clamp as Yf}from"ag-charts-core";function th(e,t){const[i,s]=Wt(t);return Yf(i,e,s)}function Wt(e){if(e.length===0)return[];const t=[1/0,-1/0];for(const i of e)i<t[0]&&(t[0]=i),i>t[1]&&(t[1]=i);return t}function Mo(e){const[t,i]=Wt(e);return i-t}var xr=class{ticks(e,t,i){}niceDomain(e,t=this.domain){return t}tickFormatter(e){}datumFormatter(e){}get bandwidth(){}get step(){}get inset(){}},eh=class Jg extends xr{constructor(t=[],i=[]){super(),this.domain=t,this.range=i,this.defaultClamp=!1}static is(t){return t instanceof Jg}normalizeDomains(...t){let i,s=1/0,n,o=-1/0;for(const a of t)for(const r of a){const l=r.valueOf();l<s&&(s=l,i=r),l>o&&(o=l,n=r)}return i!=null&&n!=null?{domain:[i,n],animatable:!0}:{domain:[],animatable:!1}}transform(t){return t}transformInvert(t){return t}calcBandwidth(t=1){const{domain:i}=this,s=this.getPixelRange();if(i.length===0)return s;const n=Math.abs(i[1].valueOf()-i[0].valueOf())/t+1,o=Math.floor(s),a=Math.min(n,o);return s/Math.max(1,a)}convert(t,i=this.defaultClamp){const{domain:s}=this;if(!s||s.length<2)return NaN;const n=Number(this.transform(s[0])),o=Number(this.transform(s[1])),a=Number(this.transform(t)),{range:r}=this,[l,c]=r;if(i){const[h,u]=Wt([n,o]);if(a<h)return l;if(a>u)return c}return n===o?(l+c)/2:a===n?l:a===o?c:l+(a-n)/(o-n)*(c-l)}invert(t,i){const s=this.domain.map(h=>this.transform(h)),[n,o]=s,{range:a}=this,[r,l]=a;let c;return r===l?c=this.toDomain((Number(n)+Number(o))/2):c=this.toDomain(Number(n)+(t-r)/(l-r)*(Number(o)-Number(n))),this.transformInvert(c)}getPixelRange(){const[t,i]=this.range;return Math.abs(i-t)}};eh.defaultTickCount=5;var dt=eh;import{isFiniteNumber as ih}from"ag-charts-core";import{Logger as Wf}from"ag-charts-core";var Cs=class{constructor(e,t,i){this._encode=e,this._decode=t,this._rangeCallback=i}floor(e){const t=new Date(e),i=this._encode(t);return this._decode(i)}ceil(e){const t=new Date(Number(e)-1),i=this._encode(t);return this._decode(i+1)}range(e,t,{extend:i=!1,visibleRange:s=[0,1]}={}){let n=!1;e.getTime()>t.getTime()&&([e,t]=[t,e],n=!0);const o=this._rangeCallback?.(e,t),a=this._encode(i?this.floor(e):this.ceil(e)),r=this._encode(i?this.ceil(t):this.floor(t));if(r<a)return[];const l=r-a;let c,h;n?(c=Math.ceil(a+(1-s[1])*l),h=Math.floor(a+(1-s[0])*l)):(c=Math.floor(a+s[0]*l),h=Math.ceil(a+s[1]*l));const u=[];for(let d=c;d<=h;d+=1){const p=this._decode(d);u.push(p)}return o?.(),u}},mi=class extends Cs{getOffset(e,t){return Math.floor(this._encode(new Date(e)))%t}every(e,t){let i=0,s;const n=e;e=Math.max(1,Math.round(e)),n!==e&&Wf.warnOnce(`interval step of [${n}] rounded to [${e}].`);const{snapTo:o="start"}=t??{};if(typeof o=="string"){const l=i;s=(c,h)=>{const u=o==="start"?c:h;return i=this.getOffset(u,e),()=>i=l}}else typeof o=="number"?i=this.getOffset(new Date(o),e):o instanceof Date&&(i=this.getOffset(o,e));const a=l=>Math.floor((this._encode(l)-i)/e),r=l=>this._decode(l*e+i);return new Cs(a,r,s)}};function Zf(e){return e.getTime()}function Hf(e){return new Date(e)}var Uf=new mi(Zf,Hf),yi=1e3,he=yi*60,De=he*60,Ee=De*24,oi=Ee*7,pn=Ee*30,ks=Ee*365,sh=new Date().getTimezoneOffset()*he;function Kf(e){return Math.floor((e.getTime()-sh)/yi)}function $f(e){return new Date(sh+e*yi)}var gn=new mi(Kf,$f),nh=new Date().getTimezoneOffset()*he;function Xf(e){return Math.floor((e.getTime()-nh)/he)}function qf(e){return new Date(nh+e*he)}var fn=new mi(Xf,qf),oh=new Date().getTimezoneOffset()*he;function Jf(e){return Math.floor((e.getTime()-oh)/De)}function Qf(e){return new Date(oh+e*De)}var mn=new mi(Jf,Qf);function tm(e){const t=e.getTimezoneOffset()*he;return Math.floor((e.getTime()-t)/Ee)}function em(e){const t=new Date(1970,0,1);return t.setDate(t.getDate()+e),t}var br=new mi(tm,em);function Ui(e){const i=(7+e-4)%7;function s(o){const a=o.getTimezoneOffset()*he;return Math.floor((o.getTime()-a)/oi-i/7)}function n(o){const a=new Date(1970,0,1);return a.setDate(a.getDate()+o*7+i),a}return new mi(s,n)}var So=Ui(0),xA=Ui(1),bA=Ui(2),vA=Ui(3),MA=Ui(4),SA=Ui(5),IA=Ui(6);function im(e){return e.getFullYear()*12+e.getMonth()}function sm(e){const t=Math.floor(e/12),i=e-t*12;return new Date(t,i,1)}var Ns=new mi(im,sm);function nm(e){return e.getFullYear()}function om(e){const t=new Date;return t.setFullYear(e),t.setMonth(0,1),t.setHours(0,0,0,0),t}var vr=new mi(nm,om),Io={periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]};function Mr(e,t=new Date(e.getFullYear(),0,1)){const i=e.getTimezoneOffset()-t.getTimezoneOffset(),s=e.getTime()-t.getTime()+i*6e4,n=36e5*24;return Math.floor(s/n)}function ah(e,t){const s=new Date(e.getFullYear(),0,1).getDay(),n=(t-s+7)%7,o=new Date(e.getFullYear(),0,n+1);return o<=e?Math.floor(Mr(e,o)/7)+1:0}var am=0,rh=1,lh=4;function ch(e,t=e.getFullYear()){const s=new Date(t,0,1).getDay(),n=(lh-s+7)%7,o=new Date(t,0,n-(lh-rh)+1);return o<=e?Math.floor(Mr(e,o)/7)+1:ch(e,t-1)}function rm(e){const t=e.getTimezoneOffset(),i=Math.abs(t);return`${t>0?"-":"+"}${Xt(Math.floor(i/60),2,"0")}${Xt(Math.floor(i%60),2,"0")}`}var lm={a:e=>Io.shortDays[e.getDay()],A:e=>Io.days[e.getDay()],b:e=>Io.shortMonths[e.getMonth()],B:e=>Io.months[e.getMonth()],c:"%x, %X",d:(e,t)=>Xt(e.getDate(),2,t??"0"),e:"%_d",f:(e,t)=>Xt(e.getMilliseconds()*1e3,6,t??"0"),H:(e,t)=>Xt(e.getHours(),2,t??"0"),I:(e,t)=>{const i=e.getHours()%12;return i===0?"12":Xt(i,2,t??"0")},j:(e,t)=>Xt(Mr(e)+1,3,t??"0"),m:(e,t)=>Xt(e.getMonth()+1,2,t??"0"),M:(e,t)=>Xt(e.getMinutes(),2,t??"0"),L:(e,t)=>Xt(e.getMilliseconds(),3,t??"0"),p:e=>e.getHours()<12?"AM":"PM",Q:e=>String(e.getTime()),s:e=>String(Math.floor(e.getTime()/1e3)),S:(e,t)=>Xt(e.getSeconds(),2,t??"0"),u:e=>{let t=e.getDay();return t<1&&(t+=7),String(t%7)},U:(e,t)=>Xt(ah(e,am),2,t??"0"),V:(e,t)=>Xt(ch(e),2,t??"0"),w:(e,t)=>Xt(e.getDay(),2,t??"0"),W:(e,t)=>Xt(ah(e,rh),2,t??"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(e,t)=>Xt(e.getFullYear()%100,2,t??"0"),Y:(e,t)=>Xt(e.getFullYear(),4,t??"0"),Z:e=>rm(e),"%":()=>"%"},cm={_:" ",0:"0","-":""};function Xt(e,t,i){const s=String(Math.floor(e));return s.length>=t?s:`${i.repeat(t-s.length)}${s}`}function Do(e){const t=[];for(;e.length>0;){let i=e.indexOf("%");if(i!==0){const r=i>0?e.substring(0,i):e;t.push(r)}if(i<0)break;const s=e[i+1],n=cm[s];n!=null&&i++;const o=e[i+1],a=lm[o];if(typeof a=="function")t.push([a,n]);else if(typeof a=="string"){const r=Do(a);t.push([r,n])}else t.push(`${n??""}${o}`);e=e.substring(i+2)}return i=>{const s=typeof i=="number"?new Date(i):i;return t.map(n=>typeof n=="string"?n:n[0](s,n[1])).join("")}}function ue(e){return e instanceof Date?e.getTime():e}function hh(e,t,i){const s=hm(e,t,i),n=Do(s);return o=>n(o)}function hm(e,t,i=0){let s=1/0;for(let h=1;h<e.length;h++)s=Math.min(s,Math.abs(e[h].valueOf()-e[h-1].valueOf()));const[n,o]=t.length===0?[0,0]:Wt([t[0].valueOf(),t[t.length-1].valueOf()]),a=new Date(n).getFullYear(),l=new Date(o).getFullYear()-a>0,c=isFinite(s)?um(s,e):dm(e[0]);return gm(Math.max(c-i,0),l,e)}function um(e,t){return e<yi?0:e<he?1:e<De?2:e<Ee?3:e<oi?4:e<Ee*28||e<Ee*31&&pm(t)?5:e<ks?6:7}function dm(e){return gn.floor(e)<e?0:fn.floor(e)<e?1:mn.floor(e)<e?2:br.floor(e)<e?3:Ns.floor(e)<e?So.floor(e)<e?4:5:vr.floor(e)<e?6:7}function pm(e){let t=new Date(e[0]).getMonth();for(let i=1;i<e.length;i++){const s=new Date(e[i]).getMonth();if(t===s)return!0;t=s}return!1}function gm(e,t,i){const s=ue(i[0]),n=ue(i.at(-1)),o=Math.abs(n-s),a=t||e===7,r=o===0,c=[["hour",6*De,14*Ee,3,"%I %p"],["hour",he,6*De,3,"%I:%M"],["second",1e3,6*De,1,":%S"],["ms",0,6*De,0,".%L"],["am/pm",he,6*De,3,"%p"]," ",["day",Ee,oi,4,"%a"],["month",r?0:oi,52*oi,5,"%b %d"],["month",5*oi,10*ks,6,"%B"]," ",["year",a?0:ks,1/0,7,"%Y"]].filter(d=>{if(typeof d=="string")return!0;const[p,f,y,b]=d;return b>=e&&f<=o&&o<y}).reduce((d,p)=>(typeof p=="string"?d.result.push(p):d.used.has(p[0])||(d.result.push(p),d.used.add(p[0])),d),{result:[],used:new Set}).result,h=c.findIndex(d=>typeof d!="string"),u=c.findLastIndex(d=>typeof d!="string");return c.slice(h,u+1).map(d=>typeof d=="string"?d:d[4]).join("").replaceAll(/\s+/g," ").trim()}import{Logger as fm,clamp as wo}from"ag-charts-core";var yn=(e,t)=>{const i=Symbol(String(t));e[i]=void 0,Object.defineProperty(e,t,{get(){return this[i]},set(s){this[i]!==s&&(this[i]=s,this.invalid=!0)},enumerable:!0,configurable:!1})};import{clamp as uh}from"ag-charts-core";function dh(e,t,i){if(i==null||i[0]===0&&i[1]===1)return e;const s=uh(0,Math.floor(i[0]*e.length),e.length),n=uh(0,Math.ceil(i[1]*e.length),e.length),o=t?e.length-n:s,a=t?e.length-s:n;return e.slice(o,a)}var Ao=class Qg extends xr{constructor(){super(...arguments),this.invalid=!0,this.range=[0,1],this.round=!1,this.interval=void 0,this._bandwidth=1,this._step=1,this._inset=1,this._rawBandwidth=1,this._paddingInner=0,this._paddingOuter=0}static is(t){return t instanceof Qg}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=wo(0,t,1),this._paddingInner=t,this._paddingOuter=t}get padding(){return this._paddingInner}set paddingInner(t){this.invalid=!0,this._paddingInner=wo(0,t,1)}get paddingInner(){return this._paddingInner}set paddingOuter(t){this.invalid=!0,this._paddingOuter=wo(0,t,1)}get paddingOuter(){return this._paddingOuter}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&fm.warnOnce("Expected update to not invalidate scale"))}ticks(t,i=this.domain,s){return dh(i,!1,s)}convert(t,i){this.refresh();const s=this.getIndex(t);return s==null||s<0||s>=this.domain.length?NaN:this.ordinalRange(s)}invertNearestIndex(t){this.refresh();const{domain:i}=this;if(i.length===0)return-1;let s=0,n=i.length-1,o=1/0,a=0;for(;s<=n;){const r=(n+s)/2|0,l=this.ordinalRange(r),c=Math.abs(l-t);if(c===0)return r;c<o&&(o=c,a=r),l<t?s=r+1:n=r-1}return a}update(){const t=this.domain.length;if(t===0)return;const[i,s]=this.range;let{_paddingInner:n}=this;const{_paddingOuter:o,round:a}=this,r=s-i;let l;t===1?(n=0,l=r*(1-o*2)):l=r/Math.max(1,t-n+o*2);const c=a?Math.floor(l):l;let h=i+(r-c*(t-n))/2,u=c*(1-n);a&&(h=Math.round(h),u=Math.round(u)),this._step=c,this._inset=h,this._bandwidth=u,this._rawBandwidth=l*(1-n)}ordinalRange(t){const{_inset:i,_step:s,range:n}=this,o=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return wo(o,i+s*t,a)}};g([yn],Ao.prototype,"range",2),g([yn],Ao.prototype,"round",2),g([yn],Ao.prototype,"interval",2);var Lo=Ao,Sr=class extends Lo{constructor(){super(...arguments),this.type="band",this.index=void 0,this._domain=[]}set domain(e){this._domain!==e&&(this.invalid=!0,this._domain=e,this.index=void 0)}get domain(){return this._domain}normalizeDomains(...e){let t;const i=new Set;let s=!0;for(const n of e)i.has(n)||(i.add(n),t==null?t=ph(n):(s&&(s=mm(n,t)),t=ph([...t,...n])));return t??(t=[]),{domain:t,animatable:s}}toDomain(e){}invert(e,t=!1){this.refresh();const i=t?this.bandwidth/2:0,s=this.invertNearestIndex(Math.max(0,e-i));return t||e===this.ordinalRange(s)?this.domain[s]:void 0}getIndex(e){let{index:t}=this;if(t==null){const{domain:i}=this;t=new Map;for(let s=0;s<i.length;s++)t.set(ue(i[s]),s);this.index=t}return t.get(ue(e))}};function ph(e){let t;const i=new Set;for(const s of e){const n=ue(s),o=i.size;i.add(n),i.size!==o?t?.push(s):t??(t=e.slice(0,i.size))}return t??e}function mm(e,t){let i=-1;for(const s of e){const n=t.indexOf(s);if(n===-1)i=1/0;else{if(n<=i)return!1;i=n}}return!0}import{Logger as gh,isArray as Ir,isBoolean as ym,isColor as xm,isFiniteNumber as Dr,isFunction as fh,isNumber as xi,isObject as Co,isString as bm,isValidDate as mh,stringifyValue as vm}from"ag-charts-core";import{Logger as ko,isArray as Mm,isPlainObject as Sm}from"ag-charts-core";var nt=class{handleUnknownProperties(e,t){}set(e){const{className:t=this.constructor.name}=this.constructor;if(typeof e!="object")return ko.warn(`unable to set ${t} - expecting a properties object`),this;const i=new Set(Object.keys(e));for(const s of Wi(this))if(i.has(s)){const n=e[s],o=this;if(ai(o[s]))if(o[s]instanceof No){const a=o[s].reset(n);a!=null?o[s]=a:ko.warn(`unable to set [${s}] - expecting a properties array`)}else o[s].set(n);else Sm(n)?o[s]=qc(n,o[s]??{}):o[s]=n;i.delete(s)}this.handleUnknownProperties(i,e);for(const s of i)ko.warn(`unable to set [${s}] in ${t} - property is unknown`);return this}isValid(e){return Wi(this).every(t=>{const i=Ff(this,t);if(i==null)return!0;const s=i.optional===!0||typeof this[t]<"u";return s||ko.warnOnce(`${e??""}[${t}] is required.`),s})}toJson(){return Wi(this).reduce((e,t)=>{const i=this[t];return e[t]=ai(i)?i.toJson():i,e},{})}},No=class tf extends Array{constructor(t,...i){super(i.length);const n=(o=>!!o?.prototype?.constructor?.name)(t)?o=>new t().set(o):t;Object.defineProperty(this,"itemFactory",{value:n,enumerable:!1,configurable:!1}),this.set(i)}set(t){if(Mm(t)){this.length=t.length;for(let i=0;i<t.length;i++)this[i]=this.itemFactory(t[i])}return this}reset(t){if(Array.isArray(t))return new tf(this.itemFactory,...t)}toJson(){return this.map(t=>t?.toJson?.()??t)}};function ai(e){return e instanceof nt||e instanceof No}var Im=!1,x=Im?(e,t={})=>{const{optional:i=!1}=t;return Ls((s,n,o)=>{const a={...t,target:s,property:n};if(i&&typeof o>"u"||e(o,a)){if(ai(s[n])&&!ai(o))return s[n].set(o),s[n]}else{const r=vm(o,50),l=String(n).replace(/^_*/,""),c=s.constructor.className??s.constructor.name.replace(/Properties$/,""),h=e.message?`; expecting ${bn(e,a)}`:"";gh.warn(`TempValidation!!! Property [${l}] of [${c}] cannot be set to [${r}]${h}, ignoring.`)}return o},void 0,{optional:i})}:()=>Of,Ki=(...e)=>{const t=[];return pt((i,s)=>(t.length=0,e.every(n=>{const o=n(i,s);return o||t.push(bn(n,s)),o})),()=>t.filter(Boolean).join(" AND "))},de=(...e)=>pt((t,i)=>e.some(s=>s(t,i)),t=>e.map(Om(t)).filter(Boolean).join(" OR ")),O=Eo(pt((e,t)=>ai(e)||Co(e)&&ai(t.target[t.property]),"a properties object")),CA=Eo(pt(e=>Co(e),"an object")),Z=pt(ym,"a boolean"),Ve=pt(fh,"a function"),k=pt(bm,"a string"),tt=Pm(pt(Dr,"a number")),Dm=pt(e=>xi(e)&&!isNaN(e),"a real number"),wr=pt(e=>xi(e)&&isNaN(e),"NaN"),R=tt.restrict({min:0}),yt=tt.restrict({min:0,max:1}),Ar=de(tt,wr),Ts=Rm(pt(Ir,"an array")),qt=(e,t)=>pt((i,s)=>Ir(i)&&i.every(n=>e(n,s)),i=>{const s=bn(Ts,i)??"";return typeof t=="function"?`${s} of ${t(i)}`:t?`${s} of ${t}`:s}),To=e=>Dr(e)||mh(e),Lr=e=>pt((t,i)=>!To(t)||!To(i.target[e])||t<i.target[e],`to be less than ${e}`),Cr=e=>pt((t,i)=>!To(t)||!To(i.target[e])||t>i.target[e],`to be greater than ${e}`),yh=pt(mh,"Date object"),xh=de(yh,R),bh="A color string can be in one of the following formats to be valid: #rgb, #rrggbb, rgb(r, g, b), rgba(r, g, b, a) or a CSS color name such as 'white', 'orange', 'cyan', etc",lt=pt(xm,`color string. ${bh}`),bi=Eo(pt(e=>Co(e)&&e.type==="gradient","a color gradient object")),vi=Eo(pt(e=>Co(e)&&e.type==="pattern","a color pattern object")),xn=pt(qt(lt),`color strings. ${bh}`),kA=qt(Z,"boolean values"),wm=qt(tt,"numbers"),Am=qt(k,"strings"),NA=pt(qt(yh),"Date objects"),vh=pt(qt(O),"objects"),TA=xt(["butt","round","square"],"a line cap"),EA=xt(["round","bevel","miter"],"a line join"),OA=xt(["solid","dashed","dotted"],"a line style"),ri=pt(qt(R),"numbers specifying the length in pixels of alternating dashes and gaps, for example, [6, 3] means dashes with a length of 6 pixels with gaps between of 3 pixels."),Lm=xt(["top","right","bottom","left"],"a position"),Es=xt(["normal","italic","oblique"],"a font style"),Os=de(xt(["normal","bold","bolder","lighter"],"a font weight"),tt.restrict({min:1,max:1e3})),kr=xt(["never","always","hyphenate","on-space"],"a text wrap strategy"),Cm=xt(["left","center","right"],"a text align"),RA=xt(["top","middle","bottom"],"a vertical align"),PA=xt(["ellipsis","hide"],"an overflow strategy"),km=xt(["horizontal","vertical"],"a direction"),FA=xt(["inside","outside"],"a placement"),Nr=de(xt(["exact","nearest"],"interaction range"),tt),Mh=xt(["top","bottom","left","right"]);function xt(e,t="a"){return pt((i,s)=>{const n=e.find(o=>{const a=typeof o=="string"?o:o.value;return i===a});if(n==null)return!1;if(typeof n!="string"&&(n.deprecated===!0||n.deprecatedTo!=null)){const o=[`Property [%s] with value '${n.value}' is deprecated.`];n.deprecatedTo&&o.push(`Use ${n.deprecatedTo} instead.`),gh.warnOnce(o.join(" "),s.property)}return!0},`${t} keyword such as ${Em(e)}`)}var Nm=de(Ki(tt.restrict({min:1}),Lr("maxSpacing")),wr),Tm=de(Ki(tt.restrict({min:1}),Cr("minSpacing")),wr);function pt(e,t){return e.message=t,e}function Em(e){const t=e.filter(s=>typeof s=="string"||s.undocumented!==!0).map(s=>`'${typeof s=="string"?s:s.value}'`);if(t.length===1)return t[0];const i=t.pop();return`${t.join(", ")} or ${i}`}function bn(e,t){return fh(e.message)?e.message(t):e.message}function Om(e){return t=>bn(t,e)}function Rm(e){return Object.assign(e,{restrict({length:t,minLength:i}={}){let s="an array";return xi(i)&&i>0?s="a non-empty array":xi(t)&&(s=`an array of length ${t}`),pt(n=>Ir(n)&&(xi(t)?n.length===t:!0)&&(xi(i)?n.length>=i:!0),s)}})}function Pm(e){return Object.assign(e,{restrict({min:t,max:i}={}){const s=["a number"],n=xi(t),o=xi(i);return n&&o?s.push(`between ${t} and ${i} inclusive`):n?s.push(`greater than or equal to ${t}`):o&&s.push(`less than or equal to ${i}`),pt(a=>Dr(a)&&(n?a>=t:!0)&&(o?a<=i:!0),s.join(" "))}})}function Eo(e){return Object.assign(e,{restrict(t){return pt(i=>i instanceof t,i=>bn(e,i)??`an instance of ${t.name}`)}})}import{arraysEqual as Fm,diffArrays as jm}from"ag-charts-core";function ne(e,t){const{nodes:i,selections:s}=mr(e);for(const n of s){for(const o of n.nodes()){const a=t(o,o.datum);o.setProperties(a)}n.cleanup()}for(const n of i){const o=t(n,n.datum);n.setProperties(o)}}import{clamp as zm}from"ag-charts-core";import{Logger as Tr,getWindow as Bm,toArray as Sh}from"ag-charts-core";var Vm=2e3,Ih=Date.now(),Gm=()=>{const e=Date.now()-Ih;if(e>Vm){const t=(Math.floor(e/100)/10).toFixed(1);Tr.log(`**** ${t}s since last log message ****`)}Ih=Date.now()},St={create(...e){return Object.assign((...i)=>{St.check(...e)&&(typeof i[0]=="function"&&(i=Sh(i[0]())),Gm(),Tr.log(...i))},{check:()=>St.check(...e),group:(i,s)=>St.check(...e)?Tr.logGroup(i,s):s()})},check(...e){return e.length===0&&e.push(!0),Sh(Bm("agChartsDebug")).some(i=>e.includes(i))},inDevelopmentMode(e){if(St.check("dev"))return e()}};function Dh({context:e,pixelRatio:t,width:i,height:s}){e.save(),e.resetTransform(),e.clearRect(0,0,Math.ceil(i*t),Math.ceil(s*t)),e.restore()}function wh(e){if(St.check("canvas")){const t=e.save.bind(e),i=e.restore.bind(e);let s=0;Object.assign(e,{save(){t(),s++},restore(){if(s===0)throw new Error("AG Charts - Unable to restore() past depth 0");i(),s--},verifyDepthZero(){if(s!==0)throw new Error(`AG Charts - Save/restore depth is non-zero: ${s}`)}})}}function Ah(e,t,i){return[Math.floor(e*i),Math.floor(t*i)]}var Er=class{constructor(e){const{width:t,height:i,pixelRatio:s,willReadFrequently:n=!1}=e;this.width=t,this.height=i,this.pixelRatio=s;const[o,a]=Ah(t,i,s);this.canvas=new OffscreenCanvas(o,a),this.context=this.canvas.getContext("2d",{willReadFrequently:n}),this.context.setTransform(s,0,0,s,0,0),wh(this.context)}drawImage(e,t=0,i=0){return e.drawImage(this.canvas,t,i)}transferToImageBitmap(){return this.canvas.transferToImageBitmap()}resize(e,t,i){if(!(e>0&&t>0))return;const{canvas:s,context:n}=this;if(e!==this.width||t!==this.height||i!==this.pixelRatio){const[o,a]=Ah(e,t,i);s.width=o,s.height=a}n.setTransform(i,0,0,i,0,0),this.width=e,this.height=t,this.pixelRatio=i}clear(){Dh(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{clamp as _m}from"ag-charts-core";import{createSvgElement as Ym}from"ag-charts-core";var Mi=Math.PI*2,vn=Math.PI/2;function Gt(e){return e%=Mi,e+=Mi,e%=Mi,e}function Oo(e){return e%=Mi,e<-Math.PI?e+=Mi:e>=Math.PI&&(e-=Mi),e}function $i(e,t,i){const s=Gt(e),n=Gt(t),o=Gt(i);return n<o?n<=s&&s<=o:n>o?n<=s||s<=o:!0}function Lt(e){return e/180*Math.PI}function Wm(e,t){return e=Gt(e),t=Gt(t),t-e+(e>t?Mi:0)}function Zm(e){const t=Gt(e);return t<=vn?t/vn:t<=Math.PI?(Math.PI-t)/vn:t<=1.5*Math.PI?(t-Math.PI)/vn:(Mi-t)/vn}import{createSvgElement as Hm}from"ag-charts-core";import{Logger as Or,clamp as Um}from"ag-charts-core";var Lh=e=>{const t=wt.fromString(e),[i,s,n]=wt.RGBtoOKLCH(t.r,t.g,t.b);return{l:i,c:s,h:n,a:t.a}},Rr=1e-6,Ch=e=>e.c<Rr||e.l<Rr||e.l>1-Rr,Km=(e,t,i)=>{i=Um(0,i,1);let s;if(Ch(e))s=t.h;else if(Ch(t))s=e.h;else{const r=e.h;let l=t.h;const c=t.h-e.h;c>180?l-=360:c<-180&&(l+=360),s=r*(1-i)+l*i}const n=e.c*(1-i)+t.c*i,o=e.l*(1-i)+t.l*i,a=e.a*(1-i)+t.a*i;return wt.fromOKLCH(o,n,s,a)},Ro=class extends xr{constructor(){super(...arguments),this.type="color",this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.parsedRange=this.range.map(Lh)}update(){const{domain:e,range:t}=this;e.length<2&&(Or.warnOnce("`colorDomain` should have at least 2 values."),e.length===0?e.push(0,1):e.length===1&&e.push(e[0]+1));for(let i=1;i<e.length;i++){const s=e[i-1],n=e[i];if(s>=n){Or.warnOnce("`colorDomain` values should be supplied in ascending order."),e.sort((o,a)=>o-a);break}}if(t.length<e.length)for(let i=t.length;i<e.length;i++)t.push(t.length>0?t[0]:"black");this.parsedRange=this.range.map(Lh)}normalizeDomains(...e){return{domain:e.flat(),animatable:!0}}toDomain(){}convert(e){this.refresh();const{domain:t,range:i,parsedRange:s}=this,n=t[0],o=t.at(-1),a=i[0],r=i[i.length-1];if(e<=n)return a;if(e>=o)return r;let l,c;if(t.length===2){const d=(e-n)/(o-n),p=1/(i.length-1);l=i.length<=2?0:Math.min(Math.floor(d*(i.length-1)),i.length-2),c=(d-l*p)/p}else{for(l=0;l<t.length-2&&!(e<t[l+1]);l++);const d=t[l],p=t[l+1];c=(e-d)/(p-d)}const h=s[l],u=s[l+1];return Km(h,u,c).toRgbaString()}invert(){}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&Or.warnOnce("Expected update to not invalidate scale"))}};g([yn],Ro.prototype,"domain",2),g([yn],Ro.prototype,"range",2);var Pr=class{constructor(e,t=[],i){this.colorSpace=e,this.stops=t,this.bbox=i,this._cache=void 0}createGradient(e,t,i){const s=this.bbox??t;if(isNaN(s.x)||isNaN(s.y))return;if(this._cache!=null&&this._cache.ctx===e&&this._cache.bbox.equals(s))return this._cache.gradient;const{stops:n,colorSpace:o}=this;if(n.length===0)return;if(n.length===1)return n[0].color;let a=this.createCanvasGradient(e,s,i);if(a==null)return;const r=o==="oklch",l=.05;let c=n[0];a.addColorStop(c.stop,c.color);for(let h=1;h<n.length;h+=1){const u=n[h];if(r){const d=new Ro;d.domain=[c.stop,u.stop],d.range=[c.color,u.color];for(let p=c.stop+l;p<u.stop;p+=l)a.addColorStop(p,d.convert(p))}a.addColorStop(u.stop,u.color),c=u}return"createPattern"in a&&(a=a.createPattern()),this._cache={ctx:e,bbox:s,gradient:a},a}toSvg(e){const t=this.bbox??e,i=this.createSvgGradient(t);return this.stops.forEach(({stop:s,color:n})=>{const o=Hm("stop");o.setAttribute("offse