UNPKG

ag-charts-community

Version:

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

14 lines 933 kB
(function(ra,bs){typeof exports=="object"&&typeof module=="object"?module.exports=bs():typeof define=="function"&&define.amd?define("agCharts",[],bs):typeof exports=="object"?exports.agCharts=bs():ra.agCharts=bs()})(this,()=>{var ra={},bs={exports:ra};if(typeof H2>"u")var H2=function(t){throw new Error("Unknown module: "+t)};var Fu=Object.defineProperty,MD=Object.getOwnPropertyDescriptor,gm=Object.getOwnPropertyNames,SD=Object.prototype.hasOwnProperty,Be=(e,t)=>function(){return e&&(t=(0,e[gm(e)[0]])(e=0)),t},_u=(e,t)=>{for(var i in t)Fu(e,i,{get:t[i],enumerable:!0})},DD=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of gm(t))!SD.call(e,n)&&n!==i&&Fu(e,n,{get:()=>t[n],enumerable:!(s=MD(t,n))||s.enumerable});return e},N=e=>DD(Fu({},"__esModule",{value:!0}),e),fm={};_u(fm,{error:()=>ym,errorOnce:()=>LD,log:()=>ID,logGroup:()=>CD,reset:()=>kD,table:()=>AD,warn:()=>mm,warnOnce:()=>oa});function ID(...e){console.log(...e)}function mm(e,...t){console.warn(`AG Charts - ${e}`,...t)}function ym(e,...t){typeof e=="object"?console.error("AG Charts error",e,...t):console.error(`AG Charts - ${e}`,...t)}function AD(...e){console.table(...e)}function bm(e,t,i){let s;e instanceof Error?s=e.message:typeof e=="string"?s=e:typeof e=="object"?s=JSON.stringify(e):s=String(e);const n=`${t}: ${s}`;Zl.has(n)||(i(e),Zl.add(n))}function oa(e,...t){bm(e,"Logger.warn",i=>mm(i,...t))}function LD(e,...t){bm(e,"Logger.error",i=>ym(i,...t))}function kD(){Zl.clear()}function CD(e,t){console.groupCollapsed(e);try{return t()}finally{console.groupEnd()}}var Zl,ju=Be({"packages/ag-charts-core/src/globals/logger.ts"(){"use strict";Zl=new Set}}),zu,wD=Be({"packages/ag-charts-core/src/interfaces/moduleDefinition.ts"(){"use strict";zu=(e=>(e.Axis="axis",e.Chart="chart",e.Preset="preset",e.Plugin="plugin",e.Series="series",e))(zu||{})}}),xm={};_u(xm,{detectChartDefinition:()=>PD,getAxisModule:()=>RD,getPresetModule:()=>FD,getSeriesModule:()=>_D,hasModule:()=>OD,listModulesByType:()=>ED,register:()=>vm,registerMany:()=>TD,reset:()=>ND});function vm(e){const t=xs.get(e.name);if(t&&(t.enterprise||!e.enterprise))throw new Error(`AG Charts - Module '${e.name}' already registered`);xs.set(e.name,e)}function TD(e){for(const t of e)vm(t)}function ND(){xs.clear()}function OD(e){return xs.has(e)}function*ED(e){for(const t of xs.values())aa(e,t)&&(yield t)}function PD(e){for(const t of xs.values())if(aa("chart",t)&&t.detect(e))return t;throw new Error("AG Charts - Unknown chart type; Check options are correctly structured and series types are specified")}function RD(e){const t=xs.get(e);if(aa("axis",t))return t}function FD(e){const t=xs.get(e);if(aa("preset",t))return t}function _D(e){const t=xs.get(e);if(aa("series",t))return t}function aa(e,t){return t?.type===e}var xs,jD=Be({"packages/ag-charts-core/src/globals/moduleRegistry.ts"(){"use strict";xs=new Map}}),zD=Be({"packages/ag-charts-core/src/globals/index.ts"(){"use strict";ju(),jD()}}),BD=Be({"packages/ag-charts-core/src/interfaces/globalTypes.ts"(){"use strict"}}),Mm,GD=Be({"packages/ag-charts-core/src/classes/eventEmitter.ts"(){"use strict";Mm=class{constructor(){this.events=new Map}on(e,t){return this.events.has(e)||this.events.set(e,new Set),this.events.get(e)?.add(t),()=>this.off(e,t)}off(e,t){const i=this.events.get(e);i&&(i.delete(t),i.size===0&&this.events.delete(e))}emit(e,t){this.events.get(e)?.forEach(i=>i(t))}clear(e){e?this.events.delete(e):this.events.clear()}}}});function Xl(e){return e?Ji.document?.[e]:Ji.document}function Sm(e){return e?Ji.window?.[e]:Ji.window}function VD(e){Ji.document=e}function UD(e){Ji.window=e}var Ji,ql=Be({"packages/ag-charts-core/src/utils/dom/globalsProxy.ts"(){"use strict";Ji={},typeof window<"u"?Ji.window=window:typeof global<"u"&&(Ji.window=global.window),typeof document<"u"?Ji.document=document:typeof global<"u"&&(Ji.document=global.document)}});function Dm(e,t,i){const s=Xl().createElement(e);if(typeof t=="object"&&(i=t,t=void 0),t)for(const n of t.split(" "))s.classList.add(n);return i&&Object.assign(s.style,i),s}function WD(e){return Xl().createElementNS("http://www.w3.org/2000/svg",e)}var Im=Be({"packages/ag-charts-core/src/utils/dom/domElements.ts"(){"use strict";ql()}});function HD(e,t){const i=Xl("body"),s=Dm("a",{display:"none"});s.href=e,s.download=t,i.appendChild(s),s.click(),setTimeout(()=>i.removeChild(s))}var YD=Be({"packages/ag-charts-core/src/utils/dom/domDownload.ts"(){"use strict";Im(),ql()}});function Am(e){const t=Sm("Option"),{style:i}=new t;return i.color=e,i.color||null}var $D=Be({"packages/ag-charts-core/src/utils/dom/domUtils.ts"(){"use strict";ql()}}),Lm=Be({"packages/ag-charts-core/src/utils/dom/index.ts"(){"use strict";YD(),Im(),$D(),ql()}});function km(e){return e!=null}function Xn(e){return Array.isArray(e)}function Cm(e){return typeof e=="boolean"}function Bu(e){return e instanceof Date}function Gu(e){return Bu(e)&&!isNaN(Number(e))}function KD(e){return e instanceof RegExp}function gn(e){return typeof e=="function"}function fn(e){return typeof e=="object"&&e!==null&&!Xn(e)}function ZD(e){return Xn(e)||wm(e)}function wm(e){return typeof e=="object"&&e!==null&&e.constructor?.name==="Object"}function qn(e){return typeof e=="string"}function XD(e){return typeof e=="number"}function mn(e){return Number.isFinite(e)}function qD(e){return typeof window<"u"&&e instanceof HTMLElement}function QD(e,t){return qn(t)&&Object.keys(e).includes(t)}function JD(e,t){return Object.values(e).includes(t)}function eI(e){return typeof e=="symbol"}function Tm(e){return qn(e)&&(e==="none"||Am(e)!=null)}function tI(e,t){return e in t}var la=Be({"packages/ag-charts-core/src/utils/typeGuards.ts"(){"use strict";Lm()}});function iI(e,t=0,i){const{leading:s=!1,trailing:n=!0,maxWait:r=1/0}=i??{};let o,a;if(r<t)throw new Error("Value of maxWait cannot be lower than waitMs.");function l(...c){if(s&&!a){a=Date.now(),o=setTimeout(()=>a=null,t),e(...c);return}let h=t;if(r!==1/0&&a){const u=Date.now()-a;t>r-u&&(h=r-u)}clearTimeout(o),a??(a=Date.now()),o=setTimeout(()=>{a=null,n&&e(...c)},h)}return Object.assign(l,{cancel(){clearTimeout(o),a=null}})}function sI(e,t,i){const{leading:s=!0,trailing:n=!0}=i??{};let r,o,a=!1;function l(){n&&o?(r=setTimeout(l,t),e(...o)):a=!1,o=null}function c(...h){a?o=h:(a=!0,r=setTimeout(l,t),s?e(...h):o=h)}return Object.assign(c,{cancel(){clearTimeout(r),a=!1,o=null}})}function Vu(e,t,i=""){try{return e(...t)}catch(s){const n=i?` \`${i}\``:"";oa(`Uncaught exception in user callback${n}`,s)}}var Nm=Be({"packages/ag-charts-core/src/utils/functions.ts"(){"use strict";ju()}});function Ql(e,t="and",i=String,s=1/0){if(e.length===0)return"";if(e.length===1)return i(e[0]);e=e.map(i);const n=e.pop();if(e.length>=s){const r=e.length-(s-1);return`${e.slice(0,s-1).join(", ")}, and ${r} more ${t} ${n}`}return`${e.join(", ")} ${t} ${n}`}function Jl(e,t=1/0){if(typeof e=="number"){if(isNaN(e))return"NaN";if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity"}const i=JSON.stringify(e)??typeof e;return i.length>t?`${i.slice(0,t)}... (+${i.length-t} characters)`:i}function nI(e){let t=1;for(let i=0;i<e.length;i++)e.charCodeAt(i)===10&&t++;return t}function Om(e,t){if(e===t)return 0;const[i,s]=e.length<t.length?[e,t]:[t,e],n=i.length,r=s.length;let o=new Array(n+1).fill(0).map((l,c)=>c),a=new Array(n+1);for(let l=1;l<=r;l++){a[0]=l;for(let c=1;c<=n;c++){const h=s[l-1]===i[c-1]?0:1;a[c]=Math.min(o[c]+1,a[c-1]+1,o[c-1]+h)}[o,a]=[a,o]}return o[n]}var Em=Be({"packages/ag-charts-core/src/utils/strings.ts"(){"use strict"}});function ca(e,t){return mn(t)?`${e}[${t}]`:e?`${e}.${t}`:t}function $r(e,t,i=""){if(!fn(e))return{cleared:null,invalid:[new Kr("required","an object",e,i)]};const s={},n=[],r=new Set(Object.keys(e)),o=[];if(ua in t){const a=Object.keys(t),l=t[ua];if(e.type!=null&&a.includes(e.type)||e.type==null&&l!=null){const{type:c=l,...h}=e,u=$r(h,t[c],i);Object.assign(s,{type:c},u.cleared);for(const d of u.invalid)d.setUnionType(c,i);n.push(...u.invalid)}else{const c=Ql(a,"or",h=>`'${h}'`);n.push(new Kr("required",`a keyword such as ${c}`,e.type,i,"type"))}return{cleared:s,invalid:n}}for(const a of Object.keys(t)){const l=t[a],c=l[Uu],h=e[a];if(r.delete(a),typeof h>"u"&&(l[Wu]||o.push(a),!c))continue;const u=ca(i,a);if(gn(l)){const p=l(h,{options:e,path:u});if(typeof p=="object"){if(n.push(...p.invalid),p.valid){s[a]=p.cleared;continue}else if(ec(p.invalid,u))continue}else if(p){s[a]=h;continue}n.push(new Kr(c?"required":"invalid",l[Si],h,i,a))}else{const d=$r(h,l,u);d.cleared!=null&&(s[a]=d.cleared),n.push(...d.invalid)}}for(const a of r){const l=e[a];typeof l>"u"||n.push(new tc(o,l,i,a))}return{cleared:s,invalid:n}}function rI(e,t,i=2){const s=[],n=e.toLowerCase(),r=Rm.get(n);for(const o of t){const a=o.toLowerCase();(r?.has(o)||a.includes(n)||Om(n,a)<=i)&&s.push(o)}return s}function je(e,t){return Object.assign(gn(e)?(i,s)=>e(i,s):{...e},{[Si]:t})}function ze(e){return Object.assign(gn(e)?(t,i)=>e(t,i):ts(e),{[Uu]:!0,[Si]:e[Si]})}function es(e){return Object.assign(gn(e)?(t,i)=>e(t,i):ts(e),{[Wu]:!0,[Si]:e[Si]})}function Mi(...e){fn(e[0])&&(e=Object.values(e[0]));const t=Ql(e,"or",i=>`'${i}'`);return je(i=>e.includes(i),`a keyword such as ${t}`)}function ec(e,t){return e.some(i=>i.type==="required"&&i.path===t)}function Pm(e,t){return i=>{if(i instanceof tc)return oa(`Callback \`${e.path}\` returned an unknown property \`${ca(i.path,i.key)}\`${i.getPostfix()}`);const s=Jl(i.value,50);oa(i.key?`Callback \`${e.path}\` returned an invalid property \`${ca(i.path,i.key)}\`: \`${s}\`; expecting ${i.description}, ignoring.`:`Callback \`${e.path}\` returned an invalid value \`${s}\`; expecting ${t??i.description}, ignoring.`)}}var Si,Uu,ha,Wu,ua,Rm,Hu,Kr,tc,ts,Yu,ic,Qn,da,Fm,_m,pa,jm,ci,zm,Bm,vs,Gm,Jn,Vm,sc,nc,rc,$u,vt,Um,_i,Wm,Hm,Zr,Ym,Xr,$m,Km,Zm,Ku=Be({"packages/ag-charts-core/src/utils/validation.ts"(){"use strict";ju(),Nm(),Em(),la(),Si=Symbol("description"),Uu=Symbol("required"),ha=Symbol("marked"),Wu=Symbol("undocumented"),ua=Symbol("union"),Rm=[["placement","position"],["padding","spacing","gap"],["color","fill","stroke"],["whisker","wick"],["nodeClick","seriesNodeClick"],["nodeDoubleClick","seriesNodeDoubleClick"],["src","url"]].reduce((e,t)=>{for(const i of t)e.set(i.toLowerCase(),new Set(t.filter(s=>s!==i)));return e},new Map),Hu=(e=>(e.Invalid="invalid",e.Required="required",e.Unknown="unknown",e))(Hu||{}),Kr=class{constructor(e,t,i,s,n){this.type=e,this.description=t,this.value=i,this.path=s,this.key=n}setUnionType(e,t){if(this.path.startsWith(t)){const i=this.path.slice(t.length);this.altPath=`${t}[type=${e}]${i}`}}getPrefix(){const{altPath:e=this.path,key:t}=this;return!e&&!t?"Value":`Option \`${t?ca(e,t):e}\``}toString(){const{description:e="unknown",type:t,value:i}=this;return t==="required"&&i==null?`${this.getPrefix()} is required and has not been provided; expecting ${e}, ignoring.`:`${this.getPrefix()} cannot be set to \`${Jl(i,50)}\`; expecting ${e}, ignoring.`}},tc=class extends Kr{constructor(e,t,i,s){super("unknown",void 0,t,i,s),this.suggestions=e,this.key=s}getPrefix(){return`Unknown option \`${ca(this.path,this.key)}\``}getPostfix(){const e=Ql(rI(this.key,this.suggestions),"or",t=>`\`${t}\``);return e?`; Did you mean ${e}? Ignoring.`:", ignoring."}toString(){return`${this.getPrefix()}${this.getPostfix()}`}},ts=(e,t="an object")=>je((i,s)=>{const n=$r(i,e,s.path);return{valid:!ec(n.invalid,s.path),cleared:n.cleared,invalid:n.invalid}},t),Yu=(e,t,i)=>({...e,[Si]:t,[ua]:i}),ic=(...e)=>je((t,i)=>{const s=[];for(const n of e){const r=n(t,i);if(typeof r=="object"){if(s.push(...r.invalid),!r.valid)return{valid:!1,cleared:t,invalid:s};t=r.cleared}else if(!r)return!1}return{valid:!0,cleared:t,invalid:s}},e.map(t=>t[Si]).filter(Boolean).join(" and ")),Qn=(...e)=>je((t,i)=>{for(const s of e){const n=s(t,i);if(typeof n=="object"?n.valid:n)return n}return!1},e.map(t=>t[Si]).filter(Boolean).join(" or ")),da=e=>mn(e)||Gu(e),Fm=e=>Bu(e)||(mn(e)||qn(e))&&Gu(new Date(e)),_m=je(Xn,"an array"),pa=je(Cm,"a boolean"),jm=je(gn,"a function"),ci=je(Tm,"a color string"),zm=je(Fm,"a date"),Bm=je(km,"a defined value"),vs=je(mn,"a number"),Gm=je(fn,"an object"),Jn=je(qn,"a string"),Vm=je(e=>typeof HTMLElement>"u"||e instanceof HTMLElement,"an html element"),sc=(e,t=1/0)=>{let i;return t===1/0?i=`an array of at least ${e} items`:e===t?i=`an array of exactly ${e} items`:e===0?i=`an array of no more than ${t} items`:i=`an array of at least ${e} and no more than ${t} items`,je(s=>Xn(s)&&s.length>=e&&s.length<=t,i)},nc=(e,t=1/0)=>{let i;return t===1/0?i=`a string of at least ${e} characters`:e===t?i=`an string of exactly ${e} characters`:e===0?i=`an string of no more than ${t} characters`:i=`an string of at least ${e} and no more than ${t} characters`,je(s=>qn(s)&&s.length>=e&&s.length<=t,i)},rc=(e,t=!0)=>je(i=>mn(i)&&(i>e||t&&i===e),`a number greater than ${t?"or equal to ":""}${e}`),$u=(e,t)=>je(i=>mn(i)&&i>=e&&i<=t,`a number between ${e} and ${t} inclusive`),vt=rc(0),Um=rc(0,!1),_i=$u(0,1),Wm=e=>je((t,{options:i})=>!da(t)||!da(i[e])||t<i[e],`the value to be less than \`${e}\``),Hm=e=>je((t,{options:i})=>!da(t)||!da(i[e])||t>i[e],`the value to be greater than \`${e}\``),Zr=e=>je(t=>e===t,`the value ${JSON.stringify(e)}`),Ym=(e,t)=>je(i=>i instanceof e,t??`an instance of ${e.name}`),Xr=(e,t,i=!0)=>je((s,n)=>{if(!Xn(s))return!1;let r=i;const o=[],a=[],l=c=>r=i?r&&c:r||c;if(s.length===0)return{valid:!0,cleared:o,invalid:a};for(let c=0;c<s.length;c++){const h=s[c],u=e(h,{options:h,path:`${n.path}[${c}]`});typeof u=="object"?(r=l(u.valid),a.push(...u.invalid),u.cleared!=null&&o.push(u.cleared)):(r=l(u),u&&o.push(h))}return{valid:r,cleared:r||!i?o:null,invalid:a}},t??`${e[Si]} array`),$m=(e,t="an object array")=>je((i,s)=>{if(!Xn(i))return!1;const n=[],r=[];for(let o=0;o<i.length;o++){const a=`${s.path}[${o}]`,l=$r(i[o],e,a);ec(l.invalid,a)||n.push(l.cleared),r.push(...l.invalid)}return{valid:!0,cleared:n,invalid:r}},t),Km=(e,t)=>je((i,s)=>gn(i)?ha in i?!0:{valid:!0,cleared:Object.assign((...r)=>{const o=Vu(i,r);if(o==null)return;const a=e(o,{options:o,path:""});if(typeof a=="object"){if(a.invalid.forEach(Pm(s,t??e[Si])),a.valid)return a.cleared}else{if(a)return o;oa(`Callback \`${s.path}\` returned an invalid value \`${Jl(o,50)}\`; expecting ${t??e[Si]}, ignoring.`)}},{[ha]:!0}),invalid:[]}:!1,"a function"),Zm=(e,t="an object")=>je((i,s)=>gn(i)?ha in i?!0:{valid:!0,cleared:Object.assign((...r)=>{const o=Vu(i,r,s.path);if(o==null)return;const a=$r(o,e);return a.invalid.forEach(Pm(s,t)),a.cleared},{[ha]:!0}),invalid:[]}:!1,"a function")}}),Zu,Xm,Xu,ga,oc,qm,qu,Qu,Ju,ed,Qm,td,fa,Jm,ac,id,ey,oI=Be({"packages/ag-charts-core/src/options/commonOptionsDefs.ts"(){"use strict";la(),Ku(),Zu=e=>{if(!fn(e))return!1;const t=Object.keys(e);return t.length===1&&t[0].startsWith("$")},Xm=ts({color:ci,stop:_i},""),Xu=je(e=>{let t=-1/0;for(const i of e)if(i?.stop!=null){if(i.stop<t)return!1;t=i.stop}return!0},"color stops to be defined in ascending order"),ga=ic(sc(2),Xr(Xm),Xu),oc=Mi("axis","item","series"),qm=ts({type:ze(Zr("gradient")),colorStops:ze(ga),rotation:vs,gradient:es(Mi("linear","radial","conic")),bounds:es(oc),reverse:es(pa)},"a gradient object with color stops"),qu={stroke:ci,strokeWidth:vt,strokeOpacity:_i},Qu=ts({type:ze(Zr("gradient")),gradient:ze(Mi("linear","radial","conic")),bounds:ze(oc),colorStops:ze(Qn(ga,ic(sc(2),Xr(ci)))),rotation:ze(vs),reverse:ze(pa)}),Ju=ts({type:ze(Zr("pattern")),pattern:ze(Mi("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses")),path:nc(2),width:ze(vt),height:ze(vt),fill:ze(ci),fillOpacity:ze(_i),backgroundFill:ze(ci),backgroundFillOpacity:ze(_i),padding:ze(vt),rotation:ze(vs),scale:ze(vt),stroke:ze(ci),strokeWidth:ze(vt),strokeOpacity:ze(_i)}),ed=ts({type:ze(Zr("image")),url:Jn,width:vt,height:vt,rotation:ze(vs),backgroundFill:ze(ci),backgroundFillOpacity:_i,fit:ze(Mi("stretch","contain","cover")),repeat:ze(Mi("repeat","repeat-x","repeat-y","no-repeat"))}),Qm=Yu({gradient:{colorStops:ga,rotation:vs,gradient:es(Mi("linear","radial","conic")),bounds:es(oc),reverse:es(pa)},pattern:{pattern:Mi("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses"),path:nc(2),width:vt,height:vt,rotation:vs,scale:vt,fill:ci,fillOpacity:_i,backgroundFill:ci,backgroundFillOpacity:_i,...qu,padding:es(vt)},image:{url:ze(Jn),backgroundFill:ci,backgroundFillOpacity:_i,width:vt,height:vt,fit:Mi("stretch","contain","cover","none"),repeat:Mi("repeat","repeat-x","repeat-y","no-repeat"),rotation:vs}},"a color object"),td=Qn(ci,ts(Qm,"a color object")),fa={fill:td,fillOpacity:_i},fa.fillGradientDefaults=es(Qu),fa.fillPatternDefaults=es(Ju),fa.fillImageDefaults=es(ed),Jm={lineDash:Xr(vt),lineDashOffset:vs},ac=ts({googleFont:Jn},"google font"),id=Qn(Jn,Zu,ac,Xr(Qn(Jn,ac))),ey={color:ci,fontFamily:id,fontSize:vt,fontStyle:Mi("normal","italic","oblique"),fontWeight:Qn(vt,Mi("normal","bold","bolder","lighter"))}}});function aI(e){return typeof e>"u"?[]:Array.isArray(e)?e:[e]}function lI(e){return Array.from(new Set(e))}function cI(e,t){return e.reduce((i,s)=>{const n=t(s);return i[n]??(i[n]=[]),i[n].push(s),i},{})}function ty(e,t){if(e==null||t==null||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(Array.isArray(e[i])&&Array.isArray(t[i])){if(!ty(e[i],t[i]))return!1}else if(e[i]!==t[i])return!1;return!0}function hI(e,t,i=0){if(e.length===0)return[];const s=[];for(let n=0;n<t;n++)s.push(e.at((n+i)%e.length));return s}function uI(e,t){const i=new Map;return t.forEach((s,n)=>{i.set(s,n)}),e.sort((s,n)=>{const r=i.get(s)??1/0,o=i.get(n)??1/0;return r-o})}function dI(e,t){let i=0;for(;i<e.length&&t(e[i]);)i+=1;const s=i;s!==0&&e.splice(0,s)}function pI(e,t){let i=e.length-1;for(;i>=0&&t(e[i]);)i-=1;const s=e.length-1-i;s!==0&&e.splice(e.length-s,s)}var gI=Be({"packages/ag-charts-core/src/utils/arrays.ts"(){"use strict"}});function fI(e=0){return new Promise(t=>{setTimeout(t,e)})}var iy,mI=Be({"packages/ag-charts-core/src/utils/async.ts"(){"use strict";iy=class{constructor(){this.queue=[]}await(e=50){return new Promise(t=>{const i=()=>{clearTimeout(n),t(!0)},n=setTimeout(()=>{const r=this.queue.indexOf(i);r<0||(this.queue.splice(r,1),t(!1))},e);this.queue.push(i)})}notify(){this.queue.splice(0).forEach(e=>e())}}}});function*yI(...e){for(const t of e)yield*t}function bI(e){return e!=null&&typeof e=="object"&&Symbol.iterator in e?e:[e]}function xI(e){for(const t of e)return t;throw new Error("AG Charts - no first() value found")}function*sd(e){const t=[void 0,void 0];for(const i of Object.keys(e))t[0]=i,t[1]=e[i],yield t}var sy=Be({"packages/ag-charts-core/src/utils/iterators.ts"(){"use strict"}});function yn(e){return e==="true"}function vI(e){return Number(e)}function Di(e){return e}function ny(e,t,i){i==null||i===""||i===""?e?.removeAttribute(t):e?.setAttribute(t,i.toString())}function MI(e,t){if(t!=null)for(const[i,s]of sd(t))i!=="class"&&ny(e,i,s)}function SI(e,t,i){if(!(e instanceof HTMLElement))return;const s=e.getAttribute(t);return s===null?i:oy[t]?.(s)??void 0}function ry(e,t,i){e!=null&&(i==null?e.style.removeProperty(t):e.style.setProperty(t,i.toString()))}function DI(e,t){for(const[i,s]of sd(t))ry(e,i,s)}var oy,II=Be({"packages/ag-charts-core/src/utils/attributeUtil.ts"(){"use strict";sy(),oy={role:Di,"aria-checked":yn,"aria-controls":Di,"aria-describedby":Di,"aria-disabled":yn,"aria-expanded":yn,"aria-haspopup":Di,"aria-hidden":yn,"aria-label":Di,"aria-labelledby":Di,"aria-live":Di,"aria-orientation":Di,"aria-selected":yn,"data-focus-override":yn,"data-focus-visible-override":yn,"data-preventdefault":yn,class:Di,for:Di,id:Di,tabindex:vI,title:Di,placeholder:Di}}});function AI(e,t,i){if(e>t)return;let s;for(;t>=e;){const n=Math.floor((t+e)/2);i(n)?(s=n,e=n+1):t=n-1}return s}function LI(e,t,i){if(e>t)return;let s;for(;t>=e;){const n=Math.floor((t+e)/2);i(n)?(s=n,t=n-1):e=n+1}return s}function kI(e,t,i){if(e>t)return;let s;for(;t>=e;){const n=Math.floor((t+e)/2),r=i(n);r==null?t=n-1:(s=r,e=n+1)}return s}function CI(e,t,i){if(e>t)return;let s;for(;t>=e;){const n=Math.floor((t+e)/2),r=i(n);r==null?e=n+1:(s=r,t=n-1)}return s}var wI=Be({"packages/ag-charts-core/src/utils/binarySearch.ts"(){"use strict"}});function TI(e,t){const i=Math.max(e.length,t.length),s=new Set,n=new Set;for(let r=0;r<i;r++){const o=e[r],a=t[r];o!==a&&(n.has(a)?n.delete(a):a&&s.add(a),s.has(o)?s.delete(o):o&&n.add(o))}return{changed:s.size>0||n.size>0,added:s,removed:n}}var NI=Be({"packages/ag-charts-core/src/utils/diff.ts"(){"use strict"}});function ay(e,t,i){return Math.min(i,Math.max(e,t))}function OI(e,t,i=1e-10){return e>=t[0]-i&&e<=t[1]+i}function nd(e,t,i=1e-10){return e===t||Math.abs(e-t)<i}function EI(e){return Math.sign(e)===-1||Object.is(e,-0)}function PI(e){return e%1===0}function RI(e,t=2){const i=10**t;return Math.round(e*i)/i}function FI(e,t){return Math.floor(e%t+(e<0?Math.abs(t):0))}function _I(e){if(Math.floor(e)===e)return 0;let t=String(e),i=0;if(e<1e-6||e>=1e21){let n;[t,n]=t.split("e"),n!=null&&(i=Number(n))}const s=t.split(".")[1]?.length??0;return Math.max(s-i,0)}var rd=Be({"packages/ag-charts-core/src/utils/numbers.ts"(){"use strict"}});function ly(e){return Array.isArray(e)&&e.length>=2&&e.every(mn)}function lc(e){return Array.isArray(e)&&e.length>=2&&e.every(ly)}function jI(e){const t=e[0],i=e[e.length-1];return nd(t[0],i[0],.001)&&nd(t[1],i[1],.001)}function cy(e){return Array.isArray(e)&&e.every(lc)&&e.every(jI)}function hy(e){if(e===null)return!0;if(!fn(e)||e.type==null)return!1;const{type:t,coordinates:i}=e;switch(t){case"GeometryCollection":return Array.isArray(e.geometries)&&e.geometries.every(hy);case"MultiPolygon":return Array.isArray(i)&&i.every(cy);case"Polygon":return cy(i);case"MultiLineString":return Array.isArray(i)&&i.every(lc);case"LineString":return lc(i);case"MultiPoint":return lc(i);case"Point":return ly(i);default:return!1}}function zI(e){return fn(e)&&e.type==="Feature"&&hy(e.geometry)}function BI(e){return fn(e)&&e.type==="FeatureCollection"&&Array.isArray(e.features)&&e.features.every(zI)}var uy,GI=Be({"packages/ag-charts-core/src/utils/geoJson.ts"(){"use strict";rd(),la(),Ku(),uy=je(BI,"a GeoJSON object")}});function VI(){cc.clear(),od=1}function UI(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=(cc.get(i)??0)+1;return cc.set(i,s),`${i}-${s}`}function WI(){return`ag-charts-${od++}`}function HI(){return crypto.randomUUID?.()??YI()}function YI(){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}var cc,$I,od,KI=Be({"packages/ag-charts-core/src/utils/id.ts"(){"use strict";cc=new Map,$I=Symbol("ElementID"),od=1}});function ZI(e){if(!qn(e))return!1;const t=ld.exec(e);return ad.test(t?t[2]:e)}function dy(e){let t,i;const s=ld.exec(e);s&&([,t,e,i]=s);const n=ad.exec(e);if(!n)throw new Error(`The number formatter is invalid: ${e}`);const[,r,o,a,l,c,h,u,d,p,f]=n;return{fill:r,align:o,sign:a,symbol:l,zero:c,width:parseInt(h),comma:u,precision:parseInt(d),trim:!!p,type:f,prefix:t,suffix:i}}function XI(e){const t=typeof e=="string"?dy(e):e,{fill:i,align:s,sign:n="-",symbol:r,zero:o,width:a,comma:l,type:c,prefix:h="",suffix:u="",precision:d}=t;let{trim:p}=t;const f=d==null||isNaN(d);let y;if(!c)y=Ii.g,p=!0;else if(c in Ii&&c in er)y=f?er[c]:Ii[c];else if(c in Ii)y=Ii[c];else if(c in er)y=er[c];else throw new Error(`The number formatter type is invalid: ${c}`);let b;return f?b=c?6:12:b=d,m=>{let v=y(m,b);return p&&(v=qI(v)),l&&(v=QI(v,l)),v=eA(m,v,n),r&&r!=="#"&&(v=`${r}${v}`),r==="#"&&c==="x"&&(v=`0x${v}`),c==="s"&&(v=`${v}${JI(m)}`),(c==="%"||c==="p")&&(v=`${v}%`),a!=null&&!isNaN(a)&&(v=tA(v,a,i??o,s)),v=`${h}${v}${u}`,v}}function hc(e){return Math.floor(Math.abs(e))}function qI(e){return e.replace(/\.0+$/,"").replace(/(\.[1-9])0+$/,"$1")}function QI(e,t){let i=e.indexOf(".");i<0&&(i=e.length);const s=e.substring(0,i).split(""),n=e.substring(i);for(let r=s.length-3;r>0;r-=3)s.splice(r,0,t);return`${s.join("")}${n}`}function JI(e){return gy[py(e)]}function py(e){return ay(cd,e?Math.floor(Math.log10(Math.abs(e))/3)*3:0,hd)}function eA(e,t,i=""){if(i==="(")return e>=0?t:`(${t})`;const s=i==="+"?"+":"";return`${e>=0?s:fy}${t}`}function tA(e,t,i=" ",s=">"){let n=e;if(s===">"||!s)n=n.padStart(t,i);else if(s==="<")n=n.padEnd(t,i);else if(s==="^"){const r=Math.max(0,t-n.length),o=Math.ceil(r/2),a=Math.floor(r/2);n=n.padStart(o+n.length,i),n=n.padEnd(a+n.length,i)}return n}var ad,ld,er,Ii,cd,hd,gy,fy,iA=Be({"packages/ag-charts-core/src/utils/numberFormat.ts"(){"use strict";rd(),la(),ad=/^(?:(.)?([<>=^]))?([+\-( ])?([$€£¥₣₹#])?(0)?(\d+)?(,)?(?:\.(\d+))?(~)?([%a-z])?$/i,ld=/^((?:[^#]|#[^{])*)#{([^}]+)}(.*)$/,er={b:e=>hc(e).toString(2),c:e=>String.fromCharCode(e),d:e=>Math.round(Math.abs(e)).toFixed(0),o:e=>hc(e).toString(8),x:e=>hc(e).toString(16),X:e=>er.x(e).toUpperCase(),n:e=>er.d(e),"%":e=>`${hc(e*100).toFixed(0)}`},Ii={e:(e,t)=>Math.abs(e).toExponential(t),E:(e,t)=>Ii.e(e,t).toUpperCase(),f:(e,t)=>Math.abs(e).toFixed(t),F:(e,t)=>Ii.f(e,t).toUpperCase(),g:(e,t)=>{if(e===0)return"0";const i=Math.abs(e),s=Math.floor(Math.log10(i));return s>=-4&&s<t?i.toFixed(t-1-s):i.toExponential(t-1)},G:(e,t)=>Ii.g(e,t).toUpperCase(),n:(e,t)=>Ii.g(e,t),p:(e,t)=>Ii.r(e*100,t),r:(e,t)=>{if(e===0)return"0";const i=Math.abs(e),n=Math.floor(Math.log10(i))-(t-1);if(n<=0)return i.toFixed(-n);const r=10**n;return(Math.round(i/r)*r).toFixed()},s:(e,t)=>{const i=py(e);return Ii.r(e/10**i,t)},"%":(e,t)=>Ii.f(e*100,t)},cd=-24,hd=24,gy={[cd]:"y",[-21]:"z",[-18]:"a",[-15]:"f",[-12]:"p",[-9]:"n",[-6]:"\xB5",[-3]:"m",0:"",3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",[hd]:"Y"},fy="\u2212"}}),T={};_u(T,{AsyncAwaitQueue:()=>iy,ErrorType:()=>Hu,EventEmitter:()=>Mm,Logger:()=>fm,ModuleRegistry:()=>xm,ModuleType:()=>zu,UnknownError:()=>tc,ValidationError:()=>Kr,and:()=>ic,array:()=>_m,arrayLength:()=>sc,arrayOf:()=>Xr,arrayOfDefs:()=>$m,arraysEqual:()=>ty,attachDescription:()=>je,boolean:()=>pa,callback:()=>jm,callbackDefs:()=>Zm,callbackOf:()=>Km,circularSliceArray:()=>hI,clamp:()=>ay,color:()=>ci,colorStopsOrderValidator:()=>Xu,colorUnion:()=>td,constant:()=>Zr,countFractionDigits:()=>_I,countLines:()=>nI,createElement:()=>Dm,createElementId:()=>WI,createId:()=>UI,createNumberFormatter:()=>XI,createSvgElement:()=>WD,date:()=>zm,debounce:()=>iI,defined:()=>Bm,diffArrays:()=>TI,downloadUrl:()=>HD,dropFirstWhile:()=>dI,dropLastWhile:()=>pI,entries:()=>sd,fillGradientDefaults:()=>Qu,fillImageDefaults:()=>ed,fillOptionsDef:()=>fa,fillPatternDefaults:()=>Ju,findMaxIndex:()=>AI,findMaxValue:()=>kI,findMinIndex:()=>LI,findMinValue:()=>CI,first:()=>xI,fontFamilyFull:()=>id,fontOptionsDef:()=>ey,generateUUID:()=>HI,geoJson:()=>uy,getAttribute:()=>SI,getDocument:()=>Xl,getWindow:()=>Sm,googleFont:()=>ac,gradientColorStops:()=>ga,gradientStrict:()=>qm,greaterThan:()=>Hm,groupBy:()=>cI,hasRequiredInPath:()=>ec,htmlElement:()=>Vm,inRange:()=>OI,instanceOf:()=>Ym,isArray:()=>Xn,isBoolean:()=>Cm,isColor:()=>Tm,isDate:()=>Bu,isDefined:()=>km,isEnumKey:()=>QD,isEnumValue:()=>JD,isFiniteNumber:()=>mn,isFunction:()=>gn,isHtmlElement:()=>qD,isInteger:()=>PI,isKeyOf:()=>tI,isNegative:()=>EI,isNumber:()=>XD,isNumberEqual:()=>nd,isObject:()=>fn,isObjectLike:()=>ZD,isPlainObject:()=>wm,isRegExp:()=>KD,isString:()=>qn,isSymbol:()=>eI,isValidDate:()=>Gu,isValidNumberFormat:()=>ZI,iterate:()=>yI,joinFormatted:()=>Ql,lessThan:()=>Wm,levenshteinDistance:()=>Om,lineDashOptionsDef:()=>Jm,modulus:()=>FI,number:()=>vs,numberMin:()=>rc,numberRange:()=>$u,object:()=>Gm,optionsDefs:()=>ts,or:()=>Qn,parseColor:()=>Am,parseNumberFormat:()=>dy,pause:()=>fI,positiveNumber:()=>vt,positiveNumberNonZero:()=>Um,ratio:()=>_i,required:()=>ze,resetIds:()=>VI,roundTo:()=>RI,safeCall:()=>Vu,setAttribute:()=>ny,setAttributes:()=>MI,setDocument:()=>VD,setElementStyle:()=>ry,setElementStyles:()=>DI,setWindow:()=>UD,sortBasedOnArray:()=>uI,string:()=>Jn,stringLength:()=>nc,stringifyValue:()=>Jl,strokeOptionsDef:()=>qu,themeOperator:()=>Zu,throttle:()=>sI,toArray:()=>aI,toIterable:()=>bI,typeUnion:()=>Yu,undocumented:()=>es,union:()=>Mi,unionSymbol:()=>ua,unique:()=>lI,validate:()=>$r});var O=Be({"packages/ag-charts-core/src/main.ts"(){"use strict";zD(),BD(),wD(),GD(),oI(),Lm(),gI(),mI(),II(),wI(),NI(),Nm(),GI(),KI(),sy(),iA(),rd(),Em(),la(),Ku()}}),uc=Object.defineProperty,my=Object.getOwnPropertyDescriptor,sA=Object.getOwnPropertyNames,nA=Object.prototype.hasOwnProperty,ji=(e,t)=>{for(var i in t)uc(e,i,{get:t[i],enumerable:!0})},rA=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of sA(t))!nA.call(e,n)&&n!==i&&uc(e,n,{get:()=>t[n],enumerable:!(s=my(t,n))||s.enumerable});return e},oA=e=>rA(uc({},"__esModule",{value:!0}),e),g=(e,t,i,s)=>{for(var n=s>1?void 0:s?my(t,i):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(n=(s?o(t,i,n):o(n))||n);return s&&n&&uc(t,i,n),n},yy={};ji(yy,{AG_CHARTS_LOCALE_EN_US:()=>Nb,AgCharts:()=>$n,AgChartsCommunityModule:()=>U2,AgErrorBarSupportedSeriesTypes:()=>vO,AgTooltipAnchorToType:()=>bf,AgTooltipPlacementType:()=>xf,AgTooltipPositionType:()=>vf,VERSION:()=>uo,_ModuleSupport:()=>BS,_Scene:()=>Uf,_Theme:()=>Yf,_Util:()=>$f,_Widget:()=>YS,setupCommunityModules:()=>yf,time:()=>yp}),bs.exports=oA(yy);var dc=(O(),N(T)),Nt=(O(),N(T)),pc=class{constructor(){this.destroyFns=[]}destroy(){for(const e of this.destroyFns)e()}},aA=class{constructor(){this.modules=[],this.dependencies=new Map,this.modulesByOptionKey=new Map}register(...e){for(const t of e){this.registerDependencies(t);const i=this.modules.find(s=>t.type===s.type&&("optionsKey"in t&&"optionsKey"in s?t.optionsKey===s.optionsKey:!0)&&t.identifier===s.identifier);if(i){if(t.packageType==="enterprise"&&i.packageType==="community"){const s=this.modules.indexOf(i);this.modules.splice(s,1,t),"optionsKey"in t&&this.modulesByOptionKey.set(t.optionsKey,t)}}else this.modules.push(t),"optionsKey"in t&&this.modulesByOptionKey.set(t.optionsKey,t)}}hasEnterpriseModules(){return this.modules.some(e=>e.packageType==="enterprise")}*byType(...e){const t=new Set,i=this.modules.filter(r=>e.includes(r.type)),s=r=>{const o=this.dependencies.get(r);return o?.flatMap(s).concat(o)??[]},n=[];for(const r of i){const o="optionsKey"in r?r.optionsKey:r.contextKey;if(!t.has(o)){for(const a of s(o)){if(t.has(a))continue;const l=this.modulesByOptionKey.get(a);if(!l){n.push(a);continue}e.includes(l.type)&&(yield l,t.add(a))}yield r,t.add(o)}}if(n.length>0)throw new Error(`Could not resolve module dependencies: ${n}`)}registerDependencies(e){if(e.dependencies==null||e.dependencies.length===0)return;const t="optionsKey"in e?e.optionsKey:e.contextKey;this.dependencies.set(t,e.dependencies)}},Ms=new aA,qr=(O(),N(T)),tr={containsPoint:lA,equals:cA,isEmpty:hA,normalize:uA};function lA(e,t,i){return t>=e.x&&t<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}function cA(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function hA(e){return e==null||e.height===0||e.width===0||isNaN(e.height)||isNaN(e.width)}function uA(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 gc=Symbol("interpolate"),fc=e=>e[gc]!=null;function mc(e,t,i,s=1/0){const n={nearest:void 0,distanceSquared:s};for(const r of i){const o=r.distanceSquared(e,t);if(o===0)return{nearest:r,distanceSquared:0};o<n.distanceSquared&&(n.nearest=r,n.distanceSquared=o)}return n}function dA(e,t,i,s=1/0){const{x:n=e,y:r=t}=i.transformPoint?.(e,t)??{},o={nearest:void 0,distanceSquared:s};for(const a of i.children){const{nearest:l,distanceSquared:c}=a.nearestSquared(n,r,o.distanceSquared);if(c===0)return{nearest:l,distanceSquared:c};c<o.distanceSquared&&(o.nearest=l,o.distanceSquared=c)}return o}var ma=class na{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 na(t,i,s,n)}static merge(t){let i=1/0,s=1/0,n=-1/0,r=-1/0;for(const o of t)o.x<i&&(i=o.x),o.y<s&&(s=o.y),o.x+o.width>n&&(n=o.x+o.width),o.y+o.height>r&&(r=o.y+o.height);return new na(i,s,n-i,r-s)}static nearestBox(t,i,s){return mc(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 na(t,i,s,n)}equals(t){return tr.equals(this,t)}containsPoint(t,i){return tr.containsPoint(this,t,i)}intersection(t){if(!this.collidesBBox(t))return;const i=(0,qr.clamp)(t.x,this.x,t.x+t.width),s=(0,qr.clamp)(t.y,this.y,t.y+t.height),n=(0,qr.clamp)(t.x,this.x+this.width,t.x+t.width),r=(0,qr.clamp)(t.y,this.y+this.height,t.y+t.height);return new na(i,s,n-i,r-s)}collidesBBox(t){return this.x<t.x+t.width&&this.x+this.width>t.x&&this.y<t.y+t.height&&this.y+this.height>t.y}computeCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)&&Number.isFinite(this.width)&&Number.isFinite(this.height)}distanceSquared(t,i){if(this.containsPoint(t,i))return 0;const s=t-(0,qr.clamp)(this.x,t,this.x+this.width),n=i-(0,qr.clamp)(this.y,i,this.y+this.height);return s*s+n*n}shrink(t,i){if(typeof t=="number")this.applyMargin(t,i);else for(const s of Object.keys(t)){const n=t[s];typeof n=="number"&&this.applyMargin(n,s)}return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this}grow(t,i){if(typeof t=="number")this.applyMargin(-t,i);else for(const s of Object.keys(t)){const n=t[s];typeof n=="number"&&this.applyMargin(-n,s)}return this}applyMargin(t,i){switch(i){case"top":this.y+=t;case"bottom":this.height-=t;break;case"left":this.x+=t;case"right":this.width-=t;break;case"vertical":this.y+=t,this.height-=t*2;break;case"horizontal":this.x+=t,this.width-=t*2;break;case void 0:this.x+=t,this.y+=t,this.width-=t*2,this.height-=t*2;break}}translate(t,i){return this.x+=t,this.y+=i,this}[gc](t,i){return new na(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)}};ma.zero=Object.freeze(new ma(0,0,0,0)),ma.NaN=Object.freeze(new ma(NaN,NaN,NaN,NaN));var U=ma,pA=(O(),N(T)),Qr=(O(),N(T)),gA=2e3,by=Date.now(),fA=()=>{const e=Date.now()-by;if(e>gA){const t=(Math.floor(e/100)/10).toFixed(1);Qr.Logger.log(`**** ${t}s since last log message ****`)}by=Date.now()},ke={create(...e){return Object.assign((...i)=>{ke.check(...e)&&(typeof i[0]=="function"&&(i=(0,Qr.toArray)(i[0]())),fA(),Qr.Logger.log(...i))},{check:()=>ke.check(...e),group:(i,s)=>ke.check(...e)?Qr.Logger.logGroup(i,s):s()})},check(...e){return e.length===0&&e.push(!0),(0,Qr.toArray)((0,Qr.getWindow)("agChartsDebug")).some(i=>e.includes(i))},inDevelopmentMode(e){if(ke.check("dev"))return e()}};function xy({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 vy(e){if(ke.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 My(e,t,i){return[Math.floor(e*i),Math.floor(t*i)]}var ud=class{constructor(e){const{width:t,height:i,pixelRatio:s,willReadFrequently:n=!1}=e;this.width=t,this.height=i,this.pixelRatio=s;const[r,o]=My(t,i,s);this.canvas=new OffscreenCanvas(r,o),this.context=this.canvas.getContext("2d",{willReadFrequently:n}),this.context.setTransform(s,0,0,s,0,0),vy(this.context)}drawImage(e,t=0,i=0){return e.drawImage(this.canvas,t,i)}transferToImageBitmap(){return this.canvas.transferToImageBitmap()}resize(e,t,i){if(!(e>0&&t>0))return;const{canvas:s,context:n}=this;if(e!==this.width||t!==this.height||i!==this.pixelRatio){const[r,o]=My(e,t,i);s.width=r,s.height=o}n.setTransform(i,0,0,i,0,0),this.width=e,this.height=t,this.pixelRatio=i}clear(){xy(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)}},yc=(O(),N(T)),hi=(O(),N(T)),dd=Symbol("BREAK"),ya="__decorator_config",bc="__decorator_accessors";function mA(e,t){pd(e,t).optional=!0}function pd(e,t){if(Object.getOwnPropertyDescriptor(e,ya)==null&&Object.defineProperty(e,ya,{value:{}}),Object.getOwnPropertyDescriptor(e,bc)==null){const h=Object.getPrototypeOf(e)?.[bc]?.slice()??[];Object.defineProperty(e,bc,{value:h})}const i=e[ya],s=t.toString();if(i[s]!=null)return i[s];i[s]={setters:[],getters:[],observers:[]};const n=Object.getOwnPropertyDescriptor(e,t);let r=n?.get,o=n?.set;if(r==null||o==null){const c=e[bc];let h=c.indexOf(t);h===-1&&(h=c.push(t)-1),r??(r=function(){let u=this.__accessors;return u==null&&(u=c.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:u})),u[h]}),o??(o=function(u){let d=this.__accessors;d==null&&(d=c.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:d})),d[h]=u})}return Object.defineProperty(e,t,{set:function(c){const{setters:h,observers:u}=i[s];let d;h.some(p=>p.length>2)&&(d=r.call(this));for(const p of h)if(c=p(this,t,c,d),c===dd)return;o.call(this,c);for(const p of u)p(this,c,d)},get:function(){let c=r.call(this);for(const h of i[s].getters)if(c=h(this,t,c),c===dd)return;return c},enumerable:!0,configurable:!1}),i[s]}function ir(e,t,i){return(s,n)=>{const r=pd(s,n);r.setters.push(e),t&&r.getters.unshift(t),i&&Object.assign(r,i)}}function Sy(e){return(t,i)=>{pd(t,i).observers.push(e)}}function xc(e){return typeof e<"u"&&ya in e}function sr(e){const t=new Set;for(;xc(e);)t.add(e?.[ya]),e=Object.getPrototypeOf(e);return Array.from(t).flatMap(i=>Object.keys(i))}function Dy(e){return sr(e).reduce((t,i)=>(t[i]=e[i]??null,t),{})}function ii(e,t){return Array.isArray(e)?!Array.isArray(t)||e.length!==t.length?!1:e.every((i,s)=>ii(i,t[s])):(0,hi.isPlainObject)(e)?(0,hi.isPlainObject)(t)?gd(e,t,ii):!1:e===t}function gd(e,t,i){if(Object.is(e,t))return!0;for(const s of Object.keys(t))if(!(s in e))return!1;for(const s of Object.keys(e))if(!(s in t)||!i(e[s],t[s]))return!1;return!0}function xe(...e){const t={};for(const i of e){if(!(0,hi.isObject)(i))continue;const s=xc(i)?sr(i):Object.keys(i);for(const n of s)(0,hi.isPlainObject)(t[n])&&(0,hi.isPlainObject)(i[n])?t[n]=xe(t[n],i[n]):t[n]??(t[n]=i[n])}return t}function ba(...e){const t={};for(const i of e){if(!(0,hi.isObject)(i))continue;const s=xc(i)?sr(i):Object.keys(i);for(const n of s)(0,hi.isPlainObject)(t[n])&&(0,hi.isPlainObject)(i[n])?t[n]=ba(t[n],i[n]):n in t||(t[n]??(t[n]=i[n]))}return t}function vc(e,...t){return t&&(0,hi.isArray)(e)?e.map(i=>xe(i,...t)):e}function Iy(e,t){const i={};for(const[s,n]of(0,hi.entries)(e))i[s]=t(n,s,e);return i}function H(e,t){const i={...e};for(const s of t)delete i[s];return i}function Jr(e,t){return((0,hi.isArray)(t)?t:t.split(".")).reduce((s,n)=>s[n],e)}var fd=new Set(["__proto__","constructor","prototype"]);function md(e,t,i){const s=(0,hi.isArray)(t)?t.slice():t.split("."),n=s.pop();if(s.some(o=>fd.has(o)))return;const r=s.reduce((o,a)=>o[a],e);return r[n]=i,r[n]}function yd(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}function nr(e){return e==null||typeof e!="object"||!(0,hi.isPlainObject)(e)||(Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const i=e[t];i!==null&&(typeof i=="object"||typeof i=="function")&&!Object.isFrozen(i)&&nr(i)})),e}function Ay(e,t){return(0,hi.isPlainObject)(e)&&t in e}function yA(e,t){return Ay(e,t)&&typeof e[t]=="string"}var bA=(O(),N(T)),eo=(e,t)=>e===t;function _(e){return function(t,i){const s=`__${i}`;t[i]||xA(t,i,s,e)}}function Ai(e){return _(e)}function bd(e){const t=e??{};return t.equals=bA.arraysEqual,_(e)}function xA(e,t,i,s){const{changeCb:n,convertor:r,checkDirtyOnAssignment:o=!1}=s??{},a={changeCb:n,checkDirtyOnAssignment:o,convertor:r},l=SA(i,MA(vA(DA(i,a),a),a),a);Object.defineProperty(e,t,{set:l,get:function(){return this[i]},enumerable:!0,configurable:!0})}function vA(e,t){const{convertor:i}=t;return i?function(s){e.call(this,i(s))}:e}var Ly=Symbol("no-change");function MA(e,t){const{changeCb:i}=t;return i?function(s){const n=e.call(this,s);return n!==Ly&&i.call(this,this),n}:e}function SA(e,t,i){const{checkDirtyOnAssignment:s}=i;return s?function(n){const r=t.call(this,n);return n?._dirty===!0&&this.markDirty(e),r}:t}function DA(e,t){const{equals:i=eo}=t;return function(s){const n=this[e];return i(s,n)?Ly:(this[e]=s,this.onChangeDetection(e),s)}}var ky=(e=>(e[e.All=0]="All",e[e.None=1]="None",e))(ky||{}),xa=class am{constructor(t){this.serialNumber=am._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=(0,yc.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??am._debugEnabled)&&(this._debugDirtyProperties=new Map([["__first__",[]]]))}static toSVG(t,i,s){const n=t?.toSVG();if(n==null||!n.elements.length&&!n.defs?.length)return;const r=(0,yc.createSvgElement)("svg");if(r.setAttribute("width",String(i)),r.setAttribute("height",String(s)),r.setAttribute("viewBox",`0 0 ${i} ${s}`),n.defs?.length){const o=(0,yc.createSvgElement)("defs");o.append(...n.defs),r.append(o)}return r.append(...n.elements),r.outerHTML}static*extractBBoxes(t,i){for(const s of t)if(!i||s.visible&&!s.transitionOut){const n=s.getBBox();n&&(yield n)}}get datum(){return this._datum}set datum(t){this._datum!==t&&(this._previousDatum=this._datum,this._datum=t)}get previousDatum(){return this._previousDatum}get layerManager(){return this.scene?.layersManager}get imageLoader(){return this.scene?.imageLoader}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)}setScene(t){this.scene=t,this._debug=t?.layersManager?.debug;for(const i of this.children())i.setScene(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(0,yc.toIterable)(t))i.parentNode?.removeChild(i),this.childNodes.add(i),i.parentNode=this,i.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,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 r=s[n].pickNode(t,i);if(r)return r}}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(){}onChangeDetection(t){this.markDirty(t)}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(){}};xa._nextSerialNumber=0,xa._debugEnabled=!1,g([_()],xa.prototype,"visible",2),g([Ai({equals:ii,changeCb:e=>e.onZIndexChange()})],xa.prototype,"zIndex",2);var js=xa,Mc=(O(),N(T)),IA=(O(),N(T)),zi=Math.PI*2,va=Math.PI/2;function ot(e){return e%=zi,e+=zi,e%=zi,e}function AA(e){return e%=zi,e+=zi,e!==zi&&(e%=zi),e}function Ma(e){return e%=zi,e<-Math.PI?e+=zi:e>=Math.PI&&(e-=zi),e}function bn(e,t,i){const s=ot(e),n=ot(t),r=ot(i);return n<r?n<=s&&s<=r:n>r?n<=s||s<=r:!0}function dt(e){return e/180*Math.PI}function LA(e){return e/Math.PI*180}function Sc(e,t){return e=ot(e),t=ot(t),t-e+(e>t?zi:0)}function Cy(e){const t=ot(e);return t<=va?t/va:t<=Math.PI?(Math.PI-t)/va:t<=1.5*Math.PI?(t-Math.PI)/va:(zi-t)/va}function xd(e,t,i){const s=Cy(i);return e*s+t*Math.abs(1-s)}function zs(e){return e?ot(dt(e)):0}var kA=(O(),N(T)),Dc=(O(),N(T)),Bs=(O(),N(T)),rr=(e,t,i)=>e*(1-i)+t*i,vd=e=>{const t=e<0?-1:1,i=Math.abs(e);return i<=.04045?e/12.92:t*((i+.055)/1.055)**2.4},Md=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},wy=class Ne{constructor(t,i,s,n=1){this.r=(0,Bs.clamp)(0,t||0,1),this.g=(0,Bs.clamp)(0,i||0,1),this.b=(0,Bs.clamp)(0,s||0,1),this.a=(0,Bs.clamp)(0,n||0,1)}static validColorString(t){return t.indexOf("#")>=0?!!Ne.parseHex(t):t.indexOf("rgb")>=0?!!Ne.stringToRgba(t):Ne.nameToHex.has(t.toLowerCase())}static fromString(t){if(t.indexOf("#")>=0)return Ne.fromHexString(t);const i=Ne.nameToHex.get(t.toLowerCase());if(i)return Ne.fromHexString(i);if(t.indexOf("rgb")>=0)return Ne.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=Ne.parseHex(t);if(i){const[s,n,r,o]=i;return new Ne(s/255,n/255,r/255,o/255)}throw new Error(`Malformed hexadecimal color string: '${t}'`)}static stringToRgba(t){let i=-1,s=-1;for(let a=0;a<t.length;a++){const l=t[a];if(i===-1&&l==="(")i=a;else if(l===")"){s=a;break}}if(i===-1||s===-1)return;const r=t.substring(i+1,s).split(","),o=[];for(let a=0;a<r.length;a++){const l=r[a];let c=parseFloat(l);if(!Number.isFinite(c))return;l.indexOf("%")>=0?(c=(0,Bs.clamp)(0,c,100),c/=100):a===3?c=(0,Bs.clamp)(0,c,1):(c=(0,Bs.clamp)(0,c,255),c/=255),o.push(c)}return o}static fromRgbaString(t){const i=Ne.stringToRgba(t);if(i){if(i.length===3)return new Ne(i[0],i[1],i[2]);if(i.length===4)return new Ne(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 Ne(t[0],t[1],t[2],t[3]);if(t.length===3)return new Ne(t[0],t[1],t[2]);throw new Error("The given array should contain 3 or 4 color components (numbers).")}static fromHSB(t,i,s,n=1){const r=Ne.HSBtoRGB(t,i,s);return new Ne(r[0],r[1],r[2],n)}static fromHSL(t,i,s,n=1){const r=Ne.HSLtoRGB(t,i,s);return new Ne(r[0],r[1],r[2],n)}static fromOKLCH(t,i,s,n=1){const r=Ne.OKLCHtoRGB(t,i,s);return new Ne(r[0],r[1],r[2],n)}static padHex(t){return t.length===1?"0"+t:t}toHexString(){let t="#"+Ne.padHex(Math.round(this.r*255).toString(16))+Ne.padHex(Math.round(this.g*255).toString(16))+Ne.padHex(Math.round(this.b*255).toString(16));return this.a<1&&(t+=Ne.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 Ne.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(t,i,s){const n=vd(t),r=vd(i),o=vd(s),a=Math.cbrt(.4122214708*n+.5363325363*r+.0514459929*o),l=Math.cbrt(.2119034982*n+.6806995451*r+.1073969566*o),c=Math.cbrt(.0883024619*n+.2817188376*r+.6299787005*o),h=.2104542553*a+.793617785*l-.0040720468*c,u=1.9779984951*a-2.428592205*l+.4505937099*c,d=.0259040371*a+.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,r=i*Math.cos(s*Math.PI/180),o=i*Math.sin(s*Math.PI/180),a=(n+.3963377774*r+.2158037573*o)**3,l=(n-.1055613458*r-.0638541728*o)**3,c=(n-.0894841775*r-1.291485548*o)**3,h=4.0767416621*a-3.3077115913*l+.2309699292*c,u=-1.2684380046*a+2.6097574011*l-.3413193965*c,d=-.0041960863*a-.7034186147*l+1.707614701*c,p=Md(h),f=Md(u),y=Md(d);return[p,f,y]}static RGBtoHSL(t,i,s){const n=Math.min(t,i,s),r=Math.max(t,i,s),o=(r+n)/2;let a,l;if(r===n)a=0,l=0;else{const c=r-n;l=o>.5?c/(2-r-n):c/(r+n),r===t?a=(i-s)/c+(i<s?6:0):r===i?a=(s-t)/c+2:a=(t-i)/c+4,a*=360/6}return[a,l,o]}static HSLtoRGB(t,i,s){if(t=(t%360+360)%360,i===0)return[s,s,s];const n=s<.5?s*(1+i):s+i-s*i,r=2*s-n;function o(h){return h<0&&(h+=1),h>1&&(h-=1),h<1/6?r+(n-r)*6*h:h<1/2?n:h<2/3?r+(n-r)*(2/3-h)*6:r}const a=o(t/360+1/3),l=o(t/360),c=o(t/360-1/3);return[a,l,c]}static RGBtoHSB(t,i,s){const n=Math.min(t,i,s),r=Math.max(t,i,s),o=r===0?0:(r-n)/r;let a=0;if(n!==r){const l=r-n,c=(r-t)/l,h=(r-i)/l,u=(r-s)/l;t===r?a=u-h:i===r?a=2+c-u:a=4+h-c,a/=6,a<0&&(a=a+1)}return[a*360,o,r]}static HSBtoRGB(t,i,s){t=(t%360+360)%360/360;let n=0,r=0,o=0;if(i===0)n=r=o=s;else{const a=(t-Math.floor(t))*6,l=a-Math.floor(a),c=s*(1-i),h=s*(1-i*l),u=s*(1-i*(1-l));switch(a>>0){case 0:n=s,r=u,o=c;break;case 1:n=h,r=s,o=c;break;case 2:n=c,r=s,o=u;break;case 3:n=c,r=h,o=s;break;case 4:n=u,r=c,o=s;break;case 5:n=s,r=c,o=h;break}}return[n,r,o]}static mix(t,i,s){return new Ne(rr(t.r,i.r,s),rr(t.g,i.g,s),rr(t.b,i.b,s),rr(t.a,i.a,s))}static lighten(t,i){const s=Ne.RGBtoOKLCH(t.r,t.g,t.b);return Ne.fromOKLCH((0,Bs.clamp)(0,s[0]+i,1),s[1],s[2])}static darken(t,i){const s=Ne.RGBtoOKLCH(t.r,t.g,t.b);return Ne.fromOKLCH((0,Bs.clamp)(0,s[0]-i,1),s[1],s[2])}static interpolate(t,i){const s=1/(t.length-1),n=t.map(r=>Ne.RGBtoOKLCH(r.r,r.g,r.b));return Array.from({length:i},(r,o)=>{const a=o/(i-1),l=t.length<=2?0:Math.min(Math.floor(a*(t.length-1)),t.length-2),c=(a-l*s)/s,h=n[l],u=n[l+1];return Ne.fromOKLCH(rr(h[0],u[0],c),rr(h[1],u[1],c),rr(h[2],u[2],c))})}};wy.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 Oe=wy,Ic=class{ticks(e,t,i){}niceDomain(e,t=this.domain){return t}tickFormatter(e){}datumFormatter(e){}get bandwidth(){}get step(){}get inset(){}},Sa=(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})},Ty=e=>{const t=Oe.fromString(e),[i,s,n]=Oe.RGBtoOKLCH(t.r,t.g,t.b);return{l:i,c:s,h:n,a:t.a}},Sd=1e-6,Ny=e=>e.c<Sd||e.l<Sd||e.l>1-Sd,CA=(e,t,i)=>{i=(0,Dc.clamp)(0,i,1);let s;if(Ny(e))s=t.h;else if(Ny(t))s=e.h;else{const a=e.h;let l=t.h;const c=t.h-e.h;c>180?l-=360:c<-180&&(l+=360),s=a*(1-i)+l*i}const n=e.c*(1-i)+t.c*i,r=e.l*(1-i)+t.l*i,o=e.a*(1-i)+t.a*i;return Oe.fromOKLCH(r,n,s,o)},to=class extends Ic{constructor(){super(...arguments),this.type="color",this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.parsedRange=this.range.map(Ty)}update(){const{domain:e,range:t}=this;e.length<2&&(Dc.Logger.warnOnce("`colorDomain` should have at least 2 values."),e.length===0?e.push(0,1):e.length===1&&e.push(e[0]+1));for(let i=1;i<e.length;i++){const s=e[i-1],n=e[i];if(s>=n){Dc.Logger.warnOnce("`colorDomain` values should be supplied in ascending order."),e.sort((r,o)=>r-o);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(Ty)}normalizeDomains(...e){return{domain:e.flat(),animatable:!0}}toDomain(){}convert(e){this.refresh();const{domain:t,range:i,parsedRange:s}=this,n=t[0],r=t.at(-1),o=i[0],a=i[i.length-1];if(e<=n)return o;if(e>=r)return a;let l,c;if(t.length===2){const d=(e-n)/(r-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 CA(h,u,c).toRgbaString()}invert(){}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&Dc.Logger.warnOnce("Expected update to not invalidate scale"))}};g([Sa],to.prototype,"domain",2),g([Sa],to.prototype,"range",2);var Ac=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:r}=this;if(n.length===0)return;if(n.length===1)return n[0].color;let o=this.createCanvasGradient(e,s,i);if(o==null)return;const a=r==="oklch",l=.05;let c=n[0];o.addColorStop(c.stop,c.color);for(let h=1;h<n.length;h+=1){const u=n[h];if(a){const d=new to;d.domain=[c.stop,u.stop],d.range=[c.color,u.color];for(let p=c.stop+l;p<u.stop;p+=l)o.addColorStop(p,d.convert(p))}o.addColorStop(u.stop,u.color),c=u}return"createPattern"in o&&(o=o.createPattern()),this._cache={ctx:e,bbox:s,gradient:o},o}toSvg(e){const t=this.bbox??e,i=this.createSvgGradient(t);return this.stops.forEach(({stop:s,color:n})=>{const r=(0,kA.createSvgElement)("stop");r.setAttribute("offset",`${s}`),r.setAttribute("stop-color",`${n}`),i.appendChild(r)}),i}},Oy=class extends Ac{constructor(e,t,i=0,s){super(e,t,s),this.angle=i}createCanvasGradient(e,t,i){const{angle:n}=this,r=zs(n+-90),o=i?.centerX??t.x+t.width*.5,a=i?.centerY??t.y+t.height*.5;return e.createConicGradient(r,o,a)}createSvgGradient(e){return(0,IA.createSvgElement)("linearGradient")}},wA=(O(),N(T)),Ey=class extends Ac{constructor(e,t,i=0,s){super(e,t,s),this.angle=i}getGradientPoints(e){const{angle:i}=this,s=zs(i+90),n=Math.cos(s),r=Math.sin(s),o=e.width,a=e.height,l=e.x+o*.5,c=e.y+a*.5,h=Math.sqrt(a*a+o*o)/2,u=Math.atan2(a,o);let d;s<Math.PI/2?d=s:s<Math.PI?d=Math.PI-s:s<1.5*Math.PI?d=s-Math.PI:d=2*Math.PI-s;const p=h*Math.abs(Math.cos(d-u));return{x0:l+n*p,y0:c+r*p,x1:l-n*p,y1:c-r*p}}createCanvasGradient(e,t){const{x0:i,y0:s,x1:n,y1:r}=this.getGradientPoints(t);if(!(isNaN(i)||isNaN(s)||isNaN(n)||isNaN(r)))return e.createLinearGradient(i,s,n,r)}createSvgGradient(e){const{x0:t,y0:i,x1:s,y1:n}=this.getGradientPoints(e),r=(0,wA.createSvgElement)("linearGradient");return r.setAttribute("x1",String(t)),r.setAttribute("y1",String(i)),r.setAttribute("x2",String(s)),r.setAttribute("y2",String(n)),r.setAttribute("gradientUnits","userSpaceOnUse"),r}},TA=(O(),N(T)),NA=class extends Ac{constructor(e,t,i){super(e,t,i)}createCanvasGradient(e,t,i){const s=i?.centerX??t.x+t.width*.5,n=i?.centerY??t.y+t.height*.5,r=i?.innerRadius??0,o=i?.outerRadius??Math.hypot(t.width*.5,t.height*.5)/Math.SQRT2;return e.createRadialGradient(s,n,r,s,n,o)}createSvgGradient(e){const t=e.x+e.width*.5,i=e.y+e.height*.5,s=(0,TA.createSvgElement)("radialGradient");return s.setAttribute("cx",String(t)),s.setAttribute("cy",String(i)),s.setAttribute("r",String(Math.hypot(e.width*.5,e.height*.5)/Math.SQRT2)),s.setAttribute("gradientUnits","userSpaceOnUse"),s}},OA=(O(),N(T)),Da=(O(),N(T)),x=mA,le=class{handleUnknownProperties(e,t){}set(e){const{className:t=this.constructor.name}=this.constructor;if(typeof e!="object")return Da.Logger.warn(`unable to set ${t} - expecting a properties object`),this;const i=new Set(Object.keys(e));for(const s of sr(this))if(i.has(s)){const n=e[s],r=this;if(io(r[s]))if(r[s]instanceof Ia){const o=r[s].reset(n);o!=null?r[s]=o:Da.Logger.warn(`unable to set [${s}] - expecting a properties array`)}else r[s].set(n);else(0,Da.isPlainObject)(n)?r[s]=ba(n,r[s]??{}):r[s]=n;i.delete(s)}this.handleUnknownProperties(i,e);for(const s of i)Da.Logger.warn(`unable to set [${s}] in ${t} - property is unknown`);return this}toJson(){return sr(this).reduce((e,t)=>{const i=this[t];return e[t]=io(i)?i.toJson():i,e},{})}},Ia=class tD extends Array{constructor(t,...i){super(i.length);const n=(r=>!!r?.prototype?.constructor?.name)(t)?r=>new t().set(r):t;Object.defineProperty(this,"itemFactory",{value:n,enumerable:!1,configurable:!1}),this.set(i)}set(t){if((0,Da.isArray)(t)){this.length=t.length;for(let i=0;i<t.length;i++)this[i]=this.itemFactory(t[i])}return this}reset(t){if(Array.isArray(t))return new tD(this.itemFactory,...t)}toJson(){return this.map(t=>t?.toJson?.()??t)}};function io(e){return e instanceof le||e instanceof Ia}var Dd=class extends le{constructor(){super(...arguments),this.color="black"}};g([x],Dd.prototype,"stop",2),g([x],Dd.prototype,"color",2);function EA(e){let t;for(const i of e)if(i?.stop!=null){if(t!=null&&i.stop<t)return!1;t=i.stop}return!0}function Py(e){return e.flatMap((t,i)=>{const{stop:s}=t,n=e.at(i+1)?.color;return n!=null?[t,{stop:s,color:n}]:[t]})}function PA(e,t){const i=t==="discrete"?1:0,s=e.map((n,r,{length:o})=>({stop:(r+i)/(o-1+i),color:n}));return t==="discrete"?Py(s):s}function Ry(e,t,i,s="continuous"){const n=e.map(f=>typeof f=="string"?{color:f}:f);if(n.length===0)return PA(t,s);if(!EA(n))return OA.Logger.warnOnce("[fills] must have the stops defined in ascending order"),[];const r=Math.min(...i),o=Math.max(...i),a=s==="discrete",l=new Float64Array(n.length);let c=0,h=-1;for(let f=0;f<n.length;f+=1){const y=n[f];if(f>=h){h=n.length-1;for(let m=f+1;m<n.length;m+=1)if(n[m]?.stop!=null){h=m;break}}let b=y?.stop;if(b==null){const m=n[c]?.stop,v=n[h]?.stop,M=m??r,S=v??o,D=a&&m==null?1:0;b=M+(S-M)*(f-c+D)/(h-c+D)}else c=f;l[f]=Math.max(0,Math.min(1,(b-r)/(o-r)))}let u=n.find(f=>f.color!=null)?.color,d;const p=n.map((f,y)=>{let b=f?.color;const m=l[y];return b!=null?u=b:u!=null?b=u:(d==null&&(d=new to,d.domain=[0,1],d.range=t),b=d.convert(m)),{stop:m,color:b}});return s==="discrete"?Py(p):p}var Lc=(O(),N(T)),RA=class{constructor(e,t){this.imageLoader=e,this._cache=void 0,this.url=t.url,this.backgroundFill=t.backgroundFill??"black",this.backgroundFillOpacity=t.backgroundFillOpacity??1,this.repeat=t.repeat??"no-repeat",this.width=t.width,this.height=t.height,this.fit=t.fit??"stretch",this.rotation=t.rotation??0}createCanvasImage(e,t,i,s){if(!t)return null;const[n,r]=this.getSize(t.width,t.height,i,s);return n<1||r<1?(Lc.Logger.warnOnce("Image fill is too small to render, ignoring."),null):e.createPattern(t,this.repeat)}getSize(e,t,i,s){const{fit:n}=this;let r=e,o=t,a=1;const l=i/s,c=e/t;return n==="stretch"||e===0||t===0?(r=i,o=s):n==="contain"?a=c>l?i/e:s/t:n==="cover"&&(a=c>l?s/t:i/e),[Math.max(1,r*a),Math.max(1,o*a)]}setImageTransform(e,t){if(typeof e=="string")return;const{url:i,rotation:s,width:n,height:r}=this,o=this.imageLoader?.loadImage(i);if(!o)return;const a=zs(s),l=Math.cos(a),c=Math.sin(a),[h,u]=this.getSize(o.width,o.height,n??t.width,r??t.height),d=h/o.width,p=u/o.height,f=t.x+t.width/2,y=t.y+t.height/2,b=l*h-c*u,m=c*h+l*u,v=b/2,M=m/2;e?.setTransform(new DOMMatrix([l*d,c*p,-c*d,l*p,f-v,y-M]))}createPattern(e,t,i,s){const n=this.width??t,r=this.height??i,o=this._cache;if(o!=null&&o.ctx===e&&o.width===n&&o.height===r)return o.pattern;const a=this.imageLoader?.loadImage(this.url,s),l=this.createCanvasImage(e,a,n,r);return l==null?this.backgroundFill:(this._cache={ctx:e,pattern:l,width:n,height:r},l)}toSvg(e,t){const{url:i,rotation:s,backgroundFill:n,backgroundFillOpacity:r}=this,{x:o,y:a,width:l,height:c}=e,h=(0,Lc.createSvgElement)("pattern");h.setAttribute("viewBox",`0 0 ${l} ${c}`),h.setAttribute("x",String(o)),h.setAttribute("y",String(a)),h.setAttribute("width",String(l)),h.setAttribute("height",String(c)),h.setAttribute("patternUnits","userSpaceOnUse");const u=(0,Lc.createSvgElement)("rect");u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(l)),u.setAttribute("height",String(c)),u.setAttribute("fill",n),u.setAttribute("fill-opacity",String(r)),h.appendChild(u);const d=(0,Lc.createSvgElement)("image");return d.setAttribute("href",i),d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("width",String(l)),d.setAttribute("height",String(c)),d.setAttribute("preserveAspectRatio","none"),d.setAttribute("transform",`scale(${1/t}) rotate(${s}, ${l/2}, ${c/2})`),h.appendChild(d),h}},kc=(O(),N(T)),Fy=(O(),N(T)),FA=/^[\t\n\f\r ]*([achlmqstvz])[\t\n\f\r ]*/i,Ge=/^[+-]?((\d*\.\d+)|(\d+\.)|(\d+))(e[+-]?\d+)?/i,_A=/[\t\n\f\r ]*,?[\t\n\f\r ]*/,_y=/^[01]/,jA={z:[],h:[Ge],v:[Ge],m:[Ge,Ge],l:[Ge,Ge],t:[Ge,Ge],s:[Ge,Ge,Ge,Ge],q:[Ge,Ge,Ge,Ge],c:[Ge,Ge,Ge,Ge,Ge,Ge],a:[Ge,Ge,Ge,_y,_y,Ge,Ge]};function zA(e){if(!e)return;const t=[];let i=0,s;for(;i<e.length;){const n=FA.exec(e.slice(i));let r;if(n==null){if(!s){Fy.Logger.warnOnce(`Invalid SVG path, error at index ${i}: Missing command.`);return}r=s}else r=n[1],i+=n[0].length;const o=BA(r,e,i);if(!o)return;i=o[0],s=r,t.push(o[1])}return t}function BA(e,t,i){const s=jA[e.toLocaleLowerCase()],n={command:e,params:[]};for(const r of s){const o=t.slice(i),a=r.exec(o);if(a!=null){n.params.push(parseFloat(a[0])),i+=a[0].length;const l=_A.exec(o.slice(a[0].length));l!=null&&(i+=l[0].length)}else{if(n.params.length===1)return[i,n];Fy.Logger.warnOnce(`Invalid SVG path, error at index ${i}: No path segment parameters for command [${e}]`);return}}return[i,n]}var GA=(O(),N(T));function Aa(e,t,i,s){const n=e-i,r=t-s;return n*n+r*r}function La(e,t,i,s,n,r,o){if(i===n&&s===r)return Math.min(o,Aa(e,t,i,s));const a=n-i,l=r-s,c=Math.max(0,Math.min(1,((e-i)*a+(t-s)*l)/(a*a+l*l))),h=i+c*a,u=s+c*l;return Math.min(o,Aa(e,t,h,u))}function VA(e,t,i,s,n,r,o,a,l){a&&([o,r]=[r,o]);const c=Math.atan2(t-s,e-i);if(!bn(c,r,o)){const u=i+Math.cos(r)*n,d=s+Math.sin(r)*n,p=i+Math.cos(r)*n,f=s+Math.sin(r)*n;return Math.min(l,Aa(e,t,u,d),Aa(e,t,p,f))}const h=n-Math.sqrt(Aa(e,t,i,s));return Math.min(l,h*h)}function UA(e,t){const i=-t/e;return e!==0&&i>=0&&i<=1?[i]:[]}function WA(e,t,i){if(e===0)return UA(t,i);const s=t*t-4*e*i,n=[];if(s===0){const r=-t/(2*e);r>=0&&r<=1&&n.push(r)}else if(s>0){const r=Math.sqrt(s),o=(-t-r)/(2*e),a=(-t+r)/(2*e);o>=0&&o<=1&&n.push(o),a>=0&&a<=1&&n.push(a)}return n}function HA(e,t,i,s){if(e===0)return WA(t,i,s);const n=t/e,r=i/e,o=s/e,a=(3*r-n*n)/9,l=(9*n*r-27*o-2*n*n*n)/54,c=a*a*a+l*l,h=1/3,u=[];if(c>=0){const d=Math.sqrt(c),p=Math.sign(l+d)*Math.pow(Math.abs(l+d),h),f=Math.sign(l-d)*Math.pow(Math.abs(l-d),h),y=Math.abs(Math.sqrt(3)*(p-f)/2),b=-h*n+(p+f);if(b>=0&&b<=1&&u.push(b),y===0){const m=-h*n-(p+f)/2;m>=0&&m<=1&&u.push(m)}}else{const d=Math.acos(l/Math.sqrt(-a*a*a)),p=h*n,f=2*Math.sqrt(-a),y=f*Math.cos(h*d)-p,b=f*Math.cos(h*(d+2*Math.PI))-p,m=f*Math.cos(h*(d+4*Math.PI))-p;y>=0&&y<=1&&u.push(y),b>=0&&b<=1&&u.push(b),m>=0&&m<=1&&u.push(m)}return u}function so(e,t,i,s,n,r,o,a){const l=(i-e)*(a-r)-(s-t)*(o-n);if(l===0)return 0;const c=((o-n)*(t-r)-(e-n)*(a-r))/l,h=((i-e)*(t-r)-(s-t)*(e-n))/l;return c>=0&&c<=1&&h>=0&&h<=1?1:0}function YA(e,t,i,s,n,r,o,a,l,c,h,u){let d=0;const p=c-u,f=h-l,y=l*(u-c)-c*(h-l),b=jy(e,i,n,o),m=jy(t,s,r,a),v=p*b[0]+f*m[0],M=p*b[1]+f*m[1],S=p*b[2]+f*m[2],D=p*b[3]+f*m[3]+y,C=HA(v,M,S,D);for(const k of C){const L=k*k,w=k*L,P=b[0]*w+b[1]*L+b[2]*k+b[3],R=m[0]*w+m[1]*L+m[2]*k+m[3];let G;l===h?G=(R-c)/(u-c):G=(P-l)/(h-l),G>=0&&G<=1&&d++}return d}function jy(e,t,i,s){return[-e+3*t-3*i+s,3*e-6*t+3*i,-3*e+3*t,e]}function zy(e,t,i,s,n,r,o,a,l,c){if(isNaN(e)||isNaN(t))return 0;r&&([n,s]=[s,n]);const h=(c-a)/(l-o),u=a-h*o,d=Math.pow(h,2)+1,p=2*(h*(u-t)-e),f=Math.pow(e,2)+Math.pow(u-t,2)-Math.pow(i,2),y=Math.pow(p,2)-4*d*f;if(y<0)return 0;const b=(-p+Math.sqrt(y))/2/d,m=(-p-Math.sqrt(y))/2/d;let v=0;return[b,m].forEach(M=>{if(!(M>=Math.min(o,l)&&M<=Math.max(o,l)))return;const D=h*M+u,C=M-e,k=D-t,L=Math.atan2(k,C);bn(L,s,n)&&v++}),v}function Cc(e,t,i,s,n){return(1-n)**3*e+3*(1-n)**2*n*t+3*(1-n)*n**2*i+n**3*s}function wc(e,t,i,s,n){if(n<=Math.min(e,s))return e<s?0:1;if(n>=Math.max(e,s))return e<s?1:0;let r=0,o=1,a=NaN;for(let l=0;l<12;l+=1)a=(r+o)/2,Cc(e,t,i,s,a)<n?r=a:o=a;return a}function Tc(e,t,i,s,n,r,o,a,l){const c=(1-l)*e+l*i,h=(1-l)*t+l*s,u=(1-l)*i+l*n,d=(1-l)*s+l*r,p=(1-l)*n+l*o,f=(1-l)*r+l*a,y=(1-l)*c+l*u,b=(1-l)*h+l*d,m=(1-l)*u+l*p,v=(1-l)*d+l*f,M=(1-l)*y+l*m,S=(1-l)*b+l*v;return[[{x:e,y:t},{x:c,y:h},{x:y,y:b},{x:M,y:S}],[{x:M,y:S},{x:m,y:v},{x:p,y:f},{x:o,y:a}]]}function Id(e,t,i,s){const n=-e+3*t-3*i+s,r=2*(e-2*t+i),o=-e+t;if(n===0){if(r!==0){const l=-o/r;if(l>0&&l<1)return[l]}return[]}const a=r*r-4*n*o;if(a>=0){const l=Math.sqrt(a),c=(-r+l)/(2*n),h=(-r-l)/(2*n);return[c,h].filter(u=>u>0&&u<1)}return[]}function By(e,t,i,s,n,r,o,a){const l=Id(e,i,n,o),c=Id(t,s,r,a);return[...l,...c]}var no=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(e,t){this.openedPath=!0,this.path2d.moveTo(e,t),this.commands.push(0),this.params.push(e,t)}lineTo(e,t){this.openedPath?(this.path2d.lineTo(e,t),this.commands.push(1),this.params.push(e,t)):this.moveTo(e,t)}rect(e,t,i,s){this.moveTo(e,t),this.lineTo(e+i,t),this.lineTo(e+i,t+s),this.lineTo(e,t+s),this.closePath()}appendSvg(e){let t=0,i=0,s,n,r=0,o=0;for(const{command:a,params:l}of e){s??(s=l[0]),n??(n=l[1]);const c=a===a.toLowerCase(),h=c?s:0,u=c?n:0;switch(a.toLowerCase()){case"m":this.moveTo(h+l[0],u+l[1]),s=h+l[0],n=u+l[1],t=s,i=n;break;case"c":this.cubicCurveTo(h+l[0],u+l[1],h+l[2],u+l[3],h+l[4],u+l[5]),r=h+l[2],o=u+l[3],s=h+l[4],n=u+l[5];break;case"s":this.cubicCurveTo(s+s-r,n+n-o,h+l[0],u+l[1],h+l[2],u+l[3]),r=h+l[0],o=u+l[1],s=h+l[2],n=u+l[3];break;case"q":this.cubicCurveTo((h+2*l[0])/3,(u+2*l[1])/3,(2*l[0]+l[2])/3,(2*l[1]+l[3])/3,l[2],l[3]),r=l[0],o=l[1],s=l[2],n=l[3];break;case"t":this.cubicCurveTo((s+2*(s+s-r))/3,(n+2*(n+n-o))/3,(2*(s+s-r)+l[0])/3,(2*(n+n-o)+l[1])/3,l[0],l[1]),r=s+s-r,o=n+n-o,s=l[0],n=l[1];break;case"a":this.ellipse(s,n,l[0],l[1],l[2]*Math.PI/180,l[3],l[4],h+l[5],u+l[6]),s=h+l[5],n=u+l[6];break;case"h":this.lineTo(h+l[0],n),s=h+l[0];break;case"l":this.lineTo(h+l[0],u+l[1]),s=h+l[0],n=u+l[1];break;case"v":this.lineTo(s,u+l[0]),n=u+l[0];break;case"z":this.closePath(),s=t,n=i;break;default:throw new Error(`Could not translate command '${a}' with '${l.join(" ")}'`)}}}ellipse(e,t,i,s,n,r,o,a,l){i=Math.abs(i),s=Math.abs(s);const c=(e-a)/2,h=(t-l)/2,u=Math.sin(n),d=Math.cos(n),p=d*c+u*h,f=-u*c+d*h,y=p/i,b=f/s;let m=y*y+b*b,v=(e+a)/2,M=(t+l)/2,S=0,D=0;m>=1?(m=Math.sqrt(m),i*=m,s*=m):(m=Math.sqrt(1/m-1),r===o&&(m=-m),S=m*i*b,D=-m*s*y,v+=d*S-u*D,M+=u*S+d*D);const C=Math.atan2((f-D)/s,(p-S)/i),k=Math.atan2((-f-D)/s,(-p-S)/i)-C,L=C+k,w=!!(1-o);this.ellipticalArc(v,M,i,s,n,C,L,w)}ellipticalArc(e,t,i,s,n,r,o,a){a&&([r,o]=[o,r]);const l=[],c=.5522847498307935,h=Math.sin(r),u=Math.cos(r),d=Math.sin(n),p=Math.cos(n);let f=p*u*i-d*h*s,y=d*u*i+p*h*s,b=-p*h*i-d*u*s,m=-d*h*i+p*u*s;l.push(f+e,y+t),o-=r,o=ot(o);const v=Math.PI/2,M=Math.floor(o/v),S=o%v;for(let D=0;D<M;D++)l.push(f+b*c+e,y+m*c+t,f*c+b+e,y*c+m+t,b+e,m+t),[f,b]=[b,-f],[y,m]=[m,-y];if(S>0){const D=Math.sin(S),C=Math.cos(S),k=Math.tan(S/4)*(4/3),L=C+k*D,w=D-k*C;l.push(f+b*k+e,y+m*k+t,f*L+b*w+e,y*L+m*w+t,f*C+b*D+e,y*C+m*D+t)}if(a)for(let D=0,C=l.length-2;D<C;D+=2,C-=2)[l[D],l[C]]=[l[C],l[D]],[l[D+1],l[C+1]]=[l[C+1],l[D+1]];for(let D=2;D<l.length;D+=6){const[C,k,L,w,P,R]=l.slice(D,D+6);this.cubicCurveTo(C,k,L,w,P,R)}}roundRect(e,t,i,s,n){n=Math.min(n,i/2,s/2),this.moveTo(e,t+n),this.arc(e+n,t+n,n,Math.PI,1.5*Math.PI),this.lineTo(e+n,t),this.lineTo(e+i-n,t),this.arc(e+i-n,t+n,n,1.5*Math.PI,2*Math.PI),this.lineTo(e+i,t+n),this.lineTo(e+i,t+s-n),this.arc(e+i-n,t+s-n,n,0,Math.PI/2),this.lineTo(e+i-n,t+s),this.lineTo(e+n,t+s),this.arc(e+ +n,t+s-n,n,Math.PI/2,Math.PI),this.lineTo(e,t+s-n),this.closePath()}arc(e,t,i,s,n,r){this.openedPath=!0,this.path2d.arc(e,t,i,s,n,r),this.commands.push(2),this.params.push(e,t,i,s,n,r?1:0)}cubicCurveTo(e,t,i,s,n,r){this.openedPath||this.moveTo(e,t),this.path2d.bezierCurveTo(e,t,i,s,n,r),this.commands.push(3),this.params.push(e,t,i,s,n,r)}closePath(){this.openedPath&&(this.path2d.closePath(),this.commands.push(4),this.openedPath=!1,this.closedPath=!0)}clear(e){e&&(this.previousCommands=this.commands,this.previousParams=this.params,this.previousClosedPath=this.closedPath),this.path2d=new Path2D,this.openedPath=!1,this.closedPath=!1,this.commands=[],this.params=[]}isPointInPath(e,t){const i=this.commands,s=this.params,n=i.length,r=-1e4,o=-1e4;let a=NaN,l=NaN,c=0,h=0,u=0;for(let d=0,p=0;d<n;d++)switch(i[d]){case 0:u+=so(a,l,c,h,r,o,e,t),c=s[p++],a=c,h=s[p++],l=h;break;case 1:u+=so(c,h,s[p++],s[p++],r,o,e,t),c=s[p-2],h=s[p-1];break;case 3:u+=YA(c,h,s[p++],s[p++],s[p++],s[p++],s[p++],s[p++],r,o,e,t),c=s[p-2],h=s[p-1];break;case 2:{const f=s[p++],y=s[p++],b=s[p++],m=s[p++],v=s[p++],M=!!s[p++];if(u+=zy(f,y,b,m,v,M,r,o,e,t),!isNaN(a)){const S=f+Math.cos(m)*b,D=y+Math.sin(m)*b;u+=so(c,h,S,D,r,o,e,t)}c=f+Math.cos(v)*b,h=y+Math.sin(v)*b;break}case 4:u+=so(a,l,c,h,r,o,e,t);break}return u%2===1}distanceSquared(e,t){let i=1/0;const s=this.commands,n=this.params,r=s.length;let o=NaN,a=NaN,l=0,c=0;for(let h=0,u=0;h<r;h++)switch(s[h]){case 0:l=o=n[u++],c=a=n[u++];break;case 1:{const d=n[u++],p=n[u++];i=La(e,t,l,c,d,p,i);break}case 3:GA.Logger.error("Command.Curve distanceSquare not implemented");break;case 2:{const d=n[u++],p=n[u++],f=n[u++],y=n[u++],b=n[u++],m=d+Math.cos(y)*f,v=p+Math.sin(y)*f,M=!!n[u++];i=La(e,t,l,c,m,v,i),i=VA(e,t,d,p,f,y,b,M,i),l=d+Math.cos(b)*f,c=p+Math.sin(b)*f;break}case 4:i=La(e,t,l,c,o,a,i);break}return i}toSVG(e=(t,i)=>({x:t,y:i})){const t=[],{commands:i,params:s}=this,n=(o,...a)=>{t.push(o);for(let l=0;l<a.length;l+=2){const{x:c,y:h}=e(a[l],a[l+1]);t.push(c,h)}};let r=0;for(const o of i)switch(o){case 0:n("M",s[r++],s[r++]);break;case 1:n("L",s[r++],s[r++]);break;case 3:n("C",s[r++],s[r++],s[r++],s[r++],s[r++],s[r++]);break;case 2:{const a=s[r++],l=s[r++],c=s[r++],h=s[r++],u=s[r++],d=s[r++];let p=d?h-u:u-h;p<0&&(p+=Math.ceil(-p/(2*Math.PI))*2*Math.PI),d&&(p=-p);const f=Math.max(Math.ceil(Math.abs(p)/(Math.PI/2)),1),y=p/f,b=4/3*Math.tan(y/4),m=t.length===0?"M":"L";n(m,a+Math.cos(h)*c,l+Math.sin(h)*c);for(let v=0;v<f;v+=1){const M=h+y*(v+0),S=h+y*(v+1),D=c*Math.sin(M),C=c*Math.cos(M),k=c*Math.sin(S),L=c*Math.cos(S);n("C",a+C-b*D,l+D+b*C,a+L+b*k,l+k-b*L,a+L,l+k)}break}case 4:t.push("Z");break}return t.join(" ")}computeBBox(){const{commands:e,params:t}=this;let[i,s,n,r]=[1/0,1/0,-1/0,-1/0],[o,a]=[NaN,NaN],[l,c]=[NaN,NaN];const h=(p,f,y)=>{i=Math.min(f,i),s=Math.min(p,s),n=Math.max(p,n),r=Math.max(f,r),y&&([o,a]=[p,f])},u=(p,f,y,b,m)=>{const v=p+y*Math.cos(b),M=f+y*Math.sin(b);h(v,M,m)};let d=0;for(const p of e)switch(p){case 0:h(t[d++],t[d++],!0),[l,c]=[o,a];break;case 1:h(t[d++],t[d++],!0);break;case 3:{const f=t[d++],y=t[d++],b=t[d++],m=t[d++],v=t[d++],M=t[d++];By(o,a,f,y,b,m,v,M).forEach(D=>{const C=Cc(o,f,b,v,D),k=Cc(a,y,m,M,D);h(C,k)}),h(v,M,!0);break}case 2:{const f=t[d++],y=t[d++],b=t[d++],m=ot(t[d++]),v=ot(t[d++]),M=t[d++];u(f,y,b,m);const S=[0,Math.PI/2,Math.PI,3*Math.PI/2],[D,C]=M?[v,m]:[m,v];for(const k of S)(D<C&&D<=k&&k<=C||D>C&&(D<=k||k<=C))&&u(f,y,b,k);u(f,y,b,v,!0);break}case 4:[o,a]=[l,c];break}return new U(s,i,n-s,r-i)}};function Mt(e,t,i){const s=Math.round(t*e)/e;return i==null?s:i===0?0:i<1?Math.ceil(i*e)/e:Math.round((i+t)*e)/e-s}function Gy(e,t){return Math.floor(t*e)/e}function Ad(e,t,i){const{width:s,height:n,padding:r,strokeWidth:o}=t,a=s/2,l=n/2,c=Math.max(1,s-r-o/2),h=Math.max(1,n-r-o/2);let u=!1;for(const[d,p]of i){const f=a+(d-.5)*c,y=l+(p-.5)*h;u?e.lineTo(f,y):e.moveTo(f,y),u=!0}e.closePath()}var $A={circles(e,{width:t,strokeWidth:i,padding:s}){const n=t/2,r=Math.max(1,n-s-i/2);e.arc(n,n,r,0,Math.PI*2)},squares(e,{width:t,height:i,pixelRatio:s,padding:n,strokeWidth:r}){const o=n+r/2;e.moveTo(Mt(s,o),Mt(s,o)),e.lineTo(Mt(s,t-o),Mt(s,o)),e.lineTo(Mt(s,t-o),Mt(s,i-o)),e.lineTo(Mt(s,o),Mt(s,i-o)),e.closePath()},triangles(e,t){Ad(e,t,[[.5,0],[1,1],[0,1]])},diamonds(e,t){Ad(e,t,[[.5,0],[1,.5],[.5,1],[0,.5]])},stars(e,{width:t,height:i,padding:s}){const r=Math.max(1,(t-s)/2),o=r/2,a=Math.PI/2;for(let l=0;l<5*2;l++){const c=l%2===0?r:o,h=l*Math.PI/5-a,u=t/2+Math.cos(h)*c,d=i/2+Math.sin(h)*c;e.lineTo(u,d)}e.closePath()},hearts(e,{width:t,height:i,padding:s}){const n=Math.max(1,t/4-s/2),r=t/2,o=i/2+n/2;e.arc(r-n,o-n,n,dt(130),dt(330)),e.arc(r+n,o-n,n,dt(220),dt(50)),e.lineTo(r,o+n),e.closePath()},crosses(e,t){Ad(e,t,[[.25,0],[.5,.25],[.75,0],[1,.25],[.75,.5],[1,.75],[.75,1],[.5,.75],[.25,1],[0,.75],[.25,.5],[0,.25]])},"vertical-lines"(e,{width:t,height:i,pixelRatio:s,strokeWidth:n}){const r=Mt(s,t/2)-n%2/2;e.moveTo(r,0),e.lineTo(r,i)},"horizontal-lines"(e,{width:t,height:i,pixelRatio:s,strokeWidth:n}){const r=Mt(s,i/2)-n%2/2;e.moveTo(0,r),e.lineTo(t,r)},"forward-slanted-lines"(e,{width:t,height:i,strokeWidth:s}){const n=Math.atan2(i,t),r=s*Math.cos(n),o=s*Math.sin(n);e.moveTo(-r,o),e.lineTo(r,-o),e.moveTo(-r,i+o),e.lineTo(t+r,-o),e.moveTo(t-r,i+o),e.lineTo(t+r,i-o)},"backward-slanted-lines"(e,{width:t,height:i,strokeWidth:s}){const n=Math.atan2(i,t),r=s*Math.cos(n),o=s*Math.sin(n);e.moveTo(t-r,-o),e.lineTo(t+r,o),e.moveTo(-r,-o),e.lineTo(t+r,i+o),e.moveTo(-r,i-o),e.lineTo(r,i+o)}},KA=class{constructor(e){this._cache=void 0,this.width=Math.max(e?.width??10,1),this.height=Math.max(e?.height??10,1),this.fill=e.fill??"none",this.fillOpacity=e.fillOpacity??1,this.backgroundFill=e.backgroundFill??"none",this.backgroundFillOpacity=e.backgroundFillOpacity??1,this.stroke=e.stroke??"black",this.strokeOpacity=e.strokeOpacity??1,this.strokeWidth=e.strokeWidth??1,this.padding=e.padding??1,this.pattern=e.pattern??"forward-slanted-lines",this.rotation=e.rotation??0,this.scale=e.scale??1,this.path=e.path}getPath(e){const{pattern:t,width:i,height:s,padding:n,strokeWidth:r,path:o}=this,a=new no,l=zA(o);return l?a.appendSvg(l):$A[t](a,{width:i,height:s,pixelRatio:e,strokeWidth:r,padding:n}),a}renderStroke(e,t){const{stroke:i,strokeWidth:s,strokeOpacity:n}=this;s&&(t.strokeStyle=i,t.lineWidth=s,t.globalAlpha=n,t.stroke(e))}renderFill(e,t){const{fill:i,fillOpacity:s}=this;i!=="none"&&(t.fillStyle=i,t.globalAlpha=s,t.fill(e))}createCanvasPattern(e,t){const{width:i,height:s,scale:n,backgroundFill:r,backgroundFillOpacity:o}=this;if(i*n<1||s*n<1)return kc.Logger.warnOnce("Pattern fill is too small to render, ignoring."),null;const a=new ud({width:i,height:s,pixelRatio:t*n}),l=a.context;r!=="none"&&(l.fillStyle=r,l.globalAlpha=o,l.fillRect(0,0,i,s));const c=this.getPath(t).getPath2D();this.renderFill(c,l),this.renderStroke(c,l);const h=e.createPattern(a.canvas,"repeat");return this.setPatternTransform(h,t),a.destroy(),h}setPatternTransform(e,t,i=0,s=0){const n=zs(this.rotation),r=1/t,o=Math.cos(n)*r,a=Math.sin(n)*r;e?.setTransform(new DOMMatrix([o,a,-a,o,i,s]))}createPattern(e,t){if(this._cache!=null&&this._cache.ctx===e&&this._cache.pixelRatio===t)return this._cache.pattern;const i=this.createCanvasPattern(e,t);if(i!=null)return this._cache={ctx:e,pattern:i,pixelRatio:t},i}toSvg(){const{width:e,height:t,fill:i,fillOpacity:s,backgroundFill:n,backgroundFillOpacity:r,stroke:o,strokeWidth:a,strokeOpacity:l,rotation:c,scale:h}=this,u=(0,kc.createSvgElement)("pattern");u.setAttribute("viewBox",`0 0 ${e} ${t}`),u.setAttribute("width",String(e)),u.setAttribute("height",String(t)),u.setAttribute("patternUnits","userSpaceOnUse");const d=(0,kc.createSvgElement)("rect");d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("width",String(e)),d.setAttribute("height",String(t)),d.setAttribute("fill",n),d.setAttribute("fill-opacity",String(r)),u.appendChild(d);const p=(0,kc.createSvgElement)("path");return p.setAttribute("fill",i),p.setAttribute("fill-opacity",String(s)),p.setAttribute("stroke-opacity",String(l)),p.setAttribute("stroke",o),p.setAttribute("stroke-width",String(a)),p.setAttribute("transform",`rotate(${c}) scale(${h})`),p.setAttribute("d",this.getPath(1).toSVG()),u.appendChild(p),u}},Nc=(O(),N(T));function is(e){return(0,Nc.isObject)(e)&&e.type=="gradient"}function Vy(e){return(0,Nc.isArray)(e)&&e.every(t=>typeof t=="string")}function or(e){return e!==null&&(0,Nc.isObject)(e)&&e.type=="pattern"}function ro(e){return e!==null&&(0,Nc.isObject)(e)&&e.type=="image"}function ZA(e){return is(e)||or(e)}var Kt=class _s extends js{constructor(){super(...arguments),this.fillOpacity=1,this.strokeOpacity=1,this.fill=_s.defaultStyles.fill,this.stroke=_s.defaultStyles.stroke,this.strokeWidth=_s.defaultStyles.strokeWidth,this.lineDash=_s.defaultStyles.lineDash,this.lineDashOffset=_s.defaultStyles.lineDashOffset,this.lineCap=_s.defaultStyles.lineCap,this.lineJoin=_s.defaultStyles.lineJoin,this.miterLimit=void 0,this.opacity=_s.defaultStyles.opacity,this.fillShadow=_s.defaultStyles.fillShadow}restoreOwnStyles(){const{defaultStyles:t}=this.constructor;Object.assign(this,t)}getGradient(t){if(is(t))return this.createGradient(t)}createGradient(t){const{colorSpace:i="rgb",gradient:s="linear",colorStops:n,rotation:r=0,reverse:o=!1}=t;if(n==null)return;let a=Ry(n,["black"],[0,1]);switch(o&&(a=a.map(l=>({color:l.color,stop:1-l.stop})).reverse()),s){case"linear":return new Ey(i,a,r);case"radial":return new NA(i,a);case"conic":return new Oy(i,a,r)}}getPattern(t){if(or(t))return this.createPattern(t)}createPattern(t){return new KA(t)}getImage(t){if(ro(t))return this.createImage(t)}createImage(t){return new RA(this.imageLoader,t)}onFillChange(){typeof this.fill=="object"&&ii(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,i){return Mt(this.layerManager?.canvas?.pixelRatio??1,t,i)}preRender(t,i){return this.dirty&&(this.cachedDefaultGradientFillBBox=void 0),super.preRender(t,i)}fillStroke(t,i){this.renderFill(t,i),this.renderStroke(t,i)}renderFill(t,i){const{fill:s,fillImage:n}=this;if(s&&s!=="none"){const{globalAlpha:r}=t;n&&(t.globalAlpha=n.backgroundFillOpacity,t.fillStyle=n.backgroundFill,this.executeFill(t,i),t.globalAlpha=r),this.applyFillAndAlpha(t),this.applyShadow(t),this.executeFill(t,i),t.globalAlpha=r}t.shadowColor="rgba(0, 0, 0, 0)"}executeFill(t,i){i?t.fill(i):t.fill()}applyFillAndAlpha(t){const{fill:i,fillGradient:s,fillPattern:n,fillImage:r,fillOpacity:o,opacity:a}=this;if(t.globalAlpha*=a*o,s){const{fillBBox:l=this.getDefaultGradientFillBBox()??this.getBBox(),fillParams:c}=this;t.fillStyle=s.createGradient(t,l,c)??"black"}else if(n){const{x:l,y:c}=this.getBBox(),h=this.layerManager?.canvas?.pixelRatio??1,u=n.createPattern(t,h);n.setPatternTransform(u,h,l,c),u?t.fillStyle=u:(t.fillStyle=n.fill,t.globalAlpha*=n.fillOpacity)}else if(r){const l=this.getBBox(),c=r.createPattern(t,l.width,l.height,this);r.setImageTransform(c,l),t.fillStyle=c??"transparent"}else t.fillStyle=typeof i=="string"?i:"black"}applyStrokeAndAlpha(t){const{stroke:i,strokeOpacity:s,strokeGradient:n,opacity:r}=this;t.strokeStyle=n?.createGradient(t,this.getBBox())??(typeof i=="string"?i:void 0)??"black",t.globalAlpha*=r*s}applyShadow(t){const i=this.layerManager?.canvas.pixelRatio??1,s=this.fillShadow;s?.enabled&&(t.shadowColor=s.color,t.shadowOffsetX=s.xOffset*i,t.shadowOffsetY=s.yOffset*i,t.shadowBlur=s.blur*i)}renderStroke(t,i){const{stroke:s,strokeWidth:n,lineDash:r,lineDashOffset:o,lineCap:a,lineJoin:l,miterLimit:c}=this;if(s&&n){const{globalAlpha:h}=t;this.applyStrokeAndAlpha(t),t.lineWidth=n,r&&t.setLineDash(r),o&&(t.lineDashOffset=o),a&&(t.lineCap=a),l&&(t.lineJoin=l),c!=null&&(t.miterLimit=c),this.executeStroke(t,i),t.globalAlpha=h}}executeStroke(t,i){i?t.stroke(i):t.stroke()}getDefaultGradientFillBBox(){return this.cachedDefaultGradientFillBBox==null&&(this.cachedDefaultGradientFillBBox=Object.freeze(this.computeDefaultGradientFillBBox())),this.cachedDefaultGradientFillBBox}computeDefaultGradientFillBBox(){}containsPoint(t,i){return this.isPointInPath(t,i)}applySvgFillAttributes(t,i){const{fill:s,fillOpacity:n}=this;if(typeof s=="string")t.setAttribute("fill",s);else if(is(s)&&this.fillGradient){i??(i=[]);const r=this.fillGradient.toSvg(this.fillBBox??this.getBBox()),o=(0,Mc.generateUUID)();r.setAttribute("id",o),i.push(r),t.setAttribute("fill",`url(#${o})`)}else if(or(s)&&this.fillPattern){i??(i=[]);const r=this.fillPattern.toSvg(),o=(0,Mc.generateUUID)();r.setAttribute("id",o),i.push(r),t.setAttribute("fill",`url(#${o})`)}else if(ro(s)&&this.fillImage){i??(i=[]);const r=this.layerManager?.canvas?.pixelRatio??1,o=this.fillImage.toSvg(this.getBBox(),r),a=(0,Mc.generateUUID)();o.setAttribute("id",a),i.push(o),t.setAttribute("fill",`url(#${a})`)}else t.setAttribute("fill","none");return t.setAttribute("fill-opacity",String(n)),i}applySvgStrokeAttributes(t){const{stroke:i,strokeOpacity:s,strokeWidth:n,lineDash:r,lineDashOffset:o}=this;if(i!=null&&(t.setAttribute("stroke",typeof i=="string"?i:"none"),t.setAttribute("stroke-opacity",String(s)),t.setAttribute("stroke-width",String(n))),r?.some(a=>a!==0)===!0){const a=r.length%2===1?[...r,...r]:r;t.setAttribute("stroke-dasharray",a.join(" ")),t.setAttribute("stroke-dashoffset",String(o))}}};Kt.defaultStyles={fill:"black",stroke:void 0,strokeWidth:0,lineDash:void 0,lineDashOffset:0,lineCap:void 0,lineJoin:void 0,opacity:1,fillShadow:void 0},g([_()],Kt.prototype,"fillOpacity",2),g([_()],Kt.prototype,"strokeOpacity",2),g([Ai({equals:ii,changeCb:e=>e.onFillChange()})],Kt.prototype,"fill",2),g([Ai({equals:ii,changeCb:e=>e.onStrokeChange()})],Kt.prototype,"stroke",2),g([_()],Kt.prototype,"strokeWidth",2),g([bd()],Kt.prototype,"lineDash",2),g([_()],Kt.prototype,"lineDashOffset",2),g([_()],Kt.prototype,"lineCap",2),g([_()],Kt.prototype,"lineJoin",2),g([_()],Kt.prototype,"miterLimit",2),g([_({convertor:e=>(0,Mc.clamp)(0,e,1)})],Kt.prototype,"opacity",2),g([Ai({equals:eo,checkDirtyOnAssignment:!0})],Kt.prototype,"fillShadow",2),g([Ai({equals:tr.equals,changeCb:e=>e.onFillChange()})],Kt.prototype,"fillBBox",2),g([Ai({equals:ii,changeCb:e=>e.onFillChange()})],Kt.prototype,"fillParams",2);var Bi=Kt,XA=(O(),N(T)),oo=(O(),N(T)),Uy=[1,0,0,1,0,0],Gs=class Ou{get e(){return[...this.elements]}constructor(t=Uy){this.elements=[...t]}setElements(t){const i=this.elements;return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],this}get identity(){const t=this.elements;return(0,oo.isNumberEqual)(t[0],1)&&(0,oo.isNumberEqual)(t[1],0)&&(0,oo.isNumberEqual)(t[2],0)&&(0,oo.isNumberEqual)(t[3],1)&&(0,oo.isNumberEqual)(t[4],0)&&(0,oo.isNumberEqual)(t[5],0)}AxB(t,i,s){const n=t[0]*i[0]+t[2]*i[1],r=t[1]*i[0]+t[3]*i[1],o=t[0]*i[2]+t[2]*i[3],a=t[1]*i[2]+t[3]*i[3],l=t[0]*i[4]+t[2]*i[5]+t[4],c=t[1]*i[4]+t[3]*i[5]+t[5];s=s??t,s[0]=n,s[1]=r,s[2]=o,s[3]=a,s[4]=l,s[5]=c}multiplySelf(t){return this.AxB(this.elements,t.elements),this}multiply(t){const i=new Array(6);return t instanceof Ou?this.AxB(this.elements,t.elements,i):this.AxB(this.elements,[t.a,t.b,t.c,t.d,t.e,t.f],i),new Ou(i)}preMultiplySelf(t){return this.AxB(t.elements,this.elements,this.elements),this}inverse(){const t=this.elements;let i=t[0],s=t[1],n=t[2],r=t[3];const o=t[4],a=t[5],l=1/(i*r-s*n);return i*=l,s*=l,n*=l,r*=l,new Ou([r,-s,-n,i,n*a-r*o,s*o-i*a])}invertSelf(){const t=this.elements;let i=t[0],s=t[1],n=t[2],r=t[3];const o=t[4],a=t[5],l=1/(i*r-s*n);return i*=l,s*=l,n*=l,r*=l,t[0]=r,t[1]=-s,t[2]=-n,t[3]=i,t[4]=n*a-r*o,t[5]=s*o-i*a,this}transformPoint(t,i){const s=this.elements;return{x:t*s[0]+i*s[2]+s[4],y:t*s[1]+i*s[3]+s[5]}}transformBBox(t,i){const s=this.elements,n=s[0],r=s[1],o=s[2],a=s[3],l=t.width*.5,c=t.height*.5,h=t.x+l,u=t.y+c,d=Math.abs(l*n)+Math.abs(c*o),p=Math.abs(l*r)+Math.abs(c*a);return i??(i=new U(0,0,0,0)),i.x=h*n+u*o+s[4]-d,i.y=h*r+u*a+s[5]-p,i.width=d+d,i.height=p+p,i}toContext(t){if(this.identity)return;const i=this.elements;t.transform(i[0],i[1],i[2],i[3],i[4],i[5])}static updateTransformMatrix(t,i,s,n,r,o,a){const l=i,c=s;let h,u;l===1&&c===1?(h=0,u=0):(h=a?.scalingCenterX??0,u=a?.scalingCenterY??0);const d=n,p=Math.cos(d),f=Math.sin(d);let y,b;d===0?(y=0,b=0):(y=a?.rotationCenterX??0,b=a?.rotationCenterY??0);const m=r,v=o,M=h*(1-l)-y,S=u*(1-c)-b;return t.setElements([p*l,f*l,-f*c,p*c,p*M-f*S+y+m,f*M+p*S+b+v]),t}};function xn(e){return Hy(e.constructor)}var Wy=Symbol("isMatrixTransform");function Hy(e){return e[Wy]===!0}function Ld(e){var t,i;const s=e;if(Hy(e))return e;const n=Symbol("matrix_combined_transform");class r extends s{constructor(){super(...arguments),this[i]=new Gs,this._dirtyTransform=!0}markDirtyTransform(){this._dirtyTransform=!0,super.markDirty()}onChangeDetection(a){super.onChangeDetection(a),this.markDirtyTransform()}updateMatrix(a){}computeTransformMatrix(){this._dirtyTransform&&(this[n].setElements(Uy),this.updateMatrix(this[n]),this._dirtyTransform=!1)}toParent(a){return this.computeTransformMatrix(),this[n].identity?a.clone():this[n].transformBBox(a)}toParentPoint(a,l){return this.computeTransformMatrix(),this[n].identity?{x:a,y:l}:this[n].transformPoint(a,l)}fromParent(a){return this.computeTransformMatrix(),this[n].identity?a.clone():this[n].inverse().transformBBox(a)}fromParentPoint(a,l){return this.computeTransformMatrix(),this[n].identity?{x:a,y:l}:this[n].inverse().transformPoint(a,l)}computeBBox(){const a=super.computeBBox();return a&&this.toParent(a)}computeBBoxWithoutTransforms(){return super.computeBBox()}pickNode(a,l){return{x:a,y:l}=this.fromParentPoint(a,l),super.pickNode(a,l)}pickNodes(a,l,c){return{x:a,y:l}=this.fromParentPoint(a,l),super.pickNodes(a,l,c)}render(a){this.computeTransformMatrix();const{ctx:l}=a,c=this[n];let h=!1;c.identity||(l.save(),h=!0,c.toContext(l)),super.render(a),h&&l.restore()}toSVG(){this.computeTransformMatrix();const a=super.toSVG(),l=this[n];if(l.identity||a==null)return a;const c=(0,XA.createSvgElement)("g");c.append(...a.elements);const[h,u,d,p,f,y]=l.e;return c.setAttribute("transform",`matrix(${h} ${u} ${d} ${p} ${f} ${y})`),{elements:[c],defs:a.defs}}}return t=Wy,i=n,r[t]=!0,r}function ao(e){var t;const i=e,s=Symbol("matrix_rotation");class n extends Ld(i){constructor(){super(...arguments),this[t]=new Gs,this.rotationCenterX=0,this.rotationCenterY=0,this.rotation=0}updateMatrix(o){super.updateMatrix(o);const{rotation:a,rotationCenterX:l,rotationCenterY:c}=this;a!==0&&(Gs.updateTransformMatrix(this[s],1,1,a,0,0,{rotationCenterX:l,rotationCenterY:c}),o.multiplySelf(this[s]))}}return t=s,g([_()],n.prototype,"rotationCenterX",2),g([_()],n.prototype,"rotationCenterY",2),g([_()],n.prototype,"rotation",2),n}function kd(e){var t;const i=e,s=Symbol("matrix_scale");class n extends Ld(i){constructor(){super(...arguments),this[t]=new Gs,this.scalingX=1,this.scalingY=1,this.scalingCenterX=0,this.scalingCenterY=0}updateMatrix(o){super.updateMatrix(o);const{scalingX:a,scalingY:l,scalingCenterX:c,scalingCenterY:h}=this;a===1&&l===1||(Gs.updateTransformMatrix(this[s],a,l,0,0,0,{scalingCenterX:c,scalingCenterY:h}),o.multiplySelf(this[s]))}}return t=s,g([_()],n.prototype,"scalingX",2),g([_()],n.prototype,"scalingY",2),g([_()],n.prototype,"scalingCenterX",2),g([_()],n.prototype,"scalingCenterY",2),n}function ar(e){var t;const i=e,s=Symbol("matrix_translation");class n extends Ld(i){constructor(){super(...arguments),this[t]=new Gs,this.translationX=0,this.translationY=0}updateMatrix(o){super.updateMatrix(o);const{translationX:a,translationY:l}=this;a===0&&l===0||(Gs.updateTransformMatrix(this[s],1,1,0,a,l),o.multiplySelf(this[s]))}}return t=s,g([_()],n.prototype,"translationX",2),g([_()],n.prototype,"translationY",2),n}var Qe=class{static fromCanvas(e,t){const i=[];for(const s of e.traverseUp())xn(s)&&i.unshift(s);for(const s of i)t=s.fromParent(t);return xn(e)&&(t=e.fromParent(t)),t}static toCanvas(e,t){t==null?t=e.getBBox():xn(e)&&(t=e.toParent(t));for(const i of e.traverseUp())xn(i)&&(t=i.toParent(t));return t}static fromCanvasPoint(e,t,i){const s=[];for(const n of e.traverseUp())xn(n)&&s.unshift(n);for(const n of s)({x:t,y:i}=n.fromParentPoint(t,i));return xn(e)&&({x:t,y:i}=e.fromParentPoint(t,i)),{x:t,y:i}}static toCanvasPoint(e,t,i){xn(e)&&({x:t,y:i}=e.toParentPoint(t,i));for(const s of e.traverseUp())xn(s)&&({x:t,y:i}=s.toParentPoint(t,i));return{x:t,y:i}}},Cd=(e,t)=>Math.sign(e-t);function Yy(e,t){if(typeof e=="number"&&typeof t=="number")return Cd(e,t);const i=typeof e=="number"?[e]:e,s=typeof t=="number"?[t]:t,n=Math.min(i.length,s.length);for(let r=0;r<n;r+=1){const o=Cd(i[r],s[r]);if(o!==0)return o}return Cd(i.length,s.length)}var ka,wd=class Yl extends js{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 Yl}static computeChildrenBBox(t,i=!0){return U.merge(js.extractBBoxes(t,i))}static compareChildren(t,i){return Yy(t.zIndex,i.zIndex)||t.serialNumber-i.serialNumber}containsPoint(t,i){return!0}computeBBox(){return Yl.computeChildrenBBox(this.children())}computeSafeClippingBBox(t){const i=this.computeBBox();if(!i.isFinite())return;let s=0;const n=4;for(const d of this.descendants())d instanceof Bi&&(s=Math.max(s,d.strokeWidth));const r=Math.max(1,s/2*n),{x:o,y:a}=Qe.toCanvasPoint(this,0,0),l=Gy(t,o+i.x-r)-o,c=Gy(t,a+i.y-r)-a,h=Math.ceil(i.x+i.width-l+r),u=Math.ceil(i.y+i.height-c+r);return new U(l,c,h,u)}prepareSharedCanvas(t,i,s){return ka==null||ka.pixelRatio!==s?ka=new ud({width:t,height:i,pixelRatio:s}):ka.resize(t,i,s),ka}isDirty(t){const{width:i,height:s,devicePixelRatio:n}=t,{dirty:r,dirtyZIndex:o,layer:a}=this,l=a!=null&&(this._lastWidth!==i||this._lastHeight!==s),c=this._lastDevicePixelRatio!==n;if(this._lastWidth=i,this._lastHeight=s,this._lastDevicePixelRatio=n,r||o||l||c)return!0;for(const h of this.children())if(h.dirty)return!0;return!1}preRender(t){const i=super.preRender(t,0);return i.groups+=1,i.nonGroups-=1,this.renderToOffscreenCanvas&&!this.optimizeForInfrequentRedraws&&i.nonGroups>0&&this.getVisibility()?this.layer??(this.layer=this.layerManager?.addLayer({name:this.name})):this.layer!=null&&(this.layerManager?.removeLayer(this.layer),this.layer=void 0),i}render(t){const{layer:i,renderToOffscreenCanvas:s}=this,n={...t};if(!s){this.renderInContext(n),super.render(n);return}const{ctx:r,stats:o,devicePixelRatio:a}=t;let{image:l}=this;if(this.isDirty(t)){l?.bitmap.close(),l=void 0;const h=i?void 0:this.computeSafeClippingBBox(a),u=(d,...p)=>{const f=d.context;n.ctx=f,d.clear(),f.save(),f.setTransform(...p),f.globalAlpha=1,this.renderInContext(n),f.restore(),f.verifyDepthZero?.()};if(i)u(i,r.getTransform());else if(h){const{x:d,y:p,width:f,height:y}=h,b=this.prepareSharedCanvas(f,y,a);u(b,a,0,0,a,-d*a,-p*a),l={bitmap:b.transferToImageBitmap(),x:d,y:p,width:f,height:y}}else this.dirtyZIndex&&this.sortChildren(Yl.compareChildren);this.image=l,o&&o.layersRendered++}else this.skipRender(n),o&&o.layersSkipped++;const{globalAlpha:c}=r;if(r.globalAlpha=c*this.opacity,i)r.save(),r.resetTransform(),i.drawImage(r),r.restore();else if(l){const{bitmap:h,x:u,y:d,width:p,height:f}=l;r.drawImage(h,0,0,p*a,f*a,u,d,p,f)}r.globalAlpha=c,super.render(n)}skipRender(t){const{stats:i}=t;for(const s of this.children())s.markClean(),i&&(i.nodesSkipped+=this.childNodeCounts.groups+this.childNodeCounts.nonGroups,i.opsSkipped+=this.childNodeCounts.complexity)}applyClip(t,i){const{x:s,y:n,width:r,height:o}=i;t.beginPath(),t.rect(s,n,r,o),t.clip()}renderInContext(t){const{ctx:i,stats:s}=t;this.dirtyZIndex&&this.sortChildren(Yl.compareChildren),i.save(),i.globalAlpha*=this.opacity,this.clipRect!=null&&(this.applyClip(i,this.clipRect),t.clipBBox=Qe.toCanvas(this,this.clipRect));for(const n of this.children()){if(!n.visible){n.markClean(),s&&(s.nodesSkipped+=n.childNodeCounts.nonGroups+n.childNodeCounts.groups,s.opsSkipped+=n.childNodeCounts.complexity);continue}i.save(),n.render(t),i.restore()}i.restore()}setClipRect(t){this.clipRect=t?Qe.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=[],i=[];for(const s of this.children()){const n=s.toSVG();n!=null&&(i.push(...n.elements),n.defs!=null&&t.push(...n.defs))}return{elements:i,defs:t}}};wd.className="Group",g([_({convertor:e=>(0,pA.clamp)(0,e,1)})],wd.prototype,"opacity",2);var ue=wd,qA=class extends kd(ue){},QA=class extends ao(ue){},Ot=class extends ar(ue){},lo=class extends ao(ar(ue)){},Td=(O(),N(T));function Oc(e,t){e&&(t=tr.normalize(t),t.width==null?e.style.removeProperty("width"):e.style.width=`${t.width}px`,t.height==null?e.style.removeProperty("height"):e.style.height=`${t.height}px`,t.x==null?e.style.removeProperty("left"):e.style.left=`${t.x}px`,t.y==null?e.style.removeProperty("top"):e.style.top=`${t.y}px`)}function $y(e){const t=parseFloat(e.style.width)||e.offsetWidth,i=parseFloat(e.style.height)||e.offsetHeight,s=parseFloat(e.style.left)||e.offsetLeft,n=parseFloat(e.style.top)||e.offsetTop;return{x:s,y:n,width:t,height:i}}function JA(e){if(e.focus({preventScroll:!0}),e.lastChild?.textContent==null)return;const t=(0,Td.getDocument)().createRange();t.setStart(e.lastChild,e.lastChild.textContent.length),t.setEnd(e.lastChild,e.lastChild.textContent.length);const i=(0,Td.getWindow)().getSelection();i?.removeAllRanges(),i?.addRange(t)}function Ky(){const e=(0,Td.getWindow)("navigator");if("scheduling"in e){const t=e.scheduling;if("isInputPending"in t)return t.isInputPending({includeContinuous:!0})}return!1}function Ec(e){return`ag-charts-icon ag-charts-icon-${e}`}var K=(O(),N(T)),Nd="class-instance";function Ss(e,t,i){if((0,K.isArray)(t)){if(!(0,K.isArray)(e)||e.length!==t.length||t.some((s,n)=>Ss(e[n],s,i)!=null))return t}else if((0,K.isPlainObject)(t)){if(!(0,K.isPlainObject)(e))return t;const s={},n=new Set([...Object.keys(e),...Object.keys(t)]);for(const r of n)if(e[r]!==t[r])if(i?.has(r))s[r]=t[r];else if(typeof e[r]==typeof t[r]){const o=Ss(e[r],t[r],i);o!==null&&(s[r]=o)}else s[r]=t[r];return Object.keys(s).length?s:null}else if(e!==t)return t;return null}function Zy(e,t){for(const i of Object.keys(e))if(e[i]!==t?.[i])return!1;return!0}function Ve(e,t){return(0,K.isArray)(e)?eL(e,t):(0,K.isPlainObject)(e)?tL(e,t):e instanceof Map?new Map(Ve(Array.from(e))):Od(e)}function eL(e,t){const i=[],s=t?.seen;for(const n of e){if(typeof n=="object"&&s?.includes(n)){K.Logger.warn("cycle detected in array",n);continue}s?.push(n),i.push(Ve(n,t)),s?.pop()}return i}function tL(e,t){const i={};for(const s of Object.keys(e))t?.assign?.has(s)?i[s]=e[s]:t?.shallow?.has(s)?i[s]=Od(e[s]):i[s]=Ve(e[s],t);return i}function Od(e){return(0,K.isArray)(e)?e.slice(0):(0,K.isPlainObject)(e)?{...e}:(0,K.isDate)(e)?new Date(e):(0,K.isRegExp)(e)?new RegExp(e.source,e.flags):e}function Ds(e,t,i,s,n,r){if((0,K.isArray)(e)){r=t(e,s,n,r);let o=0;for(const a of e)r=Ds(a,t,i,s?.[o],n,r),o++}else if((0,K.isPlainObject)(e)){r=t(e,s,n,r);for(const o of Object.keys(e)){if(i?.has(o))continue;const a=e[o];r=Ds(a,t,i,s?.[o],n,r)}}return r}function Ca(e,t,i={}){const{path:s,matcherPath:n=s?.replace(/(\[[0-9+]+])/i,"[]"),skip:r=[]}=i;if(e==null)throw new Error(`AG Charts - target is uninitialised: ${s??"<root>"}`);if(t==null)return e;if(io(e))return e.set(t);const o=e,a=Ed(e);for(const l of Object.keys(t)){if(fd.has(l))continue;const c=`${n?n+".":""}${l}`;if(r.includes(c))continue;const h=t[l],u=`${s?s+".":""}${l}`,d=o.constructor,p=o[l];try{const f=Ed(p),y=Ed(h);if(a===Nd&&!(l in e||l==="context")){if(h===void 0)continue;K.Logger.warn(`unable to set [${u}] in ${d?.name} - property is unknown`);continue}if(f!=null&&y!=null&&y!==f&&(f!==Nd||y!=="object")){K.Logger.warn(`unable to set [${u}] in ${d?.name} - can't apply type of [${y}], allowed types are: [${f}]`);continue}if(io(p))o[l].set(h);else if(y==="object"&&l!=="context"){if(p==null){K.Logger.warn(`unable to set [${u}] in ${d?.name} - property is unknown`);continue}Ca(p,h,{...i,path:u,matcherPath:c})}else o[l]=h}catch(f){K.Logger.warn(`unable to set [${u}] in [${d?.name}]; nested error is: ${f.message}`)}}return e}function Ed(e){return e==null?null:(0,K.isHtmlElement)(e)||(0,K.isDate)(e)?"primitive":(0,K.isArray)(e)?"array":(0,K.isObject)(e)?(0,K.isPlainObject)(e)?"object":Nd:(0,K.isFunction)(e)?"function":"primitive"}function Pc(e,t,i,s){return Rd(e,t,s??e,{matches:new Map},i)}var Pd=Symbol("operation-resolved-undefined");function Rd(e,t,i,s,n,r=[],o={}){if((0,K.isArray)(e)){Xy(e,t,i,s,r,o);let a=0;for(const l of e)Rd(l,t,i,s,n,[...r,`${a}`],o),a++}else if((0,K.isPlainObject)(e)){Xy(e,t,i,s,r,o);for(const a of Object.keys(e)){if(n?.has(a))continue;const l=e[a];Vs(l)?e[a]=Fd(l,t,i,s,[...r,a],o):Rd(l,t,i,s,n,[...r,a],o)}}return o}function Xy(e,t,i,s,n,r){if((0,K.isArray)(e))for(let o=0;o<e.length;o++)e[o]=Fd(e[o],t,i,s,[...n,`${o}`],r),e[o]===Pd&&(e[o]=void 0);else{let o=!1;for(const a of Object.keys(e))e[a]=Fd(e[a],t,i,s,[...n,a],r),o||(o=ss(a,Fc)),e[a]===Pd&&delete e[a];if(o&&Object.keys(e).length>1)for(const a of Object.keys(e))ss(a,Fc)&&delete e[a]}}function Fd(e,t,i,s,n,r){const o=Vs(e);if(!o)return e;r[n.join(".")]=e;const a=wa(o.operation,o.values,t,i,n,s);return a===void 0?Pd:a}function Vs(e){if(!(0,K.isPlainObject)(e))return;const[t]=Object.keys(e);if(ss(t,Fc))return{operation:t,values:e[t]}}function wa(e,t,i,s,n,r){r.referencedParams??(r.referencedParams=new Set);const o=["$find","$map"];(0,K.isArray)(t)&&!o.includes(e)&&(t=t.map(l=>{const c=Vs(l);return c?wa(c.operation,c.values,i,s,n,r):l}));const a=Fc[e];return a(t,n,i,s,r)}function ss(e,t){return(0,K.isString)(e)&&((0,K.isObject)(t)||(0,K.isArray)(t))&&e in t}function Rc(e){return(0,K.isNumber)(e)&&e>=0&&e<=1}function qy(e){return(0,K.isObject)(e)&&e.type=="gradient"}function iL(e){return e!==null&&(0,K.isObject)(e)&&e.type=="pattern"}function sL(e){return e!==null&&(0,K.isObject)(e)&&e.type=="image"}function Qy(e,t){const i=t.split("/");let s=[...e];t.startsWith("/")&&(s=[],i.shift());let n=!1;for(const r of i){if(r==="..")s.pop(),n||s.pop();else if(r===".")s.pop();else if(r==="$index"){const o=e.findLast(a=>!isNaN(Number(a)));o!=null&&s.push(o)}else if(r==="$prevIndex"){const o=e.findLast(a=>!isNaN(Number(a)));o!=null&&s.push(`${Number(o)-1}`)}else r.length!==0&&s.push(r);n=r===".."}return s}var nL={$ref:Jy,$path:uL,$palette:hL},rL={$if:([e,t,i])=>e?t:i,$eq:([e,t])=>e===t,$not:([e])=>!e,$or:e=>(0,K.isArray)(e)&&e.some(Boolean),$and:e=>(0,K.isArray)(e)&&e.every(Boolean),$switch:()=>{},$isOperation:dL},oL={$isEven:pL,$mul:gL,$round:fL},aL={$map:mL,$find:yL,$merge:bL,$omit:xL,$value:vL},lL={$rem:ML},cL={$mix:SL,$foregroundBackgroundMix:DL,$foregroundBackgroundAccentMix:IL,$interpolate:AL,$isGradient:([e])=>qy(e),$isPattern:([e])=>iL(e),$isImage:([e])=>sL(e)},Fc={...nL,...rL,...oL,...aL,...lL,...cL};function Jy(e,t,i,s,n){if(!ss(e,i)){K.Logger.warnOnce(`\`$ref\` json operation failed on [${String(e)}] at [${t.join(".")}], expecting one of [${Object.keys(i).join(", ")}].`);return}const r=Vs(i[e]);if(r?.operation!=="$ref")return i[e];if(n.referencedParams?.has(r.values)){K.Logger.warnOnce(`\`$ref\` json operation failed on [${String(e)}] at [${t.join(".")}], circular reference detected with [${[...n.referencedParams].join(", ")}].`);return}return n.referencedParams?.add(r.values),Jy(r.values,t,i,s,n)}function hL(e,t,i,s){if(!(0,K.isString)(e))return;const n=i.__palette;if(["fill","fillFallback","stroke","gradient","range2"].includes(e)){const o=t.findLastIndex(u=>!isNaN(Number(u)));let a=Number(t[o]);if(isNaN(a))return;const l=t.slice(0,o),c=["map-shape-background","map-line-background"],h=Jr(s,l).slice(0,a).filter(u=>c.includes(u.type)).length;switch(a-=h,e){case"fill":return(0,K.circularSliceArray)(n.fills,1,a)[0];case"fillFallback":return(0,K.circularSliceArray)(n.fillsFallback,1,a)[0];case"stroke":return(0,K.circularSliceArray)(n.strokes,1,a)[0];case"gradient":return(0,K.circularSliceArray)(n.sequentialColors,1,a)[0];case"range2":return(0,K.circularSliceArray)(n.fills,2,a)}return}return e==="gradients"?n.sequentialColors:Jr(n,e)}function uL(e,t,i,s){let n=!1,r,o=!1,a=s;if((0,K.isArray)(e))n=!0,r=e[1],o=e.length===3,a=o?e[2]:a,e=e[0];else if(!(0,K.isString)(e)){K.Logger.warnOnce(`\`$path\` json operation failed on [${String(e)}] at [${t.join(".")}], expecting a string.`);return}const l=Qy(o?[]:t,e);let c=a;for(const h of l){if(!ss(h,c)){if(n)return r;K.Logger.warnOnce(`\`$path\` json operation failed on [${String(e)}] at [${t.join(".")}] resolved to [${l.join(".")}], could not find path in object.`);return}c=c[h]}return Object.isFrozen(c)?Ve(c):c}function dL(e,t,i,s){const n=(0,K.isString)(e)?Qy(t,e):t,r=n.length===0?s:Jr(s,n);return Vs(r)!=null}function pL([e],t){if(typeof e=="number")return e%2===0;K.Logger.warnOnce(`\`$isEven\` json operation failed on [${String(e)}] at [${t.join(".")}], expecting a number.`)}function gL([e,t],i){if(typeof e=="number"&&typeof t=="number")return e*t;K.Logger.warnOnce(`\`$mul\` json operation failed on [${String(e)}] and [${String(t)}] at [${i.join(".")}], expecting two numbers.`)}function fL([e],t){if(typeof e=="number")return Math.round(e);K.Logger.warnOnce(`\`$round\` json operation failed on [${String(e)}] at [${t.join(".")}], expecting a number.`)}function mL([e,t],i,s,n,r){const o=Vs(t);if(o&&(t=wa(o.operation,o.values,s,n,i,r)),!(0,K.isArray)(t))return[];const a=Vs(e);return a?(r.matches.set(i.join("."),t),t.map(()=>({[a.operation]:a.values}))):[]}function yL([e,t],i,s,n,r){const o=Vs(t);if(o&&(t=wa(o.operation,o.values,s,n,i,r)),!(0,K.isArray)(t))return;const a=Vs(e);return a?t.find(l=>wa(a.operation,a.values,s,l,[],r)):e?t[0]:void 0}function bL(e){if((0,K.isArray)(e)){for(const t of e)if(!(0,K.isPlainObject)(t))return;return xe(...e)}}function xL([e,t]){if(!(!(0,K.isArray)(e)||!(0,K.isPlainObject)(t)))return H(t,e)}function vL(e,t,i,s,n){if(e!=="$1"&&e!=="$index")return e;const r=t.findLastIndex(l=>!isNaN(Number(l)));if(r===-1)return e;const o=Number(t[r]);if(e==="$index")return o;const a=t.slice(0,r).join(".");return n.matches.get(a)?.at(o)}function ML([e],t,i){const s="fontSize";if(ss(s,i)&&typeof i[s]=="number"&&typeof e=="number")return Math.round(e*i[s]);K.Logger.warnOnce(`\`$rem\` json operation failed on [${String(e)}] at [${t.join(".")}], expecting a number.`)}function SL([e,t,i],s){const n=`\`$mix\` json operation failed on [${String(e)}, ${String(t)}, ${String(i)}] at [${s.join(".")}], expecting`,r=`${n} two colors and a number between 0 and 1.`;if(typeof t!="string"||!Rc(i)){K.Logger.warnOnce(r);return}if(typeof e=="string")try{return Oe.mix(Oe.fromString(e),Oe.fromString(t),i).toString()}catch{K.Logger.warnOnce(r);return}if(!qy(e)){K.Logger.warnOnce(r);return}let o=e.colorStops;try{o=o?.map(a=>{let l;return typeof a.color=="string"&&(l=Oe.mix(Oe.fromString(a.color),Oe.fromString(t),i).toString()),{...a,color:l}})}catch{K.Logger.warnOnce(`${n} a gradient, a color and a number between 0 and 1.`);return}return{...e,colorStops:o}}function DL([e],t,i){const s="foregroundColor",n="backgroundColor";if(ss(s,i)&&ss(n,i)&&typeof i[s]=="string"&&typeof i[n]=="string"&&Rc(e))return Oe.mix(Oe.fromString(i[s]),Oe.fromString(i[n]),e).toString();K.Logger.warnOnce(`\`$foregroundBackgroundMix\` json operation failed on [${String(e)}}}] at [${t.join(".")}], expecting a number between 0 and 1.`)}function IL([e,t],i,s){const n="foregroundColor",r="backgroundColor",o="accentColor";if(ss(n,s)&&ss(r,s)&&ss(o,s)&&typeof s[n]=="string"&&typeof s[r]=="string"&&typeof s[o]=="string"&&Rc(e)&&Rc(t))return Oe.mix(Oe.mix(Oe.fromString(s[n]),Oe.fromString(s[r]),e),Oe.fromString(s[o]),t).toString();K.Logger.warnOnce(`\`$foregroundBackgroundAccentMix\` json operation failed on [${String(e)}, ${String(t)}}] at [${i.join(".")}], expecting two numbers between 0 and 1.`)}function AL([e,t]){if(!(!(0,K.isArray)(e)||!(0,K.isNumber)(t)))return Oe.interpolate(e.map(i=>Oe.fromString(i)),t).map(i=>i.toString())}var eb=(O(),N(T)),LL=class{constructor(){this.available=!0,this.acquireQueue=[]}acquire(e){return new Promise(t=>{this.acquireQueue.push([e,t]),this.available&&this.dispatchNext().catch(i=>eb.Logger.errorOnce(i))})}async acquireImmediately(e){return this.available?(await this.acquire(e),!0):!1}async waitForClearAcquireQueue(){return this.acquire(()=>Promise.resolve(void 0))}async dispatchNext(){this.available=!1;let[e,t]=this.acquireQueue.shift()??[];for(;e;){try{await e(),t?.()}catch(i){eb.Logger.error("mutex callback error",i),t?.()}[e,t]=this.acquireQueue.shift()??[]}this.available=!0}},tb=class{constructor(){this.eventListeners=new Map}addEventListener(e,t){if(typeof t!="function")throw new Error("AG Charts - listener must be a Function");const i=this.eventListeners.get(e);i?i.add(t):this.eventListeners.set(e,new Set([t]))}removeEventListener(e,t){const i=this.eventListeners.get(e);i!=null&&(i.delete(t),i.size===0&&this.eventListeners.delete(e))}hasEventListener(e){return this.eventListeners.has(e)}clearEventListeners(){this.eventListeners.clear()}fireEvent(e){this.eventListeners.get(e.type)?.forEach(t=>t(e))}},vn=class extends le{constructor(e=0,t=e,i=e,s=t){super(),this.top=e,this.right=t,this.bottom=i,this.left=s}};g([x],vn.prototype,"top",2),g([x],vn.prototype,"right",2),g([x],vn.prototype,"bottom",2),g([x],vn.prototype,"left",2);var kL=(O(),N(T));function Ee(e,t){const i=(0,kL.isArray)(e)?e:e.split(".");if(i.length===1){const[s]=i;return ir((n,r,o)=>n[s]=o,n=>n[s],t)}return ir((s,n,r)=>md(s,i,r),s=>Jr(s,i),t)}function CL(e){return ir((t,i,s)=>t[e]=s)}function Et(e,t){return ir((i,s,n)=>i[e][t??s]=n)}function ui(e){const{newValue:t,oldValue:i,changeValue:s}=e;return ir((n,r,o,a)=>(o!==a&&(a!==void 0&&i?.call(n,a),o!==void 0&&t?.call(n,o),s?.call(n,o,a)),o))}function Mn(e){return Sy(e)}var wL=(O(),N(T));function TL(e){return ib((t,i)=>(0,wL.getWindow)().requestAnimationFrame(t),e)}function NL(e){return ib((t,i=0)=>{i===0?queueMicrotask(t):setTimeout(t,i)},e)}function ib(e,t){let i=0,s=!1,n,r;const o=()=>s,a=()=>{s=!1,r?.(),r=void 0,n=void 0,i>0&&e(l)},l=()=>{const c=i;i=0,s=!0;const h=t({count:c});if(!h){a();return}h.then(a,a)};return{schedule(c){i===0&&!o()&&e(l,c),i++},async await(){if(o())for(n==null&&(n=new Promise(c=>{r=c}));o();)await n}}}var pt=(O(),N(T)),_d=["blur","change","contextmenu","focus","keydown","keyup","click","dblclick","mouseenter","mousemove","mouseleave","wheel","touchstart","touchmove","touchend","touchcancel"];function co(e,t,i){const{offsetX:s,offsetY:n,clientX:r,clientY:o}=t,{currentX:a,currentY:l}=Us.calcCurrentXY(i,t);return{type:e,offsetX:s,offsetY:n,clientX:r,clientY:o,currentX:a,currentY:l,sourceEvent:t}}function _c(e,t,i){return{type:e,sourceEvent:t}}var OL={blur:e=>({type:"blur",sourceEvent:e}),change:e=>({type:"change",sourceEvent:e}),contextmenu:(e,t)=>co("contextmenu",e,t),focus:e=>({type:"focus",sourceEvent:e}),keydown:e=>({type:"keydown",sourceEvent:e}),keyup:e=>({type:"keyup",sourceEvent:e}),click:(e,t)=>co("click",e,t),dblclick:(e,t)=>co("dblclick",e,t),mouseenter:(e,t)=>co("mouseenter",e,t),mousemove:(e,t)=>co("mousemove",e,t),mouseleave:(e,t)=>co("mouseleave",e,t),wheel:e=>{const{offsetX:t,offsetY:i,clientX:s,clientY:n}=e,r=e.deltaMode===0?.01:1,o=e.deltaX*r,a=e.deltaY*r;return{type:"wheel",offsetX:t,offsetY:i,clientX:s,clientY:n,deltaX:o,deltaY:a,sourceEvent:e}},touchstart:(e,t)=>_c("touchstart",e,t),touchmove:(e,t)=>_c("touchmove",e,t),touchend:(e,t)=>_c("touchend",e,t),touchcancel:(e,t)=>_c("touchcancel",e,t)},Us=class{static alloc(e,t,i){return OL[e](t,i)}static isHTMLEvent(e){return _d.includes(e)}static calcCurrentXY(e,t){const i=e.getBoundingClientRect();return{currentX:t.clientX-i.x,currentY:t.clientY-i.y}}},EL=(O(),N(T)),PL=class{constructor(){this.widgetListeners={},this.sourceListeners={}}initSourceHandler(e,t){this.sourceListeners??(this.sourceListeners={}),this.sourceListeners[e]=t}lazyGetWidgetListeners(e,t){var i;if(!(e in(this.sourceListeners??{}))){const s=r=>{const o=Us.alloc(e,r,t.getElement());for(const a of this.widgetListeners?.[e]??[])a(o,t)},n={};e.startsWith("touch")&&(n.passive=!1),this.initSourceHandler(e,s),t.getElement().addEventListener(e,s,n)}return this.widgetListeners??(this.widgetListeners={}),(i=this.widgetListeners)[e]??(i[e]=[]),this.widgetListeners[e]}add(e,t,i){this.lazyGetWidgetListeners(e,t).push(i)}remove(e,t,i){const s=this.lazyGetWidgetListeners(e,t),n=s.indexOf(i);n>-1&&s.splice(n,1)}destroy(e){for(const[t,i]of(0,EL.entries)(this.sourceListeners??{}))e.getElement().removeEventListener(t,i);this.widgetListeners=void 0,this.sourceListeners=void 0}},Y2=(O(),N(T)),RL=(O(),N(T)),FL=class{constructor(e,t,i,s){this.glob=e,this.self=t,this.window=(0,RL.getWindow)(),this.mousegeneral=l=>{l.stopPropagation(),l.stopImmediatePropagation()},this.mousemove=l=>{l.stopPropagation(),l.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mousemove(l)},this.mouseup=l=>{l.button===0&&(l.stopPropagation(),l.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mouseup(l),this.destroy())};const{window:n,mousegeneral:r,mousemove:o,mouseup:a}=this;n.addEventListener("mousedown",r,{capture:!0}),n.addEventListener("mouseenter",r,{capture:!0}),n.addEventListener("mouseleave",r,{capture:!0}),n.addEventListener("mouseout",r,{capture:!0}),n.addEventListener("mouseover",r,{capture:!0}),n.addEventListener("mousemove",o,{capture:!0}),n.addEventListener("mouseup",a,{capture:!0}),t.mouseDragger=this,e.globalMouseDragCallbacks=i,e.globalMouseDragCallbacks.mousedown(s)}destroy(){const{window:e,mousegeneral:t,mousemove:i,mouseup:s}=this;e.removeEventListener("mousedown",t,{capture:!0}),e.removeEventListener("mouseenter",t,{capture:!0}),e.removeEventListener("mouseleave",t,{capture:!0}),e.removeEventListener("mouseout",t,{capture:!0}),e.removeEventListener("mouseover",t,{capture:!0}),e.removeEventListener("mousemove",i,{capture:!0}),e.removeEventListener("mouseup",s,{capture:!0}),this.glob.globalMouseDragCallbacks=void 0,this.self.mouseDragger=void 0}};function _L(e,t,i,s){if(e.globalMouseDragCallbacks==null)return new FL(e,t,i,s)}var jL=(O(),N(T)),zL=500,BL=100;function GL(e,t){const i=e.clientX-t.clientX,s=e.clientY-t.clientY;return i*i+s*s}var jd=!1,VL=class{constructor(e,t,i,s,n){this.glob=e,this.self=t,this.initialTouch=s,this.target=n,this.longTapInterrupted=!1,this.longtap=()=>{const{target:a,initialTouch:l}=this;if(!this.longTapInterrupted){a.dispatchEvent(new TouchEvent("touchcancel",{touches:[l],bubbles:!0})),jd=!0;const c=f=>{f.preventDefault()},h=f=>{jd=!1,f.preventDefault(),a.removeEventListener("touchmove",c),a.removeEventListener("touchend",h),a.removeEventListener("touchcancel",h)};a.addEventListener("touchmove",c,{passive:!1}),a.addEventListener("touchend",h,{passive:!1}),a.addEventListener("touchcancel",h,{passive:!1});const{clientX:u,clientY:d}=l,p=new PointerEvent("contextmenu",{bubbles:!0,cancelable:!0,view:(0,jL.getWindow)(),clientX:u,clientY:d,pointerType:"touch"});a.dispatchEvent(p)}},this.touchmove=a=>{const{glob:l,self:c,initialTouch:h}=this,u=this.findInitialFinger(a.targetTouches);u!=null&&(this.longTapInterrupted=this.longTapInterrupted||GL(h,u)>BL,c.dragTouchEnabled&&u!=null&&l.globalTouchDragCallbacks?.touchmove(a,u))},this.touchend=a=>{this.longTapInterrupted=!0;const l=this.findInitialFinger(a.changedTouches,a.touches);l!=null&&this.glob.globalTouchDragCallbacks?.touchend(a,l),this.destroy()},this.longtapTimer=setTimeout(this.longtap,zL);const{touchmove:r,touchend:o}=this;n.addEventListener("touchmove",r,{passive:!1}),n.addEventListener("touchstart",o,{passive:!1}),n.addEventListener("touchend",o,{passive:!1}),n.addEventListener("touchcancel",o,{passive:!1}),t.touchDragger=this,e.globalTouchDragCallbacks=i}destroy(){const{longtapTimer:e,touchmove:t,touchend:i}=this;clearTimeout(e),this.target.removeEventListener("touchstart",i),this.target.removeEventListener("touchmove",t),this.target.removeEventListener("touchend",i),this.target.removeEventListener("touchcancel",i),this.glob.globalTouchDragCallbacks=void 0,this.self.touchDragger=void 0}findInitialFinger(...e){const t=e.map(i=>Array.from(i)).flat();return Array.from(t).find(i=>i.identifier===this.initialTouch.identifier)}};function UL(e,t,i,s,n){if(!(e.globalTouchDragCallbacks!=null||jd))return new VL(e,t,i,s,n)}function zd(e,t,i,s){const{currentX:n,currentY:r}=Us.calcCurrentXY(e.getElement(),s),o=s.pageX-i.pageX,a=s.pageY-i.pageY;return{type:t,device:"mouse",offsetX:i.offsetX+o,offsetY:i.offsetY+a,clientX:s.clientX,clientY:s.clientY,currentX:n,currentY:r,originDeltaX:o,originDeltaY:a,sourceEvent:s}}function WL(e,{pageX:t,pageY:i}){const{x:s,y:n}=e.getElement().getBoundingClientRect();return{offsetX:t-s,offsetY:i-n}}function Bd(e,t,i,s,n){const{currentX:r,currentY:o}=Us.calcCurrentXY(e.getElement(),n),a=n.pageX-i.pageX,l=n.pageY-i.pageY;return{type:t,device:"touch",offsetX:i.offsetX+a,offsetY:i.offsetY+l,clientX:n.clientX,clientY:n.clientY,currentX:r,currentY:o,originDeltaX:a,originDeltaY:l,sourceEvent:s}}var sb={},nb=class{constructor(e){this.dispatchCallback=e,this.dragTouchEnabled=!0}destroy(){this.dragTriggerRemover?.(),this.dragTriggerRemover=void 0,this.listeners?.clear(),this.mouseDragger?.destroy(),this.touchDragger?.destroy()}getListenerSet(e){this.listeners??(this.listeners=new Map);let t=this.listeners.get(e);return t===void 0&&(t=new Set,this.listeners.set(e,t)),t}add(e,t,i){switch(this.getListenerSet(e).add(i),e){case"drag-start":case"drag-move":case"drag-end":{this.registerDragTrigger(t);break}}}remove(e,t,i){this.getListenerSet(e).delete(i)}registerDragTrigger(e){if(this.dragTriggerRemover==null){const t=s=>this.triggerMouseDrag(e,s),i=s=>this.triggerTouchDrag(e,s);e.getElement().addEventListener("mousedown",t),e.getElement().addEventListener("touchstart",i,{passive:!1}),this.dragTriggerRemover=()=>{e.getElement().removeEventListener("mousedown",t),e.getElement().removeEventListener("touchstart",i)}}}triggerMouseDrag(e,t){t.button===0&&this.startMouseDrag(e,t)}startMouseDrag(e,t){const i={pageX:NaN,pageY:NaN,offsetX:NaN,offsetY:NaN};yd(["pageX","pageY","offsetX","offsetY"],i,t);const s={mousedown:n=>{const r=zd(e,"drag-start",i,n);this.dispatch("drag-start",e,r)},mousemove:n=>{const r=zd(e,"drag-move",i,n);this.dispatch("drag-move",e,r)},mouseup:n=>{const r=zd(e,"drag-end",i,n);this.dispatch("drag-end",e,r),this.endDrag(e,r)}};this.mouseDragger=_L(sb,this,s,t)}endDrag(e,{sourceEvent:t,clientX:i,clientY:s}){const n=e.getElement(),r=n.getBoundingClientRect();tr.containsPoint(r,i,s)||(n.dispatchEvent(new MouseEvent("mouseleave",t)),t.target?.dispatchEvent(new MouseEvent("mouseenter",t)))}triggerTouchDrag(e,t){const i=t.targetTouches[0];t.targetTouches.length===1&&i!=null&&this.startOneFingerTouch(e,t,i)}startOneFingerTouch(e,t,i){const s={pageX:NaN,pageY:NaN,...WL(e,i)};yd(["pageX","pageY"],s,i);const n={touchmove:(a,l)=>{const c=Bd(e,"drag-move",s,a,l);this.dispatch("drag-move",e,c)},touchend:(a,l)=>{const c=Bd(e,"drag-end",s,a,l);this.dispatch("drag-end",e,c)}},r=e.getElement();this.touchDragger=UL(sb,this,n,i,r);const o=Bd(e,"drag-start",s,t,i);this.dispatch("drag-start",e,o)}dispatch(e,t,i){for(const s of this.getListenerSet(e))s(i,t);this.dispatchCallback(e,i)}},HL=class{constructor(e){this.elem=e}setBounds(e){Oc(this.elemContainer??this.elem,e)}getBounds(){return $y(this.elemContainer??this.elem)}static setElementContainer(e,t){const i=e.getBounds();Oc(t,i),(0,pt.setElementStyles)(e.elem,{width:"100%",height:"100%"}),e.elem.remove(),e.elemContainer=t,e.elemContainer.replaceChildren(e.elem)}},Is=class extends HL{constructor(e){super(e),this.elem=e,this.index=NaN,this.children=[]}set id(e){(0,pt.setAttribute)(this.elem,"id",e)}get id(){return(0,pt.getAttribute)(this.elem,"id")}getElement(){return this.elem}getBoundingClientRect(){return this.elem.getBoundingClientRect()}get clientWidth(){return this.elem.clientWidth}get clientHeight(){return this.elem.clientHeight}destroy(){this.parent?.removeChild(this),this.children.forEach(e=>{e.parent=void 0,e.destroy()}),this.children.length=0,this.destructor(),this.remove(),this.internalListener?.destroy(),this.htmlListener?.destroy(this)}remove(){this.elem.remove(),this.elemContainer?.remove()}setHidden(e){(0,pt.setElementStyle)(this.elem,"display",e?"none":void 0)}isHidden(){return(0,pt.getWindow)()?.getComputedStyle?.(this.elem).display==="none"}setCursor(e){(0,pt.setElementStyle)(this.elem,"cursor",e)}setTextContent(e){this.elem.textContent=e??null}setAriaDescribedBy(e){(0,pt.setAttribute)(this.elem,"aria-describedby",e)}setAriaHidden(e){(0,pt.setAttribute)(this.elem,"aria-hidden",e)}setAriaLabel(e){(0,pt.setAttribute)(this.elem,"aria-label",e)}setAriaExpanded(e){(0,pt.setAttribute)(this.elem,"aria-expanded",e)}setAriaControls(e){(0,pt.setAttribute)(this.elem,"aria-controls",e)}setAriaHasPopup(e){(0,pt.setAttribute)(this.elem,"aria-haspopup",e)}setInnerHTML(e){this.elem.innerHTML=e}setPointerEvents(e){(0,pt.setElementStyle)(this.elem,"pointer-events",e)}isDisabled(){return(0,pt.getAttribute)(this.elem,"aria-disabled",!1)}hasPopup(){const e=(0,pt.getAttribute)(this.elem,"aria-haspopup");return e!==void 0&&e!=="false"}parseFloat(e){return e===""?0:parseFloat(e)}cssLeft(){return this.parseFloat(this.elem.style.left)}cssTop(){return this.parseFloat(this.elem.style.top)}cssWidth(){return this.parseFloat(this.elem.style.width)}cssHeight(){return this.parseFloat(this.elem.style.height)}focus(e){this.elem.focus(e)}setFocusOverride(e){(0,pt.setAttribute)(this.elem,"data-focus-override",e)}setPreventsDefault(e){(0,pt.setAttribute)(this.elem,"data-preventdefault",e)}setTabIndex(e){(0,pt.setAttribute)(this.elem,"tabindex",e)}addChild(e){this.addChildToDOM(e,this.getBefore(e)),this.children.push(e),e.index=this.children.length-1,e.parent=this,this.onChildAdded(e)}removeChild(e){const t=this.children.findIndex(i=>i===e);this.children.splice(t,1),this.removeChildFromDOM(e),this.onChildRemoved(e)}moveChild(e,t){e.domIndex!==t&&(e.domIndex=t,this.removeChildFromDOM(e),this.addChildToDOM(e,this.getBefore(e)))}addClass(...e){this.elem.classList.add(...e)}removeClass(...e){this.elem.classList.remove(...e)}toggleClass(e,t){this.elem.classList.toggle(e,t)}appendOrInsert(e,t){t?t.getElement().insertAdjacentElement("beforebegin",e):this.elem.appendChild(e)}addChildToDOM(e,t){this.appendOrInsert(e.getElement(),t)}removeChildFromDOM(e){this.elem.removeChild(e.getElement())}onChildAdded(e){}onChildRemoved(e){}getBefore({domIndex:e}){if(e!==void 0)return this.children.filter(t=>t.domIndex!==void 0&&t.domIndex>e).reduce((t,i)=>!t||i.domIndex<t.domIndex?i:t,void 0)}addListener(e,t){return Us.isHTMLEvent(e)?(this.htmlListener??(this.htmlListener=new PL),this.htmlListener.add(e,this,t)):(this.internalListener??(this.internalListener=new nb(this.onDispatch.bind(this))),this.internalListener.add(e,this,t)),()=>this.removeListener(e,t)}removeListener(e,t){Us.isHTMLEvent(e)?this.htmlListener?.remove(e,this,t):this.htmlListener!=null&&this.internalListener?.remove(e,this,t)}setDragTouchEnabled(e){this.internalListener??(this.internalListener=new nb(this.onDispatch.bind(this))),this.internalListener.dragTouchEnabled=e}onDispatch(e,t){if(!t.sourceEvent?.bubbles)return;let{parent:i}=this;for(;i!=null;){const{internalListener:s}=i;if(s!=null){const n={...t,...Us.calcCurrentXY(i.getElement(),t)};s.dispatch(e,i,n)}i=i.parent}}static addWindowEvent(e,t){const i=s=>{s.persisted||t()};return(0,pt.getWindow)().addEventListener("pagehide",i),()=>(0,pt.getWindow)().removeEventListener("pagehide",i)}},YL=(O(),N(T)),rb=(O(),N(T));function $L(e=0,t=0){return new OffscreenCanvas(e,t).getContext("2d")}var Gd=class{constructor(e=5){this.maxCacheSize=e,this.store=new Map}get(e){if(!this.store.has(e))return;const t=this.store.get(e);return this.store.delete(e),this.store.set(e,t),t}has(e){return this.store.has(e)}set(e,t){if(this.store.set(e,t),this.store.size>this.maxCacheSize){const i=this.store.keys();let s=this.store.size-this.maxCacheSize;for(;s>0;){const n=i.next();n.done||this.store.delete(n.value),s--}}return t}clear(){this.store.clear()}},As=class{static measureText(e,t){return this.getMeasurer(t).measureText(e)}static measureLines(e,t){return this.getMeasurer(t).measureLines(e)}static getMeasurer(e){const t=typeof e.font=="string"?e.font:Ue.toFontString(e.font),i=`${t}-${e.textAlign??"start"}-${e.textBaseline??"alphabetic"}`;return this.instanceMap.get(i)??this.createFontMeasurer(t,e,i)}static clear(){this.instanceMap.clear()}static createFontMeasurer(e,t,i){const s=$L();s.font=e,s.textAlign=t.textAlign??"start",s.textBaseline=t.textBaseline??"alphabetic";const n=new ob(s,t);return this.instanceMap.set(i,n),n}};As.instanceMap=new Gd(10);var ob=class{constructor(e,t){this.ctx=e,this.measureMap=new Gd(100),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline),e.font=typeof t.font=="string"?t.font:Ue.toFontString(t.font),this.textMeasurer=new Vd(i=>this.cachedCtxMeasureText(i),t.textBaseline??"alphabetic")}textWidth(e,t){return this.textMeasurer.textWidth(e,t)}measureText(e){return this.textMeasurer.measureText(e)}measureLines(e){return this.textMeasurer.measureLines(e)}cachedCtxMeasureText(e){if(!this.measureMap.has(e)){const t=this.ctx.measureText(e);this.measureMap.set(e,{actualBoundingBoxAscent:t.actualBoundingBoxAscent,emHeightAscent:t.emHeightAscent,emHeightDescent:t.emHeightDescent,actualBoundingBoxDescent:t.actualBoundingBoxDescent,actualBoundingBoxLeft:t.actualBoundingBoxLeft,actualBoundingBoxRight:t.actualBoundingBoxRight,alphabeticBaseline:t.alphabeticBaseline,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent,hangingBaseline:t.hangingBaseline,ideographicBaseline:t.ideographicBaseline,width:t.width})}return this.measureMap.get(e)}},Ue=class{static toFontString({fontSize:e=10,fontStyle:t,fontWeight:i,fontFamily:s,lineHeight:n}){let r="";return t&&(r+=`${t} `),i&&(r+=`${i} `),r+=`${e}px`,n&&(r+=`/${n}px`),r+=` ${s}`,r.trim()}static getLineHeight(e){return Math.ceil(e*this.defaultLineHeight)}static getVerticalModifier(e){switch(e){case"hanging":case"top":return 0;case"middle":return .5;case"alphabetic":case"bottom":case"ideographic":default:return 1}}};Ue.EllipsisChar="\u2026",Ue.defaultLineHeight=1.15,Ue.lineSplitter=/\r?\n/g;var Vd=class{constructor(e,t="alphabetic"){this.measureTextFn=e,this.textBaseline=t,this.charMap=new Map}getMetrics(e){const t=this.measureTextFn(e);return t.fontBoundingBoxAscent??(t.fontBoundingBoxAscent=t.emHeightAscent),t.fontBoundingBoxDescent??(t.fontBoundingBoxDescent=t.emHeightDescent),{width:t.width,height:t.actualBoundingBoxAscent+t.actualBoundingBoxDescent,lineHeight:t.fontBoundingBoxAscent+t.fontBoundingBoxDescent,offsetTop:t.actualBoundingBoxAscent,offsetLeft:t.actualBoundingBoxLeft}}getMultilineMetrics(e){let t=0,i=0,s=0,n=0,r=0;const o=Ue.getVerticalModifier(this.textBaseline),a=[];let l=0;const c=e.length;for(const h of e){const u=this.measureTextFn(h);u.fontBoundingBoxAscent??(u.fontBoundingBoxAscent=u.emHeightAscent),u.fontBoundingBoxDescent??(u.fontBoundingBoxDescent=u.emHeightDescent),t<u.width&&(t=u.width),n<u.actualBoundingBoxLeft&&(n=u.actualBoundingBoxLeft),l===0?(i+=u.actualBoundingBoxAscent,s+=u.actualBoundingBoxAscent):r+=u.fontBoundingBoxAscent,l===c-1?i+=u.actualBoundingBoxDescent:r+=u.fontBoundingBoxDescent,a.push({text:h,width:u.width,height:u.actualBoundingBoxAscent+u.actualBoundingBoxDescent,lineHeight:u.fontBoundingBoxAscent+u.fontBoundingBoxDescent,offsetTop:u.actualBoundingBoxAscent,offsetLeft:u.actualBoundingBoxLeft}),l++}return i+=r,s+=r*o,{width:t,height:i,offsetTop:s,offsetLeft:n,lineMetrics:a}}textWidth(e,t){if(t){let i=0;for(let s=0;s<e.length;s++)i+=this.textWidth(e.charAt(s));return i}return e.length>1?this.measureTextFn(e).width:this.charMap.get(e)??this.charWidth(e)}measureText(e){return this.getMetrics(e)}measureLines(e){const t=typeof e=="string"?e.split(Ue.lineSplitter):e;return this.getMultilineMetrics(t)}charWidth(e){const{width:t}=this.measureTextFn(e);return this.charMap.set(e,t),t}},Li=class Eu extends Bi{constructor(){super(...arguments),this.x=0,this.y=0,this.lines=[],this.text=void 0,this.fontSize=10,this.fontFamily="sans-serif",this.textAlign=Eu.defaultStyles.textAlign,this.textBaseline=Eu.defaultStyles.textBaseline}onTextChange(){this.lines=this.text?.split(`
`).map(t=>t.trim())??[]}static computeBBox(t,i,s,n){const{offsetTop:r,offsetLeft:o,width:a,height:l}=As.measureLines(t,n),c=n.lineHeight?n.lineHeight*t.length:l;return new U(i-o,s-r,a,c)}computeBBox(){const{x:t,y:i,lines:s,textBaseline:n,textAlign:r,lineHeight:o}=this;return Eu.computeBBox(s,t,i,{font:this,textBaseline:n,textAlign:r,lineHeight:o})}getTextMeasureBBox(){return this.computeBBox()}isPointInPath(t,i){const s=this.getBBox();return s?s.containsPoint(t,i):!1}render(t){const{ctx:i,stats:s}=t;if(!this.lines.length||!this.layerManager)return s&&(s.nodesSkipped+=1),super.render(t);const{fill:n,stroke:r,strokeWidth:o}=this,{globalAlpha:a}=i,{pixelRatio:l}=this.layerManager.canvas;if(!n&&!(r!=null&&o>0))return super.render(t);const c=Ue.toFontString(this);if(i.font!==c&&(i.font=c),i.textAlign=this.textAlign,i.textBaseline=this.textBaseline,n){this.applyFillAndAlpha(i);const{fillShadow:h}=this;h?.enabled&&(i.shadowColor=h.color,i.shadowOffsetX=h.xOffset*l,i.shadowOffsetY=h.yOffset*l,i.shadowBlur=h.blur*l),this.renderLines((u,d,p)=>i.fillText(u,d,p)),i.globalAlpha=a}if(r&&o){this.applyStrokeAndAlpha(i),i.lineWidth=o;const{lineDash:h,lineDashOffset:u,lineCap:d,lineJoin:p}=this;h&&i.setLineDash([...h]),u&&(i.lineDashOffset=u),d&&(i.lineCap=d),p&&(i.lineJoin=p),this.renderLines((f,y,b)=>i.strokeText(f,y,b)),i.globalAlpha=a}super.render(t)}renderLines(t){const{lines:i,x:s,y:n}=this,r=this.lineHeight??Ue.getLineHeight(this.fontSize);let o=(r-r*i.length)*Ue.getVerticalModifier(this.textBaseline);for(const a of i)t(a,s,n+o),o+=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,rb.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]}}};Li.className="Text",Li.defaultStyles={...Bi.defaultStyles,textAlign:"start",fontStyle:void 0,fontWeight:void 0,fontSize:10,fontFamily:"sans-serif",textBaseline:"alphabetic"},g([_()],Li.prototype,"x",2),g([_()],Li.prototype,"y",2),g([_({convertor:e=>(0,rb.isDefined)(e)?String(e):e,changeCb:e=>e.onTextChange()})],Li.prototype,"text",2),g([_()],Li.prototype,"fontStyle",2),g([_()],Li.prototype,"fontWeight",2),g([_()],Li.prototype,"fontSize",2),g([_()],Li.prototype,"fontFamily",2),g([_()],Li.prototype,"textAlign",2),g([_()],Li.prototype,"textBaseline",2),g([_()],Li.prototype,"lineHeight",2);var St=Li,ab=class extends ao(St){},ho=class extends ao(ar(St)){},Ud=class{static wrapText(e,t){return this.wrapLines(e,t).join(`
`)}static wrapLines(e,t){const i=this.textWrap(e,t);return t.overflow==="hide"&&i.some(s=>s.endsWith(Ue.EllipsisChar))?[]:i}static appendEllipsis(e){return e.replace(/[.,]{1,5}$/,"")+Ue.EllipsisChar}static truncateLine(e,t,i,s){const n=t.textWidth(Ue.EllipsisChar);let r=0,o=0;for(;o<e.length;o++){const a=t.textWidth(e.charAt(o));if(r+a>i)break;r+=a}if(e.length===o&&(!s||r+n<=i))return s?e+Ue.EllipsisChar:e;for(e=e.slice(0,o).trimEnd();e.length&&t.textWidth(e)+n>i;)e=e.slice(0,-1).trimEnd();return e+Ue.EllipsisChar}static textWrap(e,t){const i=e.split(Ue.lineSplitter),s=As.getMeasurer(t);if(t.textWrap==="never")return i.map(a=>this.truncateLine(a.trimEnd(),s,t.maxWidth));const n=[],r=t.textWrap==="hyphenate",o=t.textWrap==null||t.textWrap==="on-space";for(const a of i){let l=a.trimEnd();if(l===""){n.push(l);continue}let c=0,h=0,u=0;for(;c<l.length;){const d=l.charAt(c);if(h+=s.textWidth(d),d===" "&&(u=c),h>t.maxWidth){if(c===0)break;const p=s.textWidth(l.slice(0,c+1));if(p<=t.maxWidth){h=p,c++;continue}if(u){const b=this.getWordAt(l,u+1),m=s.textWidth(b);if(m<=t.maxWidth){n.push(l.slice(0,u).trimEnd()),l=l.slice(u).trimStart(),c=0,h=0,u=0;continue}else o&&m>t.maxWidth&&n.push(l.slice(0,u).trimEnd(),this.truncateLine(l.slice(u).trimStart(),s,t.maxWidth,!0))}else o&&n.push(this.truncateLine(l,s,t.maxWidth,!0));if(o){l="";break}const f=r?"-":"";let y=l.slice(0,c).trim();for(;y.length&&s.textWidth(y+f)>t.maxWidth;)y=y.slice(0,-1).trimEnd();if(n.push(y+f),!y.length){l="";break}l=l.slice(y.length).trimStart(),c=-1,h=0,u=0}c++}l&&n.push(l)}return this.avoidOrphans(n,s,t),this.clipLines(n,s,t)}static getWordAt(e,t){const i=e.indexOf(" ",t);return i===-1?e.slice(t):e.slice(t,i)}static clipLines(e,t,i){if(!i.maxHeight)return e;const{height:s,lineMetrics:n}=t.measureLines(e);if(s<=i.maxHeight)return e;for(let r=0,o=0;r<n.length;r++){const{lineHeight:a}=n[r];if(o+=a,o>i.maxHeight){if(i.overflow==="hide")return[];const l=e.slice(0,r||1),c=l.pop();return l.concat(this.truncateLine(c,t,i.maxWidth,!0))}}return e}static avoidOrphans(e,t,i){if(i.avoidOrphans===!1||e.length<2)return;const{length:s}=e,n=e[s-1],r=e[s-2];if(r.length<n.length)return;const o=r.lastIndexOf(" ");if(o===-1||o===r.indexOf(" ")||n.includes(" "))return;const a=r.slice(o+1);t.textWidth(n+a)<=i.maxWidth&&(e[s-2]=r.slice(0,o),e[s-1]=a+" "+n)}},Ye=class extends le{constructor(){super(...arguments),this.id=(0,YL.createId)(this),this.node=new ab({zIndex:1}).setProperties({textAlign:"center",pointerEvents:1}),this.enabled=!1,this.textAlign="center",this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always",this.padding=0,this.layoutStyle="block",this.truncated=!1}registerInteraction(e,t){return e.layoutManager.addListener("layout:complete",()=>this.updateA11yText(e,t))}computeTextWrap(e,t){const{text:i,padding:s,wrapping:n}=this,r=Math.min(this.maxWidth??1/0,e)-s*2,o=this.maxHeight??t-s*2;if(!isFinite(r)&&!isFinite(o)){this.node.text=i;return}const a=Ud.wrapText(i??"",{maxWidth:r,maxHeight:o,font:this,textWrap:n});this.node.text=a,this.truncated=a.includes(Ue.EllipsisChar)}updateA11yText(e,t){const{proxyInteractionService:i}=e;if(this.enabled&&this.text){const s=Qe.toCanvas(this.node);if(s){const{id:n}=this;this.proxyText??(this.proxyText=i.createProxyElement({type:"text",domManagerId:n,where:t})),this.proxyText.textContent=this.text,this.proxyText.setBounds(s),this.proxyText.addListener("mousemove",r=>this.handleMouseMove(e,r)),this.proxyText.addListener("mouseleave",r=>this.handleMouseLeave(e,r))}}else this.proxyText?.destroy(),this.proxyText=void 0}handleMouseMove(e,t){if(t!=null&&this.enabled&&this.node.visible&&this.truncated){const{x:i,y:s}=Qe.toCanvas(this.node),n=t.sourceEvent.offsetX+i,r=t.sourceEvent.offsetY+s;e.tooltipManager.updateTooltip(this.id,{canvasX:n,canvasY:r,showArrow:!1},[{type:"structured",title:this.text}])}}handleMouseLeave(e,t){e.tooltipManager.removeTooltip(this.id)}};Ye.SMALL_PADDING=10,g([x,Et("node","visible")],Ye.prototype,"enabled",2),g([x,Et("node")],Ye.prototype,"text",2),g([x,Et("node")],Ye.prototype,"textAlign",2),g([x,Et("node")],Ye.prototype,"fontStyle",2),g([x,Et("node")],Ye.prototype,"fontWeight",2),g([x,Et("node")],Ye.prototype,"fontSize",2),g([x,Et("node")],Ye.prototype,"fontFamily",2),g([x,Et("node","fill")],Ye.prototype,"color",2),g([x],Ye.prototype,"spacing",2),g([x],Ye.prototype,"maxWidth",2),g([x],Ye.prototype,"maxHeight",2),g([x],Ye.prototype,"wrapping",2),g([x],Ye.prototype,"padding",2),g([x],Ye.prototype,"layoutStyle",2);var Wd=(e=>(e.X="x",e.Y="y",e.Angle="angle",e.Radius="radius",e))(Wd||{});function KL(e){switch(e){case"x":case"y":case"angle":case"radius":return!0;default:return!1}}var ZL=(O(),N(T)),Hd=(e=>(e[e.Caption=0]="Caption",e[e.Legend=1]="Legend",e[e.ToolbarLeft=2]="ToolbarLeft",e[e.ToolbarBottom=3]="ToolbarBottom",e[e.Navigator=4]="Navigator",e[e.Overlay=5]="Overlay",e))(Hd||{}),lb=class{constructor(){this.events=new ZL.EventEmitter,this.elements=new Map}addListener(e,t){return this.events.on(e,t)}registerElement(e,t){return this.elements.has(e)?this.elements.get(e).add(t):this.elements.set(e,new Set([t])),()=>this.elements.get(e)?.delete(t)}createContext(e,t){const i=new XL(e,t);for(const s of Object.values(Hd))typeof s=="number"&&this.elements.get(s)?.forEach(n=>n(i));return i}emitLayoutComplete(e,t){const i="layout:complete",{width:s,height:n}=e;this.events.emit(i,{type:i,axes:t.axes??[],chart:{width:s,height:n},clipSeries:t.clipSeries??!1,series:t.series})}},XL=class{constructor(e,t){this.width=e,this.height=t,this.layoutBox=new U(0,0,e,t)}},jc=class{constructor(){this.title=new Ye,this.subtitle=new Ye,this.footnote=new Ye}positionCaptions(e){const{title:t,subtitle:i,footnote:s}=this,n=e.layoutBox.height/10;if(t.enabled){const{spacing:r}=t;this.positionCaption("top",t,e.layoutBox,n),this.shrinkLayoutByCaption("top",t,e.layoutBox,r)}i.enabled&&(this.positionCaption("top",i,e.layoutBox,n),this.shrinkLayoutByCaption("top",i,e.layoutBox,i.spacing)),s.enabled&&(this.positionCaption("bottom",s,e.layoutBox,n),this.shrinkLayoutByCaption("bottom",s,e.layoutBox,s.spacing))}positionAbsoluteCaptions(e){const{title:t,subtitle:i,footnote:s}=this,{rect:n}=e.series;for(const r of[t,i,s])if(r.layoutStyle==="overlay"){if(r.textAlign==="left")r.node.x=n.x+r.padding;else if(r.textAlign==="right"){const o=r.node.getBBox();r.node.x=n.x+n.width-o.width-r.padding}}}computeX(e,t){return e==="left"?t.x:e==="right"?t.x+t.width:t.x+t.width/2}positionCaption(e,t,i,s){const n=Math.max(Ue.getLineHeight(t.fontSize),s);t.node.x=this.computeX(t.textAlign,i)+t.padding,t.node.y=i.y+(e==="top"?0:i.height)+t.padding,t.node.textBaseline=e,t.computeTextWrap(i.width,n)}shrinkLayoutByCaption(e,t,i,s=0){if(t.layoutStyle==="block"){const n=t.node.getTextMeasureBBox();i.shrink(Math.ceil(e==="top"?n.y-i.y+n.height+s:i.y+i.height-n.y+s),e)}}};g([x],jc.prototype,"title",2),g([x],jc.prototype,"subtitle",2),g([x],jc.prototype,"footnote",2);var qL=(O(),N(T)),QL=["candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"],JL=class{constructor(e){this.chartService=e,this.mementoOriginatorKey="chartType"}createMemento(){let e=this.chartService.publicApi?.getOptions()?.chartType;return e==null&&(e="candlestick"),e}guardMemento(e){return e==null||QL.includes(e)}restoreMemento(e,t,i){if(i==null)return;const s={chartType:i};this.chartService.publicApi?.updateDelta(s).catch(n=>qL.Logger.error("error restoring state",n))}},Yd=class{constructor(){this.destroyFns=[]}destroy(){this.destroyFns.forEach(e=>e()),this.destroyFns.length=0}setFns(e){this.destroy(),this.destroyFns=e}push(...e){this.destroyFns.push(...e)}},uo="11.3.2",cb=Symbol("previous-memento-not-found"),ek=class{constructor(e){this.history=[],this.historyIndex=-1,this.originators=new Map,this.clearState=new Map,this.maxHistoryLength=100,this.debug=ke.create(!0,"history"),this.destroyFns=new Yd,this.destroyFns.setFns([e.addListener("series-undo",this.undo.bind(this)),e.addListener("series-redo",this.redo.bind(this))])}destroy(){this.destroyFns.destroy()}addMementoOriginator(e){this.originators.set(e.mementoOriginatorKey,e),this.clearState.set(e.mementoOriginatorKey,e.createMemento()),this.debugEvent("History add originator:",e.mementoOriginatorKey)}clear(){this.debug("History clear:",Object.keys(this.originators)),this.history=[],this.historyIndex=-1;for(const[e,t]of this.originators.entries())this.clearState.set(e,t.createMemento())}record(e,...t){this.historyIndex<this.history.length-1&&(this.history=this.history.slice(0,this.historyIndex+1)),this.history.length>this.maxHistoryLength&&(this.history=this.history.slice(-this.maxHistoryLength));const i=new Map;for(const s of t){if(!this.originators.has(s.mementoOriginatorKey))throw new Error(`Originator [${s.mementoOriginatorKey}] has not been added to the HistoryManager.`);i.set(s.mementoOriginatorKey,s.createMemento())}this.history.push({label:e,mementos:i}),this.historyIndex=this.history.length-1,this.debugEvent(`History record: [${e}]`)}undo(){const e=this.history[this.historyIndex];if(e){for(const t of e.mementos.keys()){const i=this.findPreviousMemento(t);if(i===cb)throw new Error(`Could not find previous memento for [${t}].`);this.restoreMemento(t,i)}this.historyIndex-=1,this.debugEvent(`History undo: [${e.label}]`)}}redo(){const e=this.history[this.historyIndex+1];if(e){for(const[t,i]of e.mementos.entries())this.restoreMemento(t,i);this.historyIndex+=1,this.debugEvent(`History redo: [${e.label}]`)}}findPreviousMemento(e){for(let t=this.historyIndex-1;t>=0;t--)if(this.history[t].mementos.has(e))return this.history[t].mementos.get(e);return this.clearState.has(e)?this.clearState.get(e):cb}restoreMemento(e,t){this.originators.get(e)?.restoreMemento(uo,uo,t)}debugEvent(...e){this.debug(...e,this.history.map((t,i)=>i===this.historyIndex?`** ${t.label} **`:t.label))}},po=(O(),N(T)),hb=class lm{constructor(t){this.version=t.split("-")[0]}save(...t){const i={version:this.version};for(const s of Object.values(t))i[s.mementoOriginatorKey]=this.encode(s,s.createMemento());return i}restore(t,...i){if(typeof t!="object"){po.Logger.warnOnce(`Could not restore data of type [${typeof t}], expecting an object, ignoring.`);return}if(t==null){po.Logger.warnOnce("Could not restore data of type [null], expecting an object, ignoring.");return}if(!("version"in t)||typeof t.version!="string"){po.Logger.warnOnce("Could not restore data, missing [version] string in object, ignoring.");return}for(const s of i){const n=this.decode(s,t[s.mementoOriginatorKey]),r=[];if(!s.guardMemento(n,r)){const o=r.length>0?`

${r.join(`

`)}

`:"";po.Logger.warnOnce(`Could not restore [${s.mementoOriginatorKey}] data, value was invalid, ignoring.${o}`,n);return}s.restoreMemento(this.version,t.version,n)}}encode(t,i){try{return JSON.parse(JSON.stringify(i,lm.encodeTypes))}catch(s){throw new Error(`Failed to encode [${t.mementoOriginatorKey}] value [${s}].`,{cause:s})}}decode(t,i){if(i==null)return i;try{return JSON.parse(JSON.stringify(i),lm.decodeTypes)}catch(s){throw new Error(`Failed to decode [${t.mementoOriginatorKey}] value [${s}].`,{cause:s})}}static encodeTypes(t,i){return(0,po.isDate)(this[t])?{__type:"date",value:this[t].toISOString()}:i}static decodeTypes(t,i){return(0,po.isObject)(this[t])&&"__type"in this[t]&&this[t].__type==="date"?new Date(this[t].value):i}},tk=class{constructor(){this.caretaker=new hb(uo),this.state=new Map}setState(e,t){ii(this.state.get(e.mementoOriginatorKey),t)||this.setStateAndRestore(e,t)}setStateAndRestore(e,t){this.state.set(e.mementoOriginatorKey,t),this.restoreState(e)}restoreState(e){const{caretaker:t,state:i}=this;if(!i.has(e.mementoOriginatorKey))return;const s=i.get(e.mementoOriginatorKey);t.restore({version:t.version,[e.mementoOriginatorKey]:s},e)}},si=(O(),N(T)),ik=`.ag-charts-wrapper,.ag-charts-wrapper:after,.ag-charts-wrapper:before,.ag-charts-wrapper *,.ag-charts-wrapper *:after,.ag-charts-wrapper *:before{box-sizing:border-box}.ag-charts-wrapper{--align-items: center;--justify-content: center;position:relative;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ag-charts-wrapper--safe-horizontal{--justify-content: flex-start}.ag-charts-wrapper--safe-vertical{--align-items: flex-start}.ag-charts-tab-guard{width:0%;height:0%;position:absolute;pointer-events:none}.ag-charts-canvas-center{width:100%;height:100%;position:absolute;touch-action:auto;pointer-events:auto;display:flex;align-items:var(--align-items);justify-content:var(--justify-content)}.ag-charts-canvas-container,.ag-charts-canvas{position:relative;user-select:none;-webkit-user-select:none}.ag-charts-canvas-container>*,.ag-charts-canvas>*{pointer-events:none}.ag-charts-canvas canvas{display:block}.ag-charts-series-area{outline:none;pointer-events:auto;position:absolute}.ag-charts-swapchain{top:0;left:0;outline:none;opacity:0;pointer-events:none;position:absolute;width:100%;height:100%}.ag-charts-swapchain:focus-visible{opacity:1}.ag-charts-canvas-proxy,.ag-charts-canvas-overlay{inset:0;pointer-events:none;position:absolute;user-select:none;-webkit-user-select:none}.ag-charts-canvas-overlay>*{position:absolute;pointer-events:auto}.ag-charts-theme-default,.ag-charts-theme-default-dark{--ag-charts-accent-color: #2196f3;--ag-charts-background-color: #fff;--ag-charts-border-color: #dddddd;--ag-charts-foreground-color: #464646;--ag-charts-font-family: Verdana, sans-serif;--ag-charts-font-size: 12px;--ag-charts-font-weight: 400;--ag-charts-padding: 20px;--ag-charts-shadow-color: #00000080;--ag-charts-subtle-text-color: #8c8c8c;--ag-charts-text-color: #464646;--ag-charts-chrome-background-color: #fafafa;--ag-charts-chrome-font-family: Verdana, sans-serif;--ag-charts-chrome-font-size: 12px;--ag-charts-chrome-font-weight: 400;--ag-charts-chrome-subtle-text-color: #8c8c8c;--ag-charts-chrome-text-color: #181d1f;--ag-charts-input-background-color: #fff;--ag-charts-input-text-color: #464646;--ag-charts-crosshair-label-background-color: #fff;--ag-charts-crosshair-label-text-color: #464646;--ag-charts-spacing: 4px;--ag-charts-border-radius: 4px;--ag-charts-icon-size: 16px;--ag-charts-shadow: 0 2px 8px 0 color-mix(in srgb, black 8%, transparent);--ag-charts-focus-shadow: 0 0 0 3px var(--ag-charts-accent-color);--ag-charts-focus-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-accent-color) 12%);--ag-charts-input-border-color: var(--ag-charts-border-color);--ag-charts-input-border-radius: var(--ag-charts-border-radius);--ag-charts-input-focus-border-color: var(--ag-charts-accent-color);--ag-charts-input-focus-text-color: var(--ag-charts-accent-color);--ag-charts-input-disabled-background-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-foreground-color) 6% );--ag-charts-input-disabled-border-color: var(--ag-charts-border-color);--ag-charts-input-disabled-text-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-input-text-color) 50% );--ag-charts-input-placeholder-text-color: color-mix( in srgb, var(--ag-charts-input-background-color), var(--ag-charts-input-text-color) 60% );--ag-charts-button-background-color: var(--ag-charts-background-color);--ag-charts-button-border-color: var(--ag-charts-border-color);--ag-charts-button-border-radius: var(--ag-charts-border-radius);--ag-charts-button-text-color: var(--ag-charts-text-color);--ag-charts-button-focus-background-color: color-mix( in srgb, var(--ag-charts-button-background-color), var(--ag-charts-accent-color) 12% );--ag-charts-button-focus-border-color: var(--ag-charts-accent-color);--ag-charts-button-focus-text-color: var(--ag-charts-accent-color);--ag-charts-button-disabled-background-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-foreground-color) 6% );--ag-charts-button-disabled-border-color: var(--ag-charts-border-color);--ag-charts-button-disabled-text-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-chrome-text-color) 50% );--ag-charts-checkbox-background-color: color-mix( in srgb, var(--ag-charts-background-color), var(--ag-charts-foreground-color) 35% );--ag-charts-checkbox-checked-background-color: var(--ag-charts-accent-color);--ag-charts-chrome-font-size-small: var(--ag-charts-chrome-font-size);--ag-charts-chrome-font-size-medium: calc(var(--ag-charts-chrome-font-size) * (13 / 12));--ag-charts-chrome-font-size-large: calc(var(--ag-charts-chrome-font-size) * (14 / 12));--ag-charts-border: solid 1px var(--ag-charts-border-color);--ag-charts-focus-border: solid 1px var(--ag-charts-accent-color);--ag-charts-focus-border-shadow: 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%);--ag-charts-layer-menu: 6;--ag-charts-layer-ui-overlay: 5;--ag-charts-layer-tooltip: 4;--ag-charts-layer-toolbar: 3;--ag-charts-layer-crosshair: 2;--ag-charts-layer-annotations: 1}.ag-charts-theme-default-dark{--ag-charts-shadow: 0 2px 12px 0 color-mix(in srgb, black 33.3%, transparent);--ag-charts-focus-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-accent-color) 22%)}.ag-chart-canvas-wrapper .ag-charts-theme-default{--ag-charts-border-radius: var(--ag-border-radius, 4px);--ag-charts-border: var(--ag-borders-critical, solid 1px) var(--ag-charts-border-color);--ag-charts-focus-shadow: var(--ag-focus-shadow, 0 0 0 3px var(--ag-charts-accent-color));--ag-charts-focus-border-shadow: var( --ag-focus-shadow, 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%) )}.ag-charts-icon{display:block;width:20px;height:20px;speak:none;speak:never;mask:var(--icon) center / contain no-repeat;background-color:currentColor;transition:background-color .25s ease-in-out}.ag-charts-icon-align-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNyAxMGg2djFIN3pNNCA3aDEydjFINHptMSA2aDEwdjFINXoiLz48L3N2Zz4=)}.ag-charts-icon-align-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNCAxMGg2djFINHptMC0zaDEydjFINHptMCA2aDEwdjFINHoiLz48L3N2Zz4=)}.ag-charts-icon-align-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTAgMTBoNnYxaC02ek00IDdoMTJ2MUg0em0yIDZoMTB2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-arrow-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE1LjI5MyA0LjVIMTIuNXYtMUgxN3Y0aC0xVjUuMjA3bC05LjY0NiA5LjY0Ny0uNzA4LS43MDh6IiBmaWxsPSIjMDAwIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03IDE2YTIuNSAyLjUgMCAxIDEtNSAwIDIuNSAyLjUgMCAwIDEgNSAwbS0yLjUgMS41YTEuNSAxLjUgMCAxIDAgMC0zIDEuNSAxLjUgMCAwIDAgMCAzIiBmaWxsPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-arrow-down-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02IDhMMS41IDhMMTAgMThMMTguNSA4TDE0IDhMMTQgM0w2IDNMNiA4Wk03IDRMNyA5SDMuNjYyNDRMMTAgMTYuNDU2TDE2LjMzNzYgOUwxMyA5TDEzIDRMNyA0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-arrow-up-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNCAxMkgxOC41TDEwIDJMMS41IDEySDZMNi4wMDAwMiAxN0gxNFYxMlpNMTMgMTZWMTFIMTYuMzM3NkwxMCAzLjU0NDA1TDMuNjYyNDQgMTFIN0w3LjAwMDAyIDE2SDEzWiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-callout-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtNC41MTRhMjYgMjYgMCAwIDAtMi4wMTcgMS41NGwtLjMxNC4yNmMtLjU1LjQ1Ny0xLjExNS45MjYtMS43NiAxLjQtLjY2OS40OTEtMS41NjItLjAxMi0xLjU2Mi0uOFYxNEg0LjVBMS41IDEuNSAwIDAgMSAzIDEyLjV6TTQuNSA0YS41LjUgMCAwIDAtLjUuNXY4YS41LjUgMCAwIDAgLjUuNWgxLjgzM3YzLjM3MmEzNiAzNiAwIDAgMCAxLjY3OC0xLjMzOGwuMzItLjI2NWEyNiAyNiAwIDAgMSAyLjIyNS0xLjY4NWwuMTI2LS4wODRIMTUuNWEuNS41IDAgMCAwIC41LS41di04YS41LjUgMCAwIDAtLjUtLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyAxdjNoMnYxMkg3djNINnYtM0g0VjRoMlYxek01IDVoM3YxMEg1ek0xMSAxNFY2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6bTEtN2gzdjZoLTN6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-close{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtNSA1IDEwIDEwTTUgMTUgMTUgNSIgc3Ryb2tlPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-comment-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy41MTMgMy45OTVhNi41IDYuNSAwIDAgMSA2LjA5OCAxMS40MWMtLjU4OC4zOTMtMS4yMTcuNTM2LTEuODI5LjU4NWExMyAxMyAwIDAgMS0xLjI3LjAxN0EyNyAyNyAwIDAgMCAxMCAxNkg0LjVhLjUuNSAwIDAgMS0uNS0uNVYxMHEwLS4yNDctLjAwNy0uNTEzYy0uMDA4LS40MTYtLjAxNi0uODU3LjAxNy0xLjI2OS4wNS0uNjEyLjE5Mi0xLjI0LjU4NS0xLjgzYTYuNSA2LjUgMCAwIDEgMi45MTgtMi4zOTNtMy41Ni42MWE1LjUgNS41IDAgMCAwLTUuNjQ2IDIuMzRjLS4yNjYuMzk3LS4zNzkuODQyLS40MiAxLjM1NC0uMDMuMzYtLjAyMi43MTgtLjAxNSAxLjEwOFE1IDkuNjg5IDUgMTB2NWg1cS4zMTEuMDAxLjU5My4wMDhjLjM5LjAwNy43NDcuMDE1IDEuMTA4LS4wMTUuNTEyLS4wNDEuOTU3LS4xNTQgMS4zNTUtLjQyYTUuNSA1LjUgMCAwIDAtMS45ODMtOS45NjciIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-crosshair-add-line{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-date-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMiAyaDF2MTZIMnptMTUgMGgxdjE2aC0xeiIgZmlsbD0iIzE4MUQxRiIvPjxwYXRoIGQ9Ik0xMy4xNTcgMTFINXYtMWg3Ljc5M0wxMSA4LjIwN2wuNzA3LS43MDcgMy4xODIgMy4xODItMy4xODIgMy4xODItLjcwNy0uNzA3eiIgZmlsbD0iIzAwMCIvPjwvc3ZnPg==)}.ag-charts-icon-date-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMyAySDJ2MTZoMXptMy41MDcgNC44OUw4LjUgNC44OTVWMTBINXYxaDMuNXY3aDF2LTdoNS4wODhsLTEuOTU3IDEuOTU3LjcwNy43MDcgMy4xODItMy4xODJMMTMuMzM4IDcuM2wtLjcwNy43MDdMMTQuNjI0IDEwSDkuNVY0LjkzMmwxLjk1NyAxLjk1Ny43MDctLjcwN0w4Ljk4MiAzIDUuOCA2LjE4MnoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-delete{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTguNDk2IDguOTk2QS41LjUgMCAwIDEgOSA5LjQ5MnY0YS41LjUgMCAxIDEtMSAuMDA4di00YS41LjUgMCAwIDEgLjQ5Ni0uNTA0TTEyIDkuNWEuNS41IDAgMCAwLTEgMHY0YS41LjUgMCAwIDAgMSAweiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTYgNVYzLjVBMi41IDIuNSAwIDAgMSA4LjUgMWgzQTIuNSAyLjUgMCAwIDEgMTQgMy41VjVoMi44MzNhLjUuNSAwIDAgMSAwIDFIMTV2MTAuMjVjMCAuNDE1LS4wNjYuODYzLS4zIDEuMjIxLS4yNTcuMzk0LS42NzIuNjEyLTEuMi42MTJoLTdjLS41MjggMC0uOTQzLS4yMTgtMS4yLS42MTItLjIzNC0uMzU4LS4zLS44MDYtLjMtMS4yMjFWNkgzLjMzM2EuNS41IDAgMCAxIDAtMXptMS0xLjVBMS41IDEuNSAwIDAgMSA4LjUgMmgzQTEuNSAxLjUgMCAwIDEgMTMgMy41VjVIN3pNNiAxNi4yNVY2aDh2MTAuMjVjMCAuMzM1LS4wNTkuNTU0LS4xMzguNjc1LS4wNTUuMDg1LS4xNC4xNTgtLjM2Mi4xNThoLTdjLS4yMjIgMC0uMzA3LS4wNzMtLjM2Mi0uMTU4LS4wOC0uMTIxLS4xMzgtLjM0LS4xMzgtLjY3NSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-disjoint-channel,.ag-charts-icon-disjoint-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTkuMDI4IDE3LjQ2YTIuMjUgMi4yNSAwIDAgMC00LjA5Mi0xLjg1bC05LjUxMS0yLjM3OGEyLjI1IDIuMjUgMCAxIDAtLjIyNS45NzRsOS40NzUgMi4zNjlhMi4yNTEgMi4yNTEgMCAwIDAgNC4zNTMuODg2bS0xLjY2Mi0xLjk2NWExLjI1IDEuMjUgMCAxIDEtLjg4NSAyLjMzOCAxLjI1IDEuMjUgMCAwIDEgLjg4NS0yLjMzOE00LjM0MyAxMy42NjlhMS4yNSAxLjI1IDAgMSAwLTIuMzM4LS44ODUgMS4yNSAxLjI1IDAgMCAwIDIuMzM4Ljg4NU0zLjk3IDguNzY5YTIuMjUgMi4yNSAwIDAgMCAxLjQ1NS0yLjExbDkuNTExLTIuMzc4YTIuMjUgMi4yNSAwIDEgMC0uMjYtLjk2NUw1LjIgNS42ODVhMi4yNSAyLjI1IDAgMSAwLTEuMjMgMy4wODRtLjM3My0yLjU0N2ExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjc1LTMuNDM4YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-drag-handle{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjcuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjxjaXJjbGUgY3g9IjEzLjc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iMTMuNzUiIGN5PSIxMS43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjExLjc1IiByPSIuNzUiIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjUiLz48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iMTEuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjwvc3ZnPg==)}.ag-charts-icon-fibonacci-retracement-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA1aDEydjFIMnoiLz48Y2lyY2xlIGN4PSIxNS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4yNSIgY3k9IjE0LjUiIHI9IjEuNzUiIHN0cm9rZT0iIzAwMCIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik0xOCAxNUg2di0xaDEyem0wLTQuNUgydi0xaDE2eiIvPjwvc3ZnPg==)}.ag-charts-icon-fibonacci-retracement-trend-based-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJtNC45OTYgMTIuNjc0IDMuMjkxLTUuNzQzLjg2OC40OTctMy4yOTEgNS43NDN6Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4zNTEiIGN5PSIxNC41IiByPSIxLjc1IiBzdHJva2U9IiMwMDAiLz48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTggNmgtN1Y1aDd6bTAgNC41aC03di0xaDd6bTAgNC41SDZ2LTFoMTJ6Ii8+PC9zdmc+)}.ag-charts-icon-fill-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtOC4wNzEgNC4wNi0uOTI0LS45MjQuNzA3LS43MDcgNy4yODggNy4yODgtNC45NSA0Ljk1YTMuNSAzLjUgMCAwIDEtNC45NSAwbC0xLjQxNC0xLjQxNGEzLjUgMy41IDAgMCAxIDAtNC45NXptLjcwNy43MDhMNC41MzYgOS4wMWEyLjUgMi41IDAgMCAwIDAgMy41MzZMNS45NSAxMy45NmEyLjUgMi41IDAgMCAwIDMuNTM1IDBsNC4yNDMtNC4yNDN6bTYuOSA3LjIwMi0uMzQ1LjM2My0uMzQ0LS4zNjNhLjUuNSAwIDAgMSAuNjg4IDBtLS4zNDUgMS4wOGE4IDggMCAwIDAtLjI4LjMyMyA0LjMgNC4zIDAgMCAwLS40MDkuNTgyYy0uMTEzLjIwMS0uMTQ0LjMyNi0uMTQ0LjM3OGEuODMzLjgzMyAwIDAgMCAxLjY2NyAwYzAtLjA1Mi0uMDMxLS4xNzctLjE0NC0uMzc4YTQuMyA0LjMgMCAwIDAtLjQxLS41ODIgOCA4IDAgMCAwLS4yOC0uMzIybS0uMzQ0LTEuMDguMzQ0LjM2My4zNDQtLjM2My4wMDIuMDAyLjAwNC4wMDQuMDEzLjAxMmE2IDYgMCAwIDEgLjIwNi4yMDhjLjEzMS4xMzYuMzA4LjMyNy40ODUuNTQ1LjE3Ni4yMTUuMzYzLjQ2Ny41MDcuNzI0LjEzNy4yNDMuMjczLjU1My4yNzMuODY4YTEuODMzIDEuODMzIDAgMSAxLTMuNjY3IDBjMC0uMzE1LjEzNi0uNjI1LjI3My0uODY4LjE0NC0uMjU3LjMzLS41MDkuNTA3LS43MjRhOSA5IDAgMCAxIC42NDUtLjcwOGwuMDQ2LS4wNDUuMDEzLS4wMTIuMDA0LS4wMDR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-hollow-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1vcGFjaXR5PSIuMTUiIGQ9Ik01IDVoM3YxMEg1eiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTcgMXYzaDJ2MTJIN3YzSDZ2LTNINFY0aDJWMXpNNSA1aDN2MTBINXptNyAyaDN2NmgtM3ptLTEgN1Y2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-horizontal-line,.ag-charts-icon-horizontal-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNLjUgOS41aDcuMzA2YTIuMjUgMi4yNSAwIDAgMSA0LjM4OCAwSDE5LjV2MWgtNy4zMDZhMi4yNSAyLjI1IDAgMCAxLTQuMzg4IDBILjV6bTkuNSAxLjc1YTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-line-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTQuMjQyIDIuNzIyYy0uNjEyIDAtMS4yLjI0My0xLjYzMi42NzVsLTEuMzQzIDEuMzQ0YS41LjUgMCAwIDAtLjExMi4xMTJMNC4wNSAxMS45NTljLS4yMDcuMjA3LS4zNi40Ni0uNDQ2Ljc0di4wMDFsLS42OSAyLjc2N3YuMDAyYS44Mi44MiAwIDAgMCAxLjAyMiAxLjAyMWguMDAybDIuNjM0LS44MjJjLjI4LS4wODUuNTM0LS4yMzcuNzQtLjQ0M2w3LjEwNy03LjEwOGEuNS41IDAgMCAwIC4xMTItLjExMmwxLjM0My0xLjM0M2EyLjMwOCAyLjMwOCAwIDAgMC0xLjYzMi0zLjk0TTE0LjEyMiA3bDEuMDQ0LTEuMDQ1YTEuMzA4IDEuMzA4IDAgMSAwLTEuODQ5LTEuODVMMTIuMjcxIDUuMTV6bS0yLjU1OC0xLjE0Mi02LjgwNyA2LjgwOWEuOC44IDAgMCAwLS4xOTYuMzI1bC0uNzUgMi40NjggMi40Ny0uNzQ5YS44LjggMCAwIDAgLjMyNS0uMTk0bDYuODA4LTYuODF6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTcuMzYyIDQuODczLTQuNTk0IDYuNjU0LTQuODUtMy4zMTctNC4yNTEgNi45NzctLjg1NC0uNTJMNy42MTIgNi43OWw0Ljg5OSAzLjM1IDQuMDI4LTUuODM2eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-line-style-dashed{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDR2MUgyem0xMiAwaDR2MWgtNHpNOCA5aDR2MUg4eiIvPjwvc3ZnPg==)}.ag-charts-icon-line-style-dotted{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIyLjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSI4LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTAuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSIxMi41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjE0LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48L3N2Zz4=)}.ag-charts-icon-line-style-solid{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDE2djFIMnoiLz48L3N2Zz4=)}.ag-charts-icon-line-with-markers-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTk4IDQuODg4LTMuNTU2IDQuOTE4YTIuMjUgMi4yNSAwIDEgMS0zLjg2Ni43NWwtMS40MzItLjlhMi4yNCAyLjI0IDAgMCAxLTIuMDA5LjQzNWwtMy44MjggNi40MjgtLjg2LS41MTJMNi40NSA5LjYyM2EyLjI1IDIuMjUgMCAxIDEgMy41MS0uNzYxbDEuMzI5LjgzNWEyLjI0IDIuMjQgMCAwIDEgMi41NTctLjQ5N2wzLjU0Mi00Ljg5OHptLTQuOTYgNS4xNTNhMS4yNSAxLjI1IDAgMSAwLS42NCAyLjQxOSAxLjI1IDEuMjUgMCAwIDAgLjY0LTIuNDE5TTkuMSA4LjMyMXEuMDY2LS4xOTIuMDY3LS40MDRhMS4yNSAxLjI1IDAgMSAwLS4wNjcuNDA0IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-lock,.ag-charts-icon-locked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuMjA3IDMuNzY0YTIuODk0IDIuODk0IDAgMCAwLTIuODk1IDIuODk0VjloNS43ODlWNi42NThhMi44OTQgMi44OTQgMCAwIDAtMi44OTUtMi44OTRNMTQuMSA5VjYuNjU4YTMuODk0IDMuODk0IDAgMSAwLTcuNzg5IDB2Mi4zNDlBMi41IDIuNSAwIDAgMCA0IDExLjV2M0EyLjUgMi41IDAgMCAwIDYuNSAxN2g4YTIuNSAyLjUgMCAwIDAgMi41LTIuNXYtM0EyLjUgMi41IDAgMCAwIDE0LjUgOXpNNi41IDEwQTEuNSAxLjUgMCAwIDAgNSAxMS41djNBMS41IDEuNSAwIDAgMCA2LjUgMTZoOGExLjUgMS41IDAgMCAwIDEuNS0xLjV2LTNhMS41IDEuNSAwIDAgMC0xLjUtMS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-measurer-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibTQuNDYxIDEyLjcxIDEuNTMyLTEuNTMxIDEuNDE0IDEuNDE0LjcwNy0uNzA3TDYuNyAxMC40NzJsMS41MzItMS41MzMgMiAyIC43MDctLjcwNy0yLTIgNi4wMS02LjAxIDIuODMgMi44MjhMNS4wNSAxNy43NzggMi4yMjIgMTQuOTVsMS41MzItMS41MzIgMS40MTQgMS40MTQuNzA3LS43MDd6TS44MDggMTQuOTVsLjcwNy0uNzA3TDE0LjI0MyAxLjUxNWwuNzA3LS43MDcuNzA3LjcwNyAyLjgyOCAyLjgyOC43MDcuNzA3LS43MDcuNzA3TDUuNzU3IDE4LjQ4NWwtLjcwNy43MDctLjcwNy0uNzA3LTIuODI4LTIuODI4em0xMS4wNzgtNi44MzVMMTAuNDcgNi43bC43MDctLjcwNyAxLjQxNSAxLjQxNHptLjgyNC0zLjY1NCAxIDEgLjcwOC0uNzA3LTEtMXoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-note-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtMy4yMWwtMS40NjkgMi41N2ExIDEgMCAwIDEtMS42ODIuMDg1TDcuMjQzIDE0SDQuNUExLjUgMS41IDAgMCAxIDMgMTIuNXpNNC41IDRhLjUuNSAwIDAgMC0uNS41djhhLjUuNSAwIDAgMCAuNS41aDMuMjU3bDIuMTk2IDMuMDc0TDExLjcxIDEzaDMuNzlhLjUuNSAwIDAgMCAuNS0uNXYtOGEuNS41IDAgMCAwLS41LS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNi41IDYuNUEuNS41IDAgMCAxIDcgNmg2YS41LjUgMCAwIDEgMCAxSDdhLjUuNSAwIDAgMS0uNS0uNU02LjUgOS41QS41LjUgMCAwIDEgNyA5aDZhLjUuNSAwIDAgMSAwIDFIN2EuNS41IDAgMCAxLS41LS41IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-ohlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTEzIDExaC0zdi0xaDNWM2gxdjJoNHYxaC00djExaC0xek02IDE3di0yaDN2LTFINlY0SDV2MUgydjFoM3YxMXoiLz48L3N2Zz4=)}.ag-charts-icon-pan-end{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0ibTYuNjQ2IDEzLjgxMy0uMzUzLjM1NC43MDcuNzA3LjM1NC0uMzU0ek0xMS4xNjYgMTBsLjM1NC4zNTQuMzU0LS4zNTQtLjM1NC0uMzU0ek03LjM1NSA1LjQ4IDcgNS4xMjZsLS43MDcuNzA3LjM1My4zNTR6bTAgOS4wNCA0LjE2Ni00LjE2Ni0uNzA3LS43MDgtNC4xNjcgNC4xNjd6bTQuMTY2LTQuODc0TDcuMzU0IDUuNDhsLS43MDguNzA3IDQuMTY3IDQuMTY3ek0xMy4wODMgNXYxMGgxVjV6Ii8+PC9zdmc+)}.ag-charts-icon-pan-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuNzkgNS44MzMgOC42MjUgMTBsNC4xNjYgNC4xNjctLjcwNy43MDdMNy4yMSAxMGw0Ljg3My00Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy4yMSAxNC4xNjcgMTEuMzc2IDEwIDcuMjEgNS44MzNsLjcwNy0uNzA3TDEyLjc5IDEwbC00Ljg3MyA0Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-start{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgNXYxMGgxVjV6TTkuNjI0IDEwbDQuMTY2LTQuMTY3LS43MDctLjcwN0w4LjIxIDEwbDQuODc0IDQuODc0LjcwNy0uNzA3eiIvPjwvc3ZnPg==)}.ag-charts-icon-parallel-channel,.ag-charts-icon-parallel-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTcuNzIgNS4zMzFBMi4yNSAyLjI1IDAgMSAwIDE0LjcwNSAzLjZsLTkuNDkgNC41NjJhMi4yNSAyLjI1IDAgMSAwIC4yMDkgMS4wMWw5LjY2Mi00LjY0NmEyLjI1IDIuMjUgMCAwIDAgMi42MzQuODA1bS4zNzMtMi41NDdhMS4yNSAxLjI1IDAgMSAxLTIuMzM4Ljg4NSAxLjI1IDEuMjUgMCAwIDEgMi4zMzgtLjg4NU00LjM0MyA4LjY3YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODVNNS4zMDcgMTYuNzI4YTIuMjUgMi4yNSAwIDEgMS0uNTI1LS44NThsOS45MjMtNC43N2EyLjI1IDIuMjUgMCAxIDEgLjM4MS45MjZ6bS0uOTY0LjI3NGExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjAyMy01LjEwNmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-position-bottom{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzem0zLTNoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgMTNoOHYxSDZ6Ii8+PC9zdmc+)}.ag-charts-icon-position-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMyAxMGgxNHYxSDN6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDdoOHYxSDZ6bTAgNmg4djFINnoiLz48L3N2Zz4=)}.ag-charts-icon-position-top{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzeiIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik02IDdoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDEzaDh2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-price-label-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNC41IDNBMS41IDEuNSAwIDAgMCAzIDQuNVYxM2ExLjUgMS41IDAgMCAwIDEuNSAxLjVoLjgzM3YuMDU3Yy4yNDItLjI5OS41OTctLjUwMyAxLS41NDhWMTMuNUg0LjVBLjUuNSAwIDAgMSA0IDEzVjQuNWEuNS41IDAgMCAxIC41LS41aDExYS41LjUgMCAwIDEgLjUuNXY4YS41LjUgMCAwIDEtLjUuNWgtNC44MThsLS4xMjYuMDg0YTI2IDI2IDAgMCAwLTIuMjI1IDEuNjg1bC0uMzIuMjY1LS4wNjguMDU2YTEuNSAxLjUgMCAwIDEtMi42MDkgMS4zNTRjLjAzMy43NjMuOTA1IDEuMjM4IDEuNTYuNzU2LjY0Ni0uNDc0IDEuMjEtLjk0MyAxLjc2MS0xLjRsLjMxMy0uMjZBMjYgMjYgMCAwIDEgMTAuOTg2IDE0SDE1LjVhMS41IDEuNSAwIDAgMCAxLjUtMS41di04QTEuNSAxLjUgMCAwIDAgMTUuNSAzeiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNOC43MTYgMTQuODE1YTIuMjUgMi4yNSAwIDEgMS00LjIxIDEuNTkzIDIuMjUgMi4yNSAwIDAgMSA0LjIxLTEuNTkzbS0xLjY2MiAxLjk2NmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS41IDYuMjI4IDcuMTY3IDguMzc2IDYuNSA3Ljc2MiA5LjUgNWwzIDIuNzYyLS42NjcuNjE0eiIgZmlsbD0iIzAwMCIvPjxwYXRoIGQ9Ik0yIDE4di0xaDE2djF6TTIgM1YyaDE2djF6IiBmaWxsPSIjMTgxRDFGIi8+PC9zdmc+)}.ag-charts-icon-reset{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuMDQgNC40NDVhNS44MSA1LjgxIDAgMCAwLTcuMjU3IDIuNDUzLjUuNSAwIDAgMS0uODY1LS41MDJBNi44MSA2LjgxIDAgMSAxIDMgOS44MTNhLjUuNSAwIDAgMSAxIDAgNS44MSA1LjgxIDAgMSAwIDguMDQtNS4zNjgiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTQuMjg5IDMuMDAyYS41LjUgMCAwIDEgLjUuNXYyLjY1NWgyLjY1NWEuNS41IDAgMCAxIDAgMUg0LjI5YS41LjUgMCAwIDEtLjUtLjVWMy41MDJhLjUuNSAwIDAgMSAuNS0uNSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-settings{--icon: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkIj48cGF0aCBkPSJNMTAgMTNhMyAzIDAgMSAwIDAtNiAzIDMgMCAwIDAgMCA2bTAtMWEyIDIgMCAxIDEtLjAwMS0zLjk5OUEyIDIgMCAwIDEgMTAgMTIiLz48cGF0aCBkPSJNMi4zMSAxNC4zNDVjLS44MTctMS40OTEuMDI3LTIuNDk5LjQ3NC0yLjg2NS41MzEtLjQzNC45NjktLjM2NS45NzItMS40OC0uMDAzLTEuMTE1LS40NDEtMS4wNDYtLjk3Mi0xLjQ4MS0uNDU0LS4zNzEtMS4zMTctMS40MDUtLjQzNC0yLjkzNmwuMDA1LS4wMDljLjg4NC0xLjUyIDIuMjA3LTEuMjkgMi43NTUtMS4wODMuNjQxLjI0My44MDEuNjU2IDEuNzY4LjEwMS45NjQtLjU2LjY4Ni0uOTA0Ljc5Ni0xLjU4Mi4wOTQtLjU3OC41NTktMS44NDMgMi4zMjYtMS44NDNoLjAxYzEuNzU5LjAwNSAyLjIyMiAxLjI2NiAyLjMxNiAxLjg0My4xMS42NzgtLjE2OCAxLjAyMi43OTYgMS41ODIuOTY3LjU1NSAxLjEyNy4xNDIgMS43NjgtLjEwMS41NDktLjIwOCAxLjg3Ni0uNDM4IDIuNzYgMS4wOTJzLjAyIDIuNTY1LS40MzQgMi45MzZjLS41MzEuNDM1LS45NjkuMzY2LS45NzIgMS40ODEuMDAzIDEuMTE1LjQ0MSAxLjA0Ni45NzIgMS40OC40NTQuMzcyIDEuMzE3IDEuNDA2LjQzNCAyLjkzN2wtLjAwNS4wMDljLS44ODQgMS41Mi0yLjIwNyAxLjI5LTIuNzU1IDEuMDgzLS42NDEtLjI0My0uODAxLS42NTYtMS43NjgtLjEwMS0uOTY0LjU2LS42ODYuOTA0LS43OTYgMS41ODEtLjA5NC41NzktLjU1OSAxLjg0NC0yLjMyNiAxLjg0NGgtLjAxYy0xLjc1OS0uMDA1LTIuMjIyLTEuMjY2LTIuMzE2LTEuODQ0LS4xMS0uNjc3LjE2OC0xLjAyMS0uNzk2LTEuNTgxLS45NjctLjU1NS0xLjEyNy0uMTQyLTEuNzY4LjEwMS0uNTQ5LjIwOC0xLjg3Ni40MzgtMi43Ni0xLjA5MmwtLjAyLS4wMzZ6TTkuOTg0IDIuMTYySDEwYzEuMzU1IDAgMS4zNDIgMS4wMzkgMS4zNTMgMS40MjUuMDA4LjMxMi4wNCAxLjE2IDEuMjU5IDEuODcybC4wMTUuMDA4YzEuMjI1LjcgMS45NzYuMzA0IDIuMjUxLjE1NS4zMzctLjE4MyAxLjIyNi0uNzExIDEuOTAyLjQ0NWwuMDA4LjAxNGMuNjc4IDEuMTczLS4yMjkgMS42ODItLjU1OCAxLjg4NC0uMjY2LjE2My0uOTg0LjYxNS0uOTkxIDIuMDI3di4wMTZjLjAwNyAxLjQxMi43MjUgMS44NjQuOTkxIDIuMDI3LjMyOC4yMDEgMS4yMjkuNzA3LjU2NiAxLjg3bC0uMDA4LjAxNGMtLjY3NyAxLjE3NC0xLjU3MS42NDMtMS45MS40NTktLjI3NS0uMTQ5LTEuMDI2LS41NDUtMi4yNTEuMTU0bC0uMDE1LjAwOWMtMS4yMTkuNzEyLTEuMjUxIDEuNTYtMS4yNTkgMS44NzItLjAxMS4zODYuMDAyIDEuNDI1LTEuMzUzIDEuNDI1cy0xLjM0Mi0xLjAzOS0xLjM1My0xLjQyNWMtLjAwOC0uMzEyLS4wNC0xLjE2LTEuMjU5LTEuODcybC0uMDE1LS4wMDljLTEuMjI1LS42OTktMS45NzYtLjMwMy0yLjI1MS0uMTU0LS4zMzYuMTgzLTEuMjE5LjcwNi0xLjg5NC0uNDMybC0uMDE2LS4wMjdjLS42NzgtMS4xNzQuMjI5LTEuNjgyLjU1OC0xLjg4NC4yNjYtLjE2My45ODQtLjYxNS45OTEtMi4wMjd2LS4wMTZjLS4wMDctMS40MTItLjcyNS0xLjg2NC0uOTkxLTIuMDI3LS4zMjgtLjIwMS0xLjIyOS0uNzA3LS41NjYtMS44N2wuMDA4LS4wMTRjLjY3Ny0xLjE3NCAxLjU3MS0uNjQzIDEuOTEtLjQ1OS4yNzUuMTQ5IDEuMDI2LjU0NSAyLjI1MS0uMTU1bC4wMTUtLjAwOGMxLjIxOS0uNzEyIDEuMjUxLTEuNTYgMS4yNTktMS44NzIuMDEtLjM4NC0uMDAyLTEuNDE3IDEuMzM3LTEuNDI1Ii8+PC9zdmc+)}.ag-charts-icon-step-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzE4MUQxRiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNiA0aDV2OGgzVjhoNXYxaC00djRoLTVWNUg3djEwSDJ2LTFoNHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-text-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00IDRIMTZWN0gxNVY1SDEwLjVWMTVIMTRWMTZINlYxNUg5LjVWNUg1VjdINFY0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-trend-line,.ag-charts-icon-trend-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS4zMTQgMTAuOTM4YTIuMjUgMi4yNSAwIDEgMSAuMDEtMWg5LjM1MmEyLjI1IDIuMjUgMCAxIDEgLjAxIDF6bS0yLjE4OS43MjlhMS4yNSAxLjI1IDAgMSAwIDAtMi41IDEuMjUgMS4yNSAwIDAgMCAwIDIuNW0xMy43NSAwYTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-unlock,.ag-charts-icon-unlocked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNjUxIDMuNWEyLjg5NCAyLjg5NCAwIDAgMC0yLjg5NCAyLjg5NFY5SDE0LjVhMi41IDIuNSAwIDAgMSAyLjUgMi41djNhMi41IDIuNSAwIDAgMS0yLjUgMi41aC04QTIuNSAyLjUgMCAwIDEgNCAxNC41di0zQTIuNSAyLjUgMCAwIDEgNi41IDloLjI1N1Y2LjM5NGEzLjg5NCAzLjg5NCAwIDEgMSA3Ljc4OSAwIC41LjUgMCAwIDEtMSAwQTIuODk0IDIuODk0IDAgMCAwIDEwLjY1IDMuNU02LjUgMTBBMS41IDEuNSAwIDAgMCA1IDExLjV2M0ExLjUgMS41IDAgMCAwIDYuNSAxNmg4YTEuNSAxLjUgMCAwIDAgMS41LTEuNXYtM2ExLjUgMS41IDAgMCAwLTEuNS0xLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-vertical-line,.ag-charts-icon-vertical-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNSA3LjgwNmEyLjI1IDIuMjUgMCAwIDEgMCA0LjM4OFYxOS41aC0xdi03LjMwNmEyLjI1IDIuMjUgMCAwIDEgMC00LjM4OFYuNWgxem0tLjUuOTQ0YTEuMjUgMS4yNSAwIDEgMSAwIDIuNSAxLjI1IDEuMjUgMCAwIDEgMC0yLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-zoom-in{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-zoom-out{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS41IDEwYS41LjUgMCAwIDEgLjUtLjVoOGEuNS41IDAgMCAxIDAgMUg2YS41LjUgMCAwIDEtLjUtLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-high-low-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyA0aDJ2MTJINFY0aDNNNSA1aDN2MTBINXpNMTEgMTRWNmg1djhoLTVtMS03aDN2NmgtM3oiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-hlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTYzIDEuODM3LTUuMzM0IDExLjYyMUw2Ljk1NyA4LjEybC00LjE5OSA5LjYyMi0uOTE2LS40IDQuNzU2LTEwLjlMMTIuNDkgMTEuOCAxNy4yNTQgMS40MnoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjQiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTUuODI1IDIuNzA0LjU1IDEzLjc4NWwuOTAyLjQzIDQuNzI0LTkuOTE5IDYuMDM0IDUuMDI5IDMuMjU1LTguMTQtLjkyOC0uMzctMi43NDUgNi44NnptNy44NTIgMTQuNjM2IDUuNzgtMTMuMTM5LS45MTUtLjQwMi01LjIxOSAxMS44Ni02LjAwNS01LjUwNC0zLjI3OCA3LjY0OC45Mi4zOTQgMi43MjItNi4zNTJ6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-zoom-in-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20taW4iPjxjaXJjbGUgY3g9IjExIiBjeT0iMTEiIHI9IjgiLz48bGluZSB4MT0iMjEiIHgyPSIxNi42NSIgeTE9IjIxIiB5Mj0iMTYuNjUiLz48bGluZSB4MT0iMTEiIHgyPSIxMSIgeTE9IjgiIHkyPSIxNCIvPjxsaW5lIHgxPSI4IiB4Mj0iMTQiIHkxPSIxMSIgeTI9IjExIi8+PC9zdmc+)}.ag-charts-icon-zoom-out-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20tb3V0Ij48Y2lyY2xlIGN4PSIxMSIgY3k9IjExIiByPSI4Ii8+PGxpbmUgeDE9IjIxIiB4Mj0iMTYuNjUiIHkxPSIyMSIgeTI9IjE2LjY1Ii8+PGxpbmUgeDE9IjgiIHgyPSIxNCIgeTE9IjExIiB5Mj0iMTEiLz48L3N2Zz4=)}.ag-charts-input{--input-layer-active: 1;--input-layer-focus: 2;--input-padding: calc(var(--ag-charts-spacing) * 2);--input-padding-large: calc(var(--ag-charts-spacing) * 2.5);color:var(--ag-charts-input-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-large);transition-duration:.25s;transition-property:none;transition-timing-function:ease-out}.ag-charts-input:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--input-layer-focus)}.ag-charts-button{background:var(--ag-charts-button-background-color);border:1px solid var(--ag-charts-border-color);border-radius:var(--ag-charts-button-border-radius);color:var(--ag-charts-button-text-color);cursor:pointer;padding:var(--input-padding);transition-property:background,border-color}.ag-charts-button:hover{background:var(--ag-charts-focus-color)}.ag-charts-button:has(.ag-charts-icon){padding:2px}.ag-charts-checkbox{--checkbox-transition-duration: .1s;appearance:none;background:var(--ag-charts-checkbox-background-color);border-radius:calc(var(--ag-charts-border-radius) * 9);cursor:pointer;height:18px;margin:0;transition-duration:var(--checkbox-transition-duration);transition-property:margin;width:29px}.ag-charts-checkbox:before{display:block;background:var(--ag-charts-input-background-color);border-radius:calc(var(--ag-charts-border-radius) * 7);content:" ";height:14px;margin:2px;transition-duration:var(--checkbox-transition-duration);transition-property:margin;transition-timing-function:var(--ag-charts-input-transition-easing);width:14px}.ag-charts-checkbox:checked{background:var(--ag-charts-checkbox-checked-background-color)}.ag-charts-checkbox:checked:before{margin-left:13px}.ag-charts-select{background:var(--ag-charts-input-background-color);border:1px solid var(--ag-charts-input-border-color);border-radius:var(--ag-charts-input-border-radius);padding:3px 2px 4px;font-size:inherit}.ag-charts-textarea{--textarea-line-height: 1.38;background:var(--ag-charts-input-background-color);border:1px solid var(--ag-charts-border-color);border-radius:var(--ag-charts-input-border-radius);line-height:var(--textarea-line-height);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-large);padding:var(--input-padding-large) var(--input-padding)}.ag-charts-textarea::placeholder{color:var(--ag-charts-input-placeholder-text-color)}.ag-charts-proxy-container{pointer-events:none;position:absolute}.ag-charts-proxy-elem{-webkit-appearance:none;appearance:none;background:none;border:none;color:#0000;overflow:hidden;pointer-events:auto;position:absolute}.ag-charts-proxy-elem::-moz-range-thumb,.ag-charts-proxy-elem::-moz-range-track{opacity:0}.ag-charts-proxy-elem::-webkit-slider-runnable-track,.ag-charts-proxy-elem::-webkit-slider-thumb{opacity:0}.ag-charts-proxy-elem:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-focus-indicator{position:absolute;display:block;pointer-events:none;user-select:none;-webkit-user-select:none;width:100%;height:100%}.ag-charts-focus-indicator>div{position:absolute;outline:solid 1px var(--ag-charts-chrome-background-color);box-shadow:var(--ag-charts-focus-shadow)}.ag-charts-focus-indicator>svg{width:100%;height:100%;fill:none;overflow:visible}.ag-charts-focus-svg-outer-path{stroke:var(--ag-charts-chrome-background-color);stroke-width:4px}.ag-charts-focus-svg-inner-path{stroke:var(--ag-charts-accent-color);stroke-width:2px}.ag-charts-overlay{color:#181d1f;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay{color:#fff}.ag-charts-overlay--loading{color:#8c8c8c}.ag-charts-overlay__loading-background{background:#fff;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-overlay__loading-background{background:#192232}.ag-charts-tooltip{--tooltip-arrow-size: 8px;--tooltip-row-spacing: 8px;--tooltip-column-spacing: 16px;position:fixed;inset:unset;margin:0;padding:0;overflow:visible;top:var(--top, 0px);left:var(--left, 0px);width:max-content;max-width:100%;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);color:var(--ag-charts-chrome-text-color);background:var(--ag-charts-chrome-background-color);border:var(--ag-charts-border);border-radius:var(--ag-charts-border-radius);box-shadow:var(--ag-charts-shadow)}.ag-charts-tooltip--compact .ag-charts-tooltip-content{--tooltip-row-spacing: 2px;--tooltip-column-spacing: 8px;padding:3px 6px}.ag-charts-tooltip--arrow-top:before,.ag-charts-tooltip--arrow-right:before,.ag-charts-tooltip--arrow-bottom:before,.ag-charts-tooltip--arrow-left:before{content:"";position:absolute;display:block;width:var(--tooltip-arrow-size);height:var(--tooltip-arrow-size);border:inherit;border-bottom-color:transparent;border-right-color:transparent;background:inherit;clip-path:polygon(0 0,100% 0,100% 1px,1px 100%,0 100%)}.ag-charts-tooltip--arrow-top:before{bottom:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * .5)) rotate(45deg)}.ag-charts-tooltip--arrow-bottom:before{top:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * -.5)) rotate(225deg)}.ag-charts-tooltip--arrow-left:before{right:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * .5)) rotate(315deg)}.ag-charts-tooltip--arrow-right:before{left:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * -.5)) rotate(135deg)}.ag-charts-tooltip--no-interaction{pointer-events:none;user-select:none;-webkit-user-select:none}.ag-charts-tooltip--wrap-always{overflow-wrap:break-word;word-break:break-word;hyphens:none}.ag-charts-tooltip--wrap-hyphenate{overflow-wrap:break-word;word-break:break-word;hyphens:auto}.ag-charts-tooltip--wrap-on-space{overflow-wrap:normal;word-break:normal}.ag-charts-tooltip--wrap-never{white-space:nowrap}.ag-charts-tooltip-heading,.ag-charts-tooltip-title,.ag-charts-tooltip-label,.ag-charts-tooltip-value{overflow:hidden;text-overflow:ellipsis}.ag-charts-tooltip-content{display:grid;grid:auto-flow minmax(1em,auto) / 1fr;padding:8px 12px;gap:var(--tooltip-row-spacing)}.ag-charts-tooltip-content:has(.ag-charts-tooltip-symbol){grid:auto-flow minmax(1em,auto) / auto 1fr}.ag-charts-tooltip-heading{grid-column:1 / -1}.ag-charts-tooltip-symbol{grid-column:1 / 2;place-self:center}.ag-charts-tooltip-symbol svg{display:block}.ag-charts-tooltip-title{grid-column:-2 / -1}.ag-charts-tooltip-row{grid-column:1 / -1;display:flex;gap:var(--tooltip-column-spacing);align-items:baseline;justify-content:space-between;overflow:hidden}.ag-charts-tooltip-row--inline{grid-column:-2 / -1}.ag-charts-tooltip-label{flex:1;min-width:0}.ag-charts-tooltip-value{min-width:0}.ag-charts-tooltip-footer{grid-column:1 / -1;color:var(--ag-charts-chrome-subtle-text-color);text-align:center}.ag-charts-popover{position:absolute;border:var(--ag-charts-border);border-radius:var(--ag-charts-border-radius);background:var(--ag-charts-chrome-background-color);color:var(--ag-charts-chrome-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);box-shadow:var(--ag-charts-shadow);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-menu{--item-padding: 6px 12px;--icon-color: var(--ag-charts-chrome-text-color);display:grid;grid:auto-flow auto / 1fr;column-gap:12px;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-menu:has(.ag-charts-menu__icon,.ag-charts-menu__row--stroke-width-visible){grid:auto-flow auto / auto 1fr}.ag-charts-menu__row--stroke-width-visible:before{content:"";height:var(--strokeWidth);width:12px;background:var(--icon-color)}.ag-charts-menu__row--stroke-width-visible[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-menu__row{display:grid;grid-column:1 / -1;grid-template-columns:subgrid;align-items:center;padding:var(--item-padding)}.ag-charts-menu__row:not(.ag-charts-menu__row--active){cursor:pointer}.ag-charts-menu__row:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.ag-charts-menu__row:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.ag-charts-menu__row:focus{background:var(--ag-charts-focus-color)}.ag-charts-menu__row:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--ag-charts-layer-menu)}.ag-charts-menu__row--active{--icon-color: var(--ag-charts-accent-color);background:var(--ag-charts-focus-color);color:var(--ag-charts-accent-color)}.ag-charts-menu__label{grid-column:-1 / span 1}.ag-charts-toolbar{--toolbar-gap: calc(var(--ag-charts-spacing) * 2);--toolbar-size: 34px;--toolbar-button-padding: 6px;align-items:center;display:flex;flex-wrap:nowrap;position:absolute}.ag-charts-toolbar__button{align-items:center;background:var(--ag-charts-chrome-background-color);border:var(--ag-charts-border);color:var(--ag-charts-chrome-text-color);cursor:pointer;display:flex;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-medium);font-weight:var(--ag-charts-chrome-font-weight);justify-content:center;min-height:var(--toolbar-size);min-width:var(--toolbar-size);padding:var(--toolbar-button-padding);position:relative;transition:background-color .25s ease-in-out,border-color .25s ease-in-out,color .25s ease-in-out;white-space:nowrap}.ag-charts-toolbar__button:hover{background:var(--ag-charts-focus-color);z-index:1}.ag-charts-toolbar__button:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-toolbar__button--active{background:var(--ag-charts-focus-color);border-color:var(--ag-charts-accent-color);color:var(--ag-charts-accent-color);z-index:2}.ag-charts-toolbar__button[aria-disabled=true]{background:var(--ag-charts-button-disabled-background-color);color:var(--ag-charts-button-disabled-text-color);cursor:default}.ag-charts-toolbar--horizontal{flex-direction:row;.ag-charts-toolbar__button{margin:0 0 0 -1px}.ag-charts-toolbar__button--first{border-bottom-left-radius:var(--ag-charts-border-radius);border-top-left-radius:var(--ag-charts-border-radius);margin:0}.ag-charts-toolbar__button--last{border-bottom-right-radius:var(--ag-charts-border-radius);border-top-right-radius:var(--ag-charts-border-radius)}}.ag-charts-toolbar--vertical{flex-direction:column;.ag-charts-toolbar__button{margin:-1px 0 0;max-width:100%}.ag-charts-toolbar__button--first{border-top-left-radius:var(--ag-charts-border-radius);border-top-right-radius:var(--ag-charts-border-radius);margin:0}.ag-charts-toolbar__button--last{border-bottom-left-radius:var(--ag-charts-border-radius);border-bottom-right-radius:var(--ag-charts-border-radius)}}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{margin-left:var(--toolbar-gap)}.ag-charts-toolbar__icon,.ag-charts-toolbar__label{pointer-events:none}.ag-charts-floating-toolbar{border:none;display:flex;.ag-charts-toolbar{align-items:unset;position:unset}}.ag-charts-floating-toolbar__drag-handle{align-items:center;background:var(--ag-charts-chrome-background-color);border:var(--ag-charts-border);border-bottom-left-radius:var(--ag-charts-border-radius);border-top-left-radius:var(--ag-charts-border-radius);cursor:grab;display:flex;justify-content:center;min-width:24px;padding-left:0;padding-right:0}.ag-charts-floating-toolbar__drag-handle--dragging{cursor:grabbing}
`,sk=(O(),N(T)),Sn=class{constructor(){this.registeredListeners=new Map}addListener(e,t){const i={symbol:Symbol(e),handler:t};return this.registeredListeners.has(e)?this.registeredListeners.get(e).push(i):this.registeredListeners.set(e,[i]),()=>this.removeListener(i.symbol)}removeListener(e){for(const[t,i]of this.registeredListeners.entries()){const s=i.findIndex(n=>n.symbol===e);if(s>=0){i.splice(s,1),i.length===0&&this.registeredListeners.delete(t);break}}}dispatch(e,...t){for(const i of this.getListenersByType(e))try{i.handler(...t)}catch(s){sk.Logger.errorOnce(s)}}getListenersByType(e){return this.registeredListeners.get(e)??[]}destroy(){this.registeredListeners.clear()}},Ws=class{constructor(){this.listeners=new Sn,this.destroyFns=[],this.destroyed=!1}addListener(e,t){return this.listeners.addListener(e,t)}destroy(){this.listeners.destroy(),this.destroyFns.forEach(e=>e()),this.destroyed=!0}},zc=(O(),N(T)),nk=class Pu{constructor(t,i,s){this.element=t,this.topTabGuard=i,this.bottomTabGuard=s,this.destroyFns=[],this.guardTabIndex=0,this.hasFocus=!1,this.initTabGuard(this.topTabGuard,n=>this.onTab(n,!1)),this.initTabGuard(this.bottomTabGuard,n=>this.onTab(n,!0)),this.element.addEventListener("focus",()=>this.onFocus(),{capture:!0}),this.element.addEventListener("blur",n=>this.onBlur(n),{capture:!0})}set tabIndex(t){this.guardTabIndex=t,this.guardTabIndex===0?this.setGuardIndices(void 0):this.hasFocus||this.setGuardIndices(this.guardTabIndex)}destroy(){for(const t of this.destroyFns)t();this.destroyFns.length=0}initTabGuard(t,i){const s=()=>i(t);t.addEventListener("focus",s),this.destroyFns.push(()=>t.removeEventListener("focus",s))}setGuardIndices(t){const i=t;(0,zc.setAttribute)(this.topTabGuard,"tabindex",i),(0,zc.setAttribute)(this.bottomTabGuard,"tabindex",i)}onFocus(){this.hasFocus=!0,this.guardTabIndex!==0&&this.setGuardIndices(0)}onBlur({relatedTarget:t}){const{topTabGuard:i,bottomTabGuard:s}=this;this.hasFocus=!1,this.guardTabIndex!==0&&t!==i&&t!==s&&this.setGuardIndices(this.guardTabIndex)}onTab(t,i){if(this.guardTabIndex!==0){let s;t.tabIndex===0?(s=this.findExitTarget(!i),this.setGuardIndices(this.guardTabIndex)):s=this.findEnterTarget(i),s?.focus()}}static queryFocusable(t,i){const s=(0,zc.getWindow)();return Array.from(t.querySelectorAll(i)).filter(n=>{if(n instanceof HTMLElement){const r=s.getComputedStyle(n);return r.display!=="none"&&r.visibility!=="none"}return!1})}findEnterTarget(t){const i=Pu.queryFocusable(this.element,'[tabindex="0"]'),s=t?i.length-1:0;return i[s]}findExitTarget(t){const i=Pu.queryFocusable((0,zc.getDocument)(),"[tabindex]").filter(r=>r.tabIndex>0).sort((r,o)=>r.tabIndex-o.tabIndex),{before:s,after:n}=Pu.findBeforeAndAfter(i,this.guardTabIndex);return t?s:n}static findBeforeAndAfter(t,i){let s=0,n=t.length-1,r,o;for(;s<=n;){const a=Math.floor((s+n)/2),l=t[a].tabIndex;if(l===i){r=t[a-1]||void 0,o=t[a+1]||void 0;break}else l<i?(r=t[a],s=a+1):(o=t[a],n=a-1)}return{before:r,after:o}}},Ta=(O(),N(T));function Ls(e,t,i,s,n){t.addEventListener(i,s);const r=()=>t.removeEventListener(i,s,n);return e.push(r),r}function Bc(e,t,i,s=["Escape"]){Ls(e,t,"keydown",n=>{Gc(n,...s)&&i(n)})}function $d(e,t,i){const s=Ls(e,window,"mousedown",n=>{[0,2].includes(n.button)&&!ub(t,n)&&(i(),s())});return s}function Kd(e,t,i){const s=Ls(e,window,"touchstart",n=>{Array.from(n.targetTouches).some(o=>!ub(t,o))&&(i(),s())});return s}function ub(e,t){return t.target instanceof Node&&e.contains(t.target)}function Zd(e,t,i,s){i.forEach(r=>(0,Ta.setAttribute)(r,"data-focus-visible-override",s)),Ls(e,t,"keydown",()=>{i.forEach(r=>(0,Ta.setAttribute)(r,"data-focus-visible-override",!0))},{once:!0})}function Na(e){return!(e.shiftKey||e.altKey||e.ctrlKey||e.metaKey)}function Gc(e,...t){return Na(e)&&t.some(i=>e.key===i)}function db(e,t,i,s){i&&Ls(e,t,"keydown",n=>{Gc(n,s)&&i.focus()})}function rk(e,t,i,s,n,r){db(e,t,n,r),db(e,t,i,s),Ls(e,t,"keydown",o=>{Gc(o,s,r)&&o.preventDefault()})}var go={horizontal:{nextKey:"ArrowRight",prevKey:"ArrowLeft"},vertical:{nextKey:"ArrowDown",prevKey:"ArrowUp"}};function pb(e){const{orientation:t,buttons:i,wrapAround:s=!1,onEscape:n,onFocus:r,onBlur:o}=e,{nextKey:a,prevKey:l}=go[t],c=p=>{p.target&&"tabIndex"in p.target&&(i.forEach(f=>f.tabIndex=-1),p.target.tabIndex=0)},[h,u]=s?[i.length,i.length]:[0,1/0],d=[];for(let p=0;p<i.length;p++){const f=i[(h+p-1)%u],y=i[p],b=i[(h+p+1)%u];Ls(d,y,"focus",c),r&&Ls(d,y,"focus",r),o&&Ls(d,y,"blur",o),n&&Bc(d,y,n),rk(d,y,b,a,f,l),y.tabIndex=p===0?0:-1}return d}var ok=class{constructor(e,t,i){this.lastFocus=t,this.closeCallback=i,this.destroyFns=[],this.destroyFns.push($d(this.destroyFns,e,()=>this.close(!0))),this.destroyFns.push(Kd(this.destroyFns,e,()=>this.close(!0)))}close(e){this.destroyFns.forEach(t=>t()),this.destroyFns.length=0,this.closeCallback(),this.finishClosing(e)}finishClosing(e){this.destroyFns.forEach(t=>t()),this.destroyFns.length=0,(0,Ta.setAttribute)(this.lastFocus,"aria-expanded",!1),e||this.lastFocus?.focus({preventScroll:!0}),this.lastFocus=void 0}};function gb(e){const{sourceEvent:t,orientation:i,menu:s,buttons:n,closeCallback:r,overrideFocusVisible:o}=e,{nextKey:a,prevKey:l}=go[i],c=Vc(t);(0,Ta.setAttribute)(c,"aria-expanded",!0);const h=new ok(s,c,r),u=()=>h.close(),{destroyFns:d}=h;return s.role="menu",s.ariaOrientation=i,d.push(...pb({orientation:i,buttons:n,onEscape:u,wrapAround:!0})),s.tabIndex=-1,Bc(d,s,u),Ls(d,s,"keydown",p=>{p.target===s&&(p.key===a||p.key===l)&&(p.preventDefault(),n[0]?.focus())}),n[0]?.focus({preventScroll:!0}),o!==void 0&&Zd(d,s,n,o),h}function ak(e,t){return i=>{if(e.ariaDisabled==="true")return i.preventDefault();t(i)}}function Xd(e){return"button"in e?e.button===0:Na(e)&&(e.code==="Space"||e.key==="Enter")}function Vc(e){if(e?.target instanceof HTMLElement&&"tabindex"in e.target.attributes)return e.target}function fb(e){const t=i=>{if(i.defaultPrevented)return;(0,Ta.getAttribute)(i.target,"data-preventdefault",!0)&&Gc(i,"ArrowRight","ArrowLeft","ArrowDown","ArrowUp")&&i.preventDefault()};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}var qd=(O(),N(T)),Qd=(O(),N(T)),lk=class{constructor(e){this.callback=e,this.devicePixelRatio=(0,Qd.getWindow)("devicePixelRatio")??1,this.devicePixelRatioMediaQuery=void 0,this.devicePixelRatioListener=t=>{t.matches||(this.devicePixelRatio=(0,Qd.getWindow)("devicePixelRatio")??1,this.unregisterDevicePixelRatioListener(),this.registerDevicePixelRatioListener(),this.callback(this.pixelRatio))}}get pixelRatio(){return this.devicePixelRatio}observe(){this.registerDevicePixelRatioListener()}disconnect(){this.unregisterDevicePixelRatioListener()}unregisterDevicePixelRatioListener(){this.devicePixelRatioMediaQuery?.removeEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=void 0}registerDevicePixelRatioListener(){const e=(0,Qd.getWindow)("matchMedia")?.(`(resolution: ${this.pixelRatio}dppx)`);e?.addEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=e}},mb=class{constructor(){this.elements=new Map,this.documentReady=!1,this.queuedObserveRequests=[],this.onLoad=()=>{this.documentReady=!0,this.queuedObserveRequests.forEach(([t,i])=>this.observe(t,i)),this.queuedObserveRequests=[],this.observeWindow()},typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(t=>{for(const{target:i,contentRect:{width:s,height:n}}of t){const r=this.elements.get(i);this.checkSize(r,i,s,n)}}));let e;this.pixelRatioObserver=new lk(()=>{clearTimeout(e),e=setTimeout(()=>this.checkPixelRatio(),0)}),this.documentReady=(0,qd.getDocument)("readyState")==="complete",this.documentReady?this.observeWindow():(0,qd.getWindow)()?.addEventListener("load",this.onLoad)}destroy(){(0,qd.getWindow)()?.removeEventListener("load",this.onLoad),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.pixelRatioObserver?.disconnect(),this.pixelRatioObserver=void 0}observeWindow(){this.pixelRatioObserver?.observe()}checkPixelRatio(){const e=this.pixelRatioObserver?.pixelRatio??1;for(const[t,i]of this.elements)if(i.size!=null&&i.size.pixelRatio!==e){const{width:s,height:n}=i.size;i.size={width:s,height:n,pixelRatio:e},i.cb(i.size,t)}}checkSize(e,t,i,s){if(e&&(i!==e.size?.width||s!==e.size?.height)){const n=this.pixelRatioObserver?.pixelRatio??1;e.size={width:i,height:s,pixelRatio:n},e.cb(e.size,t)}}observe(e,t){if(!this.documentReady){this.queuedObserveRequests.push([e,t]);return}this.elements.has(e)?this.removeFromQueue(e):this.resizeObserver?.observe(e);const i={cb:t};this.elements.set(e,i)}unobserve(e){this.resizeObserver?.unobserve(e),this.elements.delete(e),this.removeFromQueue(e),this.elements.size||this.destroy()}removeFromQueue(e){this.queuedObserveRequests=this.queuedObserveRequests.filter(([t])=>t!==e)}},fo=class extends Map{constructor(e,t){super(),this.defaultValue=e,this.defaultState=t}set(e,t){return this.delete(e),typeof t<"u"&&super.set(e,t),this}stateId(){return Array.from(this.keys()).pop()??this.defaultState}stateValue(){return Array.from(this.values()).pop()??this.defaultValue}},ck='<div role="presentation" class="ag-charts-wrapper ag-charts-styles" data-ag-charts><div role="presentation" class="ag-charts-canvas-center"><div role="presentation" class="ag-charts-canvas-container"><div role="presentation" class="ag-charts-canvas" aria-hidden="true"></div><div role="figure" class="ag-charts-canvas-proxy"><div role="presentation" class="ag-charts-series-area"></div></div><div role="presentation" class="ag-charts-canvas-overlay ag-charts-tooltip-container"></div></div></div></div>',hk=["styles","canvas","canvas-center","canvas-container","canvas-overlay","canvas-proxy","series-area","tooltip-container"],uk=new Set(["canvas-container","canvas","tooltip-container"]),yb={safeHorizontal:"ag-charts-wrapper--safe-horizontal",safeVertical:"ag-charts-wrapper--safe-vertical"},dk=new Map([["styles",{childElementType:"style"}],["canvas",{childElementType:"canvas"}],["canvas-proxy",{childElementType:"div"}],["canvas-overlay",{childElementType:"div"}],["canvas-center",{childElementType:"div"}],["series-area",{childElementType:"div"}],["tooltip-container",{childElementType:"div"}]]);function pk(e,t){if(typeof IntersectionObserver>"u")return;const i=new IntersectionObserver(s=>{for(const n of s)n.target===e&&t(n.intersectionRatio)},{root:e});return i.observe(e),i}var bb={x:0,y:0,width:0,height:0,top:0,bottom:0,left:0,right:0,toJSON(){return bb}};function xb(e,t){const i=(0,si.createElement)("div");return i.className="ag-charts-tab-guard",e.insertAdjacentElement(t,i),i}var Jd=class Hr extends Ws{constructor(t,i,s,n="normal"){super(),this.chart=t,this.styleContainer=s,this.mode=n,this.anchorName=`--${(0,si.createId)(this)}`,this.styles=new Map,this.pendingContainer=void 0,this.container=void 0,this.documentRoot=void 0,this.initiallyConnected=void 0,this.containerSize=void 0,this.sizeMonitor=new mb,this.cursorState=new fo("default"),this.minWidth=0,this.minHeight=0,this.element=this.initDOM(),this.rootElements=this.initRootElements(),this.rootElements.canvas.element.style.setProperty("anchor-name",this.anchorName);let r=!1;if(this.observer=pk(this.element,o=>{o===0&&!r&&this.listeners.dispatch("hidden",{type:"hidden"}),r=o===0}),this.setSizeOptions(),this.updateContainerSize(),this.addStyles("ag-charts-community",ik),this.setContainer(i),this.destroyFns.push(fb(this.element)),this.mode==="normal"){const o=this.rootElements["canvas-center"].element;if(o==null)throw new Error("Error initializing tab guards");const a=xb(o,"beforebegin"),l=xb(o,"afterend");this.tabGuards=new nk(o,a,l)}}initDOM(){if(this.mode==="normal"){const s=(0,si.createElement)("div");return s.innerHTML=ck,s.firstChild}const t=(0,si.createElement)("div");t.role="presentation",t.dataset.agCharts="",t.classList.add("ag-charts-wrapper");const i=(0,si.createElement)("div");return t.appendChild(i),i.role="presentation",i.classList.add("ag-charts-series-area"),t}initRootElements(){const{mode:t,element:i}=this,s={};for(const n of hk){const r=`ag-charts-${n}`;let o;if(t==="normal"?o=i.classList.contains(r)?i:i.getElementsByClassName(r)[0]:uk.has(n)?o=i:o=i.getElementsByClassName(r)[0]??(0,si.createElement)("div"),o==null)throw new Error(`AG Charts - unable to find DOM element ${r}`);s[n]={element:o,children:new Map,listeners:[]}}return s}destroy(){super.destroy(),this.observer?.unobserve(this.element),this.container&&this.sizeMonitor.unobserve(this.container),this.pendingContainer=void 0,Object.values(this.rootElements).forEach(t=>{t.children.forEach(i=>i.remove()),t.element.remove()}),this.element.remove()}postRenderUpdate(){this.mode!=="minimal"&&(this.pendingContainer==null||this.pendingContainer===this.container||(Hr.batchedUpdateContainer.length===0&&(0,si.getWindow)().setTimeout(this.applyBatchedUpdateContainer.bind(this),0),Hr.batchedUpdateContainer.push(this)))}applyBatchedUpdateContainer(){for(const t of Hr.batchedUpdateContainer)t.destroyed||t.updateContainer();Hr.batchedUpdateContainer.splice(0)}setSizeOptions(t=300,i=300,s,n){const{style:r}=this.element;r.width=`${s??t}px`,r.height=`${n??i}px`,this.minWidth=s??t,this.minHeight=n??i,this.updateContainerClassName()}updateContainerSize(){const{style:t}=this.rootElements["canvas-center"].element;t.visibility=this.containerSize==null?"hidden":"",this.containerSize?(t.width=`${this.containerSize.width??0}px`,t.height=`${this.containerSize.height??0}px`):(t.width="",t.height=""),this.updateContainerClassName()}setTabGuardIndex(t){this.tabGuards&&(this.tabGuards.tabIndex=t)}setContainer(t){t!==this.container&&(this.pendingContainer=t,(this.mode==="minimal"||this.container==null)&&this.updateContainer())}updateContainer(){const{pendingContainer:t}=this;if(!(t==null||t===this.container)){if(this.container&&(this.container.removeChild(this.element),this.sizeMonitor.unobserve(this.container)),this.documentRoot!=null)for(const i of this.rootElements.styles.children.keys())this.removeChild("styles",i);this.container=t,this.pendingContainer=void 0,this.documentRoot=this.getShadowDocumentRoot(t),this.initiallyConnected=this.mode==="minimal"||t.isConnected;for(const[i,s]of this.styles)this.addStyles(i,s);t.appendChild(this.element),this.sizeMonitor.observe(t,i=>{this.containerSize=i,this.updateContainerSize(),this.listeners.dispatch("resize",{type:"resize"})}),this.listeners.dispatch("container-changed",{type:"container-changed"})}}setThemeClass(t){const i="ag-charts-theme-";this.element.classList.forEach(s=>{s.startsWith(i)&&s!==t&&this.element.classList.remove(s)}),this.element.classList.add(t)}setThemeParameters(t){const i={accentColor:"accent-color",axisColor:"axis-color",backgroundColor:"background-color",borderColor:"border-color",foregroundColor:"foreground-color",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",gridLineColor:"grid-line-color",padding:"padding",subtleTextColor:"subtle-text-color",textColor:"text-color",chromeBackgroundColor:"chrome-background-color",chromeFontFamily:"chrome-font-family",chromeFontSize:"chrome-font-size",chromeFontWeight:"chrome-font-weight",chromeSubtleTextColor:"chrome-subtle-text-color",chromeTextColor:"chrome-text-color",inputBackgroundColor:"input-background-color",inputTextColor:"input-text-color",crosshairLabelBackgroundColor:"crosshair-label-background-color",crosshairLabelTextColor:"crosshair-label-text-color"},s=["fontSize","chromeFontSize"];for(const[n,r]of(0,si.entries)(t)){let o=`${r}`;s.includes(n)&&(o=`${r}px`),this.element.style.setProperty(`--ag-charts-${i[n]}`,o)}}updateCanvasLabel(t){(0,si.setAttribute)(this.rootElements["canvas-proxy"].element,"aria-label",t)}getEventElement(t,i){return["focus","blur","keydown","keyup"].includes(i)?this.rootElements["series-area"].element:t}addEventListener(t,i,s){this.getEventElement(this.element,t).addEventListener(t,i,s)}removeEventListener(t,i,s){this.getEventElement(this.element,t).removeEventListener(t,i,s)}getBoundingClientRect(){return this.rootElements.canvas.element.getBoundingClientRect()}getOverlayClientRect(){const t=(0,si.getWindow)(),i=new U(0,0,t.innerWidth,t.innerHeight),s=this.getRawOverlayClientRect();return i.intersection(s)?.toDOMRect()??bb}getRawOverlayClientRect(){let t=this.element;const i=this.element.getRootNode()?.fullscreenElement;for(;t!=null;){let r;if(i!=null&&t===i)r=!0;else{const a=t.computedStyleMap?.()?.get("overflow-y")?.toString();r=a==="auto"||a==="scroll"}if(r)return U.fromDOMRect(t.getBoundingClientRect());t=t.parentElement}if(this.documentRoot!=null)return U.fromDOMRect(this.documentRoot.getBoundingClientRect());const{innerWidth:s,innerHeight:n}=(0,si.getWindow)();return new U(0,0,s,n)}getShadowDocumentRoot(t=this.container){const i=t?.ownerDocument?.body??(0,si.getDocument)("body");for(;t!=null;){if(t===i)return;if(t.parentNode instanceof DocumentFragment)return t;t=t.parentNode}}getParent(t){return this.rootElements[t].element}getChildBoundingClientRect(t){const{children:i}=this.rootElements[t],s=[];for(const n of i.values())s.push(U.fromDOMRect(n.getBoundingClientRect()));return U.merge(s)}isManagedChildDOMElement(t,i,s){const{children:n}=this.rootElements[i],r=n?.get(s);return r!=null&&t.contains(r)}contains(t,i){return i==null?this.element.contains(t):this.rootElements[i].element.contains(t)}addStyles(t,i){const s="data-ag-charts";if(this.styles.set(t,i),this.container==null)return;const n=a=>a.getAttribute(s)===t,r=a=>{const l=new Set(["TITLE","META"]);let c=!0,h;for(const d of a.children){if(c&&l.has(d.tagName)){h=d;continue}if(c=!1,n(d))return;d.hasAttribute(s)&&(h=d)}const u=(0,si.createElement)("style");return this.chart.styleNonce!=null&&(u.nonce=this.chart.styleNonce),h==null?a.prepend(u):a.insertBefore(u,h.nextSibling),u};let o;this.styleContainer?o=r(this.styleContainer):this.initiallyConnected===!1?o=this.addChild("styles",t):this.documentRoot==null&&!Hr.headStyles.has(t)?(o=r((0,si.getDocument)("head")),Hr.headStyles.add(t)):this.documentRoot!=null&&(o=this.addChild("styles",t)),!(o==null||n(o))&&(o.setAttribute(s,t),o.innerHTML=i)}removeStyles(t){this.removeChild("styles",t)}updateCursor(t,i){this.cursorState.set(t,i),this.element.style.cursor=this.cursorState.stateValue()}getCursor(){return this.element.style.cursor}addChild(t,i,s,n){const{element:r,children:o,listeners:a}=this.rootElements[t];if(!o)throw new Error("AG Charts - unable to create DOM elements after destroy()");if(o.has(i))return o.get(i);const{childElementType:l="div"}=dk.get(t)??{};if(s&&s.tagName.toLowerCase()!==l.toLowerCase())throw new Error("AG Charts - mismatching DOM element type");const c=s??(0,si.createElement)(l);for(const[h,u,d]of a)c.addEventListener(h,u,d);if(o.set(i,c),l==="style"&&this.chart.styleNonce!=null&&(c.nonce=this.chart.styleNonce),n){const h=r.querySelector(n.query);if(h==null)throw new Error(`AG Charts - addChild query failed ${n.query}`);h.insertAdjacentElement(n.where,c)}else r?.appendChild(c);return c}removeChild(t,i){const{children:s}=this.rootElements[t];s&&(s.get(i)?.remove(),s.delete(i))}incrementDataCounter(t){const{dataset:i}=this.element;i[t]??(i[t]="0"),i[t]=String(Number(i[t])+1)}setDataBoolean(t,i){this.element.dataset[t]=String(i)}updateContainerClassName(){const{element:t,containerSize:i,minWidth:s,minHeight:n}=this;t.classList.toggle(yb.safeHorizontal,s>=(i?.width??1/0)),t.classList.toggle(yb.safeVertical,n>=(i?.height??1/0))}};Jd.batchedUpdateContainer=[],Jd.headStyles=new Set;var vb=Jd,Mb=(O(),N(T)),ep=(O(),N(T)),gk=class extends Is{constructor(){super((0,ep.createElement)("div")),this.textElement=(0,ep.createSvgElement)("text"),this.textElement.role="presentation",this.svgElement=(0,ep.createSvgElement)("svg"),this.svgElement.appendChild(this.textElement),this.svgElement.style.width="100%",this.svgElement.style.opacity="0",this.svgElement.role="presentation",this.elem.appendChild(this.svgElement),this.elem.role="presentation"}set textContent(e){this.textElement.textContent=e;const i=this.textElement.getBBox?.();i&&this.svgElement.setAttribute("viewBox",`${i.x} ${i.y} ${i.width} ${i.height}`)}get textContent(){return this.textElement.textContent}destructor(){}},fk=(O(),N(T)),Sb=(O(),N(T)),Db=class extends Is{constructor(e,t){super(e),(0,Sb.setAttribute)(this.elem,"role",t),this.setEnabled(!0)}destructor(){}setEnabled(e){(0,Sb.setAttribute)(this.elem,"aria-disabled",!e)}addListener(e,t){return super.addListener(e,(i,s)=>{(e==="click"||e==="dblclick")&&this.isDisabled()||t(i,s)})}},Oa=class extends Db{constructor(){super((0,fk.createElement)("button"))}},Ib=(O(),N(T)),mk=class extends Is{constructor(){super((0,Ib.createElement)("div")),(0,Ib.setAttribute)(this.elem,"role","group")}destructor(){}},tp=(O(),N(T)),Uc=(O(),N(T)),ip=class extends Is{constructor(e,t){super((0,Uc.createElement)("div")),this.focusedChildIndex=0,this.onChildFocus=(i,s)=>{const n=this.children[this.focusedChildIndex];this.focusedChildIndex=s.index,n?.setTabIndex(-1),s.setTabIndex(0)},this.onChildKeyDown=(i,s)=>{const n=this.orientation,[r,o]=n==="both"?[go.horizontal,go.vertical]:[go[n],void 0];let a=-1;if(Na(i.sourceEvent)){const l=i.sourceEvent.key;l===r.nextKey||l===o?.nextKey?a=s.index+1:(l===r.prevKey||l===o?.prevKey)&&(a=s.index-1)}this.children[a]?.focus()},(0,Uc.setAttribute)(this.elem,"role",t),this.orientation=e}get orientation(){return(0,Uc.getAttribute)(this.elem,"aria-orientation")??"both"}set orientation(e){(0,Uc.setAttribute)(this.elem,"aria-orientation",e!=="both"?e:void 0)}focus(){this.children[this.focusedChildIndex]?.focus()}clear(){this.focusedChildIndex=0;for(const e of this.children)this.removeChildListeners(e),e.parent=void 0;this.elem.textContent="",this.children.length=0}addChildListeners(e){e.addListener("focus",this.onChildFocus),e.addListener("keydown",this.onChildKeyDown)}removeChildListeners(e){e.removeListener("focus",this.onChildFocus),e.removeListener("keydown",this.onChildKeyDown)}onChildAdded(e){this.addChildListeners(e),e.setTabIndex(this.children.length===1?0:-1)}onChildRemoved(e){this.removeChildListeners(e);const{focusedChildIndex:t,children:i}=this,s=t===e.index;for(let n=0;n<i.length;n++){const r=i[n];r.index===t&&(this.focusedChildIndex=n),r.index=n}if(s){const n=i[t]??i[t-1];n?(this.focusedChildIndex=n.index,n.setTabIndex(0)):this.focusedChildIndex=0}}},yk=class extends ip{constructor(){super("both","list"),this.setHidden(!0)}destructor(){this.children.forEach(e=>e.getElement().parentElement.remove())}addChildToDOM(e,t){const i=(0,tp.createElement)("div");(0,tp.setAttribute)(i,"role","listitem"),(0,tp.setElementStyle)(i,"position","absolute"),Is.setElementContainer(e,i),this.appendOrInsert(i,t),this.setHidden(!1)}removeChildFromDOM(e){e.getElement().parentElement.remove(),this.setHidden(this.children.length===0)}setHidden(e){this.children.length===0&&(e=!0),super.setHidden(e)}},mo=class extends Is{constructor(e){super(e)}destructor(){}},Wc=(O(),N(T)),bk=new Intl.NumberFormat("en-US",{style:"percent"});function Hs(e,t=2){return typeof e=="number"?kb(e,t):typeof e=="string"?e:String(e??"")}function Ab(e){return bk.format(e)}var Lb=new Map().set(2,new Intl.NumberFormat("en-US",{maximumFractionDigits:2,useGrouping:!1}));function kb(e,t){let i=Lb.get(t);return i||(i=new Intl.NumberFormat("en-US",{maximumFractionDigits:t,useGrouping:!1}),Lb.set(t,i)),i.format(e)}var sp=class $l extends Is{constructor(){super((0,Wc.createElement)("input")),this._step=$l.STEP_ONE,this.orientation="both"}get step(){return this._step}set step(t){this._step=t,this.getElement().step=t.attributeValue}get keyboardStep(){return this._keyboardStep?.step??this._step}set keyboardStep(t){if(t!==this._keyboardStep?.step&&(this._keyboardStep!==void 0&&(this.removeListener("keydown",this._keyboardStep.onKeyDown),this.removeListener("keyup",this._keyboardStep.onKeyUp),this.removeListener("blur",this._keyboardStep.onBlur),this._keyboardStep=void 0),t!==void 0)){const i=()=>this.getElement().step=t.attributeValue,s=()=>this.getElement().step=this._step.attributeValue;this._keyboardStep={step:t,onKeyDown:i,onKeyUp:s,onBlur:s},this.addListener("keydown",this._keyboardStep.onKeyDown),this.addListener("keyup",this._keyboardStep.onKeyUp),this.addListener("blur",this._keyboardStep.onBlur)}}get orientation(){return(0,Wc.getAttribute)(this.elem,"aria-orientation")??"both"}set orientation(t){(0,Wc.setAttribute)(this.elem,"aria-orientation",t!=="both"?t:void 0),$l.registerDefaultPreventers(this,t)}destructor(){}clampValueRatio(t,i){const s=this.getValueRatio(),n=(0,Wc.clamp)(t,s,i);return n!==s&&this.setValueRatio(n),n}setValueRatio(t,i){const{divider:s}=this.step,n=Math.round(t*1e4)/s,{ariaValueText:r=Ab(n/s)}=i??{},o=this.getElement();o.value=`${n}`,o.ariaValueText=r}getValueRatio(){return parseFloat(this.getElement().value)/this.step.divider}static registerDefaultPreventers(t,i){i==="both"?t.removeListener("keydown",$l.onKeyDown):t.addListener("keydown",$l.onKeyDown)}static onKeyDown(t,i){let s=[];const{orientation:n}=i;n==="horizontal"?s=["ArrowUp","ArrowDown"]:n==="vertical"&&(s=["ArrowLeft","ArrowRight"]),s.includes(t.sourceEvent.code)&&t.sourceEvent.preventDefault()}};sp.STEP_ONE={attributeValue:"1",divider:1},sp.STEP_HUNDRETH={attributeValue:"0.01",divider:100};var np=sp,Cb=(O(),N(T)),xk=class extends Oa{constructor(){super(),(0,Cb.setAttribute)(this.elem,"role","switch"),this.setChecked(!1)}setChecked(e){(0,Cb.setAttribute)(this.elem,"aria-checked",e)}},Hc=class extends ip{constructor(e="horizontal"){super(e,"toolbar")}destructor(){}};function yo(e,t){return t.params?.type===e}function vk(e){if(e==="button")return new Oa;if(e==="slider")return new np;if(e==="toolbar")return new Hc;if(e==="group")return new mk;if(e==="list")return new yk;if(e==="region")return new mo((0,Mb.createElement)("div"));if(e==="text")return new gk;if(e==="listswitch")return new xk;throw Error("AG Charts - error allocating meta")}function wb(e){const t={params:e,result:void 0};return t.result=vk(t.params.type),t}var Tb=class{constructor(e,t){this.localeManager=e,this.domManager=t,this.destroyFns=[]}destroy(){this.destroyFns.forEach(e=>e())}addLocalisation(e){e(),this.destroyFns.push(this.localeManager.addListener("locale-changed",e))}createProxyContainer(e){const t=wb(e),{params:i,result:s}=t,n=s.getElement();return this.domManager.addChild("canvas-proxy",i.domManagerId,n),n.classList.add(...i.classList,"ag-charts-proxy-container"),n.role=i.type,"ariaOrientation"in i&&(n.ariaOrientation=i.ariaOrientation),yo("toolbar",t)&&(t.result.orientation=t.params.orientation),this.addLocalisation(()=>{n.ariaLabel=this.localeManager.t(i.ariaLabel.id,i.ariaLabel.params)}),s}createProxyElement(e){const t=wb(e);if(yo("button",t)){const{params:i,result:s}=t,n=s.getElement();if(this.initInteract(i,s),typeof i.textContent=="string")n.textContent=i.textContent;else{const{textContent:r}=i;this.addLocalisation(()=>{n.textContent=this.localeManager.t(r.id,r.params)})}this.setParent(t.params,t.result)}if(yo("slider",t)){const{params:i,result:s}=t,n=s.getElement();this.initInteract(i,s),n.type="range",n.role="presentation",n.style.margin="0px",this.addLocalisation(()=>{n.ariaLabel=this.localeManager.t(i.ariaLabel.id,i.ariaLabel.params)}),this.setParent(t.params,t.result)}if(yo("text",t)){const{params:i,result:s}=t;this.initElement(i,s),this.setParent(t.params,t.result)}if(yo("listswitch",t)){const{params:i,result:s}=t;this.initInteract(i,s),s.setTextContent(i.textContent),s.setChecked(i.ariaChecked),s.setAriaDescribedBy(i.ariaDescribedBy),this.setParent(t.params,t.result)}if(yo("region",t)){const{params:i,result:s}=t,n=s.getElement();this.initInteract(i,s),n.role="region",this.setParent(t.params,t.result)}return t.result}initElement(e,t){const i=t.getElement();return(0,Mb.setElementStyle)(i,"cursor",e.cursor),i.classList.toggle("ag-charts-proxy-elem",!0),i}initInteract(e,t){const{tabIndex:i,domIndex:s}=e,n=this.initElement(e,t);i!==void 0&&(n.tabIndex=i),s!==void 0&&(t.domIndex=s)}setParent(e,t){if("parent"in e)e.parent?.addChild(t);else{const i={where:e.where,query:".ag-charts-series-area"};this.domManager.addChild("canvas-proxy",e.domManagerId,t.getElement(),i)}}},Nb={ariaAnnounceHoverDatum:"${datum}",ariaAnnounceChart:"chart, ${seriesCount}[number] series",ariaAnnounceHierarchyChart:"hierarchy chart, ${caption}",ariaAnnounceGaugeChart:"gauge chart, ${caption}",ariaAnnounceHierarchyDatum:"level ${level}[number], ${count}[number] children, ${description}",ariaAnnounceFlowProportionLink:"link ${index} of ${count}, from ${from} to ${to}, ${sizeName} ${size}",ariaAnnounceFlowProportionNode:"node ${index} of ${count}, ${description}",ariaDescriptionLegendItem:"Press Space or Enter to toggle visibility",ariaLabelAddHorizontalLine:"Add Horizontal Line",ariaLabelAnnotationOptionsToolbar:"Annotation Options",ariaLabelAnnotationSettingsDialog:"Annotation Settings",ariaLabelColorPicker:"Color picker",ariaLabelFinancialCharts:"Financial Charts",ariaLabelLegend:"Legend",ariaLabelLegendPagination:"Legend Pagination",ariaLabelLegendPagePrevious:"Previous Legend Page",ariaLabelLegendPageNext:"Next Legend Page",ariaLabelLegendItem:"${label}, Legend item ${index}[number] of ${count}[number]",ariaLabelLegendItemUnknown:"Unknown legend item",ariaLabelNavigator:"Navigator",ariaLabelNavigatorRange:"Range",ariaLabelNavigatorMinimum:"Minimum",ariaLabelNavigatorMaximum:"Maximum",ariaLabelRangesToolbar:"Ranges",ariaLabelSettingsTabBar:"Settings",ariaLabelZoomToolbar:"Zoom",ariaValuePanRange:"${min}[percent0to2dp] to ${max}[percent0to2dp]",iconAltTextLineStyleSolid:"Solid",iconAltTextLineStyleDashed:"Long-dashed",iconAltTextLineStyleDotted:"Short-dashed",iconAltTextPositionTop:"Top",iconAltTextPositionCenter:"Center",iconAltTextPositionBottom:"Bottom",iconAltTextAlignLeft:"Left",iconAltTextAlignCenter:"Center",iconAltTextAlignRight:"Right",iconAltTextClose:"Close",overlayLoadingData:"Loading data...",overlayNoData:"No data to display",overlayNoVisibleSeries:"No visible series",overlayUnsupportedBrowser:"Incompatible browser version. Please upgrade your browser.",seriesHistogramTooltipFrequency:"Frequency",seriesHistogramTooltipSum:"${yName} (sum)",seriesHistogramTooltipCount:"${yName} (count)",seriesHistogramTooltipMean:"${yName} (mean)",toolbarSeriesTypeDropdown:"Chart Type",toolbarSeriesTypeOHLC:"OHLC",toolbarSeriesTypeHLC:"HLC",toolbarSeriesTypeHighLow:"High Low",toolbarSeriesTypeCandles:"Candles",toolbarSeriesTypeHollowCandles:"Hollow Candles",toolbarSeriesTypeLine:"Line",toolbarSeriesTypeLineWithMarkers:"Line with Markers",toolbarSeriesTypeStepLine:"Step Line",toolbarAnnotationsTrendLine:"Trend Line",toolbarAnnotationsFibonacciRetracement:"Fib Retracement",toolbarAnnotationsFibonacciRetracementTrendBased:"Fib Trend Based",toolbarAnnotationsHorizontalLine:"Horizontal Line",toolbarAnnotationsVerticalLine:"Vertical Line",toolbarAnnotationsParallelChannel:"Parallel Channel",toolbarAnnotationsDisjointChannel:"Disjoint Channel",toolbarAnnotationsClearAll:"Clear All",toolbarAnnotationsFillColor:"Fill Color",toolbarAnnotationsLineColor:"Line Color",toolbarAnnotationsLineStyle:"Line Style",toolbarAnnotationsLineStrokeWidth:"Line Stroke Width",toolbarAnnotationsSettings:"Settings",toolbarAnnotationsTextColor:"Text Color",toolbarAnnotationsTextSize:"Text Size",toolbarAnnotationsLock:"Lock",toolbarAnnotationsUnlock:"Unlock",toolbarAnnotationsDelete:"Delete",toolbarAnnotationsDragHandle:"Drag Toolbar",toolbarAnnotationsLineAnnotations:"Trend Lines",toolbarAnnotationsFibonacciAnnotations:"Fibonacci",toolbarAnnotationsTextAnnotations:"Text Annotations",toolbarAnnotationsShapeAnnotations:"Arrows",toolbarAnnotationsMeasurerAnnotations:"Measurers",toolbarAnnotationsCallout:"Callout",toolbarAnnotationsComment:"Comment",toolbarAnnotationsNote:"Note",toolbarAnnotationsText:"Text",toolbarAnnotationsArrow:"Arrow",toolbarAnnotationsArrowUp:"Arrow Up",toolbarAnnotationsArrowDown:"Arrow Down",toolbarAnnotationsDateRange:"Date Range",toolbarAnnotationsPriceRange:"Price Range",toolbarAnnotationsDatePriceRange:"Date and Price",toolbarAnnotationsQuickDatePriceRange:"Measure",toolbarRange1Month:"1M",toolbarRange1MonthAria:"1 month",toolbarRange3Months:"3M",toolbarRange3MonthsAria:"3 months",toolbarRange6Months:"6M",toolbarRange6MonthsAria:"6 months",toolbarRangeYearToDate:"YTD",toolbarRangeYearToDateAria:"Year to date",toolbarRange1Year:"1Y",toolbarRange1YearAria:"1 year",toolbarRangeAll:"All",toolbarRangeAllAria:"All",toolbarZoomZoomOut:"Zoom out",toolbarZoomZoomIn:"Zoom in",toolbarZoomPanLeft:"Pan left",toolbarZoomPanRight:"Pan right",toolbarZoomPanStart:"Pan to the start",toolbarZoomPanEnd:"Pan to the end",toolbarZoomReset:"Reset the zoom",contextMenuDownload:"Download",contextMenuToggleSeriesVisibility:"Toggle Visibility",contextMenuToggleOtherSeries:"Toggle Other Series",contextMenuZoomToCursor:"Zoom to here",contextMenuPanToCursor:"Pan to here",dialogHeaderChannel:"Channel",dialogHeaderLine:"Line",dialogHeaderFibonacciRange:"Fib Retracement",dialogHeaderDateRange:"Date Range",dialogHeaderPriceRange:"Price Range",dialogHeaderDatePriceRange:"Date and Price",dialogHeaderText:"Text",dialogInputAlign:"Align",dialogInputColorPicker:"Color",dialogInputColorPickerAltText:"Text Color",dialogInputFillColorPicker:"Fill",dialogInputFillColorPickerAltText:"Fill Color",dialogInputExtendChannelStart:"Extend channel start",dialogInputExtendChannelEnd:"Extend channel end",dialogInputExtendLineStart:"Extend line start",dialogInputExtendLineEnd:"Extend line end",dialogInputExtendAbove:"Extend above",dialogInputExtendBelow:"Extend below",dialogInputExtendLeft:"Extend left",dialogInputExtendRight:"Extend right",dialogInputReverse:"Reverse",dialogInputShowFill:"Show Fill",dialogInputFontSize:"Size",dialogInputFontSizeAltText:"Font Size",dialogInputLineStyle:"Dash",dialogInputPosition:"Position",dialogInputStrokeWidth:"Weight",dialogInputStrokeWidthAltText:"Line Weight",dialogInputFibonacciBands:"Bands",dialogInputFibonacciBandsAltText:"Fibonacci Bands",inputTextareaPlaceholder:"Add Text",measurerDateRangeBars:"${value}[number] bars",measurerPriceRangeValue:"${value}[number]",measurerPriceRangePercent:"${value}[percent]",measurerVolume:"Vol ${value}",tooltipPaginationStatus:"${index}[number] of ${count}[number]"},Mk=(O(),N(T)),Sk=/\$\{(\w+)}(?:\[(\w+)])?/gi,rp={number:new Intl.NumberFormat("en-US"),percent:new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}),percent0to2dp:new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:0,maximumFractionDigits:2}),date:new Intl.DateTimeFormat("en-US",{dateStyle:"full"}),time:new Intl.DateTimeFormat("en-US",{timeStyle:"full"}),datetime:new Intl.DateTimeFormat("en-US",{dateStyle:"full",timeStyle:"full"})},Dk=({defaultValue:e,variables:t})=>e?.replaceAll(Sk,(i,s,n)=>{const r=t[s],o=n!=null?rp[n]:null;return n!=null&&o==null&&Mk.Logger.warnOnce(`Format style [${n}] is not supported`),o!=null?o.format(r):typeof r=="number"?rp.number.format(r):r instanceof Date?rp.datetime.format(r):String(r)}),Ik=class extends Sn{constructor(){super(...arguments),this.localeText=void 0,this.getLocaleText=void 0}setLocaleText(e){this.localeText!==e&&(this.localeText=e,this.dispatch("locale-changed"))}setLocaleTextFormatter(e){this.getLocaleText=e,this.getLocaleText!==e&&(this.getLocaleText=e,this.dispatch("locale-changed"))}t(e,t={}){const{localeText:i=Nb,getLocaleText:s}=this,n=i[e];return s?.({key:e,defaultValue:n,variables:t})??Dk({key:e,defaultValue:n,variables:t})??e}},Yc=(O(),N(T)),Ob=(O(),N(T)),op=class{constructor(e){this.enabled=!0,this.width=600,this.height=300;const{width:t,height:i,canvasElement:s,willReadFrequently:n=!1}=e;this.pixelRatio=e.pixelRatio??(0,Ob.getWindow)("devicePixelRatio")??1,this.element=s??(0,Ob.createElement)("canvas"),this.element.style.display="block",this.element.style.width=(t??this.width)+"px",this.element.style.height=(i??this.height)+"px",this.element.width=Math.round((t??this.width)*this.pixelRatio),this.element.height=Math.round((i??this.height)*this.pixelRatio),this.context=this.element.getContext("2d",{willReadFrequently:n}),this.onEnabledChange(),this.resize(t??0,i??0,this.pixelRatio),vy(this.context)}drawImage(e,t=0,i=0){return e.drawImage(this.context.canvas,t,i)}toDataURL(e){return this.element.toDataURL(e)}resize(e,t,i){if(!(e>0&&t>0))return;const{element:s,context:n}=this;s.width=Math.round(e*i),s.height=Math.round(t*i),n.setTransform(i,0,0,i,0,0),s.style.width=e+"px",s.style.height=t+"px",this.width=e,this.height=t,this.pixelRatio=i}clear(){xy(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")}};g([Mn(e=>e.onEnabledChange())],op.prototype,"enabled",2);var Ak=(O(),N(T)),Lk=class extends Ak.EventEmitter{constructor(){super(...arguments),this.cache=new Map,this.imageLoadingCount=0}loadImage(e,t){const i=this.cache.get(e);if(i?.image)return i.image;if(i!=null&&t){i.nodes.add(t);return}if(!t)return;const s={image:void 0,nodes:new Set([t])},n=new Image;return this.imageLoadingCount++,n.onload=()=>{s.image=n,s.nodes.forEach(r=>r.markDirty()),s.nodes.clear(),this.imageLoadingCount--,this.emit("image-loaded",{uri:e})},n.onerror=()=>{this.imageLoadingCount--,s.nodes.clear(),this.emit("image-error",{uri:e})},n.src=e,this.cache.set(e,s),s.image}waitingToLoad(){return this.imageLoadingCount>0}destroy(){this.cache.forEach(e=>{e.nodes.clear()}),this.cache.clear()}},kk=class{constructor(e){this.canvas=e,this.debug=ke.create(!0,"scene"),this.layersMap=new Map,this.nextLayerId=0}get size(){return this.layersMap.size}resize(e,t,i){this.canvas.resize(e,t,i),this.layersMap.forEach(({canvas:s})=>s.resize(e,t,i))}addLayer(e){const{width:t,height:i,pixelRatio:s}=this.canvas,{name:n}=e,r=new ud({width:t,height:i,pixelRatio:s});return this.layersMap.set(r,{id:this.nextLayerId++,name:n,canvas:r}),this.debug("Scene.addLayer() - layers",this.layersMap),r}removeLayer(e){this.layersMap.has(e)&&(this.layersMap.delete(e),e.destroy(),this.debug("Scene.removeLayer() -  layers",this.layersMap))}clear(){for(const e of this.layersMap.values())e.canvas.destroy();this.layersMap.clear()}},$c=(O(),N(T));function Ck(e){for(const t of["B","KB","MB","GB"]){if(e<1536)return`${e.toFixed(1)}${t}`;e/=1024}return`${e.toFixed(1)}TB}`}function wk(){if(!("memory"in performance))return;const{totalJSHeapSize:e,usedJSHeapSize:t,jsHeapSizeLimit:i}=performance.memory,s=[];for(const n of[t,e,i])typeof n=="number"&&s.push(Ck(n));return`Heap ${s.join(" / ")}`}function Eb(e,t,i,s,n={},r=U.zero){if(!ke.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:o=0,layersSkipped:a=0,nodesRendered:l=0,nodesSkipped:c=0,opsPerformed:h=0,opsSkipped:u=0}=s??{},d=performance.now(),{start:p,...f}=t,y=Object.entries(f).map(([P,R])=>Rb(P,R)).filter(P=>P!=null).join(" + "),b=Object.entries(n).map(([P,R])=>`${P}: ${JSON.stringify(R)}`).join(" ; "),m=ke.check("scene:stats:verbose"),v=wk(),M=[`${Rb("\u23F1\uFE0F",p,d)} (${y})`,`${b}`,`Layers: ${m?ap(o,a):e.size}`,m?`Nodes: ${ap(l,c)}`:null,m?`Ops: ${ap(h,u)}`:null,m&&v?v:null].filter($c.isString),S=new Vd(P=>i.measureText(P)),D=new Map(M.map(P=>[P,S.measureLines(P)])),C=Math.max(...Array.from(D.values(),P=>P.width)),k=Rk(D.values(),P=>P.height),L=2+r.x;i.save(),i.fillStyle="white",i.fillRect(L,0,C,k),i.fillStyle="black";let w=0;for(const[P,R]of D.entries())w+=R.height,i.fillText(P,L,w);i.restore()}function Tk(e){const t=(0,$c.toArray)((0,$c.getWindow)("agChartsSceneDebug")),i=[];for(const s of t)s==="layout"?i.push("seriesRoot","legend","root",/.*Axis-\d+-axis.*/):i.push(s);e.debugNodeSearch=i}function Nk(e,t){e.save();for(const[i,s]of Object.entries(t)){const n=Qe.toCanvas(s);if(!n){$c.Logger.log(`Scene.render() - no bbox for debugged node [${i}].`);continue}e.globalAlpha=.8,e.strokeStyle="red",e.lineWidth=1,e.strokeRect(n.x,n.y,n.width,n.height),e.fillStyle="red",e.strokeStyle="white",e.font="16px sans-serif",e.textBaseline="top",e.textAlign="left",e.lineWidth=2,e.strokeText(i,n.x,n.y,n.width),e.fillText(i,n.x,n.y,n.width)}e.restore()}var Ok=new Set,Ek=new Set(["gradient","zIndex","clipRect","cachedBBox","childNodeCounts","path","__zIndex","name","__scalingCenterX","__scalingCenterY","__rotationCenterX","__rotationCenterY","_previousDatum","__fill","__lineDash","borderPath","borderClipPath","_clipPath"]);function Pk(e){const{...t}=e;for(const i of Object.keys(t))Ek.has(i)||typeof t[i]!="number"&&typeof t[i]!="string"&&typeof t[i]!="boolean"&&(Ok.add(i),delete t[i]);return t}function Kc(e,t){if(!ke.check(!0,"scene"))return{};let i=0;return{node:t==="json"?Pk(e):e,name:e.name??e.id,dirty:e.dirty,...Array.from(e.children(),s=>Kc(s,t)).reduce((s,n)=>{let{name:r}=n;const{node:{visible:o,opacity:a,zIndex:l,translationX:c,translationY:h,rotation:u,scalingX:d,scalingY:p},node:f}=n;(!o||a<=0)&&(r=`(${r})`),ue.is(f)&&f.renderToOffscreenCanvas&&(r=`*${r}*`);const y=Array.isArray(l)?`(${l.join(", ")})`:l,b=[`${(i++).toString().padStart(3,"0")}|`,`${r??"<unknown>"}`,`z: ${y}`,c&&`x: ${c}`,h&&`y: ${h}`,u&&`r: ${u}`,d!=null&&d!==1&&`sx: ${d}`,p!=null&&p!==1&&`sy: ${p}`].filter(M=>!!M).join(" ");let m=b,v=1;for(;s[m]!=null&&v<100;)m=`${b} (${v++})`;return s[m]=n,s},{})}}function Pb(e){if(!e.dirty)return{dirtyTree:{},paths:[]};const t=Array.from(e.children(),n=>Pb(n)).filter(n=>n.paths.length>0),i=ue.is(e)?e.name??e.id:e.id,s=t.length?t.flatMap(n=>n.paths).map(n=>`${i}.${n}`):[i];return{dirtyTree:{name:i,node:e,dirty:e.dirty,...t.map(n=>n.dirtyTree).filter(n=>n.dirty!=null).reduce((n,r)=>(n[r.name??"<unknown>"]=r,n),{})},paths:s}}function ap(e,t){const i=e+t;return`${e} / ${i} (${Math.round(100*e/i)}%)`}function Rb(e,t,i){const s=i!=null?i-t:t;return`${e}: ${Math.round(s*100)/100}ms`}function Rk(e,t){let i=0;for(const s of e)i+=t(s);return i}var Zc=class extends Yc.EventEmitter{constructor(e){super(),this.debug=ke.create(!0,"scene"),this.id=(0,Yc.createId)(this),this.imageLoader=new Lk,this.root=null,this.pendingSize=null,this.isDirty=!1,this.destroyFns=[],this.updateDebugFlags(),this.canvas=new op(e),this.layersManager=new kk(this.canvas),this.destroyFns.push(this.imageLoader.on("image-loaded",()=>{this.emit("scene-changed",{})}),this.imageLoader.on("image-error",({uri:t})=>{Yc.Logger.warnOnce(`Unable to load image ${t}`)}))}waitingForUpdate(){return this.imageLoader?.waitingToLoad()??!1}get width(){return this.pendingSize?.[0]??this.canvas.width}get height(){return this.pendingSize?.[1]??this.canvas.height}get pixelRatio(){return this.pendingSize?.[2]??this.canvas.pixelRatio}setContainer(e){const{element:t}=this.canvas;return t.parentElement?.removeChild(t),e.appendChild(t),this}setRoot(e){return this.root===e?this:(this.isDirty=!0,this.root?.setScene(),this.root=e,e&&(e.visible=!0,e.setScene(this)),this)}updateDebugFlags(){ke.inDevelopmentMode(()=>js._debugEnabled=!0)}clearCanvas(){this.canvas.clear()}attachNode(e){return this.appendChild(e),()=>this.removeChild(e)}appendChild(e){return this.root?.appendChild(e),this}removeChild(e){return this.root?.removeChild(e),this}download(e,t){(0,Yc.downloadUrl)(this.canvas.toDataURL(t),e?.trim()??"image")}getDataURL(e){return this.canvas.toDataURL(e)}resize(e,t,i){return e=Math.round(e),t=Math.round(t),i??(i=this.pixelRatio),e>0&&t>0&&(e!==this.width||t!==this.height||i!==this.pixelRatio)?(this.pendingSize=[e,t,i],this.isDirty=!0,!0):!1}render(e){const{debugSplitTimes:t={start:performance.now()},extraDebugStats:i,seriesRect:s}=e??{},{canvas:n,canvas:{context:r}={},root:o,pendingSize:a,width:l,height:c,pixelRatio:h}=this;if(!r)return;const u=performance.now();let d=!1;if(a&&(d=!0,this.layersManager.resize(...a),this.pendingSize=null),o&&!o.visible){this.isDirty=!1;return}if(o?.dirty===!1&&!this.isDirty){this.debug.check()&&this.debug("Scene.render() - no-op",{tree:Kc(o,"console")}),Eb(this.layersManager,t,r,void 0,i,s);return}const p={ctx:r,width:l,height:c,devicePixelRatio:h,debugNodes:{}};ke.check("scene:stats:verbose")&&(p.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),Tk(p);let f=!1;if((o?.dirty!==!1||d)&&(f=!0,n.clear()),o&&ke.check("scene:dirtyTree")){const{dirtyTree:y,paths:b}=Pb(o);ke.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:y,paths:b})}if(o&&f){if(o.visible&&o.preRender(p),this.debug.check()){const y=Kc(o,"console");this.debug("Scene.render() - before",{canvasCleared:f,tree:y})}if(o.visible)try{r.save(),o.render(p),r.restore()}catch(y){throw this.canvas.reset(),y}}t["\u270D\uFE0F"]=performance.now()-u,r.verifyDepthZero?.(),this.isDirty=!1,Eb(this.layersManager,t,r,p.stats,i,s),Nk(r,p.debugNodes),o&&this.debug.check()&&this.debug("Scene.render() - after",{tree:Kc(o,"console"),canvasCleared:f})}toSVG(){const{root:e,width:t,height:i}=this;if(e!=null)return js.toSVG(e,t,i)}strip(){const{context:e,pixelRatio:t}=this.canvas;e.setTransform(t,0,0,t,0,0),this.layersManager.clear(),this.setRoot(null),this.isDirty=!1,this.clear()}destroy(){this.strip(),this.canvas.destroy(),this.imageLoader.destroy(),this.destroyFns.forEach(e=>e()),Object.assign(this,{canvas:void 0})}};Zc.className="Scene";var Fk=(O(),N(T));function _k(e,t){return"context"in e}function Fb(e,t){return _k(e,t)&&t[0]!=null&&typeof t[0]=="object"?(t[0].context=e.context,!0):!1}function Xc(e,t,i,s){return Fb(e,s)||t&&Fb(t,s),i(...s)}var _b=class{constructor(){this.cache=new WeakMap}call(e,t,i,...s){let n,r=this.cache.get(i);try{n=JSON.stringify(s)}catch{return this.invoke(e,t,i,s,r)}return r==null&&(r=new Map,this.cache.set(i,r)),r.has(n)?r.get(n):this.invoke(e,t,i,s,r,n)}invoke(e,t,i,s,n,r){try{const o=Xc(e,t,i,s);return n&&r!=null&&n.set(r,o),o}catch(o){Fk.Logger.warnOnce("User callback errored, ignoring",o);return}}invalidateCache(){this.cache=new WeakMap}},jk=(O(),N(T)),zk=class extends Ws{constructor(e,t){super(),this.annotationRoot=e,this.fireChartEvent=t,this.mementoOriginatorKey="annotations",this.annotations=[]}createMemento(){return this.annotations}guardMemento(e){return e==null||(0,jk.isArray)(e)}restoreMemento(e,t,i){this.annotations=this.cleanData(i??[]).map(s=>{const n=this.getAnnotationTypeStyles(s.type);return xe(s,n)}),this.listeners.dispatch("restore-annotations",{type:"restore-annotations",annotations:this.annotations})}updateData(e){this.annotations=this.cleanData(e??[])}fireChangedEvent(){this.fireChartEvent({type:"annotations",annotations:Ve([...this.annotations])})}attachNode(e){return this.annotationRoot.append(e),()=>(this.annotationRoot?.removeChild(e),this)}setAnnotationStyles(e){this.styles=e}getAnnotationTypeStyles(e){return this.styles?.[e]}cleanData(e){for(const t of e)"textAlign"in t&&delete t.textAlign;return e}},jb=(e=>(e[e.CHART_BACKGROUND=0]="CHART_BACKGROUND",e[e.AXIS_GRID=1]="AXIS_GRID",e[e.AXIS=2]="AXIS",e[e.ZOOM_SELECTION=3]="ZOOM_SELECTION",e[e.SERIES_CROSSLINE_RANGE=4]="SERIES_CROSSLINE_RANGE",e[e.SERIES_LAYER=5]="SERIES_LAYER",e[e.AXIS_FOREGROUND=6]="AXIS_FOREGROUND",e[e.SERIES_CROSSHAIR=7]="SERIES_CROSSHAIR",e[e.SERIES_CROSSLINE_LINE=8]="SERIES_CROSSLINE_LINE",e[e.SERIES_ANNOTATION=9]="SERIES_ANNOTATION",e[e.CHART_ANNOTATION=10]="CHART_ANNOTATION",e[e.CHART_ANNOTATION_FOCUSED=11]="CHART_ANNOTATION_FOCUSED",e[e.STATUS_BAR=12]="STATUS_BAR",e[e.SERIES_LABEL=13]="SERIES_LABEL",e[e.LEGEND=14]="LEGEND",e[e.NAVIGATOR=15]="NAVIGATOR",e[e.FOREGROUND=16]="FOREGROUND",e))(jb||{}),Bk=class{constructor(e){this.sceneRoot=e,this.axes=new Map,this.axisGridGroup=new ue({name:"Axes-Grids",zIndex:1}),this.axisGroup=new ue({name:"Axes",zIndex:2}),this.axisLabelGroup=new ue({name:"Axes-Labels",zIndex:13}),this.axisCrosslineRangeGroup=new ue({name:"Axes-Crosslines-Range",zIndex:4}),this.axisCrosslineLineGroup=new ue({name:"Axes-Crosslines-Line",zIndex:8}),this.axisCrosslineLabelGroup=new ue({name:"Axes-Crosslines-Label",zIndex:13}),this.sceneRoot.appendChild(this.axisGroup),this.sceneRoot.appendChild(this.axisGridGroup),this.sceneRoot.appendChild(this.axisLabelGroup),this.sceneRoot.appendChild(this.axisCrosslineRangeGroup),this.sceneRoot.appendChild(this.axisCrosslineLineGroup),this.sceneRoot.appendChild(this.axisCrosslineLabelGroup)}updateAxes(e,t){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const s of e)t.includes(s)||(s.detachAxis(i),s.destroy());for(const s of t)e?.includes(s)||s.attachAxis(i);this.axes.clear();for(const s of t){const n=s.createAxisContext();this.axes.has(n.direction)?this.axes.get(n.direction)?.push(n):this.axes.set(n.direction,[n])}}getAxisContext(e){return this.axes.get(e)??[]}destroy(){this.axes.clear(),this.sceneRoot.removeChild(this.axisGroup),this.sceneRoot.removeChild(this.axisGridGroup)}},Ea=(e=>(e[e.FULL=0]="FULL",e[e.UPDATE_DATA=1]="UPDATE_DATA",e[e.PROCESS_DATA=2]="PROCESS_DATA",e[e.PROCESS_DOMAIN=3]="PROCESS_DOMAIN",e[e.PERFORM_LAYOUT=4]="PERFORM_LAYOUT",e[e.SERIES_UPDATE=5]="SERIES_UPDATE",e[e.PRE_SCENE_RENDER=6]="PRE_SCENE_RENDER",e[e.SCENE_RENDER=7]="SCENE_RENDER",e[e.NONE=8]="NONE",e))(Ea||{}),qc=(O(),N(T)),Qc=class extends Sn{constructor(e){super(),this.animationManager=e,this.dispatchOnlyLatest=!0,this.dispatchThrottle=0,this.requestThrottle=300,this.isLoadingInitialData=!1,this.isLoadingData=!1,this.freshRequests=[],this.requestCounter=0,this.debug=ke.create(!0,"data-model","data-source"),this.throttledFetch=this.createThrottledFetch(this.requestThrottle),this.throttledDispatch=this.createThrottledDispatch(this.dispatchThrottle)}updateCallback(e){typeof e=="function"&&(this.debug("DataService - updated data source callback"),this.dataSourceCallback=e,this.isLoadingInitialData=!0,this.animationManager.skip(),this.dispatch("data-source-change"))}clearCallback(){this.dataSourceCallback=void 0}load(e){this.isLoadingData=!0,this.throttledFetch(e)}isLazy(){return this.dataSourceCallback!=null}isLoading(){return this.isLazy()&&(this.isLoadingInitialData||this.isLoadingData)}createThrottledFetch(e){return(0,qc.throttle)(t=>this.fetch(t).catch(i=>qc.Logger.error("callback failed",i)),e,{leading:!1,trailing:!0})}createThrottledDispatch(e){return(0,qc.throttle)((t,i)=>{this.debug(`DataService - dispatching 'data-load' | ${t}`),this.dispatch("data-load",{type:"data-load",data:i})},e,{leading:!0,trailing:!0})}async fetch(e){if(!this.dataSourceCallback)throw new Error("DataService - [dataSource.getData] callback not initialised");const t=performance.now(),i=this.requestCounter++;this.debug(`DataService - requesting | ${i}`),this.freshRequests.push(i);let s;try{s=await this.dataSourceCallback(e),this.debug(`DataService - response | ${performance.now()-t}ms | ${i}`)}catch(r){this.debug(`DataService - request failed | ${i}`),qc.Logger.errorOnce(`DataService - request failed | [${r}]`)}this.isLoadingInitialData=!1;const n=this.freshRequests.findIndex(r=>r===i);if(n===-1||this.dispatchOnlyLatest&&n!==this.freshRequests.length-1){this.debug(`DataService - discarding stale request | ${i}`);return}this.freshRequests=this.freshRequests.slice(n+1),this.freshRequests.length===0&&(this.isLoadingData=!1),Array.isArray(s)?this.throttledDispatch(i,s):this.dispatch("data-error")}};g([ui({newValue(e){this.throttledDispatch=this.createThrottledDispatch(e)}})],Qc.prototype,"dispatchThrottle",2),g([ui({newValue(e){this.throttledFetch=this.createThrottledFetch(e)}})],Qc.prototype,"requestThrottle",2);var Gk=class{constructor(e,t){this.domManager=e,this.updateService=t,this.observers=[]}updateFonts(e){!e||e.size===0||(this.loadFonts(e),e.forEach(t=>{this.observeFontStatus(t)}))}destroy(){for(const e of this.observers)e.disconnect();this.observers=[]}loadFonts(e){const t=Array.from(e).map(r=>encodeURIComponent(r)),i=":wght@100;200;300;400;500;600;700;800;900",s=`${i}&family=`,n=`@import url('https://fonts.googleapis.com/css2?family=${t.join(s)}${i}&display=swap');
`;this.domManager.addStyles(`google-font-${t.join("-")}`,n)}observeFontStatus(e){const t=window.document.createElement("div");t.style.setProperty("position","absolute"),t.style.setProperty("top","0"),t.style.setProperty("margin","0"),t.style.setProperty("padding","0"),t.style.setProperty("overflow","hidden"),t.style.setProperty("visibility","hidden"),t.style.setProperty("width","auto"),t.style.setProperty("max-width","none"),t.style.setProperty("font-synthesis","none"),t.style.setProperty("font-family",e),t.style.setProperty("font-size","16px"),t.style.setProperty("white-space","nowrap"),t.textContent="UVWxyz",this.domManager.addChild("canvas-container",`font-check-${encodeURIComponent(e)}`,t);const i=new ResizeObserver(s=>{const n=s?.at(0)?.contentBoxSize.at(0)?.inlineSize;n!=null&&n>0&&(As.clear(),this.updateService.update(4))});i.observe(t),this.observers.push(i)}},Jc=(O(),N(T)),lp=(O(),N(T));function Vk(e,t){return i=>Number(e)*(1-i)+Number(t)*i}function zb(e,t){if(typeof e=="string")try{e=Oe.fromString(e)}catch{e=Oe.fromArray([0,0,0])}if(typeof t=="string")try{t=Oe.fromString(t)}catch{t=Oe.fromArray([0,0,0])}return i=>Oe.mix(e,t,i).toRgbaString()}var cp={};ji(cp,{easeIn:()=>Uk,easeInOut:()=>Wk,easeInOutQuad:()=>$k,easeInQuad:()=>Hk,easeOut:()=>Pa,easeOutQuad:()=>Yk,inverseEaseOut:()=>Gb,linear:()=>Bb});var Bb=e=>e,Uk=e=>1-Math.cos(e*Math.PI/2),Pa=e=>Math.sin(e*Math.PI/2),Wk=e=>-(Math.cos(e*Math.PI)-1)/2,Hk=e=>e*e,Yk=e=>1-(1-e)**2,$k=e=>e<.5?2*e*e:1-(-2*e+2)**2/2,Gb=e=>2*Math.asin(e)/Math.PI,eh=.2,bo=["initial","remove","update","add","trailing","end","none"],Ra={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:eh,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1+eh,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}},Vb=(e=>(e.Loop="loop",e.Reverse="reverse",e))(Vb||{});function Kk(e){return e.every(t=>t instanceof js)}function th(e){return Kk(e)?{nodes:e,selections:[]}:{nodes:[],selections:e}}function hp(e,t){return e===t?!0:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((i,s)=>hp(i,t[s])):fc(e)&&fc(t)?e.equals(t):(0,lp.isPlainObject)(e)&&(0,lp.isPlainObject)(t)?gd(e,t,hp):!1}var Ub=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??Bb,this.phase=e.phase;const t=e.duration??Ra[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 hp(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((0,lp.clamp)(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(e,t){if(typeof t!="object"||fc(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[r,o]of i)n[r]=o(s);return n}}interpolateValue(e,t){if(!(e==null||t==null)){if(fc(e))return i=>e[gc](t,i);try{switch(typeof e){case"number":return Vk(e,t);case"string":return zb(e,t);case"boolean":if(e===t)return()=>e;break;case"object":return()=>e;default:throw new Error(`Unable to interpolate values: ${e}, ${t}`)}}catch{}throw new Error(`Unable to interpolate values: ${e}, ${t}`)}}},Zk=(O(),N(T)),Wb=class{constructor(e){this.maxAnimationTime=e,this.debug=ke.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(bo.map(t=>[t,[]])),this.skipAnimations=!1,this.animationTimeConsumed=0,this.isReady=!1}get size(){return this.controllers.size}get consumedTimeMs(){return this.animationTimeConsumed}isActive(){return this.controllers.size>0}getActiveControllers(){return this.phases.get(bo[this.currentPhase])??[]}checkOverlappingId(e){e!=null&&this.controllers.has(e)&&(this.controllers.get(e).stop(),this.debug(`Skipping animation batch due to update of existing animation: ${e}`),this.skip())}addAnimation(e){if(e.isComplete)return;if(bo.indexOf(e.phase)<this.currentPhase){this.debug("Skipping animation due to being for an earlier phase",e.id),e.stop();return}this.controllers.set(e.id,e),this.phases.get(e.phase)?.push(e)}removeAnimation(e){this.controllers.delete(e.id);const t=this.phases.get(e.phase),i=t?.indexOf(e);i!=null&&i>=0&&t?.splice(i,1)}progress(e){if(!this.isReady)return;let t=e===0?.01:e;const i=()=>{const c=bo[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:c,phaseMeta:Ra[c]}};let{phase:s,phaseControllers:n,phaseMeta:r}=i();const o=()=>bo[this.currentPhase]==null,a=()=>{for({phase:s,phaseControllers:n,phaseMeta:r}=i();!o()&&n.length===0;)this.currentPhase++,{phase:s,phaseControllers:n,phaseMeta:r}=i(),this.debug(`AnimationBatch - phase changing to ${s}`,{unusedTime:t},n)},l=this.controllers.size;this.debug(`AnimationBatch - ${e}ms; phase ${s} with ${n?.length} of ${l}`);do{const c=t,h=r.skipIfNoEarlierAnimations&&this.animationTimeConsumed===0;let u=0;for(const d of n)h?d.stop():t=Math.min(d.update(c),t),d.isComplete&&(u++,this.removeAnimation(d));this.animationTimeConsumed+=c-t,this.debug(`AnimationBatch - updated ${n.length} controllers; ${u} completed`),this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`),a()}while(t>0&&!o());this.animationTimeConsumed>this.maxAnimationTime&&(this.debug("Animation batch exceeded max animation time, skipping",[...this.controllers]),this.stop())}ready(){if(this.isReady)return;this.isReady=!0,this.debug(`AnimationBatch - ready; skipped: ${this.skipAnimations}`,[...this.controllers]);let e=!0;for(const[,t]of this.controllers)if(t.duration>0&&Ra[t.phase].skipIfNoEarlierAnimations!==!0){e=!1;break}if(!e)for(const[,t]of this.controllers)t.autoplay&&t.play(!0)}skip(e=!0){if(this.skipAnimations===!1&&e===!0){for(const t of this.controllers.values())t.stop();this.controllers.clear()}this.skipAnimations=e}play(){for(const e of this.controllers.values())e.play()}stop(){for(const e of this.controllers.values())try{e.stop(),this.removeAnimation(e)}catch(t){Zk.Logger.error("Error during animation stop",t)}this.dispatchStopped()}stopByAnimationId(e){if(e!=null&&this.controllers.has(e)){const t=this.controllers.get(e);t&&(t.stop(),this.removeAnimation(t))}}stopByAnimationGroupId(e){for(const t of this.controllers.values())t.groupId===e&&this.stopByAnimationId(t.id)}dispatchStopped(){this.stoppedCbs.forEach(e=>e()),this.stoppedCbs.clear()}isSkipped(){return this.skipAnimations}getRemainingTime(e){if(!this.isActive())return 0;let t=0;for(const[i,s]of this.phases)s.length!==0&&(e!=null&&e!==i||(t+=Math.max(...s.map(n=>n.isComplete?0:n.delay+n.duration-(n.elapsed??0)))));return t}destroy(){this.stop(),this.controllers.clear()}},Hb=(e=>(e[e.Default=32]="Default",e[e.ZoomDrag=16]="ZoomDrag",e[e.Annotations=8]="Annotations",e[e.ContextMenu=4]="ContextMenu",e[e.Animation=2]="Animation",e[e.AnnotationsSelected=1]="AnnotationsSelected",e[e.Clickable=41]="Clickable",e[e.Focusable=34]="Focusable",e[e.Keyable=43]="Keyable",e[e.ContextMenuable=36]="ContextMenuable",e[e.AnnotationsMoveable=9]="AnnotationsMoveable",e[e.AnnotationsDraggable=57]="AnnotationsDraggable",e[e.ZoomDraggable=50]="ZoomDraggable",e[e.ZoomClickable=34]="ZoomClickable",e[e.ZoomWheelable=59]="ZoomWheelable",e[e.All=63]="All",e))(Hb||{}),Yb=class{constructor(){this.stateQueue=34}pushState(e){this.stateQueue|=e}popState(e){this.stateQueue&=~e}isState(e){return!!(this.stateQueue&-this.stateQueue&e)}};function $b(e){return e==null?!0:!isNaN(e)&&e>=0&&e<=2}var Kb=class{constructor(e,t){this.interactionManager=e,this.chartUpdateMutex=t,this.defaultDuration=1e3,this.batch=new Wb(this.defaultDuration*1.5),this.debug=ke.create(!0,"animation"),this.events=new Jc.EventEmitter,this.rafAvailable=typeof requestAnimationFrame<"u",this.isPlaying=!0,this.requestId=null,this.skipAnimations=!0,this.currentAnonymousAnimationId=0}addListener(e,t){return this.events.on(e,t)}animate(e){const t=this.batch;try{t.checkOverlappingId(e.id)}catch(a){this.failsafeOnError(a);return}let{id:i}=e;i==null&&(i=`__${this.currentAnonymousAnimationId}`,this.currentAnonymousAnimationId+=1);const s=this.isSkipped()||e.phase==="none";s&&this.debug("AnimationManager - skipping animation");const{delay:n,duration:r}=e;if(!$b(n))throw new Error(`Animation delay of ${n} is unsupported (${i})`);if(!$b(r))throw new Error(`Animation duration of ${r} is unsupported (${i})`);const o=new Ub({...e,id:i,skip:s,autoplay:this.isPlaying?e.autoplay:!1,phase:e.phase,defaultDuration:this.defaultDuration});if(!this.forceTimeJump(o,this.defaultDuration))return this.batch.addAnimation(o),o}play(){if(!this.isPlaying){this.isPlaying=!0,this.debug("AnimationManager.play()");try{this.batch.play()}catch(e){this.failsafeOnError(e)}this.requestAnimation()}}stop(){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.stop()"),this.batch.stop()}stopByAnimationId(e){try{this.batch.stopByAnimationId(e)}catch(t){this.failsafeOnError(t)}}stopByAnimationGroupId(e){try{this.batch.stopByAnimationGroupId(e)}catch(t){this.failsafeOnError(t)}}reset(){this.isPlaying?(this.stop(),this.play()):this.stop()}skip(e=!0){this.skipAnimations=e}isSkipped(){return!this.rafAvailable||this.skipAnimations||this.batch.isSkipped()}isActive(){return this.isPlaying&&this.batch.isActive()}getRemainingTime(e){return this.batch.getRemainingTime(e)}skipCurrentBatch(){this.debug.check()&&this.debug("AnimationManager - skipCurrentBatch()",{stack:new Error().stack}),this.batch.skip()}isSkippingFrames(){return!0}scheduleAnimationFrame(e){this.requestId=(0,Jc.getWindow)().requestAnimationFrame(t=>{e(t).catch(i=>Jc.Logger.error(i))})}forceTimeJump(e,t){return!1}requestAnimation(){if(!this.rafAvailable||!this.batch.isActive()||this.requestId!==null)return;let e;const t=async i=>{const s=()=>{const n=i-(e??i);e=i,this.debug("AnimationManager - onAnimationFrame()",{controllersCount:this.batch.size,deltaTime:n}),this.interactionManager.pushState(2);try{this.batch.progress(n)}catch(r){this.failsafeOnError(r)}this.events.emit("animation-frame",{type:"animation-frame",deltaMs:n})};this.isSkippingFrames()?await this.chartUpdateMutex.acquireImmediately(s):await this.chartUpdateMutex.acquire(s),this.batch.isActive()?this.scheduleAnimationFrame(t):(this.batch.stop(),this.events.emit("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}))};this.events.emit("animation-start",{type:"animation-start",deltaMs:0}),this.scheduleAnimationFrame(t)}cancelAnimation(){this.requestId!==null&&(cancelAnimationFrame(this.requestId),this.requestId=null,this.startBatch())}failsafeOnError(e,t=!0){Jc.Logger.error("Error during animation, skipping animations",e),t&&this.cancelAnimation()}startBatch(e){this.debug(`AnimationManager - startBatch() with skipAnimations=${e}.`),this.reset(),this.batch.destroy(),this.batch=new Wb(this.defaultDuration*1.5),e===!0&&this.batch.skip()}endBatch(){this.batch.isActive()?(this.batch.ready(),this.requestAnimation()):(this.interactionManager.popState(2),this.batch.isSkipped()&&this.batch.skip(!1))}onBatchStop(e){this.batch.stoppedCbs.add(e)}destroy(){this.stop(),this.events.clear()}},Zb=class extends Ws{seriesEvent(e){this.listeners.dispatch(e,{type:e})}seriesKeyNavZoom(e,t){const i={type:"series-keynav-zoom",delta:e,widgetEvent:t};this.listeners.dispatch("series-keynav-zoom",i)}legendItemClick(e,t,i,s,n){const r={type:"legend-item-click",legendType:e,series:t,itemId:i,enabled:s,legendItemName:n};this.listeners.dispatch("legend-item-click",r)}legendItemDoubleClick(e,t,i,s,n,r){const o={type:"legend-item-double-click",legendType:e,series:t,itemId:i,enabled:s,legendItemName:r,numVisibleItems:n};this.listeners.dispatch("legend-item-double-click",o)}},Xk=class{constructor(){this.download={type:"action",showOn:"always",label:"contextMenuDownload",enabled:!0,action:void 0,items:void 0},this["zoom-to-cursor"]={type:"action",showOn:"series-area",label:"contextMenuZoomToCursor",enabled:!0,action:void 0,items:void 0},this["pan-to-cursor"]={type:"action",showOn:"series-area",label:"contextMenuPanToCursor",enabled:!0,action:void 0,items:void 0},this["toggle-series-visibility"]={type:"action",showOn:"legend-item",label:"contextMenuToggleSeriesVisibility",enabled:!0,action:void 0,items:void 0},this["toggle-other-series"]={type:"action",showOn:"legend-item",label:"contextMenuToggleOtherSeries",enabled:!0,action:void 0,items:void 0},this.separator={type:"separator",showOn:"always",label:"separator",enabled:!0,action:void 0,items:void 0}}},qk=class{constructor(){this.defaults=["download","zoom-to-cursor","pan-to-cursor","toggle-series-visibility","toggle-other-series"]}},Xb=class{constructor(){this.items=new Xk,this.lists=new qk}},qb=class extends Ws{constructor(){super(),this.builtins=new Xb,this.hiddenActions=new Set,this.setVisible("zoom-to-cursor",!1),this.setVisible("pan-to-cursor",!1)}static check(e,t){return t.showOn==e}static checkCallback(e,t,i){return e===t}dispatchContext(e,t,i,s){const{widgetEvent:n}=t;if(n.sourceEvent.defaultPrevented)return;const r=s?.x??t.canvasX,o=s?.y??t.canvasY,a={type:"context-setup",showOn:e,x:r,y:o,context:i,widgetEvent:n};this.listeners.dispatch("context-setup",a),a.type="context-complete",this.listeners.dispatch("context-complete",a)}isVisible(e){return!this.hiddenActions.has(e)}setVisible(e,t){t?this.hiddenActions.delete(e):this.hiddenActions.add(e)}},Qb=class extends Ws{constructor(){super(...arguments),this.highlightStates=new fo}updateHighlight(e,t){const{activeHighlight:i}=this;this.highlightStates.set(e,t),this.activeHighlight=this.highlightStates.stateValue(),this.isEqual(this.activeHighlight,i)||this.listeners.dispatch("highlight-change",{type:"highlight-change",currentHighlight:this.activeHighlight,previousHighlight:i,callerId:e})}getActiveHighlight(){return this.activeHighlight}isEqual(e,t){return e===t||e!=null&&t!=null&&e?.series===t?.series&&e?.itemId===t?.itemId&&e?.datum===t?.datum}},Jb=(O(),N(T));function e0(e,t){if(e==null||t.length===0)return[!1,!1];const i=e.valueOf(),s=t[0],n=t[t.length-1];if(typeof s=="string")return[i===s,i===n];let r=s.valueOf(),o=n.valueOf();return r>o&&([r,o]=[o,r]),[i===r,i===o]}function Dn(e,t,i,s,n){const{xValue:r,yValue:o}=e,[a,l]=e0(o,n),[c,h]=e0(r,s);return{xKey:t,yKey:i,xValue:r,yValue:o,first:c,last:h,min:a,max:l}}function t0(e,[t,i],s){const n=(0,Jb.findMinIndex)(0,e-1,o=>{const a=s(o)?.[1]??NaN;return!Number.isFinite(a)||a>t})??0;let r=(0,Jb.findMaxIndex)(0,e-1,o=>{const a=s(o)?.[0]??NaN;return!Number.isFinite(a)||a<i})??e-1;return r=Math.min(r+1,e),[n,r]}function up(e,t,i){if(i){const{x:n,y:r,width:o,height:a}=i;return{canvasX:n+o/2,canvasY:r+a/2}}const s=t.yBar?.upperPoint??t.midPoint??e.datumMidPoint?.(t);if(s){const{x:n,y:r}=Qe.toCanvasPoint(e.contentGroup,s.x,s.y);return{canvasX:Math.round(n),canvasY:Math.round(r)}}}function i0(e,t,i,s,n){let r=-1,o=0,a=0,l=!1;for(;o<s&&r<=t-e;){r+=1;const c=i+a;if(l||(a*=-1),a>=0&&(a+=1),l&&a<0&&(a-=1),c<e||c>t){l=!0;continue}n(c)&&(o+=1)}return o}var ih=class{constructor(e,t,i){this.domManager=t,this.tooltip=i,this.stateTracker=new fo,this.suppressState=new fo(!1),this.appliedState=null,this.destroyFns=[],this.destroyFns.push(i.setup(e,t),t.addListener("hidden",()=>this.tooltip.hide()))}destroy(){this.destroyFns.forEach(e=>e())}updateTooltip(e,t,i,s){i??(i=this.stateTracker.get(e)?.content),this.stateTracker.set(e,{meta:t,content:i,pagination:s}),this.applyStates()}removeTooltip(e){this.stateTracker.delete(e),this.applyStates()}suppressTooltip(e){this.suppressState.set(e,!0)}unsuppressTooltip(e){this.suppressState.delete(e)}applyStates(){const e=this.stateTracker.stateId(),t=e?this.stateTracker.get(e):void 0;if(this.suppressState.stateValue()||t?.meta==null||t?.content==null){this.appliedState=null,this.tooltip.hide();return}const i=this.domManager.getBoundingClientRect(),s=this.tooltip.bounds==="extended"?this.domManager.getOverlayClientRect():i;if(this.appliedState?.content===t?.content){const n=this.tooltip.isVisible();this.tooltip.show(s,i,t?.meta,null,void 0,n)}else this.tooltip.show(s,i,t?.meta,t?.content,t?.pagination);this.appliedState=t}static makeTooltipMeta(e,t,i,s){const{canvasX:n,canvasY:r}=e,o=t.properties.tooltip,{placement:a,defaultPlacement:l,anchorTo:c,defaultAnchorTo:h,xOffset:u,yOffset:d}=o.position,p=up(t,i,s);return{canvasX:n,canvasY:r,nodeCanvasX:p?.canvasX??n,nodeCanvasY:p?.canvasY??r,enableInteraction:o.interaction?.enabled??!1,showArrow:o.showArrow,position:{placement:a,defaultPlacement:l,anchorTo:c,defaultAnchorTo:h,xOffset:u,yOffset:d}}}isEnteringInteractiveTooltip(e){const{tooltip:t}=this,i=e.relatedTarget;return t.interactive&&t.enabled&&t.isVisible()&&t.contains(i)}},s0=3,Qk=505,n0=30;function dp(e,t,i){const{offsetX:s,offsetY:n,clientX:r,clientY:o,currentX:a,currentY:l,sourceEvent:c}=i;return{type:t,device:e,offsetX:s,offsetY:n,clientX:r,clientY:o,currentX:a,currentY:l,sourceEvent:c}}function r0(e,t){const i=e*e+t*t,s=s0*s0;return i>=s}function Jk(e,t){const i=e.clientX-t.clientX,s=e.clientY-t.clientY,n=i*i+s*s,r=n0*n0;return n<r}var o0=class{constructor(e){this.destroyFns=[],this.listeners=new Sn,this.isDragging=!1,this.touch={distanceTravelledX:0,distanceTravelledY:0,clientX:0,clientY:0},this.destroyFns.push(e.addListener("touchstart",this.onTouchStart.bind(this)),e.addListener("touchmove",this.onTouchMove.bind(this)),e.addListener("touchend",this.onTouchEnd.bind(this)),e.addListener("mousemove",this.onMouseMove.bind(this)),e.addListener("dblclick",this.onDblClick.bind(this)),e.addListener("drag-start",this.onDragStart.bind(this)),e.addListener("drag-move",this.onDragMove.bind(this)),e.addListener("drag-end",this.onDragEnd.bind(this)))}destroy(){this.destroyFns.forEach(e=>e()),this.listeners.destroy()}addListener(e,t){return this.listeners.addListener(e,t)}dispatch(e){this.listeners.dispatch(e.type,e)}onTouchStart(e){const{clientX:t,clientY:i}=e.sourceEvent.targetTouches[0]??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX=0,this.touch.distanceTravelledY=0,this.touch.clientX=t,this.touch.clientY=i}onTouchMove(e){const{clientX:t,clientY:i}=e.sourceEvent.targetTouches[0]??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX+=Math.abs(this.touch.clientX-t),this.touch.distanceTravelledY+=Math.abs(this.touch.clientY-i),this.touch.clientX=t,this.touch.clientY=i}onTouchEnd(e){e.sourceEvent.preventDefault()}onMouseMove(e){this.dispatch(e)}onDblClick(e){this.dispatch({device:"mouse",...e})}onDragStart(e){this.dragStartEvent=e}onDragMove(e){this.dragStartEvent!=null&&r0(e.originDeltaX,e.originDeltaY)&&(this.dispatch(this.dragStartEvent),this.dispatch({...this.dragStartEvent,type:"drag-move"}),this.dragStartEvent=void 0,this.isDragging=!0),this.isDragging&&this.dispatch(e)}onDragEnd(e){if(this.isDragging){this.dispatch(e),this.isDragging=!1;return}if(e.device==="mouse"){const t=dp("mouse","click",e);this.dispatch(t)}else if(e.sourceEvent.type==="touchend"){if(r0(this.touch.distanceTravelledX,this.touch.distanceTravelledY))return;const t=dp("touch","click",e);this.dispatch(t);const i=Date.now();if(this.lastClick!==void 0&&i-this.lastClick.time<=Qk&&Jk(this.lastClick,e)){const s=dp(e.device,"dblclick",e);this.dispatch(s),this.lastClick=void 0}else this.lastClick={time:i,clientX:e.clientX,clientY:e.clientY}}}},pp=class extends mo{constructor(e){super(e)}addChildToDOM(){}removeChildFromDOM(){}},eC=class{constructor(e){this.seriesWidget=new pp(e.getParent("series-area")),this.chartWidget=new pp(e.getParent("canvas-proxy")),this.containerWidget=new pp(e.getParent("canvas-container")),this.containerWidget.addChild(this.chartWidget),this.chartWidget.addChild(this.seriesWidget),this.seriesDragInterpreter=new o0(this.seriesWidget)}destroy(){this.seriesDragInterpreter.destroy(),this.seriesWidget.destroy(),this.chartWidget.destroy(),this.containerWidget.destroy()}},ve=(O(),N(T)),tC=(O(),N(T));function gp(e,t){const[i,s]=Dt(t);return(0,tC.clamp)(i,e,s)}function Dt(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 xo(e){const[t,i]=Dt(e);return i-t}var a0=class iD extends Ic{constructor(t=[],i=[]){super(),this.domain=t,this.range=i,this.defaultClamp=!1}static is(t){return t instanceof iD}normalizeDomains(...t){return fp(...t)}transform(t){return t}transformInvert(t){return t}calcBandwidth(t=1,i=1){const{domain:s}=this,n=this.getPixelRange();if(s.length===0)return n;let o=Math.abs(s[1].valueOf()-s[0].valueOf())/t+1;if(i!==0){const a=Math.floor(n);o=Math.min(o,a)}return n/Math.max(1,o)}convert(t,i){const{domain:s}=this;if(!s||s.length<2)return NaN;const n=i?.clamp??this.defaultClamp,r=Number(this.transform(s[0])),o=Number(this.transform(s[1])),a=Number(this.transform(t)),{range:l}=this,[c,h]=l;if(n){const[u,d]=Dt([r,o]);if(a<u)return c;if(a>d)return h}return r===o?(c+h)/2:a===r?c:a===o?h:c+(a-r)/(o-r)*(h-c)}invert(t,i){const s=this.domain.map(h=>this.transform(h)),[n,r]=s,{range:o}=this,[a,l]=o;let c;return a===l?c=this.toDomain((Number(n)+Number(r))/2):c=this.toDomain(Number(n)+(t-a)/(l-a)*(Number(r)-Number(n))),this.transformInvert(c)}getPixelRange(){const[t,i]=this.range;return Math.abs(i-t)}};a0.defaultTickCount=5;var Fe=a0;function fp(...e){let t,i=1/0,s,n=-1/0;for(const r of e)for(const o of r){const a=o.valueOf();a<i&&(i=a,t=o),a>n&&(n=a,s=o)}return t!=null&&s!=null?{domain:[t,s],animatable:!0}:{domain:[],animatable:!1}}var mp=(O(),N(T)),yp={};ji(yp,{TimeInterval:()=>gt,day:()=>$s,friday:()=>SC,hour:()=>Do,millisecond:()=>l0,minute:()=>So,monday:()=>bC,month:()=>ns,saturday:()=>DC,second:()=>Mo,sunday:()=>ks,thursday:()=>MC,tuesday:()=>xC,utcDay:()=>bp,utcHour:()=>RC,utcMinute:()=>OC,utcMonth:()=>p0,utcYear:()=>d0,wednesday:()=>vC,year:()=>lr});var In=1e3,jt=In*60,ni=jt*60,Gi=ni*24,Ys=Gi*7,Fa=Gi*30,vo=Gi*365,iC=(O(),N(T)),gt=class cm{constructor(t,i,s,n,r,o=1,a){this.unit=t,this.milliseconds=i,this.hierarchy=s,this._encode=n,this._decode=r,this.step=o,this._rangeCallback=a}static extent(t,i,s){if(t.getTime()>i.getTime()&&([t,i]=[i,t],s!=null&&(s=[1-s[1],1-s[0]])),s!=null){const n=i.getTime()-t.getTime(),r=t.getTime();t=new Date(r+s[0]*n),i=new Date(r+s[1]*n)}return[t,i]}getOffset(t,i){return Math.floor(this._encode(new Date(t)))%i}floor(t){const i=new Date(t),s=this._encode(i);return this._decode(s)}ceil(t){const i=new Date(Number(t)-1),s=this._encode(i);return this._decode(s+1)}rangeIndices(t,i,{extend:s=!1,visibleRange:n=[0,1],limit:r}){[t,i]=cm.extent(t,i,n);const o=this._encode(s?this.floor(t):this.ceil(t));let a=this._encode(s?this.ceil(i):this.floor(i));return r!=null&&a-o>r&&(a=o+r),[o,a]}range(t,i,s={}){let n;t.getTime()>i.getTime()?n=this._rangeCallback?.(i,t):n=this._rangeCallback?.(t,i);const[r,o]=this.rangeIndices(t,i,s),a=[];for(let l=r;l<=o;l++){const c=this._decode(l);a.push(c)}return n?.(),a}previous(t){return this._decode(this._encode(this.ceil(t))-1)}next(t){return this._decode(this._encode(this.floor(t))+1)}rangeCount(t,i,s={}){const[n,r]=this.rangeIndices(t,i,s);return r-n}every(t,i){if(t===1&&i?.snapTo!=null)return this;const{unit:s,milliseconds:n,hierarchy:r,step:o}=this;let a=0,l;const c=t;t=Math.max(1,Math.round(t)),c!==t&&iC.Logger.warnOnce(`interval step of [${c}] rounded to [${t}].`);const{snapTo:h="start"}=i??{};if(typeof h=="string"){const p=a;l=(f,y)=>{const b=h==="start"?f:y;return a=this.getOffset(b,t),()=>a=p}}else typeof h=="number"?a=this.getOffset(new Date(h),t):h instanceof Date&&(a=this.getOffset(h,t));const u=p=>Math.floor((this._encode(p)-a)/t),d=p=>this._decode(p*t+a);return new cm(s,n*t,r,u,d,o*t,l)}};function sC(e){return e.getFullYear()}function nC(e){const t=new Date;return t.setFullYear(e),t.setMonth(0,1),t.setHours(0,0,0,0),t}var rC=(365+1/4-1/100+1/400)*24*60*60*1e3,lr=new gt("year",rC,void 0,sC,nC);function oC(e){return e.getFullYear()*12+e.getMonth()}function aC(e){const t=Math.floor(e/12),i=e-t*12;return new Date(t,i,1)}var ns=new gt("month",lr.milliseconds/12,lr,oC,aC);function lC(e){const t=e.getTimezoneOffset()*jt;return Math.floor((e.getTime()-t)/Gi)}function cC(e){const t=new Date(1970,0,1);return t.setDate(t.getDate()+e),t}var $s=new gt("day",24*60*60*1e3,ns,lC,cC);function hC(e){return e.getTime()}function uC(e){return new Date(e)}var l0=new gt("millisecond",1,$s,hC,uC),c0=new Date().getTimezoneOffset()*jt;function dC(e){return Math.floor((e.getTime()-c0)/In)}function pC(e){return new Date(c0+e*In)}var Mo=new gt("second",1e3,$s,dC,pC),h0=new Date().getTimezoneOffset()*jt;function gC(e){return Math.floor((e.getTime()-h0)/jt)}function fC(e){return new Date(h0+e*jt)}var So=new gt("minute",60*1e3,$s,gC,fC),u0=new Date().getTimezoneOffset()*jt;function mC(e){return Math.floor((e.getTime()-u0)/ni)}function yC(e){return new Date(u0+e*ni)}var Do=new gt("hour",60*60*1e3,$s,mC,yC);function cr(e){const i=(7+e-4)%7;function s(r){const o=r.getTimezoneOffset()*jt;return Math.floor((r.getTime()-o)/Ys-i/7)}function n(r){const o=new Date(1970,0,1);return o.setDate(o.getDate()+r*7+i),o}return new gt("day",7*24*60*60*1e3,ns,s,n,7)}var ks=cr(0),bC=cr(1),xC=cr(2),vC=cr(3),MC=cr(4),SC=cr(5),DC=cr(6);function IC(e){return e.getUTCFullYear()}function AC(e){const t=new Date;return t.setUTCFullYear(e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0),t}var d0=new gt("year",lr.milliseconds,void 0,IC,AC);function LC(e){return e.getUTCFullYear()*12+e.getUTCMonth()}function kC(e){const t=Math.floor(e/12),i=e-t*12;return new Date(Date.UTC(t,i,1))}var p0=new gt("month",ns.milliseconds,d0,LC,kC);function CC(e){return Math.floor(e.getTime()/Gi)}function wC(e){const t=new Date(0);return t.setUTCDate(t.getUTCDate()+e),t.setUTCHours(0,0,0,0),t}var bp=new gt("day",24*60*60*1e3,p0,CC,wC);function TC(e){return Math.floor(e.getTime()/jt)}function NC(e){return new Date(e*jt)}var OC=new gt("minute",60*1e3,bp,TC,NC);function EC(e){return Math.floor(e.getTime()/ni)}function PC(e){return new Date(e*ni)}var RC=new gt("hour",60*60*1e3,bp,EC,PC),sh={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 xp(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 g0(e,t){const s=new Date(e.getFullYear(),0,1).getDay(),n=(t-s+7)%7,r=new Date(e.getFullYear(),0,n+1);return r<=e?Math.floor(xp(e,r)/7)+1:0}var FC=0,f0=1,m0=4;function y0(e,t=e.getFullYear()){const s=new Date(t,0,1).getDay(),n=(m0-s+7)%7,r=new Date(t,0,n-(m0-f0)+1);return r<=e?Math.floor(xp(e,r)/7)+1:y0(e,t-1)}function _C(e){const t=e.getTimezoneOffset(),i=Math.abs(t);return`${t>0?"-":"+"}${zt(Math.floor(i/60),2,"0")}${zt(Math.floor(i%60),2,"0")}`}var jC={a:e=>sh.shortDays[e.getDay()],A:e=>sh.days[e.getDay()],b:e=>sh.shortMonths[e.getMonth()],B:e=>sh.months[e.getMonth()],c:"%x, %X",d:(e,t)=>zt(e.getDate(),2,t??"0"),e:"%_d",f:(e,t)=>zt(e.getMilliseconds()*1e3,6,t??"0"),H:(e,t)=>zt(e.getHours(),2,t??"0"),I:(e,t)=>{const i=e.getHours()%12;return i===0?"12":zt(i,2,t??"0")},j:(e,t)=>zt(xp(e)+1,3,t??"0"),m:(e,t)=>zt(e.getMonth()+1,2,t??"0"),M:(e,t)=>zt(e.getMinutes(),2,t??"0"),L:(e,t)=>zt(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)=>zt(e.getSeconds(),2,t??"0"),u:e=>{let t=e.getDay();return t<1&&(t+=7),String(t%7)},U:(e,t)=>zt(g0(e,FC),2,t??"0"),V:(e,t)=>zt(y0(e),2,t??"0"),w:(e,t)=>zt(e.getDay(),2,t??"0"),W:(e,t)=>zt(g0(e,f0),2,t??"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(e,t)=>zt(e.getFullYear()%100,2,t??"0"),Y:(e,t)=>zt(e.getFullYear(),4,t??"0"),Z:e=>_C(e),"%":()=>"%"},zC={_:" ",0:"0","-":""};function zt(e,t,i){const s=String(Math.floor(e));return s.length>=t?s:`${i.repeat(t-s.length)}${s}`}function _a(e){const t=[];for(;e.length>0;){let i=e.indexOf("%");if(i!==0){const a=i>0?e.substring(0,i):e;t.push(a)}if(i<0)break;const s=e[i+1],n=zC[s];n!=null&&i++;const r=e[i+1],o=jC[r];if(typeof o=="function")t.push([o,n]);else if(typeof o=="string"){const a=_a(o);t.push([a,n])}else t.push(`${n??""}${r}`);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 Zt(e){return e instanceof Date?e.getTime():e}function vp(e,t,i){const s=b0(e,t,i),n=_a(s);return r=>n(r)}function b0(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,r]=t.length===0?[0,0]:Dt([t[0].valueOf(),t[t.length-1].valueOf()]),o=new Date(n).getFullYear(),l=new Date(r).getFullYear()-o>0,c=isFinite(s)?BC(s,e):GC(e[0]);return UC(Math.max(c-i,0),l,e)}function BC(e,t){return e<In?0:e<jt?1:e<ni?2:e<Gi?3:e<Ys?4:e<Gi*28||e<Gi*31&&VC(t)?5:e<vo?6:7}function GC(e){return Mo.floor(e)<e?0:So.floor(e)<e?1:Do.floor(e)<e?2:$s.floor(e)<e?3:ns.floor(e)<e?ks.floor(e)<e?4:5:lr.floor(e)<e?6:7}function VC(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 UC(e,t,i){const s=Zt(i[0]),n=Zt(i.at(-1)),r=Math.abs(n-s),o=t||e===7,a=r===0,c=[["hour",6*ni,14*Gi,3,"%I %p"],["hour",jt,6*ni,3,"%I:%M"],["second",1e3,6*ni,1,":%S"],["ms",0,6*ni,0,".%L"],["am/pm",jt,6*ni,3,"%p"]," ",["day",Gi,Ys,4,"%a"],["month",a?0:Ys,52*Ys,5,"%b %d"],["month",5*Ys,10*vo,6,"%B"]," ",["year",o?0:vo,1/0,7,"%Y"]].filter(d=>{if(typeof d=="string")return!0;const[p,f,y,b]=d;return b>=e&&f<=r&&r<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()}var ja=(O(),N(T)),Mp=class sD extends Ic{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 sD}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,ja.clamp)(0,t,1),this._paddingInner=t,this._paddingOuter=t}get padding(){return this._paddingInner}set paddingInner(t){this.invalid=!0,this._paddingInner=(0,ja.clamp)(0,t,1)}get paddingInner(){return this._paddingInner}set paddingOuter(t){this.invalid=!0,this._paddingOuter=(0,ja.clamp)(0,t,1)}get paddingOuter(){return this._paddingOuter}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&ja.Logger.warnOnce("Expected update to not invalidate scale"))}convert(t,i){this.refresh();const s=this.findIndex(t);return s==null||s<0||s>=this.bands.length?NaN:this.ordinalRange(s)}invertNearestIndex(t){this.refresh();const i=this.bands.length;if(i===0)return-1;let s=0,n=i-1,r=1/0,o=0;for(;s<=n;){const a=(n+s)/2|0,l=this.ordinalRange(a),c=Math.abs(l-t);if(c===0)return a;c<r&&(r=c,o=a),l<t?s=a+1:n=a-1}return o}update(){const[t,i]=this.range;let{_paddingInner:s}=this;const{_paddingOuter:n,round:r,bands:o}=this,a=o.length;if(a===0)return;const l=i-t;let c;a===1?(s=0,c=l*(1-n*2)):c=l/Math.max(1,a-s+n*2);const h=r?Math.floor(c):c;let u=t+(l-h*(a-s))/2,d=h*(1-s);r&&(u=Math.round(u),d=Math.round(d)),this._step=h,this._inset=u,this._bandwidth=d,this._rawBandwidth=c*(1-s)}ordinalRange(t){const{_inset:i,_step:s,range:n}=this,r=Math.min(n[0],n[1]),o=Math.max(n[0],n[1]);return(0,ja.clamp)(r,i+s*t,o)}};g([Sa],Mp.prototype,"range",2),g([Sa],Mp.prototype,"round",2);var za=Mp,rs=class nD extends za{static is(t){return t instanceof nD}toDomain(t){return new Date(t)}convert(t,i){const{domain:s,bands:n}=this;if(s.length<=0)return NaN;const r=this.ordinalRange(0),o=this.ordinalRange(n.length-1),a=i?.interpolate??!1,l=s[0].valueOf()>s[s.length-1].valueOf();if(!a){const y=super.convert(t,i);return l?o-(y-r):y}if(n.length===0)return r;const c=t.valueOf();let h;l?h=((0,mp.findMinIndex)(0,s.length-1,y=>s[y].valueOf()<=c)??s.length)-1:h=(0,mp.findMaxIndex)(0,s.length-1,y=>s[y].valueOf()<=c)??0,h=Math.min(Math.max(h,0),s.length-2);const u=s[h].valueOf(),d=s[h+1].valueOf(),p=(c-u)/(d-u);return(h+p)/(s.length-1)*(o-r)+r}invert(t,i=!1){this.refresh();const{domain:s,bands:n}=this,r=s[0].valueOf()>s[s.length-1].valueOf();let o;return i?o=this.invertNearestIndex(t-this.bandwidth/2):o=(0,mp.findMinIndex)(0,n.length-1,l=>this.ordinalRange(l)>=t)??0,n[r?n.length-1-o:o]}tickFormatter({domain:t,ticks:i,specifier:s},n){return s!=null?_a(s):vp(i,t,n)}},Sp=(O(),N(T)),Ba={bottomCenter:KC,center:$C,clone:QC,collides:JC,end:HC,from:ew,height:XC,round:qC,start:WC,topCenter:YC,origin:tw,width:ZC};function WC(e){return{x:e.x1,y:e.y1}}function HC(e){return{x:e.x2,y:e.y2}}function YC(e){return{x:(e.x1+e.x2)/2,y:Math.min(e.y1,e.y2)}}function $C(e){return{x:(e.x1+e.x2)/2,y:(e.y1+e.y2)/2}}function KC(e){return{x:(e.x1+e.x2)/2,y:Math.max(e.y1,e.y2)}}function ZC(e){return Math.abs(e.x2-e.x1)}function XC(e){return Math.abs(e.y2-e.y1)}function qC(e){return{x1:Math.round(e.x1),y1:Math.round(e.y1),x2:Math.round(e.x2),y2:Math.round(e.y2)}}function QC(e){return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}function JC(e,t){const i=Dp(e),s=Dp(t);return i.x1<=s.x2&&i.x2>=s.x1&&i.y1<=s.y2&&i.y2>=s.y1}function Dp(e){return{x1:Math.min(e.x1,e.x2),x2:Math.max(e.x1,e.x2),y1:Math.min(e.y1,e.y2),y2:Math.max(e.y1,e.y2)}}function ew(e,t,i,s){if(typeof e=="number")return{x1:e,y1:t,x2:i,y2:s};if("width"in e)return Dp({x1:e.x,y1:e.y,x2:e.x+e.width,y2:e.y+e.height});throw new Error(`Values can not be converted into a vector4: [${JSON.stringify(e)}] [${t}] [${i}] [${s}]`)}function tw(){return{x1:0,y1:0,x2:0,y2:0}}function nh(e,t,i,s,n){return t+(s-t)*((n-e)/(i-e))}function x0(e,t,i,s,n){return e+(n-t)*((i-e)/(s-t))}function v0(e,t,i){return[x0(e,i.min,t,i.max,0),x0(e,i.min,t,i.max,1)]}function iw(e,t,i){const[s,n]=v0(e.x1,e.x2,t),[r,o]=v0(e.y1,e.y2,i);return{x1:s,x2:n,y1:r,y2:o}}function M0(e,t,i,s,n,r){if(i<=n&&r<=s)return i;const o=n-i,a=r-s,l=Math.abs(o)<Math.abs(a)?o:a;return(0,Sp.clamp)(e,i+l,t)}function sw(e,t,i){const{x:s={min:0,max:1},y:n={min:0,max:1}}=t,r=Ba.from(i),o=Ba.from(e),a=iw(o,s,n),l=M0(a.x1,a.x2,o.x1,o.x2,r.x1,r.x2),c=M0(a.y1,a.y2,o.y1,o.y2,r.y1,r.y2),h={x:{min:nh(o.x1,s.min,o.x2,s.max,l),max:nh(o.x1,s.min,o.x2,s.max,l+e.width)},y:{min:nh(o.y1,n.min,o.y2,n.max,c),max:nh(o.y1,n.min,o.y2,n.max,c+e.height)}},u=h.x.max-h.x.min,d=h.y.max-h.y.min;return h.x.min=(0,Sp.clamp)(0,h.x.min,1-u),h.x.max=h.x.min+u,h.y.min=(0,Sp.clamp)(0,h.y.min,1-d),h.y.max=h.y.min+d,h}var nw=["rangeX","rangeY","ratioX","ratioY","autoScaledAxes"],rw=class{constructor(){this.enabled=!1,this.padding=0,this.manuallyAdjusted=!1}},S0=e=>(0,ve.attachDescription)((t,{options:i})=>!Fe.is(e?.scale)&&!rs.is(e?.scale)||t==null||i.end==null?!0:t<=i.end,"to be less than end"),D0=class extends Ws{constructor(e,t){super(),this.fireChartEvent=e,this.mementoOriginatorKey="zoom",this.axisZoomManagers=new Map,this.state=new fo(void 0,"initial"),this.axes=[],this.didLayoutAxes=!1,this.autoScaleYAxis=new rw,this.lastRestoredState=void 0,this.independentAxes=!1,this.navigatorModule=!1,this.zoomModule=!1,this.pendingMemento=void 0,this.destroyFns.push(t.addListener("layout:complete",()=>{const{pendingMemento:i}=this,s=!this.didLayoutAxes;this.didLayoutAxes=!0,i?this.restoreMemento(i.version,i.mementoVersion,i.memento):s&&this.autoScaleYZoom("zoom-manager")}))}createMemento(){return this.getMementoRanges()}guardMemento(e,t){if(e==null)return!0;if(!(0,ve.isObject)(e))return!1;for(const o of Object.keys(e))if(!nw.includes(o))return!1;const i=this.getPrimaryAxis("x"),s=this.getPrimaryAxis("y"),n={rangeX:{start:(0,ve.and)((0,ve.or)(ve.number,ve.date),S0(i)),end:(0,ve.or)(ve.number,ve.date)},rangeY:{start:(0,ve.and)((0,ve.or)(ve.number,ve.date),S0(s)),end:(0,ve.or)(ve.number,ve.date)},ratioX:{start:(0,ve.and)(ve.ratio,(0,ve.lessThan)("end")),end:ve.ratio},ratioY:{start:(0,ve.and)(ve.ratio,(0,ve.lessThan)("end")),end:ve.ratio},autoScaledAxes:(0,ve.arrayOf)((0,ve.union)("y"))},{invalid:r}=(0,ve.validate)(e,n);return r.length>0?(t.push(...r.map(String)),!1):!0}restoreMemento(e,t,i){const{independentAxes:s}=this;if(!this.axes||!this.didLayoutAxes){this.pendingMemento={version:e,mementoVersion:t,memento:i};return}this.pendingMemento=void 0;const n=this.getDefinedZoom();if(i?.rangeX?n.x=this.rangeToRatio(i.rangeX,"x")??{min:0,max:1}:i?.ratioX?n.x={min:i.ratioX.start??0,max:i.ratioX.end??1}:n.x={min:0,max:1},!this.navigatorModule||this.zoomModule){let a=i?.autoScaledAxes?.includes("y");i?.rangeY?(n.y=this.rangeToRatio(i.rangeY,"y")??{min:0,max:1},a??(a=!1)):i?.ratioY?(n.y={min:i.ratioY.start??0,max:i.ratioY.end??1},a??(a=!1)):(n.y={min:0,max:1},a??(a=!0)),n.autoScaleYAxis=a}if(this.lastRestoredState=n,s!==!0){this.updateZoom("zoom-manager",n);return}const r=this.getPrimaryAxis("x"),o=this.getPrimaryAxis("y");for(const a of[r,o])a&&this.updateAxisZoom("zoom-manager",a.id,n[a.direction])}updateAxes(e){this.axes=e;const t=new Map(e.map(i=>[i.id,this.axisZoomManagers.get(i.id)]));this.axisZoomManagers.clear();for(const i of e)this.axisZoomManagers.set(i.id,t.get(i.id)??new ow(i));this.state.size>0&&e.length>0&&this.updateZoom(this.state.stateId(),this.state.stateValue())}setIndependentAxes(e=!0){this.independentAxes=e}setAutoScaleYAxis(e,t){this.autoScaleYAxis.enabled=e,this.autoScaleYAxis.padding=t}setNavigatorEnabled(e=!0){this.navigatorModule=e}setZoomModuleEnabled(e=!0){this.zoomModule=e}isNavigatorEnabled(){return this.navigatorModule}isZoomEnabled(){return this.zoomModule}updateZoom(e,t){if(t?.x&&(t.x.min<0||t.x.max>1)&&(ve.Logger.warnOnce(`Attempted to update x-axis zoom to an invalid ratio of [{ min: ${t.x.min}, max: ${t.x.max} }], expecting a ratio of 0 to 1, ignoring.`),t.x=void 0),t?.y&&(t.y.min<0||t.y.max>1)&&(ve.Logger.warnOnce(`Attempted to update y-axis zoom to an invalid ratio of [{ min: ${t.y.min}, max: ${t.y.max} }], expecting a ratio of 0 to 1, ignoring.`),t.y=void 0),this.axisZoomManagers.size===0){const s=this.state.stateId();(s==="initial"||s===e)&&this.state.set(e,t);return}this.state.set(e,t);const i=t?.autoScaleYAxis;i!=null&&(this.autoScaleYAxis.manuallyAdjusted=!i),this.axisZoomManagers.forEach(s=>{s.updateZoom(e,t?.[s.getDirection()])}),this.applyChanges(e)}updateAxisZoom(e,t,i){this.axisZoomManagers.get(t)?.updateZoom(e,i),this.applyChanges(e)}resetZoom(e){this.autoScaleYAxis.manuallyAdjusted=!1;const t=this.getRestoredZoom();this.updateZoom(e,{x:{min:t?.x?.min??0,max:t?.x?.max??1},y:{min:t?.y?.min??0,max:t?.y?.max??1},autoScaleYAxis:t?.autoScaleYAxis??!0})}resetAxisZoom(e,t){const s=this.axisZoomManagers.get(t)?.getDirection();if(s==null)return;const n=this.getRestoredZoom();if(s==="y"){const r=n?.autoScaleYAxis??!0;this.autoScaleYAxis.manuallyAdjusted=!r}for(const r of this.axes)r.direction===s&&this.updateAxisZoom(e,r.id,n?.[s]??{min:0,max:1})}setAxisManuallyAdjusted(e,t){this.axisZoomManagers.get(t)?.getDirection()==="y"&&(this.autoScaleYAxis.manuallyAdjusted=!0)}updatePrimaryAxisZoom(e,t,i){const s=this.getPrimaryAxis(t);s&&this.updateAxisZoom(e,s.id,i)}panToBBox(e,t,i){if(!this.isZoomEnabled()&&!this.isNavigatorEnabled())return!1;const s=this.getZoom();if(s===void 0||!s.x&&!s.y)return!1;if(!(t.width>0&&t.height>0&&Math.abs(i.width)<=Math.abs(t.width)&&Math.abs(i.height)<=Math.abs(t.height)))return ve.Logger.warnOnce("cannot pan to target BBox - chart too small?"),!1;const r=sw(t,s,i);return this.independentAxes?(this.updatePrimaryAxisZoom(e,"x",r.x),this.updatePrimaryAxisZoom(e,"y",r.y)):this.updateZoom(e,r),!0}fireZoomPanStartEvent(e){this.listeners.dispatch("zoom-pan-start",{type:"zoom-pan-start",callerId:e})}extendToEnd(e,t,i){return this.extendWith(e,t,s=>Number(s)-i)}extendWith(e,t,i){const s=this.getPrimaryAxis(t);if(!s)return;const n=this.getDomainExtents(s);if(!n)return;const[,r]=n,o=i(r),a=this.rangeToRatio({start:o,end:r},t);a&&this.updateZoom(e,{[t]:a})}updateWith(e,t,i){const s=this.getPrimaryAxis(t);if(!s)return;const n=this.getDomainExtents(s);if(!n)return;let[r,o]=n;[r,o]=i(r,o);const a=this.rangeToRatio({start:r,end:o},t);a&&this.updateZoom(e,{[t]:a})}getZoom(){let e,t;if(this.axisZoomManagers.forEach(i=>{i.getDirection()==="x"?e??(e=i.getZoom()):i.getDirection()==="y"&&(t??(t=i.getZoom()))}),e||t)return{x:e,y:t}}getAxisZoom(e){return this.axisZoomManagers.get(e)?.getZoom()??{min:0,max:1}}getAxisZooms(){const e={};for(const[t,i]of this.axisZoomManagers.entries())e[t]={direction:i.getDirection(),zoom:i.getZoom()};return e}getRestoredZoom(){return this.lastRestoredState}getPrimaryAxisId(e){return this.getPrimaryAxis(e)?.id}isVisibleItemsCountAtLeast(e,t){const i=this.getPrimaryAxis("x"),s=this.getPrimaryAxis("y"),n=new Set;let r=0;const o=[e.x.min,e.x.max],a=[e.y.min,e.y.max];for(const l of i?.boundSeries??[]){n.add(l.id);const c=t-(r??0),h=l.getVisibleItems(o,a,c);if(r+=h,r>=t)return!0}for(const l of s?.boundSeries??[]){if(n.has(l.id))continue;const c=t-(r??0),h=l.getVisibleItems(o,a,c);if(r+=h,r>=t)return!0}return n.size===0}getMementoRanges(){const e=this.getDefinedZoom();let t;return this.autoScaleYAxis.enabled&&(t=this.autoScaleYAxis.manuallyAdjusted?[]:["y"]),{rangeX:this.getRangeDirection(e.x,"x"),rangeY:this.getRangeDirection(e.y,"y"),ratioX:{start:e.x.min,end:e.x.max},ratioY:{start:e.y.min,end:e.y.max},autoScaledAxes:t}}autoScaleYZoom(e,t=!0){if(!this.isZoomEnabled())return;const{independentAxes:i,autoScaleYAxis:s}=this,n=this.getZoom();if(n?.x==null||!s.enabled||s.manuallyAdjusted)return;const{padding:r}=s;let o;if(n.x?.min===0&&n.x?.max===1?o={min:0,max:1}:i?o=this.primaryAxisZoom("y",n.x,{padding:r}):o=this.combinedAxisZoom("y",n.x,{padding:r}),o!=null){if(i){const a=this.getPrimaryAxis("y");(a==null?void 0:this.axisZoomManagers.get(a.id))?.updateZoom("zoom-manager",o)}else for(const a of this.axisZoomManagers.values())a.getDirection()==="y"&&a.updateZoom("zoom-manager",o);t&&this.applyChanges(e)}}applyChanges(e){if(this.autoScaleYZoom(e,!1),!Array.from(this.axisZoomManagers.values(),s=>s.applyChanges()).includes(!0))return;const i={};for(const[s,n]of this.axisZoomManagers.entries())i[s]=n.getZoom();this.listeners.dispatch("zoom-change",{type:"zoom-change",...this.getZoom(),axes:i,callerId:e}),this.fireChartEvent({type:"zoom",...this.getMementoRanges()})}getRangeDirection(e,t){const i=this.getPrimaryAxis(t);if(!i||!Fe.is(i.scale)&&!rs.is(i.scale))return;const s=this.getDomainPixelExtents(i);if(!s)return;const[n,r]=s;let o,a;return n<=r?(o=i.scale.invert(0),a=i.scale.invert(n+(r-n)*e.max)):(o=i.scale.invert(n-(n-r)*e.min),a=i.scale.invert(0)),{start:o,end:a}}rangeToRatio(e,t){const i=this.getPrimaryAxis(t);if(!i)return;const s=this.getDomainPixelExtents(i);if(!s)return;const[n,r]=s;let o=e.start==null?n:i.scale.convert?.(e.start),a=e.end==null?r:i.scale.convert?.(e.end);if(!(0,ve.isFiniteNumber)(o)||!(0,ve.isFiniteNumber)(a))return;const[l,c]=[Math.min(n,r),Math.max(n,r)];if(o<l||o>c){ve.Logger.warnOnce(`Invalid range start [${e.start}], expecting a value between [${i.scale.invert?.(n)}] and [${i.scale.invert?.(r)}], ignoring.`);return}if(a<l||a>c){ve.Logger.warnOnce(`Invalid range end [${e.end}], expecting a value between [${i.scale.invert?.(n)}] and [${i.scale.invert?.(r)}], ignoring.`);return}o=Math.min(c,Math.max(l,o)),a=Math.min(c,Math.max(l,a));const h=r-n,u=Math.abs((o-n)/h),d=Math.abs((a-n)/h);return{min:u,max:d}}getPrimaryAxis(e){return this.axes?.find(t=>t.direction===e)}getDomainExtents(e){const{domain:t}=e.scale,i=t.at(0),s=t.at(-1);if(!(i==null||s==null))return[i,s]}getDomainPixelExtents(e){const{domain:t}=e.scale,i=e.scale.convert?.(t.at(0)),s=e.scale.convert?.(t.at(-1));if(!(!(0,ve.isFiniteNumber)(i)||!(0,ve.isFiniteNumber)(s)))return[i,s]}getDefinedZoom(){const e=this.getZoom();return{x:{min:e?.x?.min??0,max:e?.x?.max??1},y:{min:e?.y?.min??0,max:e?.y?.max??1}}}zoomBounds(e,t,i,s){const n=e.scale,r=n.range;n.range=[0,1];const o=t.scale,a=o.range;o.range=[0,1];let l=1,c=!1,h=0,u=!1;for(const f of t.boundSeries){const{connectsToYAxis:y}=f,b=f.getRange("y",[i.min,i.max]);for(const m of b){const v=o.convert(m);Number.isFinite(v)&&(v<l&&(l=v,c=!y||m<0),v>h&&(h=v,u=!y||m>0))}}if((0,ve.isFiniteNumber)(t.min)&&(l=0),(0,ve.isFiniteNumber)(t.max)&&(h=1),n.range=r,o.range=a,l>=h)return;const d=(c?s:0)+(u?s:0),p=Math.min((h-l)*(1+d),1);if(!(p<=0)){if(c&&u){const f=(h+l)/2;l=f-p/2,h=f+p/2}else!c&&u?h=l+p:c&&!u&&(l=h-p);return l<0?(h+=-l,l=0):h>1&&(l-=h-1,h=1),{min:l,max:h}}}primaryAxisZoom(e,t,{padding:i=0}={}){const s=e==="x"?"y":"x",n=this.getPrimaryAxis(s),r=this.getPrimaryAxis(e);if(!(n==null||r==null))return this.zoomBounds(n,r,t,i)}combinedAxisZoom(e,t,{padding:i=0}={}){const s=e==="x"?"y":"x",n=new Map;for(const l of this.axes)if(l.direction===s)for(const c of l.boundSeries)n.set(c,l);let r=1,o=0;for(const l of this.axes)if(l.direction===e)for(const c of l.boundSeries){const h=n.get(c);if(h==null)continue;const u=this.zoomBounds(h,l,t,i);if(u==null)return;r=Math.min(r,u.min),o=Math.max(o,u.max)}const a=1e-6;if(r<a&&(r=0),o>1-a&&(o=1),!(r>o))return{min:r,max:o}}},ow=class{constructor(e){this.axis=e;const[t=0,i=1]=e.visibleRange;this.state=new fo({min:t,max:i}),this.currentZoom=this.state.stateValue()}getDirection(){return this.axis.direction}updateZoom(e,t){this.state.set(e,t)}getZoom(){return Ve(this.state.stateValue())}hasChanges(){const e=this.currentZoom,t=this.state.stateValue();return e.min!==t.min||e.max!==t.max}applyChanges(){const e=this.hasChanges();return this.currentZoom=this.state.stateValue(),e}};function aw(e,t,i,s,n,r){if(e.size===0)return!1;let o=e.x,a=e.y;t!=null&&(o-=(t.x-.5)*e.size,a-=(t.y-.5)*e.size);let l=o;o<i?l=i:o>i+n&&(l=i+n);let c=a;a<s?c=s:a>s+r&&(c=s+r);const h=o-l,u=a-c;return Math.sqrt(h*h+u*u)<=e.size*.5}function I0(e,t,i,s,n){const r=e.x+e.width>t&&e.x<t+s,o=e.y+e.height>i&&e.y<i+n;return r&&o}function lw(e,t,i,s,n){return t+s<e.x+e.width&&t>e.x&&i>e.y&&i+n<e.y+e.height}function cw(e){return e!=null&&typeof e.point=="object"&&typeof e.label=="object"}var hw={top:{x:0,y:-1},bottom:{x:0,y:1},left:{x:-1,y:0},right:{x:1,y:0},"top-left":{x:-1,y:-1},"top-right":{x:1,y:-1},"bottom-left":{x:-1,y:1},"bottom-right":{x:1,y:1}};function uw(e,t,i=5){const s=new Map,n=[],r=new Map([...e.entries()].map(([a,l])=>[a,l.toSorted((c,h)=>h.point.size-c.point.size)])),o=[...r.values()].flat();for(const[a,l]of r.entries()){const c=[];if(l[0]?.label){for(let h=0,u=l.length;h<u;h++){const d=l[h],{point:p,label:f,anchor:y}=d,{text:b,width:m,height:v}=f,M=p.size*.5;let S=0,D=0;if(M>0&&d.placement!=null){const G=hw[d.placement];S=(m*.5+M+i)*G.x,D=(v*.5+M+i)*G.y}const C=p.x-m*.5+S-((y?.x??.5)-.5)*p.size,k=p.y-v*.5+D-((y?.y??.5)-.5)*p.size;if(!(!t||lw(t,C,k,m,v))||o.some(G=>aw(G.point,G.anchor,C,k,m,v))||n.some(G=>I0(G,C,k,m,v)))continue;const R={index:h,text:b,x:C,y:k,width:m,height:v,datum:d};c.push(R),n.push(R)}s.set(a,c)}}return s}function A0(e,t=0){const i=[];for(let s=0;s<e.length;s++){const n=e[s],{point:{x:r,y:o},label:{text:a}}=n;let{width:l,height:c}=n.label;if(l+=t,c+=t,i.some(h=>I0(h,r,o,l,c)))return!0;i.push({index:s,text:a,x:r,y:o,width:l,height:c,datum:n})}return!1}var dw=class{constructor(){this.labelData=new Map}updateLabels(e,t,i=U.zero){const s={x:-t.left,y:-t.top,width:i.width+t.left+t.right,height:i.height+t.top+t.bottom},n=new Set(e.map(o=>o.id));for(const o of this.labelData.keys())n.has(o)||this.labelData.delete(o);for(const o of e){const a=o.getLabelData();a.every(cw)&&this.labelData.set(o.id,a)}const r=uw(this.labelData,s,5);for(const o of e)o.updatePlacedLabelData?.(r.get(o.id)??[])}},L0=(O(),N(T)),pw=class extends Ws{constructor(){super(...arguments),this.mementoOriginatorKey="legend",this.legendDataMap=new Map}createMemento(){return this.getData().filter(({hideInLegend:e,isFixed:t})=>!e&&!t).map(({enabled:e,seriesId:t,itemId:i,legendItemName:s})=>({visible:e,seriesId:t,itemId:i,legendItemName:s}))}guardMemento(e){return e==null||(0,L0.isArray)(e)}restoreMemento(e,t,i){i?.forEach(s=>{const{seriesId:n,data:r}=this.getRestoredData(s)??{};!n||!r||this.updateData(n,r)}),this.update()}getRestoredData(e){const{seriesId:t,itemId:i,legendItemName:s,visible:n}=e;if(t){const o=(this.legendDataMap.get(t)??[]).map(a=>{const l=a.seriesId===t&&(!i||a.itemId===i);return l&&a.isFixed&&this.warnFixed(a.seriesId,a.itemId),!a.isFixed&&l?{...a,enabled:n}:a});return{seriesId:t,data:o}}if(!(i==null&&s==null))for(const r of this.getData()){if(i!=null&&r.itemId!==i||s!=null&&r.legendItemName!==s)continue;if(r.isFixed){this.warnFixed(r.seriesId,i);return}const o=(this.legendDataMap.get(r.seriesId)??[]).map(a=>a.itemId===i||a.legendItemName===s?{...a,enabled:n}:a);return{seriesId:r.seriesId,data:o}}}warnFixed(e,t){L0.Logger.warnOnce(`The legend item with seriesId [${e}] and itemId [${t}] is not configurable, this series item cannot be toggled through the legend.`)}update(e){this.listeners.dispatch("legend-change",{type:"legend-change",legendData:e??this.getData()})}updateData(e,t=[]){this.legendDataMap.set(e,t)}clearData(){this.legendDataMap.clear()}toggleItem(e,t,i,s){if(s){this.getData().forEach(a=>{const l=(this.legendDataMap.get(a.seriesId)??[]).map(c=>c.legendItemName===s?{...c,enabled:e}:c);this.updateData(a.seriesId,l)});return}const n=this.getData(t),r=n.length===1,o=n.map(a=>i==null&&r||a.itemId===i?{...a,enabled:e}:a);this.updateData(t,o)}getData(e){return e?this.legendDataMap.get(e)??[]:[...this.legendDataMap].reduce((t,[i,s])=>t.concat(s),[])}getDatum({seriesId:e,itemId:t}={}){return this.getData(e).find(i=>i.itemId===t)}getSeriesEnabled(e){const t=this.getData(e);if(t.length>0)return t.some(i=>i.enabled)}getItemEnabled({seriesId:e,itemId:t}={}){return this.getDatum({seriesId:e,itemId:t})?.enabled??!0}},gw=class{constructor(){this.groups={}}registerSeries({internalId:e,seriesGrouping:t,visible:i,type:s}){var n;t&&((n=this.groups)[s]??(n[s]={}),this.groups[s][e]={grouping:t,visible:i})}updateSeries({internalId:e,seriesGrouping:t,visible:i,type:s}){if(!t)return;const n=this.groups[s]?.[e];n&&(n.grouping=t,n.visible=i)}deregisterSeries({internalId:e,type:t}){this.groups[t]&&delete this.groups[t][e],this.groups[t]&&Object.keys(this.groups[t]).length===0&&delete this.groups[t]}getVisiblePeerGroupIndex({type:e,seriesGrouping:t,visible:i}){if(!t)return{visibleGroupCount:i?1:0,visibleSameStackCount:i?1:0,index:0};const s=new Set,n=new Set;for(const o of Object.values(this.groups[e]??{}))o.visible&&(s.add(o.grouping.groupIndex),o.grouping.groupIndex===t.groupIndex&&n.add(o.grouping.stackIndex));const r=Array.from(s);return r.sort((o,a)=>o-a),{visibleGroupCount:r.length,visibleSameStackCount:n.size,index:r.indexOf(t.groupIndex)}}},fw=(O(),N(T)),k0=class{constructor(e){this.updateCallback=e,this.events=new fw.EventEmitter}addListener(e,t){return this.events.on(e,t)}removeListener(e,t){return this.events.on(e,t)}destroy(){this.events.clear()}update(e=0,t){this.updateCallback(e,t)}dispatchUpdateComplete(e){this.events.emit("update-complete",{type:"update-complete",apiUpdate:e})}dispatchPreDomUpdate(){this.events.emit("pre-dom-update",{type:"pre-dom-update"})}dispatchPreSceneRender(){this.events.emit("pre-scene-render",{type:"pre-scene-render"})}dispatchProcessData({series:e}){this.events.emit("process-data",{type:"process-data",series:e})}},mw=class{constructor(e,t){this.callbackCache=new _b,this.chartEventManager=new Zb,this.highlightManager=new Qb,this.layoutManager=new lb,this.localeManager=new Ik,this.seriesStateManager=new gw,this.stateManager=new tk,this.seriesLabelLayoutManager=new dw,this.destroyFns=[],this.contextModules=[];const{scene:i,root:s,syncManager:n,container:r,fireEvent:o,updateCallback:a,updateMutex:l,styleContainer:c,chartType:h,domMode:u}=t;this.chartService=e,this.syncManager=n,this.domManager=new vb(this.chartService,r,c,u),this.widgets=new eC(this.domManager);const d=this.domManager.addChild("canvas","scene-canvas",i?.canvas.element);this.scene=i??new Zc({canvasElement:d}),this.scene.setRoot(s),this.destroyFns.push(this.scene.on("scene-changed",()=>{this.updateService.update(7)})),this.axisManager=new Bk(s),this.legendManager=new pw,this.annotationManager=new zk(e.annotationRoot,o),this.chartTypeOriginator=new JL(e),this.interactionManager=new Yb,this.contextMenuRegistry=new qb,this.updateService=new k0(a),this.proxyInteractionService=new Tb(this.localeManager,this.domManager),this.fontManager=new Gk(this.domManager,this.updateService),this.historyManager=new ek(this.chartEventManager),this.animationManager=new Kb(this.interactionManager,l),this.dataService=new Qc(this.animationManager),this.tooltipManager=new ih(this.localeManager,this.domManager,e.tooltip),this.zoomManager=new D0(o,this.layoutManager);for(const p of Ms.byType("context")){if(!p.chartTypes.includes(h))continue;const f=p.moduleFactory(this);this.contextModules.push(f),this[p.contextKey]=f}}destroy(){this.animationManager.destroy(),this.highlightManager.destroy(),this.axisManager.destroy(),this.callbackCache.invalidateCache(),this.chartEventManager.destroy(),this.domManager.destroy(),this.fontManager.destroy(),this.highlightManager.destroy(),this.proxyInteractionService.destroy(),this.syncManager.destroy(),this.tooltipManager.destroy(),this.zoomManager.destroy(),this.widgets.destroy(),this.contextModules.forEach(e=>e.destroy()),this.destroyFns.forEach(e=>e())}},C0=class extends le{constructor(){super(...arguments),this.range="tooltip"}};g([x],C0.prototype,"range",2);var w0=(O(),N(T));function yw(e,t){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}function bw(e,t){if(e==null||t==null)return e===t;if(e.size!==t.size)return!1;for(const[i,s]of e){const n=t.get(i);if(n==null||!yw(s,n))return!1}return!0}function xw(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i+=1){const{type:s,idsMap:n,scopes:r,data:o,...a}=e[i],{type:l,idsMap:c,scopes:h,data:u,...d}=t[i];if(s!==l||r&&h&&!(0,w0.arraysEqual)(r,h)||o&&u&&o!==u||!ii(a,d)||!bw(n,c))return!1}return!0}function vw(e,t){const{props:i,...s}=e,{props:n,...r}=t;return ii(s,r)&&xw(i,n)}function Mw(e,t,i,s){return t===e.data&&(0,w0.arraysEqual)(i,e.ids)&&vw(s,e.opts)}var T0=(O(),N(T)),Bt=(O(),N(T)),N0=class rD{constructor(){this.domain=new Set}static is(t){return t instanceof rD}extend(t){this.domain.add(t)}getDomain(){return Array.from(this.domain)}},An=class oD{constructor(){this.domain=[1/0,-1/0]}static is(t){return t instanceof oD}static extendDomain(t,i=[1/0,-1/0]){for(const s of t)typeof s=="number"&&(i[0]>s&&(i[0]=s),i[1]<s&&(i[1]=s));return i}extend(t){this.domain[0]>t&&(this.domain[0]=t),this.domain[1]<t&&(this.domain[1]=t)}getDomain(){return[...this.domain]}},Io=0,Ao=1,Cs=2,Sw=class{constructor(e){const t=e.reduce((r,o)=>Math.max(r,o.length),0);let s=1<<32-Math.clz32(t);t===s/2&&(s=s>>>1),this.maxLevelSize=s;const n=new Float64Array((s*2-1)*2).fill(NaN);for(const r of e)for(let o=0;o<r.length;o+=1){const a=Number(r[o]),l=s+o-1,c=(l*Cs|0)+Io,h=(l*Cs|0)+Ao,u=n[c],d=n[h];(!Number.isFinite(u)||a<u)&&(n[c]=a),(!Number.isFinite(d)||a>d)&&(n[h]=a)}for(let r=s/2|0;r>=1;r=r/2|0){const o=r-1|0,a=o+r|0;for(let l=0;l<r;l+=1){const c=o+l,h=a+l*2,u=h+1,d=n[(h*Cs|0)+Io],p=n[(u*Cs|0)+Io];n[(c*Cs|0)+Io]=!Number.isFinite(p)||d<p?d:p;const f=n[(h*Cs|0)+Ao],y=n[(u*Cs|0)+Ao];n[(c*Cs|0)+Ao]=!Number.isFinite(y)||f>y?f:y}}this.buffer=n}computeRangeInto(e,t,i,s,n,r,o){const a=n+r-1;if(a<t||n>=i)return o;if(n>=t&&a<i){const l=e[(s*Cs|0)+Io],c=e[(s*Cs|0)+Ao];Number.isFinite(l)&&(o[0]=Math.min(o[0],l)),Number.isFinite(c)&&(o[1]=Math.max(o[1],c))}else r>1&&(s=s*2|0,r=r/2|0,this.computeRangeInto(e,t,i,s+1|0,n,r,o),this.computeRangeInto(e,t,i,s+2|0,n+r,r,o));return o}rangeBetween(e,t){if(e>t)return[NaN,NaN];const{maxLevelSize:i,buffer:s}=this,n=[1/0,-1/0];return this.computeRangeInto(s,e,t,0,0,i,n),n}get range(){const{buffer:e}=this;return[e[Io],e[Ao]]}},O0=Symbol("domain-ranges");function Dw(e){return e.map(t=>(0,Bt.isObject)(t)?JSON.stringify(t):t).join("-")}function di(e){const t=e?.map(Number);return t?.every(Number.isFinite)?t:[]}function Ip(e,t){return t?.get(e.id)??0}function Iw(e){return"scopes"in e&&Array.isArray(e.scopes)}function Ap(e,t){const i=[];for(let s=0;s<e;s+=1)i[s]=t;return i}function rh(e,t,i){const s=[];for(const n of e){const r=n.get(t)?.[i];if(r==null)return;s.push(r)}return s}function E0(e){const t=[];let i=0,s;const n=/((?:(?:^|\.)\s*\w+|\[\s*(?:'(?:[^']|(?<!\\)\\')*'|"(?:[^"]|(?<!\\)\\")*"|-?\d+)\s*\])\s*)/g;for(;s=n.exec(e);){if(s.index!==i)return;i=s.index+s[0].length;const r=s[1].trim();if(r.startsWith("."))t.push(r.slice(1).trim());else if(r.startsWith("[")){const o=r.slice(1,-1).trim();o.startsWith("'")?t.push(o.slice(1,-1).replace(/(?<!\\)\\'/g,"'")):o.startsWith('"')?t.push(o.slice(1,-1).replace(/(?<!\\)\\"/g,'"')):t.push(o)}else t.push(r)}if(i===e.length)return t}function Aw(e){return t=>{let i=t;for(const s of e)i=i[s];return i}}var P0=class{constructor(e,t="standalone",i=!1){this.opts=e,this.mode=t,this.suppressFieldDotNotation=i,this.debug=ke.create(!0,"data-model"),this.scopeCache=new Map,this.keys=[],this.values=[],this.aggregates=[],this.groupProcessors=[],this.propertyProcessors=[],this.reducers=[],this.processors=[],this.markScopeDatumInvalid=function(a,l,c,h){for(const u of a)h.has(u)||h.set(u,Ap(l.length,!1)),h.get(u)[c]=!0};let s=!0;for(const a of e.props){if(a.type==="key"&&!s)throw new Error("AG Charts - internal config error: keys must come before values.");a.type==="value"&&s&&(s=!1)}const n=({matchGroupIds:a=[]})=>{for(const l of a)if(this.values.every(c=>c.groupId!==l))throw new Error(`AG Charts - internal config error: matchGroupIds properties must match defined groups (${l}).`)},r=new Set,o=new Set;for(const a of e.props){const l=a.type==="key"?r:o;switch(Iw(a)&&a.scopes?.forEach(c=>l.add(c)),a.type){case"key":this.keys.push({...a,index:this.keys.length,missing:new Map});break;case"value":if(a.property==null)throw new Error(`AG Charts - internal config error: no properties specified for value definitions: ${JSON.stringify(a)}`);this.values.push({...a,index:this.values.length,missing:new Map});break;case"aggregate":n(a),this.aggregates.push({...a,index:this.aggregates.length});break;case"group-value-processor":n(a),this.groupProcessors.push({...a,index:this.groupProcessors.length});break;case"property-value-processor":this.propertyProcessors.push({...a,index:this.propertyProcessors.length});break;case"reducer":this.reducers.push({...a,index:this.reducers.length});break;case"processor":this.processors.push({...a,index:this.processors.length});break}}if(this.opts.groupByKeys||this.opts.groupByFn!=null){const a=new Set(o.values());if(r.forEach(l=>a.delete(l)),a.size>0)throw new Error(`AG Charts - scopes missing key for grouping, illegal configuration: ${[...a.values()]}`)}}resolveProcessedDataDefById(e,t){const i=this.scopeCache.get(e.id)?.get(t);if(!i)throw new Error(`AG Charts - didn't find property definition for [${t}, ${e.id}]`);return{index:i.index,def:i}}resolveProcessedDataIndexById(e,t){return this.resolveProcessedDataDefById(e,t).index}resolveKeysById(e,t,i){const s=this.resolveProcessedDataIndexById(e,t),n=i.keys[s];if(n==null)throw new Error(`AG Charts - didn't find keys for [${t}, ${e.id}]`);return n.get(e.id)}hasColumnById(e,t){return this.scopeCache.get(e.id)?.get(t)!=null}resolveColumnById(e,t,i){const s=this.resolveProcessedDataIndexById(e,t),n=i.columns?.[s];if(n==null)throw new Error(`AG Charts - didn't find column for [${t}, ${e.id}]`);return n}*forEachDatum(e,t,i){const s=t.columnScopes.findIndex(n=>n.has(e.id));for(const n of i.datumIndices[s]??[])yield t.columns[s][n]}*forEachGroupDatum(e,t){const i=t.columnScopes.findIndex(r=>r.has(e.id)),s={groupIndex:0,columnIndex:i},n=[];for(const r of t.groups){s.group=r;let o=0;for(const a of r.datumIndices[i]??n)s.datumIndex=a,s.valueIndex=o++,yield s;s.groupIndex++}}*forEachGroupDatumTuple(e,t){const s={columnIndex:t.columnScopes.findIndex(n=>n.has(e.id)),datumIndexes:[void 0,void 0,void 0]};for(const n of this.forEachGroupDatum(e,t))s.group=s.nextGroup,s.groupIndex=s.nextGroupIndex,s.nextGroup=n.group,s.nextGroupIndex=n.groupIndex,s.datumIndexes[0]=s.datumIndexes[1],s.datumIndexes[1]=s.datumIndexes[2],s.datumIndexes[2]=n.datumIndex,s.group!=null&&s.datumIndexes[1]!=null&&(yield s);s.group=s.nextGroup,s.groupIndex=s.nextGroupIndex,s.nextGroup=void 0,s.nextGroupIndex=void 0,s.datumIndexes[0]=s.datumIndexes[1],s.datumIndexes[1]=s.datumIndexes[2],s.datumIndexes[2]=void 0,s.group!=null&&s.datumIndexes[1]!=null&&(yield s)}getDomain(e,t,i,s){return this.getDomainsByType(i??"value",s)?.[this.resolveProcessedDataIndexById(e,t)]??[]}getDomainBetweenRange(e,t,[i,s],n){const r=t.map(c=>this.resolveProcessedDataIndexById(e,c)),o=r.join(":"),a=n[O0];let l=a.get(o);if(l==null){const c=r.map(h=>n.columns[h]);l=new Sw(c),a.set(o,l)}return l.rangeBetween(i,s)}getDomainsByType(e,t){switch(e){case"key":return t.domain.keys;case"value":return t.domain.values;case"aggregate":return t.domain.aggValues;case"group-value-processor":return t.domain.groups;default:return null}}processData(e){const{opts:{groupByKeys:t,groupByFn:i},aggregates:s,groupProcessors:n,reducers:r,processors:o,propertyProcessors:a}=this,l=performance.now();if(t&&this.keys.length===0)return;let c=this.extractData(e);t?c=this.groupData(c):i&&(c=this.groupData(c,i(c))),n.length>0&&c.type==="grouped"&&this.postProcessGroups(c),s.length>0&&c.type==="ungrouped"?this.aggregateUngroupedData(c):s.length>0&&c.type==="grouped"&&this.aggregateGroupedData(c),a.length>0&&this.postProcessProperties(c),r.length>0&&this.reduceData(c),o.length>0&&this.postProcessData(c),this.warnDataMissingProperties(e);const h=performance.now();return c.time=h-l,this.debug.check()&&Lw(c),this.processScopeCache(),c}warnDataMissingProperties(e){if(e.size!==0)for(const t of(0,Bt.iterate)(this.keys,this.values))for(const[i,s]of t.missing){if(s<(e.get(i)?.length??1/0))continue;const n=i==null?"":` for ${i}`;Bt.Logger.warnOnce(`the key '${t.property}' was not found in any data element${n}.`)}}processScopeCache(){this.scopeCache.clear();for(const e of(0,Bt.iterate)(this.keys,this.values,this.aggregates))if(e.idsMap)for(const[t,i]of e.idsMap)for(const s of i)if(!this.scopeCache.has(t))this.scopeCache.set(t,new Map([[s,e]]));else{if(this.scopeCache.get(t)?.has(s))throw new Error("duplicate definition ids on the same scope are not allowed.");this.scopeCache.get(t).set(s,e)}}valueGroupIdxLookup({matchGroupIds:e}){const t=[];for(const[i,s]of this.values.entries())(!e||s.groupId&&e.includes(s.groupId))&&t.push(i);return t}valueIdxLookup(e,t){const i=e==null||e.length===0,s=typeof t=="string"?t:t.id,n=o=>{if(o.idsMap){for(const[a,l]of o.idsMap)if(e?.includes(a)&&l.has(s))return!0}return!1},r=this.values.reduce((o,a,l)=>((a.scopes==null||i&&!a.scopes.length||a.scopes.some(h=>e?.includes(h)))&&(a.property===s||a.id===s||n(a))&&o.push(l),o),[]);if(r.length===0)throw new Error(`AG Charts - configuration error, unknown property ${JSON.stringify(t)} in scope(s) ${JSON.stringify(e)}`);return r}extractData(e){const{dataDomain:t,processValue:i,allScopesHaveSameDefs:s}=this.initDataDomainProcessor(),{keys:n,values:r}=this,{invalidData:o,invalidKeys:a,allKeyMappings:l}=this.extractKeys(n,e,i),{columns:c,columnScopes:h,partialValidDataCount:u,maxDataLength:d}=this.extractValues(o,r,e,a,i),p=f=>{const y=t.get(f),b=y.getDomain();return An.is(y)&&b[0]>b[1]?[]:b};return{type:"ungrouped",input:{count:d},scopes:new Set(e.keys()),dataSources:e,aggregation:void 0,keys:[...l.values()],columns:c,columnScopes:h,invalidKeys:a,invalidData:o,domain:{keys:n.map(p),values:r.map(p)},defs:{allScopesHaveSameDefs:s,keys:n,values:r},partialValidDataCount:u,time:0,[O0]:new Map}}extractKeys(e,t,i){const s=new Map,n=new Map,r=new Map;let o,a;const l=(c,h)=>{const u=a.get(c);o.set(h,o.get(u)),s.has(u)&&(s.set(h,s.get(u)),n.set(h,n.get(u)))};for(const c of e){const{invalidValue:h,scopes:u}=c;o=new Map,a=new Map,r.set(c,o);for(const d of u??[]){const p=t.get(d)??[];if(a.has(p)){l(p,d);continue}const f=[];o.set(d,f),a.set(p,d);let y,b;for(let m=0;m<p.length;m++){if(p[m]==null||typeof p[m]!="object")continue;const v=i(c,p[m],m,d);if(v.valid){f.push(v.value);continue}f.push(h),y??(y=Ap(p.length,!1)),b??(b=Ap(p.length,!1)),y[m]=!0,b[m]=!0}y&&b&&(s.set(d,y),n.set(d,b))}}return{invalidData:n,invalidKeys:s,allKeyMappings:r}}extractValues(e,t,i,s,n){let r=0;const o=[],a=[];let l=0;for(const c of t){const{invalidValue:h}=c;if(new Set(c.scopes.map(b=>i.get(b))).size>1)throw new Error(`AG Charts - more than one data source for: ${JSON.stringify(c)}`);const d=new Set(c.scopes),p=(0,Bt.first)(c.scopes),f=i.get(p),y=new Array;for(let b=0;b<f.length;b++){if(f[b]==null||typeof f[b]!="object")continue;const m=f[b],v=s.get(p)?.[b],M=n(c,m,b,c.scopes);let S=M.value;(v||!M.valid)&&this.markScopeDatumInvalid(c.scopes,f,b,e),v?S=h:M.valid||(r+=1,S=h),y[b]=S}o.push(y),a.push(d),l=Math.max(l,y.length)}return{columns:o,columnScopes:a,partialValidDataCount:r,maxDataLength:l}}groupData(e,t){var i;const s=new Map,{keys:n,columns:r,columnScopes:o,invalidKeys:a,invalidData:l}=e,c=e.scopes,h=new Set;for(const p of c){const f=r.map((S,D)=>D).filter(S=>!h.has(S)&&o[S].has(p));if(f.length===0)continue;for(const S of f)h.add(S);const y=new Set;for(const S of f)for(const D of o[S])y.add(D);const b=n.map(S=>S.get(p)).filter(S=>S!=null),m=r[(0,Bt.first)(f)],v=l?.get(p),M=a?.get(p);for(let S=0;S<m.length;S++){if(M?.[S]===!0)continue;const D=b.map(w=>w[S]);if(D==null||D.length===0)throw new Error("AG Charts - no keys found for scope: "+p);const C=t?.(D)??D,k=Dw(C),L=s.get(k)??{keys:C,datumIndices:[],validScopes:c};if(s.has(k)||s.set(k,L),v?.[S]===!0){L.validScopes===c&&(L.validScopes=new Set(c.values()));for(const w of y)L.validScopes.delete(w)}for(const w of f)(i=L.datumIndices)[w]??(i[w]=[]),L.datumIndices[w].push(S)}}const u=[],d=[];for(const{keys:p,datumIndices:f,validScopes:y}of s.values())u.push(p),d.push({datumIndices:f,keys:p,aggregation:[],validScopes:y});return{...e,type:"grouped",domain:{...e.domain,groups:u},groups:d}}aggregateUngroupedData(e){const t=this.aggregates.map(()=>[1/0,-1/0]);e.domain.aggValues=t;const{keys:i,columns:s,dataSources:n}=e,r=(0,Bt.first)(n.keys()),o=n.get(r);e.aggregation=o?.map((a,l)=>{const c=[];for(const[h,u]of this.aggregates.entries()){const d=this.valueGroupIdxLookup(u);let p=u.groupAggregateFunction?.()??[1/0,-1/0];const f=d.map(v=>s[v][l]),y=rh(i,r,l),b=y!=null?u.aggregateFunction(f,y):void 0;b&&(p=u.groupAggregateFunction?.(b,p)??An.extendDomain(b,p));const m=u.finalFunction?.(p)??p;c[h]=m,An.extendDomain(m,t[h])}return c})}aggregateGroupedData(e){const t=this.aggregates.map(()=>[1/0,-1/0]);e.domain.aggValues=t;const{columns:i}=e;for(const[s,n]of this.aggregates.entries()){const r=this.valueGroupIdxLookup(n);for(const o of e.groups){o.aggregation??(o.aggregation=[]);const a=o.keys;let l=n.groupAggregateFunction?.()??[1/0,-1/0];const c=Math.max(...r.map(u=>o.datumIndices[u]?.length??0));for(let u=0;u<c;u++){const d=r.map(f=>i[f][o.datumIndices[f]?.[u]]),p=n.aggregateFunction(d,a);p&&(l=n.groupAggregateFunction?.(p,l)??An.extendDomain(p,l))}const h=n.finalFunction?.(l)??l;o.aggregation[s]=h,An.extendDomain(h,t[s])}}}postProcessGroups(e){const{groupProcessors:t}=this,{columnScopes:i,columns:s,invalidData:n}=e;for(const r of t){const o=this.valueGroupIdxLookup(r),a=r.adjust()();for(const l of e.groups)a(s,o,l);for(const l of o){const h=this.values[l].valueType==="category",u=s[l],d=(0,Bt.first)(i[l]),p=n?.get(d),f=h?new N0:new An;for(let y=0;y<u.length;y+=1)p?.[y]!==!0&&f.extend(u[y]);e.domain.values[l]=f.getDomain()}}}postProcessProperties(e){for(const{adjust:t,property:i,scopes:s}of this.propertyProcessors)for(const n of this.valueIdxLookup(s,i))t()(e,n)}reduceData(e){e.reduced??(e.reduced={});const{dataSources:t,keys:i}=e;for(const s of this.reducers){const n=s.reducer();let r=s.initialValue;if(e.type==="grouped")for(const o of e.groups)r=n(r,o.keys);else{const o=(0,Bt.first)(t.keys()),a=i.map(h=>h.get(o)).filter(h=>h!=null),l=a.map(()=>{}),c=t.get(o);for(let h=0;h<c.length;h+=1){for(let u=0;u<l.length;u++)l[u]=a[u]?.[h];r=n(r,l)}}e.reduced[s.property]=r}}postProcessData(e){e.reduced??(e.reduced={});for(const t of this.processors)e.reduced[t.property]=t.calculate(e,e.reduced[t.property])}initDataDomainProcessor(){const{keys:e,values:t}=this,i=new Set;for(const h of t)if(h.scopes)for(const u of h.scopes)i.add(u);const s=new Map,n=new Map;let r=!0;const o=()=>{for(const h of(0,Bt.iterate)(e,t))h.valueType==="category"?s.set(h,new N0):(s.set(h,new An),r&&(r=(h.scopes??[]).length===i.size))};o();const a=this.buildAccessors((0,Bt.iterate)(e,t)),l={value:void 0,missing:!1,valid:!1};return{dataDomain:s,processValue:(h,u,d,p)=>{let f,y;if(a.has(h.property)){try{y=a.get(h.property)(u)}catch{}f=y!=null}else f=h.property in u,y=f?u[h.property]:h.missingValue;h.forceValue!=null&&(y=f&&(0,Bt.isNegative)(y)?-1*h.forceValue:h.forceValue,f=!0),l.missing=!f;const b="missingValue"in h;if(!f&&!b)if(typeof p=="string"){const m=h.missing.get(p)??0;h.missing.set(p,m+1)}else for(const m of p){const v=h.missing.get(m)??0;h.missing.set(m,v+1)}if(s.has(h)||o(),f&&h.validation?.(y,u,d)===!1)if(l.valid=!1,"invalidValue"in h)y=h.invalidValue;else return this.mode!=="integrated"&&Bt.Logger.warnOnce(`invalid value of type [${typeof y}] for [${h.scopes} / ${h.id}] ignored:`,`[${y}]`),l.value=void 0,l;else l.valid=!0;if(h.processor){let m=n.get(h);m==null&&(m=h.processor(),n.set(h,m)),y=m(y,d)}return s.get(h)?.extend(y),l.value=y,l},initDataDomain:o,scopes:i,allScopesHaveSameDefs:r}}buildAccessors(e){const t=new Map;if(this.suppressFieldDotNotation)return t;for(const i of e){if(!(i.property.includes(".")||i.property.includes("[")))continue;const n=E0(i.property);if(n==null){Bt.Logger.warnOnce("Invalid property path [%s]",i.property);continue}const r=Aw(n);t.set(i.property,r)}return t}};function Lw(e){const t=(i,s)=>{s.length>0&&(Bt.Logger.log(`DataModel.processData() - ${i}`),Bt.Logger.table(s))};Bt.Logger.log("DataModel.processData() - processedData",e),t("Key Domains",e.domain.keys),t("Group Domains",e.domain.groups??[]),t("Value Domains",e.domain.values),t("Aggregate Domains",e.domain.aggValues??[])}var R0=class dn{constructor(t,i){this.mode=t,this.suppressFieldDotNotation=i,this.debug=ke.create(!0,"data-model"),this.requested=[],this.status="setup"}async request(t,i,s){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");return new Promise((n,r)=>{this.requested.push({id:t,opts:s,data:i,resolve:n,reject:r})})}execute(t){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");this.status="executed",this.debug("DataController.execute() - requested",this.requested);const i=this.validateRequests(this.requested);this.debug("DataController.execute() - validated",i);const s=this.mergeRequested(i);this.debug("DataController.execute() - merged",s),this.debug.check()&&((0,T0.getWindow)().processedData=[]);const n=[];for(const{data:r,ids:o,opts:a,resolves:l,rejects:c}of s){const h=t?.find(p=>Mw(p,r,o,a));let u,d;if(h==null)try{u=new P0(a,this.mode,this.suppressFieldDotNotation);const p=new Map(i.map(f=>[f.id,f.data]));d=u.processData(p)}catch(p){c.forEach(f=>f(p));continue}else({dataModel:u,processedData:d}=h);n.push({opts:a,data:r,ids:o,dataModel:u,processedData:d}),this.debug.check()&&(0,T0.getWindow)("processedData").push(d),d?.partialValidDataCount===0?l.forEach(p=>p({dataModel:u,processedData:d})):d?this.splitResult(u,d,o,l):c.forEach(p=>p(new Error("AG Charts - no processed data generated")))}return n}validateRequests(t){const i=[];for(const[s,n]of t.entries())s>0&&n.data.length!==t[0].data.length&&n.opts.groupByData===!1&&n.opts.groupByKeys===!1?n.reject(new Error("all series[].data arrays must be of the same length and have matching keys.")):i.push(n);return i}mergeRequested(t){const i=[];for(const s of t){const n=i.find(dn.groupMatch(s));n?n.push(s):i.push([s])}return i.map(dn.mergeRequests)}splitResult(t,i,s,n){for(let r=0;r<s.length;r++){const o=n[r];o({dataModel:t,processedData:i})}}static groupMatch({data:t,opts:i}){function s(c){return c.filter(h=>h.type==="key").map(h=>h.property).join(";")}const{groupByData:n,groupByKeys:r=!1,groupByFn:o,props:a}=i,l=s(a);return([c])=>(n===!1||c.data===t)&&(c.opts.groupByKeys??!1)===r&&c.opts.groupByFn===o&&s(c.opts.props)===l}static mergeRequests(t){const i=new Set(["key","group-value-processor"]);return t.reduce((s,{id:n,data:r,resolve:o,reject:a,opts:{props:l,...c}})=>{s.ids.push(n),s.rejects.push(a),s.resolves.push(o),s.data??(s.data=r),s.opts??(s.opts={...c,props:[]});for(const h of l){const u={...h,scopes:[n],data:r};dn.createIdsMap(n,u);const d=s.opts.props.find(p=>p.type===u.type&&(i.has(p.type)||p.data===u.data)&&dn.deepEqual(p,u));if(!d){s.opts.props.push(u);continue}d.scopes??(d.scopes=[]),d.scopes.push(...u.scopes??[]),(d.type==="key"||d.type==="value")&&u.idsMap?.size&&dn.mergeIdsMap(u.idsMap,d.idsMap)}return s},{ids:[],rejects:[],resolves:[],data:null,opts:null})}static mergeIdsMap(t,i){for(const[s,n]of t){const r=i.get(s);if(r==null)i.set(s,new Set(n));else for(const o of n)r.add(o)}}static createIdsMap(t,i){i.id!=null&&(i.idsMap??(i.idsMap=new Map),i.idsMap.has(t)?i.idsMap.get(t).add(i.id):i.idsMap.set(t,new Set([i.id])))}static deepEqual(t,i){if(t===i)return!0;if(t&&i&&typeof t=="object"&&typeof i=="object"){if(t.constructor!==i.constructor)return!1;let s,n;if(Array.isArray(t)){if(n=t.length,n!==i.length)return!1;for(s=n-1;s>=0;s--)if(!dn.deepEqual(t[s],i[s]))return!1;return!0}const r=Object.keys(t);if(n=r.length,n!==Object.keys(i).length)return!1;for(s=n-1;s>=0;s--){const o=r[s];if(!dn.skipKeys.has(o)&&(!Object.hasOwn(i,o)||!dn.deepEqual(t[o],i[o])))return!1}return!0}return!1}};R0.skipKeys=new Set(["id","idsMap","type","scopes","data"]);var F0=R0,kw=class{constructor(){this.axesMap=new Map,this.themeTemplates=new Map}register(e,t){this.axesMap.set(e,t.moduleFactory),t.themeTemplate&&this.setThemeTemplate(e,t.themeTemplate)}create(e,t){const i=this.axesMap.get(e);if(i)return i(t);throw new Error(`AG Charts - unknown axis type: ${e}`)}has(e){return this.axesMap.has(e)}keys(){return this.axesMap.keys()}setThemeTemplate(e,t){return this.themeTemplates.set(e,t),this}getThemeTemplate(e){return this.themeTemplates.get(e)}},hr=new kw,Ga=[{type:"root",optionsKey:"animation",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"]},{type:"root",optionsKey:"annotations",chartTypes:["cartesian"]},{type:"root",optionsKey:"background",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],optionsInnerKey:"image"},{type:"root",optionsKey:"foreground",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],optionsInnerKey:"image"},{type:"root",optionsKey:"chartToolbar",chartTypes:["cartesian"]},{type:"root",optionsKey:"contextMenu",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"]},{type:"root",optionsKey:"statusBar",chartTypes:["cartesian"],identifier:"status-bar"},{type:"root",optionsKey:"dataSource",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"]},{type:"root",optionsKey:"sync",chartTypes:["cartesian"]},{type:"root",optionsKey:"zoom",chartTypes:["cartesian","topology"]},{type:"root",optionsKey:"ranges",chartTypes:["cartesian"]},{type:"legend",optionsKey:"gradientLegend",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],identifier:"gradient"},{type:"root",optionsKey:"navigator",chartTypes:["cartesian"]},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"angle-category"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"angle-number"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"radius-category"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"radius-number"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"bar",community:!0},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"line",community:!0},{type:"axis",optionsKey:"axes[]",chartTypes:["cartesian"],identifier:"ordinal-time"},{type:"axis-option",optionsKey:"crosshair",chartTypes:["cartesian"]},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"box-plot"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"candlestick"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"cone-funnel"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"funnel"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"ohlc"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"heatmap"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"range-area"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"range-bar"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"waterfall"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"nightingale"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radar-area"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radar-line"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radial-bar"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radial-column"},{type:"series",optionsKey:"series[]",chartTypes:["hierarchy"],identifier:"sunburst"},{type:"series",optionsKey:"series[]",chartTypes:["hierarchy"],identifier:"treemap"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-shape"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-line"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-marker"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-shape-background"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-line-background"},{type:"series",optionsKey:"series[]",chartTypes:["flow-proportion"],identifier:"chord"},{type:"series",optionsKey:"series[]",chartTypes:["flow-proportion"],identifier:"sankey"},{type:"series",optionsKey:"series[]",chartTypes:["standalone"],identifier:"pyramid"},{type:"series",optionsKey:"series[]",chartTypes:["gauge"],identifier:"linear-gauge"},{type:"series",optionsKey:"series[]",chartTypes:["gauge"],identifier:"radial-gauge"},{type:"series-option",optionsKey:"errorBar",chartTypes:["cartesian"],identifier:"error-bars"},{type:"context",contextKey:"sharedToolbar",chartTypes:["cartesian"]}];function ur(e){return Ga.find(t=>t.type==="series"&&t.identifier===e)?.chartTypes}function Cw(e){return ur(e)?.find(i=>i==="cartesian")==="cartesian"}function ww(e){return ur(e)?.find(i=>i==="polar")==="polar"}function Tw(e){return ur(e)?.find(i=>i==="hierarchy")==="hierarchy"}function Nw(e){return ur(e)?.find(i=>i==="topology")==="topology"}function Ow(e){return ur(e)?.find(i=>i==="flow-proportion")==="flow-proportion"}function Ew(e){return ur(e)?.find(i=>i==="standalone")==="standalone"}function Pw(e){return ur(e)?.find(i=>i==="gauge")==="gauge"}function Rw(e){return e.packageType==="enterprise"}function Fw(e){if(!Rw(e))throw new Error("AG Charts - internal configuration error, only enterprise modules need verification.");const t=Ga.find(i=>i.type===e.type&&("optionsKey"in i&&"optionsKey"in e?i.optionsKey===e.optionsKey:!0)&&("contextKey"in i&&"contextKey"in e?i.contextKey===e.contextKey:!0)&&i.identifier===e.identifier&&e.chartTypes.every(s=>i.chartTypes.includes(s)));return t&&(t.useCount??(t.useCount=0),t.useCount++),t!=null}function _w(){return Ga.filter(({useCount:e})=>e==null||e===0)}var jw=class{constructor(){this.legendMap=new Map,this.themeTemplates=new Map}register(e,{optionsKey:t,moduleFactory:i,themeTemplate:s}){this.legendMap.set(e,{optionsKey:t,moduleFactory:i}),this.themeTemplates.set(t,s)}create(e,t){const i=this.legendMap.get(e)?.moduleFactory;if(i)return i(t);throw new Error(`AG Charts - unknown legend type: ${e}`)}getThemeTemplates(){return Object.fromEntries(this.themeTemplates)}getKeys(){return Array.from(this.legendMap.entries()).reduce((e,[t,i])=>(e[t]=i.optionsKey,e),{})}},Lp=new jw,_0=class extends Map{get(e){return super.get(e)??"unknown"}isCartesian(e){return this.get(e)==="cartesian"}isPolar(e){return this.get(e)==="polar"}isHierarchy(e){return this.get(e)==="hierarchy"}isTopology(e){return this.get(e)==="topology"}isFlowProportion(e){return this.get(e)==="flow-proportion"}isStandalone(e){return this.get(e)==="standalone"}isGauge(e){return this.get(e)==="gauge"}get seriesTypes(){return Array.from(this.keys())}get cartesianTypes(){return this.seriesTypes.filter(e=>this.isCartesian(e))}get polarTypes(){return this.seriesTypes.filter(e=>this.isPolar(e))}get hierarchyTypes(){return this.seriesTypes.filter(e=>this.isHierarchy(e))}get topologyTypes(){return this.seriesTypes.filter(e=>this.isTopology(e))}get flowProportionTypes(){return this.seriesTypes.filter(e=>this.isFlowProportion(e))}get standaloneTypes(){return this.seriesTypes.filter(e=>this.isStandalone(e))}get gaugeTypes(){return this.seriesTypes.filter(e=>this.isGauge(e))}},zw=class extends Map{set(e,t){return super.set(e,xe(t,this.get(e)))}},Ze=new _0,Bw=new _0,kp=new zw,Gw=class{constructor(){this.seriesMap=new Map,this.themeTemplates=new Map}register(e,{chartTypes:[t],moduleFactory:i,tooltipDefaults:s,defaultAxes:n,themeTemplate:r,solo:o,stackable:a,groupable:l,stackedByDefault:c,hidden:h}){this.setThemeTemplate(e,r),this.seriesMap.set(e,{moduleFactory:i,tooltipDefaults:s,defaultAxes:n,solo:o,stackable:a,groupable:l,stackedByDefault:c}),Ze.set(e,t),h||Bw.set(e,t)}create(e,t){const i=this.seriesMap.get(e)?.moduleFactory;if(i)return i(t);throw new Error(`AG Charts - unknown series type: ${e}`)}cloneDefaultAxes(e){const t=this.seriesMap.get(e)?.defaultAxes;return t==null?null:{axes:Ve(t)}}setThemeTemplate(e,t){const i=this.themeTemplates.get(e);this.themeTemplates.set(e,xe(t,i))}getThemeTemplate(e){return this.themeTemplates.get(e)}getTooltipDefauls(e){return this.seriesMap.get(e)?.tooltipDefaults}isSolo(e){return this.seriesMap.get(e)?.solo??!1}isGroupable(e){return this.seriesMap.get(e)?.groupable??!1}isStackable(e){return this.seriesMap.get(e)?.stackable??!1}isStackedByDefault(e){return this.seriesMap.get(e)?.stackedByDefault??!1}},Vi=new Gw,Cp=class pn extends Ws{constructor(t){super(),this.chart=t}subscribe(t=pn.DEFAULT_GROUP){let i=this.get(t);return i||(i={members:new Set},pn.chartsGroups.set(t,i)),i.members.add(this.chart),this}unsubscribe(t=pn.DEFAULT_GROUP){const i=this.get(t);return i?.members.delete(this.chart),delete i?.domains?.x?.sources?.[this.chart.id],delete i?.domains?.y?.sources?.[this.chart.id],this}getChart(){return this.chart}getGroupState(t=pn.DEFAULT_GROUP){return this.get(t)}getGroupMembers(t=pn.DEFAULT_GROUP){const i=this.get(t);return i?Array.from(i.members):[]}getGroupSiblings(t=pn.DEFAULT_GROUP){return this.getGroupMembers(t).filter(i=>i!==this.chart)}getGroupSyncMode(t=pn.DEFAULT_GROUP){return this.getGroupMembers(t).some(i=>i.series.length>1)?"multi-series":"single-series"}get(t){return pn.chartsGroups.get(t)}};Cp.chartsGroups=new Map,Cp.DEFAULT_GROUP=Symbol("sync-group-default");var Vw=Cp,wp=class extends le{constructor(){super(...arguments),this.enabled=!1}};g([x],wp.prototype,"enabled",2),g([x],wp.prototype,"tabIndex",2);var oh=(O(),N(T)),j0={};ji(j0,{NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>os,fromToMotion:()=>Xe,staticFromToMotion:()=>Ks});var os={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function Xe(e,t,i,s,n,r,o){const{fromFn:a,toFn:l,applyFn:c=(f,y)=>f.setProperties(y)}=n,{nodes:h,selections:u}=th(s),d=(f,y)=>{let b,m=0,v=0;for(const M of y){const S=f[m]===M,D={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+(S?1:0)]},C=`${e}_${t}_${M.id}`;i.stopByAnimationId(C);let k="unknown";S?r&&o&&(k=Uw(M,M.datum,r,o)):k="removed",M.transitionOut=k==="removed";const{phase:L,start:w,finish:P,delay:R,duration:G,...Y}=a(M,M.datum,k,D),{phase:he,start:se,finish:de,delay:ge,duration:ye,...J}=l(M,M.datum,k,D),W=P==null;i.animate({id:C,groupId:e,phase:L??he??"update",duration:G??ye,delay:R??ge,from:Y,to:J,ease:Pa,collapsable:W,onPlay:()=>{const V={...w,...se,...Y};c(M,V,"start")},onUpdate(V){c(M,V,"update")},onStop:()=>{const V={...w,...se,...Y,...J,...P,...de};c(M,V,"end")}}),S&&m++,v++,b=Y}};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:Pa,onStop(){f.cleanup()}}),p++}d(h,h)}function Ks(e,t,i,s,n,r,o){const{nodes:a,selections:l}=th(s),{start:c,finish:h,phase:u}=o;i.animate({id:`${e}_${t}`,groupId:e,phase:u??"update",from:n,to:r,ease:Pa,onPlay:()=>{if(c){for(const d of a)d.setProperties(c);for(const d of l)for(const p of d.nodes())p.setProperties(c)}},onUpdate(d){for(const p of a)p.setProperties(d);for(const p of l)for(const f of p.nodes())f.setProperties(d)},onStop:()=>{for(const d of a)d.setProperties({...r,...h});for(const d of l){for(const p of d.nodes())p.setProperties({...r,...h});d.cleanup()}}})}function Uw(e,t,i,s){const n=i(e,t);return s.added.has(n)?"added":s.removed.has(n)?"removed":e.previousDatum==null&&e.datum!=null?"added":e.previousDatum!=null&&e.datum==null?"removed":"updated"}var z0={};ji(z0,{resetMotion:()=>It});function It(e,t){const{nodes:i,selections:s}=th(e);for(const n of s){for(const r of n.nodes()){const o=t(r,r.datum);r.setProperties(o)}n.cleanup()}for(const n of i){const r=t(n,n.datum);n.setProperties(r)}}var ht=class Yr{constructor(t,i,s=!0){this.parentNode=t,this.autoCleanup=s,this.garbageBin=new Set,this._nodesMap=new Map,this._nodes=[],this.data=[],this.debug=ke.create(!0,"scene","scene:selections"),this.nodeFactory=Object.prototype.isPrototypeOf.call(js,i)?()=>new i:i}static select(t,i,s=!0){return new Yr(t,i,s)}static selectAll(t,i){const s=[],n=r=>{i(r)&&s.push(r);for(const o of r.children())n(o)};return n(t),s}static selectByClass(t,...i){return Yr.selectAll(t,s=>i.some(n=>s instanceof n))}static selectByTag(t,i){return Yr.selectAll(t,s=>s.tag===i)}createNode(t,i,s){const n=this.nodeFactory(t);return n.datum=t,i?.(n),s==null?this._nodes.push(n):this._nodes.splice(s,0,n),this.parentNode.appendChild(n),n}update(t,i,s){if(this.garbageBin.size>0&&this.debug("Selection - update() called with pending garbage",t),s){const n=new Map(t.map((r,o)=>[s(r),[r,o]]));for(const[r,o]of this._nodesMap.entries())if(n.has(o)){const[a]=n.get(o);r.datum=a,this.garbageBin.delete(r),n.delete(o)}else this.garbageBin.add(r);for(const[r,[o,a]]of n.entries())this._nodesMap.set(this.createNode(o,i,a),r)}else{const n=Math.max(t.length,this.data.length);for(let r=0;r<n;r++)r>=t.length?this.garbageBin.add(this._nodes[r]):r>=this._nodes.length?this.createNode(t[r],i):(this._nodes[r].datum=t[r],this.garbageBin.delete(this._nodes[r]))}return this.data=t.slice(),this.autoCleanup&&this.cleanup(),this}cleanup(){return this.garbageBin.size===0?this:(this._nodes=this._nodes.filter(t=>this.garbageBin.has(t)?(this._nodesMap.delete(t),this.garbageBin.delete(t),t.destroy(),!1):!0),this)}clear(){return this.update([]),this}isGarbage(t){return this.garbageBin.has(t)}each(t){for(const i of this._nodes.entries())t(i[1],i[1].datum,i[0]);return this}*[Symbol.iterator](){for(let t=0;t<this._nodes.length;t++){const i=this._nodes[t];yield{node:i,datum:i.datum,index:t}}}select(t){return Yr.selectAll(this.parentNode,t)}selectByClass(t){return Yr.selectByClass(this.parentNode,t)}selectByTag(t){return Yr.selectByTag(this.parentNode,t)}nodes(){return this._nodes}at(t){return this._nodes.at(t)}get length(){return this._nodes.length}},Ww=(O(),N(T)),Xt=class extends Bi{constructor(e={}){super(e),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.restoreOwnStyles()}set x(e){this.x1=e,this.x2=e}set y(e){this.y1=e,this.y2=e}get midPoint(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}}computeBBox(){return new U(Math.min(this.x1,this.x2),Math.min(this.y1,this.y2),Math.abs(this.x2-this.x1),Math.abs(this.y2-this.y1))}isPointInPath(e,t){return this.x1===this.x2||this.y1===this.y2?this.getBBox().clone().grow(this.strokeWidth/2).containsPoint(e,t):!1}distanceSquared(e,t){const{x1:i,y1:s,x2:n,y2:r}=this;return La(e,t,i,s,n,r,1/0)}render(e){const{ctx:t,devicePixelRatio:i}=e;let{x1:s,y1:n,x2:r,y2:o}=this;if(s===r){const{strokeWidth:a}=this,l=Math.round(s*i)/i+Math.trunc(a*i)%2/(i*2);s=l,r=l}else if(n===o){const{strokeWidth:a}=this,l=Math.round(n*i)/i+Math.trunc(a*i)%2/(i*2);n=l,o=l}t.beginPath(),t.moveTo(s,n),t.lineTo(r,o),this.fillStroke(t),this.fillShadow?.markClean(),super.render(e)}toSVG(){if(!this.visible)return;const e=(0,Ww.createSvgElement)("line");return e.setAttribute("x1",String(this.x1)),e.setAttribute("y1",String(this.y1)),e.setAttribute("x2",String(this.x2)),e.setAttribute("y2",String(this.y2)),this.applySvgStrokeAttributes(e),{elements:[e]}}};Xt.className="Line",Xt.defaultStyles={...Bi.defaultStyles,fill:void 0,strokeWidth:1},g([_()],Xt.prototype,"x1",2),g([_()],Xt.prototype,"y1",2),g([_()],Xt.prototype,"x2",2),g([_()],Xt.prototype,"y2",2);var Tp="color: green",Np="color: grey";function Hw(){return Sy(()=>{})}function Op(e,t){const i=sr(t);if(i.length===0)return;const s=Dy(e);for(const n of i)n in s&&(t[n]=s[n])}var B0=class{transitionRoot(e,t){this.parent?this.parent.transitionRoot(e,t):this.transition(e,t)}},Ep=class vi extends B0{constructor(t,i,s){super(),this.defaultState=t,this.states=i,this.enterEach=s,this.debug=ke.create(!0,"animation"),this.state=t,this.debug(`%c${this.constructor.name} | init -> ${t}`,Tp)}transition(t,i){if(!this.transitionChild(t,i)||this.state===vi.child||this.state===vi.parent)return;const n=this.state,r=this.states[this.state];let o=r[t];const a=`%c${this.constructor.name} | ${this.state} -> ${t} ->`;if(Array.isArray(o))o=o.find(h=>{if(!h.guard)return!0;const u=h.guard(i);return u||this.debug(`${a} (guarded)`,h.target,Np),u});else if(typeof o=="object"&&!(o instanceof vi)&&o.guard&&!o.guard(i)){this.debug(`${a} (guarded)`,o.target,Np);return}if(!o){this.debug(`${a} ${this.state}`,Np);return}const l=this.getDestinationState(o),c=l===this.state?void 0:r.onExit;this.debug(`${a} ${l}`,Tp),this.state=l,typeof o=="function"?o(i):typeof o=="object"&&!(o instanceof vi)&&o.action?.(i),c?.(),this.enterEach?.(n,l),l!==n&&l!==vi.child&&l!==vi.parent&&this.states[l].onEnter?.(n,i)}transitionAsync(t,i){setTimeout(()=>{this.transition(t,i)},0)}is(t){return this.state===vi.child&&this.childState?this.childState.is(t):this.state===t}resetHierarchy(){this.debug(`%c${this.constructor.name} | ${this.state} -> [resetHierarchy] -> ${this.defaultState}`,"color: green"),this.state=this.defaultState}transitionChild(t,i){return this.state!==vi.child||!this.childState||(Op(this,this.childState),this.childState.transition(t,i),!this.childState.is(vi.parent))?!0:(this.debug(`%c${this.constructor.name} | ${this.state} -> ${t} -> ${this.defaultState}`,Tp),this.state=this.defaultState,this.states[this.state].onEnter?.(),this.childState.resetHierarchy(),!1)}getDestinationState(t){let i=this.state;return typeof t=="string"?i=t:t instanceof vi?(this.childState=t,this.childState.parent=this,i=vi.child):typeof t=="object"&&(t.target instanceof vi?(this.childState=t.target,this.childState.parent=this,i=vi.child):t.target!=null&&(i=t.target)),i}};Ep.child="__child",Ep.parent="__parent";var Va=Ep,Yw=class extends B0{constructor(...e){super(),this.stateMachines=e;for(const t of e)t.parent=this}transition(e,t){for(const i of this.stateMachines)Op(this,i),i.transition(e,t)}transitionAsync(e,t){for(const i of this.stateMachines)Op(this,i),i.transitionAsync(e,t)}},Pp=(O(),N(T)),Rp=(O(),N(T)),Fp=class{constructor(){this.moduleMap=new Map}*modules(){for(const e of this.moduleMap.values())yield e.moduleInstance}addModule(e,t){if(this.moduleMap.has(e.optionsKey))throw new Error(`AG Charts - module already initialised: ${e.optionsKey}`);this.moduleMap.set(e.optionsKey,{module:e,moduleInstance:t(e)})}removeModule(e){const t=(0,Rp.isString)(e)?e:e.optionsKey;this.moduleMap.get(t)?.moduleInstance.destroy(),this.moduleMap.delete(t)}getModule(e){return this.moduleMap.get((0,Rp.isString)(e)?e:e.optionsKey)?.moduleInstance}isEnabled(e){return this.moduleMap.has((0,Rp.isString)(e)?e:e.optionsKey)}mapModules(e){return Array.from(this.moduleMap.values(),(t,i)=>e(t.moduleInstance,i))}destroy(){for(const e of this.moduleMap.keys())this.moduleMap.get(e)?.moduleInstance.destroy();this.moduleMap.clear()}},Lo=(O(),N(T));function dr(e){return typeof e=="string"?yp[e]:e}function _p(e){return dr(e).unit}function $w(e){return dr(e).step}function jp(e){return dr(e).hierarchy}function ko(e){return dr(e).milliseconds}function ah(e,t,i,s){return dr(e).range(t,i,s)}function G0(e,t){return dr(e).floor(t)}var V0=class aD extends rs{constructor(){super(...arguments),this.type="unit-time",this._domain=[],this._bands=void 0}static is(t){return t instanceof aD}set domain(t){t!==this._domain&&(this._domain=t,this._bands=void 0)}get domain(){return this._domain}get interval(){return this._interval}set interval(t){this._interval!==t&&(this._interval=t,this._bands=void 0)}get bands(){return this._bands??(this._bands=this.calculateBands(this._domain,[0,1])),this._bands}normalizeDomains(...t){return fp(...t)}convert(t,i){const{domain:s,interval:n}=this;if(s.length<2)return NaN;if(n!=null){const r=t.valueOf(),[o,a]=this.calculateBandRange(s,n),l=Math.min(o.valueOf(),a.valueOf()),c=Math.max(o.valueOf(),a.valueOf());if(r<l||r>=c+ko(n))return NaN}return super.convert(t,i)}calculateBandRange(t,i){const s=G0(i,t[0]),n=G0(i,t[1]);return[s,n]}calculateBands(t,i,s=!1){if(t===this.domain&&i[0]===0&&i[1]===1&&!s&&this._bands!=null)return this._bands;if(t.length<2)return[];const{interval:n}=this;if(n==null)return[];const[r,o]=this.calculateBandRange(t,n);return ah(n,r,o,{visibleRange:i,extend:s})}ticks({interval:t},i=this.domain,s=[0,1],n=!1){if(i.length<2)return;const r=this.calculateBands(i,s,n),o=this.interval?ko(this.interval):1/0;if(t==null)return{ticks:r,count:void 0};const a=Math.min(i[0].valueOf(),i[1].valueOf()),l=Math.max(i[0].valueOf(),i[1].valueOf()),c=[];let h,u,d;t instanceof gt?(h=t.range(i[0],i[1],{extend:!0,visibleRange:s}),u=0,d=h.length-1):(h=r,u=(0,Lo.findMaxIndex)(0,r.length-1,v=>r[v].valueOf()<=a)??0,d=(0,Lo.findMaxIndex)(0,r.length-1,v=>r[v].valueOf()<=l)??r.length-1);let p;for(let v=u;v<=d;v++){const M=h[v].valueOf(),S=(0,Lo.findMaxIndex)(0,r.length-1,C=>r[C].valueOf()<=M),D=S!=null&&S!=p?r[S]:void 0;p=S,D!=null&&M-D.getTime()<=o&&c.push(D)}let f,y;if(this.interval){const v=this.calculateBandRange([new Date(a),new Date(l)],this.interval);f=v[0].valueOf(),y=v[1].valueOf()}else f=a,y=l;let b=(0,Lo.findMinIndex)(0,c.length-1,v=>c[v].valueOf()>=f)??0,m=(0,Lo.findMaxIndex)(0,c.length-1,v=>c[v].valueOf()<=y)??c.length-1;return n&&(b=Math.max(b-1,0),m=Math.min(m+1,c.length-1)),{ticks:c.slice(b,m+1),count:c.length}}findIndex(t){const{bands:i}=this,s=t.valueOf();return(0,Lo.findMaxIndex)(0,i.length-1,n=>i[n].valueOf()<=s)}datumFormatter(t){const i=this.tickFormatter(t,1);return s=>{const n=this.findIndex(s);return n!=null?i(this.bands[n]):i(s)}}};V0.defaultTickCount=12;var ki=V0,Kw=(O(),N(T));function lh(e,t){return e.valueOf()-t.valueOf()}function Zw(e){let t=NaN;const i=[];for(const s of e){const n=s.valueOf();t!==n&&i.push(s),t=n}return i}function zp(e){const t=e.slice().sort(lh);return Bp(t)==null?Zw(t):t}function Bp(e){if(e.length===0)return 1;const t=Number(e[e.length-1])>Number(e[0])?1:-1;let i=-1/0*t;for(const s of e){const n=s.valueOf();if(Math.sign(n-i)!==t)return;i=n}return t}var Co=(O(),N(T)),Je=(e,t,i)=>({duration:t*i,timeInterval:e,step:i}),Gp=[Je(Mo,In,1),Je(Mo,In,5),Je(Mo,In,15),Je(Mo,In,30),Je(So,jt,1),Je(So,jt,5),Je(So,jt,15),Je(So,jt,30),Je(Do,ni,1),Je(Do,ni,3),Je(Do,ni,6),Je(Do,ni,12),Je($s,Gi,1),Je($s,Gi,2),Je(ks,Ys,1),Je(ks,Ys,2),Je(ks,Ys,3),Je(ns,Fa,1),Je(ns,Fa,2),Je(ns,Fa,3),Je(ns,Fa,4),Je(ns,Fa,6),Je(lr,vo,1)],U0=[1,2,5,10];function W0(e,t){return Math.abs(Math.round(e)-e)<t}function H0(e,t,i){return Math.abs(t-e)>=i?Math.abs(t-e)/i+1:1}function Ua(e,t,i,s,n,r){if(e===t)return{ticks:[e],count:1};if(i<2)return{ticks:[e,t],count:2};const o=Wa(e,t,i,s,n);if(!Number.isFinite(o))return{ticks:[],count:0};let a=e,l=t;if(W0(a/o,1e-12)||(a=Math.ceil(a/o)*o),W0(l/o,1e-12)||(l=Math.floor(l/o)*o),r!=null){const h=l-a,u=t-e,d=e+u*r[0],p=e+u*r[1];r=[(d-a)/h,(p-a)/h]}const{ticks:c}=ch(a,l,o,r);return{ticks:c,count:H0(e,t,o)}}var Xw=Math.floor(2*ks.milliseconds/ns.milliseconds*10)/10;function Y0({timeInterval:e,step:t}){return e.milliseconds*t<=(e.hierarchy?.milliseconds??1/0)*Xw}function Vp(e,t,i,s,n,{weekStart:r,primaryOnly:o=!1,targetInterval:a}){if(i<=0)return;const l=a??Math.abs(t-e)/Math.max(i,1),c=Gp.findLast(p=>(!o||Y0(p))&&l>p.duration),h=Gp.find(p=>(!o||Y0(p))&&l<=p.duration);if(c==null){const p=Math.max(Wa(e,t,i,s,n),1);return l0.every(p)}else if(h==null){const p=a==null?Wa(e/vo,t/vo,i,s,n):1;return lr.every(p)}const{timeInterval:u,step:d}=l-c.duration<h.duration-l?c:h;return u===ks?r?.every(d)??$s.every(7*d):u.every(d)}function Wa(e,t,i,s=0,n=1/0){if(e===t)return(0,Co.clamp)(1,s,n);if(i<1)return NaN;const r=Math.abs(t-e),o=10**Math.floor(Math.log10(r/i));let a=NaN,l=1/0,c=!1;for(const h of U0){const u=Math.ceil(r/(h*o)),d=u>=s&&u<=n;if(c&&!d)continue;const p=Math.abs(u-i);(l>p||c!==d)&&(c||(c=d),l=p,a=h)}return a*o}function $0(e){for(let t=e.length-1;t>=0;t-=1)if(e[t]!=="0")return t+1;return 0}function K0(e,t){const i=(0,Co.parseNumberFormat)(t??",f");(i.precision==null||isNaN(i.precision))&&(!i.type||"eEFgGnprs".includes(i.type)?i.precision=Math.max(...e.map(n=>{if(!Number.isFinite(n))return 0;const[r,o]=n.toExponential((i.type?6:12)-1).split(/[.e]/g);return(r!=="1"&&r!=="-1"?1:0)+$0(o)+1})):"f%".includes(i.type)&&(i.precision=Math.max(...e.map(n=>{if(!Number.isFinite(n)||n===0)return 0;const r=Math.floor(Math.log10(Math.abs(n))),o=i.type?6:12,a=n.toExponential(o-1).split(/[.e]/g)[1],l=$0(a);return Math.max(0,l-r)}))));const s=(0,Co.createNumberFormatter)(i);return n=>s(Number(n))}function ch(e,t,i,s){if(!Number.isFinite(i)||i<=0)return{ticks:[],count:0};if(e===t)return{ticks:[e],count:1};const n=10**(0,Co.countFractionDigits)(i),r=Math.min(e,t),o=Math.max(e,t);let a,l;if(s!=null&&(s[0]!==0||s[1]!==1)){const h=t-e,u=e+h*s[0],d=t-h*(1-s[1]);a=Math.min(u,d),l=Math.max(u,d)}else a=r,l=o;a=Math.floor(a*n)/n,l=Math.ceil(l*n)/n;const c=[];for(let h=0;;h+=1){const u=Math.round((r+i*h)*n)/n;if(u>o)break;u>=a&&u<=l&&c.push(u)}return{ticks:c,count:H0(r,o,i)}}function wo(e,t){return e>=t?(Co.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 Z0(e,t){const i=Math.abs(t-e),s=10**Math.floor(Math.log10(i));let n=1/0,r=[e,t];for(const o of U0){const a=o*s,l=Math.floor(e/a)*a,c=Math.ceil(t/a)*a,h=1-i/Math.abs(c-l);n>h&&(n=h,r=[l,c])}return r}function X0(e,t,i,s,n,r){if(e<=0)return{minTickCount:0,maxTickCount:0,tickCount:0};r=Math.max(r,e/(n+1)),i??(i=r),s??(s=e),i>s&&(i===r?i=s:s=i);const o=Math.max(1,Math.floor(e/(t*i))),a=Math.min(o,Math.ceil(e/(t*s))),l=(0,Co.clamp)(a,Math.floor(n/t),o);return{minTickCount:a,maxTickCount:o,tickCount:l}}var Ha=class lD extends Fe{constructor(){super([],[0,1]),this.type="time"}static is(t){return t instanceof lD}toDomain(t){return new Date(t)}convert(t,i){return t instanceof Date||(t=new Date(t)),super.convert(t,i)}invert(t){return new Date(super.invert(t))}niceDomain(t,i=this.domain){if(i.length<2)return[];let[s,n]=i;const r=4,o=this.getPixelRange();for(let a=0;a<r;a++){const[l,c]=qw(s,n,t,o);if(Zt(s)===Zt(l)&&Zt(n)===Zt(c))break;s=l,n=c}return[s,n]}ticks(t,i=this.domain,s=[0,1],n=!1){const{nice:r,interval:o,tickCount:a=Fe.defaultTickCount,minTickCount:l,maxTickCount:c}=t;if(i.length<2)return;const h=i.map(Zt),u=h[0],d=h[h.length-1];if(o!=null){const p=this.getPixelRange();return{ticks:Up({start:u,stop:d,interval:o,availableRange:p,visibleRange:s,extend:n})??q0({start:u,stop:d,tickCount:a,minTickCount:l,maxTickCount:c,visibleRange:s,extend:n}),count:void 0}}else{if(r&&a===2)return{ticks:i,count:void 0};if(r&&a===1)return{ticks:i.slice(0,1),count:void 0}}return{ticks:q0({start:u,stop:d,tickCount:a,minTickCount:l,maxTickCount:c,visibleRange:s,extend:n}),count:void 0}}_tickFormatter({domain:t,ticks:i,specifier:s},n){return s!=null?_a(s):vp(i,t,n)}tickFormatter(t){return this._tickFormatter(t)}datumFormatter(t){return this._tickFormatter(t,1)}};function q0({start:e,stop:t,tickCount:i,minTickCount:s,maxTickCount:n,visibleRange:r,extend:o}){const a=Vp(e,t,i,s,n,{weekStart:ks});return a?a.range(new Date(e),new Date(t),{visibleRange:r,extend:o}):[]}function Up({start:e,stop:t,interval:i,availableRange:s,visibleRange:n,extend:r}){if(!i)return[];if(i instanceof gt||typeof i=="string"){const u=ah(i,new Date(e),new Date(t),{visibleRange:n,extend:r});return wo(u.length,s)?void 0:u}const o=Math.abs(i);if(wo(Math.abs(t-e)/o,s))return;const a=Gp.findLast(u=>o%u.duration===0);if(a)return a.timeInterval.every(o/(a.duration/a.step)).range(new Date(e),new Date(t),{visibleRange:n,extend:r});let l=new Date(Math.min(e,t));const c=new Date(Math.max(e,t)),h=[];for(;l<=c;)h.push(l),l=new Date(l),l.setMilliseconds(l.getMilliseconds()+o);return h}function qw(e,t,i,s){const{interval:n}=i,r=Math.min(Zt(e),Zt(t)),o=Math.max(Zt(e),Zt(t));let a;if(n instanceof gt)a=n;else if(typeof n=="string")a=n;else{let u;typeof n=="number"&&(u=(o-r)/Math.max(n,1),wo(u,s)&&(u=void 0)),u??(u=i.tickCount??Fe.defaultTickCount),a=Vp(r,o,u,i.minTickCount,i.maxTickCount,{weekStart:ks})}if(a==null)return[e,t];const l=ah(a,new Date(r),new Date(o),{extend:!0});if(l==null||l.length<2)return[e,t];const c=l[0],h=l[l.length-1];return e<=t?[c,h]:[h,c]}var hh=class cD extends rs{constructor(){super(...arguments),this.type="ordinal-time",this._domain=[],this.isReversed=!1}static is(t){return t instanceof cD}set domain(t){t!==this._domain&&(this.invalid=!0,this._domain=t,this._bands=void 0,this.isReversed=t.length>0&&t[0]>t[t.length-1],this.sortedTimestamps=void 0,this.precomputedSteps=void 0)}get domain(){return this._domain}get bands(){return this._bands??(this._bands=this.isReversed?this.domain.slice().reverse():this.domain),this._bands}normalizeDomains(...t){const i=t.filter(s=>s.length>0);if(i.length===0)return{domain:[],animatable:!1};if(i.length===1){let s=i[0];const n=Bp(s);return n===-1?s=s.slice().reverse():n==null&&(s=zp(s.slice())),{domain:s,animatable:!0}}return{domain:zp(i.flat()),animatable:!0}}ticks({interval:t,maxTickCount:i},s=this.domain,n=[0,1],r=!1){if(!s.length)return;this.refresh();const{isReversed:o}=this;if(t==null)return{ticks:Q0(s,i,o,n,r),count:void 0};const a=s[0].valueOf(),l=s[s.length-1].valueOf(),[c,h]=this.range,u=Math.abs(h-c);let d=Up({start:a,stop:l,interval:t,availableRange:u,visibleRange:n,extend:r})??Q0(s,i,o,n,r),p=-1;return d=d.filter(f=>{const y=this.findInterval(f.valueOf()),b=y===p;return p=y,!b}),{ticks:d,count:void 0}}getSortedTimestamps(){let{sortedTimestamps:t}=this;return t==null&&(t??(t=this.bands.map(Zt)),this.sortedTimestamps=t),t}getPrecomputedSteps(){const{domain:t}=this;let{precomputedSteps:i}=this;const s=t.length<1e4?t.length:Math.ceil(t.length/16);if(i!=null||s<=1)return i;const n=this.getSortedTimestamps();i=new Int32Array(s);const r=n[0],a=n[n.length-1]-r,l=0,c=n.length-1;for(let h=0;h<i.length;h+=1)i[h]=this.findIntervalInRange(r+h/s*a,l,c);this.precomputedSteps=i}findIntervalInRange(t,i,s){const n=this.getSortedTimestamps();for(;i<=s;){const r=(i+s)/2|0;if(n[r]===t)return r;n[r]<t?i=r+1:s=r-1}return i}findInterval(t){const i=this.getPrecomputedSteps();let s,n;if(i==null)s=0,n=this.domain.length-1;else{const r=this.getSortedTimestamps(),o=r[0],a=r[r.length-1],l=Math.min((t-o)/(a-o)*i.length|0,i.length-1|0);s=i[l],n=l<i.length-2?i[l+1]:r.length-1}return this.findIntervalInRange(t,s,n)}datumFormatter(t){return this.tickFormatter(t)}findIndex(t){const i=this.getSortedTimestamps(),s=Number(t);if(!(s<i[0]))return this.findInterval(s)}};function Q0(e,t,i,s,n){const r=[],o=Math.ceil(e.length/t),a=Math.floor(o/2);let l=Math.floor(s[0]*e.length),c=Math.ceil(s[1]*e.length);n&&(l>o&&(l-=o),c<e.length-o&&(c+=o));for(let h=l;h<c;h+=1){const u=i?e.length-1-h:h;(o<=0||(u+a)%o===0)&&r.push(e[h])}return r}var as=class extends Bi{constructor(e={}){super(e),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.startLine=!1,this.endLine=!1,this.horizontal=!1,this.restoreOwnStyles()}computeBBox(){return new U(this.x1,this.y1,this.x2-this.x1,this.y2-this.y1)}isPointInPath(e,t){return!1}render(e){const{ctx:t}=e;let{x1:i,y1:s,x2:n,y2:r}=this;i=this.align(i),s=this.align(s),n=this.align(n),r=this.align(r);const{fill:o,horizontal:a}=this,{globalAlpha:l}=t;o!=null&&(this.applyFillAndAlpha(t),t.beginPath(),t.moveTo(i,s),t.lineTo(n,s),t.lineTo(n,r),t.lineTo(i,r),t.closePath(),t.fill(),t.globalAlpha=l);const{stroke:c,strokeWidth:h,startLine:u,endLine:d}=this;if(!!((u||d)&&c&&h)){const{lineDash:f,lineDashOffset:y,lineCap:b,lineJoin:m}=this;this.applyStrokeAndAlpha(t),t.lineWidth=h,f&&t.setLineDash([...f]),y&&(t.lineDashOffset=y),b&&(t.lineCap=b),m&&(t.lineJoin=m),t.beginPath(),u&&(t.moveTo(i,s),a?t.lineTo(i,r):t.lineTo(n,s)),d&&(t.moveTo(n,r),a?t.lineTo(n,s):t.lineTo(i,r)),t.stroke(),t.globalAlpha=l}this.fillShadow?.markClean(),super.render(e)}};as.className="Range",as.defaultStyles={...Bi.defaultStyles,strokeWidth:1},g([_()],as.prototype,"x1",2),g([_()],as.prototype,"y1",2),g([_()],as.prototype,"x2",2),g([_()],as.prototype,"y2",2),g([_()],as.prototype,"startLine",2),g([_()],as.prototype,"endLine",2),g([_()],as.prototype,"horizontal",2);var Qw=(O(),N(T)),uh=(O(),N(T));function Jw(e){return e!=null&&Object.hasOwn(e,"toString")&&(0,uh.isString)(e.toString())}function eT(e){return e!=null&&Object.hasOwn(e,"valueOf")&&(0,uh.isFiniteNumber)(e.valueOf())}function dh(e){return(0,uh.isFiniteNumber)(e)||(0,uh.isValidDate)(e)||eT(e)}function tT(e,t){return e!=null&&(!t||dh(e))}function Wp(e){return Jw(e)&&Object.hasOwn(e,"id")?e.id:e}function J0(e){switch(e.type){case"line":return e.value;case"range":return e.range}}function ex(e,t){if(e==null)return!1;const i=Fe.is(t)||rs.is(t),s=n=>tT(n,i)&&!isNaN(t.convert(n));if((0,Qw.isArray)(e)){const[n,r]=e;return s(n)&&s(r)}else return s(e)}var iT={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:1},"top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:-1},"bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},sT={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:-1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:-1,labelV:-1},"inside-top-right":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},nT={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},rT={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:-1,labelV:-1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},Ui=class extends le{constructor(){super(...arguments),this.fontSize=14,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}};g([x],Ui.prototype,"enabled",2),g([x],Ui.prototype,"text",2),g([x],Ui.prototype,"fontStyle",2),g([x],Ui.prototype,"fontWeight",2),g([x],Ui.prototype,"fontSize",2),g([x],Ui.prototype,"fontFamily",2),g([x],Ui.prototype,"padding",2),g([x],Ui.prototype,"color",2),g([x],Ui.prototype,"position",2),g([x],Ui.prototype,"rotation",2),g([x],Ui.prototype,"parallel",2);var ri=class extends le{constructor(){super(),this.id=(0,Kw.createId)(this),this.defaultColorRange=[],this.fill="#c16068",this.label=new Ui,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.position="top",this.rangeGroup=new ue({name:this.id}),this.lineGroup=new ue({name:this.id}),this.labelGroup=new ue({name:this.id}),this.crossLineRange=new as,this.crossLineLabel=new ho,this.data=void 0,this.startLine=!1,this.endLine=!1,this._isRange=void 0,this.lineGroup.append(this.crossLineRange),this.labelGroup.append(this.crossLineLabel),this.crossLineRange.pointerEvents=1}get defaultLabelPosition(){return"top"}update(e){const{enabled:t,type:i,data:s,scale:n}=this;if(!n||!t||!e||!ex(J0(this),n)||s==null){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updateNodes();const r=i==="range";r!==this._isRange&&(r?this.rangeGroup.appendChild(this.crossLineRange):this.lineGroup.appendChild(this.crossLineRange)),this._isRange=r}calculateLayout(e,t){if(this.data=void 0,!e)return;const{type:i,range:s,value:n,scale:r,clippedRange:o,strokeWidth:a=0}=this;if(!r)return;const l=r.bandwidth??0,c=r.step??0,h=(t?-1:1)*(r instanceof za?(c-l)/2:0);let u,d,p,f;if(i==="line"){const b=l/2;u=r.convert(n)+b,d=NaN,p=r.convert(n,{clamp:!0})+b,f=NaN}else if(s){const[b,m]=s,v=b?.valueOf()===m?.valueOf()&&hh.is(r)?l/2+h:0;u=r.convert(b)+v,d=r.convert(m)+l,p=r.convert(b,{clamp:!0})+v-h,f=r.convert(m,{clamp:!0})+l+h}else return;p=gp(p,o),f=gp(f,o);const y=(u===p||d===f||p!==f)&&Math.abs(f-p)>0;y&&p>f&&([p,f]=[f,p],[u,d]=[d,u]),u-h>=p&&(u-=h),d+h<=f&&(d+=h),this.startLine=a>0&&u>=p&&u<=p+h,this.endLine=a>0&&d>=f-l-h&&d<=f,!(i==="range"&&!y&&!this.startLine&&!this.endLine)&&(this.data=[p,f],this.label.enabled===!1||this.label.text)}updateNodes(){const{position:e,data:[t,i]=[0,0],gridLength:s}=this,n=Number.isFinite(i)?i-t:0;let r;switch(e){case"top":case"bottom":r=new U(t,e==="top"?0:-s,n,s);break;case"left":case"right":r=new U(e==="left"?0:-s,t,s,n)}this.updateRangeNode(r);const{label:o}=this;o.enabled!==!1&&o.text&&(this.updateLabel(),this.positionLabel(r))}updateRangeNode(e){const{type:t,position:i,crossLineRange:s,startLine:n,endLine:r,fill:o,fillOpacity:a,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:u}=this;s.x1=e.x,s.x2=e.x+e.width,s.y1=e.y,s.y2=e.y+e.height,s.horizontal=i==="top"||i==="bottom",s.startLine=n,s.endLine=r,s.fill=t==="range"?o:void 0,s.fillOpacity=a??1,s.stroke=l,s.strokeWidth=c??1,s.strokeOpacity=h??1,s.lineDash=u}updateLabel(){const{crossLineLabel:e,label:t}=this;t.text&&(e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.fontSize=t.fontSize,e.fontFamily=t.fontFamily,e.fill=t.color,e.text=t.text)}get anchor(){const e=this.position==="left"||this.position==="right",t=this.type==="range",{position:i=this.defaultLabelPosition}=this.label;return t?(e?nT:rT)[i]:(e?iT:sT)[i]}positionLabel(e){const{crossLineLabel:t,label:i,anchor:s}=this;t.rotation=dt(i.rotation??0),t.textBaseline="middle",t.textAlign="center";const n=t.getBBox();if(!n)return;const{width:r,height:o}=n,a=i.padding+r/2,l=i.padding+o/2,c=e.x+e.width*(s.rangeH+1)/2-a*s.labelH,h=e.y+e.height*(s.rangeV+1)/2-l*s.labelV;t.x=c,t.y=h,t.rotationCenterX=c,t.rotationCenterY=h}computeLabelSize(){const{label:e}=this;if(e.enabled===!1||!e.text)return;const t=new ho;t.fontFamily=e.fontFamily,t.fontSize=e.fontSize,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.text=e.text,t.rotation=dt(e.rotation??0),t.textBaseline="middle",t.textAlign="center";const i=t.getBBox();if(!i)return;const{width:s,height:n}=i;return{width:s,height:n}}calculatePadding(e){const{label:t,anchor:i}=this,s=this.computeLabelSize();if(!s)return;const{width:n,height:r}=s,o=t.padding+n,a=t.padding+r,l=this.position==="left"||this.position==="right";l&&(i.rangeH===-1&&i.labelH===1?e.left=Math.max(e.left??0,o):i.rangeH===1&&i.labelH===-1&&(e.right=Math.max(e.right??0,o))),l||(i.rangeV===-1&&i.labelV===1?e.top=Math.max(e.top??0,a):i.rangeV===1&&i.labelV===-1&&(e.bottom=Math.max(e.bottom??0,a)))}};ri.className="CrossLine",g([x],ri.prototype,"enabled",2),g([x],ri.prototype,"type",2),g([x],ri.prototype,"range",2),g([x],ri.prototype,"value",2),g([x],ri.prototype,"defaultColorRange",2),g([x],ri.prototype,"fill",2),g([x],ri.prototype,"fillOpacity",2),g([x],ri.prototype,"stroke",2),g([x],ri.prototype,"strokeWidth",2),g([x],ri.prototype,"strokeOpacity",2),g([x],ri.prototype,"lineDash",2),g([x],ri.prototype,"label",2);var oT=(O(),N(T)),At=class extends le{constructor(){super(...arguments),this.enabled=!0}getFont(){return Ue.toFontString(this)}};g([x],At.prototype,"enabled",2),g([x],At.prototype,"color",2),g([x],At.prototype,"fontStyle",2),g([x],At.prototype,"fontWeight",2),g([x],At.prototype,"fontSize",2),g([x],At.prototype,"fontFamily",2),g([x],At.prototype,"formatter",2);function aT(e,t,i=0,s=0){const n=zs(e),r=!n&&s>=0&&s<=Math.PI?-1:1,o=!n&&i>=0&&i<=Math.PI?-1:1;let a=0;return t?a=r*Math.PI/2:o===-1&&(a=Math.PI),{configuredRotation:n,defaultRotation:a,parallelFlipFlag:r,regularFlipFlag:o}}function lT(e,t){return e??(t?0:10)}function cT(e,t,i,s,n){if(e&&!t){const r=n?"hanging":"top";return i*s===-1?r:"bottom"}return"middle"}function tx(e,t,i,s,n){const r=t>0&&t<=Math.PI,o=i>0&&i<=Math.PI,a=r||o?-1:1;if(e)if(t||i){if(s*a===-1)return"end"}else return"center";else if(s*n===-1)return"end";return"start"}function Ya(e,t){if(e!=null){if(typeof e=="string")return e;if((0,oT.isPlainObject)(e)&&t!=null)return e[_p(t)]}}function hT(e,t,i,s,n,r,o){const a=Ya(t.format,r)??(typeof t.format=="string"?t.format:void 0),l={domain:s,ticks:n,fractionDigits:0,specifier:a},c=e.tickFormatter(l),h=r?jp(r):void 0,u=Ya(i?.format,h),d=u?e.tickFormatter({...l,specifier:u}):c,p=new Date(s[0]),f=new Date(s[s.length-1]),y=h?.range(new Date(s[0]),new Date(s[s.length-1]),{extend:!0});let b=0,m=0;if(c!=null){let v,M;y!=null&&y.length>1?(v=y[0],M=y[1]):(v=p,M=f);const S=ah(r,v,M,{limit:50});for(const D of S){const C=c(D),{width:k,height:L}=o.measureLines(C);b=Math.max(b,k),m=Math.max(m,L)}}if(d!=null&&y!=null)for(const v of y){const M=d(v),{width:S,height:D}=o.measureLines(M);b=Math.max(b,S),m=Math.max(m,D)}return{width:Math.ceil(b),height:Math.ceil(m)}}function uT(e,t,i,s){const n=[];for(const{tickLabel:r,translationY:o}of e){if(!r)continue;const{x:a,y:l}=i.transformBBox(new U(t,o,0,0)),{width:c,height:h}=s.measureLines(r);n.push({point:{x:a,y:l},label:{text:r,width:c,height:h}})}return n}function dT({width:e,height:t,spacing:i},s,n){const r=[];for(const o of[0,i]){const{x:a,y:l}=n.transformBBox(new U(s,o,0,0));r.push({point:{x:a,y:l},label:{text:void 0,width:e,height:t}})}return r}var ph=class{constructor(){this.enabled=!0,this.width=1,this.style=[{stroke:void 0,lineDash:[]}]}};g([x],ph.prototype,"enabled",2),g([x],ph.prototype,"width",2),g([x],ph.prototype,"style",2);var pr=class extends le{};g([x],pr.prototype,"step",2),g([x],pr.prototype,"values",2),g([x],pr.prototype,"minSpacing",2),g([x],pr.prototype,"maxSpacing",2);var ft=class extends le{constructor(){super(...arguments),this.enabled=!0,this.spacing=5,this.color="#575757",this.avoidCollisions=!0,this.mirrored=!1,this.parallel=!1}getSideFlag(){return this.mirrored?1:-1}getFont(){return Ue.toFontString(this)}};g([x],ft.prototype,"enabled",2),g([x],ft.prototype,"fontStyle",2),g([x],ft.prototype,"fontWeight",2),g([x],ft.prototype,"fontSize",2),g([x],ft.prototype,"fontFamily",2),g([x],ft.prototype,"spacing",2),g([x],ft.prototype,"minSpacing",2),g([x],ft.prototype,"color",2),g([x],ft.prototype,"rotation",2),g([x],ft.prototype,"avoidCollisions",2),g([x],ft.prototype,"mirrored",2),g([x],ft.prototype,"parallel",2),g([x],ft.prototype,"itemStyler",2),g([x],ft.prototype,"formatter",2),g([x],ft.prototype,"format",2);var gh=class{constructor(){this.enabled=!0,this.width=1,this.stroke=void 0}};g([x],gh.prototype,"enabled",2),g([x],gh.prototype,"width",2),g([x],gh.prototype,"stroke",2);var gr=class extends le{constructor(){super(...arguments),this.enabled=!0,this.width=1,this.size=6}};g([x],gr.prototype,"enabled",2),g([x],gr.prototype,"width",2),g([x],gr.prototype,"size",2),g([x],gr.prototype,"stroke",2);var ls=class extends le{constructor(){super(...arguments),this.caption=new Ye,this.enabled=!1,this.spacing=Ye.SMALL_PADDING,this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always"}};g([x],ls.prototype,"enabled",2),g([x],ls.prototype,"text",2),g([x],ls.prototype,"spacing",2),g([x],ls.prototype,"fontStyle",2),g([x],ls.prototype,"fontWeight",2),g([x],ls.prototype,"fontSize",2),g([x],ls.prototype,"fontFamily",2),g([x],ls.prototype,"color",2),g([x],ls.prototype,"wrapping",2),g([x],ls.prototype,"formatter",2);var ix=(e=>(e[e.TickAndDomain=0]="TickAndDomain",e[e.TicksOnly=1]="TicksOnly",e[e.Off=2]="Off",e))(ix||{});function sx(e){const[t,i]=Dt(e.range),s=Math.floor(t),n=Math.ceil(i);return{min:s,max:n,visible:s!==n}}var Hp=Math.PI*2,pT=Hp/2;function gT(e,t){return Math.abs(t-e)<pT?t:e>t?t+Hp:t-Hp}function nx(e){const{min:t,max:i}=e,s=l=>l<t||l>i;return{tick:{fromFn(l,c,h){let{x1:u,x2:d,y1:p,y2:f}=l,y=l.opacity;return(h==="added"||s(c.offset))&&({x1:u,x2:d,y1:p,y2:f}=c,y=0),{x1:u,x2:d,y1:p,y2:f,opacity:y,phase:os[h]}},toFn(l,c,h){const{x1:u,x2:d,y1:p,y2:f}=c;let y=1;return h==="removed"&&(y=0),{x1:u,x2:d,y1:p,y2:f,opacity:y}},applyFn(l,c){l.setProperties(c),l.visible=!s(l.y)}},line:{fromFn(l,c){const{x1:h,x2:u,y1:d,y2:p}=l.previousDatum??c;return{x1:h,x2:u,y1:d,y2:p,phase:os.updated}},toFn(l,c){const{x1:h,x2:u,y1:d,y2:p}=c;return{x1:h,x2:u,y1:d,y2:p}}},label:{fromFn(l,c,h){const u=l.previousDatum??c;let{x:d,y:p,rotationCenterX:f,rotationCenterY:y,rotation:b}=u,m=l.opacity;return h==="removed"||s(u.y)?b=c.rotation:(h==="added"||s(l.datum.y))&&({x:d,y:p,rotationCenterX:f,rotationCenterY:y,rotation:b}=c,m=0),{x:d,y:p,rotationCenterX:f,rotationCenterY:y,rotation:b,opacity:m,phase:os[h]}},toFn(l,c,h){const{x:u,y:d,rotationCenterX:p,rotationCenterY:f}=c;let y=0,b=1;return h==="added"?y=c.rotation:h==="removed"?(b=0,y=c.rotation):y=gT(l.previousDatum?.rotation??c.rotation,c.rotation),{x:u,y:d,rotationCenterX:p,rotationCenterY:f,rotation:y,opacity:b,finish:{rotation:c.rotation}}}},group:{fromFn(l,c){const{translationX:h,translationY:u}=l;return{translationX:h,translationY:u,phase:os.updated}},toFn(l,c){const{translationX:h,translationY:u}=c;return{translationX:h,translationY:u}}}}}function rx(){return(e,t)=>({translationX:t.translationX,translationY:t.translationY})}function fh(){return(e,t)=>({x:t.x,y:t.y,rotationCenterX:t.rotationCenterX,rotationCenterY:t.rotationCenterY,rotation:t.rotation})}function Yp(){return(e,t)=>{const{x1:i,x2:s,y1:n,y2:r}=t;return{x1:i,x2:s,y1:n,y2:r}}}var fT=(O(),N(T)),mT={millisecond:"%Y %b %e %H:%M:%S.%L",second:"%Y %b %e %H:%M:%S",minute:"%Y %b %e %H:%M",hour:"%Y %b %e %H:%M",day:"%Y %b %e",month:"%Y %b",year:"%Y"},Ln={year:0,month:1,day:2,hour:3,minute:4,second:5,millisecond:6},yT=/%[-_0]?L/,bT=/%[-_0]?S/,xT=/%[-_0]?M/,vT=/%[-_0]?[HI]/,MT=/^%[-_0]?[de]$/,ST=/^%[-_0]?[Bbm]$/,DT=/^%[-_0]?[Yy]$/;function IT(e,t){if(!(0,fT.isPlainObject)(e))return e;const i=_p(t),{millisecond:s,second:n,minute:r,hour:o,day:a,month:l,year:c}=e,h=Ln[i],u=mT[i];if(h>=Ln.year&&!DT.test(c)||h>=Ln.month&&!ST.test(l)||h>=Ln.day&&!MT.test(a))return u;let d;switch(i){case"year":return c;case"month":return`${l} ${c}`;case"day":return`${l} ${a} ${c}`;case"hour":d=o;break;case"minute":d=r;break;case"second":d=n;break;case"millisecond":d=s;break;default:return u}return h>=Ln.hour&&!vT.test(d)||h>=Ln.minute&&!xT.test(d)||h>=Ln.second&&!bT.test(d)||h>=Ln.millisecond&&!yT.test(d)?u:`${d} ${l} ${a} ${c}`}var AT=class extends ar(Xt){},ox=(e=>(e[e.TickLines=0]="TickLines",e[e.AxisLine=1]="AxisLine",e[e.TickLabels=2]="TickLabels",e))(ox||{}),Zs=class hD{constructor(t,i){this.moduleCtx=t,this.scale=i,this.id=(0,Pp.createId)(this),this.nice=!0,this.reverse=!1,this.keys=[],this.interval=new pr,this.dataDomain={domain:[],clipped:!1},this.layoutConstraints={stacked:!0,align:"start",width:100,unit:"percent"},this.boundSeries=[],this.includeInvisibleDomains=!1,this.interactionEnabled=!0,this.axisGroup=new ue({name:`${this.id}-axis`}),this.tickLineGroup=this.axisGroup.appendChild(new lo({name:`${this.id}-Axis-tick-lines`,zIndex:0})),this.tickLabelGroup=this.axisGroup.appendChild(new lo({name:`${this.id}-Axis-tick-labels`,zIndex:2})),this.labelGroup=new ue({name:`${this.id}-Labels`,zIndex:9}),this.gridGroup=new Ot({name:`${this.id}-Axis-grid`,zIndex:1}),this.gridLineGroup=this.gridGroup.appendChild(new ue({name:`${this.id}-gridLines`})),this.crossLineRangeGroup=new lo({name:`${this.id}-CrossLines-Range`,zIndex:4}),this.crossLineLineGroup=new lo({name:`${this.id}-CrossLines-Line`,zIndex:8}),this.crossLineLabelGroup=new lo({name:`${this.id}-CrossLines-Label`,zIndex:13}),this.tickLabelGroupSelection=ht.select(this.tickLabelGroup,ho,!1),this._crossLines=[],this.line=new gh,this.tick=new gr,this.gridLine=new ph,this.label=this.createLabel(),this.defaultTickMinSpacing=hD.defaultTickMinSpacing,this.translation={x:0,y:0},this.layout={label:{fractionDigits:0,spacing:this.label.spacing,format:this.label.format}},this.axisContext=void 0,this.labelFormatter=void 0,this.datumFormatter=void 0,this.scaleFormatterParams=void 0,this.destroyFns=[],this.range=[0,1],this.visibleRange=[0,1],this.title=new ls,this.gridLength=0,this.gridPadding=0,this.seriesAreaPadding=0,this.animatable=!0,this._cachedUnzoomedInputDomain=void 0,this._cachedUnzoomedRangeExtent=NaN,this._cachedUnzoomedTickCount=0,this.moduleMap=new Fp,this.range=this.scale.range.slice(),this.crossLines.forEach(s=>this.initCrossLine(s))}get type(){return this.constructor.type??""}get labelNodes(){return this.tickLabelGroupSelection.nodes()}set crossLines(t){const{CrossLineConstructor:i}=this.constructor;this._crossLines.forEach(s=>this.detachCrossLine(s)),this._crossLines=t.map(s=>{const n=new i;return n.set(s),n}),this._crossLines.forEach(s=>{this.attachCrossLine(s),this.initCrossLine(s)})}get crossLines(){return this._crossLines}resetAnimation(t){}attachCrossLine(t){this.crossLineRangeGroup.appendChild(t.rangeGroup),this.crossLineLineGroup.appendChild(t.lineGroup),this.crossLineLabelGroup.appendChild(t.labelGroup)}detachCrossLine(t){this.crossLineRangeGroup.removeChild(t.rangeGroup),this.crossLineLineGroup.removeChild(t.lineGroup),this.crossLineLabelGroup.removeChild(t.labelGroup)}destroy(){this.moduleMap.destroy(),this.destroyFns.forEach(t=>t())}updateScale(){const{range:t,visibleRange:i,scale:s}=this,n=(t[1]-t[0])/(i[1]-i[0]),r=n*i[0],o=t[0]-r;s.range=[o,o+n],this.crossLines.forEach(a=>{a.clippedRange=[t[0],t[1]]})}setCrossLinesVisible(t){this.crossLineRangeGroup.visible=t,this.crossLineLineGroup.visible=t,this.crossLineLabelGroup.visible=t}attachAxis(t){t.gridNode.appendChild(this.gridGroup),t.axisNode.appendChild(this.axisGroup),t.labelNode.appendChild(this.labelGroup),t.crossLineRangeNode.appendChild(this.crossLineRangeGroup),t.crossLineLineNode.appendChild(this.crossLineLineGroup),t.crossLineLabelNode.appendChild(this.crossLineLabelGroup)}detachAxis(t){t.gridNode.removeChild(this.gridGroup),t.axisNode.removeChild(this.axisGroup),t.labelNode.removeChild(this.labelGroup),t.crossLineRangeNode.removeChild(this.crossLineRangeGroup),t.crossLineLineNode.removeChild(this.crossLineLineGroup),t.crossLineLabelNode.removeChild(this.crossLineLabelGroup)}attachLabel(t){this.labelGroup.append(t)}inRange(t,i=0){const[s,n]=Dt(this.range);return t>=s-i&&t<=n+i}getRangeOverflow(t){const{range:i,visibleRange:s}=this,n=(i[1]-i[0])/(s[1]-s[0]),[r,o]=Dt([i[0]-n*s[0],i[0]-n*s[0]+n]);return t<r?t-r:t>o?t-o:0}defaultDatumFormatter(t,i){return Hs(t,i+1)}defaultLabelFormatter(t,i){return Hs(t,i)}onGridLengthChange(t,i){i^t&&this.onGridVisibilityChange(),this.crossLines.forEach(s=>this.initCrossLine(s))}onGridVisibilityChange(){}createLabel(){return new ft}update(){this.updatePosition(),this.updateSelections(),this.tickLineGroup.visible=this.tick.enabled,this.gridLineGroup.visible=this.gridLine.enabled,this.tickLabelGroup.visible=this.label.enabled,this.updateLabels(),this.updateCrossLines()}getLabelStyles(t,i,s=this.label){const n={color:s.color,spacing:s.spacing,fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight};let r;s.itemStyler&&(r=this.callWithContext(s.itemStyler,{...t,...n}));const{color:o,fontFamily:a,fontSize:l,fontStyle:c,fontWeight:h,spacing:u}=xe(r,i,n);return{fill:o,fontFamily:a,fontSize:l,fontStyle:c,fontWeight:h,spacing:u}}getTickSize(t=this.tick){return t.enabled?t.size:0}processData(){const{includeInvisibleDomains:t,boundSeries:i,direction:s}=this,r=(t?i:i.filter(o=>o.isEnabled())).map(o=>o.getDomain(s));this.setDomains(...r)}setDomains(...t){let i,s;t.length>0?{domain:i,animatable:s}=this.scale.normalizeDomains(...t):(i=[],s=!0),this.dataDomain=this.normaliseDataDomain(i),this.reverse&&this.dataDomain.domain.reverse(),this.animatable=s}calculateLayout(t,i){const{scale:s,label:n,visibleRange:r,nice:o}=this;this.chartPadding=i,this.updateScale();const a=xo(this.range),l=this.dataDomain.domain;let c,h;if(r[0]===0&&r[1]===1)c=void 0,h=void 0;else if(this._cachedUnzoomedInputDomain===l&&this._cachedUnzoomedRangeExtent===a)c=this.scale.domain,h=this._cachedUnzoomedTickCount;else{const D=this.calculateTickLayout(l,o?0:2,[0,1]);c=D.niceDomain,h=D.rawTickCount??0}let u;o?c==null?u=0:u=1:u=2;const{niceDomain:d,ticks:p,rawTickCount:f=0,tickDomain:y,fractionDigits:b,bbox:m}=this.calculateTickLayout(c??l,u,r,t);h??(h=f);const v=f!==0&&h!==0?{zoomed:f,unzoomed:h}:void 0,M=ki.is(s)?s.interval:void 0;this.scale.domain=d,this._cachedUnzoomedInputDomain=l,this._cachedUnzoomedRangeExtent=a,this._cachedUnzoomedTickCount=h;const S=Ya(M==null?n.format:IT(n.format,M),M);return this.labelFormatter=s.tickFormatter({domain:y,specifier:S,ticks:p,fractionDigits:b})??(D=>this.defaultLabelFormatter(D,b)),this.datumFormatter=s.datumFormatter({domain:y,specifier:S,ticks:p,fractionDigits:b})??(D=>this.defaultDatumFormatter(D,b)),this.scaleFormatterParams={domain:y,ticks:p,fractionDigits:b},this.layout.label={fractionDigits:b,spacing:this.label.spacing,format:this.label.format},this.layoutCrossLines(),{primaryTickCount:v,bbox:m}}updateCrossLines(){const t=this.isAnySeriesActive();this.crossLines.forEach(i=>{i.update(t)})}updatePosition(){const{crossLineRangeGroup:t,crossLineLineGroup:i,crossLineLabelGroup:s,gridGroup:n,translation:r}=this,o=Math.floor(r.x),a=Math.floor(r.y);n.setProperties({translationX:o,translationY:a}),t.setProperties({translationX:o,translationY:a}),i.setProperties({translationX:o,translationY:a}),s.setProperties({translationX:o,translationY:a})}formatTick(t,i,s,n,r,o){const{labelFormatter:a,label:{formatter:l}}=this;let c;if(l){const h=this.getFormatterBoundSeries(),u=r?_p(r):void 0,d=r?$w(r):void 0;c=this.callWithContext(l,{value:t,index:i,domain:s,fractionDigits:n,unit:u,step:d,boundSeries:h})}else o?c=o(t):a&&(c=a(t));return String(c??t)}formatDatum(t){const{label:{formatter:i},datumFormatter:s=this.labelFormatter}=this;let n;if(i){const{domain:r}=this.scale,o=this.getFormatterBoundSeries();n=this.callWithContext(i,{value:t,index:NaN,domain:r,boundSeries:o})}else s?n=this.callWithContext(s,t):(0,Pp.isArray)(t)&&(n=t.filter(Boolean).join(" - "));return String(n??t)}getScaleValueFormatter(t){const{scaleFormatterParams:i}=this;let s;try{t!=null&&i!=null&&(s=this.scale.tickFormatter({...i,specifier:t}))}catch{Pp.Logger.warnOnce(`the format string ${t} is invalid, ignoring.`)}return s??(s=n=>this.formatDatum(n)),s}getBBox(){return this.axisGroup.getBBox()}initCrossLine(t){t.scale=this.scale,t.gridLength=this.gridLength}isAnySeriesActive(){return this.boundSeries.some(t=>this.includeInvisibleDomains||t.isEnabled())}clipTickLines(t,i,s,n){this.tickLineGroup.setClipRect(new U(t,i,s,n))}clipGrid(t,i,s,n){this.gridGroup.setClipRect(new U(t,i,s,n))}getFormatterBoundSeries(){const{direction:t}=this,i=[];for(const s of this.boundSeries){const n=s.getKeys(t),r=s.getNames(t);for(let o=0;o<n.length;o++)i.push({key:n[o],name:r[o]})}return i}getTitleFormatterParams(t){const{direction:i}=this,s=this.getFormatterBoundSeries();return{domain:t,direction:i,boundSeries:s,defaultValue:this.title?.text}}normaliseDataDomain(t){return{domain:[...t],clipped:!1}}getLayoutState(){return{id:this.id,rect:this.getBBox(),gridPadding:this.gridPadding,seriesAreaPadding:this.seriesAreaPadding,tickSize:this.getTickSize(),direction:this.direction,domain:this.dataDomain.domain,scale:this.scale,...this.layout}}getModuleMap(){return this.moduleMap}createModuleContext(){return this.axisContext??(this.axisContext=this.createAxisContext()),{...this.moduleCtx,parent:this.axisContext}}createAxisContext(){const{scale:t}=this;return{axisId:this.id,scale:this.scale,direction:this.direction,continuous:Fe.is(t)||rs.is(t),getCanvasBounds:()=>Qe.toCanvas(this.axisGroup),seriesKeyProperties:()=>this.boundSeries.reduce((i,s)=>(s.getKeyProperties(this.direction).forEach(r=>i.add(r)),i),new Set),seriesIds:()=>this.boundSeries.map(i=>i.id),scaleValueFormatter:i=>this.getScaleValueFormatter(i),scaleInvert:i=>t.invert(i,!0),scaleInvertNearest:i=>t.invert(i,!0),attachLabel:i=>this.attachLabel(i),inRange:(i,s)=>this.inRange(i,s),getRangeOverflow:i=>this.getRangeOverflow(i)}}isReversed(){return this.reverse}callWithContext(t,...i){const{callbackCache:s,chartService:n}=this.moduleCtx;return s.call(this,n,t,...i)}};Zs.defaultTickMinSpacing=50,Zs.CrossLineConstructor=ri,g([x],Zs.prototype,"nice",2),g([x],Zs.prototype,"reverse",2),g([x],Zs.prototype,"keys",2),g([x],Zs.prototype,"interval",2),g([x],Zs.prototype,"title",2),g([Mn((e,t,i)=>e.onGridLengthChange(t,i))],Zs.prototype,"gridLength",2);var $p=Zs,Kp=(O(),N(T)),LT=(O(),N(T));function kT(e,t,i,s,n){let[r,o]=Dt(t.map(Number));const a=Math.floor(i.unzoomed);if(a<=1){const[m,v]=CT(r,o),M=5*Math.pow(2,-Math.ceil(Math.log2(n[1]-n[0]))),{ticks:S}=Ua(m,v,M,void 0,void 0,n),D=[e.toDomain(m),e.toDomain(v)];return s&&D.reverse(),{domain:D,ticks:S}}if(r===o){const m=Math.floor(Math.log10(r)),v=Math.pow(10,m),M=Math.min(v,1),S=a-1;r-=M*Math.floor(S/2),o=r+M*S}let l=r,c=o;l=wT(l,c,a);const h=NT(l,c,a),u=a-1;c=l+u*h;const d=Math.floor(l/h)*h,p=Math.floor(c/h)*h;d<=r&&p>=o&&(l=d,c=p);const f=[e.toDomain(l),e.toDomain(c)];s&&f.reverse();const y=h*((i.unzoomed-1)/(i.zoomed-1)),b=TT(l,y,Math.floor(i.zoomed));return{domain:f,ticks:b}}function CT(e,t){let i=e,s=t,n=0;do{[i,s]=Z0(i,s);const{ticks:r}=Ua(i,s,5);if(r.length%2===1)return[i,s];i-=1,s+=1}while(n++<10);return[e,t]}function wT(e,t,i){e=Math.floor(e);const s=Math.abs(t-e)/(i-1),n=Math.floor(Math.log10(s)),r=Math.pow(10,n);return Math.floor(e/r)*r}function TT(e,t,i){const s=(0,LT.countFractionDigits)(t),n=Math.pow(10,s),r=[];for(let o=0;o<i;o++){const a=e+t*o;r.push(Math.round(a*n)/n)}return r}function NT(e,t,i){const s=i-1,n=(t-e)/s;return OT(n)}function OT(e){const t=Math.floor(Math.log10(e)),i=Math.pow(10,t),s=e/i;return s>0&&s<=1?i:s>1&&s<=2?2*i:s>2&&s<=5?5*i:s>5&&s<=10?10*i:e}function Zp(){const e=new Map;return t=>{const i=e.get(t);return i?(e.set(t,i+1),`${t}_${i}`):(e.set(t,1),t)}}function ET(e){if(e.length<2)return 1/0;let t=0,i=e[0].translationY;for(let s=1;s<e.length;s++){const n=e[s].translationY,r=Math.abs(n-i);t=Math.max(t,r),i=n}return t}var ax=class{constructor(e){this.axis=e}estimateTickCount(e,t,i){const{scale:s,range:n,defaultTickMinSpacing:r}=this.axis,o=ki.is(s)?ki.defaultTickCount:Fe.defaultTickCount;return X0(xo(n),xo(e),t,i,o,r)}filterTicks(e,t){const{minSpacing:i,maxSpacing:s}=this.axis.interval,r=i!=null||s!=null?Math.ceil(e.length/t):2,o=e.length%r?-1:0;return e.filter((a,l)=>(l+o)%r===0)}generateTicks({domain:e,primaryTickCount:t,visibleRange:i,niceMode:s,parallelFlipRotation:n,regularFlipRotation:r,labelX:o,sideFlag:a,removeOverflowLabels:l,removeOverflowThreshold:c=0}){const{scale:h,label:u,primaryLabel:d,interval:{minSpacing:p,maxSpacing:f}}=this.axis,{parallel:y,fontFamily:b,fontSize:m,fontStyle:v,fontWeight:M}=u,S=t!==void 0,{defaultRotation:D,configuredRotation:C,parallelFlipFlag:k,regularFlipFlag:L}=aT(u.rotation,y,r,n),{maxTickCount:w}=this.estimateTickCount(i,p,f),R=!(Fe.is(h)||rs.is(h))||isNaN(w)?10:w;let G=tx(y,C,0,a,L);const Y=cT(y,C,a,k,d==null),he=Ue.toFontString({fontFamily:b,fontSize:m,fontStyle:v,fontWeight:M}),se=As.getMeasurer({font:he}),de={fontFamily:b,fontSize:m,fontStyle:v,fontWeight:M,textBaseline:Y,textAlign:G},ge=u.enabled&&u.avoidCollisions,ye=C+D,J=new Gs,W=X=>{const fe=ye+X;Gs.updateTransformMatrix(J,1,1,fe,0,0)},V=({ticks:X},fe)=>(W(fe),uT(X,o,J,se)),ee=(X,fe)=>{const{niceDomain:Ie,ticks:Te,rawTicks:qe,timeInterval:Tt}=X;if(Tt==null)return[];W(fe);const _t=ET(Te),{width:$t,height:ys}=hT(h,u,d,Ie??e,qe,Tt,se);return dT({width:$t,height:ys,spacing:_t},o,J)},ie=(X,fe)=>{if(!ge)return!1;const Ie=C!==0||fe!==0,Te=lT(u.minSpacing,Ie);return A0(ee(X,fe),Te)||A0(V(X,fe),Te)};let ne={tickDomain:[],ticks:[],rawTicks:[],rawTickCount:void 0,timeInterval:void 0,fractionDigits:0,niceDomain:void 0},me=0,Z=0,te=!0,B=!1;for(;!B&&te&&me<=R;){Z=0;for(const X of this.getTickStrategies({domain:e,niceMode:s,secondaryAxis:S,index:me}))({tickData:ne,index:me,autoRotation:Z,terminate:B}=X({index:me,tickData:ne,textProps:de,terminate:B,primaryTickCount:t,visibleRange:i,labelsOverlap(){return ie(ne,Z)}}));te=ie(ne,Z)}G=tx(y,C,Z,a,L);const q=C+Z;if(l&&ne.ticks.length>2){const X=V(ne,Z),fe=ne.ticks.at(-1),Ie=X.at(-1);if(fe!=null&&Ie!=null&&fe.translationY+Ie.label.width/2>this.axis.range[1]+c){fe.tickLabel=void 0;const Te=ne.ticks[0];Te.translationY===0&&i[0]===0&&i[1]===1&&(Te.tickLabel=void 0)}}return{tickData:ne,rotation:q,textBaseline:Y,textAlign:G}}getTickStrategies({domain:e,niceMode:t,index:i,secondaryAxis:s}){const{scale:n,label:r,interval:o}=this.axis,{minSpacing:a}=o,l=Fe.is(n)||rs.is(n),c=r.enabled&&r.avoidCollisions,h=!l&&i!==0&&c,u=r.autoRotate===!0&&r.rotation===void 0,d=[];let p;o.values?p=3:s?p=1:h?p=2:p=0;const f=({index:y,tickData:b,primaryTickCount:m,visibleRange:v,terminate:M})=>this.createTickData(e,t,v,m,p,y,b,M);if(d.push(f),!l&&a!=null){const y=({index:b,tickData:m,primaryTickCount:v,visibleRange:M,terminate:S})=>this.createTickData(e,t,M,v,2,b,m,S);d.push(y)}if(c&&u){const y=({index:b,tickData:m,labelsOverlap:v,terminate:M})=>({index:b,tickData:m,autoRotation:v()?zs(r.autoRotateAngle):0,terminate:M});d.push(y)}return d}ticksEqual(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i+=1)if(e[i]?.valueOf()!==t[i]?.valueOf())return!1;return!0}createTickData(e,t,i,s,n,r,o,a){const{scale:l,interval:c}=this.axis,{step:h,values:u,minSpacing:d,maxSpacing:p}=c,{maxTickCount:f,minTickCount:y,tickCount:b}=this.estimateTickCount(i,d,p),m=Fe.is(l)||rs.is(l),v=!m||isNaN(f)?10:f,M=k=>m?Math.max(b-k,y):f,S=o.rawTicks,D=h==null&&u==null&&M(r)>y&&(m||n===2),C={domain:e,niceMode:t,visibleRange:i,primaryTickCount:s,tickGenerationType:n,previousTicks:S,minTickCount:y,maxTickCount:f,tickCount:0};if(C.tickCount=M(r),o=this.getTicks(C),D&&this.ticksEqual(o.rawTicks,S)){let k=r,L=v;for(;k<=L;)r=(k+L)/2|0,C.tickCount=M(r),o=this.getTicks(C),this.ticksEqual(o.rawTicks,S)?k=r+1:L=r-1}return r+=1,a||(a=h!=null||u!=null),{tickData:o,index:r,autoRotation:0,terminate:a}}getTimeIntervalTicks(e,t,i){const s=jp(i);if(s==null)return;const{scale:n,reverse:r}=this.axis;if(!Ha.is(n)&&!rs.is(n))return;r&&(e=[1-e[1],1-e[0]]);const o=Math.min(n.domain[0].valueOf(),n.domain[n.domain.length-1].valueOf()),a=Math.max(n.domain[0].valueOf(),n.domain[n.domain.length-1].valueOf());let[l,c]=gt.extent(new Date(o),new Date(a),e);l=s.floor(l),l.valueOf()>=o&&(l=s.previous(l)),c=s.ceil(c),c.valueOf()<=a&&(c=s.next(c));const h=s.range(l,c),u=ko(i),d=ki.is(n)&&n.interval!=null&&ko(n.interval)<u;let p,f=new Set;if(Ha.is(n)||ki.is(n)){p=[];const y={...t,interval:i},b=!ki.is(n)||d;for(let m=0;m<h.length-1;m+=1){const v=h[m],M=h[m+1],S=m===h.length-2,D=M.valueOf()-v.valueOf(),C=[Math.max((o-v.valueOf())/D,0),Math.min((a-v.valueOf())/D,1)],k=b?this.timeScaleTicks(y,[v,M],C,!0):n.ticks(y,[v,M],C,!0)?.ticks??[];if((0,Kp.dropFirstWhile)(k,R=>R.valueOf()<v.valueOf()),S||(0,Kp.dropLastWhile)(k,R=>b?R.valueOf()+u>M.valueOf():R.valueOf()>=M.valueOf()),k.length===0)continue;const L=k[0],w=lh(L,v);(b?w===0:w<=u)&&f.add(p.length),p.push(...k)}}else if(hh.is(n)){p=n.ticks(t,void 0,e,!0)?.ticks??[];let y=0;for(let b=0;b<p.length;b++){const m=p[b];let v=!1;for(;y<h.length&&lh(h[y],m)<=0;)v=!0,y++;v&&f.add(b)}}else p=[];return(f.size===0||f.size===1&&f.has(0))&&(f=void 0),{ticks:p,tickCount:void 0,primaryTicksIndices:f,interpolate:d}}timeScaleTicks(e,t,i,s){const{interval:n}=e;if(n==null)return t;const r=t[0].valueOf(),o=t[1].valueOf();if(typeof n!="number")return dr(n).every(1,{snapTo:t[0]}).range(t[0],t[1],{visibleRange:i,extend:s});const a=[];for(let l=r;l<=o;l+=n){const c=new Date(l);a.push(c)}return a}getTicks({domain:e,niceMode:t,visibleRange:i,tickGenerationType:s,previousTicks:n,tickCount:r,minTickCount:o,maxTickCount:a,primaryTickCount:l}){const{axis:c}=this,{label:h,primaryLabel:u,range:d,scale:p,interval:f}=c,y=Zp(),b={nice:t===0,interval:f.step,tickCount:r,minTickCount:o,maxTickCount:a},m={...b,nice:t===0||t===1};let v;s===1&&l!=null&&Fe.is(p)&&(v=kT(p,e,l,c.reverse,i));const M=t===0?v?.domain??p.niceDomain(b,e):e;let S=M,D,C,k,L,w=!1;const P=p.domain;switch(p.domain=M,s){case 3:if(S=f.values,D=f.values,C=D.length,w=ki.is(p),Fe.is(p)){const[J,W]=Dt(M.map(Number));D=D.filter(V=>Number(V)>=J&&Number(V)<=W).sort((V,ee)=>Number(V)-Number(ee))}break;case 1:if(v)D=v.ticks,C=v.ticks.length;else{const J=p.ticks(m,M,i);D=J?.ticks??[],C=J?.count}break;case 2:D=this.filterTicks(n,r),C=void 0;break;default:{if(M.length>0&&m.interval==null&&(ki.is(p)||u!=null&&(Ha.is(p)||hh.is(p)))){const V=M,ee=Math.min(V[0].valueOf(),V[V.length-1].valueOf()),ie=Math.max(V[0].valueOf(),V[V.length-1].valueOf());k=Vp(ee,ie,r,o,a,{weekStart:u==null?ks:void 0,primaryOnly:ki.is(p)})}const J=ki.is(p)?p.interval:void 0;J!=null&&k!=null&&ko(J)>ko(k)&&(k=J);const W=k?this.getTimeIntervalTicks(i,m,k):void 0;if(W)({ticks:D,tickCount:C,primaryTicksIndices:L,interpolate:w}=W);else{const V=ki.is(p)&&k!=null?{...m,interval:m.interval??k}:m,ee=p.ticks(V,M,i);D=ee?.ticks??[],C=ee?.count}}}const R=D.reduce((J,W)=>Math.max(J,typeof W=="number"?(0,Kp.countFractionDigits)(W):0),0),G=Ya(h.format,k)??(typeof h.format=="string"?h.format:void 0),Y={domain:S,ticks:D,fractionDigits:R,specifier:G},he=p.tickFormatter(Y),se=Ya(u?.format,k?jp(k):void 0),de=se?p.tickFormatter({...Y,specifier:se}):he,ge=(p.bandwidth??0)/2,ye=[];for(let J=0;J<D.length;J++){const W=D[J],V=p.convert(W,{interpolate:w})+ge,ee=L?.has(J)??!1;if(d.length>0&&!c.inRange(V,.001))continue;const ie=ee&&u?.enabled===!0?de:he,ne=h.enabled?c.formatTick(W,J,M,R,k,ie):"";ye.push({tick:W,tickId:y(ne),tickLabel:ne,translationY:Math.floor(V),primary:ee})}return p.domain=P,{tickDomain:S,rawTicks:D,rawTickCount:C,fractionDigits:R,timeInterval:k,ticks:ye,niceDomain:M}}},Xp=class extends ft{constructor(){super(...arguments),this.autoRotateAngle=335}};g([x],Xp.prototype,"autoRotate",2),g([x],Xp.prototype,"autoRotateAngle",2);var qp=class uD extends $p{constructor(t,i){super(t,i),this.headingLabelGroup=this.axisGroup.appendChild(new Ot({name:`${this.id}-Axis-heading`})),this.lineNodeGroup=this.axisGroup.appendChild(new Ot({name:`${this.id}-Axis-line`})),this.lineNode=this.lineNodeGroup.appendChild(new Xt({zIndex:1})),this.tickLineGroupSelection=ht.select(this.tickLineGroup,Xt,!1),this.gridLineGroupSelection=ht.select(this.gridLineGroup,Xt,!1),this.tempText=new ho({debugDirty:!1}),this.tempCaption=new Ye,this.tickGenerator=new ax(this),this.generatedTicks=void 0,this.animationManager=t.animationManager,this.animationState=new Va("empty",{empty:{update:{target:"ready",action:()=>this.resetSelectionNodes()},reset:"empty"},ready:{update:n=>this.animateReadyUpdate(n),resize:()=>this.resetSelectionNodes(),reset:"empty"}}),this.headingLabelGroup.appendChild(this.title.caption.node);let s;this.destroyFns.push(t.layoutManager.addListener("layout:complete",n=>{const r=[n.chart.width,n.chart.height];s!=null&&!(0,oh.arraysEqual)(r,s)&&this.animationState.transition("resize"),s=r}),this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}static is(t){return t instanceof uD}get primaryLabel(){}get primaryTick(){}get horizontal(){return this.position==="top"||this.position==="bottom"}onGridVisibilityChange(){this.gridLineGroupSelection.clear()}resetAnimation(t){t==="initial"&&this.animationState.transition("reset")}get direction(){return this.position==="top"||this.position==="bottom"?"x":"y"}createAxisContext(){return{...super.createAxisContext(),position:this.position}}createLabel(){return new Xp}updateDirection(){switch(this.position){case"top":this.label.mirrored=!0,this.label.parallel=!0;break;case"right":this.label.mirrored=!0,this.label.parallel=!1;break;case"bottom":this.label.mirrored=!1,this.label.parallel=!0;break;case"left":this.label.mirrored=!1,this.label.parallel=!1;break}this.axisContext&&(this.axisContext.position=this.position,this.axisContext.direction=this.direction)}calculateLayout(t,i){return this.updateDirection(),super.calculateLayout(t,i)}layoutCrossLines(){const t=this.isAnySeriesActive();this.crossLines.forEach(i=>{i.calculateLayout?.(t,this.reverse)})}calculateTickLayout(t,i,s,n){const r=this.label.getSideFlag(),o=this.horizontal?-.5*Math.PI:0,a=ot(o),l=ot(o-Math.PI/2),c=r*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding);if(i===2&&this.label.enabled===!1&&this.tick.enabled===!1&&this.gridLine.enabled===!1){const{bbox:J,spacing:W}=this.tickBBox(t,[],[]);return this.generatedTicks={ticks:[],tickLines:[],gridLines:[],labels:[],spacing:W},{ticks:[],rawTickCount:0,tickDomain:t,niceDomain:t,fractionDigits:0,timeInterval:void 0,bbox:J}}const h=this.horizontal&&Fe.is(this.scale),u=this.tickGenerator.generateTicks({domain:t,niceMode:i,visibleRange:s,primaryTickCount:n,parallelFlipRotation:a,regularFlipRotation:l,labelX:c,sideFlag:r,removeOverflowLabels:h,removeOverflowThreshold:this.chartPadding?.right}),{tickData:d}=u,{ticks:p,tickDomain:f,rawTicks:y,rawTickCount:b,fractionDigits:m,timeInterval:v,niceDomain:M=t}=d,S=p.map(J=>this.getTickLabelProps(J,u)),{position:D,horizontal:C,gridPadding:k,gridLength:L}=this,w=D==="bottom"||D==="right"?-1:1,P=k,R=w*L-k,{gridLine:G}=this,Y=p.map(({tickId:J,translationY:W},V)=>{const[ee,ie,ne,me]=C?[W,P,W,R]:[P,W,R,W],{style:Z,width:te}=G,{stroke:B,lineDash:q}=Z[V%Z.length]??{};return{tickId:J,offset:W,x1:ee,y1:ie,x2:ne,y2:me,stroke:B,strokeWidth:te,lineDash:q}}),{tick:he,primaryTick:se}=this,de=p.map(({primary:J,tickId:W,translationY:V})=>{const ee=J&&se?.enabled?se:he,ie=-w*this.getTickSize(ee),[ne,me,Z,te]=C?[V,0,V,ie]:[0,V,ie,V],{stroke:B,width:q}=ee;return{tickId:W,offset:V,x1:ne,y1:me,x2:Z,y2:te,stroke:B,strokeWidth:q,lineDash:void 0}}),{bbox:ge,spacing:ye}=this.tickBBox(f,p,S);return this.generatedTicks={ticks:p,gridLines:Y,tickLines:de,labels:S,spacing:ye},{ticks:y,rawTickCount:b,tickDomain:f,niceDomain:M,fractionDigits:m,timeInterval:v,bbox:ge}}update(){this.updateDirection();const t=Array.from(this.tickLabelGroupSelection.nodes(),o=>o.datum.tickId);super.update(),this.tickLineGroup.visible=this.tick.enabled||(this.primaryTick?.enabled??!1),this.tickLabelGroup.visible=this.label.enabled||(this.primaryTick?.enabled??!1);const{generatedTicks:i}=this;if(this.updateTitle(this.scale.domain,i?.spacing??0),this.animatable||this.moduleCtx.animationManager.skipCurrentBatch(),this.generatedTicks){const{ticks:o}=this.generatedTicks;if(this.animationManager.isSkipped())this.resetSelectionNodes();else{const a=o.map(c=>c.tickId),l=(0,oh.diffArrays)(t,a);this.animationState.transition("update",l)}}const{enabled:s,stroke:n,width:r}=this.line;this.lineNode.setProperties({stroke:n,strokeWidth:s?r:0}),this.updateTickLines(),this.updateGridLines()}getAxisTransform(){return{translationX:Math.floor(this.translation.x),translationY:Math.floor(this.translation.y)}}updatePosition(){super.updatePosition();const t=this.getAxisTransform();this.tickLineGroup.datum=t,this.tickLabelGroup.datum=t,this.lineNodeGroup.datum=t,this.headingLabelGroup.datum=t}getAxisLineCoordinates(){const{horizontal:t}=this,[i,s]=Dt(this.range);return t?{x1:i,x2:s,y1:0,y2:0}:{x1:0,x2:0,y1:i,y2:s}}getTickLineBBox(t){const{position:i,primaryTick:s}=this,n=Math.max(this.getTickSize(),s?.enabled?this.getTickSize(s):0),{translationY:r}=t;switch(i){case"top":return new U(r,-n,r,n);case"bottom":return new U(r,0,r,n);case"left":return new U(-n,r,n,r);case"right":return new U(0,r,n,r)}}lineNodeBBox(){const{position:t,seriesAreaPadding:i}=this,{y1:s,y2:n}=this.getAxisLineCoordinates(),r=n-s;switch(t){case"top":return new U(s,-i,r,i);case"bottom":return new U(s,0,r,i);case"left":return new U(-i,s,i,r);case"right":return new U(0,s,i,r)}}titleBBox(t,i){const{tempCaption:s}=this;return s.node.setProperties(this.titleProps(s,t,i)),s.node.getBBox()}tickBBox(t,i,s){const{tick:n,primaryTick:r,label:o,primaryLabel:a,title:l,position:c,horizontal:h,seriesAreaPadding:u}=this,d=[];if(d.push(this.lineNodeBBox()),n.enabled||r?.enabled)for(const b of i)d.push(this.getTickLineBBox(b));const{tempText:p}=this;if(o.enabled)for(const b of s){if(!b.visible)continue;p.setProperties(b);const m=p.getBBox();m&&d.push(m)}if(a?.enabled&&a.format!=null&&c==="bottom"){const{fontSize:b,format:m}=a,M=((0,oh.isPlainObject)(m)?Object.values(m):[m]).reduce((k,L)=>Math.max(k,(0,oh.countLines)(L)),0),S=this.getTickSize(r??n)+a.spacing+u,D=2,C=M*Ue.getLineHeight(b)+D;d.push(new U(0,S,1,C))}let f=0;if(l.enabled){const b=U.merge(d);f=h?b.height:b.width,d.push(this.titleBBox(t,f))}return{bbox:U.merge(d),spacing:f}}titleProps(t,i,s){const{title:n}=this;if(!n.enabled)return t.enabled=!1,{visible:!1,text:"",textBaseline:"bottom",x:0,y:0,rotationCenterX:0,rotationCenterY:0,rotation:0};t.enabled=!0,t.color=n.color,t.fontFamily=n.fontFamily,t.fontSize=n.fontSize,t.fontStyle=n.fontStyle,t.fontWeight=n.fontWeight,t.wrapping=n.wrapping;const r=(n.spacing??0)+s,{range:o}=this,a=(o[0]+o[1])/2;let l,c,h,u;switch(this.position){case"top":l=a,c=-r,h=0,u="bottom";break;case"bottom":l=a,c=r,h=0,u="top";break;case"left":l=-r,c=a,h=-.5*Math.PI,u="bottom";break;case"right":l=r,c=a,h=.5*Math.PI,u="bottom";break}const{formatter:d=f=>f.defaultValue}=n,p=this.callWithContext(d,this.getTitleFormatterParams(i));return t.text=p,{visible:!0,text:p,textBaseline:u,x:l,y:c,rotationCenterX:l,rotationCenterY:c,rotation:h}}getTickLabelProps(t,i){const{horizontal:s,primaryLabel:n,primaryTick:r,seriesAreaPadding:o,scale:a}=this,{tickId:l,tickLabel:c="",translationY:h,primary:u}=t,d=u&&n?.enabled?n:this.label,p=u&&r?.enabled?r:this.tick,{rotation:f,textBaseline:y,textAlign:b}=i,{range:m}=a,M=this.label.getSideFlag()*(this.getTickSize(p)+d.spacing+o),S=c!=="",D=s?h:M,C=s?-M:h;return{...this.getLabelStyles({value:c},void 0,d),tickId:l,rotation:f,text:c,textAlign:b,textBaseline:y,visible:S,x:D,y:C,rotationCenterX:D,rotationCenterY:C,range:m}}updateSelections(){if(!this.generatedTicks)return;const t=this.getAxisLineCoordinates(),{tickLines:i,gridLines:s,labels:n}=this.generatedTicks,r=o=>o.tickId;this.lineNode.datum=t,this.gridLineGroupSelection.update(this.gridLine.enabled?s:[],void 0,r),this.tickLineGroupSelection.update(i,void 0,r),this.tickLabelGroupSelection.update(n,void 0,r)}updateGridLines(){this.gridLineGroupSelection.each((t,i)=>{t.stroke=i.stroke,t.strokeWidth=i.strokeWidth,t.lineDash=i.lineDash})}updateTickLines(){this.tickLineGroupSelection.each((t,i)=>{t.stroke=i.stroke,t.strokeWidth=i.strokeWidth,t.lineDash=i.lineDash})}updateTitle(t,i){const{caption:s}=this.title,n=this.titleProps(s,t,i);s.node.visible=n.visible,s.node.text=n.text,s.node.textBaseline=n.textBaseline,s.node.datum=n}updateLabels(){this.label.enabled&&this.tickLabelGroupSelection.each((t,i)=>{t.fill=i.fill,t.fontFamily=i.fontFamily,t.fontSize=i.fontSize,t.fontStyle=i.fontStyle,t.fontWeight=i.fontWeight,t.text=i.text,t.textBaseline=i.textBaseline,t.textAlign=i.textAlign??"center"})}animateReadyUpdate(t){const{animationManager:i}=this.moduleCtx,s=sx(this),n=nx(s);Xe(this.id,"axis-group",i,[this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],n.group),Xe(this.id,"line",i,[this.lineNode],n.line),Xe(this.id,"line-paths",i,[this.gridLineGroupSelection,this.tickLineGroupSelection],n.tick,(r,o)=>o.tickId,t),Xe(this.id,"tick-labels",i,[this.tickLabelGroupSelection],n.label,(r,o)=>o.tickId,t),Xe(this.id,"title",i,[this.title.caption.node],n.label,(r,o)=>o.tickId,t)}resetSelectionNodes(){It([this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],rx()),It([this.gridLineGroupSelection,this.tickLineGroupSelection],Yp()),It([this.tickLabelGroupSelection],fh()),It([this.title.caption.node],fh()),It([this.lineNode],Yp())}};g([x],qp.prototype,"thickness",2),g([x],qp.prototype,"position",2);var $a=qp,lx=["top","right","bottom","left"];function PT(e){return typeof e=="string"&&lx.includes(e)}function RT(e){const t=[],i=[],s=[...lx];for(const n of e)n instanceof $a&&(PT(n.position)?i.push(n.position):t.push(n));for(const n of t){let r;do r=s.pop();while(r&&i.includes(r));if(r==null)break;n.position=r}}var FT=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo"];function _T(e,t,i){const s=(c,h,u)=>{const d=[c];for(const p of FT)p in h&&h[p]!=null&&d.push(`${p}=${h[p]}`);return u?.seriesGrouping&&d.push(`seriesGrouping.groupId=${u?.seriesGrouping.groupId}`),d.join(";")},n=new Map;let r=0;for(const c of e){const h=s(c.type,c.properties,i?.[r]);n.has(h)||n.set(h,[]),n.get(h)?.push([c,r++])}const o=new Map;r=0;for(const c of t){const h=s(c.type,c,c);o.has(h)||o.set(h,[]),o.get(h)?.push([c,r++])}if(![...n.keys()].some(c=>o.has(c)))return{status:"no-overlap",oldKeys:n.keys(),newKeys:o.keys()};const l=[];for(const[c,h]of o.entries())for(const[u,d]of h){const p=n.get(c);if(p==null||p.length<1){l.push({opts:u,targetIdx:d,idx:d,status:"add"}),n.delete(c);continue}const[f,y]=p.shift(),b=i?.[y]??{},m=Ss(b,u??{}),{groupIndex:v,stackIndex:M}=m?.seriesGrouping??{};v!=null||M!=null?l.push({opts:u,series:f,diff:m,targetIdx:d,idx:y,status:"series-grouping"}):m?l.push({opts:u,series:f,diff:m,targetIdx:d,idx:y,status:"update"}):l.push({opts:u,series:f,targetIdx:d,idx:y,status:"no-op"}),p.length===0&&n.delete(c)}for(const c of n.values())for(const[h,u]of c)l.push({series:h,idx:u,targetIdx:-1,status:"remove"});return{status:"overlap",changes:l}}function Xs(e){const{series:t}=e;return t?.[0]?.type??"line"}function Qp(e){const t=Xs(e);return Ze.isCartesian(t)||Cw(t)}function cx(e){const t=Xs(e);return Ze.isPolar(t)||ww(t)}function hx(e){const t=Xs(e);return Ze.isHierarchy(t)||Tw(t)}function ux(e){const t=Xs(e);return Ze.isTopology(t)||Nw(t)}function dx(e){const t=Xs(e);return Ze.isFlowProportion(t)||Ow(t)}function Jp(e){const t=Xs(e);return Ze.isStandalone(t)||Ew(t)}function eg(e){const t=Xs(e);return Ze.isGauge(t)||Pw(t)}function jT(e){const t=Xs(e);return cx(e)&&t!=="pie"&&t!=="donut"}var zT=class extends Fp{applyOptions(e){for(const t of this.moduleMap.values())t.module.optionsKey in e&&io(t.moduleInstance)&&t.moduleInstance.set(e[t.module.optionsKey])}*legends(){for(const{module:e,moduleInstance:t}of this.moduleMap.values())e.type==="legend"&&(yield{legendType:e.identifier,legend:t})}},px=(O(),N(T)),tg="ag-charts-overlay",gx="ag-charts-dark-overlay",fr=class extends le{constructor(e,t){super(),this.className=e,this.defaultMessageId=t,this.enabled=!0}getText(e){return e.t(this.text??this.defaultMessageId)}getElement(e,t,i){if(this.content?.remove(),this.focusBox=i,this.renderer){const s=this.renderer();if(s instanceof HTMLElement)this.content=s;else{const n=(0,px.createElement)("div");n.innerHTML=s;const{firstElementChild:r}=n;r instanceof HTMLElement&&n.childElementCount===1?this.content=r:this.content=n}}else{const s=(0,px.createElement)("div",{display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",height:"100%",margin:"8px",fontFamily:"var(--ag-charts-font-family)",fontSize:"var(--ag-charts-font-size)",fontWeight:"var(--ag-charts-font-weight)"});s.innerText=this.getText(t),this.content=s,e?.animate({from:0,to:1,id:"overlay",phase:"add",groupId:"opacity",onUpdate(n){s.style.opacity=String(n)},onStop(){s.style.opacity="1"}})}return this.content}removeElement(e=()=>this.content?.remove(),t){if(this.content){if(t){const{content:i}=this;t.animate({from:1,to:0,phase:"remove",id:"overlay",groupId:"opacity",onUpdate(s){i.style.opacity=String(s)},onStop(){e?.()}})}else e?.();this.content=void 0,this.focusBox=void 0}}};g([x],fr.prototype,"enabled",2),g([x],fr.prototype,"text",2),g([x],fr.prototype,"renderer",2);var To=class extends le{constructor(){super(...arguments),this.darkTheme=!1,this.loading=new fr("ag-charts-loading-overlay","overlayLoadingData"),this.noData=new fr("ag-charts-no-data-overlay","overlayNoData"),this.noVisibleSeries=new fr("ag-charts-no-visible-series","overlayNoVisibleSeries"),this.unsupportedBrowser=new fr("ag-charts-unsupported-browser","overlayUnsupportedBrowser")}getFocusInfo(e){for(const t of[this.loading,this.noData,this.noVisibleSeries,this.unsupportedBrowser])if(t.focusBox!==void 0)return{text:t.getText(e),rect:t.focusBox}}destroy(){this.loading.removeElement(),this.noData.removeElement(),this.noVisibleSeries.removeElement(),this.unsupportedBrowser.removeElement()}};g([x],To.prototype,"darkTheme",2),g([x],To.prototype,"loading",2),g([x],To.prototype,"noData",2),g([x],To.prototype,"noVisibleSeries",2),g([x],To.prototype,"unsupportedBrowser",2);var Ka=(O(),N(T));function BT(e,t){const{animationDuration:i}=Ra.add,s=i*t,n=(0,Ka.createElement)("div",`${tg}--loading`,{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",height:"100%",boxSizing:"border-box",font:"13px Verdana, sans-serif",userSelect:"none",animation:`ag-charts-loading ${s}ms linear 50ms both`}),r=(0,Ka.createElement)("span",{width:"45px",height:"40px",backgroundImage:["linear-gradient(#0000 calc(1 * 100% / 6), #ccc 0 calc(3 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(2 * 100% / 6), #ccc 0 calc(4 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(3 * 100% / 6), #ccc 0 calc(5 * 100% / 6), #0000 0)"].join(""),backgroundSize:"10px 400%",backgroundRepeat:"no-repeat",animation:"ag-charts-loading-matrix 1s infinite linear"}),o=(0,Ka.createElement)("p",{marginTop:"1em"});o.innerText=e;const a=(0,Ka.createElement)("div",`${tg}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),l=(0,Ka.createElement)("style");return l.innerText=["@keyframes ag-charts-loading { from { opacity: 0 } to { opacity: 1 } }","@keyframes ag-charts-loading-matrix {","0% { background-position: 0% 0%, 50% 0%, 100% 0%; }","100% { background-position: 0% 100%, 50% 100%, 100% 100%; }","}"].join(" "),n.replaceChildren(l,r,o,a),n}var fx=(O(),N(T)),mx=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.ANY_CONTENT=1]="ANY_CONTENT",e))(mx||{}),yx=(e=>(e[e.FOREGROUND=0]="FOREGROUND",e[e.HIGHLIGHT=1]="HIGHLIGHT",e[e.LABEL=2]="LABEL",e))(yx||{});function mr(e,t,i,s){if(is(e))return{type:"gradient",gradient:e.gradient??t.gradient,colorStops:e.colorStops??t.colorStops,bounds:e.bounds??t.bounds,rotation:e.rotation??t.rotation,reverse:e.reverse??t.reverse};if(or(e)){const n=e.pattern??i.pattern;let r=e.strokeWidth;n==="backward-slanted-lines"||n==="forward-slanted-lines"||n==="horizontal-lines"||n==="vertical-lines"?r??(r=i.strokeWidth):r??(r=0);const o=e.width??e.height??i.width,a=e.height??e.width??i.height;return{type:"pattern",pattern:n,width:o,height:a,path:e.path,padding:e.padding??i.padding,fill:e.fill??i.fill,fillOpacity:e.fillOpacity??i.fillOpacity,backgroundFill:e.backgroundFill??i.backgroundFill,backgroundFillOpacity:e.backgroundFillOpacity??i.backgroundFillOpacity,stroke:e.stroke??i.stroke,strokeOpacity:e.strokeOpacity??i.strokeOpacity,strokeWidth:r,rotation:e.rotation??i.rotation,scale:e.scale??i.scale}}return ro(e)?{type:"image",url:e.url,width:e.width,height:e.height,backgroundFill:e.backgroundFill??s.backgroundFill,backgroundFillOpacity:e.backgroundFillOpacity??s.backgroundFillOpacity,rotation:e.rotation??s.rotation,repeat:e.repeat??s.repeat,fit:e.fit??s.fit}:e}function ws(e,t,i,s){return!is(e?.fill)&&!or(e?.fill)&&!ro(e?.fill)?e:{...e,fill:mr(e.fill,t,i,s)}}function mh(e,t,i,s){i==null||!is(t)||t.bounds==null||t.bounds==="item"?e.fillBBox=void 0:e.fillBBox=i[t.bounds],e.fillParams=s}function yr(e,t,i,s,n){const r=i?.fill??t.fill;e.fill=r,mh(e,i?.fill??t.fill,s,n),e.fillOpacity=i?.fillOpacity??t.fillOpacity??1,e.stroke=i?.stroke??t.stroke,e.strokeOpacity=i?.strokeOpacity??t.strokeOpacity??1,e.strokeWidth=i?.strokeWidth??t.strokeWidth??0,e.lineDash=i?.lineDash??t.lineDash,e.lineDashOffset=i?.lineDashOffset??t.lineDashOffset??0}var bx=(e=>(e[e.EXACT_SHAPE_MATCH=0]="EXACT_SHAPE_MATCH",e[e.NEAREST_NODE=1]="NEAREST_NODE",e[e.AXIS_ALIGNED=2]="AXIS_ALIGNED",e))(bx||{}),GT=.25,VT=.125,Za=class{constructor(e,t,i,s){this.type=e,this.event=t,this.defaultPrevented=!1,this.datum=i.datum,this.seriesId=s.id}preventDefault(){this.defaultPrevented=!0}},ig=class{constructor(e,t,i){this.series=e,this.seriesGrouping=t,this.oldGrouping=i,this.type="groupingChanged"}},yh=class extends tb{constructor(e){super(),this.destroyFns=[],this.usesPlacedLabels=!1,this.seriesGrouping=void 0,this.NodeEvent=Za,this.internalId=(0,fx.createId)(this),this.contentGroup=new Ot({name:`${this.internalId}-content`,zIndex:1}),this.highlightGroup=new Ot({name:`${this.internalId}-highlight`,zIndex:1}),this.annotationGroup=new Ot({name:`${this.internalId}-annotation`}),this.labelGroup=new Ot({name:`${this.internalId}-series-labels`}),this.axes={},this.directions=["x","y"],this.nodeDataRefresh=!0,this.moduleMap=new Fp,this.datumCallbackCache=new Map,this.connectsToYAxis=!1,this._declarationOrder=-1,this.seriesListeners=new Sn,this._pickNodeCache=new Gd;const{moduleCtx:t,pickModes:i,directionKeys:s={},directionNames:n={},canHaveAxes:r=!1,usesPlacedLabels:o=!1}=e;this.ctx=t,this.directionKeys=s,this.directionNames=n,this.canHaveAxes=r,this.usesPlacedLabels=o,this.highlightGroup=new Ot({name:`${this.internalId}-highlight`}),this.highlightNode=this.highlightGroup.appendChild(new ue({name:"highlightNode",zIndex:0})),this.highlightLabel=this.highlightGroup.appendChild(new ue({name:"highlightLabel",zIndex:10})),this.pickModes=i}get pickModeAxis(){return"main"}get id(){return this.properties?.id??this.internalId}get type(){return this.constructor.type??""}get focusable(){return!0}get data(){return this._data??this._chartData}set visible(e){this.properties.visible=e,this.ctx.legendManager.toggleItem(e,this.id),this.ctx.legendManager.update(),this.visibleMaybeChanged()}get visible(){return this.ctx.legendManager.getSeriesEnabled(this.id)??this.properties.visible}get hasData(){return this.data!=null&&this.data.length>0}get tooltipEnabled(){return this.properties.tooltip?.enabled}onDataChange(){this.nodeDataRefresh=!0,this._pickNodeCache.clear()}setOptionsData(e){this._data=e,this.onDataChange()}setChartData(e){this._chartData=e,this.data===e&&this.onDataChange()}onSeriesGroupingChange(e,t){const{internalId:i,type:s,visible:n}=this;e&&this.ctx.seriesStateManager.deregisterSeries(this),t&&this.ctx.seriesStateManager.registerSeries({internalId:i,type:s,visible:n,seriesGrouping:t}),this.fireEvent(new ig(this,t,e))}getBandScalePadding(){return{inner:1,outer:0}}attachSeries(e,t,i){e.appendChild(this.contentGroup),t.appendChild(this.highlightGroup),t.appendChild(this.labelGroup),i?.appendChild(this.annotationGroup)}detachSeries(e,t,i){e?.removeChild(this.contentGroup),t.removeChild(this.highlightGroup),t.removeChild(this.labelGroup),i?.removeChild(this.annotationGroup)}setSeriesIndex(e){return e===this._declarationOrder?!1:(this._declarationOrder=e,this.contentGroup.zIndex=[1,e,0],this.highlightGroup.zIndex=[1,e,1],this.labelGroup.zIndex=[1,e,2],this.annotationGroup.zIndex=e,!0)}renderToOffscreenCanvas(){return!1}addEventListener(e,t){return super.addEventListener(e,t)}removeEventListener(e,t){return super.removeEventListener(e,t)}hasEventListener(e){return super.hasEventListener(e)}addListener(e,t){return this.seriesListeners.addListener(e,t)}dispatch(e,t){this.seriesListeners.dispatch(e,t)}addChartEventListeners(){}updatedDomains(){}destroy(){this.destroyFns.forEach(e=>e()),this.destroyFns=[],this.resetDatumCallbackCache(),this.ctx.seriesStateManager.deregisterSeries(this)}getDirectionValues(e,t){const i=this.resolveKeyDirection(e),s=t?.[i],n=[];if(!s)return n;const r=(...o)=>{for(const a of o)Array.isArray(a)?r(...a):typeof a=="object"?r(...Object.values(a)):n.push(a)};return r(...s.map(o=>this.properties[o])),n}getKeys(e){return this.getDirectionValues(e,this.directionKeys)}getKeyProperties(e){return this.directionKeys[this.resolveKeyDirection(e)]??[]}getNames(e){return this.getDirectionValues(e,this.directionNames)}resolveKeyDirection(e){return e}getDomain(e){const t=this.getSeriesDomain(e),i=this.moduleMap.mapModules(s=>s.getDomain(e)).flat();return i.length!==0?t.concat(i):t}getRange(e,t){return this.getSeriesRange(e,t)}getVisibleItems(e,t,i){return 1/0}markNodeDataDirty(){this.nodeDataRefresh=!0,this._pickNodeCache.clear(),this.visibleMaybeChanged()}visibleMaybeChanged(){this.ctx.seriesStateManager.updateSeries(this)}getOpacity(){const{dimOpacity:t=1,enabled:i=!0}=this.properties.highlightStyle.series;if(!i||t===1)return 1;switch(this.isItemIdHighlighted()){case 0:case 1:return 1;case 2:default:return t}}getStrokeWidth(e){const{strokeWidth:t,enabled:i=!0}=this.properties.highlightStyle.series;if(!i||t===void 0)return e;switch(this.isItemIdHighlighted()){case 1:return t;case 0:case 2:return e}}isItemIdHighlighted(){const e=this.ctx.highlightManager?.getActiveHighlight()?.series;return e==null?0:e!==this?2:1}getModuleTooltipParams(){return this.moduleMap.mapModules(e=>e.getTooltipParams()).reduce((e,t)=>Object.assign(e,t),{})}pickNodes(e,t,i=!1){const{pickModes:s,pickModeAxis:n,visible:r,contentGroup:o}=this;if(!r||!o.visible||t==="highlight"&&!this.properties.highlight.enabled||t==="highlight-tooltip"&&!this.properties.highlight.enabled)return;let a=1/0;if(t==="tooltip"||t==="highlight-tooltip"){const{tooltip:d}=this.properties;a=typeof d.range=="number"?d.range:1/0,i||(i=d.range==="exact")}else if(t==="event"||t==="context-menu"){const{nodeClickRange:d}=this.properties;a=typeof d=="number"?d:1/0,i||(i=d==="exact")}const l=s.filter(d=>!i||d===0),{x:c,y:h}=e,u=JSON.stringify({x:c,y:h,maxDistance:a,selectedPickModes:l});if(this._pickNodeCache.has(u))return this._pickNodeCache.get(u);for(const d of l){let p;switch(d){case 0:{const f=this.pickNodesExactShape(e);p=f.length===0?void 0:{datums:f,distance:0};break}case 1:{const f=this.pickNodeClosestDatum(e),y=f?.distance===0?this.pickNodesExactShape(e):void 0;y!=null&&y.length!==0?p={datums:y,distance:0}:f?p={datums:[f.datum],distance:f.distance}:p=void 0;break}case 2:{const f=n!=null?this.pickNodeMainAxisFirst(e,n==="main-category"):void 0;p=f!=null?{datums:[f.datum],distance:f.distance}:void 0;break}}if(p&&p.distance<=a)return this._pickNodeCache.set(u,{pickMode:d,datums:p.datums,distance:p.distance})}return this._pickNodeCache.set(u,void 0)}pickNodesExactShape(e){const t=[];for(const i of this.contentGroup.pickNodes(e.x,e.y)){const s=i.closestDatum();s!=null&&s.missing!==!0&&t.push(s)}return t}pickNodeClosestDatum(e){throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented")}pickNodeNearestDistantObject(e,t){const i=mc(e.x,e.y,t),s=i.nearest?.closestDatum();if(s!=null&&s.missing!==!0)return{datum:s,distance:Math.sqrt(i.distanceSquared)}}pickNodeMainAxisFirst(e,t){throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented")}getLabelData(){return[]}updatePlacedLabelData(e){}fireNodeClickEvent(e,t){const i=new this.NodeEvent("seriesNodeClick",e,t,this);return this.fireEvent(i),!i.defaultPrevented}fireNodeDoubleClickEvent(e,t){const i=new this.NodeEvent("seriesNodeDoubleClick",e,t,this);return this.fireEvent(i),!i.defaultPrevented}createNodeContextMenuActionEvent(e,t){return new this.NodeEvent("nodeContextMenuAction",e,t,this)}onLegendInitialState(e,t){const{visible:i=!0,itemId:s,legendItemName:n}=t??{};this.toggleSeriesItem(i,e,s,n)}onLegendItemClick(e){const{enabled:t,itemId:i,series:s,legendType:n}=e,r="legendItemName"in this.properties?this.properties.legendItemName:void 0,o="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,a=r!=null&&r===e.legendItemName;(s.id===this.id||a||o!=null)&&this.toggleSeriesItem(t,n,i,r,e)}onLegendItemDoubleClick(e){const{enabled:t,itemId:i,series:s,numVisibleItems:n,legendType:r}=e,o="legendItemName"in this.properties?this.properties.legendItemName:void 0,a="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,l=o!=null&&o===e.legendItemName;s.id===this.id||l||a!=null?this.toggleSeriesItem(!0,r,i,o,e):t&&n===1?this.toggleSeriesItem(!0,r,void 0,o):this.toggleSeriesItem(!1,r,void 0,o)}toggleSeriesItem(e,t,i,s,n){const r=this.id;(e||t!=="category")&&(this.visible=e),this.nodeDataRefresh=!0,this._pickNodeCache.clear();const o={type:"seriesVisibilityChange",seriesId:r,itemId:i,legendItemName:n?.legendItemName??s,visible:e};this.fireEvent(o),this.ctx.legendManager.toggleItem(e,r,i,s)}isEnabled(){return this.visible}getModuleMap(){return this.moduleMap}createModuleContext(){return{...this.ctx,series:this}}getLabelText(e,t,i=Hs){return e.formatter?this.cachedCallWithContext(e.formatter,{seriesId:this.id,...t})??this.callWithContext(i,t.value):this.callWithContext(i,t.value)}getMarkerStyle(e,t,i,s=!1,n=e.size??0,r){const{itemStyler:o,fillGradientDefaults:a,fillPatternDefaults:l,fillImageDefaults:c}=e;let u=ws(xe({size:n},r,e.getStyle()),a,l,c);if(o&&i){const d=this.cachedCallWithContext(o,{seriesId:this.id,...u,...i,highlighted:s,datum:t});u=ws(xe(d,u),a,l,c)}return u}updateMarkerStyle(e,t,i,s,n,r,o,a,{applyTranslation:l=!0,selected:c=!0}={}){const h=this.getMarkerStyle(e,i,n,r,s?.size,o),{shape:u,size:d}=h,p=this.visible&&d>0&&s&&!isNaN(s.x)&&!isNaN(s.y);if(yr(t,h,void 0,a),l?t.setProperties({visible:p,shape:u,size:d,x:s?.x,y:s?.y,scalingCenterX:s?.x,scalingCenterY:s?.y}):t.setProperties({visible:p,shape:u,size:d}),c||(t.fillOpacity*=GT,t.strokeOpacity*=VT),typeof e.shape=="function"&&!t.dirtyPath){t.path.clear(!0),t.updatePath(),t.checkPathDirty();const f=t.getBBox();if(s!==void 0&&f.isFinite()){const y=f.computeCenter(),[b,m]=["x","y"].map(v=>(h.strokeWidth??0)+Math.abs(y[v]-s[v]));s.focusSize=Math.max(f.width+b,f.height+m)}}}get nodeDataDependencies(){return this._nodeDataDependencies??{seriesRectWidth:NaN,seriesRectHeight:NaN}}checkResize(e){const{width:t,height:i}=e??{width:NaN,height:NaN},s=e?{seriesRectWidth:t,seriesRectHeight:i}:void 0,n=Ss(this.nodeDataDependencies,s)!=null;return n&&(this._nodeDataDependencies=s,this.markNodeDataDirty()),n}pickFocus(e){}resetDatumCallbackCache(){this.datumCallbackCache.clear()}cachedDatumCallback(e,t){const{datumCallbackCache:i}=this,s=i.get(e);if(s!=null)return s;try{const n=t();return i.set(e,n),n}catch(n){fx.Logger.error(String(n))}}cachedCallWithContext(e,...t){return this.ctx.callbackCache.call(this.properties,this.ctx.chartService,e,...t)}callWithContext(e,...t){return Xc(this.properties,this.ctx.chartService,e,t)}formatTooltipWithContext(e,t,i){return e.formatTooltip(this.properties,this.ctx.chartService,t,i)}};g([ui({changeValue:function(e,t){this.onSeriesGroupingChange(t,e)}})],yh.prototype,"seriesGrouping",2);var xx=(O(),N(T)),No=(O(),N(T)),UT=(O(),N(T)),oi=class extends Bi{constructor(){super(...arguments),this.path=new no,this._clipX=NaN,this._clipY=NaN,this.clip=!1,this._dirtyPath=!0,this.lastPixelRatio=NaN}set clipX(e){this._clipX=e,this.dirtyPath=!0}set clipY(e){this._clipY=e,this.dirtyPath=!0}set dirtyPath(e){this._dirtyPath!==e&&(this._dirtyPath=e,e&&this.markDirty("path"))}get dirtyPath(){return this._dirtyPath}checkPathDirty(){this._dirtyPath||(this.dirtyPath=this.path.isDirty()||(this.fillShadow?.isDirty()??!1)||(this._clipPath?.isDirty()??!1))}onChangeDetection(e){this._dirtyPath||(this._dirtyPath=!0,super.onChangeDetection(e))}computeBBox(){return this.updatePathIfDirty(),this.path.computeBBox()}isPointInPath(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)}distanceSquared(e,t){return this.distanceSquaredTransformedPoint(e,t)}svgPathData(e){return this.updatePathIfDirty(),this.path.toSVG(e)}distanceSquaredTransformedPoint(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)?0:this.path.distanceSquared(e,t)}isDirtyPath(){return!1}updatePath(){}updatePathIfDirty(){(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1)}preRender(e){return e.devicePixelRatio!==this.lastPixelRatio&&(this.dirtyPath=!0),this.lastPixelRatio=e.devicePixelRatio,this.updatePathIfDirty(),super.preRender(e,this.path.commands.length)}render(e){const{ctx:t}=e;if(this.clip&&!isNaN(this._clipX)&&!isNaN(this._clipY)){t.save();const i=this.strokeWidth/2;this._clipPath??(this._clipPath=new no),this._clipPath.clear(),this._clipPath.rect(-i,-i,this._clipX+i,this._clipY+i+i),t.clip(this._clipPath?.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(t),t.restore()}else this._clipPath=void 0,this.drawPath(t);this.fillShadow?.markClean(),super.render(e)}drawPath(e){this.fillStroke(e,this.path.getPath2D())}toSVG(){if(!this.visible)return;const e=(0,UT.createSvgElement)("path");e.setAttribute("d",this.svgPathData());const t=this.applySvgFillAttributes(e,[]);return this.applySvgStrokeAttributes(e),{elements:[e],defs:t}}};oi.className="Path",g([_()],oi.prototype,"clip",2),g([_()],oi.prototype,"clipX",1),g([_()],oi.prototype,"clipY",1);var WT=class{constructor(e){this.swapChain=e,this.hasBeenActivated=!1,this.div=(0,No.createElement)("div"),this.svg=(0,No.createSvgElement)("svg"),this.outerPath=(0,No.createSvgElement)("path"),this.innerPath=(0,No.createSvgElement)("path"),this.svg.append(this.outerPath),this.svg.append(this.innerPath),this.outerPath.classList.add("ag-charts-focus-svg-outer-path"),this.innerPath.classList.add("ag-charts-focus-svg-inner-path"),this.element=(0,No.createElement)("div","ag-charts-focus-indicator"),this.element.ariaHidden="true",this.element.append(this.svg),this.swapChain.addListener("swap",t=>this.onSwap(t))}clear(){}update(e,t,i){if(t!=null)if(e instanceof oi){const s=(r,o)=>{let{x:a,y:l}=Qe.toCanvasPoint(e,r,o);return a-=t.x??0,l-=t.y??0,{x:a,y:l}},n=e.svgPathData(s);this.outerPath.setAttribute("d",n),this.innerPath.setAttribute("d",n),this.show(this.svg)}else{let s;if(i){const n=Math.max(e.x-t.x,0),r=Math.max(e.y-t.y,0),o=Math.min(e.x+e.width-t.x,t.width),a=Math.min(e.y+e.height-t.y,t.height);s=new U(n,r,o-n,a-r)}else s=new U(e.x-t.x,e.y-t.y,e.width,e.height);Oc(this.div,s),this.show(this.div)}}onSwap(e){e!==this.element.parentElement&&(this.element.remove(),e.appendChild(this.element),this.overrideFocusVisible(this.focusVisible))}show(e){this.hasBeenActivated=!0,this.element.innerHTML="",this.element.append(e)}overrideFocusVisible(e){this.focusVisible=e;const t={true:"1",false:"0",undefined:""};this.element.parentElement?.style.setProperty("opacity",t[`${e}`])}isFocusVisible(e=!1){if(!e&&!this.hasBeenActivated)return!1;const t=this.element.parentElement;return t!=null&&(0,No.getWindow)().getComputedStyle(t).opacity==="1"}},Wi=(O(),N(T)),HT=class{constructor(e,t,i){this.label1=e,this.label2=t,this.hasFocus=!1,this.skipDispatch=!1,this.listeners={blur:[],focus:[],swap:[]},this.onBlur=s=>((0,Wi.setElementStyle)(s.target,"pointer-events",void 0),!this.skipDispatch&&this.dispatch("blur",s)),this.onFocus=s=>((0,Wi.setElementStyle)(s.target,"pointer-events","auto"),!this.skipDispatch&&this.dispatch("focus",s)),(0,Wi.setAttribute)(this.label1,"id",(0,Wi.createElementId)()),(0,Wi.setAttribute)(this.label2,"id",(0,Wi.createElementId)()),(0,Wi.setElementStyle)(this.label1,"display","none"),(0,Wi.setElementStyle)(this.label2,"display","none"),this.activeAnnouncer=this.createAnnouncer(i),this.inactiveAnnouncer=this.createAnnouncer(i),(0,Wi.setAttribute)(this.activeAnnouncer,"tabindex",0),this.label2.insertAdjacentElement("afterend",this.activeAnnouncer),this.label2.insertAdjacentElement("afterend",this.inactiveAnnouncer),this.swap("")}createAnnouncer(e){const t=(0,Wi.createElement)("div");return t.role=e,t.className="ag-charts-swapchain",t.addEventListener("blur",this.onBlur),t.addEventListener("focus",this.onFocus),t}destroy(){for(const e of[this.activeAnnouncer,this.inactiveAnnouncer])e.removeEventListener("blur",this.onBlur),e.removeEventListener("focus",this.onFocus),e.remove()}focus(e){this.focusOptions=e,this.activeAnnouncer.focus(e),this.focusOptions=void 0}update(e){this.skipDispatch=!0,this.swap(e),this.hasFocus&&this.activeAnnouncer.focus(this.focusOptions),this.skipDispatch=!1}addListener(e,t){this.listeners[e].push(t),e==="swap"&&t(this.activeAnnouncer)}dispatch(e,t){e==="focus"?this.hasFocus=!0:e==="blur"&&(this.hasFocus=!1),this.listeners[e].forEach(i=>i(t))}swap(e){const t=this.activeAnnouncer.tabIndex;this.label2.textContent=e,[this.inactiveAnnouncer,this.activeAnnouncer]=[this.activeAnnouncer,this.inactiveAnnouncer],[this.label1,this.label2]=[this.label2,this.label1],(0,Wi.setAttributes)(this.inactiveAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!0,tabindex:void 0}),(0,Wi.setAttributes)(this.activeAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!1,tabindex:t}),this.dispatch("swap",this.activeAnnouncer)}},YT=(O(),N(T)),$T={arrowdown:{bindings:[{code:"ArrowDown"}]},arrowleft:{bindings:[{code:"ArrowLeft"}]},arrowright:{bindings:[{code:"ArrowRight"}]},arrowup:{bindings:[{code:"ArrowUp"}]},delete:{bindings:[{key:"Backspace"},{key:"Delete"}],activatesFocusIndicator:!1},redo:{bindings:[{key:"y",ctrlOrMeta:!0},{key:"z",ctrlOrMeta:!0,shift:!0}],activatesFocusIndicator:!1},undo:{bindings:[{key:"z",ctrlOrMeta:!0}],activatesFocusIndicator:!1},submit:{bindings:[{key:"Enter"},{code:"Enter"},{code:"Space"}]},zoomin:{bindings:[{key:"+"},{code:"ZoomIn"},{code:"Add"}],activatesFocusIndicator:!1},zoomout:{bindings:[{key:"-"},{code:"ZoomOut"},{code:"Substract"}],activatesFocusIndicator:!1}};function KT(e,t){for(const i of t)if("code"in i){if(i.code===e.code)return!0}else if(i.key===e.key&&(i.shift===void 0||i.shift===e.shiftKey)&&(i.ctrlOrMeta===void 0||i.ctrlOrMeta===e.ctrlKey||i.ctrlOrMeta===e.metaKey))return!0;return!1}function ZT(e){for(const[t,{activatesFocusIndicator:i=!0,bindings:s}]of(0,YT.entries)($T))if(KT(e,s))return{name:t,activatesFocusIndicator:i}}function XT(e,t,i){const s=up(e,i.datum,i.movedBounds);if(s!=null)return{x:s.canvasX,y:s.canvasY};const n=i.bounds;if(n!=null){if(n instanceof U){const{x:r,y:o}=n.computeCenter();return{x:t.x+r,y:t.y+o}}return Qe.toCanvas(n).computeCenter()}}function qT({bounds:e}){return e instanceof U?e:e!=null?Qe.toCanvas(e):U.NaN}function QT(e,t,i){const{x:s,y:n}=XT(e,t,i)??{};if(s!==void 0&&n!==void 0)return{type:"keyboard",canvasX:s,canvasY:n}}var sg=(O(),N(T)),JT=(O(),N(T));function ng(){return(e,t)=>{const i=[`Property [${e}] is deprecated.`,t].filter(Boolean).join(" ");JT.Logger.warnOnce(i)}}function vx(e,t){const i=ng(),s=t?.default;return ir((n,r,o)=>(o!==s&&i(r.toString(),e),o))}function eN(e,t){const i=ng();return ir((s,n,r)=>(r!==s[e]&&(i(n.toString(),`Use [${e}] instead.`),md(s,e,t?t(r):r)),dd),(s,n)=>(i(n.toString(),`Use [${e}] instead.`),Jr(s,e)))}function Mx(e,t,i,s){let{top:n,right:r,bottom:o,left:a,width:l,height:c}=s;return a!=null?l!=null?r=i.width-a+l:r!=null&&(l=i.width-a-r):r!=null&&l!=null&&(a=i.width-r-l),n!=null?c!=null?o=i.height-n-c:o!=null&&(c=i.height-o-n):o!=null&&c!=null&&(n=i.height-o-c),l==null?c==null?(l=e,c=t):l=Math.ceil(e*c/t):c==null&&(c=Math.ceil(t*l/e)),a==null&&(r==null?a=Math.floor((i.width-l)/2):a=i.width-r-l),n==null&&(o==null?n=Math.floor((i.height-c)/2):n=i.height-c-o),{x:a,y:n,width:l,height:c}}var Sx=.1,Dx=200,Ix=12,tN=.5,iN=class extends Sn{constructor(){super(...arguments),this.x1=NaN,this.y1=NaN,this.x=NaN,this.y=NaN,this.vx=0,this.vy=0,this.t0=NaN,this.animationFrameHandle=void 0}reset(){this.x=NaN,this.y=NaN,this.animationFrameHandle!=null&&(cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0)}update(e,t){if(Number.isNaN(this.x)||Number.isNaN(this.y)){this.x=e,this.y=t,this.vx=0,this.vy=0,this.emitUpdate(),this.animationFrameHandle!=null&&(cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0);return}this.x1=e,this.y1=t,this.t0=Date.now(),this.animationFrameHandle==null&&(this.animationFrameHandle=requestAnimationFrame(this.onFrame.bind(this)))}onFrame(){this.animationFrameHandle=void 0;const{x1:e,y1:t,t0:i}=this,s=Date.now(),n=s-i;this.t0=s;const r=.001,o=Math.ceil(n/(r*1e3))|0;let{x:a,y:l,vx:c,vy:h}=this;for(let u=0;u<o;u+=1){const d=a-e,p=l-t,f=-(Dx*d+Ix*c)/Sx,y=-(Dx*p+Ix*h)/Sx;c+=f*r,h+=y*r,a+=c*r,l+=h*r}Math.hypot(a-e,l-t)<tN?(this.x=this.x1,this.y=this.y1,this.vx=0,this.vy=0):(this.x=a,this.y=l,this.vx=c,this.vy=h,this.animationFrameHandle=requestAnimationFrame(this.onFrame.bind(this))),this.emitUpdate()}emitUpdate(){this.dispatch("update",{type:"update",x:this.x,y:this.y})}},sN=(O(),N(T)),bh=null;function Xa(e){return e===""?"":(bh??(bh=(0,sN.createElement)("div")),bh.textContent=String(e),bh.innerHTML.replace(/\n/g,"<br>"))}function qa(e,t){const{path:i,size:s}=e,{x:n,y:r}=e;i.clear();let o=!1;for(const[a,l]of t){const c=n+(a-.5)*s,h=r+(l-.5)*s;o?i.lineTo(c,h):i.moveTo(c,h),o=!0}i.closePath()}var nN={circle({path:e,x:t,y:i,size:s}){const n=s/2;e.arc(t,i,n,0,Math.PI*2),e.closePath()},cross(e){qa(e,[[.25,0],[.5,.25],[.75,0],[1,.25],[.75,.5],[1,.75],[.75,1],[.5,.75],[.25,1],[0,.75],[.25,.5],[0,.25]])},diamond(e){qa(e,[[.5,0],[1,.5],[.5,1],[0,.5]])},heart({path:e,x:t,y:i,size:s}){const n=s/4;i=i+n/2,e.arc(t-n,i-n,n,dt(130),dt(330)),e.arc(t+n,i-n,n,dt(220),dt(50)),e.lineTo(t,i+n),e.closePath()},pin({path:e,x:t,y:i,size:s}){e.moveTo(t+(.15625-.5)*s,i+(.34375-.5)*s),e.cubicCurveTo(t+(.15625-.5)*s,i+(.151491-.5)*s,t+(.307741-.5)*s,i+(0-.5)*s,t+(.5-.5)*s,i+(0-.5)*s),e.cubicCurveTo(t+(.692259-.5)*s,i+(0-.5)*s,t+(.84375-.5)*s,i+(.151491-.5)*s,t+(.84375-.5)*s,i+(.34375-.5)*s),e.cubicCurveTo(t+(.84375-.5)*s,i+(.493824-.5)*s,t+(.784625-.5)*s,i+(.600181-.5)*s,t+(.716461-.5)*s,i+(.695393-.5)*s),e.cubicCurveTo(t+(.699009-.5)*s,i+(.719769-.5)*s,t+(.681271-.5)*s,i+(.743104-.5)*s,t+(.663785-.5)*s,i+(.766105-.5)*s),e.cubicCurveTo(t+(.611893-.5)*s,i+(.834367-.5)*s,t+(.562228-.5)*s,i+(.899699-.5)*s,t+(.528896-.5)*s,i+(.980648-.5)*s),e.cubicCurveTo(t+(.524075-.5)*s,i+(.992358-.5)*s,t+(.512663-.5)*s,i+(1-.5)*s,t+(.5-.5)*s,i+(1-.5)*s),e.cubicCurveTo(t+(.487337-.5)*s,i+(1-.5)*s,t+(.475925-.5)*s,i+(.992358-.5)*s,t+(.471104-.5)*s,i+(.980648-.5)*s),e.cubicCurveTo(t+(.487337-.5)*s,i+(1-.5)*s,t+(.475925-.5)*s,i+(.992358-.5)*s,t+(.471104-.5)*s,i+(.980648-.5)*s),e.cubicCurveTo(t+(.437772-.5)*s,i+(.899699-.5)*s,t+(.388107-.5)*s,i+(.834367-.5)*s,t+(.336215-.5)*s,i+(.766105-.5)*s),e.cubicCurveTo(t+(.318729-.5)*s,i+(.743104-.5)*s,t+(.300991-.5)*s,i+(.719769-.5)*s,t+(.283539-.5)*s,i+(.695393-.5)*s),e.cubicCurveTo(t+(.215375-.5)*s,i+(.600181-.5)*s,t+(.15625-.5)*s,i+(.493824-.5)*s,t+(.15625-.5)*s,i+(.34375-.5)*s),e.closePath()},plus(e){qa(e,[[1/3,0],[2/3,0],[2/3,1/3],[1,1/3],[1,2/3],[2/3,2/3],[2/3,1],[1/3,1],[1/3,2/3],[0,2/3],[0,1/3],[1/3,1/3]])},square({path:e,x:t,y:i,size:s,pixelRatio:n}){const r=s/2;e.moveTo(Mt(n,t-r),Mt(n,i-r)),e.lineTo(Mt(n,t+r),Mt(n,i-r)),e.lineTo(Mt(n,t+r),Mt(n,i+r)),e.lineTo(Mt(n,t-r),Mt(n,i+r)),e.closePath()},star({path:e,x:t,y:i,size:s}){const r=s/2,o=r/2,a=Math.PI/2;for(let l=0;l<5*2;l++){const c=l%2===0?r:o,h=l*Math.PI/5-a,u=t+Math.cos(h)*c,d=i+Math.sin(h)*c;e.lineTo(u,d)}e.closePath()},triangle(e){qa(e,[[.5,0],[1,.87],[0,.87]])}},Qa=class extends oi{constructor(){super(...arguments),this.shape="square",this.x=0,this.y=0,this.size=12}updatePath(){const{path:e,shape:t,x:i,y:s,size:n}=this,r=this.layerManager?.canvas?.pixelRatio??1,o=Lt.anchor(t),a={path:e,x:i-(o.x-.5)*n,y:s-(o.y-.5)*n,size:n,pixelRatio:r};e.clear(),typeof t=="string"?nN[t](a):typeof t=="function"&&t(a)}computeBBox(){const{x:e,y:t,size:i}=this,s=Lt.anchor(this.shape);return new U(e-i*s.x,t-i*s.y,i,i)}executeFill(e,t){if(t)return super.executeFill(e,t)}executeStroke(e,t){if(t)return super.executeStroke(e,t)}};g([Ai({equals:eo})],Qa.prototype,"shape",2),g([_()],Qa.prototype,"x",2),g([_()],Qa.prototype,"y",2),g([_({convertor:Math.abs})],Qa.prototype,"size",2);var Lt=class extends ao(kd(ar(Qa))){static anchor(e){return e==="pin"?{x:.5,y:1}:typeof e=="function"&&"anchor"in e?e.anchor:{x:.5,y:.5}}constructor(e){super(e),e?.shape!=null&&(this.shape=e.shape)}};function Ax(e,t,i=t*(5/3)){const s=new ue,n=Math.min(e.marker.strokeWidth??1,2),r=Math.min(e.line?.strokeWidth??0,2),o=Math.max(e.marker.enabled===!1?0:t,e.line==null?0:i),a=Math.max(e.marker.enabled===!1?0:t,r);if(e.line!=null){const{stroke:l,strokeOpacity:c,lineDash:h}=e.line,u=new Xt;u.x1=0,u.y1=a/2,u.x2=o,u.y2=a/2,u.stroke=l,u.strokeOpacity=c,u.strokeWidth=r,u.lineDash=h,s.append(u)}if(e.marker.enabled!==!1){const{shape:l,fill:c,fillOpacity:h,stroke:u,strokeOpacity:d,lineDash:p,lineDashOffset:f}=e.marker,y=new Lt;y.shape=l??"square",y.size=t,y.fill=c,y.fillOpacity=h??1,y.stroke=u,y.strokeOpacity=d??1,y.strokeWidth=n,y.lineDash=p,y.lineDashOffset=f??0;const b=Lt.anchor(l),m=o/2+(b.x-.5)*t,v=a/2+(b.y-.5)*t,M=t/(t+n);y.x=m,y.y=v,y.scalingCenterX=m,y.scalingCenterY=v,y.scalingX=M,y.scalingY=M,s.append(y)}return ue.toSVG(s,o,a)}var Pt="ag-charts-tooltip",Lx="ag-charts-tooltip--dark";function kx(e){const t=[],i=new Map;for(const s of e)if(s.type==="structured"){const{heading:n}=s,r=n!=null?i.get(n):void 0,o={type:"structured",heading:n,items:[s]};r==null?(i.set(n,o),t.push(o)):r.items.push(s)}else t.push(s);return t}function Cx(e){const t=kx(e),i=[];return t.forEach(s=>{if(s.type==="raw")return"";s.heading!=null&&i.push(s.heading),s.items.forEach(n=>{n.title!=null&&i.push(n.title),n.data?.forEach(r=>{i.push(r.label??r.fallbackLabel,r.value)})})}),i.join("; ")}function rg(e,t,i){let s="";e==null?s+=`<span class="${Pt}-label">${Xa(t)}</span>`:(s+=`<span class="${Pt}-label">${Xa(e)}</span>`,s+=" ",s+=`<span class="${Pt}-value">${Xa(t)}</span>`);const n=[`${Pt}-row`];return i&&n.push(`${Pt}-row--inline`),s=`<div class="${n.join(" ")}">${s}</div>`,s}function rN(e){let t="";if(e.data?.length&&e.data.every(n=>n.value==null||n.value===""))return t;const i=e.title==null&&e.data?.length===1,s=e.symbol==null?void 0:Ax(e.symbol,12);return s!=null&&(e.title!=null||e.data?.length)&&(t+=`<span class="${Pt}-symbol">${s}</span>`),e.title!=null&&(t+=`<span class="${Pt}-title">${Xa(e.title)}</span>`,t+=" "),e.data?.forEach(n=>{t+=rg(n.label??n.fallbackLabel,n.value,i),t+=" "}),t}function wx(e,t){if(e==null||t.length===1)return;const i=e?.t("tooltipPaginationStatus",{index:t.index+1,count:t.length});return`<div class="${Pt}-footer">${i}</div>`}function Tx(e,t,i,s){const n=t.items.length===1?t.items[0]:void 0;let r,o,a;switch(i){case"compact":r=!0,o=n?.title;break;case"single":r=n!=null&&(t.heading==null||n.title==null)&&n.data?.length===1&&n.data[0].label==null&&n.data[0].value!=null,a=t.heading??n?.title;break;case"shared":r=!1}let l="";if(r&&n!=null?(o!=null&&(l+=rg(void 0,o,!1)),n.data?.forEach(h=>{l+=rg(h.label??a,h.value,!1),l+=" "})):(t.heading!=null&&(l+=`<span class="${Pt}-heading">${Xa(t.heading)}</span>`,l+=" "),t.items.forEach(h=>{l+=rN(h)})),l.length===0)return;const c=i!=="compact"&&s!=null?wx(e,s):void 0;return c+null&&(l+=c),l=`<div class="${Pt}-content">${l.trimEnd()}</div>`,l}function oN(e,t){const i=t==null?void 0:wx(e,t);return i==null?"":`<div class="${Pt}-content">${i}</div>`}function Nx(e,t,i,s){const n=kx(t);if(n.length!==0){if(n.length===1&&n[0].type==="structured")return Tx(e,n[0],i,s);{const r=n.map(o=>o.type==="structured"?Tx(e,o,i):o.rawHtmlString);return s!=null&&r.push(oN(e,s)??""),r.join("")}}}var aN={left:-1,"top-left":-1,"bottom-left":-1,top:0,center:0,bottom:0,right:1,"top-right":1,"bottom-right":1},lN={"top-left":-1,top:-1,"top-right":-1,left:0,center:0,right:0,"bottom-left":1,bottom:1,"bottom-right":1},cN={left:3,"top-left":void 0,"bottom-left":void 0,top:2,center:void 0,bottom:1,right:0,"top-right":void 0,"bottom-right":void 0},Ox={top:2,bottom:2,left:1,right:1,"top-right":3,"top-left":3,"bottom-right":3,"bottom-left":3,center:0},qs=class extends le{constructor(){super(...arguments),this.xOffset=0,this.yOffset=0}get defaultAnchorTo(){const{type:e,_seriesOverrideType:t}=this,i=e??t??"pointer";return i==="node"||i==="pointer"?i:"chart"}get defaultPlacement(){const{type:e,_seriesOverrideType:t}=this,i=e??t??"pointer";return i==="node"||i==="pointer"?"top":i}};g([x,vx("Use `anchorTo` and/or `placement` options instead.")],qs.prototype,"type",2),g([x],qs.prototype,"_seriesOverrideType",2),g([x],qs.prototype,"xOffset",2),g([x],qs.prototype,"yOffset",2),g([x],qs.prototype,"anchorTo",2),g([x],qs.prototype,"placement",2);var Hi=class extends le{constructor(){super(),this.enabled=!0,this.mode="single",this.delay=0,this.range=void 0,this.wrapping="hyphenate",this.position=new qs,this.pagination=!1,this.darkTheme=!1,this.bounds="extended",this.destroyFns=[],this.springAnimation=new iN,this.enableInteraction=!1,this.wrapTypes=["always","hyphenate","on-space","never"],this.sizeMonitor=new mb,this._elementSize=void 0,this._showTimeout=void 0,this.arrowPosition=void 0,this._visible=!1,this.positionParams=void 0,this.localeManager=void 0,this.destroyFns.push(this.springAnimation.addListener("update",this.updateTooltipPosition.bind(this)))}get interactive(){return this.enableInteraction}setup(e,t){return"togglePopover"in(0,sg.getWindow)().HTMLElement.prototype&&(this.element=t.addChild("tooltip-container",Pt),this.element.setAttribute("popover","manual"),this.element.className=Pt,this.element.style.positionAnchor=t.anchorName,this.sizeMonitor.observe(this.element,i=>{this._elementSize=i,this.updateTooltipPosition()})),this.localeManager=e,()=>{t.removeChild("tooltip-container",Pt),this.destroyFns.forEach(i=>i()),this.element&&this.sizeMonitor.unobserve(this.element)}}isVisible(){return this._visible}contains(e){return this.element?.contains(e)??!1}updateTooltipPosition(){const{element:e,_elementSize:t,positionParams:i}=this;if(e==null||t==null||i==null)return;const{canvasRect:s,relativeRect:n,meta:r}=i,{x:o,y:a}=this.springAnimation;let l=r.position?.placement??this.position.placement??r.position?.defaultPlacement??this.position.defaultPlacement;Array.isArray(l)||(l=[l]);const c=r.position?.anchorTo??this.position.anchorTo??r.position?.defaultAnchorTo??this.position.defaultAnchorTo,h=r.position?.xOffset??0,u=r.position?.yOffset??0,d=n.x,p=n.y,f=n.width-t.width-1+d,y=n.height-t.height+p;let b=0,m,v,M=!1;do{m=l[b],b+=1;const L=this.getTooltipBounds({elementSize:t,placement:m,anchorTo:c,canvasX:o,canvasY:a,yOffset:u,xOffset:h,canvasRect:s});v=Mx(t.width,t.height,n,L),M=!1,Ox[m]&1&&(M||(M=v.x<d||v.x>f)),Ox[m]&2&&(M||(M=v.y<p||v.y>y))}while(b<l.length&&M);const S=(0,sg.clamp)(d,v.x,f),D=(0,sg.clamp)(p,v.y,y);M||(M=S!==v.x||D!==v.y);const C=c!=="chart"&&!M&&!h&&!u,k=r.showArrow??this.showArrow??C;this.arrowPosition=k?cN[m]:void 0,this.updateClassModifiers(),e.style.translate=`${S}px ${D}px`}show(e,t,i,s,n,r=!1){const{element:o}=this;if(o!=null&&s!=null&&s.length!==0){const c=Nx(this.localeManager,s,this.mode,this.pagination?n:void 0);if(c==null){this.toggle(!1);return}o.innerHTML=c}else if(o==null||o.innerHTML===""){this.toggle(!1);return}const a={x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height};switch(this.positionParams={canvasRect:t,relativeRect:a,meta:i},i.position?.anchorTo??this.position.anchorTo??i.position?.defaultAnchorTo??this.position.defaultAnchorTo){case"node":this.springAnimation.update(i.nodeCanvasX??i.canvasX,i.nodeCanvasY??i.canvasY);break;case"pointer":this.springAnimation.update(i.canvasX,i.canvasY);break;case"chart":this.springAnimation.reset()}i.enableInteraction?(this.enableInteraction=!0,o.style.pointerEvents="auto",o.removeAttribute("aria-hidden"),o.tabIndex=-1):(this.enableInteraction=!1,o.style.pointerEvents="none",o.setAttribute("aria-hidden","true"),o.removeAttribute("tabindex")),o.style.setProperty("--top",`${t.top}px`),o.style.setProperty("--left",`${t.left}px`),this.updateClassModifiers(),this.toggle(!0,r)}hide(){this.toggle(!1)}toggle(e,t=!1){const{delay:i}=this;e&&i>0&&!t?this._showTimeout??(this._showTimeout=setTimeout(()=>{this._showTimeout=void 0,this.toggleCallback(!0)},i)):(clearTimeout(this._showTimeout),this._showTimeout=void 0,this.toggleCallback(e))}toggleCallback(e){this.element?.isConnected&&this._visible!==e&&(this._visible=e,this.element.togglePopover(e),e?this.updateTooltipPosition():this.springAnimation.reset())}updateClassModifiers(){if(!this.element?.isConnected)return;const{classList:e}=this.element,t=(i,s)=>e.toggle(`${Pt}--${i}`,s);t("no-interaction",!this.enableInteraction),t("arrow-top",this.arrowPosition===1),t("arrow-right",this.arrowPosition===3),t("arrow-bottom",this.arrowPosition===2),t("arrow-left",this.arrowPosition===0),t("compact",this.mode==="compact"),e.toggle(Lx,this.darkTheme);for(const i of this.wrapTypes)e.toggle(`${Pt}--wrap-${i}`,i===this.wrapping)}getTooltipBounds(e){const{elementSize:t,anchorTo:i,placement:s,canvasX:n,canvasY:r,yOffset:o,xOffset:a,canvasRect:l}=e,{width:c,height:h}=t,u={width:c,height:h};if(i==="node"||i==="pointer"){const d=aN[s],p=lN[s];return u.top=r+o+h*(p-1)/2+8*p,u.left=n+a+c*(d-1)/2+8*d,u}switch(s){case"top":return u.top=o,u.left=l.width/2-c/2+a,u;case"right":return u.top=l.height/2-h/2+o,u.left=l.width-c/2+a,u;case"left":return u.top=l.height/2-h/2+o,u.left=a,u;case"bottom":return u.top=l.height-h+o,u.left=l.width/2-c/2+a,u;case"top-left":return u.top=o,u.left=a,u;case"top-right":return u.top=o,u.left=l.width-c+a,u;case"bottom-right":return u.top=l.height-h+o,u.left=l.width-c+a,u;case"bottom-left":return u.top=l.height-h+o,u.left=a,u}return u}};g([x],Hi.prototype,"enabled",2),g([x],Hi.prototype,"mode",2),g([x],Hi.prototype,"showArrow",2),g([x],Hi.prototype,"delay",2),g([x],Hi.prototype,"range",2),g([x],Hi.prototype,"wrapping",2),g([x],Hi.prototype,"position",2),g([x],Hi.prototype,"pagination",2),g([x],Hi.prototype,"darkTheme",2),g([x],Hi.prototype,"bounds",2);function og(e,t){return e.series===t.series&&ii(e.datumIndex,t.datumIndex)}var hN=class{constructor(){this.candidates=[]}get current(){return this.active}reset(){this.candidates.length=0,this.active=void 0}update(e,t){this.candidates=e;let i=t!=null?e.findIndex(s=>og(s,t)):-1;return i===-1&&(i=0),this.active=e[i],{current:this.active,index:i,length:e.length}}next(){const{candidates:e,active:t}=this,i=t==null?-1:e.findIndex(n=>og(n,t));if(i===-1)return;let s=i+1;return s>=e.length&&(s=0),this.active=e[s],{current:this.active,index:s,length:this.candidates.length}}},uN=class extends Ws{constructor(e){super(),this.chart=e,this.id=(0,xx.createId)(this),this.series=[],this.highlight={pendingHoverEvent:void 0,appliedHoverEvent:void 0,stashedHoverEvent:void 0},this.tooltip={lastHover:void 0},this.hoverDevice="pointer",this.previousInputDevice="keyboard",this.focus={sortedSeries:[],series:void 0,seriesIndex:0,datumIndex:0,datum:void 0},this.hoverScheduler=TL(()=>{if(!(!this.tooltip.lastHover&&!this.highlight.pendingHoverEvent)){if(this.chart.getUpdateType()<=5){this.hoverScheduler.schedule();return}this.highlight.pendingHoverEvent&&this.handleHoverHighlight(!1),this.tooltip.lastHover&&this.handleHoverTooltip(this.tooltip.lastHover,!1)}}),this.tooltipCandidates=new hN;const t=e.ctx.domManager.addChild("series-area","series-area-aria-label1"),i=e.ctx.domManager.addChild("series-area","series-area-aria-label2");this.swapChain=new HT(t,i,"img"),this.swapChain.addListener("blur",o=>this.onBlur(o)),this.swapChain.addListener("focus",()=>this.onFocus()),e.ctx.domManager.mode==="normal"&&(this.focusIndicator=new WT(this.swapChain),this.focusIndicator.overrideFocusVisible(e.mode==="integrated"?!1:void 0));const{seriesDragInterpreter:s,seriesWidget:n,containerWidget:r}=e.ctx.widgets;n.setTabIndex(-1),this.destroyFns.push(()=>e.ctx.domManager.removeChild("series-area","series-area-aria-label1"),()=>e.ctx.domManager.removeChild("series-area","series-area-aria-label2"),n.addListener("focus",()=>this.swapChain.focus()),n.addListener("mousemove",o=>this.onHover(o)),n.addListener("wheel",o=>this.onWheel(o)),n.addListener("mouseleave",o=>this.onLeave(o)),n.addListener("keydown",o=>this.onKeyDown(o)),n.addListener("contextmenu",(o,a)=>this.onContextMenu(o,a)),s.addListener("drag-move",o=>this.onDragMove(o)),s.addListener("click",o=>this.onClick(o,n)),s.addListener("dblclick",o=>this.onClick(o,n)),r.addListener("contextmenu",(o,a)=>this.onContextMenu(o,a)),r.addListener("click",(o,a)=>this.onClick(o,a)),r.addListener("dblclick",(o,a)=>this.onClick(o,a)),e.ctx.animationManager.addListener("animation-start",()=>this.clearAll()),e.ctx.domManager.addListener("resize",()=>this.clearAll()),e.ctx.highlightManager.addListener("highlight-change",o=>this.changeHighlightDatum(o)),e.ctx.layoutManager.addListener("layout:complete",o=>this.layoutComplete(o)),e.ctx.updateService.addListener("pre-scene-render",()=>this.preSceneRender()),e.ctx.updateService.addListener("update-complete",()=>this.updateComplete()),e.ctx.zoomManager.addListener("zoom-change",()=>this.clearAll()),e.ctx.zoomManager.addListener("zoom-pan-start",()=>this.clearAll()))}get bbox(){return(this.seriesRect??U.zero).clone()}isState(e){return this.chart.ctx.interactionManager.isState(e)}isIgnoredTouch(e){return!(e.device!=="touch"||e.type==="click"||this.chart.ctx.chartService.touch.dragAction==="hover"||this.chart.ctx.chartService.touch.dragAction==="drag"&&this.isState(9))}dataChanged(){var e;(e=this.highlight).stashedHoverEvent??(e.stashedHoverEvent=this.highlight.appliedHoverEvent),this.chart.ctx.tooltipManager.removeTooltip(this.id),this.focusIndicator?.clear(),this.clearHighlight()}preSceneRender(){this.highlight.stashedHoverEvent!=null&&(this.highlight.pendingHoverEvent=this.highlight.stashedHoverEvent,this.highlight.stashedHoverEvent=void 0,this.handleHoverHighlight(!0)),this.tooltip.lastHover!=null&&this.handleHoverTooltip(this.tooltip.lastHover,!0)}updateComplete(){this.isState(34)&&this.focusIndicator?.isFocusVisible()&&this.handleSeriesFocus(0,0,!0)}update(e,t){this.chart.ctx.updateService.update(e,t)}seriesChanged(e){this.focus.sortedSeries=[...e].sort((t,i)=>{let s=t.properties.focusPriority??1/0,n=i.properties.focusPriority??1/0;return s===n&&([s,n]=[t._declarationOrder,i._declarationOrder]),s<n?-1:s>n?1:0}),this.series=e}layoutComplete(e){this.seriesRect=e.series.rect,this.hoverRect=e.series.paddedRect,this.chart.ctx.widgets.seriesWidget.setBounds(e.series.paddedRect),this.chart.ctx.domManager.mode==="normal"&&this.chart.ctx.widgets.chartWidget.setBounds(e.chart)}onContextMenu(e,t){const{sourceEvent:i}=e;if(i.currentTarget!=t.getElement())return;if(i.target==this.chart.ctx.widgets.containerWidget.getElement()){if(this.isState(36)){const{currentX:l,currentY:c}=e;this.chart.ctx.contextMenuRegistry.dispatchContext("always",{widgetEvent:e,canvasX:l,canvasY:c},void 0)}return}let s,n;if(this.focusIndicator?.isFocusVisible())s=this.chart.ctx.highlightManager.getActiveHighlight(),s&&this.seriesRect&&s.midPoint&&(n=Qe.toCanvasPoint(s.series.contentGroup,s.midPoint.x,s.midPoint.y));else if(this.isState(36)){const l=this.pickNodes({x:e.currentX,y:e.currentY},"context-menu");l&&(this.chart.ctx.highlightManager.updateHighlight(this.id),s=l.matches[0].datum)}const r=s?.series;this.clearAll();const o=e.currentX+t.cssLeft(),a=e.currentY+t.cssTop();r&&s?this.chart.ctx.contextMenuRegistry.dispatchContext("series-node",{widgetEvent:e,canvasX:o,canvasY:a},{pickedSeries:r,pickedNode:s},n):this.chart.ctx.contextMenuRegistry.dispatchContext("series-area",{widgetEvent:e,canvasX:o,canvasY:a},void 0,n)}onLeave(e){!this.isState(41)||e.sourceEvent.relatedTarget?.className==="ag-charts-text-input__textarea"||this.chart.ctx.tooltipManager.isEnteringInteractiveTooltip(e.sourceEvent)||(this.chart.ctx.domManager.updateCursor(this.id),this.hoverDevice!=="keyboard"&&this.clearAll())}onWheel(e){this.isState(41)&&(this.focusIndicator?.overrideFocusVisible(!1),this.previousInputDevice="pointer")}onDragMove(e){this.isState(41)&&(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(e))}onHover(e){this.isState(41)&&this.onHoverLikeEvent(e)}onHoverLikeEvent(e){if(!this.isIgnoredTouch(e)&&((e.device==="touch"||dN(e,"drag-move"))&&(this.tooltip.lastHover=e),e.device==="touch"&&this.chart.ctx.chartService.touch.dragAction==="hover"&&e.sourceEvent.preventDefault(),this.hoverDevice="pointer",this.previousInputDevice="pointer",this.highlight.pendingHoverEvent=e,this.hoverScheduler.schedule(),this.isState(32))){const{currentX:t,currentY:i}=e,s=this.pickNodes({x:t,y:i},"event")?.matches,n=s?.[0];n?.series.hasEventListener("seriesNodeClick")||n?.series.hasEventListener("seriesNodeDoubleClick")||s!=null&&s.length>1&&this.chart.tooltip.pagination?this.chart.ctx.domManager.updateCursor(this.id,"pointer"):this.chart.ctx.domManager.updateCursor(this.id)}}onClick(e,t){if(t===this.chart.ctx.widgets.seriesWidget&&this.chart.ctx.animationManager.isActive()&&this.chart.ctx.animationManager.skipCurrentBatch(),e.device==="touch"&&t===this.chart.ctx.widgets.seriesWidget&&this.swapChain.focus({preventScroll:!0}),!this.isState(41))return;if(t===this.chart.ctx.widgets.seriesWidget){if(!t.getElement().contains(e.sourceEvent.target))return}else if(e.sourceEvent.target!=t.getElement())return;if(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(e),!this.isState(32))return;if(t==this.chart.ctx.widgets.seriesWidget&&this.checkSeriesNodeClick(e)){this.update(5),e.sourceEvent.preventDefault();return}const i={type:e.type==="click"?"click":"doubleClick",event:e.sourceEvent};this.chart.fireEvent(i)}onFocus(){this.isState(34)&&(this.hoverDevice=this.focusIndicator?.isFocusVisible(!0)?"keyboard":"pointer",this.handleFocus(0,0))}onBlur(e){this.isState(34)&&(this.hoverDevice="pointer",this.chart.ctx.tooltipManager.isEnteringInteractiveTooltip(e)||this.clearAll(),this.focusIndicator?.overrideFocusVisible(void 0))}onKeyDown(e){if(!this.isState(43))return;const t=ZT(e.sourceEvent);switch(t?.activatesFocusIndicator===!1&&this.focusIndicator?.overrideFocusVisible(this.previousInputDevice==="keyboard"),t?.name){case"redo":return this.chart.ctx.chartEventManager.seriesEvent("series-redo");case"undo":return this.chart.ctx.chartEventManager.seriesEvent("series-undo");case"zoomin":return this.chart.ctx.chartEventManager.seriesKeyNavZoom(1,e);case"zoomout":return this.chart.ctx.chartEventManager.seriesKeyNavZoom(-1,e);case"arrowup":return this.onArrow(-1,0,e);case"arrowdown":return this.onArrow(1,0,e);case"arrowleft":return this.onArrow(0,-1,e);case"arrowright":return this.onArrow(0,1,e);case"submit":return this.onSubmit(e)}}onArrow(e,t,i){this.isState(34)&&(this.hoverDevice="keyboard",this.previousInputDevice="keyboard",this.focusIndicator?.overrideFocusVisible(!0),this.focus.seriesIndex+=e,this.focus.datumIndex+=t,this.handleFocus(e,t),i.sourceEvent.preventDefault(),this.chart.ctx.chartEventManager.seriesEvent("series-focus-change"))}onSubmit(e){if(!this.isState(34))return;const{series:t,datum:i}=this.focus,s=e.sourceEvent;t!==void 0&&i!==void 0?t.fireNodeClickEvent(s,i):this.chart.fireEvent({type:"click",event:s}),s.preventDefault()}checkSeriesNodeClick(e){var t;const i=this.pickNodes({x:e.currentX,y:e.currentY},"event");if(i==null||i.matches.length===0)return;const s=this.chart.tooltip.pagination?this.tooltipCandidates.update(i.matches,this.tooltipCandidates.current)?.current:void 0,{series:n,datum:r}=s??i.matches[0],o=s==null?i.distance:0;if(e.type==="click"){const l=n.fireNodeClickEvent(e.sourceEvent,r)&&this.chart.tooltip.pagination?this.tooltipCandidates.next():void 0;if(l!=null){e.sourceEvent.preventDefault();const{currentX:c,currentY:h}=e,u=c+(this.hoverRect?.x??0),d=h+(this.hoverRect?.y??0);(t=this.highlight).pendingHoverEvent??(t.pendingHoverEvent=this.highlight.appliedHoverEvent),this.handleHoverHighlight(!1),this.showTooltip(l.current,u,d,{index:l.index,length:l.length})}return!0}return e.type==="dblclick"?(e.preventZoomDblClick=o===0,n.fireNodeDoubleClickEvent(e.sourceEvent,r),!0):!1}handleFocus(e,t){const i=this.chart.overlays.getFocusInfo(this.chart.ctx.localeManager);i==null?this.handleSeriesFocus(e,t):this.focusIndicator?.update(i.rect,this.seriesRect,!1)}handleSeriesFocus(e,t,i=!1){if(this.chart.chartType==="hierarchy"||this.chart.chartType==="gauge"){this.handleSoloSeriesFocus(e,t,i);return}const{focus:s}=this,n=s.sortedSeries.filter(c=>c.visible&&c.focusable);if(n.length===0)return;const r=s.datumIndex-t,o=s.seriesIndex-e;s.seriesIndex=(0,xx.clamp)(0,s.seriesIndex,n.length-1),s.series=n[s.seriesIndex];const a=this.focus.datumIndex,l=this.focus.seriesIndex;this.updatePickedFocus(a,t,r,l,e,o,i)}handleSoloSeriesFocus(e,t,i){this.focus.series=this.focus.sortedSeries[0];const s=this.focus.datumIndex,n=this.focus.seriesIndex,r=this.focus.datumIndex-t,o=this.focus.seriesIndex-e;this.updatePickedFocus(s,t,r,n,e,o,i)}updatePickedFocus(e,t,i,s,n,r,o){const{focus:a,hoverRect:l,seriesRect:c}=this;if(a.series===void 0||l===void 0)return;const h=a?.series?.pickFocus({datumIndex:e,datumIndexDelta:t,otherIndex:s,otherIndexDelta:n,seriesRect:c});if(!h)return;const{datum:u}=h;if(h.otherIndex!==void 0&&(a.seriesIndex=h.otherIndex),a.datumIndex=h.datumIndex,a.datum=u,this.focusIndicator?.isFocusVisible()&&this.chart.ctx.animationManager.reset(),this.focusIndicator?.isFocusVisible()){const p=qT(h),{x:f,y}=p.computeCenter();if(!l.containsPoint(f,y)&&this.chart.ctx.zoomManager.panToBBox(this.id,l,p))return;const{x1:b,x2:m,y1:v,y2:M}=Ba.from(p),S=l.containsPoint(b,v),D=l.containsPoint(m,v),C=l.containsPoint(b,M),k=l.containsPoint(m,M);if(!(S||D||C||k)){const L=Ba.from(l);h.movedBounds=p.clone(),b<L.x1&&m<L.x1?(h.movedBounds.x=L.x1-2,h.movedBounds.width=4):b>L.x2&&m>L.x2&&(h.movedBounds.x=L.x2-2,h.movedBounds.width=4),v<L.y1&&M<L.y1?(h.movedBounds.y=L.y1-2,h.movedBounds.height=4):v>L.y2&&M>L.y2&&(h.movedBounds.y=L.y2-2,h.movedBounds.height=4)}}this.focusIndicator?.update(h.movedBounds??h.bounds,this.seriesRect,h.clipFocusBox);const d=QT(a.series,l,h);if(d!==void 0&&this.hoverDevice==="keyboard"){this.tooltip.lastHover=void 0,this.highlight.appliedHoverEvent=void 0,this.highlight.pendingHoverEvent=void 0,this.highlight.stashedHoverEvent=void 0;const p=this.chart.getTooltipContent(a.series,u.datumIndex,u),f=ih.makeTooltipMeta(d,a.series,u,h.movedBounds);this.chart.ctx.highlightManager.updateHighlight(this.id,u),a.series.tooltipEnabled??this.chart.tooltip.enabled?this.chart.ctx.tooltipManager.updateTooltip(this.id,f,p):this.chart.ctx.tooltipManager.removeTooltip(this.id),o||(t===0&&n===0||i!==h.datumIndex||r!==(h.otherIndex??a.seriesIndex))&&this.swapChain.update(this.getDatumAriaText(u,p))}}getDatumAriaText(e,t){const i=t==null?"":Cx(t);return this.chart.ctx.localeManager.t("ariaAnnounceHoverDatum",{datum:e.series.getDatumAriaText?.(e,i)??i})}clearHighlight(){this.highlight.pendingHoverEvent=void 0,this.highlight.appliedHoverEvent=void 0,this.chart.ctx.highlightManager.updateHighlight(this.id)}clearTooltip(){this.chart.ctx.tooltipManager.removeTooltip(this.id),this.tooltip.lastHover=void 0}clearAll(){this.clearHighlight(),this.clearTooltip(),this.focusIndicator?.clear()}handleHoverHighlight(e){this.highlight.appliedHoverEvent=this.highlight.pendingHoverEvent,this.highlight.pendingHoverEvent=void 0;const t=this.highlight.appliedHoverEvent;if(!t||!this.isState(41))return;const{currentX:i,currentY:s}=t,n=t.currentX+(this.hoverRect?.x??0),r=t.currentY+(this.hoverRect?.y??0);if(e?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(n,r)){this.clearHighlight();return}const{range:o}=this.chart.highlight,a=o==="tooltip"?"highlight-tooltip":"highlight",l=this.pickNodes({x:i,y:s},a);if(!l||l.matches.length===0){this.chart.ctx.highlightManager.updateHighlight(this.id);return}const{current:c}=this.tooltipCandidates,u=(c==null?void 0:l.matches.find(d=>og(d,c)))?.datum??l.matches[0].datum;this.chart.ctx.highlightManager.updateHighlight(this.id,u),this.hoverDevice="pointer"}handleHoverTooltip(e,t){const{current:i}=this.tooltipCandidates;if(this.tooltipCandidates.reset(),!this.isState(41))return;const{currentX:s,currentY:n}=e,r=s+(this.hoverRect?.x??0),o=n+(this.hoverRect?.y??0),a=e.sourceEvent.target;if(t?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(r,o)){this.hoverDevice=="pointer"&&this.clearTooltip();return}if(a&&this.chart.tooltip.interactive&&this.chart.ctx.domManager.isManagedChildDOMElement(a,"canvas-overlay",Pt))return;const l=this.pickNodes({x:e.currentX,y:e.currentY},"tooltip");if(!l||l.matches.length===0){this.hoverDevice=="pointer"&&this.clearTooltip();return}if(this.hoverDevice="pointer",l.distance===0){const{current:c,index:h,length:u}=this.tooltipCandidates.update(l.matches,this.chart.tooltip.pagination?i:void 0);this.showTooltip(c,r,o,{index:h,length:u})}else this.showTooltip(l.matches[0],r,o)}showTooltip({series:e,datum:t,datumIndex:i},s,n,r){const o=this.chart.getTooltipContent(e,i,t);if((e.tooltipEnabled??this.chart.tooltip.enabled)&&o!=null){const c=ih.makeTooltipMeta({type:"pointermove",canvasX:s,canvasY:n},e,t,void 0);this.chart.ctx.tooltipManager.updateTooltip(this.id,c,o,r)}else this.chart.ctx.tooltipManager.removeTooltip(this.id)}changeHighlightDatum(e){const t=new Set,{series:i=void 0,datum:s}=e.currentHighlight??{},{series:n=void 0,datum:r}=e.previousHighlight??{};n&&t.add(n),i&&t.add(i),n?.properties.cursor&&r&&this.chart.ctx.domManager.updateCursor(n.id),i?.properties.cursor&&i?.properties.cursor!=="default"&&s&&this.chart.ctx.domManager.updateCursor(i.id,i.properties.cursor),i==null||n==null?this.update(5):this.update(5,{seriesToUpdate:t})}pickNodes(e,t,i){const s=[...this.series].reverse();let n;for(const r of s){if(!r.visible||!r.contentGroup.visible)continue;const o=r.pickNodes(e,t,i);if(o==null||o.datums.length===0)continue;const{datums:a,distance:l}=o;if(o.datums.length!==0){if(l===0){n?.distance!==0&&(n={matches:[],distance:0});for(const c of a){const{datumIndex:h}=c;n.matches.push({series:r,datum:c,datumIndex:h})}}else if(n==null||n.distance>l){const[c]=a,{datumIndex:h}=c;n={matches:[{series:r,datum:c,datumIndex:h}],distance:l}}}}return n}};function dN(e,t){return e.type!==t}var pN=(O(),N(T)),Ex=30,gN=class{constructor(e){this.seriesRoot=e,this.groups=new Map,this.series=new Map,this.expectedSeriesCount=1,this.mode="normal"}setSeriesCount(e){this.expectedSeriesCount=e}requestGroup(e){const{internalId:t,type:i,contentGroup:s,seriesGrouping:n}=e,{groupIndex:r=t}=n??{},o=this.series.get(t);if(o!=null)throw new Error(`AG Charts - series already has an allocated layer: ${JSON.stringify(o)}`);this.series.size===0&&(this.mode=this.expectedSeriesCount>=Ex?"aggressive-grouping":"normal");let a=this.groups.get(i);a==null&&(a=new Map,this.groups.set(i,a));const l=this.lookupIdx(r);let c=a.get(l);return c==null&&(c={type:i,id:l,seriesIds:[],group:this.seriesRoot.appendChild(new ue({name:`${e.contentGroup.name??i}-managed-layer`,zIndex:e.contentGroup.zIndex,renderToOffscreenCanvas:!1}))},a.set(l,c)),this.series.set(t,{layerState:c,seriesConfig:e}),c.seriesIds.push(t),c.group.appendChild(s),c.group}changeGroup(e){const{internalId:t,seriesGrouping:i,type:s,contentGroup:n,oldGrouping:r}=e,{groupIndex:o=t}=i??{};this.groups.get(s)?.get(o)?.seriesIds.includes(t)||(this.series.has(t)&&this.releaseGroup({internalId:t,seriesGrouping:r,type:s,contentGroup:n}),this.requestGroup(e))}releaseGroup(e){const{internalId:t,contentGroup:i,type:s}=e;if(!this.series.has(t))throw new Error(`AG Charts - series doesn't have an allocated layer: ${t}`);const n=this.series.get(t)?.layerState;n&&(n.seriesIds=n.seriesIds.filter(r=>r!==t),n.group.removeChild(i)),n?.seriesIds.length===0?(this.seriesRoot.removeChild(n.group),this.groups.get(n.type)?.delete(n.id),this.groups.get(s)?.delete(t)):n!=null&&n.seriesIds.length>0&&(n.group.zIndex=this.getLowestSeriesZIndex(n.seriesIds)),this.series.delete(t)}updateLayerCompositing(){this.groups.forEach(e=>{e.forEach(t=>{const{group:i,seriesIds:s}=t;let n;s.length===0?n=!1:s.length>1?n=!0:n=this.series.get(s[0])?.seriesConfig.renderToOffscreenCanvas()===!0,i.renderToOffscreenCanvas=n,i.zIndex=this.getLowestSeriesZIndex(s)})})}lookupIdx(e){return this.mode==="normal"?e:typeof e=="string"&&(e=Number(e.split("-").at(-1)),!e)?0:Math.floor((0,pN.clamp)(0,e/this.expectedSeriesCount,1)*Ex)}destroy(){this.groups.forEach(e=>{e.forEach(t=>{this.seriesRoot.removeChild(t.group)})}),this.groups.clear(),this.series.clear()}getLowestSeriesZIndex(e){return e.reduce((i,s)=>{const r=this.series.get(s)?.seriesConfig.contentGroup.zIndex;return i==null||r==null?r:Yy(i,r)<=0?i:r},void 0)??1}},Px=class extends le{constructor(){super(...arguments),this.dragAction="drag"}};g([x],Px.prototype,"dragAction",2);var fN=class{constructor(e,t,i,s,n){this.chart=e,this.dataService=t,this.updateService=i,this.zoomManager=s,this.animationManager=n,this.dirtyZoom=!1,this.dirtyDataSource=!1,this.lastAxisZooms=new Map,this.destroyFns=[],this.destroyFns.push(this.dataService.addListener("data-source-change",()=>this.onDataSourceChange()),this.dataService.addListener("data-load",()=>this.onDataLoad()),this.dataService.addListener("data-error",()=>this.onDataError()),this.updateService.addListener("update-complete",r=>this.onUpdateComplete(r)),this.zoomManager.addListener("zoom-change",()=>this.onZoomChange()))}destroy(){this.destroyFns.forEach(e=>e())}onDataLoad(){this.animationManager.skip(),this.updateService.update(1)}onDataError(){this.updateService.update(4)}onDataSourceChange(){this.dirtyDataSource=!0}onUpdateComplete(e){!e.apiUpdate&&!this.dirtyZoom&&!this.dirtyDataSource||this.updateWindow(e)}onZoomChange(){this.dirtyZoom=!0}updateWindow(e){if(!this.dataService.isLazy())return;const t=this.getValidAxis();let i,s=!0;if(t){const n=this.zoomManager.getAxisZoom(t.id);i=this.getAxisWindow(t,n),s=this.shouldRefresh(e,t,n)}this.dirtyZoom=!1,this.dirtyDataSource=!1,s&&this.dataService.load({windowStart:i?.min,windowEnd:i?.max})}getValidAxis(){return this.chart.axes.find(e=>e.type==="time")}shouldRefresh(e,t,i){if(e.apiUpdate||this.dirtyDataSource)return!0;if(!this.dirtyZoom)return!1;const s=this.lastAxisZooms.get(t.id);return s&&i.min===s.min&&i.max===s.max?!1:(this.lastAxisZooms.set(t.id,i),!0)}getAxisWindow(e,t){const{domain:i}=e.scale;if(!t||i.length===0||isNaN(Number(i[0])))return;const s=Number(i[1])-Number(i[0]),n=new Date(Number(i[0])+s*t.min),r=new Date(Number(i[0])+s*t.max);return{min:n,max:r}}},mN=(O(),N(T)),ag=(O(),N(T)),yN=/^((?!chrome|android).)*safari/i,bN=/Version\/(\d+(\.\d+)?)/,xN=/Chrome/,vN=/Chrome\/(\d+)/,MN=/Edg/,SN=/OPR/;function DN(){const{userAgent:e}=(0,ag.getWindow)("navigator");if(yN.test(e)){const t=bN.exec(e);if(t==null)return!1;const i=parseFloat(t[1]),s=Math.floor(i)>16;return s||ag.Logger.warnOnce(`Unsupported Safari version: ${i}; ${e}`),!s}else if(xN.test(e)&&!MN.test(e)&&!SN.test(e)){const t=vN.exec(e);if(t==null)return!1;const i=parseInt(t[1],10),s=i>126;return s||ag.Logger.warnOnce(`Unsupported Chrome version: ${i}; ${e}`),!s}return!1}var IN=new Set(["map-shape-background","map-line-background"]),AN=class{constructor(e,t,i,s,n,r,o){this.chartLike=e,this.overlays=t,this.dataService=i,this.layoutManager=s,this.localeManager=n,this.animationManager=r,this.domManager=o,this.destroyFns=[],this.overlayElem=this.domManager.addChild("canvas-overlay","overlay"),this.overlayElem.role="status",this.overlayElem.ariaAtomic="false",this.overlayElem.ariaLive="polite",this.overlayElem.classList.toggle(tg),this.destroyFns.push(this.layoutManager.addListener("layout:complete",a=>this.onLayoutComplete(a)))}destroy(){this.destroyFns.forEach(e=>e()),this.domManager.removeChild("canvas-overlay","overlay")}onLayoutComplete({series:{rect:e}}){const t=this.dataService.isLoading(),i=this.chartLike.series.some(c=>c.hasData),s=this.chartLike.series.some(c=>c.visible&&!IN.has(c.type));this.overlays.darkTheme?this.overlayElem.classList.add(gx):this.overlayElem.classList.remove(gx),this.overlayElem.style.left=`${e.x}px`,this.overlayElem.style.top=`${e.y}px`,this.overlayElem.style.width=`${e.width}px`,this.overlayElem.style.height=`${e.height}px`;const n=t,r=!t&&!i,o=i&&!s,a=this.overlays.unsupportedBrowser.enabled&&DN();n?this.showOverlay(this.overlays.loading,e):this.hideOverlay(this.overlays.loading),r?this.showOverlay(this.overlays.noData,e):this.hideOverlay(this.overlays.noData),o?this.showOverlay(this.overlays.noVisibleSeries,e):this.hideOverlay(this.overlays.noVisibleSeries),a?this.showOverlay(this.overlays.unsupportedBrowser,e):this.hideOverlay(this.overlays.unsupportedBrowser);const l=n||r||o||a;(0,mN.setAttribute)(this.overlayElem,"aria-hidden",!l)}showOverlay(e,t){if(!e.enabled)return;const i=e.getElement(this.animationManager,this.localeManager,t);this.overlayElem.appendChild(i)}hideOverlay(e){e.removeElement(()=>{this.overlayElem.innerText="\xA0"},this.animationManager)}},cs=ke.create(!0,"opts"),lg=class extends le{constructor(){super(...arguments),this.padding=new vn(0)}};g([x],lg.prototype,"clip",2),g([x],lg.prototype,"padding",2);var et=class dD extends tb{constructor(t,i){var s;super(),this.id=(0,Nt.createId)(this),this.seriesRoot=new Ot({name:`${this.id}-series-root`,zIndex:5}),this.annotationRoot=new Ot({name:`${this.id}-annotation-root`,zIndex:9}),this.titleGroup=new ue({name:"titles",zIndex:13}),this.debug=ke.create(),this.extraDebugStats={},this.data=[],this._firstAutoSize=!0,this._autoSizeNotify=new Nt.AsyncAwaitQueue,this.padding=new vn(20),this.seriesArea=new lg,this.keyboard=new wp,this.touch=new Px,this.mode="standalone",this.chartCaptions=new jc,this.suppressFieldDotNotation=!1,this.loadGoogleFonts=!1,this.destroyed=!1,this._destroyFns=[],this.chartAnimationPhase="initial",this.modulesManager=new zT,this.processors=[],this.queuedUserOptions=[],this.queuedChartOptions=[],this.firstApply=!0,this.syncStatus="init",this.apiUpdate=!1,this._pendingFactoryUpdatesCount=0,this._performUpdateSkipAnimations=!1,this._performUpdateNotify=new Nt.AsyncAwaitQueue,this.performUpdateType=8,this.runningUpdateType=8,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new LL,this.updateRequestors={},this.performUpdateTrigger=NL(({count:h})=>{this.destroyed||this.updateMutex.acquire(async()=>{try{await this.performUpdate(h)}catch(u){Nt.Logger.error("update error",u)}}).catch(u=>Nt.Logger.errorOnce(u))}),this._performUpdateSplits={},this.axes=[],this.series=[],this._cachedData=void 0,this.onSeriesNodeClick=h=>{this.fireEvent(h)},this.onSeriesNodeDoubleClick=h=>{this.fireEvent(h)},this.onSeriesVisibilityChange=h=>{this.fireEvent(h)},this.seriesGroupingChanged=h=>{if(!(h instanceof ig))return;const{series:u,seriesGrouping:d,oldGrouping:p}=h;u.contentGroup.isRoot()||this.seriesLayerManager.changeGroup({internalId:u.internalId,type:u.type,contentGroup:u.contentGroup,renderToOffscreenCanvas:()=>u.renderToOffscreenCanvas(),seriesGrouping:d,oldGrouping:p})},this.chartOptions=t;const n=i?.scene,r=i?.container??t.processedOptions.container??void 0,o=i?.styleContainer??t.specialOverrides.styleContainer;n&&(this._firstAutoSize=!1,this._lastAutoSize=[n.width,n.height,n.pixelRatio]);const a=new ue({name:"root"});a.visible=!1,a.append(this.seriesRoot),a.append(this.annotationRoot),a.append(this.titleGroup),this.titleGroup.append(this.title.node),this.titleGroup.append(this.subtitle.node),this.titleGroup.append(this.footnote.node),this.tooltip=new Hi,this.seriesLayerManager=new gN(this.seriesRoot),this.mode=t.userOptions.mode??this.mode,this.styleNonce=t.processedOptions.styleNonce;const l=this.ctx=new mw(this,{chartType:this.getChartType(),scene:n,root:a,container:r,styleContainer:o,domMode:t.optionMetadata.domMode,syncManager:new Vw(this),fireEvent:h=>this.fireEvent(h),updateCallback:(h,u)=>this.update(h,u),updateMutex:this.updateMutex});this._destroyFns.push(l.domManager.addListener("resize",()=>this.parentResize(l.domManager.containerSize))),this.overlays=new To,(s=this.overlays.loading).renderer??(s.renderer=()=>BT(this.overlays.loading.getText(l.localeManager),l.animationManager.defaultDuration)),this.processors=[new fN(this,l.dataService,l.updateService,l.zoomManager,l.animationManager),new AN(this,this.overlays,l.dataService,l.layoutManager,l.localeManager,l.animationManager,l.domManager)],this.highlight=new C0,this.container=r;const c=this.getModuleContext();l.domManager.setDataBoolean("animating",!1),this.seriesAreaManager=new uN(this.initSeriesAreaDependencies()),this._destroyFns.push(l.layoutManager.registerElement(0,h=>{h.layoutBox.shrink(this.padding.toJson()),this.chartCaptions.positionCaptions(h)}),l.layoutManager.addListener("layout:complete",h=>this.chartCaptions.positionAbsoluteCaptions(h)),l.dataService.addListener("data-load",h=>{this.data=h.data}),this.title.registerInteraction(c,"beforebegin"),this.subtitle.registerInteraction(c,"beforebegin"),this.footnote.registerInteraction(c,"afterend"),Is.addWindowEvent("page-left",()=>this.destroy()),l.animationManager.addListener("animation-frame",()=>{this.update(7)}),l.animationManager.addListener("animation-start",()=>l.domManager.setDataBoolean("animating",!0)),l.animationManager.addListener("animation-stop",()=>l.domManager.setDataBoolean("animating",!1)),l.zoomManager.addListener("zoom-change",()=>{this.series.forEach(u=>u.animationState?.transition("updateData"));const h=this.chartAnimationPhase!=="initial";this.update(4,{forceNodeDataRefresh:!0,skipAnimations:h})})),this.parentResize(l.domManager.containerSize)}static getInstance(t){return dD.chartsInstances.get(t)}get canvasElement(){return this.ctx.scene.canvas.element}download(t,i){this.ctx.scene.download(t,i)}getCanvasDataURL(t){return this.ctx.scene.getDataURL(t)}toSVG(){return this.ctx.scene.toSVG()}get seriesAreaBoundingBox(){return this.seriesAreaManager.bbox}getOptions(){return this.queuedUserOptions.at(-1)??this.chartOptions.userOptions}getChartOptions(){return this.queuedChartOptions.at(-1)??this.chartOptions}overrideFocusVisible(t){this.seriesAreaManager.focusIndicator?.overrideFocusVisible(t)}initSeriesAreaDependencies(){const{ctx:t,tooltip:i,highlight:s,overlays:n,seriesRoot:r,mode:o}=this,a=this.getChartType();return{fireEvent:this.fireEvent.bind(this),getUpdateType:()=>this.performUpdateType,getTooltipContent:(u,d,p)=>this.getTooltipContent(u,d,p),chartType:a,ctx:t,tooltip:i,highlight:s,overlays:n,seriesRoot:r,mode:o}}getModuleContext(){return this.ctx}getTooltipContent(t,i,s){const n=t.properties.tooltip.enabled!==!1?t.getTooltipContent(i,s):void 0,r=n==null?[]:[n];if(this.tooltip.mode!=="shared"||this.series.length===1)return r;const o=t.getCategoryValue(i);return o==null?r:this.series.flatMap(a=>{if(a===t)return r;if(!a.isEnabled()||a.properties.tooltip.enabled===!1)return[];const l=a.datumIndexForCategoryValue(o),c=l==null?void 0:a.getTooltipContent(l,void 0);return c==null?[]:[c]})}getCaptionText(){return[this.title,this.subtitle,this.footnote].filter(t=>t.enabled&&t.text).map(t=>t.text).join(". ")}getAriaLabel(){return this.ctx.localeManager.t("ariaAnnounceChart",{seriesCount:this.series.length})}resetAnimations(){this.chartAnimationPhase="initial";for(const t of this.series)t.resetAnimation(this.chartAnimationPhase);for(const t of this.axes)t.resetAnimation(this.chartAnimationPhase);this.animationRect=void 0,this.ctx.animationManager.reset()}skipAnimations(){this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0}detachAndClear(){this.container=void 0,this.ctx.scene.clearCanvas()}destroy(t){if(this.destroyed)return;const i=t?.keepTransferableResources;let s;return this.performUpdateType=8,this._destroyFns.forEach(n=>n()),this.processors.forEach(n=>n.destroy()),this.overlays.destroy(),this.modulesManager.destroy(),i?(this.ctx.scene.strip(),s={container:this.container,scene:this.ctx.scene}):(this.ctx.scene.destroy(),this.container=void 0),this.destroySeries(this.series),this.seriesLayerManager.destroy(),this.axes.forEach(n=>n.destroy()),this.axes=[],this.animationRect=void 0,this.ctx.destroy(),this.destroyed=!0,Object.freeze(this),s}requestFactoryUpdate(t){this.destroyed||(this._pendingFactoryUpdatesCount++,this.updateMutex.acquire(async()=>{if(!this.destroyed)try{await t(this)}finally{this.destroyed||this._pendingFactoryUpdatesCount--}}).catch(i=>Nt.Logger.errorOnce(i)))}clearCallbackCache(){this.ctx.callbackCache.invalidateCache();for(const t of this.series)t.resetDatumCallbackCache()}update(t=0,i){if(this.destroyed)return;const{forceNodeDataRefresh:s=!1,skipAnimations:n,seriesToUpdate:r=this.series,newAnimationBatch:o,apiUpdate:a=!1}=i??{};this.apiUpdate=a,this.ctx.widgets.seriesWidget.setDragTouchEnabled(this.touch.dragAction!=="none"),s&&this.series.forEach(l=>l.markNodeDataDirty());for(const l of r)this.seriesToUpdate.add(l);if(n&&(this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0),o&&this.ctx.animationManager.isActive()&&(this._performUpdateSkipAnimations=!0),this.debug.check()){let l=new Error().stack??"<unknown>";l=l.replace(/\([^)]*/g,""),this.updateRequestors[l]=t}t<this.performUpdateType&&(this.performUpdateType=t,this.ctx.domManager.setDataBoolean("updatePending",!0),this.performUpdateTrigger.schedule(i?.backOffMs))}async performUpdate(t){const{performUpdateType:i,extraDebugStats:s,_performUpdateSplits:n,ctx:r}=this,o=[...this.seriesToUpdate];this.clearCallbackCache(),this.performUpdateType=8,this.seriesToUpdate.clear(),this.runningUpdateType=i,this.updateShortcutCount===0&&i<7&&(r.animationManager.startBatch(this._performUpdateSkipAnimations),r.animationManager.onBatchStop(()=>this.chartAnimationPhase="ready")),this.ctx.scene.updateDebugFlags(),this.debug("Chart.performUpdate() - start",Ea[i]);let a=performance.now();n.start??(n.start=a);const l=h=>{n[h]??(n[h]=0),n[h]+=performance.now()-a,a=performance.now()};switch(i){case 0:if(this.checkUpdateShortcut(0))break;this.ctx.updateService.dispatchPreDomUpdate(),this.updateDOM();case 1:if(this.checkUpdateShortcut(1))break;await this.updateData(),l("\u2B07\uFE0F");case 2:if(this.checkUpdateShortcut(2))break;await this.processData(),this.seriesAreaManager.dataChanged(),l("\u{1F3ED}");case 3:if(this.checkUpdateShortcut(3))break;await this.processDomains(),l("\u26F0\uFE0F");case 4:if(await this.checkFirstAutoSize(),this.checkUpdateShortcut(4))break;await this.processLayout(),l("\u2316");case 5:{if(this.checkUpdateShortcut(5))break;await this.updateSeries(o),l("\u{1F914}"),this.updateAriaLabels(),this.seriesLayerManager.updateLayerCompositing()}case 6:if(this.checkUpdateShortcut(6))break;r.updateService.dispatchPreSceneRender(),l("\u2196");case 7:if(this.checkUpdateShortcut(7))break;r.animationManager.endBatch(),s.updateShortcutCount=this.updateShortcutCount,r.scene.render({debugSplitTimes:n,extraDebugStats:s,seriesRect:this.seriesRect}),this.extraDebugStats={};for(const h of Object.keys(n))delete n[h];this.ctx.domManager.incrementDataCounter("sceneRenders"),this.ctx.domManager.postRenderUpdate();case 8:this.updateShortcutCount=0,this.updateRequestors={},this._performUpdateSkipAnimations=!1,r.animationManager.endBatch()}this.destroyed||(r.updateService.dispatchUpdateComplete(this.apiUpdate),this.apiUpdate=!1,this.ctx.domManager.setDataBoolean("updatePending",!1),this.runningUpdateType=8,this.syncStatus="ready"),this._performUpdateNotify.notify();const c=performance.now();this.debug("Chart.performUpdate() - end",{chart:this,durationMs:Math.round((c-n.start)*100)/100,count:t,performUpdateType:Ea[i]})}updateThemeClassName(){const t="ag-charts-theme-",i=[`${t}default`,`${t}default-dark`];let s=i[0],n=!1,{theme:r}=this.chartOptions.processedOptions;for(;typeof r!="string"&&r!=null;)r=r.baseTheme;typeof r=="string"&&(s=r.replace("ag-",t),n=r.includes("-dark")),i.includes(s)||(s=n?i[1]:i[0]),this.ctx.domManager.setThemeClass(s)}updateDOM(){this.updateThemeClassName();const{enabled:t,tabIndex:i}=this.keyboard;this.ctx.domManager.setTabGuardIndex(t?i??0:-1),this.ctx.domManager.setThemeParameters(this.chartOptions.themeParameters)}updateAriaLabels(){this.ctx.domManager.updateCanvasLabel(this.getAriaLabel())}checkUpdateShortcut(t){return this.destroyed?!0:this.updateShortcutCount>3?(Nt.Logger.warn("exceeded the maximum number of simultaneous updates (4), discarding changes and rendering",this.updateRequestors),!1):this.performUpdateType<=t?(this.updateShortcutCount++,!0):!1}async checkFirstAutoSize(){this.width!=null&&this.height!=null||this._lastAutoSize||await this._autoSizeNotify.await(500)||this.debug("Chart.checkFirstAutoSize() - timeout for first size update.")}onAxisChange(t,i){i==null&&t.length===0||this.ctx.axisManager.updateAxes(i??[],t)}onSeriesChange(t,i){const s=i?.filter(n=>!t.includes(n))??[];this.destroySeries(s),this.seriesLayerManager?.setSeriesCount(t.length);for(const n of t){if(i?.includes(n))continue;const r=this.seriesLayerManager.requestGroup(n);n.attachSeries(r,this.seriesRoot,this.annotationRoot);const o=this;n.chart={get mode(){return o.mode},get isMiniChart(){return!1},get seriesRect(){return o.seriesRect}},n.resetAnimation(this.chartAnimationPhase),this.addSeriesListeners(n),n.addChartEventListeners()}this.seriesAreaManager?.seriesChanged(t)}destroySeries(t){t?.forEach(i=>{i.removeEventListener("seriesNodeClick",this.onSeriesNodeClick),i.removeEventListener("seriesNodeDoubleClick",this.onSeriesNodeDoubleClick),i.removeEventListener("groupingChanged",this.seriesGroupingChanged),i.destroy(),this.seriesLayerManager.releaseGroup(i),i.detachSeries(void 0,this.seriesRoot,this.annotationRoot),i.chart=void 0})}addSeriesListeners(t){this.hasEventListener("seriesNodeClick")&&t.addEventListener("seriesNodeClick",this.onSeriesNodeClick),this.hasEventListener("seriesNodeDoubleClick")&&t.addEventListener("seriesNodeDoubleClick",this.onSeriesNodeDoubleClick),this.hasEventListener("seriesVisibilityChange")&&t.addEventListener("seriesVisibilityChange",this.onSeriesVisibilityChange),t.addEventListener("groupingChanged",this.seriesGroupingChanged)}assignSeriesToAxes(){for(const t of this.axes)t.boundSeries=this.series.filter(i=>i.axes[t.direction]===t)}assignAxesToSeries(){const t=(0,Nt.groupBy)(this.axes,i=>i.direction);for(const i of this.series)for(const s of i.directions){const n=t[s];if(!n){Nt.Logger.warnOnce(`no available axis for direction [${s}]; check series and axes configuration.`);return}const r=i.getKeys(s),o=n.find(a=>!a.keys.length||r.some(l=>a.keys.includes(l)));if(!o){Nt.Logger.warnOnce(`no matching axis for direction [${s}] and keys [${r}]; check series and axes configuration.`);return}i.axes[s]=o}}parentResize(t){if(t==null||this.width!=null&&this.height!=null)return;let{width:i,height:s}=t;const{pixelRatio:n}=t;if(i=Math.floor(i),s=Math.floor(s),i===0&&s===0)return;const[r=0,o=0,a=1]=this._lastAutoSize??[];r===i&&o===s&&a===n||(this._lastAutoSize=[i,s,n],this.resize("SizeMonitor",{}))}resize(t,i){const{scene:s,animationManager:n}=this.ctx,{inWidth:r,inHeight:o,inMinWidth:a,inMinHeight:l,inOverrideDevicePixelRatio:c}=i;this.ctx.domManager.setSizeOptions(a??this.minWidth,l??this.minHeight,r??this.width,o??this.height);const h=r??this.width??this._lastAutoSize?.[0],u=o??this.height??this._lastAutoSize?.[1],d=c??this.overrideDevicePixelRatio??this._lastAutoSize?.[2];if(this.debug(`Chart.resize() from ${t}`,{width:h,height:u,pixelRatio:d,stack:new Error().stack}),!(h==null||u==null||!(0,Nt.isFiniteNumber)(h)||!(0,Nt.isFiniteNumber)(u))&&s.resize(h,u,d)){n.reset();let p=!0;(this.width==null||this.height==null)&&this._firstAutoSize&&(p=!1,this._firstAutoSize=!1),this.update(4,{forceNodeDataRefresh:!0,skipAnimations:p}),this._autoSizeNotify.notify()}}async updateData(){this.series.forEach(i=>i.setChartData(this.data));const t=this.modulesManager.mapModules(i=>i.updateData?.(this.data));await Promise.all(t)}async processData(){this.series.some(n=>n.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes());const t=new F0(this.mode,this.suppressFieldDotNotation),i=this.series.map(n=>n.processData(t)),s=this.modulesManager.mapModules(n=>n.processData?.(t));this._cachedData=t.execute(this._cachedData),await Promise.all([...i,...s]),this.updateLegends()}async processDomains(){for(const t of this.axes)t.processData();for(const t of this.series)t.updatedDomains()}updateLegends(t){for(const{legend:i,legendType:s}of this.modulesManager.legends())s==="category"?this.setCategoryLegendData(t):this.setLegendData(s,i)}setCategoryLegendData(t){var i;const{ctx:{legendManager:s,stateManager:n}}=this;t&&this.series.forEach(o=>{const a=t.find(l=>l.seriesId===o.id);o.onLegendInitialState("category",a)});const r=this.series.flatMap(o=>{const a=o.getLegendData("category");return s.updateData(o.id,a),a});if(t){n.setStateAndRestore(s,t);return}if(this.mode!=="integrated"){const o={},a=new Map(this.series.map(l=>[l.id,l.type]));for(const{seriesId:l,symbol:{marker:c},label:h}of r.filter(u=>!u.hideInLegend)){if(c.fill==null)continue;const u=a.get(l),d=o[u]??(o[u]={});d[i=h.text]??(d[i]=c.fill),d[h.text]!==c.fill&&Nt.Logger.warnOnce(`legend item '${h.text}' has multiple fill colors, this may cause unexpected behaviour.`)}}s.update()}setLegendData(t,i){i.data=this.series.filter(s=>s.properties.showInLegend).flatMap(s=>s.getLegendData(t))}async processLayout(){const t=this.animationRect,{width:i,height:s}=this.ctx.scene,n=this.ctx.layoutManager.createContext(i,s);await this.performLayout(n),t&&!this.animationRect?.equals(t)&&this.ctx.animationManager.skipCurrentBatch(),this.debug("Chart.performUpdate() - seriesRect",this.seriesRect)}async updateSeries(t){const{seriesRect:i}=this;await Promise.all(t.map(s=>s.update({seriesRect:i}))),this.ctx.seriesLabelLayoutManager.updateLabels(this.series.filter(s=>s.visible&&s.usesPlacedLabels),this.padding,this.seriesRect)}async waitForUpdate(t=1e4,i=!1){const s=performance.now();for(;(this._pendingFactoryUpdatesCount>0||this.performUpdateType!==8||this.runningUpdateType!==8||this.ctx.scene.waitingForUpdate())&&!this.destroyed;){if(this._pendingFactoryUpdatesCount>0&&await this.updateMutex.waitForClearAcquireQueue(),(this.performUpdateType!==8||this.runningUpdateType!==8)&&await this._performUpdateNotify.await(),performance.now()-s>t){const n=`Chart.waitForUpdate() timeout of ${t} reached - first chart update taking too long.`;if(i)throw new Error(n);Nt.Logger.warnOnce(n)}Ky()&&await(0,Nt.pause)(),this.ctx.scene.waitingForUpdate()&&await(0,Nt.pause)(50)}}filterMiniChartSeries(t){return t?.filter(i=>i.showInMiniChart!==!1)}applyOptions(t){const i=this.firstApply?t.processedOptions:t.diffOptions(this.chartOptions);if(i==null||Object.keys(i).length===0)return;const s=this.firstApply?{}:this.chartOptions.processedOptions,n=t.processedOptions;cs("Chart.applyOptions() - applying delta",i);const r=this.applyModules(n),o=["type","data","series","listeners","preset","theme","legend.listeners","navigator.miniChart.series","navigator.miniChart.label","locale.localeText","axes","topology","nodes","initialState","styleContainer"];i.listeners&&this.registerListeners(this,i.listeners),Ca(this,i,{skip:o});let a=!1,l="no-op";i.series!=null&&(l=this.applySeries(this,i.series,s?.series),a=!0),l==="replaced"&&this.resetAnimations(),this.applyAxes(this,n,s,l,[])&&(a=!0),i.data&&(this.data=i.data),i.legend?.listeners&&this.modulesManager.isEnabled("legend")&&Object.assign(this.legend.listeners,i.legend.listeners),i.locale?.localeText&&(this.modulesManager.getModule("locale").localeText=i.locale?.localeText),this.chartOptions=t;const c=this.modulesManager.getModule("navigator"),h=this.modulesManager.getModule("zoom");!c?.enabled&&!h?.enabled&&this.ctx.zoomManager.updateZoom("chart");const u=c?.miniChart,d=n.navigator?.miniChart?.series??n.series;u?.enabled===!0&&d!=null?this.applyMiniChartOptions(u,d,n,s):u?.enabled===!1&&(u.series=[],u.axes=[]),this.ctx.annotationManager.setAnnotationStyles(t.annotationThemes),a||(a=this.shouldForceNodeDataRefresh(i,l));const f=a||r?0:4;this.maybeResetAnimations(l),this.shouldClearLegendData(n,s,l)&&this.ctx.legendManager.clearData(),this.applyInitialState(n),cs("Chart.applyOptions() - update type",Ea[f],{seriesStatus:l,forceNodeDataRefresh:a}),this.update(f,{apiUpdate:!0,forceNodeDataRefresh:a,newAnimationBatch:!0}),this.firstApply=!1}applyInitialState(t){const{annotationManager:i,chartTypeOriginator:s,historyManager:n,stateManager:r,zoomManager:o}=this.ctx,{initialState:a}=t;if("annotations"in t&&t.annotations?.enabled&&a?.annotations!=null){const l=a.annotations.map(c=>{const h=i.getAnnotationTypeStyles(c.type);return xe(c,h)});r.setState(i,l)}a?.chartType!=null&&r.setState(s,a.chartType),(t.navigator?.enabled||t.zoom?.enabled)&&a?.zoom!=null&&r.setState(o,a.zoom),a?.legend!=null&&this.updateLegends(a.legend),a!=null&&n.clear()}maybeResetAnimations(t){if(this.mode==="standalone")switch(t){case"series-grouping-change":case"replaced":this.resetAnimations();break;default:}}shouldForceNodeDataRefresh(t,i){const s=!!t.data||i==="data-change"||i==="replaced",n=Lp.getKeys(),r=Object.values(n).some(a=>t[a]!=null),o=t.title!=null&&t.subtitle!=null;return s||r||o}shouldClearLegendData(t,i,s){const n=s==="replaced"||s==="series-grouping-change"||s==="updated"&&(t.series?.length!==i.series?.length||!t.series?.every((o,a)=>o.type===i.series?.[a].type)),r=i.legend!=null&&t.legend==null;return n||r}applyMiniChartOptions(t,i,s,n){const r=n?.navigator?.miniChart?.series??n?.series,o=this.applySeries(t,this.filterMiniChartSeries(i),this.filterMiniChartSeries(r));this.applyAxes(t,s,n,o,["axes[].tick","axes[].thickness","axes[].title","axes[].crosshair","axes[].gridLine","axes[].label"]);const a=t.series;for(const h of a)h.properties.id=void 0;const l=t.axes,c=l.find(h=>h.direction==="x");for(const h of l)h.nice=!1,h.gridLine.enabled=!1,h.label.enabled=h===c,h.tick.enabled=!1,h.interactionEnabled=!1;if(c!=null){const h=s.navigator?.miniChart,u=h?.label,d=h?.label?.interval;if(c.line.enabled=!1,c.label.set(H(u,["interval","rotation","minSpacing","autoRotate","autoRotateAngle"])),c.tick.set(H(d,["enabled","width","size","color","interval","step"])),c.type==="grouped-category"){c.label.enabled=!1,c.label.rotation=0;const{depthOptions:f}=c;if(f.length===0)f.set([{label:{enabled:!0}}]);else for(let y=1;y<f.length;y++)f[y].label.enabled=!1}else(c.type==="time"||c.type==="unit-time"||c.type==="ordinal-time")&&(c.parentLevel.enabled=!1);const p=d?.step;p!=null&&(c.interval.step=p)}}applyModules(t){const{type:i}=this.constructor;let s=!1;for(const n of Ms.byType("root","legend")){const o=t[n.optionsKey]!=null&&n.chartTypes.includes(i);o!==this.modulesManager.isEnabled(n)&&(o?(this.modulesManager.addModule(n,a=>a.moduleFactory(this.getModuleContext())),n.type==="legend"&&this.modulesManager.getModule(n)?.attachLegend(this.ctx.scene),this[n.optionsKey]=this.modulesManager.getModule(n)):(this.modulesManager.removeModule(n),delete this[n.optionsKey]),s=!0)}return s}initSeriesDeclarationOrder(t){for(let i=0;i<t.length;i++)t[i].setSeriesIndex(i)}applySeries(t,i,s){if(!i)return"no-change";const n=_T(t.series,i,s);if(n.status==="no-overlap"){cs(`Chart.applySeries() - creating new series instances, status: ${n.status}`,n);const h=i.map(u=>this.createSeries(u));return this.initSeriesDeclarationOrder(h),t.series=h,"replaced"}cs("Chart.applySeries() - matchResult",n);const r=[];let o=!1,a=!1,l=!1;const c=n.changes.toSorted((h,u)=>h.targetIdx-u.targetIdx);for(const h of c)switch(a||(a=h.status==="series-grouping"),o||(o=h.diff?.data!=null),l||(l=h.status!=="no-op"),h.status){case"add":{const u=this.createSeries(h.opts);r.push(u),cs("Chart.applySeries() - created new series",u);break}case"remove":cs(`Chart.applySeries() - removing series at previous idx ${h.idx}`,h.series);break;case"no-op":r.push(h.series),cs(`Chart.applySeries() - no change to series at previous idx ${h.idx}`,h.series);break;case"series-grouping":case"update":default:{const{series:u,diff:d,idx:p}=h;cs(`Chart.applySeries() - applying series diff previous idx ${p}`,d,u),this.applySeriesValues(u,d),u.markNodeDataDirty(),r.push(u)}}return this.initSeriesDeclarationOrder(r),cs("Chart.applySeries() - final series instances",r),t.series=r,a?"series-grouping-change":o?"data-change":l?"updated":"no-op"}applyAxes(t,i,s,n,r=[]){if(!("axes"in i)||!i.axes)return!1;r=["axes[].type",...r];const o=i.axes.map(c=>c.type==="time"&&c.unit!=null?{...c,type:"unit-time"}:c);return!(n==="replaced")&&t.axes.length===o.length&&t.axes.every((c,h)=>c.type===o[h].type)&&Qp(s)?(t.axes.forEach((c,h)=>{const u=s.axes?.[h]??{},d=Ss(u,o[h]);cs(`Chart.applyAxes() - applying axis diff idx ${h}`,d);const p=`axes[${h}]`;Ca(c,d,{path:p,skip:r})}),!0):(cs(`Chart.applyAxes() - creating new axes instances; seriesStatus: ${n}`),t.axes=this.createAxis(o,r),!0)}createSeries(t){const i=Vi.create(t.type,this.getModuleContext());return this.applySeriesOptionModules(i,t),this.applySeriesValues(i,t),i}applySeriesOptionModules(t,i){const s=t.createModuleContext(),n=t.getModuleMap();for(const r of Ms.byType("series-option"))r.optionsKey in i&&r.seriesTypes.includes(t.type)&&n.addModule(r,o=>o.moduleFactory(s))}applySeriesValues(t,i){const s=t.getModuleMap(),{type:n,data:r,listeners:o,seriesGrouping:a,showInMiniChart:l,...c}=i;for(const h of Ga)if(h.type==="series-option"&&h.optionsKey in c){const u=s.getModule(h.optionsKey);if(u){const d=c[h.optionsKey];delete c[h.optionsKey],u.properties.set(d)}}c.visible!=null&&(t.visible=c.visible),t.properties.set(c),"data"in i&&t.setOptionsData(r),o&&this.registerListeners(t,o,{nodeClick:"seriesNodeClick",nodeDoubleClick:"seriesNodeDoubleClick"}),"seriesGrouping"in i&&(a==null?t.seriesGrouping=void 0:t.seriesGrouping={...t.seriesGrouping,...a})}createAxis(t,i){const s=[],n=this.getModuleContext();for(let r=0;r<t.length;r++){const o=t[r],a=hr.create(o.type,n);this.applyAxisModules(a,o),Ca(a,o,{path:`axes[${r}]`,skip:i}),s.push(a)}return RT(s),s}applyAxisModules(t,i){const s=t.createModuleContext(),n=t.getModuleMap();for(const r of Ms.byType("axis-option")){const o=i[r.optionsKey]!=null;o!==n.isEnabled(r)&&(o?(n.addModule(r,a=>a.moduleFactory(s)),t[r.optionsKey]=n.getModule(r)):(n.removeModule(r),delete t[r.optionsKey]))}}registerListeners(t,i,s){t.clearEventListeners();for(const[n,r]of(0,Nt.entries)(i))if((0,Nt.isFunction)(r)){const o=s?.[n];o==null?t.addEventListener(n,r):t.addEventListener(o,a=>{if(a?.type===o){const l=new Proxy(a,{get(c,h,u){return h==="type"?n:Reflect.get(c,h,u)}});r(l)}else r(a)})}}};et.chartsInstances=new WeakMap,g([ui({newValue(e){this.destroyed||(this.ctx.domManager.setContainer(e),et.chartsInstances.set(e,this))},oldValue(e){et.chartsInstances.delete(e)}})],et.prototype,"container",2),g([ui({newValue(e){this.resize("width option",{inWidth:e})}})],et.prototype,"width",2),g([ui({newValue(e){this.resize("height option",{inHeight:e})}})],et.prototype,"height",2),g([ui({newValue(e){this.resize("minWidth option",{inMinWidth:e})}})],et.prototype,"minWidth",2),g([ui({newValue(e){this.resize("minHeight option",{inMinHeight:e})}})],et.prototype,"minHeight",2),g([ui({newValue(e){this.resize("overrideDevicePixelRatio option",{inOverrideDevicePixelRatio:e})}})],et.prototype,"overrideDevicePixelRatio",2),g([x],et.prototype,"padding",2),g([x],et.prototype,"seriesArea",2),g([x],et.prototype,"keyboard",2),g([x],et.prototype,"touch",2),g([x],et.prototype,"mode",2),g([x],et.prototype,"styleNonce",2),g([Ee("chartCaptions.title")],et.prototype,"title",2),g([Ee("chartCaptions.subtitle")],et.prototype,"subtitle",2),g([Ee("chartCaptions.footnote")],et.prototype,"footnote",2),g([x],et.prototype,"suppressFieldDotNotation",2),g([x],et.prototype,"loadGoogleFonts",2),g([ui({changeValue(e,t){this.onAxisChange(e,t)}})],et.prototype,"axes",2),g([ui({changeValue(e,t){this.onSeriesChange(e,t)}})],et.prototype,"series",2);var xh=et,Rx=ke.create(!0,"opts"),br="AG Charts - Chart was destroyed, cannot perform request.",Ja=class{constructor(t,i,s){this.factoryApi=i,this.licenseManager=s,this.chart=t}async update(t){if(!this.chart)throw new Error(br);return Rx.group("AgChartInstance.update()",async()=>{this.factoryApi.update(t,this),await this.chart?.waitForUpdate()})}async updateDelta(t){if(!this.chart)throw new Error(br);return Rx.group("AgChartInstance.updateDelta()",async()=>{this.factoryApi.updateUserDelta(this,t),await this.chart?.waitForUpdate()})}getOptions(){if(!this.chart)throw new Error(br);const t=Ve(this.chart.getOptions());for(const i of Object.keys(t))i.startsWith("_")&&delete t[i];return t}waitForUpdate(){if(!this.chart)throw new Error(br);return this.chart.waitForUpdate()}async download(t){if(!this.chart)throw new Error(br);const i=await this.prepareResizedChart(this,this.chart,t);try{i.chart?.download(t?.fileName,t?.fileFormat)}finally{i.destroy()}}async __toSVG(t){if(!this.chart)throw new Error(br);const i=await this.prepareResizedChart(this,this.chart,{width:600,height:300,...t});try{return i?.chart?.toSVG()}finally{i?.destroy()}}async getImageDataURL(t){if(!this.chart)throw new Error(br);const i=await this.prepareResizedChart(this,this.chart,t);try{return i.chart.getCanvasDataURL(t?.fileFormat)}finally{i.destroy()}}getState(){return this.factoryApi.caretaker.save(...this.getEnabledOriginators())}async setState(t){const{chart:i}=this;if(!i)return;const s=this.getEnabledOriginators();if(!s.includes(i.ctx.legendManager)){await this.setStateOriginators(t,s);return}await this.setStateOriginators(t,s.filter(n=>n!==i.ctx.zoomManager)),await this.setStateOriginators(t,[i.ctx.zoomManager])}resetAnimations(){this.chart?.resetAnimations()}skipAnimations(){this.chart?.skipAnimations()}destroy(){this.releaseChart?(this.releaseChart(),this.releaseChart=void 0):this.chart&&(this.chart.publicApi=void 0,this.chart.destroy()),this.chart=void 0}async prepareResizedChart(t,i,s={}){const n=s.width??i.width??i.ctx.scene.canvas.width,r=s.height??i.height??i.ctx.scene.canvas.height,o=t.getState(),a=Ms.hasEnterpriseModules(),l={...i.chartOptions.processedOverrides,container:document.createElement("div"),width:n,height:r};s.width!=null&&s.height!=null&&(l.overrideDevicePixelRatio=1);const c=i.getOptions();a&&(l.animation={enabled:!1},this.licenseManager?.isDisplayWatermark()&&(l.foreground={text:this.licenseManager.getWatermarkMessage(),image:{url:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=",width:170,height:25,right:25,bottom:50,opacity:.7}}));const h={...i.chartOptions.specialOverrides},u={...i.chartOptions.optionMetadata},d=this.factoryApi.create(c,l,h,u);await d.setState(o),d.chart?.ctx.zoomManager.updateZoom("chartProxy",i.ctx.zoomManager.getZoom()),d.chart?.ctx.legendManager.clearData(),d.chart?.ctx.legendManager.update(i.ctx.legendManager.getData()),i.series.forEach((f,y)=>{d.chart.series[y].visible=f.visible});const p=[];for(const f of i.modulesManager.legends())p.push(f.legend.pagination?.currentPage??0);for(const f of d.chart.modulesManager.legends()){const y=p.shift()??0;f.legend.pagination&&f.legend.pagination.setPage(y)}return d.chart?.update(0,{forceNodeDataRefresh:!0}),await d.waitForUpdate(),d}getEnabledOriginators(){if(!this.chart)return[];const{chartOptions:{processedOptions:t,optionMetadata:i},ctx:{annotationManager:s,chartTypeOriginator:n,zoomManager:r,legendManager:o}}=this.chart,a=[];return"annotations"in t&&t.annotations?.enabled&&a.push(s),i.presetType==="price-volume"&&a.push(n),(t.navigator?.enabled||t.zoom?.enabled)&&a.push(r),"legend"in this.chart&&a.push(o),a}async setStateOriginators(t,i){this.factoryApi.caretaker.restore(t,...i),this.chart?.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),await this.chart?.waitForUpdate()}};Ja.chartInstances=new WeakMap,g([ui({oldValue(e){e.destroyed||(e.publicApi=void 0),Ja.chartInstances.delete(e)},newValue(e){e&&(e.publicApi=this,Ja.chartInstances.set(e,this))}})],Ja.prototype,"chart",2);var Fx=Ja,cg=class extends pc{constructor(e){super(),this.ctx=e,this.localeText=void 0}};g([Mn(e=>{e.ctx.localeManager.setLocaleText(e.localeText)}),x],cg.prototype,"localeText",2),g([Mn(e=>{e.ctx.localeManager.setLocaleTextFormatter(e.getLocaleText)}),x],cg.prototype,"getLocaleText",2);var LN={type:"root",optionsKey:"locale",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new cg(e)},_x=(O(),N(T)),jx=(O(),N(T));function zx(e,t,i){if(i==null||i[0]===0&&i[1]===1)return{ticks:e,count:e.length};const s=(0,jx.clamp)(0,Math.floor(i[0]*e.length),e.length),n=(0,jx.clamp)(0,Math.ceil(i[1]*e.length),e.length),r=t?e.length-n:s,o=t?e.length-s:n;return{ticks:e.slice(r,o),count:e.length}}var el=class pD extends za{constructor(){super(...arguments),this.type="band",this.index=void 0,this._domain=[]}static is(t){return t instanceof pD}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 i;const s=new Set;let n=!0;for(const r of t)s.has(r)||(s.add(r),i==null?i=Bx(r):(n&&(n=kN(r,i)),i=Bx([...i,...r])));return i??(i=[]),{domain:i,animatable:n}}toDomain(t){}invert(t,i=!1){this.refresh();const s=i?this.bandwidth/2:0,n=this.invertNearestIndex(Math.max(0,t-s));return i||t===this.ordinalRange(n)?this.domain[n]:void 0}ticks(t,i=this.domain,s){return zx(i,!1,s)}findIndex(t){let{index:i}=this;if(i==null){const{domain:s}=this;i=new Map;for(let n=0;n<s.length;n++)i.set(Zt(s[n]),n);this.index=i}return i.get(Zt(t))}};function Bx(e){let t;const i=new Set;for(const s of e){const n=Zt(s),r=i.size;i.add(n),i.size!==r?t?.push(s):t??(t=e.slice(0,i.size))}return t??e}function kN(e,t){let i=-1;for(const s of e){const n=t.indexOf(s);if(n===-1)i=1/0;else{if(n<=i)return!1;i=n}}return!0}var Oo=class gD extends $a{constructor(t,i=new el){super(t,i),this.groupPaddingInner=.1,this.includeInvisibleDomains=!0,this.nice=!1}static is(t){return t instanceof gD}normaliseDataDomain(t){return{domain:t,clipped:!1}}updateScale(){super.updateScale();let{paddingInner:t,paddingOuter:i}=this;if(!(0,_x.isFiniteNumber)(t)||!(0,_x.isFiniteNumber)(i)){const s=this.reduceBandScalePadding();t??(t=s.inner),i??(i=s.outer)}this.scale.paddingInner=t??0,this.scale.paddingOuter=i??0}reduceBandScalePadding(){return this.boundSeries.reduce((t,i)=>{const s=i.getBandScalePadding?.();return s&&(t.inner>s.inner&&(t.inner=s.inner),t.outer<s.outer&&(t.outer=s.outer)),t},{inner:1/0,outer:-1/0})}};Oo.className="CategoryAxis",Oo.type="category",g([x],Oo.prototype,"groupPaddingInner",2),g([x],Oo.prototype,"paddingInner",2),g([x],Oo.prototype,"paddingOuter",2);var kn=Oo,tl=(O(),N(T)),Gx=class fD extends el{static is(t){return t instanceof fD}normalizeDomains(...t){const{domain:i}=super.normalizeDomains(...t);return{domain:i,animatable:!1}}findIndex(t){return super.findIndex(t)??this.getMatchIndex(t)}getMatchIndex(t){const i=JSON.stringify(t),s=this._domain.find(n=>JSON.stringify(n)===i);if(s!=null)return super.findIndex(s)}};function Qs(e){if(e.length===0)return null;let t=1/0,i=-1/0;for(const n of e){const r=n instanceof Date?n.getTime():n;typeof r=="number"&&(r<t&&(t=r),r>i&&(i=r))}const s=[t,i];return s.every(isFinite)?s:null}function hg(e,t,i){let s=!1;return e.length>2&&(e=Qs(e)??[NaN,NaN]),t!=null&&(s||(s=t>e[0]),e=[t,e[1]]),i!=null&&(s||(s=i<e[1]),e=[e[0],i]),e[0]>e[1]&&(e=[]),{extent:e,clipped:s}}var xr=(O(),N(T)),il=new WeakMap;function vh(e,t){const i=JSON.stringify(e,null,0);return il.has(t)||il.set(t,new Map),il.get(t)?.has(i)||il.get(t)?.set(i,t(e)),il.get(t)?.get(i)}function ai(e,t){const i=new Map,s=(...o)=>o.map(a=>typeof a=="object"||typeof a=="symbol"?a:(i.has(a)||i.set(a,{v:a}),i.get(a))),n={},r=new WeakMap;return(...o)=>{const a=o.length===0?[n]:s(...o);let l=r;for(const u of a.slice(0,-1))l.has(u)||l.set(u,new WeakMap),l=l.get(u);const c=a.at(-1);let h=l.get(c);return h?t?.("hit",e,o):(h=e(...o),l.set(c,h),t?.("miss",e,o)),h}}var Vx=(O(),N(T));function Mh(e,t=[0,0]){for(const i of e)typeof i=="number"&&(i<0&&(t[0]+=i),i>0&&(t[1]+=i));return t}function CN(e,t){return{id:e,matchGroupIds:[t],type:"aggregate",aggregateFunction:s=>Mh(s)}}function Ux(e,t){return{id:e,type:"aggregate",matchGroupIds:t?[t]:void 0,aggregateFunction:i=>Mh(i),groupAggregateFunction:(i,s=[0,0])=>(s[0]+=i?.[0]??0,s[1]+=i?.[1]??0,s)}}function wN(e,t){return{id:e,matchGroupIds:[t],type:"aggregate",aggregateFunction:s=>An.extendDomain(s)}}function ug(e){return{id:e,type:"aggregate",aggregateFunction:()=>[0,1],groupAggregateFunction:(t,i=[0,0])=>(i[0]+=t?.[0]??0,i[1]+=t?.[1]??0,i)}}function Wx(e,t){return{id:e,matchGroupIds:t?[t]:void 0,type:"aggregate",aggregateFunction:s=>Mh(s),groupAggregateFunction:(s,n=[0,0,-1])=>(n[0]+=s?.[0]??0,n[1]+=s?.[1]??0,n[2]++,n),finalFunction:(s=[0,0,0])=>{const n=s[0]+s[1];return n>=0?[0,n/s[2]]:[n/s[2],0]}}}function dg(e,t,i){const s={id:e,matchGroupIds:i?[i]:void 0,type:"aggregate",aggregateFunction:(n,r=[])=>{const o=r[1]-r[0];return t.aggregateFunction(n).map(a=>a/o)}};return t.groupAggregateFunction&&(s.groupAggregateFunction=t.groupAggregateFunction),s}function Hx(e){return()=>{let t=0;return i=>(0,Vx.isFiniteNumber)(i)?(t+=e?Math.max(0,i):i,t):i}}function Yx(){return()=>{let e=0;return t=>{if(!(0,Vx.isFiniteNumber)(t))return t;const i=e;return e+=t,i}}}function $x(e){return e!=null&&dh(e)}function TN(e){return e!=null}function Kx(e){switch(e){case"number":case"log":case"ordinal-time":case"unit-time":case"time":case"color":return $x;default:return TN}}function Zx(e){switch(e){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function hs(e,t,i={}){return{property:e,type:"key",valueType:Zx(t),validation:Kx(t),...i}}function Me(e,t,i={}){return{property:e,type:"value",valueType:Zx(t),validation:Kx(t),...i}}function Xx(e,t={}){return{property:e,type:"value",valueType:"range",missingValue:1,processor:()=>()=>1,...t}}var NN=function(e){return e};function qx(...e){const t=e.filter(i=>i!=null);return t.length===0?()=>NN:t.length===1?t[0]:()=>{const i=t.map(s=>s());return(s,n)=>i.reduce((r,o)=>o(r,n),s)}}function pg(e,t={}){const{min:i=-1/0,max:s=1/0,processor:n,...r}=t;return{type:"value",property:e,valueType:"range",validation:$x,processor:qx(n,()=>o=>(0,xr.isFiniteNumber)(o)?(0,xr.clamp)(i,o,s):o),...r}}function sl(e,t,i={}){const{onlyPositive:s,processor:n,...r}=i;return{...Me(e,t,r),processor:qx(n,Hx(s))}}function ON(e,t,i={}){return{...Me(e,t,i),processor:Yx()}}function Cn(e,t,i,s,n){return[Me(e,n,s),sv(s.groupId,t,i,s.separateNegative),...s.rangeId!=null?[wN(s.rangeId,s.groupId)]:[]]}function Qx(e,t,i){return[Me(e,t,i),nv(i.groupId)]}var Jx={type:"reducer",property:"smallestKeyInterval",initialValue:1/0,reducer:()=>{let e=NaN;return(t=1/0,i)=>{const s=typeof i[0]=="number"?i[0]:Number(i[0]),n=Math.abs(s-e);return e=s,!isNaN(n)&&n>0&&n<t?n:t}}},ev={type:"reducer",property:"largestKeyInterval",initialValue:-1/0,reducer:()=>{let e=NaN;return(t=-1/0,i)=>{const s=typeof i[0]=="number"?i[0]:Number(i[0]),n=Math.abs(s-e);return e=s,!isNaN(n)&&n>0&&n>t?n:t}}},tv={type:"processor",property:"sortedGroupDomain",calculate:({domain:{groups:e}})=>e?.slice().sort((t,i)=>{for(let s=0;s<t.length;s++){const n=t[s]-i[s];if(n!==0)return n}return 0})};function EN({normaliseTo:e}){const t=(i,s)=>{if(s===0)return null;const n=(i??0)*e/s;return n>=0?Math.min(e,n):Math.max(-e,n)};return()=>()=>(i,s,n)=>{const r=PN(i,s,n);for(const o of s)for(const a of n.datumIndices[o]??[]){const l=i[o],c=l[a];if(c==null){l[a]=void 0;continue}l[a]=typeof c=="number"?t(c,r):c.map(h=>t(h,r))}}}function PN(e,t,i){const s=[0,0];for(const n of t){const r=e[n];for(const o of i.datumIndices[n]??[]){const a=r[o];if(a==null)continue;const l=typeof a=="number"?a:Math.max(...a.map(h=>h??0)),c=l<0?0:1;c===0?s[c]=Math.min(s[c],l):s[c]=Math.max(s[c],l)}}return Math.max(Math.abs(s[0]),s[1])}function Sh(e,t){return{type:"group-value-processor",matchGroupIds:e,adjust:vh({normaliseTo:t},EN)}}function RN({normaliseTo:e,zeroDomain:t,rangeMin:i,rangeMax:s}){const n=e[1]-e[0],r=(o,a,l)=>{const c=e[0]+(o-a)/l*n;return l===0?t:c>=e[1]?e[1]:c<e[0]?e[0]:c};return()=>(o,a)=>{let[l,c]=o.domain.values[a];i!=null&&(l=i),s!=null&&(c=s);const h=c-l;o.domain.values[a]=[e[0],e[1]];const u=o.columns[a];for(let d=0;d<u.length;d+=1)u[d]=r(u[d],l,h)}}function vr(e,t,i,s,n){return{type:"property-value-processor",property:e,adjust:vh({normaliseTo:t,rangeMin:s,rangeMax:n,zeroDomain:i},RN)}}var nl=1,Dh=2;function iv(e,t,i,s){let n=nl|Dh;if(t.valueType==="category")return i.length<e&&(n&=~nl),n;let r=s[0]?.valueOf();for(let o=1;n!==0&&o<s.length;o++){const a=s[o]?.valueOf();(!Number.isFinite(a)||r>a)&&(n&=~Dh),Number.isFinite(a)&&r===a&&(n&=~nl),r=a}return n}function Eo(e){return{type:"processor",property:"animationValidation",calculate(t){const{keys:i,values:s}=t.defs,{input:{count:n},domain:{keys:r,values:o},keys:a,columns:l}=t;let c=nl|Dh;if(n!==0){for(let h=0;c!==0&&h<i.length;h++)for(const u of i[h].scopes)c&=iv(n,i[h],r[h],a[h].get(u));for(let h=0;c!==0&&h<s.length;h++){const u=s[h];e?.includes(u.id)&&(c&=iv(n,u,o[h],l[h]))}}return{uniqueKeys:(c&nl)!==0,orderedKeys:(c&Dh)!==0}}}}function FN({mode:e,separateNegative:t}){return()=>()=>(i,s,n)=>{const r=[0,0];for(const o of s)for(const a of n.datumIndices[o]??[]){const l=i[o],c=l[a],h=(0,xr.isNegative)(c)&&t?0:1;(0,xr.isFiniteNumber)(c)&&(e==="normal"&&(r[h]+=c),l[a]=r[h],e==="trailing"&&(r[h]+=c))}}}function _N({mode:e,sum:t}){return()=>{const i=[];let s=!0;return()=>(n,r,o)=>{let a=0;for(const l of r){const c=n[l];for(const h of o.datumIndices[l]??[]){const u=c[h],d=s&&t==="current"?0:i[l];i[l]=u;const p=t==="current"?u:d;if(!(0,xr.isFiniteNumber)(u)||!(0,xr.isFiniteNumber)(d)){c[h]=a;continue}e==="normal"&&(a+=p),c[h]=a,e==="trailing"&&(a+=p)}}s=!1}}}function sv(e,t,i,s=!1){let n;if(t.startsWith("window")){const r=t.endsWith("-trailing")?"trailing":"normal";n=vh({mode:r,sum:i},_N)}else n=vh({mode:t,separateNegative:s},FN);return{type:"group-value-processor",matchGroupIds:[e],adjust:n}}function jN(){return()=>(e,t,i)=>{const s=new Float64Array(t.length);let n=0;for(const r of t){const o=e[r];for(const a of i.datumIndices[r]??[]){const l=o[a];s[n]=Number.isFinite(l)?l:NaN,n+=1,o[a]=s.subarray(0,n)}}}}function nv(e){return{type:"group-value-processor",matchGroupIds:[e],adjust:jN}}function rv(e){return e.id??e.property}function zN(e,t,i){const s=new Map,n=t.defs.values;for(let a=0;a<n.length;a+=1){const l=n[a];if(l.scopes?.includes(e)===!1)continue;const c=rv(l);if(s.has(c))return;s.set(c,a)}const r=[],o=i.defs.values;for(let a=0;a<o.length;a+=1){const l=o[a];if(l.scopes?.includes(e)===!1)continue;const c=rv(l),h=s.get(c);if(h==null)return;s.delete(c),r.push({previousIndex:h,nextIndex:a})}if(s.size===0)return r}function gg(e,t,i,s,n){for(const{previousIndex:r,nextIndex:o}of i){const a=e[r],l=t[o],c=a[s],h=l[n];if(c!==h)return!1}return!0}function Po(e,t,i=!0){return{type:"processor",property:"diff",calculate(s,n){const r=new Map,o=new Map,a=new Map,l=new Map,c=t.keys,h=s.keys,u=t.columns,d=s.columns,p=zN(e,t,s);if(p==null)return n;const f=Math.max(t.input.count,s.input.count);for(let m=0;m<f;m++){const v=m<t.input.count,M=m<s.input.count,S=v?rh(c,e,m):void 0,D=S!=null?Ci(S):"",C=M?rh(h,e,m):void 0,k=C!=null?Ci(C):"";if(M&&v&&D===k){gg(u,d,p,m,m)||a.set(k,m);continue}const L=l.get(k);L!=null?((i||!gg(u,d,p,L,m))&&(a.set(k,m),r.set(k,m)),l.delete(k)):M&&o.set(k,m);const w=o.get(D);w!=null?((i||!gg(u,d,p,w,m))&&(a.set(D,m),r.set(D,m)),o.delete(D)):v&&(a.delete(D),l.set(D,m))}const b={changed:o.size>0||a.size>0||l.size>0,added:new Set(o.keys()),updated:new Set(a.keys()),removed:new Set(l.keys()),moved:new Set(r.keys())};return{...n,[e]:b}}}}function Ci(e,...t){let i;return(0,xr.isArray)(e)?i=e.map(n=>Wp(n)).join("___"):i=Wp(e),(typeof i=="string"||typeof i=="number"||typeof i=="boolean"||i instanceof Date)&&t.length>0&&(i+=`___${t.join("___")}`),i}var BN=class{constructor(){this.top=1/0,this.right=-1/0,this.bottom=-1/0,this.left=1/0}update(e,t){e>this.right&&(this.right=e),e<this.left&&(this.left=e),t>this.bottom&&(this.bottom=t),t<this.top&&(this.top=t)}},GN=class mD{constructor(t="",i,s){this.label=t,this.parent=i,this.refId=s,this.position=0,this.subtreeLeft=NaN,this.subtreeRight=NaN,this.children=[],this.leafCount=0,this.prelim=0,this.mod=0,this.ancestor=this,this.change=0,this.shift=0,this.index=0,this.screen=0,this.depth=i?i.depth+1:0}insertTick(t,i){let s=this;for(let n=0;n<t.length;n++){const r=t[n],o=n!==t.length-1,{children:a}=s,l=a.find(c=>c.label===r);if(l&&o)s=l;else{const c=new mD(r,s,i);c.index=a.length,a.push(c),o&&(s=c)}}}getLeftSibling(){return this.index>0?this.parent?.children[this.index-1]:void 0}getLeftmostSibling(){return this.index>0?this.parent?.children[0]:void 0}nextLeft(){return this.children[0]}nextRight(){return this.children.at(-1)}getSiblings(){return this.parent?.children.filter((t,i)=>i!==this.index)??[]}};function VN(e){const t=e.reduce((s,n)=>s<n.length?n.length:s,0),i=new GN;for(let s=0;s<e.length;s++){const n=e[s];for(;n.length<t;)n.push("");i.insertTick(n,s)}return i}function UN(e,t,i){const s=t.index-e.index,n=i/s;t.change-=n,t.shift+=i,e.change+=n,t.prelim+=i,t.mod+=i}function WN(e,t,i){return t.getSiblings().indexOf(e.ancestor)>=0?e.ancestor:i}function HN({children:e}){let t=0,i=0;for(let s=e.length-1;s>=0;s--){const n=e[s];n.prelim+=t,n.mod+=t,i+=n.change,t+=n.shift+i}}function YN(e,t){const i=e.getLeftSibling();if(i){let s=e,n=e,r=i,o=n.getLeftmostSibling(),a=n.mod,l=s.mod,c=r.mod,h=o.mod;for(;r.nextRight()&&n.nextLeft();){r=r.nextRight(),n=n.nextLeft(),o=o.nextLeft(),s=s.nextRight(),s.ancestor=e;const u=r.prelim+c-(n.prelim+a)+1;u>0&&(UN(WN(r,e,t),e,u),a+=u,l+=u),c+=r.mod,a+=n.mod,h+=o.mod,l+=s.mod}r.nextRight()&&!s.nextRight()?s.mod+=c-l:(n.nextLeft()&&!o.nextLeft()&&(o.mod+=a-h),t=e)}return t}function ov(e){const{children:t}=e;if(t.length){let[i]=t;for(const r of t)ov(r),i=YN(r,i);HN(e);const s=(t[0].prelim+t.at(-1).prelim)/2,n=e.getLeftSibling();n?(e.prelim=n.prelim+1,e.mod=e.prelim-s):e.prelim=s}else{const i=e.getLeftSibling();e.prelim=i?i.prelim+1:0}}function av(e,t,i){e.position=e.prelim+t,i.insertNode(e);for(const s of e.children)av(s,t+e.mod,i)}function lv(e){const{children:t}=e;let i=0;for(const s of t)lv(s),s.children.length?i+=s.leafCount:i++;e.leafCount=i,t.length?(e.subtreeLeft=t[0].subtreeLeft,e.subtreeRight=t[t.length-1].subtreeRight,e.position=(e.subtreeLeft+e.subtreeRight)/2):(e.subtreeLeft=e.position,e.subtreeRight=e.position)}function $N(e){const t=new KN,i=VN(e);return ov(i),av(i,-i.prelim,t),lv(i),t}var KN=class{constructor(){this.dimensions=new BN,this.nodes=[],this.depth=0}insertNode(e){this.depth<e.depth&&(this.depth=e.depth),this.dimensions.update(e.position,e.depth),this.nodes.push(e)}scaling(e,t){let i=1;if(e>0){const{left:s,right:n}=this.dimensions;n!==s&&(i=e/(n-s))}return t&&(i*=-1),i}},Ts=class extends le{constructor(){super(...arguments),this.enabled=!0}};g([x],Ts.prototype,"enabled",2),g([x],Ts.prototype,"avoidCollisions",2),g([x],Ts.prototype,"color",2),g([x],Ts.prototype,"spacing",2),g([x],Ts.prototype,"rotation",2),g([x],Ts.prototype,"fontStyle",2),g([x],Ts.prototype,"fontWeight",2),g([x],Ts.prototype,"fontSize",2),g([x],Ts.prototype,"fontFamily",2);var Ih=class extends le{constructor(){super(...arguments),this.enabled=!0}};g([x],Ih.prototype,"enabled",2),g([x],Ih.prototype,"width",2),g([x],Ih.prototype,"stroke",2);var fg=class extends le{constructor(){super(...arguments),this.label=new Ts,this.tick=new Ih}};g([x],fg.prototype,"label",2),g([x],fg.prototype,"tick",2);var Mr=class extends kn{constructor(e){super(e,new Gx),this.tickScale=new Gx,this.depthOptions=new Ia(fg),this.includeInvisibleDomains=!0,this.tickScale.paddingInner=1,this.tickScale.paddingOuter=0}resizeTickTree(){if(!this.tickTreeLayout)return;const{nodes:e}=this.tickTreeLayout,{range:t,step:i,inset:s,bandwidth:n}=this.scale,r=Math.abs(t[1]-t[0])-i,o=this.tickTreeLayout.scaling(r,t[0]>t[1]),a=s+n/2;let l=0;for(const c of e){const h=c.position*o;l>h&&(l=h),c.screen=h+a}for(const c of e)c.screen-=l}getDepthOptionsMap(e){const t=[],{depthOptions:i,label:s}=this,n=this.horizontal?0:-90;for(let r=0;r<e;r++)t.push(i[r]?.label.enabled??s.enabled?{enabled:!0,spacing:i[r]?.label.spacing??s.spacing,rotation:i[r]?.label.rotation??(r?n:s.rotation),avoidCollisions:i[r]?.label.avoidCollisions??s.avoidCollisions}:{enabled:!1,spacing:0,rotation:0,avoidCollisions:!1});return t}updateCategoryLabels(){this.computedLayout&&this.tickLabelGroupSelection.update(this.computedLayout.tickLabelLayout).each((e,t)=>e.setProperties(t))}updateAxisLine(){this.computedLayout&&(this.lineNode.visible=this.line.enabled,this.lineNode.stroke=this.line.stroke,this.lineNode.strokeWidth=this.line.width)}computeLayout(){if(this.updateDirection(),this.updateScale(),this.resizeTickTree(),!this.tickTreeLayout?.depth)return{bbox:U.zero,spacing:0,separatorLayout:[],tickLabelLayout:[]};const{step:e}=this.scale,{title:t,label:i,range:s,depthOptions:n,horizontal:r}=this,{depth:o,nodes:a}=this.tickTreeLayout,l=Math.ceil(i.fontSize/e),c=r?-i.getSideFlag():i.getSideFlag(),h=[],u=new Map,d=new ho,p=this.getDepthOptionsMap(o),f=c*p[0].spacing,y=(R,G)=>{const Y=o-R.depth;if(!p[Y]?.enabled||G%l!==0||!(0,tl.inRange)(R.screen,s))return!1;const he=this.formatTick(R.label,G-1,this.scale.domain),se=this.getLabelStyles({value:he,depth:Y},n[Y]?.label);return d.setProperties({...se,text:he,textAlign:"center",textBaseline:i.parallel?"hanging":"bottom",lineHeight:Ue.getLineHeight(se.fontSize),x:r?R.screen:f,y:r?f:R.screen,rotation:0}),!0},b={};a.forEach((R,G)=>{const Y=o-R.depth;if(!y(R,G)||!d.getBBox())return;u.set(G,d.getBBox()),d.rotation=zs(p[Y]?.rotation);const{width:se,height:de}=d.getBBox(),ge=r?de:se;b[Y]??(b[Y]=0),b[Y]<ge&&(b[Y]=ge)});const m=Zp(),v=new Map,M=R=>{if(R===0)return 0;let G=b[0];for(let Y=1;Y<=R;Y++)G+=p[Y].spacing,Y!==R&&(G+=b[Y]);return G};a.forEach((R,G)=>{if(G===0)return;const Y=y(R,G),he=!R.children.length,se=o-R.depth;if(R.parent){const V=he?R.position:R.position-(R.leafCount-1)/2;if(!v.has(V)){const ee=this.depthOptions[se]?.tick;let ie=b[0];for(let ne=0;ne<=se;ne++)ie+=p[ne].spacing,ne!==0&&(ie+=b[ne]);v.set(V,{tickSize:ie,tickStroke:ee?.stroke,tickWidth:ee?.enabled!==!1?ee?.width:0})}}if(!Y)return;const de=zs(p[se].rotation),{width:ge,height:ye}=u.get(G),J=M(se);if(d.textAlign="end",d.textBaseline="middle",d.rotation=de,r?(d.x+=ge/2,d.y+=(J+xd(ge/2,ye/2,de))*c,d.rotationCenterX=R.screen,d.rotationCenterY=d.y):(d.x+=J*c+xd((p[se].spacing*c+ge)/2,i.mirrored?ge:0,de),d.rotationCenterX=d.x-ge/2,d.rotationCenterY=R.screen),p[se].avoidCollisions){const{width:V,height:ee}=d.getBBox(),ie=r?V:ee,ne=he?e:R.leafCount*e;if(ie>ne){u.delete(G);return}}const{text:W=""}=d;h.push({text:W,visible:!0,range:this.scale.range,tickId:m(W),fill:d.fill,fontFamily:d.fontFamily,fontSize:d.fontSize,fontStyle:d.fontStyle,fontWeight:d.fontWeight,rotation:d.rotation,rotationCenterX:d.rotationCenterX,rotationCenterY:d.rotationCenterY,textAlign:d.textAlign,textBaseline:d.textBaseline,x:d.x,y:d.y}),u.set(G,Qe.toCanvas(d))});const{enabled:S,stroke:D,width:C}=this.line;this.lineNode.datum=r?{x1:s[0],x2:s[1],y1:0,y2:0}:{x1:0,x2:0,y1:s[0],y2:s[1]},this.lineNode.setProperties({stroke:D,strokeWidth:S?C:0});const k=[...v.values()];k.push(k[0]);const L=[this.lineNodeBBox(),U.merge(u.values()),new U(0,0,k[0].tickSize*c,0)];let w=0;if(t.enabled){const R=U.merge(L);w=r?R.height:R.width,L.push(this.titleBBox(this.scale.domain,w))}return{bbox:U.merge(L),spacing:w,separatorLayout:k,tickLabelLayout:h}}update(){if(!this.computedLayout)return;this.moduleCtx.animationManager.skipCurrentBatch();const{tickScale:e,tick:t,gridLine:i,gridLength:s}=this,{separatorLayout:n,spacing:r}=this.computedLayout,{position:o,horizontal:a,gridPadding:l}=this,c=o==="bottom"||o==="right"?-1:1,h=l,u=c*s-l,d=e.ticks({nice:!1,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0}).ticks.map((p,f)=>({tickId:Ci(p,f),offset:Math.round(e.convert(p))}));this.gridLineGroupSelection.update(i.enabled&&s?d.map(({tickId:p,offset:f},y)=>{const[b,m,v,M]=a?[f,f,h,u]:[h,u,f,f],{style:S,width:D}=i,{stroke:C,lineDash:k}=S[y%S.length]??{};return{tickId:p,offset:f,x1:b,y1:v,x2:m,y2:M,stroke:C,strokeWidth:D,lineDash:k}}):[]),this.tickLineGroupSelection.update(t.enabled?d.map(({tickId:p,offset:f},y)=>{const{tickSize:b=this.getTickSize(),tickStroke:m=t.stroke,tickWidth:v=t.width}=n[y]??{},M=-c*b,[S,D,C,k]=a?[f,f,0,M]:[0,M,f,f];return{tickId:p,offset:f,x1:S,y1:C,x2:D,y2:k,stroke:m,strokeWidth:v,lineDash:void 0}}):[]),this.updatePosition(),this.updateCategoryLabels(),this.updateAxisLine(),this.updateGridLines(),this.updateTickLines(),this.updateTitle(this.scale.domain,r),this.resetSelectionNodes()}calculateLayout(){const{separatorLayout:e,tickLabelLayout:t,spacing:i,bbox:s}=this.computeLayout();return this.computedLayout={separatorLayout:e,tickLabelLayout:t,spacing:i},{bbox:s,niceDomain:this.scale.domain}}onGridVisibilityChange(){this.gridLineGroupSelection.clear(),this.tickLabelGroupSelection.clear()}updateScale(){super.updateScale(),this.tickScale.range=this.scale.range,this.scale.paddingOuter=this.scale.paddingInner/2}processData(){const{direction:e}=this,t=this.boundSeries.filter(n=>n.visible).flatMap(n=>n.getDomain(e));this.dataDomain={domain:Qs(t)??this.filterDuplicateArrays(t),clipped:!1},this.isReversed()&&this.dataDomain.domain.reverse();const i=this.dataDomain.domain.map(n=>(0,tl.toArray)((0,tl.isObject)(n)&&"value"in n?n.value:n));this.tickTreeLayout=$N(i);const s=[];for(const n of this.tickTreeLayout.nodes)n.leafCount||n.refId==null||s.push(this.dataDomain.domain[n.refId]);this.scale.domain=(0,tl.sortBasedOnArray)(this.dataDomain.domain,s),this.tickScale.domain=i.concat([[""]])}filterDuplicateArrays(e){const t=new Set;return e.filter(i=>{const s=(0,tl.isArray)(i)?JSON.stringify(i):i;return t.has(s)?!1:(t.add(s),!0)})}};Mr.className="GroupedCategoryAxis",Mr.type="grouped-category",g([x],Mr.prototype,"depthOptions",2);var cv=(O(),N(T)),hv=(O(),N(T)),ZN={2:(e,t)=>Math.log2(t),[Math.E]:(e,t)=>Math.log(t),10:(e,t)=>Math.log10(t)},XN=(e,t)=>Math.log(t)/Math.log(e);function mg(e,t,i){const s=Math.min(...t),n=ZN[e]??XN;return s>=0?n(e,i):-n(e,-i)}var qN={[Math.E]:(e,t)=>Math.exp(t),10:(e,t)=>t>=0?10**t:1/10**-t},QN=(e,t)=>e**t;function yg(e,t,i){const s=Math.min(...t),n=qN[e]??QN;return s>=0?n(e,i):-n(e,-i)}var bg=class yD extends Fe{constructor(t=[1,10],i=[0,1]){super(t,i),this.type="log",this.defaultClamp=!0,this.base=10,this.log=s=>mg(this.base,this.domain,s),this.pow=s=>yg(this.base,this.domain,s)}static is(t){return t instanceof yD}toDomain(t){return t}transform(t){const[i,s]=Dt(this.domain);return i>=0!=s>=0?NaN:i>=0?Math.log(t):-Math.log(-t)}transformInvert(t){const[i,s]=Dt(this.domain);return i>=0!=s>=0?NaN:i>=0?Math.exp(t):-Math.exp(-t)}niceDomain(t,i=this.domain){if(i.length<2)return[];const{base:s}=this,[n,r]=i,o=n>r?Math.ceil:Math.floor,a=n>r?Math.floor:Math.ceil,l=yg(s,i,o(mg(s,i,n))),c=yg(s,i,a(mg(s,i,r)));return[l,c]}ticks({interval:t,tickCount:i=Fe.defaultTickCount},s=this.domain,n){if(!s||s.length<2||i<1)return;const r=this.base,[o,a]=s,l=Math.min(o,a),c=Math.max(o,a);let h=this.log(l),u=this.log(c);if(t){const b=D=>D>=l&&D<=c,m=Math.min(Math.abs(t),Math.abs(u-h)),{ticks:v,count:M}=ch(h,u,m,n),S=v.map(this.pow).filter(b);if(!wo(S.length,this.getPixelRange()))return{ticks:S,count:M}}if(!(0,hv.isInteger)(r)||u-h>=i){const b=Math.min(u-h,i),{ticks:m,count:v}=Ua(h,u,b,void 0,void 0,n);return{ticks:m.map(this.pow),count:v}}const d=[],p=l>0;h=Math.floor(h)-1,u=Math.round(u)+1;const f=xo(this.range)/i;let y=1/0;for(let b=h;b<=u;b++){const m=this.convert(this.pow(b+1));for(let v=1;v<r;v++){const M=p?v:r-v+1,S=this.pow(b)*M,D=this.convert(S),C=Math.abs(y-D),k=Math.abs(D-m),L=C>=f&&k>=f;S>=l&&S<=c&&(v===1||L||d.length===0)&&(d.push(S),y=D)}}return zx(d,p,n)}tickFormatter({specifier:t}){return t!=null?(0,hv.createNumberFormatter)(t):String}datumFormatter(t){return this.tickFormatter(t)}},us=class hm extends Fe{constructor(){super([0,1],[0,1]),this.type="number"}static is(t){return t instanceof hm}static getTickStep(t,i,s){const{interval:n,tickCount:r=Fe.defaultTickCount,minTickCount:o,maxTickCount:a}=s;return n??Wa(t,i,r,o,a)}toDomain(t){return t}ticks({interval:t,tickCount:i=Fe.defaultTickCount,minTickCount:s,maxTickCount:n},r=this.domain,o){if(!r||r.length<2||i<1||!r.every(isFinite))return{ticks:[],count:0};const[a,l]=r;if(t){const c=Math.abs(t);if(!wo((l-a)/c,this.getPixelRange()))return ch(a,l,c,o)}return Ua(a,l,i,s,n,o)}niceDomain(t,i=this.domain){if(i.length<2)return[];const{tickCount:s=Fe.defaultTickCount}=t;let[n,r]=i;if(s===1)[n,r]=Z0(n,r);else if(s>1){const o=n>r?Math.ceil:Math.floor,a=n>r?Math.floor:Math.ceil,l=4;for(let c=0;c<l;c++){const h=n,u=r,d=hm.getTickStep(n,r,t),[p,f]=i;if(n=o(p/d)*d,r=a(f/d)*d,n===h&&r===u)break}}return[n,r]}tickFormatter({ticks:t,fractionDigits:i,specifier:s}){return s!=null?K0(t,s):n=>Hs(n,i)}datumFormatter({ticks:t,fractionDigits:i,specifier:s}){return s!=null?K0(t,s):n=>Hs(n,i+1)}},Js=class extends $a{constructor(e,t=new us){super(e,t)}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:s,clipped:n}=hg(e,t,i);return{domain:s,clipped:n}}};Js.className="NumberAxis",Js.type="number",g([x],Js.prototype,"min",2),g([x],Js.prototype,"max",2);var Ro=class extends Js{normaliseDataDomain(e){const{min:t,max:i}=this,{extent:s,clipped:n}=hg(e,t,i);return s[0]<0&&s[1]>0||e[0]<0&&e[1]>0?(cv.Logger.warn("The log axis domain crosses zero, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:n}):s[0]===0||s[1]===0||e[0]===0||e[1]===0?(cv.Logger.warn("The log axis domain contains a value of 0, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:n}):{domain:s,clipped:n}}set base(e){this.scale.base=e}get base(){return this.scale.base}constructor(e){super(e,new bg)}defaultDatumFormatter(e,t){return String(e)}defaultLabelFormatter(e,t){return String(e)}};Ro.className="LogAxis",Ro.type="log";var Fo=class extends le{constructor(){super(...arguments),this.enabled=!1,this.label=new ft,this.tick=new gr}};g([x],Fo.prototype,"enabled",2),g([x],Fo.prototype,"label",2),g([x],Fo.prototype,"tick",2);var Yi=class extends $a{constructor(e){super(e,new Ha),this.parentLevel=new Fo,this.min=void 0,this.max=void 0,this.groupPaddingInner=.1}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}normaliseDataDomain(e){return uv(e,this.min,this.max)}};Yi.className="TimeAxis",Yi.type="time",g([x],Yi.prototype,"parentLevel",2),g([x],Yi.prototype,"min",2),g([x],Yi.prototype,"max",2),g([x],Yi.prototype,"groupPaddingInner",2),g([x],Yi.prototype,"paddingInner",2),g([x],Yi.prototype,"paddingOuter",2);function uv(e,t,i){let s=!1;return typeof t=="number"&&(t=new Date(t)),typeof i=="number"&&(i=new Date(i)),e.length>2&&(e=Qs(e)?.map(n=>new Date(n))??[]),t instanceof Date&&(s||(s=t>e[0]),e=[t,e[1]]),i instanceof Date&&(s||(s=i<e[1]),e=[e[0],i]),e[0]>e[1]&&(e=[]),{domain:e,clipped:s}}var wn=class extends kn{constructor(e){super(e,new ki),this.parentLevel=new Fo,this.min=void 0,this.max=void 0}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}updateScale(){super.updateScale(),this.scale.interval=this.unit}normaliseDataDomain(e){return uv(e,this.min,this.max)}};wn.className="UnitTimeAxis",wn.type="unit-time",g([x],wn.prototype,"parentLevel",2),g([x],wn.prototype,"min",2),g([x],wn.prototype,"max",2),g([x],wn.prototype,"unit",2);var rl=(e,{x0:t,y0:i,x1:s,y1:n,cx:r,cy:o},a,l)=>{if(l&&e.moveTo(t,i),t!==s||i!==n){const c=Math.atan2(i-o,t-r),h=Math.atan2(n-o,s-r);e.arc(r,o,a,c,h)}else e.lineTo(t,i)},dv=1e-6,Ah=(e,t,i,s,n)=>{let r=!1,o=!1,a=s-Math.sqrt(Math.max(n**2-i**2,0)),l=0,c=0,h=i-Math.sqrt(Math.max(n**2-s**2,0));return a>e?(r=!0,a=e,l=i-Math.sqrt(Math.max(n**2-(s-e)**2))):a<dv&&(a=0),h>t?(o=!0,c=s-Math.sqrt(Math.max(n**2-(i-t)**2)),h=t):h<dv&&(h=0),{leading0:a,leading1:l,trailing0:c,trailing1:h,leadingClipped:r,trailingClipped:o}},Lh=(e,t,i,s,n,r,o)=>{let{topLeft:a,topRight:l,bottomRight:c,bottomLeft:h}=r;const u=Math.max(a+h,l+c),d=Math.max(a+l,h+c);if(u<=0&&d<=0){o==null?e.rect(t,i,s,n):e.rect(o.x,o.y,o.width,o.height);return}else if(o==null&&a===l&&a===c&&a===h){e.roundRect(t,i,s,n,a);return}if(s<0&&(t+=s,s=Math.abs(s)),n<0&&(i+=n,n=Math.abs(n)),s<=0||n<=0)return;if(o==null)o=new U(t,i,s,n);else{const k=Math.max(t,o.x),L=Math.min(t+s,o.x+o.width),w=Math.max(i,o.y),P=Math.min(i+n,o.y+o.height);o=new U(k,w,L-k,P-w)}const p=Math.max(u/n,d/s,1);p>1&&(a/=p,l/=p,c/=p,h/=p);let f=!0,y=!0,b=!0,m=!0,v,M,S,D;if(f){const k=Ah(o.height,o.width,Math.max(t+a-o.x,0),Math.max(i+a-o.y,0),a);k.leadingClipped&&(m=!1),k.trailingClipped&&(y=!1);const L=Math.max(o.x+k.leading1,o.x),w=Math.max(o.y+k.leading0,o.y),P=Math.max(o.x+k.trailing1,o.x),R=Math.max(o.y+k.trailing0,o.y),G=t+a,Y=i+a;v={x0:L,y0:w,x1:P,y1:R,cx:G,cy:Y}}if(y){const k=Ah(o.width,o.height,Math.max(i+l-o.y,0),Math.max(o.x+o.width-(t+s-l),0),l);k.leadingClipped&&(f=!1),k.trailingClipped&&(b=!1);const L=Math.min(o.x+o.width-k.leading0,o.x+o.width),w=Math.max(o.y+k.leading1,o.y),P=Math.min(o.x+o.width-k.trailing0,o.x+o.width),R=Math.max(o.y+k.trailing1,o.y),G=t+s-l,Y=i+l;M={x0:L,y0:w,x1:P,y1:R,cx:G,cy:Y}}if(b){const k=Ah(o.height,o.width,Math.max(o.x+o.width-(t+s-c),0),Math.max(o.y+o.height-(i+n-c),0),c);k.leadingClipped&&(y=!1),k.trailingClipped&&(m=!1);const L=Math.min(o.x+o.width-k.leading1,o.x+o.width),w=Math.min(o.y+o.height-k.leading0,o.y+o.height),P=Math.min(o.x+o.width-k.trailing1,o.x+o.width),R=Math.min(o.y+o.height-k.trailing0,o.y+o.height),G=t+s-c,Y=i+n-c;S={x0:L,y0:w,x1:P,y1:R,cx:G,cy:Y}}if(m){const k=Ah(o.width,o.height,Math.max(o.y+o.height-(i+n-h),0),Math.max(t+h-o.x,0),h);k.leadingClipped&&(b=!1),k.trailingClipped&&(f=!1);const L=Math.max(o.x+k.leading0,o.x),w=Math.min(o.y+o.height-k.leading1,o.y+o.height),P=Math.max(o.x+k.trailing0,o.x),R=Math.min(o.y+o.height-k.trailing1,o.y+o.height),G=t+h,Y=i+n-h;D={x0:L,y0:w,x1:P,y1:R,cx:G,cy:Y}}let C=!1;f&&v!=null&&(rl(e,v,a,!C),C||(C=!0)),y&&M!=null&&(rl(e,M,l,!C),C||(C=!0)),b&&S!=null&&(rl(e,S,c,!C),C||(C=!0)),m&&D!=null&&rl(e,D,h,!C),e.closePath()},qt=class extends oi{constructor(){super(...arguments),this.borderPath=new no,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=Bi.defaultStyles.strokeWidth,this.effectiveStrokeWidth=Bi.defaultStyles.strokeWidth,this.hittester=super.isPointInPath.bind(this),this.distanceCalculator=super.distanceSquaredTransformedPoint.bind(this),this.microPixelEffectOpacity=1}set cornerRadius(e){this.topLeftCornerRadius=e,this.topRightCornerRadius=e,this.bottomRightCornerRadius=e,this.bottomLeftCornerRadius=e}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.strokeWidth||!!(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){const{path:e,borderPath:t,crisp:i,topLeftCornerRadius:s,topRightCornerRadius:n,bottomRightCornerRadius:r,bottomLeftCornerRadius:o}=this;let{x:a,y:l,width:c,height:h,strokeWidth:u,clipBBox:d}=this;const f=1/(this.layerManager?.canvas.pixelRatio??1);let y=1;if(e.clear(!0),t.clear(!0),i&&(c<=f&&(y*=c/f),h<=f&&(y*=h/f),c=this.align(a,c),h=this.align(l,h),a=this.align(a),l=this.align(l),d=d!=null?new U(this.align(d.x),this.align(d.y),this.align(d.x,d.width),this.align(d.y,d.height)):void 0),u)if(c<f){const b=a+f/2;t.moveTo(b,l),t.lineTo(b,l+h),u=f,this.borderClipPath=void 0}else if(h<f){const b=l+f/2;t.moveTo(a,b),t.lineTo(a+c,b),u=f,this.borderClipPath=void 0}else if(u<c&&u<h){const b=u/2;a+=b,l+=b,c-=u,h-=u;const m=d?.clone().shrink(b),v={topLeft:s>0?s-u:0,topRight:n>0?n-u:0,bottomRight:r>0?r-u:0,bottomLeft:o>0?o-u:0};this.borderClipPath=void 0,c>0&&h>0&&(m==null||m?.width>0&&m?.height>0)&&(Lh(e,a,l,c,h,v,m),Lh(t,a,l,c,h,v,m))}else this.borderClipPath=this.borderClipPath??new no,this.borderClipPath.clear(!0),this.borderClipPath.rect(a,l,c,h),t.rect(a,l,c,h);else{const b={topLeft:s,topRight:n,bottomRight:r,bottomLeft:o};this.borderClipPath=void 0,Lh(e,a,l,c,h,b,d)}if([s,n,r,o].every(b=>b===0)){const b=this.getBBox();this.hittester=b.containsPoint.bind(b),this.distanceSquared=(m,v)=>this.getBBox().distanceSquared(m,v)}else this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquaredTransformedPoint;this.effectiveStrokeWidth=u,this.lastUpdatePathStrokeWidth=u,this.microPixelEffectOpacity=y}computeBBox(){const{x:e,y:t,width:i,height:s,clipBBox:n}=this;return n?.clone()??new U(e,t,i,s)}isPointInPath(e,t){return this.hittester(e,t)}get midPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}}distanceSquared(e,t){return this.distanceCalculator(e,t)}applyFillAndAlpha(e){super.applyFillAndAlpha(e),e.globalAlpha*=this.microPixelEffectOpacity}applyStrokeAndAlpha(e){super.applyStrokeAndAlpha(e),e.globalAlpha*=this.microPixelEffectOpacity}renderStroke(e){const{stroke:t,effectiveStrokeWidth:i}=this;if(t&&i){const{globalAlpha:s}=e,{lineDash:n,lineDashOffset:r,lineCap:o,lineJoin:a,borderPath:l,borderClipPath:c}=this;c&&e.clip(c.getPath2D()),this.applyStrokeAndAlpha(e),e.lineWidth=i,n&&e.setLineDash(n),r&&(e.lineDashOffset=r),o&&(e.lineCap=o),a&&(e.lineJoin=a),e.stroke(l.getPath2D()),e.globalAlpha=s}}};qt.className="Rect",g([_()],qt.prototype,"x",2),g([_()],qt.prototype,"y",2),g([_()],qt.prototype,"width",2),g([_()],qt.prototype,"height",2),g([_()],qt.prototype,"topLeftCornerRadius",2),g([_()],qt.prototype,"topRightCornerRadius",2),g([_()],qt.prototype,"bottomRightCornerRadius",2),g([_()],qt.prototype,"bottomLeftCornerRadius",2),g([Ai({equals:tr.equals})],qt.prototype,"clipBBox",2),g([_()],qt.prototype,"crisp",2);var _o=class extends pc{constructor(e){super(),this.ctx=e,this.rectNode=new qt,this.textNode=new St,this.fill="white",this.node=this.createNode(),this.node.append([this.rectNode,this.textNode]),this.visible=!0,this.destroyFns.push(e.scene.attachNode(this.node),e.layoutManager.addListener("layout:complete",t=>this.onLayoutComplete(t)))}createNode(){return new ue({name:"background",zIndex:0})}onLayoutComplete(e){const{width:t,height:i}=e.chart;this.rectNode.width=t,this.rectNode.height=i}};g([x,Et("node","visible")],_o.prototype,"visible",2),g([x,Et("rectNode","fill")],_o.prototype,"fill",2),g([x],_o.prototype,"image",2),g([x,Et("textNode")],_o.prototype,"text",2);var pv={type:"root",optionsKey:"background",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new _o(e)},xg=(O(),N(T));function JN({orientation:e,bboxes:t,maxHeight:i,maxWidth:s,itemPaddingY:n=0,itemPaddingX:r=0,forceResult:o=!1}){const a=e==="horizontal",l={max:a?s:i,fn:a?d=>d.width:d=>d.height,padding:a?r:n},c={max:a?i:s,fn:a?d=>d.height:d=>d.width,padding:a?n:r};let h=0;const u=[];for(;h<t.length;){const d=t.slice(h),p=e1(d,h,l,c,o);if(!p)return;h+=p.processedBBoxCount,u.push(p.pageIndices)}return i1(u,e,t,n,r)}function e1(e,t,i,s,n){let o=n1(e,i);if(o<1){if(!n)return;o=1}let a=o;for(;a>=1;){const l=t1(e,t,a,i,s,n);if(l==null&&a<=1)return;if(l==null){a--;continue}if(typeof l=="number"){if(l<=1)return;a=l<a&&l>1?l:a,a--;continue}return{processedBBoxCount:l.length*l[0].length,pageIndices:l}}}function t1(e,t,i,s,n,r){const o=[];let a=0,l=0,c=[];const h=[];for(let u=0;u<e.length;u++){const d=(u+i)%i;d===0&&(a+=l,l=0,c.length>0&&o.push(c),c=[]);const p=s.fn(e[u])+s.padding;h[d]=Math.max(h[d]??0,p),l=Math.max(l,n.fn(e[u])+n.padding);const f=a+l,y=!r||o.length>0;if(f>n.max&&y){c=[];break}if(h.reduce((m,v)=>m+v,0)>s.max&&!r)return h.length<i?h.length:void 0;c.push(u+t)}return c.length>0&&o.push(c),o.length>0?o:void 0}function i1(e,t,i,s,n){let r=0,o=0;return{pages:e.map(l=>{t==="horizontal"&&(l=s1(l));let c=0;const h=l.map(p=>{const f=p.map(m=>(c=Math.max(m,c),i[m]));let y=0,b=0;return f.forEach(m=>{y+=m.height+s,b=Math.max(b,m.width+n)}),{indices:p,bboxes:f,columnHeight:Math.ceil(y),columnWidth:Math.ceil(b)}});let u=0,d=0;return h.forEach(p=>{u+=p.columnWidth,d=Math.max(d,p.columnHeight)}),r=Math.max(u,r),o=Math.max(d,o),{columns:h,startIndex:l[0][0],endIndex:c,pageWidth:u,pageHeight:d}}),maxPageWidth:r,maxPageHeight:o}}function s1(e){const t=[];for(const i of e[0])t.push([]);return e.forEach((i,s)=>{i.forEach((n,r)=>{t[r][s]=n})}),t}function n1(e,t){const i=e.length;let s=0;for(let n=0;n<i;n++)if(s+=t.fn(e[n])+t.padding,s>t.max)return i/n<2?Math.ceil(i/2):n;return i}var gv=(O(),N(T)),jo=class extends le{constructor(){super(...arguments),this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};g([x],jo.prototype,"color",2),g([x],jo.prototype,"fontStyle",2),g([x],jo.prototype,"fontWeight",2),g([x],jo.prototype,"fontSize",2),g([x],jo.prototype,"fontFamily",2);var en=class extends le{constructor(){super(...arguments),this.size=15,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=1,this.strokeOpacity=1}};g([x],en.prototype,"size",2),g([x],en.prototype,"fill",2),g([x],en.prototype,"fillOpacity",2),g([x],en.prototype,"stroke",2),g([x],en.prototype,"strokeWidth",2),g([x],en.prototype,"strokeOpacity",2);var kh=class extends le{constructor(e){super(),this.parent=e,this.shape="triangle",this.size=15,this.padding=8}};g([ui({changeValue(){this.parent.marker===this&&this.parent.onMarkerShapeChange()}})],kh.prototype,"shape",2),g([x],kh.prototype,"size",2),g([x],kh.prototype,"padding",2);var Sr=class extends le{constructor(e,t){super(),this.chartUpdateCallback=e,this.pageUpdateCallback=t,this.id=(0,gv.createId)(this),this.marker=new kh(this),this.activeStyle=new en,this.inactiveStyle=new en,this.highlightStyle=new en,this.label=new jo,this.group=new Ot({name:"pagination"}),this.labelNode=new St,this.totalPages=0,this.currentPage=0,this.translationX=0,this.translationY=0,this.nextButtonDisabled=!1,this.previousButtonDisabled=!1,this._visible=!0,this._enabled=!0,this._orientation="vertical",this.nextButton=new Lt,this.previousButton=new Lt,this.labelNode.setProperties({textBaseline:"middle",fontSize:12,fontFamily:"Verdana, sans-serif",fill:"black",y:1}),this.group.append([this.nextButton,this.previousButton,this.labelNode]),this.update(),this.updateMarkers()}set visible(e){this._visible=e,this.updateGroupVisibility()}get visible(){return this._visible}set enabled(e){this._enabled=e,this.updateGroupVisibility()}get enabled(){return this._enabled}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible}set orientation(e){switch(this._orientation=e,e){case"horizontal":{this.previousButton.rotation=-Math.PI/2,this.nextButton.rotation=Math.PI/2;break}case"vertical":default:this.previousButton.rotation=0,this.nextButton.rotation=Math.PI}}get orientation(){return this._orientation}update(){this.updateLabel(),this.updatePositions(),this.enableOrDisableButtons()}updatePositions(){this.group.translationX=this.translationX,this.group.translationY=this.translationY,this.updateLabelPosition(),this.updateNextButtonPosition()}updateLabelPosition(){const{size:e,padding:t}=this.marker;this.nextButton.size=e,this.previousButton.size=e,this.labelNode.x=e/2+t}updateNextButtonPosition(){const e=this.labelNode.getBBox();this.nextButton.translationX=e.width+(this.marker.size/2+this.marker.padding)*2}updateLabel(){const{currentPage:e,totalPages:t,labelNode:i,label:{color:s,fontStyle:n,fontWeight:r,fontSize:o,fontFamily:a}}=this;i.text=`${e+1} / ${t}`,i.fill=s,i.fontStyle=n,i.fontWeight=r,i.fontSize=o,i.fontFamily=a}updateMarkers(){const{nextButton:e,previousButton:t,nextButtonDisabled:i,previousButtonDisabled:s,activeStyle:n,inactiveStyle:r,highlightStyle:o,highlightActive:a}=this,l=(c,h)=>h?r:c===a?o:n;this.updateMarker(e,l("next",i)),this.updateMarker(t,l("previous",s))}updateMarker(e,t){const{shape:i,size:s}=this.marker;e.shape=i,e.size=s,e.fill=t.fill,e.fillOpacity=t.fillOpacity??1,e.stroke=t.stroke,e.strokeWidth=t.strokeWidth,e.strokeOpacity=t.strokeOpacity}enableOrDisableButtons(){const{currentPage:e,totalPages:t}=this,i=t===0,s=e===t-1,n=e===0;this.nextButtonDisabled=s||i,this.previousButtonDisabled=n||i}setPage(e){e=(0,gv.clamp)(0,e,Math.max(0,this.totalPages-1)),this.currentPage!==e&&(this.currentPage=e,this.onPaginationChanged())}getCursor(e){return{previous:this.previousButtonDisabled,next:this.nextButtonDisabled}[e]?void 0:"pointer"}onClick(e,t){e.preventDefault(),t==="next"&&!this.nextButtonDisabled?(this.incrementPage(),this.onPaginationChanged()):t==="previous"&&!this.previousButtonDisabled&&(this.decrementPage(),this.onPaginationChanged())}onMouseHover(e){this.highlightActive=e,this.updateMarkers(),this.chartUpdateCallback(7)}onPaginationChanged(){this.pageUpdateCallback(this.currentPage)}incrementPage(){this.currentPage=Math.min(this.currentPage+1,this.totalPages-1)}decrementPage(){this.currentPage=Math.max(this.currentPage-1,0)}onMarkerShapeChange(){this.updatePositions(),this.updateMarkers(),this.chartUpdateCallback(7)}attachPagination(e){e.append(this.group)}getBBox(){return this.group.getBBox()}computeCSSBounds(){const e=Qe.toCanvas(this.previousButton),t=Qe.toCanvas(this.nextButton);return{prev:e,next:t}}};Sr.className="Pagination",g([x],Sr.prototype,"marker",2),g([x],Sr.prototype,"activeStyle",2),g([x],Sr.prototype,"inactiveStyle",2),g([x],Sr.prototype,"highlightStyle",2),g([x],Sr.prototype,"label",2);var fv=(O(),N(T)),r1=class{constructor(e,t){this.dirty=!0,this.destroyFns=new Yd,this.itemList=e.proxyInteractionService.createProxyContainer({type:"list",domManagerId:`${t}-toolbar`,classList:["ag-charts-proxy-legend-toolbar"],ariaLabel:{id:"ariaLabelLegend"}}),this.paginationGroup=e.proxyInteractionService.createProxyContainer({type:"group",domManagerId:`${t}-pagination`,classList:["ag-charts-proxy-legend-pagination"],ariaLabel:{id:"ariaLabelLegendPagination"},ariaOrientation:"horizontal"}),this.itemDescription=(0,fv.createElement)("p"),this.itemDescription.style.display="none",this.itemDescription.id=(0,fv.createElementId)(),this.itemDescription.textContent=this.getItemAriaDescription(e.localeManager),this.itemList.getElement().append(this.itemDescription)}destroy(){this.destroyFns.destroy()}initLegendList(e){if(!this.dirty)return;const{ctx:t,itemSelection:i,datumReader:s,itemListener:n}=e,r=t.localeManager,o=i.length;i.each((a,l,c)=>{a.proxyButton?.destroy(),a.proxyButton=t.proxyInteractionService.createProxyElement({type:"listswitch",textContent:this.getItemAriaText(r,s.getItemLabel(l),c,o),ariaChecked:!!a.datum.enabled,ariaDescribedBy:this.itemDescription.id,parent:this.itemList});const h=a.proxyButton;h.addListener("click",u=>n.onClick(u.sourceEvent,a.datum,h)),h.addListener("dblclick",u=>n.onDoubleClick(u.sourceEvent,a.datum)),h.addListener("mouseenter",u=>n.onHover(u.sourceEvent,a)),h.addListener("mouseleave",()=>n.onLeave()),h.addListener("contextmenu",u=>n.onContextClick(u,a)),h.addListener("blur",()=>n.onLeave()),h.addListener("focus",u=>n.onHover(u.sourceEvent,a)),h.addListener("drag-start",()=>{})}),this.dirty=!1}update(e){e.visible&&(this.initLegendList(e),this.updateItemProxyButtons(e),this.updatePaginationProxyButtons(e,!0)),this.updateVisibility(e.visible)}updateVisibility(e){this.itemList.setHidden(!e),this.paginationGroup.setHidden(!e)}updateItemProxyButtons({itemSelection:e,group:t,pagination:i,interactive:s}){const n=Qe.toCanvas(t);this.itemList.setBounds(n);const r=Math.max(...e.nodes().map(o=>o.getBBox().height));e.each((o,a)=>{if(o.proxyButton){const l=o.pageIndex===i.currentPage,{x:c,y:h,height:u,width:d}=Qe.toCanvas(o),p=(r-u)/2,f={x:c-n.x,y:h-p-n.y,height:r,width:d},y=s&&l;o.proxyButton.setCursor("pointer"),o.proxyButton.setEnabled(y),o.proxyButton.setPointerEvents(y?void 0:"none"),o.proxyButton.setBounds(f)}})}updatePaginationProxyButtons(e,t){const{pagination:i}=e;if(this.paginationGroup.setHidden(!i.visible),t&&"ctx"in e){const{ctx:r,oldPages:o,newPages:a}=e,l=(o?.length??a.length)>1,c=a.length>1;l!==c&&(c?(this.prevButton=r.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPagePrevious"},tabIndex:0,parent:this.paginationGroup}),this.prevButton.addListener("click",h=>this.onPageButton(e,h,"previous")),this.prevButton.addListener("mouseenter",()=>i.onMouseHover("previous")),this.prevButton.addListener("mouseleave",()=>i.onMouseHover(void 0)),this.nextButton??(this.nextButton=r.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPageNext"},tabIndex:0,parent:this.paginationGroup})),this.nextButton.addListener("click",h=>this.onPageButton(e,h,"next")),this.nextButton.addListener("mouseenter",()=>i.onMouseHover("next")),this.nextButton.addListener("mouseleave",()=>i.onMouseHover(void 0))):(this.nextButton?.destroy(),this.prevButton?.destroy(),this.nextButton=void 0,this.prevButton=void 0))}const{prev:s,next:n}=i.computeCSSBounds();this.prevButton?.setBounds(s),this.nextButton?.setBounds(n),this.prevButton?.setEnabled(i.currentPage!==0),this.nextButton?.setEnabled(i.currentPage!==i.totalPages-1),this.nextButton?.setCursor(i.getCursor("next")),this.prevButton?.setCursor(i.getCursor("previous"))}onPageButton(e,t,i){e.pagination.onClick(t.sourceEvent,i),this.updatePaginationProxyButtons(e,!1)}onDataUpdate(e,t){this.dirty=e.length!==t.length||e.some((i,s,n)=>{const[r,o]=[t[s],e[s]];return r.id!==o.id})}onLocaleChanged(e,t,i){const s=t.length;t.each(({proxyButton:n},r,o)=>{const a=n?.getElement();if(a!=null){const l=i.getItemLabel(r);a.textContent=this.getItemAriaText(e,l,o,s)}}),this.itemDescription.textContent=this.getItemAriaDescription(e)}onPageChange(e){this.updateItemProxyButtons(e),this.updatePaginationProxyButtons(e,!1)}getItemAriaText(e,t,i,s){return i>=0&&t?(i++,e.t("ariaLabelLegendItem",{label:t,index:i,count:s})):e.t("ariaLabelLegendItemUnknown")}getItemAriaDescription(e){return e.t("ariaDescriptionLegendItem")}};function mv(e,t,i,s){const n={defaultPrevented:!1,apiEvent:{type:e,itemId:t,seriesId:i,event:s,preventDefault:()=>n.defaultPrevented=!0}};return n}var $i=class extends ar(ue){constructor(){super({name:"markerLabelGroup"}),this.symbolsGroup=this.appendChild(new ue({name:"legend-markerLabel-symbols"})),this.label=this.appendChild(new St),this.enabled=!0,this.pageIndex=NaN,this.spacing=0,this.length=0,this.isCustomMarker=!1,this.marker=this.symbolsGroup.appendChild(new Lt({zIndex:1})),this.line=this.symbolsGroup.appendChild(new Xt({zIndex:0}));const{label:e,line:t,symbolsGroup:i}=this;t.visible=!1,i.renderToOffscreenCanvas=!0,i.optimizeForInfrequentRedraws=!0,e.textBaseline="middle",e.fontSize=12,e.fontFamily="Verdana, sans-serif",e.fill="black",e.y=1}destroy(){super.destroy(),this.proxyButton?.destroy()}setEnabled(e){this.enabled=e,this.refreshVisibilities()}getTextMeasureBBox(){return this.layout(),U.merge([this.symbolsGroup.getBBox(),this.label.getTextMeasureBBox()])}refreshVisibilities(){const e=this.enabled?1:.5;this.label.opacity=e,this.opacity=e}layout(){const{marker:e,line:t,length:i,isCustomMarker:s}=this;let n=0,r=0;if(e.visible){const{size:o}=e,a=Lt.anchor(e.shape);n=(a.x-.5)*o+i/2,r=(a.y-.5)*o,s?(e.x=0,e.y=0,e.translationX=n,e.translationY=r):(e.x=n,e.y=r,e.translationX=0,e.translationY=0)}t.visible&&(t.x1=0,t.x2=i,t.y1=0,t.y2=0)}preRender(e){const t=super.preRender(e);return this.layout(),t}layoutLabel(){const{length:e,spacing:t}=this;this.label.x=e+t}computeBBox(){return this.layout(),super.computeBBox()}};$i.className="MarkerLabel",g([Et("label")],$i.prototype,"text",2),g([Et("label")],$i.prototype,"fontStyle",2),g([Et("label")],$i.prototype,"fontWeight",2),g([Et("label")],$i.prototype,"fontSize",2),g([Et("label")],$i.prototype,"fontFamily",2),g([Et("label","fill")],$i.prototype,"color",2),g([Mn(e=>e.layoutLabel())],$i.prototype,"spacing",2),g([Mn(e=>e.layoutLabel())],$i.prototype,"length",2),g([_()],$i.prototype,"isCustomMarker",2);var Tn=class extends le{constructor(){super(...arguments),this.maxLength=void 0,this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};g([x],Tn.prototype,"maxLength",2),g([x],Tn.prototype,"color",2),g([x],Tn.prototype,"fontStyle",2),g([x],Tn.prototype,"fontWeight",2),g([x],Tn.prototype,"fontSize",2),g([x],Tn.prototype,"fontFamily",2),g([x],Tn.prototype,"formatter",2);var zo=class extends le{constructor(){super(...arguments),this.shape=void 0,this.size=15,this.padding=8}};g([x],zo.prototype,"shape",2),g([x],zo.prototype,"size",2),g([x],zo.prototype,"padding",2),g([x],zo.prototype,"strokeWidth",2),g([x],zo.prototype,"enabled",2);var vg=class extends le{};g([x],vg.prototype,"strokeWidth",2),g([x],vg.prototype,"length",2);var Nn=class extends le{constructor(){super(...arguments),this.paddingX=16,this.paddingY=8,this.showSeriesStroke=!1,this.marker=new zo,this.label=new Tn,this.line=new vg}};g([x],Nn.prototype,"maxWidth",2),g([x],Nn.prototype,"paddingX",2),g([x],Nn.prototype,"paddingY",2),g([x],Nn.prototype,"showSeriesStroke",2),g([x],Nn.prototype,"marker",2),g([x],Nn.prototype,"label",2),g([x],Nn.prototype,"line",2);var Mg=class extends le{};g([x],Mg.prototype,"legendItemClick",2),g([x],Mg.prototype,"legendItemDoubleClick",2);var o1={type:"gradient",bounds:"item",gradient:"linear",colorStops:[{color:"black"}],rotation:0,reverse:!1},a1={type:"pattern",pattern:"forward-slanted-lines",width:8,height:8,padding:1,fill:"black",fillOpacity:1,backgroundFill:"white",backgroundFillOpacity:1,stroke:"black",strokeOpacity:1,strokeWidth:0,rotation:0,scale:1},l1={type:"image",backgroundFill:"black",backgroundFillOpacity:1,rotation:0,repeat:"no-repeat",fit:"contain",width:8,height:8},pi=class extends le{constructor(e){super(),this.ctx=e,this.id=(0,xg.createId)(this),this.group=new Ot({name:"legend",zIndex:14}),this.itemSelection=ht.select(this.group,$i),this.oldSize=[0,0],this.pages=[],this.maxPageSize=[0,0],this.paginationTrackingIndex=0,this.truncatedItems=new Set,this._data=[],this.toggleSeries=!0,this.item=new Nn,this.listeners=new Mg,this.enabled=!0,this.position="bottom",this.spacing=20,this.destroyFns=[],this.size=[0,0],this._visible=!0,this.pagination=new Sr(i=>e.updateService.update(i),i=>this.updatePageNumber(i)),this.pagination.attachPagination(this.group);const{items:t}=e.contextMenuRegistry.builtins;t["toggle-series-visibility"].action=i=>this.contextToggleVisibility(i),t["toggle-other-series"].action=i=>this.contextToggleOtherSeries(i),this.destroyFns.push(e.legendManager.addListener("legend-change",this.onLegendDataChange.bind(this))),this.destroyFns.push(()=>delete t["toggle-series-visibility"].action,()=>delete t["toggle-other-series"].action,e.layoutManager.registerElement(1,i=>this.positionLegend(i)),e.localeManager.addListener("locale-changed",()=>this.onLocaleChanged()),()=>this.group.remove()),this.domProxy=new r1(this.ctx,this.id),this.ctx.historyManager.addMementoOriginator(e.legendManager)}set data(e){ii(e,this._data)||(this.domProxy.onDataUpdate(this._data,e),this._data=e,this.updateGroupVisibility())}get data(){return this._data}onLegendDataChange({legendData:e=[]}){this.enabled&&(this.data=e.filter(t=>!t.hideInLegend))}destroy(){this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-toolbar`),this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-pagination`),this.destroyFns.forEach(e=>e()),this.itemSelection.clear(),this.domProxy.destroy()}getOrientation(){return this.orientation??"horizontal"}set visible(e){this._visible=e,this.updateGroupVisibility()}get visible(){return this._visible}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible&&this.data.length>0}attachLegend(e){e.appendChild(this.group)}getItemLabel(e){const{formatter:t}=this.item.label;if(t){const i=e.datum;return this.cachedCallWithContext(t,{itemId:e.itemId,value:e.label.text,seriesId:e.seriesId,...i&&{datum:i}})}return e.label.text}calcLayout(e,t){const{paddingX:i,paddingY:s,label:n,maxWidth:r,label:{maxLength:o=1/0,fontStyle:a,fontWeight:l,fontSize:c,fontFamily:h}}=this.item,u=[...this.data];this.reverseOrder&&u.reverse(),this.itemSelection.update(u);const d=[],p=Ue.toFontString(n),y=r??e*.8,{markerWidth:b,anyLineEnabled:m}=this.calculateMarkerWidth();if(this.itemSelection.each((P,R)=>{P.fontStyle=a,P.fontWeight=l,P.fontSize=c,P.fontFamily=h;const G=this.updateMarkerLabel(P,R,b,m),Y=R.itemId??R.id,se=(this.getItemLabel(R)??"<unknown>").replace(/\r?\n/g," ");P.text=this.truncate(se,o,y,G,p,Y),d.push(P.getTextMeasureBBox())}),e=Math.max(1,e),t=Math.max(1,t),!isFinite(e))return{};const v=this.size,M=this.oldSize;v[0]=e,v[1]=t,(v[0]!==M[0]||v[1]!==M[1])&&(M[0]=v[0],M[1]=v[1]);const{pages:S,maxPageHeight:D,maxPageWidth:C}=this.updatePagination(d,e,t),k=this.pages;this.pages=S,this.maxPageSize=[C-i,D-s];const L=this.pagination.currentPage,w=this.pages[L];return this.pages.length<1||!w?(this.visible=!1,{oldPages:k}):(this.visible=!0,this.updatePositions(L),this.update(),{oldPages:k})}isCustomMarker(e,t){return e&&t!==void 0&&typeof t!="string"}calcSymbolsEnabled(e){const{showSeriesStroke:t,marker:i}=this.item,s=!!i.enabled||!t||(e.marker.enabled??!0),n=!!(e.line&&t),r=this.isCustomMarker(s,e.marker.shape);return{markerEnabled:s,lineEnabled:n,isCustomMarker:r}}calcSymbolsLengths(e,t,i){const{marker:s,line:n}=this.item;let r;const{shape:o}=e.marker;if(this.isCustomMarker(t,o)){const c=new Lt;c.shape=o,c.updatePath();const h=c.getBBox();r=Math.max(h.width,h.height)}const a=t?s.size:0,l=i?n.length??25:0;return{markerLength:a,lineLength:l,customMarkerSize:r}}calculateMarkerWidth(){let e=0,t=!1;return this.itemSelection.each((i,s)=>{const{symbol:n}=s,{lineEnabled:r,markerEnabled:o}=this.calcSymbolsEnabled(n),{markerLength:a,lineLength:l,customMarkerSize:c=-1/0}=this.calcSymbolsLengths(n,o,r);e=Math.max(e,l,c,a),t||(t=r)}),{markerWidth:e,anyLineEnabled:t}}updateMarkerLabel(e,t,i,s){const{marker:n,paddingX:r}=this.item,{symbol:o}=t;let a=r;const{markerEnabled:l,isCustomMarker:c}=this.calcSymbolsEnabled(o),h=n.padding;(l||s)&&(a+=h+i);const{marker:u,line:d}=e;return u.visible=l,u.visible&&(u.shape=n.shape??o.marker.shape??"square",u.size=n.size,yr(u,this.getMarkerStyles(o))),d.visible=s,d.visible&&yr(d,this.getLineStyles(o)),e.length=i,e.spacing=h,e.isCustomMarker=c,a}truncate(e,t,i,s,n,r){let o=!1;e.length>t&&(e=e.substring(0,t),o=!0);const a=As.getMeasurer({font:n}),l=Ud.truncateLine(e,a,i-s,o);return l.endsWith(Ue.EllipsisChar)?this.truncatedItems.add(r):this.truncatedItems.delete(r),l}updatePagination(e,t,i){const s=this.getOrientation(),n=Math.min(this.paginationTrackingIndex,e.length);this.pagination.orientation=s,this.pagination.translationX=0,this.pagination.translationY=0;const{pages:r,maxPageHeight:o,maxPageWidth:a,paginationBBox:l,paginationVertical:c}=this.calculatePagination(e,t,i),h=r.findIndex(M=>M.endIndex>=n);this.pagination.currentPage=(0,xg.clamp)(0,h,r.length-1);const{paddingX:u,paddingY:d}=this.item,p=8,f=a-u,y=o-d;let b=0,m=-l.y-this.item.marker.size/2;c?m+=y+p:(b+=-l.x+f+p,m+=(y-l.height)/2),this.pagination.translationX=b,this.pagination.translationY=m,this.pagination.update(),this.pagination.updateMarkers();let v=0;return this.itemSelection.each((M,S,D)=>{D>(r[v]?.endIndex??1/0)&&v++,M.pageIndex=v}),{maxPageHeight:o,maxPageWidth:a,pages:r}}calculatePagination(e,t,i){const{paddingX:s,paddingY:n}=this.item,r=this.getOrientation(),o=["left","right"].includes(this.position);let a=this.pagination.getBBox(),l=new U(0,0,0,0),c=[],h=0,u=0,d=0;const p=y=>y.width===a.width&&y.height===a.height,f=this.maxWidth!==void 0&&this.maxHeight!==void 0;do{if(d++>10){xg.Logger.warn("unable to find stable legend layout.");break}a=l;const y=t-(o?0:a.width),b=i-(o?a.height:0),m=JN({orientation:r,bboxes:e,maxHeight:b,maxWidth:y,itemPaddingY:n,itemPaddingX:s,forceResult:f});c=m?.pages??[],h=m?.maxPageWidth??0,u=m?.maxPageHeight??0;const v=c.length;if(this.pagination.visible=v>1,this.pagination.totalPages=v,this.pagination.update(),this.pagination.updateMarkers(),l=this.pagination.getBBox(),!this.pagination.visible)break}while(!p(l));return{maxPageWidth:h,maxPageHeight:u,pages:c,paginationBBox:l,paginationVertical:o}}updatePositions(e=0){const{item:{paddingY:t},itemSelection:i,pages:s}=this;if(s.length<1||!s[e])return;const{columns:n,startIndex:r,endIndex:o}=s[e];let a=0,l=0;const c=n.length,h=n[0].indices.length,u=this.getOrientation()==="horizontal",d=n[0].bboxes[0].height+t,p=[];i.each((f,y,b)=>{if(b<r||b>o){f.visible=!1;return}const m=b-r;let v,M;u?(v=m%c,M=Math.floor(m/c)):(v=Math.floor(m/h),M=m%h),f.visible=!0;const S=n[v];S&&(l=Math.floor(d*M),a=Math.floor(p[M]??0),p[M]=(p[M]??0)+S.columnWidth,f.translationX=a,f.translationY=l)})}updatePageNumber(e){const{itemSelection:t,group:i,pagination:s,pages:n,toggleSeries:r}=this,{startIndex:o,endIndex:a}=n[e];o===0?this.paginationTrackingIndex=0:e===n.length-1?this.paginationTrackingIndex=a:this.paginationTrackingIndex=Math.floor((o+a)/2),this.pagination.update(),this.pagination.updateMarkers(),this.updatePositions(e),this.domProxy.onPageChange({itemSelection:t,group:i,pagination:s,interactive:r}),this.ctx.updateService.update(7)}update(){const{label:{color:e}}=this.item;this.itemSelection.each((t,i)=>{t.setEnabled(i.enabled),t.color=e}),this.updateContextMenu()}updateContextMenu(){this.ctx.contextMenuRegistry.setVisible("toggle-series-visibility",this.toggleSeries),this.ctx.contextMenuRegistry.setVisible("toggle-other-series",this.toggleSeries)}getLineStyles(e){const{stroke:t,strokeOpacity:i=1,strokeWidth:s,lineDash:n}=e.line??{},r=Math.min(2,s??1);return{stroke:t,strokeOpacity:i,strokeWidth:this.item.line.strokeWidth??r,lineDash:n}}getMarkerStyles({marker:e}){const{fill:t,stroke:i,strokeOpacity:s=1,fillOpacity:n=1,strokeWidth:r,lineDash:o,lineDashOffset:a}=e,l=Math.min(2,r??1);return or(t)&&(t.width=8,t.height=8,t.padding=1,t.strokeWidth=Math.min(2,t.strokeWidth??2)),ro(t)&&(t.fit="contain",t.width=void 0,t.height=void 0,t.repeat="no-repeat"),ws({fill:t,stroke:i,strokeOpacity:s,fillOpacity:n,strokeWidth:this.item.marker.strokeWidth??l,lineDash:o,lineDashOffset:a},o1,a1,l1)}computePagedBBox(){const e=ue.computeChildrenBBox(this.group.children());if(this.pages.length>1){const[t,i]=this.maxPageSize;e.height=Math.max(i,e.height),e.width=Math.max(t,e.width)}return e}findNode(e){const{datum:t,proxyButton:i}=this.itemSelection.select(s=>s.datum?.itemId===e.itemId)[0]??{};if(t===void 0||i===void 0)throw new Error(`AG Charts - Missing required properties { datum: ${t}, proxyButton: ${JSON.stringify(i)} }`);return{datum:t,proxyButton:i}}contextToggleVisibility(e){const{datum:t,proxyButton:i}=this.findNode(e);this.doClick(e.event,t,i)}contextToggleOtherSeries(e){this.doDoubleClick(e.event,this.findNode(e).datum)}onContextClick(e,t){const{sourceEvent:i}=e,s=t.datum;this.preventHidingAll&&this.contextMenuDatum?.enabled&&this.getVisibleItemCount()<=1?this.ctx.contextMenuRegistry.builtins.items["toggle-series-visibility"].enabled=!1:this.ctx.contextMenuRegistry.builtins.items["toggle-series-visibility"].enabled=!0;const n=this.ctx.chartService.series.length>1&&this.ctx.chartService.series[0]?.getLegendData("category")[0]?.hideToggleOtherSeries!==!0;this.ctx.contextMenuRegistry.setVisible("toggle-other-series",n);const{offsetX:r,offsetY:o}=i,{x:a,y:l}=Qe.toCanvasPoint(t,r,o);this.ctx.contextMenuRegistry.dispatchContext("legend-item",{widgetEvent:e,canvasX:a,canvasY:l},{legendItem:s})}onClick(e,t,i){this.doClick(e,t,i)&&e.preventDefault()}getVisibleItemCount(){return this.ctx.chartService.series.flatMap(e=>e.getLegendData("category")).filter(e=>e.enabled).length}doClick(e,t,i){const{listeners:{legendItemClick:s},ctx:{chartService:n,highlightManager:r},preventHidingAll:o,toggleSeries:a}=this;if(!t)return!1;const{legendType:l,seriesId:c,itemId:h,enabled:u}=t,d=n.series.find(y=>y.id===c);if(!d)return!1;let p=u;const f=mv("click",h,d.id,e);return s?.(f.apiEvent),f.defaultPrevented||(a&&(p=!u,o&&!p&&this.getVisibleItemCount()<2&&(p=!0),i.setChecked(p),this.ctx.chartEventManager.legendItemClick(l,d,h,p,t.legendItemName)),p?r.updateHighlight(this.id,{series:d,itemId:h,datum:void 0,datumIndex:void 0}):r.updateHighlight(this.id),this.ctx.legendManager.update(),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0,skipAnimations:t.skipAnimations??!1})),!0}onDoubleClick(e,t){this.doDoubleClick(e,t)&&e.preventDefault()}doDoubleClick(e,t){const{listeners:{legendItemDoubleClick:i},ctx:{chartService:s},toggleSeries:n}=this;if(!t)return!1;const{legendType:r,id:o,itemId:a,seriesId:l}=t,c=s.series.find(u=>u.id===o);if(!c)return!1;const h=mv("dblclick",a,c.id,e);if(i?.(h.apiEvent),h.defaultPrevented)return!0;if(n){const u=s.series.flatMap(y=>y.getLegendData("category"));let d=0;const p=new Set;for(const y of u)y.enabled&&(d+=1,y.legendItemName!=null&&p.add(y.legendItemName));p.size>0&&(d=p.size);const f=u.find(y=>y.itemId===a&&y.seriesId===l);this.ctx.chartEventManager.legendItemDoubleClick(r,c,a,f?.enabled??!1,d,f?.legendItemName)}return this.ctx.legendManager.update(),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),!0}toTooltipMeta(e,t){let i;return e instanceof FocusEvent?i=Qe.toCanvas(t).computeCenter():(e.preventDefault(),i=Qe.toCanvasPoint(t,e.offsetX,e.offsetY)),{canvasX:i.x,canvasY:i.y,showArrow:!1}}onHover(e,t){if(!this.enabled)throw new Error("AG Charts - onHover handler called on disabled legend");this.pagination.setPage(t.pageIndex);const i=t.datum,s=i?this.ctx.chartService.series.find(n=>n.id===i?.id):void 0;if(i&&this.truncatedItems.has(i.itemId??i.id)){const n=this.toTooltipMeta(e,t);this.ctx.tooltipManager.updateTooltip(this.id,n,[{type:"structured",title:this.getItemLabel(i)}])}else this.ctx.tooltipManager.removeTooltip(this.id);i?.enabled&&s?this.updateHighlight({series:s,itemId:i?.itemId,datum:void 0,datumIndex:void 0}):this.updateHighlight()}onLeave(){this.ctx.tooltipManager.removeTooltip(this.id),this.updateHighlight()}updateHighlight(e){this.ctx.interactionManager.isState(32)?this.ctx.highlightManager.updateHighlight(this.id,e):this.ctx.interactionManager.isState(2)&&(this.pendingHighlightDatum=e,this.ctx.animationManager.onBatchStop(()=>{this.ctx.highlightManager.updateHighlight(this.id,this.pendingHighlightDatum)}))}onLocaleChanged(){this.domProxy.onLocaleChanged(this.ctx.localeManager,this.itemSelection,this)}positionLegend(e){const t=this.positionLegendScene(e);this.positionLegendDOM(t)}positionLegendScene(e){if(!this.enabled||!this.data.length)return;const{layoutBox:t}=e,{x:i,y:s,width:n,height:r}=t,[o,a]=this.calculateLegendDimensions(t),{oldPages:l}=this.calcLayout(o,a),c=this.computePagedBBox(),h=()=>{switch(this.position){case"top":case"left":return 0;case"bottom":return r-c.height;case"right":default:return n-c.width}};if(this.visible){const u=this.spacing;let d,p;switch(this.position){case"top":case"bottom":d=(n-c.width)/2,p=h(),t.shrink(c.height+u,this.position);break;case"left":case"right":default:d=h(),p=(r-c.height)/2,t.shrink(c.width+u,this.position)}this.group.translationX=Math.floor(i+d-c.x),this.group.translationY=Math.floor(s+p-c.y)}return l}positionLegendDOM(e){const{ctx:t,itemSelection:i,pagination:s,pages:n,toggleSeries:r,group:o,listeners:{legendItemClick:a,legendItemDoubleClick:l}}=this,c=this.visible&&this.enabled,h=r||l!=null||a!=null;this.domProxy.update({visible:c,interactive:h,ctx:t,itemSelection:i,group:o,pagination:s,oldPages:e,newPages:n,datumReader:this,itemListener:this})}calculateLegendDimensions(e){const{width:t,height:i}=e,s=t/i,n=.5,r=.2,o=.25;let a,l;switch(this.position){case"top":case"bottom":{const c=s<1?Math.min(n,r*(1/s)):r;a=this.maxWidth?Math.min(this.maxWidth,t):t,l=this.maxHeight?Math.min(this.maxHeight,i):Math.round(i*c);break}case"left":case"right":default:{const c=s>1?Math.min(n,o*s):o;a=this.maxWidth?Math.min(this.maxWidth,t):Math.round(t*c),l=this.maxHeight?Math.min(this.maxHeight,i):i}}return[a,l]}cachedCallWithContext(e,...t){const{callbackCache:i,chartService:s}=this.ctx;return i.call(this,s,e,...t)}};pi.className="Legend",g([x],pi.prototype,"toggleSeries",2),g([x],pi.prototype,"pagination",2),g([x],pi.prototype,"item",2),g([x],pi.prototype,"listeners",2),g([Mn((e,t,i)=>{if(e.updateGroupVisibility(),t===i)return;const{ctx:{legendManager:s,stateManager:n}}=e;i===!1&&t===!0&&n.restoreState(s)}),x],pi.prototype,"enabled",2),g([x],pi.prototype,"position",2),g([x],pi.prototype,"maxWidth",2),g([x],pi.prototype,"maxHeight",2),g([x],pi.prototype,"reverseOrder",2),g([x],pi.prototype,"orientation",2),g([x],pi.prototype,"preventHidingAll",2),g([x],pi.prototype,"spacing",2);var c1={type:"legend",optionsKey:"legend",identifier:"category",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new pi(e),packageType:"community",removable:"standalone-only"},yv={};ji(yv,{CARTESIAN_AXIS_TYPE:()=>vv,CARTESIAN_POSITION:()=>xv,FONT_SIZE:()=>bv,FONT_SIZE_RATIO:()=>Sg,POLAR_AXIS_SHAPE:()=>Sv,POLAR_AXIS_TYPE:()=>Mv});var bv=(e=>(e[e.SMALLEST=8]="SMALLEST",e[e.SMALLER=10]="SMALLER",e[e.SMALL=12]="SMALL",e[e.MEDIUM=13]="MEDIUM",e[e.LARGE=14]="LARGE",e[e.LARGEST=17]="LARGEST",e))(bv||{}),Sg=(e=>(e[e.SMALLEST=.6666666666666666]="SMALLEST",e[e.SMALLER=.8333333333333334]="SMALLER",e[e.SMALL=1]="SMALL",e[e.MEDIUM=1.0833333333333333]="MEDIUM",e[e.LARGE=1.1666666666666667]="LARGE",e[e.LARGEST=1.4166666666666667]="LARGEST",e))(Sg||{}),xv=(e=>(e.TOP="top",e.RIGHT="right",e.BOTTOM="bottom",e.LEFT="left",e))(xv||{}),vv=(e=>(e.CATEGORY="category",e.GROUPED_CATEGORY="grouped-category",e.ORDINAL_TIME="ordinal-time",e.UNIT_TIME="unit-time",e.NUMBER="number",e.TIME="time",e.LOG="log",e))(vv||{}),Mv=(e=>(e.ANGLE_CATEGORY="angle-category",e.ANGLE_NUMBER="angle-number",e.RADIUS_CATEGORY="radius-category",e.RADIUS_NUMBER="radius-number",e))(Mv||{}),Sv=(e=>(e.CIRCLE="circle",e.POLYGON="polygon",e))(Sv||{}),Dg={};ji(Dg,{DEFAULT_ANNOTATION_HANDLE_FILL:()=>cl,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>dl,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>pl,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>gl,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>fl,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>hl,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>ul,DEFAULT_CAPTION_ALIGNMENT:()=>Pn,DEFAULT_CAPTION_LAYOUT_STYLE:()=>En,DEFAULT_FIBONACCI_STROKES:()=>al,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>mt,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>tt,DEFAULT_GRIDLINE_ENABLED:()=>ds,DEFAULT_POLAR_SERIES_STROKE:()=>Ph,DEFAULT_SEPARATION_LINES_COLOUR:()=>ol,DEFAULT_SHADOW_COLOUR:()=>On,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>Rh,DEFAULT_TEXTBOX_COLOR:()=>bl,DEFAULT_TEXTBOX_FILL:()=>ml,DEFAULT_TEXTBOX_STROKE:()=>yl,DEFAULT_TEXT_ANNOTATION_COLOR:()=>ll,DEFAULT_TOOLBAR_POSITION:()=>xl,IS_DARK_THEME:()=>Bo,PALETTE_ALT_DOWN_FILL:()=>kg,PALETTE_ALT_DOWN_STROKE:()=>Ag,PALETTE_ALT_NEUTRAL_FILL:()=>Cg,PALETTE_ALT_NEUTRAL_STROKE:()=>wg,PALETTE_ALT_UP_FILL:()=>Lg,PALETTE_ALT_UP_STROKE:()=>Ig,PALETTE_DOWN_FILL:()=>Nh,PALETTE_DOWN_STROKE:()=>wh,PALETTE_NEUTRAL_FILL:()=>Eh,PALETTE_NEUTRAL_STROKE:()=>Oh,PALETTE_UP_FILL:()=>Th,PALETTE_UP_STROKE:()=>Ch});var Bo=Symbol("is-dark-theme"),ol=Symbol("default-separation-lines-colour"),On=Symbol("default-shadow-colour"),En=Symbol("default-caption-layout-style"),Pn=Symbol("default-caption-alignment"),Ch=Symbol("palette-up-stroke"),wh=Symbol("palette-down-stroke"),Th=Symbol("palette-up-fill"),Nh=Symbol("palette-down-fill"),Oh=Symbol("palette-neutral-stroke"),Eh=Symbol("palette-neutral-fill"),Ig=Symbol("palette-alt-up-stroke"),Ag=Symbol("palette-alt-down-stroke"),Lg=Symbol("palette-alt-up-fill"),kg=Symbol("palette-alt-down-fill"),Cg=Symbol("palette-gray-fill"),wg=Symbol("palette-gray-stroke"),Ph=Symbol("default-polar-series-stroke"),Rh=Symbol("default-sparkline-crosshair-stroke"),tt=Symbol("default-financial-charts-annotation-stroke"),al=Symbol("default-hierarchy-strokes"),ll=Symbol("default-text-annotation-color"),mt=Symbol("default-financial-charts-annotation-background-fill"),cl=Symbol("default-annotation-handle-fill"),hl=Symbol("default-annotation-statistics-fill"),ul=Symbol("default-annotation-statistics-stroke"),dl=Symbol("default-annotation-statistics-color"),pl=Symbol("default-annotation-statistics-divider-stroke"),gl=Symbol("default-annotation-statistics-fill"),fl=Symbol("default-annotation-statistics-stroke"),ml=Symbol("default-textbox-fill"),yl=Symbol("default-textbox-stroke"),bl=Symbol("default-textbox-color"),xl=Symbol("default-toolbar-position"),ds=Symbol("default-gridline-enabled"),Dv=[{type:"number",position:{$if:[{$eq:[{$path:["/direction",void 0]},"horizontal"]},"bottom","left"]}},{type:"category",position:{$if:[{$eq:[{$path:["/direction",void 0]},"horizontal"]},"left","bottom"]}}],h1={$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isPattern:[{$palette:"fill"}]},{$isImage:[{$value:"$1"}]}]},{$palette:"fillFallback"},{$palette:"fill"}]},Tg={$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isPattern:[{$palette:"fill"}]},{$isImage:[{$value:"$1"}]}]},{$palette:"fillsFallback"},{$palette:"fills"}]},Fh={$if:[{$isGradient:[{$palette:"fill"}]},{$palette:"fillFallback"},{$if:[{$isPattern:[{$palette:"fill"}]},{$path:["./stroke",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},u1={$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isPattern:[{$palette:"fill"}]},{$isImage:[{$value:"$1"}]}]},[{$palette:"fillFallback"},{$palette:"fillFallback"}],{$palette:"range2"}]},Rn={type:"pattern",pattern:"forward-slanted-lines",width:10,height:10,padding:2,fill:{$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isImage:[{$palette:"fill"}]}]},{$palette:"fillFallback"},{$if:[{$isPattern:[{$palette:"fill"}]},{$path:["./fill",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},fillOpacity:1,stroke:Fh,strokeOpacity:1,strokeWidth:4,backgroundFill:"none",backgroundFillOpacity:1,rotation:0,scale:1},Dr={type:"image",backgroundFill:{$palette:"fillFallback"},backgroundFillOpacity:1,repeat:"no-repeat",fit:"contain",rotation:0};function wi(e){return Iy(e,t=>{const i=Oe.fromString(t);return[Oe.darken(i,.15).toString(),t,Oe.lighten(i,.15).toString()]})}var Ng=(O(),N(T));function _h(e,t,i,s,n){const{addPhaseFn:r,updatePhaseFn:o,removePhaseFn:a}=n,l=(c,h,u)=>{i.animate({id:`${e}_${t}_${h.id}_${c}`,groupId:e,from:0,to:1,ease:Pa,collapsable:!1,onUpdate(d,p){p&&c!=="removed"||(h.path.clear(!0),u(d,h),h.checkPathDirty())},onStop(){c==="added"&&(h.path.clear(!0),u(1,h),h.checkPathDirty())},phase:os[c]})};for(const c of s)i.isSkipped()||(l("removed",c,a),l("updated",c,o)),l("added",c,r)}function Ce({id:e},t,i,...s){for(const n of s)n.cleanup();Ks(e,t,i,s,{opacity:0},{opacity:1},{phase:"trailing"})}function Fn({id:e},t,i,...s){Ks(e,t,i,s,{opacity:1},{opacity:0},{phase:"remove"})}function tn(e){return{opacity:1}}var Og=class extends le{constructor(){super(...arguments),this._dirty=!0}markDirty(){this._dirty=!0}markClean(e){this._dirty=!1}isDirty(){return this._dirty}onChangeDetection(e){this.markDirty()}},ps=class extends Og{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};g([x,_()],ps.prototype,"enabled",2),g([x,_()],ps.prototype,"color",2),g([x,_()],ps.prototype,"xOffset",2),g([x,_()],ps.prototype,"yOffset",2),g([x,_()],ps.prototype,"blur",2);var sn=class extends le{constructor(){super(...arguments),this.fill="rgba(255,255,255, 0.33)",this.stroke="rgba(0, 0, 0, 0.4)",this.strokeWidth=2}};g([x],sn.prototype,"fill",2),g([x],sn.prototype,"fillOpacity",2),g([x],sn.prototype,"stroke",2),g([x],sn.prototype,"strokeWidth",2),g([x],sn.prototype,"strokeOpacity",2),g([x],sn.prototype,"lineDash",2),g([x],sn.prototype,"lineDashOffset",2);var jh=class extends le{};g([x],jh.prototype,"strokeWidth",2),g([x],jh.prototype,"dimOpacity",2),g([x],jh.prototype,"enabled",2);var Iv=class extends le{constructor(){super(...arguments),this.color="black"}};g([x],Iv.prototype,"color",2);var Eg=class extends le{constructor(){super(...arguments),this.enabled=!0}};g([x],Eg.prototype,"enabled",2);var Ki=class extends le{constructor(){super(...arguments),this.type="gradient",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.reverse=!1}};g([x],Ki.prototype,"type",2),g([x],Ki.prototype,"colorStops",2),g([x],Ki.prototype,"bounds",2),g([x],Ki.prototype,"gradient",2),g([x],Ki.prototype,"rotation",2),g([x],Ki.prototype,"reverse",2);var $e=class extends le{constructor(){super(...arguments),this.type="pattern",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.scale=1,this.reverse=!1,this.pattern="forward-slanted-lines",this.width=26,this.height=26,this.padding=6,this.fill="black",this.fillOpacity=1,this.backgroundFill="white",this.backgroundFillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0}};g([x],$e.prototype,"type",2),g([x],$e.prototype,"colorStops",2),g([x],$e.prototype,"bounds",2),g([x],$e.prototype,"gradient",2),g([x],$e.prototype,"rotation",2),g([x],$e.prototype,"scale",2),g([x],$e.prototype,"reverse",2),g([x],$e.prototype,"path",2),g([x],$e.prototype,"pattern",2),g([x],$e.prototype,"width",2),g([x],$e.prototype,"height",2),g([x],$e.prototype,"padding",2),g([x],$e.prototype,"fill",2),g([x],$e.prototype,"fillOpacity",2),g([x],$e.prototype,"backgroundFill",2),g([x],$e.prototype,"backgroundFillOpacity",2),g([x],$e.prototype,"stroke",2),g([x],$e.prototype,"strokeOpacity",2),g([x],$e.prototype,"strokeWidth",2);var gi=class extends le{constructor(){super(...arguments),this.type="image",this.url="",this.rotation=0,this.scale=1,this.backgroundFill="black",this.backgroundFillOpacity=1,this.repeat="no-repeat",this.fit="contain"}};g([x],gi.prototype,"type",2),g([x],gi.prototype,"url",2),g([x],gi.prototype,"rotation",2),g([x],gi.prototype,"scale",2),g([x],gi.prototype,"backgroundFill",2),g([x],gi.prototype,"backgroundFillOpacity",2),g([x],gi.prototype,"repeat",2),g([x],gi.prototype,"fit",2);var vl=class extends le{constructor(){super(...arguments),this.item=new sn,this.series=new jh,this.text=new Iv}};g([x],vl.prototype,"item",2),g([x],vl.prototype,"series",2),g([x],vl.prototype,"text",2);var Ti=class extends le{constructor(){super(...arguments),this.visible=!0,this.focusPriority=1/0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlight=new Eg,this.highlightStyle=new vl}handleUnknownProperties(e,t){"context"in t&&(this.context=t.context,e.delete("context"))}};g([x],Ti.prototype,"id",2),g([x],Ti.prototype,"visible",2),g([x],Ti.prototype,"focusPriority",2),g([x],Ti.prototype,"showInLegend",2),g([x],Ti.prototype,"cursor",2),g([x],Ti.prototype,"nodeClickRange",2),g([x],Ti.prototype,"highlight",2),g([x],Ti.prototype,"highlightStyle",2);var kt=class extends Og{constructor(){super(...arguments),this.enabled=!0,this.shape="circle",this.size=6,this.fillGradientDefaults=new Ki,this.fillPatternDefaults=new $e,this.fillImageDefaults=new gi,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(){const{size:e,shape:t,fill:i,fillOpacity:s,stroke:n,strokeWidth:r,strokeOpacity:o,lineDash:a,lineDashOffset:l}=this;return{size:e,shape:t,fill:i,fillOpacity:s,stroke:n,strokeWidth:r,strokeOpacity:o,lineDash:a,lineDashOffset:l}}getDiameter(){return this.size+this.strokeWidth}};g([x,_()],kt.prototype,"enabled",2),g([x,Ai({equals:eo})],kt.prototype,"shape",2),g([x,_()],kt.prototype,"size",2),g([x,Ai({equals:ii})],kt.prototype,"fill",2),g([x],kt.prototype,"fillGradientDefaults",2),g([x],kt.prototype,"fillPatternDefaults",2),g([x],kt.prototype,"fillImageDefaults",2),g([x,_()],kt.prototype,"fillOpacity",2),g([x,_()],kt.prototype,"stroke",2),g([x,_()],kt.prototype,"strokeWidth",2),g([x,_()],kt.prototype,"strokeOpacity",2),g([x],kt.prototype,"lineDash",2),g([x],kt.prototype,"lineDashOffset",2),g([x,Ai({equals:eo})],kt.prototype,"itemStyler",2);var Av=class extends le{constructor(){super(...arguments),this.enabled=!1}};g([x],Av.prototype,"enabled",2);var Qt=class extends le{constructor(){super(...arguments),this.interaction=new Av,this.position=new qs,this.range=void 0,this.class=void 0}formatTooltip(e,t,i,s){const n=this.renderer==null?void 0:Xc(e,t,this.renderer,[s]);return typeof n=="string"?{type:"raw",rawHtmlString:n}:n!=null?{type:"structured",...i,...n}:{type:"structured",...i}}};g([x],Qt.prototype,"enabled",2),g([x],Qt.prototype,"showArrow",2),g([x],Qt.prototype,"renderer",2),g([x],Qt.prototype,"interaction",2),g([x],Qt.prototype,"position",2),g([x],Qt.prototype,"range",2),g([x],Qt.prototype,"class",2);var Go=(O(),N(T)),d1=class{constructor(e,t,i){this.root=new f1(e,t,i)}clear(e){this.root.clear(e)}addValue(e,t){const i={hitTester:e,value:t,distanceSquared:(s,n)=>e.distanceSquared(s,n)};this.root.addElem(i)}find(e,t){const i={best:{nearest:void 0,distanceSquared:1/0}};return this.root.find(e,t,i),i.best}},p1=class{constructor(e,t,i,s){this.nw=e,this.ne=t,this.sw=i,this.se=s}addElem(e){this.nw.addElem(e),this.ne.addElem(e),this.sw.addElem(e),this.se.addElem(e)}find(e,t,i){this.nw.find(e,t,i),this.ne.find(e,t,i),this.sw.find(e,t,i),this.se.find(e,t,i)}},g1=class{constructor(e,t,i){this.capacity=e,this.maxdepth=t,this.boundary=i??U.NaN,this.elems=[],this.subdivisions=void 0}clear(e){this.elems.length=0,this.boundary=e,this.subdivisions=void 0}addElem(e){this.addCondition(e)&&(this.subdivisions===void 0?this.maxdepth===0||this.elems.length<this.capacity?this.elems.push(e):this.subdivide(e):this.subdivisions.addElem(e))}find(e,t,i){this.findCondition(e,t,i)&&(this.subdivisions===void 0?this.findAction(e,t,i):this.subdivisions.find(e,t,i))}subdivide(e){this.subdivisions=this.makeSubdivisions();for(const t of this.elems)this.subdivisions.addElem(t);this.subdivisions.addElem(e),this.elems.length=0}makeSubdivisions(){const{x:e,y:t,width:i,height:s}=this.boundary,{capacity:n}=this,r=this.maxdepth-1,o=i/2,a=s/2,l=new U(e,t,o,a),c=new U(e+o,t,o,a),h=new U(e,t+a,o,a),u=new U(e+o,t+a,o,a);return new p1(this.child(n,r,l),this.child(n,r,c),this.child(n,r,h),this.child(n,r,u))}},f1=class bD extends g1{addCondition(t){const{x:i,y:s}=t.hitTester.midPoint;return this.boundary.containsPoint(i,s)}findCondition(t,i,s){const{best:n}=s;return n.distanceSquared!==0&&this.boundary.distanceSquared(t,i)<n.distanceSquared}findAction(t,i,s){const n=mc(t,i,this.elems,s.best.distanceSquared);n.nearest!==void 0&&n.distanceSquared<s.best.distanceSquared&&(s.best=n)}child(t,i,s){return new bD(t,i,s)}},m1=(O(),N(T)),Pg=class extends yh{constructor({clipFocusBox:e,categoryKey:t,...i}){super(i),this.categoryKey=t,this.clipFocusBox=e??!0}getScaleInformation({xScale:e,yScale:t}){const i=Fe.is(e),s=Fe.is(t);return{isContinuousX:i,isContinuousY:s,xScaleType:e?.type,yScaleType:t?.type}}getModulePropertyDefinitions(){const e=this.axes.x?.scale,t=this.axes.y?.scale;return this.moduleMap.mapModules(i=>i.getPropertyDefinitions(this.getScaleInformation({xScale:e,yScale:t}))).flat()}async requestDataModel(e,t,i){i.props.push(...this.getModulePropertyDefinitions());const{dataModel:s,processedData:n}=await e.request(this.id,t??[],i);return this.dataModel=s,this.processedData=n,this.dispatch("data-processed",{dataModel:s,processedData:n}),{dataModel:s,processedData:n}}isProcessedDataAnimatable(){const e=this.processedData?.reduced?.animationValidation;if(!e)return!0;const{orderedKeys:t,uniqueKeys:i}=e;return t&&i}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}pickFocus(e){const t=this.getNodeData();if(t===void 0||t.length===0)return;const i=this.computeFocusDatumIndex(e,t);if(i===void 0)return;const{clipFocusBox:s}=this,n=t[i],r={...e,datumIndex:i},o=this.computeFocusBounds(r);if(o!==void 0)return{bounds:o,clipFocusBox:s,datum:n,datumIndex:i}}isDatumEnabled(e,t){const{missing:i=!1,enabled:s=!0,focusable:n=!0}=e[t];return!i&&s&&n}computeFocusDatumIndex(e,t){const i=(o,a)=>{for(;o>=0&&!this.isDatumEnabled(t,o);)o+=a;return o===-1?void 0:o},s=(o,a)=>{for(;o<t.length&&!this.isDatumEnabled(t,o);)o+=a;return o===t.length?void 0:o};let n;const r=(0,m1.clamp)(0,e.datumIndex,t.length-1);return e.datumIndexDelta<0?n=i(r,e.datumIndexDelta):e.datumIndexDelta>0?n=s(r,e.datumIndexDelta):n=s(r,1)??i(r,-1),n===void 0?e.datumIndexDelta===0?void 0:e.datumIndex-e.datumIndexDelta:n}keysOrValues(e){const t=this.dataModel.resolveProcessedDataIndexById(this,e);return this.processedData?.keys[t]?.get(this.id)??this.processedData?.columns[t]??[]}getCategoryKey(){return this.categoryKey}getCategoryValue(e){const{processedData:t,dataModel:i}=this,s=this.getCategoryKey();return!t||!i||!s||(t.invalidData?.get(this.id)?.[e]??!1)?void 0:this.keysOrValues(s)[e]}datumIndexForCategoryValue(e){const{processedData:t,dataModel:i}=this,s=this.getCategoryKey();if(!t||!i||!s)return;e=e.valueOf();const n=t.invalidData?.get(this.id),r=this.keysOrValues(s);for(let o=0;o<r.length;o+=1){if(n?.[o]===!0)continue;const a=r[o]?.valueOf();if(ii(e,a))return o}}},Ir={x:["xKey"],y:["yKey"]},Ar={x:["xName"],y:["yName"]},Rg=class extends Za{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.yKey=s.properties.yKey}},nn=class extends Ti{constructor(){super(...arguments),this.pickOutsideVisibleMinorAxis=!1}};g([x],nn.prototype,"legendItemName",2),g([x],nn.prototype,"pickOutsideVisibleMinorAxis",2);var zh=100,_n=class extends Pg{constructor({pathsPerSeries:e=["path"],hasMarkers:t=!1,hasHighlightedLabels:i=!1,pathsZIndexSubOrderOffset:s=[],datumSelectionGarbageCollection:n=!0,markerSelectionGarbageCollection:r=!0,animationAlwaysUpdateSelections:o=!1,animationResetFns:a,directionKeys:l,directionNames:c,...h}){if(super({directionKeys:l,directionNames:c,canHaveAxes:!0,...h}),this.NodeEvent=Rg,this.dataNodeGroup=this.contentGroup.appendChild(new ue({name:`${this.id}-series-dataNodes`,zIndex:0})),this.markerGroup=this.contentGroup.appendChild(new ue({name:`${this.id}-series-markers`,zIndex:1})),this.labelGroup=this.contentGroup.appendChild(new Ot({name:`${this.id}-series-labels`})),this.labelSelection=ht.select(this.labelGroup,St),this.highlightSelection=ht.select(this.highlightNode,()=>this.opts.hasMarkers?new Lt:this.nodeFactory()),this.highlightLabelSelection=ht.select(this.highlightLabel,St),this.annotationSelections=new Set,this.debug=ke.create(),!l||!c)throw new Error(`Unable to initialise series type ${this.type}`);this.opts={pathsPerSeries:e,hasMarkers:t,hasHighlightedLabels:i,pathsZIndexSubOrderOffset:s,directionKeys:l,directionNames:c,animationResetFns:a,animationAlwaysUpdateSelections:o,datumSelectionGarbageCollection:n,markerSelectionGarbageCollection:r},this.paths=e.map(u=>new oi({name:`${this.id}-${u}`})),this.datumSelection=ht.select(this.dataNodeGroup,()=>this.nodeFactory(),n),this.markerSelection=ht.select(this.markerGroup,Lt,r),this.animationState=new Va("empty",{empty:{update:{target:"ready",action:u=>this.animateEmptyUpdateReady(u)},reset:"empty",skip:"ready",disable:"disabled"},ready:{updateData:"waiting",clear:"clearing",highlight:u=>this.animateReadyHighlight(u),highlightMarkers:u=>this.animateReadyHighlightMarkers(u),resize:u=>this.animateReadyResize(u),reset:"empty",skip:"ready",disable:"disabled"},waiting:{update:{target:"ready",action:u=>{this.ctx.animationManager.isSkipped()?this.resetAllAnimation(u):this.animateWaitingUpdateReady(u)}},reset:"empty",skip:"ready",disable:"disabled"},disabled:{update:u=>this.resetAllAnimation(u),reset:"empty"},clearing:{update:{target:"empty",action:u=>this.animateClearingUpdateEmpty(u)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}get contextNodeData(){return this._contextNodeData}getNodeData(){return this.contextNodeData?.nodeData}attachSeries(e,t,i){super.attachSeries(e,t,i),this.attachPaths(this.paths,t,i)}detachSeries(e,t,i){super.detachSeries(e,t,i),this.detachPaths(this.paths,t,i)}updatedDomains(){this.animationState.transition("updateData")}attachPaths(e,t,i){for(const s of e)this.contentGroup.appendChild(s)}detachPaths(e,t,i){for(const s of e)this.contentGroup.removeChild(s)}renderToOffscreenCanvas(){const e=this.getNodeData();return e!=null&&e.length>zh}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"?this.animationState.transition("skip"):e==="disabled"&&this.animationState.transition("disable")}addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager.addListener("legend-item-click",e=>this.onLegendItemClick(e)),this.ctx.chartEventManager.addListener("legend-item-double-click",e=>this.onLegendItemDoubleClick(e)))}destroy(){super.destroy(),this._contextNodeData=void 0}update({seriesRect:e}){const{visible:t,_contextNodeData:i}=this,n=this.ctx.highlightManager?.getActiveHighlight()?.series===this,r=this.checkResize(e),o=this.updateHighlightSelection(n);this.updateSelections(t),this.updateNodes(o,n,t);const a=this.getAnimationData(e,i);a&&(r&&this.animationState.transition("resize",a),this.animationState.transition("update",a))}updateSelections(e){var t;const i=!this.opts.animationAlwaysUpdateSelections&&this.ctx.animationManager.isSkipped();if(!(!e&&i)&&!(!this.nodeDataRefresh&&!this.isPathOrSelectionDirty())){if(this.nodeDataRefresh){this.nodeDataRefresh=!1,this.debug("CartesianSeries.updateSelections() - calling createNodeData() for",this.id),this.markQuadtreeDirty(),this._contextNodeData=this.createNodeData();const s=this.isProcessedDataAnimatable();this._contextNodeData&&((t=this._contextNodeData).animationValid??(t.animationValid=s));const{dataModel:n,processedData:r}=this;n!==void 0&&r!==void 0&&this.dispatch("data-update",{dataModel:n,processedData:r})}this.updateSeriesSelections()}}updateSeriesSelections(e){const{datumSelection:t,labelSelection:i,markerSelection:s,paths:n}=this,r=this._contextNodeData;if(!r)return;const{nodeData:o,labelData:a,itemId:l}=r;this.updatePaths({seriesHighlighted:e,itemId:l,contextData:r,paths:n}),this.datumSelection=this.updateDatumSelection({nodeData:o,datumSelection:t}),this.labelSelection=this.updateLabelSelection({labelData:a,labelSelection:i})??i,this.opts.hasMarkers&&(this.markerSelection=this.updateMarkerSelection({nodeData:o,markerSelection:s}))}getShapeFillBBox(){const{axes:e}=this,t=e.x,i=e.y,[s,n]=Dt(t?.range??[0,1]),[r,o]=Dt(i?.range??[0,1]),a=this.getSeriesDomain("x"),l=[t?.scale.convert(a.at(0)),t?.scale.convert(a.at(-1))],c=this.getSeriesDomain("y"),h=[i?.scale.convert(c.at(0)),i?.scale.convert(c.at(-1))],[u,d]=Dt(l),[p,f]=Dt(h);return{axis:new U(s,r,n-s,o-r),series:new U(u,p,d-u,f-p)}}updateNodes(e,t,i){const{highlightSelection:s,highlightLabelSelection:n,opts:{hasMarkers:r,hasHighlightedLabels:o}}=this,a=!this.ctx.animationManager.isSkipped(),l=this.visible&&this._contextNodeData!=null&&i;this.contentGroup.visible=a||l,this.highlightGroup.visible=(a||l)&&t;const c=this.getOpacity();r?(this.updateMarkerNodes({markerSelection:s,isHighlight:!0}),this.animationState.transition("highlightMarkers",s)):(this.updateDatumNodes({datumSelection:s,isHighlight:!0}),this.animationState.transition("highlight",s)),o&&this.updateLabelNodes({labelSelection:n});const{dataNodeGroup:h,markerGroup:u,datumSelection:d,labelSelection:p,markerSelection:f,paths:y,labelGroup:b}=this,{itemId:m}=this.contextNodeData??{};h.opacity=c,h.visible=a||l,b.visible=l,r&&(u.opacity=c,u.visible=l),b&&(b.opacity=c),this.updatePathNodes({seriesHighlighted:t,itemId:m,paths:y,opacity:c,visible:l,animationEnabled:a}),h.visible&&(this.updateDatumNodes({datumSelection:d,highlightedItems:e,isHighlight:!1}),this.usesPlacedLabels||this.updateLabelNodes({labelSelection:p}),r&&this.updateMarkerNodes({markerSelection:f,isHighlight:!1}))}getHighlightLabelData(e,t){const i=e.filter(s=>s.datum===t.datum&&s.itemId===t.itemId);return i.length===0?void 0:i}getHighlightData(e,t){return t?[t]:void 0}updateHighlightSelection(e){const{highlightSelection:t,highlightLabelSelection:i,_contextNodeData:s}=this;if(!s)return;const n=this.ctx.highlightManager?.getActiveHighlight(),r=e&&n?.datum?n:void 0;let o,a;if(r!=null){const l=this.isLabelEnabled(),{labelData:c,nodeData:h}=s;a=this.getHighlightData(h,r),o=l?this.getHighlightLabelData(c,r):void 0}return this.highlightSelection=this.updateHighlightSelectionItem({items:a,highlightSelection:t}),this.highlightLabelSelection=this.updateHighlightSelectionLabel({items:o,highlightLabelSelection:i}),a}markQuadtreeDirty(){this.quadtree=void 0}*datumNodesIter(){for(const{node:e}of this.datumSelection)e.datum.missing!==!0&&(yield e)}getQuadTree(){if(this.quadtree===void 0){const{width:e,height:t}=this.ctx.scene.canvas,i=new U(0,0,e,t);this.quadtree=new d1(100,10,i),this.initQuadTree(this.quadtree)}return this.quadtree}initQuadTree(e){}pickNodesExactShape(e){const t=super.pickNodesExactShape(e);if(t.length!==0)return t;const{x:i,y:s}=e,{opts:{hasMarkers:n}}=this,{dataNodeGroup:r,markerGroup:o}=this;let a=r.pickNodes(i,s).filter(l=>l.datum.missing!==!0);if(a.length===0&&n&&(a=o?.pickNodes(i,s).filter(l=>l.datum.missing!==!0)),a.length!==0)return a.map(c=>c.datum);for(const l of this.moduleMap.modules()){const{datum:c}=l.pickNodeExact(e)??{};if(c!=null&&c?.missing!==!0)return[c]}return[]}pickNodeClosestDatum(e){const{x:t,y:i}=e,{axes:s,_contextNodeData:n}=this;if(!n)return;const r=s.x,o=s.y,a={x:t,y:i};let l=1/0,c;for(const h of n.nodeData){const{point:{x:u=NaN,y:d=NaN}={}}=h;if(isNaN(u)||isNaN(d)||!(r?.inRange(u)&&o?.inRange(d)))continue;const f=Math.max((a.x-u)**2+(a.y-d)**2,0);f<l&&(l=f,c=h)}for(const h of this.moduleMap.modules()){const u=h.pickNodeNearest(e);if(u!==void 0&&u.distanceSquared<l){l=u.distanceSquared,c=u.datum;break}}if(c){const h=Math.max(Math.sqrt(l)-(c.point?.size??0)/2,0);return{datum:c,distance:h}}}pickNodeMainAxisFirst(e,t){const{x:i,y:s}=e,{axes:n,_contextNodeData:r}=this,{pickOutsideVisibleMinorAxis:o}=this.properties;if(!r)return;const a=n.x,l=n.y,c=[a,l].filter(kn.is).map(f=>f.direction);if(t&&c.length===0)return;const[h="x"]=c,u=[i,s];h!=="x"&&u.reverse();const d=[1/0,1/0];let p;for(const f of r.nodeData){const{x:y=NaN,y:b=NaN}=f.point??f.midPoint??{};if(isNaN(y)||isNaN(b)||f.missing===!0)continue;const m=[a?.inRange(y),l?.inRange(b)];if(h!=="x"&&m.reverse(),!m[0]||!o&&!m[1])continue;const v=[y,b];h!=="x"&&v.reverse();let M=!0;for(let S=0;S<v.length;S++){const D=Math.abs(v[S]-u[S]);if(D>d[S]){M=!1;break}else D<d[S]&&(d[S]=D,d.fill(1/0,S+1,d.length))}M&&(p=f)}if(p){let f=Math.max(d[0]**2+d[1]**2-(p.point?.size??0),0);for(const y of this.moduleMap.modules()){const b=y.pickNodeMainAxisFirst(e);if(b!==void 0&&b.distanceSquared<f){p=b.datum,f=b.distanceSquared;break}}return{datum:p,distance:Math.sqrt(f)}}}isPathOrSelectionDirty(){return!1}shouldFlipXY(){return!1}visibleRange(e,t,i){const s=this.keysOrValues(e),n=0;return t0(i?.length??s.length,t,r=>{const o=i?.[r]??r;return this.xCoordinateRange(s[o],n,o)})}domainForVisibleRange(e,t,i,s,n,r){const{processedData:o,dataModel:a}=this,[l,c]=s,h=this.keysOrValues(i);if(n){const f=this.visibleRange(i,s,r);return a.getDomainBetweenRange(this,t,f,o)}const u=t.map(f=>this.keysOrValues(f));let d=1/0,p=-1/0;return h.forEach((f,y)=>{const[b,m]=this.xCoordinateRange(f,0,y);if(!(m<l||b>c))for(let v=0;v<t.length;v++){const M=u[v][y];d=Math.min(d,M),p=Math.max(p,M)}}),d>p?[NaN,NaN]:[d,p]}domainForClippedRange(e,t,i,s){const{processedData:n,dataModel:r,axes:o}=this,l=y1(o[e==="x"?"y":"x"]);if(!l)return t.flatMap(f=>r.getDomain(this,f,"value",n));const c=this.keysOrValues(i);if(s){const f=b1(c.length,l,y=>c[y]);return r.getDomainBetweenRange(this,t,f,n)}const h=t.map(f=>this.keysOrValues(f)),u=l[0].valueOf(),d=l[1].valueOf(),p=[];return c.forEach((f,y)=>{const b=f.valueOf();if(b<u||b>d)return;const m=h.map(v=>v[y]);b>=u&&p.push(...m),b<=d&&p.push(...m)}),p}countVisibleItems(e,t,i,s,n){const{dataModel:r,processedData:o}=this;if(!r||!o)return 1/0;const a=this.keysOrValues(e),l=t.map(D=>r.resolveColumnById(this,D,o)),c=this.axes.x,h=this.axes.y,u=this.shouldFlipXY(),d=c.range,p=h.range,f=(D,C,k)=>D[0]+(k-C[0])/(C[1]-C[0])*(D[1]-D[0]),y=f(d,c.visibleRange,i[0]),b=f(d,c.visibleRange,i[1]),m=f(p,h.visibleRange,u?s[0]:s[1]),v=f(p,h.visibleRange,u?s[1]:s[0]),M=Math.round((i[0]+(i[1]-i[0])/2)*a.length),S=0;return i0(0,a.length-1,M,n,D=>{let[C,k]=this.xCoordinateRange(a[D],S,D),[L,w]=this.yCoordinateRange(l.map(P=>P[D]),S,D);return!(0,Go.isFiniteNumber)(C)||!(0,Go.isFiniteNumber)(k)||!(0,Go.isFiniteNumber)(L)||!(0,Go.isFiniteNumber)(w)?!1:(u&&([C,k,L,w]=[L,w,C,k]),C>=y&&k<=b&&L>=m&&w<=v)})}updateHighlightSelectionItem(e){const{opts:{hasMarkers:t}}=this,{items:i,highlightSelection:s}=e,n=i??[];if(t){const r=s;return this.updateMarkerSelection({nodeData:n,markerSelection:r})}else return this.updateDatumSelection({nodeData:n,datumSelection:s})}updateHighlightSelectionLabel(e){return this.updateLabelSelection({labelData:e.items??[],labelSelection:e.highlightLabelSelection})}updateDatumSelection(e){return e.datumSelection}updateDatumNodes(e){}updateMarkerSelection(e){return e.markerSelection}updateMarkerNodes(e){}updatePaths(e){e.paths.forEach(t=>t.visible=!1)}updatePathNodes(e){const{paths:t,opacity:i,visible:s}=e;for(const n of t)n.opacity=i,n.visible=s}resetPathAnimation(e){const{path:t}=this.opts?.animationResetFns??{};t&&e.paths.forEach(i=>{It([i],t)})}resetDatumAnimation(e){const{datum:t}=this.opts?.animationResetFns??{};t&&It([e.datumSelection],t)}resetLabelAnimation(e){const{label:t}=this.opts?.animationResetFns??{};t&&It([e.labelSelection],t)}resetMarkerAnimation(e){const{marker:t}=this.opts?.animationResetFns??{};t&&this.opts.hasMarkers&&It([e.markerSelection],t)}resetAllAnimation(e){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.resetPathAnimation(e),this.resetDatumAnimation(e),this.resetLabelAnimation(e),this.resetMarkerAnimation(e),e.contextData?.animationValid===!1&&this.ctx.animationManager.skipCurrentBatch()}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateReadyHighlight(e){const{datum:t}=this.opts?.animationResetFns??{};t&&It([e],t)}animateReadyHighlightMarkers(e){const{marker:t}=this.opts?.animationResetFns??{};t&&It([e],t)}animateReadyResize(e){this.resetAllAnimation(e)}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}getAnimationData(e,t){const{_contextNodeData:i}=this;return i?{datumSelection:this.datumSelection,markerSelection:this.markerSelection,labelSelection:this.labelSelection,annotationSelections:[...this.annotationSelections],contextData:i,previousContextData:t,paths:this.paths,seriesRect:e}:void 0}updateLabelSelection(e){return e.labelSelection}getScaling(e){if(e instanceof bg){const{range:t,domain:i}=e;return{type:"log",convert:s=>e.convert(s),domain:[i[0],i[1]],range:[t[0],t[1]]}}else if(e instanceof Fe){const{range:t,domain:i}=e;return{type:"continuous",domain:[i[0],i[1]],range:[t[0],t[1]]}}else if(e instanceof za){const{domain:t}=e;return{type:"category",domain:t,inset:e.inset,step:e.step}}}calculateScaling(){const e={};for(const t of Object.values(Wd)){const i=this.axes[t];if(!i)continue;const s=this.getScaling(i.scale);s!=null&&(e[t]=s)}return e}};function y1(e){let t,i;if((e instanceof Js||e instanceof Yi)&&({min:t,max:i}=e),!(t==null&&i==null))return t??(t=-1/0),i??(i=1/0),[t,i]}function b1(e,t,i){const s=t[0].valueOf(),n=t[1].valueOf(),r=(0,Go.findMinIndex)(0,e-1,a=>{const l=i(a)?.valueOf();return!Number.isFinite(l)||l>=s});let o=(0,Go.findMaxIndex)(0,e-1,a=>{const l=i(a)?.valueOf();return!Number.isFinite(l)||l<=n});return r==null||o==null?[0,0]:(o=Math.min(o+1,e),[r,o])}var Vo=class extends le{constructor(){super(...arguments),this.type="linear",this.tension=1,this.position="end"}};g([x],Vo.prototype,"type",2),g([x],Vo.prototype,"tension",2),g([x],Vo.prototype,"position",2);var it=class extends nn{constructor(){super(...arguments),this.xName=void 0,this.fill="#c16068",this.fillGradientDefaults=new Ki,this.fillPatternDefaults=new $e,this.fillImageDefaults=new gi,this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new Vo,this.shadow=new ps,this.marker=new kt,this.label=new At,this.tooltip=new Qt,this.connectMissingData=!1}};g([x],it.prototype,"xKey",2),g([x],it.prototype,"xName",2),g([x],it.prototype,"yKey",2),g([x],it.prototype,"yName",2),g([x],it.prototype,"yFilterKey",2),g([x],it.prototype,"normalizedTo",2),g([x],it.prototype,"fill",2),g([x],it.prototype,"fillGradientDefaults",2),g([x],it.prototype,"fillPatternDefaults",2),g([x],it.prototype,"fillImageDefaults",2),g([x],it.prototype,"fillOpacity",2),g([x],it.prototype,"stroke",2),g([x],it.prototype,"strokeWidth",2),g([x],it.prototype,"strokeOpacity",2),g([x],it.prototype,"lineDash",2),g([x],it.prototype,"lineDashOffset",2),g([x],it.prototype,"interpolation",2),g([x],it.prototype,"shadow",2),g([x],it.prototype,"marker",2),g([x],it.prototype,"label",2),g([x],it.prototype,"tooltip",2),g([x],it.prototype,"connectMissingData",2);function Ns(e){switch(e.type){case"linear":case"step":return[{x:e.x0,y:e.y0},{x:e.x1,y:e.y1}];case"cubic":return[{x:e.cp0x,y:e.cp0y},{x:e.cp3x,y:e.cp3y}]}}function x1(e){const t=Ns(e);return t[0].x>t[1].x&&t.reverse(),t}function v1(e,t){const{x:i,y:s}=t;switch(e.type){case"linear":return{type:"linear",moveTo:e.moveTo,x0:i,y0:s,x1:i,y1:s};case"step":return{type:"step",moveTo:e.moveTo,x0:i,y0:s,x1:i,y1:s,stepX:i};case"cubic":return{type:"cubic",moveTo:e.moveTo,cp0x:i,cp0y:s,cp1x:i,cp1y:s,cp2x:i,cp2y:s,cp3x:i,cp3y:s}}}function Ml(e,t,i){const[s,n]=Ns(e),r=n.x!==s.x?(i.x-t.x)/(n.x-s.x):0,o=n.y!==s.y?(i.y-t.y)/(n.y-s.y):0;switch(e.type){case"linear":return{type:"linear",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:i.x,y1:i.y};case"cubic":return{type:"cubic",moveTo:e.moveTo,cp0x:t.x,cp0y:t.y,cp1x:i.x-(e.cp2x-s.x)*r,cp1y:i.y-(e.cp2y-s.y)*o,cp2x:i.x-(e.cp1x-s.x)*r,cp2y:i.y-(e.cp1y-s.y)*o,cp3x:i.x,cp3y:i.y};case"step":return{type:"step",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:i.x,y1:i.y,stepX:i.x-(e.stepX-s.x)*r}}}function Lv(e,t,i){const{moveTo:s}=e,[n,r]=x1(e),{x:o,y:a}=n,{x:l,y:c}=r;if(i<o)return Ml(e,n,n);if(t>l)return Ml(e,r,r);switch(e.type){case"linear":{const h=a===c?void 0:(c-a)/(l-o),u=h==null?a:h*(t-o)+a,d=h==null?a:h*(i-o)+a;return{type:"linear",moveTo:s,x0:t,y0:u,x1:i,y1:d}}case"step":if(i<=e.stepX){const h=e.y0;return{type:"step",moveTo:s,x0:t,y0:h,x1:i,y1:h,stepX:i}}else if(t>=e.stepX){const h=e.y1;return{type:"step",moveTo:s,x0:t,y0:h,x1:i,y1:h,stepX:t}}else{const{y0:h,y1:u,stepX:d}=e;return{type:"step",moveTo:s,x0:t,y0:h,x1:i,y1:u,stepX:d}}case"cubic":{const h=wc(e.cp0x,e.cp1x,e.cp2x,e.cp3x,t);let[u,d]=Tc(e.cp0x,e.cp0y,e.cp1x,e.cp1y,e.cp2x,e.cp2y,e.cp3x,e.cp3y,h);const p=wc(d[0].x,d[1].x,d[2].x,d[3].x,i);return[d,u]=Tc(d[0].x,d[0].y,d[1].x,d[1].y,d[2].x,d[2].y,d[3].x,d[3].y,p),{type:"cubic",moveTo:s,cp0x:d[0].x,cp0y:d[0].y,cp1x:d[1].x,cp1y:d[1].y,cp2x:d[2].x,cp2y:d[2].y,cp3x:d[3].x,cp3y:d[3].y}}}}function M1(e){const t=[];let i=0,s=NaN,n=NaN;for(const{x:r,y:o}of e){if(i>0){const a=i===1;t.push({type:"linear",moveTo:a,x0:s,y0:n,x1:r,y1:o})}i+=1,s=r,n=o}return t}var S1={start:0,middle:.5,end:1};function D1(e,t){const i=[];let s=0,n=NaN,r=NaN;const o=typeof t=="number"?t:S1[t];for(const{x:a,y:l}of e){if(s>0){const c=s===1,h=n+(a-n)*o;i.push({type:"step",moveTo:c,x0:n,y0:r,x1:a,y1:l,stepX:h})}s+=1,n=a,r=l}return i}var Bh=.05;function I1(e,t){const i=Array.isArray(e)?e:Array.from(e);if(i.length<=1)return[];const s=i.map((r,o)=>{const a=o===0?r:i[o-1],l=o===i.length-1?r:i[o+1],c=o===0||o===i.length-1;if(Math.sign(a.y-r.y)===Math.sign(l.y-r.y))return 0;if(!c){const h=Math.abs(a.y-l.y),u=Math.abs(r.y-a.y)/h,d=Math.abs(r.y-l.y)/h;if(u<=Bh||1-u<=Bh||d<=Bh||1-d<=Bh)return 0}return(l.y-a.y)/(l.x-a.x)});s[1]===0&&(s[0]*=2),s[s.length-2]===0&&(s[s.length-1]*=2);const n=[];for(let r=1;r<i.length;r+=1){const o=i[r-1],a=s[r-1],l=i[r],c=s[r],h=l.x-o.x,u=l.y-o.y;let d=h*t/3,p=h*a*t/3,f=h*t/3,y=h*c*t/3;c===0&&Math.abs(p)>Math.abs(u)&&(d*=Math.abs(u/p),p=Math.sign(p)*Math.abs(u)),a===0&&Math.abs(y)>Math.abs(u)&&(f*=Math.abs(u/y),y=Math.sign(y)*Math.abs(u)),n.push({type:"cubic",moveTo:r===1,cp0x:o.x,cp0y:o.y,cp1x:o.x+d,cp1y:o.y+p,cp2x:l.x-f,cp2y:l.y-y,cp3x:l.x,cp3y:l.y})}return n}function yt(e,t,i){return(t-e)*i+e}function A1(e,t){const{x0:i,y0:s,x1:n,y1:r}=e,a=(r-s)/(n-i)*(t-i)+s;return{leftCp1x:i,leftCp1y:s,leftCp2x:t,leftCp2y:a,stepX:t,stepY0:a,stepY1:a,rightCp1x:t,rightCp1y:a,rightCp2x:n,rightCp2y:r}}function L1(e,t){const{cp0x:i,cp0y:s,cp1x:n,cp1y:r,cp2x:o,cp2y:a,cp3x:l,cp3y:c}=e,h=wc(i,n,o,l,t),[u,d]=Tc(i,s,n,r,o,a,l,c,h),p=u[3].y;return{leftCp1x:u[1].x,leftCp1y:u[1].y,leftCp2x:u[2].x,leftCp2y:u[2].y,stepX:t,stepY0:p,stepY1:p,rightCp1x:d[1].x,rightCp1y:d[1].y,rightCp2x:d[2].x,rightCp2y:d[2].y}}function k1(e){const{x0:t,y0:i,x1:s,y1:n,stepX:r}=e;return{leftCp1x:(t+r)/2,leftCp1y:i,leftCp2x:(t+r)/2,leftCp2y:i,stepX:r,stepY0:i,stepY1:n,rightCp1x:(r+s)/2,rightCp1y:n,rightCp2x:(r+s)/2,rightCp2y:n}}function kv(e,t){return e.type==="linear"?A1(e,t):e.type==="cubic"?L1(e,t):k1(e)}function Cv(e,t,i,s,n,r,o){switch(t){case 0:o?e.moveTo(n,r):e.moveTo(i,s);break;case 1:o?e.lineTo(n,r):e.lineTo(i,s);break}}function wv(e,t,i,s,n,r){r?e.lineTo(t,i):e.lineTo(s,n)}function Tv(e,t,i,s,n,r,o,a,l,c){c?e.cubicCurveTo(r,o,s,n,t,i):e.cubicCurveTo(s,n,r,o,a,l)}function Nv(e,t,i,s,n,r,o){o?(e.lineTo(r,n),e.lineTo(r,i),e.lineTo(t,i)):(e.lineTo(r,i),e.lineTo(r,n),e.lineTo(s,n))}function Fg(e,t,i,s){const[n,r]=Ns(t);switch(Cv(e,i,n.x,n.y,r.x,r.y,s),t.type){case"linear":wv(e,t.x0,t.y0,t.x1,t.y1,s);break;case"cubic":Tv(e,t.cp0x,t.cp0y,t.cp1x,t.cp1y,t.cp2x,t.cp2y,t.cp3x,t.cp3y,s);break;case"step":Nv(e,t.x0,t.y0,t.x1,t.y1,t.stepX,s);break}}function Ov(e,t,i){const[s,n]=Ns(e),[r,o]=Ns(t),a=yt(s.x,r.x,i),l=yt(s.y,r.y,i),c=yt(n.x,o.x,i),h=yt(n.y,o.y,i);return[{x:a,y:l},{x:c,y:h}]}function _g(e,t,i,s,n,r){const[{x:o,y:a},{x:l,y:c}]=Ov(t,i,s);if(Cv(e,n,o,a,l,c,r),t.type==="cubic"&&i.type==="cubic"){const h=yt(t.cp1x,i.cp1x,s),u=yt(t.cp1y,i.cp1y,s),d=yt(t.cp2x,i.cp2x,s),p=yt(t.cp2y,i.cp2y,s);Tv(e,o,a,h,u,d,p,l,c,r)}else if(t.type==="step"&&i.type==="step"){const h=yt(t.stepX,i.stepX,s);Nv(e,o,a,l,c,h,r)}else if(t.type==="linear"&&i.type==="linear")wv(e,o,a,l,c,r);else{let h;t.type==="step"?h=t.stepX:i.type==="step"?h=i.stepX:h=(o+l)/2;const u=kv(t,h),d=kv(i,h),p=yt(u.leftCp1x,d.leftCp1x,s),f=yt(u.leftCp1y,d.leftCp1y,s),y=yt(u.leftCp2x,d.leftCp2x,s),b=yt(u.leftCp2y,d.leftCp2y,s),m=yt(u.stepX,d.stepX,s),v=yt(u.stepY0,d.stepY0,s),M=yt(u.stepY1,d.stepY1,s),S=yt(u.rightCp1x,d.rightCp1x,s),D=yt(u.rightCp1y,d.rightCp1y,s),C=yt(u.rightCp2x,d.rightCp2x,s),k=yt(u.rightCp2y,d.rightCp2y,s);r?(e.cubicCurveTo(C,k,S,D,m,M),e.lineTo(m,v),e.cubicCurveTo(y,b,p,f,o,a)):(e.cubicCurveTo(p,f,y,b,m,v),e.lineTo(m,M),e.cubicCurveTo(S,D,C,k,l,c))}}var Ev=(e=>(e[e.Zero=0]="Zero",e[e.Split=1]="Split",e))(Ev||{});function C1(e,t){return e==null||t==null||typeof e!="object"||typeof t!="object"?!1:"id"in e&&"id"in t?e.id===t.id:e.toString()===t.toString()}function Jt(e,t){if(!t)return NaN;if(e instanceof Date&&(e=e.getTime()),t.type==="continuous"&&typeof e=="number")return(e-t.domain[0])/(t.domain[1]-t.domain[0])*(t.range[1]-t.range[0])+t.range[0];if(t.type==="log"&&typeof e=="number")return t.convert(e);if(t.type!=="category")return NaN;let i=t.domain.findIndex(s=>s===e);return i===-1&&(i=t.domain.findIndex(s=>C1(e,s))),i>=0?t.inset+t.step*i:NaN}function Zi(e){return Wp(e).valueOf()}function Pv({data:e},t){return e.map((i,s)=>({xValue0Index:t.indexOf(Zi(i.xValue0)),xValue1Index:t.indexOf(Zi(i.xValue1)),datumIndex:s}))}function w1(e,t){const i=t.scales.x,s=e.scales.x;if(i?.type!=="category"||s?.type!=="category")return!0;let n=-1/0;for(const r of i.domain){const o=Jt(r,s);if(Number.isFinite(o)){if(o<n)return!1;n=o}}return!0}function T1(e,t){let i=-1/0;for(const s of e){const n=Jt(s.value,t.scales.x);if(Number.isFinite(n)){if(n<i)return!1;i=n}}return!0}function N1(e,t){const i=new Map;for(const{xValue0:h,xValue1:u}of e.data){const d=Zi(h),p=Zi(u);i.set(d,h).set(p,u)}const s=Array.from(i,([h,u])=>({axisValue:h,value:u}));s.sort((h,u)=>Jt(h.value,e.scales.x)-Jt(u.value,e.scales.x));const n=[];for(const{xValue0:h,xValue1:u}of t.data){const d=Zi(h),p=Zi(u);i.has(d)||(i.set(d,h),n.push({axisValue:d,value:h})),i.has(p)||(i.set(p,u),n.push({axisValue:p,value:u}))}n.sort((h,u)=>Jt(h.value,t.scales.x)-Jt(u.value,t.scales.x));const r=s;let o=0;for(const h of n){for(let u=r.length-1;u>o;u-=1){const d=Jt(h.value,t.scales.x),p=Jt(r[u].value,t.scales.x);if(d>p){o=u+1;break}}r.splice(o,0,h),o+=1}if(!T1(r,t))return;const a=r.map(h=>h.axisValue),l=Pv(t,a),c=Pv(e,a);return{axisValues:a,oldDataAxisIndices:l,newDataAxisIndices:c}}function Rv(e,t,i){if(i.xValue1Index===i.xValue0Index+1)return e;const s=Ns(e),n=(s[1].x-s[0].x)/(i.xValue1Index-i.xValue0Index),r=s[0].x+(t-i.xValue0Index)*n,o=r+n;return Lv(e,r,o)}function Fv(e,t){const[i,s]=Ns(e),n=Jt(0,t.scales.y);return Ml(e,{x:i.x,y:n},{x:s.x,y:n})}function _v(e){const[t,i]=Ns(e);return v1(e,{x:(t.x+i.x)/2,y:(t.y+i.y)/2})}function jv(e,t,i,s,n,r){let o,a;if(n.xValue0Index>=r.xValue1Index){const u=s.findLast(p=>p.xValue1Index<=r.xValue1Index)?.datumIndex,d=u!=null?i.data[u]:void 0;o=d?.xValue1,a=d?.yValue1}else if(n.xValue0Index<=r.xValue0Index){const u=s.find(p=>p.xValue0Index>=r.xValue0Index)?.datumIndex,d=u!=null?i.data[u]:void 0;o=d?.xValue0,a=d?.yValue0}if(o==null||a==null)switch(t){case 0:return Fv(e,i);case 1:return _v(e)}const l=Jt(o,i.scales.x),c=Jt(a,i.scales.y),h={x:l,y:c};return Ml(e,h,h)}function jg(e,t){if(t==null)return;const i=Zi(e.xValue0),s=Zi(e.xValue1);return t.find(n=>Zi(n.xValue0)===i&&Zi(n.xValue1)===s)?.span}function zv(e,t,i,s,n,r,o){const a=e.data[s.datumIndex],l=a.span,c=jg(a,n);if(c!=null)o.removed.push({from:c,to:c}),o.moved.push({from:c,to:l}),o.added.push({from:l,to:l});else{const h=jv(l,t,e,i,s,r);o.added.push({from:h,to:l})}}function Bv(e,t,i,s,n,r,o){const a=e.data[s.datumIndex],l=a.span,c=jg(a,n);if(c!=null)o.removed.push({from:l,to:l}),o.moved.push({from:l,to:c}),o.added.push({from:c,to:c});else{const h=jv(l,t,e,i,s,r);o.removed.push({from:l,to:h})}}function Gv(e,t,i,s,n){const r=t[n.xValue0Index],o=i.data.find(b=>Zi(b.xValue0)===r),a=t[n.xValue1Index],l=i.data.find(b=>Zi(b.xValue1)===a);if(o==null||l==null)return;const[{x:c},{x:h}]=Ns(e),u=Jt(o.xValue0,i.scales.x),d=Jt(o.yValue0,i.scales.y),p=Jt(l.xValue1,i.scales.x),f=Jt(l.yValue1,i.scales.y);let y=s.data[n.datumIndex].span;return y=Ml(y,{x:u,y:d},{x:p,y:f}),y=Lv(y,c,h),y}function O1(e,t,i,s,n,r,o,a,l){const c=n+1,h=o.find(M=>M.xValue0Index<=n&&M.xValue1Index>=c),u=r.find(M=>M.xValue0Index<=n&&M.xValue1Index>=c),d=t.zeroData,p=e.zeroData;if(h==null&&u!=null){zv(e,i,r,u,d,a,l);return}else if(h!=null&&u==null){Bv(t,i,o,h,p,a,l);return}else if(h==null||u==null)return;let f;h.xValue0Index===u.xValue0Index&&h.xValue1Index===u.xValue1Index?f=0:h.xValue0Index<=u.xValue0Index&&h.xValue1Index>=u.xValue1Index?f=-1:h.xValue0Index>=u.xValue0Index&&h.xValue1Index<=u.xValue1Index?f=1:f=0;const y=t.data[h.datumIndex],b=Rv(y.span,n,h),m=e.data[u.datumIndex],v=Rv(m.span,n,u);if(f===1){const M=Gv(b,s,t,e,u);M!=null?(l.removed.push({from:b,to:M}),l.moved.push({from:M,to:v}),l.added.push({from:v,to:v})):Bv(t,i,o,h,p,a,l)}else if(f===-1){const M=Gv(v,s,e,t,h);M!=null?(l.removed.push({from:b,to:b}),l.moved.push({from:b,to:M}),l.added.push({from:M,to:v})):zv(e,i,r,u,d,a,l)}else l.removed.push({from:b,to:b}),l.moved.push({from:b,to:v}),l.added.push({from:v,to:v})}function E1(e,t,i,s){const n={removed:[],moved:[],added:[]},{axisValues:r,oldDataAxisIndices:o,newDataAxisIndices:a}=e,l={xValue0Index:Math.max(o.at(0)?.xValue0Index??-1/0,a.at(0)?.xValue0Index??-1/0),xValue1Index:Math.min(o.at(-1)?.xValue1Index??1/0,a.at(-1)?.xValue1Index??1/0)};for(let c=0;c<r.length-1;c+=1)O1(t,i,s,r,c,a,o,l,n);return n}function Vv(e,t,i){const{span:s}=t;switch(i){case 0:return jg(t,e.zeroData)??Fv(s,e);case 1:return _v(s)}}function P1(e,t,i){const s=[],n=[];for(const r of t.data){const o=r.span,a=Vv(t,r,i);n.push({from:o,to:a})}for(const r of e.data){const o=r.span,a=Vv(e,r,i);s.push({from:a,to:o})}return{removed:n,moved:[],added:s}}function Sl(e,t,i){if(!w1(e,t))return;const s=N1(e,t);return s==null?P1(e,t,i):E1(s,e,t,i)}var zg=(O(),N(T));function Uv(e){return e.type==="continuous"||e.type==="log"}function Wv(e){return e.type==="category"}function Lr(e,t){return e===void 0||t===void 0?e!==void 0||t!==void 0:Uv(e)&&Uv(t)?e.type===t.type&&(0,zg.arraysEqual)(e.domain,t.domain)&&(0,zg.arraysEqual)(e.range,t.range):Wv(e)&&Wv(t)?e.inset===t.inset&&e.step===t.step&&(0,zg.arraysEqual)(e.domain,t.domain):!1}function Dl(e){return e==null?!1:e.type==="category"?e.domain.every(t=>t!=null):e.domain.every(t=>Number.isFinite(t)||t instanceof Date)&&e.range.every(t=>Number.isFinite(t))}function Gh(e,t){let i;const s=e.map(n=>n.point);switch(t.type){case"linear":i=M1(s);break;case"smooth":i=I1(s,t.tension);break;case"step":i=D1(s,t.position);break}return i.map((n,r)=>({span:n,xValue0:e[r].xDatum,yValue0:e[r].yDatum,xValue1:e[r+1].xDatum,yValue1:e[r+1].yDatum}))}function Hv(e,t,i=.001){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}function Bg({path:e},t){let i;for(const{span:s}of t){const[n,r]=Ns(s),o=i!=null&&Hv(i,n)?1:0;Fg(e,s,o,!1),i=r}}function Vh(e,t,i){let s;for(const n of i){const[r,o]=Ov(n.from,n.to,e),a=s!=null&&Hv(s,r)?1:0;_g(t.path,n.from,n.to,e,a,!1),s=o}}function Gg(e,t,i){const s=(a,l)=>Vh(a,l,t.removed),n=(a,l)=>Vh(a,l,t.moved),r=(a,l)=>Vh(a,l,t.added),o=Vg(e,i);return{status:e,path:{addPhaseFn:r,updatePhaseFn:n,removePhaseFn:s},pathProperties:o}}function Vg(e,t){const i=t==="none"?"updated":e,s={fromFn:n=>{let r;return e==="removed"?r={finish:{visible:!1}}:e==="added"?r={start:{visible:!0}}:r={},{phase:os[i],...r}},toFn:n=>({phase:os[i]})};return t==="fade"?{fromFn:n=>({opacity:e==="added"?0:n.opacity,...s.fromFn(n)}),toFn:n=>({opacity:e==="removed"?0:1,...s.toFn(n)})}:s}function Yv(e,t,i){const s=e.scales.x?.type==="category",n=t.scales.x?.type==="category";if(s!==n||!Dl(e.scales.x)||!Dl(t.scales.x)||e.strokeData==null||t.strokeData==null)return;let r="updated";t.visible&&!e.visible?r="removed":!t.visible&&e.visible&&(r="added");const o=Sl({scales:e.scales,data:e.strokeData.spans},{scales:t.scales,data:t.strokeData.spans},1);if(o==null)return;const a=Gg(r,o,"fade"),l=(i?.changed??!0)||!Lr(e.scales.x,t.scales.x)||!Lr(e.scales.y,t.scales.y)||r!=="updated";return{status:r,stroke:a,hasMotion:l}}function $v({path:e},{spans:t,phantomSpans:i}){for(let s=0;s<t.length;s+=1){const{span:n}=t[s],r=i[s].span;Fg(e,n,0,!1),Fg(e,r,1,!0),e.closePath()}}function Uh(e,{path:t},i,s){for(let n=0;n<i.length;n+=1){const r=i[n],o=s[n];_g(t,r.from,r.to,e,0,!1),_g(t,o.from,o.to,e,1,!0),t.closePath()}}function Kv(e,t,i,s){const n=(l,c)=>Uh(l,c,t.removed,i.removed),r=(l,c)=>Uh(l,c,t.moved,i.moved),o=(l,c)=>Uh(l,c,t.added,i.added),a=Vg(e,s);return{status:e,path:{addPhaseFn:o,updatePhaseFn:r,removePhaseFn:n},pathProperties:a}}function Zv(e,t){const i=e.scales.x?.type==="category",s=t.scales.x?.type==="category";if(i!==s||!Dl(e.scales.x)||!Dl(t.scales.x))return;let n="updated";t.visible&&!e.visible?n="removed":!t.visible&&e.visible&&(n="added");const r=Sl({scales:e.scales,data:e.fillData.spans},{scales:t.scales,data:t.fillData.spans},0);if(r==null)return;const o=Sl({scales:e.scales,data:e.fillData.phantomSpans},{scales:t.scales,data:t.fillData.phantomSpans},0);if(o==null)return;const a=Sl({scales:e.scales,data:e.strokeData.spans,zeroData:e.fillData.phantomSpans},{scales:t.scales,data:t.strokeData.spans,zeroData:t.fillData.phantomSpans},0);if(a==null)return;const l="none",c=Kv(n,r,o,l),h=Gg(n,a,l);return{status:n,fill:c,stroke:h}}var R1=(O(),N(T));function Il({id:e},t,i,...s){const n={phase:i?os[i]:"trailing"};Ks(e,"markers",t,s,{opacity:0},{opacity:1},n),s.forEach(r=>r.cleanup())}function Ug({id:e},t,...i){Ks(e,"markers",t,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"}),i.forEach(s=>s.cleanup())}function Wg({id:e,nodeDataDependencies:t},i,...s){const n=t.seriesRectWidth;Xe(e,"markers",i,s,{fromFn:(a,l)=>{const c=l.midPoint?.x??n;let h=(0,R1.clamp)(0,Gb(c/n),1);return isNaN(h)&&(h=0),{scalingX:0,scalingY:0,delay:h,duration:eh,phase:"initial"}},toFn:()=>({scalingX:1,scalingY:1})})}function Al(e){return{opacity:1,scalingX:1,scalingY:1}}function Ll(e,t){return{x:t.point?.x??NaN,y:t.point?.y??NaN,scalingCenterX:t.point?.x??NaN,scalingCenterY:t.point?.y??NaN}}function kl(e,{datumIndex:t}){const i=e.getNodeData();if(i===void 0)return;const s=i[t],{point:n}=s??{};if(s==null||n==null)return;const r=4+(n.focusSize??e.getFormattedMarkerStyle(s).size),o=r/2,a=s.point.x-o,l=s.point.y-o;return Qe.toCanvas(e.contentGroup,new U(a,l,r,r))}function Hg({id:e,visible:t,nodeDataDependencies:i},s,...n){const{seriesRectWidth:r,seriesRectHeight:o}=i;Ks(e,"path_properties",s,n,{clipX:0},{clipX:r},{phase:"initial",start:{clip:!0,clipY:o,visible:t},finish:{clip:!1,visible:t}})}function Wh({id:e},t,i,s="add",...n){Ks(e,t,i,n,{opacity:0},{opacity:1},{phase:s})}function Yg(e){return t=>({visible:e.getVisible(),opacity:e.getOpacity(),clipScalingX:1,clip:!1})}function Hh({nodeDataDependencies:e},t){const i=s=>isFinite(s)?s:0;t.clipX=i(e.seriesRectWidth),t.clipY=i(e.seriesRectHeight)}var F1=.125,_1=.25,Yh=class extends _n{constructor(e){super({moduleCtx:e,directionKeys:Ir,directionNames:Ar,categoryKey:"xValue",pathsPerSeries:["fill","stroke"],pathsZIndexSubOrderOffset:[0,1e3],hasMarkers:!0,markerSelectionGarbageCollection:!1,pickModes:[2,0],animationResetFns:{path:Yg({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:tn,marker:(t,i)=>({...Al(t),...Ll(t,i)})},clipFocusBox:!1}),this.properties=new it,this.connectsToYAxis=!0,this.backgroundGroup=new ue({name:`${this.id}-background`,zIndex:0}),this._isStacked=void 0}get pickModeAxis(){return"main"}renderToOffscreenCanvas(){return super.renderToOffscreenCanvas()||this.contextNodeData!=null&&(this.contextNodeData.fillData.spans.length>zh||this.contextNodeData.strokeData.spans.length>zh)}attachSeries(e,t,i){super.attachSeries(e,t,i),e.appendChild(this.backgroundGroup)}detachSeries(e,t,i){super.detachSeries(e,t,i),e?.removeChild(this.backgroundGroup)}attachPaths([e,t]){this.backgroundGroup.appendChild(e),this.contentGroup.appendChild(t),t.zIndex=-1}detachPaths([e,t]){this.backgroundGroup.removeChild(e),this.contentGroup.removeChild(t)}isStacked(){return(this.seriesGrouping?.stackCount??1)>1}setSeriesIndex(e){const t=this.isStacked();return!super.setSeriesIndex(e)&&this._isStacked===t?!1:(this._isStacked=t,t?(this.backgroundGroup.zIndex=[0,e],this.contentGroup.zIndex=[1,e,0]):(this.backgroundGroup.zIndex=[1,e,0,0],this.contentGroup.zIndex=[1,e,0,1]),!0)}async processData(e){if(this.data==null)return;const{data:t,visible:i,seriesGrouping:{groupIndex:s=this.id,stackCount:n=1}={}}=this,{xKey:r,yKey:o,yFilterKey:a,connectMissingData:l,normalizedTo:c}=this.properties,h=!this.ctx.animationManager.isSkipped(),u=this.axes.x?.scale,d=this.axes.y?.scale,{xScaleType:p,yScaleType:f}=this.getScaleInformation({xScale:u,yScale:d}),y={value:`area-stack-${s}-yValue`,values:`area-stack-${s}-yValues`,stack:`area-stack-${s}-yValue-stack`,marker:`area-stack-${s}-yValues-marker`},b=[];(0,Ng.isDefined)(c)&&b.push(Sh(Object.values(y),c)),h&&b.push(Eo());const m={invalidValue:null};((0,Ng.isDefined)(c)||l)&&n>1&&(m.invalidValue=0),i||(m.forceValue=0),await this.requestDataModel(e,t,{props:[hs(r,p,{id:"xValue"}),Me(o,f,{id:"yValueRaw",...m}),...a!=null?[Me(a,f,{id:"yFilterRaw"})]:[],...Qx(o,f,{id:"yValueStack",...m,groupId:y.stack}),Me(o,f,{id:"yValue",...m,groupId:y.value}),...Cn(o,"window","current",{id:"yValueEnd",...m,groupId:y.values},f),...Cn(o,"normal","current",{id:"yValueCumulative",...m,groupId:y.marker},f),...b],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}xCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes.x.scale.convert(e),n=i.enabled?.5*i.size*t:0;return[s-n,s+n]}yCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes.y.scale.convert(e[0]),n=i.enabled?.5*i.size*t:0;return[s-n,s+n]}getSeriesDomain(e){const{processedData:t,dataModel:i,axes:s}=this;if(!t||!i)return[];const n=s.y;if(e==="x"){const o=i.resolveProcessedDataDefById(this,"xValue"),a=i.getDomain(this,"xValue","key",t);return o?.def.type==="key"&&o.def.valueType==="category"?a:di(Qs(a))}const r=this.domainForClippedRange("y",["yValueCumulative"],"xValue",!0);if(n instanceof Ro||n instanceof Yi)return di(r);{const o=Number.isFinite(r[1]-r[0])?[r[0]>0?0:r[0],r[1]<0?0:r[1]]:[];return di(o)}}getSeriesRange(e,t){const[i,s]=this.domainForVisibleRange("y",["yValueCumulative"],"xValue",t,!0);return[Math.min(i,0),Math.max(s,0)]}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",["yValueCumulative"],e,t,i)}createNodeData(){const{axes:e,data:t,processedData:i,dataModel:s}=this,n=e.x,r=e.y;if(!n||!r||!t||!s||i?.type!=="grouped")return;const{yKey:o,xKey:a,yFilterKey:l,marker:c,label:h,fill:u,stroke:d,connectMissingData:p,interpolation:f}=this.properties,{scale:y}=n,{scale:b}=r,{isContinuousY:m}=this.getScaleInformation({xScale:y,yScale:b}),v=(y.bandwidth??0)/2,M=s.resolveKeysById(this,"xValue",i),S=s.resolveColumnById(this,"yValueEnd",i),D=s.resolveColumnById(this,"yValueRaw",i),C=s.resolveColumnById(this,"yValueCumulative",i),k=l!=null?s.resolveColumnById(this,"yFilterRaw",i):void 0,L=s.resolveColumnById(this,"yValueStack",i),w=(Z,te,B)=>{let q;return((0,Ng.isDefined)(this.properties.normalizedTo)?m&&dh(B):!isNaN(B))&&(q=te),{x:y.convert(Z)+v,y:b.convert(q),size:c.size}},P=[],R=[],{visibleSameStackCount:G}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);let Y=!1;const{dataSources:he}=i,se=he.get(this.id)??[];for(const{datumIndex:Z}of s.forEachGroupDatum(this,i)){const te=M[Z];if(te==null)return;const B=se[Z],q=D[Z],X=C[Z],fe=S[Z],Ie=Number.isFinite(q),Te=w(te,+X,q),qe=k!=null?k[Z]===q:void 0;if(qe===!1&&(Y=!0),Ie&&c&&R.push({series:this,itemId:o,datum:B,datumIndex:Z,midPoint:{x:Te.x,y:Te.y},cumulativeValue:fe,yValue:q,xValue:te,yKey:o,xKey:a,point:Te,fill:c.fill??u,stroke:c.stroke??d,strokeWidth:c.strokeWidth??this.getStrokeWidth(this.properties.strokeWidth),selected:qe}),Ie&&h){const Tt=this.getLabelText(h,{value:q,datum:B,xKey:a,yKey:o,xName:this.properties.xName,yName:this.properties.yName});P.push({series:this,itemId:o,datum:B,datumIndex:Z,x:Te.x,y:Te.y,labelText:Tt})}}const de=Z=>Z.flatMap(te=>Array.isArray(te)?Gh(te,f):new Array(te.skip).fill(null)),ge=(Z,te)=>({point:{x:y.convert(Z)+v,y:b.convert(te)},xDatum:Z,yDatum:te}),ye=Z=>{const te=[];for(const{datumIndexes:[B,q,X]}of s.forEachGroupDatumTuple(this,i)){const fe=M[q],Ie=L[q],Te=Ie[Z],qe=Number.isFinite(Te);if(p&&!qe)continue;const Tt=B!=null?L[B]:void 0,_t=X!=null?L[X]:void 0;let $t=0,ys=0;for(let ut=0;ut<=Z;ut+=1){const xi=Ie[ut];if(Number.isFinite(xi)){const Fi=Tt==null||Number.isFinite(Tt[ut]),om=_t==null||Number.isFinite(_t[ut]);Fi&&($t+=xi),om&&(ys+=xi)}}const li=te[te.length-1];if(!p&&($t!==ys||!qe))if(!qe&&Array.isArray(li)&&li.length===1)te[te.length-1]={skip:1};else{const ut=ge(fe,$t),xi=ge(fe,ys);Array.isArray(li)?li.push(ut):li!=null&&(li.skip+=1),te.push(qe?[xi]:{skip:0})}else{const ut=p?Te:Math.max($t,ys),xi=ge(fe,ut);Array.isArray(li)?li.push(xi):li!=null?(li.skip+=1,te.push([xi])):te.push([xi])}}return de(te)},J=this.seriesGrouping?.stackIndex??0,W=()=>{const Z=Array.from(s.forEachGroupDatum(this,i),({datumIndex:te})=>{const B=M[te],X=L[te][J];if(!(p&&!Number.isFinite(X)))return ge(B,0)}).filter(te=>te!=null);return Gh(Z,f)},V=ye(J),ee=V.map(()=>null);for(let Z=J-1;Z>=-1;Z-=1){let te;for(let B=0;B<ee.length;B+=1)ee[B]==null&&(te??(te=Z!==-1?ye(Z):W()),ee[B]=te[B])}const ie=V.map((Z,te)=>Z??ee[te]),ne=V.filter(Z=>Z!=null);return{itemId:o,fillData:{itemId:o,spans:ie,phantomSpans:ee},strokeData:{itemId:o,spans:ne},labelData:P,nodeData:R,scales:this.calculateScaling(),visible:this.visible,stackVisible:G>0,crossFiltering:Y}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(e){const{opacity:t,visible:i,animationEnabled:s}=e,[n,r]=e.paths,o=this.contextNodeData?.crossFiltering===!0,a=this.getStrokeWidth(this.properties.strokeWidth);r.setProperties({fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:1,stroke:this.properties.stroke,strokeWidth:a,strokeOpacity:this.properties.strokeOpacity*(o?_1:1),lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,opacity:t,visible:i||s});const l=mr(this.properties.fill,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults);yr(n,{fill:l,stroke:void 0,fillOpacity:this.properties.fillOpacity*(o?F1:1)},void 0,this.getShapeFillBBox()),n.setProperties({lineJoin:"round",pointerEvents:1,fillShadow:this.properties.shadow,opacity:t,visible:i||s}),Hh(this,r),Hh(this,n)}updatePaths(e){this.updateAreaPaths(e.paths,e.contextData)}updateAreaPaths(e,t){for(const i of e)i.visible=t.visible;if(t.visible)this.updateFillPath(e,t),this.updateStrokePath(e,t);else for(const i of e)i.path.clear(),i.markDirty("AreaSeries")}updateFillPath(e,t){const[i]=e;i.path.clear(),$v(i,t.fillData),i.markDirty("AreaSeries")}updateStrokePath(e,t){const{spans:i}=t.strokeData,[,s]=e;s.path.clear(),Bg(s,i),s.markDirty("AreaSeries")}updateMarkerSelection(e){const{nodeData:t,markerSelection:i}=e,s=this.properties.marker.enabled||this.contextNodeData?.crossFiltering===!0;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(s?t:[])}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i}=e,{xKey:s,yKey:n,marker:r,fill:o,stroke:a,strokeWidth:l,fillOpacity:c,strokeOpacity:h,highlightStyle:u}=this.properties,d=this.getSeriesDomain("x"),p=this.getSeriesDomain("y"),f=xe(i&&u.item,r.getStyle(),{fill:o,stroke:a,strokeWidth:l,fillOpacity:c,strokeOpacity:h}),y=this.getShapeFillBBox();t.each((b,m)=>{this.updateMarkerStyle(r,b,m.datum,m.point,Dn(m,s,n,d,p),i,f,y,{selected:m.selected})}),i||this.properties.marker.markClean()}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}updateLabelNodes(e){const{labelSelection:t}=e,{enabled:i,fontStyle:s,fontWeight:n,fontSize:r,fontFamily:o,color:a}=this.properties.label;t.each((l,c)=>{const{x:h,y:u,labelText:d}=c;d&&i&&this.visible?(l.fontStyle=s,l.fontWeight=n,l.fontSize=r,l.fontFamily=o,l.textAlign="center",l.textBaseline="bottom",l.text=d,l.x=h,l.y=u-10,l.fill=a,l.visible=!0):l.visible=!1})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:r}=this,{xKey:o,xName:a,yKey:l,yName:c,tooltip:h,marker:u}=r,d=n.x,p=n.y;if(!i||!s||!d||!p)return;const f=s.dataSources.get(this.id)?.[e],y=i.resolveKeysById(this,"xValue",s)[e],b=i.resolveColumnById(this,"yValueRaw",s)[e],{xDomain:m,yDomain:v}=this.cachedDatumCallback("domain",()=>({xDomain:this.getSeriesDomain("x"),yDomain:this.getSeriesDomain("y")}));if(y==null)return;const M=u.getStyle(),S={datum:f,xValue:y,yValue:b},D=this.getMarkerStyle(u,f,Dn(S,o,l,m,v),!1,void 0,M);return this.formatTooltipWithContext(h,{heading:d.formatDatum(y),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:p.formatDatum(b)}]},{seriesId:t,datum:f,title:c,xKey:o,xName:a,yKey:l,yName:c,...D,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:r,marker:o,fillGradientDefaults:a,fillPatternDefaults:l,fillImageDefaults:c}=this.properties,h=!o.enabled||o.fill===void 0,u=h?mr(e,a,l,c):mr(o.fill,o.fillGradientDefaults,o.fillPatternDefaults,o.fillImageDefaults);return{marker:{...this.getMarkerStyle(o,void 0,void 0,!1,void 0,{fill:u,fillOpacity:h?i:o.fillOpacity}),enabled:o.enabled||n<=0},line:{stroke:t,strokeOpacity:s,strokeWidth:n,lineDash:r}}}getLegendData(e){if(e!=="category")return[];const{id:t,ctx:{legendManager:i},visible:s}=this,{yKey:n,yName:r,legendItemName:o,showInLegend:a}=this.properties;return[{legendType:e,id:t,itemId:n,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:n}),label:{text:o??r??n},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!a}]}animateEmptyUpdateReady(e){const{markerSelection:t,labelSelection:i,contextData:s,paths:n}=e,{animationManager:r}=this.ctx;this.updateAreaPaths(n,s),Hg(this,r,...n),It([t],Ll),Wg(this,r,t),Ce(this,"labels",r,i)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateAreaPaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:t}=this.ctx,{markerSelection:i,labelSelection:s,contextData:n,paths:r,previousContextData:o}=e,[a,l]=r;if(a==null&&l==null)return;this.resetMarkerAnimation(e),this.resetLabelAnimation(e);const c=()=>{this.resetPathAnimation(e),this.updateAreaPaths(r,n)},h=()=>{t.skipCurrentBatch(),c()};if(n==null||o==null){c(),Il(this,t,"added",i),Wh(this,"fill_path_properties",t,"add",a),Wh(this,"stroke_path_properties",t,"add",l),Ce(this,"labels",t,s);return}if(n.crossFiltering!==o.crossFiltering){h();return}const u=Zv(n,o);if(u===void 0){h();return}else if(u.status==="no-op")return;Il(this,t,void 0,i),Xe(this.id,"fill_path_properties",t,[a],u.fill.pathProperties),_h(this.id,"fill_path_update",t,[a],u.fill.path),Xe(this.id,"stroke_path_properties",t,[l],u.stroke.pathProperties),_h(this.id,"stroke_path_update",t,[l],u.stroke.path),Ce(this,"labels",t,s),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(r,n)})}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new ue}getFormattedMarkerStyle(e){const{xKey:t,yKey:i}=e,s=this.getSeriesDomain("x"),n=this.getSeriesDomain("y");return this.getMarkerStyle(this.properties.marker,e.datum,Dn(e,t,i,s,n),!0)}computeFocusBounds(e){return kl(this,e)}};Yh.className="AreaSeries",Yh.type="area";var ei=(O(),N(T)),A=(O(),N(T)),F=(O(),N(T)),$g=(0,F.union)("millisecond","second","minute","hour","day","month","year"),jn=(0,F.attachDescription)(F.isValidNumberFormat,"a valid number format string"),kr={enabled:F.boolean,text:F.string,padding:F.number,...F.fontOptionsDef},Os=(0,F.attachDescription)({enabled:F.boolean,type:(0,F.required)((0,F.union)("line","range")),range:(0,F.and)((0,F.attachDescription)((e,{options:t})=>t.type==="range","crossLine type to be 'range'"),(0,F.arrayOf)(F.defined),(0,F.arrayLength)(2,2)),value:(0,F.and)((0,F.attachDescription)((e,{options:t})=>t.type==="line","crossLine type to be 'line'"),F.defined),label:kr,fill:F.string,fillOpacity:F.ratio,...F.strokeOptionsDef,...F.lineDashOptionsDef},"cross-line options"),rn={...Os,label:{...kr,position:(0,F.union)("top","left","right","bottom","top-left","top-right","bottom-left","bottom-right","inside","inside-left","inside-right","inside-top","inside-bottom","inside-top-left","inside-bottom-left","inside-top-right","inside-bottom-right"),rotation:F.number}},Cr={enabled:F.boolean,rotation:F.number,avoidCollisions:F.boolean,minSpacing:F.positiveNumber,spacing:F.positiveNumber,formatter:F.callback,itemStyler:(0,F.callbackDefs)({...F.fontOptionsDef,spacing:F.number}),...F.fontOptionsDef},Cl={autoRotate:F.boolean,autoRotateAngle:F.number,...Cr},Kg={format:jn,...Cl},wl={format:(0,F.or)(F.string,F.object),...Cl},Xv={enabled:F.boolean,width:F.positiveNumber,size:F.positiveNumber,stroke:F.color},$h={enabled:F.boolean,label:wl,tick:Xv},zn={reverse:F.boolean,gridLine:{enabled:F.boolean,width:F.positiveNumber,style:(0,F.arrayOfDefs)({stroke:(0,F.or)(F.color,F.themeOperator),lineDash:(0,F.arrayOf)(F.positiveNumber)},"a grid-line style object array")},interval:{values:(0,F.arrayOf)(F.defined),minSpacing:F.positiveNumber},label:Cr,line:{enabled:F.boolean,width:F.positiveNumber,stroke:F.color},tick:Xv};zn.context=(0,F.undocumented)(()=>!0),zn.layoutConstraints=(0,F.undocumented)({stacked:(0,F.required)(F.boolean),align:(0,F.required)((0,F.union)("start","end")),unit:(0,F.required)((0,F.union)("percent","px")),width:(0,F.required)(F.positiveNumber)});var on={...zn,keys:(0,F.arrayOf)(F.string),crossLines:(0,F.arrayOfDefs)(rn,"a cross-line options array"),position:(0,F.union)("top","right","bottom","left"),thickness:F.positiveNumber,title:{enabled:F.boolean,text:F.string,spacing:F.positiveNumber,formatter:F.callback,...F.fontOptionsDef}};on.title._enabledFromTheme=(0,F.undocumented)(F.boolean);function Bn(e){const t={enabled:F.boolean,xOffset:F.number,yOffset:F.number,renderer:(0,F.callbackOf)((0,F.or)(F.string,(0,F.optionsDefs)({text:F.string,color:F.color,backgroundColor:F.color,opacity:F.ratio},"crosshair label renderer result object")))};return e&&(t.format=F.string),{enabled:F.boolean,snap:F.boolean,label:t,...F.strokeOptionsDef,...F.lineDashOptionsDef}}function Gn(e,t){return{min:(0,F.and)(e,(0,F.lessThan)("max")),max:(0,F.and)(e,(0,F.greaterThan)("min")),nice:F.boolean,interval:{step:t?(0,F.or)(F.positiveNumberNonZero,$g,(0,F.instanceOf)(gt)):F.positiveNumberNonZero,values:(0,F.arrayOf)(e),minSpacing:(0,F.and)(F.positiveNumber,(0,F.lessThan)("maxSpacing")),maxSpacing:(0,F.and)(F.positiveNumber,(0,F.greaterThan)("minSpacing"))}}}var Kh=(0,A.or)((0,A.union)("circle","cross","diamond","heart","plus","pin","square","star","triangle"),A.callback),qv=(0,A.union)("never","always","hyphenate","on-space"),Zh=(0,A.union)("top","right","bottom","left","top-right","bottom-right","bottom-left","top-left","center"),Zg=(0,A.union)("pointer","node","top","right","bottom","left","top-left","top-right","bottom-left","bottom-right"),Xh=(0,A.or)(A.positiveNumber,(0,A.union)("exact","nearest")),Qv=(0,A.union)("pointer","start","middle","end"),qh={enabled:A.boolean,text:A.string,textAlign:(0,A.union)("left","center","right"),wrapping:(0,A.union)("never","always","hyphenate","on-space"),spacing:A.positiveNumber,maxWidth:A.positiveNumber,maxHeight:A.positiveNumber,...A.fontOptionsDef};qh.padding=(0,A.undocumented)(A.positiveNumber);var Qh={enabled:A.boolean,text:A.string,renderer:(0,A.callbackOf)((0,A.or)(A.string,A.htmlElement))},Xg=["defaults","download","zoom-to-cursor","pan-to-cursor","toggle-series-visibility","toggle-other-series","separator"],Jv={type:(0,A.union)("action","separator"),showOn:(0,A.union)("always","series-area","series-node","legend-item"),label:(0,A.required)(A.string),enabled:A.boolean,action:A.callback,items:(e,t)=>eM(e,t)};Jv.iconUrl=(0,A.undocumented)(A.string);var j1=(0,A.optionsDefs)(Jv),z1=(0,A.attachDescription)((e,t)=>{let i;return typeof e=="string"?Xg.includes(e)?i=!0:(i={valid:!1,invalid:[],cleared:null},i.invalid.push(new A.ValidationError(A.ErrorType.Invalid,`a context menu item string alias: ["${Xg.join('", "')}"]`,e,t.path))):i=j1(e,t),i},`a context menu item object or string alias: [${Xg.join(", ")}]`),eM=(0,A.arrayOf)(z1,"a menu items array",!1),Jh=(0,A.arrayOfDefs)({label:(0,A.required)(A.string),action:(0,A.required)(A.callback)},"a context menu actions array"),wr={label:A.string,ariaLabel:A.string,tooltip:A.string,icon:(0,A.union)("align-center","align-left","align-right","arrow-drawing","arrow-down-drawing","arrow-up-drawing","callout-annotation","candlestick-series","close","comment-annotation","date-range-drawing","date-price-range-drawing","delete","disjoint-channel-drawing","drag-handle","fill-color","line-style-solid","line-style-dashed","line-style-dotted","high-low-series","hlc-series","hollow-candlestick-series","horizontal-line-drawing","line-color","line-series","line-with-markers-series","locked","measurer-drawing","note-annotation","ohlc-series","pan-end","pan-left","pan-right","pan-start","parallel-channel-drawing","position-bottom","position-center","position-top","price-label-annotation","price-range-drawing","reset","settings","step-line-series","text-annotation","trend-line-drawing","fibonacci-retracement-drawing","fibonacci-retracement-trend-based-drawing","unlocked","vertical-line-drawing","zoom-in","zoom-out")},re={width:A.positiveNumber,height:A.positiveNumber,minWidth:A.positiveNumber,minHeight:A.positiveNumber,suppressFieldDotNotation:A.boolean,title:qh,subtitle:qh,footnote:qh,padding:{top:A.positiveNumber,right:A.positiveNumber,bottom:A.positiveNumber,left:A.positiveNumber},seriesArea:{clip:A.boolean,padding:{top:A.positiveNumber,right:A.positiveNumber,bottom:A.positiveNumber,left:A.positiveNumber}},legend:{enabled:A.boolean,position:(0,A.union)("top","right","bottom","left"),orientation:(0,A.union)("horizontal","vertical"),maxWidth:A.positiveNumber,maxHeight:A.positiveNumber,spacing:A.positiveNumber,preventHidingAll:A.boolean,reverseOrder:A.boolean,toggleSeries:A.boolean,item:{marker:{size:A.positiveNumber,shape:Kh,padding:A.positiveNumber,strokeWidth:A.positiveNumber},line:{length:A.positiveNumber,strokeWidth:A.positiveNumber},label:{maxLength:A.positiveNumber,formatter:A.callback,...A.fontOptionsDef},maxWidth:A.positiveNumber,paddingX:A.positiveNumber,paddingY:A.positiveNumber,showSeriesStroke:A.boolean},pagination:{marker:{size:A.positiveNumber,shape:Kh,padding:A.positiveNumber},activeStyle:{...A.fillOptionsDef,...A.strokeOptionsDef},inactiveStyle:{...A.fillOptionsDef,...A.strokeOptionsDef},highlightStyle:{...A.fillOptionsDef,...A.strokeOptionsDef},label:A.fontOptionsDef},listeners:{legendItemClick:A.callback,legendItemDoubleClick:A.callback}},gradientLegend:{enabled:A.boolean,position:(0,A.union)("top","right","bottom","left"),spacing:A.positiveNumber,reverseOrder:A.boolean,gradient:{preferredLength:A.positiveNumber,thickness:A.positiveNumber},scale:{label:{...A.fontOptionsDef,format:jn,formatter:A.callback},padding:A.positiveNumber,interval:{step:A.number,values:A.array,minSpacing:(0,A.and)(A.positiveNumber,(0,A.lessThan)("maxSpacing")),maxSpacing:(0,A.and)(A.positiveNumber,(0,A.greaterThan)("minSpacing"))}}},listeners:{seriesNodeClick:A.callback,seriesNodeDoubleClick:A.callback,seriesVisibilityChange:A.callback,click:A.callback,doubleClick:A.callback,annotations:A.callback,zoom:A.callback},loadGoogleFonts:A.boolean,highlight:{range:(0,A.union)("tooltip","node")},overlays:{loading:Qh,noData:Qh,noVisibleSeries:Qh,unsupportedBrowser:Qh},tooltip:{enabled:A.boolean,showArrow:A.boolean,pagination:A.boolean,delay:A.positiveNumber,range:Xh,wrapping:qv,mode:(0,A.union)("single","shared","compact"),position:{type:Zg,anchorTo:(0,A.union)("pointer","node","chart"),placement:(0,A.or)(Zh,(0,A.arrayOf)(Zh)),xOffset:A.number,yOffset:A.number}},animation:{enabled:A.boolean,duration:A.positiveNumber},contextMenu:{enabled:A.boolean,items:eM,extraActions:Jh,extraSeriesAreaActions:Jh,extraNodeActions:Jh,extraLegendItemActions:Jh},dataSource:{getData:A.callback},keyboard:{enabled:A.boolean,tabIndex:A.number},touch:{dragAction:(0,A.union)("none","drag","hover")},ranges:{enabled:A.boolean,buttons:(0,A.arrayOfDefs)({...wr,value:(0,A.or)(A.number,(0,A.and)((0,A.arrayOf)((0,A.or)(A.number,A.date)),(0,A.arrayLength)(2,2)),A.callback)},"range button options array")},locale:{localeText:A.object,getLocaleText:(0,A.callbackOf)(A.string)},background:{visible:A.boolean,fill:A.color,image:{url:(0,A.required)(A.string),top:A.number,right:A.number,bottom:A.number,left:A.number,width:A.positiveNumber,height:A.positiveNumber,opacity:A.ratio}},styleNonce:A.string,sync:{enabled:A.boolean,groupId:A.string,axes:(0,A.union)("x","y","xy"),nodeInteraction:A.boolean,zoom:A.boolean},zoom:{enabled:A.boolean,enableAxisDragging:A.boolean,enableDoubleClickToReset:A.boolean,enablePanning:A.boolean,enableScrolling:A.boolean,enableSelecting:A.boolean,enableTwoFingerZoom:A.boolean,keepAspectRatio:A.boolean,anchorPointX:Qv,anchorPointY:Qv,axes:(0,A.union)("x","y","xy"),deceleration:(0,A.or)((0,A.union)("off","short","long"),A.ratio),minVisibleItems:A.positiveNumber,minVisibleItemsX:A.positiveNumber,minVisibleItemsY:A.positiveNumber,panKey:(0,A.union)("alt","ctrl","meta","shift"),scrollingStep:A.ratio,autoScaling:{enabled:A.boolean,padding:A.ratio},buttons:{enabled:A.boolean,buttons:(0,A.arrayOfDefs)({...wr,value:(0,A.union)("reset","zoom-in","zoom-out","pan-left","pan-right","pan-start","pan-end"),section:A.string},"zoom button options array"),visible:(0,A.union)("always","zoomed","hover")}}};re.dataSource.requestThrottle=(0,A.undocumented)(A.positiveNumber),re.dataSource.updateThrottle=(0,A.undocumented)(A.positiveNumber),re.dataSource.updateDuringInteraction=(0,A.undocumented)(A.boolean),re.zoom.enableIndependentAxes=(0,A.undocumented)(A.boolean),re.statusBar=(0,A.undocumented)(A.defined),re.foreground=(0,A.undocumented)({visible:A.boolean,text:A.string,image:{url:A.string,top:A.number,right:A.number,bottom:A.number,left:A.number,width:A.positiveNumber,height:A.positiveNumber,opacity:A.ratio},...A.fillOptionsDef}),re.context=(0,A.undocumented)(()=>!0),re.overrideDevicePixelRatio=(0,A.undocumented)(A.number),re.sync.domainMode=(0,A.undocumented)((0,A.union)("direction","position","key"));var Se={cursor:A.string,showInLegend:A.boolean,nodeClickRange:Xh,listeners:{nodeClick:A.callback,nodeDoubleClick:A.callback},highlightStyle:{item:{...A.fillOptionsDef,...A.strokeOptionsDef},series:{enabled:A.boolean,dimOpacity:A.ratio,strokeWidth:A.positiveNumber}}},Ni={...Se,id:A.string,visible:A.boolean,data:A.array};Ni.context=(0,A.undocumented)(()=>!0),Ni.seriesGrouping=(0,A.undocumented)(A.defined),Ni.highlight=(0,A.undocumented)({enabled:A.boolean});var an={enabled:A.boolean,shape:Kh,size:A.positiveNumber,itemStyler:(0,A.callbackDefs)({...A.fillOptionsDef,...A.strokeOptionsDef,...A.lineDashOptionsDef,shape:Kh,size:A.positiveNumber}),...A.fillOptionsDef,...A.strokeOptionsDef,...A.lineDashOptionsDef},Pe={enabled:A.boolean,formatter:A.callback,...A.fontOptionsDef},Vn={...Pe,lineHeight:A.positiveNumber,minimumFontSize:A.positiveNumber,wrapping:qv,overflowStrategy:(0,A.union)("ellipsis","hide")},Tl={visible:A.boolean,cap:{visible:A.boolean,length:A.positiveNumber,lengthRatio:A.ratio,...A.strokeOptionsDef,...A.lineDashOptionsDef},...A.strokeOptionsDef,...A.lineDashOptionsDef},eu={...Tl,xLowerKey:A.string,xUpperKey:A.string,yLowerKey:A.string,yUpperKey:A.string,xLowerName:A.string,xUpperName:A.string,yLowerName:A.string,yUpperName:A.string,itemStyler:(0,A.callbackDefs)({visible:A.boolean,...A.strokeOptionsDef,...A.lineDashOptionsDef,cap:{visible:A.boolean,length:A.positiveNumber,lengthRatio:A.ratio,...A.strokeOptionsDef,...A.lineDashOptionsDef}})},Ae={enabled:A.boolean,showArrow:A.boolean,range:Xh,renderer:(0,A.callbackOf)((0,A.or)(A.string,(0,A.optionsDefs)({heading:A.string,title:A.string,data:(0,A.arrayOfDefs)({label:(0,A.required)(A.string),value:(0,A.required)(A.string)})},"tooltip renderer result object"))),position:{type:Zg,anchorTo:(0,A.union)("node","pointer","chart"),placement:(0,A.or)(Zh,(0,A.arrayOf)(Zh)),xOffset:A.number,yOffset:A.number},interaction:{enabled:A.boolean}};Ae.position._seriesOverrideType=(0,A.undocumented)(Zg);var Es={enabled:A.boolean,xOffset:A.number,yOffset:A.number,blur:A.positiveNumber,color:A.color},tu=(0,A.typeUnion)({linear:{},smooth:{tension:A.ratio},step:{position:(0,A.union)("start","middle","end")}},"interpolation line options"),tM={showInMiniChart:ei.boolean,connectMissingData:ei.boolean,interpolation:tu,label:Pe,marker:an,tooltip:Ae,shadow:Es,...Se,...ei.fillOptionsDef,...ei.strokeOptionsDef,...ei.lineDashOptionsDef},iM={...tM,...Ni,type:(0,ei.required)((0,ei.constant)("area")),xKey:(0,ei.required)(ei.string),yKey:(0,ei.required)(ei.string),xName:ei.string,yName:ei.string,stacked:ei.boolean,stackGroup:ei.string,normalizedTo:ei.number},B1={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"area",moduleFactory:e=>new Yh(e),stackable:!0,tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{nodeClickRange:"nearest",tooltip:{position:{_seriesOverrideType:"node"}},fill:{$palette:"fill"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:Rn,fillImageDefaults:Dr,stroke:{$palette:"stroke"},fillOpacity:.8,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:On,xOffset:3,yOffset:3,blur:5},interpolation:{type:"linear"},marker:{enabled:!1,shape:"circle",size:7,strokeWidth:0,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:Rn},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}}}},sM={type:"series",name:"area",chartType:"cartesian",options:iM,create:e=>new Yh(e)},$2=(O(),N(T)),G1=(O(),N(T)),V1=(O(),N(T)),U1=(O(),N(T));function qg(e,t){for(const i of t){const s=i.datum;s===void 0?U1.Logger.error("undefined datum"):e.addValue(i,s)}}function Qg(e,t){const{x:i,y:s}=t,{nearest:n,distanceSquared:r}=e.getQuadTree().find(i,s);if(n!==void 0)return{datum:n.value,distance:Math.sqrt(r)}}var Jg=class extends nn{constructor(){super(...arguments),this.direction="vertical"}};g([x],Jg.prototype,"direction",2);var nM=class extends _n{constructor(){super(...arguments),this.groupScale=new el,this.smallestDataInterval=void 0,this.largestDataInterval=void 0}padBandExtent(e,t){const i=typeof t=="boolean"?1:.5,s=(0,V1.isFiniteNumber)(this.smallestDataInterval)?this.smallestDataInterval*i:0,n=Qs(e)??[NaN,NaN];return typeof t=="boolean"?n[t?0:1]-=(t?1:-1)*s:(n[0]-=s,n[1]+=s),di(n)}getBandScalePadding(){return{inner:.3,outer:.15}}shouldFlipXY(){return!this.isVertical()}isVertical(){return this.properties.direction==="vertical"}getBarDirection(){return this.shouldFlipXY()?"x":"y"}getCategoryDirection(){return this.shouldFlipXY()?"y":"x"}getValueAxis(){const e=this.getBarDirection();return this.axes[e]}getCategoryAxis(){const e=this.getCategoryDirection();return this.axes[e]}getBandwidth(e,t){return Fe.is(e.scale)?e.scale.calcBandwidth(this.smallestDataInterval,t):e.scale.bandwidth}xCoordinateRange(e){const t=this.axes[this.getCategoryDirection()],i=t.scale,s=this.getBandwidth(t,0)??0,n=Fe.is(i)?s*-.5:0,r=i.convert(e)+n;return[r,r+s]}yCoordinateRange(e){const i=this.axes[this.getBarDirection()].scale,s=e.map(n=>i.convert(n));if(s.length===1){const n=i.convert(0);return[Math.min(s[0],n),Math.max(s[0],n)]}return[Math.min(...s),Math.max(...s)]}updateGroupScale(e){const t=[],{groupScale:i}=this,s=this.getBandwidth(e),{index:n,visibleGroupCount:r}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);for(let a=0;a<r;a++)t.push(String(a));return i.domain=t,i.range=[0,s??0],e instanceof Mr?i.paddingInner=e.groupPaddingInner:e instanceof kn?(i.paddingInner=e.groupPaddingInner,i.round=i.padding!==0):i.padding=0,{barWidth:i.bandwidth>=1?i.bandwidth:i.rawBandwidth,groupIndex:n}}resolveKeyDirection(e){return this.getBarDirection()==="x"?e==="x"?"y":"x":e}initQuadTree(e){qg(e,this.datumNodesIter())}pickNodeClosestDatum(e){return Qg(this,e)}},ef=class extends At{constructor(){super(...arguments),this.placement="inside-center",this.padding=0}};g([x],ef.prototype,"placement",2),g([x],ef.prototype,"padding",2);var We=class extends Jg{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new Ki,this.fillPatternDefaults=new $e,this.fillImageDefaults=new gi,this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.crisp=void 0,this.shadow=new ps,this.label=new ef,this.tooltip=new Qt,this.sparklineMode=!1,this.fastDataProcessing=!1}};g([x],We.prototype,"xKey",2),g([x],We.prototype,"xName",2),g([x],We.prototype,"yKey",2),g([x],We.prototype,"yName",2),g([x],We.prototype,"yFilterKey",2),g([x],We.prototype,"stackGroup",2),g([x],We.prototype,"normalizedTo",2),g([x],We.prototype,"fill",2),g([x],We.prototype,"fillGradientDefaults",2),g([x],We.prototype,"fillPatternDefaults",2),g([x],We.prototype,"fillImageDefaults",2),g([x],We.prototype,"fillOpacity",2),g([x],We.prototype,"stroke",2),g([x],We.prototype,"strokeWidth",2),g([x],We.prototype,"strokeOpacity",2),g([x],We.prototype,"lineDash",2),g([x],We.prototype,"lineDashOffset",2),g([x],We.prototype,"cornerRadius",2),g([x],We.prototype,"crisp",2),g([x],We.prototype,"itemStyler",2),g([x],We.prototype,"shadow",2),g([x],We.prototype,"label",2),g([x],We.prototype,"tooltip",2),g([x],We.prototype,"sparklineMode",2),g([x],We.prototype,"fastDataProcessing",2);var W1=(O(),N(T));function rM(e,t,i,s){if(t!=null){const[n,r]=t;if(n!==0||r!==1)return!1}if(Fe.is(e)){const n=e.calcBandwidth(s)-e.calcBandwidth(i);if(n>0&&n<1)return!1}return!0}var tf=e=>(0,W1.isNegative)(e.yValue??0);function Nl(e,t,i){const{startingX:s,startingY:n}=Y1(e,t);return{isVertical:e,calculate:(o,a)=>{let l=e?o.x:s,c=e?n:o.y,h=e?o.width:0,u=e?0:o.height;const{opacity:d=1}=o;a&&(isNaN(l)||isNaN(c))&&({x:l,y:c}=a,h=e?a.width:0,u=e?0:a.height,e&&!tf(a)?c+=a.height:!e&&tf(a)&&(l+=a.width));let p;return o.clipBBox==null?p=void 0:tf(o)?p=e?new U(l,c-u,h,u):new U(l-h,c,h,u):p=new U(l,c,h,u),{x:l,y:c,width:h,height:u,clipBBox:p,opacity:d}},mode:i}}function H1(e,t){return{isVertical:e,calculate:i=>({x:e?i.x:i.x+i.width/2,y:e?i.y+i.height/2:i.y,width:e?i.width:0,height:e?0:i.height,clipBBox:i.clipBBox,opacity:i.opacity??1}),mode:t}}function Ol(e){const t=r=>r==null||isNaN(r.x)||isNaN(r.y);return{toFn:(r,o,a)=>a==="removed"&&r.datum==null&&e.mode==="fade"?{...El(r,o),opacity:0}:a==="removed"||t(o)?e.calculate(o,r.previousDatum):{x:o.x,y:o.y,width:o.width,height:o.height,clipBBox:o.clipBBox,opacity:o.opacity??1},fromFn:(r,o,a)=>{a==="updated"&&t(o)?a="removed":a==="updated"&&t(r.previousDatum)&&(a="added");let l;a==="added"&&r.previousDatum==null&&e.mode==="fade"?l={...El(r,o),opacity:0}:a==="unknown"||a==="added"?l=e.calculate(o,r.previousDatum):l={x:r.x,y:r.y,width:r.width,height:r.height,clipBBox:r.clipBBox,opacity:r.opacity??1};const c=os[a];return{...l,phase:c}},applyFn:(r,o,a)=>{r.setProperties(o),r.crisp=a==="end"&&(r.datum?.crisp??!1)}}}function Y1(e,t){const i=t[e?"y":"x"];let s=1/0,n=0;return i?(e?n=i.scale.convert(Fe.is(i.scale)?0:Math.max(...i.range)):s=i.scale.convert(Fe.is(i.scale)?0:Math.min(...i.range)),{startingX:s,startingY:n}):{startingX:s,startingY:n}}function El(e,{x:t,y:i,width:s,height:n,clipBBox:r,opacity:o=1}){return{x:t,y:i,width:s,height:n,clipBBox:r,opacity:o,crisp:e.datum?.crisp??!1}}function sf(e,t){if(t===void 0)return;const{x:i,y:s,width:n,height:r}=t;return Qe.toCanvas(e.contentGroup,new U(i,s,n,r))}function nf(e,t,i,s,n,r){let o=r?.reduced?.diff?.[e];if(o?.changed)return o;const a=$1(s,n);return o==null&&r?.reduced?.diff!=null?(o={changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set},a?o.updated=new Set(Array.from(t,({datum:l})=>i(l))):o.added=new Set(Array.from(t,({datum:l})=>i(l)))):a&&(o={changed:!0,added:new Set,updated:new Set(Array.from(t,({datum:l})=>i(l))),removed:new Set,moved:new Set}),o}function oM(e){return typeof e=="object"&&e!==null&&"groupScale"in e}function $1(e,t){if(!t)return!1;const i=e.scales,s=t.scales;if(!Lr(i.x,s.x)||!Lr(i.y,s.y))return!0;if(!oM(e)||!oM(t))return!1;const n=e.groupScale,r=t.groupScale;return!Lr(n,r)}function aM(e,t,i){if(t.enabled&&i){const{x:s,y:n,text:r,textAlign:o,textBaseline:a}=i,{color:l,fontStyle:c,fontWeight:h,fontSize:u,fontFamily:d}=t;e.setProperties({visible:!0,x:s,y:n,text:r,fill:l,fontStyle:c,fontWeight:h,fontSize:u,fontFamily:d,textAlign:o,textBaseline:a})}else e.visible=!1}var K1={"inside-start":{inside:!0,direction:-1,textAlignment:1},"inside-end":{inside:!0,direction:1,textAlignment:-1},"outside-start":{inside:!1,direction:-1,textAlignment:-1},"outside-end":{inside:!1,direction:1,textAlignment:1}};function lM({isUpward:e,isVertical:t,placement:i,padding:s=0,rect:n}){let r=n.x+n.width/2,o=n.y+n.height/2,a="center",l="middle";if(i!=="inside-center"){const c=(e?1:-1)*(t?-1:1),{direction:h,textAlignment:u}=K1[i],d=(h+1)*.5;if(t){const p=e?n.y+n.height:n.y,f=n.height*c;o=p+f*d+s*u*c,l=u===c?"top":"bottom"}else{const p=e?n.x:n.x+n.width,f=n.width*c;r=p+f*d+s*u*c,a=u===c?"left":"right"}}return{x:r,y:o,textAlign:a,textBaseline:l}}var Z1=0,X1=1,q1=2,Q1=3,J1=4,Pl=class extends nM{constructor(e){super({moduleCtx:e,directionKeys:Ir,directionNames:Ar,categoryKey:"xValue",pickModes:[2,1,0],pathsPerSeries:[],hasHighlightedLabels:!0,datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:El,label:tn}}),this.properties=new We,this.connectsToYAxis=!0,this.dataAggregationFilters=void 0}get pickModeAxis(){return this.properties.sparklineMode?"main":void 0}crossFilteringEnabled(){return this.properties.yFilterKey!=null&&(this.seriesGrouping==null||this.seriesGrouping.stackIndex===0)}async processData(e){if(!this.data)return;const{xKey:t,yKey:i,yFilterKey:s,normalizedTo:n,fastDataProcessing:r}=this.properties,{seriesGrouping:{groupIndex:o=this.id}={},data:a}=this,l=this.seriesGrouping?.groupCount??0,h=(this.seriesGrouping?.stackCount??0)>=1||n!=null,u=!r||l>1||h,d=!this.ctx.animationManager.isSkipped(),p=this.getCategoryAxis()?.scale,f=this.getValueAxis()?.scale,{isContinuousX:y,xScaleType:b,yScaleType:m}=this.getScaleInformation({xScale:p,yScale:f}),v=`bar-stack-${o}-yValues`,M=`${v}-trailing`,S=this.visible?{}:{forceValue:0},D=[hs(t,b,{id:"xValue"}),Me(i,m,{id:"yValue-raw",invalidValue:null,...S})];this.crossFilteringEnabled()&&D.push(Me(s,m,{id:"yFilterValue",invalidValue:null,...S})),h&&D.push(...Cn(i,"normal","current",{id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:v,separateNegative:!0,...S},m),...Cn(i,"trailing","current",{id:"yValue-start",invalidValue:null,missingValue:0,groupId:M,separateNegative:!0,...S},m)),y&&D.push(Jx,ev),(0,G1.isFiniteNumber)(n)&&D.push(Sh([v,M],Math.abs(n))),d&&this.processedData&&D.push(Po(this.id,this.processedData)),(d||!u)&&D.push(Eo());const{dataModel:C,processedData:k}=await this.requestDataModel(e,a,{props:D,groupByKeys:u,groupByData:!u});this.dataAggregationFilters=this.aggregateData(C,k),this.smallestDataInterval=k.reduced?.smallestKeyInterval,this.largestDataInterval=k.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(i==null||t==null)return[];if(e===this.getCategoryDirection()){const o=i.resolveProcessedDataDefById(this,"xValue"),a=i.getDomain(this,"xValue","key",t);return o?.def.type==="key"&&o.def.valueType==="category"?a:this.padBandExtent(a)}const s=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw";let n=this.domainForClippedRange(e,[s],"xValue",!0);const r=this.crossFilteringEnabled()?i.getDomain(this,"yFilterValue","value",t):void 0;if(r!=null&&(n=[Math.min(n[0],r[0]),Math.max(n[1],r[1])]),this.getValueAxis()instanceof Ro)return di(n);{const o=Number.isFinite(n[1]-n[0])?[Math.min(0,n[0]),Math.max(0,n[1])]:[];return di(o)}}getSeriesRange(e,t){const i=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw",[s,n]=this.domainForVisibleRange("y",[i],"xValue",t,!0);return[Math.min(s,0),Math.max(n,0)]}getVisibleItems(e,t,i){const s=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw";return this.countVisibleItems("xValue",[s],e,t,i)}aggregateData(e,t){}createNodeData(){const{dataModel:e,processedData:t,groupScale:i,dataAggregationFilters:s}=this,n=this.getCategoryAxis(),r=this.getValueAxis();if(!e||!t||!n||!r)return;const o=t.dataSources?.get(this.id);if(o==null)return;const a=n.scale,l=r.scale,{xKey:c,yKey:h,xName:u,yName:d,legendItemName:p,label:f}=this.properties,y=r.isReversed(),{barWidth:b,groupIndex:m}=this.updateGroupScale(n),v=i.convert(String(m)),M=Fe.is(a)?b*-.5:0,S=e.resolveKeysById(this,"xValue",t),D=e.resolveColumnById(this,"yValue-raw",t),C=this.crossFilteringEnabled()?e.resolveColumnById(this,"yFilterValue",t):void 0,k=!this.ctx.animationManager.isSkipped(),L=W=>a.convert(S[W])+v+M,w=this.properties.crisp??rM(n?.scale,n?.visibleRange,this.smallestDataInterval,this.largestDataInterval),P=l.convert(0),R=({datum:W,datumIndex:V,valueIndex:ee,xValue:ie,yValue:ne,cumulativeValue:me,phantom:Z,currY:te,prevY:B,x:q,width:X,isPositive:fe,yRange:Ie,labelText:Te,opacity:qe,crossScale:Tt=1})=>{const _t=fe!==y,$t=l.convert(te),ys=l.convert(B),li=l.convert(Ie),ut=this.getBarDirection()==="x",xi=X*.5*(1-Tt),Fi={x:ut?Math.min($t,ys):q+xi,y:ut?q+xi:Math.min($t,ys),width:ut?Math.abs(ys-$t):X*Tt,height:ut?X*Tt:Math.abs(ys-$t)},om=new U(Fi.x,Fi.y,Fi.width,Fi.height),Nu={x:ut?Math.min(P,li):q+xi,y:ut?q+xi:Math.min(P,li),width:ut?Math.abs(P-li):X*Tt,height:ut?X*Tt:Math.abs(P-li)},eD=this.shouldFlipXY()?Fi.height:Fi.width;return{series:this,itemId:Z?Ci(h,Z):h,datum:W,datumIndex:V,valueIndex:ee,cumulativeValue:me,phantom:Z,xValue:ie,yValue:ne,yKey:h,xKey:c,capDefaults:{lengthRatioMultiplier:eD,lengthMax:eD},x:Nu.x,y:Nu.y,width:Nu.width,height:Nu.height,midPoint:{x:Fi.x+Fi.width/2,y:Fi.y+Fi.height/2},opacity:qe,topLeftCornerRadius:ut!==_t,topRightCornerRadius:_t,bottomRightCornerRadius:ut===_t,bottomLeftCornerRadius:!_t,clipBBox:om,crisp:w,label:Te!=null?{text:Te,...lM({isUpward:_t,isVertical:!ut,placement:f.placement,padding:f.padding,rect:Fi})}:void 0,missing:ne==null,focusable:!Z}},G=[],Y=[],he=[],se=(W,V,ee,ie,ne,me,Z,te)=>{const B=S[W];if(B==null)return;const q=D[W],X=C!=null?Number(C[W]):void 0,fe=q>=0&&!Object.is(q,-0);if(!Number.isFinite(me)||X!=null&&!Number.isFinite(X))return;const Ie=q!=null?this.getLabelText(this.properties.label,{datum:o[W],value:X??q,xKey:c,yKey:h,xName:u,yName:d,legendItemName:p}):void 0,Te=X!=null&&X>q,qe=R({datum:o[W],datumIndex:W,valueIndex:V,xValue:B,yValue:X??q,cumulativeValue:X??me,phantom:!1,currY:X!=null?ne+X:me,prevY:ne,x:ee,width:ie,isPositive:fe,yRange:Math.max(ne+(X??-1/0),Z),labelText:Ie,opacity:te,crossScale:Te?.6:void 0});if(Y.push(qe),he.push(qe),X!=null){const Tt=R({datum:o[W],datumIndex:W,valueIndex:V,xValue:B,yValue:X,cumulativeValue:X,phantom:!0,currY:me,prevY:ne,x:ee,width:ie,isPositive:fe,yRange:Z,labelText:void 0,opacity:te,crossScale:void 0});G.push(Tt)}},[de,ge]=a.range,ye=ge-de,J=s?.find(W=>W.maxRange>ye);if(t.type==="grouped"){const W=b,V=e.hasColumnById(this,"yValue-start"),ee=V?e.resolveColumnById(this,"yValue-start",t):void 0,ie=V?e.resolveColumnById(this,"yValue-end",t):void 0,ne=V?e.resolveProcessedDataIndexById(this,"yValue-range"):-1;for(const{datumIndex:me,valueIndex:Z,group:{aggregation:te}}of e.forEachGroupDatum(this,t)){const B=L(me),q=D[me],X=q>=0&&!Object.is(q,-0),fe=V?Number(ee?.[me]):0,Ie=V?Number(ie?.[me]):q;let Te=Ie;V&&(Te=te[ne][X?1:0]),se(me,Z,B,W,fe,Ie,Te,1)}}else if(J==null){const W=b;let[V,ee]=this.visibleRange("xValue",n.range);t.input.count<1e3&&(V=0,ee=t.input.count);for(let ie=V;ie<ee;ie+=1){const ne=L(ie),me=Number(D[ie]);se(ie,0,ne,W,0,me,me,1)}}else{const{indexData:W,indices:V}=J,[ee,ie]=this.visibleRange("xValue",n.range,V);for(let ne=ee;ne<ie;ne+=1){const me=ne*J1,Z=W[me+Z1],te=W[me+X1],B=W[me+q1],q=W[me+Q1];if(Z===-1)continue;const X=L((Z+te)/2|0),fe=Math.abs(L(te)-L(Z))+b,Ie=S[q]!=null?Number(D[q]):NaN,Te=S[B]!=null?Number(D[B]):NaN;if(Ie>0){const qe=Te>=0?Te/Ie:1;se(q,0,X,fe,0,Ie,Ie,qe)}if(Te<0){const qe=Ie<=0?Ie/Te:1;se(B,1,X,fe,0,Te,Te,qe)}}}return{itemId:h,nodeData:G.length>0?[...G,...Y]:Y,labelData:he,scales:this.calculateScaling(),visible:this.visible||k,groupScale:this.getScaling(this.groupScale)}}nodeFactory(){return new qt}getHighlightData(e,t){const i=e.find(s=>s.datum===t.datum&&!s.phantom);return i!=null?[i]:void 0}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>this.getDatumId(t))}getItemBaseStyle(e){const{properties:t}=this,{cornerRadius:i,fillGradientDefaults:s,fillPatternDefaults:n,fillImageDefaults:r}=t,o=e?t.highlightStyle.item:void 0;return ws({fill:o?.fill??t.fill,fillOpacity:o?.fillOpacity??t.fillOpacity,stroke:o?.stroke??t.stroke,strokeWidth:o?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:o?.strokeOpacity??t.strokeOpacity,lineDash:o?.lineDash??t.lineDash??[],lineDashOffset:o?.lineDashOffset??t.lineDashOffset,cornerRadius:i},s,n,r)}getItemStyleOverrides(e,t,i,s,n,r){const{id:o,properties:a}=this,{xKey:l,yKey:c,itemStyler:h,fillGradientDefaults:u,fillPatternDefaults:d,fillImageDefaults:p}=a;if(h==null)return;const{xDomain:f,yDomain:y}=this.cachedDatumCallback("domain",()=>({xDomain:this.getSeriesDomain("x"),yDomain:this.getSeriesDomain("y")})),b=this.cachedDatumCallback(Ci(e,r?"highlight":"node"),()=>this.callWithContext(h,{seriesId:o,...Dn(t,l,c,f,y),datum:t,xValue:i,yValue:s,highlighted:r,...n}));return ws(b,u,d,p)}updateDatumNodes(e){const{shadow:t}=this.properties,i=this.getCategoryDirection()==="x",s=this.getItemBaseStyle(e.isHighlight),n=this.getShapeFillBBox();e.datumSelection.each((r,o)=>{const a=this.getItemStyleOverrides(String(o.datumIndex),o.datum,o.xValue,o.yValue,s,e.isHighlight);r.opacity=o.opacity??0,yr(r,s,a,n);const l=a?.cornerRadius??s.cornerRadius;r.topLeftCornerRadius=o.topLeftCornerRadius?l:0,r.topRightCornerRadius=o.topRightCornerRadius?l:0,r.bottomRightCornerRadius=o.bottomRightCornerRadius?l:0,r.bottomLeftCornerRadius=o.bottomLeftCornerRadius?l:0,r.visible=i?(o.clipBBox?.width??o.width)>0:(o.clipBBox?.height??o.height)>0,r.crisp=o.crisp,r.fillShadow=t})}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t,i=>{i.pointerEvents=1})}updateLabelNodes(e){e.labelSelection.each((t,i)=>{aM(t,this.properties.label,i.label)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n}=this,{xKey:r,xName:o,yKey:a,yName:l,legendItemName:c,stackGroup:h,tooltip:u}=n,d=this.getCategoryAxis(),p=this.getValueAxis();if(!i||!s||!d||!p)return;const f=s.dataSources.get(this.id)?.[e],y=i.resolveKeysById(this,"xValue",s)[e],b=i.resolveColumnById(this,"yValue-raw",s)[e];if(y==null)return;const m=this.getItemBaseStyle(!1);return Object.assign(m,this.getItemStyleOverrides(String(e),f,y,b,m,!1)),this.formatTooltipWithContext(u,{heading:d.formatDatum(y),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:a,value:p.formatDatum(b)}]},{seriesId:t,datum:f,title:l,xKey:r,xName:o,yKey:a,yName:l,legendItemName:c,stackGroup:h,...m,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,fillOpacity:s,strokeOpacity:n,lineDash:r,lineDashOffset:o,fillGradientDefaults:a,fillPatternDefaults:l,fillImageDefaults:c}=this.properties;return{marker:ws({fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:s,strokeOpacity:n,strokeWidth:i,lineDash:r,lineDashOffset:o},a,l,c)}}getLegendData(e){const{showInLegend:t}=this.properties;if(e!=="category")return[];const{id:i,ctx:{legendManager:s},visible:n}=this,{yKey:r,yName:o,legendItemName:a}=this.properties;return[{legendType:"category",id:i,itemId:r,seriesId:i,enabled:n&&s.getItemEnabled({seriesId:i,itemId:r}),label:{text:a??o??r},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!t}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t,annotationSelections:i}){const s=Ol(Nl(this.isVertical(),this.axes,"normal"));Xe(this.id,"nodes",this.ctx.animationManager,[e],s),Ce(this,"labels",this.ctx.animationManager,t),Ce(this,"annotations",this.ctx.animationManager,...i)}animateWaitingUpdateReady(e){const{datumSelection:t,labelSelection:i,annotationSelections:s,contextData:n,previousContextData:r}=e;this.ctx.animationManager.stopByAnimationGroupId(this.id);const o=nf(this.id,t,this.getDatumId.bind(this),e.contextData,r,this.processedData),a=r==null?"fade":"normal",l=Ol(Nl(this.isVertical(),this.axes,a));Xe(this.id,"nodes",this.ctx.animationManager,[t],l,(c,h)=>this.getDatumId(h),o),(o?.changed||!Lr(n.groupScale,r?.groupScale))&&(Ce(this,"labels",this.ctx.animationManager,i),Ce(this,"annotations",this.ctx.animationManager,...s))}getDatumId(e){return Ci(e.xValue,e.valueIndex,e.phantom)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){const t=this.contextNodeData?.nodeData[e].clipBBox;return sf(this,t)}};Pl.className="BarSeries",Pl.type="bar";var De=(O(),N(T)),rf={direction:(0,De.union)("horizontal","vertical"),showInMiniChart:De.boolean,cornerRadius:De.positiveNumber,itemStyler:(0,De.callbackDefs)({...De.fillOptionsDef,...De.strokeOptionsDef,...De.lineDashOptionsDef,cornerRadius:De.positiveNumber}),crisp:De.boolean,label:{...Pe,placement:(0,De.union)("inside-center","inside-start","inside-end","outside-start","outside-end"),padding:De.positiveNumber},errorBar:Tl,shadow:Es,tooltip:Ae,...Se,...De.fillOptionsDef,...De.strokeOptionsDef,...De.lineDashOptionsDef};rf.sparklineMode=(0,De.undocumented)(De.boolean);var Rl={...rf,...Ni,type:(0,De.required)((0,De.constant)("bar")),xKey:(0,De.required)(De.string),yKey:(0,De.required)(De.string),xName:De.string,yName:De.string,direction:(0,De.union)("horizontal","vertical"),grouped:De.boolean,stacked:De.boolean,stackGroup:De.string,normalizedTo:De.number,legendItemName:De.string,errorBar:eu};Rl.pickOutsideVisibleMinorAxis=(0,De.undocumented)(De.boolean),Rl.fastDataProcessing=(0,De.undocumented)(De.boolean),Rl.focusPriority=(0,De.undocumented)(De.number);var cM={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bar",moduleFactory:e=>new Pl(e),stackable:!0,groupable:!0,tooltipDefaults:{range:"exact"},defaultAxes:Dv,themeTemplate:{series:{direction:"vertical",fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:Rn,fillImageDefaults:Dr,fillOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,label:{enabled:!1,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$if:[{$or:[{$eq:[{$path:"./placement"},"outside-start"]},{$eq:[{$path:"./placement"},"outside-end"]}]},{$ref:"textColor"},{$ref:"backgroundColor"}]},placement:"inside-center"},shadow:{enabled:!1,color:On,xOffset:3,yOffset:3,blur:5},errorBar:{cap:{lengthRatio:.3}}}}},hM={type:"series",name:"bar",chartType:"cartesian",options:Rl,create:e=>new Pl(e)},of=class extends kt{constructor(){super(...arguments),this.maxSize=30}};g([x,_()],of.prototype,"maxSize",2),g([x,bd()],of.prototype,"domain",2);var uM=class extends At{constructor(){super(...arguments),this.placement="top"}};g([x],uM.prototype,"placement",2);var _e=class extends nn{constructor(){super(...arguments),this.label=new uM,this.tooltip=new Qt,this.marker=new of}};g([x],_e.prototype,"xKey",2),g([x],_e.prototype,"yKey",2),g([x],_e.prototype,"sizeKey",2),g([x],_e.prototype,"labelKey",2),g([x],_e.prototype,"xFilterKey",2),g([x],_e.prototype,"yFilterKey",2),g([x],_e.prototype,"sizeFilterKey",2),g([x],_e.prototype,"xName",2),g([x],_e.prototype,"yName",2),g([x],_e.prototype,"sizeName",2),g([x],_e.prototype,"labelName",2),g([x],_e.prototype,"title",2),g([Ee("marker.shape")],_e.prototype,"shape",2),g([Ee("marker.size")],_e.prototype,"size",2),g([Ee("marker.maxSize")],_e.prototype,"maxSize",2),g([Ee("marker.domain")],_e.prototype,"domain",2),g([Ee("marker.fillGradientDefaults")],_e.prototype,"fillGradientDefaults",2),g([Ee("marker.fillPatternDefaults")],_e.prototype,"fillPatternDefaults",2),g([Ee("marker.fillImageDefaults")],_e.prototype,"fillImageDefaults",2),g([Ee("marker.fill")],_e.prototype,"fill",2),g([Ee("marker.fillOpacity")],_e.prototype,"fillOpacity",2),g([Ee("marker.stroke")],_e.prototype,"stroke",2),g([Ee("marker.strokeWidth")],_e.prototype,"strokeWidth",2),g([Ee("marker.strokeOpacity")],_e.prototype,"strokeOpacity",2),g([Ee("marker.lineDash")],_e.prototype,"lineDash",2),g([Ee("marker.lineDashOffset")],_e.prototype,"lineDashOffset",2),g([Ee("marker.itemStyler")],_e.prototype,"itemStyler",2),g([x],_e.prototype,"label",2),g([x],_e.prototype,"tooltip",2);var eO=class extends Rg{constructor(e,t,i,s){super(e,t,i,s),this.sizeKey=s.properties.sizeKey}},iu=class extends _n{constructor(e){super({moduleCtx:e,directionKeys:Ir,directionNames:Ar,categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{label:tn,marker:Al},usesPlacedLabels:!0,clipFocusBox:!1}),this.NodeEvent=eO,this.properties=new _e,this.sizeScale=new us}get pickModeAxis(){return"main-category"}async processData(e){if(this.data==null||!this.visible)return;const t=this.axes.x?.scale,i=this.axes.y?.scale,{xScaleType:s,yScaleType:n}=this.getScaleInformation({xScale:t,yScale:i}),r=this.sizeScale.type,{xKey:o,yKey:a,sizeKey:l,xFilterKey:c,yFilterKey:h,sizeFilterKey:u,labelKey:d,marker:p}=this.properties,{dataModel:f,processedData:y}=await this.requestDataModel(e,this.data,{props:[Me(o,s,{id:"xValue"}),Me(a,n,{id:"yValue"}),...c!=null?[Me(c,s,{id:"xFilterValue"})]:[],...h!=null?[Me(h,n,{id:"yFilterValue"})]:[],...u!=null?[Me(u,r,{id:"sizeFilterValue"})]:[],Me(l,r,{id:"sizeValue"}),...d?[Me(d,"band",{id:"labelValue"})]:[]]}),b=f.resolveProcessedDataIndexById(this,"sizeValue"),m=p.domain?[p.domain[0],p.domain[1]]:void 0;this.sizeScale.domain=m??y.domain.values[b]??[],this.animationState.transition("updateData")}xCoordinateRange(e,t,i){const{properties:s,sizeScale:n}=this,{size:r,sizeKey:o}=s,a=this.axes.x.scale.convert(e),l=o!=null?this.dataModel.resolveColumnById(this,"sizeValue",this.processedData):void 0,h=.5*(l!=null?n.convert(l[i]):r)*t;return[a-h,a+h]}yCoordinateRange(e,t,i){const{properties:s,sizeScale:n}=this,{size:r,sizeKey:o}=s,a=this.axes.y.scale.convert(e[0]),l=o!=null?this.dataModel.resolveColumnById(this,"sizeValue",this.processedData):void 0,h=.5*(l!=null?n.convert(l[i]):r)*t;return[a-h,a+h]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];const s={x:"xValue",y:"yValue"},n=s[e],r=t.resolveProcessedDataDefById(this,n),o=t.getDomain(this,n,"value",i);if(r?.def.type==="value"&&r?.def.valueType==="category")return o;const l=s[e==="x"?"y":"x"],c=this.domainForClippedRange(e,[n],l,!1);return di(Qs(c))}getSeriesRange(e,t){return this.domainForVisibleRange("y",["yValue"],"xValue",t,!1)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",["yValue"],e,t,i)}createNodeData(){const{axes:e,dataModel:t,processedData:i,sizeScale:s,visible:n}=this,{xKey:r,yKey:o,sizeKey:a,xFilterKey:l,yFilterKey:c,sizeFilterKey:h,labelKey:u,xName:d,yName:p,sizeName:f,labelName:y,label:b,marker:m}=this.properties,{placement:v}=b,M=Lt.anchor(m.shape),S=e.x,D=e.y;if(!(t&&i&&n&&S&&D))return;const C=t.resolveColumnById(this,"xValue",i),k=t.resolveColumnById(this,"yValue",i),L=a!=null?t.resolveColumnById(this,"sizeValue",i):void 0,w=u!=null?t.resolveColumnById(this,"labelValue",i):void 0,P=l!=null?t.resolveColumnById(this,"xFilterValue",i):void 0,R=c!=null?t.resolveColumnById(this,"yFilterValue",i):void 0,G=h!=null?t.resolveColumnById(this,"sizeFilterValue",i):void 0,Y=S.scale,he=D.scale,se=(Y.bandwidth??0)/2,de=(he.bandwidth??0)/2,ge=[];s.range=[m.size,m.maxSize];const ye=b.getFont(),J=As.getMeasurer({font:ye});return i.dataSources.get(this.id)?.forEach((W,V)=>{const ee=C[V],ie=k[V],ne=L?.[V],me=Y.convert(ee)+se,Z=he.convert(ie)+de;let te;P!=null&&R!=null&&(te=P[V]===ee&&R[V]===ie,G!=null&&te&&(te=G[V]===ne));const B=this.getLabelText(b,{value:w!=null?w[V]:ie,datum:W,xKey:r,yKey:o,sizeKey:a,labelKey:u,xName:d,yName:p,sizeName:f,labelName:y}),q=J.measureText(String(B)),X=ne!=null?s.convert(ne):m.size;ge.push({series:this,itemId:o,yKey:o,xKey:r,datum:W,datumIndex:V,xValue:ee,yValue:ie,sizeValue:ne,point:{x:me,y:Z,size:X},midPoint:{x:me,y:Z},label:{text:B,...q},anchor:M,placement:v,selected:te})}),{itemId:o,nodeData:ge,labelData:ge,scales:this.calculateScaling(),visible:this.visible}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}updateMarkerSelection(e){const{nodeData:t,markerSelection:i}=e;this.properties.marker.isDirty()&&(i.clear(),i.cleanup());const s=this.properties.marker.enabled?t:[];return i.update(s,void 0,n=>Ci([n.xValue,n.yValue,n.sizeValue,n.label.text]))}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i}=e,{xKey:s,yKey:n,sizeKey:r,labelKey:o,marker:a}=this.properties,l=xe(i&&this.properties.highlightStyle.item,a.getStyle());this.sizeScale.range=[a.size,a.maxSize];const c=this.getShapeFillBBox();t.each((h,u)=>{this.updateMarkerStyle(a,h,u.datum,u.point,{xKey:s,yKey:n,sizeKey:r,labelKey:o},i,l,c,{selected:u.selected})}),i||this.properties.marker.markClean()}updatePlacedLabelData(e){this.labelSelection.update(e.map(t=>({...t.datum,point:{x:t.x,y:t.y,size:t.datum.point.size}})),t=>{t.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(e){const{label:t}=this.properties;e.labelSelection.each((i,s)=>{i.text=s.label.text,i.fill=t.color,i.x=s.point?.x??0,i.y=s.point?.y??0,i.fontStyle=t.fontStyle,i.fontWeight=t.fontWeight,i.fontSize=t.fontSize,i.fontFamily=t.fontFamily,i.textAlign="left",i.textBaseline="top"})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:r}=this,{xKey:o,xName:a,yKey:l,yName:c,sizeKey:h,sizeName:u,labelKey:d,labelName:p,title:f,tooltip:y,marker:b}=r,m=n.x,v=n.y;if(!i||!s||!m||!v)return;const M=s.dataSources.get(this.id)?.[e],S=i.resolveColumnById(this,"xValue",s)[e],D=i.resolveColumnById(this,"yValue",s)[e],C=this.contextNodeData?.nodeData[e];if(S==null||C==null)return;const k=[{label:a,fallbackLabel:o,value:m.formatDatum(S)},{label:c,fallbackLabel:l,value:v.formatDatum(D)}];if(h!=null){const P=i.resolveColumnById(this,"sizeValue",s)[e];k.push({label:u,fallbackLabel:h,value:String(P)})}const L=b.getStyle(),w=this.getMarkerStyle(b,M,{xKey:o,yKey:l,sizeKey:h,labelKey:d,highlighted:!0},!1,void 0,L);return this.formatTooltipWithContext(y,{title:f,symbol:this.legendItemSymbol(),data:k},{seriesId:t,datum:M,title:l,xKey:o,xName:a,yKey:l,yName:c,sizeKey:h,sizeName:u,labelKey:d,labelName:p,...w,...this.getModuleTooltipParams()})}legendItemSymbol(){return{marker:this.getMarkerStyle(this.properties.marker)}}getLegendData(){const{id:e,ctx:{legendManager:t},visible:i}=this,{yKey:s,yName:n,title:r}=this.properties;return[{legendType:"category",id:e,itemId:s,seriesId:e,enabled:i&&t.getItemEnabled({seriesId:e,itemId:s}),label:{text:r??n??s},symbol:this.legendItemSymbol()}]}animateEmptyUpdateReady({markerSelection:e,labelSelection:t}){Ug(this,this.ctx.animationManager,e),Ce(this,"labels",this.ctx.animationManager,t)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new ue}getFormattedMarkerStyle(e){const{xKey:t,yKey:i,sizeKey:s,labelKey:n,marker:r}=this.properties;return this.getMarkerStyle(r,e,{xKey:t,yKey:i,sizeKey:s,labelKey:n},!1,e.point.size)}computeFocusBounds(e){return kl(this,e)}};iu.className="BubbleSeries",iu.type="bubble";var Ct=(O(),N(T)),dM={title:Ct.string,domain:(0,Ct.arrayOf)(Ct.number),maxSize:Ct.positiveNumber,showInMiniChart:Ct.boolean,label:{placement:(0,Ct.union)("top","right","bottom","left"),...Pe},tooltip:Ae,...Se,...H(an,["enabled"])},tO={...dM,...Ni,type:(0,Ct.required)((0,Ct.constant)("bubble")),xKey:(0,Ct.required)(Ct.string),yKey:(0,Ct.required)(Ct.string),sizeKey:(0,Ct.required)(Ct.string),labelKey:Ct.string,xName:Ct.string,yName:Ct.string,sizeName:Ct.string,labelName:Ct.string},iO={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bubble",moduleFactory:e=>new iu(e),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{shape:"circle",size:7,maxSize:30,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:Rn,fillImageDefaults:Dr,fillOpacity:.8,tooltip:{position:{_seriesOverrideType:"node"}},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}}}},pM={type:"series",name:"bubble",chartType:"cartesian",options:tO,create:e=>new iu(e)},af=(O(),N(T)),st=class extends nn{constructor(){super(...arguments),this.fillGradientDefaults=new Ki,this.fillPatternDefaults=new $e,this.fillImageDefaults=new gi,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.areaPlot=!1,this.aggregation="sum",this.shadow=new ps,this.label=new At,this.tooltip=new Qt}};g([x],st.prototype,"xKey",2),g([x],st.prototype,"yKey",2),g([x],st.prototype,"xName",2),g([x],st.prototype,"yName",2),g([x],st.prototype,"fill",2),g([x],st.prototype,"fillGradientDefaults",2),g([x],st.prototype,"fillPatternDefaults",2),g([x],st.prototype,"fillImageDefaults",2),g([x],st.prototype,"fillOpacity",2),g([x],st.prototype,"stroke",2),g([x],st.prototype,"strokeWidth",2),g([x],st.prototype,"strokeOpacity",2),g([x],st.prototype,"lineDash",2),g([x],st.prototype,"lineDashOffset",2),g([x],st.prototype,"cornerRadius",2),g([x],st.prototype,"areaPlot",2),g([x],st.prototype,"bins",2),g([x],st.prototype,"aggregation",2),g([x],st.prototype,"binCount",2),g([x],st.prototype,"shadow",2),g([x],st.prototype,"label",2),g([x],st.prototype,"tooltip",2);var gM=10,su=class extends _n{constructor(e){super({moduleCtx:e,directionKeys:Ir,directionNames:Ar,categoryKey:void 0,pickModes:[1,0],datumSelectionGarbageCollection:!1,animationResetFns:{datum:El,label:tn}}),this.properties=new st,this.calculatedBins=[]}deriveBins(e){const t=Ua(e[0],e[1],gM).ticks,i=Wa(e[0],e[1],gM),[s]=t,n=r=>[r,r+i];return[[s-i,s],...t.map(n)]}calculateNiceBins(e,t){const i=Math.floor(e[0]),s=e[1],n=t||1,{start:r,binSize:o}=this.calculateNiceStart(i,s,n);return this.getBins(r,s,o,n)}getBins(e,t,i,s){const n=[],r=this.calculatePrecision(i);for(let o=0;o<s;o++){const a=Math.round((e+o*i)*r)/r;let l=Math.round((e+(o+1)*i)*r)/r;o===s-1&&(l=Math.max(l,t)),n[o]=[a,l]}return n}calculatePrecision(e){let t=10;if(isFinite(e)&&e>0)for(;e<1;)t*=10,e*=10;return t}calculateNiceStart(e,t,i){const s=Math.abs(t-e)/i,n=Math.floor(Math.log10(s)),r=Math.pow(10,n);return{start:Math.floor(e/r)*r,binSize:s}}async processData(e){this.visible||(this.processedData=void 0,this.animationState.transition("updateData"));const{xKey:t,yKey:i,areaPlot:s,aggregation:n}=this.properties,r=this.axes.x?.scale,o=this.axes.y?.scale,{xScaleType:a,yScaleType:l}=this.getScaleInformation({yScale:o,xScale:r}),c=[hs(t,a),tv];if(i){let u=ug("groupAgg");n==="count"||(n==="sum"?u=Ux("groupAgg"):n==="mean"&&(u=Wx("groupAgg"))),s&&(u=dg("groupAgg",u)),c.push(Me(i,l,{invalidValue:void 0}),u)}else{c.push(Xx("count"));let u=ug("groupAgg");s&&(u=dg("groupAgg",u)),c.push(u)}const h=u=>{const d=di(u.domain.keys[0]);if(d.length===0)return u.domain.groups=[],()=>[];const p=(0,af.isNumber)(this.properties.binCount)?this.calculateNiceBins(d,this.properties.binCount):this.properties.bins??this.deriveBins(d),f=p.length;return this.calculatedBins=[...p],y=>{let b=y[0];if((0,af.isDate)(b)&&(b=b.getTime()),!(0,af.isNumber)(b))return[];for(let m=0;m<f;m++){const v=p[m];if(b>=v[0]&&b<v[1]||m===f-1&&b<=v[1])return v}return[]}};!this.ctx.animationManager.isSkipped()&&this.processedData&&c.push(Po(this.id,this.processedData,!1)),await this.requestDataModel(e,this.data,{props:c,groupByFn:h}),this.animationState.transition("updateData")}xCoordinateRange(){return[NaN,NaN]}yCoordinateRange(){return[NaN,NaN]}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i||!this.calculatedBins.length)return[];const s=i.getDomain(this,"groupAgg","aggregate",t),n=this.calculatedBins?.[0][0],r=this.calculatedBins?.[(this.calculatedBins?.length??0)-1][1];return di(e==="x"?[n,r]:s)}getSeriesRange(e,[t,i]){const{dataModel:s,processedData:n}=this;if(!s||n?.type!=="grouped")return[NaN,NaN];const r=this.axes.x.scale,o=0;let a=-1/0;return n.groups.forEach(({keys:l,aggregation:c})=>{const[[h,u]=[0,0]]=c,[d,p]=l,[f,y]=Dt([r.convert(d),r.convert(p)]);if(y>=t&&f<=i){const b=h+u;a=Math.max(a,b)}}),o>a?[NaN,NaN]:[o,a]}frequency(e){return e.datumIndices.reduce((t,i)=>t+i.length,0)}createNodeData(){const{id:e,axes:t,processedData:i,dataModel:s}=this,n=t.x,r=t.y;if(!n||!r||!s)return;const{scale:o}=n,{scale:a}=r,{xKey:l,yKey:c,xName:h,yName:u}=this.properties,d=this.properties.label.formatter,p=[],f={itemId:this.properties.yKey??this.id,nodeData:p,labelData:p,scales:this.calculateScaling(),animationValid:!0,visible:this.visible};return!this.visible||i==null||i.type!=="grouped"||(i.groups.forEach((y,b)=>{const{keys:m,aggregation:v}=y,[[M,S]=[0,0]]=v,D=this.frequency(y),C=m,[k,L]=C,w=[...s.forEachDatum(this,i,y)],P=o.convert(k),R=o.convert(L),G=M+S,Y=a.convert(0),he=a.convert(G),se=Math.abs(R-P),de=Math.abs(he-Y),ge=Math.min(P,R),ye=Math.min(Y,he);let J;G!==0&&(J={x:ge+se/2,y:ye+de/2,text:this.cachedDatumCallback(Ci(b,"label"),()=>d?.({value:G,datum:w,seriesId:e,xKey:l,yKey:c,xName:h,yName:u}))??r.formatDatum(G)});const W={x:ge+se/2,y:ye+de/2},V=r.isReversed();p.push({series:this,datumIndex:b,datum:w,aggregatedValue:G,frequency:D,domain:C,yKey:c,xKey:l,x:ge,y:ye,xValue:P,yValue:he,width:se,height:de,midPoint:W,topLeftCornerRadius:!V,topRightCornerRadius:!V,bottomRightCornerRadius:V,bottomLeftCornerRadius:V,label:J,crisp:!0})}),p.sort((y,b)=>y.x-b.x)),f}nodeFactory(){return new qt}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e;return i.update(t,void 0,s=>s.domain.join("_"))}getItemBaseStyle(e){const{properties:t}=this,i=e?t.highlightStyle.item:void 0;return ws({fill:i?.fill??t.fill,fillOpacity:i?.fillOpacity??t.fillOpacity,stroke:i?.stroke??t.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(t.strokeWidth),strokeOpacity:i?.strokeOpacity??t.strokeOpacity,lineDash:i?.lineDash??t.lineDash,lineDashOffset:i?.lineDashOffset??t.lineDashOffset,cornerRadius:t.cornerRadius},t.fillGradientDefaults,t.fillPatternDefaults,t.fillImageDefaults)}updateDatumNodes(e){const{isHighlight:t}=e,{shadow:i}=this.properties,s=this.getItemBaseStyle(t),n=this.getShapeFillBBox();e.datumSelection.each((r,o)=>{const{cornerRadius:a}=s,{topLeftCornerRadius:l,topRightCornerRadius:c,bottomRightCornerRadius:h,bottomLeftCornerRadius:u}=o;yr(r,s,void 0,n),r.topLeftCornerRadius=l?a:0,r.topRightCornerRadius=c?a:0,r.bottomRightCornerRadius=h?a:0,r.bottomLeftCornerRadius=u?a:0,r.crisp=o.crisp,r.fillShadow=i,r.visible=o.height>0})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t,s=>{s.pointerEvents=1,s.textAlign="center",s.textBaseline="middle"})}updateLabelNodes(e){const{fontStyle:t,fontWeight:i,fontFamily:s,fontSize:n,color:r}=this.properties.label,o=this.isLabelEnabled();e.labelSelection.each((a,l)=>{o&&l?.label?(a.text=l.label.text,a.x=l.label.x,a.y=l.label.y,a.fontStyle=t,a.fontWeight=i,a.fontFamily=s,a.fontSize=n,a.fill=r,a.visible=!0):a.visible=!1})}initQuadTree(e){const{value:t}=this.contentGroup.children().next();t&&qg(e,t.children())}pickNodeClosestDatum(e){return Qg(this,e)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:r,ctx:{localeManager:o}}=this,{xKey:a,xName:l,yKey:c,yName:h,tooltip:u}=r,d=n.x,p=n.y;if(!i||s?.type!=="grouped"||!d||!p)return;const f=s.groups[e],{aggregation:y,keys:b}=f,[[m,v]=[0,0]]=y,M=this.frequency(f),S=b,[D,C]=S,k=m+v,L={data:[...i.forEachDatum(this,s,f)],aggregatedValue:k,frequency:M,domain:S},w=[{label:l,fallbackLabel:a,value:`${d.formatDatum(D)} - ${d.formatDatum(C)}`},{label:o.t("seriesHistogramTooltipFrequency"),value:p.formatDatum(M)}];if(c!=null){let P;switch(r.aggregation){case"sum":P=o.t("seriesHistogramTooltipSum",{yName:h??c});break;case"mean":P=o.t("seriesHistogramTooltipMean",{yName:h??c});break;case"count":P=o.t("seriesHistogramTooltipCount",{yName:h??c});break}w.push({label:P,value:p.formatDatum(k)})}return this.formatTooltipWithContext(u,{symbol:this.legendItemSymbol(),data:w},{seriesId:t,datum:L,title:h,xKey:a,xName:l,yKey:c,yName:h,xRange:[D,C],frequency:M,...this.getItemBaseStyle(!1)})}legendItemSymbol(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:r,lineDashOffset:o,fillGradientDefaults:a,fillPatternDefaults:l,fillImageDefaults:c}=this.properties;return{marker:ws({fill:e??"rgba(0, 0, 0, 0)",stroke:i??"rgba(0, 0, 0, 0)",fillOpacity:t,strokeOpacity:n,strokeWidth:s,lineDash:r,lineDashOffset:o},a,l,c)}}getLegendData(e){if(e!=="category")return[];const{id:t,ctx:{legendManager:i},visible:s}=this,{xKey:n,yName:r,showInLegend:o}=this.properties;return[{legendType:"category",id:t,itemId:n,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:n}),label:{text:r??n??"Frequency"},symbol:this.legendItemSymbol(),hideInLegend:!o}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){const i=Ol(Nl(!0,this.axes,"normal"));Xe(this.id,"datums",this.ctx.animationManager,[e],i),Ce(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(e){const t=Ol(Nl(!0,this.axes,"normal")),i=nf(this.id,e.datumSelection,s=>Ci(s.domain),e.contextData,e.previousContextData,this.processedData);Xe(this.id,"datums",this.ctx.animationManager,[e.datumSelection],t,(s,n)=>Ci(n.domain),i),i?.changed&&Ce(this,"labels",this.ctx.animationManager,e.labelSelection)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return sf(this,this.contextNodeData?.nodeData[e])}};su.className="HistogramSeries",su.type="histogram";var Rt=(O(),N(T)),fM={showInMiniChart:Rt.boolean,cornerRadius:Rt.positiveNumber,label:Pe,tooltip:Ae,shadow:Es,...Se,...Rt.fillOptionsDef,...Rt.strokeOptionsDef,...Rt.lineDashOptionsDef},sO={...fM,...Ni,type:(0,Rt.required)((0,Rt.constant)("histogram")),xKey:(0,Rt.required)(Rt.string),yKey:Rt.string,xName:Rt.string,yName:Rt.string,areaPlot:Rt.boolean,aggregation:(0,Rt.union)("count","sum","mean"),bins:(0,Rt.arrayOf)((0,Rt.arrayOf)(Rt.number)),binCount:Rt.positiveNumber},nO={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"histogram",moduleFactory:e=>new su(e),tooltipDefaults:{range:"exact"},defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:Rn,fillImageDefaults:Dr,strokeWidth:1,fillOpacity:1,strokeOpacity:1,lineDash:[0],lineDashOffset:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}},shadow:{enabled:!1,color:On,xOffset:3,yOffset:3,blur:5}}}},mM={type:"series",name:"histogram",chartType:"cartesian",enterprise:!0,options:sO,create:e=>new su(e)},rO=(O(),N(T)),bt=class extends nn{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new Vo,this.marker=new kt,this.label=new At,this.tooltip=new Qt,this.connectMissingData=!1,this.sparklineMode=!1}};g([x],bt.prototype,"xKey",2),g([x],bt.prototype,"yKey",2),g([x],bt.prototype,"xName",2),g([x],bt.prototype,"yName",2),g([x],bt.prototype,"yFilterKey",2),g([x],bt.prototype,"stackGroup",2),g([x],bt.prototype,"normalizedTo",2),g([x],bt.prototype,"title",2),g([x],bt.prototype,"stroke",2),g([x],bt.prototype,"strokeWidth",2),g([x],bt.prototype,"strokeOpacity",2),g([x],bt.prototype,"lineDash",2),g([x],bt.prototype,"lineDashOffset",2),g([x],bt.prototype,"interpolation",2),g([x],bt.prototype,"marker",2),g([x],bt.prototype,"label",2),g([x],bt.prototype,"tooltip",2),g([x],bt.prototype,"connectMissingData",2),g([x],bt.prototype,"sparklineMode",2);var oO=.25,Fl=class extends _n{constructor(e){super({moduleCtx:e,directionKeys:Ir,directionNames:Ar,categoryKey:"xValue",hasMarkers:!0,pickModes:[2,1,0],markerSelectionGarbageCollection:!1,animationResetFns:{path:Yg({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:tn,marker:(t,i)=>({...Al(t),...Ll(t,i)})},clipFocusBox:!1}),this.properties=new bt,this.dataAggregationFilters=void 0}get pickModeAxis(){return this.properties.sparklineMode?"main":"main-category"}async processData(e){if(this.data==null)return;const{data:t,visible:i,seriesGrouping:{groupIndex:s=this.id,stackCount:n=0}={}}=this,{xKey:r,yKey:o,yFilterKey:a,connectMissingData:l,normalizedTo:c}=this.properties,h=!this.ctx.animationManager.isSkipped(),u=this.axes.x?.scale,d=this.axes.y?.scale,{isContinuousX:p,xScaleType:f,yScaleType:y}=this.getScaleInformation({xScale:u,yScale:d}),b=n>=1||c!=null,m={invalidValue:null};l&&b&&(m.invalidValue=0),b&&!i&&(m.forceValue=0);const v=[];if((!p||b)&&v.push(hs(r,f,{id:"xKey"})),v.push(Me(r,f,{id:"xValue"}),Me(o,y,{id:"yValueRaw",...m,invalidValue:void 0})),a!=null&&v.push(Me(a,y,{id:"yFilterRaw"})),b){const D=[`line-stack-${s}-yValues`,`line-stack-${s}-yValues-trailing`,`line-stack-${s}-yValues-marker`];v.push(...Cn(o,"window","current",{id:"yValueEnd",...m,groupId:D[0]},y),...Cn(o,"window-trailing","current",{id:"yValueStart",...m,groupId:D[1]},y),...Cn(o,"normal","current",{id:"yValueCumulative",...m,groupId:D[2]},y)),(0,rO.isDefined)(c)&&v.push(Sh([D[0],D[1],D[2]],c))}h&&(v.push(Eo(p?["xValue"]:void 0)),this.processedData&&v.push(Po(this.id,this.processedData)));const{dataModel:M,processedData:S}=await this.requestDataModel(e,t,{props:v,groupByKeys:b,groupByData:!b});this.dataAggregationFilters=this.aggregateData(M,S),this.animationState.transition("updateData")}xCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes.x.scale.convert(e),n=i.enabled?.5*i.size*t:0;return[s-n,s+n]}yCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes.y.scale.convert(e[0]),n=i.enabled?.5*i.size*t:0;return[s-n,s+n]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!t||!i)return[];if(e==="x"){const r=t.resolveProcessedDataDefById(this,"xValue"),o=t.getDomain(this,"xValue","value",i);return r?.def.type==="value"&&r.def.valueType==="category"?o:di(Qs(o))}const s=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw",n=this.domainForClippedRange("y",[s],"xValue",!0);return di(n)}getSeriesRange(e,t){const i=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw";return this.domainForVisibleRange("y",[i],"xValue",t,!0)}getVisibleItems(e,t,i){const s=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw";return this.countVisibleItems("xValue",[s],e,t,i)}aggregateData(e,t){}createNodeData(){const{dataModel:e,processedData:t,axes:i,dataAggregationFilters:s}=this,n=i.x,r=i.y;if(!e||!t||!n||!r)return;const{xKey:o,yKey:a,yFilterKey:l,xName:c,yName:h,marker:u,label:d,connectMissingData:p,interpolation:f,legendItemName:y}=this.properties,b=this.dataModel?.hasColumnById(this,"yValueEnd"),m=n.scale,v=r.scale,M=(m.bandwidth??0)/2,S=(v.bandwidth??0)/2,D=u.enabled?u.size:0,C=t.dataSources.get(this.id)??[],k=e.resolveColumnById(this,"xValue",t),L=e.resolveColumnById(this,"yValueRaw",t),w=b?e.resolveColumnById(this,"yValueEnd",t):void 0,P=b?e.resolveColumnById(this,"yValueCumulative",t):L,R=l!=null?e.resolveColumnById(this,"yFilterRaw",t):void 0,G=B=>m.convert(k[B])+M,Y=B=>v.convert(P[B])+S,he={lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},se=[];let de;const ge=B=>{const q=C[B],X=k[B],fe=L[B],Ie=w?.[B],Te=R?.[B],qe=G(B),Tt=Y(B);if(!Number.isFinite(qe))return;if(fe!=null){const $t=d.enabled?this.getLabelText(d,{value:fe,datum:q,xKey:o,yKey:a,xName:c,yName:h,legendItemName:y}):void 0;se.push({series:this,datum:q,datumIndex:B,yKey:a,xKey:o,point:{x:qe,y:Tt,size:D},midPoint:{x:qe,y:Tt},cumulativeValue:Ie,yValue:fe,xValue:X,capDefaults:he,labelText:$t,selected:Te})}if(de==null)return;const _t=de[de.length-1];if(fe!=null){const $t={point:{x:qe,y:Tt},xDatum:X,yDatum:fe};Array.isArray(_t)?_t.push($t):_t!=null?(_t.skip+=1,de.push([$t])):de.push([$t])}else p||(Array.isArray(_t)||_t==null?de.push({skip:0}):_t.skip+=1)},[ye,J]=m.range,W=J-ye,ee=s?.find(B=>B.maxRange>W)?.indices;let[ie,ne]=this.visibleRange("xValue",n.range,ee);ie=Math.max(ie-1,0),ne=Math.min(ne+1,ee?.length??k.length),t.input.count<1e3&&(ie=0,ne=t.input.count),ee==null&&(de=[]);for(let B=ie;B<ne;B+=1)ge(ee?.[B]??B);const me=de?.flatMap(B=>Array.isArray(B)?Gh(B,f):[]),Z=me!=null?{itemId:a,spans:me}:void 0,te=R?.some((B,q)=>B===L[q])??!1;return{itemId:a,nodeData:se,labelData:se,strokeData:Z,scales:this.calculateScaling(),visible:this.visible,crossFiltering:te}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(e){const{paths:[t],opacity:i,visible:s,animationEnabled:n}=e,r=this.contextNodeData?.crossFiltering===!0;t.setProperties({fill:void 0,lineJoin:"round",pointerEvents:1,opacity:i,stroke:this.properties.stroke,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.properties.strokeOpacity*(r?oO:1),lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset}),n||(t.visible=s),Hh(this,t)}getMarkerItemBaseStyle(e){const{properties:t}=this,{marker:i}=t,s=e?t.highlightStyle.item:void 0;return ws({size:i.size,shape:i.shape,fill:s?.fill??i.fill,fillOpacity:s?.fillOpacity??i.fillOpacity,stroke:s?.stroke??i.stroke,strokeWidth:s?.strokeWidth??i.strokeWidth,strokeOpacity:s?.strokeOpacity??i.strokeOpacity,lineDash:s?.lineDash??i.lineDash,lineDashOffset:s?.lineDashOffset??i.lineDashOffset},i.fillGradientDefaults,i.fillPatternDefaults,i.fillImageDefaults)}getMarkerItemStyleOverrides(e,t,i,s){const{id:n,properties:r}=this,{xKey:o,yKey:a,marker:l}=r,{itemStyler:c}=l;if(c!=null)return this.cachedDatumCallback(Ci(e,s?"highlight":"node"),()=>{const h=this.getSeriesDomain("x"),u=this.getSeriesDomain("y");return this.callWithContext(c,{seriesId:n,...Dn(t,o,a,h,u),datum:t,highlighted:s,...i})})}updateMarkerSelection(e){let{nodeData:t}=e;const{markerSelection:i}=e;return t=this.properties.marker.enabled||this.contextNodeData?.crossFiltering===!0?t:[],this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(t,void 0,n=>Ci(n.xValue))}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i}=e,{xKey:s,yKey:n,stroke:r,strokeWidth:o,strokeOpacity:a,marker:l,highlightStyle:c}=this.properties,h=this.getSeriesDomain("x"),u=this.getSeriesDomain("y"),d=xe(i&&c.item,l.getStyle(),{stroke:r,strokeWidth:o,strokeOpacity:a}),p=this.ctx.animationManager.isSkipped(),f=this.getShapeFillBBox();t.each((y,b)=>{this.updateMarkerStyle(l,y,b.datum,b.point,Dn(b,s,n,h,u),i,d,f,{applyTranslation:p,selected:b.selected})}),i||l.markClean()}updateLabelSelection(e){return e.labelSelection.update(this.isLabelEnabled()?e.labelData:[])}updateLabelNodes(e){const{enabled:t,fontStyle:i,fontWeight:s,fontSize:n,fontFamily:r,color:o}=this.properties.label;e.labelSelection.each((a,l)=>{t&&l?.labelText?(a.fontStyle=i,a.fontWeight=s,a.fontSize=n,a.fontFamily=r,a.textAlign="center",a.textBaseline="bottom",a.text=l.labelText,a.x=l.point.x,a.y=l.point.y-10,a.fill=o,a.visible=!0):a.visible=!1})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:r}=this,{xKey:o,xName:a,yKey:l,yName:c,tooltip:h}=r,u=n.x,d=n.y;if(!i||!s||!u||!d)return;const p=s.dataSources.get(this.id)?.[e],f=i.resolveColumnById(this,"xValue",s)[e],y=i.resolveColumnById(this,"yValueRaw",s)[e];if(f==null)return;const b=this.getMarkerItemBaseStyle(!1);return Object.assign(b,this.getMarkerItemStyleOverrides(String(e),p,b,!1)),this.formatTooltipWithContext(h,{heading:u.formatDatum(f),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:d.formatDatum(y)}]},{seriesId:t,datum:p,title:c,xKey:o,xName:a,yKey:l,yName:c,...b,...this.getModuleTooltipParams()})}legendItemSymbol(){const e="rgba(0, 0, 0, 0)",{stroke:t,strokeOpacity:i,strokeWidth:s,lineDash:n,marker:r}=this.properties;return{marker:{...this.getMarkerStyle(r,void 0,void 0,!1,void 0,{fill:r.fill??e,stroke:r.stroke??t??e}),enabled:r.enabled},line:{stroke:t??e,strokeOpacity:i,strokeWidth:s,lineDash:n}}}getLegendData(e){if(e!=="category")return[];const{id:t,ctx:{legendManager:i},visible:s}=this,{yKey:n,yName:r,title:o,legendItemName:a,showInLegend:l}=this.properties;return[{legendType:"category",id:t,itemId:n,legendItemName:a,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:n}),label:{text:a??o??r??n},symbol:this.legendItemSymbol(),hideInLegend:!l}]}updatePaths(e){this.updateLinePaths(e.paths,e.contextData)}plotNodeDataPoints(e,t){if(t.length===0)return;const i=t[0].point;e.moveTo(i.x,i.y);for(let s=1;s<t.length;s+=1){const{x:n,y:r}=t[s].point;e.lineTo(n,r)}}updateLinePaths(e,t){const i=t.strokeData?.spans,[s]=e;s.path.clear(),i!=null?Bg(s,i):this.plotNodeDataPoints(s.path,t.nodeData),s.markDirty("LineSeries")}animateEmptyUpdateReady(e){const{markerSelection:t,labelSelection:i,annotationSelections:s,contextData:n,paths:r}=e,{animationManager:o}=this.ctx;this.updateLinePaths(r,n),Hg(this,o,...r),It([t],Ll),Wg(this,o,t),Ce(this,"labels",o,i),Ce(this,"annotations",o,...s)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateLinePaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:t}=this.ctx,{markerSelection:i,labelSelection:s,annotationSelections:n,contextData:r,paths:o,previousContextData:a}=e,[l]=o;this.resetMarkerAnimation(e),this.resetLabelAnimation(e);const c=()=>{this.resetPathAnimation(e),this.updateLinePaths(o,r)},h=()=>{t.skipCurrentBatch(),c()};if(r==null||a==null){c(),Il(this,t,"added",i),Wh(this,"path_properties",t,"add",l),Ce(this,"labels",t,s),Ce(this,"annotations",t,...n);return}if(r.crossFiltering!==a.crossFiltering){h();return}const u=Yv(r,a,this.processedData?.reduced?.diff?.[this.id]);if(u===void 0){h();return}else if(u.status==="no-op")return;Xe(this.id,"path_properties",t,[l],u.stroke.pathProperties),u.status==="added"?this.updateLinePaths(o,r):u.status==="removed"?this.updateLinePaths(o,a):_h(this.id,"path_update",t,[l],u.stroke.path),u.hasMotion&&(Il(this,t,void 0,i),Ce(this,"labels",t,s),Ce(this,"annotations",t,...n))}isLabelEnabled(){return this.properties.label.enabled}getBandScalePadding(){return{inner:1,outer:.1}}nodeFactory(){return new ue}getFormattedMarkerStyle(e){const{xKey:t,yKey:i}=this.properties,s=this.getSeriesDomain("x"),n=this.getSeriesDomain("y");return this.getMarkerStyle(this.properties.marker,e.datum,Dn(e,t,i,s,n),!0)}computeFocusBounds(e){return kl(this,e)}};Fl.className="LineSeries",Fl.type="line";var at=(O(),N(T)),lf={title:at.string,showInMiniChart:at.boolean,connectMissingData:at.boolean,interpolation:tu,label:Pe,marker:an,tooltip:Ae,errorBar:Tl,...Se,...at.strokeOptionsDef,...at.lineDashOptionsDef};lf.sparklineMode=(0,at.undocumented)(at.boolean);var nu={...lf,...Ni,type:(0,at.constant)("line"),xKey:(0,at.required)(at.string),yKey:(0,at.required)(at.string),xName:at.string,yName:at.string,stacked:at.boolean,stackGroup:at.string,normalizedTo:at.number,legendItemName:at.string,errorBar:eu};nu.pickOutsideVisibleMinorAxis=(0,at.undocumented)(at.boolean),nu.focusPriority=(0,at.undocumented)(at.number);var yM={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"line",moduleFactory:e=>new Fl(e),stackable:!0,tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{tooltip:{position:{_seriesOverrideType:"node"}},stroke:Fh,strokeWidth:2,strokeOpacity:1,lineDash:[0],lineDashOffset:0,interpolation:{type:"linear"},marker:{shape:"circle",size:7,strokeWidth:0,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:Rn,fillImageDefaults:Dr},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},errorBar:{cap:{lengthRatio:1}}}}},bM={type:"series",name:"line",chartType:"cartesian",options:nu,create:e=>new Fl(e)},xM=class extends At{constructor(){super(...arguments),this.placement="top"}};g([x],xM.prototype,"placement",2);var Ke=class extends nn{constructor(){super(...arguments),this.label=new xM,this.tooltip=new Qt,this.marker=new kt}};g([x],Ke.prototype,"xKey",2),g([x],Ke.prototype,"yKey",2),g([x],Ke.prototype,"labelKey",2),g([x],Ke.prototype,"xFilterKey",2),g([x],Ke.prototype,"yFilterKey",2),g([x],Ke.prototype,"xName",2),g([x],Ke.prototype,"yName",2),g([x],Ke.prototype,"labelName",2),g([x],Ke.prototype,"title",2),g([Ee("marker.shape")],Ke.prototype,"shape",2),g([Ee("marker.size")],Ke.prototype,"size",2),g([Ee("marker.fill")],Ke.prototype,"fill",2),g([Ee("marker.fillGradientDefaults")],Ke.prototype,"fillGradientDefaults",2),g([Ee("marker.fillPatternDefaults")],Ke.prototype,"fillPatternDefaults",2),g([Ee("marker.fillImageDefaults")],Ke.prototype,"fillImageDefaults",2),g([Ee("marker.fillOpacity")],Ke.prototype,"fillOpacity",2),g([Ee("marker.stroke")],Ke.prototype,"stroke",2),g([Ee("marker.strokeWidth")],Ke.prototype,"strokeWidth",2),g([Ee("marker.strokeOpacity")],Ke.prototype,"strokeOpacity",2),g([Ee("marker.lineDash")],Ke.prototype,"lineDash",2),g([Ee("marker.lineDashOffset")],Ke.prototype,"lineDashOffset",2),g([Ee("marker.itemStyler")],Ke.prototype,"itemStyler",2),g([x],Ke.prototype,"label",2),g([x],Ke.prototype,"tooltip",2);var ru=class extends _n{constructor(e){super({moduleCtx:e,directionKeys:Ir,directionNames:Ar,categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{marker:Al,label:tn},usesPlacedLabels:!0,clipFocusBox:!1}),this.properties=new Ke}get pickModeAxis(){return"main-category"}async processData(e){if(this.data==null||!this.visible)return;const t=this.axes.x?.scale,i=this.axes.y?.scale,{xScaleType:s,yScaleType:n}=this.getScaleInformation({xScale:t,yScale:i}),{xKey:r,yKey:o,xFilterKey:a,yFilterKey:l,labelKey:c}=this.properties;await this.requestDataModel(e,this.data,{props:[Me(r,s,{id:"xValue"}),Me(o,n,{id:"yValue"}),...a!=null?[Me(a,s,{id:"xFilterValue"})]:[],...l!=null?[Me(l,n,{id:"yFilterValue"})]:[],...c?[Me(c,"band",{id:"labelValue"})]:[]]}),this.animationState.transition("updateData")}xCoordinateRange(e,t){const i=this.axes.x.scale.convert(e),s=.5*this.properties.size*t;return[i-s,i+s]}yCoordinateRange(e,t){const i=this.axes.y.scale.convert(e[0]),s=.5*this.properties.size*t;return[i-s,i+s]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];const s={x:"xValue",y:"yValue"},n=s[e],r=t.resolveProcessedDataDefById(this,n),o=t.getDomain(this,n,"value",i);if(r?.def.type==="value"&&r?.def.valueType==="category")return o;const l=s[e==="x"?"y":"x"],c=this.domainForClippedRange(e,[n],l,!1);return di(Qs(c))}getSeriesRange(e,t){return this.domainForVisibleRange("y",["yValue"],"xValue",t,!1)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",["yValue"],e,t,i)}createNodeData(){const{axes:e,dataModel:t,processedData:i,visible:s}=this,{xKey:n,yKey:r,xFilterKey:o,yFilterKey:a,labelKey:l,xName:c,yName:h,labelName:u,marker:d,label:p}=this.properties,{placement:f}=p,y=Lt.anchor(d.shape),b=e.x,m=e.y;if(!(t&&i&&s&&b&&m))return;const v=t.resolveColumnById(this,"xValue",i),M=t.resolveColumnById(this,"yValue",i),S=l!=null?t.resolveColumnById(this,"labelValue",i):void 0,D=o!=null?t.resolveColumnById(this,"xFilterValue",i):void 0,C=a!=null?t.resolveColumnById(this,"yFilterValue",i):void 0,k=b.scale,L=m.scale,w=(k.bandwidth??0)/2,P=(L.bandwidth??0)/2,R=[],G=p.getFont(),Y=As.getMeasurer({font:G});return(i.dataSources.get(this.id)??[]).forEach((se,de)=>{const ge=v[de],ye=M[de],J=k.convert(ge)+w,W=L.convert(ye)+P,V=D!=null&&C!=null?D[de]===ge&&C[de]===ye:void 0,ee=this.getLabelText(p,{value:S!=null?S?.[de]:ye,datum:se,xKey:n,yKey:r,labelKey:l,xName:c,yName:h,labelName:u}),ie=Y.measureText(ee);R.push({series:this,itemId:r,yKey:r,xKey:n,datum:se,datumIndex:de,xValue:ge,yValue:ye,capDefaults:{lengthRatioMultiplier:d.getDiameter(),lengthMax:1/0},point:{x:J,y:W,size:d.size},midPoint:{x:J,y:W},label:{text:ee,...ie},anchor:y,placement:f,selected:V})}),{itemId:r,nodeData:R,labelData:R,scales:this.calculateScaling(),visible:this.visible}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}updateMarkerSelection(e){const{nodeData:t,markerSelection:i}=e;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(this.properties.marker.enabled?t:[])}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i}=e,{xKey:s,yKey:n,labelKey:r,marker:o,highlightStyle:a}=this.properties,l=xe(i&&a.item,o.getStyle()),c=this.getShapeFillBBox();t.each((h,u)=>{this.updateMarkerStyle(o,h,u.datum,u.point,{xKey:s,yKey:n,labelKey:r},i,l,c,{selected:u.selected})}),i||o.markClean()}updatePlacedLabelData(e){this.labelSelection.update(e.map(t=>({...t.datum,point:{x:t.x,y:t.y,size:t.datum.point.size}})),t=>{t.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(e){const{label:t}=this.properties;e.labelSelection.each((i,s)=>{i.text=s.label.text,i.fill=t.color,i.x=s.point?.x??0,i.y=s.point?.y??0,i.fontStyle=t.fontStyle,i.fontWeight=t.fontWeight,i.fontSize=t.fontSize,i.fontFamily=t.fontFamily,i.textAlign="left",i.textBaseline="top"})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:r}=this,{xKey:o,xName:a,yKey:l,yName:c,labelKey:h,labelName:u,title:d,tooltip:p,marker:f}=r,y=n.x,b=n.y;if(!i||!s||!y||!b)return;const m=s.dataSources.get(this.id)?.[e],v=i.resolveColumnById(this,"xValue",s)[e],M=i.resolveColumnById(this,"yValue",s)[e],S=this.contextNodeData?.nodeData[e];if(v==null||S==null)return;const D=this.getMarkerStyle(f,S.datum,{xKey:o,yKey:l,labelKey:h,highlighted:!0});return this.formatTooltipWithContext(p,{symbol:this.legendItemSymbol(),title:d,data:[{label:a,fallbackLabel:o,value:y.formatDatum(v)},{label:c,fallbackLabel:l,value:b.formatDatum(M)}]},{seriesId:t,datum:m,title:c,xKey:o,xName:a,yKey:l,yName:c,labelKey:h,labelName:u,...D,...this.getModuleTooltipParams()})}legendItemSymbol(){return{marker:this.getMarkerStyle(this.properties.marker)}}getLegendData(e){if(e!=="category")return[];const{yKey:t,yName:i,title:s,showInLegend:n}=this.properties,{id:r,ctx:{legendManager:o},visible:a}=this;return[{legendType:"category",id:r,itemId:t,seriesId:r,enabled:a&&o.getItemEnabled({seriesId:r,itemId:t}),label:{text:s??i??t},symbol:this.legendItemSymbol(),hideInLegend:!n}]}animateEmptyUpdateReady(e){const{markerSelection:t,labelSelection:i,annotationSelections:s}=e;Ug(this,this.ctx.animationManager,t),Ce(this,"labels",this.ctx.animationManager,i),Ce(this,"annotations",this.ctx.animationManager,...s)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new ue}getFormattedMarkerStyle(e){const{xKey:t,yKey:i,labelKey:s}=this.properties;return this.getMarkerStyle(this.properties.marker,e.datum,{xKey:t,yKey:i,labelKey:s},!0)}computeFocusBounds(e){return kl(this,e)}};ru.className="ScatterSeries",ru.type="scatter";var Oi=(O(),N(T)),vM={title:Oi.string,showInMiniChart:Oi.boolean,label:{placement:(0,Oi.union)("top","right","bottom","left"),...Pe},tooltip:Ae,errorBar:Tl,...Se,...H(an,["enabled"])},aO={...vM,...Ni,type:(0,Oi.required)((0,Oi.constant)("scatter")),xKey:(0,Oi.required)(Oi.string),yKey:(0,Oi.required)(Oi.string),labelKey:Oi.string,xName:Oi.string,yName:Oi.string,labelName:Oi.string,errorBar:eu},lO={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"scatter",moduleFactory:e=>new ru(e),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{shape:"circle",size:7,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:Rn,fillImageDefaults:Dr,fillOpacity:.8,tooltip:{position:{_seriesOverrideType:"node"}},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},errorBar:{cap:{lengthRatio:1}}}}},MM={type:"series",name:"scatter",chartType:"cartesian",options:aO,create:e=>new ru(e)},K2=(O(),N(T)),SM=(O(),N(T)),DM=class um{constructor(t,i,s,n){this.startAngle=t,this.endAngle=i,this.innerRadius=s,this.outerRadius=n}clone(){const{startAngle:t,endAngle:i,innerRadius:s,outerRadius:n}=this;return new um(t,i,s,n)}equals(t){return this.startAngle===t.startAngle&&this.endAngle===t.endAngle&&this.innerRadius===t.innerRadius&&this.outerRadius===t.outerRadius}[gc](t,i){return new um(this.startAngle*(1-i)+t.startAngle*i,this.endAngle*(1-i)+t.endAngle*i,this.innerRadius*(1-i)+t.innerRadius*i,this.outerRadius*(1-i)+t.outerRadius*i)}};function IM({startAngle:e,endAngle:t,innerRadius:i,outerRadius:s}){let n=1/0,r=1/0,o=-1/0,a=-1/0;const l=(c,h)=>{n=Math.min(c,n),r=Math.min(h,r),o=Math.max(c,o),a=Math.max(h,a)};return l(i*Math.cos(e),i*Math.sin(e)),l(i*Math.cos(t),i*Math.sin(t)),l(s*Math.cos(e),s*Math.sin(e)),l(s*Math.cos(t),s*Math.sin(t)),bn(0,e,t)&&l(s,0),bn(Math.PI*.5,e,t)&&l(0,s),bn(Math.PI,e,t)&&l(-s,0),bn(Math.PI*1.5,e,t)&&l(0,-s),new U(n,r,o-n,a-r)}function ou(e,t,i){const s=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),{innerRadius:n,outerRadius:r}=i;if(i.startAngle===i.endAngle||s<Math.min(n,r)||s>Math.max(n,r))return!1;const o=Ma(i.startAngle),a=Ma(i.endAngle),l=Math.atan2(t,e);return o<a?l<=a&&l>=o:l<=a&&l>=-Math.PI||l>=o&&l<=Math.PI}function AM(e,t){const{startAngle:i,endAngle:s,innerRadius:n,outerRadius:r}=t,o={x:r*Math.cos(i),y:r*Math.sin(i)},a={x:r*Math.cos(s),y:r*Math.sin(s)},l=n===0?{x:0,y:0}:{x:n*Math.cos(i),y:n*Math.sin(i)},c=n===0?{x:0,y:0}:{x:n*Math.cos(s),y:n*Math.sin(s)};return so(e.start.x,e.start.y,e.end.x,e.end.y,o.x,o.y,l.x,l.y)||so(e.start.x,e.start.y,e.end.x,e.end.y,a.x,a.y,c.x,c.y)||zy(0,0,r,i,s,!0,e.start.x,e.start.y,e.end.x,e.end.y)}function LM(e,t){const i={x:e.x,y:e.y},s={x:e.x+e.width,y:e.y},n={x:e.x,y:e.y+e.height},r={x:e.x+e.width,y:e.y+e.height};return AM({start:i,end:s},t)||AM({start:n,end:r},t)}function kM(e,t,i,s){if(i===0&&s===0)return 0;if(Math.asin(Math.abs(1*i)/(e+1*i))+Math.asin(Math.abs(1*s)/(e+1*s))-t<0)return 1;let r=0,o=1;for(let a=0;a<8;a+=1){const l=(r+o)/2;Math.asin(Math.abs(l*i)/(e+l*i))+Math.asin(Math.abs(l*s)/(e+l*s))-t<0?r=l:o=l}return r}var cO=1e-6;function Un(e,t){return Sc(e,t)<cO?t:ot(e-t)+t}function au(e,t,i=0){const n=Math.abs(t-e)>=2*Math.PI?2*Math.PI:ot(t-e);return e=Un(e,i),t=e+n,{startAngle:e,endAngle:t}}function lu(e,t,i,s,n,r){const o=Math.sin(r),a=Math.cos(r),l=e**2+t**2-i**2;let c,h,u,d;if(a>.5){const M=o/a,S=1+M**2,D=-2*(e+t*M),C=D**2-4*S*l;if(C<0)return;const k=(-D+Math.sqrt(C))/(2*S),L=(-D-Math.sqrt(C))/(2*S);c=k,h=k*M,u=L,d=L*M}else{const M=a/o,S=1+M**2,D=-2*(t+e*M),C=D**2-4*S*l;if(C<0)return;const k=(-D+Math.sqrt(C))/(2*S),L=(-D-Math.sqrt(C))/(2*S);c=k*M,h=k,u=L*M,d=L}const p=a,f=o,y=c*p+h*f,b=u*p+d*f,m=y>0?Un(Math.atan2(h-t,c-e),s):NaN,v=b>0?Un(Math.atan2(d-t,u-e),s):NaN;if(m>=s&&m<=n)return m;if(v>=s&&v<=n)return v}function cu(e,t,i,s,n,r){const o=Math.hypot(e,t),a=(o**2-i**2+r**2)/(2*o),l=o-a,c=Math.atan2(t,e),h=Math.acos(-l/i),u=Un(c+h,s),d=Un(c-h,s);if(u>=s&&u<=n)return u;if(d>=s&&d<=n)return d}var cf=class{constructor(e,t,i,s,n){this.cx=e,this.cy=t,this.r=i,this.a0=s,this.a1=n,this.a0>=this.a1&&(this.a0=NaN,this.a1=NaN)}isValid(){return Number.isFinite(this.a0)&&Number.isFinite(this.a1)}pointAt(e){return{x:this.cx+this.r*Math.cos(e),y:this.cy+this.r*Math.sin(e)}}clipStart(e){e==null||!this.isValid()||e<this.a0||(this.a0=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}clipEnd(e){e==null||!this.isValid()||e>this.a1||(this.a1=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}},Ft=class extends oi{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.innerRadius=10,this.outerRadius=20,this.startAngle=0,this.endAngle=Math.PI*2,this.clipSector=void 0,this.concentricEdgeInset=0,this.radialEdgeInset=0,this.startOuterCornerRadius=0,this.endOuterCornerRadius=0,this.startInnerCornerRadius=0,this.endInnerCornerRadius=0}set inset(e){this.concentricEdgeInset=e,this.radialEdgeInset=e}set cornerRadius(e){this.startOuterCornerRadius=e,this.endOuterCornerRadius=e,this.startInnerCornerRadius=e,this.endInnerCornerRadius=e}computeBBox(){return IM(this).translate(this.centerX,this.centerY)}normalizedRadii(){const{concentricEdgeInset:e}=this;let{innerRadius:t,outerRadius:i}=this;return t=t>0?t+e:0,i=Math.max(i-e,0),{innerRadius:t,outerRadius:i}}normalizedClipSector(){const{clipSector:e}=this;if(e==null)return;const{startAngle:t,endAngle:i}=au(this.startAngle,this.endAngle),{innerRadius:s,outerRadius:n}=this.normalizedRadii(),r=au(e.startAngle,e.endAngle,t);return new DM(Math.max(t,r.startAngle),Math.min(i,r.endAngle),Math.max(s,e.innerRadius),Math.min(n,e.outerRadius))}getAngleOffset(e){return e>0?this.radialEdgeInset/e:0}arc(e,t,i,s,n,r,o,a){if(e<=0)return;const{startAngle:l,endAngle:c}=au(this.startAngle,this.endAngle),{innerRadius:h,outerRadius:u}=this.normalizedRadii(),d=this.normalizedClipSector();if(a&&h<=0)return;const p=a?this.getAngleOffset(h+e):this.getAngleOffset(u-e),f=o?l+p+t:c-p-t,y=a?h+e:u-e,b=y*Math.cos(f),m=y*Math.sin(f);if(d!=null&&(!o&&!(f>=l-1e-6&&f<=d.endAngle-1e-6)||o&&!(f>=d.startAngle+1e-6&&f<=c-1e-6)||a&&y<d.innerRadius-1e-6||!a&&y>d.outerRadius+1e-6))return;const v=new cf(b,m,e,i,s);if(d!=null){a?(v.clipStart(lu(b,m,e,i,s,d.endAngle)),v.clipEnd(lu(b,m,e,i,s,d.startAngle))):(v.clipStart(lu(b,m,e,i,s,d.startAngle)),v.clipEnd(lu(b,m,e,i,s,d.endAngle)));let k,L;if(o?(k=cu(b,m,e,i,s,d.innerRadius),L=cu(b,m,e,i,s,d.outerRadius)):(k=cu(b,m,e,i,s,d.outerRadius),L=cu(b,m,e,i,s,d.innerRadius)),v.clipStart(k),v.clipEnd(L),k!=null){const{x:w,y:P}=v.pointAt(k),R=Un(Math.atan2(P,w),l);o?r?.clipStart(R):n.clipEnd(R)}if(L!=null){const{x:w,y:P}=v.pointAt(L),R=Un(Math.atan2(P,w),l);o?n.clipStart(R):r?.clipEnd(R)}}if(d!=null){const{x:k,y:L}=v.pointAt((v.a0+v.a1)/2);if(!ou(k,L,d))return}const{x:M,y:S}=v.pointAt(o===a?v.a0:v.a1),D=Un(Math.atan2(S,M),l),C=a?r:n;return o?C?.clipStart(D):C?.clipEnd(D),v}updatePath(){const{path:t,centerX:i,centerY:s,concentricEdgeInset:n,radialEdgeInset:r}=this;let{startOuterCornerRadius:o,endOuterCornerRadius:a,startInnerCornerRadius:l,endInnerCornerRadius:c}=this;const{startAngle:h,endAngle:u}=au(this.startAngle,this.endAngle),{innerRadius:d,outerRadius:p}=this.normalizedRadii(),f=this.normalizedClipSector(),y=u-h,b=y>=2*Math.PI-1e-6;if(t.clear(),d===0&&p===0||d>p)return;if((f?.startAngle??h)===(f?.endAngle??u))return;if(b&&this.clipSector==null&&o===0&&a===0&&l===0&&c===0){t.moveTo(i+p*Math.cos(h),s+p*Math.sin(h)),t.arc(i,s,p,h,u),d>n&&(t.moveTo(i+d*Math.cos(u),s+d*Math.sin(u)),t.arc(i,s,d,u,h,!0)),t.closePath();return}else if(this.clipSector==null&&Math.abs(d-p)<1e-6){t.arc(i,s,p,h,u,!1),t.arc(i,s,p,u,h,!0),t.closePath();return}const m=this.getAngleOffset(d),v=this.getAngleOffset(p);if(y<2*v)return;const S=(f?.innerRadius??d)>n,D=d<n||y<2*m,C=p-d,k=Math.max(o,l,a,c),L=k>0?Math.min(C/k,1):1;o*=L,a*=L,l*=L,c*=L;const w=kM(p,y-2*v,-o,-a);if(o*=w,a*=w,!D&&S){const B=kM(d,y-2*m,l,c);l*=B,c*=B}else l=0,c=0;const P=Math.max(o+l,a+c),R=P>0?Math.min(C/P,1):1;o*=R,a*=R,l*=R,c*=R;let G=0,Y=0;const he=o/(p-o),se=a/(p-a);if(he>=0&&he<1-1e-6)G=Math.asin(he);else{G=y/2;const B=p/(1/Math.sin(G)+1);o=Math.min(B,o)}if(se>=0&&se<1-1e-6)Y=Math.asin(se);else{Y=y/2;const B=p/(1/Math.sin(Y)+1);a=Math.min(B,a)}const de=Math.asin(l/(d+l)),ge=Math.asin(c/(d+c)),ye=f?.outerRadius??p,J=this.getAngleOffset(ye),W=new cf(0,0,ye,h+J,u-J),V=f?.innerRadius??d,ee=this.getAngleOffset(V),ie=S?new cf(0,0,V,h+ee,u-ee):void 0;f!=null&&(W.clipStart(f.startAngle),W.clipEnd(f.endAngle),ie?.clipStart(f.startAngle),ie?.clipEnd(f.endAngle));const ne=this.arc(o,G,h-Math.PI*.5,h+G,W,ie,!0,!1),me=this.arc(a,Y,u-Y,u+Math.PI*.5,W,ie,!1,!1),Z=this.arc(c,ge,u+Math.PI*.5,u+Math.PI-ge,W,ie,!1,!0),te=this.arc(l,de,h+Math.PI+de,h+Math.PI*1.5,W,ie,!0,!0);if(D){const B=y<Math.PI*.5?r*(1+Math.cos(y))/Math.sin(y):NaN;let q;B>0&&B<p?q=Math.max(Math.hypot(r,B),d):q=r,q=Math.max(q,d);const X=h+y*.5;t.moveTo(i+q*Math.cos(X),s+q*Math.sin(X))}else if(!(te?.isValid()===!0||ie?.isValid()===!0)){const B=h+y/2,q=d*Math.cos(B),X=d*Math.sin(B);t.moveTo(i+q,s+X)}if(ne?.isValid()===!0){const{cx:B,cy:q,r:X,a0:fe,a1:Ie}=ne;t.arc(i+B,s+q,X,fe,Ie)}if(W.isValid()){const{r:B,a0:q,a1:X}=W;t.arc(i,s,B,q,X)}if(me?.isValid()===!0){const{cx:B,cy:q,r:X,a0:fe,a1:Ie}=me;t.arc(i+B,s+q,X,fe,Ie)}if(!D){if(Z?.isValid()===!0){const{cx:B,cy:q,r:X,a0:fe,a1:Ie}=Z;t.arc(i+B,s+q,X,fe,Ie)}if(ie?.isValid()===!0){const{r:B,a0:q,a1:X}=ie;t.arc(i,s,B,X,q,!0)}if(te?.isValid()===!0){const{cx:B,cy:q,r:X,a0:fe,a1:Ie}=te;t.arc(i+B,s+q,X,fe,Ie)}}t.closePath()}isPointInPath(e,t){const{startAngle:i,endAngle:s,innerRadius:n,outerRadius:r}=this.clipSector??this;return ou(e-this.centerX,t-this.centerY,{startAngle:i,endAngle:s,innerRadius:Math.min(n,r),outerRadius:Math.max(n,r)})}};Ft.className="Sector",g([_()],Ft.prototype,"centerX",2),g([_()],Ft.prototype,"centerY",2),g([_()],Ft.prototype,"innerRadius",2),g([_()],Ft.prototype,"outerRadius",2),g([_()],Ft.prototype,"startAngle",2),g([_()],Ft.prototype,"endAngle",2),g([Ai({equals:(e,t)=>e.equals(t)})],Ft.prototype,"clipSector",2),g([_()],Ft.prototype,"concentricEdgeInset",2),g([_()],Ft.prototype,"radialEdgeInset",2),g([_()],Ft.prototype,"startOuterCornerRadius",2),g([_()],Ft.prototype,"endOuterCornerRadius",2),g([_()],Ft.prototype,"startInnerCornerRadius",2),g([_()],Ft.prototype,"endInnerCornerRadius",2);var lt={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},Ps={BLUE:"#2b5c95",ORANGE:"#cc6f10",GREEN:"#1e652e",CYAN:"#18859e",YELLOW:"#a69400",VIOLET:"#603c88",GRAY:"#575757",MAGENTA:"#7d2f6d",BROWN:"#4f3508",RED:"#a82529"},CM=class extends Ye{constructor(){super(...arguments),this.showInLegend=!1}};g([x],CM.prototype,"showInLegend",2);var hf=class extends At{constructor(){super(...arguments),this.spacing=2}set(e,t){return super.set(e)}};g([x],hf.prototype,"text",2),g([x],hf.prototype,"spacing",2);var uf=class extends le{constructor(){super(...arguments),this.fill="transparent",this.fillOpacity=1}};g([x],uf.prototype,"fill",2),g([x],uf.prototype,"fillOpacity",2);var Uo=class extends At{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};g([x],Uo.prototype,"offset",2),g([x],Uo.prototype,"minAngle",2),g([x],Uo.prototype,"minSpacing",2),g([x],Uo.prototype,"maxCollisionOffset",2),g([x],Uo.prototype,"avoidCollisions",2);var df=class extends At{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};g([x],df.prototype,"positionOffset",2),g([x],df.prototype,"positionRatio",2);var hu=class extends le{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};g([x],hu.prototype,"colors",2),g([x],hu.prototype,"length",2),g([x],hu.prototype,"strokeWidth",2);var be=class extends Ti{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(lt),this.strokes=Object.values(Ps),this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.outerRadiusOffset=0,this.outerRadiusRatio=1,this.strokeWidth=1,this.sectorSpacing=0,this.hideZeroValueSectorsInLegend=!1,this.innerLabels=new Ia(hf),this.title=new CM,this.innerCircle=new uf,this.shadow=new ps,this.calloutLabel=new Uo,this.sectorLabel=new df,this.calloutLine=new hu,this.tooltip=new Qt}};g([x],be.prototype,"angleKey",2),g([x],be.prototype,"angleName",2),g([x],be.prototype,"angleFilterKey",2),g([x],be.prototype,"radiusKey",2),g([x],be.prototype,"radiusName",2),g([x],be.prototype,"radiusMin",2),g([x],be.prototype,"radiusMax",2),g([x],be.prototype,"calloutLabelKey",2),g([x],be.prototype,"calloutLabelName",2),g([x],be.prototype,"sectorLabelKey",2),g([x],be.prototype,"sectorLabelName",2),g([x],be.prototype,"legendItemKey",2),g([x],be.prototype,"defaultColorRange",2),g([x],be.prototype,"defaultPatternFills",2),g([x],be.prototype,"fills",2),g([x],be.prototype,"strokes",2),g([x],be.prototype,"fillOpacity",2),g([x],be.prototype,"strokeOpacity",2),g([x],be.prototype,"lineDash",2),g([x],be.prototype,"lineDashOffset",2),g([x],be.prototype,"cornerRadius",2),g([x],be.prototype,"itemStyler",2),g([x],be.prototype,"rotation",2),g([x],be.prototype,"outerRadiusOffset",2),g([x],be.prototype,"outerRadiusRatio",2),g([x],be.prototype,"innerRadiusOffset",2),g([x],be.prototype,"innerRadiusRatio",2),g([x],be.prototype,"strokeWidth",2),g([x],be.prototype,"sectorSpacing",2),g([x],be.prototype,"hideZeroValueSectorsInLegend",2),g([x],be.prototype,"innerLabels",2),g([x],be.prototype,"title",2),g([x],be.prototype,"innerCircle",2),g([x],be.prototype,"shadow",2),g([x],be.prototype,"calloutLabel",2),g([x],be.prototype,"sectorLabel",2),g([x],be.prototype,"calloutLine",2),g([x],be.prototype,"tooltip",2);function Tr(e,t,i,s){const n=[i.convert(0),i.convert(1)],r=[s.convert(0),s.convert(1)],o=Math.PI/-2+dt(t),a=e?"initial":"update",l=({radius:f})=>({innerRadius:n[0],outerRadius:n[0]+(n[1]-n[0])*f}),c=({radius:f})=>({innerRadius:r[0],outerRadius:r[0]+(r[1]-r[0])*f});return{nodes:{toFn:(f,y,b,{prevLive:m})=>{let{startAngle:v,endAngle:M,innerRadius:S,outerRadius:D}=y;const{stroke:C,fill:k}=y.sectorFormat;if(b==="removed"&&m?(v=m.datum?.endAngle,M=m.datum?.endAngle):b==="removed"&&!m&&(v=o,M=o),b==="removed"){const L=l(y);S=L.innerRadius,D=L.outerRadius}return{startAngle:v,endAngle:M,outerRadius:D,innerRadius:S,stroke:C,fill:k}},fromFn:(f,y,b,{prevFromProps:m})=>{let{startAngle:v,endAngle:M,innerRadius:S,outerRadius:D}=f,{fill:C,stroke:k}=y.sectorFormat;if(b==="updated"&&f.previousDatum==null&&(b="added"),b==="unknown"||b==="added"&&!m?(v=o,M=o,S=y.innerRadius,D=y.outerRadius):b==="added"&&m&&(v=m.endAngle??o,M=m.endAngle??o,S=m.innerRadius??y.innerRadius,D=m.outerRadius??y.outerRadius),b==="added"&&!e){const L=c(y);S=L.innerRadius,D=L.outerRadius}return b==="updated"&&(C=f.fill??C,k=(typeof f.stroke=="string"?f.stroke:void 0)??k),{startAngle:v,endAngle:M,innerRadius:S,outerRadius:D,fill:C,stroke:k,phase:a}}},innerCircle:{fromFn:(f,y)=>({size:f.previousDatum?.radius??f.size??0,phase:a}),toFn:(f,y)=>({size:y.radius??0})}}}function pf(e,t){return{startAngle:t.startAngle,endAngle:t.endAngle,innerRadius:t.innerRadius,outerRadius:t.outerRadius,stroke:t.sectorFormat.stroke}}function gf(e,t){const i=t.y-e.centerY,s=t.x-e.centerX,n=Math.atan2(i,s),r=e.getItemNodes();for(const o of r)if(o.datum.missing!==!0&&bn(n,o.startAngle,o.endAngle)){const a=Math.sqrt(s*s+i*i);let l=0;return a<o.innerRadius?l=o.innerRadius-a:a>o.outerRadius&&(l=a-o.outerRadius),{datum:o.datum,distance:l}}}var wM=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.FOREGROUND=1]="FOREGROUND",e[e.HIGHLIGHT=2]="HIGHLIGHT",e[e.LABEL=3]="LABEL",e))(wM||{}),uu=class extends Pg{constructor({categoryKey:e,useLabelLayer:t=!1,pickModes:i=[1,0],canHaveAxes:s=!1,animationResetFns:n,...r}){super({...r,categoryKey:e,useLabelLayer:t,pickModes:i,directionKeys:{angle:["angleKey"],radius:["radiusKey"]},directionNames:{angle:["angleName"],radius:["radiusName"]},canHaveAxes:s}),this.directions=["angle","radius"],this.itemGroup=this.contentGroup.appendChild(new ue),this.nodeData=[],this.itemSelection=ht.select(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=ht.select(this.labelGroup,()=>this.labelFactory(),!1),this.highlightSelection=ht.select(this.highlightGroup,()=>this.nodeFactory()),this.highlightLabelSelection=ht.select(this.highlightLabel,()=>this.labelFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.animationResetFns=n,this.animationState=new Va("empty",{empty:{update:{target:"ready",action:o=>this.animateEmptyUpdateReady(o)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:o=>this.animateReadyHighlight(o),highlightMarkers:o=>this.animateReadyHighlightMarkers(o),resize:o=>this.animateReadyResize(o),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:o=>this.animateWaitingUpdateReady(o)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:o=>this.animateClearingUpdateEmpty(o)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getItemNodes(){return[...this.itemGroup.children()]}getNodeData(){return this.nodeData}setSeriesIndex(e){return super.setSeriesIndex(e)?(this.contentGroup.zIndex=[e,1],this.highlightGroup.zIndex=[e,2],this.labelGroup.zIndex=[e,3],!0):!1}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}labelFactory(){const e=new St;return e.pointerEvents=1,e}addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager?.addListener("legend-item-click",e=>this.onLegendItemClick(e)),this.ctx.chartEventManager?.addListener("legend-item-double-click",e=>this.onLegendItemDoubleClick(e)))}getInnerRadius(){return 0}computeLabelsBBox(e,t){return null}getShapeFillBBox(){const e=this.radius;return{series:new U(-e,-e,e*2,e*2),axis:new U(-e,-e,e*2,e*2)}}resetAllAnimation(){const{item:e,label:t}=this.animationResetFns??{};this.ctx.animationManager.stopByAnimationGroupId(this.id),e&&It([this.itemSelection,this.highlightSelection],e),t&&It([this.labelSelection,this.highlightLabelSelection],t),this.itemSelection.cleanup(),this.labelSelection.cleanup(),this.highlightSelection.cleanup(),this.highlightLabelSelection.cleanup()}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateReadyHighlight(e){const{item:t,label:i}=this.animationResetFns??{};t&&It([this.highlightSelection],t),i&&It([this.highlightLabelSelection],i)}animateReadyHighlightMarkers(e){}animateReadyResize(e){this.resetAllAnimation()}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}computeFocusBounds(e){const t=this.getNodeData()?.[e.datumIndex];if(t!==void 0)return this.itemSelection.select(i=>i instanceof oi&&i.datum===t)[0]}getSeriesRange(e,t){return[NaN,NaN]}},hO=class extends Za{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey,this.calloutLabelKey=s.properties.calloutLabelKey,this.sectorLabelKey=s.properties.sectorLabelKey}},du=class extends uu{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[1,0],useLabelLayer:!0,animationResetFns:{item:pf,label:tn}}),this.properties=new be,this.phantomNodeData=void 0,this.backgroundGroup=new Ot({name:`${this.id}-background`,zIndex:0}),this.noVisibleData=!1,this.previousRadiusScale=new us,this.radiusScale=new us,this.phantomGroup=this.backgroundGroup.appendChild(new ue({name:"phantom"})),this.phantomSelection=ht.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new ue({name:"pieCalloutLabels"})),this.calloutLabelSelection=new ht(this.calloutLabelGroup,ue),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new ue({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new Lt({shape:"circle"})),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new Lt({shape:"circle"})),this.innerLabelsGroup=this.contentGroup.appendChild(new ue({name:"innerLabels"})),this.innerCircleGroup=this.backgroundGroup.appendChild(new ue({name:`${this.id}-innerCircle`})),this.innerLabelsSelection=ht.select(this.innerLabelsGroup,St),this.innerCircleSelection=ht.select(this.innerCircleGroup,()=>new Lt({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=hO,this.angleScale=new us,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(t=>t+Math.PI/2),this.phantomGroup.opacity=.2}get calloutNodeData(){return this.phantomNodeData??this.nodeData}attachSeries(e,t,i){super.attachSeries(e,t,i),e?.appendChild(this.backgroundGroup)}detachSeries(e,t,i){super.detachSeries(e,t,i),e?.removeChild(this.backgroundGroup)}setSeriesIndex(e){return super.setSeriesIndex(e)?(this.backgroundGroup.zIndex=[0,e],!0):!1}nodeFactory(){return new Ft}getSeriesDomain(e){return e==="angle"?this.angleScale.domain:this.radiusScale.domain}async processData(e){if(this.data==null)return;const{visible:t,id:i,ctx:{legendManager:s}}=this,{angleKey:n,angleFilterKey:r,radiusKey:o,calloutLabelKey:a,sectorLabelKey:l,legendItemKey:c}=this.properties,h=()=>(b,m)=>t&&s.getItemEnabled({seriesId:i,itemId:m})?b:0,u=!this.ctx.animationManager.isSkipped(),d=[],p=[];c?d.push(hs(c,"band",{id:"legendItemKey"})):a?d.push(hs(a,"band",{id:"calloutLabelKey"})):l&&d.push(hs(l,"band",{id:"sectorLabelKey"}));const f=this.radiusScale.type,y=this.angleScale.type;o&&p.push(pg(o,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,missingValue:this.properties.radiusMax??1,processor:h}),Me(o,f,{id:"radiusRaw",processor:h}),vr("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),a&&p.push(Me(a,"band",{id:"calloutLabelValue"})),l&&p.push(Me(l,"band",{id:"sectorLabelValue"})),c&&p.push(Me(c,"band",{id:"legendItemValue"})),r&&p.push(sl(r,y,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:h}),Me(r,y,{id:"angleFilterRaw"}),vr("angleFilterValue",[0,1],0,0)),u&&this.processedData&&d.length>0&&p.push(Po(this.id,this.processedData)),p.push(Eo()),await this.requestDataModel(e,this.data,{props:[...d,sl(n,y,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:h}),Me(n,y,{id:"angleRaw"}),vr("angleValue",[0,1],0,0),...p]});for(const b of this.processedData?.defs?.values??[]){const{id:m,missing:v,property:M}=b,S=Ip(this,v);m!=="angleRaw"&&S>0&&SM.Logger.warnOnce(`no value was found for the key '${String(M)}' on ${S} data element${S>1?"s":""}`)}this.animationState.transition("updateData")}maybeRefreshNodeData(){if(!this.nodeDataRefresh)return;const{nodeData:e=[],phantomNodeData:t}=this.createNodeData()??{};this.nodeData=e,this.phantomNodeData=t,this.nodeDataRefresh=!1}getProcessedDataValues(e,t){const i=e.resolveColumnById(this,"angleValue",t),s=e.resolveColumnById(this,"angleRaw",t),n=this.properties.angleFilterKey!=null?e.resolveColumnById(this,"angleFilterValue",t):void 0,r=this.properties.angleFilterKey!=null?e.resolveColumnById(this,"angleFilterRaw",t):void 0,o=this.properties.radiusKey?e.resolveColumnById(this,"radiusValue",t):void 0,a=this.properties.radiusKey?e.resolveColumnById(this,"radiusRaw",t):void 0,l=this.properties.calloutLabelKey?e.resolveColumnById(this,"calloutLabelValue",t):void 0,c=this.properties.sectorLabelKey?e.resolveColumnById(this,"sectorLabelValue",t):void 0,h=this.properties.legendItemKey?e.resolveColumnById(this,"legendItemValue",t):void 0;return{angleValues:i,angleRawValues:s,angleFilterValues:n,angleFilterRawValues:r,radiusValues:o,radiusRawValues:a,calloutLabelValues:l,sectorLabelValues:c,legendItemValues:h}}createNodeData(){const{id:e,processedData:t,dataModel:i,angleScale:s,ctx:{legendManager:n},visible:r}=this,{rotation:o,innerRadiusRatio:a}=this.properties;if(!i||t?.type!=="ungrouped")return;const{angleValues:l,angleRawValues:c,angleFilterValues:h,angleFilterRawValues:u,radiusValues:d,radiusRawValues:p,calloutLabelValues:f,sectorLabelValues:y,legendItemValues:b}=this.getProcessedDataValues(i,t),m=u?.some((L,w)=>L>c[w])??!1;let v=0,M=0;const S=[],D=u!=null?[]:void 0,C=t.dataSources.get(this.id)??[],k=t.invalidData?.get(this.id);return C.forEach((L,w)=>{if(k?.[w]===!0)return;const P=m?h[w]:l[w],R=u!=null&&!m?Math.sqrt(u[w]/c[w]):1,G=s.convert(v)+dt(o);v=P,M+=P;const Y=s.convert(v)+dt(o),he=Math.abs(Y-G),se=G+he/2,de=c[w],ye=(d?.[w]??1)*R,J=p?.[w],W=b?.[w],V=this.getLabels(L,se,he,!0,f?.[w],y?.[w],W),ee=this.getSectorFormat(L,w,!1),ie={itemId:w,series:this,datum:L,datumIndex:w,angleValue:de,midAngle:se,midCos:Math.cos(se),midSin:Math.sin(se),startAngle:G,endAngle:Y,radius:ye,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(ye),0),sectorFormat:ee,radiusValue:J,legendItemValue:W,enabled:r&&n.getItemEnabled({seriesId:e,itemId:w}),focusable:!0,...V};S.push(ie),D?.push({...ie,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0),focusable:!1})}),this.zerosumOuterRing.visible=M===0,this.zerosumInnerRing.visible=M===0&&a!=null&&a!==1&&a>0,{itemId:e,nodeData:S,labelData:S,phantomNodeData:D}}getLabels(e,t,i,s,n,r,o){const{calloutLabel:a,sectorLabel:l,legendItemKey:c}=this.properties,h=!s||a.enabled?this.properties.calloutLabelKey:void 0,u=!s||l.enabled?this.properties.sectorLabelKey:void 0;if(!h&&!u&&!c)return{};const d={datum:e,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},p={};return h&&i>=dt(a.minAngle)&&(p.calloutLabel={...this.getTextAlignment(t),text:this.getLabelText(a,{...d,value:n}),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),u&&(p.sectorLabel={text:this.getLabelText(l,{...d,value:r})}),c!=null&&o!=null&&(p.legendItem={key:c,text:o}),p}getTextAlignment(e){const t=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=Ma(e),s=-.75*Math.PI,n=i-s,r=Math.floor(n/(Math.PI/2)),o=(0,SM.modulus)(r,t.length);return t[o]}getNodeFill(e,t,i){return mr(e,{type:"gradient",bounds:"series",colorStops:t.map(s=>({color:s})),gradient:"radial",rotation:0,reverse:!0},{type:"pattern",pattern:"forward-slanted-lines",fill:i,fillOpacity:1,backgroundFill:"none",backgroundFillOpacity:1,stroke:i,strokeOpacity:1,strokeWidth:4,rotation:0},{type:"image",backgroundFill:i,backgroundFillOpacity:1,fit:"contain",repeat:"no-repeat",rotation:0})}getFillParams(e,t,i){if(!(!is(e)||e.bounds==="item"))return{centerX:0,centerY:0,innerRadius:t,outerRadius:i}}getSectorFormat(e,t,i){const{angleKey:s,radiusKey:n,calloutLabelKey:r,sectorLabelKey:o,legendItemKey:a,fills:l,strokes:c,defaultColorRange:h,defaultPatternFills:u,itemStyler:d}=this.properties,p=c[t%c.length],{fill:f,fillOpacity:y,stroke:b,strokeWidth:m,strokeOpacity:v,lineDash:M,lineDashOffset:S,cornerRadius:D}=xe(i&&this.properties.highlightStyle.item,{fill:l.length>0?l[t%l.length]:void 0,stroke:p,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()},this.properties),C=h[t%h.length],k=u[t%u.length],L=f??"black";let w;return d&&(w=this.cachedDatumCallback(this.getDatumId(t)+(i?"-highlight":"-hide"),()=>this.callWithContext(d,{datum:e,angleKey:s,radiusKey:n,calloutLabelKey:r,sectorLabelKey:o,legendItemKey:a,fill:this.getNodeFill(L,C,k),fillOpacity:y,stroke:b,strokeWidth:m,strokeOpacity:v,lineDash:M,lineDashOffset:S,cornerRadius:D,highlighted:i,seriesId:this.id}))),{fill:this.getNodeFill(w?.fill??L,C,k),fillOpacity:w?.fillOpacity??y,stroke:w?.stroke??b,strokeWidth:w?.strokeWidth??m,strokeOpacity:w?.strokeOpacity??v,lineDash:w?.lineDash??M,lineDashOffset:w?.lineDashOffset??S,cornerRadius:w?.cornerRadius??D}}getInnerRadius(){const{radius:e}=this,{innerRadiusRatio:t=1,innerRadiusOffset:i=0}=this.properties,s=e*t+i;return s===e||s<0?0:s}getOuterRadius(){const{outerRadiusRatio:e,outerRadiusOffset:t}=this.properties;return Math.max(this.radius*e+t,0)}updateRadiusScale(e){const t=[this.getInnerRadius(),this.getOuterRadius()];this.radiusScale.range=t,e&&(this.previousRadiusScale.range=t);const i=s=>({...s,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(s.radius),0)});this.nodeData=this.nodeData.map(i),this.phantomNodeData=this.phantomNodeData?.map(i)}getTitleTranslationY(){const e=Math.max(0,this.radiusScale.range[1]);if(e===0)return NaN;const i=2+(this.properties.title?.spacing??0),s=Math.max(0,-e);return-e-i-s}update({seriesRect:e}){const{title:t}=this.properties,i={seriesRectWidth:e?.width,seriesRectHeight:e?.height},s=Ss(this.nodeDataDependencies,i)!=null;if(s&&(this._nodeDataDependencies=i),this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(s),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),t){const n=this.getTitleTranslationY();t.node.y=isFinite(n)?n:0;const r=t.node.getBBox();t.node.visible=t.enabled&&isFinite(n)&&!this.bboxIntersectsSurroundingSeries(r)}for(const n of[this.zerosumInnerRing,this.zerosumOuterRing])n.fillOpacity=0,n.stroke=this.properties.calloutLabel.color,n.strokeWidth=1,n.strokeOpacity=1;this.updateNodeMidPoint(),this.updateSelections(),this.updateNodes(e)}updateTitleNodes(){const{oldTitle:e}=this,{title:t}=this.properties;e!==t&&(e&&this.labelGroup?.removeChild(e.node),t&&(t.node.textBaseline="bottom",this.labelGroup?.appendChild(t.node)),this.oldTitle=t)}updateNodeMidPoint(){const e=t=>{const i=t.innerRadius+(t.outerRadius-t.innerRadius)/2;t.midPoint={x:t.midCos*Math.max(0,i),y:t.midSin*Math.max(0,i)}};this.nodeData.forEach(e),this.phantomNodeData?.forEach(e)}updateSelections(){this.updateGroupSelection(),this.updateInnerCircleSelection()}updateGroupSelection(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,highlightLabelSelection:s,calloutLabelSelection:n,labelSelection:r,innerLabelsSelection:o}=this,a=this.nodeData.map(c=>({...c,sectorFormat:{...c.sectorFormat}})),l=(c,h)=>{c.update(h,void 0,u=>this.getDatumId(u.datumIndex)),this.ctx.animationManager.isSkipped()&&c.cleanup()};l(e,this.nodeData),l(t,a),l(i,this.phantomNodeData??[]),n.update(this.calloutNodeData,c=>{const h=new Xt;h.tag=0,h.pointerEvents=1,c.appendChild(h);const u=new St;u.tag=1,u.pointerEvents=1,c.appendChild(u)}),r.update(this.nodeData),s.update(a),o.update(this.properties.innerLabels,c=>{c.pointerEvents=1})}updateInnerCircleSelection(){const{innerCircle:e}=this.properties;let t=0;const i=this.getInnerRadius();if(i>0){const n=Math.min(i,this.getOuterRadius()),r=1;t=Math.ceil(n*2+r)}const s=e?[{radius:t}]:[];this.innerCircleSelection.update(s)}updateNodes(e){const t=this.ctx.highlightManager.getActiveHighlight(),{visible:i}=this;this.backgroundGroup.visible=i,this.contentGroup.visible=i,this.highlightGroup.visible=i&&t?.series===this,this.highlightLabel.visible=i&&t?.series===this,this.labelGroup.visible=i,this.contentGroup.opacity=this.getOpacity(),this.innerCircleSelection.each((l,{radius:c})=>{l.setProperties({fill:this.getNodeFill(this.properties.innerCircle?.fill,["black"],"black"),opacity:this.properties.innerCircle?.fillOpacity,size:c})});const s=this.radiusScale.range[0],n=this.radiusScale.range[1],r=this.getShapeFillBBox(),o=this.ctx.animationManager.isSkipped(),a=(l,c,h,u)=>{const d=this.getSectorFormat(c.datum,c.itemId,u);c.sectorFormat.fill=d.fill,c.sectorFormat.stroke=d.stroke,o&&(l.startAngle=c.startAngle,l.endAngle=c.endAngle,l.innerRadius=c.innerRadius,l.outerRadius=c.outerRadius),(u||o)&&(l.fill=d.fill,l.stroke=d.stroke);const p=this.getFillParams(d.fill,s,n);mh(l,d.fill,r,p),l.strokeWidth=d.strokeWidth,l.fillOpacity=d.fillOpacity,l.strokeOpacity=d.strokeOpacity,l.lineDash=d.lineDash,l.lineDashOffset=d.lineDashOffset,l.cornerRadius=d.cornerRadius,l.fillShadow=this.properties.shadow;const f=Math.max((this.properties.sectorSpacing+(d.stroke!=null?d.strokeWidth:0))/2,0);l.inset=f,l.lineJoin=this.properties.sectorSpacing>=0||f>0?"miter":"round"};this.itemSelection.each((l,c,h)=>a(l,c,h,!1)),this.highlightSelection.each((l,c,h)=>{a(l,c,h,!0),l.visible=c.itemId===t?.itemId}),this.phantomSelection.each((l,c,h)=>a(l,c,h,!1)),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(e),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{calloutLine:{length:e,strokeWidth:t,colors:i},strokes:s}=this.properties,n=t,r=Vy(i)?i??this.properties.strokes:s,{offset:o}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach(a=>{const l=a.closestDatum(),{calloutLabel:c,outerRadius:h,datumIndex:u}=l;if(c?.text&&!c.hidden&&h!==0){a.visible=!0,a.strokeWidth=n,a.stroke=r[u%r.length],a.fill=void 0;const d=l.midCos*h,p=l.midSin*h;let f=l.midCos*(h+e),y=l.midSin*(h+e);if((c.collisionTextAlign??c.collisionOffsetY!==0)&&c.box!=null){const m=c.box;let v=f,M=y;f<m.x?v=m.x:f>m.x+m.width&&(v=m.x+m.width),y<m.y?M=m.y:y>m.y+m.height&&(M=m.y+m.height);const S=v-f,D=M-y,C=Math.sqrt(Math.pow(S,2)+Math.pow(D,2)),k=C-o;k>0&&(f=f+S*k/C,y=y+D*k/C)}a.x1=d,a.y1=p,a.x2=f,a.y2=y}else a.visible=!1})}getLabelOverflow(e,t,i){const s=-this.centerX,n=s+i.width,r=-this.centerY,o=r+i.height,a=1;let l=1;t.x+a<s?l=(t.x+t.width-s)/t.width:t.x+t.width-a>n&&(l=(n-t.x)/t.width);const c=t.y+a<r||t.y+t.height-a>o,h=l===1?e.length:Math.floor(e.length*l)-1,u=this.bboxIntersectsSurroundingSeries(t);return{textLength:h,hasVerticalOverflow:c,hasSurroundingSeriesOverflow:u}}bboxIntersectsSurroundingSeries(e){const{surroundingRadius:t}=this;if(t==null)return!1;const i=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],s=t**2;return i.some(n=>n.x**2+n.y**2>s)}computeCalloutLabelCollisionOffsets(){const{radiusScale:e}=this,{calloutLabel:t,calloutLine:i}=this.properties,{offset:s,minSpacing:n}=t,r=e.convert(0),o=m=>!m.calloutLabel||m.outerRadius===0,a=this.calloutNodeData,l=a.filter(m=>!o(m));if(l.forEach(m=>{const v=m.calloutLabel;v!=null&&(v.hidden=!1,v.collisionTextAlign=void 0,v.collisionOffsetY=0)}),l.length<=1)return;const c=l.filter(m=>m.midCos<0).sort((m,v)=>m.midSin-v.midSin),h=l.filter(m=>m.midCos>=0).sort((m,v)=>m.midSin-v.midSin),u=l.filter(m=>m.midSin<0&&m.calloutLabel?.textAlign==="center").sort((m,v)=>m.midCos-v.midCos),d=l.filter(m=>m.midSin>=0&&m.calloutLabel?.textAlign==="center").sort((m,v)=>m.midCos-v.midCos),p=m=>{const v=m.calloutLabel;if(v==null)return U.zero.clone();const M=m.outerRadius+i.length+s,S=m.midCos*M,D=m.midSin*M+v.collisionOffsetY,C=v.collisionTextAlign??v.textAlign,k=v.textBaseline;return St.computeBBox(v.text,S,D,{font:this.properties.calloutLabel,textAlign:C,textBaseline:k})},f=(m,v,M)=>{const S=p(m).grow(n/2),D=p(v).grow(n/2);S.x<D.x+D.width&&S.x+S.width>D.x&&(M==="to-top"?S.y<D.y+D.height:S.y+S.height>D.y)&&(v.calloutLabel.collisionOffsetY=M==="to-top"?S.y-D.y-D.height:S.y+S.height-D.y)},y=m=>{const v=m.slice().sort((S,D)=>Math.abs(S.midSin)-Math.abs(D.midSin))[0],M=m.indexOf(v);for(let S=M-1;S>=0;S--){const D=m[S+1],C=m[S];f(D,C,"to-top")}for(let S=M+1;S<m.length;S++){const D=m[S-1],C=m[S];f(D,C,"to-bottom")}},b=m=>{const v=l.some(L=>L.calloutLabel.collisionOffsetY!==0),M=m.map(L=>p(L)),S=M.map(L=>L.clone().grow(n/2));let D=!1;for(let L=0;L<S.length&&!D;L++){const w=S[L];for(let P=L+1;P<m.length;P++){const R=S[P];if(w.collidesBBox(R)){D=!0;break}}}const C=a.map(L=>{const{startAngle:w,endAngle:P,outerRadius:R}=L;return{startAngle:w,endAngle:P,innerRadius:r,outerRadius:R}}),k=M.some(L=>C.some(w=>LM(L,w)));!D&&!v&&!k||m.filter(L=>L.calloutLabel.textAlign==="center").forEach(L=>{const w=L.calloutLabel;L.midCos<0?w.collisionTextAlign="right":L.midCos>0?w.collisionTextAlign="left":w.collisionTextAlign="center"})};y(c),y(h),b(u),b(d)}updateCalloutLabelNodes(e){const{radiusScale:t}=this,{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:r,color:o}=i,a=new St;this.calloutLabelSelection.selectByTag(1).forEach(l=>{const c=l.closestDatum(),h=c.calloutLabel,u=t.convert(c.radius),d=Math.max(0,u);if(!h?.text||d===0||h.hidden){l.visible=!1;return}const p=d+n+r,f=c.midCos*p,y=c.midSin*p+h.collisionOffsetY,b={textAlign:h.collisionTextAlign??h.textAlign,textBaseline:h.textBaseline};a.text=h.text,a.x=f,a.y=y,a.setFont(this.properties.calloutLabel),a.setAlign(b);const m=a.getBBox();let v=h.text,M=!0;if(i.avoidCollisions){const{textLength:S,hasVerticalOverflow:D}=this.getLabelOverflow(h.text,m,e);v=h.text.length===S?h.text:`${h.text.substring(0,S)}\u2026`,M=!D}l.text=v,l.x=f,l.y=y,l.setFont(this.properties.calloutLabel),l.setAlign(b),l.fill=o,l.visible=M})}computeLabelsBBox(e,t){const{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:r,maxCollisionOffset:o,minSpacing:a}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],c=new St;let h;const{title:u}=this.properties;if(u?.text&&u.enabled){const d=this.getTitleTranslationY();isFinite(d)&&(c.text=u.text,c.x=0,c.y=d,c.setFont(u),c.setAlign({textBaseline:"bottom",textAlign:"center"}),h=c.getBBox(),l.push(h))}return this.calloutNodeData.forEach(d=>{const p=d.calloutLabel;if(!p||d.outerRadius===0)return null;const f=d.outerRadius+n+r,y=d.midCos*f,b=d.midSin*f+p.collisionOffsetY;c.text=p.text,c.x=y,c.y=b,c.setFont(this.properties.calloutLabel),c.setAlign({textAlign:p.collisionTextAlign??p.textAlign,textBaseline:p.textBaseline});const m=c.getBBox();if(p.box=m,Math.abs(p.collisionOffsetY)>o){p.hidden=!0;return}if(h){const v=-this.centerY,M=new U(h.x-a,v,h.width+2*a,h.y+h.height+a-v);if(m.collidesBBox(M)){p.hidden=!0;return}}if(e.hideWhenNecessary){const{textLength:v,hasVerticalOverflow:M,hasSurroundingSeriesOverflow:S}=this.getLabelOverflow(p.text,m,t),D=p.text.length>2&&v<2;if(M||D||S){p.hidden=!0;return}}p.hidden=!1,l.push(m)}),l.length===0?null:U.merge(l)}updateSectorLabelNodes(){const{radiusScale:e}=this,t=e.convert(0),{fontSize:i,fontStyle:s,fontWeight:n,fontFamily:r,positionOffset:o,positionRatio:a,color:l}=this.properties.sectorLabel,c=(h,u)=>{const{sectorLabel:d,outerRadius:p}=u;let f=!1;if(d&&p!==0){const y=t*(1-a)+p*a+o;h.fill=l,h.fontStyle=s,h.fontWeight=n,h.fontSize=i,h.fontFamily=r,h.text=d.text,h.x=u.midCos*y,h.y=u.midSin*y,h.textAlign="center",h.textBaseline="middle";const b=h.getBBox(),m=[[b.x,b.y],[b.x+b.width,b.y],[b.x+b.width,b.y+b.height],[b.x,b.y+b.height]],{startAngle:v,endAngle:M}=u,S={startAngle:v,endAngle:M,innerRadius:t,outerRadius:p};m.every(([D,C])=>ou(D,C,S))&&(f=!0)}h.visible=f};this.labelSelection.each(c),this.highlightLabelSelection.each(c)}updateInnerLabelNodes(){const e=[],t=[];this.innerLabelsSelection.each((h,u)=>{const{fontStyle:d,fontWeight:p,fontSize:f,fontFamily:y,color:b}=u;h.fontStyle=d,h.fontWeight=p,h.fontSize=f,h.fontFamily=y,h.text=u.text,h.x=0,h.y=0,h.fill=b,h.textAlign="center",h.textBaseline="alphabetic",e.push(h.getBBox()),t.push(u.spacing)});const i=h=>h===0?0:t[h],s=h=>h===t.length-1?0:t[h],n=e.reduce((h,u,d)=>h+u.height+i(d)+s(d),0),r=Math.max(...e.map(h=>h.width)),o=this.getInnerRadius(),l=Math.sqrt(Math.pow(r/2,2)+Math.pow(n/2,2))<=(o>0?o:this.getOuterRadius()),c=[];for(let h=0,u=-n/2;h<e.length;h++){const p=e[h].height+u+i(h);c.push(p),u=p+s(h)}this.innerLabelsSelection.each((h,u,d)=>{h.y=c[d],h.visible=l})}updateZerosumRings(){this.zerosumOuterRing.size=this.getOuterRadius()*2,this.zerosumInnerRing.size=this.getInnerRadius()*2}pickNodeClosestDatum(e){return gf(this,e)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n}=this,{legendItemKey:r,calloutLabelKey:o,calloutLabelName:a,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:u,radiusKey:d,radiusName:p,tooltip:f}=n,y=this.properties.title.text;if(!i||!s)return;const b=s.dataSources.get(this.id)?.[e],{angleRawValues:m,legendItemValues:v,calloutLabelValues:M,sectorLabelValues:S}=this.getProcessedDataValues(i,s),D=m[e],C=v?.[e]??(o===h?void 0:M?.[e])??(l===h?void 0:S?.[e])??u;return this.formatTooltipWithContext(f,{title:y,symbol:this.legendItemSymbol(e),data:[{label:C,fallbackLabel:h,value:Hs(D,3)}]},{seriesId:t,datum:b,title:u,legendItemKey:r,calloutLabelKey:o,calloutLabelName:a,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:u,radiusKey:d,radiusName:p,...this.getSectorFormat(b,e,!1)})}legendItemSymbol(e){const t=this.processedData?.dataSources.get(this.id)?.[e],i=this.getSectorFormat(t,e,!1),{fillOpacity:s,strokeOpacity:n,strokeWidth:r,lineDash:o,lineDashOffset:a}=this.properties;let{fill:l}=i;const{stroke:c}=i;return is(l)&&(l={...l,gradient:"linear",rotation:0,reverse:!1}),{marker:{fill:l,stroke:c,fillOpacity:s,strokeOpacity:n,strokeWidth:r,lineDash:o,lineDashOffset:a}}}getLegendData(e){const{visible:t,processedData:i,dataModel:s,id:n,ctx:{legendManager:r}}=this;if(!s||!i||e!=="category")return[];const{angleKey:o,calloutLabelKey:a,sectorLabelKey:l,legendItemKey:c,showInLegend:h}=this.properties;if(!c&&(!a||a===o)&&(!l||l===o))return[];const{angleRawValues:u,calloutLabelValues:d,sectorLabelValues:p,legendItemValues:f}=this.getProcessedDataValues(s,i),y=this.properties.title?.showInLegend&&this.properties.title.text,b=[],m=this.properties.hideZeroValueSectorsInLegend,v=i.dataSources.get(this.id),M=i.invalidData?.get(this.id);for(let S=0;S<i.input.count;S++){const D=v?.[S],C=u[S];if(M?.[S]===!0||m&&C===0)continue;const k=[];y&&k.push(y);const L=this.getLabels(D,2*Math.PI,2*Math.PI,!1,d?.[S],p?.[S],f?.[S]);c&&L.legendItem!==void 0?k.push(L.legendItem.text):a&&a!==o&&L.calloutLabel?.text!==void 0?k.push(L.calloutLabel?.text):l&&l!==o&&L.sectorLabel?.text!==void 0&&k.push(L.sectorLabel?.text),k.length!==0&&b.push({legendType:"category",id:n,datum:D,itemId:S,seriesId:n,hideToggleOtherSeries:!0,enabled:t&&r.getItemEnabled({seriesId:n,itemId:S}),label:{text:k.join(" - ")},symbol:this.legendItemSymbol(S),legendItemName:c!=null?D[c]:void 0,hideInLegend:!h})}return b}setLegendState(e){const{id:t,ctx:{legendManager:i,updateService:s}}=this;e.forEach((n,r)=>i.toggleItem(n,t,r)),i.update(),s.update(5)}animateEmptyUpdateReady(e){const{animationManager:t}=this.ctx,i=Tr(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);Xe(this.id,"nodes",t,[this.itemSelection,this.highlightSelection,this.phantomSelection],i.nodes,(s,n)=>this.getDatumId(n.datumIndex)),Xe(this.id,"innerCircle",t,[this.innerCircleSelection],i.innerCircle),Ce(this,"callout",t,this.calloutLabelSelection),Ce(this,"sector",t,this.labelSelection),Ce(this,"highlight",t,this.highlightLabelSelection),Ce(this,"inner",t,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,processedData:s,radiusScale:n,previousRadiusScale:r}=this,{animationManager:o}=this.ctx,a=s?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=(a?.moved.size??0)===0,c=(s?.defs.keys.length??0)>0,h=s?.reduced?.animationValidation?.uniqueKeys??!0;(!l||!c||!h)&&this.ctx.animationManager.skipCurrentBatch();const u=!this.nodeData.some(p=>p.enabled),d=Tr(!1,this.properties.rotation,n,r);Xe(this.id,"nodes",o,[e,t,i],d.nodes,(p,f)=>this.getDatumId(f.datumIndex),a),Xe(this.id,"innerCircle",o,[this.innerCircleSelection],d.innerCircle),Ce(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Ce(this,"sector",this.ctx.animationManager,this.labelSelection),Ce(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.noVisibleData!==u&&(this.noVisibleData=u,Ce(this,"inner",this.ctx.animationManager,this.innerLabelsSelection)),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,radiusScale:s,previousRadiusScale:n}=this,{animationManager:r}=this.ctx,o=Tr(!1,this.properties.rotation,s,n);Xe(this.id,"nodes",r,[e,t,i],o.nodes,(a,l)=>this.getDatumId(l.datumIndex)),Xe(this.id,"innerCircle",r,[this.innerCircleSelection],o.innerCircle),Fn(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Fn(this,"sector",this.ctx.animationManager,this.labelSelection),Fn(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),Fn(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(e){return`${e}`}};du.className="DonutSeries",du.type="donut";var Ei=(O(),N(T)),Q=(O(),N(T)),ff={radiusMin:Q.positiveNumber,radiusMax:Q.positiveNumber,rotation:Q.number,outerRadiusOffset:Q.number,outerRadiusRatio:Q.ratio,hideZeroValueSectorsInLegend:Q.boolean,sectorSpacing:Q.positiveNumber,cornerRadius:Q.positiveNumber,itemStyler:(0,Q.callbackDefs)({...Q.fillOptionsDef,...Q.strokeOptionsDef,...Q.lineDashOptionsDef,cornerRadius:Q.positiveNumber}),title:{enabled:Q.boolean,text:Q.string,showInLegend:Q.boolean,spacing:Q.positiveNumber,...Q.fontOptionsDef},calloutLabel:{enabled:Q.boolean,offset:Q.number,minAngle:Q.positiveNumber,avoidCollisions:Q.boolean,formatter:Q.callback,...Q.fontOptionsDef},sectorLabel:{enabled:Q.boolean,positionOffset:Q.number,positionRatio:Q.ratio,formatter:Q.callback,...Q.fontOptionsDef},calloutLine:{colors:(0,Q.arrayOf)(Q.color),length:Q.positiveNumber,strokeWidth:Q.positiveNumber},fills:(0,Q.arrayOf)(Q.colorUnion),strokes:(0,Q.arrayOf)(Q.color),tooltip:Ae,shadow:Es,...Se,...Q.lineDashOptionsDef,...H(Q.fillOptionsDef,["fill"]),...H(Q.strokeOptionsDef,["stroke"])},Nr={...ff,...Ni,type:(0,Q.required)((0,Q.constant)("pie")),angleKey:(0,Q.required)(Q.string),radiusKey:Q.string,calloutLabelKey:Q.string,sectorLabelKey:Q.string,legendItemKey:Q.string,angleName:Q.string,radiusName:Q.string,calloutLabelName:Q.string,sectorLabelName:Q.string};Nr.defaultColorRange=(0,Q.undocumented)((0,Q.arrayOf)((0,Q.arrayOf)(Q.color))),Nr.defaultPatternFills=(0,Q.undocumented)((0,Q.arrayOf)(Q.color)),Nr.title._enabledFromTheme=(0,Q.undocumented)(Q.boolean),Nr.calloutLabel._enabledFromTheme=(0,Q.undocumented)(Q.boolean),Nr.sectorLabel._enabledFromTheme=(0,Q.undocumented)(Q.boolean);var TM={...ff,innerRadiusOffset:Ei.number,innerRadiusRatio:Ei.ratio,innerCircle:{fill:Ei.string,fillOpacity:Ei.ratio},innerLabels:{spacing:Ei.positiveNumber,...Ei.fontOptionsDef}},uO={...TM,...Nr,type:(0,Ei.required)((0,Ei.constant)("donut")),innerLabels:(0,Ei.arrayOfDefs)({text:(0,Ei.required)(Ei.string),spacing:Ei.positiveNumber,...Ei.fontOptionsDef},"inner label options array")},dO={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.1666666666666667]},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"backgroundColor"},positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2,colors:{$map:[{$if:[{$or:[{$isGradient:[{$value:"$1"}]},{$isPattern:[{$value:"$1"}]},{$isImage:[{$value:"$1"}]}]},{$path:["../../strokes/$index",{$ref:"foregroundColor"}]},{$value:"$1"}]},{$if:[{$eq:[{$path:"../strokeWidth"},0]},{$path:"../fills"},{$path:"../strokes"}]}]}},fills:{$palette:"fills"},strokes:{$palette:"strokes"},defaultColorRange:{$palette:"gradients"},defaultPatternFills:Tg,fillOpacity:1,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,innerRadiusRatio:{$if:[{$eq:[{$path:["./innerRadiusOffset",void 0]},void 0]},.7,void 0]},shadow:{enabled:!1,color:On,xOffset:3,yOffset:3,blur:5},innerLabels:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:2}},legend:{enabled:!0}},pO={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"donut",moduleFactory:e=>new du(e),tooltipDefaults:{range:"exact"},themeTemplate:dO},gO={type:"series",name:"donut",chartType:"polar",options:uO,create:e=>new du(e)},NM=(O(),N(T)),OM=class extends Ye{constructor(){super(...arguments),this.showInLegend=!1}};g([x],OM.prototype,"showInLegend",2);var Wo=class extends At{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};g([x],Wo.prototype,"offset",2),g([x],Wo.prototype,"minAngle",2),g([x],Wo.prototype,"minSpacing",2),g([x],Wo.prototype,"maxCollisionOffset",2),g([x],Wo.prototype,"avoidCollisions",2);var mf=class extends At{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};g([x],mf.prototype,"positionOffset",2),g([x],mf.prototype,"positionRatio",2);var pu=class extends le{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};g([x],pu.prototype,"colors",2),g([x],pu.prototype,"length",2),g([x],pu.prototype,"strokeWidth",2);var Le=class extends Ti{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(lt),this.strokes=Object.values(Ps),this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.outerRadiusOffset=0,this.outerRadiusRatio=1,this.strokeWidth=1,this.sectorSpacing=0,this.hideZeroValueSectorsInLegend=!1,this.title=new OM,this.shadow=new ps,this.calloutLabel=new Wo,this.sectorLabel=new mf,this.calloutLine=new pu,this.tooltip=new Qt}};g([x],Le.prototype,"angleKey",2),g([x],Le.prototype,"angleName",2),g([x],Le.prototype,"angleFilterKey",2),g([x],Le.prototype,"radiusKey",2),g([x],Le.prototype,"radiusName",2),g([x],Le.prototype,"radiusMin",2),g([x],Le.prototype,"radiusMax",2),g([x],Le.prototype,"calloutLabelKey",2),g([x],Le.prototype,"calloutLabelName",2),g([x],Le.prototype,"sectorLabelKey",2),g([x],Le.prototype,"sectorLabelName",2),g([x],Le.prototype,"legendItemKey",2),g([x],Le.prototype,"defaultColorRange",2),g([x],Le.prototype,"defaultPatternFills",2),g([x],Le.prototype,"fills",2),g([x],Le.prototype,"strokes",2),g([x],Le.prototype,"fillOpacity",2),g([x],Le.prototype,"strokeOpacity",2),g([x],Le.prototype,"lineDash",2),g([x],Le.prototype,"lineDashOffset",2),g([x],Le.prototype,"cornerRadius",2),g([x],Le.prototype,"itemStyler",2),g([x],Le.prototype,"rotation",2),g([x],Le.prototype,"outerRadiusOffset",2),g([x],Le.prototype,"outerRadiusRatio",2),g([x],Le.prototype,"strokeWidth",2),g([x],Le.prototype,"sectorSpacing",2),g([x],Le.prototype,"hideZeroValueSectorsInLegend",2),g([x],Le.prototype,"title",2),g([x],Le.prototype,"shadow",2),g([x],Le.prototype,"calloutLabel",2),g([x],Le.prototype,"sectorLabel",2),g([x],Le.prototype,"calloutLine",2),g([x],Le.prototype,"tooltip",2);var fO=class extends Za{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey,this.calloutLabelKey=s.properties.calloutLabelKey,this.sectorLabelKey=s.properties.sectorLabelKey}},gu=class extends uu{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[1,0],useLabelLayer:!0,animationResetFns:{item:pf,label:tn}}),this.properties=new Le,this.phantomNodeData=void 0,this.backgroundGroup=new Ot({name:`${this.id}-background`,zIndex:0}),this.previousRadiusScale=new us,this.radiusScale=new us,this.phantomGroup=this.backgroundGroup.appendChild(new ue({name:"phantom"})),this.phantomSelection=ht.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new ue({name:"pieCalloutLabels"})),this.calloutLabelSelection=new ht(this.calloutLabelGroup,ue),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new ue({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new Lt({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=fO,this.angleScale=new us,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(t=>t+Math.PI/2),this.phantomGroup.opacity=.2}get calloutNodeData(){return this.phantomNodeData??this.nodeData}attachSeries(e,t,i){super.attachSeries(e,t,i),e.appendChild(this.backgroundGroup)}detachSeries(e,t,i){super.detachSeries(e,t,i),e?.removeChild(this.backgroundGroup)}setSeriesIndex(e){return super.setSeriesIndex(e)?(this.backgroundGroup.zIndex=[0,e],!0):!1}nodeFactory(){const e=new Ft;return e.miterLimit=1e9,e}getSeriesDomain(e){return e==="angle"?this.angleScale.domain:this.radiusScale.domain}async processData(e){if(this.data==null)return;const{visible:t,id:i,ctx:{legendManager:s}}=this,{angleKey:n,angleFilterKey:r,radiusKey:o,calloutLabelKey:a,sectorLabelKey:l,legendItemKey:c}=this.properties,h=()=>(b,m)=>t&&s.getItemEnabled({seriesId:i,itemId:m})?b:0,u=!this.ctx.animationManager.isSkipped(),d=[],p=[];c?d.push(hs(c,"band",{id:"legendItemKey"})):a?d.push(hs(a,"band",{id:"calloutLabelKey"})):l&&d.push(hs(l,"band",{id:"sectorLabelKey"}));const f=this.radiusScale.type,y=this.angleScale.type;o&&p.push(pg(o,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,missingValue:this.properties.radiusMax??1,processor:h}),Me(o,f,{id:"radiusRaw",processor:h}),vr("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),a&&p.push(Me(a,"band",{id:"calloutLabelValue"})),l&&p.push(Me(l,"band",{id:"sectorLabelValue"})),c&&p.push(Me(c,"band",{id:"legendItemValue"})),r&&p.push(sl(r,y,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:h}),Me(r,y,{id:"angleFilterRaw"}),vr("angleFilterValue",[0,1],0,0)),u&&this.processedData?.reduced?.animationValidation?.uniqueKeys&&d.length>0&&p.push(Po(this.id,this.processedData)),p.push(Eo()),await this.requestDataModel(e,this.data,{props:[...d,sl(n,y,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:h}),Me(n,y,{id:"angleRaw"}),vr("angleValue",[0,1],0,0),...p]});for(const b of this.processedData?.defs?.values??[]){const{id:m,missing:v,property:M}=b,S=Ip(this,v);m!=="angleRaw"&&S>0&&NM.Logger.warnOnce(`no value was found for the key '${String(M)}' on ${S} data element${S>1?"s":""}`)}this.animationState.transition("updateData")}maybeRefreshNodeData(){if(!this.nodeDataRefresh)return;const{nodeData:e=[],phantomNodeData:t}=this.createNodeData()??{};this.nodeData=e,this.phantomNodeData=t,this.nodeDataRefresh=!1}getProcessedDataValues(e,t){const i=e.resolveColumnById(this,"angleValue",t),s=e.resolveColumnById(this,"angleRaw",t),n=this.properties.angleFilterKey!=null?e.resolveColumnById(this,"angleFilterValue",t):void 0,r=this.properties.angleFilterKey!=null?e.resolveColumnById(this,"angleFilterRaw",t):void 0,o=this.properties.radiusKey?e.resolveColumnById(this,"radiusValue",t):void 0,a=this.properties.radiusKey?e.resolveColumnById(this,"radiusRaw",t):void 0,l=this.properties.calloutLabelKey?e.resolveColumnById(this,"calloutLabelValue",t):void 0,c=this.properties.sectorLabelKey?e.resolveColumnById(this,"sectorLabelValue",t):void 0,h=this.properties.legendItemKey?e.resolveColumnById(this,"legendItemValue",t):void 0;return{angleValues:i,angleRawValues:s,angleFilterValues:n,angleFilterRawValues:r,radiusValues:o,radiusRawValues:a,calloutLabelValues:l,sectorLabelValues:c,legendItemValues:h}}createNodeData(){const{id:e,processedData:t,dataModel:i,angleScale:s,ctx:{legendManager:n},visible:r}=this,{rotation:o}=this.properties;if(!i||t?.type!=="ungrouped")return;const{angleValues:a,angleRawValues:l,angleFilterValues:c,angleFilterRawValues:h,radiusValues:u,radiusRawValues:d,calloutLabelValues:p,sectorLabelValues:f,legendItemValues:y}=this.getProcessedDataValues(i,t),b=h?.some((k,L)=>k>l[L])??!1;let m=0,v=0;const M=[],S=h!=null?[]:void 0,D=t.dataSources.get(this.id)??[],C=t.invalidData?.get(this.id);return D.forEach((k,L)=>{if(C?.[L]===!0)return;const w=b?c[L]:a[L],P=h!=null&&!b?Math.sqrt(h[L]/l[L]):1,R=s.convert(m)+dt(o);m=w,v+=w;const G=s.convert(m)+dt(o),Y=Math.abs(G-R),he=R+Y/2,se=l[L],ge=(u?.[L]??1)*P,ye=d?.[L],J=y?.[L],W=this.getLabels(k,he,Y,!0,p?.[L],f?.[L],J),V=this.getSectorFormat(k,L,!1),ee={itemId:L,series:this,datum:k,datumIndex:L,angleValue:se,midAngle:he,midCos:Math.cos(he),midSin:Math.sin(he),startAngle:R,endAngle:G,radius:ge,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(ge),0),sectorFormat:V,radiusValue:ye,legendItemValue:J,enabled:r&&n.getItemEnabled({seriesId:e,itemId:L}),...W};M.push(ee),S?.push({...ee,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0)})}),this.zerosumOuterRing.visible=v===0,{itemId:e,nodeData:M,labelData:M,phantomNodeData:S}}getLabels(e,t,i,s,n,r,o){const{calloutLabel:a,sectorLabel:l,legendItemKey:c}=this.properties,h=!s||a.enabled?this.properties.calloutLabelKey:void 0,u=!s||l.enabled?this.properties.sectorLabelKey:void 0;if(!h&&!u&&!c)return{};const d={datum:e,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},p={};return h&&i>=dt(a.minAngle)&&(p.calloutLabel={...this.getTextAlignment(t),text:this.getLabelText(a,{...d,value:n}),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),u&&(p.sectorLabel={text:this.getLabelText(l,{...d,value:r})}),c!=null&&o!=null&&(p.legendItem={key:c,text:o}),p}getTextAlignment(e){const t=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=Ma(e),s=-.75*Math.PI,n=i-s,r=Math.floor(n/(Math.PI/2)),o=(0,NM.modulus)(r,t.length);return t[o]}getNodeFill(e,t,i){return mr(e,{type:"gradient",bounds:"series",colorStops:t.map(s=>({color:s})),gradient:"radial",rotation:0,reverse:!0},{type:"pattern",pattern:"forward-slanted-lines",fill:i,fillOpacity:1,backgroundFill:"none",backgroundFillOpacity:1,stroke:i,strokeOpacity:1,strokeWidth:4,rotation:0},{type:"image",backgroundFill:i,backgroundFillOpacity:1,fit:"contain",repeat:"no-repeat",rotation:0})}getFillParams(e,t,i){if(!(!is(e)||e.bounds==="item"))return{centerX:0,centerY:0,innerRadius:t,outerRadius:i}}getSectorFormat(e,t,i){const{angleKey:s,radiusKey:n,calloutLabelKey:r,sectorLabelKey:o,legendItemKey:a,fills:l,strokes:c,defaultColorRange:h,defaultPatternFills:u,itemStyler:d}=this.properties,p=c[t%c.length],{fill:f,fillOpacity:y,stroke:b,strokeWidth:m,strokeOpacity:v,lineDash:M,lineDashOffset:S,cornerRadius:D}=xe(i&&this.properties.highlightStyle.item,{fill:l.length>0?l[t%l.length]:void 0,stroke:p,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()},this.properties),C=h[t%h.length],k=u[t%u.length],L=f??"black";let w;return d&&(w=this.cachedDatumCallback(this.getDatumId(t)+(i?"-highlight":"-hide"),()=>this.callWithContext(d,{datum:e,angleKey:s,radiusKey:n,calloutLabelKey:r,sectorLabelKey:o,legendItemKey:a,fill:this.getNodeFill(L,C,k),strokeOpacity:v,stroke:b,strokeWidth:m,fillOpacity:y,lineDash:M,lineDashOffset:S,cornerRadius:D,highlighted:i,seriesId:this.id}))),{fill:this.getNodeFill(w?.fill??L,C,k),fillOpacity:w?.fillOpacity??y,stroke:w?.stroke??b,strokeWidth:w?.strokeWidth??m,strokeOpacity:w?.strokeOpacity??v,lineDash:w?.lineDash??M,lineDashOffset:w?.lineDashOffset??S,cornerRadius:w?.cornerRadius??D}}getOuterRadius(){return Math.max(this.radius*this.properties.outerRadiusRatio+this.properties.outerRadiusOffset,0)}updateRadiusScale(e){const t=[0,this.getOuterRadius()];this.radiusScale.range=t,e&&(this.previousRadiusScale.range=t);const i=s=>({...s,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(s.radius),0)});this.nodeData=this.nodeData.map(i),this.phantomNodeData=this.phantomNodeData?.map(i)}getTitleTranslationY(){const e=Math.max(0,this.radiusScale.range[1]);if(e===0)return NaN;const i=2+(this.properties.title?.spacing??0),s=Math.max(0,-e);return-e-i-s}update({seriesRect:e}){const{title:t}=this.properties,i={seriesRectWidth:e?.width,seriesRectHeight:e?.height},s=Ss(this.nodeDataDependencies,i)!=null;if(s&&(this._nodeDataDependencies=i),this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(s),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),t){const n=this.getTitleTranslationY();t.node.y=isFinite(n)?n:0;const r=t.node.getBBox();t.node.visible=t.enabled&&isFinite(n)&&!this.bboxIntersectsSurroundingSeries(r)}this.zerosumOuterRing.fillOpacity=0,this.zerosumOuterRing.stroke=this.properties.calloutLabel.color,this.zerosumOuterRing.strokeWidth=1,this.zerosumOuterRing.strokeOpacity=1,this.updateNodeMidPoint(),this.updateSelections(),this.updateNodes(e)}updateTitleNodes(){const{oldTitle:e}=this,{title:t}=this.properties;e!==t&&(e&&this.labelGroup?.removeChild(e.node),t&&(t.node.textBaseline="bottom",this.labelGroup?.appendChild(t.node)),this.oldTitle=t)}updateNodeMidPoint(){const e=t=>{const i=t.innerRadius+(t.outerRadius-t.innerRadius)/2;t.midPoint={x:t.midCos*Math.max(0,i),y:t.midSin*Math.max(0,i)}};this.nodeData.forEach(e),this.phantomNodeData?.forEach(e)}updateSelections(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,highlightLabelSelection:s,calloutLabelSelection:n,labelSelection:r}=this,o=this.nodeData.map(l=>({...l,sectorFormat:{...l.sectorFormat}})),a=(l,c)=>{l.update(c,void 0,h=>this.getDatumId(h.datumIndex)),this.ctx.animationManager.isSkipped()&&l.cleanup()};a(e,this.nodeData),a(t,o),a(i,this.phantomNodeData??[]),n.update(this.calloutNodeData,l=>{const c=new Xt;c.tag=0,c.pointerEvents=1,l.appendChild(c);const h=new St;h.tag=1,h.pointerEvents=1,l.appendChild(h)}),r.update(this.nodeData),s.update(o)}updateNodes(e){const t=this.ctx.highlightManager.getActiveHighlight(),{visible:i}=this;this.backgroundGroup.visible=i,this.contentGroup.visible=i,this.highlightGroup.visible=i&&t?.series===this,this.highlightLabel.visible=i&&t?.series===this,this.labelGroup&&(this.labelGroup.visible=i),this.contentGroup.opacity=this.getOpacity();const s=this.radiusScale.range[0],n=this.radiusScale.range[1],r=this.getShapeFillBBox(),o=this.ctx.animationManager.isSkipped(),a=(l,c,h,u)=>{const d=this.getSectorFormat(c.datum,c.itemId,u);c.sectorFormat.fill=d.fill,c.sectorFormat.stroke=d.stroke,o&&(l.startAngle=c.startAngle,l.endAngle=c.endAngle,l.innerRadius=c.innerRadius,l.outerRadius=c.outerRadius),(u||o)&&(l.fill=d.fill,l.stroke=d.stroke);const p=this.getFillParams(d.fill,s,n);mh(l,d.fill,r,p),l.strokeWidth=d.strokeWidth,l.fillOpacity=d.fillOpacity,l.strokeOpacity=d.strokeOpacity,l.lineDash=d.lineDash,l.lineDashOffset=d.lineDashOffset,l.cornerRadius=d.cornerRadius,l.fillShadow=this.properties.shadow;const f=Math.max((this.properties.sectorSpacing+(d.stroke!=null?d.strokeWidth:0))/2,0);l.inset=f,l.lineJoin=this.properties.sectorSpacing>=0||f>0?"miter":"round"};this.itemSelection.each((l,c,h)=>a(l,c,h,!1)),this.highlightSelection.each((l,c,h)=>{a(l,c,h,!0),l.visible=c.itemId===t?.itemId}),this.phantomSelection.each((l,c,h)=>a(l,c,h,!1)),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(e),this.updateSectorLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{calloutLine:{length:e,strokeWidth:t,colors:i},strokes:s}=this.properties,n=t,r=Vy(i)?i:s,{offset:o}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach(a=>{const l=a.closestDatum(),{calloutLabel:c,outerRadius:h,datumIndex:u}=l;if(c?.text&&!c.hidden&&h!==0){a.visible=!0,a.strokeWidth=n,a.stroke=r[u%r.length],a.fill=void 0;const d=l.midCos*h,p=l.midSin*h;let f=l.midCos*(h+e),y=l.midSin*(h+e);if((c.collisionTextAlign??c.collisionOffsetY!==0)&&c.box!=null){const m=c.box;let v=f,M=y;f<m.x?v=m.x:f>m.x+m.width&&(v=m.x+m.width),y<m.y?M=m.y:y>m.y+m.height&&(M=m.y+m.height);const S=v-f,D=M-y,C=Math.sqrt(Math.pow(S,2)+Math.pow(D,2)),k=C-o;k>0&&(f=f+S*k/C,y=y+D*k/C)}a.x1=d,a.y1=p,a.x2=f,a.y2=y}else a.visible=!1})}getLabelOverflow(e,t,i){const s=-this.centerX,n=s+i.width,r=-this.centerY,o=r+i.height,a=1;let l=1;t.x+a<s?l=(t.x+t.width-s)/t.width:t.x+t.width-a>n&&(l=(n-t.x)/t.width);const c=t.y+a<r||t.y+t.height-a>o,h=l===1?e.length:Math.floor(e.length*l)-1,u=this.bboxIntersectsSurroundingSeries(t);return{textLength:h,hasVerticalOverflow:c,hasSurroundingSeriesOverflow:u}}bboxIntersectsSurroundingSeries(e){const{surroundingRadius:t}=this;if(t==null)return!1;const i=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],s=t**2;return i.some(n=>n.x**2+n.y**2>s)}computeCalloutLabelCollisionOffsets(){const{radiusScale:e}=this,{calloutLabel:t,calloutLine:i}=this.properties,{offset:s,minSpacing:n}=t,r=e.convert(0),o=m=>!m.calloutLabel||m.outerRadius===0,a=this.calloutNodeData,l=a.filter(m=>!o(m));if(l.forEach(m=>{const v=m.calloutLabel;v!=null&&(v.hidden=!1,v.collisionTextAlign=void 0,v.collisionOffsetY=0)}),l.length<=1)return;const c=l.filter(m=>m.midCos<0).sort((m,v)=>m.midSin-v.midSin),h=l.filter(m=>m.midCos>=0).sort((m,v)=>m.midSin-v.midSin),u=l.filter(m=>m.midSin<0&&m.calloutLabel?.textAlign==="center").sort((m,v)=>m.midCos-v.midCos),d=l.filter(m=>m.midSin>=0&&m.calloutLabel?.textAlign==="center").sort((m,v)=>m.midCos-v.midCos),p=m=>{const v=m.calloutLabel;if(v==null)return U.zero.clone();const M=m.outerRadius+i.length+s,S=m.midCos*M,D=m.midSin*M+v.collisionOffsetY,C=v.collisionTextAlign??v.textAlign,k=v.textBaseline;return St.computeBBox(v.text,S,D,{font:this.properties.calloutLabel,textAlign:C,textBaseline:k})},f=(m,v,M)=>{const S=p(m).grow(n/2),D=p(v).grow(n/2);S.x<D.x+D.width&&S.x+S.width>D.x&&(M==="to-top"?S.y<D.y+D.height:S.y+S.height>D.y)&&(v.calloutLabel.collisionOffsetY=M==="to-top"?S.y-D.y-D.height:S.y+S.height-D.y)},y=m=>{const v=m.slice().sort((S,D)=>Math.abs(S.midSin)-Math.abs(D.midSin))[0],M=m.indexOf(v);for(let S=M-1;S>=0;S--){const D=m[S+1],C=m[S];f(D,C,"to-top")}for(let S=M+1;S<m.length;S++){const D=m[S-1],C=m[S];f(D,C,"to-bottom")}},b=m=>{const v=l.some(L=>L.calloutLabel.collisionOffsetY!==0),M=m.map(L=>p(L)),S=M.map(L=>L.clone().grow(n/2));let D=!1;for(let L=0;L<S.length&&!D;L++){const w=S[L];for(let P=L+1;P<m.length;P++){const R=S[P];if(w.collidesBBox(R)){D=!0;break}}}const C=a.map(L=>{const{startAngle:w,endAngle:P,outerRadius:R}=L;return{startAngle:w,endAngle:P,innerRadius:r,outerRadius:R}}),k=M.some(L=>C.some(w=>LM(L,w)));!D&&!v&&!k||m.filter(L=>L.calloutLabel.textAlign==="center").forEach(L=>{const w=L.calloutLabel;L.midCos<0?w.collisionTextAlign="right":L.midCos>0?w.collisionTextAlign="left":w.collisionTextAlign="center"})};y(c),y(h),b(u),b(d)}updateCalloutLabelNodes(e){const{radiusScale:t}=this,{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:r,color:o}=i,a=new St;this.calloutLabelSelection.selectByTag(1).forEach(l=>{const c=l.closestDatum(),h=c.calloutLabel,u=t.convert(c.radius),d=Math.max(0,u);if(!h?.text||d===0||h.hidden){l.visible=!1;return}const p=d+n+r,f=c.midCos*p,y=c.midSin*p+h.collisionOffsetY,b={textAlign:h.collisionTextAlign??h.textAlign,textBaseline:h.textBaseline};a.text=h.text,a.x=f,a.y=y,a.setFont(this.properties.calloutLabel),a.setAlign(b);const m=a.getBBox();let v=h.text,M=!0;if(i.avoidCollisions){const{textLength:S,hasVerticalOverflow:D}=this.getLabelOverflow(h.text,m,e);v=h.text.length===S?h.text:`${h.text.substring(0,S)}\u2026`,M=!D}l.text=v,l.x=f,l.y=y,l.setFont(this.properties.calloutLabel),l.setAlign(b),l.fill=o,l.visible=M})}computeLabelsBBox(e,t){const{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:r,maxCollisionOffset:o,minSpacing:a}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],c=new St;let h;const{title:u}=this.properties;if(u?.text&&u.enabled){const d=this.getTitleTranslationY();isFinite(d)&&(c.text=u.text,c.x=0,c.y=d,c.setFont(u),c.setAlign({textBaseline:"bottom",textAlign:"center"}),h=c.getBBox(),l.push(h))}return this.calloutNodeData.forEach(d=>{const p=d.calloutLabel;if(!p||d.outerRadius===0)return null;const f=d.outerRadius+n+r,y=d.midCos*f,b=d.midSin*f+p.collisionOffsetY;c.text=p.text,c.x=y,c.y=b,c.setFont(this.properties.calloutLabel),c.setAlign({textAlign:p.collisionTextAlign??p.textAlign,textBaseline:p.textBaseline});const m=c.getBBox();if(p.box=m,Math.abs(p.collisionOffsetY)>o){p.hidden=!0;return}if(h){const v=-this.centerY,M=new U(h.x-a,v,h.width+2*a,h.y+h.height+a-v);if(m.collidesBBox(M)){p.hidden=!0;return}}if(e.hideWhenNecessary){const{textLength:v,hasVerticalOverflow:M,hasSurroundingSeriesOverflow:S}=this.getLabelOverflow(p.text,m,t),D=p.text.length>2&&v<2;if(M||D||S){p.hidden=!0;return}}p.hidden=!1,l.push(m)}),l.length===0?null:U.merge(l)}updateSectorLabelNodes(){const{radiusScale:e}=this,t=e.convert(0),{fontSize:i,fontStyle:s,fontWeight:n,fontFamily:r,positionOffset:o,positionRatio:a,color:l}=this.properties.sectorLabel,c=t>0,h=this.ctx.legendManager.getData(this.id)?.filter(d=>d.enabled).length===1,u=(d,p)=>{const{sectorLabel:f,outerRadius:y,startAngle:b,endAngle:m}=p;let v=!1;if(f&&y!==0){const M=t*(1-a)+y*a+o;d.fill=l,d.fontStyle=s,d.fontWeight=n,d.fontSize=i,d.fontFamily=r,d.text=f.text,!c&&h?(d.x=0,d.y=0):(d.x=p.midCos*M,d.y=p.midSin*M),d.textAlign="center",d.textBaseline="middle";const D=d.getBBox(),C=[[D.x,D.y],[D.x+D.width,D.y],[D.x+D.width,D.y+D.height],[D.x,D.y+D.height]],k={startAngle:b,endAngle:m,innerRadius:t,outerRadius:y};C.every(([L,w])=>ou(L,w,k))&&(v=!0)}d.visible=v};this.labelSelection.each(u),this.highlightLabelSelection.each(u)}updateZerosumRings(){this.zerosumOuterRing.size=this.getOuterRadius()*2}pickNodeClosestDatum(e){return gf(this,e)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n}=this,{legendItemKey:r,calloutLabelKey:o,calloutLabelName:a,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:u,radiusKey:d,radiusName:p,tooltip:f}=n,y=this.properties.title.text;if(!i||!s)return;const b=s.dataSources.get(this.id)?.[e],{angleRawValues:m,legendItemValues:v,calloutLabelValues:M,sectorLabelValues:S}=this.getProcessedDataValues(i,s),D=m[e],C=v?.[e]??(o===h?void 0:M?.[e])??(l===h?void 0:S?.[e])??u;return this.formatTooltipWithContext(f,{title:y,symbol:this.legendItemSymbol(e),data:[{label:C,fallbackLabel:h,value:Hs(D,3)}]},{seriesId:t,datum:b,title:u,legendItemKey:r,calloutLabelKey:o,calloutLabelName:a,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:u,radiusKey:d,radiusName:p,...this.getSectorFormat(b,e,!1)})}legendItemSymbol(e){const t=this.processedData?.dataSources.get(this.id)?.[e],i=this.getSectorFormat(t,e,!1),{fillOpacity:s,strokeOpacity:n,strokeWidth:r,lineDash:o,lineDashOffset:a}=this.properties;let{fill:l}=i;const{stroke:c}=i;return is(l)&&(l={...l,gradient:"linear",rotation:0,reverse:!1}),{marker:{fill:l,stroke:c,fillOpacity:s,strokeOpacity:n,strokeWidth:r,lineDash:o,lineDashOffset:a}}}getLegendData(e){const{id:t,visible:i,processedData:s,dataModel:n,ctx:{legendManager:r}}=this;if(!n||!s||e!=="category")return[];const{angleKey:o,calloutLabelKey:a,sectorLabelKey:l,legendItemKey:c,showInLegend:h}=this.properties;if(!c&&(!a||a===o)&&(!l||l===o))return[];const{calloutLabelValues:u,sectorLabelValues:d,legendItemValues:p,angleRawValues:f}=this.getProcessedDataValues(n,s),y=this.properties.title?.showInLegend&&this.properties.title.text,b=[],m=this.properties.hideZeroValueSectorsInLegend,v=s.dataSources.get(this.id),M=s.invalidData?.get(this.id);for(let S=0;S<s.input.count;S++){const D=v?.[S],C=f[S];if(M?.[S]===!0||m&&C===0)continue;const k=[];y&&k.push(y);const L=this.getLabels(D,2*Math.PI,2*Math.PI,!1,u?.[S],d?.[S],p?.[S]);c&&L.legendItem!==void 0?k.push(L.legendItem.text):a&&a!==o&&L.calloutLabel?.text!==void 0?k.push(L.calloutLabel?.text):l&&l!==o&&L.sectorLabel?.text!==void 0&&k.push(L.sectorLabel?.text),k.length!==0&&b.push({legendType:"category",id:t,datum:D,itemId:S,seriesId:t,hideToggleOtherSeries:!0,enabled:i&&r.getItemEnabled({seriesId:t,itemId:S}),label:{text:k.join(" - ")},symbol:this.legendItemSymbol(S),legendItemName:c!=null?D[c]:void 0,hideInLegend:!h})}return b}setLegendState(e){const{id:t,ctx:{legendManager:i,updateService:s}}=this;e.forEach((n,r)=>i.toggleItem(n,t,r)),i.update(),s.update(5)}animateEmptyUpdateReady(e){const{animationManager:t}=this.ctx,i=Tr(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);Xe(this.id,"nodes",t,[this.itemSelection,this.highlightSelection,this.phantomSelection],i.nodes,(s,n)=>this.getDatumId(n.datumIndex)),Ce(this,"callout",t,this.calloutLabelSelection),Ce(this,"sector",t,this.labelSelection),Ce(this,"highlight",t,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,processedData:s,radiusScale:n,previousRadiusScale:r}=this,{animationManager:o}=this.ctx,a=s?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=(a?.moved.size??0)===0,c=(s?.defs.keys.length??0)>0,h=s?.reduced?.animationValidation?.uniqueKeys??!0;(!l||!c||!h)&&this.ctx.animationManager.skipCurrentBatch();const u=Tr(!1,this.properties.rotation,n,r);Xe(this.id,"nodes",o,[e,t,i],u.nodes,(d,p)=>this.getDatumId(p.datumIndex),a),Ce(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Ce(this,"sector",this.ctx.animationManager,this.labelSelection),Ce(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,radiusScale:s,previousRadiusScale:n}=this,{animationManager:r}=this.ctx,o=Tr(!1,this.properties.rotation,s,n);Xe(this.id,"nodes",r,[e,t,i],o.nodes,(a,l)=>this.getDatumId(l.datumIndex)),Fn(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Fn(this,"sector",this.ctx.animationManager,this.labelSelection),Fn(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(e){return`${e}`}};gu.className="PieSeries",gu.type="pie";var mO={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.1666666666666667]},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"backgroundColor"},positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2,colors:{$map:[{$if:[{$or:[{$isGradient:[{$value:"$1"}]},{$isPattern:[{$value:"$1"}]},{$isImage:[{$value:"$1"}]}]},{$path:["../../strokes/$index",{$ref:"foregroundColor"}]},{$value:"$1"}]},{$if:[{$eq:[{$path:"../strokeWidth"},0]},{$path:"../fills"},{$path:"../strokes"}]}]}},fills:{$palette:"fills"},strokes:{$palette:"strokes"},defaultColorRange:{$palette:"gradients"},defaultPatternFills:Tg,fillOpacity:1,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,shadow:{enabled:!1,color:On,xOffset:3,yOffset:3,blur:5}},legend:{enabled:!0}},yO={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"pie",moduleFactory:e=>new gu(e),tooltipDefaults:{range:"exact"},themeTemplate:mO},bO={type:"series",name:"pie",chartType:"polar",options:Nr,create:e=>new gu(e)};function yf(){Ms.register(pv,c1,LN,B1,cM,iO,yM,lO,pO,yO,nO);for(const e of[Js,kn,Yi,Mr,Ro,wn])hr.register(e.type,{moduleFactory:t=>new e(t)})}var EM=(O(),N(T));function xO(){for(const e of Ms.modules){if(e.packageType==="enterprise"&&!Fw(e)&&EM.Logger.errorOnce("Unexpected enterprise module registered: "+e.identifier),e.type==="root"&&e.themeTemplate)for(const t of e.chartTypes)kp.set(t,e.themeTemplate);if(e.type==="series"){if(e.chartTypes.length>1)throw new Error(`AG Charts - Module definition error: ${e.identifier}`);Vi.register(e.identifier,e)}if(e.type==="series-option"&&e.themeTemplate)for(const t of e.seriesTypes)Vi.setThemeTemplate(t,e.themeTemplate);if(e.type==="axis-option"&&e.themeTemplate)for(const t of e.axisTypes){const i=hr.getThemeTemplate(t),s=xe(e.themeTemplate,i);hr.setThemeTemplate(t,s)}e.type==="axis"&&hr.register(e.identifier,e),e.type==="legend"&&Lp.register(e.identifier,e)}if(Ms.hasEnterpriseModules()){const e=_w();e.length>0&&EM.Logger.errorOnce("Enterprise modules expected but not registered: ",e)}}var j=(O(),N(T)),vO=["bar","line","scatter"],MO=void 0,SO=void 0;SO=MO;var DO=void 0,IO=void 0;IO=DO;var bf=(e=>(e.POINTER="pointer",e.NODE="node",e.CHART="chart",e))(bf||{}),xf=(e=>(e.TOP="top",e.RIGHT="right",e.BOTTOM="bottom",e.LEFT="left",e.TOP_RIGHT="top-right",e.BOTTOM_RIGHT="bottom-right",e.BOTTOM_LEFT="bottom-left",e.TOP_LEFT="top-left",e.CENTER="center",e))(xf||{}),vf=(e=>(e.POINTER="pointer",e.NODE="node",e.TOP="top",e.RIGHT="right",e.BOTTOM="bottom",e.LEFT="left",e.TOP_LEFT="top-left",e.TOP_RIGHT="top-right",e.BOTTOM_RIGHT="bottom-right",e.BOTTOM_LEFT="bottom-left",e))(vf||{}),AO=void 0,LO=void 0;LO=AO;var kO=void 0,CO=void 0;CO=kO;var fi=Symbol("IGNORED_PROP");function Xi(e,t){const i={};for(const s of Object.keys(t)){const n=t[s];n!==fi&&Object.hasOwn(e,s)&&(i[s]=n)}return i}function PM(e){const{enabled:t,mode:i,showArrow:s,range:n,position:r,pagination:o,delay:a,wrapping:l,interaction:c,renderer:h,...u}=e,d=Xi(e,{enabled:t,showArrow:s,range:n,position:r,interaction:c,renderer:h,...u});return{chartTooltipOptions:Xi(e,{enabled:fi,showArrow:fi,range:fi,position:fi,mode:i,pagination:o,delay:a,wrapping:l,...u}),seriesTooltipOptions:d}}function wO(e){const{animation:t,background:i,container:s,contextMenu:n,footnote:r,height:o,listeners:a,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:u,padding:d,subtitle:p,theme:f,title:y,width:b,type:m,cursor:v,nodeClickRange:M,tooltip:S={},value:D,scale:C={},startAngle:k,endAngle:L,highlightStyle:w,segmentation:P,bar:R,needle:G,targets:Y,outerRadius:he,innerRadius:se,outerRadiusRatio:de,innerRadiusRatio:ge,cornerRadius:ye,cornerMode:J,label:W,secondaryLabel:V,spacing:ee,...ie}=e,{chartTooltipOptions:ne,seriesTooltipOptions:me}=PM(S),Z=Xi(e,{animation:t,background:i,container:s,contextMenu:n,footnote:r,height:o,listeners:a,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:u,padding:d,subtitle:p,theme:f,title:y,tooltip:ne,width:b}),te=Xi(e,{needle:G!=null?{enabled:!0,...G}:fi,startAngle:k,endAngle:L,scale:C,type:m,cursor:v,nodeClickRange:M,tooltip:me,value:D,highlightStyle:w,segmentation:P,bar:R,targets:Y,outerRadius:he,innerRadius:se,outerRadiusRatio:de,innerRadiusRatio:ge,cornerRadius:ye,cornerMode:J,label:W,secondaryLabel:V,spacing:ee,...ie});return"context"in e&&(Z.context=e.context),{...Z,series:[te]}}function TO(e){const{animation:t,background:i,container:s,contextMenu:n,footnote:r,height:o,listeners:a,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:u,padding:d,subtitle:p,theme:f,title:y,width:b,type:m,cursor:v,nodeClickRange:M,tooltip:S={},value:D,scale:C={},direction:k="vertical",thickness:L,highlightStyle:w,segmentation:P,bar:R,targets:G,cornerRadius:Y,cornerMode:he,label:se,...de}=e,{chartTooltipOptions:ge,seriesTooltipOptions:ye}=PM(S),J=Xi(e,{animation:t,background:i,container:s,contextMenu:n,footnote:r,height:o,listeners:a,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:u,padding:d,subtitle:p,theme:f,title:y,tooltip:ge,width:b}),W=Xi(e,{scale:C,type:m,cursor:v,nodeClickRange:M,tooltip:ye,value:D,direction:k,thickness:L,highlightStyle:w,segmentation:P,bar:R,targets:G,cornerRadius:Y,cornerMode:he,label:se,...de});return"context"in e&&(J.context=e.context),{...J,series:[W]}}function RM(e,t){if(t==null)return e;const{targets:i,...s}=t;return e=xe(e,s),e.targets!=null&&i!=null&&(e.targets=vc(e.targets,i)),e}function NO(e,t){if(e.listeners){const{nodeClick:i,nodeDoubleClick:s,...n}=e.listeners;e={...e,listeners:{seriesNodeClick:i,seriesNodeDoubleClick:s,...n}}}switch(e.type){case"radial-gauge":const i=RM(e,t);return wO(i);case"linear-gauge":const s=RM(e,t);return TO(s);default:return{}}}var E=(O(),N(T)),_l={fills:(0,E.and)((0,E.arrayLength)(2),(0,E.arrayOf)((0,E.optionsDefs)({color:E.color,stop:E.number},"")),E.colorStopsOrderValidator),fillMode:(0,E.union)("continuous","discrete")},fu={value:(0,E.required)(E.number),text:E.string,shape:(0,E.or)((0,E.union)("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),E.callback),placement:(0,E.union)("before","after","middle"),spacing:E.positiveNumber,size:E.positiveNumber,rotation:E.number,...E.fillOptionsDef,...E.strokeOptionsDef,...E.lineDashOptionsDef},mu={value:(0,E.required)(E.number),text:E.string,shape:(0,E.or)((0,E.union)("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),E.callback),placement:(0,E.union)("inside","outside","middle"),spacing:E.positiveNumber,size:E.positiveNumber,rotation:E.number,label:{...Pe,spacing:E.positiveNumber},...E.fillOptionsDef,...E.strokeOptionsDef,...E.lineDashOptionsDef},yu={direction:(0,E.union)("horizontal","vertical"),cornerMode:(0,E.union)("container","item"),cornerRadius:E.positiveNumber,thickness:E.positiveNumber,segmentation:{enabled:E.boolean,spacing:E.positiveNumber,interval:{values:(0,E.arrayOf)(E.number),step:E.number,count:E.number}},bar:{enabled:E.boolean,thickness:E.positiveNumber,thicknessRatio:E.ratio,..._l,...E.fillOptionsDef,...E.strokeOptionsDef,...E.lineDashOptionsDef},label:{...Vn,text:E.string,spacing:E.positiveNumber,avoidCollisions:E.boolean,placement:(0,E.union)("inside-start","outside-start","inside-end","outside-end","inside-center","bar-inside","bar-inside-end","bar-outside-end","bar-end")},tooltip:Ae,...H(Se,["listeners"])},Wn={...yu,...H(Ni,["listeners"]),type:(0,E.required)((0,E.constant)("linear-gauge")),value:(0,E.required)(E.number),scale:{min:(0,E.and)(E.number,(0,E.lessThan)("max")),max:(0,E.and)(E.number,(0,E.greaterThan)("min")),label:{enabled:E.boolean,formatter:E.callback,rotation:E.number,spacing:E.positiveNumber,minSpacing:E.positiveNumber,placement:(0,E.union)("before","after"),avoidCollisions:E.boolean,format:jn,...E.fontOptionsDef},interval:{values:(0,E.arrayOf)(E.number),step:E.number},..._l,...E.fillOptionsDef,...E.strokeOptionsDef,...E.lineDashOptionsDef},targets:(0,E.arrayOfDefs)(fu,"target options array")};Wn.margin=(0,E.undocumented)(E.number),Wn.defaultColorRange=(0,E.undocumented)((0,E.arrayOf)(E.color)),Wn.defaultTarget=(0,E.undocumented)({...fu,value:E.number,label:{...Pe,spacing:E.number}}),Wn.defaultScale=(0,E.undocumented)(Wn.scale),Wn.scale.defaultFill=(0,E.undocumented)(E.color);var bu={outerRadius:E.positiveNumber,innerRadius:E.positiveNumber,outerRadiusRatio:E.ratio,innerRadiusRatio:E.ratio,startAngle:E.number,endAngle:E.number,spacing:E.positiveNumber,cornerMode:(0,E.union)("container","item"),cornerRadius:E.positiveNumber,scale:{min:(0,E.and)(E.number,(0,E.lessThan)("max")),max:(0,E.and)(E.number,(0,E.greaterThan)("min")),label:{enabled:E.boolean,formatter:E.callback,rotation:E.number,spacing:E.positiveNumber,minSpacing:E.positiveNumber,avoidCollisions:E.boolean,format:jn,...E.fontOptionsDef},interval:{values:(0,E.arrayOf)(E.number),step:E.number},..._l,...E.fillOptionsDef,...E.strokeOptionsDef,...E.lineDashOptionsDef},segmentation:{enabled:E.boolean,spacing:E.positiveNumber,interval:{values:(0,E.arrayOf)(E.number),step:E.number,count:E.number}},bar:{enabled:E.boolean,..._l,...E.fillOptionsDef,...E.strokeOptionsDef,...E.lineDashOptionsDef},needle:{enabled:E.boolean,spacing:E.positiveNumber,radiusRatio:E.ratio,...E.fillOptionsDef,...E.strokeOptionsDef,...E.lineDashOptionsDef},label:{text:E.string,spacing:E.positiveNumber,...Vn},secondaryLabel:{text:E.string,...Vn},tooltip:Ae,...Se},jl={...bu,...Ni,type:(0,E.required)((0,E.constant)("radial-gauge")),value:(0,E.required)(E.number),targets:(0,E.arrayOfDefs)(mu,"target options array")};jl.defaultColorRange=(0,E.undocumented)((0,E.arrayOf)(E.color)),jl.defaultTarget=(0,E.undocumented)({...mu,value:E.number,label:{...Pe,spacing:E.number}}),jl.scale.defaultFill=(0,E.undocumented)(E.color);var OO=(O(),N(T)),qi={stroke:tt},Gt={fill:cl},FM={color:"white",fill:tt},ln={color:tt},Or={color:ll,fontSize:{$rem:[1.1666666666666667]},fontFamily:{$ref:"fontFamily"}},Mf={...Or,fontSize:{$ref:"fontSize"},color:dl,fill:hl,stroke:ul,strokeWidth:1,divider:{stroke:pl,strokeWidth:1,strokeOpacity:.5}},Sf={...qi,background:{fill:mt,fillOpacity:.2},handle:{...Gt},text:{...ln},statistics:{...Mf}},EO={line:{...qi,handle:{...Gt},text:{...ln}},"horizontal-line":{...qi,handle:{...Gt},axisLabel:{...FM},text:{...ln}},"vertical-line":{...qi,handle:{...Gt},axisLabel:{...FM},text:{...ln}},"disjoint-channel":{...qi,background:{fill:mt,fillOpacity:.2},handle:{...Gt},text:{...ln}},"parallel-channel":{...qi,background:{fill:mt,fillOpacity:.2},handle:{...Gt},text:{...ln}},"fibonacci-retracement":{...qi,strokes:al,rangeStroke:tt,handle:{...Gt},text:{...ln,position:"center"},label:{...Or,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},"fibonacci-retracement-trend-based":{...qi,strokes:al,rangeStroke:tt,handle:{...Gt},text:{...ln,position:"center"},label:{...Or,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},callout:{...qi,...Or,color:{$ref:"textColor"},handle:{...Gt},fill:mt,fillOpacity:.2},comment:{...Or,color:"white",fontWeight:700,handle:{...Gt},fill:tt},note:{...Or,color:bl,fill:tt,stroke:{$ref:"backgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...Gt},background:{fill:ml,stroke:yl,strokeWidth:1}},text:{...Or,handle:{...Gt}},arrow:{...qi,handle:{...Gt},text:{...ln}},"arrow-up":{fill:{$palette:"up.fill"},handle:{...Gt,stroke:tt}},"arrow-down":{fill:{$palette:"down.fill"},handle:{...Gt,stroke:tt}},"date-range":{...Sf},"price-range":{...Sf},"date-price-range":{...Sf},"quick-date-price-range":{up:{...qi,fill:mt,fillOpacity:.2,handle:{...Gt},statistics:{...Mf,color:"#fff",fill:mt,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...qi,stroke:fl,fill:gl,fillOpacity:.2,handle:{...Gt,stroke:fl},statistics:{...Mf,color:"#fff",fill:gl,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{enabled:!0}},PO=["ohlc","line","step-line","hlc","high-low","candlestick","hollow-candlestick"],RO=[{icon:"trend-line-drawing",tooltip:"toolbarAnnotationsLineAnnotations",value:"line-menu"},{icon:"fibonacci-retracement-drawing",tooltip:"toolbarAnnotationsFibonacciAnnotations",value:"fibonacci-menu"},{icon:"text-annotation",tooltip:"toolbarAnnotationsTextAnnotations",value:"text-menu"},{icon:"arrow-drawing",tooltip:"toolbarAnnotationsShapeAnnotations",value:"shape-menu"},{icon:"measurer-drawing",tooltip:"toolbarAnnotationsMeasurerAnnotations",value:"measurer-menu"},{icon:"delete",tooltip:"toolbarAnnotationsClearAll",value:"clear"}];function FO(e,t,i){const{dateKey:s="date",highKey:n="high",openKey:r="open",lowKey:o="low",closeKey:a="close",volumeKey:l="volume",chartType:c="candlestick",navigator:h=!1,volume:u=!0,rangeButtons:d=!0,statusBar:p=!0,toolbar:f=!0,zoom:y=!0,sync:b=!1,theme:m,data:v,...M}=e,S=jO(c,s,n,o,r,a),D=_O(i,r,a,u,l),k={navigator:{enabled:h,...u?{miniChart:{enabled:h,series:[{type:"line",xKey:s,yKey:l,stroke:Fh,marker:{enabled:!1}}]},height:40,minHandle:{height:46},maxHandle:{height:46}}:null}},L={annotations:{enabled:f,optionsToolbar:{enabled:f},snap:!0,toolbar:{enabled:f,buttons:RO,padding:0},data:v,xKey:s,volumeKey:u?l:void 0}},w=p?{statusBar:{enabled:!0,data:v,highKey:n,openKey:r,lowKey:o,closeKey:a,volumeKey:u?l:void 0}}:null,P={zoom:{enabled:y,autoScaling:{enabled:!0},enableIndependentAxes:!0}},R={ranges:{enabled:d}},G=b?{sync:{enabled:b,nodeInteraction:!0,zoom:!0}}:null,Y=u?[{type:"number",position:"left",keys:[l],label:{enabled:!1},crosshair:{enabled:!1},gridLine:{enabled:!1},nice:!1,layoutConstraints:{stacked:!1,width:20,unit:"percent",align:"end"}}]:[];return{theme:{baseTheme:typeof m=="string"?m:"ag-financial",...xe(typeof m=="object"?m:null,{overrides:{common:{title:{padding:4},padding:{top:6,right:8,bottom:5},chartToolbar:{enabled:f},annotations:{...EO},axes:{number:{interval:{maxSpacing:45},label:{format:".2f"}}}},bar:{series:{fillOpacity:.5}},line:{series:{marker:{enabled:!1},...zM(c,{hlc:{stroke:{$palette:"altNeutral.stroke"},strokeWidth:2},line:{stroke:{$palette:"neutral.stroke"}},"step-line":{stroke:{$palette:"neutral.stroke"},interpolation:{type:"step"}}})}},candlestick:{series:{...zM(c,{"hollow-candlestick":{item:{up:{fill:"transparent"}}}})}},"range-area":{series:{fillOpacity:.3,strokeWidth:2}}}})},animation:{enabled:!1},legend:{enabled:!1},series:[...D,...S],axes:[{type:"number",position:"right",keys:[r,a,n,o],crosshair:{enabled:!0,snap:!1},layoutConstraints:{stacked:!1,width:100,unit:"percent",align:"start"}},...Y,{type:"ordinal-time",position:"bottom",line:{enabled:!1},label:{enabled:!0},crosshair:{enabled:!0}}],tooltip:{enabled:!1},data:v,...L,...k,...w,...P,...R,...G,...M}}function _O(e,t,i,s,n){return s?[{type:"bar",xKey:"date",yKey:n,tooltip:{enabled:!1},itemStyler({datum:r}){const{up:o,down:a}=e().palette;return{fill:r[t]<r[i]?o?.fill:a?.fill}},focusPriority:1,fastDataProcessing:!0,highlight:{enabled:!1}}]:[]}var _M="range-area";function jO(e,t,i,s,n,r){const o={xKey:t,openKey:n,closeKey:r,highKey:i,lowKey:s},a={xKey:t,yKey:r},l={pickOutsideVisibleMinorAxis:!0};switch(e??"candlestick"){case"ohlc":return zO(l,o);case"line":case"step-line":return BO(l,a);case"hlc":return GO(l,a,o);case"high-low":return VO(l,o);case"candlestick":case"hollow-candlestick":return jM(l,o);default:return OO.Logger.warnOnce(`unknown chart type: ${e}; expected one of: ${PO.join(", ")}`),jM(l,o)}}function zO(e,t){return[{type:"ohlc",focusPriority:0,...e,...t}]}function BO(e,t){return[{type:"line",focusPriority:0,...e,...t}]}function GO(e,t,{xKey:i,highKey:s,closeKey:n,lowKey:r}){return[{type:_M,focusPriority:0,...e,xKey:i,yHighKey:s,yLowKey:n,fill:Th,stroke:Ch},{type:_M,focusPriority:0,...e,xKey:i,yHighKey:n,yLowKey:r,fill:Nh,stroke:wh},{type:"line",...e,...t}]}function VO(e,{xKey:t,highKey:i,lowKey:s}){return[{type:"range-bar",...e,xKey:t,yHighKey:i,yLowKey:s,fill:Eh,stroke:Oh,tooltip:{range:"nearest"},focusPriority:0,fastDataProcessing:!0}]}function jM(e,t){return[{type:"candlestick",focusPriority:0,...e,...t}]}function zM(e,t){return t[e]??t.default}var BM={title:{enabled:!1},label:{enabled:!1},line:{enabled:!1},gridLine:{enabled:!1},crosshair:{enabled:!1,stroke:Rh,lineDash:[0],label:{enabled:!1}}},Df={...BM,nice:!1},xu={mode:"compact",position:{anchorTo:"node",placement:["right","left"]},showArrow:!1},If={style:[{stroke:{$ref:"gridLineColor"}}],width:2},UO={number:{gridLine:If},time:{gridLine:If},category:{gridLine:If}},WO={overrides:{common:{animation:{enabled:!1},contextMenu:{enabled:!1},keyboard:{enabled:!1},background:{visible:!1},navigator:{enabled:!1},padding:{top:0,right:0,bottom:0,left:0},axes:{number:{...Df,interval:{values:[0]}},log:{...Df},time:{...Df},category:{...BM}}},bar:{series:{crisp:!1,label:{placement:"inside-end",padding:4},sparklineMode:!0},tooltip:{...xu,position:{...xu.position,anchorTo:"pointer"},range:"nearest"},axes:UO},line:{seriesArea:{padding:{top:2,right:2,bottom:2,left:2}},series:{sparklineMode:!0,strokeWidth:1,marker:{enabled:!1,size:3}},tooltip:xu},area:{seriesArea:{padding:{top:1,right:0,bottom:1,left:0}},series:{strokeWidth:1,fillOpacity:.4},tooltip:xu}}},GM=ai(HO);function HO(e,t){return typeof e=="string"?{...t,baseTheme:e}:e!=null?{...e,baseTheme:GM(e.baseTheme,t)}:t}function VM(e){if(Array.isArray(e)&&e.length!==0){const t=e[0];if(typeof t=="number")return{data:e.map((s,n)=>({x:n,y:s})),series:[{xKey:"x",yKey:"y"}],datumKey:"y"};if(Array.isArray(t))return{data:e.map(s=>({x:s[0],y:s[1],datum:s})),series:[{xKey:"x",yKey:"y"}],datumKey:"datum"}}return{data:e}}function YO(e){switch(e?.type){case"number":{const{type:n,min:r,max:o,reverse:a}=e;return Xi(e,{type:n,reverse:a,min:r,max:o})}case"time":{const{type:n,min:r,max:o,reverse:a}=e;return Xi(e,{type:n,reverse:a,min:r,max:o})}case"category":default:const{paddingInner:t,paddingOuter:i,reverse:s}=e??{};return Xi({...e,type:"category"},{type:"category",reverse:s,paddingInner:t,paddingOuter:i})}}function $O(e,t,i){const s={};return e?.stroke!=null&&(s.style=[{stroke:e?.stroke}],s.enabled??(s.enabled=!0)),e?.strokeWidth!=null&&(s.width=e?.strokeWidth,s.enabled??(s.enabled=!0)),i.type==="bar"&&i.direction!=="horizontal"&&(s.enabled??(s.enabled=!0)),e?.visible!=null&&(s.enabled=e.visible),s.enabled??(s.enabled=t),s}var KO=ai((e,t,i)=>s=>{const n=s.datum[s.xKey],r=s.datum[s.yKey],o=i!=null?s.datum[i]:s.datum,a=t?.renderer?.({context:e,datum:o,xValue:n,yValue:r});if(typeof a=="string")return a;const l=a?.content??r.toFixed(2);return a?.title?{heading:void 0,title:void 0,data:[{label:a.title,value:l}]}:{heading:void 0,title:l,data:[]}});function ZO(e){const{background:t,container:i,height:s,listeners:n,locale:r,minHeight:o,minWidth:a,overrideDevicePixelRatio:l,padding:c,width:h,theme:u,data:d,crosshair:p,axis:f,min:y,max:b,tooltip:m,context:v,styleNonce:M,...S}=e,D=Xi(e,{background:t,container:i,height:s,listeners:n,locale:r,minHeight:o,minWidth:a,overrideDevicePixelRatio:l,padding:c,width:h,styleNonce:M,tooltip:fi,context:fi,data:fi,crosshair:fi,axis:fi,min:fi,max:fi,theme:fi}),{data:C,series:[k]=[],datumKey:L}=VM(d),w=S;k!=null&&Object.assign(w,k),w.tooltip={...m,renderer:KO(v,m,L)},D.theme=GM(u,WO),D.data=C,D.series=[w];const P=w.type!=="bar"||w.direction!=="horizontal",[R,G]=P?["bottom","left"]:["left","bottom"],Y={...YO(f),position:R,...Xi(e,{crosshair:p})},he={type:"number",gridLine:$O(f,!1,e),position:G,...Xi(e,{min:y,max:b})};return D.axes=P?[he,Y]:[Y,he],D}var XO={chartType:(0,j.union)("candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"),dateKey:j.string,openKey:j.string,highKey:j.string,lowKey:j.string,closeKey:j.string,volumeKey:j.string,navigator:j.boolean,volume:j.boolean,rangeButtons:j.boolean,statusBar:j.boolean,toolbar:j.boolean,zoom:j.boolean,sync:j.boolean,theme:j.defined,container:j.defined,width:j.defined,height:j.defined,minWidth:j.defined,minHeight:j.defined,listeners:j.defined,initialState:j.defined,title:j.defined,data:j.array},Af={theme:j.defined,container:j.defined,animation:j.defined,background:j.defined,contextMenu:j.defined,listeners:j.defined,locale:j.defined,width:j.defined,height:j.defined,minWidth:j.defined,minHeight:j.defined,title:j.defined,subtitle:j.defined,footnote:j.defined,padding:j.defined,tooltip:{...Ae,...re.tooltip}};Af.overrideDevicePixelRatio=(0,j.undocumented)(j.positiveNumber);var Lf=["showInLegend","showInMiniChart","grouped","stacked","stackGroup","tooltip","listeners","errorBar","xKey","yKey","type"],kf={visible:j.boolean,reverse:j.boolean,stroke:j.color,strokeWidth:j.positiveNumber},Cf={context:j.defined,tooltip:j.defined,theme:j.defined,background:j.defined,container:j.defined,width:j.defined,height:j.defined,minWidth:j.defined,minHeight:j.defined,padding:j.defined,listeners:j.defined,locale:j.defined,data:j.defined,styleNonce:j.string,axis:(0,j.typeUnion)({number:{...kf,min:(0,j.and)(j.number,(0,j.lessThan)("max")),max:(0,j.and)(j.number,(0,j.greaterThan)("min"))},category:{...kf,paddingInner:j.ratio,paddingOuter:j.ratio},time:{...kf,min:(0,j.and)((0,j.or)(j.number,j.date),(0,j.lessThan)("max")),max:(0,j.and)((0,j.or)(j.number,j.date),(0,j.greaterThan)("min"))}},"axis options","category"),min:(0,j.and)(j.number,(0,j.lessThan)("max")),max:(0,j.and)(j.number,(0,j.greaterThan)("min")),crosshair:{enabled:j.boolean,snap:j.boolean,...j.strokeOptionsDef,...j.lineDashOptionsDef},xKey:j.string,yKey:j.string},qO={type:"preset",name:"price-volume",enterprise:!0,options:XO,create:FO},QO={type:"preset",name:"gauge-preset",enterprise:!0,options:(0,j.typeUnion)({"linear-gauge":{...H(Wn,["type"]),...Af},"radial-gauge":{...H(jl,["type"]),...Af}},"gauge options"),create:NO},JO={type:"preset",name:"sparkline",options:(0,j.typeUnion)({area:{...Cf,...H(iM,Lf)},bar:{...Cf,...H(Rl,Lf)},line:{...Cf,...H(nu,Lf)}},"sparkline options"),create:ZO,processData:VM},wf=(O(),N(T)),zl=(O(),N(T)),eE=["top","right","bottom","left"],vu=class xD extends xh{constructor(t,i){super(t,i),this.paired=!0,this.lastUpdateClipRect=void 0,this.lastLayoutWidth=NaN,this.lastLayoutHeight=NaN}onAxisChange(t,i){super.onAxisChange(t,i),this.syncAxisChanges(t,i),this.ctx!=null&&this.ctx.zoomManager.updateAxes(t)}destroySeries(t){super.destroySeries(t),this.lastLayoutWidth=NaN,this.lastLayoutHeight=NaN}getChartType(){return"cartesian"}setRootClipRects(t){const{seriesRoot:i,annotationRoot:s}=this;i.setClipRect(t),s.setClipRect(t)}async processData(){await super.processData(),this.syncStatus==="init"&&(this.syncStatus="domains-calculated"),this.ctx.updateService.dispatchProcessData({series:{shouldFlipXY:this.shouldFlipXY()}})}async processDomains(){await super.processDomains();for(const t of this.axes){const i=await this.getSyncedDomain(t);i!=null&&t.setDomains(i)}}performLayout(t){const{seriesRoot:i,annotationRoot:s}=this,{clipSeries:n,seriesRect:r,visible:o}=this.updateAxes(t.layoutBox);this.seriesRoot.visible=o,this.seriesRect=r,this.animationRect=t.layoutBox;const{x:a,y:l}=r;if(t.width!==this.lastLayoutWidth||t.height!==this.lastLayoutHeight)for(const d of[i,s])d.translationX=Math.floor(a),d.translationY=Math.floor(l);else{const{translationX:d,translationY:p}=i;Ks(this.id,"seriesRect",this.ctx.animationManager,[i,s],{translationX:d,translationY:p},{translationX:Math.floor(a),translationY:Math.floor(l)},{phase:"update"})}this.lastLayoutWidth=t.width,this.lastLayoutHeight=t.height;const c=r.clone().grow(this.seriesArea.padding),h=this.seriesArea.clip||n?c:void 0,{lastUpdateClipRect:u}=this;this.lastUpdateClipRect=h,this.ctx.animationManager.isActive()&&u!=null?this.ctx.animationManager.animate({id:this.id,groupId:"clip-rect",phase:"update",from:u,to:c,onUpdate:d=>this.setRootClipRects(d),onComplete:()=>this.setRootClipRects(h)}):this.setRootClipRects(h),this.ctx.layoutManager.emitLayoutComplete(t,{axes:this.axes.map(d=>d.getLayoutState()),series:{visible:o,rect:r,paddedRect:c},clipSeries:n})}updateAxes(t){const{clipSeries:i,seriesRect:s,overflows:n}=this.resolveAxesLayout(t);for(const r of this.axes)r.update(),r.setCrossLinesVisible(!n),this.clipAxis(r,s,t);return{clipSeries:i,seriesRect:s,visible:!n}}resolveAxesLayout(t){let i,s,n=0;const r=10;do if(s=i??this.getDefaultState(),i=this.updateAxesPass(new Map(s.axisAreaWidths),t.clone()),n++>r){zl.Logger.warn("Max iterations reached. Unable to stabilize axes layout.");break}while(!this.isLayoutStable(i,s));return this.lastAreaWidths=i.axisAreaWidths,i}updateAxesPass(t,i){const s=new Map,n={};let r=!1,o=!1;for(const M of eE){const S=this.seriesArea.padding[M],D=this.axes.findLast(C=>C.position===M);D?D.seriesAreaPadding=S:i.shrink(S,M)}const a=(t.get("left")??0)+(t.get("right")??0),l=(t.get("top")??0)+(t.get("bottom")??0),c=this.buildCrossLinePadding(t),h=c.left+c.right,u=c.top+c.bottom;i.width<=a+h||i.height<=l+u?r=!0:i.shrink(c);const d=i.clone().shrink(Object.fromEntries(t));for(const M of this.axes){const{position:S="left",direction:D}=M;this.sizeAxis(M,d,S);const C=D==="y",{primaryTickCount:k,bbox:L}=M.calculateLayout(M.nice?n[D]:void 0,this.padding);n[D]??(n[D]=k),o||(o=M.dataDomain.clipped||M.visibleRange[0]>0||M.visibleRange[1]<1),s.set(M.id,Math.ceil(M.thickness??(C?L?.width:L?.height)??0))}const p=(0,zl.groupBy)(this.axes,M=>M.position??"left"),{width:f,height:y,pixelRatio:b}=this.ctx.scene,m=new Map,v=new Map;for(const[M,S]of(0,zl.entries)(p)){let C=M==="left"||M==="right"?y%b:f%b,k=0;for(const L of S??[]){v.set(L.id,C);const w=s.get(L.id)??0;k=Math.max(k,C+w),L.layoutConstraints.stacked&&(C+=w+xD.AxesPadding)}m.set(M,Math.ceil(k))}for(const[M,S]of(0,zl.entries)(p))this.positionAxes({axes:S??[],position:M,axisWidths:s,axisOffsets:v,axisAreaWidths:m,axisBound:i,seriesRect:d});return{clipSeries:o,seriesRect:d,axisAreaWidths:m,overflows:r}}buildCrossLinePadding(t){const i={top:0,right:0,bottom:0,left:0};this.axes.forEach(s=>{const{position:n,label:r}=s;s.crossLines?.forEach(o=>{var a;o instanceof ri&&(o.position=n??"top",(a=o.label).parallel??(a.parallel=r.parallel)),o.calculatePadding?.(i)})});for(const[s,n=0]of(0,zl.entries)(i))i[s]=Math.max(n-(t.get(s)??0),0);return i}clampToOutsideSeriesRect(t,i,s,n){const r=s==="x"?t.x:t.y,o=s==="x"?t.width:t.height;return n===1?Math.min(i,r+o):Math.max(i,r)}async getSyncedDomain(t){const i=this.modulesManager.getModule("sync");if(i?.enabled)return await i.getSyncedDomain(t)}syncAxisChanges(t,i){const s=this.modulesManager.getModule("sync");if(!s?.enabled)return;const n=new Set(i??[]);for(const r of t)n.delete(r);for(const r of n)s.removeAxis(r)}sizeAxis(t,i,s){const n=t instanceof kn,r=s==="left"||s==="right",{width:o,height:a}=i,l=r?a:o;let c=0,h=l,{min:u,max:d}=this.ctx.zoomManager.getAxisZoom(t.id);const{width:p,unit:f,align:y}=t.layoutConstraints;f==="px"?h=c+p:h=h*p/100,y==="end"&&(c=l-(h-c),h=l),r&&(n?[u,d]=[1-d,1-u]:[c,h]=[h,c]),t.range=[c,h],t.visibleRange=[u,d],t.gridLength=r?o:a}positionAxes(t){const{axes:i,axisBound:s,axisWidths:n,axisOffsets:r,axisAreaWidths:o,seriesRect:a,position:l}=t,c=o.get(l)??0;let h="x",u="y",d=1;(l==="top"||l==="bottom")&&(h="y",u="x");let p=s[h];(l==="right"||l==="bottom")&&(d=-1,p+=h==="x"?s.width:s.height);for(const f of i){const y=o.get(u==="x"?"left":"top")??0,b=n.get(f.id)??0,m=r.get(f.id)??0;f.gridPadding=c-m-b,f.translation[u]=s[u]+y,f.translation[h]=this.clampToOutsideSeriesRect(a,p+d*(m+b),h,d)}}shouldFlipXY(){return this.series.every(t=>t instanceof _n&&t.shouldFlipXY())}getDefaultState(){const t=new Map;if(this.lastAreaWidths)for(const{position:i="left"}of this.axes){const s=this.lastAreaWidths.get(i);s!=null&&t.set(i,s)}return{axisAreaWidths:t,clipSeries:!1,overflows:!1}}isLayoutStable(t,i){if(i.overflows!==t.overflows||i.clipSeries!==t.clipSeries)return!1;for(const s of t.axisAreaWidths.keys())if(!i.axisAreaWidths.has(s))return!1;for(const[s,n]of i.axisAreaWidths.entries()){const r=t.axisAreaWidths.get(s);if((n!=null||r!=null)&&n!==r)return!1}return!0}clipAxis(t,i,s){const n=Math.ceil(t.gridLine?.width??0),r=Math.ceil(t.line?.width??0);let{width:o,height:a}=i;switch(o+=t.direction==="x"?n:r,a+=t.direction==="y"?n:r,t.clipGrid(i.x,i.y,o,a),t.position){case"left":case"right":t.clipTickLines(s.x,i.y-n,s.width+n,i.height+n*2);break;case"top":case"bottom":t.clipTickLines(i.x-n,s.y,i.width+n*2,s.height+n);break}}};vu.className="CartesianChart",vu.type="cartesian",vu.AxesPadding=15;var tE=vu,He=(O(),N(T)),Er={mode:(0,He.undocumented)((0,He.union)("integrated","standalone")),container:He.htmlElement,theme:He.defined,series:He.array,annotations:He.defined,navigator:He.defined,initialState:{chartType:He.string,annotations:He.defined,legend:(0,He.arrayOfDefs)({visible:He.boolean,seriesId:He.string,itemId:He.string,legendItemName:He.string},"legend state array"),zoom:He.defined}},UM={...re,...Er,axes:He.defined,data:He.array},WM={...re,...Er,axes:He.defined,data:He.array},iE={...re,...Er,data:He.array,topology:He.geoJson},sE={...re,...Er,data:He.array},nE={...re,...Er,data:He.array},rE={...re,...Er,data:He.array,nodes:He.array},oE={...re,...Er,data:He.array},aE=new Set(["number","log","time"]),lE=e=>(0,wf.isObject)(e)&&!aE.has(e.type),cE={type:"chart",name:"cartesian",options:UM,detect:Qp,create(e,t){return new tE(e,t)},validate(e,t,i){const s=[];e?.series?.[0]?.type==="histogram"&&e?.axes?.some(lE)&&(s.push(new wf.ValidationError("invalid","only continuous axis types when histogram series is used",e.axes,i,"axes")),e=H(e,["axes"]));const n=(0,wf.validate)(e,t,i);return n.invalid.push(...s),n}},Z2=(O(),N(T)),Bl=()=>{throw new Error("Enterprise module placeholder cannot be initialised")},hE={type:"chart",name:"flow-proportion",placeholder:!0,options:{},detect:dx,create:Bl},uE={type:"chart",name:"gauge",placeholder:!0,options:{},detect:eg,create:Bl},dE={type:"chart",name:"hierarchy",placeholder:!0,options:{},detect:hx,create:Bl},pE={type:"chart",name:"standalone",placeholder:!0,options:{},detect:Jp,create:Bl},gE={type:"chart",name:"topology",placeholder:!0,options:{},detect:ux,create:Bl},HM=(O(),N(T)),YM=(O(),N(T)),Ho=class extends $p{constructor(){super(...arguments),this.shape="polygon",this.innerRadiusRatio=0,this.defaultTickMinSpacing=20}layoutCrossLines(){const e=this.label.getSideFlag(),t=this.isAnySeriesActive(),{rotation:i,parallelFlipRotation:s,regularFlipRotation:n}=this.calculateRotations();this.crossLines.forEach(r=>{r.sideFlag=-e,r.direction=i===-Math.PI/2?"angle":"radius",r.parallelFlipRotation=s,r.regularFlipRotation=n,r.calculateLayout?.(t,this.reverse)})}updatePosition(){super.updatePosition();const e=Math.floor(this.translation.x),t=Math.floor(this.translation.y);this.tickLineGroup.translationX=e,this.tickLineGroup.translationY=t,this.tickLabelGroup.translationX=e,this.tickLabelGroup.translationY=t,this.crossLineRangeGroup.translationX=e,this.crossLineRangeGroup.translationY=t,this.crossLineLineGroup.translationX=e,this.crossLineLineGroup.translationY=t,this.crossLineLabelGroup.translationX=e,this.crossLineLabelGroup.translationY=t,this.tickLabelGroupSelection.each(fh())}computeLabelsBBox(e,t){return null}computeRange(){}getAxisLinePoints(){}};g([x],Ho.prototype,"shape",2),g([x],Ho.prototype,"innerRadiusRatio",2);var Tf=class extends xh{constructor(e,t){super(e,t),this.padding=new vn(40),this.ctx.axisManager.axisGroup.zIndex=6}getChartType(){return"polar"}async performLayout(e){const{layoutBox:t}=e;t.shrink(this.seriesArea.padding.toJson());const i=t.clone();this.seriesRect=i,this.animationRect=i,this.seriesRoot.translationX=i.x,this.seriesRoot.translationY=i.y,await this.computeCircle(i),this.axes.forEach(s=>s.update()),this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:i,paddedRect:i}})}updateAxes(e,t,i,s){const n=this.axes.find(l=>l.direction==="angle"),r=this.axes.find(l=>l.direction==="radius");if(!(n instanceof Ho)||!(r instanceof Ho))return;const o=n.scale,a=r.innerRadiusRatio;n.innerRadiusRatio=a,n.computeRange(),n.gridLength=s,r.gridAngles=o.ticks({nice:n.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(l=>o.convert(l)),r.gridRange=n.range,r.range=[s,s*a],[n,r].forEach(l=>{l.translation.x=e.x+t,l.translation.y=e.y+i,l.calculateLayout()})}async computeCircle(e){const t=this.series.filter(fE),i=this.axes.filter(mE),s=(c,h,u)=>{this.updateAxes(e,c,h,u),t.forEach(p=>{p.centerX=c,p.centerY=h,p.radius=u});const d=t.filter(p=>p.type==="donut"||p.type==="pie");if(d.length>1){const p=d.map(f=>{const y=f.getInnerRadius();return{series:f,innerRadius:y}}).sort((f,y)=>f.innerRadius-y.innerRadius);p.at(-1).series.surroundingRadius=void 0;for(let f=0;f<p.length-1;f++)p[f].series.surroundingRadius=p[f+1].innerRadius}},n=e.width/2,r=e.height/2,o=Math.max(0,Math.min(e.width,e.height)/2);let a=o;s(n,r,a);const l=async({hideWhenNecessary:c=!1}={})=>{const h=[];for(const p of(0,YM.iterate)(i,t)){const f=await p.computeLabelsBBox({hideWhenNecessary:c},e);f&&h.push(f)}if(h.length===0){s(n,r,o);return}const u=U.merge(h),d=this.refineCircle(u,a,e);s(d.centerX,d.centerY,d.radius),a=d.radius};await l(),await l(),await l(),await l({hideWhenNecessary:!0}),await l({hideWhenNecessary:!0});for(const c of(0,YM.iterate)(i,t))await c.computeLabelsBBox({hideWhenNecessary:!0},e);return{radius:a,centerX:n,centerY:r}}refineCircle(e,t,i){const n=-t,r=-t,o=t,a=t;let l=Math.max(0,n-e.x),c=Math.max(0,r-e.y),h=Math.max(0,e.x+e.width-o),u=Math.max(0,e.y+e.height-a);l=h=Math.max(l,h),c=u=Math.max(c,u);const d=i.width-l-h,p=i.height-c-u;let f=Math.min(d,p)/2;const y=.5*i.width/2,b=.5*i.height/2,m=Math.min(y,b);if(f<m){f=m;const S=l+h,D=c+u;if(2*f+D>i.height){const C=i.height-2*f;Math.min(c,u)*2>C?(c=C/2,u=C/2):c>u?c=C-u:u=C-c}if(2*f+S>i.width){const C=i.width-2*f;Math.min(l,h)*2>C?(l=C/2,h=C/2):l>h?l=C-h:h=C-l}}const v=l+2*f+h,M=c+2*f+u;return{centerX:(i.width-v)/2+l+f,centerY:(i.height-M)/2+c+f,radius:f}}};Tf.className="PolarChart",Tf.type="polar";function fE(e){return e instanceof uu}function mE(e){return e instanceof Ho}var yE={type:"chart",name:"polar",options:WM,detect:cx,create(e,t){return new Tf(e,t)},validate(e,t,i){const s=[],n=e?.series?.[0]?.type;(n==="pie"||n==="donut")&&e?.axes&&(s.push(new HM.UnknownError([],e.axes,i,"axes")),e=H(e,["axes"]));const r=(0,HM.validate)(e,t,i);return r.invalid.push(...s),r}},pe=(O(),N(T)),Yo={...on,...Gn(pe.number),type:(0,pe.required)((0,pe.constant)("number")),label:Kg,crosshair:Bn(!0)},$o={...on,...Gn(pe.number),type:(0,pe.required)((0,pe.constant)("log")),base:(0,pe.and)(pe.positiveNumberNonZero,(0,pe.attachDescription)(e=>e!==1,"not equal to 1")),label:Kg,crosshair:Bn(!0)},cn={...on,...Gn((0,pe.or)(pe.number,pe.date),!0),type:(0,pe.required)((0,pe.constant)("time")),label:wl,parentLevel:$h,crosshair:Bn(!0)};cn.paddingInner=pe.positiveNumber,cn.paddingOuter=pe.positiveNumber,cn.groupPaddingInner=pe.positiveNumber;var Ko={...on,type:(0,pe.required)((0,pe.constant)("category")),label:Cl,paddingInner:pe.ratio,paddingOuter:pe.ratio,groupPaddingInner:pe.ratio,crosshair:Bn()},Zo={...on,type:(0,pe.required)((0,pe.constant)("grouped-category")),label:Cl,crosshair:Bn(),paddingInner:pe.ratio,groupPaddingInner:pe.ratio,depthOptions:(0,pe.arrayOfDefs)({label:{enabled:pe.boolean,avoidCollisions:pe.boolean,rotation:pe.number,spacing:pe.number,...pe.fontOptionsDef},tick:{enabled:pe.boolean,stroke:pe.color,width:pe.positiveNumber}},"depth options objects array")},Pr={...on,...Gn((0,pe.or)(pe.number,pe.date),!0),type:(0,pe.required)((0,pe.constant)("unit-time")),unit:(0,pe.or)((0,pe.instanceOf)(gt),$g),label:wl,parentLevel:$h,paddingInner:pe.ratio,paddingOuter:pe.ratio,groupPaddingInner:pe.ratio,crosshair:Bn(!0)},$M=(e,t)=>{const i={};for(const s of new Set([...Object.keys(e),...Object.keys(t)])){const n=e[s],r=t[s];(0,pe.isPlainObject)(n)&&(0,pe.isPlainObject)(r)?i[s]=$M(n,r):n!=null&&r!=null&&n!==r?i[s]=(0,pe.or)(n,r):i[s]=n??r}return i},bE=$M(cn,Pr),xE={type:"axis",name:"number",chartType:"cartesian",options:Yo,create:e=>new Js(e)},vE={type:"axis",name:"log",chartType:"cartesian",options:$o,create:e=>new Ro(e)},ME={type:"axis",name:"time",chartType:"cartesian",options:bE,create:e=>new Yi(e)},SE={type:"axis",name:"category",chartType:"cartesian",options:Ko,create:e=>new kn(e)},DE={type:"axis",name:"grouped-category",chartType:"cartesian",options:Zo,create:e=>new Mr(e)},IE={type:"axis",name:"unit-time",chartType:"cartesian",options:Pr,create:e=>new wn(e)},X2=(O(),N(T)),AE=[cE,xE,vE,ME,SE,DE,IE,sM,hM,pM,mM,bM,MM],LE=[yE,gO,bO],kE=[...AE,...LE,hE,uE,dE,pE,gE,qO,QO,JO],Hn={isEnterprise:!1},oe=(O(),N(T)),Gl=(O(),N(T));function KM(e,t){let i=[];const s=eg(e),n=Xs(e),r=n?Ze.get(n):"unknown";for(const o of Ga)if(!(r!=="unknown"&&!o.chartTypes.includes(r))){if(o.type==="root"||o.type==="legend"){const a=e[o.optionsKey];if(a==null)continue;o.optionsInnerKey?a[o.optionsInnerKey]&&(i.push(`${o.optionsKey}.${o.optionsInnerKey}`),delete a[o.optionsInnerKey]):(i.push(o.optionsKey),delete e[o.optionsKey])}else if(o.type==="axis"){if(!("axes"in e)||!(0,Gl.isArray)(e.axes)||!e.axes?.some(a=>a.type===o.identifier))continue;i.push(`axis[type=${o.identifier}]`),e.axes=e.axes.filter(a=>a.type!==o.identifier)}else if(o.type==="axis-option"){if(!("axes"in e)||!(0,Gl.isArray)(e.axes)||!e.axes?.some(a=>a[o.optionsKey]))continue;i.push(`axis.${o.optionsKey}`),e.axes.forEach(a=>{a[o.optionsKey]&&delete a[o.optionsKey]})}else if(o.type==="series"){if(o.community||!(0,Gl.isArray)(e.series)||!e.series?.some(a=>a.type===o.identifier))continue;i.push(`series[type=${o.identifier}]`),e.series=e.series.filter(a=>a.type!==o.identifier)}else if(o.type==="series-option"){if(!(0,Gl.isArray)(e.series)||!e.series?.some(a=>a[o.optionsKey]))continue;i.push(`series.${o.optionsKey}`),e.series.forEach(a=>{a[o.optionsKey]&&delete a[o.optionsKey]})}}if(i.length&&!t){s&&(i=["AgCharts.createGauge"]);let o="ag-charts-enterprise",a="https://www.ag-grid.com/charts/javascript/installation/";e.mode==="integrated"&&(o="ag-grid-charts-enterprise' or 'ag-grid-enterprise/charts-enterprise",a="https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/"),Gl.Logger.warnOnce([`unable to use these enterprise features as '${o}' has not been loaded:`,"",...i,"",`See: ${a}`].join(`
`))}}function CE(e){const t="mode"in e&&e.mode==="integrated";for(const i of Ms.byType("root","legend")){const s=e[i.optionsKey],n=s!=null&&s.enabled===!1,r=!("removable"in i)||i.removable===!0||i.removable==="standalone-only"&&!t;n&&r&&delete e[i.optionsKey]}}var ae=(O(),N(T)),ZM=(O(),N(T));function XM(e){return e?.up||e?.down||e?.neutral?"user-full":e?.fills||e?.strokes?"user-indexed":"inbuilt"}var Nf="white",Of={get cartesian(){return{seriesTypes:Ze.cartesianTypes,commonOptions:["zoom","navigator"]}},get polar(){return{seriesTypes:Ze.polarTypes,commonOptions:[]}},get hierarchy(){return{seriesTypes:Ze.hierarchyTypes,commonOptions:[]}},get topology(){return{seriesTypes:Ze.topologyTypes,commonOptions:[]}},get"flow-proportion"(){return{seriesTypes:Ze.flowProportionTypes,commonOptions:[]}},get standalone(){return{seriesTypes:Ze.standaloneTypes,commonOptions:[]}},get gauge(){return{seriesTypes:Ze.gaugeTypes,commonOptions:[]}}},wE={"radial-gauge":!0,"linear-gauge":!0};function qM(e){return wE[e]===!0}var TE={millisecond:"%H:%M:%S.L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e %B",month:"%B",year:"%Y"},mi={millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e",month:"%b",year:"%Y"},NE=Object.values(Of).reduce((e,{commonOptions:t})=>e.concat(t),[]),Pi=class Kl{static getDefaultColors(){return{fills:lt,fillsFallback:Object.values(lt),strokes:Ps,sequentialColors:wi(lt),divergingColors:[lt.ORANGE,lt.YELLOW,lt.GREEN],hierarchyColors:["#fff","#e0e5ea","#c1ccd5","#a3b4c1","#859cad"],secondSequentialColors:Oe.interpolate([Oe.fromHexString(lt.BLUE),Oe.fromHexString("#cbdef5")],8).map(t=>t.toString()),secondDivergingColors:[lt.GREEN,lt.YELLOW,lt.RED],secondHierarchyColors:["#fff","#c5cbd1","#a4b1bd","#8498a9","#648096"],up:{fill:lt.GREEN,stroke:Ps.GREEN},down:{fill:lt.RED,stroke:Ps.RED},neutral:{fill:lt.GRAY,stroke:Ps.GRAY},altUp:{fill:lt.BLUE,stroke:Ps.BLUE},altDown:{fill:lt.ORANGE,stroke:Ps.ORANGE},altNeutral:{fill:lt.GRAY,stroke:Ps.GRAY}}}static getDefaultPublicParameters(){return{accentColor:"#2196f3",axisColor:{$foregroundBackgroundMix:[.675]},backgroundColor:Nf,borderColor:{$foregroundBackgroundMix:[.818]},foregroundColor:"#464646",fontFamily:"Verdana, sans-serif",fontSize:12,fontWeight:400,gridLineColor:{$foregroundBackgroundAccentMix:[.93,.085]},padding:20,subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"backgroundColor"},.38]},textColor:{$ref:"foregroundColor"},chromeBackgroundColor:{$foregroundBackgroundMix:[.975]},chromeFontFamily:{$ref:"fontFamily"},chromeFontSize:{$ref:"fontSize"},chromeFontWeight:{$ref:"fontWeight"},chromeTextColor:"#181d1f",chromeSubtleTextColor:{$mix:[{$ref:"chromeTextColor"},{$ref:"backgroundColor"},.38]},inputBackgroundColor:{$ref:"backgroundColor"},inputTextColor:{$ref:"textColor"},crosshairLabelBackgroundColor:{$ref:"foregroundColor"},crosshairLabelTextColor:{$ref:"backgroundColor"}}}static getAxisDefaults(t,{title:i,time:s}){const n=s==="modern"?TE:void 0;return xe(t,i&&{title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},s!=="off"&&{label:{format:{millisecond:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},mi.millisecond,n?.millisecond]},second:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},mi.second,n?.second]},minute:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},mi.minute,n?.minute]},hour:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},mi.hour,n?.hour]},day:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},mi.day,n?.day]},month:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},mi.month,n?.month]},year:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},mi.year,n?.year]}}},parentLevel:{enabled:!1,label:{enabled:{$path:"../../label/enabled"},fontSize:{$path:"../../label/fontSize"},fontFamily:{$path:"../../label/fontFamily"},fontWeight:"bold",spacing:{$path:"../../label/spacing"},color:{$path:"../../label/color"},avoidCollisions:{$path:"../../label/avoidCollisions"},format:{millisecond:{$path:["../../../label/format/millisecond",mi.millisecond]},second:{$path:["../../../label/format/second",mi.second]},minute:{$path:["../../../label/format/minute",mi.minute]},hour:{$path:["../../../label/format/hour",mi.hour]},day:{$path:["../../../label/format/day",mi.day]},month:{$path:["../../../label/format/month",mi.month]},year:{$path:["../../../label/format/year",mi.year]}}},tick:{enabled:{$path:"../../tick/enabled"},size:{$path:"../../tick/size"},width:{$path:"../../tick/width"},stroke:{$path:"../../tick/stroke"}}}},{label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:11,color:{$ref:"textColor"},avoidCollisions:!0},line:{enabled:!0,width:1,stroke:{$ref:"axisColor"}},tick:{enabled:!1,size:6,width:1,stroke:{$ref:"axisColor"}},gridLine:{enabled:!0,style:[{stroke:{$ref:"gridLineColor"},lineDash:[]}]},crossLines:{enabled:!0,fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},fillOpacity:.1,strokeWidth:1,label:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},padding:5,color:{$ref:"textColor"}}}})}getChartDefaults(){return{minHeight:300,minWidth:300,background:{visible:!0,fill:{$ref:"backgroundColor"}},padding:{top:{$ref:"padding"},right:{$ref:"padding"},bottom:{$ref:"padding"},left:{$ref:"padding"}},seriesArea:{padding:{top:0,right:0,bottom:0,left:0}},keyboard:{enabled:!0},title:{enabled:!1,text:"Title",spacing:{$if:[{$path:"../subtitle/enabled"},10,20]},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.4166666666666667]},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},wrapping:"hyphenate",layoutStyle:En,textAlign:Pn},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:En,textAlign:Pn},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:En,textAlign:Pn},legend:{position:"bottom",orientation:{$if:[{$or:[{$eq:[{$path:"./position"},"left"]},{$eq:[{$path:"./position"},"right"]}]},"vertical","horizontal"]},spacing:30,listeners:{},toggleSeries:!0,item:{paddingX:16,paddingY:8,marker:{size:15,padding:8},showSeriesStroke:!0,label:{color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"}}},reverseOrder:!1,pagination:{marker:{size:12},activeStyle:{fill:{$ref:"foregroundColor"}},inactiveStyle:{fill:{$ref:"subtleTextColor"}},highlightStyle:{fill:{$ref:"foregroundColor"}},label:{color:{$ref:"textColor"}}}},tooltip:{enabled:!0,darkTheme:Bo,delay:0,pagination:!1},overlays:{darkTheme:Bo},listeners:{}}}constructor(t={}){const{overrides:i,palette:s,params:n}=Ve(t),r=this.createChartConfigPerChartType(this.getDefaults()),o={};i&&this.mergeOverrides(r,o,i);const{fills:a,strokes:l,sequentialColors:c,...h}=this.getDefaultColors();this.palette=nr(xe(s,{fills:Object.values(a),strokes:Object.values(l),sequentialColors:Object.values(c),...h})),this.paletteType=XM(s),this.params=xe(n,this.getPublicParameters()),this.config=nr(this.templateTheme(r)),this.presets=nr(o)}mergeOverrides(t,i,s){for(const{seriesTypes:n,commonOptions:r}of Object.values(Of)){const o={...s.common};for(const a of NE)r.includes(a)||delete o[a];for(const a of n){const l=a;qM(l)||(t[l]=xe(o,t[l]))}}Ze.seriesTypes.forEach(n=>{const r=n,o=s[r];qM(r)?i[r]=o:t[r]=xe(o,t[r])})}createChartConfigPerChartType(t){for(const[i,{seriesTypes:s}]of(0,ZM.entries)(Of)){const n=kp.get(i);for(const r of s)t[r]??(t[r]=Ve(n))}return t}getDefaults(){const t=(i,s)=>{const n={},r={axes:{},...Lp.getThemeTemplates(),...this.getChartDefaults(),...kp.get(i)};for(const o of s){n[o]=xe(Vi.getThemeTemplate(o),n[o]??Ve(r));const{axes:a}=n[o];for(const l of hr.keys())a[l]=xe(a[l],hr.getThemeTemplate(l),Kl.axisDefault[l])}return n};return xe(t("cartesian",Ze.cartesianTypes),t("polar",Ze.polarTypes),t("hierarchy",Ze.hierarchyTypes),t("topology",Ze.topologyTypes),t("flow-proportion",Ze.flowProportionTypes),t("standalone",Ze.standaloneTypes),t("gauge",Ze.gaugeTypes))}static applyTemplateTheme(t,i,s){if((0,ZM.isArray)(t))for(let n=0;n<t.length;n++){const r=t[n];typeof r=="symbol"&&s?.has(r)&&(t[n]=s.get(r))}else for(const n of Object.keys(t)){const r=t[n];typeof r=="symbol"&&s?.has(r)&&(t[n]=s.get(r))}}templateTheme(t,i=!0){const s=i?Ve(t):t,n=this.getTemplateParameters();return Ds(s,Kl.applyTemplateTheme,void 0,void 0,n),s}getDefaultColors(){return Kl.getDefaultColors()}getPublicParameters(){return Kl.getDefaultPublicParameters()}getTemplateParameters(){const t=new Map;t.set(Bo,!1),t.set(ol,"#d9d9d9"),t.set(On,"#00000080"),t.set(Rh,"#aaa"),t.set(En,"block"),t.set(Pn,"center"),t.set(al,["#797b86","#e24c4a","#f49d2d","#65ab58","#409682","#4db9d2","#5090dc","#3068f9","#e24c4a","#913aac","#d93e64"]),t.set(Ph,Nf),t.set(tt,lt.BLUE),t.set(mt,lt.BLUE),t.set(ll,lt.BLUE),t.set(cl,Nf),t.set(hl,"#fafafa"),t.set(ul,"#ddd"),t.set(dl,"#000"),t.set(pl,"#181d1f"),t.set(gl,"#e35c5c"),t.set(fl,"#e35c5c"),t.set(ml,"#fafafa"),t.set(yl,"#ddd"),t.set(bl,"#000"),t.set(xl,"top"),t.set(ds,!1);const i=this.getDefaultColors();return t.set(Ch,this.palette.up?.stroke??i.up.stroke),t.set(Th,this.palette.up?.fill??i.up.fill),t.set(wh,this.palette.down?.stroke??i.down.stroke),t.set(Nh,this.palette.down?.fill??i.down.fill),t.set(Oh,this.palette.neutral?.stroke??i.neutral.stroke),t.set(Eh,this.palette.neutral?.fill??i.neutral.fill),t.set(Ig,this.palette.altUp?.stroke??i.up.stroke),t.set(Lg,this.palette.altUp?.fill??i.up.fill),t.set(Ag,this.palette.altDown?.stroke??i.down.stroke),t.set(kg,this.palette.altDown?.fill??i.down.fill),t.set(Cg,this.palette.altNeutral?.fill??i.altNeutral.fill),t.set(wg,this.palette.altNeutral?.stroke??i.altNeutral.stroke),t}};Pi.axisDefault={number:Pi.getAxisDefaults({keys:[],line:{enabled:!1},crosshair:{enabled:!0}},{title:!0,time:"off"}),log:Pi.getAxisDefaults({keys:[],base:10,line:{enabled:!1},crosshair:{enabled:!0}},{title:!0,time:"off"}),category:Pi.getAxisDefaults({keys:[],groupPaddingInner:.1,label:{autoRotate:!0},gridLine:{enabled:ds},crosshair:{enabled:!1}},{title:!0,time:"off"}),"grouped-category":Pi.getAxisDefaults({keys:[],tick:{enabled:!0,stroke:ol},label:{spacing:10,rotation:270},paddingInner:.4,groupPaddingInner:.2,crosshair:{enabled:!1}},{title:!0,time:"off"}),time:Pi.getAxisDefaults({keys:[],gridLine:{enabled:ds},crosshair:{enabled:!0}},{title:!0,time:"legacy"}),"ordinal-time":Pi.getAxisDefaults({keys:[],groupPaddingInner:0,label:{autoRotate:!1},gridLine:{enabled:ds},crosshair:{enabled:!0}},{title:!0,time:"legacy"}),"unit-time":Pi.getAxisDefaults({keys:[],groupPaddingInner:.1,label:{autoRotate:!1},gridLine:{enabled:ds},crosshair:{enabled:!0},parentLevel:{enabled:!0}},{title:!0,time:"modern"}),"angle-category":Pi.getAxisDefaults({label:{spacing:5},gridLine:{enabled:ds},shape:{$path:["./shape",void 0,{$find:[{$not:[{$isOperation:"./shape"}]},{$path:".."}]}]}},{title:!1,time:"off"}),"angle-number":Pi.getAxisDefaults({label:{spacing:5},gridLine:{enabled:ds}},{title:!1,time:"off"}),"radius-category":Pi.getAxisDefaults({positionAngle:0,line:{enabled:!1}},{title:!0,time:"off"}),"radius-number":Pi.getAxisDefaults({positionAngle:0,line:{enabled:!1},shape:{$path:["./shape",void 0,{$find:[{$not:[{$isOperation:"./shape"}]},{$path:".."}]}]}},{title:!0,time:"off"})};var gs=Pi,Ef="#192232",Vt={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},Rr={BLUE:"#74a8e6",ORANGE:"#ffbe70",GREEN:"#6cb176",CYAN:"#75d4ef",YELLOW:"#f6e559",VIOLET:"#aa86d8",GRAY:"#a1a1a1",MAGENTA:"#ce7ab9",BROWN:"#997b52",RED:"#ff7872"},Xo=class extends gs{getDefaultColors(){return{fills:Vt,fillsFallback:Object.values(Vt),strokes:Rr,sequentialColors:wi(Vt),divergingColors:[Vt.ORANGE,Vt.YELLOW,Vt.GREEN],hierarchyColors:["#192834","#253746","#324859","#3f596c","#4d6a80"],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[Vt.GREEN,Vt.YELLOW,Vt.RED],secondHierarchyColors:["#192834","#3b5164","#496275","#577287","#668399"],up:{fill:Vt.GREEN,stroke:Rr.GREEN},down:{fill:Vt.RED,stroke:Rr.RED},neutral:{fill:Vt.GRAY,stroke:Rr.GRAY},altUp:{fill:Vt.BLUE,stroke:Rr.BLUE},altDown:{fill:Vt.ORANGE,stroke:Rr.ORANGE},altNeutral:{fill:Vt.GRAY,stroke:Rr.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),axisColor:{$foregroundBackgroundMix:[.263]},backgroundColor:Ef,borderColor:{$foregroundBackgroundMix:[.784]},chromeBackgroundColor:{$foregroundBackgroundMix:[.93]},foregroundColor:"#fff",gridLineColor:{$foregroundBackgroundAccentMix:[.743,.01]},subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"backgroundColor"},.57]},chromeTextColor:{$ref:"textColor"},crosshairLabelBackgroundColor:{$foregroundBackgroundAccentMix:[.35,.1]}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Bo,!0),e.set(Ph,Ef),e.set(ol,"#7f8389"),e.set(tt,Vt.BLUE),e.set(ll,"#fff"),e.set(mt,Vt.BLUE),e.set(cl,Ef),e.set(hl,"#28313e"),e.set(ul,"#4b525d"),e.set(dl,"#fff"),e.set(pl,"#fff"),e.set(ml,"#28313e"),e.set(yl,"#4b525d"),e.set(bl,"#fff"),e}constructor(e){super(e)}},yi={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},Fr={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},OE=class extends Xo{getDefaultColors(){return{...super.getDefaultColors(),fills:{...yi},fillsFallback:Object.values({...yi}),strokes:{...Fr},sequentialColors:wi(yi),divergingColors:[yi.GREEN,yi.BLUE,yi.RED],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],up:{fill:yi.GREEN,stroke:Fr.GREEN},down:{fill:yi.RED,stroke:Fr.RED},neutral:{fill:yi.BLUE,stroke:Fr.BLUE},altUp:{fill:yi.GREEN,stroke:Fr.GREEN},altDown:{fill:yi.RED,stroke:Fr.RED},altNeutral:{fill:yi.GRAY,stroke:Fr.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),gridLineColor:{$foregroundBackgroundAccentMix:[.88,.01]},padding:0}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(tt,yi.BLUE),e.set(mt,yi.BLUE),e.set(En,"overlay"),e.set(Pn,"left"),e.set(xl,"bottom"),e.set(ds,!0),e}},bi={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},_r={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},EE=class extends gs{getDefaultColors(){return{...super.getDefaultColors(),fills:{...bi},fillsFallback:Object.values({...bi}),strokes:{..._r},sequentialColors:wi(bi),divergingColors:[bi.GREEN,bi.BLUE,bi.RED],up:{fill:bi.GREEN,stroke:_r.GREEN},down:{fill:bi.RED,stroke:_r.RED},neutral:{fill:bi.BLUE,stroke:_r.BLUE},altUp:{fill:bi.GREEN,stroke:_r.GREEN},altDown:{fill:bi.RED,stroke:_r.RED},altNeutral:{fill:bi.GRAY,stroke:_r.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),gridLineColor:{$foregroundBackgroundAccentMix:[.94,.01]},padding:0}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(tt,bi.BLUE),e.set(mt,bi.BLUE),e.set(En,"overlay"),e.set(Pn,"left"),e.set(xl,"bottom"),e.set(ds,!0),e}},Ut={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},jr={BLUE:"#90CAF9",ORANGE:"#FFCC80",GREEN:"#A5D6A7",CYAN:"#80DEEA",YELLOW:"#FFF9C4",VIOLET:"#B39DDB",GRAY:"#E0E0E0",MAGENTA:"#F48FB1",BROWN:"#A1887F",RED:"#EF9A9A"},PE=class extends Xo{getDefaultColors(){return{...super.getDefaultColors(),fills:Ut,fillsFallback:Object.values(Ut),strokes:jr,sequentialColors:wi(Ut),divergingColors:[Ut.ORANGE,Ut.YELLOW,Ut.GREEN],secondSequentialColors:["#2196f3","#208FEC","#1E88E5","#1C7FDC","#1976d2","#176EC9","#1565c0"],secondDivergingColors:[Ut.GREEN,Ut.YELLOW,Ut.RED],up:{fill:Ut.GREEN,stroke:jr.GREEN},down:{fill:Ut.RED,stroke:jr.RED},neutral:{fill:Ut.GRAY,stroke:jr.GRAY},altUp:{fill:Ut.BLUE,stroke:jr.BLUE},altDown:{fill:Ut.RED,stroke:jr.RED},altNeutral:{fill:Ut.GRAY,stroke:jr.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(tt,Ut.BLUE),e.set(mt,Ut.BLUE),e}},Wt={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},zr={BLUE:"#1565C0",ORANGE:"#E65100",GREEN:"#2E7D32",CYAN:"#00838F",YELLOW:"#F9A825",VIOLET:"#4527A0",GRAY:"#616161",MAGENTA:"#C2185B",BROWN:"#4E342E",RED:"#B71C1C"},RE=class extends gs{getDefaultColors(){return{...super.getDefaultColors(),fills:Wt,fillsFallback:Object.values(Wt),strokes:zr,sequentialColors:wi(Wt),divergingColors:[Wt.ORANGE,Wt.YELLOW,Wt.GREEN],secondSequentialColors:["#2196f3","#329EF4","#42a5f5","#53ADF6","#64b5f6","#7AC0F8","#90caf9"],secondDivergingColors:[Wt.GREEN,Wt.YELLOW,Wt.RED],up:{fill:Wt.GREEN,stroke:zr.GREEN},down:{fill:Wt.RED,stroke:zr.RED},neutral:{fill:Wt.GRAY,stroke:zr.GRAY},altUp:{fill:Wt.BLUE,stroke:zr.BLUE},altDown:{fill:Wt.RED,stroke:zr.RED},altNeutral:{fill:Wt.GRAY,stroke:zr.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(tt,Wt.BLUE),e.set(mt,Wt.BLUE),e}},nt={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},Br={BLUE:"#6698ff",PURPLE:"#c0a3ff",MAGENTA:"#fc8dfc",PINK:"#ff82b1",RED:"#ff9b70",ORANGE:"#ffcf4e",YELLOW:"#ffff58",GREEN:"#58dd70",CYAN:"#51e2c9",MODERATE_BLUE:"#4fd7ff",GRAY:"#eeeeee"},FE=class extends Xo{getDefaultColors(){return{fills:nt,fillsFallback:Object.values(nt),strokes:Br,sequentialColors:wi(nt),divergingColors:[nt.BLUE,nt.RED],hierarchyColors:[],secondSequentialColors:[nt.BLUE,nt.PURPLE,nt.MAGENTA,nt.PINK,nt.RED,nt.ORANGE,nt.YELLOW,nt.GREEN],secondDivergingColors:[nt.BLUE,nt.RED],secondHierarchyColors:[],up:{fill:nt.GREEN,stroke:Br.GREEN},down:{fill:nt.RED,stroke:Br.RED},neutral:{fill:nt.GRAY,stroke:Br.GRAY},altUp:{fill:nt.BLUE,stroke:Br.BLUE},altDown:{fill:nt.RED,stroke:Br.RED},altNeutral:{fill:nt.GRAY,stroke:Br.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(tt,nt.BLUE),e.set(mt,nt.BLUE),e}},rt={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},Gr={BLUE:"#2346c9",PURPLE:"#7653d4",MAGENTA:"#a73da9",PINK:"#c32d66",RED:"#c84b1c",ORANGE:"#c87f00",YELLOW:"#c1b900",GREEN:"#008c1c",CYAN:"#00927c",MODERATE_BLUE:"#0087bb",GRAY:"#888888"},_E=class extends gs{getDefaultColors(){return{...super.getDefaultColors(),fills:rt,fillsFallback:Object.values(rt),strokes:Gr,sequentialColors:wi(rt),divergingColors:[rt.BLUE,rt.RED],hierarchyColors:[],secondSequentialColors:[rt.BLUE,rt.PURPLE,rt.MAGENTA,rt.PINK,rt.RED,rt.ORANGE,rt.YELLOW,rt.GREEN],secondDivergingColors:[rt.BLUE,rt.RED],secondHierarchyColors:[],up:{fill:rt.GREEN,stroke:Gr.GREEN},down:{fill:rt.RED,stroke:Gr.RED},neutral:{fill:rt.GRAY,stroke:Gr.GRAY},altUp:{fill:rt.BLUE,stroke:Gr.BLUE},altDown:{fill:rt.RED,stroke:Gr.RED},altNeutral:{fill:rt.GRAY,stroke:Gr.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(tt,rt.BLUE),e.set(mt,rt.BLUE),e}},xt={BLUE:"#4472C4",ORANGE:"#ED7D31",GRAY:"#A5A5A5",YELLOW:"#FFC000",MODERATE_BLUE:"#5B9BD5",GREEN:"#70AD47",DARK_GRAY:"#7B7B7B",DARK_BLUE:"#264478",VERY_DARK_GRAY:"#636363",DARK_YELLOW:"#997300"},Yn={BLUE:"#6899ee",ORANGE:"#ffa55d",GRAY:"#cdcdcd",YELLOW:"#ffea53",MODERATE_BLUE:"#82c3ff",GREEN:"#96d56f",DARK_GRAY:"#a1a1a1",DARK_BLUE:"#47689f",VERY_DARK_GRAY:"#878787",DARK_YELLOW:"#c0993d"},jE=class extends Xo{getDefaultColors(){return{...super.getDefaultColors(),fills:{...xt,RED:xt.ORANGE},fillsFallback:Object.values({...xt,RED:xt.ORANGE}),strokes:{...Yn,RED:Yn.ORANGE},sequentialColors:wi({...xt,RED:xt.ORANGE}),divergingColors:[xt.ORANGE,xt.YELLOW,xt.GREEN],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[xt.GREEN,xt.YELLOW,xt.ORANGE],up:{fill:xt.GREEN,stroke:Yn.GREEN},down:{fill:xt.ORANGE,stroke:Yn.ORANGE},neutral:{fill:xt.GRAY,stroke:Yn.GRAY},altUp:{fill:xt.BLUE,stroke:Yn.BLUE},altDown:{fill:xt.ORANGE,stroke:Yn.ORANGE},altNeutral:{fill:xt.GRAY,stroke:Yn.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(tt,xt.BLUE),e.set(mt,xt.BLUE),e}},wt={BLUE:"#5281d5",ORANGE:"#ff8d44",GRAY:"#b5b5b5",YELLOW:"#ffd02f",MODERATE_BLUE:"#6aabe6",GREEN:"#7fbd57",DARK_GRAY:"#8a8a8a",DARK_BLUE:"#335287",VERY_DARK_GRAY:"#717171",DARK_YELLOW:"#a98220"},hn={BLUE:"#214d9b",ORANGE:"#c25600",GRAY:"#7f7f7f",YELLOW:"#d59800",MODERATE_BLUE:"#3575ac",GREEN:"#4b861a",DARK_GRAY:"#575757",DARK_BLUE:"#062253",VERY_DARK_GRAY:"#414141",DARK_YELLOW:"#734f00"},zE=class extends gs{getDefaultColors(){return{...super.getDefaultColors(),fills:{...wt,RED:wt.ORANGE},fillsFallback:Object.values({...wt,RED:wt.ORANGE}),strokes:{...hn,RED:hn.ORANGE},sequentialColors:wi({...wt,RED:wt.ORANGE}),divergingColors:[wt.ORANGE,wt.YELLOW,wt.GREEN],secondSequentialColors:["#5090dc","#629be0","#73a6e3","#85b1e7","#96bcea","#a8c8ee","#b9d3f1","#cbdef5"],secondDivergingColors:[wt.GREEN,wt.YELLOW,wt.ORANGE],secondHierarchyColors:[],up:{fill:wt.GREEN,stroke:hn.GREEN},down:{fill:wt.ORANGE,stroke:hn.ORANGE},neutral:{fill:hn.GRAY,stroke:hn.GRAY},altUp:{fill:wt.BLUE,stroke:hn.BLUE},altDown:{fill:wt.ORANGE,stroke:hn.ORANGE},altNeutral:{fill:wt.GRAY,stroke:hn.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(tt,wt.BLUE),e.set(mt,wt.BLUE),e}},$=(O(),N(T)),ce=(O(),N(T)),qo={...on,type:(0,ce.required)((0,ce.constant)("ordinal-time")),paddingInner:ce.ratio,paddingOuter:ce.ratio,groupPaddingInner:ce.ratio,label:wl,parentLevel:$h,interval:Gn((0,ce.or)(ce.number,ce.date),!0).interval,crosshair:Bn(!0)},QM={...zn,...Gn(ce.number),type:(0,ce.required)((0,ce.constant)("angle-number")),crossLines:(0,ce.arrayOfDefs)(Os),startAngle:ce.number,endAngle:ce.number,label:{...Cr,orientation:(0,ce.union)("fixed","parallel","perpendicular"),format:jn}},BE={innerRadiusRatio:ce.ratio},JM={...zn,...BE,type:(0,ce.required)((0,ce.constant)("angle-category")),shape:(0,ce.union)("polygon","circle"),crossLines:(0,ce.arrayOfDefs)(Os),startAngle:ce.number,endAngle:ce.number,paddingInner:ce.ratio,groupPaddingInner:ce.ratio,label:{...Cr,orientation:(0,ce.union)("fixed","parallel","perpendicular")}},eS={...zn,...Gn(ce.number),type:(0,ce.required)((0,ce.constant)("radius-number")),shape:(0,ce.union)("polygon","circle"),positionAngle:ce.number,innerRadiusRatio:ce.ratio,crossLines:(0,ce.arrayOfDefs)({...Os,label:{...kr,positionAngle:ce.number}},"cross-line options"),title:{enabled:ce.boolean,text:ce.string,spacing:ce.positiveNumber,formatter:ce.callback,...ce.fontOptionsDef},label:{...Cr,format:jn}},tS={...zn,type:(0,ce.required)((0,ce.constant)("radius-category")),positionAngle:ce.number,innerRadiusRatio:ce.ratio,paddingInner:ce.ratio,paddingOuter:ce.ratio,groupPaddingInner:ce.ratio,label:Cr,crossLines:(0,ce.arrayOfDefs)({...Os,label:{...kr,positionAngle:ce.number}},"cross-line options"),title:{enabled:ce.boolean,text:ce.string,spacing:ce.positiveNumber,formatter:ce.callback,...ce.fontOptionsDef}},z=(O(),N(T)),Qo={lineStyle:(0,z.union)("solid","dashed","dotted"),...z.lineDashOptionsDef},Vr={...z.fillOptionsDef,...z.strokeOptionsDef,...z.lineDashOptionsDef},Vl={visible:z.boolean,locked:z.boolean,handle:Vr,...z.fontOptionsDef},Mu={position:(0,z.union)("top","center","bottom"),alignment:(0,z.union)("left","center","right"),...z.fontOptionsDef},iS={position:(0,z.union)("top","inside","bottom"),alignment:(0,z.union)("left","center","right"),...z.fontOptionsDef},GE={enabled:z.boolean,cornerRadius:z.positiveNumber,formatter:z.callback,...z.fontOptionsDef,...z.fillOptionsDef,...z.strokeOptionsDef,...z.lineDashOptionsDef},VE={visible:z.boolean,...Qo,...z.strokeOptionsDef},sS={divider:z.strokeOptionsDef,...z.fillOptionsDef,...z.strokeOptionsDef,...z.fontOptionsDef},nS={handle:Vr,statistics:sS,...Qo,...z.fillOptionsDef,...z.strokeOptionsDef},Su={visible:z.boolean,locked:z.boolean,extendStart:z.boolean,extendEnd:z.boolean,handle:Vr,text:Mu,...Qo,...z.strokeOptionsDef},Pf={visible:z.boolean,locked:z.boolean,axisLabel:GE,handle:Vr,text:Mu,...Qo,...z.strokeOptionsDef},Rf={visible:z.boolean,locked:z.boolean,extendStart:z.boolean,extendEnd:z.boolean,handle:Vr,text:iS,background:z.fillOptionsDef,...Qo,...z.strokeOptionsDef},rS={...Rf},oS={...Rf,middle:VE},Ff={label:z.fontOptionsDef,showFill:z.boolean,isMultiColor:z.boolean,strokes:(0,z.arrayOf)(z.color),rangeStroke:z.color,bands:(0,z.union)(4,6,10),...Su},aS={...z.fillOptionsDef,...z.strokeOptionsDef,...Vl},lS={...z.fillOptionsDef,...z.strokeOptionsDef,...Vl},cS={...z.fillOptionsDef,...z.strokeOptionsDef,...Vl,background:{...z.fillOptionsDef,...z.strokeOptionsDef}},_f={visible:z.boolean,locked:z.boolean,handle:Vr,...z.fillOptionsDef},Du={visible:z.boolean,locked:z.boolean,extendStart:z.boolean,extendEnd:z.boolean,handle:Vr,text:Mu,background:z.fillOptionsDef,statistics:sS,...Qo,...z.strokeOptionsDef},hS={visible:z.boolean,up:nS,down:nS},Jo={enabled:z.boolean,axesButtons:{enabled:z.boolean,axes:(0,z.union)("x","y","xy")},toolbar:{enabled:z.boolean,padding:z.positiveNumber,buttons:(0,z.arrayOfDefs)({...wr,value:(0,z.union)("line-menu","fibonacci-menu","text-menu","shape-menu","measurer-menu","line","horizontal-line","vertical-line","parallel-channel","disjoint-channel","fibonacci-retracement","fibonacci-retracement-trend-based","text","comment","callout","note","clear")},"annotation toolbar buttons array")},optionsToolbar:{enabled:z.boolean,buttons:(0,z.arrayOf)((0,z.or)((0,z.optionsDefs)({...wr,value:(0,z.required)((0,z.union)("line-stroke-width","line-style-type","line-color","fill-color","text-color","text-size","delete","settings"))}),(0,z.optionsDefs)({...wr,value:(0,z.required)((0,z.union)("lock")),checkedOverrides:wr})))}};Jo.data=(0,z.undocumented)(z.array),Jo.xKey=(0,z.undocumented)(z.string),Jo.volumeKey=(0,z.undocumented)(z.string),Jo.snap=(0,z.undocumented)(z.boolean);var I=(O(),N(T)),uS={direction:(0,I.union)("horizontal","vertical"),showInMiniChart:I.boolean,cornerRadius:I.positiveNumber,itemStyler:(0,I.callbackDefs)({...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef,cornerRadius:I.positiveNumber,whisker:{...I.strokeOptionsDef,...I.lineDashOptionsDef},cap:{lengthRatio:I.ratio}}),whisker:{...I.strokeOptionsDef,...I.lineDashOptionsDef},cap:{lengthRatio:I.ratio},tooltip:Ae,...Se,...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef},dS={cornerRadius:I.positiveNumber,wick:{...I.strokeOptionsDef,...I.lineDashOptionsDef},...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef},pS={item:{up:dS,down:dS},itemStyler:(0,I.callbackDefs)({...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef,cornerRadius:I.positiveNumber,wick:{...I.strokeOptionsDef,...I.lineDashOptionsDef}}),showInMiniChart:I.boolean,tooltip:Ae,...Se},gS={fills:(0,I.arrayOf)(I.colorUnion),strokes:(0,I.arrayOf)(I.color),label:{spacing:I.positiveNumber,maxWidth:I.positiveNumber,...Pe},link:{tension:I.ratio,itemStyler:(0,I.callbackDefs)({...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef,tension:I.ratio}),...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef},node:{width:I.positiveNumber,spacing:I.positiveNumber,itemStyler:(0,I.callbackDefs)({...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef}),...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef},tooltip:Ae,...Se},fS={direction:(0,I.union)("horizontal","vertical"),fills:(0,I.arrayOf)(I.colorUnion),strokes:(0,I.arrayOf)(I.color),showInMiniChart:I.boolean,label:{spacing:I.positiveNumber,placement:(0,I.union)("before","middle","after"),...Pe},stageLabel:{rotation:I.number,spacing:I.positiveNumber,minSpacing:I.positiveNumber,placement:(0,I.union)("before","after"),avoidCollisions:I.boolean,itemStyler:(0,I.callbackDefs)({...I.fontOptionsDef,spacing:I.number}),format:I.string,...Pe},tooltip:Ae,...Se,...H(I.fillOptionsDef,["fill"]),...H(I.strokeOptionsDef,["stroke"]),...I.lineDashOptionsDef},mS={direction:(0,I.union)("horizontal","vertical"),fills:(0,I.arrayOf)(I.colorUnion),strokes:(0,I.arrayOf)(I.color),showInMiniChart:I.boolean,itemStyler:(0,I.callbackDefs)({...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef}),spacingRatio:I.ratio,crisp:I.boolean,dropOff:{enabled:I.boolean,...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef},stageLabel:{rotation:I.number,spacing:I.positiveNumber,minSpacing:I.positiveNumber,placement:(0,I.union)("before","after"),avoidCollisions:I.boolean,itemStyler:(0,I.callbackDefs)({...I.fontOptionsDef,spacing:I.number}),format:I.string,...Pe},label:Pe,tooltip:Ae,shadow:Es,...Se,...H(I.fillOptionsDef,["fill"]),...H(I.strokeOptionsDef,["stroke"]),...I.lineDashOptionsDef},yS={title:I.string,textAlign:(0,I.union)("left","center","right"),verticalAlign:(0,I.union)("top","middle","bottom"),itemPadding:I.positiveNumber,itemStyler:(0,I.callbackDefs)({...I.fillOptionsDef,...I.strokeOptionsDef}),showInMiniChart:I.boolean,label:Vn,tooltip:Ae,...Se,...I.strokeOptionsDef},bS={showInMiniChart:I.boolean,itemStyler:(0,I.callbackDefs)({...I.strokeOptionsDef,...I.lineDashOptionsDef}),item:{up:{...I.strokeOptionsDef,...I.lineDashOptionsDef},down:{...I.strokeOptionsDef,...I.lineDashOptionsDef}},tooltip:Ae,...Se},xS={maxStrokeWidth:I.positiveNumber,itemStyler:(0,I.callbackDefs)({...I.strokeOptionsDef,...I.lineDashOptionsDef}),sizeDomain:(0,I.arrayOf)(I.positiveNumber),label:Pe,tooltip:Ae,...Se,...I.strokeOptionsDef,...I.lineDashOptionsDef,highlightStyle:{...Se.highlightStyle,...I.strokeOptionsDef}},vS={...I.strokeOptionsDef,...I.lineDashOptionsDef},MS={colorRange:(0,I.arrayOf)(I.color),maxSize:I.positiveNumber,sizeDomain:(0,I.arrayOf)(I.positiveNumber),label:{placement:(0,I.union)("top","bottom","left","right"),...Pe},tooltip:Ae,...Se,...H(an,["enabled"]),highlightStyle:{...Se.highlightStyle,...I.fillOptionsDef,...I.strokeOptionsDef}},SS={colorRange:(0,I.arrayOf)(I.color),padding:I.positiveNumber,itemStyler:(0,I.callbackDefs)({...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef}),label:Vn,tooltip:Ae,...Se,...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef,highlightStyle:{...Se.highlightStyle,...I.fillOptionsDef,...I.strokeOptionsDef}},DS={...Se,...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef},IS={cornerRadius:I.positiveNumber,itemStyler:(0,I.callbackDefs)({...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef,cornerRadius:I.positiveNumber}),label:Pe,tooltip:Ae,...Se,...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef},AS={direction:(0,I.union)("horizontal","vertical"),aspectRatio:I.positiveNumber,spacing:I.positiveNumber,reverse:I.boolean,itemStyler:(0,I.callbackDefs)({...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef}),fills:(0,I.arrayOf)(I.colorUnion),strokes:(0,I.arrayOf)(I.color),label:Pe,stageLabel:{spacing:I.positiveNumber,placement:(0,I.union)("before","after"),...Pe},tooltip:Ae,shadow:Es,...Se,...H(I.fillOptionsDef,["fill"]),...H(I.strokeOptionsDef,["stroke"]),...I.lineDashOptionsDef},LS={connectMissingData:I.boolean,marker:an,label:Pe,tooltip:Ae,...Se,...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef},kS={connectMissingData:I.boolean,marker:an,label:Pe,tooltip:Ae,...Se,...I.strokeOptionsDef,...I.lineDashOptionsDef},CS={cornerRadius:I.positiveNumber,itemStyler:(0,I.callbackDefs)({...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef,cornerRadius:I.positiveNumber}),label:Pe,tooltip:Ae,...Se,...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef},wS={cornerRadius:I.positiveNumber,columnWidthRatio:I.ratio,maxColumnWidthRatio:I.ratio,itemStyler:(0,I.callbackDefs)({...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef,cornerRadius:I.positiveNumber}),label:Pe,tooltip:Ae,...Se,...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef},TS={showInMiniChart:I.boolean,connectMissingData:I.boolean,interpolation:tu,label:{...Pe,padding:I.positiveNumber,placement:(0,I.union)("inside","outside")},marker:an,tooltip:Ae,shadow:Es,...Se,...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef},NS={direction:(0,I.union)("horizontal","vertical"),showInMiniChart:I.boolean,cornerRadius:I.positiveNumber,itemStyler:(0,I.callbackDefs)({...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef,cornerRadius:I.positiveNumber}),label:{...Pe,padding:I.positiveNumber,placement:(0,I.union)("inside","outside")},tooltip:Ae,shadow:Es,...Se,...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef},OS={fills:(0,I.arrayOf)(I.colorUnion),strokes:(0,I.arrayOf)(I.color),label:{...Pe,spacing:I.positiveNumber},link:{itemStyler:(0,I.callbackDefs)({...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef}),...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef},node:{width:I.positiveNumber,spacing:I.positiveNumber,alignment:(0,I.union)("left","center","right","justify"),itemStyler:(0,I.callbackDefs)({...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef}),...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef},tooltip:Ae,...Se},ES={fills:(0,I.arrayOf)(I.colorUnion),strokes:(0,I.arrayOf)(I.color),colorRange:(0,I.arrayOf)(I.color),sectorSpacing:I.positiveNumber,cornerRadius:I.positiveNumber,padding:I.positiveNumber,itemStyler:(0,I.callbackDefs)({...I.fillOptionsDef,...I.strokeOptionsDef}),label:{spacing:I.positiveNumber,...Vn},secondaryLabel:Vn,tooltip:Ae,...Se,...H(I.fillOptionsDef,["fill"]),...H(I.strokeOptionsDef,["stroke"]),highlightStyle:{label:{color:I.color},secondaryLabel:{color:I.color},...I.fillOptionsDef,...I.strokeOptionsDef}},PS={fills:(0,I.arrayOf)(I.colorUnion),strokes:(0,I.arrayOf)(I.color),colorRange:(0,I.arrayOf)(I.color),itemStyler:(0,I.callbackDefs)({...I.fillOptionsDef,...I.strokeOptionsDef}),group:{gap:I.positiveNumber,padding:I.positiveNumber,cornerRadius:I.positiveNumber,textAlign:(0,I.union)("left","center","right"),interactive:I.boolean,label:{...Pe,spacing:I.positiveNumber},...I.fillOptionsDef,...I.strokeOptionsDef},tile:{gap:I.positiveNumber,padding:I.positiveNumber,cornerRadius:I.positiveNumber,textAlign:(0,I.union)("left","center","right"),verticalAlign:(0,I.union)("top","middle","bottom"),label:{...Pe,spacing:I.positiveNumber,lineHeight:I.positiveNumber,minimumFontSize:I.positiveNumber,wrapping:(0,I.union)("never","always","hyphenate","on-space"),overflowStrategy:(0,I.union)("ellipsis","hide")},secondaryLabel:{...Pe,lineHeight:I.positiveNumber,minimumFontSize:I.positiveNumber,wrapping:(0,I.union)("never","always","hyphenate","on-space"),overflowStrategy:(0,I.union)("ellipsis","hide")},...I.fillOptionsDef,...I.strokeOptionsDef},tooltip:Ae,...Se,highlightStyle:{group:{label:{color:I.color},...I.fillOptionsDef,...I.strokeOptionsDef},tile:{label:{color:I.color},secondaryLabel:{color:I.color},...I.fillOptionsDef,...I.strokeOptionsDef}}},jf={name:I.string,cornerRadius:I.positiveNumber,itemStyler:(0,I.callbackDefs)({...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef,cornerRadius:I.positiveNumber}),label:{...Pe,padding:I.positiveNumber,placement:(0,I.union)("inside-start","inside-center","inside-end","outside-start","outside-end")},tooltip:Ae,shadow:Es,...I.fillOptionsDef,...I.strokeOptionsDef,...I.lineDashOptionsDef},RS={direction:(0,I.union)("horizontal","vertical"),showInMiniChart:I.boolean,item:{positive:jf,negative:jf,total:jf},line:{enabled:I.boolean,...I.strokeOptionsDef,...I.lineDashOptionsDef},tooltip:Ae,...Se},Iu=(0,$.optionsDefs)({__type:(0,$.required)((0,$.constant)("date")),value:(0,$.or)($.string,$.number)},"a serializable date object"),FS={width:$.positiveNumber,height:$.positiveNumber,grip:$.boolean,fill:$.color,stroke:$.color,strokeWidth:$.positiveNumber,cornerRadius:$.positiveNumber},we={enabled:$.boolean,height:$.positiveNumber,spacing:$.positiveNumber,cornerRadius:$.number,mask:{fill:$.color,fillOpacity:$.ratio,stroke:$.color,strokeWidth:$.positiveNumber},minHandle:FS,maxHandle:FS,miniChart:{enabled:$.boolean,padding:{top:$.positiveNumber,bottom:$.positiveNumber},label:{enabled:$.boolean,avoidCollisions:$.boolean,spacing:$.positiveNumber,format:jn,formatter:$.callback,interval:{minSpacing:$.positiveNumber,maxSpacing:$.positiveNumber,values:$.array,step:$.number},...$.fontOptionsDef},series:$.defined}},ti={number:{...H(Yo,["type","crossLines"]),top:H(Yo,["type","crossLines","position"]),right:H(Yo,["type","crossLines","position"]),bottom:H(Yo,["type","crossLines","position"]),left:H(Yo,["type","crossLines","position"]),crossLines:H(rn,["type"])},log:{...H($o,["type","crossLines"]),top:H($o,["type","crossLines","position"]),right:H($o,["type","crossLines","position"]),bottom:H($o,["type","crossLines","position"]),left:H($o,["type","crossLines","position"]),crossLines:H(rn,["type"])},category:{...H(Ko,["type","crossLines"]),top:H(Ko,["type","crossLines","position"]),right:H(Ko,["type","crossLines","position"]),bottom:H(Ko,["type","crossLines","position"]),left:H(Ko,["type","crossLines","position"]),crossLines:H(rn,["type"])},time:{...H(cn,["type","crossLines"]),top:H(cn,["type","crossLines","position"]),right:H(cn,["type","crossLines","position"]),bottom:H(cn,["type","crossLines","position"]),left:H(cn,["type","crossLines","position"]),crossLines:H(rn,["type"])},"grouped-category":{...H(Zo,["type"]),top:H(Zo,["type","position"]),right:H(Zo,["type","position"]),bottom:H(Zo,["type","position"]),left:H(Zo,["type","position"]),crossLines:H(rn,["type"])},"unit-time":{...H(Pr,["type","crossLines"]),top:H(Pr,["type","crossLines","position"]),right:H(Pr,["type","crossLines","position"]),bottom:H(Pr,["type","crossLines","position"]),left:H(Pr,["type","crossLines","position"]),crossLines:H(rn,["type"])},"ordinal-time":{...H(qo,["type","crossLines"]),top:H(qo,["type","crossLines","position"]),right:H(qo,["type","crossLines","position"]),bottom:H(qo,["type","crossLines","position"]),left:H(qo,["type","crossLines","position"]),crossLines:H(rn,["type"])}},ea={"angle-category":{...H(JM,["type","crossLines"]),crossLines:H(Os,["type"])},"angle-number":{...H(QM,["type","crossLines"]),crossLines:H(Os,["type"])},"radius-category":{...H(tS,["type","crossLines"]),crossLines:{...H(Os,["type"]),label:{...kr,positionAngle:$.number}}},"radius-number":{...H(eS,["type","crossLines"]),crossLines:{...H(Os,["type"]),label:{...kr,positionAngle:$.number}}}},Re={visible:$.boolean},UE={common:{...re,navigator:we,axes:{...ti,...ea},annotations:{...Jo,line:Su,"horizontal-line":Pf,"vertical-line":Pf,"disjoint-channel":rS,"parallel-channel":oS,"fibonacci-retracement":Ff,"fibonacci-retracement-trend-based":Ff,callout:aS,comment:lS,note:cS,text:Vl,arrow:Su,"arrow-up":_f,"arrow-down":_f,"date-range":Du,"price-range":Du,"date-price-range":Du,"quick-date-price-range":hS},chartToolbar:{enabled:$.boolean},initialState:{legend:(0,$.arrayOfDefs)({visible:$.boolean,seriesId:$.string,itemId:$.string,legendItemName:$.string},"legend state array"),zoom:{rangeX:{start:(0,$.or)($.number,Iu),end:(0,$.or)($.number,Iu)},rangeY:{start:(0,$.or)($.number,Iu),end:(0,$.or)($.number,Iu)},ratioX:{start:$.ratio,end:$.ratio},ratioY:{start:$.ratio,end:$.ratio},autoScaledAxes:(0,$.arrayOf)((0,$.constant)("y"))}}},line:{...re,axes:ti,series:lf,navigator:we,...Re},scatter:{...re,axes:ti,series:vM,navigator:we,...Re},bubble:{...re,axes:ti,series:dM,navigator:we,...Re},area:{...re,axes:ti,series:tM,navigator:we,...Re},bar:{...re,axes:ti,series:rf,navigator:we,...Re},"box-plot":{...re,axes:ti,series:uS,navigator:we,...Re},candlestick:{...re,axes:ti,series:pS,navigator:we,...Re},"cone-funnel":{...re,axes:ti,series:fS,navigator:we,...Re},funnel:{...re,axes:ti,series:mS,navigator:we,...Re},ohlc:{...re,axes:ti,series:bS,navigator:we,...Re},histogram:{...re,axes:H(ti,["category","grouped-category","ordinal-time","unit-time"]),series:fM,navigator:we,...Re},heatmap:{...re,axes:ti,series:yS,navigator:we,...Re},waterfall:{...re,axes:ti,series:RS,navigator:we,...Re},"range-bar":{...re,axes:ti,series:NS,navigator:we,...Re},"range-area":{...re,axes:ti,series:TS,navigator:we,...Re},donut:{...re,series:TM,navigator:we,...Re},pie:{...re,series:ff,navigator:we,...Re},"radar-line":{...re,axes:ea,series:kS,navigator:we,...Re},"radar-area":{...re,axes:ea,series:LS,navigator:we,...Re},"radial-bar":{...re,axes:ea,series:CS,navigator:we,...Re},"radial-column":{...re,axes:ea,series:wS,navigator:we,...Re},nightingale:{...re,axes:ea,series:IS,navigator:we,...Re},sunburst:{...re,series:ES,navigator:we,...Re},treemap:{...re,series:PS,navigator:we,...Re},"map-shape":{...re,series:SS,navigator:we,...Re},"map-line":{...re,series:xS,navigator:we,...Re},"map-marker":{...re,series:MS,navigator:we,...Re},"map-shape-background":{...re,series:DS,navigator:we,...Re},"map-line-background":{...re,series:vS,navigator:we,...Re},sankey:{...re,series:OS,navigator:we,...Re},chord:{...re,series:gS,navigator:we,...Re},pyramid:{...re,series:AS,navigator:we,...Re},"radial-gauge":{...re,...bu,targets:H(mu,["value"]),tooltip:{...bu.tooltip,...re.tooltip}},"linear-gauge":{...re,...yu,targets:H(fu,["value"]),tooltip:{...yu.tooltip,...re.tooltip}}};function Au(e,t){const i={};for(const s of Reflect.ownKeys(e))i[s]=t(e[s],s,e);return i}var WE=Au(UE,function e(t,i){if((0,$.isSymbol)(i))return t;if((0,$.isFunction)(t))return(0,$.or)(t,$.themeOperator,$.isSymbol);if((0,$.isObject)(t))return(0,$.or)((0,$.optionsDefs)($.unionSymbol in t?Au(t,s=>(0,$.isObject)(s)?Au(s,e):s):Au(t,e)),$.themeOperator,$.isSymbol);throw new Error(`Invalid theme override value: ${String(t)}`)}),Ht={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Ur={BLUE:"#67b7ff",ORANGE:"#ffc24d",GREEN:"#5cc86f",CYAN:"#54ebff",VIOLET:"#fff653",YELLOW:"#c18aff",GRAY:"#aeaeae",MAGENTA:"#f078d4",BROWN:"#ba8438",RED:"#ff726e"},HE=class extends Xo{getDefaultColors(){return{fills:Ht,fillsFallback:Object.values(Ht),strokes:Ur,sequentialColors:wi(Ht),divergingColors:[Ht.ORANGE,Ht.YELLOW,Ht.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#0076e6","#0069cc","#005cb3","#004f99","#004280","#003466","#00274c"],secondDivergingColors:[Ht.GREEN,Ht.YELLOW,Ht.RED],secondHierarchyColors:[],up:{fill:Ht.GREEN,stroke:Ur.GREEN},down:{fill:Ht.RED,stroke:Ur.RED},neutral:{fill:Ht.GRAY,stroke:Ur.GRAY},altUp:{fill:Ht.BLUE,stroke:Ur.BLUE},altDown:{fill:Ht.ORANGE,stroke:Ur.ORANGE},altNeutral:{fill:Ht.GRAY,stroke:Ur.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(tt,Ht.BLUE),e.set(mt,Ht.BLUE),e}},Yt={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Wr={BLUE:"#0f68c0",ORANGE:"#d47100",GREEN:"#007922",CYAN:"#009ac2",VIOLET:"#bca400",YELLOW:"#753cac",GRAY:"#646464",MAGENTA:"#9b2685",BROWN:"#6c3b00",RED:"#cb0021"},YE=class extends gs{getDefaultColors(){return{...super.getDefaultColors(),fills:Yt,fillsFallback:Object.values(Yt),strokes:Wr,sequentialColors:wi(Yt),divergingColors:[Yt.ORANGE,Yt.YELLOW,Yt.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#1a8fff","#339cff","#4da8ff","#66b5ff","#80c1ff","#99cdff","#b3daff"],secondDivergingColors:[Yt.GREEN,Yt.YELLOW,Yt.RED],secondHierarchyColors:[],up:{fill:Yt.GREEN,stroke:Wr.GREEN},down:{fill:Yt.RED,stroke:Wr.RED},neutral:{fill:Yt.GRAY,stroke:Wr.GRAY},altUp:{fill:Yt.BLUE,stroke:Wr.BLUE},altDown:{fill:Yt.ORANGE,stroke:Wr.ORANGE},altNeutral:{fill:Yt.GRAY,stroke:Wr.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(tt,Yt.BLUE),e.set(mt,Yt.BLUE),e}},zf=ai(()=>new gs),$E=ke.create(!0,"perf"),fs=(e,t,i)=>{$E("[CACHE] ChartTheme",e,t.name,i)},Bf={"ag-default-dark":ai(()=>new Xo),"ag-sheets-dark":ai(()=>new jE,fs),"ag-polychroma-dark":ai(()=>new FE,fs),"ag-vivid-dark":ai(()=>new HE,fs),"ag-material-dark":ai(()=>new PE,fs),"ag-financial-dark":ai(()=>new OE,fs),"ag-default":zf,"ag-sheets":ai(()=>new zE,fs),"ag-polychroma":ai(()=>new _E,fs),"ag-vivid":ai(()=>new YE,fs),"ag-material":ai(()=>new RE,fs),"ag-financial":ai(()=>new EE,fs)},Lu=ai(KE,fs);function KE(e){if(e instanceof gs)return e;if(!QE(e))return zf();if(e==null||typeof e=="string"){const n=Bf[e??"ag-default"];if(n)return n();throw new Error(`Cannot find theme \`${e}\`.`)}const{cleared:t,invalid:i}=(0,ae.validate)(ZE(e),XE,"theme");for(const n of i)ae.Logger.warnOnce(String(n));const s=t?.baseTheme?Lu(t.baseTheme):zf();return t?new s.constructor(t):s}function ZE(e){if(!(0,ae.isObject)(e)||!(0,ae.isObject)(e.baseTheme))return e;let t=e,i,s;const n=[];for(;typeof t=="object";)i??(i=t.palette),s??(s=t.params),t.overrides&&n.push(t.overrides),t=t.baseTheme;return{baseTheme:t,overrides:xe(...n),params:s,palette:i}}var XE={baseTheme:(0,ae.or)(ae.string,ae.object),overrides:WE,params:{accentColor:ae.color,axisColor:ae.color,backgroundColor:ae.color,borderColor:ae.color,foregroundColor:ae.color,fontFamily:ae.fontFamilyFull,fontSize:ae.number,fontWeight:(0,ae.or)(ae.string,ae.number),gridLineColor:ae.color,padding:ae.number,subtleTextColor:ae.color,textColor:ae.color,chromeBackgroundColor:ae.color,chromeFontFamily:ae.fontFamilyFull,chromeFontSize:ae.number,chromeFontWeight:(0,ae.or)(ae.string,ae.number),chromeSubtleTextColor:ae.color,chromeTextColor:ae.color,inputBackgroundColor:ae.color,inputTextColor:ae.color,crosshairLabelBackgroundColor:ae.color,crosshairLabelTextColor:ae.color},palette:{fills:(0,ae.arrayOf)(ae.colorUnion),strokes:(0,ae.arrayOf)(ae.color),up:{fill:(0,ae.or)(ae.color,ae.gradientStrict),stroke:ae.color},down:{fill:(0,ae.or)(ae.color,ae.gradientStrict),stroke:ae.color},neutral:{fill:(0,ae.or)(ae.color,ae.gradientStrict),stroke:ae.color}}},qE=(0,ae.union)("ag-default","ag-default-dark","ag-sheets","ag-sheets-dark","ag-polychroma","ag-polychroma-dark","ag-vivid","ag-vivid-dark","ag-material","ag-material-dark","ag-financial","ag-financial-dark");function QE(e){const{invalid:t}=(0,ae.validate)({theme:e},{theme:(0,ae.or)(qE,ae.object)});for(const i of t)ae.Logger.warnOnce(String(i));return t.length===0}var _S=e=>`'${e}'`,ta=class ct{constructor(t,i,s,n,r,o,a=!1){this.themeParameters={},this.optionMetadata=r??{},this.processedOverrides=s??{};let l=null;t instanceof ct?(l=t,this.specialOverrides=l.specialOverrides,o===void 0&&(o=Ss(l.userOptions,i,ct.JSON_DIFF_OPTS)),this.userOptions=Ve(ba(o,l.userOptions),{...ct.OPTIONS_CLONE_OPTS,seen:[]})):(this.userOptions=Ve(t??i,{...ct.OPTIONS_CLONE_OPTS,seen:[]}),this.specialOverrides=this.specialOverridesDefaults({...n})),a&&this.removeLeftoverSymbols(this.userOptions);let c,h,u,d,p,f,y;!a&&o!==void 0&&ct.isFastPathDelta(o)&&l!=null?({activeTheme:c,processedOptions:h,defaultAxes:u,fastDelta:d}=this.fastSetup(o,l),p=l.themeParameters,f=l.annotationThemes):(ct.perfDebug("ChartOptions.slowSetup()"),{activeTheme:c,processedOptions:h,defaultAxes:u,themeParameters:p,annotationThemes:f,googleFonts:y}=this.slowSetup(s,o,a)),this.activeTheme=c,this.processedOptions=h,this.defaultAxes=u,this.fastDelta=d??void 0,this.themeParameters=p,this.annotationThemes=f,this.googleFonts=y,ke.inDevelopmentMode(()=>nr(this))}static isFastPathDelta(t){for(const i of Object.keys(t??{}))if(!this.FAST_PATH_OPTIONS.has(i))return ct.perfDebug("ChartOptions.isFastPathDelta() - slow path required due to presence of: ",i),!1;return ct.perfDebug("ChartOptions.isFastPathDelta() - fast path possible."),!0}fastSetup(t,i){const{activeTheme:s,defaultAxes:n,processedOptions:r}=i,{presetType:o}=this.optionMetadata;if(o!=null&&t?.data!=null){const l=oe.ModuleRegistry.getPresetModule(o);if(l?.processData){const{series:c,data:h}=l.processData(t.data);t=xe({series:c,data:h},t)}}this.fastSeriesSetup(t,r);const a=xe(t,r);return ct.debug("ChartOptions.fastSetup() - processed options",a),{activeTheme:s,defaultAxes:n,processedOptions:a,fastDelta:t}}fastSeriesSetup(t,i){t?.series&&(t.series?.every((s,n)=>Zy(s,i.series?.[n]??{}))?delete t.series:t.series=t.series.map((s,n)=>ba(s,i.series?.[n]??{})))}slowSetup(t,i,s=!1){let n=Ve(this.userOptions,ct.OPTIONS_CLONE_OPTS);i&&(n=xe(i,n),s&&this.removeLeftoverSymbols(n));const{presetType:r}=this.optionMetadata;if(r!=null){const M=oe.ModuleRegistry.getPresetModule(r);if(M){const{validate:S=oe.validate}=M,D=n,C=n.type,k=C!=null?Lu(n.theme).presets[C]:void 0,{cleared:L,invalid:w}=S(D,M.options,"");w.forEach(P=>oe.Logger.warn(P)),(0,oe.hasRequiredInPath)(w,"")?n={}:(ct.debug(">>> AgCharts.createOrUpdate() - applying preset",L),n=M.create(L,k,()=>this.activeTheme))}}this.soloSeriesIntegrity(n),Hn.isEnterprise||KM(n);const o=Lu(n.theme);if(r!=null&&o.templateTheme(n,!1),this.validateSeriesOptions(n),this.chartDef=oe.ModuleRegistry.detectChartDefinition(n),!this.chartDef.placeholder){const{validate:M=oe.validate}=this.chartDef,{cleared:S,invalid:D}=M(n,this.chartDef.options,"");D.forEach(C=>oe.Logger.warn(C)),n=S}this.validateAxesOptions(n),this.removeDisabledOptions(n);const a=this.optionsType(n),{annotations:l={},axes:c={},series:h,...u}=this.getSeriesThemeConfig(a,o),[d,p]=this.splitAnnotationsOptions(l),f=Ve(p),y=this.getDefaultAxes(n,h);let b=xe(t,n,d,u,y);this.processAxesOptions(b,c),this.processSeriesOptions(b,o),b=Ve(b,ct.OPTIONS_CLONE_OPTS),(Qp(b)||Jp(b)||jT(b))&&b.legend?.enabled==null&&(b.legend??(b.legend={}),b.legend.enabled=b.series.length>1),this.enableConfiguredOptions(b,n);let m=this.processFonts(b);const v=o.params;return m=this.processFonts(v,m),v.__palette=Ve(o.palette),v.__palette.type=(0,oe.isObject)(n.theme)?XM(n.theme?.palette):"inbuilt",this.resolveThemeOperations(v,v),this.resolveThemeOperations(v,b),this.resolveThemeOperations(v,f),o.templateTheme(b,!1),CE(b),Hn.isEnterprise||KM(b,!0),this.validateSeriesOptions(b),this.validateAxesOptions(b),this.validatePluginOptions(b),this.processMiniChartSeriesOptions(b),b.loadGoogleFonts||m.clear(),ct.debug(()=>["ChartOptions.slowSetup() - processed options",Ve(b)]),{activeTheme:o,processedOptions:b,defaultAxes:y,themeParameters:v,annotationThemes:f,googleFonts:m}}validatePluginOptions(t){for(const i of oe.ModuleRegistry.listModulesByType(oe.ModuleType.Plugin)){const s=i.name;if(s in t&&(!i.chartType||i.chartType===this.chartDef?.name)){const{cleared:n,invalid:r}=(0,oe.validate)(t[s],i.options,i.name);r.forEach(o=>oe.Logger.warn(o)),t[s]=n}}}validateSeriesOptions(t){const i=this.chartDef?.name,s=[],n=t.series?.length??0;let r;for(let o=0;o<n;o++){const a=`series[${o}]`,l=t.series[o],c=oe.ModuleRegistry.getSeriesModule(l.type??"line");if(c==null){r??(r=(0,oe.joinFormatted)(Array.from(oe.ModuleRegistry.listModulesByType(oe.ModuleType.Series)).filter(p=>!i||p.chartType===i).map(p=>p.name),"or",_S)),oe.Logger.warn(`Unknown type \`${l.type}\` at \`${a}.type\`; expecting ${r}, ignoring.`);continue}else if(i&&c.chartType!==i){oe.Logger.warn(`Series type \`${c.name}\` at \`${a}.type\` is not supported by chart type \`${i}\`, ignoring.`);continue}const{validate:h=oe.validate}=c,{cleared:u,invalid:d}=h(l,c.options,a);d.forEach(p=>oe.Logger.warn(p)),(0,oe.hasRequiredInPath)(d,a)||s.push(u)}t.series=s}validateAxesOptions(t){if(!("axes"in t)||!t.axes)return;const i=this.chartDef?.name,s=[],n=t.axes.length??0;let r;for(let o=0;o<n;o++){const a=`axes[${o}]`;let l=t.axes[o];l.type==="time"&&l.unit!=null&&(l={...l,type:"unit-time"});const c=oe.ModuleRegistry.getAxisModule(l.type);if(c==null){r??(r=(0,oe.joinFormatted)(Array.from(oe.ModuleRegistry.listModulesByType(oe.ModuleType.Axis)).filter(p=>p.chartType===i).map(p=>p.name),"or",_S)),oe.Logger.warn(`Unknown type \`${l.type}\` at  \`${a}.type\`; expecting one of ${r}, ignoring all axes options.`),delete t.axes;break}else if(c.chartType!==i){oe.Logger.warn(`Axis type \`${c.name}\` at  \`${a}.type\` is not supported by chart type \`${i}\`, ignoring.`);break}const{validate:h=oe.validate}=c,{cleared:u,invalid:d}=h(l,c.options,a);d.forEach(p=>oe.Logger.warn(p)),(0,oe.hasRequiredInPath)(d,a)||s.push(u)}t.axes=s}diffOptions(t){return this===t?{}:t==null?this.processedOptions:this.fastDelta??Ss(t.processedOptions,this.processedOptions,ct.JSON_DIFF_OPTS)}getSeriesThemeConfig(t,i){return i?.config[t]??{}}getDefaultAxes(t,i){const s=this.optionsType(t),n=t.series?.find(o=>(o.type??"line")===s)??{},r=Vi.cloneDefaultAxes(s);return Pc(r,{},void 0,xe(n,i)),r}optionsType(t){return t.series?.[0]?.type??"line"}splitAnnotationsOptions(t){const{axesButtons:i=null,enabled:s=null,optionsToolbar:n=null,toolbar:r=null,...o}=t;return i==null&&s==null&&n==null&&r==null?[{},o]:[{annotations:{axesButtons:i,enabled:s,optionsToolbar:n,toolbar:r}},o]}processAxesOptions(t,i){"axes"in t&&(t.axes=t.axes?.map(s=>{const{crossLines:n,...r}=xe(i[s.type]?.[s.position],i[s.type]);s.crossLines&&(s.crossLines=vc(s.crossLines,n));const o=r.gridLine?.style;s.gridLine?.style&&o?.length&&(s.gridLine.style=s.gridLine.style.map((d,p)=>d.stroke!=null||d.lineDash!=null?xe(d,o.at(p%o.length)):d));const{top:a,right:l,bottom:c,left:h,...u}=xe(s,r);return u}))}processSeriesOptions(t,i){const s=this.getTooltipPositionDefaults(t),n=t.series?.map(r=>{r.type??(r.type="line");const{innerLabels:o,...a}=this.getSeriesThemeConfig(r.type,i).series??{},l=oe.ModuleRegistry.getSeriesModule(r.type),c=!!l?.options.tooltip,h=!!l?.options.visible,u=c&&this.getTooltipRangeDefaults(t,r.type),d=xe(this.getSeriesGroupingOptions(r),r,c&&s,u,a,h&&{visible:!0});return d.innerLabels&&(d.innerLabels=vc(d.innerLabels,o)),d});t.series=this.setSeriesGroupingOptions(n??[])}processMiniChartSeriesOptions(t){let i=t.navigator?.miniChart?.series;i!=null&&(i=i.map(s=>(s.type??(s.type="line"),s)),t.navigator.miniChart.series=this.setSeriesGroupingOptions(i))}resolveThemeOperations(t,i){const s=Pc(i,t,new Set(["palette","data","theme"]));ct.debug("ChartOptions.resolveTheme()",s)}getSeriesGroupingOptions(t){const i=Vi.isGroupable(t.type),s=Vi.isStackable(t.type),n=Vi.isStackedByDefault(t.type);t.grouped&&!i&&oe.Logger.warnOnce(`unsupported grouping of series type "${t.type}".`),(t.stacked||t.stackGroup)&&!s&&oe.Logger.warnOnce(`unsupported stacking of series type "${t.type}".`);let{grouped:r,stacked:o}=t;return o??(o=(n||t.stackGroup!=null)&&!(i&&r)),r??(r=!0),{stacked:s&&o,grouped:i&&r&&!(s&&o)}}setSeriesGroupingOptions(t){const i=this.getSeriesGrouping(t);ct.debug("ChartOptions.setSeriesGroupingOptions() - series grouping: ",i);const s={},n=i.reduce((r,o)=>{var a;return o.groupType==="default"||(r[a=o.seriesType]??(r[a]=0),r[o.seriesType]+=o.groupType==="stack"?1:o.series.length),r},{});return i.flatMap(r=>{var o;switch(s[o=r.seriesType]??(s[o]=0),r.groupType){case"stack":{const a=s[r.seriesType]++;return r.series.map((l,c)=>Object.assign(l,{seriesGrouping:{groupId:r.groupId,groupIndex:a,groupCount:n[r.seriesType],stackIndex:c,stackCount:r.series.length}}))}case"group":return r.series.map(a=>Object.assign(a,{seriesGrouping:{groupId:r.groupId,groupIndex:s[r.seriesType]++,groupCount:n[r.seriesType],stackIndex:0,stackCount:0}}))}return r.series}).map(({stacked:r,grouped:o,...a})=>a)}getSeriesGroupId(t){return[t.type,t.xKey,t.stacked?t.stackGroup??"stacked":"grouped"].filter(Boolean).join("-")}getSeriesGrouping(t){const i=new Map;return t.reduce((s,n)=>{const r=n.type;if(!n.stacked&&!n.grouped)s.push({groupType:"default",seriesType:r,series:[n],groupId:"__default__"});else{const o=this.getSeriesGroupId(n);if(!i.has(o)){const l={groupType:n.stacked?"stack":"group",seriesType:r,series:[],groupId:o};i.set(o,l),s.push(l)}i.get(o).series.push(n)}return s},[])}getTooltipPositionDefaults(t){const i=t.tooltip?.position;if(!(0,oe.isPlainObject)(i))return;const{type:s,anchorTo:n,placement:r,xOffset:o,yOffset:a}=i,l={};return(0,oe.isString)(s)&&(0,oe.isEnumValue)(vf,s)&&(l.type=s),(0,oe.isString)(n)&&(0,oe.isEnumValue)(bf,n)&&(l.anchorTo=n),(0,oe.isString)(r)&&(0,oe.isEnumValue)(xf,r)&&(l.placement=r),(0,oe.isFiniteNumber)(o)&&(l.xOffset=o),(0,oe.isFiniteNumber)(a)&&(l.yOffset=a),{tooltip:{position:l}}}getTooltipRangeDefaults(t,i){return{tooltip:{range:t.tooltip?.range??Vi.getTooltipDefauls(i)?.range}}}soloSeriesIntegrity(t){if(!(0,oe.isArray)(t.series))return;const i=t.series;if(i&&i.length>1&&i.some(s=>Vi.isSolo(s.type))){const s=this.optionsType(t);if(Vi.isSolo(s))oe.Logger.warn(`series[0] of type '${s}' is incompatible with other series types. Only processing series[0]`),t.series=i.slice(0,1);else{const{solo:n,nonSolo:r}=(0,oe.groupBy)(i,a=>Vi.isSolo(a.type)?"solo":"nonSolo"),o=(0,oe.unique)(n.map(a=>a.type)).join(", ");oe.Logger.warn(`Unable to mix these series types with the lead series type: ${o}`),t.series=r}}}static enableConfiguredJsonOptions(t,i){typeof i=="object"&&"enabled"in i&&!i._enabledFromTheme&&t.enabled==null&&(i.enabled=!0)}static cleanupEnabledFromThemeJsonOptions(t){t._enabledFromTheme!=null&&delete t._enabledFromTheme}enableConfiguredOptions(t,i){Ds(i,ct.enableConfiguredJsonOptions,new Set(["data","theme"]),t),Ds(t,ct.cleanupEnabledFromThemeJsonOptions,new Set(["data","theme"]))}static processFontOptions(t,i,s,n=new Set){if(typeof t=="object"&&"fontFamily"in t)if(Array.isArray(t.fontFamily)){const r=[];for(const o of t.fontFamily)typeof o=="object"&&"googleFont"in o?(r.push(o.googleFont),n?.add(o.googleFont)):r.push(o);t.fontFamily=r.join(", ")}else typeof t.fontFamily=="object"&&"googleFont"in t.fontFamily&&(t.fontFamily=t.fontFamily.googleFont,n?.add(t.fontFamily));return n}processFonts(t,i=new Set){return Ds(t,ct.processFontOptions,new Set(["data","theme"]),void 0,void 0,i)}static removeDisabledOptionJson(t){"enabled"in t&&t.enabled===!1&&Object.keys(t).forEach(i=>{i!=="enabled"&&delete t[i]})}removeDisabledOptions(t){Ds(t,ct.removeDisabledOptionJson,new Set(["data","theme","contextMenu"]))}static removeLeftoverSymbolsJson(t){if(!(!t||!(0,oe.isObject)(t)))for(const i of Object.keys(t)){const s=t[i];(0,oe.isSymbol)(s)&&delete t[i]}}removeLeftoverSymbols(t){Ds(t,ct.removeLeftoverSymbolsJson,new Set(["data"]))}specialOverridesDefaults(t){if(t.window==null?t.window=(0,oe.getWindow)():(0,oe.setWindow)(t.window),t.document==null?t.document=(0,oe.getDocument)():(0,oe.setDocument)(t.document),t.window==null)throw new Error("AG Charts - unable to resolve global window");if(t.document==null)throw new Error("AG Charts - unable to resolve global document");return t}};ta.OPTIONS_CLONE_OPTS={shallow:new Set(["data","container"]),assign:new Set(["context","theme"])},ta.JSON_DIFF_OPTS=new Set(["data"]),ta.perfDebug=ke.create(!0,"perf"),ta.FAST_PATH_OPTIONS=new Set(["data","width","height","container"]),ta.debug=ke.create(!0,"opts");var Gf=ta,JE=1e3,Vf=class Kn{constructor(t,i,s,n,r,o=JE){this.name=t,this.buildItem=i,this.releaseItem=s,this.destroyItem=n,this.maxPoolSize=r,this.cleanupTimeMs=o,this.freePool=[],this.busyPool=new Set}static getPool(t,i,s,n,r){return this.pools.has(t)||this.pools.set(t,new Kn(t,i,s,n,r)),this.pools.get(t)}isFull(){return this.freePool.length+this.busyPool.size>=this.maxPoolSize}hasFree(){return this.freePool.length>0}obtain(t){if(!this.hasFree()&&this.isFull())throw new Error("AG Charts - pool exhausted");let i=this.freePool.pop();return i==null?(i=this.buildItem(t),Kn.debug(()=>[`Pool[name=${this.name}]: Created instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i])):Kn.debug(()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i]),this.busyPool.add(i),{item:i,release:()=>this.release(i)}}obtainFree(){const t=this.freePool.pop();if(t==null)throw new Error("AG Charts - pool has no free instances");return Kn.debug(()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,t]),this.busyPool.add(t),{item:t,release:()=>this.release(t)}}release(t){if(!this.busyPool.has(t))throw new Error("AG Charts - cannot free item from pool which is not tracked as busy.");Kn.debug(()=>[`Pool[name=${this.name}]: Releasing instance (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,t]),this.releaseItem(t),this.busyPool.delete(t),this.freePool.push(t),Kn.debug(()=>[`Pool[name=${this.name}]: Returned instance to free pool (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,t]);const i=Date.now(),s=i+this.cleanupTimeMs*.5;this.cleanPoolTimer&&(this.cleanPoolDue??1/0)<s&&(clearTimeout(this.cleanPoolTimer),this.cleanPoolTimer=void 0),this.cleanPoolTimer||(this.cleanPoolDue=i+this.cleanupTimeMs,this.cleanPoolTimer=setTimeout(this.cleanPool.bind(this),this.cleanupTimeMs))}cleanPool(){const t=this.freePool.splice(0);for(const i of t)this.destroyItem(i);Kn.debug(()=>[`Pool[name=${this.name}]: Cleaned pool of ${t.length} items (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`])}destroy(){this.cleanPool();for(const t of this.busyPool.values())this.destroyItem(t);this.busyPool.clear()}};Vf.pools=new Map,Vf.debug=ke.create(!0,"pool");var e2=Vf;dc.ModuleRegistry.registerMany(kE);var un=ke.create(!0,"opts"),$n=class{static licenseCheck(e){this.licenseChecked||(this.licenseManager=Hn.licenseManager?.(e),this.licenseManager?.validateLicense(),this.licenseChecked=!0)}static getLicenseDetails(e){return Hn.licenseManager?.({}).getLicenseDetails(e)}static getInstance(e){return jS.getInstance(e)}static create(e,t){return un.group("AgCharts.create()",()=>{e=ke.inDevelopmentMode(()=>nr(Ve(e)))??e,this.licenseCheck(e);const i=jS.createOrUpdate({userOptions:e,licenseManager:this.licenseManager,optionsMetadata:t});return this.licenseManager?.isDisplayWatermark()&&this.licenseManager&&Hn.injectWatermark?.(i.chart.ctx.domManager,this.licenseManager.getWatermarkMessage()),i})}static createFinancialChart(e){return un.group("AgCharts.createFinancialChart()",()=>this.create(e,{presetType:"price-volume"}))}static createGauge(e){return un.group("AgCharts.createGauge()",()=>this.create(e,{presetType:"gauge-preset"}))}static __createSparkline(e){return un.group("AgCharts.__createSparkline()",()=>{const{pool:t,...i}=e;return this.create(i,{presetType:"sparkline",pool:t??!0,domMode:"minimal"})})}};$n.licenseChecked=!1;var Rs=class Zn{static getInstance(t){const i=xh.getInstance(t);return i?Fx.chartInstances.get(i):void 0}static initialiseModules(){Zn.initialised||(yf(),xO(),Zn.initialised=!0)}static createOrUpdate(t){let{proxy:i}=t;const{userOptions:s,licenseManager:n,processedOverrides:r=i?.chart?.chartOptions.processedOverrides??{},specialOverrides:o=i?.chart?.chartOptions.specialOverrides??{},optionsMetadata:a=i?.chart?.chartOptions.optionMetadata??{},deltaOptions:l,stripSymbols:c=!1}=t,h=Hn.styles!=null?[["ag-charts-enterprise",Hn.styles]]:[],{presetType:u}=a;Zn.initialiseModules(),un(()=>[">>> AgCharts.createOrUpdate() user options",Ve(s)]);let d=s;$n.optionsMutationFn&&d&&(d=$n.optionsMutationFn(Ve(d),u),un(()=>[">>> AgCharts.createOrUpdate() MUTATED user options",Ve(d)]));const p=this.getPool(a);let f=!1,y,b=i?.chart;b==null&&p?.hasFree()&&(y=p.obtainFree(),b=y.item);const{document:m,window:v,styleContainer:M,...S}=d??{},D=b?.getChartOptions(),C=new Gf(D,S,r,{...o,document:m,window:v,styleContainer:M},a,l,c);return(b==null||dc.ModuleRegistry.detectChartDefinition(C.processedOptions)!==dc.ModuleRegistry.detectChartDefinition(b.chartOptions.processedOptions))&&(y?.release(),y=this.getPool(C.optionMetadata)?.obtain(C),y?b=y.item:(f=!0,b=Zn.createChartInstance(C,b))),h.forEach(([k,L])=>{b.ctx.domManager.addStyles(k,L)}),b.ctx.fontManager.updateFonts(C.googleFonts),i==null?(i=new Fx(b,Zn.callbackApi,n),i.releaseChart=y?.release):(y||f)&&(i.releaseChart?.(),i.chart=b,i.releaseChart=y?.release),un.check()&&typeof window<"u"&&(window.agChartInstances??(window.agChartInstances={}),window.agChartInstances[b.id]=b),b.queuedUserOptions.push(C.userOptions),b.queuedChartOptions.push(C),b.requestFactoryUpdate(k=>{un.group(">>>> Chart.applyOptions()",()=>{k.applyOptions(C);const L=k.queuedUserOptions.indexOf(C.userOptions)+1;k.queuedUserOptions.splice(0,L),k.queuedChartOptions.splice(0,L)})}),i}static markRemovedProperties(t,i,s=!1){if(typeof t!="object")return s;for(const n of Object.keys(t))typeof t[n]>"u"&&(Object.assign(t,{[n]:Symbol("UNSET")}),s||(s=!0));return s}static updateUserDelta(t,i){i=Ve(i,Gf.OPTIONS_CLONE_OPTS);const s=Ds(i,Zn.markRemovedProperties,new Set(["data"]),void 0,void 0,!1);un(()=>[">>> AgCharts.updateUserDelta() user delta",Ve(i)]),Zn.createOrUpdate({proxy:t,deltaOptions:i,stripSymbols:s})}static createChartInstance(t,i){const s=i?.destroy({keepTransferableResources:!0});return dc.ModuleRegistry.detectChartDefinition(t.processedOptions).create(t,s)}static getPool(t){if(t.pool===!0)return e2.getPool(t.presetType??"default",this.createChartInstance,this.detachAndClear,this.destroy,1/0)}};Rs.caretaker=new hb(uo),Rs.initialised=!1,Rs.callbackApi={caretaker:Rs.caretaker,create(e,t,i,s){return Rs.createOrUpdate({userOptions:e,processedOverrides:t,specialOverrides:i,optionsMetadata:s})},update(e,t){return Rs.createOrUpdate({userOptions:e,proxy:t})},updateUserDelta(e,t){return Rs.updateUserDelta(e,t)}},Rs.detachAndClear=e=>e.detachAndClear(),Rs.destroy=e=>e.destroy();var jS=Rs,Uf={};ji(Uf,{Arc:()=>Fs,BBox:()=>U,Caption:()=>Ye,CategoryScale:()=>el,Group:()=>ue,Line:()=>Xt,LinearScale:()=>us,Marker:()=>Lt,Path:()=>oi,RadialColumnShape:()=>Qi,Rect:()=>qt,Scene:()=>Zc,Sector:()=>Ft,Shape:()=>Bi,TranslatableGroup:()=>Ot,getRadialColumnWidth:()=>zS,toRadians:()=>dt});var t2=(O(),N(T)),Fs=class extends oi{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,t2.isNumberEqual)(ot(this.startAngle),ot(this.endAngle))}updatePath(){const e=this.path;e.clear(),e.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),this.type===1?e.closePath():this.type===2&&!this.fullPie&&(e.lineTo(this.centerX,this.centerY),e.closePath())}computeBBox(){return new U(this.centerX-this.radius,this.centerY-this.radius,this.radius*2,this.radius*2)}isPointInPath(e,t){const i=this.getBBox();return this.type!==0&&i.containsPoint(e,t)&&this.path.isPointInPath(e,t)}};Fs.className="Arc",g([_()],Fs.prototype,"centerX",2),g([_()],Fs.prototype,"centerY",2),g([_()],Fs.prototype,"radius",2),g([_()],Fs.prototype,"startAngle",2),g([_()],Fs.prototype,"endAngle",2),g([_()],Fs.prototype,"counterClockwise",2),g([_()],Fs.prototype,"type",2);var Wf=(O(),N(T));function Hf(e,t,i){const s=Math.sqrt(e**2+t**2),r=Math.atan2(t,e)+i;return{x:Math.cos(r)*s,y:Math.sin(r)*s}}var Qi=class extends oi{constructor(){super(...arguments),this.isBeveled=!0,this.columnWidth=0,this.startAngle=0,this.endAngle=0,this.outerRadius=0,this.innerRadius=0,this.axisInnerRadius=0,this.axisOuterRadius=0,this.isRadiusAxisReversed=!1}set cornerRadius(e){}computeBBox(){const{innerRadius:e,outerRadius:t,columnWidth:i}=this,s=this.getRotation(),n=-i/2,r=i/2,o=-t,a=-e;let l=1/0,c=1/0,h=-1/0,u=-1/0;for(let d=0;d<4;d+=1){const{x:p,y:f}=Hf(d%2===0?n:r,d<2?o:a,s);l=Math.min(p,l),c=Math.min(f,c),h=Math.max(p,h),u=Math.max(f,u)}return new U(l,c,h-l,u-c)}getRotation(){const{startAngle:e,endAngle:t}=this,i=Sc(e,t);return ot(e+i/2+Math.PI/2)}updatePath(){const{isBeveled:e}=this;e?this.updateBeveledPath():this.updateRectangularPath(),this.checkPathDirty()}updateRectangularPath(){const{columnWidth:e,innerRadius:t,outerRadius:i,path:s}=this,n=-e/2,r=e/2,o=-i,a=-t,l=this.getRotation(),c=[[n,a],[n,o],[r,o],[r,a]].map(([h,u])=>Hf(h,u,l));s.clear(!0),s.moveTo(c[0].x,c[0].y),s.lineTo(c[1].x,c[1].y),s.lineTo(c[2].x,c[2].y),s.lineTo(c[3].x,c[3].y),s.closePath()}updateBeveledPath(){const{columnWidth:e,path:t,outerRadius:i,innerRadius:s,axisInnerRadius:n,axisOuterRadius:r,isRadiusAxisReversed:o}=this,a=(0,Wf.isNumberEqual)(s,n),l=Math.asin(e/2/s),c=this.getRotation(),h=(L,w)=>Hf(L,w,c),u=(L,w)=>Math.sqrt(L**2+w**2),d=(L,w)=>w>L?0:Math.sqrt(L**2-w**2),p=(L,w,P)=>P?L<w:L>w,f=a&&!isNaN(l)&&l<Math.PI/6;let y=-e/2,b=e/2;const m=-i,v=-s*(f?Math.cos(l):1),M=p(r,u(s,e/2),!o);if(M){const L=d(r,s);y=-L,b=L}t.clear(!0);const S=h(y,v);t.moveTo(S.x,S.y);const D=(0,Wf.isNumberEqual)(s,i),C=p(r,u(i,e/2),!o);if(D&&f)t.arc(0,0,s,ot(-l-Math.PI/2)+c,ot(l-Math.PI/2)+c,!1);else if(C){const L=-d(r,e/2),w=d(r,i);if(!M){const P=h(y,L);t.lineTo(P.x,P.y)}if(t.arc(0,0,r,Math.atan2(L,y)+c,Math.atan2(m,-w)+c,!1),!(0,Wf.isNumberEqual)(w,0)){const P=h(w,m);t.lineTo(P.x,P.y)}t.arc(0,0,r,Math.atan2(m,w)+c,Math.atan2(L,b)+c,!1)}else{const L=h(y,m),w=h(b,m);t.lineTo(L.x,L.y),t.lineTo(w.x,w.y)}const k=h(b,v);if(t.lineTo(k.x,k.y),f)t.arc(0,0,s,ot(l-Math.PI/2)+c,ot(-l-Math.PI/2)+c,!0);else{const L=h(y,v);t.lineTo(L.x,L.y)}t.closePath()}};Qi.className="RadialColumnShape",g([_()],Qi.prototype,"isBeveled",2),g([_()],Qi.prototype,"columnWidth",2),g([_()],Qi.prototype,"startAngle",2),g([_()],Qi.prototype,"endAngle",2),g([_()],Qi.prototype,"outerRadius",2),g([_()],Qi.prototype,"innerRadius",2),g([_()],Qi.prototype,"axisInnerRadius",2),g([_()],Qi.prototype,"axisOuterRadius",2),g([_()],Qi.prototype,"isRadiusAxisReversed",2);function zS(e,t,i,s,n){const r=Sc(e,t),o=r*(1-s)/2;if(e+=o,t-=o,r<.001)return 2*i*n;if(r>=2*Math.PI){const p=e+r/2;e=p-Math.PI,t=p+Math.PI}const a=i*Math.cos(e),l=i*Math.sin(e),c=i*Math.cos(t),h=i*Math.sin(t),u=Math.floor(Math.sqrt((a-c)**2+(l-h)**2)),d=2*i*n;return Math.max(1,Math.min(d,u))}var Yf={};ji(Yf,{ChartTheme:()=>gs,DEFAULT_ANNOTATION_HANDLE_FILL:()=>cl,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>dl,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>pl,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>gl,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>fl,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>hl,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>ul,DEFAULT_CAPTION_ALIGNMENT:()=>Pn,DEFAULT_CAPTION_LAYOUT_STYLE:()=>En,DEFAULT_FIBONACCI_STROKES:()=>al,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>mt,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>tt,DEFAULT_GRIDLINE_ENABLED:()=>ds,DEFAULT_POLAR_SERIES_STROKE:()=>Ph,DEFAULT_SEPARATION_LINES_COLOUR:()=>ol,DEFAULT_SHADOW_COLOUR:()=>On,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>Rh,DEFAULT_TEXTBOX_COLOR:()=>bl,DEFAULT_TEXTBOX_FILL:()=>ml,DEFAULT_TEXTBOX_STROKE:()=>yl,DEFAULT_TEXT_ANNOTATION_COLOR:()=>ll,DEFAULT_TOOLBAR_POSITION:()=>xl,IS_DARK_THEME:()=>Bo,PALETTE_ALT_DOWN_FILL:()=>kg,PALETTE_ALT_DOWN_STROKE:()=>Ag,PALETTE_ALT_NEUTRAL_FILL:()=>Cg,PALETTE_ALT_NEUTRAL_STROKE:()=>wg,PALETTE_ALT_UP_FILL:()=>Lg,PALETTE_ALT_UP_STROKE:()=>Ig,PALETTE_DOWN_FILL:()=>Nh,PALETTE_DOWN_STROKE:()=>wh,PALETTE_NEUTRAL_FILL:()=>Eh,PALETTE_NEUTRAL_STROKE:()=>Oh,PALETTE_UP_FILL:()=>Th,PALETTE_UP_STROKE:()=>Ch,getChartTheme:()=>Lu,resolveOperation:()=>s2,themeNames:()=>i2,themeSymbols:()=>Dg,themes:()=>Bf});var i2=Object.keys(Bf);function s2(e){const t=gs.getDefaultPublicParameters();t.__palette=gs.getDefaultColors();const i={operation:e};return Pc(i,t),i.operation}var $f={};ji($f,{Color:()=>Oe,interpolateColor:()=>zb});var BS={};ji(BS,{AbstractBarSeries:()=>nM,AbstractBarSeriesProperties:()=>Jg,ActionOnSet:()=>ui,AnchoredPopover:()=>XS,Animation:()=>Ub,AnimationManager:()=>Kb,Arc:()=>Fs,Axis:()=>$p,AxisGroupZIndexMap:()=>ox,AxisInterval:()=>pr,AxisLabel:()=>ft,AxisTick:()=>gr,AxisTickGenerator:()=>ax,AxisTicks:()=>L2,BBox:()=>U,BBoxValues:()=>tr,Background:()=>_o,BackgroundModule:()=>pv,BandScale:()=>za,BarSeries:()=>Pl,BarSeriesModule:()=>cM,BaseModuleInstance:()=>pc,BaseProperties:()=>le,BaseToolbar:()=>rm,ButtonWidget:()=>Oa,CachedTextMeasurer:()=>ob,CachedTextMeasurerPool:()=>As,CallbackCache:()=>_b,Caption:()=>Ye,CartesianAxis:()=>$a,CartesianSeries:()=>_n,CartesianSeriesNodeEvent:()=>Rg,CartesianSeriesProperties:()=>nn,CategoryAxis:()=>kn,CategoryScale:()=>el,ChangeDetectableProperties:()=>Og,Chart:()=>xh,ChartAxisDirection:()=>Wd,ChartEventManager:()=>Zb,ChartOptions:()=>Gf,ChartUpdateType:()=>Ea,CollapseMode:()=>Ev,Color:()=>Oe,ColorScale:()=>to,ConicGradient:()=>Oy,ContextMenuBuiltins:()=>Xb,ContextMenuRegistry:()=>qb,ContinuousScale:()=>Fe,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>Ir,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>Ar,DEFAULT_TOOLTIP_CLASS:()=>Pt,DEFAULT_TOOLTIP_DARK_CLASS:()=>Lx,DIRECTION_SWAP_AXES:()=>Dv,DOMManager:()=>vb,DataController:()=>F0,DataModel:()=>P0,DataModelSeries:()=>Pg,DataService:()=>Qc,Debug:()=>ke,Deprecated:()=>vx,DeprecatedAndRenamedTo:()=>eN,DiscreteTimeScale:()=>rs,DragInterpreter:()=>o0,DraggablePopover:()=>qS,DropShadow:()=>ps,ExtendedPath2D:()=>no,FILL_IMAGE_DEFAULTS:()=>Dr,FILL_PATTERN_DEFAULTS:()=>Rn,FONT_SIZE_RATIO:()=>Sg,FillGradientDefaults:()=>Ki,FillImageDefaults:()=>gi,FillPatternDefaults:()=>$e,FloatingToolbar:()=>B2,Gradient:()=>Ac,Group:()=>ue,GroupedCategoryAxis:()=>Mr,HdpiCanvas:()=>op,HierarchyNode:()=>S2,HierarchySeries:()=>D2,HierarchySeriesProperties:()=>ms,HighlightManager:()=>Qb,HighlightProperties:()=>Eg,HighlightStyle:()=>vl,Image:()=>sa,InteractionManager:()=>Yb,InteractionState:()=>Hb,InterpolationProperties:()=>Vo,Invalidating:()=>Sa,LARGEST_KEY_INTERVAL:()=>ev,Label:()=>At,LayoutElement:()=>Hd,LayoutManager:()=>lb,LegendMarkerLabel:()=>$i,Line:()=>Xt,LineSeries:()=>Fl,LineSeriesModule:()=>yM,LinearGradient:()=>Ey,LinearScale:()=>us,Listeners:()=>Sn,LogScale:()=>bg,LonLatBBox:()=>I2,Marker:()=>Lt,Menu:()=>F2,MenuItemWidget:()=>im,MenuWidget:()=>$S,MercatorScale:()=>A2,ModuleRegistry:()=>n2.ModuleRegistry,Motion:()=>cp,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>os,NativeWidget:()=>mo,NewAreaSeriesModule:()=>sM,NewBarSeriesModule:()=>hM,NewBubbleSeriesModule:()=>pM,NewHistogramSeriesModule:()=>mM,NewLineSeriesModule:()=>bM,NewScatterSeriesModule:()=>MM,NiceMode:()=>ix,Node:()=>js,NumberAxis:()=>Js,ObserveChanges:()=>Mn,OrdinalTimeScale:()=>hh,PHASE_METADATA:()=>Ra,PHASE_ORDER:()=>bo,PREV_NEXT_KEYS:()=>go,Padding:()=>vn,ParallelStateMachine:()=>Yw,Path:()=>oi,PointerEvents:()=>ky,PolarAxis:()=>Ho,PolarSeries:()=>uu,PolarZIndexMap:()=>wM,Popover:()=>nm,PropertiesArray:()=>Ia,Property:()=>x,ProxyInteractionService:()=>Tb,ProxyOnWrite:()=>CL,ProxyProperty:()=>Ee,ProxyPropertyOnWrite:()=>Et,QUICK_TRANSITION:()=>eh,RENDER_TO_OFFSCREEN_CANVAS_THRESHOLD:()=>zh,RadialColumnShape:()=>Qi,Range:()=>as,Rect:()=>qt,RepeatType:()=>Vb,Rotatable:()=>ao,RotatableGroup:()=>QA,RotatableText:()=>ab,SAFE_FILLS_OPERATION:()=>Tg,SAFE_FILL_OPERATION:()=>h1,SAFE_RANGE2_OPERATION:()=>u1,SAFE_STROKE_FILL_OPERATION:()=>Fh,SKIP_JS_BUILTINS:()=>fd,SMALLEST_KEY_INTERVAL:()=>Jx,SORT_DOMAIN_GROUPS:()=>tv,Scalable:()=>kd,ScalableGroup:()=>qA,Scene:()=>Zc,SceneArrayChangeDetection:()=>bd,SceneChangeDetection:()=>_,SceneObjectChangeDetection:()=>Ai,Sector:()=>Ft,SectorBox:()=>DM,Selection:()=>ht,Series:()=>yh,SeriesContentZIndexMap:()=>yx,SeriesGroupingChangedEvent:()=>ig,SeriesItemHighlightStyle:()=>sn,SeriesMarker:()=>kt,SeriesNodeEvent:()=>Za,SeriesNodePickMode:()=>bx,SeriesProperties:()=>Ti,SeriesTooltip:()=>Qt,SeriesZIndexMap:()=>mx,Shape:()=>Bi,SimpleTextMeasurer:()=>Vd,SliderWidget:()=>np,StateMachine:()=>Va,StateMachineProperty:()=>Hw,StopProperties:()=>Dd,SvgPath:()=>tm,TRIPLE_EQ:()=>eo,Text:()=>St,TextUtils:()=>Ue,TextWrapper:()=>Ud,ThemeConstants:()=>yv,ThemeSymbols:()=>Dg,TimeAxisParentLevel:()=>Fo,TimeScale:()=>Ha,Toolbar:()=>j2,ToolbarButtonProperties:()=>Hl,ToolbarButtonWidget:()=>QS,ToolbarWidget:()=>Hc,Tooltip:()=>Hi,TooltipManager:()=>ih,TooltipPosition:()=>qs,Transformable:()=>Qe,TransformableGroup:()=>lo,TransformableText:()=>ho,Translatable:()=>ar,TranslatableGroup:()=>Ot,TranslatableLine:()=>AT,UnitTimeScale:()=>ki,UpdateService:()=>k0,Vec2:()=>ia,Vec4:()=>Ba,WIDGET_HTML_EVENTS:()=>_d,Widget:()=>Is,WidgetEventUtil:()=>Us,ZIndexMap:()=>jb,ZoomManager:()=>D0,accumulateGroup:()=>sv,accumulateStack:()=>nv,accumulatedValue:()=>Hx,accumulativeValueProperty:()=>sl,addEscapeEventListener:()=>Bc,addHitTestersToQuadtree:()=>qg,addMouseCloseListener:()=>$d,addOverrideFocusVisibleEventListener:()=>Zd,addTouchCloseListener:()=>Kd,adjustLabelPlacement:()=>lM,angleBetween:()=>Sc,angleCategoryAxisOptionsDefs:()=>JM,angleNumberAxisOptionsDefs:()=>QM,angularPadding:()=>xd,animationValidation:()=>Eo,annotationCalloutStylesDefs:()=>aS,annotationChannelStyleDefs:()=>Rf,annotationChannelTextDefs:()=>iS,annotationCommentStylesDefs:()=>lS,annotationCrossLineStyleDefs:()=>Pf,annotationDisjointChannelStyleDefs:()=>rS,annotationFibonacciStylesDefs:()=>Ff,annotationLineStyleDefs:()=>Su,annotationLineTextDefs:()=>Mu,annotationMeasurerStylesDefs:()=>Du,annotationNoteStylesDefs:()=>cS,annotationOptionsDef:()=>Jo,annotationParallelChannelStyleDefs:()=>oS,annotationQuickMeasurerStylesDefs:()=>hS,annotationShapeStylesDefs:()=>_f,annotationTextStylesDef:()=>Vl,applyShapeFillBBox:()=>mh,applyShapeStyle:()=>yr,areScalingEqual:()=>Lr,area:()=>dg,autoSizedLabelOptionsDefs:()=>Vn,boxPlotSeriesThemeableOptionsDef:()=>uS,buildFormatter:()=>_a,buildResetPathFn:()=>Yg,calculateDataDiff:()=>nf,calculateDefaultTimeTickFormat:()=>b0,calculateDerivativeExtrema:()=>Id,calculateDerivativeExtremaXY:()=>By,calculateLabelTranslation:()=>w2,calculatePlacement:()=>Mx,callWithContext:()=>Xc,candlestickSeriesThemeableOptionsDef:()=>pS,cartesianAxisCrosshairOptions:()=>Bn,cartesianAxisLabelOptionsDefs:()=>Cl,cartesianAxisOptionsDefs:()=>on,cartesianChartOptionsDefs:()=>UM,cartesianCrossLineOptionsDefs:()=>rn,cartesianNumericAxisLabel:()=>Kg,cartesianTimeAxisLabel:()=>wl,cartesianTimeAxisParentLevel:()=>$h,checkCrisp:()=>rM,chordSeriesThemeableOptionsDef:()=>gS,clampArray:()=>gp,clippedRoundRect:()=>Lh,collapsedStartingBarPosition:()=>Nl,commonAxisLabelOptionsDefs:()=>Cr,commonAxisOptionsDefs:()=>zn,commonChartOptionsDefs:()=>re,commonCrossLineLabelOptionsDefs:()=>kr,commonCrossLineOptionsDefs:()=>Os,commonSeriesOptionsDefs:()=>Ni,commonSeriesThemeableOptionsDefs:()=>Se,compareDates:()=>lh,computeBarFocusBounds:()=>sf,computeMarkerFocusBounds:()=>kl,coneFunnelSeriesThemeableOptionsDef:()=>fS,continuousAxisOptions:()=>Gn,countExpandingSearch:()=>i0,createButton:()=>T2,createCheckbox:()=>N2,createDatumId:()=>Ci,createDeprecationWarning:()=>ng,createIcon:()=>HS,createSelect:()=>O2,createTextArea:()=>E2,dateToNumber:()=>Zt,datesSortOrder:()=>Bp,datumKeys:()=>rh,datumStylerProperties:()=>Dn,deconstructSelectionsOrNodes:()=>th,deepClone:()=>Ve,deepFreeze:()=>nr,defaultTimeTickFormat:()=>vp,diff:()=>Po,drawCorner:()=>rl,drawMarkerUnitPolygon:()=>qa,easing:()=>cp,enterpriseModule:()=>Hn,errorBarOptionsDefs:()=>eu,errorBarThemeableOptionsDefs:()=>Tl,evaluateBezier:()=>Cc,extent:()=>Qs,extractDecoratedProperties:()=>Dy,fillsOptionsDef:()=>_l,findMinMax:()=>Dt,findQuadtreeMatch:()=>Qg,findRangeExtent:()=>xo,fixNumericExtent:()=>di,flowProportionChartOptionsDefs:()=>rE,focusCursorAtEnd:()=>JA,formatNumber:()=>kb,formatPercent:()=>Ab,formatValue:()=>Hs,fromToMotion:()=>Xe,funnelSeriesThemeableOptionsDef:()=>mS,gaugeChartOptionsDefs:()=>oE,getAngleRatioRadians:()=>Cy,getColorStops:()=>Ry,getCrossLineValue:()=>J0,getDateTicksForInterval:()=>Up,getDatumRefPoint:()=>up,getElementBBox:()=>$y,getIconClassNames:()=>Ec,getLastFocus:()=>Vc,getMissCount:()=>Ip,getPath:()=>Jr,getPathComponents:()=>E0,getRadialColumnWidth:()=>zS,getSequentialColors:()=>wi,getShapeFill:()=>mr,getShapeStyle:()=>ws,groupAccumulativeValueProperty:()=>Cn,groupAverage:()=>Wx,groupCount:()=>ug,groupStackValueProperty:()=>Qx,groupSum:()=>Ux,hasNoModifiers:()=>Na,heatmapSeriesThemeableOptionsDef:()=>yS,hierarchyChartOptionsDefs:()=>nE,initMenuKeyNav:()=>gb,initRovingTabIndex:()=>pb,interpolatePoints:()=>Gh,interpolationOptionsDefs:()=>tu,isAgFlowProportionChartOptions:()=>dx,isAgGaugeChartOptions:()=>eg,isAgHierarchyChartOptions:()=>hx,isAgStandaloneChartOptions:()=>Jp,isAgTopologyChartOptions:()=>ux,isBetweenAngles:()=>bn,isButtonClickEvent:()=>Xd,isChartAxisDirection:()=>KL,isContinuous:()=>dh,isDecoratedObject:()=>xc,isDenseInterval:()=>wo,isGradientFill:()=>is,isGradientOrPatternFill:()=>ZA,isImageFill:()=>ro,isInputPending:()=>Ky,isObjectWithProperty:()=>Ay,isObjectWithStringProperty:()=>yA,isPatternFill:()=>or,isProperties:()=>io,isScaleValid:()=>Dl,jsonApply:()=>Ca,jsonDiff:()=>Ss,jsonPropertyCompare:()=>Zy,jsonResolveOperations:()=>Pc,jsonWalk:()=>Ds,keyProperty:()=>hs,legendSymbolSvg:()=>Ax,lineDistanceSquared:()=>La,linearGaugeSeriesOptionsDef:()=>Wn,linearGaugeSeriesThemeableOptionsDef:()=>yu,linearGaugeTargetOptionsDef:()=>fu,listDecoratedProperties:()=>sr,makeAccessibleClickListener:()=>ak,mapLineBackgroundSeriesThemeableOptionsDef:()=>vS,mapLineSeriesThemeableOptionsDef:()=>xS,mapMarkerSeriesThemeableOptionsDef:()=>MS,mapShapeBackgroundSeriesThemeableOptionsDef:()=>DS,mapShapeSeriesThemeableOptionsDef:()=>SS,mapValues:()=>Iy,markerFadeInAnimation:()=>Il,markerOptionsDefs:()=>an,markerScaleInAnimation:()=>Ug,markerSwipeScaleInAnimation:()=>Wg,merge:()=>ba,mergeArrayDefaults:()=>vc,mergeDefaults:()=>xe,midpointStartingBarPosition:()=>H1,moduleRegistry:()=>Ms,motion:()=>V2,nearestSquared:()=>mc,nearestSquaredInContainer:()=>dA,nightingaleSeriesThemeableOptionsDef:()=>IS,normaliseGroupTo:()=>Sh,normalisePropertyTo:()=>vr,normalisedExtentWithMetadata:()=>hg,normalizeAngle180:()=>Ma,normalizeAngle360:()=>ot,normalizeAngle360FromDegrees:()=>zs,normalizeAngle360Inclusive:()=>AA,normalizeContinuousDomains:()=>fp,numberFormatValidator:()=>jn,objectsEqual:()=>ii,objectsEqualWith:()=>gd,ohlcSeriesThemeableOptionsDef:()=>bS,ordinalTimeAxisOptionsDefs:()=>qo,pairUpSpans:()=>Sl,partialAssign:()=>yd,pathFadeInAnimation:()=>Wh,pathMotion:()=>_h,pathSwipeInAnimation:()=>Hg,pickByMatchingAngle:()=>gf,plotAreaPathFill:()=>$v,plotInterpolatedAreaSeriesFillSpans:()=>Uh,plotInterpolatedLinePathStroke:()=>Vh,plotLinePathStroke:()=>Bg,polarChartOptionsDefs:()=>WM,prepareAreaFillAnimationFns:()=>Kv,prepareAreaPathAnimation:()=>Zv,prepareAxisAnimationContext:()=>sx,prepareAxisAnimationFunctions:()=>nx,prepareBarAnimationFunctions:()=>Ol,prepareLinePathAnimation:()=>Yv,prepareLinePathPropertyAnimation:()=>Vg,prepareLinePathStrokeAnimationFns:()=>Gg,preparePieSeriesAnimationFunctions:()=>Tr,pyramidSeriesThemeableOptionsDef:()=>AS,radarAreaSeriesThemeableOptionsDef:()=>LS,radarLineSeriesThemeableOptionsDef:()=>kS,radialBarSeriesThemeableOptionsDef:()=>CS,radialColumnSeriesThemeableOptionsDef:()=>wS,radialGaugeSeriesOptionsDef:()=>jl,radialGaugeSeriesThemeableOptionsDef:()=>bu,radialGaugeTargetOptionsDef:()=>mu,radiusCategoryAxisOptionsDefs:()=>tS,radiusNumberAxisOptionsDefs:()=>eS,range:()=>ch,rangeAreaSeriesThemeableOptionsDef:()=>TS,rangeBarSeriesThemeableOptionsDef:()=>NS,rangeValidator:()=>Xh,rangedValueProperty:()=>pg,resetAxisGroupFn:()=>rx,resetAxisLabelSelectionFn:()=>fh,resetAxisLineSelectionFn:()=>Yp,resetBarSelectionsFn:()=>El,resetLabelFn:()=>tn,resetMarkerFn:()=>Al,resetMarkerPositionFn:()=>Ll,resetMotion:()=>It,resetPieSelectionsFn:()=>pf,rowCountProperty:()=>Xx,sankeySeriesThemeableOptionsDef:()=>OS,scale:()=>Jt,sectorBox:()=>IM,seriesLabelFadeInAnimation:()=>Ce,seriesLabelFadeOutAnimation:()=>Fn,seriesLabelOptionsDefs:()=>Pe,setElementBBox:()=>Oc,setPath:()=>md,shadowOptionsDefs:()=>Es,shallowClone:()=>Od,solveBezier:()=>wc,sortAndUniqueDates:()=>zp,splitBezier:()=>Tc,standaloneChartOptionsDefs:()=>sE,staticFromToMotion:()=>Ks,stopPageScrolling:()=>fb,sum:()=>CN,sumValues:()=>Mh,sunburstSeriesThemeableOptionsDef:()=>ES,timeIntervalUnit:()=>$g,toDegrees:()=>LA,toRadians:()=>dt,toolbarButtonOptionsDefs:()=>wr,tooltipContentAriaLabel:()=>Cx,tooltipHtml:()=>Nx,tooltipOptionsDefs:()=>Ae,topologyChartOptionsDefs:()=>iE,trailingAccumulatedValue:()=>Yx,trailingAccumulatedValueProperty:()=>ON,treemapSeriesThemeableOptionsDef:()=>PS,updateClipPath:()=>Hh,updateLabelNode:()=>aM,validateCrossLineValue:()=>ex,valueProperty:()=>Me,visibleRangeIndices:()=>t0,waterfallSeriesThemeableOptionsDef:()=>RS,without:()=>H});var n2=(O(),N(T)),GS=(O(),N(T)),ia={add:r2,angle:u2,apply:v2,equal:b2,distance:l2,distanceSquared:c2,from:x2,gradient:p2,intercept:g2,intersectAtX:m2,intersectAtY:f2,length:Zf,lengthSquared:a2,multiply:o2,normalized:h2,origin:VS,required:M2,rotate:d2,round:y2,sub:Kf};function r2(e,t){return typeof t=="number"?{x:e.x+t,y:e.y+t}:{x:e.x+t.x,y:e.y+t.y}}function Kf(e,t){return typeof t=="number"?{x:e.x-t,y:e.y-t}:{x:e.x-t.x,y:e.y-t.y}}function o2(e,t){return typeof t=="number"?{x:e.x*t,y:e.y*t}:{x:e.x*t.x,y:e.y*t.y}}function Zf(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function a2(e){return e.x*e.x+e.y*e.y}function l2(e,t){const i=Kf(e,t);return Math.sqrt(i.x*i.x+i.y*i.y)}function c2(e,t){const i=Kf(e,t);return i.x*i.x+i.y*i.y}function h2(e){const t=Zf(e);return{x:e.x/t,y:e.y/t}}function u2(e,t){return t==null?Math.atan2(e.y,e.x):Math.atan2(e.y,e.x)-Math.atan2(t.y,t.x)}function d2(e,t,i=VS()){const s=Zf(e);return{x:i.x+s*Math.cos(t),y:i.y+s*Math.sin(t)}}function p2(e,t,i){const s=t.x-e.x;return(i==null?t.y-e.y:i-t.y-(i-e.y))/s}function g2(e,t,i){return(i==null?e.y:i-e.y)-t*e.x}function f2(e,t,i=0,s){return{x:e===1/0?1/0:(i-t)/e,y:s==null?i:s-i}}function m2(e,t,i=0,s){const n=e===1/0?1/0:e*i+t;return{x:i,y:s==null?n:s-n}}function y2(e,t=2){return{x:(0,GS.roundTo)(e.x,t),y:(0,GS.roundTo)(e.y,t)}}function b2(e,t){return e.x===t.x&&e.y===t.y}function x2(e,t){if(typeof e=="number")return{x:e,y:t};if("currentX"in e)return{x:e.currentX,y:e.currentY};if("offsetWidth"in e)return{x:e.offsetWidth,y:e.offsetHeight};if("width"in e)return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y+e.height}];if("x1"in e)return[{x:e.x1,y:e.y1},{x:e.x2,y:e.y2}];throw new Error(`Values can not be converted into a vector: [${JSON.stringify(e)}] [${t}]`)}function v2(e,t){return e.x=t.x,e.y=t.y,e}function M2(e){return{x:e?.x??0,y:e?.y??0}}function VS(){return{x:0,y:0}}var ku=(O(),N(T)),US=class Ru{constructor(t,i,s,n,r,o,a,l,c){this.series=t,this.datumIndex=i,this.datum=s,this.sizeValue=n,this.colorValue=r,this.sumSize=o,this.depth=a,this.parent=l,this.children=c,this.midPoint={x:0,y:0}}get hasChildren(){return this.children.length>0}walk(t,i=Ru.Walk.PreOrder){i===Ru.Walk.PreOrder&&t(this),this.children.forEach(s=>{s.walk(t,i)}),i===Ru.Walk.PostOrder&&t(this)}*[Symbol.iterator](){yield this;for(const t of this.children)yield*t}};US.Walk={PreOrder:0,PostOrder:1};var S2=US,D2=class extends yh{constructor(e){super({moduleCtx:e,pickModes:[1,0]}),this.colorDomain=[0,0],this.maxDepth=0,this.colorScale=new to,this.animationState=new Va("empty",{empty:{update:{target:"ready",action:t=>this.animateEmptyUpdateReady(t)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:t=>this.animateReadyHighlight(t),resize:t=>this.animateReadyResize(t),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:t=>this.animateWaitingUpdateReady(t)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:t=>this.animateClearingUpdateEmpty(t)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}processData(){const{NodeClass:e}=this,{childrenKey:t,sizeKey:i,colorKey:s,colorRange:n}=this.properties;let r=0,o=1/0,a=-1/0;const l=(d,p,f)=>{const y=f.depth!=null?f.depth+1:0,b=t!=null?d[t]:void 0,m=b==null||b.length===0;let v=i!=null?d[i]:void 0;Number.isFinite(v)?v=Math.max(v,0):v=m?1:0;const M=v;r=Math.max(r,y);const S=s!=null?d[s]:void 0;return typeof S=="number"&&(o=Math.min(o,S),a=Math.max(a,S)),c(new e(this,p,d,v,S,M,y,f,[]),b)},c=(d,p)=>{const{datumIndex:f}=d;return p?.forEach((y,b)=>{const m=l(y,f.concat(b),d);d.children.push(m),d.sumSize+=m.sumSize}),d},h=c(new e(this,[],void 0,0,void 0,0,void 0,void 0,[]),this.data),u=[o,a];this.colorScale.domain=o<a?[o,a]:[0,1],this.colorScale.range=n??["black"],this.colorScale.update(),this.rootNode=h,this.maxDepth=r,this.colorDomain=u}update({seriesRect:e}){this.updateSelections(),this.updateNodes();const t=this.getAnimationData();this.checkResize(e)&&this.animationState.transition("resize",t),this.animationState.transition("update",t)}resetAllAnimation(e){this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateReadyHighlight(e){}animateReadyResize(e){this.resetAllAnimation(e)}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}getAnimationData(){return{}}isProcessedDataAnimatable(){return!0}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(e,t){return[NaN,NaN]}getLegendData(e){const{colorKey:t,colorName:i,colorRange:s}=this.properties,{id:n,ctx:{legendManager:r},visible:o}=this;return e==="gradient"&&t!=null&&s!=null?[{legendType:"gradient",enabled:o&&r.getItemEnabled({seriesId:n}),seriesId:n,colorName:i,colorRange:s,colorDomain:this.colorDomain}]:[]}getDatumIdFromData(e){return e.datumIndex.join(":")}getDatumId(e){return this.getDatumIdFromData(e)}removeMeIndexPathForIndex(e){return this.datumSelection.at(e+1)?.datum.datumIndex??[]}removeMeIndexForIndexPath(e){for(const{index:t,datum:i}of this.datumSelection)if((0,ku.arraysEqual)(i.datumIndex,e))return t-1;return 0}pickFocus(e){if(!this.rootNode?.children.length)return;const t=(0,ku.clamp)(0,e.datumIndex-e.datumIndexDelta,this.datumSelection.length-1),{datumIndexDelta:i,otherIndexDelta:s}=e;let n=this.removeMeIndexPathForIndex(t);const r=n.reduce((l,c)=>l.children[c],this.rootNode);if(s>0&&r.hasChildren)n=[...n,0];else if(s<0&&n.length>1)n=n.slice(0,-1);else if(s===0&&i!==0){const l=r.parent.children.length-1;n=n.slice(),n[n.length-1]=(0,ku.clamp)(0,n[n.length-1]+i,l)}const o=n.reduce((l,c)=>l.children[c],this.rootNode),a=this.computeFocusBounds(this.datumSelection.at(t+1));if(a!=null)return{datum:o,datumIndex:this.removeMeIndexForIndexPath(n),otherIndex:o.depth,bounds:a,clipFocusBox:!0}}getDatumAriaText(e,t){if(!(e instanceof this.NodeClass)){ku.Logger.error(`datum is not HierarchyNode: ${JSON.stringify(e)}`);return}return this.ctx.localeManager.t("ariaAnnounceHierarchyDatum",{level:(e.depth??-1)+1,count:e.children.length,description:t})}getCategoryValue(e){}datumIndexForCategoryValue(e){}},ms=class extends Ti{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(lt),this.fillGradientDefaults=new Ki,this.fillPatternDefaults=new $e,this.fillImageDefaults=new gi,this.strokes=Object.values(Ps)}};g([x],ms.prototype,"childrenKey",2),g([x],ms.prototype,"sizeKey",2),g([x],ms.prototype,"colorKey",2),g([x],ms.prototype,"colorName",2),g([x],ms.prototype,"fills",2),g([x],ms.prototype,"fillGradientDefaults",2),g([x],ms.prototype,"fillPatternDefaults",2),g([x],ms.prototype,"fillImageDefaults",2),g([x],ms.prototype,"strokes",2),g([x],ms.prototype,"colorRange",2);var I2=class{constructor(e,t,i,s){this.lon0=e,this.lat0=t,this.lon1=i,this.lat1=s}merge(e){this.lon0=Math.min(this.lon0,e.lon0),this.lat0=Math.min(this.lat0,e.lat0),this.lon1=Math.max(this.lon1,e.lon1),this.lat1=Math.max(this.lat1,e.lat1)}},Cu=Math.PI/180,Xf=e=>e*Cu,qf=e=>-Math.log(Math.tan(Math.PI*.25+e*Cu*.5)),Qf=e=>e/Cu,Jf=e=>(Math.atan(Math.exp(-e))-Math.PI*.25)/(Cu*.5),A2=class dm extends Ic{constructor(t,i){super(),this.domain=t,this.range=i,this.type="mercator",this.bounds=dm.bounds(t)}static bounds(t){const[[i,s],[n,r]]=t,o=Xf(i),a=qf(s),l=Xf(n),c=qf(r);return new U(Math.min(o,l),Math.min(a,c),Math.abs(l-o),Math.abs(c-a))}static fixedScale(){return new dm([[Qf(0),Jf(0)],[Qf(1),Jf(1)]],[[0,0],[1,1]])}toDomain(){}normalizeDomains(...t){let i=-1/0,s=1/0,n=-1/0,r=1/0;for(const o of t)for(const[a,l]of o)i=Math.min(a,i),s=Math.max(a,s),n=Math.min(l,n),r=Math.max(l,r);return{domain:[[i,n],[s,r]],animatable:!0}}convert([t,i]){const[[s,n],[r,o]]=this.range,a=(r-s)/this.bounds.width,l=(o-n)/this.bounds.height;return[(Xf(t)-this.bounds.x)*a+s,(qf(i)-this.bounds.y)*l+n]}invert([t,i]){const[[s,n],[r,o]]=this.range,a=(r-s)/this.bounds.width,l=(o-n)/this.bounds.height;return[Qf((t-s)/a+this.bounds.x),Jf((i-n)/l+this.bounds.y)]}},WS=(O(),N(T)),em=class pm{constructor(){this.id=(0,WS.createId)(this),this.axisGroup=new Ot({name:`${this.id}-AxisTicks`,zIndex:2}),this.labelSelection=ht.select(this.axisGroup,St),this.interval=new pr,this.label=new ft,this.scale=new us,this.position="bottom",this.translationX=0,this.translationY=0,this.padding=0}attachAxis(t){t.appendChild(this.axisGroup)}calculateLayout(){const t=[],i=this.generateTicks(),{translationX:s,translationY:n}=this;return this.labelSelection.update(i.ticks.map(r=>this.createLabelDatum(r)),void 0,r=>r.tickId),this.labelSelection.each((r,o)=>{r.setProperties(o),o.visible&&t.push(r.getBBox())}),this.axisGroup.setProperties({translationX:s,translationY:n}),t.length>0?U.merge(t):void 0}getLabelParams(t){const{padding:i}=this,{translate:s}=t;switch(this.position){case"top":case"bottom":return{x:s,y:i,textAlign:"center",textBaseline:"top"};case"left":case"right":return{x:i,y:s,textAlign:"start",textBaseline:"middle"}}}inRange(t,i=.001){const[s,n]=Dt(this.scale.range);return t>=s-i&&t<=n+i}createLabelDatum(t){const{x:i,y:s,textBaseline:n,textAlign:r}=this.getLabelParams(t);return{visible:!!t.tickLabel,tickId:t.tickId,fill:this.label.color,fontFamily:this.label.fontFamily,fontSize:this.label.fontSize,fontStyle:this.label.fontStyle,fontWeight:this.label.fontWeight,rotation:0,rotationCenterX:0,text:t.tickLabel,textAlign:r,textBaseline:n,x:i,y:s}}generateTicks(){const{minSpacing:t,maxSpacing:i}=this.interval,{maxTickCount:s,minTickCount:n,tickCount:r}=X0(xo(this.scale.range),1,t,i,pm.DefaultTickCount,pm.DefaultMinSpacing),o=this.getTicksData({nice:!0,interval:this.interval.step,tickCount:r,minTickCount:n,maxTickCount:s});if(this.position==="bottom"||this.position==="top"){const a=As.getMeasurer({font:this.label}),{domain:l}=this.scale,h=l[0]>l[1]?-1:1;let u=-1/0*h;o.ticks=o.ticks.filter(d=>Math.sign(d.translate-u)!==h?!1:(u=d.translate+a.textWidth(d.tickLabel,!0)*h,!0))}return o}getTicksData(t){const i=[],s=t.nice?this.scale.niceDomain(t):this.scale.domain,n=this.scale.ticks(t,s)?.ticks??[],r=n.reduce((c,h)=>Math.max(c,(0,WS.countFractionDigits)(h)),0),o=[],a=Zp(),l=typeof this.label.format=="string"?this.scale.tickFormatter({domain:s,ticks:n,fractionDigits:r,specifier:this.label.format}):c=>Hs(c,r);for(let c=0;c<n.length;c++){const h=n[c],u=this.scale.convert(h);if(!this.inRange(u))continue;const d=this.label.formatter?.({value:h,index:c,domain:s,fractionDigits:r,boundSeries:o})??l(h),p=a(d);i.push({tick:h,tickId:p,tickLabel:d,translate:u})}return{rawTicks:n,fractionDigits:r,ticks:i}}};em.DefaultTickCount=5,em.DefaultMinSpacing=10;var L2=em,k2={top:{xTranslationDirection:0,yTranslationDirection:-1},bottom:{xTranslationDirection:0,yTranslationDirection:1},left:{xTranslationDirection:-1,yTranslationDirection:0},right:{xTranslationDirection:1,yTranslationDirection:0},"top-left":{xTranslationDirection:1,yTranslationDirection:-1},"top-right":{xTranslationDirection:-1,yTranslationDirection:-1},"bottom-left":{xTranslationDirection:1,yTranslationDirection:1},"bottom-right":{xTranslationDirection:-1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},"inside-left":{xTranslationDirection:1,yTranslationDirection:0},"inside-right":{xTranslationDirection:-1,yTranslationDirection:0},"inside-top":{xTranslationDirection:0,yTranslationDirection:1},"inside-bottom":{xTranslationDirection:0,yTranslationDirection:-1},"inside-top-left":{xTranslationDirection:1,yTranslationDirection:1},"inside-bottom-left":{xTranslationDirection:1,yTranslationDirection:-1},"inside-top-right":{xTranslationDirection:-1,yTranslationDirection:1},"inside-bottom-right":{xTranslationDirection:-1,yTranslationDirection:-1}},C2={top:{xTranslationDirection:1,yTranslationDirection:0},bottom:{xTranslationDirection:-1,yTranslationDirection:0},left:{xTranslationDirection:0,yTranslationDirection:-1},right:{xTranslationDirection:0,yTranslationDirection:1},"top-left":{xTranslationDirection:-1,yTranslationDirection:-1},"top-right":{xTranslationDirection:-1,yTranslationDirection:1},"bottom-left":{xTranslationDirection:1,yTranslationDirection:-1},"bottom-right":{xTranslationDirection:1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},"inside-left":{xTranslationDirection:0,yTranslationDirection:1},"inside-right":{xTranslationDirection:0,yTranslationDirection:-1},"inside-top":{xTranslationDirection:-1,yTranslationDirection:0},"inside-bottom":{xTranslationDirection:1,yTranslationDirection:0},"inside-top-left":{xTranslationDirection:-1,yTranslationDirection:1},"inside-bottom-left":{xTranslationDirection:1,yTranslationDirection:1},"inside-top-right":{xTranslationDirection:-1,yTranslationDirection:-1},"inside-bottom-right":{xTranslationDirection:1,yTranslationDirection:-1}};function w2({yDirection:e,padding:t=0,position:i="top",bbox:s}){const n=e?k2:C2,{xTranslationDirection:r,yTranslationDirection:o}=n[i],a=r*(t+s.width/2),l=o*(t+s.height/2);return{xTranslation:a,yTranslation:l}}var Ri=(O(),N(T));function T2(e,t){const i=(0,Ri.createElement)("button",wu("ag-charts-input ag-charts-button",t));return e.label!==void 0?i.append(e.label):(i.append(HS(e.icon)),i.ariaLabel=e.altText),i.addEventListener("click",e.onPress),(0,Ri.setAttributes)(i,t),i}function N2(e,t){const i=(0,Ri.createElement)("input",wu("ag-charts-input ag-charts-checkbox",t));return i.type="checkbox",i.checked=e.checked,i.addEventListener("change",s=>e.onChange(i.checked,s)),i.addEventListener("keydown",s=>{Xd(s)&&(s.preventDefault(),i.click())}),(0,Ri.setAttributes)(i,t),i}function O2(e,t){const i=(0,Ri.createElement)("select",wu("ag-charts-input ag-charts-select",t));return i.append(...e.options.map(s=>{const n=(0,Ri.createElement)("option");return n.value=s.value,n.textContent=s.label,n})),(0,Ri.setAttribute)(i,"data-preventdefault",!1),i.value=e.value,i.addEventListener("change",s=>e.onChange(i.value,s)),(0,Ri.setAttributes)(i,t),i}function E2(e,t){const i=(0,Ri.createElement)("textarea",wu("ag-charts-input ag-charts-textarea",t));return i.value=e.value,i.addEventListener("input",s=>e.onChange(i.value,s)),(0,Ri.setAttributes)(i,t),(0,Ri.setAttribute)(i,"data-preventdefault",!1),i}function HS(e){const t=(0,Ri.createElement)("span",`ag-charts-icon ag-charts-icon-${e}`);return(0,Ri.setAttribute)(t,"aria-hidden",!0),t}function wu(e,t){return t==null?e:`${e} ${t.class}`}var tm=class extends oi{constructor(e=""){super(),this.x=0,this.y=0,this.commands=[],this._d="",this.d=e}get d(){return this._d}set d(e){if(e!==this._d){this._d=e,this.commands.length=0;for(const[t,i,s]of e.matchAll(/([A-Z])([0-9. ]*)/g)){const n=s.split(/\s+/g).map(Number);this.commands.push([i,n])}this.checkPathDirty()}}updatePath(){const{path:e,x:t,y:i}=this;e.clear();let s=t,n=i;for(const[r,o]of this.commands)switch(r){case"M":e.moveTo(t+o[0],i+o[1]),s=t+o[0];break;case"C":e.cubicCurveTo(t+o[0],i+o[1],t+o[2],i+o[3],t+o[4],i+o[5]),s=t+o[4],n=i+o[5];break;case"H":e.lineTo(t+o[0],n),s=i+o[0];break;case"L":e.lineTo(t+o[0],i+o[1]),s=t+o[0],n=i+o[1];break;case"V":e.lineTo(s,i+o[0]),n=i+o[0];break;case"Z":e.closePath();break;default:throw new Error(`Could not translate command '${r}' with '${o.join(" ")}'`)}e.closePath()}};g([_()],tm.prototype,"x",2),g([_()],tm.prototype,"y",2);var sa=class extends js{constructor(e){super(),this.sourceImage=e,this.x=0,this.y=0,this.width=0,this.height=0,this.opacity=1}render(e){const{ctx:t}=e,i=this.sourceImage;i&&(t.globalAlpha=this.opacity,t.drawImage(i,0,0,i.width,i.height,this.x,this.y,this.width,this.height)),super.render(e)}};g([_()],sa.prototype,"x",2),g([_()],sa.prototype,"y",2),g([_()],sa.prototype,"width",2),g([_()],sa.prototype,"height",2),g([_()],sa.prototype,"opacity",2);var YS={};ji(YS,{ButtonWidget:()=>Oa,MenuItemWidget:()=>im,MenuWidget:()=>$S,NativeWidget:()=>mo,SliderWidget:()=>np,ToolbarWidget:()=>Hc,WIDGET_HTML_EVENTS:()=>_d,Widget:()=>Is,WidgetEventUtil:()=>Us});var Ul=(O(),N(T)),P2=(O(),N(T)),im=class extends Db{constructor(){super((0,P2.createElement)("div"),"menuitem")}},R2=["Escape","ArrowLeft"],$S=class vD extends ip{constructor(t="vertical"){super(t,"menu"),this.closeSubMenu=i=>this.openSubMenu(i,void 0)}destructor(){this.selfClose("2")}addSeparator(){const t=(0,Ul.getDocument)().createElement("div");return(0,Ul.setAttribute)(t,"role","separator"),this.elem.appendChild(t),t}onChildAdded(t){super.onChildAdded(t),t.hasPopup()||t.addListener("mouseenter",this.closeSubMenu)}onChildRemoved(t){super.onChildRemoved(t),t.hasPopup()||t.removeListener("mouseenter",this.closeSubMenu)}addSubMenu(){const t=new im,i=(0,Ul.createElementId)(),s=new vD(this.orientation),n=o=>{t.isDisabled()||this.openSubMenu(o,s)},r=o=>{Na(o.sourceEvent)&&o.sourceEvent.code==="ArrowRight"&&n(o)};return t.setAriaHasPopup("menu"),t.setAriaExpanded(!1),t.setAriaControls(i),t.addListener("click",n),t.addListener("mouseenter",n),t.addListener("keydown",r),s.addListener("close-widget",()=>t.setAriaExpanded(!1)),s.addListener("open-widget",()=>t.setAriaExpanded(!0)),s.id=i,this.addChild(t),{subMenuButton:t,subMenu:s}}openSubMenu(t,i){const{openScope:s}=this;s&&(s.openSubMenu?.selfClose("4"),i?.open(t),s.openSubMenu=i)}open(t,i){const{overrideFocusVisible:s=void 0}=i??{};if(this.openScope!=null)return;this.openScope={lastFocus:Vc(t.sourceEvent),openSubMenu:void 0,abort:()=>this.selfClose("1"),close:()=>this.selfClose("0"),removers:new Yd};const n=this.children.map(r=>r.getElement());(0,Ul.setAttribute)(this.openScope.lastFocus,"aria-expanded",!0),$d(this.openScope.removers,this.elem,this.openScope.abort),Kd(this.openScope.removers,this.elem,this.openScope.abort);for(const r of this.children)Bc(this.openScope.removers,r.getElement(),this.openScope.close,R2);s!==void 0&&Zd(this.openScope.removers,this.elem,n,s),this.internalListener?.dispatch("open-widget",this,{type:"open-widget"}),this.children[0]?.focus({preventScroll:!0})}selfClose(t){if(this.openScope===void 0)return;const{lastFocus:i,removers:s,openSubMenu:n}=this.openScope;this.openScope=void 0,n?.selfClose("3"),(0,Ul.setAttribute)(i,"aria-expanded",!1),t==="0"&&i?.focus({preventScroll:!0}),s.destroy(),this.internalListener?.dispatch("close-widget",this,{type:"close-widget"})}close(){this.selfClose("0")}},sm=(O(),N(T)),Wl=(O(),N(T)),KS=(O(),N(T)),ZS="canvas-overlay",nm=class extends pc{constructor(e,t,i){super(),this.ctx=e,this.hideFns=[],this.moduleId=`popover-${t}`,i?.detached?this.element=(0,KS.createElement)("div"):this.element=e.domManager.addChild(ZS,this.moduleId),this.element.setAttribute("role","presentation"),this.destroyFns.push(()=>e.domManager.removeChild(ZS,this.moduleId))}attachTo(e){this.element.parentElement||e.element.append(this.element)}hide(e){const{lastFocus:t=this.lastFocus}=e??{};this.element.children.length!==0&&(this.hideFns.forEach(i=>i()),t?.focus(),this.lastFocus=void 0)}removeChildren(){this.element.replaceChildren()}showWithChildren(e,t){if(!this.element.parentElement)throw new Error("Can not show popover that has not been attached to a parent.");const i=(0,KS.createElement)("div","ag-charts-popover");if(t.ariaLabel!=null&&i.setAttribute("aria-label",t.ariaLabel),t.class!=null&&i.classList.add(t.class),i.replaceChildren(...e),this.element.replaceChildren(i),this.hideFns.push(()=>this.removeChildren()),t.onHide&&this.hideFns.push(t.onHide),t.initialFocus&&t.sourceEvent){const s=Vc(t.sourceEvent);s!==void 0&&(this.lastFocus=s,this.initialFocus=t.initialFocus)}return i}getPopoverElement(){return this.element.firstElementChild}updatePosition(e){const t=this.getPopoverElement();t&&(t.style.setProperty("right","unset"),t.style.setProperty("bottom","unset"),e.x!=null&&t.style.setProperty("left",`${Math.floor(e.x)}px`),e.y!=null&&t.style.setProperty("top",`${Math.floor(e.y)}px`),this.initialFocus?.focus(),this.initialFocus=void 0)}},XS=class extends nm{setAnchor(e,t){this.anchor=e,this.fallbackAnchor=t,this.updatePosition(e),this.repositionWithinBounds()}showWithChildren(e,t){const i=t.anchor??this.anchor,s=t.fallbackAnchor??this.fallbackAnchor,n=super.showWithChildren(e,t);return i&&this.setAnchor(i,s),(0,Wl.getWindow)().requestAnimationFrame(()=>{this.repositionWithinBounds()}),n}repositionWithinBounds(){const{anchor:e,ctx:t,fallbackAnchor:i}=this,s=this.getPopoverElement();if(!e||!s)return;const n=t.domManager.getBoundingClientRect(),{offsetWidth:r,offsetHeight:o}=s;let a=(0,Wl.clamp)(0,e.x,n.width-r),l=(0,Wl.clamp)(0,e.y,n.height-o);a!==e.x&&i?.x!=null&&(a=(0,Wl.clamp)(0,i.x-r,n.width-r)),l!==e.y&&i?.y!=null&&(l=(0,Wl.clamp)(0,i.y-o,n.height-o)),this.updatePosition({x:a,y:l})}},F2=class extends XS{show(e){const t=e.items.map(s=>this.createRow(e,s)),i=this.showWithChildren(t,e);i.classList.add("ag-charts-menu"),i.setAttribute("role","menu"),this.menuCloser=gb({orientation:"vertical",menu:i,buttons:t,sourceEvent:e.sourceEvent,closeCallback:()=>this.hide()}),this.hideFns.push(()=>{this.menuCloser?.finishClosing(),this.menuCloser=void 0})}createRow(e,t){const{menuItemRole:i="menuitem"}=e,s=t.value===e.value,n=(0,sm.createElement)("div","ag-charts-menu__row");if(n.setAttribute("role",i),i==="menuitemradio"&&n.setAttribute("aria-checked",(e.value===t.value).toString()),typeof t.value=="string"&&(n.dataset.popoverId=t.value),n.classList.toggle("ag-charts-menu__row--active",s),t.icon!=null){const l=(0,sm.createElement)("span",`ag-charts-menu__icon ${Ec(t.icon)}`);n.appendChild(l)}const r=t.strokeWidth!=null;if(r&&(n.classList.toggle("ag-charts-menu__row--stroke-width-visible",r),n.style.setProperty("--strokeWidth",r?`${t.strokeWidth}px`:null)),t.label!=null){const l=(0,sm.createElement)("span","ag-charts-menu__label");l.textContent=this.ctx.localeManager.t(t.label),n.appendChild(l)}"altText"in t&&(n.ariaLabel=this.ctx.localeManager.t(t.altText));const o=()=>{e.onPress?.(t)},a=l=>{Xd(l)&&(o(),l.preventDefault(),l.stopPropagation())};return n.addEventListener("keydown",a),n.addEventListener("click",a),n.addEventListener("mousemove",()=>{n.focus({preventScroll:!0})}),n}},qS=class extends nm{constructor(){super(...arguments),this.dragged=!1}setDragHandle(e){e.addListener("drag-start",t=>{e.addClass(this.dragHandleDraggingClass),this.onDragStart(t)}),e.addListener("drag-move",this.onDragMove.bind(this)),e.addListener("drag-end",()=>{e.removeClass(this.dragHandleDraggingClass),this.onDragEnd.bind(this)})}onDragStart(e){const t=this.getPopoverElement();t&&(e.sourceEvent.preventDefault(),this.dragged=!0,this.dragStartState={client:ia.from(e.clientX,e.clientY),position:ia.from(Number(t.style.getPropertyValue("left").replace("px","")),Number(t.style.getPropertyValue("top").replace("px","")))})}onDragMove(e){const{dragStartState:t}=this,i=this.getPopoverElement();if(!t||!i)return;const s=ia.sub(ia.from(e.clientX,e.clientY),t.client),n=ia.add(t.position,s),r=this.ctx.domManager.getBoundingClientRect(),o={};n.x>=0&&n.x+i.offsetWidth<=r.width&&(o.x=n.x),n.y>=0&&n.y+i.offsetHeight<=r.height&&(o.y=n.y),this.updatePosition(o)}onDragEnd(){this.dragStartState=void 0}},Hl=class extends le{};g([x],Hl.prototype,"icon",2),g([x],Hl.prototype,"label",2),g([x],Hl.prototype,"ariaLabel",2),g([x],Hl.prototype,"tooltip",2);var _2=(O(),N(T)),QS=class extends Oa{constructor(e){super(),this.localeManager=e}update(e){const{localeManager:t}=this;e.tooltip&&(this.elem.title=t.t(e.tooltip));let i="";if(e.icon!=null&&(i=`<span class="${Ec(e.icon)} ag-charts-toolbar__icon"></span>`),e.label!=null){const s=t.t(e.label);i=`${i}<span class="ag-charts-toolbar__label">${s}</span>`}this.elem.innerHTML=i}setChecked(e){(0,_2.setAttribute)(this.elem,"aria-checked",e)}},JS="ag-charts-toolbar__button--active",rm=class extends Hc{constructor(e,t="horizontal"){super(t),this.localeManager=e,this.horizontalSpacing=10,this.verticalSpacing=10,this.events=new Sn,this.hasPrefix=!1,this.buttonWidgets=[],this.addClass("ag-charts-toolbar"),this.toggleClass("ag-charts-toolbar--horizontal",t==="horizontal"),this.toggleClass("ag-charts-toolbar--vertical",t==="vertical")}addToolbarListener(e,t){return this.events.addListener(e,t)}clearButtons(){for(const e of this.buttonWidgets)e.destroy();this.buttonWidgets.splice(0)}updateButtons(e){const{buttonWidgets:t}=this;for(const[i,s]of e.entries())(this.buttonWidgets.at(i)??this.createButton(i,s)).update(s);for(let i=e.length;i<t.length;i++)this.buttonWidgets.at(i)?.destroy();this.buttonWidgets.splice(e.length),this.refreshButtonClasses()}updateButtonByIndex(e,t){this.buttonWidgets.at(e)?.update(t)}clearActiveButton(){for(const e of this.buttonWidgets)e.toggleClass(JS,!1)}toggleActiveButtonByIndex(e){if(e!==-1)for(const[t,i]of this.buttonWidgets.entries())i.toggleClass(JS,e!=null&&e===t)}toggleButtonEnabledByIndex(e,t){e!==-1&&this.buttonWidgets.at(e)?.setEnabled(t)}toggleSwitchCheckedByIndex(e,t){e!==-1&&this.buttonWidgets.at(e)?.setChecked(t)}getButtonBounds(){return this.buttonWidgets.map(e=>this.getButtonWidgetBounds(e))}setButtonHiddenByIndex(e,t){this.buttonWidgets.at(e)?.setHidden(t)}getButtonWidgetBounds(e){const t=this.getBounds(),i=e.getBounds();return new U(i.x+t.x,i.y+t.y,i.width,i.height)}refreshButtonClasses(){const{buttonWidgets:e,hasPrefix:t}=this;let i,s,n;for(const[r,o]of e.entries())i=!t&&r===0||n!=o.section,s=r===e.length-1||o.section!=e.at(r+1)?.section,o.toggleClass("ag-charts-toolbar__button--first",i),o.toggleClass("ag-charts-toolbar__button--last",s),o.toggleClass("ag-charts-toolbar__button--gap",r>0&&i),n=o.section}createButton(e,t){const i=this.createButtonWidget();return i.addClass("ag-charts-toolbar__button"),i.addListener("click",s=>{const n={index:e,...t instanceof le?t.toJson():t},r=this.getButtonWidgetBounds(i);this.events.dispatch("button-pressed",{event:s,button:n,buttonBounds:r})}),i.addListener("focus",()=>{this.events.dispatch("button-focused",{button:{index:e}})}),t.section&&(i.section=t.section),this.buttonWidgets.push(i),this.addChild(i),i}},j2=class extends rm{createButtonWidget(){return new QS(this.localeManager)}},Tu=(O(),N(T)),z2=class extends qS{constructor(e,t,i){super(e,t),this.onPopoverMoved=i,this.dragHandleDraggingClass="ag-charts-floating-toolbar__drag-handle--dragging"}show(e,t={}){this.showWithChildren(e,{...t,class:"ag-charts-floating-toolbar"})}hide(){this.dragged=!1,super.hide()}getBounds(){const e=this.getPopoverElement();return new U(e?.offsetLeft??0,e?.offsetTop??0,e?.offsetWidth??0,e?.offsetHeight??0)}hasBeenDragged(){return this.dragged}setAnchor(e,t,i){const s=this.getPopoverElement();if(!s)return;const n=e.position??"above",{offsetWidth:r,offsetHeight:o}=s;let a=e.y-o-i,l=e.x-r/2;n==="below"?a=e.y+i:n==="right"?(a=e.y-o/2,l=e.x+t):n==="above-left"&&(l=e.x),this.updatePosition({x:l,y:a})}ignorePointerEvents(){const e=this.getPopoverElement();e&&(e.style.pointerEvents="none")}capturePointerEvents(){const e=this.getPopoverElement();e&&(e.style.pointerEvents="unset")}updatePosition(e){const t=this.getBounds(),i=this.ctx.domManager.getBoundingClientRect();e.x=Math.floor((0,Tu.clamp)(0,e.x,i.width-t.width)),e.y=Math.floor((0,Tu.clamp)(0,e.y,i.height-t.height)),super.updatePosition(e),this.onPopoverMoved()}},B2=class extends rm{constructor(e,t){super(e.localeManager),this.hasPrefix=!0,this.popover=new z2(e,t,this.onPopoverMoved.bind(this)),this.dragHandle=new G2(e.localeManager.t("toolbarAnnotationsDragHandle")),this.popover.setDragHandle(this.dragHandle)}show(e={}){this.popover.show([this.dragHandle.getElement(),this.getElement()],e)}hide(){this.popover.hide()}setAnchor(e){this.popover.setAnchor(e,this.horizontalSpacing,this.verticalSpacing)}hasBeenDragged(){return this.popover.hasBeenDragged()}ignorePointerEvents(){this.popover.ignorePointerEvents()}capturePointerEvents(){this.popover.capturePointerEvents()}onPopoverMoved(){const e=this.popover.getBounds();if(this.popoverBounds?.equals(e))return;this.popoverBounds=e.clone();const t=this.getButtonBounds();this.events.dispatch("toolbar-moved",{popoverBounds:e,buttonBounds:t})}getButtonWidgetBounds(e){const t=this.popover.getBounds(),i=super.getButtonWidgetBounds(e),s=this.dragHandle.getBounds();return new U(i.x+t.x-s.width,i.y+t.y,i.width,i.height)}},G2=class extends mo{constructor(e){super((0,Tu.createElement)("div","ag-charts-floating-toolbar__drag-handle"));const t=new mo((0,Tu.createElement)("span",`${Ec("drag-handle")} ag-charts-toolbar__icon`));t.setAriaHidden(!0),this.addChild(t),this.elem.title=e}},V2={...j0,...z0},U2={VERSION:uo,_Scene:Uf,_Theme:Yf,_Util:$f,create:$n.create.bind($n),createSparkline:$n.__createSparkline.bind($n),setup:yf,isEnterprise:!1};if(typeof bs.exports=="object"&&typeof ra=="object"){var W2=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Object.getOwnPropertyNames(t))!Object.prototype.hasOwnProperty.call(e,n)&&n!==i&&Object.defineProperty(e,n,{get:()=>t[n],enumerable:!(s=Object.getOwnPropertyDescriptor(t,n))||s.enumerable});return e};bs.exports=W2(bs.exports,ra)}return bs.exports});