UNPKG

ag-charts-community

Version:

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

16 lines 935 kB
(function(Ta,Ls){typeof exports=="object"&&typeof module=="object"?module.exports=Ls():typeof define=="function"&&define.amd?define("agCharts",[],Ls):typeof exports=="object"?exports.agCharts=Ls():Ta.agCharts=Ls()})(this,()=>{var Ta={},Ls={exports:Ta};if(typeof hO>"u")var hO=function(t){throw new Error("Unknown module: "+t)};var rd=Object.defineProperty,tD=Object.getOwnPropertyDescriptor,iD=Object.getOwnPropertyNames,sD=Object.prototype.hasOwnProperty,od=(e,t)=>{for(var i in t)rd(e,i,{get:t[i],enumerable:!0})},nD=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of iD(t))!sD.call(e,n)&&n!==i&&rd(e,n,{get:()=>t[n],enumerable:!(s=tD(t,n))||s.enumerable});return e},rD=e=>nD(rd({},"__esModule",{value:!0}),e),dm={};od(dm,{AG_CHARTS_LOCALE_EN_US:()=>ab,AgCharts:()=>ur,AgChartsCommunityModule:()=>lO,AgErrorBarSupportedSeriesTypes:()=>nC,AgTooltipAnchorToType:()=>cb,AgTooltipPlacementType:()=>hb,VERSION:()=>Lr,_ModuleSupport:()=>SS,_Scene:()=>Hf,_Theme:()=>$f,_Util:()=>Wf,_Widget:()=>LS,setupCommunityModules:()=>Nf,time:()=>DE}),Ls.exports=rD(dm);var j={};od(j,{error:()=>pm,errorOnce:()=>lD,log:()=>oD,logGroup:()=>hD,reset:()=>cD,table:()=>aD,warn:()=>ld,warnOnce:()=>ka});var ad=new Set;function oD(...e){console.log(...e)}function ld(e,...t){console.warn(`AG Charts - ${e}`,...t)}function pm(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 gm(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}`;ad.has(n)||(i(e),ad.add(n))}function ka(e,...t){gm(e,"Logger.warn",i=>ld(i,...t))}function lD(e,...t){gm(e,"Logger.error",i=>pm(i,...t))}function cD(){ad.clear()}function hD(e,t){console.groupCollapsed(e);try{return t()}finally{console.groupEnd()}}var bi={};od(bi,{detectChartDefinition:()=>fD,getAxisModule:()=>mD,getPresetModule:()=>yD,getSeriesModule:()=>bD,hasModule:()=>pD,listModulesByType:()=>gD,register:()=>fm,registerMany:()=>uD,reset:()=>dD});var Ts=new Map;function fm(e,t){const{def:i,version:s}=Ts.get(e.name)??{};if(!i){Ts.set(e.name,{def:e,version:t});return}if(!i.enterprise&&e.enterprise&&t===s){Ts.set(e.name,{def:e,version:t});return}if(s===t){ld([`AG Charts - Module '${e.name}' already registered,',
                'ignoring (version: ${s}).`,"Check your code for duplicate loading of charts NPM modules."].join(" "));return}throw new Error([`AG Charts - Module '${e.name}' already registered with different version:`,`${s} vs ${t}`,"","Check your package.json for conflicting dependencies - depending on your package manager","one of these commands may help:","- npm ls ag-charts-community","- yarn why ag-charts-community"].join(`
`))}function uD(e,t){for(const i of e)fm(i,t)}function dD(){Ts.clear()}function pD(e){return Ts.has(e)}function*gD(e){for(const t of Ts.values())wa(e,t.def)&&(yield t.def)}function fD(e){for(const t of Ts.values())if(wa("chart",t.def)&&t.def.detect(e))return t.def;throw new Error("AG Charts - Unknown chart type; Check options are correctly structured and series types are specified")}function mD(e){const t=Ts.get(e);if(wa("axis",t?.def))return t?.def}function yD(e){const t=Ts.get(e);if(wa("preset",t?.def))return t?.def}function bD(e){const t=Ts.get(e);if(wa("series",t?.def))return t?.def}function wa(e,t){return t?.type===e}var On=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()}},ks={};typeof window<"u"?ks.window=window:typeof global<"u"&&(ks.window=global.window),typeof document<"u"?ks.document=document:typeof global<"u"&&(ks.document=global.document);function ws(e){return e?ks.document?.[e]:ks.document}function Fe(e){return e?ks.window?.[e]:ks.window}function xD(e){ks.document=e}function vD(e){ks.window=e}function ve(e,t,i){const s=ws().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 Mt(e){return ws().createElementNS("http://www.w3.org/2000/svg",e)}function MD(e,t){const i=ws("body"),s=ve("a",{display:"none"});s.href=e,s.download=t,i.appendChild(s),s.click(),setTimeout(()=>i.removeChild(s))}function Ge(e,t,i,s){return e.addEventListener(t,i,s),()=>e.removeEventListener(t,i,s)}var Cc;function SD(e){if(Cc==null){const t=Fe("Option");Cc=new t().style}return Cc.color=e,Cc.color||null}function Na(e){return e!=null}function Ae(e){return Array.isArray(e)}function DD(e){return typeof e=="boolean"}function go(e){return e instanceof Date}function cd(e){return go(e)&&!isNaN(Number(e))}function ID(e){return e instanceof RegExp}function nn(e){return typeof e=="function"}function ot(e){return typeof e=="object"&&e!==null&&!Ae(e)}function Lc(e){return Ae(e)||Ne(e)}function Ne(e){return typeof e=="object"&&e!==null&&e.constructor?.name==="Object"}function hd(e){if(typeof e!="object"||e===null)return!1;for(const t in e)return!1;return!0}function Bt(e){return typeof e=="string"}function Tc(e){return typeof e=="number"}function je(e){return Number.isFinite(e)}function AD(e){return typeof window<"u"&&e instanceof HTMLElement}function kc(e){return typeof e=="symbol"}function CD(e){return Bt(e)&&(e==="none"||SD(e)!=null)}function mm(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 ym(e,t,i=""){try{return e(...t)}catch(s){const n=i?` \`${i}\``:"";ka(`Uncaught exception in user callback${n}`,s)}}function Ea(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 ud(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 LD(e){let t=1;for(let i=0;i<e.length;i++)e.charCodeAt(i)===10&&t++;return t}function TD(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]}function kD(e){return e.replace(wD,(t,i)=>(i>0?"-":"")+t.toLowerCase())}var wD=/[A-Z]+(?![a-z])|[A-Z]/g;function dd(e){return Ae(e)?e.map(t=>t.text).join(""):e??""}var wi=Symbol("description"),bm=Symbol("required"),wc=Symbol("marked"),xm=Symbol("undocumented"),Nc=Symbol("union"),ND=[["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);function Oa(e,t){return je(t)?`${e}[${t}]`:e?`${e}.${t}`:t}var mr=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?Oa(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 \`${ud(i,50)}\`; expecting ${e}, ignoring.`}},pd=class extends mr{constructor(e,t,i,s){super("unknown",void 0,t,i,s),this.suggestions=e,this.key=s}getPrefix(){return`Unknown option \`${Oa(this.altPath??this.path,this.key)}\``}getPostfix(){const e=Ea(ED(this.key,this.suggestions),"or",t=>`\`${t}\``);return e?`; Did you mean ${e}? Ignoring.`:", ignoring."}toString(){return`${this.getPrefix()}${this.getPostfix()}`}};function ci(e,t,i=""){if(!ot(e))return{cleared:null,invalid:[new mr("required","an object",e,i)]};const s={},n=[],r=new Set(Object.keys(e)),o=[];if(Nc in t){const a=Object.keys(t),l=t[Nc];if(e.type!=null&&a.includes(e.type)||e.type==null&&l!=null){const{type:c=l,...h}=e,u=ci(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=Ea(a,"or",h=>`'${h}'`);n.push(new mr("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[bm],h=e[a];if(r.delete(a),typeof h>"u"&&(l[xm]||o.push(a),!c))continue;const u=Oa(i,a);if(nn(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(fo(p.invalid,u))continue}else if(p){s[a]=h;continue}n.push(new mr(c?"required":"invalid",l[wi],h,i,a))}else{const d=ci(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 pd(o,l,i,a))}return{cleared:s,invalid:n}}function ED(e,t,i=2){const s=[],n=e.toLowerCase(),r=ND.get(n);for(const o of t){const a=o.toLowerCase();(r?.has(o)||a.includes(n)||TD(n,a)<=i)&&s.push(o)}return s}function we(e,t){if(nn(e)){let s=function(n,r){return e(n,r)};var i=s;return s[wi]=t,s}else return{...e,[wi]:t}}function W(e){return Object.assign(nn(e)?(t,i)=>e(t,i):At(e),{[bm]:!0,[wi]:e[wi]})}function he(e){return Object.assign(nn(e)?(t,i)=>e(t,i):At(e),{[xm]:!0,[wi]:e[wi]})}var At=(e,t="an object")=>we((i,s)=>{const n=ci(i,e,s.path);return{valid:!fo(n.invalid,s.path),cleared:n.cleared,invalid:n.invalid}},t),Pa=(e,t,i)=>({...e,[wi]:t,[Nc]:i}),qe=(...e)=>we((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[wi]).filter(Boolean).join(" and ")),pe=(...e)=>we((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[wi]).filter(Boolean).join(" or ")),Ec=e=>je(e)||cd(e),OD=e=>go(e)||(je(e)||Bt(e))&&cd(new Date(e)),Ns=we(Ae,"an array"),k=we(DD,"a boolean"),Be=we(nn,"a function"),_=we(CD,"a color string"),Pn=we(OD,"a date"),ee=we(Na,"a defined value"),O=we(je,"a number"),Oc=we(ot,"an object"),N=we(Bt,"a string"),vm=we(e=>typeof HTMLElement>"u"||e instanceof HTMLElement,"an html element"),yr=(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`,we(s=>Ae(s)&&s.length>=e&&s.length<=t,i)},Mm=(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`,we(s=>Bt(s)&&s.length>=e&&s.length<=t,i)},Sm=(e,t=!0)=>we(i=>je(i)&&(i>e||t&&i===e),`a number greater than ${t?"or equal to ":""}${e}`),PD=(e,t)=>we(i=>je(i)&&i>=e&&i<=t,`a number between ${e} and ${t} inclusive`),T=Sm(0),Ra=Sm(0,!1),K=PD(0,1),Es=e=>we((t,{options:i})=>!Ec(t)||!Ec(i[e])||t<i[e],`the value to be less than \`${e}\``),Os=e=>we((t,{options:i})=>!Ec(t)||!Ec(i[e])||t>i[e],`the value to be greater than \`${e}\``);function z(...e){ot(e[0])&&(e=Object.values(e[0]));const t=Ea(e,"or",i=>`'${i}'`);return we(i=>e.includes(i),`a keyword such as ${t}`)}var Qe=e=>we(t=>e===t,`the value ${JSON.stringify(e)}`),te=(e,t,i=!0)=>we((s,n)=>{if(!Ae(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[wi]} array`),qt=(e,t="an object array")=>we((i,s)=>{if(!Ae(i))return!1;const n=[],r=[];for(let o=0;o<i.length;o++){const a=`${s.path}[${o}]`,l=ci(i[o],e,a);fo(l.invalid,a)||n.push(l.cleared),r.push(...l.invalid)}return{valid:!0,cleared:n,invalid:r}},t),br=(e,t)=>we((i,s)=>nn(i)?wc in i?!0:{valid:!0,cleared:Object.assign((...r)=>{const o=ym(i,r);if(o==null)return;const a=e(o,{options:o,path:""});if(typeof a=="object"){if(a.invalid.forEach(Dm(s,t??e[wi])),a.valid)return a.cleared}else{if(a)return o;ka(`Callback \`${s.path}\` returned an invalid value \`${ud(o,50)}\`; expecting ${t??e[wi]}, ignoring.`)}},{[wc]:!0}),invalid:[]}:!1,"a function"),Je=(e,t="an object")=>we((i,s)=>nn(i)?wc in i?!0:{valid:!0,cleared:Object.assign((...r)=>{const o=ym(i,r,s.path);if(o==null)return;const a=ci(o,e);return a.invalid.forEach(Dm(s,t)),a.cleared},{[wc]:!0}),invalid:[]}:!1,"a function");function fo(e,t){return e.some(i=>i.type==="required"&&i.path===t)}function Dm(e,t){return i=>{if(i instanceof pd)return ka(`Callback \`${e.path}\` returned an unknown property \`${Oa(i.path,i.key)}\`${i.getPostfix()}`);const s=ud(i.value,50);ka(i.key?`Callback \`${e.path}\` returned an invalid property \`${Oa(i.path,i.key)}\`: \`${s}\`; expecting ${i.description}, ignoring.`:`Callback \`${e.path}\` returned an invalid value \`${s}\`; expecting ${t??i.description}, ignoring.`)}}var Pc=e=>{if(!ot(e))return!1;const t=Object.keys(e);return t.length===1&&t[0].startsWith("$")},RD=At({color:_,stop:K},""),Im=we(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"),gd=qe(yr(2),te(RD),Im),fd=z("axis","item","series"),md=At({type:W(Qe("gradient")),colorStops:W(gd),rotation:O,gradient:he(z("linear","radial","conic")),bounds:he(fd),reverse:he(k)},"a gradient object with color stops"),B={stroke:_,strokeWidth:T,strokeOpacity:K},zD=At({type:W(Qe("gradient")),gradient:W(z("linear","radial","conic")),bounds:W(fd),colorStops:W(pe(gd,qe(yr(2),te(_)))),rotation:W(O),reverse:W(k)}),FD=At({type:W(Qe("pattern")),pattern:W(z("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses")),path:Mm(2),width:W(T),height:W(T),fill:W(_),fillOpacity:W(K),backgroundFill:W(_),backgroundFillOpacity:W(K),padding:W(T),rotation:W(O),scale:W(T),stroke:W(_),strokeWidth:W(T),strokeOpacity:W(K)}),jD=At({type:W(Qe("image")),url:N,width:T,height:T,rotation:W(O),backgroundFill:W(_),backgroundFillOpacity:K,fit:W(z("stretch","contain","cover")),repeat:W(z("repeat","repeat-x","repeat-y","no-repeat"))}),BD=Pa({gradient:{colorStops:gd,rotation:O,gradient:he(z("linear","radial","conic")),bounds:he(fd),reverse:he(k)},pattern:{pattern:z("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses"),path:Mm(2),width:T,height:T,rotation:O,scale:T,fill:_,fillOpacity:K,backgroundFill:_,backgroundFillOpacity:K,...B,padding:he(T)},image:{url:W(N),backgroundFill:_,backgroundFillOpacity:K,width:T,height:T,fit:z("stretch","contain","cover","none"),repeat:z("repeat","repeat-x","repeat-y","no-repeat"),rotation:O}},"a color object"),Gi=pe(_,At(BD,"a color object")),$={fill:Gi,fillOpacity:K};$.fillGradientDefaults=he(zD),$.fillPatternDefaults=he(FD),$.fillImageDefaults=he(jD);var Y={lineDash:te(T),lineDashOffset:O},Ps={...$,...B,...Y,opacity:K,cornerRadius:T},xr={...B,...Y,opacity:K},st={...$,...B,...Y,opacity:K};function Am(e){return{enabled:k,range:z("tooltip","node"),highlightedItem:e,unhighlightedItem:e}}function St(e,t){return{enabled:k,range:z("tooltip","node"),highlightedItem:e,unhighlightedItem:e,highlightedSeries:t,unhighlightedSeries:t,bringToFront:k}}var Cm=At({googleFont:N},"google font"),yd=pe(N,Pc,Cm,te(pe(N,Cm))),_e={color:_,fontFamily:yd,fontSize:T,fontStyle:z("normal","italic","oblique"),fontWeight:pe(T,z("normal","bold","bolder","lighter"))},VD=At({top:O,right:O,bottom:O,left:O},"padding object"),Rc=pe(O,VD),zc={enabled:k,stroke:_,strokeWidth:T,strokeOpacity:K},as={border:{...zc},cornerRadius:O,padding:Rc,...$};function GD(e,t,i=1/0){const s=t,n=i,r=e%180*(Math.PI/180),o=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));if(o===0)return{width:s,height:n};if(a===0)return{width:n,height:s};if(!isFinite(n)){const c=a/o,h=s/(a+c*o);return{width:h,height:c*h}}const l=a*a-o*o;if(l===0){const c=Math.min(s,n)/Math.SQRT2;return{width:c,height:c}}return{width:Math.abs((s*a-n*o)/l),height:Math.abs((n*a-s*o)/l)}}function Fc(e){return typeof e>"u"?[]:Array.isArray(e)?e:[e]}function _D(e){return Array.from(new Set(e))}function bd(e,t){return e.reduce((i,s)=>{const n=t(s);return i[n]??(i[n]=[]),i[n].push(s),i},{})}function rn(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(!rn(e[i],t[i]))return!1}else if(e[i]!==t[i])return!1;return!0}function Rs(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 HD(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 UD(e,t){let i=0;for(;i<e.length&&t(e[i]);)i+=1;const s=i;s!==0&&e.splice(0,s)}function $D(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 Lm=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 Tm(e=0){return new Promise(t=>{setTimeout(t,e)})}function*mo(...e){for(const t of e)yield*t}function WD(e){return e!=null&&typeof e=="object"&&Symbol.iterator in e?e:[e]}function za(e){for(const t of e)return t;throw new Error("AG Charts - no first() value found")}function*ls(e){const t=[void 0,void 0];for(const i of Object.keys(e))t[0]=i,t[1]=e[i],yield t}function Rn(e){return e==="true"}function YD(e){return Number(e)}function Ni(e){return e}var KD={role:Ni,"aria-checked":Rn,"aria-controls":Ni,"aria-describedby":Ni,"aria-disabled":Rn,"aria-expanded":Rn,"aria-haspopup":Ni,"aria-hidden":Rn,"aria-label":Ni,"aria-labelledby":Ni,"aria-live":Ni,"aria-orientation":Ni,"aria-selected":Rn,"data-focus-override":Rn,"data-focus-visible-override":Rn,"data-preventdefault":Rn,class:Ni,for:Ni,id:Ni,tabindex:YD,title:Ni,placeholder:Ni};function Ce(e,t,i){i==null||i===""||i===""?e?.removeAttribute(t):e?.setAttribute(t,i.toString())}function yo(e,t){if(t!=null)for(const[i,s]of ls(t))i!=="class"&&Ce(e,i,s)}function bo(e,t,i){if(!(e instanceof HTMLElement))return;const s=e.getAttribute(t);return s===null?i:KD[t]?.(s)??void 0}function zs(e,t,i){e!=null&&(i==null?e.style.removeProperty(t):e.style.setProperty(t,i.toString()))}function ZD(e,t){for(const[i,s]of ls(t))zs(e,i,s)}function km(e,t,i,s,n){return t<e.x+e.width&&t+s>e.x&&i<e.y+e.height&&i+n>e.y}function xd(e,t,i,s=0,n=0){return t>=e.x&&t+s<=e.x+e.width&&i>=e.y&&i+n<=e.y+e.height}function vd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vr(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 Fa(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}var XD=class{constructor(e){this.getter=e}get(){let e=this.result?.deref();return e||(e=this.getter(),this.result=new WeakRef(e),e)}clear(){this.result=void 0}},at=class{constructor(){this.callbacks=new Set}flush(){for(const e of this.callbacks)e();this.callbacks.clear()}merge(e){for(const t of e.callbacks)this.callbacks.add(t)}register(...e){for(const t of e)t&&this.callbacks.add(t)}};function qD(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}}function se(e,t,i){return Math.min(i,Math.max(e,t))}function QD(e,t,i=1e-10){return e>=t[0]-i&&e<=t[1]+i}function _i(e,t,i=1e-10){return e===t||Math.abs(e-t)<i}function Md(e){return Math.sign(e)===-1||Object.is(e,-0)}function JD(e){return e%1===0}function wm(e,t=2){const i=10**t;return Math.round(e*i)/i}function eI(e,t){return Math.floor(e%t+(e<0?Math.abs(t):0))}function Sd(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)}function Nm(e){return Array.isArray(e)&&e.length>=2&&e.every(je)}function jc(e){return Array.isArray(e)&&e.length>=2&&e.every(Nm)}function tI(e){const t=e[0],i=e[e.length-1];return _i(t[0],i[0],.001)&&_i(t[1],i[1],.001)}function Em(e){return Array.isArray(e)&&e.every(jc)&&e.every(tI)}function Om(e){if(e===null)return!0;if(!ot(e)||e.type==null)return!1;const{type:t,coordinates:i}=e;switch(t){case"GeometryCollection":return Array.isArray(e.geometries)&&e.geometries.every(Om);case"MultiPolygon":return Array.isArray(i)&&i.every(Em);case"Polygon":return Em(i);case"MultiLineString":return Array.isArray(i)&&i.every(jc);case"LineString":return jc(i);case"MultiPoint":return jc(i);case"Point":return Nm(i);default:return!1}}function iI(e){return ot(e)&&e.type==="Feature"&&Om(e.geometry)}function sI(e){return ot(e)&&e.type==="FeatureCollection"&&Array.isArray(e.features)&&e.features.every(iI)}var nI=we(sI,"a GeoJSON object"),rI=class{constructor(e,t){this._vertexCount=0,this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[],this.cachedNeighboursEdge=e,this.processedEdge=t}clear(){this._vertexCount=0,this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[]}addVertex(e){const t=new oI(e);return this._vertexCount++,t}addEdge(e,t,i){i===this.cachedNeighboursEdge?e.updateCachedNeighbours().set(t.value,t):i===this.processedEdge&&(this.pendingProcessingEdgesFrom.push(e),this.pendingProcessingEdgesTo.push(t));const{edges:s}=e,n=s.get(i);n?n.indexOf(t)===-1&&n.push(t):s.set(i,[t])}removeVertex(e){this._vertexCount--;const t=e.edges;if(t){for(const[i,s]of t)this._vertexCount-=s.length;e.clear()}}removeEdge(e,t){for(const[i,s]of e.edges){const n=s.indexOf(t);s.splice(n,1),s.length===0&&e.edges.delete(i)}}removeEdges(e,t){e.edges.delete(t)}getVertexValue(e){return e.value}*neighbours(e){for(const[t,i]of e.edges)for(const s of i)yield s}*neighboursAndEdges(e){for(const[t,i]of e.edges)for(const s of i)yield[s,t]}neighboursWithEdgeValue(e,t){return e.edges.get(t)}findNeighbour(e,t){return e.edges.get(t)?.[0]}findNeighbourValue(e,t){const i=this.findNeighbour(e,t);if(i)return this.getVertexValue(i)}findNeighbourWithValue(e,t,i){const s=i==null?this.neighbours(e):this.neighboursWithEdgeValue(e,i);if(s){for(const n of s)if(this.getVertexValue(n)===t)return n}}findVertexAlongEdge(e,t,i){if(i===this.cachedNeighboursEdge){let n;for(const r of t)if(n=(n??e).readCachedNeighbours()?.get(r),!n)return;return n}if(t.length===0)return;let s=e;for(const n of t){const r=s?this.neighboursWithEdgeValue(s,i):void 0;if(!r)return;s=r.find(o=>o.value===n)}return s}adjacent(e,t){for(const[i,s]of e.edges)if(s.includes(t))return!0;return!1}},oI=class{constructor(e){this.value=e,this.edges=new Map}readCachedNeighbours(){return this._cachedNeighbours}updateCachedNeighbours(){return this._cachedNeighbours??(this._cachedNeighbours=new Map),this._cachedNeighbours}clear(){this.edges.clear(),this._cachedNeighbours?.clear()}},Pm=new Map,pO=Symbol("ElementID"),aI=1;function cs(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=(Pm.get(i)??0)+1;return Pm.set(i,s),`${i}-${s}`}function Bc(){return`ag-charts-${aI++}`}function Dd(){return crypto.randomUUID?.()??lI()}function lI(){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 cI=(e,t,i)=>{let s=e,n=s;for(const r of t)if(s==null||i(s.value,r)>0)s={value:r,next:s},n=s;else{for(n=n;n.next!=null&&i(n.next.value,r)<=0;)n=n.next;n.next={value:r,next:n.next}}return s},Rm=/^(?:(.)?([<>=^]))?([+\-( ])?([$€£¥₣₹#])?(0)?(\d+)?(,)?(?:\.(\d+))?(~)?([%a-z])?$/i,zm=/^((?:[^#]|#[^{])*)#{([^}]+)}(.*)$/;function hI(e){if(!Bt(e))return!1;const t=zm.exec(e);return Rm.test(t?t[2]:e)}function Id(e){let t,i;const s=zm.exec(e);s&&([,t,e,i]=s);const n=Rm.exec(e);if(!n){j.warnOnce(`The number formatter is invalid: ${e}`);return}const[,r,o,a,l,c,h,u,d,p,g]=n;return{fill:r,align:o,sign:a,symbol:l,zero:c,width:parseInt(h),comma:u,precision:parseInt(d),trim:!!p,type:g,prefix:t,suffix:i}}function Fm(e){const t=typeof e=="string"?Id(e):e;if(t==null)return;const{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 g=d==null||isNaN(d);let m;if(!c)m=Hi.g,p=!0;else if(c in Hi&&c in xo)m=g?xo[c]:Hi[c];else if(c in Hi)m=Hi[c];else if(c in xo)m=xo[c];else throw new Error(`The number formatter type is invalid: ${c}`);const b=c?6:12;let y;return g||(y=d),(v,M)=>{let S=m(v,y??M??b);return p&&(S=pI(S)),l&&(S=gI(S,l)),S=mI(v,S,n),r&&r!=="#"&&(S=`${r}${S}`),r==="#"&&c==="x"&&(S=`0x${S}`),c==="s"&&(S=`${S}${fI(v)}`),(c==="%"||c==="p")&&(S=`${S}%`),a!=null&&!isNaN(a)&&(S=yI(S,a,i??o,s)),S=`${h}${S}${u}`,S}}var xo={b:e=>Vc(e).toString(2),c:e=>String.fromCharCode(e),d:e=>Math.round(Math.abs(e)).toFixed(0),o:e=>Vc(e).toString(8),x:e=>Vc(e).toString(16),X:e=>xo.x(e).toUpperCase(),n:e=>xo.d(e),"%":e=>`${Vc(e*100).toFixed(0)}`},Hi={e:(e,t)=>Math.abs(e).toExponential(t),E:(e,t)=>Hi.e(e,t).toUpperCase(),f:(e,t)=>Math.abs(e).toFixed(t),F:(e,t)=>Hi.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)=>Hi.g(e,t).toUpperCase(),n:(e,t)=>Hi.g(e,t),p:(e,t)=>Hi.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=Vm(e);return Hi.r(e/10**i,t)},"%":(e,t)=>Hi.f(e*100,t)},jm=-24,Bm=24,uI={[jm]:"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",[Bm]:"Y"},dI="\u2212";function Vc(e){return Math.floor(Math.abs(e))}function pI(e){if(!e.endsWith("0")||e.indexOf(".")===-1)return e;let t=e.length-1;for(;t>0;)if(e[t]=="0")t-=1;else if(e[t]=="."){t-=1;break}else break;return e.substring(0,t+1)}function gI(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 fI(e){return uI[Vm(e)]}function Vm(e){return se(jm,e?Math.floor(Math.log10(Math.abs(e))/3)*3:0,Bm)}function mI(e,t,i=""){if(i==="(")return e>=0?t:`(${t})`;const s=i==="+"?"+":"";return`${e>=0?s:dI}${t}`}function yI(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 Gm=Object.defineProperty,bI=Object.getOwnPropertyDescriptor,Fs=(e,t)=>{for(var i in t)Gm(e,i,{get:t[i],enumerable:!0})},f=(e,t,i,s)=>{for(var n=s>1?void 0:s?bI(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&&Gm(t,i,n),n},Gc=class{constructor(){this.cleanup=new at}destroy(){this.cleanup.flush()}},xI=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)}},js=new xI,_c=Symbol("interpolate"),Hc=e=>e[_c]!=null;function Uc(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 vI(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 ja=class Ca{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 Ca(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 Ca(i,s,n-i,r-s)}static nearestBox(t,i,s){return Uc(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 Ca(t,i,s,n)}equals(t){return vd(this,t)}containsPoint(t,i){return xd(this,t,i)}intersection(t){if(!this.collidesBBox(t))return;const i=se(t.x,this.x,t.x+t.width),s=se(t.y,this.y,t.y+t.height),n=se(t.x,this.x+this.width,t.x+t.width),r=se(t.y,this.y+this.height,t.y+t.height);return new Ca(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-se(this.x,t,this.x+this.width),n=i-se(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}[_c](t,i){return new Ca(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)}};ja.zero=Object.freeze(new ja(0,0,0,0)),ja.NaN=Object.freeze(new ja(NaN,NaN,NaN,NaN));var U=ja,MI=2e3,_m=Date.now(),SI=()=>{const e=Date.now()-_m;if(e>MI){const t=(Math.floor(e/100)/10).toFixed(1);j.log(`**** ${t}s since last log message ****`)}_m=Date.now()},be={create(...e){return Object.assign((...i)=>{be.check(...e)&&(typeof i[0]=="function"&&(i=Fc(i[0]())),SI(),j.log(...i))},{check:()=>be.check(...e),group:(i,s)=>be.check(...e)?j.logGroup(i,s):s()})},check(...e){return e.length===0&&e.push(!0),Fc(Fe("agChartsDebug")).some(i=>e.includes(i))},inDevelopmentMode(e){if(be.check("dev"))return e()}};function Hm({context:e,pixelRatio:t,width:i,height:s}){e.save();try{e.resetTransform(),e.clearRect(0,0,Math.ceil(i*t),Math.ceil(s*t))}finally{e.restore()}}function Um(e){if(be.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 $m(e,t,i){return[Math.floor(e*i),Math.floor(t*i)]}var Ad=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]=$m(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),Um(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]=$m(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(){Hm(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)}},Cd=Symbol("BREAK"),Ba="__decorator_config",$c="__decorator_accessors";function DI(e,t){Ld(e,t).optional=!0}function Ld(e,t){if(Object.getOwnPropertyDescriptor(e,Ba)==null&&Object.defineProperty(e,Ba,{value:{}}),Object.getOwnPropertyDescriptor(e,$c)==null){const h=Object.getPrototypeOf(e)?.[$c]?.slice()??[];Object.defineProperty(e,$c,{value:h})}const i=e[Ba],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[$c];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===Cd)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===Cd)return;return c},enumerable:!0,configurable:!1}),i[s]}function Mr(e,t,i){return(s,n)=>{const r=Ld(s,n);r.setters.push(e),t&&r.getters.unshift(t),i&&Object.assign(r,i)}}function Wm(e){return(t,i)=>{Ld(t,i).observers.push(e)}}function Wc(e){return typeof e<"u"&&Ba in e}function zn(e){const t=new Set;for(;Wc(e);)t.add(e?.[Ba]),e=Object.getPrototypeOf(e);return Array.from(t).flatMap(i=>Object.keys(i))}function Ym(e){return zn(e).reduce((t,i)=>(t[String(i)]=e[i]??null,t),{})}function Nt(e,t){return Array.isArray(e)?!Array.isArray(t)||e.length!==t.length?!1:e.every((i,s)=>Nt(i,t[s])):Ne(e)?Ne(t)?Td(e,t,Nt):!1:e===t}function Td(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 Ee(...e){const t={};for(const i of e){if(!ot(i))continue;const s=Wc(i)?zn(i):Object.keys(i);for(const n of s)Ne(t[n])&&Ne(i[n])?t[n]=Ee(t[n],i[n]):t[n]??(t[n]=i[n])}return t}function Va(...e){const t={};for(const i of e){if(!ot(i))continue;const s=Wc(i)?zn(i):Object.keys(i);for(const n of s)Ne(t[n])&&Ne(i[n])?t[n]=Va(t[n],i[n]):n in t||(t[n]??(t[n]=i[n]))}return t}function Km(e,...t){return t&&Ae(e)?e.map(i=>Ee(i,...t)):e}function Zm(e,t){const i={};for(const[s,n]of ls(e))i[s]=t(n,s,e);return i}function V(e,t){const i={...e};for(const s of t)delete i[s];return i}function kd(e,t){if(e==null)return;const i={};for(const s of t)Object.hasOwn(e,s)&&(i[s]=e[s]);return i}function wd(e,t){return(Ae(t)?t:t.split(".")).reduce((s,n)=>s[n],e)}var Nd=new Set(["__proto__","constructor","prototype"]);function Ed(e,t,i){const s=Ae(t)?t.slice():t.split("."),n=s.pop();if(s.some(o=>Nd.has(o)))return;const r=s.reduce((o,a)=>o[a],e);return r[n]=i,r[n]}function Od(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 on(e){return e==null||typeof e!="object"||!Ne(e)||(Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const i=e[t];i!==null&&(typeof i=="object"||typeof i=="function")&&!Object.isFrozen(i)&&on(i)})),e}function Xm(e,t){return Ne(e)&&t in e}function II(e,t){return Xm(e,t)&&typeof e[t]=="string"}var vo=(e,t)=>e===t;function F(e){return function(t,i){const s=`__${i}`;t[i]||AI(t,i,s,e)}}function qm(e){return F(e)}function Ei(e){return F(e)}function Pd(e){const t=e??{};return t.equals=rn,F(e)}function AI(e,t,i,s){const{changeCb:n,convertor:r,checkDirtyOnAssignment:o=!1}=s??{},a={changeCb:n,checkDirtyOnAssignment:o,convertor:r},l=TI(i,LI(CI(kI(i,a),a),a),a);Object.defineProperty(e,t,{set:l,get:function(){return this[i]},enumerable:!0,configurable:!0})}function CI(e,t){const{convertor:i}=t;return i?function(s){e.call(this,i(s))}:e}var Qm=Symbol("no-change");function LI(e,t){const{changeCb:i}=t;return i?function(s){const n=e.call(this,s);return n!==Qm&&i.call(this,this),n}:e}function TI(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 kI(e,t){const{equals:i=vo}=t;return function(s){const n=this[e];return i(s,n)?Qm:(this[e]=s,this.onChangeDetection(e),s)}}var Rd=(e,t)=>Math.sign(e-t);function Jm(e,t){if(typeof e=="number"&&typeof t=="number")return Rd(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=Rd(i[r],s[r]);if(o!==0)return o}return Rd(i.length,s.length)}var ey=(e=>(e[e.All=0]="All",e[e.None=1]="None",e))(ey||{}),wI=5,Ga=class om{constructor(t){this.serialNumber=om._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=cs(this),this.name=void 0,this.transitionOut=void 0,this.pointerEvents=0,this._datum=void 0,this._previousDatum=void 0,this.scene=void 0,this._debugDirtyProperties=void 0,this.parentNode=void 0,this.cachedBBox=void 0,this.isContainerNode=!1,this.visible=!0,this.zIndex=0,this.batchLevel=0,this.batchDirty=!1,this.name=t?.name,this.tag=t?.tag??NaN,this.zIndex=t?.zIndex??0,this.scene=t?.scene,(t?.debugDirty??om._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=Mt("svg");if(r.setAttribute("width",String(i)),r.setAttribute("height",String(s)),r.setAttribute("viewBox",`0 0 ${i} ${s}`),r.setAttribute("overflow","visible"),n.defs?.length){const o=Mt("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}closestDatum(){for(const{datum:t}of this.traverseUp(!0))if(t!=null)return t}preRender(t,i=1){if(this.childNodeCounts.groups=0,this.childNodeCounts.nonGroups=1,this.childNodeCounts.complexity=i,this.childNodeCounts.thisComplexity=i,this.batchLevel>0||this.batchDirty)throw new Error("AG Charts - illegal rendering state; batched update in progress");return this.childNodeCounts}isolatedRender(t){t.ctx.save();try{this.render(t)}catch(i){const s=i.errorCount??1;if(s>=wI)throw i.errorCount=s,i;j.warnOnce("Error during rendering",i,i.stack)}finally{t.ctx.restore()}}render(t){const{stats:i}=t;if(this.debugDirtyProperties(),t.debugNodeSearch){const s=this.name??this.id;t.debugNodeSearch.some(n=>typeof n=="string"?n===s:n.test(s))&&(t.debugNodes[this.name??this.id]=this)}i&&(i.nodesRendered++,i.opsPerformed+=this.childNodeCounts.thisComplexity)}setScene(t){this.scene=t}*traverseUp(t){let i=this;for(t&&(yield i);i=i.parentNode;)yield i}isRoot(){return!this.parentNode}removeChild(t){throw new Error(`AG Charts - internal error, unknown child node ${t.name??t.id} in $${this.name??this.id}`)}remove(){this.parentNode?.removeChild(this)}destroy(){this.parentNode?.removeChild(this)}batchedUpdate(t){this.batchLevel++,t(),this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}setProperties(t){return this.batchLevel++,Object.assign(this,t),this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1),this}containsPoint(t,i){return!1}pickNode(t,i){if(this.containsPoint(t,i))return this}pickNodes(t,i,s=[]){return this.containsPoint(t,i)&&s.push(this),s}getBBox(){return this.cachedBBox??(this.cachedBBox=Object.freeze(this.computeBBox())),this.cachedBBox}computeBBox(){}onChangeDetection(t){this.markDirty(t)}markDirtyChildrenOrder(){this.cachedBBox=void 0}markDirty(t){if(this.batchLevel>0){this.batchDirty=!0;return}t!=null&&this._debugDirtyProperties&&this.markDebugProperties(t),this.cachedBBox=void 0,this.parentNode?.markDirty()}markDebugProperties(t){const i=this._debugDirtyProperties?.get(t)??[],s=new Error().stack?.split(`
`).filter(n=>n!=="Error"&&!n.includes(".markDebugProperties")&&!n.includes(".markDirty")&&!n.includes("Object.assign ")&&!n.includes(`${this.constructor.name}.`))??"unknown";i.push(s[0].replace(" at ","").trim()),this._debugDirtyProperties?.set(t,i)}debugDirtyProperties(){this._debugDirtyProperties!=null&&(this._debugDirtyProperties.has("__first__")||this._debugDirtyProperties.forEach((t,i)=>{t.length>1&&(console.groupCollapsed(`Property changed multiple times before render: ${this.constructor.name}.${i} (${t.length}x)`),t.forEach(s=>console.log(s)),console.groupEnd())}),this._debugDirtyProperties.clear())}onZIndexChange(){this.parentNode?.markDirtyChildrenOrder()}toSVG(){}};Ga._nextSerialNumber=0,Ga._debugEnabled=!1,f([F()],Ga.prototype,"visible",2),f([Ei({equals:Nt,changeCb:e=>e.onZIndexChange()})],Ga.prototype,"zIndex",2);var an=Ga,Ui=Math.PI*2,_a=Math.PI/2;function Ct(e){return e%=Ui,e+=Ui,e%=Ui,e}function NI(e){return e%=Ui,e+=Ui,e!==Ui&&(e%=Ui),e}function Yc(e){return e%=Ui,e<-Math.PI?e+=Ui:e>=Math.PI&&(e-=Ui),e}function Sr(e,t,i){const s=Ct(e),n=Ct(t),r=Ct(i);return n<r?n<=s&&s<=r:n>r?n<=s||s<=r:t!==i}function Qt(e){return e/180*Math.PI}function EI(e){return e/Math.PI*180}function Kc(e,t){return e=Ct(e),t=Ct(t),t-e+(e>t?Ui:0)}function ty(e){const t=Ct(e);return t<=_a?t/_a:t<=Math.PI?(Math.PI-t)/_a:t<=1.5*Math.PI?(t-Math.PI)/_a:(Ui-t)/_a}function zd(e,t,i){const s=ty(i);return e*s+t*Math.abs(1-s)}function ln(e){return e?Ct(Qt(e)):0}var Dr=(e,t,i)=>e*(1-i)+t*i,Fd=e=>{const t=e<0?-1:1,i=Math.abs(e);return i<=.04045?e/12.92:t*((i+.055)/1.055)**2.4},jd=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},iy=class Re{constructor(t,i,s,n=1){this.r=se(0,t||0,1),this.g=se(0,i||0,1),this.b=se(0,s||0,1),this.a=se(0,n||0,1)}static validColorString(t){return t.indexOf("#")>=0?!!Re.parseHex(t):t.indexOf("rgb")>=0?!!Re.stringToRgba(t):Re.nameToHex.has(t.toLowerCase())}static fromString(t){if(t.indexOf("#")>=0)return Re.fromHexString(t);const i=Re.nameToHex.get(t.toLowerCase());if(i)return Re.fromHexString(i);if(t.indexOf("rgb")>=0)return Re.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=Re.parseHex(t);if(i){const[s,n,r,o]=i;return new Re(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=se(0,c,100),c/=100):a===3?c=se(0,c,1):(c=se(0,c,255),c/=255),o.push(c)}return o}static fromRgbaString(t){const i=Re.stringToRgba(t);if(i){if(i.length===3)return new Re(i[0],i[1],i[2]);if(i.length===4)return new Re(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 Re(t[0],t[1],t[2],t[3]);if(t.length===3)return new Re(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=Re.HSBtoRGB(t,i,s);return new Re(r[0],r[1],r[2],n)}static fromHSL(t,i,s,n=1){const r=Re.HSLtoRGB(t,i,s);return new Re(r[0],r[1],r[2],n)}static fromOKLCH(t,i,s,n=1){const r=Re.OKLCHtoRGB(t,i,s);return new Re(r[0],r[1],r[2],n)}static padHex(t){return t.length===1?"0"+t:t}toHexString(){let t="#"+Re.padHex(Math.round(this.r*255).toString(16))+Re.padHex(Math.round(this.g*255).toString(16))+Re.padHex(Math.round(this.b*255).toString(16));return this.a<1&&(t+=Re.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 Re.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(t,i,s){const n=Fd(t),r=Fd(i),o=Fd(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,g=h,m=Math.hypot(u,d),b=p>=0?p:p+360;return[g,m,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=jd(h),g=jd(u),m=jd(d);return[p,g,m]}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 Re(Dr(t.r,i.r,s),Dr(t.g,i.g,s),Dr(t.b,i.b,s),Dr(t.a,i.a,s))}static lighten(t,i){const s=Re.RGBtoOKLCH(t.r,t.g,t.b);return Re.fromOKLCH(se(0,s[0]+i,1),s[1],s[2])}static darken(t,i){const s=Re.RGBtoOKLCH(t.r,t.g,t.b);return Re.fromOKLCH(se(0,s[0]-i,1),s[1],s[2])}static interpolate(t,i){const s=1/(t.length-1),n=t.map(r=>Re.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 Re.fromOKLCH(Dr(h[0],u[0],c),Dr(h[1],u[1],c),Dr(h[2],u[2],c))})}};iy.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 We=iy,sy=(e=>(e[e.Leading=0]="Leading",e[e.Trailing=1]="Trailing",e[e.Interpolate=2]="Interpolate",e))(sy||{}),Zc=class{ticks(e,t,i){}niceDomain(e,t=this.domain){return t}get bandwidth(){}get step(){}get inset(){}},Ha=(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})},ny=e=>{const t=We.fromString(e),[i,s,n]=We.RGBtoOKLCH(t.r,t.g,t.b);return{l:i,c:s,h:n,a:t.a}},Bd=1e-6,ry=e=>e.c<Bd||e.l<Bd||e.l>1-Bd,OI=(e,t,i)=>{i=se(0,i,1);let s;if(ry(e))s=t.h;else if(ry(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 We.fromOKLCH(r,n,s,o)},Mo=class extends Zc{constructor(){super(...arguments),this.type="color",this.defaultTickCount=0,this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.parsedRange=this.range.map(ny)}update(){const{domain:e,range:t}=this;e.length<2&&(j.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){j.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(ny)}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 OI(h,u,c).toRgbaString()}invert(){}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&j.warnOnce("Expected update to not invalidate scale"))}};f([Ha],Mo.prototype,"domain",2),f([Ha],Mo.prototype,"range",2);var Xc=class{constructor(e,t=[],i){this.colorSpace=e,this.stops=t,this.bbox=i,this._cache=void 0}createGradient(e,t,i){const s=this.bbox??t;if(!s.isFinite())return;if(this._cache!=null&&this._cache.ctx===e&&this._cache.bbox.equals(s))return this._cache.gradient;const{stops:n,colorSpace:r}=this;if(n.length===0)return;if(n.length===1)return n[0].color;let 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 Mo;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=Mt("stop");r.setAttribute("offset",`${s}`),r.setAttribute("stop-color",`${n}`),i.appendChild(r)}),i}},oy=class extends Xc{constructor(e,t,i=0,s){super(e,t,s),this.angle=i}createCanvasGradient(e,t,i){const{angle:n}=this,r=ln(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 Mt("linearGradient")}},ay=class extends Xc{constructor(e,t,i=0,s){super(e,t,s),this.angle=i}getGradientPoints(e){const{angle:i}=this,s=ln(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=Mt("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}},PI=class extends Xc{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=Mt("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}},x=DI,re=class{handleUnknownProperties(e,t){}set(e){const{className:t=this.constructor.name}=this.constructor;if(e==null)return this.clear(),this;if(typeof e!="object")return j.warn(`unable to set ${t} - expecting a properties object`),this;const i=new Set(Object.keys(e));for(const s of zn(this))if(i.has(s)){const n=e[s],r=this;if(Ir(r[s]))if(r[s]instanceof Ua){const o=r[s].reset(n);o==null?j.warn(`unable to set [${String(s)}] - expecting a properties array`):r[s]=o}else r[s].set(n);else Ne(n)?r[s]=Va(n,r[s]??{}):r[s]=n;i.delete(s)}this.handleUnknownProperties(i,e);for(const s of i)j.warn(`unable to set [${String(s)}] in ${t} - property is unknown`);return this}clear(){for(const e of zn(this)){const t=this[e];Ir(t)?t.clear():this[e]=void 0}return this}toJson(){return zn(this).reduce((e,t)=>{const i=this[t];return e[String(t)]=Ir(i)?i.toJson():i,e},{})}},Ua=class RS 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(Ae(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 RS(this.itemFactory,...t)}toJson(){return this.map(t=>t?.toJson?.()??t)}};function Ir(e){return e instanceof re||e instanceof Ua}var Vd=class extends re{constructor(){super(...arguments),this.color="black"}};f([x],Vd.prototype,"stop",2),f([x],Vd.prototype,"color",2);function RI(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 ly(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 zI(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"?ly(s):s}function cy(e,t,i,s="continuous"){const n=e.map(g=>typeof g=="string"?{color:g}:g);if(n.length===0)return zI(t,s);if(!RI(n))return j.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 g=0;g<n.length;g+=1){const m=n[g];if(g>=h){h=n.length-1;for(let y=g+1;y<n.length;y+=1)if(n[y]?.stop!=null){h=y;break}}let b=m?.stop;if(b==null){const y=n[c]?.stop,v=n[h]?.stop,M=y??r,S=v??o,D=a&&y==null?1:0;b=M+(S-M)*(g-c+D)/(h-c+D)}else c=g;l[g]=Math.max(0,Math.min(1,(b-r)/(o-r)))}let u=n.find(g=>g.color!=null)?.color,d;const p=n.map((g,m)=>{let b=g?.color;const y=l[m];return b!=null?u=b:u!=null?b=u:(d==null&&(d=new Mo,d.domain=[0,1],d.range=t),b=d.convert(y)),{stop:y,color:b}});return s==="discrete"?ly(p):p}var FI=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?(j.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=ln(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,g=t.x+t.width/2,m=t.y+t.height/2,b=l*h-c*u,y=c*h+l*u,v=b/2,M=y/2;e?.setTransform(new DOMMatrix([l*d,c*p,-c*d,l*p,g-v,m-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);if(l!=null)return 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=Mt("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=Mt("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=Mt("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}};function hy(e,t,i,s){const n=e-i,r=t-s;return n*n+r*r}function qc(e,t,i,s,n,r,o){if(i===n&&s===r)return Math.min(o,hy(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,hy(e,t,h,u))}var jI=/^[\t\n\f\r ]*([achlmqstvz])[\t\n\f\r ]*/i,et=/^[+-]?((\d*\.\d+)|(\d+\.)|(\d+))(e[+-]?\d+)?/i,BI=/[\t\n\f\r ]*,?[\t\n\f\r ]*/,uy=/^[01]/,VI={z:[],h:[et],v:[et],m:[et,et],l:[et,et],t:[et,et],s:[et,et,et,et],q:[et,et,et,et],c:[et,et,et,et,et,et],a:[et,et,et,uy,uy,et,et]};function GI(e){if(!e)return;const t=[];let i=0,s;for(;i<e.length;){const n=jI.exec(e.slice(i));let r;if(n==null){if(!s){j.warnOnce(`Invalid SVG path, error at index ${i}: Missing command.`);return}r=s}else r=n[1],i+=n[0].length;const o=_I(r,e,i);if(!o)return;i=o[0],s=r,t.push(o[1])}return t}function _I(e,t,i){const s=VI[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=BI.exec(o.slice(a[0].length));l!=null&&(i+=l[0].length)}else{if(n.params.length===1)return[i,n];j.warnOnce(`Invalid SVG path, error at index ${i}: No path segment parameters for command [${e}]`);return}}return[i,n]}function HI(e,t){const i=-t/e;return e!==0&&i>=0&&i<=1?[i]:[]}function UI(e,t,i,s=1e-6){if(Math.abs(e)<s)return HI(t,i);const n=t*t-4*e*i,r=[];if(Math.abs(n)<s){const o=-t/(2*e);o>=0&&o<=1&&r.push(o)}else if(n>0){const o=Math.sqrt(n),a=(-t-o)/(2*e),l=(-t+o)/(2*e);a>=0&&a<=1&&r.push(a),l>=0&&l<=1&&r.push(l)}return r}function $I(e,t,i,s,n=1e-6){if(Math.abs(e)<n)return UI(t,i,s,n);const r=t/e,o=i/e,a=s/e,l=(3*o-r*r)/9,c=(9*r*o-27*a-2*r*r*r)/54,h=l*l*l+c*c,u=1/3,d=[];if(h>=0){const p=Math.sqrt(h),g=Math.sign(c+p)*Math.pow(Math.abs(c+p),u),m=Math.sign(c-p)*Math.pow(Math.abs(c-p),u),b=Math.abs(Math.sqrt(3)*(g-m)/2),y=-u*r+(g+m);if(y>=0&&y<=1&&d.push(y),Math.abs(b)<n){const v=-u*r-(g+m)/2;v>=0&&v<=1&&d.push(v)}}else{const p=Math.acos(c/Math.sqrt(-l*l*l)),g=u*r,m=2*Math.sqrt(-l),b=m*Math.cos(u*p)-g,y=m*Math.cos(u*(p+2*Math.PI))-g,v=m*Math.cos(u*(p+4*Math.PI))-g;b>=0&&b<=1&&d.push(b),y>=0&&y<=1&&d.push(y),v>=0&&v<=1&&d.push(v)}return d}function $a(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 WI(e,t,i,s,n,r,o,a,l,c,h,u){let d=0;const p=c-u,g=h-l,m=l*(u-c)-c*(h-l),b=dy(e,i,n,o),y=dy(t,s,r,a),v=p*b[0]+g*y[0],M=p*b[1]+g*y[1],S=p*b[2]+g*y[2],D=p*b[3]+g*y[3]+m,A=$I(v,M,S,D);for(const I of A){const L=I*I,C=I*L,w=b[0]*C+b[1]*L+b[2]*I+b[3],E=y[0]*C+y[1]*L+y[2]*I+y[3];let R;l===h?R=(E-c)/(u-c):R=(w-l)/(h-l),R>=0&&R<=1&&d++}return d}function dy(e,t,i,s){return[-e+3*t-3*i+s,3*e-6*t+3*i,-3*e+3*t,e]}function So(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 Qc(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,So(e,t,i,s,a)<n?r=a:o=a;return a}function Wa(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,g=(1-l)*r+l*a,m=(1-l)*c+l*u,b=(1-l)*h+l*d,y=(1-l)*u+l*p,v=(1-l)*d+l*g,M=(1-l)*m+l*y,S=(1-l)*b+l*v;return[[{x:e,y:t},{x:c,y:h},{x:m,y:b},{x:M,y:S}],[{x:M,y:S},{x:y,y:v},{x:p,y:g},{x:o,y:a}]]}function py(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 gy(e,t,i,s,n,r,o,a){const l=py(e,i,n,o),c=py(t,s,r,a);return[...l,...c]}function Gd(e,t,i){const s=So(e[0].x,e[1].x,e[2].x,e[3].x,.5),n=So(e[0].y,e[1].y,e[2].y,e[3].y,.5),r=Math.hypot(s-t,n-i),o=Math.min(Math.hypot(e[0].x-t,e[0].y-i),Math.hypot(e[1].x-t,e[1].y-i),Math.hypot(e[2].x-t,e[2].y-i),Math.hypot(e[3].x-t,e[3].y-i));return{points:e,distance:r,minDistance:o}}function fy(e,t,i,s,n,r,o,a,l,c,h=1){let d={value:Gd([{x:e,y:t},{x:i,y:s},{x:n,y:r},{x:o,y:a}],l,c),next:null},p;for(;d!=null;){const{points:g,distance:m,minDistance:b}=d.value;if(d=d.next,(p==null||m<p.distance)&&(p={distance:m,minDistance:b}),p!=null&&p.distance-b<=h)continue;const[y,v]=Wa(g[0].x,g[0].y,g[1].x,g[1].y,g[2].x,g[2].y,g[3].x,g[3].y,.5),M=[Gd(y,l,c),Gd(v,l,c)].sort(my);d=cI(d,M,my)}return p?.distance??1/0}var my=(e,t)=>t.minDistance-e.minDistance,Do=class{constructor(){this.path2d=new Path2D,this.previousCommands=[],this.previousParams=[],this.previousClosedPath=!1,this.commands=[],this.params=[],this.cx=NaN,this.cy=NaN,this.sx=NaN,this.sy=NaN,this.openedPath=!1,this.closedPath=!1}isEmpty(){return this.commands.length===0}isDirty(){return this.closedPath!==this.previousClosedPath||this.previousCommands.length!==this.commands.length||this.previousParams.length!==this.params.length||this.previousCommands.toString()!==this.commands.toString()||this.previousParams.toString()!==this.params.toString()}getPath2D(){return this.path2d}moveTo(e,t){this.openedPath=!0,this.sx=e,this.sy=t,this.cx=e,this.cy=t,this.path2d.moveTo(e,t),this.commands.push(0),this.params.push(e,t)}lineTo(e,t){this.openedPath?(this.cx=e,this.cy=t,this.path2d.lineTo(e,t),this.commands.push(1),this.params.push(e,t)):this.moveTo(e,t)}cubicCurveTo(e,t,i,s,n,r){this.openedPath||this.moveTo(e,t),this.path2d.bezierCurveTo(e,t,i,s,n,r),this.commands.push(2),this.params.push(e,t,i,s,n,r)}closePath(){this.openedPath&&(this.cx=this.sx,this.cy=this.sy,this.sx=NaN,this.sy=NaN,this.path2d.closePath(),this.commands.push(3),this.openedPath=!1,this.closedPath=!0)}rect(e,t,i,s){this.moveTo(e,t),this.lineTo(e+i,t),this.lineTo(e+i,t+s),this.lineTo(e,t+s),this.closePath()}roundRect(e,t,i,s,n){n=Math.min(n,i/2,s/2),this.moveTo(e,t+n),this.arc(e+n,t+n,n,Math.PI,1.5*Math.PI),this.lineTo(e+n,t),this.lineTo(e+i-n,t),this.arc(e+i-n,t+n,n,1.5*Math.PI,2*Math.PI),this.lineTo(e+i,t+n),this.lineTo(e+i,t+s-n),this.arc(e+i-n,t+s-n,n,0,Math.PI/2),this.lineTo(e+i-n,t+s),this.lineTo(e+n,t+s),this.arc(e+ +n,t+s-n,n,Math.PI/2,Math.PI),this.lineTo(e,t+s-n),this.closePath()}ellipse(e,t,i,s,n,r,o,a=!1){const l=i,c=s/i,h=Math.cos(n),u=Math.sin(n),d=-c*u,p=c*h,g=l*Math.cos(r),m=l*Math.sin(r),b=e+h*g+d*m,y=t+u*g+p*m,v=(b-this.cx)**2+(y-this.cy)**2;this.openedPath?v>1e-6&&this.lineTo(b,y):this.moveTo(b,y);let M=a?-Ct(r-o):Ct(o-r);Math.abs(Math.abs(o-r)-2*Math.PI)<1e-6&&M<2*Math.PI&&(M+=2*Math.PI*(a?-1:1));const S=Math.max(Math.ceil(Math.abs(M)/(Math.PI/2)),1),D=M/S,A=4/3*Math.tan(D/4);for(let I=0;I<S;I+=1){const L=r+D*(I+0),C=r+D*(I+1),w=l*Math.sin(L),E=l*Math.cos(L),R=l*Math.sin(C),P=l*Math.cos(C),G=E-A*w,H=w+A*E,oe=P+A*R,me=R-A*P,ke=P,Te=R;this.cubicCurveTo(e+h*G+d*H,t+u*G+p*H,e+h*oe+d*me,t+u*oe+p*me,e+h*ke+d*Te,t+u*ke+p*Te)}}arc(e,t,i,s,n,r){this.ellipse(e,t,i,i,0,s,n,r)}appendSvg(e){const t=GI(e);if(t==null)return!1;let i=0,s=0,n,r,o=0,a=0;for(const{command:l,params:c}of t){n??(n=c[0]),r??(r=c[1]);const h=l===l.toLowerCase(),u=h?n:0,d=h?r:0;switch(l.toLowerCase()){case"m":this.moveTo(u+c[0],d+c[1]),n=u+c[0],r=d+c[1],i=n,s=r;break;case"c":this.cubicCurveTo(u+c[0],d+c[1],u+c[2],d+c[3],u+c[4],d+c[5]),o=u+c[2],a=d+c[3],n=u+c[4],r=d+c[5];break;case"s":this.cubicCurveTo(n+n-o,r+r-a,u+c[0],d+c[1],u+c[2],d+c[3]),o=u+c[0],a=d+c[1],n=u+c[2],r=d+c[3];break;case"q":this.cubicCurveTo((u+2*c[0])/3,(d+2*c[1])/3,(2*c[0]+c[2])/3,(2*c[1]+c[3])/3,c[2],c[3]),o=c[0],a=c[1],n=c[2],r=c[3];break;case"t":this.cubicCurveTo((n+2*(n+n-o))/3,(r+2*(r+r-a))/3,(2*(n+n-o)+c[0])/3,(2*(r+r-a)+c[1])/3,c[0],c[1]),o=n+n-o,a=r+r-a,n=c[0],r=c[1];break;case"a":this.svgEllipse(n,r,c[0],c[1],c[2]*Math.PI/180,c[3],c[4],u+c[5],d+c[6]),n=u+c[5],r=d+c[6];break;case"h":this.lineTo(u+c[0],r),n=u+c[0];break;case"l":this.lineTo(u+c[0],d+c[1]),n=u+c[0],r=d+c[1];break;case"v":this.lineTo(n,d+c[0]),r=d+c[0];break;case"z":this.closePath(),n=i,r=s;break;default:throw new Error(`Could not translate command '${l}' with '${c.join(" ")}'`)}}return!0}svgEllipse(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,g=-u*c+d*h,m=p/i,b=g/s;let y=m*m+b*b,v=(e+a)/2,M=(t+l)/2,S=0,D=0;y>=1?(y=Math.sqrt(y),i*=y,s*=y):(y=Math.sqrt(1/y-1),r===o&&(y=-y),S=y*i*b,D=-y*s*m,v+=d*S-u*D,M+=u*S+d*D);const A=Math.atan2((g-D)/s,(p-S)/i),I=Math.atan2((-g-D)/s,(-p-S)/i)-A,L=A+I,C=!!(1-o);this.ellipse(v,M,i,s,n,A,L,C)}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+=$a(a,l,c,h,r,o,e,t),c=s[p++],a=c,h=s[p++],l=h;break;case 1:u+=$a(c,h,s[p++],s[p++],r,o,e,t),c=s[p-2],h=s[p-1];break;case 2:u+=WI(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 3:u+=$a(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 v=l,M=c;l=n[u++],c=n[u++],i=qc(e,t,v,M,l,c,i);break}case 2:const d=l,p=c,g=n[u++],m=n[u++],b=n[u++],y=n[u++];l=n[u++],c=n[u++],i=fy(d,p,g,m,b,y,l,c,e,t)**2;break;case 3:i=qc(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;l+=2){const{x:c,y:h}=e(s[r++],s[r++]);t.push(c,h)}};let r=0;for(const o of i)switch(o){case 0:n("M",2);break;case 1:n("L",2);break;case 2:n("C",6);break;case 3:n("Z",0);break}return t.join(" ")}computeBBox(){const{commands:e,params:t}=this;let[i,s,n,r]=[1/0,1/0,-1/0,-1/0],[o,a]=[NaN,NaN],[l,c]=[NaN,NaN];const h=(d,p)=>{i=Math.min(p,i),s=Math.min(d,s),n=Math.max(d,n),r=Math.max(p,r),o=d,a=p};let u=0;for(const d of e)switch(d){case 0:h(t[u++],t[u++]),l=o,c=a;break;case 1:h(t[u++],t[u++]);break;case 2:{const p=o,g=a,m=t[u++],b=t[u++],y=t[u++],v=t[u++],M=t[u++],S=t[u++];gy(p,g,m,b,y,v,M,S).forEach(A=>{const I=So(p,m,y,M,A),L=So(g,b,v,S,A);h(I,L)}),h(M,S);break}case 3:h(l,c),l=NaN,c=NaN;break}return new U(s,i,n-s,r-i)}};function Vt(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 yy(e,t){return Math.floor(t*e)/e}function _d(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 g=a+(d-.5)*c,m=l+(p-.5)*h;u?e.lineTo(g,m):e.moveTo(g,m),u=!0}e.closePath()}var by={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(Vt(s,o),Vt(s,o)),e.lineTo(Vt(s,t-o),Vt(s,o)),e.lineTo(Vt(s,t-o),Vt(s,i-o)),e.lineTo(Vt(s,o),Vt(s,i-o)),e.closePath()},triangles(e,t){_d(e,t,[[.5,0],[1,1],[0,1]])},diamonds(e,t){_d(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,Qt(130),Qt(330)),e.arc(r+n,o-n,n,Qt(220),Qt(50)),e.lineTo(r,o+n),e.closePath()},crosses(e,t){_d(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=Vt(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=Vt(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)}},YI=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 Do;let l=by[t]!=null;return o&&l&&(l=!a.appendSvg(o)),l&&by[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 j.warnOnce("Pattern fill is too small to render, ignoring."),null;const a=new Ad({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){if(e==null)return;const n=ln(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=Mt("pattern");u.setAttribute("viewBox",`0 0 ${e} ${t}`),u.setAttribute("width",String(e)),u.setAttribute("height",String(t)),u.setAttribute("patternUnits","userSpaceOnUse");const d=Mt("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=Mt("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}};function hs(e){return ot(e)&&e.type=="gradient"}function KI(e){return Ae(e)&&e.every(t=>typeof t=="string")}function Fn(e){return e!==null&&ot(e)&&e.type=="pattern"}function Ar(e){return e!==null&&ot(e)&&e.type=="image"}function ZI(e){return hs(e)||Fn(e)}function xy(e,t){const{fontStyle:i,fontWeight:s,fontSize:n,fontFamily:r}=t;i&&e.setAttribute("font-style",i),s&&e.setAttribute("font-weight",String(s)),n!=null&&e.setAttribute("font-size",String(n)),r&&e.setAttribute("font-family",r)}function XI(e,t){const{stroke:i,strokeWidth:s,strokeOpacity:n}=t;i&&e.setAttribute("stroke",i),s!=null&&e.setAttribute("stroke-width",String(s)),n!=null&&e.setAttribute("stroke-opacity",String(n))}function qI(e,t){const{lineDash:i,lineDashOffset:s}=t;if(i?.some(n=>n!==0)){const n=i.length%2===1?[...i,...i]:i;e.setAttribute("stroke-dasharray",n.join(" ")),s!=null&&e.setAttribute("stroke-dashoffset",String(s))}}var Lt=class extends an{constructor(){super(...arguments),this.fillOpacity=1,this.strokeOpacity=1,this.fill="black",this.strokeWidth=0,this.lineDashOffset=0,this.opacity=1}getGradient(e){if(hs(e))return this.createGradient(e)}createGradient(e){const{colorSpace:t="rgb",gradient:i="linear",colorStops:s,rotation:n=0,reverse:r=!1}=e;if(s==null)return;let o=cy(s,["black"],[0,1]);switch(r&&(o=o.map(a=>({color:a.color,stop:1-a.stop})).reverse()),i){case"linear":return new ay(t,o,n);case"radial":return new PI(t,o);case"conic":return new oy(t,o,n)}}getPattern(e){if(Fn(e))return this.createPattern(e)}createPattern(e){return new YI(e)}getImage(e){if(Ar(e))return this.createImage(e)}createImage(e){return new FI(this.imageLoader,e)}onFillChange(){typeof this.fill=="object"&&Nt(this._cachedFill??{},this.fill)||(this.fillGradient=this.getGradient(this.fill),this.fillPattern=this.getPattern(this.fill),this.fillImage=this.getImage(this.fill),this._cachedFill=this.fill)}onStrokeChange(){this.strokeGradient=this.getGradient(this.stroke)}align(e,t){return Vt(this.layerManager?.canvas?.pixelRatio??1,e,t)}markDirty(e){super.markDirty(e),this.cachedDefaultGradientFillBBox=void 0}fillStroke(e,t){this.renderFill(e,t),this.renderStroke(e,t)}renderFill(e,t){const{fill:i,fillOpacity:s,fillImage:n}=this;if(i!=null&&i!=="none"&&s>0){const{globalAlpha:r}=e;n&&(e.globalAlpha=n.backgroundFillOpacity,e.fillStyle=n.backgroundFill,this.executeFill(e,t),e.globalAlpha=r),this.applyFillAndAlpha(e),this.applyShadow(e),this.executeFill(e,t),e.globalAlpha=r,e.shadowColor="rgba(0, 0, 0, 0)"}}executeFill(e,t){t?e.fill(t):e.fill()}applyFillAndAlpha(e){const{fill:t,fillGradient:i,fillPattern:s,fillImage:n,fillOpacity:r=1,opacity:o=1}=this;if(e.globalAlpha*=o*r,i){const{fillBBox:a=this.getDefaultGradientFillBBox()??this.getBBox(),fillParams:l}=this;e.fillStyle=i.createGradient(e,a,l)??"black"}else if(s){const{x:a,y:l}=this.getBBox(),c=this.layerManager?.canvas?.pixelRatio??1,h=s.createPattern(e,c);s.setPatternTransform(h,c,a,l),h?e.fillStyle=h:(e.fillStyle=s.fill,e.globalAlpha*=s.fillOpacity)}else if(n){const a=this.getBBox(),l=n.createPattern(e,a.width,a.height,this);n.setImageTransform(l,a),e.fillStyle=l??"transparent"}else e.fillStyle=typeof t=="string"?t:"black"}applyStrokeAndAlpha(e){const{stroke:t,strokeOpacity:i=1,strokeGradient:s,opacity:n=1}=this;e.strokeStyle=s?.createGradient(e,this.getBBox())??(typeof t=="string"?t:void 0)??"black",e.globalAlpha*=n*i}applyShadow(e){const t=this.layerManager?.canvas.pixelRatio??1,i=this.fillShadow;i?.enabled&&(e.shadowColor=i.color,e.shadowOffsetX=i.xOffset*t,e.shadowOffsetY=i.yOffset*t,e.shadowBlur=i.blur*t)}renderStroke(e,t){const{stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:r,lineDashOffset:o,lineCap:a,lineJoin:l,miterLimit:c}=this;if(i!=null&&i!=="none"&&s>0&&n>0){const{globalAlpha:h}=e;this.applyStrokeAndAlpha(e),e.lineWidth=s,r&&e.setLineDash(r),o&&(e.lineDashOffset=o),a&&(e.lineCap=a),l&&(e.lineJoin=l),c!=null&&(e.miterLimit=c),this.executeStroke(e,t),e.globalAlpha=h}}executeStroke(e,t){t?e.stroke(t):e.stroke()}getDefaultGradientFillBBox(){return this.cachedDefaultGradientFillBBox??(this.cachedDefaultGradientFillBBox=Object.freeze(this.computeDefaultGradientFillBBox())),this.cachedDefaultGradientFillBBox}computeDefaultGradientFillBBox(){}containsPoint(e,t){return this.isPointInPath(e,t)}applySvgFillAttributes(e,t){const{fill:i,fillOpacity:s}=this;if(typeof i=="string")e.setAttribute("fill",i);else if(hs(i)&&this.fillGradient){t??(t=[]);const n=this.fillGradient.toSvg(this.fillBBox??this.getBBox()),r=Dd();n.setAttribute("id",r),t.push(n),e.setAttribute("fill",`url(#${r})`)}else if(Fn(i)&&this.fillPattern){t??(t=[]);const n=this.fillPattern.toSvg(),r=Dd();n.setAttribute("id",r),t.push(n),e.setAttribute("fill",`url(#${r})`)}else if(Ar(i)&&this.fillImage){t??(t=[]);const n=this.layerManager?.canvas?.pixelRatio??1,r=this.fillImage.toSvg(this.getBBox(),n),o=Dd();r.setAttribute("id",o),t.push(r),e.setAttribute("fill",`url(#${o})`)}else e.setAttribute("fill","none");return e.setAttribute("fill-opacity",String(s)),t}applySvgStrokeAttributes(e){const{stroke:t,strokeOpacity:i,strokeWidth:s,lineDash:n,lineDashOffset:r}=this;XI(e,{stroke:Bt(t)?t:void 0,strokeOpacity:i,strokeWidth:s}),qI(e,{lineDash:n,lineDashOffset:r})}};f([F()],Lt.prototype,"fillOpacity",2),f([F()],Lt.prototype,"strokeOpacity",2),f([Ei({equals:Nt,changeCb:e=>e.onFillChange()})],Lt.prototype,"fill",2),f([Ei({equals:Nt,changeCb:e=>e.onStrokeChange()})],Lt.prototype,"stroke",2),f([F()],Lt.prototype,"strokeWidth",2),f([Pd()],Lt.prototype,"lineDash",2),f([F()],Lt.prototype,"lineDashOffset",2),f([F()],Lt.prototype,"lineCap",2),f([F()],Lt.prototype,"lineJoin",2),f([F()],Lt.prototype,"miterLimit",2),f([F({convertor:e=>se(0,e??1,1)})],Lt.prototype,"opacity",2),f([Ei({equals:vo,checkDirtyOnAssignment:!0})],Lt.prototype,"fillShadow",2),f([Ei({equals:vd,changeCb:e=>e.onFillChange()})],Lt.prototype,"fillBBox",2),f([Ei({equals:Nt,changeCb:e=>e.onFillChange()})],Lt.prototype,"fillParams",2);var vy=[1,0,0,1,0,0],cn=class td{get e(){return[...this.elements]}constructor(t=vy){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 _i(t[0],1)&&_i(t[1],0)&&_i(t[2],0)&&_i(t[3],1)&&_i(t[4],0)&&_i(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 td?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 td(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 td([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),g=Math.sin(d);let m,b;d===0?(m=0,b=0):(m=a?.rotationCenterX??0,b=a?.rotationCenterY??0);const y=r,v=o,M=h*(1-l)-m,S=u*(1-c)-b;return t.setElements([p*l,g*l,-g*c,p*c,p*M-g*S+m+y,g*M+p*S+b+v]),t}};function jn(e){return Sy(e.constructor)}var My=Symbol("isMatrixTransform");function Sy(e){return e[My]===!0}function Hd(e){var t,i;const s=e;if(Sy(e))return e;const n=Symbol("matrix_combined_transform");class r extends s{constructor(){super(...arguments),this[i]=new cn,this._dirtyTransform=!0}onChangeDetection(a){super.onChangeDetection(a),this._dirtyTransform=!0,!(this.batchLevel>0)&&this.markDirty("transform")}updateMatrix(a){}computeTransformMatrix(){this._dirtyTransform&&(this[n].setElements(vy),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;try{c.identity||(l.save(),h=!0,c.toContext(l)),super.render(a)}finally{h&&l.restore()}}toSVG(){this.computeTransformMatrix();const a=super.toSVG(),l=this[n];if(l.identity||a==null)return a;const c=Mt("g");c.append(...a.elements);const[h,u,d,p,g,m]=l.e;return c.setAttribute("transform",`matrix(${h} ${u} ${d} ${p} ${g} ${m})`),{elements:[c],defs:a.defs}}}return t=My,i=n,r[t]=!0,r}function Io(e){var t;const i=e,s=Symbol("matrix_rotation");class n extends Hd(i){constructor(){super(...arguments),this[t]=new cn,this.rotationCenterX=0,this.rotationCenterY=0,this.rotation=0}updateMatrix(o){super.updateMatrix(o);const{rotation:a,rotationCenterX:l,rotationCenterY:c}=this;a!==0&&(cn.updateTransformMatrix(this[s],1,1,a,0,0,{rotationCenterX:l,rotationCenterY:c}),o.multiplySelf(this[s]))}}return t=s,f([F()],n.prototype,"rotationCenterX",2),f([F()],n.prototype,"rotationCenterY",2),f([F()],n.prototype,"rotation",2),n}function Ud(e){var t;const i=e,s=Symbol("matrix_scale");class n extends Hd(i){constructor(){super(...arguments),this[t]=new cn,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||(cn.updateTransformMatrix(this[s],a,l,0,0,0,{scalingCenterX:c,scalingCenterY:h}),o.multiplySelf(this[s]))}}return t=s,f([F()],n.prototype,"scalingX",2),f([F()],n.prototype,"scalingY",2),f([F()],n.prototype,"scalingCenterX",2),f([F()],n.prototype,"scalingCenterY",2),n}function Ao(e){var t;const i=e,s=Symbol("matrix_translation");class n extends Hd(i){constructor(){super(...arguments),this[t]=new cn,this.translationX=0,this.translationY=0}updateMatrix(o){super.updateMatrix(o);const{translationX:a,translationY:l}=this;a===0&&l===0||(cn.updateTransformMatrix(this[s],1,1,0,a,l),o.multiplySelf(this[s]))}}return t=s,f([F()],n.prototype,"translationX",2),f([F()],n.prototype,"translationY",2),n}var dt=class{static fromCanvas(e,t){const i=[];for(const s of e.traverseUp())jn(s)&&i.unshift(s);for(const s of i)t=s.fromParent(t);return jn(e)&&(t=e.fromParent(t)),t}static toCanvas(e,t){t==null?t=e.getBBox():jn(e)&&(t=e.toParent(t));for(const i of e.traverseUp())jn(i)&&(t=i.toParent(t));return t}static fromCanvasPoint(e,t,i){const s=[];for(const n of e.traverseUp())jn(n)&&s.unshift(n);for(const n of s)({x:t,y:i}=n.fromParentPoint(t,i));return jn(e)&&({x:t,y:i}=e.fromParentPoint(t,i)),{x:t,y:i}}static toCanvasPoint(e,t,i){jn(e)&&({x:t,y:i}=e.toParentPoint(t,i));for(const s of e.traverseUp())jn(s)&&({x:t,y:i}=s.toParentPoint(t,i));return{x:t,y:i}}},Ya,$d=class Dc extends an{constructor(t){super(t),this.childNodes=new Set,this.dirty=!1,this.dirtyZIndex=!1,this.clipRect=void 0,this.opacity=1,this.renderToOffscreenCanvas=!1,this.optimizeForInfrequentRedraws=!1,this.layer=void 0,this.image=void 0,this._lastWidth=NaN,this._lastHeight=NaN,this._lastDevicePixelRatio=NaN,this.isContainerNode=!0,this.renderToOffscreenCanvas=t?.renderToOffscreenCanvas===!0}static is(t){return t instanceof Dc}static computeChildrenBBox(t,i=!0){return U.merge(an.extractBBoxes(t,i))}static compareChildren(t,i){return Jm(t.zIndex,i.zIndex)||t.serialNumber-i.serialNumber}containsPoint(t,i){return!0}computeBBox(){return Dc.computeChildrenBBox(this.children())}computeSafeClippingBBox(t){const i=this.computeBBox();if(i?.isFinite()!==!0)return;let s=0;const n=4;for(const d of this.descendants())d instanceof Lt&&(s=Math.max(s,d.strokeWidth));const r=Math.max(1,s/2*n),{x:o,y:a}=dt.toCanvasPoint(this,0,0),l=yy(t,o+i.x-r)-o,c=yy(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 Ya==null||Ya.pixelRatio!==s?Ya=new Ad({width:t,height:i,pixelRatio:s}):Ya.resize(t,i,s),Ya}setScene(t){super.setScene(t),this.layer&&(this.scene?.layersManager.removeLayer(this.layer),this.layer=void 0);for(const i of this.children())i.setScene(t)}markDirty(t){this.dirty=!0,super.markDirty(t)}markDirtyChildrenOrder(){super.markDirtyChildrenOrder(),this.dirtyZIndex=!0,this.markDirty()}append(t){for(const i of WD(t))i.parentNode?.removeChild(i),this.childNodes.add(i),i.parentNode=this,i.setScene(this.scene);this.markDirtyChildrenOrder(),this.markDirty()}appendChild(t){return this.append(t),t}removeChild(t){if(!this.childNodes?.delete(t))throw new Error(`AG Charts - internal error, unknown child node ${t.name??t.id} in $${this.name??this.id}`);t.parentNode=void 0,t.setScene(),this.markDirtyChildrenOrder(),this.markDirty()}clear(){for(const t of this.children())delete t.parentNode,t.setScene();this.childNodes?.clear(),this.markDirty()}pickNode(t,i){if(!(!this.visible||this.pointerEvents===1||!this.containsPoint(t,i))){if(this.childNodes!=null&&this.childNodes.size!==0){const s=[...this.children()];for(let n=s.length-1;n>=0;n--){const o=s[n].pickNode(t,i);if(o!=null)return o}}else if(!this.isContainerNode)return this}}pickNodes(t,i,s=[]){if(!this.visible||this.pointerEvents===1||!this.containsPoint(t,i))return s;this.isContainerNode||s.push(this);for(const n of this.children())n.pickNodes(t,i,s);return s}isDirty(t){const{width:i,height:s,devicePixelRatio:n}=t,{dirty:r,layer:o}=this,a=o!=null&&(this._lastWidth!==i||this._lastHeight!==s),l=this._lastDevicePixelRatio!==n;return this._lastWidth=i,this._lastHeight=s,this._lastDevicePixelRatio=n,r||a||l}preRender(t){let i;if(this.dirty){i=super.preRender(t,0);for(const s of this.children()){const n=s.preRender(t);i.groups+=n.groups,i.nonGroups+=n.nonGroups,i.complexity+=n.complexity}i.groups+=1,i.nonGroups-=1}else i=this.childNodeCounts;return this.renderToOffscreenCanvas&&!this.optimizeForInfrequentRedraws&&i.nonGroups>0&&this.getVisibility()?this.layer??(this.layer=this.layerManager?.addLayer({name:this.name})):this.layer!=null&&(this.layerManager?.removeLayer(this.layer),this.layer=void 0),i}render(t){const{layer:i,renderToOffscreenCanvas:s}=this,n={...t},r=this.isDirty(t);if(this.dirty=!1,!s){this.renderInContext(n),super.render(n);return}const{ctx:o,stats:a,devicePixelRatio:l}=t;let{image:c}=this;if(r){c?.bitmap.close(),c=void 0;const u=i?void 0:this.computeSafeClippingBBox(l),d=(p,...g)=>{const m=p.context;n.ctx=m,p.clear(),m.save();try{m.setTransform(...g),m.globalAlpha=1,this.renderInContext(n)}finally{m.restore(),m.verifyDepthZero?.()}};if(i)d(i,o.getTransform());else if(u){const{x:p,y:g,width:m,height:b}=u,y=this.prepareSharedCanvas(m,b,l);d(y,l,0,0,l,-p*l,-g*l),c={bitmap:y.transferToImageBitmap(),x:p,y:g,width:m,height:b}}this.image=c,a&&a.layersRendered++}else a&&a.layersSkipped++;const{globalAlpha:h}=o;if(o.globalAlpha=h*this.opacity,i){o.save();try{o.resetTransform(),i.drawImage(o)}finally{o.restore()}}else if(c){const{bitmap:u,x:d,y:p,width:g,height:m}=c;o.drawImage(u,0,0,g*l,m*l,d,p,g,m)}o.globalAlpha=h,super.render(n)}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(Dc.compareChildren),this.dirtyZIndex=!1),i.save();try{i.globalAlpha*=this.opacity,this.clipRect!=null&&(this.applyClip(i,this.clipRect),t.clipBBox=dt.toCanvas(this,this.clipRect));for(const n of this.children()){if(!n.visible){s&&(s.nodesSkipped+=n.childNodeCounts.nonGroups+n.childNodeCounts.groups,s.opsSkipped+=n.childNodeCounts.complexity);continue}n.isolatedRender(t)}}finally{i.restore()}}sortChildren(t){if(!this.childNodes)return;const i=[...this.childNodes].sort(t);this.childNodes.clear();for(const s of i)this.childNodes.add(s)}*children(){yield*this.childNodes}*excludeChildren(t){for(const i of this.children())(t.instance&&!(i instanceof t.instance)||t.name&&i.name!==t.name)&&(yield i)}*descendants(){for(const t of this.children())yield t,t instanceof Dc&&(yield*t.descendants())}setClipRect(t){this.clipRect=t?dt.fromCanvas(this,t):void 0}setClipRectCanvasSpace(t){this.clipRect=t}getVisibility(){for(const t of this.traverseUp(!0))if(!t.visible)return!1;return!0}toSVG(){if(!this.visible)return;const t=[],i=[];for(const s of this.children()){const n=s.toSVG();n!=null&&(i.push(...n.elements),n.defs!=null&&t.push(...n.defs))}return{elements:i,defs:t}}};$d.className="Group",f([F({convertor:e=>se(0,e,1)})],$d.prototype,"opacity",2);var ge=$d,QI=class extends Ud(ge){},JI=class extends Io(ge){},hi=class extends Ao(ge){},Co=class extends Io(Ao(ge)){};function eA(e,t){return"context"in e}function Dy(e,t){return e!=null&&eA(e,t)&&t[0]!=null&&typeof t[0]=="object"&&t[0].context===void 0?(t[0].context=e.context,!0):!1}function us(e,t,...i){if(Array.isArray(e)){for(const s of e)if(Dy(s,i))break}else Dy(e,i);return t(...i)}var Iy=class{constructor(){this.cache=new WeakMap}call(e,t,...i){let s,n=this.cache.get(t);try{s=JSON.stringify(i)}catch{return this.invoke(e,t,n,void 0,...i)}return n==null&&(n=new Map,this.cache.set(t,n)),n.has(s)?n.get(s):this.invoke(e,t,n,s,...i)}invoke(e,t,i,s,...n){try{const r=us(e,t,...n);return i&&s!=null&&i.set(s,r),r}catch(r){j.warnOnce("User callback errored, ignoring",r);return}}invalidateCache(){this.cache=new WeakMap}};function Jc(e,t){if(!e)return;const{x:i,y:s,width:n,height:r}=iA(t);th(e.style,"width",n),th(e.style,"height",r),th(e.style,"left",i),th(e.style,"top",s)}function Ay(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 tA(e){if(e.focus({preventScroll:!0}),e.lastChild?.textContent==null)return;const t=ws().createRange();t.setStart(e.lastChild,e.lastChild.textContent.length),t.setEnd(e.lastChild,e.lastChild.textContent.length);const i=Fe().getSelection();i?.removeAllRanges(),i?.addRange(t)}function Cy(){const e=Fe("navigator");if("scheduling"in e){const t=e.scheduling;if("isInputPending"in t)return t.isInputPending({includeContinuous:!0})}return!1}function eh(e){return`ag-charts-icon ag-charts-icon-${e}`}function iA(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})}function th(e,t,i){i==null?e.removeProperty(t):e.setProperty(t,`${i}px`)}var Wd="class-instance";function hn(e,t,i){if(Ae(t)){if(!Ae(e)||e.length!==t.length||t.some((s,n)=>hn(e[n],s,i)!=null))return t}else if(Ne(t)){if(!Ne(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=hn(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 Ly(e,t){for(const i of Object.keys(e))if(e[i]!==t?.[i])return!1;return!0}function lt(e,t){return Ae(e)?sA(e,t):Ne(e)?nA(e,t):e instanceof Map?new Map(lt(Array.from(e))):Yd(e)}function sA(e,t){const i=[],s=t?.seen;for(const n of e){if(typeof n=="object"&&s?.includes(n)){j.warn("cycle detected in array",n);continue}s?.push(n),i.push(lt(n,t)),s?.pop()}return i}function nA(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]=Yd(e[s]):i[s]=lt(e[s],t);return i}function Yd(e){return Ae(e)?e.slice(0):Ne(e)?{...e}:go(e)?new Date(e):ID(e)?new RegExp(e.source,e.flags):e}function Bn(e,t,i,s,n,r){if(Ae(e)){r=t(e,s,n,r);let o=0;for(const a of e)r=Bn(a,t,i,s?.[o],n,r),o++}else if(Ne(e)){r=t(e,s,n,r);for(const o of Object.keys(e)){if(i?.has(o))continue;const a=e[o];r=Bn(a,t,i,s?.[o],n,r)}}return r}function Ka(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(Ir(e))return e.set(t);const o=e,a=Kd(e);for(const l of Object.keys(t)){if(Nd.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 g=Kd(p),m=Kd(h);if(a===Wd&&!(l in e||l==="context")){if(h===void 0)continue;j.warn(`unable to set [${u}] in ${d?.name} - property is unknown`);continue}if(g!=null&&m!=null&&m!==g&&(g!==Wd||m!=="object")){j.warn(`unable to set [${u}] in ${d?.name} - can't apply type of [${m}], allowed types are: [${g}]`);continue}if(Ir(p))h===void 0?p.clear():p.set(h);else if(m==="object"&&l!=="context"){if(!(l in o)){j.warn(`unable to set [${u}] in ${d?.name} - property is unknown`);continue}p==null?o[l]=h:Ka(p,h,{...i,path:u,matcherPath:c})}else o[l]=h}catch(g){j.warn(`unable to set [${u}] in [${d?.name}]; nested error is: ${g.message}`)}}return e}function Kd(e){return e==null?null:AD(e)||go(e)?"primitive":Ae(e)?"array":ot(e)?Ne(e)?"object":Wd:nn(e)?"function":"primitive"}var rA=class{constructor(){this.available=!0,this.acquireQueue=[]}acquire(e){return new Promise(t=>{this.acquireQueue.push([e,t]),this.available&&this.dispatchNext().catch(i=>j.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){j.error("mutex callback error",i),t?.()}[e,t]=this.acquireQueue.shift()??[]}this.available=!0}},Ty=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))}},Cr=class extends re{constructor(e=0,t=e,i=e,s=t){super(),this.top=e,this.right=t,this.bottom=i,this.left=s}};f([x],Cr.prototype,"top",2),f([x],Cr.prototype,"right",2),f([x],Cr.prototype,"bottom",2),f([x],Cr.prototype,"left",2);function Gt(e,t){const i=Ae(e)?e:e.split(".");if(i.length===1){const[s]=i;return Mr((n,r,o)=>n[s]=o,n=>n[s],t)}return Mr((s,n,r)=>Ed(s,i,r),s=>wd(s,i),t)}function oA(e){return Mr((t,i,s)=>t[e]=s)}function Dt(e,t){return Mr((i,s,n)=>i[e][t??s]=n)}function ui(e){const{newValue:t,oldValue:i,changeValue:s}=e;return Mr((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 Vn(e){return Wm(e)}function aA(e){return ky((t,i)=>Fe().requestAnimationFrame(t),e)}function lA(e){return ky((t,i=0)=>{i===0?queueMicrotask(t):setTimeout(t,i)},e)}function ky(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??(n=new Promise(c=>{r=c}));o();)await n}}}var Zd=["blur","change","contextmenu","focus","keydown","keyup","click","dblclick","mouseenter","mousemove","mouseleave","wheel","touchstart","touchmove","touchend","touchcancel"];function Lo(e,t,i){const{offsetX:s,offsetY:n,clientX:r,clientY:o}=t,{currentX:a,currentY:l}=un.calcCurrentXY(i,t);return{type:e,device:"mouse",offsetX:s,offsetY:n,clientX:r,clientY:o,currentX:a,currentY:l,sourceEvent:t}}function ih(e,t,i){return{type:e,sourceEvent:t}}var cA={blur:e=>({type:"blur",sourceEvent:e}),change:e=>({type:"change",sourceEvent:e}),contextmenu:(e,t)=>Lo("contextmenu",e,t),focus:e=>({type:"focus",sourceEvent:e}),keydown:e=>({type:"keydown",sourceEvent:e}),keyup:e=>({type:"keyup",sourceEvent:e}),click:(e,t)=>Lo("click",e,t),dblclick:(e,t)=>Lo("dblclick",e,t),mouseenter:(e,t)=>Lo("mouseenter",e,t),mousemove:(e,t)=>Lo("mousemove",e,t),mouseleave:(e,t)=>Lo("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)=>ih("touchstart",e,t),touchmove:(e,t)=>ih("touchmove",e,t),touchend:(e,t)=>ih("touchend",e,t),touchcancel:(e,t)=>ih("touchcancel",e,t)},un=class{static alloc(e,t,i){return cA[e](t,i)}static isHTMLEvent(e){return Zd.includes(e)}static calcCurrentXY(e,t){const i=e.getBoundingClientRect();return{currentX:t.clientX-i.x,currentY:t.clientY-i.y}}},hA=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=un.alloc(e,r,t.getElement());this.dispatch(e,t,o)},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){if(this.widgetListeners=void 0,this.sourceListeners){for(const[t,i]of ls(this.sourceListeners))e.getElement().removeEventListener(t,i);this.sourceListeners=void 0}}dispatch(e,t,i){for(const s of this.widgetListeners?.[e]??[])s(i,t)}},uA=class{constructor(e,t,i,s){this.glob=e,this.self=t,this.window=Fe(),this.cleanup=new at,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;this.cleanup.register(Ge(n,"mousedown",r,{capture:!0}),Ge(n,"mouseenter",r,{capture:!0}),Ge(n,"mouseleave",r,{capture:!0}),Ge(n,"mouseout",r,{capture:!0}),Ge(n,"mouseover",r,{capture:!0}),Ge(n,"mousemove",o,{capture:!0}),Ge(n,"mouseup",a,{capture:!0})),t.mouseDragger=this,e.globalMouseDragCallbacks=i,e.globalMouseDragCallbacks.mousedown(s),s.stopPropagation(),s.stopImmediatePropagation()}destroy(){this.cleanup.flush(),this.glob.globalMouseDragCallbacks=void 0,this.self.mouseDragger=void 0}};function dA(e,t,i,s){if(e.globalMouseDragCallbacks==null)return new uA(e,t,i,s)}var pA=500,gA=100;function fA(e,t){const i=e.clientX-t.clientX,s=e.clientY-t.clientY;return i*i+s*s}var Xd=!1,mA=class{constructor(e,t,i,s,n){this.glob=e,this.self=t,this.initialTouch=s,this.target=n,this.cleanup=new at,this.longTapInterrupted=!1,this.longtap=()=>{const{target:a,initialTouch:l}=this;if(!this.longTapInterrupted){const c=new at;a.dispatchEvent(new TouchEvent("touchcancel",{touches:[l],bubbles:!0})),Xd=!0;const h=m=>m.preventDefault(),u=m=>{Xd=!1,m.preventDefault(),c.flush()};c.register(Ge(a,"touchmove",h,{passive:!1}),Ge(a,"touchend",u,{passive:!1}),Ge(a,"touchcancel",u,{passive:!1}));const{clientX:d,clientY:p}=l,g=new PointerEvent("contextmenu",{bubbles:!0,cancelable:!0,view:Fe(),clientX:d,clientY:p,pointerType:"touch"});a.dispatchEvent(g)}},this.touchmove=a=>{const{glob:l,self:c,initialTouch:h}=this,u=this.findInitialFinger(a.targetTouches);u!=null&&(this.longTapInterrupted=this.longTapInterrupted||fA(h,u)>gA,c.dragTouchEnabled&&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,pA);const{touchmove:r,touchend:o}=this;this.cleanup.register(Ge(n,"touchmove",r,{passive:!1}),Ge(n,"touchstart",o,{passive:!1}),Ge(n,"touchend",o,{passive:!1}),Ge(n,"touchcancel",o,{passive:!1})),t.touchDragger=this,e.globalTouchDragCallbacks=i}destroy(){clearTimeout(this.longtapTimer),this.cleanup.flush(),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 yA(e,t,i,s,n){if(!(e.globalTouchDragCallbacks!=null||Xd))return new mA(e,t,i,s,n)}function qd(e,t,i,s){const{currentX:n,currentY:r}=un.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 bA(e,{pageX:t,pageY:i}){const{x:s,y:n}=e.getElement().getBoundingClientRect();return{offsetX:t-s,offsetY:i-n}}function Qd(e,t,i,s,n){const{currentX:r,currentY:o}=un.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 wy={},Ny=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=e.getElement(),i=new at;i.register(Ge(t,"mousedown",s=>this.triggerMouseDrag(e,s)),Ge(t,"touchstart",s=>this.triggerTouchDrag(e,s),{passive:!1})),this.dragTriggerRemover=()=>i.flush()}}triggerMouseDrag(e,t){t.button===0&&this.startMouseDrag(e,t)}startMouseDrag(e,t){const i={pageX:NaN,pageY:NaN,offsetX:NaN,offsetY:NaN};Od(["pageX","pageY","offsetX","offsetY"],i,t);const s={mousedown:n=>{const r=qd(e,"drag-start",i,n);this.dispatch("drag-start",e,r)},mousemove:n=>{const r=qd(e,"drag-move",i,n);this.dispatch("drag-move",e,r)},mouseup:n=>{const r=qd(e,"drag-end",i,n);this.dispatch("drag-end",e,r),this.endDrag(e,r)}};this.mouseDragger=dA(wy,this,s,t)}endDrag(e,{sourceEvent:t,clientX:i,clientY:s}){const n=e.getElement(),r=n.getBoundingClientRect();xd(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,...bA(e,i)};Od(["pageX","pageY"],s,i);const n={touchmove:(a,l)=>{const c=Qd(e,"drag-move",s,a,l);this.dispatch("drag-move",e,c)},touchend:(a,l)=>{const c=Qd(e,"drag-end",s,a,l);this.dispatch("drag-end",e,c)}},r=e.getElement();this.touchDragger=yA(wy,this,n,i,r);const o=Qd(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)}},xA=class{constructor(e){this.elem=e}setBounds(e){Jc(this.elemContainer??this.elem,e)}getBounds(){return Ay(this.elemContainer??this.elem)}static setElementContainer(e,t){const i=e.getBounds();Jc(t,i),ZD(e.elem,{width:"100%",height:"100%"}),e.elem.remove(),e.elemContainer=t,e.elemContainer.replaceChildren(e.elem)}},Bs=class extends xA{constructor(){super(...arguments),this.index=NaN,this.children=[]}set id(e){Ce(this.elem,"id",e)}get id(){return bo(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.destroyListener?.(),this.destroyListener=void 0,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){zs(this.elem,"display",e?"none":void 0)}isHidden(){return Fe()?.getComputedStyle?.(this.elem).display==="none"}setCursor(e){zs(this.elem,"cursor",e)}setTextContent(e){this.elem.textContent=e??null}setAriaDescribedBy(e){Ce(this.elem,"aria-describedby",e)}setAriaHidden(e){Ce(this.elem,"aria-hidden",e)}setAriaLabel(e){Ce(this.elem,"aria-label",e)}setAriaExpanded(e){Ce(this.elem,"aria-expanded",e)}setAriaControls(e){Ce(this.elem,"aria-controls",e)}setAriaHasPopup(e){Ce(this.elem,"aria-haspopup",e)}setInnerHTML(e){this.elem.innerHTML=e}setPointerEvents(e){zs(this.elem,"pointer-events",e)}isDisabled(){return bo(this.elem,"aria-disabled",!1)}hasPopup(){const e=bo(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){Ce(this.elem,"data-focus-override",e)}setPreventsDefault(e){Ce(this.elem,"data-preventdefault",e)}setTabIndex(e){Ce(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 un.isHTMLEvent(e)?(this.htmlListener??(this.htmlListener=new hA),this.htmlListener.add(e,this,t)):(this.internalListener??(this.internalListener=new Ny(this.onDispatch.bind(this))),this.internalListener.add(e,this,t)),()=>this.removeListener(e,t)}removeListener(e,t){un.isHTMLEvent(e)?this.htmlListener?.remove(e,this,t):this.htmlListener!=null&&this.internalListener?.remove(e,this,t)}setDragTouchEnabled(e){this.internalListener??(this.internalListener=new Ny(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,...un.calcCurrentXY(i.getElement(),t)};s.dispatch(e,i,n)}i=i.parent}}static addWindowEvent(e,t){const i=s=>{s.persisted||t()};return Ge(Fe(),"pagehide",i)}};function vA(e=0,t=0){return new OffscreenCanvas(e,t).getContext("2d")}var Jd=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()}},Gn=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=He.toFontString(e.font),i=`${t}-${e.textAlign??"start"}-${e.textBaseline??"top"}`;return this.instanceMap.get(i)??this.createFontMeasurer(t,e,i)}static clear(){this.instanceMap.clear()}static createFontMeasurer(e,t,i){const s=vA();s.font=e,s.textAlign=t.textAlign??"start",s.textBaseline=t.textBaseline??"top";const n=new Ey(s,t);return this.instanceMap.set(i,n),n}};Gn.instanceMap=new Jd(10);var Ey=class{constructor(e,t){this.ctx=e,this.measureMap=new Jd(100),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline),e.font=He.toFontString(t.font),this.textMeasurer=new ep(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)}},He=class{static toFontString({fontSize:e=10,fontStyle:t,fontWeight:i,fontFamily:s}){let n="";return t&&t!=="normal"&&(n+=`${t} `),i&&i!=="normal"&&i!==400&&(n+=`${i} `),n+=`${e}px`,n+=` ${s}`,n.trim()}static getLineHeight(e){return Math.ceil(e*this.defaultLineHeight)}static getHorizontalModifier(e){switch(e){case"left":case"start":return 0;case"center":return .5;case"right":case"end":return 1;default:return 0}}static getVerticalModifier(e){switch(e){case"hanging":case"top":return 0;case"middle":return .5;case"alphabetic":case"bottom":case"ideographic":default:return 1}}};He.EllipsisChar="\u2026",He.defaultLineHeight=1.15,He.lineSplitter=/\r?\n/g;var ep=class{constructor(e,t="alphabetic"){this.measureTextFn=e,this.textBaseline=t,this.charMap=new Map}getMetrics(e){const t=this.measureTextFn(e);return t.fontBoundingBoxAscent??(t.fontBoundingBoxAscent=t.emHeightAscent),t.fontBoundingBoxDescent??(t.fontBoundingBoxDescent=t.emHeightDescent),{width:t.width,height:t.actualBoundingBoxAscent+t.actualBoundingBoxDescent,lineHeight:t.fontBoundingBoxAscent+t.fontBoundingBoxDescent}}getMultilineMetrics(e){let t=0,i=0,s=0,n=0,r=0,o=0;const a=He.getVerticalModifier(this.textBaseline),l=[];let c=0;const h=e.length;for(const u of e){const d=this.measureTextFn(u);d.fontBoundingBoxAscent??(d.fontBoundingBoxAscent=d.emHeightAscent),d.fontBoundingBoxDescent??(d.fontBoundingBoxDescent=d.emHeightDescent),t<d.width&&(t=d.width),n<d.actualBoundingBoxLeft&&(n=d.actualBoundingBoxLeft),c===0?(i+=d.actualBoundingBoxAscent,s+=d.actualBoundingBoxAscent,o=d.alphabeticBaseline):r+=d.fontBoundingBoxAscent,c===h-1?i+=d.actualBoundingBoxDescent:r+=d.fontBoundingBoxDescent,l.push({text:u,width:d.width,height:d.actualBoundingBoxAscent+d.actualBoundingBoxDescent,lineHeight:d.fontBoundingBoxAscent+d.fontBoundingBoxDescent,offsetTop:d.actualBoundingBoxAscent,offsetLeft:d.actualBoundingBoxLeft}),c++}return i+=r,s+=r*a,{width:t,height:i,offsetTop:s,offsetLeft:n,alphabeticBaseline:o,lineMetrics:l}}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(He.lineSplitter):e;return this.getMultilineMetrics(t)}charWidth(e){const{width:t}=this.measureTextFn(e);return this.charMap.set(e,t),t}};function MA(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 SA(){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(MA(n));return`Heap ${s.join(" / ")}`}function Oy(e,t,i,s,n={},r=U.zero){if(!be.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,...g}=t,m=Object.entries(g).map(([C,w])=>Ry(C,w)).filter(C=>C!=null).join(" + "),b=Object.entries(n).map(([C,w])=>`${C}: ${JSON.stringify(w)}`).join(" ; "),y=be.check("scene:stats:verbose"),v=SA(),M=[`${Ry("\u23F1\uFE0F",p,d)} (${m})`,`${b}`,`Layers: ${y?tp(o,a):e.size}`,y?`Nodes: ${tp(l,c)}`:null,y?`Ops: ${tp(h,u)}`:null,y&&v?v:null].filter(Bt),S=new ep(C=>i.measureText(C)),D=new Map(M.map(C=>[C,S.measureLines(C)])),A=Math.max(...Array.from(D.values(),C=>C.width)),I=TA(D.values(),C=>C.height),L=2+r.x;i.save();try{i.fillStyle="white",i.fillRect(L,0,A,I),i.fillStyle="black";let C=0;for(const[w,E]of D.entries())C+=E.height,i.fillText(w,L,C)}catch(C){j.warnOnce("Error during debug stats rendering",C)}finally{i.restore()}}function DA(e){const t=Fc(Fe("agChartsSceneDebug")),i=[];for(const s of t)s==="layout"?i.push("seriesRoot","legend","root",/.*Axis-\d+-axis.*/):i.push(s);e.debugNodeSearch=i}function IA(e,t){e.save();try{for(const[i,s]of Object.entries(t)){const n=dt.toCanvas(s);if(!n){j.log(`Scene.render() - no bbox for debugged node [${i}].`);continue}e.globalAlpha=.8,e.strokeStyle="red",e.lineWidth=1,e.strokeRect(n.x,n.y,n.width,n.height),e.fillStyle="red",e.strokeStyle="white",e.font="16px sans-serif",e.textBaseline="top",e.textAlign="left",e.lineWidth=2,e.strokeText(i,n.x,n.y,n.width),e.fillText(i,n.x,n.y,n.width)}}catch(i){j.warnOnce("Error during debug rendering",i)}finally{e.restore()}}var AA=new Set,CA=new Set(["gradient","zIndex","clipRect","cachedBBox","childNodeCounts","path","__zIndex","name","__scalingCenterX","__scalingCenterY","__rotationCenterX","__rotationCenterY","_previousDatum","__fill","__lineDash","borderPath","borderClipPath","_clipPath"]);function LA(e){const{...t}=e;for(const i of Object.keys(t))CA.has(i)||typeof t[i]!="number"&&typeof t[i]!="string"&&typeof t[i]!="boolean"&&(AA.add(i),delete t[i]);return t}function sh(e,t){if(!be.check(!0,"scene"))return{};let i=0;return{node:t==="json"?LA(e):e,name:e.name??e.id,dirty:e instanceof ge?e.dirty:void 0,...Array.from(e instanceof ge?e.children():[],s=>sh(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:g}=n;(!o||a<=0)&&(r=`(${r})`),ge.is(g)&&g.renderToOffscreenCanvas&&(r=`*${r}*`);const m=Array.isArray(l)?`(${l.join(", ")})`:l,b=[`${(i++).toString().padStart(3,"0")}|`,`${r??"<unknown>"}`,`z: ${m}`,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 y=b,v=1;for(;s[y]!=null&&v<100;)y=`${b} (${v++})`;return s[y]=n,s},{})}}function Py(e){const t=e instanceof ge?e.dirty:void 0;if(!t)return{dirtyTree:{},paths:[]};const i=Array.from(e instanceof ge?e.children():[],r=>Py(r)).filter(r=>r.paths.length>0),s=ge.is(e)?e.name??e.id:e.id,n=i.length?i.flatMap(r=>r.paths).map(r=>`${s}.${r}`):[s];return{dirtyTree:{name:s,node:e,dirty:t,...i.map(r=>r.dirtyTree).filter(r=>r.dirty!=null).reduce((r,o)=>(r[o.name??"<unknown>"]=o,r),{})},paths:n}}function tp(e,t){const i=e+t;return`${e} / ${i} (${Math.round(100*e/i)}%)`}function Ry(e,t,i){const s=i!=null?i-t:t;return`${e}: ${Math.round(s*100)/100}ms`}function TA(e,t){let i=0;for(const s of e)i+=t(s);return i}var Za=(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)},di=class extends Lt{constructor(){super(...arguments),this.path=new Do,this._clipX=NaN,this._clipY=NaN,this.clip=!1,this._dirtyPath=!0,this.lastPixelRatio=NaN}set clipX(e){this._clipX=e,this.dirtyPath=!0}set clipY(e){this._clipY=e,this.dirtyPath=!0}set dirtyPath(e){this._dirtyPath!==e&&(this._dirtyPath=e,e&&this.markDirty("path"))}get dirtyPath(){return this._dirtyPath}checkPathDirty(){this._dirtyPath||(this.dirtyPath=this.path.isDirty()||(this.fillShadow?.isDirty()??!1)||(this._clipPath?.isDirty()??!1))}resetPathDirty(){this.path.clear(!0),this._dirtyPath=!1}isPathDirty(){return this.path.isDirty()}onChangeDetection(e){this._dirtyPath||(this._dirtyPath=!0,super.onChangeDetection(e))}computeBBox(){return this.updatePathIfDirty(),this.path.computeBBox()}isPointInPath(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)}distanceSquared(e,t){return this.distanceSquaredTransformedPoint(e,t)}svgPathData(e){return this.updatePathIfDirty(),this.path.toSVG(e)}distanceSquaredTransformedPoint(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)?0:this.path.distanceSquared(e,t)}isDirtyPath(){return!1}updatePath(){}updatePathIfDirty(){(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1)}preRender(e){return e.devicePixelRatio!==this.lastPixelRatio&&(this.dirtyPath=!0),this.lastPixelRatio=e.devicePixelRatio,this.updatePathIfDirty(),super.preRender(e,this.path.commands.length)}render(e){const{ctx:t}=e;if(this.clip&&!isNaN(this._clipX)&&!isNaN(this._clipY)){t.save();try{const i=this.strokeWidth/2;this._clipPath??(this._clipPath=new Do),this._clipPath.clear(),this._clipPath.rect(-i,-i,this._clipX+i,this._clipY+i+i),t.clip(this._clipPath?.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(t)}finally{t.restore()}}else this._clipPath=void 0,this.drawPath(t);this.fillShadow?.markClean(),super.render(e)}drawPath(e){this.fillStroke(e,this.path.getPath2D())}toSVG(){if(!this.visible)return;const e=Mt("path");e.setAttribute("d",this.svgPathData());const t=this.applySvgFillAttributes(e,[]);return this.applySvgStrokeAttributes(e),{elements:[e],defs:t}}};di.className="Path",f([F()],di.prototype,"clip",2),f([F()],di.prototype,"clipX",1),f([F()],di.prototype,"clipY",1);var zy=1e-6,nh=(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<zy&&(a=0),h>t?(o=!0,c=s-Math.sqrt(Math.max(n**2-(i-t)**2)),h=t):h<zy&&(h=0),{leading0:a,leading1:l,trailing0:c,trailing1:h,leadingClipped:r,trailingClipped:o}},rh=(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 I=Math.max(t,o.x),L=Math.min(t+s,o.x+o.width),C=Math.max(i,o.y),w=Math.min(i+n,o.y+o.height);o=new U(I,C,L-I,w-C)}const p=Math.max(u/n,d/s,1);p>1&&(a/=p,l/=p,c/=p,h/=p);let g=!0,m=!0,b=!0,y=!0,v,M,S,D;if(g){const I=nh(o.height,o.width,Math.max(t+a-o.x,0),Math.max(i+a-o.y,0),a);I.leadingClipped&&(y=!1),I.trailingClipped&&(m=!1);const L=Math.max(o.x+I.leading1,o.x),C=Math.max(o.y+I.leading0,o.y),w=Math.max(o.x+I.trailing1,o.x),E=Math.max(o.y+I.trailing0,o.y),R=t+a,P=i+a;v={x0:L,y0:C,x1:w,y1:E,cx:R,cy:P}}if(m){const I=nh(o.width,o.height,Math.max(i+l-o.y,0),Math.max(o.x+o.width-(t+s-l),0),l);I.leadingClipped&&(g=!1),I.trailingClipped&&(b=!1);const L=Math.min(o.x+o.width-I.leading0,o.x+o.width),C=Math.max(o.y+I.leading1,o.y),w=Math.min(o.x+o.width-I.trailing0,o.x+o.width),E=Math.max(o.y+I.trailing1,o.y),R=t+s-l,P=i+l;M={x0:L,y0:C,x1:w,y1:E,cx:R,cy:P}}if(b){const I=nh(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);I.leadingClipped&&(m=!1),I.trailingClipped&&(y=!1);const L=Math.min(o.x+o.width-I.leading1,o.x+o.width),C=Math.min(o.y+o.height-I.leading0,o.y+o.height),w=Math.min(o.x+o.width-I.trailing1,o.x+o.width),E=Math.min(o.y+o.height-I.trailing0,o.y+o.height),R=t+s-c,P=i+n-c;S={x0:L,y0:C,x1:w,y1:E,cx:R,cy:P}}if(y){const I=nh(o.width,o.height,Math.max(o.y+o.height-(i+n-h),0),Math.max(t+h-o.x,0),h);I.leadingClipped&&(b=!1),I.trailingClipped&&(g=!1);const L=Math.max(o.x+I.leading0,o.x),C=Math.min(o.y+o.height-I.leading1,o.y+o.height),w=Math.max(o.x+I.trailing0,o.x),E=Math.min(o.y+o.height-I.trailing1,o.y+o.height),R=t+h,P=i+n-h;D={x0:L,y0:C,x1:w,y1:E,cx:R,cy:P}}let A=!1;g&&v!=null&&(Za(e,v,a,!A),A||(A=!0)),m&&M!=null&&(Za(e,M,l,!A),A||(A=!0)),b&&S!=null&&(Za(e,S,c,!A),A||(A=!0)),y&&D!=null&&Za(e,D,h,!A),e.closePath()},Et=class extends di{constructor(){super(...arguments),this.borderPath=new Do,this.x=0,this.y=0,this.width=10,this.height=10,this.topLeftCornerRadius=0,this.topRightCornerRadius=0,this.bottomRightCornerRadius=0,this.bottomLeftCornerRadius=0,this.clipBBox=void 0,this.crisp=!1,this.lastUpdatePathStrokeWidth=this.strokeWidth,this.effectiveStrokeWidth=this.strokeWidth,this.hittester=super.isPointInPath.bind(this),this.distanceCalculator=super.distanceSquaredTransformedPoint.bind(this),this.microPixelEffectOpacity=1}set cornerRadius(e){this.topLeftCornerRadius=e,this.topRightCornerRadius=e,this.bottomRightCornerRadius=e,this.bottomLeftCornerRadius=e}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.strokeWidth||!!(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){const{path:e,borderPath:t,crisp:i,topLeftCornerRadius:s,topRightCornerRadius:n,bottomRightCornerRadius:r,bottomLeftCornerRadius:o}=this;let{x:a,y:l,width:c,height:h,strokeWidth:u,clipBBox:d}=this;const g=1/(this.layerManager?.canvas.pixelRatio??1);let m=1;if(e.clear(!0),t.clear(!0),c===0||h===0){this.effectiveStrokeWidth=0,this.lastUpdatePathStrokeWidth=0,this.microPixelEffectOpacity=0;return}if(i&&(c<=g&&(m*=c/g),h<=g&&(m*=h/g),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<g){const b=a+g/2;t.moveTo(b,l),t.lineTo(b,l+h),u=g,this.borderClipPath=void 0}else if(h<g){const b=l+g/2;t.moveTo(a,b),t.lineTo(a+c,b),u=g,this.borderClipPath=void 0}else if(u<c&&u<h){const b=u/2;a+=b,l+=b,c-=u,h-=u;const y=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&&(y==null||y?.width>0&&y?.height>0)&&(rh(e,a,l,c,h,v,y),rh(t,a,l,c,h,v,y))}else this.borderClipPath=this.borderClipPath??new Do,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,rh(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=(y,v)=>this.getBBox().distanceSquared(y,v)}else this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquaredTransformedPoint;this.effectiveStrokeWidth=u,this.lastUpdatePathStrokeWidth=u,this.microPixelEffectOpacity=m}computeBBox(){const{x: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}}};Et.className="Rect",f([F()],Et.prototype,"x",2),f([F()],Et.prototype,"y",2),f([F()],Et.prototype,"width",2),f([F()],Et.prototype,"height",2),f([F()],Et.prototype,"topLeftCornerRadius",2),f([F()],Et.prototype,"topRightCornerRadius",2),f([F()],Et.prototype,"bottomRightCornerRadius",2),f([F()],Et.prototype,"bottomLeftCornerRadius",2),f([Ei({equals:vd})],Et.prototype,"clipBBox",2),f([F()],Et.prototype,"crisp",2);var ip=!1,Di=class La extends Lt{constructor(t){super(t),this.x=0,this.y=0,this.lines=[],this.text=void 0,this.fontSize=La.defaultFontSize,this.fontFamily="sans-serif",this.textAlign="start",this.textBaseline="alphabetic",this.boxPadding=0,this.trimText=t?.trimText??!0}onTextChange(){if(this.richText?.clear(),this.textMap?.clear(),Ae(this.text))this.lines=[],this.richText??(this.richText=new ge),this.richText.setScene(this.scene),this.richText.append(this.text.map(()=>new La({trimText:!1})));else{const t=this.text?.split(`
`)??[];this.lines=this.trimText?t.map(i=>i.trim()):t}}static computeBBox(t,i,s,n,r=!0){const{font:o,font:{fontSize:a},textAlign:l,textBaseline:c,lineHeight:h=r?He.getLineHeight(a):void 0}=n,{width:u,alphabeticBaseline:d,offsetLeft:p,offsetTop:g,height:m}=Gn.measureLines(t,r?{font:o,lineHeight:h,textAlign:"start",textBaseline:"top"}:n),b=h==null?m:h*t.length;let y;h==null?y=g:c==="alphabetic"?y=(h-a)/2-d:y=He.getVerticalModifier(c)*b;const v=r?u*He.getHorizontalModifier(l):p;return new U(i-v,s-y,u,b)}computeBBox(t=ip){if(this.generateTextMap(),this.textMap?.size){const c=U.merge(this.textMap.values());return c.x=this.x,c.y=this.y,c}const{x:i,y:s,lines:n,textBaseline:r,textAlign:o,lineHeight:a}=this,l=La.computeBBox(n,i,s,{font:this,textBaseline:r,textAlign:o,lineHeight:a},t);return this.boxing!=null&&l.grow(this.boxPadding),l}getBBox(t=!0){if(t){ip=!0;const i=this.computeBBox(!0);return ip=!1,i}return super.getBBox()}getPlainText(){return dd(this.text)}getTextMeasureBBox(){return this.computeBBox()}isPointInPath(t,i){return this.getBBox()?.containsPoint(t,i)??!1}setScene(t){this.richText?.setScene(t),super.setScene(t)}generateTextMap(){if(!Ae(this.text)||this.textMap?.size)return;this.textMap??(this.textMap=new Map);let t=0,i=0,s=0;const n={fill:this.fill,fontSize:this.fontSize,fontFamily:this.fontFamily,fontStyle:this.fontStyle,fontWeight:this.fontWeight};for(const o of this.richText.children()){const{color:a,...l}=this.text[t++];o.x=0,o.y=0,o.setProperties(Ee({fill:a},l,n));const c=o.getBBox();this.textMap.set(o,c),s=Math.max(s,c.y+c.height/2+(o.lineHeight??He.getLineHeight(o.fontSize))),i+=c.x+c.width}let r=this.x-i/2;for(const[o,a]of this.textMap)o.x+=r,o.y+=s,r+=a.width}render(t){const{ctx:i,stats:s}=t;if(!this.text||!this.layerManager)return s&&(s.nodesSkipped+=1),super.render(t);if(Ae(this.text)){this.generateTextMap();const{width:n}=this.richText.getBBox();let r=0;switch(this.textAlign){case"left":case"start":r=n/2;break;case"right":case"end":r=n/-2}i.save(),i.translate(r,this.y),this.richText.render(t),i.restore()}else this.renderText(t);if(La.debug.check()&&!this.textMap?.size){const n=this.getBBox(!0);i.strokeStyle="red",i.lineWidth=1,i.strokeRect(n.x,n.y,n.width,n.height)}super.render(t)}markDirty(t){return this.textMap?.clear(),super.markDirty(t)}renderText(t){const{fill:i,stroke:s,strokeWidth:n}=this;if(!i&&!(s&&n)||!this.layerManager)return super.render(t);const{ctx:r}=t,o=He.toFontString(this);r.font!==o&&(r.font=o);const{fontSize:a,lineHeight:l=He.getLineHeight(a),textAlign:c,textBaseline:h}=this;if(r.textAlign=c,r.textBaseline=h,this.boxing){const u={font:this,textBaseline:h,textAlign:c,lineHeight:l},d=La.computeBBox(this.lines,this.x,this.y,u);if(d.width!==0&&d.height!==0){const{x:p,y:g,width:m,height:b}=d.grow(this.boxPadding);this.boxing.opacity=this.opacity,this.boxing.x=p,this.boxing.y=g,this.boxing.width=m,this.boxing.height=b,this.boxing.preRender(t),this.boxing.render(t)}}this.fillStroke(r)}executeFill(t){const{fontSize:i,lineHeight:s=He.getLineHeight(i),textBaseline:n,lines:r}=this,o=n==="alphabetic"?0:He.getVerticalModifier(n)*s*(1-r.length);this.renderLines(o,s,(a,l,c)=>t.fillText(a,l,c))}executeStroke(t){const{fontSize:i,lineHeight:s=He.getLineHeight(i),textBaseline:n,lines:r}=this,o=n==="alphabetic"?0:He.getVerticalModifier(n)*s*(1-r.length);this.renderLines(o,s,(a,l,c)=>t.strokeText(a,l,c))}renderLines(t,i,s){const{lines:n,x:r,y:o}=this;if(!(!Number.isFinite(r)||!Number.isFinite(o)||!Number.isFinite(t)||!Number.isFinite(i)))for(const a of n)s(a,r,o+t),t+=i}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}setBoxing(t){const i=t.border?.enabled?t.border?.stroke:void 0;t.fill!=null||i!=null?(this.boxing??(this.boxing=new Et({scene:this.scene})),this.boxing.fill=t.fill,this.boxing.fillOpacity=t.fillOpacity??1,this.boxing.cornerRadius=t.cornerRadius??0,this.boxing.stroke=i,this.boxing.strokeWidth=t.border?.strokeWidth??0,this.boxing.strokeOpacity=t.border?.strokeOpacity??1,this.boxPadding=t.padding??0):this.boxing&&(this.boxing.destroy(),this.boxing=void 0)}getBoxingProperties(){const{fill:t,fillOpacity:i,cornerRadius:s,stroke:n,strokeWidth:r,strokeOpacity:o}=this.boxing??{};return{border:{enabled:n!=null,stroke:n,strokeWidth:r,strokeOpacity:o},cornerRadius:s,fill:t,fillOpacity:i,padding:this.boxPadding}}toSVG(){if(!this.visible||!this.text)return;const t=Mt("text");if(Bt(this.text))this.applySvgFillAttributes(t),xy(t,this),t.setAttribute("text-anchor",{center:"middle",left:"start",right:"end",start:"start",end:"end"}[this.textAlign??"start"]),t.setAttribute("alignment-baseline",this.textBaseline),t.setAttribute("x",String(this.x)),t.setAttribute("y",String(this.y)),t.textContent=this.text;else for(const i of this.text){const s=Mt("tspan");xy(s,{fontSize:i.fontSize??this.fontSize,fontFamily:i.fontFamily??this.fontFamily,fontWeight:i.fontWeight??this.fontWeight,fontStyle:i.fontStyle??this.fontStyle}),this.applySvgFillAttributes(s),s.textContent=i.text,t.append(s)}return{elements:[t]}}};Di.className="Text",Di.debug=be.create(!0,"scene:text"),Di.defaultFontSize=10,f([F()],Di.prototype,"x",2),f([F()],Di.prototype,"y",2),f([qm({changeCb:e=>e.onTextChange()})],Di.prototype,"text",2),f([F()],Di.prototype,"fontStyle",2),f([F()],Di.prototype,"fontWeight",2),f([F()],Di.prototype,"fontSize",2),f([F()],Di.prototype,"fontFamily",2),f([F()],Di.prototype,"textAlign",2),f([F()],Di.prototype,"textBaseline",2),f([F()],Di.prototype,"lineHeight",2);var Oi=Di,Fy=class extends Io(Oi){},To=class extends Io(Ao(Oi)){},Xa=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(He.EllipsisChar))?[]:i}static appendEllipsis(e){return e.replace(/[.,]{1,5}$/,"")+He.EllipsisChar}static truncateLine(e,t,i,s){const n=t.textWidth(He.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+He.EllipsisChar:e;for(e=e.slice(0,o).trimEnd();e.length&&t.textWidth(e)+n>i;)e=e.slice(0,-1).trimEnd();return e+He.EllipsisChar}static textWrap(e,t){const i=e.split(He.lineSplitter),s=Gn.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),y=s.textWidth(b);if(y<=t.maxWidth){n.push(l.slice(0,u).trimEnd()),l=l.slice(u).trimStart(),c=0,h=0,u=0;continue}else o&&y>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 g=r?"-":"";let m=l.slice(0,c).trim();for(;m.length&&s.textWidth(m+g)>t.maxWidth;)m=m.slice(0,-1).trimEnd();if(n.push(m+g),!m.length){l="";break}l=l.slice(m.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)}},jy={};Fs(jy,{BASE_FONT_SIZE:()=>dn,CARTESIAN_AXIS_TYPE:()=>Vy,CARTESIAN_POSITION:()=>By,FONT_SIZE:()=>sp,FONT_SIZE_RATIO:()=>Pi,POLAR_AXIS_SHAPE:()=>_y,POLAR_AXIS_TYPE:()=>Gy});var sp=(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))(sp||{}),dn=12,Pi=(e=>(e[e.SMALLEST=8/dn]="SMALLEST",e[e.SMALLER=10/dn]="SMALLER",e[e.SMALL=12/dn]="SMALL",e[e.MEDIUM=13/dn]="MEDIUM",e[e.LARGE=14/dn]="LARGE",e[e.LARGEST=17/dn]="LARGEST",e))(Pi||{}),By=(e=>(e.TOP="top",e.TOP_RIGHT="top-right",e.TOP_LEFT="top-left",e.RIGHT="right",e.RIGHT_TOP="right-top",e.RIGHT_BOTTOM="right-bottom",e.BOTTOM="bottom",e.BOTTOM_RIGHT="bottom-right",e.BOTTOM_LEFT="bottom-left",e.LEFT="left",e.LEFT_TOP="left-top",e.LEFT_BOTTOM="left-bottom",e))(By||{}),Vy=(e=>(e.CATEGORY="category",e.GROUPED_CATEGORY="grouped-category",e.ORDINAL_TIME="ordinal-time",e.UNIT_TIME="unit-time",e.TIME="time",e.NUMBER="number",e.LOG="log",e))(Vy||{}),Gy=(e=>(e.ANGLE_CATEGORY="angle-category",e.ANGLE_NUMBER="angle-number",e.RADIUS_CATEGORY="radius-category",e.RADIUS_NUMBER="radius-number",e))(Gy||{}),_y=(e=>(e.CIRCLE="circle",e.POLYGON="polygon",e))(_y||{}),ct=class extends re{constructor(){super(...arguments),this.id=cs(this),this.node=new Fy({zIndex:1}).setProperties({textAlign:"center",pointerEvents:1}),this.enabled=!1,this.textAlign="center",this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always",this.padding=0,this.layoutStyle="block",this.truncated=!1}registerInteraction(e,t){return e.eventsHub.on("layout:complete",()=>this.updateA11yText(e,t))}computeTextWrap(e,t){const{text:i,padding:s,wrapping:n}=this;if(Ae(i))return;const 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=Xa.wrapText(i??"",{maxWidth:r,maxHeight:o,font:this,textWrap:n});this.node.text=a,this.truncated=a.includes(He.EllipsisChar)}updateA11yText(e,t){const{proxyInteractionService:i}=e;if(this.enabled&&this.text){const s=dt.toCanvas(this.node);if(s){const{id:n}=this;this.proxyText??(this.proxyText=i.createProxyElement({type:"text",domManagerId:n,where:t})),this.proxyText.textContent=dd(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.truncated){const{x:i,y:s}=dt.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:dd(this.text)}])}}handleMouseLeave(e,t){e.tooltipManager.removeTooltip(this.id)}};ct.SMALL_PADDING=10,f([x,Dt("node","visible")],ct.prototype,"enabled",2),f([x,Dt("node")],ct.prototype,"text",2),f([x,Dt("node")],ct.prototype,"textAlign",2),f([x,Dt("node")],ct.prototype,"fontStyle",2),f([x,Dt("node")],ct.prototype,"fontWeight",2),f([x,Dt("node")],ct.prototype,"fontSize",2),f([x,Dt("node")],ct.prototype,"fontFamily",2),f([x,Dt("node","fill")],ct.prototype,"color",2),f([x],ct.prototype,"spacing",2),f([x],ct.prototype,"maxWidth",2),f([x],ct.prototype,"maxHeight",2),f([x],ct.prototype,"wrapping",2),f([x],ct.prototype,"padding",2),f([x],ct.prototype,"layoutStyle",2);var np=(e=>(e.X="x",e.Y="y",e.Angle="angle",e.Radius="radius",e))(np||{});function kA(e){switch(e){case"x":case"y":case"angle":case"radius":return!0;default:return!1}}var oh=class{constructor(){this.title=new ct,this.subtitle=new ct,this.footnote=new ct}positionCaptions(e){const{title:t,subtitle:i,footnote:s}=this,n=e.layoutBox.height/10;t.enabled&&(this.positionCaption("top",t,e.layoutBox,n),this.shrinkLayoutByCaption("top",t,e.layoutBox)),i.enabled&&(this.positionCaption("top",i,e.layoutBox,n),this.shrinkLayoutByCaption("top",i,e.layoutBox)),s.enabled&&(this.positionCaption("bottom",s,e.layoutBox,n),this.shrinkLayoutByCaption("bottom",s,e.layoutBox))}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(He.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){if(t.layoutStyle==="block"){const s=t.node.getBBox(),{spacing:n=0}=t;e==="bottom"&&Ae(t.text)&&(t.node.y-=s.height,s.y-=s.height),i.shrink(Math.ceil(e==="top"?s.y-i.y+s.height+n:i.y+i.height-s.y+n),e)}}};f([x],oh.prototype,"title",2),f([x],oh.prototype,"subtitle",2),f([x],oh.prototype,"footnote",2);var wA=["candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"],NA=class{constructor(e){this.chartService=e,this.mementoOriginatorKey="chartType"}createMemento(){let e=this.chartService.publicApi?.getOptions()?.chartType;return e??(e="candlestick"),e}guardMemento(e){return e==null||wA.includes(e)}restoreMemento(e,t,i){if(i==null)return;const s={chartType:i};this.chartService.publicApi?.updateDelta(s).catch(n=>j.error("error restoring state",n))}},Lr="12.1.2",Hy=Symbol("previous-memento-not-found"),EA=class{constructor(e){this.history=[],this.historyIndex=-1,this.originators=new Map,this.clearState=new Map,this.maxHistoryLength=100,this.debug=be.create(!0,"history"),this.cleanup=new at,this.cleanup.register(e.on("series:undo",this.undo.bind(this)),e.on("series:redo",this.redo.bind(this)))}destroy(){this.cleanup.flush()}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===Hy)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):Hy}restoreMemento(e,t){this.originators.get(e)?.restoreMemento(Lr,Lr,t)}debugEvent(...e){this.debug(...e,this.history.map((t,i)=>i===this.historyIndex?`** ${t.label} **`:t.label))}},Uy=class am{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"){j.warnOnce(`Could not restore data of type [${typeof t}], expecting an object, ignoring.`);return}if(t==null){j.warnOnce("Could not restore data of type [null], expecting an object, ignoring.");return}if(!("version"in t)||typeof t.version!="string"){j.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(`

`)}

`:"";j.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,am.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),am.decodeTypes)}catch(s){throw new Error(`Failed to decode [${t.mementoOriginatorKey}] value [${s}].`,{cause:s})}}static encodeTypes(t,i){return go(this[t])?{__type:"date",value:this[t].toISOString()}:i}static decodeTypes(t,i){return ot(this[t])&&"__type"in this[t]&&this[t].__type==="date"?new Date(this[t].value):i}},OA=class{constructor(){this.caretaker=new Uy(Lr),this.state=new Map}setState(e,t){Nt(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)}},PA=`.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-border-radius: 4px;--ag-charts-chart-background-color: #fff;--ag-charts-chart-padding: 20px;--ag-charts-focus-shadow: 0 0 0 3px #2196f3;--ag-charts-foreground-color: #181d1f;--ag-charts-font-family: Verdana, sans-serif;--ag-charts-font-size: 12px;--ag-charts-font-weight: 400;--ag-charts-popup-shadow: 0 0 16px rgba(0, 0, 0, .15);--ag-charts-subtle-text-color: #8c8c8c;--ag-charts-text-color: #181d1f;--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-button-background-color: #fff;--ag-charts-button-border: 1px solid #dddddd;--ag-charts-button-font-weight: normal;--ag-charts-button-text-color: inherit;--ag-charts-input-background-color: #fff;--ag-charts-input-border: 1px solid #dddddd;--ag-charts-input-text-color: #181d1f;--ag-charts-menu-background-color: #fafafa;--ag-charts-menu-border: 1px solid #dddddd;--ag-charts-menu-text-color: #181d1f;--ag-charts-panel-background-color: #fafafa;--ag-charts-panel-text-color: #181d1f;--ag-charts-tooltip-background-color: #fafafa;--ag-charts-tooltip-border: 1px solid #dddddd;--ag-charts-tooltip-text-color: #181d1f;--ag-charts-tooltip-subtle-text-color: #8c8c8c;--ag-charts-crosshair-label-background-color: #fafafa;--ag-charts-crosshair-label-text-color: #181d1f;--ag-charts-spacing: 4px;--ag-charts-icon-size: 16px;--ag-charts-focus-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-accent-color) 12%);--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-border-radius: var(--ag-charts-border-radius);--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-tooltip-border-radius: var(--ag-charts-border-radius);--ag-charts-menu-border-radius: var(--ag-charts-border-radius);--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: 1px solid var(--ag-charts-border-color);--ag-charts-focus-border: 1px solid 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-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-chevron-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjQ3IDUuNDdhLjc1Ljc1IDAgMCAxIDEuMDYgMGw0IDRhLjc1Ljc1IDAgMCAxIDAgMS4wNmwtNCA0YS43NS43NSAwIDAgMS0xLjA2LTEuMDZMMTAuOTQgMTAgNy40NyA2LjUzYS43NS43NSAwIDAgMSAwLTEuMDYiIGZpbGw9IiMwMDAiLz48L3N2Zz4=)}.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:var(--ag-charts-button-border);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:var(--ag-charts-input-border);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:var(--ag-charts-input-border);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-legend-toolbar{pointer-events:auto}.ag-charts-proxy-legend-toolbar>div[role=listitem]{pointer-events:none}.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-tooltip-text-color);background:var(--ag-charts-tooltip-background-color);border:var(--ag-charts-tooltip-border);border-radius:var(--ag-charts-tooltip-border-radius);box-shadow:var(--ag-charts-popup-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-tooltip-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-panel-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-popup-shadow);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-menu{--item-padding: 6px 12px;--icon-color: var(--ag-charts-menu-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-button-border);color:var(--ag-charts-button-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}
`,rp=class{constructor(){this.cleanup=new at,this.destroyed=!1}destroy(){this.cleanup.flush(),this.destroyed=!0}},RA=class id{constructor(t,i,s){this.element=t,this.topTabGuard=i,this.bottomTabGuard=s,this.cleanup=new at,this.guardTabIndex=0,this.hasFocus=!1,this.initTabGuard(this.topTabGuard,!1),this.initTabGuard(this.bottomTabGuard,!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(){this.cleanup.flush()}initTabGuard(t,i){this.cleanup.register(Ge(t,"focus",()=>this.onTab(t,i)))}setGuardIndices(t){const i=t;Ce(this.topTabGuard,"tabindex",i),Ce(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=Fe();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=id.queryFocusable(this.element,'[tabindex="0"]'),s=t?i.length-1:0;return i[s]}findExitTarget(t){const i=id.queryFocusable(ws(),"[tabindex]").filter(r=>r.tabIndex>0).sort((r,o)=>r.tabIndex-o.tabIndex),{before:s,after:n}=id.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}}};function ah(e,t,i=["Escape"]){return Ge(e,"keydown",s=>{lh(s,...i)&&t(s)})}function op(e,t){const i=Ge(Fe(),"mousedown",s=>{[0,2].includes(s.button)&&!$y(e,s)&&(t(),i())});return i}function ap(e,t){const i=Ge(Fe(),"touchstart",s=>{Array.from(s.targetTouches).some(r=>!$y(e,r))&&(t(),i())});return i}function $y(e,t){return t.target instanceof Element&&t.target.shadowRoot!=null?!0:t.target instanceof Node&&e.contains(t.target)}function lp(e,t,i){const s=n=>{for(const r of t)Ce(r,"data-focus-visible-override",n)};return s(i),Ge(e,"keydown",()=>s(!0),{once:!0})}function qa(e){return!(e.shiftKey||e.altKey||e.ctrlKey||e.metaKey)}function lh(e,...t){return qa(e)&&t.some(i=>e.key===i)}function Wy(e,t,i){return Ge(e,"keydown",s=>{lh(s,i)&&t.focus()})}var ko={horizontal:{nextKey:"ArrowRight",prevKey:"ArrowLeft"},vertical:{nextKey:"ArrowDown",prevKey:"ArrowUp"}};function Yy(e){const{orientation:t,buttons:i,wrapAround:s=!1,onEscape:n,onFocus:r,onBlur:o}=e,{nextKey:a,prevKey:l}=ko[t],c=p=>{p.target&&"tabIndex"in p.target&&(i.forEach(g=>g.tabIndex=-1),p.target.tabIndex=0)},[h,u]=s?[i.length,i.length]:[0,1/0],d=new at;for(let p=0;p<i.length;p++){const g=i[(h+p-1)%u],m=i[p],b=i[(h+p+1)%u];d.register(Ge(m,"focus",c),r&&Ge(m,"focus",r),o&&Ge(m,"blur",o),n&&ah(m,n),g&&Wy(m,g,l),b&&Wy(m,b,a),Ge(m,"keydown",y=>{lh(y,a,l)&&y.preventDefault()})),m.tabIndex=p===0?0:-1}return d}var zA=class{constructor(e,t,i){this.lastFocus=t,this.closeCallback=i,this.cleanup=new at,this.cleanup.register(op(e,()=>this.close(!0)),ap(e,()=>this.close(!0)))}close(e){this.cleanup.flush(),this.closeCallback(),this.finishClosing(e)}finishClosing(e){this.cleanup.flush(),Ce(this.lastFocus,"aria-expanded",!1),e||this.lastFocus?.focus({preventScroll:!0}),this.lastFocus=void 0}};function Ky(e){const{sourceEvent:t,orientation:i,menu:s,buttons:n,closeCallback:r,overrideFocusVisible:o}=e,{nextKey:a,prevKey:l}=ko[i],c=hh(t);Ce(c,"aria-expanded",!0);const h=new zA(s,c,r),u=()=>h.close(),{cleanup:d}=h;return s.role="menu",s.ariaOrientation=i,d.merge(Yy({orientation:i,buttons:n,onEscape:u,wrapAround:!0})),s.tabIndex=-1,d.register(ah(s,u),Ge(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&&d.register(lp(s,n,o)),h}function FA(e,t){return i=>{if(e.ariaDisabled==="true")return i.preventDefault();t(i)}}function ch(e){return"button"in e?e.button===0:qa(e)&&(e.code==="Space"||e.key==="Enter")}function hh(e){if(e?.target instanceof HTMLElement&&"tabindex"in e.target.attributes)return e.target}function Zy(e){return Ge(e,"keydown",t=>{if(t.defaultPrevented)return;bo(t.target,"data-preventdefault",!0)&&lh(t,"ArrowRight","ArrowLeft","ArrowDown","ArrowUp")&&t.preventDefault()})}var jA=class{constructor(e){this.callback=e,this.devicePixelRatio=Fe("devicePixelRatio")??1,this.devicePixelRatioMediaQuery=void 0,this.devicePixelRatioListener=t=>{t.matches||(this.devicePixelRatio=Fe("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=Fe("matchMedia")?.(`(resolution: ${this.pixelRatio}dppx)`);e?.addEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=e}},Xy=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 jA(()=>{clearTimeout(e),e=setTimeout(()=>this.checkPixelRatio(),0)}),this.documentReady=ws("readyState")==="complete",this.documentReady?this.observeWindow():Fe()?.addEventListener("load",this.onLoad)}destroy(){Fe()?.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)}},wo=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),delete this.cachedState,delete this.cachedValue,this}stateId(){return this.cachedState??(this.cachedState=Array.from(this.keys()).pop()??this.defaultState),this.cachedState}stateValue(){return this.cachedValue??(this.cachedValue=Array.from(this.values()).pop()??this.defaultValue),this.cachedValue}},BA='<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>',VA=["styles","canvas","canvas-center","canvas-container","canvas-overlay","canvas-proxy","series-area","tooltip-container"],GA=new Set(["styles","canvas-container","canvas","tooltip-container"]),qy={safeHorizontal:"ag-charts-wrapper--safe-horizontal",safeVertical:"ag-charts-wrapper--safe-vertical"},_A=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 HA(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 Qy={x:0,y:0,width:0,height:0,top:0,bottom:0,left:0,right:0,toJSON(){return Qy}};function Jy(e,t){const i=ve("div");return i.className="ag-charts-tab-guard",e.insertAdjacentElement(t,i),i}var cp=class uo extends rp{constructor(t,i,s,n,r="normal"){super(),this.eventsHub=t,this.chart=i,this.styleContainer=n,this.mode=r,this.anchorName=`--${cs(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 Xy,this.cursorState=new wo("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 o=!1;if(this.observer=HA(this.element,a=>{a===0&&!o&&this.eventsHub.emit("dom:hidden",null),o=a===0}),this.setSizeOptions(),this.updateContainerSize(),this.addStyles("ag-charts-community",PA),this.setContainer(s),this.cleanup.register(Zy(this.element)),this.mode==="normal"){const a=this.rootElements["canvas-center"].element;if(a==null)throw new Error("Error initializing tab guards");const l=Jy(a,"beforebegin"),c=Jy(a,"afterend");this.tabGuards=new RA(a,l,c)}}initDOM(){if(this.mode==="normal"){const s=ve("div");return s.innerHTML=BA,s.firstChild}const t=ve("div");t.role="presentation",t.dataset.agCharts="",t.classList.add("ag-charts-wrapper");const i=ve("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 VA){const r=`ag-charts-${n}`;let o;if(t==="normal"?o=i.classList.contains(r)?i:i.getElementsByClassName(r)[0]:GA.has(n)?o=i:o=i.getElementsByClassName(r)[0]??ve("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||(uo.batchedUpdateContainer.length===0&&Fe().setTimeout(this.applyBatchedUpdateContainer.bind(this),0),uo.batchedUpdateContainer.push(this)))}applyBatchedUpdateContainer(){for(const t of uo.batchedUpdateContainer)t.destroyed||t.updateContainer();uo.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=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.eventsHub.emit("dom:resize",null)}),this.eventsHub.emit("dom:container-change",null)}}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){for(const[i,s]of ls(t)){let n=`${s}`;i.endsWith("Size")||i.endsWith("Radius")?n=`${s}px`:i.endsWith("Border")&&typeof s=="boolean"&&(n=s?"var(--ag-charts-border)":"none"),this.element.style.setProperty(`--ag-charts-${kD(i)}`,n)}}updateCanvasLabel(t){Ce(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){const n=this.getEventElement(this.element,t);return Ge(n,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=Fe(),i=new U(0,0,t.innerWidth,t.innerHeight),s=this.getRawOverlayClientRect();return i.intersection(s)?.toDOMRect()??Qy}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}=Fe();return new U(0,0,s,n)}getShadowDocumentRoot(t=this.container){const i=t?.ownerDocument?.body??ws("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=ve("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&&!uo.headStyles.has(t)?(o=r(ws("head")),uo.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"}=_A.get(t)??{};if(s&&s.tagName.toLowerCase()!==l.toLowerCase())throw new Error("AG Charts - mismatching DOM element type");const c=s??ve(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(qy.safeHorizontal,s>=(i?.width??1/0)),t.classList.toggle(qy.safeVertical,n>=(i?.height??1/0))}};cp.batchedUpdateContainer=[],cp.headStyles=new Set;var eb=cp,UA=class extends Bs{constructor(){super(ve("div")),this.textElement=Mt("text"),this.textElement.role="presentation",this.svgElement=Mt("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(){}},tb=class extends Bs{constructor(e,t){super(e),Ce(this.elem,"role",t),this.setEnabled(!0),this.addListener("keydown",({sourceEvent:i})=>{ch(i)&&(i.preventDefault(),this.htmlListener?.dispatch("click",this,{type:"click",device:"keyboard",sourceEvent:i}))})}destructor(){}setEnabled(e){Ce(this.elem,"aria-disabled",!e)}addListener(e,t){return super.addListener(e,(i,s)=>{(e==="click"||e==="dblclick")&&this.isDisabled()||t(i,s)})}},Qa=class extends tb{constructor(){super(ve("button"))}},$A=class extends Bs{constructor(){super(ve("div")),Ce(this.elem,"role","group")}destructor(){}},hp=class extends Bs{constructor(e,t){super(ve("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"?[ko.horizontal,ko.vertical]:[ko[n],void 0];let a=-1;if(qa(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()},Ce(this.elem,"role",t),this.orientation=e}get orientation(){return bo(this.elem,"aria-orientation")??"both"}set orientation(e){Ce(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}}},WA=class extends hp{constructor(){super("both","list"),this.setHidden(!0)}destructor(){this.children.forEach(e=>e.getElement().parentElement.remove())}addChildToDOM(e,t){const i=ve("div");Ce(i,"role","listitem"),zs(i,"position","absolute"),Bs.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)}},No=class extends Bs{constructor(e){super(e)}destructor(){}},YA=new Intl.NumberFormat("en-US",{style:"percent"});function Eo(e,t=2){return typeof e=="number"?nb(e,t):typeof e=="string"?e:String(e??"")}function ib(e){return YA.format(e)}var sb=new Map().set(2,new Intl.NumberFormat("en-US",{maximumFractionDigits:2,useGrouping:!1}));function nb(e,t){let i=sb.get(t);return i||(i=new Intl.NumberFormat("en-US",{maximumFractionDigits:t,useGrouping:!1}),sb.set(t,i)),i.format(e)}var up=class Ic extends Bs{constructor(){super(ve("input")),this._step=Ic.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 bo(this.elem,"aria-orientation")??"both"}set orientation(t){Ce(this.elem,"aria-orientation",t!=="both"?t:void 0),Ic.registerDefaultPreventers(this,t)}destructor(){}clampValueRatio(t,i){const s=this.getValueRatio(),n=se(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=ib(n/s)}=i??{},o=this.getElement();o.value=`${n}`,o.ariaValueText=r}getValueRatio(){return this.getElement().valueAsNumber/this.step.divider}static registerDefaultPreventers(t,i){i==="both"?t.removeListener("keydown",Ic.onKeyDown):t.addListener("keydown",Ic.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()}};up.STEP_ONE={attributeValue:"1",divider:1},up.STEP_HUNDRETH={attributeValue:"0.01",divider:100};var dp=up,KA=class extends Qa{constructor(){super(),Ce(this.elem,"role","switch"),this.setChecked(!1)}setChecked(e){Ce(this.elem,"aria-checked",e)}},uh=class extends hp{constructor(e="horizontal"){super(e,"toolbar")}destructor(){}};function Oo(e,t){return t.params?.type===e}function ZA(e){if(e==="button")return new Qa;if(e==="slider")return new dp;if(e==="toolbar")return new uh;if(e==="group")return new $A;if(e==="list")return new WA;if(e==="region")return new No(ve("div"));if(e==="text")return new UA;if(e==="listswitch")return new KA;throw Error("AG Charts - error allocating meta")}function rb(e){const t={params:e,result:void 0};return t.result=ZA(t.params.type),t}var ob=class{constructor(e,t,i){this.eventsHub=e,this.localeManager=t,this.domManager=i,this.cleanup=new at}destroy(){this.cleanup.flush()}addLocalisation(e){e(),this.cleanup.register(this.eventsHub.on("locale:change",e))}createProxyContainer(e){const t=rb(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,Oo("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=rb(e);if(Oo("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(Oo("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(Oo("text",t)){const{params:i,result:s}=t;this.initElement(i,s),this.setParent(t.params,t.result)}if(Oo("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(Oo("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 zs(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),t.destroyListener=()=>{this.domManager.removeChild("canvas-proxy",e.domManagerId)}}}},ab={ariaInitSeriesArea:"interactive chart",ariaAnnounceHoverDatum:"${datum}",ariaAnnounceChart:"chart, ${seriesCount}[number] series",ariaAnnounceStandaloneChart:"chart, ${caption}",ariaAnnounceHierarchyChart:"hierarchy chart, ${caption}",ariaAnnounceGaugeChart:"gauge chart, ${caption}",ariaAnnounceHierarchyDatum:"level ${level}[number], ${count}[number] children, ${description}",ariaAnnounceFlowProportionLink:"link ${index} of ${count}, from ${from} to ${to}, ${sizeName} ${size}",ariaAnnounceFlowProportionNode:"node ${index} of ${count}, ${description}",ariaDescriptionLegendItem:"Press Space or Enter to toggle visibility",ariaLabelAddHorizontalLine:"Add Horizontal Line",ariaLabelAnnotationsToolbar:"Annotations",ariaLabelAnnotationOptionsToolbar:"Annotation Options",ariaLabelAnnotationSettingsDialog:"Annotation Settings",ariaLabelColor:"Color",ariaLabelColorPicker:"Color picker",ariaLabelColorPickerAlpha:"Transparency",ariaLabelColorPickerHue:"Hue",ariaLabelColorPickerMultiColor:"Multi Color",ariaLabelColorPickerPalette:"Palette",ariaLabelFinancialCharts:"Financial Charts",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",ariaRoleDescription2DSlider:"2D slider",ariaValueColorPalette:"s ${s}[percent0to2dp], v ${v}[percent0to2dp]",ariaValueColorPaletteFirstV:"v ${v}[percent0to2dp], s ${s}[percent0to2dp]",ariaValuePanRange:"${min}[percent0to2dp] to ${max}[percent0to2dp]",iconAltTextLineStyleSolid:"Solid",iconAltTextLineStyleDashed:"Long-dashed",iconAltTextLineStyleDotted:"Short-dashed",iconAltTextPositionTop:"Top",iconAltTextPositionCenter:"Center",iconAltTextPositionBottom:"Bottom",iconAltTextAlignLeft:"Left",iconAltTextAlignCenter:"Center",iconAltTextAlignRight:"Right",iconAltTextClose:"Close",overlayLoadingData:"Loading data...",overlayNoData:"No data to display",overlayNoVisibleSeries:"No visible series",overlayUnsupportedBrowser:"Incompatible browser version. Please upgrade your browser.",seriesHistogramTooltipFrequency:"Frequency",seriesHistogramTooltipSum:"${yName} (sum)",seriesHistogramTooltipCount:"${yName} (count)",seriesHistogramTooltipMean:"${yName} (mean)",toolbarSeriesTypeDropdown:"Chart Type",toolbarSeriesTypeOHLC:"OHLC",toolbarSeriesTypeHLC:"HLC",toolbarSeriesTypeHighLow:"High Low",toolbarSeriesTypeCandles:"Candles",toolbarSeriesTypeHollowCandles:"Hollow Candles",toolbarSeriesTypeLine:"Line",toolbarSeriesTypeLineWithMarkers:"Line with Markers",toolbarSeriesTypeStepLine:"Step Line",toolbarAnnotationsTrendLine:"Trend Line",toolbarAnnotationsFibonacciRetracement:"Fib Retracement",toolbarAnnotationsFibonacciRetracementTrendBased:"Fib Trend Based",toolbarAnnotationsHorizontalLine:"Horizontal Line",toolbarAnnotationsVerticalLine:"Vertical Line",toolbarAnnotationsParallelChannel:"Parallel Channel",toolbarAnnotationsDisjointChannel:"Disjoint Channel",toolbarAnnotationsClearAll:"Clear All",toolbarAnnotationsFillColor:"Fill Color",toolbarAnnotationsLineColor:"Line Color",toolbarAnnotationsLineStyle:"Line Style",toolbarAnnotationsLineStrokeWidth:"Line Stroke Width",toolbarAnnotationsSettings:"Settings",toolbarAnnotationsTextColor:"Text Color",toolbarAnnotationsTextSize:"Text Size",toolbarAnnotationsLock:"Lock",toolbarAnnotationsUnlock:"Unlock",toolbarAnnotationsDelete:"Delete",toolbarAnnotationsDragHandle:"Drag Toolbar",toolbarAnnotationsLineAnnotations:"Trend Lines",toolbarAnnotationsFibonacciAnnotations:"Fibonacci",toolbarAnnotationsTextAnnotations:"Text Annotations",toolbarAnnotationsShapeAnnotations:"Arrows",toolbarAnnotationsMeasurerAnnotations:"Measurers",toolbarAnnotationsCallout:"Callout",toolbarAnnotationsComment:"Comment",toolbarAnnotationsNote:"Note",toolbarAnnotationsText:"Text",toolbarAnnotationsArrow:"Arrow",toolbarAnnotationsArrowUp:"Arrow Up",toolbarAnnotationsArrowDown:"Arrow Down",toolbarAnnotationsDateRange:"Date Range",toolbarAnnotationsPriceRange:"Price Range",toolbarAnnotationsDatePriceRange:"Date and Price",toolbarAnnotationsQuickDatePriceRange:"Measure",toolbarRange1Month:"1M",toolbarRange1MonthAria:"1 month",toolbarRange3Months:"3M",toolbarRange3MonthsAria:"3 months",toolbarRange6Months:"6M",toolbarRange6MonthsAria:"6 months",toolbarRangeYearToDate:"YTD",toolbarRangeYearToDateAria:"Year to date",toolbarRange1Year:"1Y",toolbarRange1YearAria:"1 year",toolbarRangeAll:"All",toolbarRangeAllAria:"All",toolbarZoomZoomOut:"Zoom out",toolbarZoomZoomIn:"Zoom in",toolbarZoomPanLeft:"Pan left",toolbarZoomPanRight:"Pan right",toolbarZoomPanStart:"Pan to the start",toolbarZoomPanEnd:"Pan to the end",toolbarZoomReset:"Reset the zoom",contextMenuDownload:"Download",contextMenuToggleSeriesVisibility:"Toggle Visibility",contextMenuToggleOtherSeries:"Toggle Other Series",contextMenuZoomToCursor:"Zoom to here",contextMenuPanToCursor:"Pan to here",contextMenuResetZoom:"Reset zoom",dialogHeaderChannel:"Channel",dialogHeaderLine:"Line",dialogHeaderFibonacciRange:"Fib Retracement",dialogHeaderDateRange:"Date Range",dialogHeaderPriceRange:"Price Range",dialogHeaderDatePriceRange:"Date and Price",dialogHeaderText:"Text",dialogInputAlign:"Align",dialogInputColorPicker:"Color",dialogInputColorPickerAltText:"Text Color",dialogInputFillColorPicker:"Fill",dialogInputFillColorPickerAltText:"Fill Color",dialogInputExtendChannelStart:"Extend channel start",dialogInputExtendChannelEnd:"Extend channel end",dialogInputExtendLineStart:"Extend line start",dialogInputExtendLineEnd:"Extend line end",dialogInputExtendAbove:"Extend above",dialogInputExtendBelow:"Extend below",dialogInputExtendLeft:"Extend left",dialogInputExtendRight:"Extend right",dialogInputReverse:"Reverse",dialogInputShowFill:"Show Fill",dialogInputFontSize:"Size",dialogInputFontSizeAltText:"Font Size",dialogInputLineStyle:"Dash",dialogInputPosition:"Position",dialogInputStrokeWidth:"Weight",dialogInputStrokeWidthAltText:"Line Weight",dialogInputFibonacciBands:"Bands",dialogInputFibonacciBandsAltText:"Fibonacci Bands",inputTextareaPlaceholder:"Add Text",measurerDateRangeBars:"${value}[number] bars",measurerPriceRangeValue:"${value}[number]",measurerPriceRangePercent:"${value}[percent]",measurerVolume:"Vol ${value}",tooltipPaginationStatus:"${index}[number] of ${count}[number]"},XA=/\$\{(\w+)}(?:\[(\w+)])?/gi,pp={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"})},qA=({defaultValue:e,variables:t})=>e?.replaceAll(XA,(i,s,n)=>{const r=t[s],o=n!=null?pp[n]:null;return n!=null&&o==null&&j.warnOnce(`Format style [${n}] is not supported`),o!=null?o.format(r):typeof r=="number"?pp.number.format(r):r instanceof Date?pp.datetime.format(r):String(r)}),QA=class{constructor(e){this.eventsHub=e,this.localeText=void 0,this.getLocaleText=void 0}setLocaleText(e){this.localeText!==e&&(this.localeText=e,this.eventsHub.emit("locale:change",null))}setLocaleTextFormatter(e){this.getLocaleText=e,this.getLocaleText!==e&&(this.getLocaleText=e,this.eventsHub.emit("locale:change",null))}t(e,t={}){const{localeText:i=ab,getLocaleText:s}=this,n=i[e];return s?.({key:e,defaultValue:n,variables:t})??qA({key:e,defaultValue:n,variables:t})??e}},gp=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??Fe("devicePixelRatio")??1,this.element=s??ve("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),Um(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(){Hm(this)}destroy(){this.element.remove(),this.element.width=0,this.element.height=0,this.context.clearRect(0,0,0,0),Object.freeze(this)}reset(){this.context.reset(),this.context.verifyDepthZero?.()}onEnabledChange(){this.element&&(this.element.style.display=this.enabled?"":"none")}};f([Vn(e=>e.onEnabledChange())],gp.prototype,"enabled",2);var JA=class extends On{constructor(){super(...arguments),this.cache=new Map,this.imageLoadingCount=0}loadImage(e,t){const i=this.cache.get(e);if(i?.image)return i.image;if(i!=null&&t){i.nodes.add(t);return}if(!t)return;const s={image:void 0,nodes:new Set([t])},n=new Image;return this.imageLoadingCount++,n.onload=()=>{s.image=n;for(const r of s.nodes)r.markDirty();s.nodes.clear(),this.imageLoadingCount--,this.emit("image-loaded",{uri:e})},n.onerror=()=>{this.imageLoadingCount--,s.nodes.clear(),this.emit("image-error",{uri:e})},n.src=e,this.cache.set(e,s),s.image}waitingToLoad(){return this.imageLoadingCount>0}destroy(){this.cache.forEach(e=>{e.nodes.clear()}),this.cache.clear()}},eC=class{constructor(e){this.canvas=e,this.debug=be.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 Ad({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()}},dh=class extends On{constructor(e){super(),this.debug=be.create(!0,"scene"),this.id=cs(this),this.imageLoader=new JA,this.root=null,this.pendingSize=null,this.isDirty=!1,this.cleanup=new at,this.updateDebugFlags(),this.canvas=new gp(e),this.layersManager=new eC(this.canvas),this.cleanup.register(this.imageLoader.on("image-loaded",()=>{this.emit("scene-changed",{})}),this.imageLoader.on("image-error",({uri:t})=>{j.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(){be.inDevelopmentMode(()=>an._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){MD(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}let p;if(o instanceof ge&&(p=o.dirty),o!=null&&p===!1&&!this.isDirty){this.debug.check()&&this.debug("Scene.render() - no-op",{tree:sh(o,"console")}),Oy(this.layersManager,t,r,void 0,i,s);return}const g={ctx:r,width:l,height:c,devicePixelRatio:h,debugNodes:{}};be.check("scene:stats:verbose")&&(g.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),DA(g);let m=!1;if((p!==!1||d)&&(m=!0,n.clear()),o&&be.check("scene:dirtyTree")){const{dirtyTree:b,paths:y}=Py(o);be.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:b,paths:y})}if(o&&m){if(o.visible&&o.preRender(g),this.debug.check()){const b=sh(o,"console");this.debug("Scene.render() - before",{canvasCleared:m,tree:b})}if(o.visible)try{r.save(),o.render(g),r.restore()}catch(b){throw this.canvas.reset(),b}}t["\u270D\uFE0F"]=performance.now()-u,r.verifyDepthZero?.(),this.isDirty=!1,Oy(this.layersManager,t,r,g.stats,i,s),IA(r,g.debugNodes),o&&this.debug.check()&&this.debug("Scene.render() - after",{tree:sh(o,"console"),canvasCleared:m})}toSVG(){const{root:e,width:t,height:i}=this;if(e!=null)return an.toSVG(e,t,i)}strip(){const{context:e,pixelRatio:t}=this.canvas;e.setTransform(t,0,0,t,0,0),this.layersManager.clear(),this.setRoot(null),this.isDirty=!1,this.clear()}destroy(){this.strip(),this.canvas.destroy(),this.imageLoader.destroy(),this.cleanup.flush(),Object.assign(this,{canvas:void 0})}};dh.className="Scene";var tC=class{constructor(e,t,i){this.eventsHub=e,this.annotationRoot=t,this.fireChartEvent=i,this.mementoOriginatorKey="annotations",this.annotations=[]}createMemento(){return this.annotations}guardMemento(e){return e==null||Ae(e)}restoreMemento(e,t,i){this.annotations=this.cleanData(i??[]).map(s=>{const n=this.getAnnotationTypeStyles(s.type);return Ee(s,n)}),this.eventsHub.emit("annotations:restore",{annotations:this.annotations})}updateData(e){this.annotations=this.cleanData(e??[])}fireChangedEvent(){this.fireChartEvent({type:"annotations",annotations:lt([...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}},lb=(e=>(e[e.CHART_BACKGROUND=0]="CHART_BACKGROUND",e[e.AXIS_BAND_HIGHLIGHT=1]="AXIS_BAND_HIGHLIGHT",e[e.AXIS_GRID=2]="AXIS_GRID",e[e.AXIS=3]="AXIS",e[e.SERIES_AREA_CONTAINER=4]="SERIES_AREA_CONTAINER",e[e.ZOOM_SELECTION=5]="ZOOM_SELECTION",e[e.SERIES_CROSSLINE_RANGE=6]="SERIES_CROSSLINE_RANGE",e[e.SERIES_LAYER=7]="SERIES_LAYER",e[e.AXIS_FOREGROUND=8]="AXIS_FOREGROUND",e[e.SERIES_CROSSHAIR=9]="SERIES_CROSSHAIR",e[e.SERIES_CROSSLINE_LINE=10]="SERIES_CROSSLINE_LINE",e[e.SERIES_ANNOTATION=11]="SERIES_ANNOTATION",e[e.CHART_ANNOTATION=12]="CHART_ANNOTATION",e[e.CHART_ANNOTATION_FOCUSED=13]="CHART_ANNOTATION_FOCUSED",e[e.STATUS_BAR=14]="STATUS_BAR",e[e.SERIES_LABEL=15]="SERIES_LABEL",e[e.LEGEND=16]="LEGEND",e[e.NAVIGATOR=17]="NAVIGATOR",e[e.FOREGROUND=18]="FOREGROUND",e))(lb||{}),iC=class{constructor(e,t){this.eventsHub=e,this.sceneRoot=t,this.axes=new Map,this.axisGridGroup=new ge({name:"Axes-Grids",zIndex:2}),this.axisGroup=new ge({name:"Axes",zIndex:3}),this.axisLabelGroup=new ge({name:"Axes-Labels",zIndex:15}),this.axisCrosslineRangeGroup=new ge({name:"Axes-Crosslines-Range",zIndex:6}),this.axisCrosslineLineGroup=new ge({name:"Axes-Crosslines-Line",zIndex:10}),this.axisCrosslineLabelGroup=new ge({name:"Axes-Crosslines-Label",zIndex:15}),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])}this.eventsHub.emit("axis:change",null)}getAxisContext(e){return this.axes.get(e)??[]}destroy(){this.axes.clear(),this.sceneRoot.removeChild(this.axisGroup),this.sceneRoot.removeChild(this.axisGridGroup)}},Ja=(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))(Ja||{}),ph=class{constructor(e,t,i){this.eventsHub=e,this.caller=t,this.animationManager=i,this.dispatchOnlyLatest=!0,this.dispatchThrottle=0,this.requestThrottle=300,this.isLoadingInitialData=!1,this.isLoadingData=!1,this.freshRequests=[],this.requestCounter=0,this.pendingData=void 0,this.debug=be.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.eventsHub.emit("data:source-change",null))}clearCallback(){this.dataSourceCallback=void 0}load(e){const{pendingData:t}=this;if(t!=null&&t.params.windowStart?.valueOf()===e.windowStart?.valueOf()&&t.params.windowEnd?.valueOf()===e.windowEnd?.valueOf()){const i=this.requestCounter++;this.isLoadingInitialData=!1,this.dispatch(i,t.data);return}this.isLoadingData=!0,this.throttledFetch(e)}isLazy(){return this.dataSourceCallback!=null}isLoading(){return this.isLazy()&&(this.isLoadingInitialData||this.isLoadingData)}async getData(){const{latestRequest:e}=this;if(!e)return;const{params:t,fetchRequest:i}=e,s=await i;return{params:t,data:s}}restoreData(e){this.pendingData=e}createThrottledFetch(e){return mm(t=>this.fetch(t).catch(i=>j.error("callback failed",i)),e,{leading:!1,trailing:!0})}createThrottledDispatch(e){return mm((t,i)=>this.dispatch(t,i),e,{leading:!0,trailing:!0})}dispatch(e,t){this.debug(`DataService - dispatching 'data-load' | ${e}`),this.eventsHub.emit("data:load",{data:t})}async fetch(e){"context"in this.caller&&(e.context=this.caller.context);const t=Promise.resolve().then(async()=>{if(!this.dataSourceCallback)throw new Error("DataService - [dataSource.getData] callback not initialised");const i=performance.now(),s=this.requestCounter++;this.debug(`DataService - requesting | ${s}`);let n;try{n=await this.dataSourceCallback(e),this.debug(`DataService - response | ${performance.now()-i}ms | ${s}`)}catch(o){this.debug(`DataService - request failed | ${s}`),j.errorOnce(`DataService - request failed | [${o}]`)}this.isLoadingInitialData=!1;const r=this.freshRequests.indexOf(t);return r===-1||this.dispatchOnlyLatest&&r!==this.freshRequests.length-1?(this.debug(`DataService - discarding stale request | ${s}`),n):(this.freshRequests=this.freshRequests.slice(r+1),this.freshRequests.length===0&&(this.isLoadingData=!1),Array.isArray(n)?this.throttledDispatch(s,n):this.eventsHub.emit("data:error",null),n)});this.latestRequest={params:e,fetchRequest:t},this.freshRequests.push(t),await t}};f([ui({newValue(e){this.throttledDispatch=this.createThrottledDispatch(e)}})],ph.prototype,"dispatchThrottle",2),f([ui({newValue(e){this.throttledFetch=this.createThrottledFetch(e)}})],ph.prototype,"requestThrottle",2);var sC=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&&(Gn.clear(),this.updateService.update(4))});i.observe(t),this.observers.push(i)}},nC=["bar","line","scatter"],rC=void 0,oC=void 0;oC=rC;var aC=void 0,lC=void 0;lC=aC;var cb=(e=>(e.POINTER="pointer",e.NODE="node",e.CHART="chart",e))(cb||{}),hb=(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))(hb||{}),cC=void 0,hC=void 0;hC=cC;var uC=void 0,dC=void 0;dC=uC;var ub=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){j.errorOnce(s)}}getListenersByType(e){return this.registeredListeners.get(e)??[]}destroy(){this.registeredListeners.clear()}},el=new WeakMap;function tl(e,t){const i=JSON.stringify(e,null,0);return el.has(t)||el.set(t,new Map),el.get(t)?.has(i)||el.get(t)?.set(i,t(e)),el.get(t)?.get(i)}var fp=class{constructor(){this.weak=new WeakMap,this.strong=new Map,this.set=!1,this.value=void 0}};function il(e,t){let i=new fp;const s=(...n)=>{let r=i;for(const o of n){const a=typeof o=="object"||typeof o=="symbol"?r.weak:r.strong;let l=a.get(o);l==null&&(l=new fp,a.set(o,l)),r=l}if(r.set)return t?.("hit",e,n),r.value;{const o=e(...n);return r.set=!0,r.value=o,t?.("miss",e,n),o}};return s.reset=()=>{i=new fp},s}function Jt(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 gh={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 mp(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 db(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(mp(e,r)/7)+1:0}var pC=0,pb=1,gb=4;function fb(e,t=e.getFullYear()){const s=new Date(t,0,1).getDay(),n=(gb-s+7)%7,r=new Date(t,0,n-(gb-pb)+1);return r<=e?Math.floor(mp(e,r)/7)+1:fb(e,t-1)}function gC(e){const t=e.getTimezoneOffset(),i=Math.abs(t);return`${t>0?"-":"+"}${ei(Math.floor(i/60),2,"0")}${ei(Math.floor(i%60),2,"0")}`}var fC={a:e=>gh.shortDays[e.getDay()],A:e=>gh.days[e.getDay()],b:e=>gh.shortMonths[e.getMonth()],B:e=>gh.months[e.getMonth()],c:"%x, %X",d:(e,t)=>ei(e.getDate(),2,t??"0"),e:"%_d",f:(e,t)=>ei(e.getMilliseconds()*1e3,6,t??"0"),H:(e,t)=>ei(e.getHours(),2,t??"0"),I:(e,t)=>{const i=e.getHours()%12;return i===0?"12":ei(i,2,t??"0")},j:(e,t)=>ei(mp(e)+1,3,t??"0"),m:(e,t)=>ei(e.getMonth()+1,2,t??"0"),M:(e,t)=>ei(e.getMinutes(),2,t??"0"),L:(e,t)=>ei(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)=>ei(e.getSeconds(),2,t??"0"),u:e=>{let t=e.getDay();return t<1&&(t+=7),String(t%7)},U:(e,t)=>ei(db(e,pC),2,t??"0"),V:(e,t)=>ei(fb(e),2,t??"0"),w:(e,t)=>ei(e.getDay(),2,t??"0"),W:(e,t)=>ei(db(e,pb),2,t??"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(e,t)=>ei(e.getFullYear()%100,2,t??"0"),Y:(e,t)=>ei(e.getFullYear(),4,t??"0"),Z:e=>gC(e),"%":()=>"%"},mC={_:" ",0:"0","-":""};function ei(e,t,i){const s=String(Math.floor(e));return s.length>=t?s:`${i.repeat(t-s.length)}${s}`}function Tr(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=mC[s];n!=null&&i++;const r=e[i+1],o=fC[r];if(typeof o=="function")t.push([o,n]);else if(typeof o=="string"){const a=Tr(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("")}}var Vs={millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e",month:"%b",year:"%Y"},yC={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"},pi={year:0,month:1,day:2,hour:3,minute:4,second:5,millisecond:6},bC=/%[-_0]?L/,xC=/%[-_0]?S/,vC=/%[-_0]?M/,MC=/%[-_0]?[HI]/,SC=/^%[-_0]?[de]$/,DC=/^%[-_0]?[Bbm]$/,IC=/^%[-_0]?[Yy]$/;function mb(e,t,i){if(typeof e=="string")return e;e??(e=Vs);const{millisecond:s=Vs.millisecond,second:n=Vs.second,minute:r=Vs.minute,hour:o=Vs.hour,day:a=Vs.day,month:l=Vs.month,year:c=Vs.year}=e,h=pi[t],u=yC[t],d=i?pi[i]:-1;if(d<pi.year&&h>=pi.year&&!IC.test(c)||d<pi.month&&h>=pi.month&&!DC.test(l)||d<pi.day&&h>=pi.day&&!SC.test(a))return u;let p;switch(t){case"year":return c;case"month":return d<pi.year?`${l} ${c}`:l;case"day":return d<pi.year?`${l} ${a} ${c}`:`${l} ${a}`;case"hour":p=o;break;case"minute":p=r;break;case"second":p=n;break;case"millisecond":p=s;break;default:return u}if(h>=pi.hour&&!MC.test(p)||h>=pi.minute&&!vC.test(p)||h>=pi.second&&!xC.test(p)||h>=pi.millisecond&&!bC.test(p))return u;let g;return d<pi.year?g=`${l} ${a} ${c}`:d<pi.month&&(g=`${l} ${a}`),g?`${p} ${g}`:p}var Po=class sd extends ub{constructor(){super(...arguments),this.formats=new Map,this.dateFormatter=il((t,i,s,n,r)=>{const o=sd.mergeSpecifiers(t,i)??Vs;return sd.getFormatter("date",o,s,n,{truncateDate:r})}),this.formatter=void 0}static mergeSpecifiers(...t){let i;for(const s of t)typeof s=="string"?i=s:Ne(s)&&(i=Ne(i)?{...i,...s}:s);return i}static getFormatter(t,i,s,n="long",{truncateDate:r}={}){if(Ne(i)){if(t!=="date"){j.warn("Date formatter configuration is not supported for non-date types.");return}s??(s="millisecond");const o=n==="component"?i?.[s]??Vs[s]:mb(i,s,r);return Tr(o)}switch(t){case"number":{const o=Id(i);return o==null?void 0:Fm(o)}case"date":return Tr(i);case"category":return o=>i.replace("%s",String(o))}}setFormatter(t){this.formatter!==t&&(this.formatter=t,this.formats.clear(),this.dateFormatter.reset(),this.dispatch("format-changed"))}format(t,i,{specifier:s,truncateDate:n}={}){if(i.value==null)return;const{formatter:r}=this;if(r==null)return;if(typeof r=="function"){const c=t(r,i);return c!=null?String(c):void 0}const o=r[i.property];if(o==null)return;if(typeof o=="function"){const c=t(o,i);return c!=null?String(c):void 0}else if(i.type==="date"){const{unit:c,style:h}=i;return this.dateFormatter(o,s,c,h,n)?.(i.value)}const a=s??o;if(typeof a!="string")return;let l=this.formats.get(a);return l==null&&(l=sd.getFormatter(i.type,a),this.formats.set(a,l)),l?.(i.value,i.type==="number"?i.fractionDigits:void 0)}defaultFormat(t,{specifier:i,truncateDate:s}={}){const{formatter:n}=this,r=typeof n=="function"?void 0:n?.[t.property];switch(t.type){case"date":{const{unit:o,style:a}=t,l=r!=null&&typeof r!="function"?r:void 0;return this.dateFormatter(l,i,o,a,s)?.(t.value)??String(t.value)}case"number":return Eo(t.value,t.fractionDigits);case"category":return Array.isArray(t.value)?t.value.join(" - "):typeof t.value=="string"?t.value:typeof t.value=="number"?Eo(t.value):String(t.value)}}};function AC(e,t){return i=>Number(e)*(1-i)+Number(t)*i}function yb(e,t){if(typeof e=="string")try{e=We.fromString(e)}catch{e=We.fromArray([0,0,0])}if(typeof t=="string")try{t=We.fromString(t)}catch{t=We.fromArray([0,0,0])}return i=>We.mix(e,t,i).toRgbaString()}var yp={};Fs(yp,{easeIn:()=>CC,easeInOut:()=>LC,easeInOutQuad:()=>wC,easeInQuad:()=>TC,easeOut:()=>sl,easeOutQuad:()=>kC,inverseEaseOut:()=>xb,linear:()=>bb});var bb=e=>e,CC=e=>1-Math.cos(e*Math.PI/2),sl=e=>Math.sin(e*Math.PI/2),LC=e=>-(Math.cos(e*Math.PI)-1)/2,TC=e=>e*e,kC=e=>1-(1-e)**2,wC=e=>e<.5?2*e*e:1-(-2*e+2)**2/2,xb=e=>2*Math.asin(e)/Math.PI,fh=.2,Ro=["initial","remove","update","add","trailing","end","none"],nl={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:fh,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1+fh,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}},vb=(e=>(e.Loop="loop",e.Reverse="reverse",e))(vb||{});function NC(e){return e.every(t=>t instanceof an)}function mh(e){return NC(e)?{nodes:e,selections:[]}:{nodes:[],selections:e}}function bp(e,t){return e===t?!0:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((i,s)=>bp(i,t[s])):Hc(e)&&Hc(t)?e.equals(t):Ne(e)&&Ne(t)?Td(e,t,bp):!1}var Mb=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??nl[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 bp(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(se(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(e,t){if(typeof t!="object"||Hc(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(Hc(e))return i=>e[_c](t,i);try{switch(typeof e){case"number":return AC(e,t);case"string":return yb(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}`)}}},Sb=class{constructor(e){this.maxAnimationTime=e,this.debug=be.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(Ro.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(Ro[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(Ro.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=Ro[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:c,phaseMeta:nl[c]}};let{phase:s,phaseControllers:n,phaseMeta:r}=i();const o=()=>Ro[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`,n),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&&nl[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){j.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()}},Db=(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))(Db||{}),Ib=class{constructor(){this.stateQueue=34}pushState(e){this.stateQueue|=e}popState(e){this.stateQueue&=~e}isState(e){return!!(this.stateQueue&-this.stateQueue&e)}};function Ab(e){return e==null?!0:!isNaN(e)&&e>=0&&e<=2}var Cb=class{constructor(e,t){this.interactionManager=e,this.chartUpdateMutex=t,this.defaultDuration=1e3,this.batch=new Sb(this.defaultDuration*1.5),this.debug=be.create(!0,"animation"),this.events=new On,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(!Ab(n))throw new Error(`Animation delay of ${n} is unsupported (${i})`);if(!Ab(r))throw new Error(`Animation duration of ${r} is unsupported (${i})`);const o=new Mb({...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=Fe().requestAnimationFrame(t=>{e(t).catch(i=>j.error(i))})}forceTimeJump(e,t){return!1}requestAnimation(){if(!this.rafAvailable||!this.batch.isActive()||this.requestId!==null)return;let e;const t=async i=>{await this.debug.group("AnimationManager.onAnimationFrame()",async()=>{const s=()=>{const n=i-(e??i);e=i,this.debug("AnimationManager",{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.events.emit("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}),this.requestId=null,this.startBatch())}failsafeOnError(e,t=!0){j.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 Sb(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()}},EC=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["reset-zoom"]={type:"action",showOn:"series-area",label:"contextMenuResetZoom",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}}},OC=class{constructor(){this.defaults=["download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series"]}},Lb=class{constructor(){this.items=new EC,this.lists=new OC}},Tb=class{constructor(e){this.eventsHub=e,this.builtins=new Lb,this.hiddenActions=new Set,this.setVisible("zoom-to-cursor",!1),this.setVisible("pan-to-cursor",!1),this.setVisible("reset-zoom",!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={showOn:e,x:r,y:o,context:i,widgetEvent:n};this.eventsHub.emit("context-menu:setup",a),this.eventsHub.emit("context-menu:complete",a)}isVisible(e){return!this.hiddenActions.has(e)}setVisible(e,t){t?this.hiddenActions.delete(e):this.hiddenActions.add(e)}},kb=class{constructor(e){this.eventsHub=e,this.highlightStates=new wo}updateHighlight(e,t){const i=this.getActiveHighlight();this.highlightStates.set(e,t);const s=this.getActiveHighlight();this.isEqual(s,i)||this.eventsHub.emit("highlight:change",{callerId:e,currentHighlight:s,previousHighlight:i})}getActiveHighlight(){return this.highlightStates.stateValue()}isEqual(e,t){return e===t||e!=null&&t!=null&&e?.series===t?.series&&e?.itemId===t?.itemId&&e?.datum===t?.datum}};function wb(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 _n(e,t,i,s,n,r){const[o,a]=wb(t,r),[l,c]=wb(e,n);return{xKey:i,yKey:s,xValue:e,yValue:t,first:l,last:c,min:o,max:a}}function Nb(e,t,[i,s],n){let r=Fa(0,t-1,a=>{const l=e===1?a:t-a,c=n(l)?.[1]??NaN;return!Number.isFinite(c)||c>i})??0,o=vr(0,t-1,a=>{const l=e===1?a:t-a,c=n(l)?.[0]??NaN;return!Number.isFinite(c)||c<s})??t-1;return e===-1&&([r,o]=[t-o,t-r]),r=Math.max(r,0),o=Math.min(o+1,t),[r,o]}function xp(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}=dt.toCanvasPoint(e.contentGroup,s.x,s.y);return{canvasX:Math.round(n),canvasY:Math.round(r)}}}function Eb(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 yh=class{constructor(e,t,i,s){this.domManager=i,this.tooltip=s,this.stateTracker=new wo,this.suppressState=new wo(!1),this.appliedState=null,this.cleanup=new at,this.cleanup.register(s.setup(t,i),e.on("dom:hidden",()=>this.tooltip.hide()))}destroy(){this.cleanup.flush()}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(Nt(this.appliedState?.content,t?.content)&&Nt(this.appliedState?.pagination,t?.pagination)){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,anchorTo:l,xOffset:c,yOffset:h}=o.position,u=xp(t,i,s);return{canvasX:n,canvasY:r,nodeCanvasX:u?.canvasX??n,nodeCanvasY:u?.canvasY??r,enableInteraction:o.interaction?.enabled??!1,showArrow:o.showArrow,position:{placement:a,anchorTo:l,xOffset:c,yOffset:h}}}},Ob=3,PC=505,Pb=30;function vp(e,t){const{device:i,offsetX:s,offsetY:n,clientX:r,clientY:o,currentX:a,currentY:l,sourceEvent:c}=t;return{type:e,device:i,offsetX:s,offsetY:n,clientX:r,clientY:o,currentX:a,currentY:l,sourceEvent:c}}function Rb(e,t){const i=e*e+t*t,s=Ob*Ob;return i>=s}function RC(e,t){const i=e.clientX-t.clientX,s=e.clientY-t.clientY,n=i*i+s*s,r=Pb*Pb;return n<r}var zb=class{constructor(e){this.cleanup=new at,this.events=new On,this.isDragging=!1,this.touch={distanceTravelledX:0,distanceTravelledY:0,clientX:0,clientY:0},this.cleanup.register(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.cleanup.flush()}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.events.emit("mousemove",e)}onDblClick(e){this.events.emit("dblclick",e)}onDragStart(e){this.dragStartEvent=e}onDragMove(e){this.dragStartEvent!=null&&Rb(e.originDeltaX,e.originDeltaY)&&(this.events.emit("drag-start",this.dragStartEvent),this.events.emit("drag-move",{...this.dragStartEvent,type:"drag-move"}),this.dragStartEvent=void 0,this.isDragging=!0),this.isDragging&&this.events.emit("drag-move",e)}onDragEnd(e){if(this.isDragging){this.events.emit("drag-end",e),this.isDragging=!1;return}if(e.device==="mouse"){const t=vp("click",e);this.events.emit("click",t)}else if(e.sourceEvent.type==="touchend"){if(Rb(this.touch.distanceTravelledX,this.touch.distanceTravelledY))return;const t=vp("click",e);this.events.emit("click",t);const i=Date.now();if(this.lastClick!==void 0&&i-this.lastClick.time<=PC&&RC(this.lastClick,e)){const s=vp("dblclick",e);this.events.emit("dblclick",s),this.lastClick=void 0}else this.lastClick={time:i,clientX:e.clientX,clientY:e.clientY}}}},Mp=class extends No{constructor(e){super(e)}addChildToDOM(){}removeChildFromDOM(){}},zC=class{constructor(e,t){this.seriesWidget=new Mp(e.getParent("series-area")),this.chartWidget=new Mp(e.getParent("canvas-proxy")),this.containerWidget=new Mp(e.getParent("canvas-container")),this.containerWidget.addChild(this.chartWidget),this.chartWidget.addChild(this.seriesWidget),t.withDragInterpretation&&(this.seriesDragInterpreter=new zb(this.seriesWidget))}destroy(){this.seriesDragInterpreter?.destroy(),this.seriesWidget.destroy(),this.chartWidget.destroy(),this.containerWidget.destroy()}};function rl(e,t){const[i,s]=_t(t);return se(i,e,s)}function _t(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 zo(e){const[t,i]=_t(e);return i-t}function FC(e){return e=e|0,e<=0?1:e===1?2:1<<32-Math.clz32(e-1)}function Sp(e){return e=e|0,e<=0?0:e===1?1:1<<31-Math.clz32(e)}var Fb=class lm extends Zc{constructor(t=[],i=[]){super(),this.domain=t,this.range=i,this.defaultTickCount=lm.defaultTickCount,this.defaultClamp=!1}static is(t){return t instanceof lm}normalizeDomains(...t){return Dp(...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||t==null)return NaN;const{range:n}=this,r=i?.clamp??this.defaultClamp;let o=s[0].valueOf(),a=s[1].valueOf(),l=t.valueOf();if(this.transform&&(o=this.transform(o),a=this.transform(a),l=this.transform(l)),r){const[h,u]=_t([o,a]);if(l<h)return n[0];if(l>u)return n[1]}if(o===a)return(n[0]+n[1])/2;if(l===o)return n[0];if(l===a)return n[1];const c=n[0];return c+(l-o)/(a-o)*(n[1]-c)}invert(t,i){const{domain:s}=this;if(s.length<2)return;let n=s[0].valueOf(),r=s[1].valueOf();this.transform&&(n=this.transform(n),r=this.transform(r));const{range:o}=this,[a,l]=o;let c;return a===l?c=this.toDomain((n+r)/2):c=this.toDomain(n+(t-a)/(l-a)*(r-n)),this.transformInvert?this.transformInvert(c):c}getPixelRange(){const[t,i]=this.range;return Math.abs(i-t)}};Fb.defaultTickCount=5;var Ye=Fb;function Dp(...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 Ip=class zS extends Zc{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 zS}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=se(0,t,1),this._paddingInner=t,this._paddingOuter=t}get padding(){return this._paddingInner}set paddingInner(t){this.invalid=!0,this._paddingInner=se(0,t,1)}get paddingInner(){return this._paddingInner}set paddingOuter(t){this.invalid=!0,this._paddingOuter=se(0,t,1)}get paddingOuter(){return this._paddingOuter}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&j.warnOnce("Expected update to not invalidate scale"))}convert(t,i){this.refresh();const s=this.findIndex(t,i?.alignment);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 se(r,i+s*t,o)}};f([Ha],Ip.prototype,"range",2),f([Ha],Ip.prototype,"round",2);var pn=Ip,ds=class FS extends pn{static is(t){return t instanceof FS}toDomain(t){return new Date(t)}convert(t,i){t instanceof Date||(t=new Date(t));const{domain:s,bands:n}=this;if(s.length<=0)return NaN;const r=this.ordinalRange(0),o=this.ordinalRange(n.length-1);if(n.length===0)return r;if(i?.clamp===!0){const{range:v}=this;if(t<n[0])return v[0];if(t>n[n.length-1])return v[1]}const a=i?.alignment??0,l=s[0].valueOf()>s[s.length-1].valueOf();if(a!==2){const v=super.convert(t,i);return l?o-(v-r):v}const c=t.valueOf();let h=this.findIndex(t)??0,u;l?(h=Math.min(Math.max(h,1),n.length-1),u=-1):(h=Math.min(Math.max(h,0),n.length-2),u=1);const d=n[h].valueOf(),p=n[h+u].valueOf(),g=this.ordinalRange(h),m=this.ordinalRange(h+u),y=(c-d)/(p-d)*(m-g)+g;return l?o-(y-r):y}invert(t,i=!1){this.refresh();const{domain:s,bands:n}=this;if(s.length<=0)return;const r=s[0].valueOf()>s[s.length-1].valueOf();let o;return i?o=this.invertNearestIndex(t-this.bandwidth/2):o=Fa(0,n.length-1,l=>this.ordinalRange(l)>=t)??n.length-1,n[r?n.length-1-o:o]}findIndex(t,i=0){const{bands:s}=this,n=t.valueOf();return i===1?Fa(0,s.length-1,r=>s[r].valueOf()>=n):vr(0,s.length-1,r=>s[r].valueOf()<=n)}},ol={bottomCenter:_C,center:GC,clone:WC,collides:YC,end:BC,from:KC,height:UC,round:$C,start:jC,topCenter:VC,origin:ZC,width:HC};function jC(e){return{x:e.x1,y:e.y1}}function BC(e){return{x:e.x2,y:e.y2}}function VC(e){return{x:(e.x1+e.x2)/2,y:Math.min(e.y1,e.y2)}}function GC(e){return{x:(e.x1+e.x2)/2,y:(e.y1+e.y2)/2}}function _C(e){return{x:(e.x1+e.x2)/2,y:Math.max(e.y1,e.y2)}}function HC(e){return Math.abs(e.x2-e.x1)}function UC(e){return Math.abs(e.y2-e.y1)}function $C(e){return{x1:Math.round(e.x1),y1:Math.round(e.y1),x2:Math.round(e.x2),y2:Math.round(e.y2)}}function WC(e){return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}function YC(e,t){const i=Ap(e),s=Ap(t);return i.x1<=s.x2&&i.x2>=s.x1&&i.y1<=s.y2&&i.y2>=s.y1}function Ap(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 KC(e,t,i,s){if(typeof e=="number")return{x1:e,y1:t,x2:i,y2:s};if("width"in e)return Ap({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 ZC(){return{x1:0,y1:0,x2:0,y2:0}}function bh(e,t,i,s,n){return t+(s-t)*((n-e)/(i-e))}function jb(e,t,i,s,n){return e+(n-t)*((i-e)/(s-t))}function Bb(e,t,i){return[jb(e,i.min,t,i.max,0),jb(e,i.min,t,i.max,1)]}function XC(e,t,i){const[s,n]=Bb(e.x1,e.x2,t),[r,o]=Bb(e.y1,e.y2,i);return{x1:s,x2:n,y1:r,y2:o}}function Vb(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 se(e,i+l,t)}function qC(e,t,i){const{x:s={min:0,max:1},y:n={min:0,max:1}}=t,r=ol.from(i),o=ol.from(e),a=XC(o,s,n),l=Vb(a.x1,a.x2,o.x1,o.x2,r.x1,r.x2),c=Vb(a.y1,a.y2,o.y1,o.y2,r.y1,r.y2),h={x:{min:bh(o.x1,s.min,o.x2,s.max,l),max:bh(o.x1,s.min,o.x2,s.max,l+e.width)},y:{min:bh(o.y1,n.min,o.y2,n.max,c),max:bh(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=se(0,h.x.min,1-u),h.x.max=h.x.min+u,h.y.min=se(0,h.y.min,1-d),h.y.max=h.y.min+d,h}function Gb(e,t){const i=e?.valueOf(),s=t?.valueOf();return typeof i!="number"||typeof s!="number"?[void 0,void 0]:i<s?[0,1]:[1,0]}var QC=class{constructor(){this.enabled=!1,this.padding=0,this.manuallyAdjusted=!1}},_b=e=>we((t,{options:i})=>!Ye.is(e?.scale)&&!ds.is(e?.scale)||t==null||i.end==null?!0:t<i.end,"to be less than end"),Hb=class extends rp{constructor(e,t){super(),this.eventsHub=e,this.fireChartEvent=t,this.mementoOriginatorKey="zoom",this.axisZoomManagers=new Map,this.state=new wo(void 0,"initial"),this.axes=[],this.didLayoutAxes=!1,this.autoScaleYAxis=new QC,this.lastRestoredState=void 0,this.independentAxes=!1,this.navigatorModule=!1,this.zoomModule=!1,this.pendingMemento=void 0,this.boundFireOnceChartEvent=this.fireOnceChartEvent.bind(this),this.cleanup.register(e.on("layout:complete",()=>{this.didLayoutAxes=!0;const{pendingMemento:i}=this;i&&this.restoreMemento(i.version,i.mementoVersion,i.memento),this.autoScaleYZoom("zoom-manager")}))}createMemento(){return this.getMementoRanges()}guardMemento(e,t){if(e==null)return!0;if(!ot(e))return!1;const i=this.getPrimaryAxis("x"),s=this.getPrimaryAxis("y"),n={rangeX:{start:_b(i),end:ee},rangeY:{start:_b(s),end:ee},ratioX:{start:ee,end:ee},ratioY:{start:ee,end:ee},autoScaledAxes:ee},{invalid:r}=ci(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");if(i?.rangeY)a??(a=!1),n.y=this.rangeToRatio(i.rangeY,"y")??{min:0,max:1};else if(i?.ratioY)a??(a=!1),n.y={min:i.ratioY.start??0,max:i.ratioY.end??1};else{a??(a=!0);const l=a?this.getAutoScaleYZoom(n.x):void 0;n.y=l??{min:0,max:1}}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 JC(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,e&&this.autoScaleYZoom("toggle-auto-scale")}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)&&(j.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)&&(j.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 j.warnOnce("cannot pan to target BBox - chart too small?"),!1;const r=qC(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.eventsHub.emit("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{autoScaleYAxis:i}=this,s=this.getPrimaryAxis("x"),n=this.getPrimaryAxis("y");let r;if(this.independentAxes){const c=new Set(s?.boundSeries??[]),h=new Set(n?.boundSeries??[]);r=new Set;for(const u of c)h.has(u)&&r.add(u)}else r=new Set([...s?.boundSeries??[],...n?.boundSeries??[]]);const o=[e.x.min,e.x.max],a=i.enabled&&!i.manuallyAdjusted?void 0:[e.y.min,e.y.max];let l=0;for(const c of r){const h=t-(l??0),u=c.getVisibleItems(o,a,h);if(l+=u,l>=t)return!0}return r.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}}getAutoScaleYZoom(e){if(!this.isZoomEnabled())return;const{independentAxes:t,autoScaleYAxis:i}=this;if(!i.enabled||i.manuallyAdjusted)return;const{padding:s}=i;return e?.min===0&&e?.max===1?{min:0,max:1}:t?this.primaryAxisZoom("y",e,{padding:s}):this.combinedAxisZoom("y",e,{padding:s})}autoScaleYZoom(e,t=!0){const{independentAxes:i}=this,s=this.getZoom();if(s?.x==null)return;const n=this.getAutoScaleYZoom(s.x);if(!(n==null||Nt(s.y,n))){if(i){const r=this.getPrimaryAxis("y");(r==null?void 0:this.axisZoomManagers.get(r.id))?.updateZoom("zoom-manager",n)}else for(const r of this.axisZoomManagers.values())r.getDirection()==="y"&&r.updateZoom("zoom-manager",n);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.eventsHub.emit("zoom:change",{...this.getZoom(),axes:i,callerId:e}),this.eventsHub.on("layout:complete",this.boundFireOnceChartEvent)}fireOnceChartEvent(){this.fireChartEvent({type:"zoom",...this.getMementoRanges()}),this.eventsHub.off("layout:complete",this.boundFireOnceChartEvent)}getRangeDirection(e,t){const i=this.getPrimaryAxis(t);if(!i||!Ye.is(i.scale)&&!ds.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,{scale:o}=i,{start:a,end:l}=e,[c=0,h=1]=Gb(a,l);let u=e.start==null?n:o.convert(e.start,{alignment:c}),d=e.end==null?r:o.convert(e.end,{alignment:h})+(o.bandwidth??0);if(!je(u)||!je(d))return;const[p,g]=[Math.min(n,r),Math.max(n,r)];if(u<p||u>g){j.warnOnce(`Invalid range start [${e.start}], expecting a value between [${o.invert(n)}] and [${o.invert?.(r)}], ignoring.`);return}if(d<p||d>g){j.warnOnce(`Invalid range end [${e.end}], expecting a value between [${o.invert(n)}] and [${o.invert?.(r)}], ignoring.`);return}u=Math.min(g,Math.max(p,u)),d=Math.min(g,Math.max(p,d));const m=r-n,b=Math.abs((u-n)/m),y=Math.abs((d-n)/m);return{min:b,max:y}}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[t,i]=e.scale.range;if(!(!je(t)||!je(i)))return[t,i]}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 g of t.boundSeries){if(!g.visible)continue;const{connectsToYAxis:m}=g,b=g.getRange("y",[i.min,i.max]);for(const y of b){const v=o.convert(y);Number.isFinite(v)&&(v<l&&(l=v,c=!m||y<0),v>h&&(h=v,u=!m||y>0))}}if(je(t.min)&&(l=0),je(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 g=(h+l)/2;l=g-p/2,h=g+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}}},JC=class{constructor(e){this.axis=e;const[t=0,i=1]=e.visibleRange;this.state=new wo({min:t,max:i}),this.currentZoom=this.state.stateValue()}getDirection(){return this.axis.direction}updateZoom(e,t){this.state.set(e,t)}getZoom(){return lt(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}},Cp=(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))(Cp||{}),Ub=class{constructor(e){this.eventsHub=e,this.elements=new Map}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 eL(e,t);for(const s of Object.values(Cp))typeof s=="number"&&this.elements.get(s)?.forEach(n=>n(i));return i}emitLayoutComplete(e,t){const{width:i,height:s}=e;this.eventsHub.emit("layout:complete",{axes:t.axes??[],chart:{width:i,height:s},clipSeries:t.clipSeries??!1,series:t.series})}},eL=class{constructor(e,t){this.width=e,this.height=t,this.layoutBox=new U(0,0,e,t)}};function tL({point:e,anchor: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 iL(e){return e!=null&&typeof e.point=="object"&&typeof e.label=="object"}var sL={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 nL(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:g,anchor:m}=d,{text:b,width:y,height:v}=g,M=p.size*.5;let S=0,D=0;if(M>0&&d.placement!=null){const R=sL[d.placement];S=(y*.5+M+i)*R.x,D=(v*.5+M+i)*R.y}const A=p.x-y*.5+S-((m?.x??.5)-.5)*p.size,I=p.y-v*.5+D-((m?.y??.5)-.5)*p.size;if(!xd(t,A,I,y,v)||o.some(R=>tL(R,A,I,y,v))||n.some(R=>km(R,A,I,y,v)))continue;const E={index:h,text:b,x:A,y:I,width:y,height:v,datum:d};c.push(E),n.push(E)}s.set(a,c)}}return s}var rL=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(iL)&&this.labelData.set(o.id,a)}const r=nL(this.labelData,s,5);for(const o of e)o.updatePlacedLabelData?.(r.get(o.id)??[])}},oL=class{constructor(e){this.eventsHub=e,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||Ae(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){j.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.eventsHub.emit("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}},aL=class{constructor(){this.groups=new Map}registerSeries({internalId:e,seriesGrouping:t,visible:i,type:s}){if(!t)return;let n=this.groups.get(s);n==null&&(n=new Map,this.groups.set(s,n)),n.set(e,{grouping:t,visible:i})}updateSeries({internalId:e,seriesGrouping:t,visible:i,type:s}){if(!t)return;const n=this.groups.get(s)?.get(e);n&&(n.grouping=t,n.visible=i)}deregisterSeries({internalId:e,type:t}){const i=this.groups.get(t);i!=null&&(i.delete(e),i.size===0&&this.groups.delete(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,r=this.groups.get(e);for(const a of r?.values()??[])a.visible&&(s.add(a.grouping.groupIndex),a.grouping.groupIndex===t.groupIndex&&n.add(a.grouping.stackIndex));const o=Array.from(s);return o.sort((a,l)=>a-l),{visibleGroupCount:o.length,visibleSameStackCount:n.size,index:o.indexOf(t.groupIndex)}}},$b=class{constructor(e){this.updateCallback=e,this.events=new On}addListener(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})}},lL=class{constructor(e,t){this.eventsHub=new On,this.callbackCache=new Iy,this.highlightManager=new kb(this.eventsHub),this.formatManager=new Po,this.layoutManager=new Ub(this.eventsHub),this.localeManager=new QA(this.eventsHub),this.seriesStateManager=new aL,this.stateManager=new OA,this.seriesLabelLayoutManager=new rL,this.cleanup=new at,this.contextModules=[];const{scene:i,root:s,syncManager:n,container:r,fireEvent:o,updateCallback:a,updateMutex:l,styleContainer:c,chartType:h,domMode:u,withDragInterpretation:d}=t;this.chartService=e,this.syncManager=n,this.domManager=new eb(this.eventsHub,this.chartService,r,c,u),this.widgets=new zC(this.domManager,{withDragInterpretation:d});const p=this.domManager.addChild("canvas","scene-canvas",i?.canvas.element);this.scene=i??new dh({canvasElement:p}),this.scene.setRoot(s),this.cleanup.register(this.scene.on("scene-changed",()=>{this.updateService.update(7)})),this.axisManager=new iC(this.eventsHub,s),this.legendManager=new oL(this.eventsHub),this.annotationManager=new tC(this.eventsHub,e.annotationRoot,o),this.chartTypeOriginator=new NA(e),this.interactionManager=new Ib,this.contextMenuRegistry=new Tb(this.eventsHub),this.updateService=new $b(a),this.proxyInteractionService=new ob(this.eventsHub,this.localeManager,this.domManager),this.fontManager=new sC(this.domManager,this.updateService),this.historyManager=new EA(this.eventsHub),this.animationManager=new Cb(this.interactionManager,l),this.dataService=new ph(this.eventsHub,e,this.animationManager),this.tooltipManager=new yh(this.eventsHub,this.localeManager,this.domManager,e.tooltip),this.zoomManager=new Hb(this.eventsHub,o);for(const g of js.byType("context")){if(!g.chartTypes.includes(h))continue;const m=g.moduleFactory(this);this.contextModules.push(m),this[g.contextKey]=m}}destroy(){this.animationManager.destroy(),this.axisManager.destroy(),this.callbackCache.invalidateCache(),this.domManager.destroy(),this.fontManager.destroy(),this.proxyInteractionService.destroy(),this.tooltipManager.destroy(),this.zoomManager.destroy(),this.widgets.destroy(),this.contextModules.forEach(e=>e.destroy()),this.cleanup.flush()}},Wb=class extends re{constructor(){super(...arguments),this.range="tooltip"}};f([x],Wb.prototype,"range",2);function cL(e,t){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}function hL(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||!cL(s,n))return!1}return!0}function uL(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&&!rn(r,h)||o&&u&&o!==u||!Nt(a,d)||!hL(n,c))return!1}return!0}function dL(e,t){const{props:i,...s}=e,{props:n,...r}=t;return Nt(s,r)&&uL(i,n)}function pL(e,t,i,s){return t===e.data&&rn(i,e.ids)&&dL(s,e.opts)}var Yb=class jS{constructor(){this.domain=new Set}static is(t){return t instanceof jS}extend(t){this.domain.add(t)}getDomain(){return Array.from(this.domain)}},Hn=class BS{constructor(){this.domain=[1/0,-1/0]}static is(t){return t instanceof BS}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]}},Fo=0,jo=1,Gs=2,gL=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*Gs|0)+Fo,h=(l*Gs|0)+jo,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*Gs|0)+Fo],p=n[(u*Gs|0)+Fo];n[(c*Gs|0)+Fo]=!Number.isFinite(p)||d<p?d:p;const g=n[(h*Gs|0)+jo],m=n[(u*Gs|0)+jo];n[(c*Gs|0)+jo]=!Number.isFinite(m)||g>m?g:m}}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*Gs|0)+Fo],c=e[(s*Gs|0)+jo];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[Fo],e[jo]]}};function fL(e){if(e.length<=1)return 1;let t=0,i=e[0];for(let s=1;s<e.length;s++){const n=e[s];if(n==null)continue;if(typeof n.valueOf()!="number")return;const o=Math.sign(n-i);if(o!==0){if(t!==0&&t!==o)return;t=o}i=n}return t===0?1:t}var Kb=Symbol("key-sort-orders"),Zb=Symbol("column-sort-orders"),Xb=Symbol("domain-ranges");function mL(e){return e.map(t=>ot(t)?JSON.stringify(t):t).join("-")}function Ri(e){const t=e?.map(Number);return t?.every(Number.isFinite)?t:[]}function qb(e,t){return t?.get(e.id)??0}function yL(e){return"scopes"in e&&Array.isArray(e.scopes)}function Lp(e,t){const i=[];for(let s=0;s<e;s+=1)i[s]=t;return i}function xh(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 Qb(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 bL(e){return t=>{let i=t;for(const s of e)i=i[s];return i}}var Jb=class{constructor(e,t="standalone",i=!1){this.opts=e,this.mode=t,this.suppressFieldDotNotation=i,this.debug=be.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,Lp(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(yL(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;for(const o of r.datumIndices[i]??n)s.datumIndex=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[Xb];let l=a.get(o);if(l==null){const c=r.map(h=>n.columns[h]);l=new gL(c),a.set(o,l)}return l.rangeBetween(i,s)}getSortOrder(e,t,i){let s=i.get(t);return s==null&&(s={sortOrder:fL(e)},i.set(t,s)),s.sortOrder}getKeySortOrder(e,t,i){const s=this.resolveProcessedDataIndexById(e,t),n=i.keys[s]?.get(e.id);return n?this.getSortOrder(n,s,i[Kb]):void 0}getColumnSortOrder(e,t,i){const s=this.resolveProcessedDataIndexById(e,t);return this.getSortOrder(i.columns[s],s,i[Zb])}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()&&xL(c),this.processScopeCache(),c}warnDataMissingProperties(e){if(e.size!==0)for(const t of mo(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}`;j.warnOnce(`the key '${t.property}' was not found in any data element${n}.`)}}processScopeCache(){this.scopeCache.clear();for(const e of mo(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,invalidKeyCount:l,allKeyMappings:c}=this.extractKeys(n,e,i),{columns:h,columnScopes:u,partialValidDataCount:d,maxDataLength:p}=this.extractValues(o,r,e,a,i),g=m=>{const b=t.get(m),y=b.getDomain();return Hn.is(b)&&y[0]>y[1]?[]:y};return{type:"ungrouped",input:{count:p},scopes:new Set(e.keys()),dataSources:e,aggregation:void 0,keys:[...c.values()],columns:h,columnScopes:u,invalidKeys:a,invalidKeyCount:l,invalidData:o,domain:{keys:n.map(g),values:r.map(g)},defs:{allScopesHaveSameDefs:s,keys:n,values:r},partialValidDataCount:d,time:0,[Xb]:new Map,[Kb]:new Map,[Zb]:new Map}}extractKeys(e,t,i){const s=new Map,n=new Map,r=new Map,o=new Map;let a,l;const c=(h,u)=>{const d=l.get(h);a.set(u,a.get(d)),s.has(d)&&(s.set(u,s.get(d)),n.set(u,n.get(d)))};for(const h of e){const{invalidValue:u,scopes:d}=h;a=new Map,l=new Map,o.set(h,a);for(const p of d??[]){const g=t.get(p)??[];if(l.has(g)){c(g,p);continue}const m=[];a.set(p,m),l.set(g,p);let b,y,v=0;for(let M=0;M<g.length;M++){if(g[M]==null||typeof g[M]!="object")continue;const S=i(h,g[M],M,p);if(S.valid){m.push(S.value);continue}m.push(u),b??(b=Lp(g.length,!1)),y??(y=Lp(g.length,!1)),v+=1,b[M]=!0,y[M]=!0}b&&y&&(s.set(p,b),n.set(p,y),r.set(p,v))}}return{invalidData:n,invalidKeys:s,invalidKeyCount:r,allKeyMappings:o}}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(y=>i.get(y))).size>1)throw new Error(`AG Charts - more than one data source for: ${JSON.stringify(c)}`);const d=new Set(c.scopes),p=za(c.scopes),g=i.get(p),m=new Array,b=s.get(p);for(let y=0;y<g.length;y++){if(g[y]==null||typeof g[y]!="object")continue;const v=g[y],M=b!=null?b[y]:!1,S=n(c,v,y,c.scopes);let D=S.value;(M||!S.valid)&&this.markScopeDatumInvalid(c.scopes,g,y,e),M?D=h:S.valid||(r+=1,D=h),m[y]=D}o.push(m),a.push(d),l=Math.max(l,m.length)}return{columns:o,columnScopes:a,partialValidDataCount:r,maxDataLength:l}}groupData(e,t){var i;const{keys:s,columns:n,columnScopes:r,invalidKeys:o,invalidData:a}=e,l=e.scopes,c=[],h=[],u=new Set,d=l.size!==1||t!=null?new Map:void 0;for(const p of l){const g=n.map((S,D)=>D).filter(S=>!u.has(S)&&r[S].has(p));if(g.length===0)continue;for(const S of g)u.add(S);const m=new Set;for(const S of g)for(const D of r[S])m.add(D);const b=s.map(S=>S.get(p)).filter(S=>S!=null),y=n[za(g)],v=a?.get(p),M=o?.get(p);for(let S=0;S<y.length;S++){if(M?.[S]===!0)continue;const D=b.map(C=>C[S]);if(D==null||D.length===0)throw new Error("AG Charts - no keys found for scope: "+p);const A=t?.(D)??D,I=d!=null?mL(A):void 0;let L=d?.get(I);if(L==null&&(L={keys:A,datumIndices:[],aggregation:[],validScopes:l},d?.set(I,L),c.push(L.keys),h.push(L)),v?.[S]===!0){L.validScopes===l&&(L.validScopes=new Set(l.values()));for(const C of m)L.validScopes.delete(C)}for(const C of g)(i=L.datumIndices)[C]??(i[C]=[]),L.datumIndices[C].push(S)}}return{...e,type:"grouped",domain:{...e.domain,groups:c},groups:h}}aggregateUngroupedData(e){const t=this.aggregates.map(()=>[1/0,-1/0]);e.domain.aggValues=t;const{keys:i,columns:s,dataSources:n}=e,r=za(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 g=d.map(v=>s[v][l]),m=xh(i,r,l),b=m!=null?u.aggregateFunction(g,m):void 0;b&&(p=u.groupAggregateFunction?.(b,p)??Hn.extendDomain(b,p));const y=u.finalFunction?.(p)??p;c[h]=y,Hn.extendDomain(y,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(g=>i[g][o.datumIndices[g]?.[u]]),p=n.aggregateFunction(d,a);p&&(l=n.groupAggregateFunction?.(p,l)??Hn.extendDomain(p,l))}const h=n.finalFunction?.(l)??l;o.aggregation[s]=h,Hn.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=za(i[l]),p=n?.get(d),g=h?new Yb:new Hn;for(let m=0;m<u.length;m+=1)p?.[m]!==!0&&g.extend(u[m]);e.domain.values[l]=g.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=za(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 mo(e,t))h.valueType==="category"?s.set(h,new Yb):(s.set(h,new Hn),r&&(r=(h.scopes?.length??0)===i.size))};o();const a=this.buildAccessors(mo(e,t)),l={value:void 0,missing:!1,valid:!1};return{dataDomain:s,processValue:(h,u,d,p)=>{let g,m;if(a.has(h.property)){try{m=a.get(h.property)(u)}catch{}g=m!=null}else g=h.property in u,m=g?u[h.property]:h.missingValue;h.forceValue!=null&&(m=g&&Md(m)?-1*h.forceValue:h.forceValue,g=!0),l.missing=!g;const b="missingValue"in h;if(!g&&!b)if(typeof p=="string"){const y=h.missing.get(p)??0;h.missing.set(p,y+1)}else for(const y of p){const v=h.missing.get(y)??0;h.missing.set(y,v+1)}if(s.has(h)||o(),g&&h.validation?.(m,u,d)===!1)if(l.valid=!1,"invalidValue"in h)m=h.invalidValue;else return this.mode!=="integrated"&&j.warnOnce(`invalid value of type [${typeof m}] for [${h.scopes} / ${h.id}] ignored:`,`[${m}]`),l.value=void 0,l;else l.valid=!0;if(h.processor){let y=n.get(h);y==null&&(y=h.processor(),n.set(h,y)),m=y(m,d)}return s.get(h)?.extend(m),l.value=m,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=Qb(i.property);if(n==null){j.warnOnce("Invalid property path [%s]",i.property);continue}const r=bL(n);t.set(i.property,r)}return t}};function xL(e){const t=(i,s)=>{s.length>0&&(j.log(`DataModel.processData() - ${i}`),j.table(s))};j.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 Tp=class sn{constructor(t,i){this.mode=t,this.suppressFieldDotNotation=i,this.debug=be.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()&&(Fe().processedData=[]);const n=[];for(const{data:r,ids:o,opts:a,resolves:l,rejects:c}of s){const h=t?.find(p=>pL(p,r,o,a));let u,d;if(h==null)try{u=new Jb(a,this.mode,this.suppressFieldDotNotation);const p=new Map(i.map(g=>[g.id,g.data]));d=u.processData(p)}catch(p){c.forEach(g=>g(p));continue}else({dataModel:u,processedData:d}=h);n.push({opts:a,data:r,ids:o,dataModel:u,processedData:d}),this.debug.check()&&Fe("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(sn.groupMatch(s));n?n.push(s):i.push([s])}return i.map(sn.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={ids:[],rejects:[],resolves:[],data:t[0].data,opts:{...t[0].opts,props:[]}},s=new Map,n=new Map;let r=0;for(const o of t){const{id:a,data:l,resolve:c,reject:h,opts:{props:u,...d}}=o;i.ids.push(a),i.rejects.push(h),i.resolves.push(c),i.data??(i.data=l),i.opts??(i.opts={...d,props:[]});for(const p of u){const g={...p,scopes:[a],data:l};sn.createIdsMap(a,g);let m;sn.crossScopeMergableTypes.has(g.type)?m=-1:n.has(l)?m=n.get(l):(m=r++,n.set(l,m));const b=`${g.type}-${m}-${g.groupId}`,y=s.get(b),v=y?.find(M=>sn.deepEqual(M,g));if(y==null){i.opts.props.push(g),s.set(b,[g]);continue}else if(v==null){i.opts.props.push(g),y.push(g);continue}g.scopes!=null&&(v.scopes??(v.scopes=[]),v.scopes.push(...g.scopes)),(v.type==="key"||v.type==="value")&&g.idsMap?.size&&(v.idsMap??(v.idsMap=new Map),sn.mergeIdsMap(g.idsMap,v.idsMap))}}return i}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(!sn.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(!sn.skipKeys.has(o)&&(!Object.hasOwn(i,o)||!sn.deepEqual(t[o],i[o])))return!1}return!0}return!1}};Tp.crossScopeMergableTypes=new Set(["key","group-value-processor"]),Tp.skipKeys=new Set(["id","idsMap","type","scopes","data"]);var ex=Tp,vL=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)}},kr=new vL,al=[{type:"root",optionsKey:"animation",chartTypes:["cartesian","polar","topology","standalone"]},{type:"root",optionsKey:"annotations",chartTypes:["cartesian"]},{type:"root",optionsKey:"background",chartTypes:["cartesian","polar","topology","standalone"],optionsInnerKey:"image"},{type:"root",optionsKey:"foreground",chartTypes:["cartesian","polar","topology","standalone"],optionsInnerKey:"image"},{type:"root",optionsKey:"chartToolbar",chartTypes:["cartesian"]},{type:"root",optionsKey:"contextMenu",chartTypes:["cartesian","polar","topology","standalone"]},{type:"root",optionsKey:"statusBar",chartTypes:["cartesian"],identifier:"status-bar"},{type:"root",optionsKey:"dataSource",chartTypes:["cartesian","polar","topology","standalone"]},{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","topology","standalone"],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:"axis",optionsKey:"axes[]",chartTypes:["cartesian"],identifier:"ordinal-time"},{type:"axis-option",optionsKey:"crosshair",chartTypes:["cartesian"]},{type:"axis-option",optionsKey:"bandHighlight",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:["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:["standalone"],identifier:"pyramid"},{type:"series",optionsKey:"series[]",chartTypes:["standalone"],identifier:"linear-gauge"},{type:"series",optionsKey:"series[]",chartTypes:["standalone"],identifier:"radial-gauge"},{type:"series",optionsKey:"series[]",chartTypes:["standalone"],identifier:"sunburst"},{type:"series",optionsKey:"series[]",chartTypes:["standalone"],identifier:"treemap"},{type:"series",optionsKey:"series[]",chartTypes:["standalone"],identifier:"chord"},{type:"series",optionsKey:"series[]",chartTypes:["standalone"],identifier:"sankey"},{type:"series-option",optionsKey:"errorBar",chartTypes:["cartesian"],identifier:"error-bars"},{type:"context",contextKey:"sharedToolbar",chartTypes:["cartesian"]}];function vh(e){return al.find(t=>t.type==="series"&&t.identifier===e)?.chartTypes}function ML(e){return vh(e)?.find(i=>i==="cartesian")==="cartesian"}function SL(e){return vh(e)?.find(i=>i==="polar")==="polar"}function DL(e){return vh(e)?.find(i=>i==="topology")==="topology"}function IL(e){return vh(e)?.find(i=>i==="standalone")==="standalone"}function AL(e){return e.packageType==="enterprise"}function CL(e){if(!AL(e))throw new Error("AG Charts - internal configuration error, only enterprise modules need verification.");const t=al.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 LL(){return al.filter(({useCount:e})=>e==null||e===0)}var TL=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),{})}},kp=new TL,tx=class extends Map{get(e){return super.get(e)??"unknown"}isCartesian(e){return this.get(e)==="cartesian"}isPolar(e){return this.get(e)==="polar"}isTopology(e){return this.get(e)==="topology"}isStandalone(e){return this.get(e)==="standalone"}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 topologyTypes(){return this.seriesTypes.filter(e=>this.isTopology(e))}get standaloneTypes(){return this.seriesTypes.filter(e=>this.isStandalone(e))}},kL=class extends Map{set(e,t){return super.set(e,Ee(t,this.get(e)))}},Ht=new tx,wL=new tx,wp=new kL,NL=class{constructor(){this.seriesMap=new Map,this.themeTemplates=new Map}register(e,{chartTypes:[t],moduleFactory:i,defaultAxes:s,themeTemplate:n,solo:r,stackable:o,groupable:a,stackedByDefault:l,hidden:c}){this.setThemeTemplate(e,n),this.seriesMap.set(e,{moduleFactory:i,defaultAxes:s,solo:r,stackable:o,groupable:a,stackedByDefault:l}),Ht.set(e,t),c||wL.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:lt(t)}}setThemeTemplate(e,t){const i=this.themeTemplates.get(e);this.themeTemplates.set(e,Ee(t,i))}getThemeTemplate(e){return this.themeTemplates.get(e)}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}},ps=new NL,Np=class En{constructor(t){this.chart=t}subscribe(t=En.DEFAULT_GROUP){let i=this.get(t);return i||(i={members:new Set},En.chartsGroups.set(t,i)),i.members.add(this.chart),this}unsubscribe(t=En.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=En.DEFAULT_GROUP){return this.get(t)}getGroupMembers(t=En.DEFAULT_GROUP){const i=this.get(t);return i?Array.from(i.members):[]}getGroupSiblings(t=En.DEFAULT_GROUP){return this.getGroupMembers(t).filter(i=>i!==this.chart)}getGroupSyncMode(t=En.DEFAULT_GROUP){return this.getGroupMembers(t).some(i=>i.series.length>1)?"multi-series":"single-series"}get(t){return En.chartsGroups.get(t)}};Np.chartsGroups=new Map,Np.DEFAULT_GROUP=Symbol("sync-group-default");var EL=Np,Ep=class extends re{constructor(){super(...arguments),this.enabled=!1}};f([x],Ep.prototype,"enabled",2),f([x],Ep.prototype,"tabIndex",2);var ix={};Fs(ix,{NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>gs,fromToMotion:()=>Ot,staticFromToMotion:()=>gn});var gs={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function Ot(e,t,i,s,n,r,o){const{fromFn:a,toFn:l,applyFn:c=(g,m)=>g.setProperties(m)}=n,{nodes:h,selections:u}=mh(s),d=(g,m)=>{let b,y=0,v=0;for(const M of m){const S=g[y]===M,D={last:v>=m.length-1,lastLive:y>=g.length-1,prev:m[v-1],prevFromProps:b,prevLive:g[y-1],next:m[v+1],nextLive:g[y+(S?1:0)]},A=`${e}_${t}_${M.id}`;i.stopByAnimationId(A);let I="unknown";S?r&&o&&(I=OL(M,M.datum,r,o)):I="removed",M.transitionOut=I==="removed";const{phase:L,start:C,finish:w,delay:E,duration:R,...P}=a(M,M.datum,I,D),{phase:G,start:H,finish:oe,delay:me,duration:ke,...Te}=l(M,M.datum,I,D),xe=w==null;i.animate({id:A,groupId:e,phase:L??G??"update",duration:R??ke,delay:E??me,from:P,to:Te,ease:sl,collapsable:xe,onPlay:()=>{const Z={...C,...H,...P};c(M,Z,"start")},onUpdate(Z){c(M,Z,"update")},onStop:()=>{const Z={...C,...H,...P,...Te,...w,...oe};c(M,Z,"end")}}),S&&y++,v++,b=P}};let p=0;for(const g of u){const m=g.nodes(),b=m.filter(y=>!g.isGarbage(y));d(b,m),i.animate({id:`${e}_${t}_selection_${p}`,groupId:e,phase:"end",from:0,to:1,ease:sl,onStop(){g.cleanup()}}),p++}d(h,h)}function gn(e,t,i,s,n,r,o){const{nodes:a,selections:l}=mh(s),{start:c,finish:h,phase:u}=o;i.animate({id:`${e}_${t}`,groupId:e,phase:u??"update",from:n,to:r,ease:sl,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 g of p.nodes())g.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 OL(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 sx={};Fs(sx,{resetMotion:()=>ti});function ti(e,t){const{nodes:i,selections:s}=mh(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 gi=class po{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=be.create(!0,"scene","scene:selections"),this.nodeFactory=Object.prototype.isPrototypeOf.call(an,i)?()=>new i:i}static select(t,i,s=!0){return new po(t,i,s)}static selectAll(t,i){const s=[],n=r=>{if(i(r)&&s.push(r),r instanceof ge)for(const o of r.children())n(o)};return n(t),s}static selectByClass(t,...i){return po.selectAll(t,s=>i.some(n=>s instanceof n))}static selectByTag(t,i){return po.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,r=new Map;for(let o=0;o<t.length;o++){const a=t[o];let l=s(a);if(n.has(l)){const c=(r.get(l)??0)+1;r.set(l,c),l=`${l}:${c}`}n.set(l,o)}for(const[o,a]of this._nodesMap.entries()){const l=n.get(a);l==null?this.garbageBin.add(o):(o.datum=t[l],this.garbageBin.delete(o),n.delete(a))}for(const[o,a]of n.entries()){const l=t[a];this._nodesMap.set(this.createNode(l,i,a),o)}}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 po.selectAll(this.parentNode,t)}selectByClass(t){return po.selectByClass(this.parentNode,t)}selectByTag(t){return po.selectByTag(this.parentNode,t)}nodes(){return this._nodes}at(t){return this._nodes.at(t)}get length(){return this._nodes.length}},zi=class extends Lt{constructor(e={}){super(e),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.fill=void 0,this.strokeWidth=1}set x(e){this.x1=e,this.x2=e}set y(e){this.y1=e,this.y2=e}get midPoint(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}}computeBBox(){return new 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 qc(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=Mt("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]}}};zi.className="Line",f([F()],zi.prototype,"x1",2),f([F()],zi.prototype,"y1",2),f([F()],zi.prototype,"x2",2),f([F()],zi.prototype,"y2",2);var Op="color: green",Pp="color: grey";function PL(){return Wm(()=>{})}function Rp(e,t){const i=zn(t);if(i.length===0)return;const s=Ym(e);for(const n of i)n in s&&(t[n]=s[n])}var nx=class{transitionRoot(e,t){this.parent?this.parent.transitionRoot(e,t):this.transition(e,t)}},zp=class ki extends nx{constructor(t,i,s){super(),this.defaultState=t,this.states=i,this.enterEach=s,this.debug=be.create(!0,"animation"),this.state=t,this.debug(`%c${this.constructor.name} | init -> ${t}`,Op)}transition(t,i){if(!this.transitionChild(t,i)||this.state===ki.child||this.state===ki.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,Pp),u});else if(typeof o=="object"&&!(o instanceof ki)&&o.guard&&!o.guard(i)){this.debug(`${a} (guarded)`,o.target,Pp);return}if(!o){this.debug(`${a} ${this.state}`,Pp);return}const l=this.getDestinationState(o),c=l===this.state?void 0:r.onExit;this.debug(`${a} ${l}`,Op),this.state=l,typeof o=="function"?o(i):typeof o=="object"&&!(o instanceof ki)&&o.action?.(i),c?.(),this.enterEach?.(n,l),l!==n&&l!==ki.child&&l!==ki.parent&&this.states[l].onEnter?.(n,i)}transitionAsync(t,i){setTimeout(()=>{this.transition(t,i)},0)}is(t){return this.state===ki.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!==ki.child||!this.childState||(Rp(this,this.childState),this.childState.transition(t,i),!this.childState.is(ki.parent))?!0:(this.debug(`%c${this.constructor.name} | ${this.state} -> ${t} -> ${this.defaultState}`,Op),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 ki?(this.childState=t,this.childState.parent=this,i=ki.child):typeof t=="object"&&(t.target instanceof ki?(this.childState=t.target,this.childState.parent=this,i=ki.child):t.target!=null&&(i=t.target)),i}};zp.child="__child",zp.parent="__parent";var ll=zp,RL=class extends nx{constructor(...e){super(),this.stateMachines=e;for(const t of e)t.parent=this}transition(e,t){for(const i of this.stateMachines)Rp(this,i),i.transition(e,t)}transitionAsync(e,t){for(const i of this.stateMachines)Rp(this,i),i.transitionAsync(e,t)}},Bo=1e3,Un=Bo*60,wr=Un*60,Nr=wr*24,rx=Nr*7,Fp=Nr*30,cl=Nr*365,Vo=new Date().getTimezoneOffset()*Un,hl={millisecond:{milliseconds:1,hierarchy:"day",encode(e){return e.getTime()},decode(e){return new Date(e)}},second:{milliseconds:Bo,hierarchy:"day",encode(e,t){const i=t?0:Vo;return Math.floor((e.getTime()-i)/Bo)},decode(e,t){const i=t?0:Vo;return new Date(i+e*Bo)}},minute:{milliseconds:Un,hierarchy:"day",encode(e,t){const i=t?0:Vo;return Math.floor((e.getTime()-i)/Un)},decode(e,t){const i=t?0:Vo;return new Date(i+e*Un)}},hour:{milliseconds:wr,hierarchy:"day",encode(e,t){const i=t?0:Vo;return Math.floor((e.getTime()-i)/wr)},decode(e,t){const i=t?0:Vo;return new Date(i+e*wr)}},day:{milliseconds:Nr,hierarchy:"month",encode(e,t){const i=t?0:e.getTimezoneOffset()*Un;return Math.floor((e.getTime()-i)/Nr)},decode(e,t){let i;return t?(i=new Date(0),i.setUTCDate(i.getUTCDate()+e),i.setUTCHours(0,0,0,0)):(i=new Date(1970,0,1),i.setDate(i.getDate()+e)),i}},month:{milliseconds:Fp,hierarchy:"year",encode(e,t){return t?e.getUTCFullYear()*12+e.getUTCMonth():e.getFullYear()*12+e.getMonth()},decode(e,t){if(t){const i=Math.floor(e/12),s=e-i*12;return new Date(Date.UTC(i,s,1))}else{const i=Math.floor(e/12),s=e-i*12;return new Date(i,s,1)}}},year:{milliseconds:cl,hierarchy:void 0,encode(e,t){return t?e.getUTCFullYear():e.getFullYear()},decode(e,t){let i;return t?(i=new Date,i.setUTCFullYear(e),i.setUTCMonth(0,1),i.setUTCHours(0,0,0,0)):i=new Date(e,0,1,0,0,0,0),i}}};function ul(e){return typeof e=="string"?{unit:e,step:1,epoch:void 0,utc:!1}:{unit:e.unit,step:e.step??1,epoch:e.epoch,utc:e.utc??!1}}function dl(e,t,i,s){if(i==null)return 0;const n=hl[e];return Math.floor(n.encode(new Date(i),s))%t}function Go(e,t,i,s,n){const r=hl[t];return Math.floor((r.encode(new Date(e),s)-n)/i)}function pl(e,t,i,s,n){return hl[t].decode(e*i+n,s)}function Mh(e,t,i,s,n){const r=new Date(e),o=Go(r,t,i,s,n);return pl(o,t,i,s,n)}function Sh(e,t,i,s,n){const r=new Date(Number(e)-1),o=Go(r,t,i,s,n);return pl(o+1,t,i,s,n)}function $i(e,t){const{unit:i,step:s,epoch:n,utc:r}=ul(e),o=dl(i,s,n,r);return Mh(t,i,s,r,o)}function ox(e,t){const{unit:i,step:s,epoch:n,utc:r}=ul(e),o=dl(i,s,n,r);return Sh(t,i,s,r,o)}function ax(e,t){const{unit:i,step:s,epoch:n,utc:r}=ul(e),o=dl(i,s,n,r);return pl(Go(Sh(t,i,s,r,o),i,s,r,o)-1,i,s,r,o)}function lx(e,t){const{unit:i,step:s,epoch:n,utc:r}=ul(e),o=dl(i,s,n,r);return pl(Go(Mh(t,i,s,r,o),i,s,r,o)+1,i,s,r,o)}function jp(e,t,i){if(e.valueOf()>t.valueOf()&&([e,t]=[t,e],i!=null&&(i=[1-i[1],1-i[0]])),i!=null){const s=t.valueOf()-e.valueOf(),n=e.valueOf();e=new Date(n+i[0]*s),t=new Date(n+i[1]*s)}return[new Date(e),new Date(t)]}function Dh(e,t,i,{extend:s=!1,visibleRange:n=[0,1],limit:r,defaultAlignment:o="start"}={}){const a=ul(e),{unit:l,step:c,utc:h}=a;let u;a.epoch!=null?u=a.epoch:o==="interval"?u=void 0:t.valueOf()>i.valueOf()?u=i:u=t;const d=dl(a.unit,a.step,u,a.utc);let[p,g]=jp(t,i,n);p=s?Mh(p,l,c,h,d):Sh(p,l,c,h,d),g=s?Sh(g,l,c,h,d):Mh(g,l,c,h,d);const m=Go(p,l,c,h,d);let b=Go(g,l,c,h,d);return r!=null&&b-m>r&&(b=m+r),{range:[m,b],unit:l,step:c,utc:h,offset:d}}function Bp(e,t,i,s){const{range:[n,r]}=Dh(e,t,i,s);return Math.abs(r-n)}function Wi(e,t,i,s){const{range:[n,r],unit:o,step:a,utc:l,offset:c}=Dh(e,t,i,s),h=[];for(let u=n;u<=r;u+=1){const d=pl(u,o,a,l,c);h.push(d)}return h}function Ih(e,t,i,{extend:s,visibleRange:n,limit:r,defaultAlignment:o}={}){const{range:[a]}=Dh(e,t,i,{extend:s,visibleRange:n,limit:r,defaultAlignment:o}),{range:[l]}=Dh(e,t,i,{extend:s,limit:r,defaultAlignment:o});return a-l}function _s(e){return typeof e=="string"?e:e.unit}function $n(e){return typeof e=="string"?1:e.step??1}function gl(e){return typeof e=="string"?void 0:e.epoch}function fl(e){return hl[_s(e)].hierarchy}function xi(e){return $n(e)*hl[_s(e)].milliseconds}var Er=class{constructor(){this.enabled=!0}};f([x],Er.prototype,"enabled",2),f([x],Er.prototype,"stroke",2),f([x],Er.prototype,"strokeWidth",2),f([x],Er.prototype,"strokeOpacity",2);var pt=class extends re{constructor(){super(...arguments),this.enabled=!0,this.border=new Er,this._cachedFormatter=void 0}formatValue(e,t,i,s){const{formatter:n,format:r}=this;let o;if(n!=null&&(o??(o=e(n,s))),r!=null){let a=this._cachedFormatter;(a==null||a.type!==t||a.format!==r)&&(a={type:t,format:r,formatter:Po.getFormatter(t,r)},this._cachedFormatter=a),o??(o=a.formatter?.(i))}return o!=null?String(o):void 0}};f([x],pt.prototype,"enabled",2),f([x],pt.prototype,"border",2),f([x],pt.prototype,"color",2),f([x],pt.prototype,"cornerRadius",2),f([x],pt.prototype,"fill",2),f([x],pt.prototype,"fillOpacity",2),f([x],pt.prototype,"fontStyle",2),f([x],pt.prototype,"fontWeight",2),f([x],pt.prototype,"fontSize",2),f([x],pt.prototype,"fontFamily",2),f([x],pt.prototype,"formatter",2),f([x],pt.prototype,"format",2),f([x],pt.prototype,"padding",2),f([x],pt.prototype,"itemStyler",2);function _o(e){const{enabled:t=!1,stroke:i}=e?.border??{},n=e?.fill!=null||t&&i!=null?e?.padding:null;if(n==null)return{bottom:0,left:0,right:0,top:0};if(typeof n=="number")return{bottom:n,left:n,right:n,top:n};{const{bottom:r=0,left:o=0,right:a=0,top:l=0}=n;return{bottom:r,left:o,right:a,top:l}}}function zL(e,t,i=0,s=0){const n=ln(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 FL(e,t){return e??(t?0:10)}function jL(e,t,i,s){return e&&!t?i*s===-1?"top":"bottom":"middle"}function BL(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 Vp(e,t){if(e!=null){if(typeof e=="string")return e;if(Ne(e)&&t!=null)return e[_s(t)]}}function VL(e,t,i,s,n){const r=Vp(e.format,s)??(typeof e.format=="string"?e.format:void 0);if(r==null)return{width:0,height:0};const o=Tr(r),a=s?fl(s):void 0,l=Vp(t?.format,a),c=l?Tr(l):o,h=new Date(i[0]),u=new Date(i[i.length-1]),d=a?Wi(a,new Date(i[0]),new Date(i[i.length-1]),{extend:!0}):void 0;let p=0,g=0;if(o!=null){const m=_o(e),b=m.left+m.right,y=m.top+m.bottom;let v,M;d!=null&&d.length>1?(v=d[0],M=d[1]):(v=h,M=u);const S=Wi(s,v,M,{limit:50});for(const D of S){const A=o(D),{width:I,height:L}=n.measureLines(A);p=Math.max(p,I+b),g=Math.max(g,L+y)}}if(c!=null&&d!=null){const m=_o(t),b=m.left+m.right,y=m.top+m.bottom;for(const v of d){const M=c(v),{width:S,height:D}=n.measureLines(M);p=Math.max(p,S+b),g=Math.max(g,D+y)}}return{width:Math.ceil(p),height:Math.ceil(g)}}function GL(e,t,i,s,n){const r=_o(n),o=r.left+r.right,a=r.top+r.bottom,l=[];for(const{tickLabel:c,translation:h}of e){if(!c)continue;const{x:u,y:d}=i.transformBBox(new U(t,h,0,0)),p=s.measureLines(c),g=p.width+o,m=p.height+a;l.push({point:{x:u,y:d},label:{text:c,width:g,height:m}})}return l}function _L({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 Gp=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=Bt(e)?e:e.optionsKey;this.moduleMap.get(t)?.moduleInstance.destroy(),this.moduleMap.delete(t)}getModule(e){return this.moduleMap.get(Bt(e)?e:e.optionsKey)?.moduleInstance}isEnabled(e){return this.moduleMap.has(Bt(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()}},Hs=class extends Lt{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.strokeWidth=1}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:g,lineDashOffset:m,lineCap:b,lineJoin:y}=this;this.applyStrokeAndAlpha(t),t.lineWidth=h,g&&t.setLineDash([...g]),m&&(t.lineDashOffset=m),b&&(t.lineCap=b),y&&(t.lineJoin=y),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)}};Hs.className="Range",f([F()],Hs.prototype,"x1",2),f([F()],Hs.prototype,"y1",2),f([F()],Hs.prototype,"x2",2),f([F()],Hs.prototype,"y2",2),f([F()],Hs.prototype,"startLine",2),f([F()],Hs.prototype,"endLine",2),f([F()],Hs.prototype,"horizontal",2);function HL(e){return e!=null&&Object.hasOwn(e,"toString")&&Bt(e.toString())}function UL(e){return e!=null&&Object.hasOwn(e,"valueOf")&&je(e.valueOf())}function Ah(e){return je(e)||cd(e)||UL(e)}function $L(e,t){return e!=null&&(!t||Ah(e))}function _p(e){return HL(e)&&Object.hasOwn(e,"id")?e.id:e}function cx(e){switch(e.type){case"line":return e.value;case"range":return e.range}}function hx(e,t){const i=cx(e);if(i==null)return!1;const s=Ye.is(t)||ds.is(t),n=r=>$L(r,s)&&!isNaN(t.convert(r,{clamp:!0}));if(e.type==="range"){const[r,o]=i;return n(r)&&n(o)}else return n(i)}var WL={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}},YL={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}},KL={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}},ZL={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}},Yi=class extends re{constructor(){super(...arguments),this.fontSize=14,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}};f([x],Yi.prototype,"enabled",2),f([x],Yi.prototype,"text",2),f([x],Yi.prototype,"fontStyle",2),f([x],Yi.prototype,"fontWeight",2),f([x],Yi.prototype,"fontSize",2),f([x],Yi.prototype,"fontFamily",2),f([x],Yi.prototype,"padding",2),f([x],Yi.prototype,"color",2),f([x],Yi.prototype,"position",2),f([x],Yi.prototype,"rotation",2),f([x],Yi.prototype,"parallel",2);var vi=class extends re{constructor(){super(),this.id=cs(this),this.defaultColorRange=[],this.fill="#c16068",this.label=new Yi,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.position="top",this.rangeGroup=new ge({name:this.id}),this.lineGroup=new ge({name:this.id}),this.labelGroup=new ge({name:this.id}),this.crossLineRange=new Hs,this.crossLineLabel=new To,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||!hx(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){if(this.data=void 0,!e)return;const{type:t,range:i,value:s,scale:n,clippedRange:r,strokeWidth:o=0}=this;if(!n)return;const a=n.bandwidth??0,l=n.step??0,c=n instanceof pn?(l-a)/2:0;let[h,u]=_t(r);h-=a,u+=a;let d,p,g,m;if(t==="line"){const b=a/2;if(d=n.convert(s)+b,p=NaN,g=n.convert(s,{clamp:!0})+b,m=NaN,g>=u||g<=h)return}else if(i){const[b,y]=i,[v,M]=Gb(b,y);if(d=n.convert(b,{alignment:v}),p=n.convert(y,{alignment:M}),g=n.convert(b,{clamp:!0,alignment:v}),m=n.convert(y,{clamp:!0,alignment:M}),g>m&&([g,m]=[m,g],[d,p]=[p,d]),g>=u||m<=h)return;Number.isFinite(d)&&(g-=c),Number.isFinite(p)&&(p+=a,m+=a+c)}else return;g=rl(g,r),m=rl(m,r),d-c>=g&&(d-=c),p+c<=m&&(p+=c),this.startLine=o>0&&d>=g&&d<=g+c,this.endLine=o>0&&p>=m-a-c&&p<=m,this.data=[g,m],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?KL:ZL)[i]:(e?WL:YL)[i]}positionLabel(e){const{crossLineLabel:t,label:i,anchor:s}=this;t.rotation=Qt(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 To;t.fontFamily=e.fontFamily,t.fontSize=e.fontSize,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.text=e.text,t.rotation=Qt(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)))}};vi.className="CrossLine",f([x],vi.prototype,"enabled",2),f([x],vi.prototype,"type",2),f([x],vi.prototype,"range",2),f([x],vi.prototype,"value",2),f([x],vi.prototype,"defaultColorRange",2),f([x],vi.prototype,"fill",2),f([x],vi.prototype,"fillOpacity",2),f([x],vi.prototype,"stroke",2),f([x],vi.prototype,"strokeWidth",2),f([x],vi.prototype,"strokeOpacity",2),f([x],vi.prototype,"lineDash",2),f([x],vi.prototype,"label",2);var Ch=class{constructor(){this.enabled=!0,this.width=1,this.style=[{fill:void 0,fillOpacity:1,stroke:void 0,strokeWidth:void 0,lineDash:[]}]}};f([x],Ch.prototype,"enabled",2),f([x],Ch.prototype,"width",2),f([x],Ch.prototype,"style",2);var Or=class extends re{};f([x],Or.prototype,"placement",2),f([x],Or.prototype,"step",2),f([x],Or.prototype,"values",2),f([x],Or.prototype,"minSpacing",2),f([x],Or.prototype,"maxSpacing",2);var it=class extends re{constructor(){super(...arguments),this.enabled=!0,this.border=new Er,this.wrapping="never",this.truncate=!1,this.spacing=5,this.color="#575757",this.avoidCollisions=!0,this.mirrored=!1,this.parallel=!1,this._formatters={"component:year":void 0,"component:month":void 0,"component:day":void 0,"component:none":void 0,"long:year":void 0,"long:month":void 0,"long:day":void 0,"long:none":void 0}}getSideFlag(){return this.mirrored?1:-1}formatValue(e,t,i,s={dateStyle:"long",truncateDate:void 0}){const{formatter:n,format:r}=this,{type:o,value:a,domain:l,boundSeries:c}=t,h=t.type==="number"?t.fractionDigits:void 0,u=t.type==="date"?t.unit:void 0;let d;if(n!=null){const p=t.type==="date"?t.step:void 0;d=e(n,{value:a,index:i,domain:l,fractionDigits:h,unit:u,step:p,boundSeries:c})}if(r!=null&&d==null){const{specifier:p,dateStyle:g,truncateDate:m}=s,b=`${g}:${m??"none"}`;let y=this._formatters[b];const v=Po.mergeSpecifiers(p,r);(y==null||y.type!==o||y.unit!==u||!Nt(y.mergedFormat,v))&&(y={type:o,mergedFormat:v,unit:u,formatter:Po.getFormatter(o,v,u,g,s)},this._formatters[b]=y),d=y.formatter?.(a,h)}return d!=null?String(d):void 0}};f([x],it.prototype,"enabled",2),f([x],it.prototype,"border",2),f([x],it.prototype,"cornerRadius",2),f([x],it.prototype,"fill",2),f([x],it.prototype,"fillOpacity",2),f([x],it.prototype,"fontStyle",2),f([x],it.prototype,"fontWeight",2),f([x],it.prototype,"fontSize",2),f([x],it.prototype,"fontFamily",2),f([x],it.prototype,"wrapping",2),f([x],it.prototype,"truncate",2),f([x],it.prototype,"spacing",2),f([x],it.prototype,"minSpacing",2),f([x],it.prototype,"color",2),f([x],it.prototype,"rotation",2),f([x],it.prototype,"avoidCollisions",2),f([x],it.prototype,"mirrored",2),f([x],it.prototype,"padding",2),f([x],it.prototype,"parallel",2),f([x],it.prototype,"itemStyler",2),f([x],it.prototype,"formatter",2),f([x],it.prototype,"format",2);var Lh=class{constructor(){this.enabled=!0,this.width=1,this.stroke=void 0}};f([x],Lh.prototype,"enabled",2),f([x],Lh.prototype,"width",2),f([x],Lh.prototype,"stroke",2);var Pr=class extends re{constructor(){super(...arguments),this.enabled=!0,this.width=1,this.size=6}};f([x],Pr.prototype,"enabled",2),f([x],Pr.prototype,"width",2),f([x],Pr.prototype,"size",2),f([x],Pr.prototype,"stroke",2);var fs=class extends re{constructor(){super(...arguments),this.caption=new ct,this.enabled=!1,this.spacing=ct.SMALL_PADDING,this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always"}};f([x],fs.prototype,"enabled",2),f([x],fs.prototype,"text",2),f([x],fs.prototype,"spacing",2),f([x],fs.prototype,"fontStyle",2),f([x],fs.prototype,"fontWeight",2),f([x],fs.prototype,"fontSize",2),f([x],fs.prototype,"fontFamily",2),f([x],fs.prototype,"color",2),f([x],fs.prototype,"wrapping",2),f([x],fs.prototype,"formatter",2);var ux=(e=>(e[e.TickAndDomain=0]="TickAndDomain",e[e.TicksOnly=1]="TicksOnly",e[e.Off=2]="Off",e))(ux||{});function dx(e){const[t,i]=_t(e.range),s=Math.floor(t),n=Math.ceil(i);return{min:s,max:n,visible:s!==n}}var Hp=Math.PI*2,XL=Hp/2;function qL(e,t){return Math.abs(t-e)<XL?t:e>t?t+Hp:t-Hp}function px(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:g}=l,m=l.opacity;return(h==="added"||s(c.offset))&&({x1:u,x2:d,y1:p,y2:g}=c,m=0),{x1:u,x2:d,y1:p,y2:g,opacity:m,phase:gs[h]}},toFn(l,c,h){const{x1:u,x2:d,y1:p,y2:g}=c;let m=1;return h==="removed"&&(m=0),{x1:u,x2:d,y1:p,y2:g,opacity:m}},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:gs.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:g,rotationCenterY:m,rotation:b}=u,y=l.opacity;return h==="removed"||s(u.y)?b=c.rotation:(h==="added"||s(l.datum.y))&&({x:d,y:p,rotationCenterX:g,rotationCenterY:m,rotation:b}=c,y=0),{x:d,y:p,rotationCenterX:g,rotationCenterY:m,rotation:b,opacity:y,phase:gs[h]}},toFn(l,c,h){const{x:u,y:d,rotationCenterX:p,rotationCenterY:g}=c;let m=0,b=1;return h==="added"?m=c.rotation:h==="removed"?(b=0,m=c.rotation):m=qL(l.previousDatum?.rotation??c.rotation,c.rotation),{x:u,y:d,rotationCenterX:p,rotationCenterY:g,rotation:m,opacity:b,finish:{rotation:c.rotation}}}},group:{fromFn(l,c){const{translationX:h,translationY:u}=l;return{translationX:h,translationY:u,phase:gs.updated}},toFn(l,c){const{translationX:h,translationY:u}=c;return{translationX:h,translationY:u}}}}}function gx(){return(e,t)=>({translationX:t.translationX,translationY:t.translationY})}function Th(){return(e,t)=>({x:t.x,y:t.y,rotationCenterX:t.rotationCenterX,rotationCenterY:t.rotationCenterY,rotation:t.rotation})}function Up(){return(e,t)=>{const{x1:i,x2:s,y1:n,y2:r}=t;return{x1:i,x2:s,y1:n,y2:r}}}function fx(){return(e,t)=>{const{x1:i,x2:s,y1:n,y2:r}=t;return{x:i,y:n,width:s-i,height:r-n}}}var mx=(e=>(e[e.TickLines=0]="TickLines",e[e.AxisLine=1]="AxisLine",e[e.TickLabels=2]="TickLabels",e))(mx||{});function yx(e,t){return e.domain===t.domain&&e.rangeExtent===t.rangeExtent&&e.nice===t.nice&&e.gridLength===t.gridLength&&e.visibleRange[0]===t.visibleRange[0]&&e.visibleRange[1]===t.visibleRange[1]&&e.initialPrimaryTickCount?.unzoomed===t.initialPrimaryTickCount?.unzoomed&&e.initialPrimaryTickCount?.zoomed===t.initialPrimaryTickCount?.zoomed}var fn=class VS{constructor(t,i){this.moduleCtx=t,this.scale=i,this.id=cs(this),this._crossLines=[],this.nice=!0,this.reverse=!1,this.keys=[],this.interval=new Or,this.dataDomain={domain:[],clipped:!1},this.title=new fs,this.gridLength=0,this.gridPadding=0,this.seriesAreaPadding=0,this.layoutConstraints={stacked:!0,align:"start",width:100,unit:"percent"},this.boundSeries=[],this.includeInvisibleDomains=!1,this.interactionEnabled=!0,this.axisGroup=new ge({name:`${this.id}-axis`}),this.tickLineGroup=this.axisGroup.appendChild(new Co({name:`${this.id}-Axis-tick-lines`,zIndex:0})),this.tickLabelGroup=this.axisGroup.appendChild(new Co({name:`${this.id}-Axis-tick-labels`,zIndex:2})),this.labelGroup=new ge({name:`${this.id}-Labels`,zIndex:11}),this.gridGroup=new hi({name:`${this.id}-Axis-grid`,zIndex:2}),this.gridFillGroup=this.gridGroup.appendChild(new ge({name:`${this.id}-gridFills`})),this.gridLineGroup=this.gridGroup.appendChild(new ge({name:`${this.id}-gridLines`})),this.crossLineRangeGroup=new Co({name:`${this.id}-CrossLines-Range`,zIndex:6}),this.crossLineLineGroup=new Co({name:`${this.id}-CrossLines-Line`,zIndex:10}),this.crossLineLabelGroup=new Co({name:`${this.id}-CrossLines-Label`,zIndex:15}),this.tickLabelGroupSelection=gi.select(this.tickLabelGroup,To,!1),this.line=new Lh,this.tick=new Pr,this.gridLine=new Ch,this.label=this.createLabel(),this.defaultTickMinSpacing=VS.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.cleanup=new at,this.isHovering=!1,this.range=[0,1],this.visibleRange=[0,1],this.animatable=!0,this.tickLayout=void 0,this.formatterBoundSeries=new XD(()=>{const{direction:s,boundSeries:n}=this;return on(n.flatMap(r=>r.getFormatterContext(s)))}),this.moduleMap=new Gp,this.range=this.scale.range.slice(),this.crossLines.forEach(s=>this.initCrossLine(s)),this.cleanup.register(this.moduleCtx.widgets.containerWidget.addListener("mousemove",s=>this.onMouseMove(s)))}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}get type(){return this.constructor.type??""}get primaryLabel(){}get primaryTick(){}isCategoryLike(){return!1}resetAnimation(t){}onMouseMove(t){const s=this.tickLabelGroup.pickNode(t.currentX,t.currentY)?.datum,{textUntruncated:n=void 0}=s??{};n!=null?(this.moduleCtx.tooltipManager.updateTooltip(this.id,{canvasX:t.currentX,canvasY:t.currentY,showArrow:!1},[{type:"structured",title:n}]),this.isHovering=!0):this.isHovering&&(this.moduleCtx.tooltipManager.removeTooltip(this.id),this.isHovering=!1)}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.cleanup.flush()}setScaleRange(t){const{range:i,scale:s}=this,n=(i[1]-i[0])/(t[1]-t[0]),r=n*t[0],o=i[0]-r;s.range=[o,o+n]}updateScale(){const{range:[t,i]}=this;this.setScaleRange(this.visibleRange),this.crossLines.forEach(s=>{s.clippedRange=[t,i]})}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]=_t(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]=_t([i[0]-n*s[0],i[0]-n*s[0]+n]);return t<r?t-r:t>o?t-o:0}createDatumFormatter(t,i){}onGridLengthChange(t,i){i^t&&this.onGridVisibilityChange(),this.crossLines.forEach(s=>this.initCrossLine(s))}onGridVisibilityChange(){}createLabel(){return new it}update(){this.formatterBoundSeries.clear(),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={border:s.border,color:s.color,cornerRadius:s.cornerRadius,fill:s.fill,fillOpacity:s.fillOpacity,fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight,padding:s.padding,spacing:s.spacing};let r;s.itemStyler&&(r=this.cachedCallWithContext(s.itemStyler,{...t,...n}));const o=Ee(r,i,n);return{border:o.border,color:o.color,cornerRadius:o.cornerRadius,fill:o.fill,fillOpacity:o.fillOpacity,fontFamily:o.fontFamily,fontSize:o.fontSize,fontStyle:o.fontStyle,fontWeight:o.fontWeight,padding:o.padding,spacing:o.spacing}}getTickSize(t=this.tick){return t.enabled?t.size:0}processData(){this.invalidateLayoutCache();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}calculateDomain(t){const{dataDomain:{domain:i},range:s,nice:n,scale:r,gridLength:o}=this,a=zo(s),l=[0,1];this.updateScale();const{unzoomedTickLayoutCache:c}=this;let h;if(c==null||!yx(c,{domain:i,rangeExtent:a,nice:n,gridLength:o,visibleRange:l,initialPrimaryTickCount:t})){const u=r.range;this.setScaleRange([0,1]);const d=n?0:2;h=this.calculateTickLayout(i,d,[0,1],t),r.range=u,this.unzoomedTickLayoutCache={domain:i,rangeExtent:a,nice:n,gridLength:o,visibleRange:l,initialPrimaryTickCount:t,tickLayout:h}}else h=c.tickLayout;return this.updateScale(),r.domain=h.niceDomain,{unzoomedTickLayout:h,domain:r.domain}}calculateLayout(t,i){this.chartLayout=i;const{visibleRange:s,nice:n}=this,r=s[0]===0&&s[1]===1,{unzoomedTickLayout:o,domain:a}=this.calculateDomain(t);let l;if(r)l=o;else{const{range:g,gridLength:m}=this,b=zo(g),y=n?1:2,{tickLayoutCache:v}=this;v==null||!yx(v,{domain:a,rangeExtent:b,nice:n,gridLength:m,visibleRange:s,initialPrimaryTickCount:t})?(l=this.calculateTickLayout(a,y,s,t),this.tickLayoutCache={domain:a,rangeExtent:b,nice:n,gridLength:m,visibleRange:s,initialPrimaryTickCount:t,tickLayout:l}):l=v.tickLayout}const{rawTickCount:c=0,fractionDigits:h,bbox:u}=l,d=o.rawTickCount??0,p=c!==0&&d!==0?{zoomed:c,unzoomed:d}:void 0;return this.tickLayout=l.layout,this.layout.label={fractionDigits:h,spacing:this.label.spacing,format:this.label.format},this.layoutCrossLines(),{primaryTickCount:p,bbox:u}}invalidateLayoutCache(){this.unzoomedTickLayoutCache=void 0,this.tickLayoutCache=void 0,this.tickLayout=void 0}updateCrossLines(){const t=this.hasDefinedDomain()||this.hasVisibleSeries();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})}tickFormatter(t,i,s,n,r,o="long"){const{moduleCtx:a,label:l}=this,{formatManager:c}=a,h=s?this.primaryLabel:void 0,u=this.tickFormatParams(t,i,n,r),d=this.formatterBoundSeries.get();let p,g,m;if(u.type==="number")p=u.fractionDigits;else if(u.type==="date"){const{unit:D,step:A,epoch:I}=u;g={unit:D,step:A,epoch:I},m=u.truncateDate}const b=this.uncachedCallWithContext.bind(this),y={datum:void 0,seriesId:void 0,legendItemName:void 0,key:void 0,source:"axis-label",property:this.direction,domain:t,boundSeries:d},v=h??l,M=s?l.format:void 0,S={specifier:Po.mergeSpecifiers(h?.format,l.format),truncateDate:m};return(D,A)=>{const I=this.datumFormatParams(D,y,p,g,o);return I.value=D,v.formatValue(b,I,A,{specifier:M,dateStyle:o,truncateDate:m})??c.format(b,I,S)??c.defaultFormat(I,S)}}formatDatum(t,i,s,n,r,o,a,l,c,h){if(i==null)return"";const{moduleCtx:u,direction:d,dataDomain:p}=this;l??(l=p.domain);const{formatManager:g}=u,m=this.formatterBoundSeries.get();let b;switch(s){case"crosshair":case"annotation-label":b=this.layout.label.fractionDigits+1;break;case"series-label":b=2;break;case"tooltip":b=3;break;case"legend-label":b=void 0;break}const y=this.datumFormatParams(i,{source:s,datum:o,seriesId:n,legendItemName:r,key:a,property:d,domain:l,boundSeries:m},b,void 0,"long"),{type:v,value:M}=y,S=this.createCallWithContext(t),D=c?.formatValue(S,v,M,h??y)??g.format(S,y)??this.label.formatValue(S,y,NaN)??g.defaultFormat(y);return String(D)}getBBox(){return this.axisGroup.getBBox()}initCrossLine(t){t.scale=this.scale,t.gridLength=this.gridLength}hasVisibleSeries(){return this.boundSeries.some(t=>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))}getTitleFormatterParams(t){const{direction:i}=this,s=this.formatterBoundSeries.get();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:Ye.is(t)||ds.is(t),getCanvasBounds:()=>dt.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),scaleInvert:i=>t.invert(i,!0),scaleInvertNearest:i=>t.invert(i,!0),formatScaleValue:(i,s,n)=>this.formatDatum(void 0,i,s,void 0,void 0,void 0,void 0,void 0,n),attachLabel:i=>this.attachLabel(i),inRange:(i,s)=>this.inRange(i,s),getRangeOverflow:i=>this.getRangeOverflow(i),pickBand:i=>this.pickBand(i)}}pickBand(t){if(!pn.is(this.scale))return;const{scale:i,range:s}=this,n=i.invert(this.isVertical()?t.y:t.x,!0),r=i.bandwidth??0,a=((i.step??0)-r)/2,l=i.convert(n),c=l-a,h=l+r+a;return{id:this.id,value:n,band:[rl(c,s),rl(h,s)],position:l}}isVertical(){return this.direction==="y"}isReversed(){return this.reverse}cachedCallWithContext(t,...i){const{callbackCache:s,chartService:n}=this.moduleCtx;return s.call([this,n],t,...i)}uncachedCallWithContext(t,...i){const{chartService:s}=this.moduleCtx;return us([this,s],t,...i)}createCallWithContext(t){const{chartService:i}=this.moduleCtx;return(s,...n)=>us([t,this,i],s,...n)}};fn.defaultTickMinSpacing=50,fn.CrossLineConstructor=vi,f([x],fn.prototype,"nice",2),f([x],fn.prototype,"reverse",2),f([x],fn.prototype,"keys",2),f([x],fn.prototype,"interval",2),f([x],fn.prototype,"title",2),f([Vn((e,t,i)=>e.onGridLengthChange(t,i))],fn.prototype,"gridLength",2);var $p=fn;function Fi(e){return e instanceof Date?e.getTime():e}function ml(e){return e<Bo?"millisecond":e<Un?"second":e<wr?"minute":e<wr*23?"hour":e<28*Nr?"day":e<cl?"month":"year"}function Wp(e){if(e.length===0)return"millisecond";if(e.length===1)return kh(e[0]);let t=1/0;for(let i=1;i<e.length;i++)t=Math.min(t,Math.abs(e[i].valueOf()-e[i-1].valueOf()));return ml(t)}function kh(e){return $i("second",e)<e?"millisecond":$i("minute",e)<e?"second":$i("hour",e)<e?"minute":$i("day",e)<e?"hour":$i("month",e)<e?"day":$i("year",e)<e?"month":"year"}function Yp(e){const[t,i]=e.length===0?[0,0]:_t([e[0].valueOf(),e[e.length-1].valueOf()]),s=new Date(t).getFullYear(),n=new Date(i).getFullYear();if(s!==n)return;const r=new Date(t).getMonth(),o=new Date(i).getMonth();if(r!==o)return"year";const a=new Date(t).getDate(),l=new Date(i).getDate();return a!==l?"month":"day"}function bx(e,t,i){if(i==null||i[0]===0&&i[1]===1)return{ticks:e,count:e.length,firstTickIndex:0};const s=se(0,Math.floor(i[0]*e.length),e.length),n=se(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,firstTickIndex:r}}var Ho=class GS extends pn{constructor(){super(...arguments),this.type="category",this.defaultTickCount=0,this.index=new Map,this.indexInitialized=!1,this._domain=[]}static is(t){return t instanceof GS}set domain(t){this._domain!==t&&(this.invalid=!0,this._domain=t,this.index.clear(),this.indexInitialized=!1)}get domain(){return this._domain}get bands(){return this._domain}normalizeDomains(...t){let i;const s=new Set;let n=!0;for(const r of t)s.has(r)||(s.add(r),i==null?i=xx(r):(n&&(n=QL(r,i)),i=xx([...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){const{bands:n}=this;let{tickCount:r}=t;if(r===0){const m=n.length>1?1:0;return{ticks:[n[m]],count:void 0,firstTickIndex:m}}let o=r!=null&&r!==0?n.length/r|0:1;if(o=Sp(o),o<=1)return bx(i,!1,s);r=n.length/o|0;const a=o*r,l=Sp((n.length-a)/2|0),c=se(0,Math.floor((s?.[0]??0)*n.length),n.length),h=se(0,Math.ceil((s?.[1]??1)*n.length),n.length),u=Math.floor((c-l)/o)*o+l,d=Math.ceil((h-l)/o)*o+l,p=[];for(let m=u;m<d;m+=o)m>=0&&m<n.length&&p.push(n[m]);let g=p.length>0?this.findIndex(p[0]):void 0;return g!=null&&(g=Math.floor((g-l)/o)),{ticks:p,count:void 0,firstTickIndex:g}}findIndex(t){const{index:i,indexInitialized:s}=this;if(!s){const{domain:n}=this;for(let r=0;r<n.length;r++)i.set(Fi(n[r]),r);this.indexInitialized=!0}return i.get(Fi(t))}};function xx(e){let t;const i=new Set;for(const s of e){const n=Fi(s),r=i.size;i.add(n),i.size!==r?t?.push(s):t??(t=e.slice(0,i.size))}return t??e}function QL(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}function Kp(e,t){return e.valueOf()-t.valueOf()}function JL(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(Kp);return Xp(t)==null?JL(t):t}function Xp(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 gt=(e,t)=>({duration:xi(e)*t,timeInterval:e,step:t}),qp=[gt({unit:"second"},1),gt({unit:"second"},5),gt({unit:"second"},15),gt({unit:"second"},30),gt({unit:"minute"},1),gt({unit:"minute"},5),gt({unit:"minute"},15),gt({unit:"minute"},30),gt({unit:"hour"},1),gt({unit:"hour"},3),gt({unit:"hour"},6),gt({unit:"hour"},12),gt({unit:"day"},1),gt({unit:"day"},2),gt({unit:"day",step:7},1),gt({unit:"day",step:7},2),gt({unit:"day",step:7},3),gt({unit:"month"},1),gt({unit:"month"},2),gt({unit:"month"},3),gt({unit:"month"},4),gt({unit:"month"},6),gt({unit:"year"},1)],vx=[1,2,5,10];function Mx(e,t){return Math.abs(Math.round(e)-e)<t}function Sx(e,t,i){return Math.abs(t-e)>=i?Math.abs(t-e)/i+1:1}function yl(e,t,i,s,n,r){if(e===t)return{ticks:[e],count:1,firstTickIndex:0};if(i<2)return{ticks:[e,t],count:2,firstTickIndex:0};const o=bl(e,t,i,s,n);if(!Number.isFinite(o))return{ticks:[],count:0,firstTickIndex:void 0};let a=e,l=t;if(Mx(a/o,1e-12)||(a=Math.ceil(a/o)*o),Mx(l/o,1e-12)||(l=Math.floor(l/o)*o),r!=null){const u=l-a,d=t-e,p=e+d*r[0],g=e+d*r[1];r=[(p-a)/u,(g-a)/u]}const{ticks:c}=Nh(a,l,o,r),h=c.at(0);return{ticks:c,count:Sx(a,l,o),firstTickIndex:h==null?void 0:Math.round((h-a)/o)}}var eT=Math.floor(2*rx/Fp*10)/10;function Dx({timeInterval:e,step:t}){const i=xi(e)*t,s=fl(e),n=s?xi(s):void 0;return i<=(n??1/0)*eT}function Ix(e,{weekStart:t}){if(e.unit==="day"&&e.step===7)return t}function wh(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=qp.findLast(p=>(!o||Dx(p))&&l>p.duration),h=qp.find(p=>(!o||Dx(p))&&l<=p.duration);if(c==null)return{unit:"millisecond",step:Math.max(bl(e,t,i,s,n),1)};if(h==null)return{unit:"year",step:a==null?bl(e/cl,t/cl,i,s,n):1};const{timeInterval:u,step:d}=l-c.duration<h.duration-l?c:h;return{unit:u.unit,step:$n(u)*d,epoch:Ix(u,{weekStart:r})}}function bl(e,t,i,s=0,n=1/0){if(e===t)return se(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 vx){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 Ax(e){for(let t=e.length-1;t>=0;t-=1)if(e[t]!=="0")return t+1;return 0}function Cx(e,t){const i=Id(t??",f");if(i==null)return;(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)+Ax(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=Ax(a);return Math.max(0,l-r)}))));const s=Fm(i);return n=>s(Number(n))}function Nh(e,t,i,s){if(!Number.isFinite(i)||i<=0)return{ticks:[],count:0,firstTickIndex:void 0};if(e===t)return{ticks:[e],count:1,firstTickIndex:0};const n=10**Sd(i),r=Math.min(e,t),o=Math.max(e,t);let a,l;if(s!=null&&(s[0]!==0||s[1]!==1)){const u=t-e,d=e+u*s[0],p=t-u*(1-s[1]);a=Math.min(d,p),l=Math.max(d,p)}else a=r,l=o;a=Math.floor(a*n)/n,l=Math.ceil(l*n)/n;const c=[];for(let u=0;;u+=1){const d=Math.round((r+i*u)*n)/n;if(d>o)break;d>=a&&d<=l&&c.push(d)}const h=c.at(0);return{ticks:c,count:Sx(r,o,i),firstTickIndex:h==null?void 0:Math.round((h-r)/i)}}function Uo(e,t){return e>=t?(j.warnOnce("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0):!1}function Lx(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 vx){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 Tx(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),i=Math.max(i,1);const o=Math.max(1,Math.floor(e/(t*i))),a=Math.min(o,Math.ceil(e/(t*s))),l=se(a,Math.floor(n/t),o);return{minTickCount:a,maxTickCount:o,tickCount:l}}var Eh=new Date(1970,0,4),$o=class _S extends Ye{constructor(){super([],[0,1]),this.type="time"}static is(t){return t instanceof _S}toDomain(t){return new Date(t)}convert(t,i){return super.convert(t?.valueOf()??NaN,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]=iT(s,n,t,o);if(Fi(s)===Fi(l)&&Fi(n)===Fi(c))break;s=l,n=c}return[s,n]}ticks(t,i=this.domain,s=[0,1],{extend:n=!1}={}){const{nice:r,interval:o,tickCount:a=Ye.defaultTickCount,minTickCount:l,maxTickCount:c}=t;if(i.length<2)return;const h=i.map(Fi),u=h[0],d=h[h.length-1];if(o!=null){const b=this.getPixelRange();return{ticks:Qp({start:u,stop:d,interval:o,availableRange:b,visibleRange:s,extend:n})??tT({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}}const p=wh(u,d,a,l,c,{weekStart:Eh});if(p==null)return;const g=Wi(p,new Date(u),new Date(d),{visibleRange:s,extend:n}),m=Ih(p,new Date(u),new Date(d),{visibleRange:s,extend:n});return{ticks:g,count:void 0,firstTickIndex:m,timeInterval:p}}};function tT({start:e,stop:t,tickCount:i,minTickCount:s,maxTickCount:n,visibleRange:r,extend:o}){const a=wh(e,t,i,s,n,{weekStart:Eh});return a?Wi(a,new Date(e),new Date(t),{visibleRange:r,extend:o}):[]}function Qp({start:e,stop:t,interval:i,availableRange:s,visibleRange:n,extend:r}){if(!i)return[];if(Ne(i)||typeof i=="string"){const u=Wi(i,new Date(e),new Date(t),{visibleRange:n,extend:r});return Uo(u.length,s)?void 0:u}const o=Math.abs(i);if(Uo(Math.abs(t-e)/o,s))return;const a=qp.findLast(u=>o%u.duration===0);if(a){const{timeInterval:u,step:d,duration:p}=a,g={...u,step:d*$n(u)*Math.round(o/p),epoch:Ix(u,{weekStart:Eh})};return Wi(g,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 iT(e,t,i,s){const{interval:n}=i,r=Math.min(Fi(e),Fi(t)),o=Math.max(Fi(e),Fi(t));let a;if(Ne(n)||typeof n=="string")a=n;else{let u;typeof n=="number"&&(u=(o-r)/Math.max(n,1),Uo(u,s)&&(u=void 0)),u??(u=i.tickCount??Ye.defaultTickCount),a=wh(r,o,u,i.minTickCount,i.maxTickCount,{weekStart:Eh})}if(a==null)return[e,t];const l=Wi(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 Wo=class HS extends ds{constructor(){super(...arguments),this.type="ordinal-time",this.defaultTickCount=Ye.defaultTickCount,this._domain=[],this.isReversed=!1}static is(t){return t instanceof HS}set domain(t){t!==this._domain&&(this.invalid=!0,this._domain=t,this._bands=void 0,this.isReversed=kx(t))}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=Xp(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(t,i,s=[0,1],{extend:n=!1,dropInitial:r=!1}={}){const{interval:o,maxTickCount:a,tickCount:l=a}=t,{bands:c}=this;if(!c.length)return;if(this.refresh(),o==null){const{ticks:v,tickOffset:M,tickEvery:S}=this.getDefaultTicks(i,l,s,n);let D=v.length>0?this.findIndex(v[0]):void 0;return D=D!=null?Math.floor((D-M)/S):void 0,{ticks:v,count:void 0,firstTickIndex:D}}let h,u;i&&i.length>=2?(h=i[0].valueOf(),u=i[i.length-1].valueOf()):(h=c[0].valueOf(),u=c[c.length-1].valueOf());const[d,p]=this.range,g=Math.abs(p-d),m=Qp({start:h,stop:u,interval:o,availableRange:g,visibleRange:s,extend:n})??this.getDefaultTicks(i,l,s,n).ticks,b=[];let y=-1;for(const v of m){const M=this.findIndex(v,1)??-1,S=M===y;y=M,!(r&&M===0)&&M!==-1&&!S&&b.push(c[M])}return{ticks:b,count:void 0,firstTickIndex:void 0}}stepTicks(t,i,s=[0,1],n=!0){const r=i?this.bandDomainIndices(i):void 0,o=this.ticksEvery(r,s,t,0,!1),a=o.at(-1),l=n&&t>1?r?.[1]:void 0,c=l!=null&&a!=null?this.findIndex(a):void 0;return c!=null&&l!=null&&l-c<t&&o.pop(),o}bandCount(t=[0,1]){const{domain:i}=this,s=Math.floor(t[0]*i.length);return Math.ceil(t[1]*i.length)-s}getDefaultTicks(t,i,s,n){const{bands:r}=this,o=Math.ceil(r.length/i),a=Math.floor(o/2),l=t?this.bandDomainIndices(t):void 0;return{ticks:this.ticksEvery(l,s,o,a,n),tickOffset:a,tickEvery:o}}bandDomainIndices(t){const i=kx(t),s=this.findIndex(t[i?t.length-1:0],1)??0,n=this.findIndex(t[i?0:t.length-1],1)??this.bands.length-1;return[s,n]}ticksEvery([t,i]=[0,this.bands.length],s,n,r,o){const{bands:a}=this,l=t,c=i-t+1;let h=l+Math.floor(s[0]*c),u=l+Math.ceil(s[1]*c);o&&(h-=n,u+=n),h=Math.max(h,0),u=Math.min(u,a.length);let d;if(n<=1)d=a.slice(h,u);else{d=[];for(let p=h;p<u;p+=1)(p-l+r)%n===0&&d.push(a[p])}return d}};function kx(e){return e.length>0&&e[0]>e[e.length-1]}var wx=5e7,Wn=class US extends ds{constructor(){super(...arguments),this.type="unit-time",this.defaultTickCount=12,this._domain=[],this._bands=void 0}static is(t){return t instanceof US}static supportsInterval(t,i){return Nx(t,i)}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]).bands),this._bands}normalizeDomains(...t){return Dp(...t)}convert(t,i){t instanceof Date||(t=new Date(t));const{domain:s,interval:n}=this;if(s.length<2)return NaN;if(i?.clamp!==!0&&n!=null){const r=t.valueOf(),[o,a]=Oh(s,n),l=Math.min(o.valueOf(),a.valueOf()),c=Math.max(o.valueOf(),a.valueOf());if(r<l||r>=c+xi(n))return NaN}return super.convert(t,i)}calculateBands(t,i,s=!1){if(t===this.domain&&i[0]===0&&i[1]===1&&!s&&this._bands!=null)return{bands:this._bands,firstBandIndex:0};if(t.length<2)return{bands:[],firstBandIndex:void 0};const{interval:n}=this;if(n==null)return{bands:[],firstBandIndex:void 0};const r={visibleRange:i,extend:s};if(!Nx(t,n,r))return{bands:[],firstBandIndex:void 0};const[o,a]=Oh(t,n);if(Bp(n,o,a,r)>wx)return j.warnOnce("the configured unit results in too many bands, ignoring. Supply a larger unit."),{bands:[],firstBandIndex:void 0};const l=Wi(n,o,a,r),c=Ih(n,o,a,r);return{bands:l,firstBandIndex:c}}ticks({interval:t},i=this.domain,s=[0,1],{extend:n=!1}={}){if(i.length<2)return;const{bands:r,firstBandIndex:o}=this.calculateBands(i,s,n),a=this.interval?xi(this.interval):1/0;if(t==null)return{ticks:r,count:void 0,firstTickIndex:o};const l=Math.min(i[0].valueOf(),i[1].valueOf()),c=Math.max(i[0].valueOf(),i[1].valueOf());let h,u,d;Ne(t)||typeof t=="string"?(h=Wi(t,i[0],i[1],{extend:!0,visibleRange:s}),u=0,d=h.length-1):(h=r,u=vr(0,r.length-1,M=>r[M].valueOf()<=l)??0,d=vr(0,r.length-1,M=>r[M].valueOf()<=c)??r.length-1);const p=[];let g;for(let M=u;M<=d;M++){const S=h[M].valueOf(),D=vr(0,r.length-1,I=>r[I].valueOf()<=S),A=D!=null&&D!=g?r[D]:void 0;g=D,A!=null&&S-A.getTime()<=a&&p.push(A)}let m,b;if(this.interval){const M=Oh([new Date(l),new Date(c)],this.interval);m=M[0].valueOf(),b=M[1].valueOf()}else m=l,b=c;let y=Fa(0,p.length-1,M=>p[M].valueOf()>=m)??0,v=vr(0,p.length-1,M=>p[M].valueOf()<=b)??p.length-1;return n&&(y=Math.max(y-1,0),v=Math.min(v+1,p.length-1)),{ticks:p.slice(y,v+1),count:p.length,firstTickIndex:o}}};function Nx(e,t,i){const[s,n]=Oh(e,t);return Bp(t,s,n,i)<=wx}function Oh(e,t){const i=$i(t,e[0]),s=$i(t,e[1]);return[i,s]}function sT(e,t,i,s,n){let[r,o]=_t(t.map(Number));const a=Math.floor(i.unzoomed);if(a<=1){const[y,v]=nT(r,o),M=5*Math.pow(2,-Math.ceil(Math.log2(n[1]-n[0]))),{ticks:S}=yl(y,v,M,void 0,void 0,n),D=[e.toDomain(y),e.toDomain(v)];return s&&D.reverse(),{domain:D,ticks:S}}if(r===o){const y=Math.floor(Math.log10(r)),v=Math.pow(10,y),M=Math.min(v,1),S=a-1;r-=M*Math.floor(S/2),o=r+M*S}let l=r,c=o;l=rT(l,c,a);const h=aT(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 g=[e.toDomain(l),e.toDomain(c)];s&&g.reverse();const m=h*((i.unzoomed-1)/(i.zoomed-1)),b=oT(l,m,Math.floor(i.zoomed));return{domain:g,ticks:b}}function nT(e,t){let i=e,s=t,n=0;do{[i,s]=Lx(i,s);const{ticks:r}=yl(i,s,5);if(r.length%2===1)return[i,s];i-=1,s+=1}while(n++<10);return[e,t]}function rT(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 oT(e,t,i){const s=Sd(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 aT(e,t,i){const s=i-1,n=(t-e)/s;return lT(n)}function lT(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 Jp(){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)}}var cT=18,hT=[1,2,3,4,6,8,9,10,12],uT=new Date(1970,0,4),Ex=class{constructor(e){this.axis=e}estimateTickCount(e,t,i,s,n,r){const{scale:o,label:a}=this.axis,{defaultTickCount:l}=o,c=zo(t),h=zo(i);if(Ho.is(o)){const u=e.length;let d=Math.ceil(c/(h*a.fontSize));return d=Math.min(d,u),{minTickCount:0,maxTickCount:u,tickCount:d}}return Tx(c,h,n,r,l,s)}generateTicks({range:e,domain:t,reverse:i,primaryTickCount:s,defaultTickMinSpacing:n,visibleRange:r,niceMode:o,parallelFlipRotation:a,regularFlipRotation:l,labelX:c,sideFlag:h,removeOverflowLabels:u,removeOverflowThreshold:d=0,sizeLimit:p}){const{label:g,primaryLabel:m,interval:{minSpacing:b,maxSpacing:y}}=this.axis,{parallel:v,fontFamily:M,fontSize:S,fontStyle:D,fontWeight:A}=g,I=s!==void 0,{defaultRotation:L,configuredRotation:C,parallelFlipFlag:w,regularFlipFlag:E}=zL(g.rotation,v,l,a),{maxTickCount:R}=this.estimateTickCount(t,e,r,n,b,y),P=Number.isFinite(R)?R:10,G=jL(v,C,h,w),H={fontFamily:M,fontSize:S,fontStyle:D,fontWeight:A},oe=Gn.getMeasurer({font:H}),me=g.enabled&&g.avoidCollisions,ke=C+L,Te=new cn,xe=de=>{const J=ke+de;cn.updateTransformMatrix(Te,1,1,J,0,0)},Z=({ticks:de},J)=>(xe(J),GL(de,c,Te,oe,g)),ce=(de,J)=>{const{niceDomain:$e,ticks:ht,timeInterval:ut}=de;if(ut==null)return[];xe(J);const Ke=pT(ht),{width:Yt,height:ie}=VL(g,m,$e??t,ut,oe);return _L({width:Yt,height:ie,spacing:Ke},c,Te)},X=(de,J)=>{if(!me)return!1;const $e=C!==0||J!==0,ht=FL(g.minSpacing,$e);return Ox(ce(de,J),ht)||Ox(Z(de,J),ht)};let ye={tickDomain:[],niceDomain:t,ticks:[],rawTicks:[],rawTickCount:void 0,timeInterval:void 0,fractionDigits:0},Se=0,ne=0,ue=!0,q=!1;for(;!q&&ue&&Se<=P;){ne=0;for(const de of this.getTickStrategies({domain:t,range:e,reverse:i,niceMode:o,secondaryAxis:I,sizeLimit:p}))({tickData:ye,index:Se,autoRotation:ne,terminate:q}=de({index:Se,tickData:ye,terminate:q,primaryTickCount:s,defaultTickMinSpacing:n,visibleRange:r,labelsOverlap(){return X(ye,ne)}}));ue=X(ye,ne)}const Q=BL(v,C,ne,h,E),ae=C+ne;if(u&&ye.ticks.length>2){const de=Z(ye,ne),J=ye.ticks.at(-1),$e=de.at(-1);J!=null&&$e!=null&&J.translation+$e.label.width/2>e[1]+d&&(J.tickLabel=void 0,r[0]===0&&r[1]===1&&(ye.ticks[0].tickLabel=void 0))}return{tickData:ye,rotation:ae,textBaseline:G,textAlign:Q}}getTickStrategies({domain:e,range:t,reverse:i,niceMode:s,secondaryAxis:n,sizeLimit:r}){const{label:o,interval:a}=this.axis,l=o.enabled&&o.avoidCollisions,c=o.autoRotate===!0&&o.rotation===void 0,h=[];let u;a.values?u=2:n?u=1:u=0;const d=({index:p,tickData:g,primaryTickCount:m,defaultTickMinSpacing:b,visibleRange:y,terminate:v})=>this.createTickData(e,t,i,s,y,m,b,u,p,g,v,r);if(h.push(d),l&&c){const p=({index:g,tickData:m,labelsOverlap:b,terminate:y})=>({index:g,tickData:m,autoRotation:b()?ln(o.autoRotateAngle):0,terminate:y});h.push(p)}return h}createTickData(e,t,i,s,n,r,o,a,l,c,h,u){const{interval:d}=this.axis,{step:p,values:g,minSpacing:m,maxSpacing:b}=d,{maxTickCount:y,minTickCount:v,tickCount:M}=this.estimateTickCount(e,t,n,o,m,b),S=M-v,D=ce=>Math.max(M-ce,v),A=c.rawTicks,I=p==null&&g==null&&D(l)>v,L={domain:e,reverse:i,niceMode:s,visibleRange:n,primaryTickCount:r,tickGenerationType:a,minTickCount:v,maxTickCount:y,tickCount:0};L.tickCount=D(l);let C=this.getTicks(L);if(I&&Px(C.rawTicks,A)){let ce=l,X=S;for(;ce<=X;){l=(ce+X)/2|0,L.tickCount=D(l);const ye=this.getTicks(L);Px(ye.rawTicks,A)?ce=l+1:(C=ye,X=l-1)}}const{tickDomain:w,niceDomain:E,rawTicks:R,rawTickCount:P,rawFirstTickIndex:G,generatePrimaryTicks:H,primaryTicksIndices:oe,alignment:me,fractionDigits:ke,timeInterval:Te}=C,xe=this.formatTicks({range:t,niceDomain:E,rawTicks:R,rawFirstTickIndex:G,generatePrimaryTicks:H,primaryTicksIndices:oe,alignment:me,fractionDigits:ke,timeInterval:Te,sizeLimit:u}),Z={tickDomain:w,niceDomain:E,rawTicks:R,rawTickCount:P,timeInterval:Te,fractionDigits:ke,ticks:xe};return l+=1,h||(h=p!=null||g!=null),{tickData:Z,index:l,autoRotation:0,terminate:h}}getTimeIntervalTicks(e,t,i,s,n,r){const o=fl(n);if(o==null)return;const{scale:a}=this.axis;if(!$o.is(a)&&!ds.is(a))return;r&&(e=[1-e[1],1-e[0]]);const l=Math.min(a.domain[0].valueOf(),a.domain[a.domain.length-1].valueOf()),c=Math.max(a.domain[0].valueOf(),a.domain[a.domain.length-1].valueOf());let[h,u]=jp(new Date(l),new Date(c),e);h=$i(o,h),h.valueOf()>=l&&(h=ax(o,h)),u=ox(o,u),u.valueOf()<=c&&(u=lx(o,u));const d=Wi(o,h,u),p=xi(n);let g=new Set;const m=Wo.is(a),b=[],y={...s,interval:n};let v,M,S=0;if(Wo.is(a)){const A=this.axis.minimumTimeGranularity,I=_s(n);v=A!=null&&xi(A)>=xi(I)?2:3,M=1;const L=t/i,C=a.bandCount(e)/(L*cT);S=hT.findLast(w=>C>=w)??1}else Wn.is(a)&&(a.interval==null||xi(a.interval)>=p)?v=1:(v=0,M=2);for(let A=0;A<d.length-1;A+=1){const I=d[A],L=d[A+1],C=A===0,w=A===d.length-2,E=L.valueOf()-I.valueOf(),R=[Math.max((l-I.valueOf())/E,0),Math.min((c-I.valueOf())/E,1)];let P;switch(v){case 0:P=dT(y.interval,[I,L],R,!0).ticks;break;case 1:case 3:P=a.ticks(y,[I,L],R,{extend:!0,dropInitial:!0})?.ticks??[];break;case 2:P=a.stepTicks(S,[I,L],void 0,!w);break}if(UD(P,me=>me.valueOf()<I.valueOf()),w||$D(P,me=>{switch(v){case 0:case 3:return me.valueOf()+p>L.valueOf();case 1:case 2:return me.valueOf()>=L.valueOf()}}),P.length===0)continue;const G=P[0],H=Kp(G,I);(v===0?H===0:H<=p)&&(!m||!C)&&g.add(b.length),b.push(...P)}(g.size===0||g.size===1&&g.has(0))&&(g=void 0);let D;return{ticks:b,tickCount:void 0,firstTickIndex:D,primaryTicksIndices:g,alignment:M}}getTicks({domain:e,reverse:t,niceMode:i,visibleRange:s,tickGenerationType:n,tickCount:r,minTickCount:o,maxTickCount:a,primaryTickCount:l}){const{axis:c}=this,{primaryLabel:h,scale:u,interval:d}=c,p={nice:i===0,interval:d.step,tickCount:r,minTickCount:o,maxTickCount:a},g={...p,nice:i===0||i===1};let m;n===1&&l!=null&&Ye.is(u)&&(m=sT(u,e,l,t,s));const b=i===0?m?.domain??u.niceDomain(p,e):e;let y=b,v,M,S,D,A,I;const L=h?.enabled===!0&&g.interval==null,C=u.domain;switch(u.domain=b,n){case 2:if(y=d.values,v=d.values,M=v.length,Wo.is(u)?I=1:Wn.is(u)&&(I=2),Ye.is(u)){const[E,R]=_t(b.map(Number));v=v.filter(P=>Number(P)>=E&&Number(P)<=R).sort((P,G)=>Number(P)-Number(G))}break;case 1:if(m)v=m.ticks,M=m.ticks.length;else{const E=u.ticks(g,b,s);v=E?.ticks??[],M=E?.count}break;default:{if(b.length>0&&g.interval==null&&(Wn.is(u)||L&&($o.is(u)||Wo.is(u)))){const P=b,G=Math.min(P[0].valueOf(),P[P.length-1].valueOf()),H=Math.max(P[0].valueOf(),P[P.length-1].valueOf());D=wh(G,H,r,o,a,{weekStart:h==null?uT:void 0,primaryOnly:!0})}let E;Wo.is(u)?E=c.minimumTimeGranularity:Wn.is(u)&&(E=u.interval),E!=null&&D!=null&&xi(E)>=xi(D)&&(D=E);const R=D?this.getTimeIntervalTicks(s,r,a,g,D,t):void 0;if(R)({ticks:v,tickCount:M,firstTickIndex:S,primaryTicksIndices:A,alignment:I}=R);else{const P=Wn.is(u)&&g.interval==null&&D!=null?{...g,interval:D}:g,G=u.ticks(P,b,s);if(v=G?.ticks??[],M=G?.count,S=G?.firstTickIndex,$o.is(u)||ds.is(u)){const H=g,oe=typeof H.interval=="number"?ml(H.interval):H.interval;D??(D=oe??G?.timeInterval)}}}}const w=v.reduce((E,R)=>Math.max(E,typeof R=="number"?Sd(R):0),0);return L||(A=void 0),u.domain=C,{tickDomain:y,niceDomain:b,rawTicks:v,rawTickCount:M,rawFirstTickIndex:S,generatePrimaryTicks:L,primaryTicksIndices:A,alignment:I,fractionDigits:w,timeInterval:D}}formatTicks({niceDomain:e,range:t,rawTicks:i,rawFirstTickIndex:s=0,generatePrimaryTicks:n,primaryTicksIndices:r,alignment:o,fractionDigits:a,timeInterval:l,sizeLimit:c=1/0}){const{axis:h}=this,{label:u,scale:d}=h,p=d.domain;d.domain=e;const g=n?"component":"long",m=u.enabled?h.tickFormatter(e,i,!1,a,l,g):void 0,b=l!=null?fl(l):void 0,y=n?h.tickFormatter(e,i,!0,a,b,g):void 0,v=(d.bandwidth??0)/2,M=[],S=$o.is(d)||ds.is(d),D=Jp(),A=h.direction==="y",I=(pn.is(d)?d.bandwidth:null)??1/0,L={font:u,maxWidth:A?c:I,maxHeight:A?I:c,overflow:u.truncate?"ellipsis":"hide",textWrap:u.wrapping};for(let C=0;C<i.length;C++){const w=i[C],E=d.convert(w,{alignment:o})+v;if(t.length>0&&!h.inRange(E,.001))continue;const R=r?.has(C)??!1;let P=R?y?.(w,C):m?.(w,C);const G=P??String(w);u.avoidCollisions&&(P=Xa.wrapText(G,L)||P);let H;const oe=S?w?.valueOf():void 0;Number.isFinite(oe)?H=D(`v:${oe}`):H=D(`l:${P}`),M.push({index:C+s,tick:w,tickId:H,tickLabel:P,textUntruncated:P!=null&&G!==P?G:void 0,translation:Math.floor(E),primary:R})}return d.domain=p,M}};function Ox(e,t=0){const i=[];for(const s of e){const{x:n,y:r}=s.point;let{width:o,height:a}=s.label;if(o+=t,a+=t,i.some(l=>km(l,n,r,o,a)))return!0;i.push({x:n,y:r,width:o,height:a})}return!1}function dT(e,t,i,s){if(e==null)return{ticks:t,firstTickIndex:void 0};const n=t[0].valueOf(),r=t[1].valueOf();if(typeof e!="number"){const a=t[0],l=typeof e=="string"?{unit:e,epoch:a}:{...e,epoch:a},c=Wi(l,t[0],t[1],{visibleRange:i,extend:s}),h=Ih(l,t[0],t[1],{visibleRange:i,extend:s});return{ticks:c,firstTickIndex:h}}const o=[];for(let a=n;a<=r;a+=e)o.push(new Date(a));return{ticks:o,firstTickIndex:void 0}}function Px(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}function pT(e){if(e.length<2)return 1/0;let t=0,i=e[0].translation;for(let s=1;s<e.length;s++){const n=e[s].translation,r=Math.abs(n-i);t=Math.max(t,r),i=n}return t}var eg=class extends it{constructor(){super(...arguments),this.autoRotateAngle=335}};f([x],eg.prototype,"autoRotate",2),f([x],eg.prototype,"autoRotateAngle",2);var Ph=class $S extends $p{constructor(t,i){super(t,i),this.maxThicknessRatio=.3,this.headingLabelGroup=this.axisGroup.appendChild(new hi({name:`${this.id}-Axis-heading`})),this.lineNodeGroup=this.axisGroup.appendChild(new hi({name:`${this.id}-Axis-line`})),this.lineNode=this.lineNodeGroup.appendChild(new zi({zIndex:1})),this.tickLineGroupSelection=gi.select(this.tickLineGroup,zi,!1),this.gridLineGroupSelection=gi.select(this.gridLineGroup,zi,!1),this.gridFillGroupSelection=gi.select(this.gridFillGroup,Et,!1),this.tempText=new To({debugDirty:!1}),this.tempCaption=new ct,this.tickGenerator=new Ex(this),this.animationManager=t.animationManager,this.animationState=new ll("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.cleanup.register(t.eventsHub.on("layout:complete",n=>{const r=[n.chart.width,n.chart.height];s!=null&&!rn(r,s)&&this.animationState.transition("resize"),s=r}),this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}static is(t){return t instanceof $S}get horizontal(){return this.position==="top"||this.position==="bottom"}onGridVisibilityChange(){this.gridLineGroupSelection.clear(),this.gridFillGroupSelection.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 eg}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.hasDefinedDomain()||this.hasVisibleSeries();this.crossLines.forEach(i=>{i.calculateLayout?.(t)})}calculateTickLayout(t,i,s,n){const r=this.label.getSideFlag(),o=this.horizontal?-.5*Math.PI:0,a=Ct(o),l=Ct(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:xe,spacing:Z}=this.tickBBox(t,[],[]);return{ticks:[],rawTickCount:0,tickDomain:t,niceDomain:t,fractionDigits:0,timeInterval:void 0,bbox:xe,layout:{ticks:[],tickLines:[],gridLines:[],gridFills:[],labels:[],spacing:Z}}}const{range:h,reverse:u,defaultTickMinSpacing:d}=this,p=this.label.avoidCollisions&&this.horizontal&&(Ye.is(this.scale)||ds.is(this.scale)),g=this.tickGenerator.generateTicks({domain:t,range:h,reverse:u,niceMode:i,visibleRange:s,primaryTickCount:n,defaultTickMinSpacing:d,parallelFlipRotation:a,regularFlipRotation:l,labelX:c,sideFlag:r,sizeLimit:this.chartLayout?.sizeLimit,removeOverflowLabels:p,removeOverflowThreshold:this.chartLayout?.padding.right}),{tickData:m}=g,{ticks:b,tickDomain:y,rawTicks:v,rawTickCount:M,fractionDigits:S,timeInterval:D,niceDomain:A}=m,I=b.map(xe=>this.getTickLabelProps(xe,g)),{position:L,gridPadding:C,gridLength:w}=this,E=L==="bottom"||L==="right"?-1:1,R=E*C,P=E*(w+C),G=this.calculateGridLines(b,R,P),H=this.calculateGridFills(b,R,P),oe=this.calculateTickLines(b,E),{bbox:me,spacing:ke}=this.tickBBox(y,b,I);return{ticks:v,rawTickCount:M,tickDomain:y,niceDomain:A,fractionDigits:S,timeInterval:D,bbox:me,layout:{ticks:b,gridLines:G,gridFills:H,tickLines:oe,labels:I,spacing:ke}}}calculateGridLines(t,i,s){return t.map((n,r)=>this.calculateGridLine(n,r,i,s,t))}calculateGridLine({index:t,tickId:i,translation:s},n,r,o,a){const{gridLine:l,horizontal:c}=this,[h,u,d,p]=c?[s,r,s,o]:[r,s,o,s],{style:g}=l,{stroke:m,strokeWidth:b=0,lineDash:y}=g[t%g.length]??{};return{tickId:i,offset:s,x1:h,y1:u,x2:d,y2:p,stroke:m,strokeWidth:b,lineDash:y}}calculateGridFills(t,i,s){const{horizontal:n,range:r,type:o}=this,a=[];if(t.length==0)return a;let l=0;const c=!n&&o==="unit-time";if(c&&t[0].translation<r[0]||!c&&t[0].translation>r[0]){const u={tickId:`before:${t[0].tickId}`,translation:r[0]};a.push(this.calculateGridFill(u,-1,t[0].index,i,s,t)),l=1}return a.push(...t.map((u,d)=>this.calculateGridFill(u,d,u.index+l,i,s,t))),a}calculateGridFill({tickId:t,translation:i},s,n,r,o,a){const{gridLine:l,horizontal:c,range:h}=this,u=a[s+1],d=i,p=u?u.translation:h[1],[g,m,b,y]=c?[d,Math.max(r,o),p,Math.min(r,o)]:[Math.min(r,o),Math.min(d,p),Math.max(r,o),Math.max(d,p)],{fill:v,fillOpacity:M}=l.style[n%l.style.length]??{};return{tickId:t,x1:g,y1:m,x2:b,y2:y,fill:v,fillOpacity:M}}calculateTickLines(t,i){return t.map(s=>this.calculateTickLine(s,s.index,i,t))}calculateTickLine({primary:t,tickId:i,translation:s},n,r,o){const{horizontal:a,tick:l,primaryTick:c}=this,h=t&&c?.enabled?c:l,u=-r*this.getTickSize(h),[d,p,g,m]=a?[s,0,s,u]:[0,s,u,s],{stroke:b,width:y}=h;return{tickId:i,offset:s,x1:d,y1:p,x2:g,y2:m,stroke:b,strokeWidth:y,lineDash:void 0}}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{tickLayout:i}=this;if(this.updateTitle(this.scale.domain,i?.spacing??0),this.animatable||this.moduleCtx.animationManager.skipCurrentBatch(),i){const{ticks:o}=i;if(this.animationManager.isSkipped())this.resetSelectionNodes();else{const a=o.map(c=>c.tickId),l=qD(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(),this.updateGridFills()}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]=_t(this.range);return t?{x1:i,x2:s,y1:0,y2:0}:{x1:0,x2:0,y1:i,y2:s}}getTickLineBBox(t){const{translation:i}=t,{position:s,primaryTick:n}=this;let r=this.getTickSize();switch(n?.enabled&&(r=Math.max(r,this.getTickSize(n))),s){case"top":return new U(i,-r,i,r);case"bottom":return new U(i,0,i,r);case"left":return new U(-r,i,r,i);case"right":return new U(0,i,r,i)}}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 y=p.getBBox(!1);y&&d.push(y)}if(a?.enabled&&c==="bottom"&&(d.push(new U(0,He.getLineHeight(o.fontSize)+2,1,this.getTickSize(n)+o.spacing+u)),a.format!=null)){const{format:y}=a,M=(Ne(y)?Object.values(y):[y]).reduce((S,D)=>Math.max(S,LD(D)),0);d.push(new U(0,this.getTickSize(r??n)+a.spacing+u,1,M*He.getLineHeight(a.fontSize)+2))}let g=0;if(l.enabled){const b=U.merge(d);g=h?b.height:b.width,d.push(this.titleBBox(t,g))}return{bbox:U.merge(d),spacing:g}}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=g=>g.defaultValue}=n,p=this.cachedCallWithContext(d,this.getTitleFormatterParams(i));return t.text=p,{visible:!0,text:p,textBaseline:u,x:l,y:c,rotationCenterX:l,rotationCenterY:c,rotation:h}}getLabelBorderOffset(t){const i=_o(t);function s(n){return n}switch(this.position){case"top":return i.bottom;case"right":return i.left;case"bottom":return i.top;case"left":return i.right;default:this.position}}getTickLabelProps(t,i){const{horizontal:s,primaryLabel:n,primaryTick:r,seriesAreaPadding:o,scale:a}=this,{tickId:l,tickLabel:c="",translation:h,primary:u,textUntruncated:d}=t,p=u&&n?.enabled?n:this.label,g=u&&r?.enabled?r:this.tick,{rotation:m,textBaseline:b,textAlign:y}=i,{range:v}=a,M=this.label.getSideFlag(),S=-this.getLabelBorderOffset(p),D=M*(this.getTickSize(g)+p.spacing+o)+S,A=c!=="",I=s?h:D,L=s?-D:h;return{...this.getLabelStyles({value:c},void 0,p),tickId:l,rotation:m,text:c,textAlign:y,textBaseline:b,textUntruncated:d,visible:A,x:I,y:L,rotationCenterX:I,rotationCenterY:L,range:v}}updateSelections(){if(!this.tickLayout)return;const t=this.getAxisLineCoordinates(),{tickLines:i,gridLines:s,gridFills:n,labels:r}=this.tickLayout,o=a=>a.tickId;this.lineNode.datum=t,this.gridLineGroupSelection.update(this.gridLine.enabled?s:[],void 0,o),this.gridFillGroupSelection.update(this.gridLine.enabled?n:[],void 0,o),this.tickLineGroupSelection.update(i,void 0,o),this.tickLabelGroupSelection.update(r,void 0,o)}updateGridLines(){this.gridLineGroupSelection.each((t,i)=>{t.stroke=i.stroke,t.strokeWidth=i.strokeWidth,t.lineDash=i.lineDash})}updateGridFills(){this.gridFillGroupSelection.each((t,i)=>{t.fill=i.fill,t.fillOpacity=i.fillOpacity??1})}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.color,t.text=i.text,t.textBaseline=i.textBaseline,t.textAlign=i.textAlign??"center",t.pointerEvents=i.textUntruncated==null?1:0,t.setFont(i),t.setBoxing(i)})}animateReadyUpdate(t){const{animationManager:i}=this.moduleCtx,s=dx(this),n=px(s);Ot(this.id,"axis-group",i,[this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],n.group),Ot(this.id,"line",i,[this.lineNode],n.line),Ot(this.id,"line-paths",i,[this.gridLineGroupSelection,this.tickLineGroupSelection],n.tick,(r,o)=>o.tickId,t),Ot(this.id,"tick-labels",i,[this.tickLabelGroupSelection],n.label,(r,o)=>o.tickId,t),Ot(this.id,"title",i,[this.title.caption.node],n.label,(r,o)=>o.tickId,t)}resetSelectionNodes(){ti([this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],gx()),ti([this.gridLineGroupSelection,this.tickLineGroupSelection],Up()),ti([this.gridFillGroupSelection],fx()),ti([this.tickLabelGroupSelection],Th()),ti([this.title.caption.node],Th()),ti([this.lineNode],Up())}};f([x],Ph.prototype,"thickness",2),f([x],Ph.prototype,"maxThicknessRatio",2),f([x],Ph.prototype,"position",2);var xl=Ph,Rx=["top","right","bottom","left"];function gT(e){return typeof e=="string"&&Rx.includes(e)}function fT(e){const t=[],i=[],s=[...Rx];for(const n of e)n instanceof xl&&(gT(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 mT=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo"];function yT(e,t,i){const s=(c,h,u)=>{const d=[c];for(const p of mT)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[g,m]=p.shift(),b=i?.[m]??{},y=hn(b,u??{}),{groupIndex:v,stackIndex:M}=y?.seriesGrouping??{};v!=null||M!=null?l.push({opts:u,series:g,diff:y,targetIdx:d,idx:m,status:"series-grouping"}):y?l.push({opts:u,series:g,diff:y,targetIdx:d,idx:m,status:"update"}):l.push({opts:u,series:g,targetIdx:d,idx:m,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 Rh(e){const{series:t}=e;return t?.[0]?.type??"line"}function zx(e){const t=Rh(e);return Ht.isCartesian(t)||ML(t)}function bT(e){const t=Rh(e);return Ht.isPolar(t)||SL(t)}function Fx(e){const t=Rh(e);return Ht.isTopology(t)||DL(t)}function jx(e){const t=Rh(e);return Ht.isStandalone(t)||IL(t)}var xT=class extends Gp{applyOptions(e){for(const t of this.moduleMap.values())t.module.optionsKey in e&&Ir(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})}},tg="ag-charts-overlay",Bx="ag-charts-dark-overlay",Rr=class extends re{constructor(e,t){super(),this.className=e,this.defaultMessageId=t,this.enabled=!0}getText(e){return Ae(this.text)?this.text.map(t=>t.text).join(""):e.t(this.text??this.defaultMessageId)}getElement(e,t,i,s){if(this.content?.remove(),this.focusBox=s,this.renderer){const n={},r=us(e,this.renderer,n);if(r instanceof HTMLElement)this.content=r;else{const o=ve("div");o.innerHTML=r;const{firstElementChild:a}=o;a instanceof HTMLElement&&o.childElementCount===1?this.content=a:this.content=o}}else{const n=ve("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)"});if(Ae(this.text)){const r=ve("div");for(const o of this.text){const a=ve("span",{color:o.color,fontSize:`${o.fontSize}px`,fontFamily:o.fontFamily??"inherit",fontWeight:String(o.fontWeight),fontStyle:o.fontStyle});a.innerText=o.text,r.appendChild(a)}n.appendChild(r)}else n.innerText=this.getText(i);this.content=n,t?.animate({from:0,to:1,id:"overlay",phase:"add",groupId:"opacity",onUpdate(r){n.style.opacity=String(r)},onStop(){n.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}}};f([x],Rr.prototype,"enabled",2),f([x],Rr.prototype,"text",2),f([x],Rr.prototype,"renderer",2);var Yo=class extends re{constructor(){super(...arguments),this.darkTheme=!1,this.loading=new Rr("ag-charts-loading-overlay","overlayLoadingData"),this.noData=new Rr("ag-charts-no-data-overlay","overlayNoData"),this.noVisibleSeries=new Rr("ag-charts-no-visible-series","overlayNoVisibleSeries"),this.unsupportedBrowser=new Rr("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()}};f([x],Yo.prototype,"darkTheme",2),f([x],Yo.prototype,"loading",2),f([x],Yo.prototype,"noData",2),f([x],Yo.prototype,"noVisibleSeries",2),f([x],Yo.prototype,"unsupportedBrowser",2);function vT(e,t){const{animationDuration:i}=nl.add,s=i*t,n=ve("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=ve("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=ve("p",{marginTop:"1em"});o.innerText=e;const a=ve("div",`${tg}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),l=ve("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 Vx=(e=>(e[e.None=0]="None",e[e.Item=1]="Item",e[e.Series=2]="Series",e[e.OtherSeries=3]="OtherSeries",e[e.OtherItem=4]="OtherItem",e))(Vx||{}),mn=class extends re{};f([x],mn.prototype,"fill",2),f([x],mn.prototype,"fillOpacity",2),f([x],mn.prototype,"stroke",2),f([x],mn.prototype,"strokeWidth",2),f([x],mn.prototype,"strokeOpacity",2),f([x],mn.prototype,"lineDash",2),f([x],mn.prototype,"lineDashOffset",2);var yn=class extends re{constructor(){super(...arguments),this.enabled=!0,this.range="tooltip",this.bringToFront=!1,this.highlightedItem={},this.unhighlightedItem={},this.highlightedSeries={},this.unhighlightedSeries={}}getItemHighlightStyle(e){switch(e){case 1:return this.highlightedItem;case 4:return this.unhighlightedItem;case 2:return this.highlightedSeries;case 3:return this.unhighlightedSeries}}getSeriesHighlightStyle(e){switch(e){case 1:case 4:case 2:return this.highlightedSeries;case 3:return this.unhighlightedSeries}}getStyle(e){return Ee(this.getItemHighlightStyle(e),this.getSeriesHighlightStyle(e))}};f([x],yn.prototype,"enabled",2),f([x],yn.prototype,"range",2),f([x],yn.prototype,"bringToFront",2),f([x],yn.prototype,"highlightedItem",2),f([x],yn.prototype,"unhighlightedItem",2),f([x],yn.prototype,"highlightedSeries",2),f([x],yn.prototype,"unhighlightedSeries",2);var zh=class extends re{};f([x],zh.prototype,"strokeWidth",2),f([x],zh.prototype,"dimOpacity",2),f([x],zh.prototype,"enabled",2);var Gx=class extends re{constructor(){super(...arguments),this.color="black"}};f([x],Gx.prototype,"color",2);var Ki=class extends re{constructor(){super(...arguments),this.type="gradient",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.reverse=!1}};f([x],Ki.prototype,"type",2),f([x],Ki.prototype,"colorStops",2),f([x],Ki.prototype,"bounds",2),f([x],Ki.prototype,"gradient",2),f([x],Ki.prototype,"rotation",2),f([x],Ki.prototype,"reverse",2);var nt=class extends re{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}};f([x],nt.prototype,"type",2),f([x],nt.prototype,"colorStops",2),f([x],nt.prototype,"bounds",2),f([x],nt.prototype,"gradient",2),f([x],nt.prototype,"rotation",2),f([x],nt.prototype,"scale",2),f([x],nt.prototype,"reverse",2),f([x],nt.prototype,"path",2),f([x],nt.prototype,"pattern",2),f([x],nt.prototype,"width",2),f([x],nt.prototype,"height",2),f([x],nt.prototype,"padding",2),f([x],nt.prototype,"fill",2),f([x],nt.prototype,"fillOpacity",2),f([x],nt.prototype,"backgroundFill",2),f([x],nt.prototype,"backgroundFillOpacity",2),f([x],nt.prototype,"stroke",2),f([x],nt.prototype,"strokeOpacity",2),f([x],nt.prototype,"strokeWidth",2);var Ii=class extends re{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"}};f([x],Ii.prototype,"type",2),f([x],Ii.prototype,"url",2),f([x],Ii.prototype,"rotation",2),f([x],Ii.prototype,"scale",2),f([x],Ii.prototype,"backgroundFill",2),f([x],Ii.prototype,"backgroundFillOpacity",2),f([x],Ii.prototype,"repeat",2),f([x],Ii.prototype,"fit",2);var vl=class extends re{constructor(e=!0){super(),this.deprecated=e,this.item=new mn,this.series=new zh,this.text=new Gx}set(e){return this.deprecated&&j.warnOnce("highlightStyle is deprecated, use highlight instead."),super.set(e)}};f([x],vl.prototype,"item",2),f([x],vl.prototype,"series",2),f([x],vl.prototype,"text",2);var Zi=class extends re{constructor(){super(...arguments),this.visible=!0,this.focusPriority=1/0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlight=new yn,this.highlightStyle=new vl}handleUnknownProperties(e,t){"context"in t&&(this.context=t.context,e.delete("context"))}};f([x],Zi.prototype,"id",2),f([x],Zi.prototype,"visible",2),f([x],Zi.prototype,"focusPriority",2),f([x],Zi.prototype,"showInLegend",2),f([x],Zi.prototype,"cursor",2),f([x],Zi.prototype,"nodeClickRange",2),f([x],Zi.prototype,"highlight",2),f([x],Zi.prototype,"highlightStyle",2);var _x=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.ANY_CONTENT=1]="ANY_CONTENT",e))(_x||{}),Hx=(e=>(e[e.FOREGROUND=0]="FOREGROUND",e[e.HIGHLIGHT=1]="HIGHLIGHT",e[e.LABEL=2]="LABEL",e))(Hx||{});function Ko(e,t,i,s){if(hs(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(Fn(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 Ar(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 Us(e,t,i,s){return!hs(e?.fill)&&!Fn(e?.fill)&&!Ar(e?.fill)?e:{...e,fill:Ko(e.fill,t,i,s)}}function Ux(e,t,i,s){i==null||!hs(t)||t.bounds==null||t.bounds==="item"?e.fillBBox=void 0:e.fillBBox=i[t.bounds],e.fillParams=s}function bn(e,t,i,s){const n=t?.opacity??1;e.fill=t?.fill,Ux(e,e.fill,i,s),e.fillOpacity=(t?.fillOpacity??1)*n,e.stroke=t?.stroke,e.strokeOpacity=(t?.strokeOpacity??1)*n,e.strokeWidth=t?.strokeWidth??0,e.lineDash=t?.lineDash,e.lineDashOffset=t?.lineDashOffset??0}var $x=(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))($x||{}),MT=.25,ST=.125,Fh=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}},jh=class{constructor(e,t){this.series=e,this.seriesGrouping=t,this.type="groupingChanged"}};function Wx(e){switch(e){case"x":return"x";case"y":return"y";case"angle":return"angle";case"radius":return"radius"}}function ig(e){switch(e){case"x":return"x";case"y":return"y";case"angle":return"angle";case"radius":return"radius"}}var Bh=class extends Ty{constructor(e){super(),this.cleanup=new at,this.usesPlacedLabels=!1,this.hasChangesOnHighlight=!1,this.seriesGrouping=void 0,this.NodeEvent=Fh,this.internalId=cs(this),this.contentGroup=new hi({name:`${this.internalId}-content`,zIndex:1}),this.highlightGroup=new hi({name:`${this.internalId}-highlight`,zIndex:1}),this.annotationGroup=new hi({name:`${this.internalId}-annotation`}),this.labelGroup=new hi({name:`${this.internalId}-series-labels`}),this.axes={},this.directions=["x","y"],this.nodeDataRefresh=!0,this.moduleMap=new Gp,this.datumCallbackCache=new Map,this.connectsToYAxis=!1,this.declarationOrder=-1,this._broughtToFront=!1,this.events=new On,this._pickNodeCache=new Jd,this.fireEventWrapper=a=>super.fireEvent(a);const{moduleCtx:t,pickModes:i,propertyKeys:s={},propertyNames:n={},canHaveAxes:r=!1,usesPlacedLabels:o=!1}=e;this.ctx=t,this.propertyKeys=s,this.propertyNames=n,this.canHaveAxes=r,this.usesPlacedLabels=o,this.pickModes=i,this.cleanup.register(this.ctx?.eventsHub.on("highlight:change",a=>this.onChangeHighlight(a)))}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 jh(this,t))}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,t=!1){const i=this.bringToFront();return!t&&e===this.declarationOrder&&i===this._broughtToFront?!1:(this.declarationOrder=e,this._broughtToFront=i,this.setZIndex(i?Number.MAX_VALUE:e),this.fireEvent(new jh(this,this.seriesGrouping)),!0)}setZIndex(e){this.contentGroup.zIndex=[1,e,0],this.highlightGroup.zIndex=[1,e,1],this.labelGroup.zIndex=[1,e,2],this.annotationGroup.zIndex=e}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)}addChartEventListeners(){}updatedDomains(){}destroy(){this.cleanup.flush(),this.resetDatumCallbackCache(),this.ctx.seriesStateManager.deregisterSeries(this)}getPropertyValues(e,t){const i=Wx(e),s=i!=null?ig(this.resolveKeyDirection(i)):e,n=t?.[s],r=[];if(!n)return r;const o=(...a)=>{for(const l of a)Array.isArray(l)?o(...l):typeof l=="object"?o(...Object.values(l)):r.push(l)};return o(...n.map(a=>this.properties[a])),r}getKeys(e){return this.getPropertyValues(ig(e),this.propertyKeys)}getKeyProperties(e){return this.propertyKeys[this.resolveKeyDirection(e)]??[]}getNames(e){return this.getPropertyValues(ig(e),this.propertyNames)}getFormatterContext(e){const{id:t}=this,i=this.getPropertyValues(e,this.propertyKeys),s=this.getPropertyValues(e,this.propertyNames),n=[];for(let r=0;r<i.length;r++)n.push({seriesId:t,key:i[r],name:s[r]});return n}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(){if(!this.properties.highlight)return 1;const{opacity:t=1}=this.getHighlightStyle();return t}getHighlightState(e,t,i,s){if(t)return 1;if(e?.series==null)return 0;if(this.isSeriesHighlighted(e,s)){const n=this.isItemHighlighted(e,i);return n==null||n?2:4}return 3}getHighlightStateString(e,t,i,s){switch(this.getHighlightState(e,t,i,s)){case 1:return"highlighted-item";case 4:return"unhighlighted-item";case 2:return"highlighted-series";case 3:return"unhighlighted-series";case 0:default:return"none"}}onChangeHighlight(e){const t=e.previousHighlight,i=e.currentHighlight,s=this.getHighlightState(i),n=this.getHighlightState(t);if(this.setSeriesIndex(this.declarationOrder),s===n){this.hasChangesOnHighlight=!1;return}const{highlightedSeries:r,unhighlightedItem:o,unhighlightedSeries:a}=this.properties.highlight,l=this.hasItemStylers();this.hasChangesOnHighlight=l||!hd(r)||!hd(o)||!hd(a)}bringToFront(){return this.properties.highlight.bringToFront&&this.isSeriesHighlighted(this.ctx.highlightManager.getActiveHighlight())}isSeriesHighlighted(e,t){return e?.series===this}isItemHighlighted(e,t){if(!(e?.datumIndex==null||t==null))return e.datumIndex===t}getHighlightStyle(e,t,i){const s=this.ctx.highlightManager?.getActiveHighlight(),n=this.getHighlightState(s,e,t,i);return this.properties.highlight.getStyle(n)}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 g=this.pickNodesExactShape(e);p=g.length===0?void 0:{datums:g,distance:0};break}case 1:{const g=this.pickNodeClosestDatum(e),m=g?.distance===0?this.pickNodesExactShape(e):void 0;m!=null&&m.length!==0?p={datums:m,distance:0}:g?p={datums:[g.datum],distance:g.distance}:p=void 0;break}case 2:{const g=n!=null?this.pickNodeMainAxisFirst(e,n==="main-category"):void 0;p=g!=null?{datums:[g.datum],distance:g.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=Uc(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){}fireEvent(e){us([this.properties,this.ctx.chartService],this.fireEventWrapper,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}}getAxisValueText(e,t,i,s,n,r){const{id:o,properties:a}=this;return e.formatDatum(a,i,t,o,r,s,n)}getLabelText(e,t,i,s,n,r,o){if(e==null)return"";const{axes:a,canHaveAxes:l,ctx:c,id:h,properties:u}=this,d="series-label",p="legendItemName"in u?u.legendItemName:void 0,g={seriesId:this.id,...o},m=l?Wx(s):void 0,b=m!=null?a[this.resolveKeyDirection(m)]:void 0;if(b!=null)return b.formatDatum(u,e,d,h,p,t,i,n,r,g);const{formatManager:y}=c,v=this.callWithContext.bind(this),M=D=>r.formatValue(v,D.type,D.value,g)??y.format(v,D)??String(e),S=this.getFormatterContext(s);switch(s){case"y":case"color":case"size":return M({type:"number",value:e,datum:t,seriesId:h,legendItemName:p,key:i,source:d,property:s,domain:n,boundSeries:S,fractionDigits:void 0});case"x":case"radius":case"angle":case"label":case"secondaryLabel":case"calloutLabel":case"sectorLabel":case"legendItem":return M({type:"category",value:e,datum:t,seriesId:h,legendItemName:p,key:i,source:d,property:s,domain:n,boundSeries:S})}}getMarkerStyle(e,{datumIndex:t,datum:i,point:s},n,r=!1,o={size:s?.size??e.size??0},a,l=!0){const{itemStyler:c,fillGradientDefaults:h,fillPatternDefaults:u,fillImageDefaults:d}=e,p=l?this.getHighlightStyle(r,t):void 0,g=Ee(p,o,e.getStyle(),a);let m=Us(g,h,u,d);if(c&&n){const b=this.ctx.highlightManager?.getActiveHighlight(),y=this.getHighlightStateString(b,r,t),v=this.cachedCallWithContext(c,{seriesId:this.id,...m,...n,highlighted:r,highlightState:y,datum:i});m=Us(Ee(v,m),h,u,d)}return m}applyMarkerStyle(e,t,i,s,{applyTranslation:n=!0,selected:r=!0}={}){const{shape:o,size:a=0}=e,l=this.visible&&a>0&&i&&!isNaN(i.x)&&!isNaN(i.y);if(bn(t,e,s),n?t.setProperties({visible:l,shape:o,size:a,x:i?.x,y:i?.y,scalingCenterX:i?.x,scalingCenterY:i?.y}):t.setProperties({visible:l,shape:o,size:a}),r||(t.fillOpacity*=MT,t.strokeOpacity*=ST),typeof o=="function"&&!t.dirtyPath){t.path.clear(!0),t.updatePath(),t.checkPathDirty();const c=t.getBBox();if(i!=null&&c.isFinite()){const h=c.computeCenter(),[u,d]=["x","y"].map(p=>(e.strokeWidth??0)+Math.abs(h[p]-i[p]));i.focusSize=Math.max(c.width+u,c.height+d)}}}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=hn(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){j.error(String(n))}}cachedCallWithContext(e,...t){return this.ctx.callbackCache.call([this.properties,this.ctx.chartService],e,...t)}callWithContext(e,...t){return us([this.properties,this.ctx.chartService],e,...t)}formatTooltipWithContext(e,t,i){return e.formatTooltip([this.properties,this.ctx.chartService],t,i)}minTimeInterval(){}};f([ui({changeValue:function(e,t){this.onSeriesGroupingChange(t,e)}})],Bh.prototype,"seriesGrouping",2);var DT=class{constructor(e){this.swapChain=e,this.hasBeenActivated=!1,this.div=ve("div"),this.svg=Mt("svg"),this.outerPath=Mt("path"),this.innerPath=Mt("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=ve("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 di){const s=(r,o)=>{let{x:a,y:l}=dt.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);Jc(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&&Fe().getComputedStyle(t).opacity==="1"}},IT=class{constructor(e,t,i,s){this.label1=e,this.label2=t,this.hasFocus=!1,this.skipDispatch=!1,this.listeners={blur:[],focus:[],swap:[]},this.onBlur=n=>(zs(n.target,"pointer-events",void 0),!this.skipDispatch&&this.dispatch("blur",n)),this.onFocus=n=>(zs(n.target,"pointer-events","auto"),!this.skipDispatch&&this.dispatch("focus",n)),Ce(this.label1,"id",Bc()),Ce(this.label2,"id",Bc()),zs(this.label1,"display","none"),zs(this.label2,"display","none"),this.label1.textContent=s,this.label2.textContent=s,this.activeAnnouncer=this.createAnnouncer(i),this.inactiveAnnouncer=this.createAnnouncer(i),Ce(this.activeAnnouncer,"tabindex",0),this.label2.insertAdjacentElement("afterend",this.activeAnnouncer),this.label2.insertAdjacentElement("afterend",this.inactiveAnnouncer),this.swap(s)}createAnnouncer(e){const t=ve("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],yo(this.inactiveAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!0,tabindex:void 0}),yo(this.activeAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!1,tabindex:t}),this.dispatch("swap",this.activeAnnouncer)}},AT={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 CT(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 LT(e){for(const[t,{activatesFocusIndicator:i=!0,bindings:s}]of ls(AT))if(CT(e,s))return{name:t,activatesFocusIndicator:i}}function TT(e,t,i){const s=xp(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 dt.toCanvas(n).computeCenter()}}function kT({bounds:e}){return e instanceof U?e:e!=null?dt.toCanvas(e):U.NaN}function wT(e,t,i){const{x:s,y:n}=TT(e,t,i)??{};if(s!==void 0&&n!==void 0)return{type:"keyboard",canvasX:s,canvasY:n}}function Yx(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?(c=t,l=e):l=Math.ceil(e*c/t):c??(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 Kx=.1,Zx=200,Xx=12,NT=.5,ET=class{constructor(){this.events=new On,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??(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,g=-(Zx*d+Xx*c)/Kx,m=-(Zx*p+Xx*h)/Kx;c+=g*r,h+=m*r,a+=c*r,l+=h*r}Math.hypot(a-e,l-t)<NT?(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.events.emit("update",{x:this.x,y:this.y})}},Vh=null;function Ml(e){return e===""?"":(Vh??(Vh=ve("div")),Vh.textContent=String(e),Vh.innerHTML.replace(/\n/g,"<br>"))}function Sl(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 OT={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){Sl(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){Sl(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,Qt(130),Qt(330)),e.arc(t+n,i-n,n,Qt(220),Qt(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){Sl(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(Vt(n,t-r),Vt(n,i-r)),e.lineTo(Vt(n,t+r),Vt(n,i-r)),e.lineTo(Vt(n,t+r),Vt(n,i+r)),e.lineTo(Vt(n,t-r),Vt(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){Sl(e,[[.5,0],[1,.87],[0,.87]])}},Dl=class extends di{constructor(){super(...arguments),this.shape="square",this.x=0,this.y=0,this.size=12}isPointInPath(e,t){return this.distanceSquared(e,t)<=0}distanceSquared(e,t){const i=Pt.anchor(this.shape);return Math.max(Math.hypot(e-this.x+(i.x-.5)*this.size,t-this.y+(i.y-.5)*this.size)-this.size/2,0)}updatePath(){const{path:e,shape:t,x:i,y:s,size:n}=this,r=this.layerManager?.canvas?.pixelRatio??1,o=Pt.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"?OT[t](a):typeof t=="function"&&t(a)}computeBBox(){const{x:e,y:t,size:i}=this,s=Pt.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)}};f([Ei({equals:vo})],Dl.prototype,"shape",2),f([F()],Dl.prototype,"x",2),f([F()],Dl.prototype,"y",2),f([F({convertor:Math.abs})],Dl.prototype,"size",2);var Pt=class extends Io(Ud(Ao(Dl))){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 qx(e,t,i=t*(5/3)){const s=new ge,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 zi;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:g}=e.marker,m=new Pt;m.shape=l??"square",m.size=t,m.fill=c,m.fillOpacity=h??1,m.stroke=u,m.strokeOpacity=d??1,m.strokeWidth=n,m.lineDash=p,m.lineDashOffset=g??0;const b=Pt.anchor(l),y=o/2+(b.x-.5)*t,v=a/2+(b.y-.5)*t,M=t/(t+n);m.x=y,m.y=v,m.scalingCenterX=y,m.scalingCenterY=v,m.scalingX=M,m.scalingY=M,s.append(m)}return ge.toSVG(s,o,a)}var Kt="ag-charts-tooltip",Qx="ag-charts-tooltip--dark";function Jx(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 e0(e){const t=Jx(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 sg(e,t,i){let s="";e==null?s+=`<span class="${Kt}-label">${Ml(t)}</span>`:(s+=`<span class="${Kt}-label">${Ml(e)}</span>`,s+=" ",s+=`<span class="${Kt}-value">${Ml(t)}</span>`);const n=[`${Kt}-row`];return i&&n.push(`${Kt}-row--inline`),s=`<div class="${n.join(" ")}">${s}</div>`,s}function PT(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:qx(e.symbol,12);return s!=null&&(e.title!=null||e.data?.length)&&(t+=`<span class="${Kt}-symbol">${s}</span>`),e.title!=null&&(t+=`<span class="${Kt}-title">${Ml(e.title)}</span>`,t+=" "),e.data?.forEach(n=>{t+=sg(n.label??n.fallbackLabel,n.value,i),t+=" "}),t}function t0(e,t){if(e==null||t.length===1)return;const i=e?.t("tooltipPaginationStatus",{index:t.index+1,count:t.length});return`<div class="${Kt}-footer">${i}</div>`}function i0(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+=sg(void 0,o,!1)),n.data?.forEach(h=>{l+=sg(h.label??a,h.value,!1),l+=" "})):(t.heading!=null&&(l+=`<span class="${Kt}-heading">${Ml(t.heading)}</span>`,l+=" "),t.items.forEach(h=>{l+=PT(h)})),l.length===0)return;const c=i!=="compact"&&s!=null?t0(e,s):void 0;return c+null&&(l+=c),l=`<div class="${Kt}-content">${l.trimEnd()}</div>`,l}function RT(e,t){const i=t==null?void 0:t0(e,t);return i==null?"":`<div class="${Kt}-content">${i}</div>`}function s0(e,t,i,s){const n=Jx(t);if(n.length!==0){if(n.length===1&&n[0].type==="structured")return i0(e,n[0],i,s);{const r=n.map(o=>o.type==="structured"?i0(e,o,i):o.rawHtmlString);return s!=null&&r.push(RT(e,s)??""),r.join("")}}}var zT={left:-1,"top-left":-1,"bottom-left":-1,top:0,center:0,bottom:0,right:1,"top-right":1,"bottom-right":1},FT={"top-left":-1,top:-1,"top-right":-1,left:0,center:0,right:0,"bottom-left":1,bottom:1,"bottom-right":1},jT={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},n0={top:2,bottom:2,left:1,right:1,"top-right":3,"top-left":3,"bottom-right":3,"bottom-left":3,center:0},BT={pointer:"top",node:"top",chart:"top-left"},zr=class extends re{constructor(){super(...arguments),this.xOffset=0,this.yOffset=0}};f([x],zr.prototype,"xOffset",2),f([x],zr.prototype,"yOffset",2),f([x],zr.prototype,"anchorTo",2),f([x],zr.prototype,"placement",2);var Xi=class extends re{constructor(){super(),this.enabled=!0,this.mode="single",this.delay=0,this.range=void 0,this.wrapping="hyphenate",this.position=new zr,this.pagination=!1,this.darkTheme=!1,this.bounds="extended",this.cleanup=new at,this.springAnimation=new ET,this.enableInteraction=!1,this.wrapTypes=["always","hyphenate","on-space","never"],this.sizeMonitor=new Xy,this._elementSize=void 0,this._showTimeout=void 0,this.arrowPosition=void 0,this._visible=!1,this.positionParams=void 0,this.localeManager=void 0,this.cleanup.register(this.springAnimation.events.on("update",this.updateTooltipPosition.bind(this)))}get interactive(){return this.enableInteraction}setup(e,t){return"togglePopover"in Fe().HTMLElement.prototype&&(this.element=t.addChild("tooltip-container",Kt),this.element.setAttribute("popover","manual"),this.element.className=Kt,this.element.style.positionAnchor=t.anchorName,this.sizeMonitor.observe(this.element,i=>{this._elementSize=i,this.updateTooltipPosition()})),this.localeManager=e,()=>{t.removeChild("tooltip-container",Kt),this.cleanup.flush(),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,l=r.position?.anchorTo??"pointer";let c=r.position?.placement??BT[l];Array.isArray(c)||(c=[c]);const h=r.position?.xOffset??0,u=r.position?.yOffset??0,d=n.x,p=n.y,g=n.width-t.width-1+d,m=n.height-t.height+p;let b=0,y,v,M=!1;do{y=c[b],b+=1;const L=this.getTooltipBounds({elementSize:t,placement:y,anchorTo:l,canvasX:o,canvasY:a,yOffset:u,xOffset:h,canvasRect:s});v=Yx(t.width,t.height,n,L),M=!1,n0[y]&1&&(M||(M=v.x<d||v.x>g)),n0[y]&2&&(M||(M=v.y<p||v.y>m))}while(b<c.length&&M);const S=se(d,v.x,g),D=se(p,v.y,m);M||(M=S!==v.x||D!==v.y);const A=l!=="chart"&&!M&&!h&&!u,I=r.showArrow??this.showArrow??A;this.arrowPosition=I?jT[y]: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=s0(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??"pointer"){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)}maybeEnterInteractiveTooltip({relatedTarget:e},t){const{interactive:i,interactiveLeave:s,enabled:n,element:r}=this;if(r==null)return!1;if(s)return!0;const o=i&&n&&this.isVisible()&&e instanceof Node&&this.contains(e);return o&&(this.interactiveLeave={callback:t,listener:a=>{(a.relatedTarget==null||a.relatedTarget instanceof Node&&!this.contains(a.relatedTarget))&&this.popInteractiveLeaveCallback()}},r.addEventListener("focusout",this.interactiveLeave.listener),r.addEventListener("mouseout",this.interactiveLeave.listener)),o}popInteractiveLeaveCallback(){const{interactiveLeave:e,element:t}=this;this.interactiveLeave=void 0,e&&(t&&(t.removeEventListener("focusout",e.listener),t.removeEventListener("mouseout",e.listener)),e.callback())}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(),this.popInteractiveLeaveCallback()))}updateClassModifiers(){if(!this.element?.isConnected)return;const{classList:e}=this.element,t=(i,s)=>e.toggle(`${Kt}--${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(Qx,this.darkTheme);for(const i of this.wrapTypes)e.toggle(`${Kt}--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=zT[s],p=FT[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}};f([x],Xi.prototype,"enabled",2),f([x],Xi.prototype,"mode",2),f([x],Xi.prototype,"showArrow",2),f([x],Xi.prototype,"delay",2),f([x],Xi.prototype,"range",2),f([x],Xi.prototype,"wrapping",2),f([x],Xi.prototype,"position",2),f([x],Xi.prototype,"pagination",2),f([x],Xi.prototype,"darkTheme",2),f([x],Xi.prototype,"bounds",2);function ng(e,t){return e.series===t.series&&Nt(e.datumIndex,t.datumIndex)}var VT=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=>ng(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=>ng(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}}},GT=class extends rp{constructor(e){super(),this.chart=e,this.id=cs(this),this.series=[],this.announceMode="when-changed",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.cachedTooltipContent=void 0,this.hoverScheduler=aA(()=>{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 VT;const t=e.ctx.localeManager.t("ariaInitSeriesArea"),i=e.ctx.domManager.addChild("series-area","series-area-aria-label1"),s=e.ctx.domManager.addChild("series-area","series-area-aria-label2");this.swapChain=new IT(i,s,"img",t),this.swapChain.addListener("blur",a=>this.onBlur(a)),this.swapChain.addListener("focus",()=>this.onFocus()),e.ctx.domManager.mode==="normal"&&(this.focusIndicator=new DT(this.swapChain),this.focusIndicator.overrideFocusVisible(e.mode==="integrated"?!1:void 0));const{seriesDragInterpreter:n,seriesWidget:r,containerWidget:o}=e.ctx.widgets;r.setTabIndex(-1),this.cleanup.register(()=>e.ctx.domManager.removeChild("series-area","series-area-aria-label1"),()=>e.ctx.domManager.removeChild("series-area","series-area-aria-label2"),r.addListener("focus",()=>this.swapChain.focus({preventScroll:!0})),r.addListener("mousemove",a=>this.onHover(a,r)),r.addListener("wheel",a=>this.onWheel(a)),r.addListener("mouseleave",a=>this.onLeave(a)),r.addListener("keydown",a=>this.onKeyDown(a)),r.addListener("contextmenu",(a,l)=>this.onContextMenu(a,l)),o.addListener("contextmenu",(a,l)=>this.onContextMenu(a,l)),o.addListener("click",(a,l)=>this.onClick(a,l)),o.addListener("dblclick",(a,l)=>this.onClick(a,l)),e.ctx.animationManager.addListener("animation-start",()=>this.clearAll()),e.ctx.eventsHub.on("dom:resize",()=>this.clearAll()),e.ctx.eventsHub.on("highlight:change",a=>this.changeHighlightDatum(a)),e.ctx.eventsHub.on("layout:complete",a=>this.layoutComplete(a)),e.ctx.updateService.addListener("pre-scene-render",()=>this.preSceneRender()),e.ctx.updateService.addListener("update-complete",()=>this.updateComplete()),e.ctx.eventsHub.on("zoom:change",()=>this.clearAll()),e.ctx.eventsHub.on("zoom:pan-start",()=>this.clearAll())),n&&this.cleanup.register(n.events.on("drag-move",a=>this.onDragMove(a,r)),n.events.on("click",a=>this.onClick(a,r)),n.events.on("dblclick",a=>this.onClick(a,r)))}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;this.cachedTooltipContent=void 0,this.highlight.appliedHoverEvent&&((e=this.highlight).stashedHoverEvent??(e.stashedHoverEvent=this.highlight.appliedHoverEvent),this.clearHighlight()),this.chart.ctx.tooltipManager.removeTooltip(this.id),this.focusIndicator?.clear()}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.announceMode!=="always"&&(this.announceMode="never"),this.handleFocus(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.rect,this.chart.ctx.widgets.seriesWidget.setBounds(e.series.rect),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=dt.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.maybeEnterInteractiveTooltip(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,t){this.isState(41)&&(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(e,t))}onHover(e,t){this.isState(41)&&this.onHoverLikeEvent(e,t)}onHoverLikeEvent(e,t){if(!this.isIgnoredTouch(e)&&(e.device==="touch"&&this.chart.ctx.chartService.touch.dragAction==="hover"&&e.sourceEvent.preventDefault(),t===this.chart.ctx.widgets.seriesWidget&&((e.device==="touch"||_T(e,"drag-move"))&&(this.tooltip.lastHover=e),this.hoverDevice="pointer",this.previousInputDevice="pointer",this.highlight.pendingHoverEvent=e,this.hoverScheduler.schedule(),this.isState(32)))){const{currentX:i,currentY:s}=e,n=this.pickNodes({x:i,y:s},"event")?.matches,r=n?.[0];r?.series.hasEventListener("seriesNodeClick")||r?.series.hasEventListener("seriesNodeDoubleClick")||n!=null&&n.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(e.device==="keyboard"||(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,t),!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.maybeEnterInteractiveTooltip(e)||this.clearAll(),this.focusIndicator?.overrideFocusVisible(void 0))}onKeyDown(e){if(!this.isState(43))return;const t=LT(e.sourceEvent);switch(t?.activatesFocusIndicator===!1&&this.focusIndicator?.overrideFocusVisible(this.previousInputDevice==="keyboard"),t?.name){case"redo":return this.chart.ctx.eventsHub.emit("series:redo",null);case"undo":return this.chart.ctx.eventsHub.emit("series:undo",null);case"zoomin":return this.chart.ctx.eventsHub.emit("series:keynav-zoom",{delta:1,widgetEvent:e});case"zoomout":return this.chart.ctx.eventsHub.emit("series:keynav-zoom",{delta:-1,widgetEvent: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.eventsHub.emit("series:focus-change",null))}onSubmit(e){if(!this.isState(34))return;const{series:t,datum:i}=this.focus,s=e.sourceEvent;t!=null&&i!=null?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)===0?this.announceMode="when-changed":this.announceMode="always":(this.focusIndicator?.update(i.rect,this.seriesRect,!1),this.swapChain.update(i.text),this.announceMode="always")}handleSeriesFocus(e,t){if(this.chart.chartType==="standalone")return this.handleSoloSeriesFocus(e,t);const{focus:i}=this,s=i.sortedSeries.filter(l=>l.visible&&l.focusable);if(s.length===0)return 1;const n=i.datumIndex-t,r=i.seriesIndex-e;i.seriesIndex=se(0,i.seriesIndex,s.length-1),i.series=s[i.seriesIndex];const o=this.focus.datumIndex,a=this.focus.seriesIndex;return this.updatePickedFocus(o,t,n,a,e,r)}handleSoloSeriesFocus(e,t){this.focus.series=this.focus.sortedSeries[0];const i=this.focus.datumIndex,s=this.focus.seriesIndex,n=this.focus.datumIndex-t,r=this.focus.seriesIndex-e;return this.updatePickedFocus(i,t,n,s,e,r)}updatePickedFocus(e,t,i,s,n,r){const{focus:o,hoverRect:a,seriesRect:l}=this;if(o.series==null||a==null)return 1;const c=o?.series?.pickFocus({datumIndex:e,datumIndexDelta:t,otherIndex:s,otherIndexDelta:n,seriesRect:l});if(!c)return 2;const{datum:h}=c;if(o.datum=h,o.datumIndex=c.datumIndex,c.otherIndex!=null&&(o.seriesIndex=c.otherIndex),this.focusIndicator?.isFocusVisible()){this.chart.ctx.animationManager.reset();const d=kT(c),{x:p,y:g}=d.computeCenter();if(!a.containsPoint(p,g)&&this.chart.ctx.zoomManager.panToBBox(this.id,a,d))return 3;const{x1:m,x2:b,y1:y,y2:v}=ol.from(d),M=a.containsPoint(m,y),S=a.containsPoint(b,y),D=a.containsPoint(m,v),A=a.containsPoint(b,v);if(!(M||S||D||A)){const I=ol.from(a);c.movedBounds=d.clone(),m<I.x1&&b<I.x1?(c.movedBounds.x=I.x1-2,c.movedBounds.width=4):m>I.x2&&b>I.x2&&(c.movedBounds.x=I.x2-2,c.movedBounds.width=4),y<I.y1&&v<I.y1?(c.movedBounds.y=I.y1-2,c.movedBounds.height=4):y>I.y2&&v>I.y2&&(c.movedBounds.y=I.y2-2,c.movedBounds.height=4)}}this.focusIndicator?.update(c.movedBounds??c.bounds,this.seriesRect,c.clipFocusBox);const u=wT(o.series,a,c);if(u!=null&&this.hoverDevice==="keyboard"){this.tooltip.lastHover=void 0,this.highlight.appliedHoverEvent=void 0,this.highlight.pendingHoverEvent=void 0,this.highlight.stashedHoverEvent=void 0;const d=this.getTooltipContent(o.series,h.datumIndex,h,"aria-label"),p=yh.makeTooltipMeta(u,o.series,h,c.movedBounds);this.chart.ctx.highlightManager.updateHighlight(this.id,h),this.isTooltipEnabled(o.series)&&this.chart.ctx.tooltipManager.updateTooltip(this.id,p,d),this.maybeAnnouncePickedFocus(t,i,n,r,c,d)}return 0}maybeAnnouncePickedFocus(e,t,i,s,n,r){const{focus:o}=this;let a;this.announceMode==="when-changed"?e===0&&i===0||t!==n.datumIndex||s!==(n.otherIndex??o.seriesIndex)?a="always":a="never":a=this.announceMode,a==="always"&&this.swapChain.update(this.getDatumAriaText(n.datum,r))}getDatumAriaText(e,t){const i=t==null?"":e0(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=>ng(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",Kt))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.getTooltipContent(e,i,t,"tooltip");if(o!=null){const l=yh.makeTooltipMeta({type:"pointermove",canvasX:s,canvasY:n},e,t,void 0);this.chart.ctx.tooltipManager.updateTooltip(this.id,l,o,r)}else this.chart.ctx.tooltipManager.removeTooltip(this.id)}maybeEnterInteractiveTooltip(e){return this.chart.tooltip.maybeEnterInteractiveTooltip(e,()=>{this.tooltip.lastHover=void 0,this.chart.ctx.tooltipManager.removeTooltip(this.id),this.chart.ctx.highlightManager.updateHighlight(this.id)})}changeHighlightDatum(e){const t=e.previousHighlight?.series,i=e.currentHighlight?.series;t?.properties.cursor&&e.previousHighlight?.datum&&this.chart.ctx.domManager.updateCursor(t.id),i?.properties.cursor&&i.properties.cursor!=="default"&&e.currentHighlight?.datum&&this.chart.ctx.domManager.updateCursor(i.id,i.properties.cursor),i==null||t==null?this.update(5):this.update(5,{seriesToUpdate:new Set([t,i].filter(Boolean))})}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}isTooltipEnabled(e){return e.tooltipEnabled??this.chart.tooltip.enabled}getTooltipContent(e,t,i,s){let n;if(s==="aria-label"||this.isTooltipEnabled(e)){const{cachedTooltipContent:r}=this;if(r!=null&&r.series===e&&r.datumIndex===t)n=r.content;else{const o=this.chart.getTooltipContent(e,t,i);this.cachedTooltipContent={series:e,datumIndex:t,content:o},n=o}}else this.cachedTooltipContent=void 0;return n}};function _T(e,t){return e.type!==t}var r0=30,HT=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}getGroupIndex(e){const{internalId:t,seriesGrouping:i}=e;return i?.groupIndex??t}getGroupType(e,t){return t?"top":e.type}requestGroup(e){const{internalId:t,contentGroup:i}=e,s=e.bringToFront(),n=this.getGroupType(e,s),r=this.getGroupIndex(e),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>=r0?"aggressive-grouping":"normal");let a=this.groups.get(n);a==null&&(a=new Map,this.groups.set(n,a));const l=this.lookupIdx(r);let c=a.get(l);return c==null&&(c={type:n,id:l,seriesIds:[],group:this.seriesRoot.appendChild(new ge({name:`${e.contentGroup.name??n}-managed-layer`,zIndex:e.contentGroup.zIndex,renderToOffscreenCanvas:!1}))},a.set(l,c)),this.series.set(t,{layerState:c,seriesConfig:e,bringToFront:s}),c.seriesIds.push(t),c.group.appendChild(i),c.group}changeGroup(e){const{internalId:t,contentGroup:i}=e,s=e.bringToFront(),n=this.getGroupType(e,s),r=this.series.get(t),o=r?this.getGroupType(r.seriesConfig,r.bringToFront):void 0,a=this.getGroupIndex(e),l=this.lookupIdx(a),c=this.groups.get(n)?.get(l);if(!(o===n&&c?.seriesIds.includes(t)===!0))return this.series.has(t)&&this._releaseGroup({internalId:t,contentGroup:i,type:o}),this.requestGroup(e)}releaseGroup(e){const{internalId:t,contentGroup:i}=e,s=this.getGroupType(e,e.bringToFront());this._releaseGroup({internalId:t,contentGroup:i,type:s})}_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)),!Number.isFinite(e))?0:Math.floor(se(0,e/this.expectedSeriesCount,1)*r0)}destroy(){this.groups.forEach(e=>{e.forEach(t=>{this.seriesRoot.removeChild(t.group)})}),this.groups.clear(),this.series.clear()}getLowestSeriesZIndex(e){let t;for(const i of e){const n=this.series.get(i)?.seriesConfig.contentGroup.zIndex??1;if(t==null||n==null){t=n;continue}t=Jm(t,n)<=0?t:n}return t??1}},o0=class extends re{constructor(){super(...arguments),this.dragAction="drag"}};f([x],o0.prototype,"dragAction",2);var UT=class{constructor(e,t,i,s,n,r){this.chart=e,this.eventsHub=t,this.dataService=i,this.updateService=s,this.zoomManager=n,this.animationManager=r,this.dirtyZoom=!1,this.dirtyDataSource=!1,this.lastAxisZooms=new Map,this.cleanup=new at,this.cleanup.register(this.eventsHub.on("data:source-change",()=>this.onDataSourceChange()),this.eventsHub.on("data:load",()=>this.onDataLoad()),this.eventsHub.on("data:error",()=>this.onDataError()),this.updateService.addListener("update-complete",o=>this.onUpdateComplete(o)),this.eventsHub.on("zoom:change",()=>this.onZoomChange()))}destroy(){this.cleanup.flush()}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);(n.min!==0||n.max!==1)&&(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}}},$T=/^((?!chrome|android).)*safari/i,WT=/Version\/(\d+(\.\d+)?)/,YT=/Chrome/,KT=/Chrome\/(\d+)/,ZT=/Edg/,XT=/OPR/;function qT(){const{userAgent:e}=Fe("navigator");if($T.test(e)){const t=WT.exec(e);if(t==null)return!1;const i=parseFloat(t[1]),s=Math.floor(i)>16;return s||j.warnOnce(`Unsupported Safari version: ${i}; ${e}`),!s}else if(YT.test(e)&&!ZT.test(e)&&!XT.test(e)){const t=KT.exec(e);if(t==null)return!1;const i=parseInt(t[1],10),s=i>126;return s||j.warnOnce(`Unsupported Chrome version: ${i}; ${e}`),!s}return!1}var QT=new Set(["map-shape-background","map-line-background"]),JT=class{constructor(e,t,i,s,n,r,o){this.chartLike=e,this.overlays=t,this.eventsHub=i,this.dataService=s,this.localeManager=n,this.animationManager=r,this.domManager=o,this.cleanup=new at,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.cleanup.register(this.eventsHub.on("layout:complete",a=>this.onLayoutComplete(a)))}destroy(){this.cleanup.flush(),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&&!QT.has(c.type));this.overlays.darkTheme?this.overlayElem.classList.add(Bx):this.overlayElem.classList.remove(Bx),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&&qT();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;Ce(this.overlayElem,"aria-hidden",!l)}showOverlay(e,t){if(!e.enabled)return;const i=e.getElement(this.chartLike,this.animationManager,this.localeManager,t);this.overlayElem.appendChild(i)}hideOverlay(e){e.removeElement(()=>{this.overlayElem.innerText="\xA0"},this.animationManager)}},qi=be.create(!0,"opts"),ft=class WS extends Ty{constructor(t,i){var s;super(),this.id=cs(this),this.seriesRoot=new hi({name:`${this.id}-series-root`,zIndex:7}),this.annotationRoot=new hi({name:`${this.id}-annotation-root`,zIndex:11}),this.titleGroup=new ge({name:"titles",zIndex:15}),this.debug=be.create(),this.extraDebugStats={},this.data=[],this._firstAutoSize=!0,this._autoSizeNotify=new Lm,this.chartCaptions=new oh,this.padding=new Cr(20),this.keyboard=new Ep,this.touch=new o0,this.mode="standalone",this.styleNonce=void 0,this.formatter=void 0,this.suppressFieldDotNotation=!1,this.loadGoogleFonts=!1,this.destroyed=!1,this.cleanup=new at,this.chartAnimationPhase="initial",this.modulesManager=new xT,this.processors=[],this.queuedUserOptions=[],this.queuedChartOptions=[],this.firstApply=!0,this.syncStatus="init",this.fireEventWrapper=h=>super.fireEvent(h),this.apiUpdate=!1,this._pendingFactoryUpdatesCount=0,this._performUpdateSkipAnimations=!1,this._performUpdateNotify=new Lm,this.performUpdateType=8,this.runningUpdateType=8,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new rA,this.updateRequestors={},this.performUpdateTrigger=lA(({count:h})=>{this.destroyed||this.updateMutex.acquire(async()=>{try{await this.performUpdate(h)}catch(u){j.error("update error",u,u.stack)}}).catch(u=>j.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 jh))return;const{series:u,seriesGrouping:d}=h;if(u.contentGroup.isRoot())return;const p=this.seriesLayerManager.changeGroup({internalId:u.internalId,type:u.type,contentGroup:u.contentGroup,bringToFront:()=>u.bringToFront(),renderToOffscreenCanvas:()=>u.renderToOffscreenCanvas(),seriesGrouping:d});p!=null&&u.attachSeries(p,this.seriesRoot,this.annotationRoot)},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 ge({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 Xi,this.seriesLayerManager=new HT(this.seriesRoot),this.mode=t.userOptions.mode??this.mode,this.styleNonce=t.processedOptions.styleNonce;const l=this.ctx=new lL(this,{chartType:this.getChartType(),scene:n,root:a,container:r,styleContainer:o,domMode:t.optionMetadata.domMode,withDragInterpretation:t.optionMetadata.withDragInterpretation??!0,syncManager:new EL(this),fireEvent:h=>this.fireEvent(h),updateCallback:(h,u)=>this.update(h,u),updateMutex:this.updateMutex});this.cleanup.register(l.eventsHub.on("dom:resize",()=>this.parentResize(l.domManager.containerSize))),this.overlays=new Yo,(s=this.overlays.loading).renderer??(s.renderer=()=>vT(this.overlays.loading.getText(l.localeManager),l.animationManager.defaultDuration)),this.processors=[new UT(this,l.eventsHub,l.dataService,l.updateService,l.zoomManager,l.animationManager),new JT(this,this.overlays,l.eventsHub,l.dataService,l.localeManager,l.animationManager,l.domManager)],this.highlight=new Wb,this.container=r;const c=this.getModuleContext();l.domManager.setDataBoolean("animating",!1),this.seriesAreaManager=new GT(this.initSeriesAreaDependencies()),this.cleanup.register(l.layoutManager.registerElement(0,h=>{h.layoutBox.shrink(this.padding.toJson()),this.chartCaptions.positionCaptions(h)}),l.eventsHub.on("layout:complete",h=>this.chartCaptions.positionAbsoluteCaptions(h)),l.eventsHub.on("data:load",h=>{this.data=h.data}),this.title.registerInteraction(c,"beforebegin"),this.subtitle.registerInteraction(c,"beforebegin"),this.footnote.registerInteraction(c,"afterend"),Bs.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.eventsHub.on("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 WS.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)}fireEvent(t){us(this,this.fireEventWrapper,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.cleanup.flush(),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=>j.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",Ja[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:Ja[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?(j.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=bd(this.axes,i=>i.direction);for(const i of this.series)for(const s of i.directions){const n=t[s];if(!n){j.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){j.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||!je(h)||!je(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 ex(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&&j.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,i){const s=Fe("agChartsDebugTimeout");s==null?(t??(t=1e5),i??(i=!1)):(t=s,i??(i=!0));const n=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()-n>t){const r=`Chart.waitForUpdate() timeout of ${t} reached - first chart update taking too long.`;if(i)throw new Error(r);j.warnOnce(r)}Cy()&&await Tm(),this.ctx.scene.waitingForUpdate()&&await Tm(50)}}filterMiniChartSeries(t){return t?.filter(i=>i.showInMiniChart!==!1)}applyOptions(t){const s=this.firstApply?t.processedOptions:t.diffOptions(this.chartOptions);if(s==null||Object.keys(s).length===0){qi("Chart.applyOptions() - no delta, forcing re-layout",s),this.update(4,{apiUpdate:!0,newAnimationBatch:!0});return}const n=this.firstApply?{}:this.chartOptions.processedOptions,r=t.processedOptions;qi("Chart.applyOptions() - applying delta",s);const o=this.applyModules(r),a=["type","data","series","listeners","preset","theme","legend.listeners","navigator.miniChart.series","navigator.miniChart.label","locale.localeText","axes","topology","nodes","initialState","styleContainer","formatter"];s.listeners&&this.registerListeners(this,s.listeners),Ka(this,s,{skip:a});let l=!1,c="no-op";s.series!=null&&(c=this.applySeries(this,s.series,n?.series),l=!0),c==="replaced"&&this.resetAnimations(),this.applyAxes(this,r,n,c,[])&&(l=!0),s.data&&(this.data=s.data),s.legend?.listeners&&this.modulesManager.isEnabled("legend")&&Object.assign(this.legend.listeners,s.legend.listeners),s.locale?.localeText&&(this.modulesManager.getModule("locale").localeText=s.locale?.localeText),this.chartOptions=t;const h=this.modulesManager.getModule("navigator"),u=this.modulesManager.getModule("zoom");!h?.enabled&&!u?.enabled&&this.ctx.zoomManager.updateZoom("chart");const d=h?.miniChart,p=r.navigator?.miniChart?.series??r.series;d?.enabled===!0&&p!=null?this.applyMiniChartOptions(d,p,r,n):d?.enabled===!1&&(d.series=[],d.axes=[]),this.ctx.annotationManager.setAnnotationStyles(t.annotationThemes),l||(l=this.shouldForceNodeDataRefresh(s,c));const m=l||o?0:4;if(this.maybeResetAnimations(c),this.shouldClearLegendData(r,n,c)&&this.ctx.legendManager.clearData(),this.applyInitialState(r),this.ctx.formatManager.setFormatter(r.formatter),qi("Chart.applyOptions() - update type",Ja[m],{seriesStatus:c,forceNodeDataRefresh:l}),t.optionsProcessingTime!==void 0){this._performUpdateSplits["\u2699\uFE0F"]=t.optionsProcessingTime;const b=performance.now()-t.optionsProcessingTime;this._performUpdateSplits.start=b}this.update(m,{apiUpdate:!0,forceNodeDataRefresh:l,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 Ee(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=kp.getKeys(),r=Object.values(n).some(a=>t[a]!=null),o=t.title!=null&&t.subtitle!=null||t.formatter!=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(V(u,["interval","autoRotate","autoRotateAngle","itemStyler","minSpacing","rotation"])),c.type==="grouped-category"){c.label.enabled=!1,c.label.rotation=0;const{depthOptions:p}=c;if(p.length===0)p.set([{label:{enabled:!0}}]);else for(let g=1;g<p.length;g++)p[g].label.enabled=!1}else(c.type==="time"||c.type==="unit-time"||c.type==="ordinal-time")&&(c.parentLevel.enabled=!1);c.interval.step=d?.step,c.interval.values=d?.values,c.interval.minSpacing=d?.minSpacing,c.interval.maxSpacing=d?.maxSpacing}}applyModules(t){const{type:i}=this.constructor;let s=!1;for(const n of js.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=yT(t.series,i,s);if(n.status==="no-overlap"){qi(`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"}qi("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),qi("Chart.applySeries() - created new series",u);break}case"remove":qi(`Chart.applySeries() - removing series at previous idx ${h.idx}`,h.series);break;case"no-op":r.push(h.series),qi(`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;qi(`Chart.applySeries() - applying series diff previous idx ${p}`,d,u),this.applySeriesValues(u,d),u.markNodeDataDirty(),r.push(u)}}return this.initSeriesDeclarationOrder(r),qi("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;return!(n==="replaced")&&t.axes.length===o.length&&t.axes.every((c,h)=>c.type===o[h].type)&&zx(s)?(t.axes.forEach((c,h)=>{const u=s.axes?.[h]??{},d=hn(u,o[h]);qi(`Chart.applyAxes() - applying axis diff idx ${h}`,d);const p=`axes[${h}]`;Ka(c,d,{path:p,skip:r})}),!0):(qi(`Chart.applyAxes() - creating new axes instances; seriesStatus: ${n}`),t.axes=this.createAxis(o,r),!0)}createSeries(t){const i=ps.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 js.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 al)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),"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=kr.create(o.type,n);this.applyAxisModules(a,o),Ka(a,o,{path:`axes[${r}]`,skip:i}),s.push(a)}return fT(s),s}applyAxisModules(t,i){const s=t.createModuleContext(),n=t.getModuleMap();for(const r of js.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){t.clearEventListeners();for(const[s,n]of ls(i))t.addEventListener(s,n)}};ft.chartsInstances=new WeakMap,f([ui({newValue(e){this.destroyed||(this.ctx.domManager.setContainer(e),ft.chartsInstances.set(e,this))},oldValue(e){ft.chartsInstances.delete(e)}})],ft.prototype,"container",2),f([ui({newValue(e){this.resize("width option",{inWidth:e})}})],ft.prototype,"width",2),f([ui({newValue(e){this.resize("height option",{inHeight:e})}})],ft.prototype,"height",2),f([ui({newValue(e){this.resize("minWidth option",{inMinWidth:e})}})],ft.prototype,"minWidth",2),f([ui({newValue(e){this.resize("minHeight option",{inMinHeight:e})}})],ft.prototype,"minHeight",2),f([ui({newValue(e){this.resize("overrideDevicePixelRatio option",{inOverrideDevicePixelRatio:e})}})],ft.prototype,"overrideDevicePixelRatio",2),f([x],ft.prototype,"padding",2),f([x],ft.prototype,"keyboard",2),f([x],ft.prototype,"touch",2),f([x],ft.prototype,"mode",2),f([x],ft.prototype,"styleNonce",2),f([Gt("chartCaptions.title")],ft.prototype,"title",2),f([Gt("chartCaptions.subtitle")],ft.prototype,"subtitle",2),f([Gt("chartCaptions.footnote")],ft.prototype,"footnote",2),f([x],ft.prototype,"formatter",2),f([x],ft.prototype,"suppressFieldDotNotation",2),f([x],ft.prototype,"loadGoogleFonts",2),f([ui({changeValue(e,t){this.onAxisChange(e,t)}})],ft.prototype,"axes",2),f([ui({changeValue(e,t){this.onSeriesChange(e,t)}})],ft.prototype,"series",2);var Gh=ft;function a0(e,t){let i=[];const s=e?.series?.[0]?.type,n=s==="linear-gauge"||s==="radial-gauge",r=s?Ht.get(s):"unknown";for(const o of al)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)||!Ae(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)||!Ae(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||!Ae(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(!Ae(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){n&&(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/"),j.warnOnce([`unable to use these enterprise features as '${o}' has not been loaded:`,"",...i,"",`See: ${a}`].join(`
`))}}function ek(e){const t="mode"in e&&e.mode==="integrated";for(const i of js.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]}}function l0(e){return e?.up||e?.down||e?.neutral?"user-full":e?.fills||e?.strokes?"user-indexed":"inbuilt"}var Tt={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},xn={BLUE:"#2b5c95",ORANGE:"#cc6f10",GREEN:"#1e652e",CYAN:"#18859e",YELLOW:"#a69400",VIOLET:"#603c88",GRAY:"#575757",MAGENTA:"#7d2f6d",BROWN:"#4f3508",RED:"#a82529"},rg={};Fs(rg,{DEFAULT_ANNOTATION_HANDLE_FILL:()=>Ll,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>wl,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>Nl,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>El,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>Ol,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>Tl,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>kl,DEFAULT_CAPTION_ALIGNMENT:()=>Zn,DEFAULT_CAPTION_LAYOUT_STYLE:()=>Kn,DEFAULT_FIBONACCI_STROKES:()=>Al,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>Rt,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>mt,DEFAULT_GRIDLINE_ENABLED:()=>ms,DEFAULT_POLAR_SERIES_STROKE:()=>Kh,DEFAULT_SEPARATION_LINES_COLOUR:()=>Il,DEFAULT_SHADOW_COLOUR:()=>Yn,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>Zh,DEFAULT_TEXTBOX_COLOR:()=>zl,DEFAULT_TEXTBOX_FILL:()=>Pl,DEFAULT_TEXTBOX_STROKE:()=>Rl,DEFAULT_TEXT_ANNOTATION_COLOR:()=>Cl,DEFAULT_TOOLBAR_POSITION:()=>Fl,IS_DARK_THEME:()=>Zo,PALETTE_ALT_DOWN_FILL:()=>cg,PALETTE_ALT_DOWN_STROKE:()=>ag,PALETTE_ALT_NEUTRAL_FILL:()=>hg,PALETTE_ALT_NEUTRAL_STROKE:()=>ug,PALETTE_ALT_UP_FILL:()=>lg,PALETTE_ALT_UP_STROKE:()=>og,PALETTE_DOWN_FILL:()=>$h,PALETTE_DOWN_STROKE:()=>Hh,PALETTE_NEUTRAL_FILL:()=>Yh,PALETTE_NEUTRAL_STROKE:()=>Wh,PALETTE_UP_FILL:()=>Uh,PALETTE_UP_STROKE:()=>_h});var Zo=Symbol("is-dark-theme"),Il=Symbol("default-separation-lines-colour"),Yn=Symbol("default-shadow-colour"),Kn=Symbol("default-caption-layout-style"),Zn=Symbol("default-caption-alignment"),_h=Symbol("palette-up-stroke"),Hh=Symbol("palette-down-stroke"),Uh=Symbol("palette-up-fill"),$h=Symbol("palette-down-fill"),Wh=Symbol("palette-neutral-stroke"),Yh=Symbol("palette-neutral-fill"),og=Symbol("palette-alt-up-stroke"),ag=Symbol("palette-alt-down-stroke"),lg=Symbol("palette-alt-up-fill"),cg=Symbol("palette-alt-down-fill"),hg=Symbol("palette-gray-fill"),ug=Symbol("palette-gray-stroke"),Kh=Symbol("default-polar-series-stroke"),Zh=Symbol("default-sparkline-crosshair-stroke"),mt=Symbol("default-financial-charts-annotation-stroke"),Al=Symbol("default-hierarchy-strokes"),Cl=Symbol("default-text-annotation-color"),Rt=Symbol("default-financial-charts-annotation-background-fill"),Ll=Symbol("default-annotation-handle-fill"),Tl=Symbol("default-annotation-statistics-fill"),kl=Symbol("default-annotation-statistics-stroke"),wl=Symbol("default-annotation-statistics-color"),Nl=Symbol("default-annotation-statistics-divider-stroke"),El=Symbol("default-annotation-statistics-fill"),Ol=Symbol("default-annotation-statistics-stroke"),Pl=Symbol("default-textbox-fill"),Rl=Symbol("default-textbox-stroke"),zl=Symbol("default-textbox-color"),Fl=Symbol("default-toolbar-position"),ms=Symbol("default-gridline-enabled"),c0=[{type:"number",position:{$if:[{$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},"bottom","left"]}},{type:"category",position:{$if:[{$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},"left","bottom"]}}],tk={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},{$palette:"fillFallback"},{$palette:"fill"}]},dg={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},{$palette:"fillsFallback"},{$palette:"fills"}]},Xh={$if:[{$isGradient:{$palette:"fill"}},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/stroke",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},ik={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},[{$palette:"fillFallback"},{$palette:"fillFallback"}],{$palette:"range2"}]},Xo={type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},sk={...Xo,colorStops:[{$mix:[{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"black",.15]},{$mix:[{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"white",.15]}]},nk=e=>({...Xo,colorStops:{$if:[{$or:[{$isGradient:{$palette:`${e}.fill`}},{$isPattern:{$palette:`${e}.fill`}},{$isImage:{$palette:`${e}.fill`}}]},{$map:[{$path:["/color",void 0,{$value:"$1"}]},{$path:["/colorStops",void 0,{$palette:`${e}.fill`}]}]},[{$mix:[{$palette:`${e}.fill`},"black",.15]},{$mix:[{$palette:`${e}.fill`},"white",.15]}]]}}),qh={type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},jl={...qh,reverse:!0},rk={...qh,bounds:"series"},ok={...qh,bounds:"series",reverse:!0},ak={type:"gradient",gradient:"conic",bounds:"series",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},vn={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:Xh,strokeOpacity:1,strokeWidth:4,backgroundFill:"none",backgroundFillOpacity:1,rotation:0,scale:1},lk={...vn,fill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]}},Fr={type:"image",backgroundFill:{$palette:"fillFallback"},backgroundFillOpacity:1,repeat:"no-repeat",fit:"contain",rotation:0};function ji(e){return Zm(e,t=>{const i=We.fromString(t);return[We.darken(i,.15).toString(),t,We.lighten(i,.15).toString()]})}var pg={stroke:{$path:["../../highlightStyle/item/stroke","rgba(0, 0, 0, 0.4)"]},strokeWidth:{$path:["../../highlightStyle/item/strokeWidth",2]},strokeOpacity:{$path:["../../highlightStyle/item/strokeOpacity",void 0]},opacity:{$path:["../../highlightStyle/item/opacity",1]}},h0={...pg,fill:{$path:["../../highlightStyle/item/fill","rgba(255,255,255, 0.33)"]},fillOpacity:{$path:["../../highlightStyle/item/fillOpacity",void 0]}},Qi={padding:8,cornerRadius:4,fill:{$if:[{$and:[{$eq:[{$path:"./fill/type"},"image"]},{$isUserOption:["./fill/backgroundFill",!1,!0]}]},{backgroundFill:"transparent"},void 0]},border:{enabled:{$isUserOption:["../border",!0,!1]},strokeWidth:1,stroke:{$foregroundOpacity:.08}}};function Xn(e=!0){return{enabled:!0,highlightedItem:e?h0:pg,unhighlightedItem:{strokeWidth:{$path:["../../highlightStyle/series/strokeWidth",void 0]}},highlightedSeries:{strokeWidth:{$path:["../../highlightStyle/series/strokeWidth",void 0]}},unhighlightedSeries:{opacity:{$path:["../../highlightStyle/series/dimOpacity",void 0]}}}}function u0(e=!0){return{enabled:!0,highlightedItem:e?h0:pg,unhighlightedItem:{strokeWidth:{$path:["../../highlightStyle/series/strokeWidth",void 0]},opacity:{$path:["../../highlightStyle/series/dimOpacity",void 0]}}}}var d0={border:{enabled:!1,stroke:{$foregroundBackgroundMix:.25},strokeOpacity:1,strokeWidth:1},cornerRadius:4,fillOpacity:1,padding:{$if:[{$eq:[{$path:"./border/enabled"},!0]},5,{$isUserOption:["./fill",5,0]}]}},gg="white",ck={get cartesian(){return{seriesTypes:Ht.cartesianTypes,commonOptions:["zoom","navigator"]}},get polar(){return{seriesTypes:Ht.polarTypes,commonOptions:[]}},get topology(){return{seriesTypes:Ht.topologyTypes,commonOptions:[]}},get standalone(){return{seriesTypes:Ht.standaloneTypes,commonOptions:[]}}},hk={"radial-gauge":!0,"linear-gauge":!0};function uk(e){return hk[e]===!0}var Bi=class Ac{static getDefaultColors(){return{fills:Tt,fillsFallback:Object.values(Tt),strokes:xn,sequentialColors:ji(Tt),divergingColors:[Tt.ORANGE,Tt.YELLOW,Tt.GREEN],hierarchyColors:["#fff","#e0e5ea","#c1ccd5","#a3b4c1","#859cad"],secondSequentialColors:We.interpolate([We.fromHexString(Tt.BLUE),We.fromHexString("#cbdef5")],8).map(t=>t.toString()),secondDivergingColors:[Tt.GREEN,Tt.YELLOW,Tt.RED],secondHierarchyColors:["#fff","#c5cbd1","#a4b1bd","#8498a9","#648096"],up:{fill:Tt.GREEN,stroke:xn.GREEN},down:{fill:Tt.RED,stroke:xn.RED},neutral:{fill:Tt.GRAY,stroke:xn.GRAY},altUp:{fill:Tt.BLUE,stroke:xn.BLUE},altDown:{fill:Tt.ORANGE,stroke:xn.ORANGE},altNeutral:{fill:Tt.GRAY,stroke:xn.GRAY}}}static getDefaultPublicParameters(){return{accentColor:"#2196f3",axisColor:{$foregroundBackgroundMix:.325},backgroundColor:gg,borderColor:{$foregroundOpacity:.15},borderRadius:4,chartBackgroundColor:{$ref:"backgroundColor"},chartPadding:20,focusShadow:"0 0 0 3px var(--ag-charts-accent-color)",foregroundColor:"#181d1f",fontFamily:"Verdana, sans-serif",fontSize:dn,fontWeight:400,gridLineColor:{$foregroundBackgroundMix:.1},popupShadow:"0 0 16px rgba(0, 0, 0, 0.15)",subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"chartBackgroundColor"},.38]},textColor:{$ref:"foregroundColor"},chromeBackgroundColor:{$foregroundBackgroundMix:.02},chromeFontFamily:{$ref:"fontFamily"},chromeFontSize:{$ref:"fontSize"},chromeFontWeight:{$ref:"fontWeight"},chromeTextColor:{$ref:"foregroundColor"},chromeSubtleTextColor:{$mix:[{$ref:"chromeTextColor"},{$ref:"backgroundColor"},.38]},buttonBackgroundColor:{$ref:"backgroundColor"},buttonBorder:!0,buttonFontWeight:400,buttonTextColor:{$ref:"textColor"},inputBackgroundColor:{$ref:"backgroundColor"},inputBorder:!0,inputTextColor:{$ref:"textColor"},menuBackgroundColor:{$ref:"chromeBackgroundColor"},menuBorder:!0,menuTextColor:{$ref:"chromeTextColor"},panelBackgroundColor:{$ref:"chromeBackgroundColor"},panelSubtleTextColor:{$ref:"chromeSubtleTextColor"},tooltipBackgroundColor:{$ref:"chromeBackgroundColor"},tooltipBorder:!0,tooltipTextColor:{$ref:"chromeTextColor"},tooltipSubtleTextColor:{$ref:"chromeSubtleTextColor"},crosshairLabelBackgroundColor:{$ref:"foregroundColor"},crosshairLabelTextColor:{$ref:"chartBackgroundColor"}}}static getAxisDefaults(t,{title:i,time:s}){return Ee(t,i&&{title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:Pi.MEDIUM},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},s&&{parentLevel:{enabled:!1,label:{enabled:{$path:"../../label/enabled"},border:{enabled:{$or:[{$isUserOption:["../border",!0,!1]},{$path:"../../../label/border/enabled"}]},strokeWidth:{$path:"../../../label/border/strokeWidth"},stroke:{$path:"../../../label/border/stroke"}},fill:{$path:"../../label/fill"},fontSize:{$path:"../../label/fontSize"},fontFamily:{$path:"../../label/fontFamily"},fontWeight:"bold",spacing:{$path:"../../label/spacing"},color:{$path:"../../label/color"},cornerRadius:{$path:"../../label/cornerRadius"},padding:{$path:"../../label/padding"},avoidCollisions:{$path:"../../label/avoidCollisions"}},tick:{enabled:{$path:"../../tick/enabled"},width:{$path:"../../tick/width"},size:{$path:"../../tick/size"},stroke:{$path:"../../tick/stroke"}}}},{label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:11,color:{$ref:"textColor"},avoidCollisions:!0,cornerRadius:4,border:{enabled:{$isUserOption:["../border",!0,!1]},strokeWidth:1,stroke:{$foregroundOpacity:.08}},padding:{$if:[{$eq:[{$path:"./border/enabled"},!0]},{left:12,right:12,top:8,bottom:8},void 0]}},line:{enabled:!0,width:1,stroke:{$ref:"axisColor"}},tick:{enabled:!1,size:6,width:1,stroke:{$ref:"axisColor"}},gridLine:{enabled:!0,width:1,style:{$apply:[{fillOpacity:1,stroke:{$ref:"gridLineColor"},strokeWidth:{$path:"../../width"},lineDash:[]},[{fillOpacity:1,stroke:{$ref:"gridLineColor"},strokeWidth:{$path:"../../width"},lineDash:[]}]]}},crossLines:{$apply:[{enabled:!0,fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},fillOpacity:.08,strokeWidth:1,label:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},padding:5,color:{$ref:"textColor"}}},void 0,{$pathString:["/common/axes/$axisType/crossLines",{axisType:{$path:["/axes/$index/type"]}}]},{$pathString:["/$seriesType/axes/$axisType/crossLines",{seriesType:{$path:["/series/0/type","line"]},axisType:{$path:["/axes/$index/type"]}}]}]}})}getChartDefaults(){return{minHeight:300,minWidth:300,background:{visible:!0,fill:{$ref:"chartBackgroundColor"}},padding:{top:{$ref:"chartPadding"},right:{$ref:"chartPadding"},bottom:{$ref:"chartPadding"},left:{$ref:"chartPadding"}},seriesArea:{border:{enabled:!1,stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:1},cornerRadius:4,padding:{$if:[{$eq:[{$path:"./border/enabled"},!0]},5,0]}},keyboard:{enabled:!0},title:{enabled:!1,text:"Title",spacing:{$if:[{$path:"../subtitle/enabled"},10,20]},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:Pi.LARGEST},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},wrapping:"hyphenate",layoutStyle:Kn,textAlign:Zn},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:Pi.MEDIUM},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:Kn,textAlign:Zn},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:{$rem:Pi.MEDIUM},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:Kn,textAlign:Zn},legend:{...d0,enabled:{$and:[{$greaterThan:[{$size:[{$path:"/series"}]},1]},{$or:[{$isChartType:"cartesian"},{$isChartType:"standalone"},{$and:[{$isChartType:"polar"},{$not:{$isSeriesType:"pie"}},{$not:{$isSeriesType:"donut"}}]}]}]},position:"bottom",orientation:{$if:[{$or:[{$eq:[{$path:"./position"},"left"]},{$eq:[{$path:"./position"},"left-top"]},{$eq:[{$path:"./position"},"left-bottom"]},{$eq:[{$path:"./position"},"right"]},{$eq:[{$path:"./position"},"right-top"]},{$eq:[{$path:"./position"},"right-bottom"]},{$eq:[{$path:"./position/placement"},"left"]},{$eq:[{$path:"./position/placement"},"left-top"]},{$eq:[{$path:"./position/placement"},"left-bottom"]},{$eq:[{$path:"./position/placement"},"right"]},{$eq:[{$path:"./position/placement"},"right-top"]},{$eq:[{$path:"./position/placement"},"right-bottom"]}]},"vertical","horizontal"]},spacing:30,listeners:{},toggleSeries:!0,item:{paddingX:16,paddingY:8,marker:{size:15,padding:8},showSeriesStroke:!0,label:{color:{$ref:"textColor"},fontSize:{$rem:Pi.SMALL},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"}}},fill:{$if:[{$path:["./position/floating",!1]},{$ref:"chartBackgroundColor"},"transparent"]}},tooltip:{enabled:!0,darkTheme:Zo,delay:0,pagination:!1,mode:{$if:[{$and:[{$isChartType:"cartesian"},{$not:{$hasSeriesType:"bubble"}},{$not:{$hasSeriesType:"scatter"}},{$greaterThan:[{$size:[{$path:"/series"}]},1]},{$lessThan:[{$size:[{$path:"/series"}]},4]}]},"shared","single"]}},overlays:{darkTheme:Zo},listeners:{},series:{tooltip:{range:{$path:["/tooltip/range","exact"]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","pointer"]},placement:{$path:["/tooltip/position/placement",void 0]},xOffset:{$path:["/tooltip/position/xOffset",0]},yOffset:{$path:["/tooltip/position/yOffset",0]}}}}}}constructor(t={}){const{overrides:i,palette:s,params:n}=lt(t),r=this.createChartConfigPerChartType(this.getDefaults()),o={};i&&this.processOverrides(o,i);const{fills:a,strokes:l,sequentialColors:c,...h}=this.getDefaultColors();this.palette=on(Ee(s,{fills:Object.values(a),strokes:Object.values(l),sequentialColors:Object.values(c),...h})),this.paletteType=l0(s),this.params=Ee(n,this.getPublicParameters()),this.config=on(lt(r)),this.overrides=on(i),this.presets=on(o)}processOverrides(t,i){Ht.seriesTypes.forEach(s=>{const n=s,r=i[n];uk(n)&&(t[n]=r,delete i[n])})}createChartConfigPerChartType(t){for(const[i,{seriesTypes:s}]of ls(ck)){const n=wp.get(i);for(const r of s)t[r]??(t[r]=lt(n))}return t}getDefaults(){const t=(i,s)=>{const n={},r={axes:{},...kp.getThemeTemplates(),...this.getChartDefaults(),...wp.get(i)};for(const o of s){n[o]=Ee(ps.getThemeTemplate(o),n[o]??lt(r));const{axes:a}=n[o];for(const l of kr.keys())a[l]=Ee(a[l],kr.getThemeTemplate(l),Ac.axisDefault[l]);(o==="map-shape-background"||o==="map-line-background")&&delete n[o].series.tooltip}return n};return Ee(t("cartesian",Ht.cartesianTypes),t("polar",Ht.polarTypes),t("topology",Ht.topologyTypes),t("standalone",Ht.standaloneTypes))}static applyTemplateTheme(t,i,s){if(Ae(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?lt(t):t,n=this.getTemplateParameters();return Bn(s,Ac.applyTemplateTheme,void 0,void 0,n),s}getDefaultColors(){return Ac.getDefaultColors()}getPublicParameters(){return Ac.getDefaultPublicParameters()}getTemplateParameters(){const t=new Map;t.set(Zo,!1),t.set(Il,"#d9d9d9"),t.set(Yn,"#00000080"),t.set(Zh,"#aaa"),t.set(Kn,"block"),t.set(Zn,"center"),t.set(Al,["#797b86","#e24c4a","#f49d2d","#65ab58","#409682","#4db9d2","#5090dc","#3068f9","#e24c4a","#913aac","#d93e64"]),t.set(Kh,gg),t.set(mt,Tt.BLUE),t.set(Rt,Tt.BLUE),t.set(Cl,Tt.BLUE),t.set(Ll,gg),t.set(Tl,"#fafafa"),t.set(kl,"#ddd"),t.set(wl,"#000"),t.set(Nl,"#181d1f"),t.set(El,"#e35c5c"),t.set(Ol,"#e35c5c"),t.set(Pl,"#fafafa"),t.set(Rl,"#ddd"),t.set(zl,"#000"),t.set(Fl,"top"),t.set(ms,!1);const i=this.getDefaultColors();return t.set(_h,this.palette.up?.stroke??i.up.stroke),t.set(Uh,this.palette.up?.fill??i.up.fill),t.set(Hh,this.palette.down?.stroke??i.down.stroke),t.set($h,this.palette.down?.fill??i.down.fill),t.set(Wh,this.palette.neutral?.stroke??i.neutral.stroke),t.set(Yh,this.palette.neutral?.fill??i.neutral.fill),t.set(og,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(cg,this.palette.altDown?.fill??i.down.fill),t.set(hg,this.palette.altNeutral?.fill??i.altNeutral.fill),t.set(ug,this.palette.altNeutral?.stroke??i.altNeutral.stroke),t}};Bi.axisDefault={number:Bi.getAxisDefaults({keys:[],line:{enabled:!1},crosshair:{enabled:!0}},{title:!0,time:!1}),log:Bi.getAxisDefaults({keys:[],base:10,line:{enabled:!1},crosshair:{enabled:!0}},{title:!0,time:!1}),category:Bi.getAxisDefaults({keys:[],groupPaddingInner:.1,label:{autoRotate:!0,wrapping:"on-space"},gridLine:{enabled:ms},crosshair:{enabled:!1}},{title:!0,time:!1}),"grouped-category":Bi.getAxisDefaults({keys:[],tick:{enabled:!0,stroke:Il},label:{spacing:10,rotation:270,wrapping:"on-space"},maxThicknessRatio:.5,paddingInner:.4,groupPaddingInner:.2,crosshair:{enabled:!1}},{title:!0,time:!1}),time:Bi.getAxisDefaults({keys:[],gridLine:{enabled:ms},crosshair:{enabled:!0}},{title:!0,time:!0}),"unit-time":Bi.getAxisDefaults({keys:[],groupPaddingInner:.1,label:{autoRotate:!1},gridLine:{enabled:ms},crosshair:{enabled:!0},parentLevel:{enabled:!0}},{title:!0,time:!0}),"ordinal-time":Bi.getAxisDefaults({keys:[],groupPaddingInner:0,label:{autoRotate:!1},gridLine:{enabled:ms},crosshair:{enabled:!0}},{title:!0,time:!0}),"angle-category":Bi.getAxisDefaults({label:{spacing:5},gridLine:{enabled:ms},shape:{$findFirstSiblingNotOperation:void 0}},{title:!1,time:!1}),"angle-number":Bi.getAxisDefaults({label:{spacing:5},gridLine:{enabled:ms}},{title:!1,time:!1}),"radius-category":Bi.getAxisDefaults({positionAngle:0,line:{enabled:!1}},{title:!0,time:!1}),"radius-number":Bi.getAxisDefaults({positionAngle:0,line:{enabled:!1},shape:{$findFirstSiblingNotOperation:void 0}},{title:!0,time:!1})};var ys=Bi,fg="#192232",ii={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},jr={BLUE:"#74a8e6",ORANGE:"#ffbe70",GREEN:"#6cb176",CYAN:"#75d4ef",YELLOW:"#f6e559",VIOLET:"#aa86d8",GRAY:"#a1a1a1",MAGENTA:"#ce7ab9",BROWN:"#997b52",RED:"#ff7872"},qo=class extends ys{getDefaultColors(){return{fills:ii,fillsFallback:Object.values(ii),strokes:jr,sequentialColors:ji(ii),divergingColors:[ii.ORANGE,ii.YELLOW,ii.GREEN],hierarchyColors:["#192834","#253746","#324859","#3f596c","#4d6a80"],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[ii.GREEN,ii.YELLOW,ii.RED],secondHierarchyColors:["#192834","#3b5164","#496275","#577287","#668399"],up:{fill:ii.GREEN,stroke:jr.GREEN},down:{fill:ii.RED,stroke:jr.RED},neutral:{fill:ii.GRAY,stroke:jr.GRAY},altUp:{fill:ii.BLUE,stroke:jr.BLUE},altDown:{fill:ii.ORANGE,stroke:jr.ORANGE},altNeutral:{fill:ii.GRAY,stroke:jr.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),axisColor:{$foregroundBackgroundMix:.737},backgroundColor:fg,borderColor:{$foregroundBackgroundMix:.216},chromeBackgroundColor:{$foregroundBackgroundMix:.07},foregroundColor:"#fff",gridLineColor:{$foregroundBackgroundMix:.257},popupShadow:"0 0 16px rgba(0, 0, 0, 0.33)",subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"chartBackgroundColor"},.57]},crosshairLabelBackgroundColor:{$foregroundBackgroundMix:.65}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Zo,!0),e.set(Kh,fg),e.set(Il,"#7f8389"),e.set(mt,ii.BLUE),e.set(Cl,"#fff"),e.set(Rt,ii.BLUE),e.set(Ll,fg),e.set(Tl,"#28313e"),e.set(kl,"#4b525d"),e.set(wl,"#fff"),e.set(Nl,"#fff"),e.set(Pl,"#28313e"),e.set(Rl,"#4b525d"),e.set(zl,"#fff"),e}constructor(e){super(e)}},Ai={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},Br={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},dk=class extends qo{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Ai},fillsFallback:Object.values({...Ai}),strokes:{...Br},sequentialColors:ji(Ai),divergingColors:[Ai.GREEN,Ai.BLUE,Ai.RED],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],up:{fill:Ai.GREEN,stroke:Br.GREEN},down:{fill:Ai.RED,stroke:Br.RED},neutral:{fill:Ai.BLUE,stroke:Br.BLUE},altUp:{fill:Ai.GREEN,stroke:Br.GREEN},altDown:{fill:Ai.RED,stroke:Br.RED},altNeutral:{fill:Ai.GRAY,stroke:Br.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),chartPadding:0,gridLineColor:{$foregroundBackgroundMix:.12}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(mt,Ai.BLUE),e.set(Rt,Ai.BLUE),e.set(Kn,"overlay"),e.set(Zn,"left"),e.set(Fl,"bottom"),e.set(ms,!0),e}},Ci={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},Vr={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},pk=class extends ys{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Ci},fillsFallback:Object.values({...Ci}),strokes:{...Vr},sequentialColors:ji(Ci),divergingColors:[Ci.GREEN,Ci.BLUE,Ci.RED],up:{fill:Ci.GREEN,stroke:Vr.GREEN},down:{fill:Ci.RED,stroke:Vr.RED},neutral:{fill:Ci.BLUE,stroke:Vr.BLUE},altUp:{fill:Ci.GREEN,stroke:Vr.GREEN},altDown:{fill:Ci.RED,stroke:Vr.RED},altNeutral:{fill:Ci.GRAY,stroke:Vr.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),chartPadding:0,gridLineColor:{$foregroundBackgroundMix:.06}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(mt,Ci.BLUE),e.set(Rt,Ci.BLUE),e.set(Kn,"overlay"),e.set(Zn,"left"),e.set(Fl,"bottom"),e.set(ms,!0),e}},si={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Gr={BLUE:"#90CAF9",ORANGE:"#FFCC80",GREEN:"#A5D6A7",CYAN:"#80DEEA",YELLOW:"#FFF9C4",VIOLET:"#B39DDB",GRAY:"#E0E0E0",MAGENTA:"#F48FB1",BROWN:"#A1887F",RED:"#EF9A9A"},gk=class extends qo{getDefaultColors(){return{...super.getDefaultColors(),fills:si,fillsFallback:Object.values(si),strokes:Gr,sequentialColors:ji(si),divergingColors:[si.ORANGE,si.YELLOW,si.GREEN],secondSequentialColors:["#2196f3","#208FEC","#1E88E5","#1C7FDC","#1976d2","#176EC9","#1565c0"],secondDivergingColors:[si.GREEN,si.YELLOW,si.RED],up:{fill:si.GREEN,stroke:Gr.GREEN},down:{fill:si.RED,stroke:Gr.RED},neutral:{fill:si.GRAY,stroke:Gr.GRAY},altUp:{fill:si.BLUE,stroke:Gr.BLUE},altDown:{fill:si.RED,stroke:Gr.RED},altNeutral:{fill:si.GRAY,stroke:Gr.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(mt,si.BLUE),e.set(Rt,si.BLUE),e}},ni={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},_r={BLUE:"#1565C0",ORANGE:"#E65100",GREEN:"#2E7D32",CYAN:"#00838F",YELLOW:"#F9A825",VIOLET:"#4527A0",GRAY:"#616161",MAGENTA:"#C2185B",BROWN:"#4E342E",RED:"#B71C1C"},fk=class extends ys{getDefaultColors(){return{...super.getDefaultColors(),fills:ni,fillsFallback:Object.values(ni),strokes:_r,sequentialColors:ji(ni),divergingColors:[ni.ORANGE,ni.YELLOW,ni.GREEN],secondSequentialColors:["#2196f3","#329EF4","#42a5f5","#53ADF6","#64b5f6","#7AC0F8","#90caf9"],secondDivergingColors:[ni.GREEN,ni.YELLOW,ni.RED],up:{fill:ni.GREEN,stroke:_r.GREEN},down:{fill:ni.RED,stroke:_r.RED},neutral:{fill:ni.GRAY,stroke:_r.GRAY},altUp:{fill:ni.BLUE,stroke:_r.BLUE},altDown:{fill:ni.RED,stroke:_r.RED},altNeutral:{fill:ni.GRAY,stroke:_r.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(mt,ni.BLUE),e.set(Rt,ni.BLUE),e}},yt={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},Hr={BLUE:"#6698ff",PURPLE:"#c0a3ff",MAGENTA:"#fc8dfc",PINK:"#ff82b1",RED:"#ff9b70",ORANGE:"#ffcf4e",YELLOW:"#ffff58",GREEN:"#58dd70",CYAN:"#51e2c9",MODERATE_BLUE:"#4fd7ff",GRAY:"#eeeeee"},mk=class extends qo{getDefaultColors(){return{fills:yt,fillsFallback:Object.values(yt),strokes:Hr,sequentialColors:ji(yt),divergingColors:[yt.BLUE,yt.RED],hierarchyColors:[],secondSequentialColors:[yt.BLUE,yt.PURPLE,yt.MAGENTA,yt.PINK,yt.RED,yt.ORANGE,yt.YELLOW,yt.GREEN],secondDivergingColors:[yt.BLUE,yt.RED],secondHierarchyColors:[],up:{fill:yt.GREEN,stroke:Hr.GREEN},down:{fill:yt.RED,stroke:Hr.RED},neutral:{fill:yt.GRAY,stroke:Hr.GRAY},altUp:{fill:yt.BLUE,stroke:Hr.BLUE},altDown:{fill:yt.RED,stroke:Hr.RED},altNeutral:{fill:yt.GRAY,stroke:Hr.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(mt,yt.BLUE),e.set(Rt,yt.BLUE),e}},bt={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},Ur={BLUE:"#2346c9",PURPLE:"#7653d4",MAGENTA:"#a73da9",PINK:"#c32d66",RED:"#c84b1c",ORANGE:"#c87f00",YELLOW:"#c1b900",GREEN:"#008c1c",CYAN:"#00927c",MODERATE_BLUE:"#0087bb",GRAY:"#888888"},yk=class extends ys{getDefaultColors(){return{...super.getDefaultColors(),fills:bt,fillsFallback:Object.values(bt),strokes:Ur,sequentialColors:ji(bt),divergingColors:[bt.BLUE,bt.RED],hierarchyColors:[],secondSequentialColors:[bt.BLUE,bt.PURPLE,bt.MAGENTA,bt.PINK,bt.RED,bt.ORANGE,bt.YELLOW,bt.GREEN],secondDivergingColors:[bt.BLUE,bt.RED],secondHierarchyColors:[],up:{fill:bt.GREEN,stroke:Ur.GREEN},down:{fill:bt.RED,stroke:Ur.RED},neutral:{fill:bt.GRAY,stroke:Ur.GRAY},altUp:{fill:bt.BLUE,stroke:Ur.BLUE},altDown:{fill:bt.RED,stroke:Ur.RED},altNeutral:{fill:bt.GRAY,stroke:Ur.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(mt,bt.BLUE),e.set(Rt,bt.BLUE),e}},zt={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"},qn={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"},bk=class extends qo{getDefaultColors(){return{...super.getDefaultColors(),fills:{...zt,RED:zt.ORANGE},fillsFallback:Object.values({...zt,RED:zt.ORANGE}),strokes:{...qn,RED:qn.ORANGE},sequentialColors:ji({...zt,RED:zt.ORANGE}),divergingColors:[zt.ORANGE,zt.YELLOW,zt.GREEN],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[zt.GREEN,zt.YELLOW,zt.ORANGE],up:{fill:zt.GREEN,stroke:qn.GREEN},down:{fill:zt.ORANGE,stroke:qn.ORANGE},neutral:{fill:zt.GRAY,stroke:qn.GRAY},altUp:{fill:zt.BLUE,stroke:qn.BLUE},altDown:{fill:zt.ORANGE,stroke:qn.ORANGE},altNeutral:{fill:zt.GRAY,stroke:qn.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(mt,zt.BLUE),e.set(Rt,zt.BLUE),e}},Ut={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"},Mn={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"},xk=class extends ys{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Ut,RED:Ut.ORANGE},fillsFallback:Object.values({...Ut,RED:Ut.ORANGE}),strokes:{...Mn,RED:Mn.ORANGE},sequentialColors:ji({...Ut,RED:Ut.ORANGE}),divergingColors:[Ut.ORANGE,Ut.YELLOW,Ut.GREEN],secondSequentialColors:["#5090dc","#629be0","#73a6e3","#85b1e7","#96bcea","#a8c8ee","#b9d3f1","#cbdef5"],secondDivergingColors:[Ut.GREEN,Ut.YELLOW,Ut.ORANGE],secondHierarchyColors:[],up:{fill:Ut.GREEN,stroke:Mn.GREEN},down:{fill:Ut.ORANGE,stroke:Mn.ORANGE},neutral:{fill:Mn.GRAY,stroke:Mn.GRAY},altUp:{fill:Ut.BLUE,stroke:Mn.BLUE},altDown:{fill:Ut.ORANGE,stroke:Mn.ORANGE},altNeutral:{fill:Ut.GRAY,stroke:Mn.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(mt,Ut.BLUE),e.set(Rt,Ut.BLUE),e}},mg=["top","top-right","top-left","bottom","bottom-right","bottom-left","right","right-top","right-bottom","left","left-top","left-bottom"],vk={floating:k,placement:z(...mg),xOffset:O,yOffset:O},p0=we((e,t)=>{let i;if(typeof e=="string")mg.includes(e)?i=!0:(i={valid:!1,invalid:[],cleared:null},i.invalid.push(new mr("invalid",`a legend placement string: ["${mg.join('", "')}"]`,e,t.path)));else{const{cleared:s,invalid:n}=ci(e,vk);i={valid:n.length===0,cleared:s,invalid:n}}return i},"a legend position object or placement string"),Qh=pe(z("circle","cross","diamond","heart","plus","pin","square","star","triangle"),Be),g0=z("never","always","hyphenate","on-space"),Jh=z("top","right","bottom","left","top-right","bottom-right","bottom-left","top-left","center"),eu=pe(T,z("exact","nearest")),yg=pe(N,qt({text:W(N),..._e},"text segments array")),f0=z("pointer","start","middle","end"),tu={enabled:k,text:yg,textAlign:z("left","center","right"),wrapping:z("never","always","hyphenate","on-space"),spacing:T,maxWidth:T,maxHeight:T,..._e};tu.padding=he(T);var iu={enabled:k,text:yg,renderer:br(pe(N,vm))},bg=["defaults","download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series","separator"],m0={type:z("action","separator"),showOn:z("always","series-area","series-node","legend-item"),label:W(N),enabled:k,action:Be,items:(e,t)=>y0(e,t)};m0.iconUrl=he(N);var Mk=At(m0),Sk=we((e,t)=>{let i;return typeof e=="string"?bg.includes(e)?i=!0:(i={valid:!1,invalid:[],cleared:null},i.invalid.push(new mr("invalid",`a context menu item string alias: ["${bg.join('", "')}"]`,e,t.path))):i=Mk(e,t),i},`a context menu item object or string alias: [${bg.join(", ")}]`),y0=te(Sk,"a menu items array",!1),$r={label:N,ariaLabel:N,tooltip:N,icon:z("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")},bs=pe(N,br(N)),b0=At({x:bs,y:bs,angle:bs,radius:bs,size:bs,color:bs,label:bs,secondaryLabel:bs,sectorLabel:bs,calloutLabel:bs,legendItem:bs}),xs=we(hI,"a valid number format string"),le={width:T,height:T,minWidth:T,minHeight:T,suppressFieldDotNotation:k,title:tu,subtitle:tu,footnote:tu,padding:{top:T,right:T,bottom:T,left:T},seriesArea:{border:zc,clip:k,cornerRadius:O,padding:Rc},legend:{enabled:k,position:p0,orientation:z("horizontal","vertical"),maxWidth:T,maxHeight:T,spacing:T,border:zc,cornerRadius:O,padding:Rc,fill:Gi,fillOpacity:K,preventHidingAll:k,reverseOrder:k,toggleSeries:k,item:{marker:{size:T,shape:Qh,padding:T,strokeWidth:T},line:{length:T,strokeWidth:T},label:{maxLength:T,formatter:Be,..._e},maxWidth:T,paddingX:T,paddingY:T,showSeriesStroke:k},pagination:{marker:{size:T,shape:Qh,padding:T},activeStyle:{...$,...B},inactiveStyle:{...$,...B},highlightStyle:{...$,...B},label:_e},listeners:{legendItemClick:Be,legendItemDoubleClick:Be}},gradientLegend:{enabled:k,position:p0,spacing:T,reverseOrder:k,border:zc,cornerRadius:O,padding:Rc,fill:Gi,fillOpacity:K,gradient:{preferredLength:T,thickness:T},scale:{label:{..._e,minSpacing:T,format:xs,formatter:Be},padding:T,interval:{step:O,values:Ns,minSpacing:qe(T,Es("maxSpacing")),maxSpacing:qe(T,Os("minSpacing"))}}},listeners:{seriesNodeClick:Be,seriesNodeDoubleClick:Be,seriesVisibilityChange:Be,click:Be,doubleClick:Be,annotations:Be,zoom:Be},loadGoogleFonts:k,highlight:{range:z("tooltip","node")},overlays:{loading:iu,noData:iu,noVisibleSeries:iu,unsupportedBrowser:iu},tooltip:{enabled:k,showArrow:k,pagination:k,delay:T,range:eu,wrapping:g0,mode:z("single","shared","compact"),position:{anchorTo:z("pointer","node","chart"),placement:pe(Jh,te(Jh)),xOffset:O,yOffset:O}},animation:{enabled:k,duration:T},contextMenu:{enabled:k,items:y0},context:()=>!0,dataSource:{getData:Be},keyboard:{enabled:k,tabIndex:O},touch:{dragAction:z("none","drag","hover")},ranges:{enabled:k,buttons:qt({...$r,value:pe(O,qe(te(pe(O,Pn)),yr(2,2)),Be)},"range button options array")},locale:{localeText:Oc,getLocaleText:br(N)},background:{visible:k,fill:_,image:{url:W(N),top:O,right:O,bottom:O,left:O,width:T,height:T,opacity:K}},styleNonce:N,sync:{enabled:k,groupId:N,axes:z("x","y","xy"),nodeInteraction:k,zoom:k},zoom:{enabled:k,enableAxisDragging:k,enableAxisScrolling:k,enableDoubleClickToReset:k,enablePanning:k,enableScrolling:k,enableSelecting:k,enableTwoFingerZoom:k,keepAspectRatio:k,anchorPointX:f0,anchorPointY:f0,axisDraggingMode:z("pan","zoom"),axes:z("x","y","xy"),deceleration:pe(z("off","short","long"),K),minVisibleItems:T,panKey:z("alt","ctrl","meta","shift"),scrollingStep:K,autoScaling:{enabled:k,padding:K},buttons:{enabled:k,buttons:qt({...$r,value:z("reset","zoom-in","zoom-out","pan-left","pan-right","pan-start","pan-end"),section:N},"zoom button options array"),visible:z("always","zoomed","hover")}},formatter:pe(br(N),b0)};le.dataSource.requestThrottle=he(T),le.dataSource.updateThrottle=he(T),le.dataSource.updateDuringInteraction=he(k),le.zoom.enableIndependentAxes=he(k),le.statusBar=he(ee),le.foreground=he({visible:k,text:N,image:{url:N,top:O,right:O,bottom:O,left:O,width:T,height:T,opacity:K},...$}),le.overrideDevicePixelRatio=he(O),le.sync.domainMode=he(z("direction","position","key"));var Le={cursor:N,context:()=>!0,showInLegend:k,nodeClickRange:eu,listeners:{seriesNodeClick:Be,seriesNodeDoubleClick:Be},highlightStyle:{item:{...$,...B},series:{enabled:k,dimOpacity:K,strokeWidth:T}},highlight:Am(st)},vs={...Le,id:N,visible:k,context:()=>!0,data:Ns};vs.seriesGrouping=he(ee);var Sn={enabled:k,shape:Qh,size:T,itemStyler:Je({...$,...B,...Y,shape:Qh,size:T}),...$,...B,...Y},Ue={enabled:k,formatter:Be,format:xs,itemStyler:he(Je({enabled:k,...as,..._e})),...as,..._e},Qn={...Ue,lineHeight:T,minimumFontSize:T,wrapping:g0,overflowStrategy:z("ellipsis","hide")},Bl={visible:k,cap:{visible:k,length:T,lengthRatio:K,...B,...Y},...B,...Y},su={...Bl,xLowerKey:N,xUpperKey:N,yLowerKey:N,yUpperKey:N,xLowerName:N,xUpperName:N,yLowerName:N,yUpperName:N,itemStyler:Je({visible:k,...B,...Y,cap:{visible:k,length:T,lengthRatio:K,...B,...Y}})},Oe={enabled:k,showArrow:k,range:eu,renderer:br(pe(N,At({heading:N,title:N,data:qt({label:W(N),value:W(N)})},"tooltip renderer result object"))),position:{anchorTo:z("node","pointer","chart"),placement:pe(Jh,te(Jh)),xOffset:O,yOffset:O},interaction:{enabled:k}},$s={enabled:k,xOffset:O,yOffset:O,blur:T,color:_},nu=Pa({linear:{},smooth:{tension:K},step:{position:z("start","middle","end")}},"interpolation line options"),Vl={fills:qe(yr(2),te(At({color:_,stop:O},"")),Im),fillMode:z("continuous","discrete")},ru={value:W(O),text:N,shape:pe(z("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),Be),placement:z("before","after","middle"),spacing:T,size:T,rotation:O,...$,...B,...Y},ou={value:W(O),text:N,shape:pe(z("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),Be),placement:z("inside","outside","middle"),spacing:T,size:T,rotation:O,label:{...Ue,spacing:T},...$,...B,...Y},au={direction:z("horizontal","vertical"),cornerMode:z("container","item"),cornerRadius:T,thickness:T,segmentation:{enabled:k,spacing:T,interval:{values:te(O),step:O,count:O}},bar:{enabled:k,thickness:T,thicknessRatio:K,...Vl,...$,...B,...Y},label:{...Qn,text:N,spacing:T,avoidCollisions:k,placement:z("inside-start","outside-start","inside-end","outside-end","inside-center","bar-inside","bar-inside-end","bar-outside-end","bar-end")},tooltip:Oe,...V(Le,["listeners"])},Jn={...au,...V(vs,["listeners"]),type:W(Qe("linear-gauge")),value:W(O),scale:{min:qe(O,Es("max")),max:qe(O,Os("min")),label:{enabled:k,formatter:Be,rotation:O,spacing:T,minSpacing:T,placement:z("before","after"),avoidCollisions:k,format:xs,..._e},interval:{values:te(O),step:O},...Vl,...$,...B,...Y},targets:qt(ru,"target options array")};Jn.margin=he(O),Jn.defaultColorRange=he(te(_)),Jn.defaultTarget=he({...ru,value:O,label:{...Ue,spacing:O}}),Jn.defaultScale=he(Jn.scale),Jn.scale.defaultFill=he(_);var lu={outerRadius:T,innerRadius:T,outerRadiusRatio:K,innerRadiusRatio:K,startAngle:O,endAngle:O,spacing:T,cornerMode:z("container","item"),cornerRadius:T,scale:{min:qe(O,Es("max")),max:qe(O,Os("min")),label:{enabled:k,formatter:Be,rotation:O,spacing:T,minSpacing:T,avoidCollisions:k,format:xs,..._e},interval:{values:te(O),step:O},...Vl,...$,...B,...Y},segmentation:{enabled:k,spacing:T,interval:{values:te(O),step:O,count:O}},bar:{enabled:k,...Vl,...$,...B,...Y},needle:{enabled:k,spacing:T,radiusRatio:K,...$,...B,...Y},label:{text:N,spacing:T,...Qn},secondaryLabel:{text:N,...Qn},tooltip:Oe,...Le},Gl={...lu,...vs,type:W(Qe("radial-gauge")),value:W(O),targets:qt(ou,"target options array")};Gl.defaultColorRange=he(te(_)),Gl.defaultTarget=he({...ou,value:O,label:{...Ue,spacing:O}}),Gl.scale.defaultFill=he(_);var _l=z("millisecond","second","minute","hour","day","month","year"),x0={unit:W(_l),step:Ra,epoch:Pn,utc:k};x0.every=Be;var cu=At(x0,"a time interval object"),Wr={enabled:k,text:N,padding:O,..._e},Ws=we({enabled:k,type:W(z("line","range")),range:qe(we((e,{options:t})=>t.type==="range","crossLine type to be 'range'"),te(ee),yr(2,2)),value:qe(we((e,{options:t})=>t.type==="line","crossLine type to be 'line'"),ee),label:Wr,fill:_,fillOpacity:K,...B,...Y},"cross-line options"),Dn={...Ws,label:{...Wr,position:z("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:O}},In={enabled:k,rotation:O,avoidCollisions:k,minSpacing:T,spacing:T,formatter:Be,itemStyler:he(Je({..._e,...as,spacing:O})),..._e,...as},Hl={autoRotate:k,autoRotateAngle:O,wrapping:z("never","always","hyphenate","on-space"),truncate:k,...In},xg={format:xs,...Hl},Ul={format:pe(N,Oc),...Hl},v0={enabled:k,width:T,size:T,stroke:_},hu={enabled:k,label:Ul,tick:v0},vg={values:te(ee),minSpacing:T},Yr={reverse:k,gridLine:{enabled:k,width:T,style:qt({fill:_,fillOpacity:T,stroke:pe(_,Pc),strokeWidth:T,lineDash:te(T)},"a grid-line style object array")},interval:vg,label:In,line:{enabled:k,width:T,stroke:_},tick:v0,context:()=>!0};Yr.layoutConstraints=he({stacked:W(k),align:W(z("start","end")),unit:W(z("percent","px")),width:W(T)});var An={...Yr,keys:te(N),crossLines:qt(Dn,"a cross-line options array"),position:z("top","right","bottom","left"),thickness:T,maxThicknessRatio:K,title:{enabled:k,text:N,spacing:T,formatter:Be,..._e}};An.title._enabledFromTheme=he(k);var $l={enabled:k,...$,...B,...Y};function er(e,t){const i={enabled:k,xOffset:O,yOffset:O,formatter:br(N),renderer:br(pe(N,At({text:N,color:_,backgroundColor:_,opacity:K},"crosshair label renderer result object")))};let s;return e&&(s={...i,format:t?pe(N,At({millisecond:N,second:N,hour:N,day:N,month:N,year:N})):N}),{enabled:k,snap:k,label:s??i,...B,...Y}}function Qo(e,t){return{min:qe(e,Es("max")),max:qe(e,Os("min")),nice:k,interval:{step:t?pe(Ra,_l,cu):Ra,values:te(e),minSpacing:qe(T,Es("maxSpacing")),maxSpacing:qe(T,Os("minSpacing"))}}}var Mg={step:pe(Ra,_l,cu),values:te(pe(O,Pn)),minSpacing:qe(T,Es("maxSpacing")),maxSpacing:qe(T,Os("minSpacing")),placement:z("on","between")},Jo=class YS extends xl{constructor(t,i=new Ho,s=!0){super(t,i),this.groupPaddingInner=.1,this.includeInvisibleDomains=s,this.nice=!1}static is(t){return t instanceof YS}isCategoryLike(){return!0}hasDefinedDomain(){return!1}normaliseDataDomain(t){return{domain:t,clipped:!1}}updateScale(){super.updateScale();let{paddingInner:t,paddingOuter:i}=this;if(!je(t)||!je(i)){const s=this.reduceBandScalePadding();t??(t=s.inner),i??(i=s.outer)}this.scale.paddingInner=t??0,this.scale.paddingOuter=i??0}calculateGridLines(t,i,s){const n=super.calculateGridLines(t,i,s);return this.interval.placement==="between"&&t.length>0&&n.push(super.calculateGridLine({index:t.at(-1).index+1,tickId:`after:${t.at(-1).tickId}`,translation:this.range[1]},t.length,i,s,t)),n}calculateGridLine({index:t,tickId:i,translation:s},n,r,o,a){const{gridLine:l,horizontal:c,interval:h,scale:u}=this;if(h.placement!=="between")return super.calculateGridLine({index:t,tickId:i,translation:s},n,r,o,a);const d=s<u.step?Math.floor(u.step/2):u.step/2,p=s-d,[g,m,b,y]=c?[p,Math.max(r,o),p,Math.min(r,o)]:[Math.min(r,o),p,Math.max(r,o),p],{style:v}=l,{stroke:M,strokeWidth:S=0,lineDash:D}=v[t%v.length]??{};return{tickId:i,offset:p,x1:g,y1:m,x2:b,y2:y,stroke:M,strokeWidth:S,lineDash:D}}calculateGridFills(t,i,s){const{horizontal:n,range:r,scale:o}=this;if(this.interval.placement!=="between")return super.calculateGridFills(t,i,s);const a=[];if(t.length==0)return a;const l=t[0],c=l.translation>r[0]+o.step/2,h=t[t.length-1],u=n&&h.translation<r[1]-o.step/2;if(c){const d={tickId:`before:${l.tickId}`,translation:l.translation-o.step};a.push(this.calculateGridFill(d,-1,l.index-1,i,s,t))}if(a.push(...t.map((d,p)=>this.calculateGridFill(d,p,d.index,i,s,t))),u){const d={tickId:`after:${h.tickId}`,translation:h.translation+o.step};a.push(this.calculateGridFill(d,t.length,h.index+1,i,s,t))}return a}calculateGridFill({tickId:t,translation:i},s,n,r,o,a){const{gridLine:l,horizontal:c,interval:h,scale:u}=this;if(h.placement!=="between")return super.calculateGridFill({tickId:t,translation:i},s,n,r,o,a);const d=i-u.step/2,p=i+u.step/2,[g,m,b,y]=c?[d,Math.max(r,o),p,Math.min(r,o)]:[Math.min(r,o),d,Math.max(r,o),p],{fill:v,fillOpacity:M}=l.style[n%l.style.length]??{};return{tickId:t,x1:g,y1:m,x2:b,y2:y,fill:v,fillOpacity:M}}calculateTickLines(t,i){const s=super.calculateTickLines(t,i);return this.interval.placement==="between"&&t.length>0&&s.push(super.calculateTickLine({primary:!1,tickId:`after:${t.at(-1)?.tickId}`,translation:this.range[1]},t.length,i,t)),s}calculateTickLine({primary:t,tickId:i,translation:s},n,r,o){const{horizontal:a,interval:l,primaryTick:c,scale:h,tick:u}=this;if(l.placement!=="between")return super.calculateTickLine({primary:t,tickId:i,translation:s},n,r,o);const d=t&&c?.enabled?c:u,p=-r*this.getTickSize(d),g=s<h.step?Math.floor(h.step/2):h.step/2,m=s-g,[b,y,v,M]=a?[m,0,m,p]:[0,m,p,m],{stroke:S,width:D}=d;return{tickId:i,offset:m,x1:b,y1:y,x2:v,y2:M,stroke:S,strokeWidth:D,lineDash:void 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})}tickFormatParams(t,i,s,n){return{type:"category"}}datumFormatParams(t,i,s,n,r){const{datum:o,seriesId:a,legendItemName:l,key:c,source:h,property:u,domain:d,boundSeries:p}=i;return Array.isArray(t)&&t.some(g=>typeof g!="string")?t=t.map(String):!Array.isArray(t)&&typeof t!="string"&&typeof t!="number"&&!(t instanceof Date)&&(t=String(t)),{type:"category",value:t,datum:o,seriesId:a,legendItemName:l,key:c,source:h,property:u,domain:d,boundSeries:p}}};Jo.className="CategoryAxis",Jo.type="category",f([x],Jo.prototype,"groupPaddingInner",2),f([x],Jo.prototype,"paddingInner",2),f([x],Jo.prototype,"paddingOuter",2);var ea=Jo,M0=class KS extends Ho{static is(t){return t instanceof KS}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 tr(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 Sg(e,t,i){let s=!1;const n=tr(e);if(n==null)return{extent:t!=null&&i!=null&&t<=i?[t,i]:[],clipped:!1};let[r,o]=n;return t!=null&&(s||(s=t>r),r=t),i!=null&&(s||(s=i<o),o=i),r>o?{extent:[],clipped:!1}:{extent:[r,o],clipped:s}}function uu(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 Dk(e,t){return{id:e,matchGroupIds:[t],type:"aggregate",aggregateFunction:s=>uu(s)}}function S0(e,t){return{id:e,type:"aggregate",matchGroupIds:t?[t]:void 0,aggregateFunction:i=>uu(i),groupAggregateFunction:(i,s=[0,0])=>(s[0]+=i?.[0]??0,s[1]+=i?.[1]??0,s)}}function Ik(e,t){return{id:e,matchGroupIds:[t],type:"aggregate",aggregateFunction:s=>Hn.extendDomain(s)}}function Dg(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 D0(e,t){return{id:e,matchGroupIds:t?[t]:void 0,type:"aggregate",aggregateFunction:s=>uu(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 Ig(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 I0(e){return()=>{let t=0;return i=>je(i)?(t+=e?Math.max(0,i):i,t):i}}function A0(){return()=>{let e=0;return t=>{if(!je(t))return t;const i=e;return e+=t,i}}}var Ak=1e3;function ta(e){return e.input.count<=Ak}function C0(e){return e!=null&&Ah(e)}function Ck(e){return e!=null}function L0(e){switch(e){case"number":case"log":case"time":case"unit-time":case"ordinal-time":case"color":return C0;default:return Ck}}function T0(e){switch(e){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function ir(e,t,i={}){return{property:e,type:"key",valueType:T0(t),validation:L0(t),...i}}function tt(e,t,i={}){return{property:e,type:"value",valueType:T0(t),validation:L0(t),...i}}function k0(e,t={}){return{property:e,type:"value",valueType:"range",missingValue:1,processor:()=>()=>1,...t}}var Lk=function(e){return e};function w0(...e){const t=e.filter(i=>i!=null);return t.length===0?()=>Lk:t.length===1?t[0]:()=>{const i=t.map(s=>s());return(s,n)=>i.reduce((r,o)=>o(r,n),s)}}function N0(e,t={}){const{min:i=-1/0,max:s=1/0,processor:n,...r}=t;return{type:"value",property:e,valueType:"range",validation:C0,processor:w0(n,()=>o=>je(o)?se(i,o,s):o),...r}}function Ag(e,t,i={}){const{onlyPositive:s,processor:n,...r}=i;return{...tt(e,t,r),processor:w0(n,I0(s))}}function Tk(e,t,i={}){return{...tt(e,t,i),processor:A0()}}function sr(e,t,i,s,n){return[tt(e,n,s),F0(s.groupId,t,i,s.separateNegative),...s.rangeId!=null?[Ik(s.rangeId,s.groupId)]:[]]}function E0(e,t,i){return[tt(e,t,i),j0(i.groupId)]}var O0={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}}},P0={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}}},R0={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 kk({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=wk(i,s,n);for(const o of s){const a=n.datumIndices[o];if(a!=null)for(const l of a){const c=i[o],h=c[l];if(h==null){c[l]=void 0;continue}c[l]=typeof h=="number"?t(h,r):h.map(u=>t(u,r))}}}}function wk(e,t,i){const s=[0,0];for(const n of t){const r=e[n],o=i.datumIndices[n];if(o!=null)for(const a of o){const l=r[a];if(l==null)continue;const c=typeof l=="number"?l:Math.max(...l.map(u=>u??0)),h=c<0?0:1;h===0?s[h]=Math.min(s[h],c):s[h]=Math.max(s[h],c)}}return Math.max(Math.abs(s[0]),s[1])}function du(e,t){return{type:"group-value-processor",matchGroupIds:e,adjust:tl({normaliseTo:t},kk)}}function Nk({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 pu(e,t,i,s,n){return{type:"property-value-processor",property:e,adjust:tl({normaliseTo:t,rangeMin:s,rangeMax:n,zeroDomain:i},Nk)}}var Wl=1,gu=2;function z0(e,t,i,s){let n=Wl|gu;if(t.valueType==="category")return i.length<e&&(n&=~Wl),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&=~gu),Number.isFinite(a)&&r===a&&(n&=~Wl),r=a}return n}function Yl(e){return{type:"processor",property:"animationValidation",calculate(t){if(!ta(t))return;const{keys:i,values:s}=t.defs,{input:n,domain:{keys:r,values:o},keys:a,columns:l,invalidKeyCount:c}=t;let h=Wl|gu;if(n.count!==0){for(let u=0;h!==0&&u<i.length;u++)for(const d of i[u].scopes){const p=a[u].get(d),g=c?.get(d)??0,m=p.length-g;h&=z0(m,i[u],r[u],p)}for(let u=0;h!==0&&u<s.length;u++){const d=s[u];e?.includes(d.id)&&(h&=z0(0,d,o[u],l[u]))}}return{uniqueKeys:(h&Wl)!==0,orderedKeys:(h&gu)!==0}}}}function Ek({mode:e,separateNegative:t}){return()=>()=>(i,s,n)=>{const r=[0,0];for(const o of s){const a=n.datumIndices[o];if(a!=null)for(const l of a){const c=i[o],h=c[l],u=Md(h)&&t?0:1;je(h)&&(e==="normal"&&(r[u]+=h),c[l]=r[u],e==="trailing"&&(r[u]+=h))}}}}function Ok({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],h=o.datumIndices[l];if(h!=null)for(const u of h){const d=c[u],p=s&&t==="current"?0:i[l];i[l]=d;const g=t==="current"?d:p;if(!je(d)||!je(p)){c[u]=a;continue}e==="normal"&&(a+=g),c[u]=a,e==="trailing"&&(a+=g)}}s=!1}}}function F0(e,t,i,s=!1){let n;if(t.startsWith("window")){const r=t.endsWith("-trailing")?"trailing":"normal";n=tl({mode:r,sum:i},Ok)}else n=tl({mode:t,separateNegative:s},Ek);return{type:"group-value-processor",matchGroupIds:[e],adjust:n}}function Pk(){return()=>(e,t,i)=>{const s=new Float64Array(t.length);let n=0;for(const r of t){const o=e[r],a=i.datumIndices[r];if(a!=null)for(const l of a){const c=o[l];s[n]=Number.isFinite(c)?c:NaN,n+=1,o[l]=s.subarray(0,n)}}}}function j0(e){return{type:"group-value-processor",matchGroupIds:[e],adjust:Pk}}function B0(e){return e.id??e.property}function Rk(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=B0(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=B0(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 Cg(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 Kl(e,t,i=!0){return{type:"processor",property:"diff",calculate(s,n){if(!ta(s))return;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=Rk(e,t,s);if(p==null)return n;const g=Math.max(t.input.count,s.input.count);for(let y=0;y<g;y++){const v=y<t.input.count,M=y<s.input.count,S=v?xh(c,e,y):void 0,D=S!=null?Cn(S):"",A=M?xh(h,e,y):void 0,I=A!=null?Cn(A):"";if(M&&v&&D===I){Cg(u,d,p,y,y)||a.set(I,y);continue}const L=l.get(I);L!=null?((i||!Cg(u,d,p,L,y))&&(a.set(I,y),r.set(I,y)),l.delete(I)):M&&o.set(I,y);const C=o.get(D);C!=null?((i||!Cg(u,d,p,C,y))&&(a.set(D,y),r.set(D,y)),o.delete(D)):v&&(a.delete(D),l.set(D,y))}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 Cn(e,...t){let i;return Ae(e)?i=e.map(n=>_p(n)).join("___"):i=_p(e),(typeof i=="string"||typeof i=="number"||typeof i=="boolean"||i instanceof Date)&&t.length>0&&(i+=`___${t.join("___")}`),i}var zk=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)}},Fk=class ZS{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 ZS(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 jk(e){const t=e.reduce((s,n)=>s<n.length?n.length:s,0),i=new Fk;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 Bk(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 Vk(e,t,i){return t.getSiblings().indexOf(e.ancestor)>=0?e.ancestor:i}function Gk({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 _k(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&&(Bk(Vk(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 V0(e){const{children:t}=e;if(t.length){let[i]=t;for(const r of t)V0(r),i=_k(r,i);Gk(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 G0(e,t,i){e.position=e.prelim+t,i.insertNode(e);for(const s of e.children)G0(s,t+e.mod,i)}function _0(e){const{children:t}=e;let i=0;for(const s of t)_0(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 Hk(e){const t=new Uk,i=jk(e);return V0(i),G0(i,-i.prelim,t),_0(i),t}var Uk=class{constructor(){this.dimensions=new zk,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}},fi=class extends re{constructor(){super(...arguments),this.enabled=!0,this.border=new Er}};f([x],fi.prototype,"enabled",2),f([x],fi.prototype,"avoidCollisions",2),f([x],fi.prototype,"border",2),f([x],fi.prototype,"color",2),f([x],fi.prototype,"cornerRadius",2),f([x],fi.prototype,"spacing",2),f([x],fi.prototype,"rotation",2),f([x],fi.prototype,"wrapping",2),f([x],fi.prototype,"truncate",2),f([x],fi.prototype,"fill",2),f([x],fi.prototype,"fontStyle",2),f([x],fi.prototype,"fontWeight",2),f([x],fi.prototype,"fontSize",2),f([x],fi.prototype,"fontFamily",2),f([x],fi.prototype,"padding",2);var fu=class extends re{constructor(){super(...arguments),this.enabled=!0}};f([x],fu.prototype,"enabled",2),f([x],fu.prototype,"width",2),f([x],fu.prototype,"stroke",2);var Lg=class extends re{constructor(){super(...arguments),this.label=new fi,this.tick=new fu}};f([x],Lg.prototype,"label",2),f([x],Lg.prototype,"tick",2);var Kr=class extends ea{constructor(e){super(e,new M0),this.tickScale=new M0,this.depthOptions=new Ua(Lg),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,wrapping:i[r]?.label.wrapping??s.wrapping,truncate:i[r]?.label.truncate??s.truncate,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.fill=t.color,e.text=t.text,e.textBaseline=t.textBaseline,e.textAlign=t.textAlign??"center",e.setFont(t),e.setBoxing(t)})}updateAxisLine(){this.computedLayout&&(this.lineNode.visible=this.line.enabled,this.lineNode.stroke=this.line.stroke,this.lineNode.strokeWidth=this.line.width)}computeLayout(){this.updateDirection(),this.updateScale();const{step:e}=this.scale,{title:t,label:i,range:s,depthOptions:n,horizontal:r,line:o}=this;if(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:o.stroke,strokeWidth:o.enabled?o.width:0}),this.resizeTickTree(),!this.tickTreeLayout?.depth)return{bbox:U.zero,spacing:0,separatorLayout:[],tickLabelLayout:[]};const{depth:a,nodes:l}=this.tickTreeLayout,c=r?-i.getSideFlag():i.getSideFlag(),h=[],u=new Map,d=new To,p=this.getDepthOptionsMap(a),g=c*p[0].spacing,m=this.tickFormatter(this.scale.domain,this.scale.domain,!1),b=(C,w)=>{const E=a-C.depth;if(!p[E]?.enabled||!QD(C.screen,s))return!1;let R=m(C.label,w-1);const P=this.getLabelStyles({value:R,depth:E},n[E]?.label);if(i.avoidCollisions){const G=p[E].rotation;let H=(C.leafCount||1)*e,oe=this.thickness;if(G!=null){const me=GD(G,H,oe);H=me.width,oe=me.height}R=Xa.wrapText(R,{font:P,textWrap:p[E].wrapping,overflow:p[E].truncate?"ellipsis":"hide",maxWidth:H,maxHeight:oe})||R}return d.x=r?C.screen:g,d.y=r?g:C.screen,d.rotation=0,d.lineHeight=He.getLineHeight(P.fontSize),d.fill=P.color,d.text=R,d.textAlign="center",d.textBaseline=i.parallel?"top":"bottom",d.setFont(P),d.setBoxing(P),!0},y={};l.forEach((C,w)=>{const E=a-C.depth;if(y[E]??(y[E]=0),!b(C,w)||!d.getBBox())return;u.set(w,d.getBBox()),d.rotation=ln(p[E]?.rotation);const{width:P,height:G}=d.getBBox(),H=r?G:P;y[E]<H&&(y[E]=H)});const v=Jp(),M=new Map,S=C=>{if(C===0)return 0;let w=y[0];for(let E=1;E<=C;E++)w+=p[E].spacing,E!==C&&(w+=y[E]);return w};l.forEach((C,w)=>{if(w===0)return;const E=b(C,w),R=!C.children.length,P=a-C.depth;if(C.parent){const xe=R?C.position:C.position-(C.leafCount-1)/2;if(!M.has(xe)){const Z=this.depthOptions[P]?.tick;let ce=y[0];for(let X=0;X<=P;X++)ce+=p[X].spacing,X!==0&&(ce+=y[X]);M.set(xe,{tickSize:ce,tickStroke:Z?.stroke,tickWidth:Z?.enabled!==!1?Z?.width:0})}}if(!E)return;const G=ln(p[P].rotation),{width:H,height:oe}=u.get(w),me=S(P);if(d.textAlign="center",d.textBaseline="middle",d.rotation=G,r?(d.y+=(me+zd(H/2,oe/2,G))*c,d.rotationCenterX=C.screen,d.rotationCenterY=d.y):(d.x+=me*c+zd((p[P].spacing*c+H)/2,i.mirrored?H:0,G)-H/2,d.rotationCenterX=d.x,d.rotationCenterY=C.screen),p[P].avoidCollisions){const{width:xe,height:Z}=d.getBBox(),ce=r?xe:Z,X=R?e:C.leafCount*e;if(ce>X){u.delete(w);return}}const ke=d.getPlainText(),Te=d.getBoxingProperties();h.push({text:ke,visible:!0,tickId:v(ke),range:this.scale.range,border:Te.border,color:d.fill,cornerRadius:Te.cornerRadius,fill:Te.fill,fontFamily:d.fontFamily,fontSize:d.fontSize,fontStyle:d.fontStyle,fontWeight:d.fontWeight,padding:Te.padding,rotation:d.rotation,rotationCenterX:d.rotationCenterX,rotationCenterY:d.rotationCenterY,textAlign:d.textAlign,textBaseline:d.textBaseline,x:d.x,y:d.y}),u.set(w,dt.toCanvas(d))});const D=[...M.values()];D.push(D[0]);const A=[this.lineNodeBBox(),U.merge(u.values()),new U(0,0,D[0].tickSize*c,0)];let I=0;if(t.enabled){const C=U.merge(A);I=r?C.height:C.width,A.push(this.titleBBox(this.scale.domain,I))}const L=U.merge(A);return this.layoutCrossLines(),{bbox:L,spacing:I,separatorLayout:D,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,g)=>({index:g,tickId:Cn(p,g),translation:Math.round(e.convert(p))}));this.gridLineGroupSelection.update(i.enabled&&s?this.calculateGridLines(d,h,u):[]),this.gridFillGroupSelection.update(i.enabled&&s?this.calculateGridFills(d,h,u):[]),this.tickLineGroupSelection.update(t.enabled?d.map(({tickId:p,translation:g},m)=>{const{tickSize:b=this.getTickSize(),tickStroke:y=t.stroke,tickWidth:v=t.width}=n[m]??{},M=-c*b,[S,D,A,I]=a?[g,g,0,M]:[0,M,g,g];return{tickId:p,offset:g,x1:S,y1:A,x2:D,y2:I,stroke:y,strokeWidth:v,lineDash:void 0}}):[]),this.updatePosition(),this.updateCategoryLabels(),this.updateAxisLine(),this.updateGridLines(),this.updateGridFills(),this.updateTickLines(),this.updateTitle(this.scale.domain,r),this.updateCrossLines(),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(){super.onGridVisibilityChange(),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:tr(t)??this.filterDuplicateArrays(t),clipped:!1},this.isReversed()&&this.dataDomain.domain.reverse();const i=this.dataDomain.domain.map(n=>Fc(ot(n)&&"value"in n?n.value:n));this.tickTreeLayout=Hk(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=HD(this.dataDomain.domain,s),this.tickScale.domain=i.concat([[""]])}filterDuplicateArrays(e){const t=new Set;return e.filter(i=>{const s=Ae(i)?JSON.stringify(i):i;return t.has(s)?!1:(t.add(s),!0)})}};Kr.className="GroupedCategoryAxis",Kr.type="grouped-category",f([x],Kr.prototype,"depthOptions",2);var $k={2:(e,t)=>Math.log2(t),[Math.E]:(e,t)=>Math.log(t),10:(e,t)=>Math.log10(t)},Wk=(e,t)=>Math.log(t)/Math.log(e);function Tg(e,t,i){const s=Math.min(...t),n=$k[e]??Wk;return s>=0?n(e,i):-n(e,-i)}var Yk={[Math.E]:(e,t)=>Math.exp(t),10:(e,t)=>t>=0?10**t:1/10**-t},Kk=(e,t)=>e**t;function kg(e,t,i){const s=Math.min(...t),n=Yk[e]??Kk;return s>=0?n(e,i):-n(e,-i)}var wg=class XS extends Ye{constructor(t=[1,10],i=[0,1]){super(t,i),this.type="log",this.defaultClamp=!0,this.base=10,this.log=s=>Tg(this.base,this.domain,s),this.pow=s=>kg(this.base,this.domain,s)}static is(t){return t instanceof XS}transform(t){const[i,s]=_t(this.domain);return i>=0!=s>=0?NaN:i>=0?Math.log(t):-Math.log(-t)}transformInvert(t){const[i,s]=_t(this.domain);return i>=0!=s>=0?NaN:i>=0?Math.exp(t):-Math.exp(-t)}toDomain(t){return 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=kg(s,i,o(Tg(s,i,n))),c=kg(s,i,a(Tg(s,i,r)));return[l,c]}ticks({interval:t,tickCount:i=Ye.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=A=>A>=l&&A<=c,y=Math.min(Math.abs(t),Math.abs(u-h)),{ticks:v,count:M,firstTickIndex:S}=Nh(h,u,y,n),D=v.map(this.pow).filter(b);if(!Uo(D.length,this.getPixelRange()))return{ticks:D,count:M,firstTickIndex:S}}if(!JD(r)||u-h>=i){const b=Math.min(u-h,i),{ticks:y,count:v,firstTickIndex:M}=yl(h,u,b,void 0,void 0,n);return{ticks:y.map(this.pow),count:v,firstTickIndex:M}}const d=[],p=l>0;h=Math.floor(h)-1,u=Math.round(u)+1;const g=zo(this.range)/i;let m=1/0;for(let b=h;b<=u;b++){const y=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),A=Math.abs(m-D),I=Math.abs(D-y),L=A>=g&&I>=g;S>=l&&S<=c&&(v===1||L||d.length===0)&&(d.push(S),m=D)}}return bx(d,p,n)}},Zr=class cm extends Ye{constructor(){super([0,1],[0,1]),this.type="number"}static is(t){return t instanceof cm}static getTickStep(t,i,s){const{interval:n,tickCount:r=Ye.defaultTickCount,minTickCount:o,maxTickCount:a}=s;return n??bl(t,i,r,o,a)}toDomain(t){return t}ticks({interval:t,tickCount:i=Ye.defaultTickCount,minTickCount:s,maxTickCount:n},r=this.domain,o){if(!r||r.length<2||i<1||!r.every(isFinite))return{ticks:[],count:0,firstTickIndex:0};const[a,l]=r;if(t){const c=Math.abs(t);if(!Uo((l-a)/c,this.getPixelRange()))return Nh(a,l,c,o)}return yl(a,l,i,s,n,o)}niceDomain(t,i=this.domain){if(i.length<2)return[];const{tickCount:s=Ye.defaultTickCount}=t;let[n,r]=i;if(s===1)[n,r]=Lx(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=cm.getTickStep(n,r,t),[p,g]=i;if(n=o(p/d)*d,r=a(g/d)*d,n===h&&r===u)break}}return[n,r]}},Ys=class extends xl{constructor(e,t=new Zr){super(e,t)}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&e<t}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:s,clipped:n}=Sg(e,t,i);return{domain:s,clipped:n}}createDatumFormatter(e,t){const{format:i}=this.label;return typeof i=="number"?Cx(t,i):void 0}tickFormatParams(e,t,i){return{type:"number",fractionDigits:i}}datumFormatParams(e,t,i){const{datum:s,seriesId:n,legendItemName:r,key:o,source:a,property:l,domain:c,boundSeries:h}=t;return{type:"number",value:e,datum:s,seriesId:n,legendItemName:r,key:o,source:a,property:l,domain:c,boundSeries:h,fractionDigits:i}}};Ys.className="NumberAxis",Ys.type="number",f([x],Ys.prototype,"min",2),f([x],Ys.prototype,"max",2);var ia=class extends Ys{normaliseDataDomain(e){const{min:t,max:i}=this,{extent:s,clipped:n}=Sg(e,t,i);return s[0]<0&&s[1]>0||e[0]<0&&e[1]>0?(j.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?(j.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 wg)}};ia.className="LogAxis",ia.type="log";var sa=class extends re{constructor(){super(...arguments),this.enabled=!1,this.label=new it,this.tick=new Pr}};f([x],sa.prototype,"enabled",2),f([x],sa.prototype,"label",2),f([x],sa.prototype,"tick",2);var Ks=class extends xl{constructor(e){super(e,new $o),this.parentLevel=new sa,this.min=void 0,this.max=void 0,this.minimumTimeGranularity=void 0}get _unit(){}set _unit(e){j.warnOnce("To use 'unit', use an axis with type 'unit-time' instead of 'time'.")}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&e<t}isCategoryLike(){return!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 Ng(e,this.min,this.max)}processData(){super.processData();const{boundSeries:e,direction:t,min:i,max:s}=this;this.minimumTimeGranularity=H0(e,t,i,s)}tickFormatParams(e,t,i,s){s??(s=Wp(t));const n=Yp(e),r=_s(s),o=$n(s),a=gl(s);return{type:"date",unit:r,step:o,epoch:a,truncateDate:n}}datumFormatParams(e,t,i,s,n){if(typeof e=="number"&&(e=new Date(e)),s==null){const{minimumTimeGranularity:b}=this,y=kh(e);b!=null&&xi(b)<xi(y)?s=b:s=y}const{datum:r,seriesId:o,legendItemName:a,key:l,source:c,property:h,domain:u,boundSeries:d}=t,p=_s(s),g=$n(s),m=gl(s);return{type:"date",value:e,datum:r,seriesId:o,legendItemName:a,key:l,source:c,property:h,domain:u,boundSeries:d,unit:p,step:g,epoch:m,style:n}}};Ks.className="TimeAxis",Ks.type="time",f([x],Ks.prototype,"parentLevel",2),f([x],Ks.prototype,"min",2),f([x],Ks.prototype,"max",2),f([x,Dt("_unit")],Ks.prototype,"unit",2);function H0(e,t,i,s){const n=e.reduce((r,o)=>Math.min(o.minTimeInterval()??1/0,r),1/0);return Number.isFinite(n)?ml(n):U0(e,t,i,s)?.unit}function U0(e,t,i,s){let n=1/0,r=-1/0,o,a=0;const l=[];for(const d of e){if(!d.visible)continue;const{domain:p}=Ng(d.getDomain(t),void 0,void 0);if(p.length===0)continue;const g=p[0].valueOf(),m=p[p.length-1].valueOf();l.push(g,m),n=Math.min(n??1/0,g,m),r=Math.max(r??-1/0,g,m);const b=Math.abs(m-g);if(b===0)continue;const y=d.dataCount();if(a=Math.max(a,y),y<=1)continue;const v=b/(y-1);o=Math.min(o??1/0,v)}if(n=Math.min(n,i?.valueOf()??1/0,s?.valueOf()??1/0),r=Math.max(r,i?.valueOf()??-1/0,s?.valueOf()??-1/0),!Number.isFinite(n)||!Number.isFinite(r))return;o??(o=Math.abs(r-n)),o=Math.min(o,Zk(l));const c=ml(o);let h=o/xi(c);a<=2?h=Math.floor(h):h=Math.round(h),h=Math.max(h,1);const u=h===1?void 0:$i(c,n);return{unit:c,step:h,epoch:u}}function Zk(e){e.sort((i,s)=>i-s);let t=1/0;for(let i=1;i<e.length;i++){const s=e[i-1],n=e[i];n-s>0&&(t=Math.min(t,Math.abs(n-s)))}return t}function Ng(e,t,i){let s=!1;typeof t=="number"&&(t=new Date(t)),typeof i=="number"&&(i=new Date(i));const n=tr(e)?.map(a=>new Date(a));if(n==null)return{domain:t!=null&&i!=null&&t.valueOf()<=i.valueOf()?[t,i]:[],clipped:!1};let[r,o]=n;return t instanceof Date&&(s||(s=t>r),r=t),i instanceof Date&&(s||(s=i<o),o=i),r>o?{domain:[],clipped:!1}:{domain:[r,o],clipped:s}}var $0=class extends ea{calculateGridLine({index:e,tickId:t,translation:i},s,n,r,o){const{gridLine:a,horizontal:l,interval:c,range:h}=this;if(c.placement!=="between")return super.calculateGridLine({index:e,tickId:t,translation:i},s,n,r,o);const u=o[s-1],d=u?i-(i-u.translation)/2:h[0],[p,g,m,b]=l?[d,Math.max(n,r),d,Math.min(n,r)]:[Math.min(n,r),d,Math.max(n,r),d],{style:y}=a,{stroke:v,strokeWidth:M=0,lineDash:S}=y[e%y.length]??{};return{tickId:t,offset:d,x1:p,y1:g,x2:m,y2:b,stroke:v,strokeWidth:M,lineDash:S}}calculateGridFills(e,t,i){return this.interval.placement!=="between"?super.calculateGridFills(e,t,i):e.map((s,n)=>this.calculateGridFill(s,n,s.index,t,i,e))}calculateGridFill({tickId:e,translation:t},i,s,n,r,o){const{gridLine:a,horizontal:l,interval:c,range:h}=this;if(c.placement!=="between")return super.calculateGridFill({tickId:e,translation:t},i,s,n,r,o);const u=o[i-1],d=o[i+1],p=u?t-(t-u.translation)/2:h[0],g=d?t+(d.translation-t)/2:h[1],[m,b,y,v]=l?[p,Math.max(n,r),g,Math.min(n,r)]:[Math.min(n,r),p,Math.max(n,r),g],{fill:M,fillOpacity:S}=a.style[s%a.style.length]??{};return{tickId:e,x1:m,y1:b,x2:y,y2:v,fill:M,fillOpacity:S}}calculateTickLine({primary:e,tickId:t,translation:i},s,n,r){const{horizontal:o,interval:a,primaryTick:l,range:c,tick:h}=this;if(a.placement!=="between")return super.calculateTickLine({primary:e,tickId:t,translation:i},s,n,r);const u=e&&l?.enabled?l:h,d=-n*this.getTickSize(u),p=r[s-1],g=p?i-(i-p.translation)/2:c[0],[m,b,y,v]=o?[g,0,g,d]:[0,g,d,g],{stroke:M,width:S}=u;return{tickId:t,offset:g,x1:m,y1:b,x2:y,y2:v,stroke:M,strokeWidth:S,lineDash:void 0}}},nr=class extends $0{constructor(e){super(e,new Wn,!1),this.parentLevel=new sa,this.min=void 0,this.max=void 0,this.unit=void 0,this.defaultUnit=void 0}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&e<t}isCategoryLike(){return!0}processData(){super.processData();let e;const{domain:t}=this.dataDomain;if(t.length===2&&t[0].valueOf()===t[1].valueOf())e=kh(t[0]);else{const{boundSeries:i,direction:s,min:n,max:r}=this;e=U0(i,s,n,r)}Nt(this.defaultUnit,e)||(this.defaultUnit=e)}updateScale(){super.updateScale(),this.scale.interval=this.unit??this.defaultUnit}normaliseDataDomain(e){return Ng(e,this.min,this.max)}createDatumFormatter(e,t){const i=this.scale.interval,{format:s}=this.label;if(s==null)return;const n=Vp(i!=null?mb(s,_s(i)):s,i);if(n!=null)return Tr(n)}tickFormatParams(e,t,i,s){s??(s=Wp(t));const n=Yp(e),r=_s(s),o=$n(s),a=gl(s);return{type:"date",unit:r,step:o,epoch:a,truncateDate:n}}datumFormatParams(e,t,i,s,n){const r=this.unit??this.defaultUnit??"millisecond";e=$i(r,e),typeof e=="number"&&(e=new Date(e)),s??(s=r);const{datum:o,seriesId:a,legendItemName:l,key:c,source:h,property:u,domain:d,boundSeries:p}=t,g=_s(s),m=$n(s),b=gl(s);return{type:"date",value:e,datum:o,seriesId:a,legendItemName:l,key:c,source:h,property:u,domain:d,boundSeries:p,unit:g,step:m,epoch:b,style:n}}};nr.className="UnitTimeAxis",nr.type="unit-time",f([x],nr.prototype,"parentLevel",2),f([x],nr.prototype,"min",2),f([x],nr.prototype,"max",2),f([x],nr.prototype,"unit",2);var na={...An,...Qo(O),type:W(Qe("number")),label:xg,crosshair:er(!0)},ra={...An,...Qo(O),type:W(Qe("log")),base:qe(Ra,we(e=>e!==1,"not equal to 1")),label:xg,crosshair:er(!0)},oa={...An,...Qo(pe(O,Pn),!0),type:W(Qe("time")),label:Ul,parentLevel:hu,crosshair:er(!0,!0)},aa={...An,type:W(Qe("category")),label:Hl,paddingInner:K,paddingOuter:K,groupPaddingInner:K,crosshair:er(),bandHighlight:$l,interval:{...vg,placement:z("on","between")}},la={...An,type:W(Qe("grouped-category")),label:Hl,crosshair:er(),bandHighlight:$l,paddingInner:K,groupPaddingInner:K,depthOptions:qt({label:{enabled:k,avoidCollisions:k,wrapping:z("never","always","hyphenate","on-space"),truncate:k,rotation:O,spacing:O,..._e,...as},tick:{enabled:k,stroke:_,width:T}},"depth options objects array")},ca={...An,type:W(Qe("unit-time")),unit:pe(cu,_l),label:Ul,parentLevel:hu,paddingInner:K,paddingOuter:K,groupPaddingInner:K,crosshair:er(!0,!0),bandHighlight:$l,min:qe(pe(O,Pn),Es("max")),max:qe(pe(O,Pn),Os("min")),interval:Mg},Xk={type:"axis",name:"number",chartType:"cartesian",options:na,create:e=>new Ys(e)},qk={type:"axis",name:"log",chartType:"cartesian",options:ra,create:e=>new ia(e)},Qk={type:"axis",name:"time",chartType:"cartesian",options:oa,create:e=>new Ks(e)},Jk={type:"axis",name:"category",chartType:"cartesian",options:aa,create:e=>new ea(e)},ew={type:"axis",name:"grouped-category",chartType:"cartesian",options:la,create:e=>new Kr(e)},tw={type:"axis",name:"unit-time",chartType:"cartesian",options:ca,create:e=>new nr(e)},ha={...An,type:W(Qe("ordinal-time")),paddingInner:K,paddingOuter:K,groupPaddingInner:K,label:Ul,parentLevel:hu,interval:Mg,crosshair:er(!0,!0),bandHighlight:$l},W0={...Yr,...Qo(O),type:W(Qe("angle-number")),crossLines:qt(Ws),startAngle:O,endAngle:O,label:{...In,orientation:z("fixed","parallel","perpendicular"),format:xs}},iw={innerRadiusRatio:K},Y0={...Yr,...iw,type:W(Qe("angle-category")),shape:z("polygon","circle"),crossLines:qt(Ws),startAngle:O,endAngle:O,paddingInner:K,groupPaddingInner:K,label:{...In,orientation:z("fixed","parallel","perpendicular")}},K0={...Yr,...Qo(O),type:W(Qe("radius-number")),shape:z("polygon","circle"),positionAngle:O,innerRadiusRatio:K,crossLines:qt({...Ws,label:{...Wr,positionAngle:O}},"cross-line options"),title:{enabled:k,text:N,spacing:T,formatter:Be,..._e},label:{...In,format:xs}},Z0={...Yr,type:W(Qe("radius-category")),positionAngle:O,innerRadiusRatio:K,paddingInner:K,paddingOuter:K,groupPaddingInner:K,label:In,crossLines:qt({...Ws,label:{...Wr,positionAngle:O}},"cross-line options"),title:{enabled:k,text:N,spacing:T,formatter:Be,..._e}},X0=St(st,st),q0={showInMiniChart:k,connectMissingData:k,interpolation:nu,label:Ue,marker:Sn,tooltip:Oe,shadow:$s,...Le,...$,...B,...Y,highlight:X0},Q0={...q0,...vs,highlight:X0,type:W(Qe("area")),xKey:W(N),yKey:W(N),xName:N,yName:N,stacked:k,stackGroup:N,normalizedTo:O},J0=St(Ps,Ps),Eg={direction:z("horizontal","vertical"),showInMiniChart:k,cornerRadius:T,itemStyler:Je({...$,...B,...Y,cornerRadius:T}),crisp:k,label:{...Ue,placement:z("inside-center","inside-start","inside-end","outside-start","outside-end"),spacing:T},errorBar:Bl,shadow:$s,tooltip:Oe,...Le,highlight:J0,...$,...B,...Y};Eg.sparklineMode=he(k);var mu={...Eg,...vs,highlight:J0,type:W(Qe("bar")),xKey:W(N),yKey:W(N),xName:N,yName:N,direction:z("horizontal","vertical"),grouped:k,stacked:k,stackGroup:N,normalizedTo:O,legendItemName:N,errorBar:su};mu.pickOutsideVisibleMinorAxis=he(k),mu.focusPriority=he(O);var ev={title:N,domain:te(O),maxSize:T,showInMiniChart:k,label:{placement:z("top","right","bottom","left"),...Ue},tooltip:Oe,maxRenderedItems:O,...Le,...V(Sn,["enabled"]),highlight:St(st,st)},sw={...ev,...vs,type:W(Qe("bubble")),xKey:W(N),yKey:W(N),sizeKey:W(N),labelKey:N,xName:N,yName:N,sizeName:N,labelName:N,highlight:St(st,st)},tv={showInMiniChart:k,cornerRadius:T,label:Ue,tooltip:Oe,shadow:$s,...Le,...$,...B,...Y,highlight:St(st,st)},nw={...vs,...tv,type:W(Qe("histogram")),xKey:W(N),yKey:N,xName:N,yName:N,areaPlot:k,aggregation:z("count","sum","mean"),bins:te(te(O)),binCount:T},iv=St(st,xr),Og={title:N,showInMiniChart:k,connectMissingData:k,interpolation:nu,label:Ue,marker:Sn,tooltip:Oe,errorBar:Bl,...Le,...B,...Y,highlight:iv};Og.sparklineMode=he(k);var yu={...Og,...vs,highlight:iv,type:W(Qe("line")),xKey:W(N),yKey:W(N),xName:N,yName:N,stacked:k,stackGroup:N,normalizedTo:O,legendItemName:N,errorBar:su};yu.pickOutsideVisibleMinorAxis=he(k),yu.focusPriority=he(O);var sv={title:N,showInMiniChart:k,label:{placement:z("top","right","bottom","left"),...Ue},tooltip:Oe,errorBar:Bl,maxRenderedItems:O,...Le,...V(Sn,["enabled"]),highlight:St(st,st)},rw={...sv,...vs,type:W(Qe("scatter")),xKey:W(N),yKey:W(N),labelKey:N,xName:N,yName:N,labelName:N,errorBar:su,highlight:St(st,st)},nv=St(st,st),Pg={...Le,radiusMin:T,radiusMax:T,rotation:O,outerRadiusOffset:O,outerRadiusRatio:K,hideZeroValueSectorsInLegend:k,sectorSpacing:T,cornerRadius:T,itemStyler:Je({...$,...B,...Y,cornerRadius:T}),title:{enabled:k,text:N,showInLegend:k,spacing:T,..._e},calloutLabel:{enabled:k,offset:O,minAngle:T,avoidCollisions:k,formatter:Be,format:N,itemStyler:Je({enabled:k,...as,..._e}),...as,..._e},sectorLabel:{enabled:k,positionOffset:O,positionRatio:K,formatter:Be,format:N,itemStyler:Je({enabled:k,...as,..._e}),...as,..._e},calloutLine:{colors:te(_),length:T,strokeWidth:T},fills:te(Gi),strokes:te(_),tooltip:Oe,shadow:$s,highlight:nv,...Y,...V($,["fill"]),...V(B,["stroke"])},Xr={...Pg,...vs,type:W(Qe("pie")),angleKey:W(N),radiusKey:N,calloutLabelKey:N,sectorLabelKey:N,legendItemKey:N,angleName:N,radiusName:N,calloutLabelName:N,sectorLabelName:N,highlight:nv};Xr.defaultColorRange=he(te(te(_))),Xr.defaultPatternFills=he(te(_)),Xr.title._enabledFromTheme=he(k),Xr.calloutLabel._enabledFromTheme=he(k),Xr.sectorLabel._enabledFromTheme=he(k);var rv={...Pg,innerRadiusOffset:O,innerRadiusRatio:K,innerCircle:{fill:N,fillOpacity:K},innerLabels:{spacing:T,..._e,...as}},ow={...rv,...Xr,type:W(Qe("donut")),innerLabels:qt({text:W(N),spacing:T,..._e,...as},"inner label options array")},ua={lineStyle:z("solid","dashed","dotted"),...Y},qr={...$,...B,...Y},Zl={visible:k,locked:k,handle:qr,..._e},bu={position:z("top","center","bottom"),alignment:z("left","center","right"),..._e},ov={position:z("top","inside","bottom"),alignment:z("left","center","right"),..._e},aw={enabled:k,cornerRadius:T,formatter:Be,..._e,...$,...B,...Y},lw={visible:k,...ua,...B},av={divider:B,...$,...B,..._e},lv={handle:qr,statistics:av,...ua,...$,...B},xu={visible:k,locked:k,extendStart:k,extendEnd:k,handle:qr,text:bu,...ua,...B},Rg={visible:k,locked:k,axisLabel:aw,handle:qr,text:bu,...ua,...B},zg={visible:k,locked:k,extendStart:k,extendEnd:k,handle:qr,text:ov,background:$,...ua,...B},cv={...zg},hv={...zg,middle:lw},Fg={label:_e,showFill:k,isMultiColor:k,strokes:te(_),rangeStroke:_,bands:z(4,6,10),...xu},uv={...$,...B,...Zl},dv={...$,...B,...Zl},pv={...$,...B,...Zl,background:{...$,...B}},jg={visible:k,locked:k,handle:qr,...$},vu={visible:k,locked:k,extendStart:k,extendEnd:k,handle:qr,text:bu,background:$,statistics:av,...ua,...B},gv={visible:k,up:lv,down:lv},da={enabled:k,axesButtons:{enabled:k,axes:z("x","y","xy")},toolbar:{enabled:k,padding:T,buttons:qt({...$r,value:z("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:k,buttons:te(pe(At({...$r,value:W(z("line-stroke-width","line-style-type","line-color","fill-color","text-color","text-size","delete","settings"))}),At({...$r,value:W(z("lock")),checkedOverrides:$r})))}};da.data=he(Ns),da.xKey=he(N),da.volumeKey=he(N),da.snap=he(k);var Bg={...$,...B,...Y,cornerRadius:T,whisker:{...B,...Y},cap:{lengthRatio:K}},Vg={...Bg,opacity:K},fv={direction:z("horizontal","vertical"),showInMiniChart:k,itemStyler:Je({...$,...B,...Y,cornerRadius:T,whisker:{...B,...Y},cap:{lengthRatio:K}}),tooltip:Oe,...Le,...Bg,highlight:St(Vg,Vg)},Gg={cornerRadius:T,wick:{...B,...Y},...$,...B,...Y},mv={...Gg,opacity:K},yv={item:{up:Gg,down:Gg},itemStyler:Je({...$,...B,...Y,cornerRadius:T,wick:{...B,...Y}}),showInMiniChart:k,tooltip:Oe,...Le,highlight:St(mv,mv)},bv={fills:te(Gi),strokes:te(_),label:{spacing:T,maxWidth:T,...Ue},link:{tension:K,itemStyler:Je({...$,...B,...Y,tension:K}),...$,...B,...Y},node:{width:T,spacing:T,itemStyler:Je({...$,...B,...Y}),...$,...B,...Y},tooltip:Oe,...Le},xv={direction:z("horizontal","vertical"),fills:te(Gi),strokes:te(_),label:{spacing:T,placement:z("before","middle","after"),...Ue},stageLabel:{placement:z("before","after"),format:xs,...In},tooltip:Oe,...V(Le,["showInLegend"]),...V($,["fill"]),...V(B,["stroke"]),...Y,highlight:Am(xr)},vv={direction:z("horizontal","vertical"),fills:te(Gi),strokes:te(_),itemStyler:Je({...$,...B,...Y}),spacingRatio:K,crisp:k,dropOff:{enabled:k,...$,...B,...Y},stageLabel:{placement:z("before","after"),format:xs,...In},label:Ue,tooltip:Oe,shadow:$s,...V(Le,["showInLegend"]),...V($,["fill"]),...V(B,["stroke"]),...Y},Mv={title:N,textAlign:z("left","center","right"),verticalAlign:z("top","middle","bottom"),itemPadding:T,itemStyler:Je({...$,...B}),showInMiniChart:k,label:Qn,tooltip:Oe,...Le,...B},Sv={showInMiniChart:k,itemStyler:Je({...B,...Y}),item:{up:{...B,...Y},down:{...B,...Y}},tooltip:Oe,...Le,highlight:St(xr,xr)},Dv={maxStrokeWidth:T,itemStyler:Je({...B,...Y}),sizeDomain:te(T),label:Ue,tooltip:Oe,...Le,...B,...Y,highlightStyle:{...Le.highlightStyle,...B},highlight:St(xr,xr)},Iv={...B,...Y},Av={colorRange:te(_),maxSize:T,sizeDomain:te(T),label:{placement:z("top","bottom","left","right"),...Ue},tooltip:Oe,...Le,...V(Sn,["enabled"]),highlightStyle:{...Le.highlightStyle,...$,...B},highlight:St(st,st)},Cv={colorRange:te(_),padding:T,itemStyler:Je({...$,...B,...Y}),label:Qn,tooltip:Oe,...Le,...$,...B,...Y,highlightStyle:{...Le.highlightStyle,...$,...B},highlight:St(st,st)},Lv={...Le,...$,...B,...Y},Tv={cornerRadius:T,itemStyler:Je({...$,...B,...Y,cornerRadius:T}),label:Ue,tooltip:Oe,...Le,...$,...B,...Y,highlight:St(Ps,Ps)},kv={direction:z("horizontal","vertical"),aspectRatio:T,spacing:T,reverse:k,itemStyler:Je({...$,...B,...Y}),fills:te(Gi),strokes:te(_),label:Ue,stageLabel:{spacing:T,placement:z("before","after"),...Ue},tooltip:Oe,shadow:$s,...Le,...V($,["fill"]),...V(B,["stroke"]),...Y},wv={connectMissingData:k,marker:Sn,label:Ue,tooltip:Oe,...Le,...$,...B,...Y,highlight:St(st,st)},Nv={connectMissingData:k,marker:Sn,label:Ue,tooltip:Oe,...Le,...B,...Y,highlight:St(st,xr)},Ev={cornerRadius:T,itemStyler:Je({...$,...B,...Y,cornerRadius:T}),label:Ue,tooltip:Oe,...Le,...$,...B,...Y,highlight:St(Ps,Ps)},Ov={cornerRadius:T,columnWidthRatio:K,maxColumnWidthRatio:K,itemStyler:Je({...$,...B,...Y,cornerRadius:T}),label:Ue,tooltip:Oe,...Le,...$,...B,...Y,highlight:St(Ps,Ps)},Pv={showInMiniChart:k,connectMissingData:k,interpolation:nu,label:{...Ue,placement:z("inside","outside"),spacing:T},marker:Sn,tooltip:Oe,shadow:$s,...Le,...$,...B,...Y,highlight:St(st,st)},Rv={direction:z("horizontal","vertical"),grouped:k,showInMiniChart:k,cornerRadius:T,itemStyler:Je({...$,...B,...Y,cornerRadius:T}),label:{...Ue,placement:z("inside","outside"),spacing:T},tooltip:Oe,shadow:$s,...Le,...$,...B,...Y,highlight:St(Ps,Ps)},zv={fills:te(Gi),strokes:te(_),label:{...Ue,spacing:T},link:{itemStyler:Je({...$,...B,...Y}),...$,...B,...Y},node:{width:T,spacing:T,alignment:z("left","center","right","justify"),itemStyler:Je({...$,...B,...Y}),...$,...B,...Y},tooltip:Oe,...Le},Fv={fills:te(Gi),strokes:te(_),colorRange:te(_),sectorSpacing:T,cornerRadius:T,padding:T,itemStyler:Je({...$,...B}),label:{spacing:T,...Qn},secondaryLabel:Qn,tooltip:Oe,...V(Le,["highlight","showInLegend"]),...V($,["fill"]),...V(B,["stroke"]),highlightStyle:{label:{color:_},secondaryLabel:{color:_},...$,...B}},jv={fills:te(Gi),strokes:te(_),colorRange:te(_),itemStyler:Je({...$,...B}),group:{gap:T,padding:T,cornerRadius:T,textAlign:z("left","center","right"),interactive:k,label:{...Ue,spacing:T},...$,...B},tile:{gap:T,padding:T,cornerRadius:T,textAlign:z("left","center","right"),verticalAlign:z("top","middle","bottom"),label:{...Ue,spacing:T,lineHeight:T,minimumFontSize:T,wrapping:z("never","always","hyphenate","on-space"),overflowStrategy:z("ellipsis","hide")},secondaryLabel:{...Ue,lineHeight:T,minimumFontSize:T,wrapping:z("never","always","hyphenate","on-space"),overflowStrategy:z("ellipsis","hide")},...$,...B},tooltip:Oe,...V(Le,["highlight","showInLegend"]),highlightStyle:{group:{label:{color:_},...$,...B},tile:{label:{color:_},secondaryLabel:{color:_},...$,...B}}},_g={name:N,cornerRadius:T,itemStyler:Je({...$,...B,...Y,cornerRadius:T}),label:{...Ue,placement:z("inside-start","inside-center","inside-end","outside-start","outside-end"),spacing:T},tooltip:Oe,shadow:$s,...$,...B,...Y},Bv={direction:z("horizontal","vertical"),showInMiniChart:k,item:{positive:_g,negative:_g,total:_g},line:{enabled:k,...B,...Y},tooltip:Oe,...Le},Mu=At({__type:W(Qe("date")),value:pe(N,O)},"a serializable date object"),Vv={width:T,height:T,grip:k,fill:_,stroke:_,strokeWidth:T,cornerRadius:T},Pe={enabled:k,height:T,spacing:T,cornerRadius:O,mask:{fill:_,fillOpacity:K,stroke:_,strokeWidth:T},minHandle:Vv,maxHandle:Vv,miniChart:{enabled:k,padding:{top:T,bottom:T},label:{enabled:k,avoidCollisions:k,spacing:T,format:xs,formatter:Be,interval:{minSpacing:T,maxSpacing:T,values:Ns,step:O},..._e},series:ee}},mi={number:{...V(na,["type","crossLines"]),top:V(na,["type","crossLines","position"]),right:V(na,["type","crossLines","position"]),bottom:V(na,["type","crossLines","position"]),left:V(na,["type","crossLines","position"]),crossLines:V(Dn,["type"])},log:{...V(ra,["type","crossLines"]),top:V(ra,["type","crossLines","position"]),right:V(ra,["type","crossLines","position"]),bottom:V(ra,["type","crossLines","position"]),left:V(ra,["type","crossLines","position"]),crossLines:V(Dn,["type"])},category:{...V(aa,["type","crossLines"]),top:V(aa,["type","crossLines","position"]),right:V(aa,["type","crossLines","position"]),bottom:V(aa,["type","crossLines","position"]),left:V(aa,["type","crossLines","position"]),crossLines:V(Dn,["type"])},time:{...V(oa,["type","crossLines"]),top:V(oa,["type","crossLines","position"]),right:V(oa,["type","crossLines","position"]),bottom:V(oa,["type","crossLines","position"]),left:V(oa,["type","crossLines","position"]),crossLines:V(Dn,["type"])},"unit-time":{...V(ca,["type","crossLines"]),top:V(ca,["type","crossLines","position"]),right:V(ca,["type","crossLines","position"]),bottom:V(ca,["type","crossLines","position"]),left:V(ca,["type","crossLines","position"]),crossLines:V(Dn,["type"])},"grouped-category":{...V(la,["type"]),top:V(la,["type","position"]),right:V(la,["type","position"]),bottom:V(la,["type","position"]),left:V(la,["type","position"]),crossLines:V(Dn,["type"])},"ordinal-time":{...V(ha,["type","crossLines"]),top:V(ha,["type","crossLines","position"]),right:V(ha,["type","crossLines","position"]),bottom:V(ha,["type","crossLines","position"]),left:V(ha,["type","crossLines","position"]),crossLines:V(Dn,["type"])}},pa={"angle-category":{...V(Y0,["type","crossLines"]),crossLines:V(Ws,["type"])},"angle-number":{...V(W0,["type","crossLines"]),crossLines:V(Ws,["type"])},"radius-category":{...V(Z0,["type","crossLines"]),crossLines:{...V(Ws,["type"]),label:{...Wr,positionAngle:O}}},"radius-number":{...V(K0,["type","crossLines"]),crossLines:{...V(Ws,["type"]),label:{...Wr,positionAngle:O}}}},ze={visible:k},cw={common:{...le,navigator:Pe,axes:{...mi,...pa},annotations:{...da,line:xu,"horizontal-line":Rg,"vertical-line":Rg,"disjoint-channel":cv,"parallel-channel":hv,"fibonacci-retracement":Fg,"fibonacci-retracement-trend-based":Fg,callout:uv,comment:dv,note:pv,text:Zl,arrow:xu,"arrow-up":jg,"arrow-down":jg,"date-range":vu,"price-range":vu,"date-price-range":vu,"quick-date-price-range":gv},chartToolbar:{enabled:k},initialState:{legend:qt({visible:k,seriesId:N,itemId:N,legendItemName:N},"legend state array"),zoom:{rangeX:{start:pe(O,Mu),end:pe(O,Mu)},rangeY:{start:pe(O,Mu),end:pe(O,Mu)},ratioX:{start:K,end:K},ratioY:{start:K,end:K},autoScaledAxes:te(Qe("y"))}}},line:{...le,axes:mi,series:Og,navigator:Pe,...ze},scatter:{...le,axes:mi,series:sv,navigator:Pe,...ze},bubble:{...le,axes:mi,series:ev,navigator:Pe,...ze},area:{...le,axes:mi,series:q0,navigator:Pe,...ze},bar:{...le,axes:mi,series:Eg,navigator:Pe,...ze},"box-plot":{...le,axes:mi,series:fv,navigator:Pe,...ze},candlestick:{...le,axes:mi,series:yv,navigator:Pe,...ze},"cone-funnel":{...le,axes:mi,series:xv,navigator:Pe,...ze},funnel:{...le,axes:mi,series:vv,navigator:Pe,...ze},ohlc:{...le,axes:mi,series:Sv,navigator:Pe,...ze},histogram:{...le,axes:V(mi,["category","grouped-category","unit-time","ordinal-time"]),series:tv,navigator:Pe,...ze},heatmap:{...le,axes:mi,series:Mv,navigator:Pe,...ze},waterfall:{...le,axes:mi,series:Bv,navigator:Pe,...ze},"range-bar":{...le,axes:mi,series:Rv,navigator:Pe,...ze},"range-area":{...le,axes:mi,series:Pv,navigator:Pe,...ze},donut:{...le,series:rv,navigator:Pe,...ze},pie:{...le,series:Pg,navigator:Pe,...ze},"radar-line":{...le,axes:pa,series:Nv,navigator:Pe,...ze},"radar-area":{...le,axes:pa,series:wv,navigator:Pe,...ze},"radial-bar":{...le,axes:pa,series:Ev,navigator:Pe,...ze},"radial-column":{...le,axes:pa,series:Ov,navigator:Pe,...ze},nightingale:{...le,axes:pa,series:Tv,navigator:Pe,...ze},sunburst:{...le,series:Fv,navigator:Pe,...ze},treemap:{...le,series:jv,navigator:Pe,...ze},"map-shape":{...le,series:Cv,navigator:Pe,...ze},"map-line":{...le,series:Dv,navigator:Pe,...ze},"map-marker":{...le,series:Av,navigator:Pe,...ze},"map-shape-background":{...le,series:Lv,navigator:Pe,...ze},"map-line-background":{...le,series:Iv,navigator:Pe,...ze},sankey:{...le,series:zv,navigator:Pe,...ze},chord:{...le,series:bv,navigator:Pe,...ze},pyramid:{...le,series:kv,navigator:Pe,...ze},"radial-gauge":{...le,...lu,targets:V(ou,["value"]),tooltip:{...lu.tooltip,...le.tooltip}},"linear-gauge":{...le,...au,targets:V(ru,["value"]),tooltip:{...au.tooltip,...le.tooltip}}};function Su(e,t){const i={};for(const s of Reflect.ownKeys(e))i[s]=t(e[s],s,e);return i}var hw=Su(cw,function e(t,i){if(kc(i))return t;if(nn(t))return pe(t,Pc,kc);if(ot(t))return pe(At(Nc in t?Su(t,s=>ot(s)?Su(s,e):s):Su(t,e)),Pc,kc);throw new Error(`Invalid theme override value: ${String(t)}`)}),ri={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Qr={BLUE:"#67b7ff",ORANGE:"#ffc24d",GREEN:"#5cc86f",CYAN:"#54ebff",VIOLET:"#fff653",YELLOW:"#c18aff",GRAY:"#aeaeae",MAGENTA:"#f078d4",BROWN:"#ba8438",RED:"#ff726e"},uw=class extends qo{getDefaultColors(){return{fills:ri,fillsFallback:Object.values(ri),strokes:Qr,sequentialColors:ji(ri),divergingColors:[ri.ORANGE,ri.YELLOW,ri.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#0076e6","#0069cc","#005cb3","#004f99","#004280","#003466","#00274c"],secondDivergingColors:[ri.GREEN,ri.YELLOW,ri.RED],secondHierarchyColors:[],up:{fill:ri.GREEN,stroke:Qr.GREEN},down:{fill:ri.RED,stroke:Qr.RED},neutral:{fill:ri.GRAY,stroke:Qr.GRAY},altUp:{fill:ri.BLUE,stroke:Qr.BLUE},altDown:{fill:ri.ORANGE,stroke:Qr.ORANGE},altNeutral:{fill:ri.GRAY,stroke:Qr.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(mt,ri.BLUE),e.set(Rt,ri.BLUE),e}},oi={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Jr={BLUE:"#0f68c0",ORANGE:"#d47100",GREEN:"#007922",CYAN:"#009ac2",VIOLET:"#bca400",YELLOW:"#753cac",GRAY:"#646464",MAGENTA:"#9b2685",BROWN:"#6c3b00",RED:"#cb0021"},dw=class extends ys{getDefaultColors(){return{...super.getDefaultColors(),fills:oi,fillsFallback:Object.values(oi),strokes:Jr,sequentialColors:ji(oi),divergingColors:[oi.ORANGE,oi.YELLOW,oi.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#1a8fff","#339cff","#4da8ff","#66b5ff","#80c1ff","#99cdff","#b3daff"],secondDivergingColors:[oi.GREEN,oi.YELLOW,oi.RED],secondHierarchyColors:[],up:{fill:oi.GREEN,stroke:Jr.GREEN},down:{fill:oi.RED,stroke:Jr.RED},neutral:{fill:oi.GRAY,stroke:Jr.GRAY},altUp:{fill:oi.BLUE,stroke:Jr.BLUE},altDown:{fill:oi.ORANGE,stroke:Jr.ORANGE},altNeutral:{fill:oi.GRAY,stroke:Jr.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(mt,oi.BLUE),e.set(Rt,oi.BLUE),e}},Hg=Jt(()=>new ys),pw=be.create(!0,"perf"),Ms=(e,t,i)=>{pw("[CACHE] ChartTheme",e,t.name,i)},Ug={"ag-default-dark":Jt(()=>new qo),"ag-sheets-dark":Jt(()=>new bk,Ms),"ag-polychroma-dark":Jt(()=>new mk,Ms),"ag-vivid-dark":Jt(()=>new uw,Ms),"ag-material-dark":Jt(()=>new gk,Ms),"ag-financial-dark":Jt(()=>new dk,Ms),"ag-default":Hg,"ag-sheets":Jt(()=>new xk,Ms),"ag-polychroma":Jt(()=>new yk,Ms),"ag-vivid":Jt(()=>new dw,Ms),"ag-material":Jt(()=>new fk,Ms),"ag-financial":Jt(()=>new pk,Ms)},Du=Jt(gw,Ms);function gw(e){if(e instanceof ys)return e;if(!bw(e))return Hg();if(e==null||typeof e=="string"){const n=Ug[e??"ag-default"];if(n)return n();throw new Error(`Cannot find theme \`${e}\`.`)}const{cleared:t,invalid:i}=ci(fw(e),mw,"theme");for(const n of i)j.warnOnce(String(n));const s=t?.baseTheme?Du(t.baseTheme):Hg();return t?new s.constructor(t):s}function fw(e){if(!ot(e)||!ot(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:Ee(...n),params:s,palette:i}}var mw={baseTheme:pe(N,Oc),overrides:hw,params:{accentColor:_,axisColor:_,backgroundColor:_,borderColor:_,borderRadius:O,chartBackgroundColor:_,chartPadding:O,focusShadow:N,foregroundColor:_,fontFamily:yd,fontSize:O,fontWeight:pe(N,O),gridLineColor:_,popupShadow:N,subtleTextColor:_,textColor:_,chromeBackgroundColor:_,chromeFontFamily:yd,chromeFontSize:O,chromeFontWeight:pe(N,O),chromeSubtleTextColor:_,chromeTextColor:_,buttonBackgroundColor:_,buttonBorder:k,buttonFontWeight:O,buttonTextColor:_,inputBackgroundColor:_,inputBorder:k,inputTextColor:_,menuBackgroundColor:_,menuBorder:k,menuTextColor:_,panelBackgroundColor:_,panelSubtleTextColor:_,tooltipBackgroundColor:_,tooltipBorder:k,tooltipTextColor:_,tooltipSubtleTextColor:_,crosshairLabelBackgroundColor:_,crosshairLabelTextColor:_},palette:{fills:te(Gi),strokes:te(_),up:{fill:pe(_,md),stroke:_},down:{fill:pe(_,md),stroke:_},neutral:{fill:pe(_,md),stroke:_}}},yw=z("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 bw(e){const{invalid:t}=ci({theme:e},{theme:pe(yw,Oc)});for(const i of t)j.warnOnce(String(i));return t.length===0}var rr={isEnterprise:!1},$t="path",Ss="pathArray",Wt="default",Ds="override",ga="user",Xl="operation",ql="operationValue",$g="dependency",Wg="autoEnable",Gv="autoEnableValue";function Yg(e){return Tc(e)&&e>=0&&e<=1}function Ql(e,t){let i=e;for(const s of t){if(!(typeof s=="string"&&i!=null&&(typeof i=="object"||Array.isArray(i))&&s in i))return!1;i=i[s]}return!0}function Is(e,t){let i=e;for(const s of t){if(!(typeof s=="string"&&i!=null&&(typeof i=="object"||Array.isArray(i))&&s in i))return;i=i[s]}return i}function Kg(e,t,i){const s=t.length;if(s===0)return;let n=e;const r=s-1,o=t[r];for(let a=0;a<r;a++){const l=t[a],c=t[a+1];let h=n[l];(h==null||!Lc(h))&&(h=isNaN(Number(c))?{}:[],n[l]=h),n=h}n[o]=i}var xw=/^\d+$/;function _v(e){for(let t=e.length-1;t>=0;t--){const i=e[t];if(xw.test(i))return t}return-1}function Jl(e){const t=_v(e);return Number(e[t])}function eo(e,t,i){const s=t.split("/");let n=[...e];t.startsWith("/")&&(n=[],s.shift());let r=!1;for(const o of s){if(o==="..")n.pop(),r||n.pop();else if(o===".")n.pop();else if(o==="$index"){const a=Jl(e);if(isNaN(a))return Zs;n.push(`${a}`)}else if(o==="$prevIndex"){const a=Jl(e);if(isNaN(a)||Number(a)<=0)return Zs;n.push(`${Number(a)-1}`)}else if(o.startsWith("$")){const a=i?.[o.slice(1)];if(a==null)return Zs;n.push(a)}else o.length!==0&&n.push(o);r=o===".."}return n}var Zs=Symbol("unresolvable-path"),or=Symbol("resolved-to-branch");function fa(e,t){if(e==null||typeof e!="object"||Array.isArray(e)||(t??(t=Object.keys(e)),t.length===0))return;const i=t[0];if(Wv.has(i))return{operation:i,values:Array.isArray(e[i])?e[i]:[e[i]]}}function vw(e,t,i){const s=fa(e.getVertexValue(i));switch(s?.operation){case"$path":{const[n]=s.values,r=e.getPathArray(t),o=eo(r,n);return o===Zs?void 0:e.findVertexAtPath(o)}case"$value":return t}}var Mw={$hasSeriesType:{dependencies:Zg,resolve:Sw},$isChartType:{dependencies:Zg,resolve:Iw},$isSeriesType:{dependencies:Zg,resolve:Dw}};function Zg(e,t,i){const s=e.findVertexAtPath(["series","0","type"]);s&&e.addEdge(t,s,$g)}function Sw(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s),r=e.getResolvedPath(["series"]);if(!Array.isArray(r))return!1;for(const o of r)if(o.type===n)return!0;return!1}function Dw(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return e.getResolvedPath(["series","0","type"])===n}function Iw(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s),r=e.getResolvedPath(["series","0","type"]);if(typeof r!="string")return!1;switch(n){case"cartesian":return Ht.isCartesian(r);case"polar":return Ht.isPolar(r);case"standalone":return Ht.isStandalone(r)}return!1}var Aw={$foregroundBackgroundMix:Cw,$foregroundOpacity:Lw,$interpolate:Tw,$isGradient:kw,$isImage:ww,$isPattern:Nw,$mix:Ew};function Cw(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s),r=e.getParamValue("foregroundColor"),o=e.getParamValue("backgroundColor");if(typeof r=="string"&&typeof o=="string"&&Yg(n))return We.mix(We.fromString(r),We.fromString(o),1-n).toString();be.inDevelopmentMode(()=>j.warnOnce(`\`$foregroundBackgroundMix\` json operation failed on [${String(n)}}}] at [${e.getPathArray(t).join(".")}], expecting a number between 0 and 1.`))}function Lw(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s),r=e.getParamValue("foregroundColor");if(typeof r=="string"&&Yg(n)){const o=We.fromString(r);return new We(o.r,o.g,o.b,n).toString()}be.inDevelopmentMode(()=>j.warnOnce(`\`$foregroundOpacity\` json operation failed on [${String(n)}}}] at [${e.getPathArray(t).join(".")}], expecting a number between 0 and 1.`))}function Tw(e,t,i){const[s,n]=i,r=e.resolveVertexValue(t,s),o=e.resolveVertexValue(t,n);if(!(!Ae(r)||!Tc(o)))return We.interpolate(r.map(a=>We.fromString(a)),o).map(a=>a.toString())}function kw(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return hs(n)}function ww(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return Ar(n)}function Nw(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return Fn(n)}function Ew(e,t,i){const[s,n,r]=i,o=e.resolveVertexValue(t,s),a=e.resolveVertexValue(t,n),l=e.resolveVertexValue(t,r),c=e.getPathArray(t),h=`\`$mix\` json operation failed on [${String(o)}, ${String(a)}, ${String(l)}] at [${c.join(".")}], expecting`,u=`${h} two colors and a number between 0 and 1.`;if(typeof a!="string"||!Yg(l)){be.inDevelopmentMode(()=>j.warnOnce(u));return}if(typeof o=="string")try{return We.mix(We.fromString(o),We.fromString(a),l).toString()}catch{be.inDevelopmentMode(()=>j.warnOnce(u));return}if(!hs(o)){be.inDevelopmentMode(()=>j.warnOnce(u));return}let d=o.colorStops;try{d=d?.map(p=>{let g;return typeof p.color=="string"&&(g=We.mix(We.fromString(p.color),We.fromString(a),l).toString()),{...p,color:g}})}catch{be.inDevelopmentMode(()=>j.warnOnce(`${h} a gradient, a color and a number between 0 and 1.`));return}return{...o,colorStops:d}}var Ow={$rem:Pw};function Pw(e,t,i){const[s]=i,n=e.getVertexValue(s),r=e.getParamValue("fontSize");if(typeof r=="number"&&typeof n=="number")return Math.round(n*r);be.inDevelopmentMode(()=>j.warnOnce(`\`$rem\` json operation failed on [${String(n)}] at [${e.getPathArray(t).join(".")}], expecting a number.`))}var Rw={$and:zw,$eq:Fw,$greaterThan:jw,$if:Bw,$lessThan:Vw,$not:Gw,$or:_w,$switch:Hw};function zw(e,t,i){for(const s of i)if(!e.resolveVertexValue(t,s))return!1;return!0}function Fw(e,t,i){let s,n=!0;for(const r of i){const o=e.resolveVertexValue(t,r);if(n)s=o,n=!1;else if(o!==s)return!1}return!0}function jw(e,t,i){const[s,n]=i;return e.resolveVertexValue(t,s)>e.resolveVertexValue(t,n)}function Bw(e,t,i){const[s,n,r]=i,a=e.resolveVertexValue(t,s)?n:r,l=e.neighboursWithEdgeValue(a,$t);if(l)for(const c of l)e.addEdge(t,c,$t);return e.resolveVertexValue(t,a)}function Vw(e,t,i){const[s,n]=i;return e.resolveVertexValue(t,s)<e.resolveVertexValue(t,n)}function Gw(e,t,i){for(const s of i)return!e.resolveVertexValue(t,s)}function _w(e,t,i){for(const s of i)if(e.resolveVertexValue(t,s))return!0;return!1}function Hw(e,t,i){const[s,n,...r]=i,o=e.resolveVertexValue(t,s);for(const a of r){const l=e.getVertexValue(a);if(!Array.isArray(l))continue;const[c,h]=l;if(o===c||Array.isArray(c)&&c.includes(o))return h}return e.getVertexValue(n)}var Uw={$isUserOption:$w,$isThemeOverride:Ww,$palette:Yw,$mapPalette:Kw,$path:{dependencies:$v,resolve:Zw},$pathString:{dependencies:$v,resolve:Xw},$ref:qw};function $w(e,t,i){const[s,n,r]=i,o=e.neighboursWithEdgeValue(s,$t);if(o)for(const a of o){const l=e.findNeighbour(a,Wt);if(l&&Hv(e,t,l))return e.resolveVertexValue(t,n)}else if(Hv(e,t,s))return e.resolveVertexValue(t,n);return e.resolveVertexValue(t,r)}function Hv(e,t,i){const s=e.resolveVertexValue(t,i);if(!Bt(s))throw new Error(`\`$isUserOption\` json operation failed on [${String(s)}], expecting a string.`);const n=e.getPathArray(t),r=eo(n,s);return r===Zs?!1:e.hasUserOption(r)}function Ww(e,t,i){const[s,n,r]=i,o=e.resolveVertexValue(t,s);if(!Bt(o))throw new Error(`\`$isThemeOverride\` json operation failed on [${String(o)}], expecting a string.`);const a=e.getPathArray(t),l=eo(a,o);if(l!==Zs)return e.hasThemeOverride(l)?e.resolveVertexValue(t,n):e.resolveVertexValue(t,r)}var Uv=new Set(["fill","fillFallback","stroke","gradient","range2"]);function Yw(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);if(!Bt(n))return;if(Uv.has(n)){const o=e.getPathArray(t),a=Jl(o);if(isNaN(a))return;switch(n){case"fill":return Rs(e.palette.fills,1,a)[0];case"fillFallback":return Rs(e.palette.fillsFallback,1,a)[0];case"stroke":return Rs(e.palette.strokes,1,a)[0];case"gradient":return Rs(e.palette.sequentialColors,1,a)[0];case"range2":return Rs(e.palette.fills,2,a)}return}if(n==="gradients")return e.palette.sequentialColors;const r=Is(e.palette,n.split("."));return Array.isArray(r)?[...r]:typeof r=="object"?{...r}:r}function Kw(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);if(!Bt(n))return;if(Uv.has(n)){const o=e.getPathArray(t);let a=Jl(o),l=0;const c=["series","0","type"];for(let h=0;h<a;h++){c[1]=`${h}`;const u=e.getResolvedPath(c);(u==="map-shape-background"||u==="map-line-background")&&l++}if(a-=l,isNaN(a))return;switch(n){case"fill":return Rs(e.palette.fills,1,a)[0];case"fillFallback":return Rs(e.palette.fillsFallback,1,a)[0];case"stroke":return Rs(e.palette.strokes,1,a)[0];case"gradient":return Rs(e.palette.sequentialColors,1,a)[0];case"range2":return Rs(e.palette.fills,2,a)}return}if(n==="gradients")return e.palette.sequentialColors;const r=Is(e.palette,n.split("."));return Array.isArray(r)?[...r]:typeof r=="object"?{...r}:r}function $v(e,t,i){const[s]=i,n=e.getVertexValue(s);if(Bt(n)){const r=e.getPathArray(t),o=eo(r,n);if(o===Zs)return;const a=e.findVertexAtPath(o);a&&e.addEdge(t,a,$g)}}function Zw(e,t,i){const s=i.length>1,n=i.length>2,[r,o,a]=i,l=e.resolveVertexValue(t,r),c=n?e.resolveVertexValue(t,a):null;if(!Bt(l))throw new Error(`\`$path\` json operation failed on [${String(l)}], expecting a string.`);const h=e.getPathArray(t),u=eo(h,l);if(u===Zs)return;const d=c?Is(c,u):e.getResolvedPath(u);if(d!=null)return d;if(s)return e.resolveVertexValue(t,o)}function Xw(e,t,i){const[s,n]=i,r=e.resolveVertexValue(t,s);if(!Bt(r))throw new Error(`\`$path\` json operation failed on [${String(r)}], expecting a string.`);let o;n&&(o=e.graftAndResolveOrphan(t,n));const a=e.getPathArray(t),l=eo(a,r,o);if(l===Zs)throw new Error(`Unresolvable path [${r}] at [${a.join(".")}]`);return l}function qw(e,t,i){const[s]=i,n=e.getVertexValue(s);return e.getParamValue(n)}var Qw={$apply:Jw,$applyTheme:e1,$findFirstSiblingNotOperation:t1,$map:i1,$merge:s1,$omit:n1,$size:r1,$shallow:o1,$value:a1};function Jw(e,t,i){const[s,n,r,o]=i,a=e.getVertexValue(s);if(!Ne(a))return;const l=n?e.getVertexValue(n):void 0,c=e.neighboursWithEdgeValue(t,$t),h=r?e.resolveVertexValue(t,r):void 0,u=o?e.resolveVertexValue(t,o):void 0;if((!c||c.length===0)&&l!=null)if(fa(l)){const d=e.resolveVertexValue(t,n);Ne(d)&&e.graftObject(t,d,[h,u])}else e.graftObject(t,l,[h,u]);if(!c)return or;for(const d of c){const p=e.neighboursWithEdgeValue(d,$t);if(!p||p.length===0){const g=e.addVertex({});e.addEdge(d,g,Wt)}else e.graftObject(d,a,[h,u])}return or}function e1(e,t,i){const[s,n,r]=i;let o=e.getVertexValue(s);if(typeof o=="string"&&(o=[o]),!Array.isArray(o))return;const a=e.neighboursWithEdgeValue(t,$t),l=r?e.getVertexValue(r):[],c=Array.isArray(l)?new Set(l):new Set;if(!a)return or;for(const h of a){const u=e.graftAndResolveOrphan(h,n);for(const d of o){const p=eo([],d,u);p!==Zs&&e.graftConfig(h,p,c)}}return or}function t1(e,t,i){const[s]=i,n=e.getPathArray(t),r=_v(n);if(r<0)return e.resolveVertexValue(t,s);const o=n.slice(0,r),a=e.findVertexAtPath(o);if(!a)return e.resolveVertexValue(t,s);const l=e.neighboursWithEdgeValue(a,$t);if(l)for(let c=0;c<l.length;c++){if(`${c}`===n[r])continue;const h=o.concat([`${c}`,...n.slice(r+1)]),u=e.findVertexAtPath(h);if(!u)continue;const d=e.findNeighbourValue(u,ga);if(d!=null)return d;const p=e.findNeighbourValue(u,Ds);if(p!=null)return p}return e.resolveVertexValue(t,s)}function i1(e,t,i){const[s,n]=i,r=e.getVertexValue(s),o=e.resolveVertexValue(t,n);if(!Array.isArray(o))return;if(!fa(r))return o.map(()=>r);let a=0;for(const l of o)e.graftValue(t,`${a}`,r,l),a++;return or}function s1(e,t,i){for(const s of i){const n=e.resolveVertexValue(t,s);Ne(n)&&e.graftObject(t,n)}return or}function n1(e,t,i){const[s,n]=i;let r=e.getVertexValue(s);if(!Array.isArray(r)){const a=vw(e,t,n);if(!a)return;r=e.resolveVertexValue(a,s)}const o=e.resolveVertexValue(t,n);if(!(!Array.isArray(r)||!Ne(o)))return V(o,r)}function r1(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return Lc(n)?Object.keys(n).length:0}function o1(e,t,i){const s=[];for(const n of i)s.push(e.getVertexValue(n));return s}function a1(e,t,i){const[s]=i,n=e.getVertexValue(s),r=e.getPathArray(t);if(n==="$index")return Jl(r);if(n==="$1")return e.resolveValue$1(r)}var l1={$isEven:c1,$mul:h1,$round:u1};function c1(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return isNaN(Number(n))?!1:Number(n)%2===0}function h1(e,t,i){let s;for(const n of i){const r=e.resolveVertexValue(t,n);s==null?s=Number(r):s*=Number(r)}return s}function u1(e,t,i){for(const s of i)return Math.round(Number(e.resolveVertexValue(t,s)))}var ec={...Mw,...Aw,...Ow,...Uw,...Rw,...l1,...Qw},Wv=new Set(Object.keys(ec));function tc(e){return Wv.has(e)}var d1=Jt(p1);function p1(e,t){return new Yv(e.config,t,e.params,e.palette,e.overrides,e.getTemplateParameters())}var ic=class Cs extends rI{constructor(t={},i={},s=void 0,n=void 0,r={},o=new Map){super($t,Xl),this.config=t,this.userOptions=i,this.overrides=r,this.internalParams=o,this.resolvedParams={},this.resolvedAnnotations={},this.value$1={},this.cachedPathVertices=new Map,this.EMPTY_PATH_ARRAY_VERTEX=this.addVertex([]),this.root=this.addVertex("root"),this.params=this.addVertex("params"),this.annotations=this.addVertex("annotations"),this.config=t,this.overrides=r,this.internalParams=o,this.palette=n?lt(n):{},this.palette.type=ot(i?.theme)?l0(i.theme?.palette):"inbuilt";const a="line",l=i.series?.[0]?.type??a,c=ps.cloneDefaultAxes(l);i.axes??(i.axes=c?.axes??[]),this.buildGraphFromObject(this.root,ga,V(i,["theme"])),this.buildGraphFromObject(this.root,Wt,V(t[l],Cs.COMPLEX_KEYS));const h=r?V(r[l],Cs.COMPLEX_KEYS):{};Object.keys(h).length>0&&this.buildGraphFromObject(this.root,Ds,h);const u=r?V(r.common,Cs.COMPLEX_KEYS):{};Object.keys(u).length>0&&this.buildGraphFromObject(this.root,Ds,Ht.isCartesian(l)?u:V(u,["zoom","navigator"])),s&&this.buildGraphFromObject(this.params,Wt,s);const d=this.findNeighbourWithValue(this.root,"axes",$t),p=this.findNeighbourWithValue(this.root,"series",$t);d&&this.buildGraphFromObject(d,Wt,{$applyTheme:[["/$seriesType/axes/$axisType/$position","/$seriesType/axes/$axisType"],{seriesType:{$path:["/series/0/type","line"]},axisType:{$path:["./type","category"]},position:{$path:["./position"]}},["top","right","bottom","left"]]}),p&&this.buildGraphFromObject(p,Wt,{$applyTheme:["/$seriesType/series",{seriesType:{$path:["./type","line"]}}]});const g=V(t[l]?.annotations??{},Cs.ANNOTATIONS_OPTIONS_KEYS);Object.keys(g).length>0&&this.buildGraphFromObject(this.annotations,Wt,g);const m=V(r?.common?.annotations??{},Cs.ANNOTATIONS_OPTIONS_KEYS);Object.keys(m).length>0&&this.buildGraphFromObject(this.annotations,Ds,m);const b=kd(t[l]?.annotations??{},Cs.ANNOTATIONS_OPTIONS_KEYS);Object.keys(b).length>0&&this.buildGraphFromObject(this.root,Wt,{annotations:b});const y=kd(r?.common?.annotations??{},Cs.ANNOTATIONS_OPTIONS_KEYS);Object.keys(y).length>0&&this.buildGraphFromObject(this.root,Ds,{annotations:y}),this.buildDependencyGraph()}clear(){super.clear(),this.cachedPathVertices.clear()}resolve(){return this.resolved={},this.resolvedParams={},this.resolvedAnnotations={},this.resolveVertex(this.params,this.resolvedParams),this.resolveVertex(this.annotations,this.resolvedAnnotations),this.resolveVertex(this.root),this.resolved}resolveParams(){return this.resolvedParams}resolveAnnotationThemes(){return this.resolvedAnnotations}findVertexAtPath(t){const i=t.join(".");if(this.cachedPathVertices.has(i))return this.cachedPathVertices.get(i);const s=this.findVertexAlongEdge(this.root,t,$t);if(s)return this.cachedPathVertices.set(i,s),s}hasUserOption(t){return Ql(this.userOptions,t)}hasThemeOverride(t){if(t[0]==="axes"&&t.length>1){const i=this.getResolvedPath(["axes",t[1],"type"]);if(Ql(this.overrides,["common","axes",i,...t.slice(2)]))return!0;const s=this.getResolvedPath(["series","0","type"]);return Ql(this.overrides,[s,"axes",i,...t.slice(2)])}if(t[0]==="series"&&t.length>1){const i=this.getResolvedPath(["series",t[1],"type"]);return Ql(this.overrides,[i,"series",...t.slice(2)])}return Ql(this.overrides,t)}getParamValue(t){if(this.resolvedParams[t]!=null)return this.resolvedParams[t];const i=this.findVertexAlongEdge(this.params,[t],$t);if(!i)return;const s=this.findNeighbour(i,Wt);if(!s)return;const n=this.resolveVertexValue(i,s);return this.resolvedParams[t]=n,n}getPathArray(t){return this.findNeighbourValue(t,Ss)??[]}getResolvedPath(t){return Is(this.resolved,t)}resolveVertexValue(t,i){this.resolveVertexDependencies(i);const s=this.findNeighbourValue(i,Xl);if(s&&tc(s)){const r=this.neighboursWithEdgeValue(i,ql),o=ec[s],l=(typeof o=="function"?o:o.resolve)?.(this,t,r??[]);return l===or?void 0:l}let n=this.getVertexValue(i);if(Array.isArray(n)){const r={};this.resolveVertexChildren(i,r),n=Is(r,this.getPathArray(t))}return this.resolveValueOrSymbol(n)}resolveValue$1(t){return Is(this.value$1,t)}graftConfig(t,i,s){const n=Is(this.config,i),r=this.findNeighbour(t,Ss);if(Ne(n)&&this.buildGraphFromObject(t,Wt,n,r,void 0,s),this.overrides){const o=Is(this.overrides,i);Ne(o)&&this.buildGraphFromObject(t,Ds,o,r,void 0,s);const a=Is(this.overrides,["common",...i.slice(1)]);Ne(a)&&this.buildGraphFromObject(t,Ds,a,r,void 0,s)}this.buildDependencyGraph()}graftObject(t,i,s){const n=this.findNeighbour(t,Ss);if(this.buildGraphFromObject(t,Wt,i,n),this.overrides&&s)for(const r of s){if(r==null)continue;const o=Is(this.overrides,r);o&&this.buildGraphFromObject(t,Ds,o,n)}this.buildDependencyGraph()}graftValue(t,i,s,n){const r=[...this.getPathArray(t),i];Kg(this.value$1,r,n);const o=this.findVertexAtPath(r)??this.addVertex(i);this.buildGraphFromValue(t,o,Wt,r,s),this.buildDependencyGraph()}graftAndResolveOrphan(t,i){const s={},n=this.addVertex(s),r=this.getPathArray(t);return this.graftAndResolveChildren(i,n,r,[]),this.resolveVertex(n,s),Is(s,r)}buildGraphFromObject(t,i,s,n,r=Cs.SHALLOW_KEYS,o){const a=Object.keys(s),l=fa(s,a);if(l){const g=this.addVertex(s);this.addEdge(t,g,i),this.buildGraphFromOperation(g,i,l,n);return}if(a.length===0){this.addEdge(t,this.addVertex(Array.isArray(s)?[]:{}),i),this.buildGraphAutoEnable(t,i,s,void 0);return}const c=this.getVertexChildrenByKey(t),h=n?this.getVertexValue(n):[];let u;const d=[...h],p=h.length;for(const g of a){if(o?.has(g))continue;const m=c?.get(g)??this.addVertex(g);d[p]=g,r?.has(g)?this.buildShallowGraphFromValue(t,m,i,d,s[g]):this.buildGraphFromValue(t,m,i,d,s[g],r),g==="enabled"&&(u=m)}this.buildGraphAutoEnable(t,i,s,u)}buildGraphAutoEnable(t,i,s,n){if(i===Wt&&!n||i===ga&&n||i!==Wt&&i!==ga&&i!==Ds)return;let r=this.findNeighbour(t,Wg);r||(r=this.addVertex(Wg),this.addEdge(t,r,Wg)),n&&this.addEdge(n,r,Gv);const{enabled:o,_enabledFromTheme:a}=s;this.addEdge(r,this.addVertex({enabled:o,_enabledFromTheme:a,keys:Object.keys(s).length}),i)}getVertexChildrenByKey(t){const i=this.neighboursWithEdgeValue(t,$t);if(!i)return;const s=new Map;for(const n of i)s.set(this.getVertexValue(n),n);return s}buildGraphFromValue(t,i,s,n,r,o){this.addEdge(t,i,$t);let a=this.findNeighbour(i,Ss);a||(a=this.addVertex([...n]),this.addEdge(i,a,Ss));const l=fa(r);if(l){const c=this.addVertex(r);this.addEdge(i,c,s),this.addEdge(c,a,Ss),this.buildGraphFromOperation(c,s,l,a)}else if(Lc(r))this.buildGraphFromObject(i,s,r,a,o);else{const c=this.addVertex(r);this.addEdge(i,c,s)}}buildShallowGraphFromValue(t,i,s,n,r){this.addEdge(t,i,$t);let o=this.findNeighbour(i,Ss);o||(o=this.addVertex([...n]),this.addEdge(i,o,Ss));const a=this.addVertex(r);this.addEdge(i,a,s)}buildGraphFromOperation(t,i,s,n){const r=this.addVertex(s.operation);this.addEdge(t,r,Xl);for(const o of s.values)this.buildGraphFromOperationValue(t,o,i,n)}buildGraphFromOperationValue(t,i,s,n=this.EMPTY_PATH_ARRAY_VERTEX){const r=this.addVertex(i);this.addEdge(t,n,Ss),this.addEdge(t,r,ql);const o=fa(i);o?this.buildGraphFromOperation(r,s,o,n):Lc(i)&&this.buildGraphFromObject(r,s,i,n)}buildDependencyGraph(){for(let t=0;t<this.pendingProcessingEdgesFrom.length;t++){const i=this.pendingProcessingEdgesFrom[t],s=this.pendingProcessingEdgesTo[t],n=this.getVertexValue(s);if(!tc(n))continue;const r=this.neighboursWithEdgeValue(i,ql),o=ec[n];(typeof o=="function"?void 0:o.dependencies)?.(this,i,r??[])}this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[]}resolveVertex(t,i=this.resolved){const s=this.getPathArray(t);this.resolveVertexInEdgePriority(t,i,s),this.resolveVertexAutoEnable(t,i,s),this.resolveVertexChildren(t,i)}resolveVertexInEdgePriority(t,i,s){const n=this.neighboursWithEdgeValue(t,$t),[r]=Cs.EDGE_PRIORITY;for(const o of Cs.EDGE_PRIORITY){const a=this.findNeighbour(t,o);if(a==null)continue;const l=this.resolveVertexValueInternal(t,a);if(!(l==null&&o!==r)&&!(n&&n.length>0&&Array.isArray(l)&&o!==r)){if(s.length===0){if(l==null)continue;this.resolved=l}else Kg(i,s,l);break}}}resolveVertexValueInternal(t,i){this.resolveVertexDependencies(i);const s=this.findNeighbourValue(i,Xl);if(s&&tc(s)){const n=this.neighboursWithEdgeValue(i,ql),r=ec[s],a=(typeof r=="function"?r:r.resolve)?.(this,t,n??[]);return a===or?void 0:a}return this.resolveValueOrSymbol(this.getVertexValue(i))}resolveVertexAutoEnable(t,i,s){const n=this.neighboursWithEdgeValue(t,Gv)?.[0];if(!n)return;const r=this.findNeighbourValue(n,Wt),o=this.findNeighbourValue(n,Ds),a=this.findNeighbourValue(n,ga);a&&a.enabled==null&&!r?._enabledFromTheme&&!o?._enabledFromTheme&&Kg(i,s,!0)}resolveVertexChildren(t,i){const s=this.neighboursWithEdgeValue(t,$t);if(s)for(const n of s){const r=this.getVertexValue(n);s.length>1&&tc(r)||r!=="_enabledFromTheme"&&this.resolveVertex(n,i)}}resolveVertexDependencies(t){const i=this.neighboursWithEdgeValue(t,$g);if(i)for(const s of i)this.resolveVertex(s)}graftAndResolveChildren(t,i,s,n){const r=this.neighboursWithEdgeValue(t,$t);if(r)for(const o of r){const a=this.getVertexValue(o),l=[...s,a],c=[...n,a],h=this.addVertex(a),u=this.findNeighbourValue(o,Wt);this.addEdge(i,h,$t);const d=this.addVertex(l);if(this.addEdge(h,d,Ss),Ne(u)){this.buildGraphFromObject(h,Wt,u,d);const p=this.findNeighbour(h,Wt);this.addEdge(p,this.addVertex(l),Ss);const g=this.findNeighbourValue(p,Xl);if(tc(g)){const m=this.neighboursWithEdgeValue(p,ql),b=ec[g];(typeof b=="function"?void 0:b.dependencies)?.(this,p,m??[])}}this.graftAndResolveChildren(o,h,l,c)}}resolveValueOrSymbol(t){return typeof t=="symbol"&&this.internalParams?.has(t)?this.internalParams.get(t):t}};ic.EDGE_PRIORITY=[ga,Ds,Wt],ic.SHALLOW_KEYS=new Set(["context","data","topology"]),ic.COMPLEX_KEYS=["annotations","axes","series"],ic.ANNOTATIONS_OPTIONS_KEYS=["axesButtons","data","enabled","optionsToolbar","snap","toolbar","xKey","volumeKey"];var Yv=ic,Kv=e=>`'${e}'`,to=class Xt{constructor(t,i,s,n,r,o,a=!1,l){this.themeParameters={},this.optionMetadata=r??{},this.processedOverrides=s??{};let c=null;t instanceof Xt?(c=t,this.specialOverrides=c.specialOverrides,o===void 0&&(o=hn(c.userOptions,i,Xt.JSON_DIFF_OPTS)),this.userOptions=lt(Va(o,c.userOptions),{...Xt.OPTIONS_CLONE_OPTS_SLOW,seen:[]})):(this.userOptions=lt(t??i,{...Xt.OPTIONS_CLONE_OPTS_SLOW,seen:[]}),this.specialOverrides=this.specialOverridesDefaults({...n})),a&&this.removeLeftoverSymbols(this.userOptions);let h,u,d,p,g,m;if(!a&&o!==void 0&&Xt.isFastPathDelta(o)&&c!=null?({activeTheme:h,processedOptions:u,fastDelta:d}=this.fastSetup(o,c),p=c.themeParameters,g=c.annotationThemes):(Xt.perfDebug("ChartOptions.slowSetup()"),{activeTheme:h,processedOptions:u,themeParameters:p,annotationThemes:g,googleFonts:m}=this.slowSetup(s,o,a)),this.activeTheme=h,this.processedOptions=u,this.fastDelta=d??void 0,this.themeParameters=p,this.annotationThemes=g,this.googleFonts=m,l!==void 0&&typeof l=="number"&&!isNaN(l)){const b=performance.now();this.optionsProcessingTime=b-l}be.inDevelopmentMode(()=>on(this))}static isFastPathDelta(t){for(const i of Object.keys(t??{}))if(!this.FAST_PATH_OPTIONS.has(i))return Xt.perfDebug("ChartOptions.isFastPathDelta() - slow path required due to presence of: ",i),!1;return Xt.perfDebug("ChartOptions.isFastPathDelta() - fast path possible."),!0}fastSetup(t,i){const{activeTheme:s,processedOptions:n}=i,{presetType:r}=this.optionMetadata;if(r!=null&&t?.data!=null){const a=bi.getPresetModule(r);if(a?.processData){const{series:l,data:c}=a.processData(t.data);t=Ee({series:l,data:c},t)}}this.fastSeriesSetup(t,n);const o=Ee(t,n);return Xt.debug("ChartOptions.fastSetup() - processed options",o),{activeTheme:s,processedOptions:o,fastDelta:t}}fastSeriesSetup(t,i){t?.series&&(t.series?.every((s,n)=>Ly(s,i.series?.[n]??{}))?delete t.series:t.series=t.series.map((s,n)=>Va(s,i.series?.[n]??{})))}slowSetup(t,i,s=!1){let n=lt(this.userOptions,Xt.OPTIONS_CLONE_OPTS_FAST);i&&(n=Ee(i,n),s&&this.removeLeftoverSymbols(n));const{presetType:r}=this.optionMetadata;if(r!=null){const p=bi.getPresetModule(r);if(p){const{validate:g=ci}=p,m=n,b=n.type,y=b!=null?Du(n.theme).presets[b]:void 0,{cleared:v,invalid:M}=g(m,p.options,"");M.forEach(S=>j.warn(S)),fo(M,"")?n={}:(Xt.debug(">>> AgCharts.createOrUpdate() - applying preset",v),n=p.create(v,y,()=>this.activeTheme))}}this.soloSeriesIntegrity(n),rr.isEnterprise||a0(n);const o=Du(n.theme);if(r!=null&&o.templateTheme(n,!1),this.validateSeriesOptions(n),this.chartDef=bi.detectChartDefinition(n),!this.chartDef.placeholder){const{validate:p=ci}=this.chartDef,{cleared:g,invalid:m}=p(n,this.chartDef.options,"");m.forEach(b=>j.warn(b)),n=g}this.validateAxesOptions(n),this.removeDisabledOptions(n);let a=this.processFonts(o.params);a=this.processFonts(n,a),this.processSeriesOptions(n);const l=d1(o,n),c=l.resolve(),h=l.resolveParams(),u=l.resolveAnnotationThemes();l.clear();const d=Ee(t,c);return ek(d),rr.isEnterprise||a0(d,!0),this.validateSeriesOptions(d),this.validateAxesOptions(d),this.validatePluginOptions(d),this.processMiniChartSeriesOptions(d),d.loadGoogleFonts||a.clear(),Xt.debug(()=>["ChartOptions.slowSetup() - processed options",lt(d)]),{activeTheme:o,processedOptions:d,themeParameters:h,annotationThemes:u,googleFonts:a}}validatePluginOptions(t){for(const i of bi.listModulesByType("plugin")){const s=i.name;if(s in t&&(!i.chartType||i.chartType===this.chartDef?.name)){const{cleared:n,invalid:r}=ci(t[s],i.options,i.name);r.forEach(o=>j.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=bi.getSeriesModule(l.type);if(c==null){r??(r=Ea(Array.from(bi.listModulesByType("series")).filter(p=>!i||p.chartType===i).map(p=>p.name),"or",Kv)),j.warn(l.type==null?`Option \`${a}.type\` is required and has not been provided; expecting ${r}, ignoring.`:`Unknown type \`${l.type}\` at \`${a}.type\`; expecting ${r}, ignoring.`);continue}else if(i&&c.chartType!==i){j.warn(`Series type \`${c.name}\` at \`${a}.type\` is not supported by chart type \`${i}\`, ignoring.`);continue}const{validate:h=ci}=c,{cleared:u,invalid:d}=h(l,c.options,a);d.forEach(p=>j.warn(p)),fo(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}]`,l=t.axes[o],c=bi.getAxisModule(l.type);if(c==null){r??(r=Ea(Array.from(bi.listModulesByType("axis")).filter(p=>p.chartType===i).map(p=>p.name),"or",Kv)),j.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){j.warn(`Axis type \`${c.name}\` at  \`${a}.type\` is not supported by chart type \`${i}\`, ignoring.`);break}const{validate:h=ci}=c,{cleared:u,invalid:d}=h(l,c.options,a);d.forEach(p=>j.warn(p)),fo(d,a)||s.push(u)}t.axes=s}diffOptions(t){return this===t?{}:t==null?this.processedOptions:this.fastDelta??hn(t.processedOptions,this.processedOptions,Xt.JSON_DIFF_OPTS)}optionsType(t){return t.series?.[0]?.type??"line"}processSeriesOptions(t){const i=t.series?.map(s=>{s.type??(s.type="line");const r=!!bi.getSeriesModule(s.type)?.options.visible;return Ee(this.getSeriesGroupingOptions(s),s,r&&{visible:!0})});t.series=this.setSeriesGroupingOptions(i??[])}processMiniChartSeriesOptions(t){const i=t.navigator?.miniChart?.series;i!=null&&(t.navigator.miniChart.series=this.setSeriesGroupingOptions(i))}getSeriesGroupingOptions(t){const i=ps.isGroupable(t.type),s=ps.isStackable(t.type),n=ps.isStackedByDefault(t.type);t.grouped&&!i&&j.warnOnce(`unsupported grouping of series type "${t.type}".`),(t.stacked||t.stackGroup)&&!s&&j.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);Xt.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},[])}soloSeriesIntegrity(t){if(!Ae(t.series))return;const i=t.series;if(i&&i.length>1&&i.some(s=>ps.isSolo(s.type))){const s=this.optionsType(t);if(ps.isSolo(s))j.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}=bd(i,a=>ps.isSolo(a.type)?"solo":"nonSolo"),o=_D(n.map(a=>a.type)).join(", ");j.warn(`Unable to mix these series types with the lead series type: ${o}`),t.series=r}}}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 Bn(t,Xt.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){Bn(t,Xt.removeDisabledOptionJson,new Set(["data","theme","contextMenu"]))}static removeLeftoverSymbolsJson(t){if(!(!t||!ot(t)))for(const i of Object.keys(t)){const s=t[i];kc(s)&&delete t[i]}}removeLeftoverSymbols(t){Bn(t,Xt.removeLeftoverSymbolsJson,new Set(["data"]))}specialOverridesDefaults(t){if(t.window==null?t.window=Fe():vD(t.window),t.document==null?t.document=ws():xD(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}};to.OPTIONS_CLONE_OPTS_SLOW={shallow:new Set(["data","container"]),assign:new Set(["context","theme"])},to.OPTIONS_CLONE_OPTS_FAST={shallow:new Set(["container"]),assign:new Set(["data","context","theme"])},to.JSON_DIFF_OPTS=new Set(["data"]),to.perfDebug=be.create(!0,"perf"),to.FAST_PATH_OPTIONS=new Set(["data","width","height","container"]),to.debug=be.create(!0,"opts");var sc=to,Zv=be.create(!0,"opts"),io="AG Charts - Chart was destroyed, cannot perform request.",nc=class{constructor(t,i,s){this.factoryApi=i,this.licenseManager=s,this.chart=t}async update(t){if(!this.chart)throw new Error(io);return Zv.group("AgChartInstance.update()",async()=>{const i=be.check("scene:stats","scene:stats:verbose")?performance.now():void 0;this.factoryApi.update(t,this,void 0,i),await this.chart?.waitForUpdate()})}async updateDelta(t){if(!this.chart)throw new Error(io);return Zv.group("AgChartInstance.updateDelta()",async()=>{const i=be.check("scene:stats","scene:stats:verbose")?performance.now():void 0;this.factoryApi.updateUserDelta(this,t,i),await this.chart?.waitForUpdate()})}getOptions(){if(!this.chart)throw new Error(io);const t=lt(this.chart.getOptions(),sc.OPTIONS_CLONE_OPTS_FAST);for(const i of Object.keys(t))i.startsWith("_")&&delete t[i];return t}waitForUpdate(){if(!this.chart)throw new Error(io);return this.chart.waitForUpdate()}async download(t){if(!this.chart)throw new Error(io);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(io);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(io);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=js.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=await this.chart?.ctx.dataService.getData(),p=this.factoryApi.create(c,l,h,u,d);await p.setState(o),p.chart?.ctx.zoomManager.updateZoom("chartProxy",i.ctx.zoomManager.getZoom()),p.chart?.ctx.legendManager.clearData(),p.chart?.ctx.legendManager.update(i.ctx.legendManager.getData()),i.series.forEach((m,b)=>{p.chart.series[b].visible=m.visible});const g=[];for(const m of i.modulesManager.legends())g.push(m.legend.pagination?.currentPage??0);for(const m of p.chart.modulesManager.legends()){const b=g.shift()??0;m.legend.pagination&&m.legend.pagination.setPage(b)}return p.chart?.update(0,{forceNodeDataRefresh:!0}),await p.waitForUpdate(),p}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()}};nc.chartInstances=new WeakMap,f([ui({oldValue(e){e.destroyed||(e.publicApi=void 0),nc.chartInstances.delete(e)},newValue(e){e&&(e.publicApi=this,nc.chartInstances.set(e,this))}})],nc.prototype,"chart",2);var Xv=nc,Xg=class extends Gc{constructor(e){super(),this.ctx=e,this.localeText=void 0}};f([Vn(e=>{e.ctx.localeManager.setLocaleText(e.localeText)}),x],Xg.prototype,"localeText",2),f([Vn(e=>{e.ctx.localeManager.setLocaleTextFormatter(e.getLocaleText)}),x],Xg.prototype,"getLocaleText",2);var g1={type:"root",optionsKey:"locale",packageType:"community",chartTypes:["cartesian","polar","topology","standalone"],moduleFactory:e=>new Xg(e)},ma=class extends Gc{constructor(e){super(),this.ctx=e,this.rectNode=new Et,this.textNode=new Oi,this.fill="white",this.node=this.createNode(),this.node.append([this.rectNode,this.textNode]),this.visible=!0,this.cleanup.register(e.scene.attachNode(this.node),e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)))}createNode(){return new ge({name:"background",zIndex:0})}onLayoutComplete(e){const{width:t,height:i}=e.chart;this.rectNode.width=t,this.rectNode.height=i}};f([x,Dt("node","visible")],ma.prototype,"visible",2),f([x,Dt("rectNode","fill")],ma.prototype,"fill",2),f([x],ma.prototype,"image",2),f([x,Dt("textNode")],ma.prototype,"text",2);var qv={type:"root",optionsKey:"background",packageType:"community",chartTypes:["cartesian","polar","topology","standalone"],moduleFactory:e=>new ma(e)},so=class extends re{constructor(e){super(),this.node=e,this.enabled=!1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=1}};f([ui({changeValue(e){e?this.node.strokeWidth=this.strokeWidth:this.node.strokeWidth=0}}),x],so.prototype,"enabled",2),f([Dt("node","stroke"),x],so.prototype,"stroke",2),f([Dt("node","strokeOpacity"),x],so.prototype,"strokeOpacity",2),f([ui({changeValue(e){this.enabled?this.node.strokeWidth=e:this.node.strokeWidth=0}}),x],so.prototype,"strokeWidth",2);function f1({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=m1(d,h,l,c,o);if(!p)return;h+=p.processedBBoxCount,u.push(p.pageIndices)}return b1(u,e,t,n,r)}function m1(e,t,i,s,n){let o=v1(e,i);if(o<1){if(!n)return;o=1}let a=o;for(;a>=1;){const l=y1(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 y1(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 g=a+l,m=!r||o.length>0;if(g>n.max&&m){c=[];break}if(h.reduce((y,v)=>y+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 b1(e,t,i,s,n){let r=0,o=0;return{pages:e.map(l=>{t==="horizontal"&&(l=x1(l));let c=0;const h=l.map(p=>{const g=p.map(y=>(c=Math.max(y,c),i[y]));let m=0,b=0;return g.forEach(y=>{m+=y.height+s,b=Math.max(b,y.width+n)}),{indices:p,bboxes:g,columnHeight:Math.ceil(m),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 x1(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 v1(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 ya=class extends re{constructor(){super(...arguments),this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};f([x],ya.prototype,"color",2),f([x],ya.prototype,"fontStyle",2),f([x],ya.prototype,"fontWeight",2),f([x],ya.prototype,"fontSize",2),f([x],ya.prototype,"fontFamily",2);var Ln=class extends re{constructor(){super(...arguments),this.size=15,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=1,this.strokeOpacity=1}};f([x],Ln.prototype,"size",2),f([x],Ln.prototype,"fill",2),f([x],Ln.prototype,"fillOpacity",2),f([x],Ln.prototype,"stroke",2),f([x],Ln.prototype,"strokeWidth",2),f([x],Ln.prototype,"strokeOpacity",2);var Iu=class extends re{constructor(e){super(),this.parent=e,this.shape="triangle",this.size=15,this.padding=8}};f([ui({changeValue(){this.parent.marker===this&&this.parent.onMarkerShapeChange()}})],Iu.prototype,"shape",2),f([x],Iu.prototype,"size",2),f([x],Iu.prototype,"padding",2);var no=class extends re{constructor(e,t){super(),this.chartUpdateCallback=e,this.pageUpdateCallback=t,this.id=cs(this),this.marker=new Iu(this),this.activeStyle=new Ln,this.inactiveStyle=new Ln,this.highlightStyle=new Ln,this.label=new ya,this.group=new hi({name:"pagination"}),this.labelNode=new Oi,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 Pt,this.previousButton=new Pt,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=se(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=dt.toCanvas(this.previousButton),t=dt.toCanvas(this.nextButton);return{prev:e,next:t}}};no.className="Pagination",f([x],no.prototype,"marker",2),f([x],no.prototype,"activeStyle",2),f([x],no.prototype,"inactiveStyle",2),f([x],no.prototype,"highlightStyle",2),f([x],no.prototype,"label",2);var M1=class{constructor(e,t){this.dirty=!0,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"}}),this.itemDescription=ve("p"),this.itemDescription.style.display="none",this.itemDescription.id=Bc(),this.itemDescription.textContent=this.getItemAriaDescription(e.localeManager),this.itemList.getElement().append(this.itemDescription)}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=dt.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}=dt.toCanvas(o),p=(r-u)/2,g={x:c-n.x,y:h-p-n.y,height:r,width:d},m=s&&l;o.proxyButton.setCursor("pointer"),o.proxyButton.setEnabled(m),o.proxyButton.setPointerEvents(m?void 0:"none"),o.proxyButton.setBounds(g)}})}updatePaginationProxyButtons(e,t){const{pagination:i}=e;if(this.paginationGroup.setHidden(!i.visible),t&&"ctx"in e){const{ctx:s,oldPages:n,newPages:r}=e,o=(n?.length??r.length)>1,a=r.length>1;o!==a&&(a?(this.prevButton=s.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPagePrevious"},tabIndex:0,parent:this.paginationGroup}),this.prevButton.addListener("click",l=>this.onPageButton(e,l,"previous")),this.prevButton.addListener("mouseenter",()=>i.onMouseHover("previous")),this.prevButton.addListener("mouseleave",()=>i.onMouseHover(void 0)),this.nextButton??(this.nextButton=s.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPageNext"},tabIndex:0,parent:this.paginationGroup})),this.nextButton.addListener("click",l=>this.onPageButton(e,l,"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)),this.paginationGroup.setAriaHidden(a?void 0:!0)}if(this.prevButton&&this.nextButton){const{prev:s,next:n}=i.computeCSSBounds(),r=U.merge([s,n]);s.x-=r.x,s.y-=r.y,n.x-=r.x,n.y-=r.y,this.paginationGroup.setBounds(r),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 Qv(e,{itemId:t,seriesId:i,label:{text:s}},n){const r={defaultPrevented:!1,apiEvent:{type:e,itemId:t,seriesId:i,text:s,event:n,preventDefault:()=>r.defaultPrevented=!0}};return r}var Ji=class extends hi{constructor(){super({name:"markerLabelGroup"}),this.symbolsGroup=this.appendChild(new ge({name:"legend-markerLabel-symbols"})),this.label=this.appendChild(new Oi),this.enabled=!0,this.pageIndex=NaN,this.spacing=0,this.length=0,this.isCustomMarker=!1,this.marker=this.symbolsGroup.appendChild(new Pt({zIndex:1})),this.line=this.symbolsGroup.appendChild(new zi({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=Pt.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()}};Ji.className="MarkerLabel",f([Dt("label")],Ji.prototype,"text",2),f([Dt("label")],Ji.prototype,"fontStyle",2),f([Dt("label")],Ji.prototype,"fontWeight",2),f([Dt("label")],Ji.prototype,"fontSize",2),f([Dt("label")],Ji.prototype,"fontFamily",2),f([Dt("label","fill")],Ji.prototype,"color",2),f([Vn(e=>e.layoutLabel())],Ji.prototype,"spacing",2),f([Vn(e=>e.layoutLabel())],Ji.prototype,"length",2),f([F()],Ji.prototype,"isCustomMarker",2);function Au(e){const{placement:t="bottom",floating:i=!1,xOffset:s=0,yOffset:n=0}=typeof e=="string"?{placement:e,floating:!1}:e;return{placement:t,floating:i,xOffset:s,yOffset:n}}var ar=class extends re{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"}};f([x],ar.prototype,"maxLength",2),f([x],ar.prototype,"color",2),f([x],ar.prototype,"fontStyle",2),f([x],ar.prototype,"fontWeight",2),f([x],ar.prototype,"fontSize",2),f([x],ar.prototype,"fontFamily",2),f([x],ar.prototype,"formatter",2);var ba=class extends re{constructor(){super(...arguments),this.shape=void 0,this.size=15,this.padding=8}};f([x],ba.prototype,"shape",2),f([x],ba.prototype,"size",2),f([x],ba.prototype,"padding",2),f([x],ba.prototype,"strokeWidth",2),f([x],ba.prototype,"enabled",2);var qg=class extends re{};f([x],qg.prototype,"strokeWidth",2),f([x],qg.prototype,"length",2);var lr=class extends re{constructor(){super(...arguments),this.paddingX=16,this.paddingY=8,this.showSeriesStroke=!1,this.marker=new ba,this.label=new ar,this.line=new qg}};f([x],lr.prototype,"maxWidth",2),f([x],lr.prototype,"paddingX",2),f([x],lr.prototype,"paddingY",2),f([x],lr.prototype,"showSeriesStroke",2),f([x],lr.prototype,"marker",2),f([x],lr.prototype,"label",2),f([x],lr.prototype,"line",2);var Qg=class extends re{};f([x],Qg.prototype,"legendItemClick",2),f([x],Qg.prototype,"legendItemDoubleClick",2);var Jv={type:"gradient",bounds:"item",gradient:"linear",colorStops:[{color:"black"}],rotation:0,reverse:!1},eM={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:1,rotation:0,scale:1},tM={type:"image",backgroundFill:"black",backgroundFillOpacity:1,rotation:0,repeat:"no-repeat",fit:"contain",width:8,height:8},kt=class extends re{constructor(e){super(),this.ctx=e,this.id=cs(this),this.group=new hi({name:"legend",zIndex:16}),this.itemSelection=gi.select(this.group,Ji),this.containerNode=this.group.appendChild(new Et({name:"legend-container"})),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 lr,this.listeners=new Qg,this.enabled=!0,this.position="bottom",this.border=new so(this.containerNode),this.cornerRadius=0,this.fillOpacity=1,this.padding=4,this.spacing=20,this.cleanup=new at,this.size=[0,0],this._visible=!0,this.pagination=new no(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.cleanup.register(e.eventsHub.on("legend:change",this.onLegendDataChange.bind(this)),e.layoutManager.registerElement(1,i=>this.positionLegend(i)),e.eventsHub.on("locale:change",()=>this.onLocaleChanged()),()=>delete t["toggle-series-visibility"].action,()=>delete t["toggle-other-series"].action,()=>this.group.remove()),this.domProxy=new M1(this.ctx,this.id),this.ctx.historyManager.addMementoOriginator(e.legendManager)}set data(e){Nt(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.cleanup.flush(),this.itemSelection.clear()}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=Gn.getMeasurer({font:n}),m=r??e*.8,{markerWidth:b,anyLineEnabled:y}=this.calculateMarkerWidth();if(this.itemSelection.each((w,E)=>{w.fontStyle=a,w.fontWeight=l,w.fontSize=c,w.fontFamily=h;const R=this.updateMarkerLabel(w,E,b,y),P=E.itemId??E.id,H=(this.getItemLabel(E)??"<unknown>").replace(/\r?\n/g," ");w.text=this.truncate(H,o,m,R,p,P),d.push(w.getTextMeasureBBox())}),e=Math.max(1,e),t=Math.max(1,t),!isFinite(e))return{};[e,t]=this.updateContainer(e,t);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:A}=this.updatePagination(d,e,t),I=this.pages;this.pages=S,this.maxPageSize=[A-i,D-s];const L=this.pagination.currentPage,C=this.pages[L];return this.pages.length<1||!C?(this.visible=!1,{oldPages:I}):(this.visible=!0,this.updatePositions(L),this.update(),{oldPages:I})}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 Pt;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,bn(u,this.getMarkerStyles(o))),d.visible=s,d.visible&&bn(d,this.getLineStyles(o)),e.length=i,e.spacing=h,e.isCustomMarker=c,a}updateContainer(e,t){const i=this.getContainerStyles();return this.containerNode.width=0,this.containerNode.height=0,bn(this.containerNode,i),this.containerNode.cornerRadius=i.cornerRadius,e-=i.strokeWidth*2+i.padding.left+i.padding.right,t-=i.strokeWidth*2+i.padding.top+i.padding.bottom,[e,t]}truncate(e,t,i,s,n,r){let o=!1;e.length>t&&(e=e.substring(0,t),o=!0);const a=Xa.truncateLine(e,n,i-s,o);return a.endsWith(He.EllipsisChar)?this.truncatedItems.add(r):this.truncatedItems.delete(r),a}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=se(0,h,r.length-1);const{paddingX:u,paddingY:d}=this.item,p=8,g=a-u,m=o-d;let b=0,y=-l.y-this.item.marker.size/2;c?y+=m+p:(b+=-l.x+g+p,y+=(m-l.height)/2),this.pagination.translationX=b,this.pagination.translationY=y,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=["left","left-top","left-bottom","right","right-top","right-bottom"],{placement:o}=Au(this.position),a=this.getOrientation(),l=r.includes(o);let c=this.pagination.getBBox(),h=new U(0,0,0,0),u=[],d=0,p=0,g=0;const m=y=>y.width===c.width&&y.height===c.height,b=this.maxWidth!==void 0&&this.maxHeight!==void 0;do{if(g++>10){j.warn("unable to find stable legend layout.");break}c=h;const y=t-(l?0:c.width),v=i-(l?c.height:0),M=f1({orientation:a,bboxes:e,maxHeight:v,maxWidth:y,itemPaddingY:n,itemPaddingX:s,forceResult:b});u=M?.pages??[],d=M?.maxPageWidth??0,p=M?.maxPageHeight??0;const S=u.length;if(this.pagination.visible=S>1,this.pagination.totalPages=S,this.pagination.update(),this.pagination.updateMarkers(),h=this.pagination.getBBox(),!this.pagination.visible)break}while(!m(h));return{maxPageWidth:d,maxPageHeight:p,pages:u,paginationBBox:h,paginationVertical:l}}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((g,m,b)=>{if(b<r||b>o){g.visible=!1;return}const y=b-r;let v,M;u?(v=y%c,M=Math.floor(y/c)):(v=Math.floor(y/h),M=y%h),g.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,g.translationX=a,g.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 Fn(t)&&(t.width=8,t.height=8,t.padding=1,t.strokeWidth=Math.min(2,t.strokeWidth??2)),Ar(t)&&(t.fit="contain",t.width=void 0,t.height=void 0,t.repeat="no-repeat"),Us({fill:t,stroke:i,strokeOpacity:s,fillOpacity:n,strokeWidth:this.item.marker.strokeWidth??l,lineDash:o,lineDashOffset:a},Jv,eM,tM)}getContainerStyles(){const{stroke:e,strokeOpacity:t,strokeWidth:i}=this.border,{cornerRadius:s,fill:n,fillOpacity:r,padding:o}=this,a=typeof o=="number";return Us({cornerRadius:s,fill:n,fillOpacity:r,padding:{top:a?o:o.top??0,right:a?o:o.right??0,bottom:a?o:o.bottom??0,left:a?o:o.left??0},stroke:e,strokeOpacity:t,strokeWidth:this.border.enabled?i:0},Jv,eM,tM)}computePagedBBox(){const e=ge.computeChildrenBBox(this.group.excludeChildren({name:"legend-container"}));if(this.pages.length>1){const[s,n]=this.maxPageSize;e.height=Math.max(n,e.height),e.width=Math.max(s,e.width)}const{strokeWidth:t,padding:i}=this.getContainerStyles();return e.grow(i).grow(t),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}=dt.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,legendItemName:d}=t,p=n.series.find(b=>b.id===c);if(!p)return!1;let g=u;const m=Qv("click",t,e);return s&&us([p.properties,this.ctx.chartService],s,m.apiEvent),m.defaultPrevented||(a&&(g=!u,o&&!g&&this.getVisibleItemCount()<2&&(g=!0),i.setChecked(g),this.ctx.eventsHub.emit("legend:item-click",{legendType:l,series:p,itemId:h,enabled:g,legendItemName:d})),g?r.updateHighlight(this.id,{series:p,itemId:h,datum:void 0,datumIndex:void 0,legendItemName:d}):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=Qv("dblclick",t,e);if(i&&us([c.properties,this.ctx.chartService],i,h.apiEvent),h.defaultPrevented)return!0;if(n){const u=s.series.flatMap(m=>m.getLegendData("category"));let d=0;const p=new Set;for(const m of u)m.enabled&&(d+=1,m.legendItemName!=null&&p.add(m.legendItemName));p.size>0&&(d=p.size);const g=u.find(m=>m.itemId===a&&m.seriesId===l);this.ctx.eventsHub.emit("legend:item-double-click",{legendType:r,series:c,itemId:a,numVisibleItems:d,enabled:g?.enabled??!1,legendItemName:g?.legendItemName})}return this.ctx.legendManager.update(),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),!0}toTooltipMeta(e,t){let i;return e instanceof FocusEvent?i=dt.toCanvas(t).computeCenter():(e.preventDefault(),i=dt.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,legendItemName:i?.legendItemName}):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{placement:t,floating:i,xOffset:s,yOffset:n}=Au(this.position),r=i?new U(0,0,e.width,e.height):e.layoutBox,{x:o,y:a,width:l,height:c}=r,[h,u]=this.calculateLegendDimensions(r),{oldPages:d}=this.calcLayout(h,u),p=this.computePagedBBox();if(this.visible){let m=function(M){};var g=m;const b=this.spacing;let y,v;switch(t){case"top":y=(l-p.width)/2,v=0;break;case"bottom":y=(l-p.width)/2,v=c-p.height;break;case"right":y=l-p.width,v=(c-p.height)/2;break;case"left":y=0,v=(c-p.height)/2;break;case"top-right":case"right-top":y=l-p.width,v=0;break;case"top-left":case"left-top":y=0,v=0;break;case"bottom-right":case"right-bottom":y=l-p.width,v=c-p.height;break;case"bottom-left":case"left-bottom":y=0,v=c-p.height;break;default:m(t)}if(!i){let M,S;switch(t){case"top":case"top-right":case"top-left":M=p.height+b,S="top";break;case"bottom":case"bottom-right":case"bottom-left":M=p.height+b,S="bottom";break;case"left":case"left-top":case"left-bottom":M=p.width+b,S="left";break;case"right":case"right-top":case"right-bottom":M=p.width+b,S="right";break;default:m(t)}r.shrink(M,S)}y+=s,v+=n,this.group.translationX=Math.floor(o+y-p.x),this.group.translationY=Math.floor(a+v-p.y),this.containerNode.x=p.x,this.containerNode.y=p.y,this.containerNode.width=p.width,this.containerNode.height=p.height}return d}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,{placement:s}=Au(this.position),n=t/i,r=.5,o=.2,a=.25;let l,c;function h(u){}switch(s){case"top":case"top-left":case"top-right":case"bottom":case"bottom-left":case"bottom-right":{const u=n<1?Math.min(r,o*(1/n)):o;l=this.maxWidth?Math.min(this.maxWidth,t):t,c=this.maxHeight?Math.min(this.maxHeight,i):Math.round(i*u);break}case"left":case"left-top":case"left-bottom":case"right":case"right-top":case"right-bottom":{const u=n>1?Math.min(r,a*n):a;l=this.maxWidth?Math.min(this.maxWidth,t):Math.round(t*u),c=this.maxHeight?Math.min(this.maxHeight,i):i;break}default:}return[l,c]}cachedCallWithContext(e,...t){const{callbackCache:i,chartService:s}=this.ctx;return i.call([this,s],e,...t)}};kt.className="Legend",f([x],kt.prototype,"toggleSeries",2),f([x],kt.prototype,"pagination",2),f([x],kt.prototype,"item",2),f([x],kt.prototype,"listeners",2),f([Vn((e,t,i)=>{if(e.updateGroupVisibility(),t===i)return;const{ctx:{legendManager:s,stateManager:n}}=e;i===!1&&t===!0&&n.restoreState(s)}),x],kt.prototype,"enabled",2),f([x],kt.prototype,"position",2),f([x],kt.prototype,"maxWidth",2),f([x],kt.prototype,"maxHeight",2),f([x],kt.prototype,"reverseOrder",2),f([x],kt.prototype,"orientation",2),f([x],kt.prototype,"preventHidingAll",2),f([x],kt.prototype,"border",2),f([x],kt.prototype,"cornerRadius",2),f([x],kt.prototype,"fill",2),f([x],kt.prototype,"fillOpacity",2),f([x],kt.prototype,"padding",2),f([x],kt.prototype,"spacing",2),f([x],kt.prototype,"xOffset",2),f([x],kt.prototype,"yOffset",2);var S1={type:"legend",optionsKey:"legend",identifier:"category",chartTypes:["cartesian","polar","topology","standalone"],moduleFactory:e=>new kt(e),packageType:"community",removable:"standalone-only"},rc=class extends re{constructor(e){super(),this.ctx=e,this.rectNode=new Et,this.border=new so(this.rectNode),this.cornerRadius=0,this.padding=0,this.cleanup=new at,this.node=this.createNode(),this.node.append([this.rectNode]),this.rectNode.fill=void 0,this.cleanup.register(e.scene.attachNode(this.node),e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)))}destroy(){this.cleanup.flush()}getPadding(){const{border:e,padding:t}=this,i=e.enabled?e.strokeWidth:0;if(typeof t=="number"){const s=t+i;return{top:s,right:s,bottom:s,left:s}}return{top:(t.top??0)+i,right:(t.right??0)+i,bottom:(t.bottom??0)+i,left:(t.left??0)+i}}createNode(){return new ge({name:"series-area-container",zIndex:4})}onLayoutComplete(e){const{x:t,y:i,width:s,height:n}=e.series.paddedRect;this.rectNode.x=t,this.rectNode.y=i,this.rectNode.width=s,this.rectNode.height=n}};f([x],rc.prototype,"border",2),f([x],rc.prototype,"clip",2),f([Dt("rectNode","cornerRadius"),x],rc.prototype,"cornerRadius",2),f([x],rc.prototype,"padding",2);var D1={type:"root",optionsKey:"seriesArea",packageType:"community",chartTypes:["cartesian","polar","topology","standalone"],moduleFactory:e=>new rc(e)};function Cu(e,t,i,s,n){const r=(u,d,p,g)=>{i.animate({id:`${e}_${t}_${d.id}_${u}`,groupId:e,from:p?1:0,to:1,ease:sl,collapsable:p,onUpdate(m,b){b&&u!=="removed"||(d.path.clear(!0),g(m,d),d.checkPathDirty())},onStop(){u==="added"&&(d.path.clear(!0),g(1,d),d.checkPathDirty())},phase:gs[u]})},o=new di,a=u=>(o.resetPathDirty(),u(0,o),o.resetPathDirty(),u(1,o),o.checkPathDirty(),o.isPathDirty()),{addPhaseFn:l,updatePhaseFn:c,removePhaseFn:h}=n;for(const u of s)i.isSkipped()||(r("removed",u,!a(h),h),r("updated",u,!a(c),c)),r("added",u,!a(l),l)}function Xs(e,t,i,s,n,r){if(s.itemStyler){const o={border:s.border,color:s.color,cornerRadius:s.cornerRadius,datum:t?.datum,enabled:s.enabled,fill:s.fill,fillOpacity:s.fillOpacity,fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight,itemId:void 0,seriesId:e.id,padding:s.padding,highlighted:n,highlightState:r};return Ee(e.callWithContext(s.itemStyler,{...i,...o}),o)}return s}function iM(e,t,i,s,n,r,o){if(s.enabled&&n){const a=Xs(e,n,i,s,r,o);t.visible=!0,t.x=n.x,t.y=n.y,t.text=n.text,t.fill=a.color,t.setAlign(n),t.setFont(a),t.setBoxing(a)}else t.visible=!1}var I1={"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 sM({isUpward:e,isVertical:t,placement:i,spacing: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}=I1[i],d=(h+1)*.5;if(t){const p=e?n.y+n.height:n.y,g=n.height*c;o=p+g*d+s*u*c,l=u===c?"top":"bottom"}else{const p=e?n.x:n.x+n.width,g=n.width*c;r=p+g*d+s*u*c,a=u===c?"left":"right"}}return{x:r,y:o,textAlign:a,textBaseline:l}}function It({id:e},t,i,...s){for(const n of s)n.cleanup();gn(e,t,i,s,{opacity:0},{opacity:1},{phase:"trailing"})}function Lu({id:e},t,i,...s){gn(e,t,i,s,{opacity:1},{opacity:0},{phase:"remove"})}function ro(e){return{opacity:1}}var Jg=class extends re{constructor(){super(...arguments),this._dirty=!0}markDirty(){this._dirty=!0}markClean(e){this._dirty=!1}isDirty(){return this._dirty}onChangeDetection(e){this.markDirty()}},qs=class extends Jg{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};f([x,F()],qs.prototype,"enabled",2),f([x,F()],qs.prototype,"color",2),f([x,F()],qs.prototype,"xOffset",2),f([x,F()],qs.prototype,"yOffset",2),f([x,F()],qs.prototype,"blur",2);var Zt=class extends Jg{constructor(){super(...arguments),this.enabled=!0,this.shape="circle",this.size=6,this.fillGradientDefaults=new Ki,this.fillPatternDefaults=new nt,this.fillImageDefaults=new Ii,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}};f([x,F()],Zt.prototype,"enabled",2),f([x,Ei({equals:vo})],Zt.prototype,"shape",2),f([x,F()],Zt.prototype,"size",2),f([x,Ei({equals:Nt})],Zt.prototype,"fill",2),f([x],Zt.prototype,"fillGradientDefaults",2),f([x],Zt.prototype,"fillPatternDefaults",2),f([x],Zt.prototype,"fillImageDefaults",2),f([x,F()],Zt.prototype,"fillOpacity",2),f([x,F()],Zt.prototype,"stroke",2),f([x,F()],Zt.prototype,"strokeWidth",2),f([x,F()],Zt.prototype,"strokeOpacity",2),f([x],Zt.prototype,"lineDash",2),f([x],Zt.prototype,"lineDashOffset",2),f([x,Ei({equals:vo})],Zt.prototype,"itemStyler",2);var nM=class extends re{constructor(){super(...arguments),this.enabled=!1}};f([x],nM.prototype,"enabled",2);var Tn=class extends re{constructor(){super(...arguments),this.interaction=new nM,this.position=new zr,this.range=void 0,this.class=void 0}formatTooltip(e,t,i){const s=this.renderer==null?void 0:us(e,this.renderer,i);return typeof s=="string"?{type:"raw",rawHtmlString:s}:s!=null?{type:"structured",...t,...s}:{type:"structured",...t}}};f([x],Tn.prototype,"enabled",2),f([x],Tn.prototype,"showArrow",2),f([x],Tn.prototype,"renderer",2),f([x],Tn.prototype,"interaction",2),f([x],Tn.prototype,"position",2),f([x],Tn.prototype,"range",2),f([x],Tn.prototype,"class",2);function oo(){return new Tn}var rM=class{constructor(e,t,i){this.root=new L1(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}},A1=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)}},C1=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 A1(this.child(n,r,l),this.child(n,r,c),this.child(n,r,h),this.child(n,r,u))}},L1=class qS extends C1{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=Uc(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 qS(t,i,s)}},ef=class extends Bh{constructor({clipFocusBox:e,categoryKey:t,...i}){super(i),this.categoryKey=t,this.clipFocusBox=e??!0}dataCount(){return this.processedData?.dataSources?.get(this.id)?.length??0}getScaleInformation({xScale:e,yScale:t}){const i=Ye.is(e),s=Ye.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.events.emit("data-processed",{dataModel:s,processedData:n}),{dataModel:s,processedData:n}}isProcessedDataAnimatable(){const{processedData:e}=this;if(!e)return!1;const t=e.reduced?.animationValidation;if(!t)return!0;const{orderedKeys:i,uniqueKeys:s}=t;return i&&s}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}}pickNodesExactShape(e){const t=super.pickNodesExactShape(e);return t.sort((i,s)=>i.datumIndex-s.datumIndex),t}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=se(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}dataModelPropertyIsKey(e){const{processedData:t}=this;return t?t.defs.keys.some(i=>i.id===e&&i.idsMap?.get(this.id)?.has(e)===!0):!1}keysOrValues(e){const{dataModel:t,processedData:i}=this;return!t||!i?[]:this.dataModelPropertyIsKey(e)?t.resolveKeysById(this,e,i):t.resolveColumnById(this,e,i)}sortOrder(e){const{dataModel:t,processedData:i}=this;if(!(!t||!i))return this.dataModelPropertyIsKey(e)?t.getKeySortOrder(this,e,i):t.getColumnSortOrder(this,e,i)}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(Nt(e,a))return o}}},xa={x:["xKey"],y:["yKey"]},va={x:["xName"],y:["yName"]},tf=class extends Fh{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.yKey=s.properties.yKey}},cr=class extends Zi{constructor(){super(...arguments),this.pickOutsideVisibleMinorAxis=!1}};f([x],cr.prototype,"legendItemName",2),f([x],cr.prototype,"pickOutsideVisibleMinorAxis",2);var Tu=100,ao=class extends ef{constructor({pathsPerSeries:e=["path"],pathsZIndexSubOrderOffset:t=[],datumSelectionGarbageCollection:i=!0,animationAlwaysUpdateSelections:s=!1,animationResetFns:n,propertyKeys:r,propertyNames:o,...a}){if(super({propertyKeys:r,propertyNames:o,canHaveAxes:!0,...a}),this.NodeEvent=tf,this.dataNodeGroup=this.contentGroup.appendChild(new ge({name:`${this.id}-series-dataNodes`,zIndex:1})),this.labelGroup=this.contentGroup.appendChild(new hi({name:`${this.id}-series-labels`})),this.labelSelection=gi.select(this.labelGroup,Oi),this.highlightSelection=gi.select(this.highlightGroup,()=>this.nodeFactory()),this.annotationSelections=new Set,this.debug=be.create(),!r||!o)throw new Error(`Unable to initialise series type ${this.type}`);this.opts={pathsPerSeries:e,pathsZIndexSubOrderOffset:t,propertyKeys:r,propertyNames:o,animationResetFns:n,animationAlwaysUpdateSelections:s,datumSelectionGarbageCollection:i},this.paths=e.map(l=>new di({name:`${this.id}-${l}`})),this.datumSelection=gi.select(this.dataNodeGroup,()=>this.nodeFactory(),i),this.animationState=new ll("empty",{empty:{update:{target:"ready",action:l=>this.animateEmptyUpdateReady(l)},reset:"empty",skip:"ready",disable:"disabled"},ready:{updateData:"waiting",clear:"clearing",highlight:l=>this.animateReadyHighlight(l),resize:l=>this.animateReadyResize(l),reset:"empty",skip:"ready",disable:"disabled"},waiting:{update:{target:"ready",action:l=>{this.ctx.animationManager.isSkipped()?this.resetAllAnimation(l):this.animateWaitingUpdateReady(l)}},reset:"empty",skip:"ready",disable:"disabled"},disabled:{update:l=>this.resetAllAnimation(l),reset:"empty"},clearing:{update:{target:"empty",action:l=>this.animateClearingUpdateEmpty(l)},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)}detachSeries(e,t,i){super.detachSeries(e,t,i),this.detachPaths(this.paths)}updatedDomains(){this.animationState.transition("updateData")}attachPaths(e){for(const t of e)this.contentGroup.appendChild(t)}detachPaths(e){for(const t of e)this.contentGroup.removeChild(t)}renderToOffscreenCanvas(){const e=this.getNodeData();return e!=null&&e.length>Tu}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"?this.animationState.transition("skip"):e==="disabled"&&this.animationState.transition("disable")}addChartEventListeners(){this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",e=>this.onLegendItemClick(e)),this.ctx.eventsHub.on("legend:item-double-click",e=>this.onLegendItemDoubleClick(e)))}destroy(){super.destroy(),this._contextNodeData=void 0}isSeriesHighlighted(e){const{series:t,legendItemName:i}=e??{},{legendItemName:s}=this.properties;return t===this||s!=null&&s===i}strokewidthChange(){const e=("strokeWidth"in this.properties&&this.properties.strokeWidth)??0,t=this.properties.highlight.highlightedSeries.strokeWidth??e,i=this.properties.highlight.highlightedItem?.strokeWidth??e;return e>i||t>i}update({seriesRect:e}){const{_contextNodeData:t}=this,i=this.checkResize(e),s=this.updateHighlightSelection();this.contentGroup.batchedUpdate(()=>{const r=this.updateSelections();this.updateNodes(s,i||r)});const n=this.getAnimationData(e,t);n&&(i&&this.animationState.transition("resize",n),this.animationState.transition("update",n))}updateSelections(){var e;const t=!this.opts.animationAlwaysUpdateSelections&&this.ctx.animationManager.isSkipped();if(!this.visible&&t)return!1;const{nodeDataRefresh:i}=this;if(!i&&!this.isPathOrSelectionDirty())return!1;if(i){this.nodeDataRefresh=!1,this.debug("CartesianSeries.updateSelections() - calling createNodeData() for",this.id),this.markQuadtreeDirty(),this._contextNodeData=this.createNodeData();const s=this.isProcessedDataAnimatable();this._contextNodeData&&((e=this._contextNodeData).animationValid??(e.animationValid=s));const{dataModel:n,processedData:r}=this;n!==void 0&&r!==void 0&&this.events.emit("data-update",{dataModel:n,processedData:r}),this.updateSeriesSelections()}return i}updateSeriesSelections(){const{datumSelection:e,labelSelection:t,paths:i}=this,s=this._contextNodeData;if(!s)return;const{nodeData:n,labelData:r,itemId:o}=s;this.updatePaths({itemId:o,contextData:s,paths:i}),this.datumSelection=this.updateDatumSelection({nodeData:n,datumSelection:e}),this.labelGroup.batchedUpdate(()=>{this.labelSelection=this.updateLabelSelection({labelData:r,labelSelection:t})??t})}getShapeFillBBox(){const{axes:e}=this,t=e.x,i=e.y,[s,n]=_t(t?.range??[0,1]),[r,o]=_t(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]=_t(l),[p,g]=_t(h);return{axis:new U(s,r,n-s,o-r),series:new U(u,p,d-u,g-p)}}updateNodes(e,t){const{highlightSelection:i,datumSelection:s}=this,n=!this.ctx.animationManager.isSkipped(),r=this.visible&&this._contextNodeData!=null;this.contentGroup.visible=n||r,this.highlightGroup.visible=(n||r)&&e,this.updateDatumNodes({datumSelection:i,isHighlight:!0}),this.animationState.transition("highlight",i);const{dataNodeGroup:o,labelSelection:a,paths:l,labelGroup:c}=this,{itemId:h}=this.contextNodeData??{};if(this.updatePathNodes({itemId:h,paths:l,visible:r,animationEnabled:n}),o.visible=n||r,c.visible=r,!o.visible)return;const u=this.strokewidthChange()||this.hasChangesOnHighlight;(t||u)&&(this.updateDatumNodes({datumSelection:s,isHighlight:!1}),this.usesPlacedLabels||this.labelGroup.batchedUpdate(()=>{this.updateLabelNodes({labelSelection:a,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(){const{highlightSelection:e,_contextNodeData:t}=this;if(!t)return!1;const i=this.ctx.highlightManager?.getActiveHighlight(),n=this.isSeriesHighlighted(i)&&i?.datum?i:void 0;if(n==null)return!1;const{nodeData:r}=t,o=this.getHighlightData(r,n);return this.highlightSelection=this.updateHighlightSelectionItem({items:o,highlightSelection:e}),!0}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 rM(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,{dataNodeGroup:n}=this,r=n.pickNodes(i,s).filter(o=>o.datum.missing!==!0);if(r.length!==0)return r.map(a=>a.datum);for(const o of this.moduleMap.modules()){const{datum:a}=o.pickNodeExact(e)??{};if(a!=null&&a?.missing!==!0)return[a]}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 g=Math.max((a.x-u)**2+(a.y-d)**2,0);g<l&&(l=g,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;if(a==null||l==null)return;const c=[a,l].filter(g=>g.isCategoryLike()).map(g=>g.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 g of r.nodeData){const{x:m=NaN,y:b=NaN}=g.point??g.midPoint??{};if(isNaN(m)||isNaN(b)||g.missing===!0)continue;const y=[a?.inRange(m,1),l?.inRange(b,1)];if(h!=="x"&&y.reverse(),!y[0]||!o&&!y[1])continue;const v=[m,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=g)}if(p){let g=Math.max(d[0]**2+d[1]**2-(p.point?.size??0),0);for(const m of this.moduleMap.modules()){const b=m.pickNodeMainAxisFirst(e,h);if(b!==void 0&&b.distanceSquared<g){p=b.datum,g=b.distanceSquared;break}}return{datum:p,distance:Math.sqrt(g)}}}isPathOrSelectionDirty(){return!1}shouldFlipXY(){return!1}visibleRangeIndices(e,t,i,s){let n;if(s==null){const{processedData:c,dataModel:h}=this;n=h.getColumnSortOrder(this,e,c)??1}else n=s.sortOrder;const r=this.keysOrValues(e),o=0,[a,l]=Nb(n,i?.length??r.length,t,c=>{const h=i?.[c]??c;return this.xCoordinateRange(r[h],o,h)});return a<l?[a,l]:[l,a]}domainForVisibleRange(e,t,i,s,n){const{processedData:r,dataModel:o}=this,[a,l]=s,c=this.keysOrValues(i),h=this.sortOrder(i);if(h!=null){const g=this.visibleRangeIndices(i,s,n,{sortOrder:h});return o.getDomainBetweenRange(this,t,g,r)}const u=t.map(g=>this.keysOrValues(g));let d=1/0,p=-1/0;return c.forEach((g,m)=>{const[b,y]=this.xCoordinateRange(g,0,m);if(!(y<a||b>l))for(let v=0;v<t.length;v++){const M=u[v][m];d=Math.min(d,M),p=Math.max(p,M)}}),d>p?[NaN,NaN]:[d,p]}domainForClippedRange(e,t,i){const{processedData:s,dataModel:n,axes:r}=this,a=T1(r[e==="x"?"y":"x"]);if(!a)return t.flatMap(g=>n.getDomain(this,g,"value",s));const l=this.keysOrValues(i),c=n.getColumnSortOrder(this,i,s);if(c!=null){const g=k1(c,l.length,a,m=>l[m]);return n.getDomainBetweenRange(this,t,g,s)}const h=t.map(g=>this.keysOrValues(g)),u=a[0].valueOf(),d=a[1].valueOf(),p=[];return l.forEach((g,m)=>{const b=g.valueOf();if(b<u||b>d)return;const y=h.map(v=>v[m]);b>=u&&p.push(...y),b<=d&&p.push(...y)}),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();if(s==null){const D=this.sortOrder(e);if(D==null)s=[0,1];else{const A=c.scale,I=A.range;A.range=[0,1];let[L,C]=this.visibleRangeIndices(e,i,void 0,{sortOrder:D});const w=this.keysOrValues(e),E=0;this.xCoordinateRange(w[L],E,L)[0]<i[0]&&(L+=1),C<w.length&&this.xCoordinateRange(w[C],E,C)[1]>i[1]&&(C-=1);const R=Math.abs(C-L);return A.range=I,R}}const d=(D,A,I)=>D[0]+(I-A[0])/(A[1]-A[0])*(D[1]-D[0]),p=c.range,g=h.range,m=d(p,c.visibleRange,i[0]),b=d(p,c.visibleRange,i[1]),y=d(g,h.visibleRange,u?s[0]:s[1]),v=d(g,h.visibleRange,u?s[1]:s[0]),M=Math.round((i[0]+(i[1]-i[0])/2)*a.length),S=0;return Eb(0,a.length-1,M,n,D=>{let[A,I]=this.xCoordinateRange(a[D],S,D),[L,C]=this.yCoordinateRange(l.map(w=>w[D]),S,D);return!je(A)||!je(I)||!je(L)||!je(C)?!1:(u&&([A,I,L,C]=[L,C,A,I]),A>=m&&I<=b&&L>=y&&C<=v)})}minTimeInterval(){let e;try{e=this.keysOrValues("xValue")}catch{}if(e==null||e.length>1e3)return;let t=1/0,i=e[0],s;for(let n=1;n<e.length;n++){const r=e[n];if(r!=null&&i!=null){const o=r.valueOf()-i.valueOf(),a=Math.sign(o);if(a===0)continue;if(s!==void 0&&a!==s)return;t=Math.min(t,Math.abs(o)),s=a}i=r}if(Number.isFinite(t))return t}updateHighlightSelectionItem(e){const{items:t,highlightSelection:i}=e,s=t??[];return this.updateDatumSelection({nodeData:s,datumSelection:i})}updateHighlightSelectionLabel(e){return this.updateLabelSelection({labelData:e.items??[],labelSelection:e.highlightLabelSelection})}updateDatumSelection(e){return e.datumSelection}updateDatumNodes(e){}updatePaths(e){e.paths.forEach(t=>t.visible=!1)}updatePathNodes(e){const{paths:t,visible:i}=e;for(const s of t)s.visible=i}resetPathAnimation(e){const{path:t}=this.opts?.animationResetFns??{};t&&e.paths.forEach(i=>{ti([i],t)})}resetDatumAnimation(e){const{datum:t}=this.opts?.animationResetFns??{};t&&ti([e.datumSelection],t)}resetLabelAnimation(e){const{label:t}=this.opts?.animationResetFns??{};t&&ti([e.labelSelection],t)}resetAllAnimation(e){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.resetPathAnimation(e),this.resetDatumAnimation(e),this.resetLabelAnimation(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&&ti([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,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 wg){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 Ye){const{range:t,domain:i}=e;return{type:"continuous",domain:[i[0],i[1]],range:[t[0],t[1]]}}else if(e instanceof pn)return{type:"category",domain:e instanceof Wn?e.bands:e.domain,inset:e.inset,step:e.step}}calculateScaling(){const e={};for(const t of Object.values(np)){const i=this.axes[t];if(!i)continue;const s=this.getScaling(i.scale);s!=null&&(e[t]=s)}return e}};function T1(e){let t,i;if((e instanceof Ys||e instanceof Ks)&&({min:t,max:i}=e),!(t==null&&i==null))return t??(t=-1/0),i??(i=1/0),[t,i]}function k1(e,t,i,s){const n=i[0].valueOf(),r=i[1].valueOf();let o=Fa(0,t-1,l=>{const c=e===1?l:t-l,h=s(c)?.valueOf();return!Number.isFinite(h)||h>=n}),a=vr(0,t-1,l=>{const c=e===1?l:t-l,h=s(c)?.valueOf();return!Number.isFinite(h)||h<=r});return o==null||a==null?[0,0]:(e===-1&&([o,a]=[t-a,t-o]),o=Math.max(o,0),a=Math.min(a+1,t),[o,a])}var Ma=class extends re{constructor(){super(...arguments),this.type="linear",this.tension=1,this.position="end"}};f([x],Ma.prototype,"type",2),f([x],Ma.prototype,"tension",2),f([x],Ma.prototype,"position",2);var xt=class extends cr{constructor(){super(...arguments),this.xName=void 0,this.fill="#c16068",this.fillGradientDefaults=new Ki,this.fillPatternDefaults=new nt,this.fillImageDefaults=new Ii,this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new Ma,this.shadow=new qs,this.marker=new Zt,this.label=new pt,this.tooltip=oo(),this.connectMissingData=!1}};f([x],xt.prototype,"xKey",2),f([x],xt.prototype,"xName",2),f([x],xt.prototype,"yKey",2),f([x],xt.prototype,"yName",2),f([x],xt.prototype,"yFilterKey",2),f([x],xt.prototype,"normalizedTo",2),f([x],xt.prototype,"fill",2),f([x],xt.prototype,"fillGradientDefaults",2),f([x],xt.prototype,"fillPatternDefaults",2),f([x],xt.prototype,"fillImageDefaults",2),f([x],xt.prototype,"fillOpacity",2),f([x],xt.prototype,"stroke",2),f([x],xt.prototype,"strokeWidth",2),f([x],xt.prototype,"strokeOpacity",2),f([x],xt.prototype,"lineDash",2),f([x],xt.prototype,"lineDashOffset",2),f([x],xt.prototype,"interpolation",2),f([x],xt.prototype,"shadow",2),f([x],xt.prototype,"marker",2),f([x],xt.prototype,"label",2),f([x],xt.prototype,"tooltip",2),f([x],xt.prototype,"connectMissingData",2);function es(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 w1(e){const t=es(e);return t[0].x>t[1].x&&t.reverse(),t}function N1(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 oc(e,t,i){const[s,n]=es(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 oM(e,t,i){const{moveTo:s}=e,[n,r]=w1(e),{x:o,y:a}=n,{x:l,y:c}=r;if(i<o)return oc(e,n,n);if(t>l)return oc(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=Qc(e.cp0x,e.cp1x,e.cp2x,e.cp3x,t);let[u,d]=Wa(e.cp0x,e.cp0y,e.cp1x,e.cp1y,e.cp2x,e.cp2y,e.cp3x,e.cp3y,h);const p=Qc(d[0].x,d[1].x,d[2].x,d[3].x,i);return[d,u]=Wa(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 E1(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 O1={start:0,middle:.5,end:1};function P1(e,t){const i=[];let s=0,n=NaN,r=NaN;const o=typeof t=="number"?t:O1[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 ku=.05;function R1(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<=ku||1-u<=ku||d<=ku||1-d<=ku)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,g=h*t/3,m=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(m)>Math.abs(u)&&(g*=Math.abs(u/m),m=Math.sign(m)*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-g,cp2y:l.y-m,cp3x:l.x,cp3y:l.y})}return n}function Ft(e,t,i){return(t-e)*i+e}function z1(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 F1(e,t){const{cp0x:i,cp0y:s,cp1x:n,cp1y:r,cp2x:o,cp2y:a,cp3x:l,cp3y:c}=e,h=Qc(i,n,o,l,t),[u,d]=Wa(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 j1(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 aM(e,t){return e.type==="linear"?z1(e,t):e.type==="cubic"?F1(e,t):j1(e)}function lM(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 cM(e,t,i,s,n,r){r?e.lineTo(t,i):e.lineTo(s,n)}function hM(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 uM(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 ac(e,t,i,s){const[n,r]=es(t);switch(lM(e,i,n.x,n.y,r.x,r.y,s),t.type){case"linear":cM(e,t.x0,t.y0,t.x1,t.y1,s);break;case"cubic":hM(e,t.cp0x,t.cp0y,t.cp1x,t.cp1y,t.cp2x,t.cp2y,t.cp3x,t.cp3y,s);break;case"step":uM(e,t.x0,t.y0,t.x1,t.y1,t.stepX,s);break}}function dM(e,t,i){const[s,n]=es(e),[r,o]=es(t),a=Ft(s.x,r.x,i),l=Ft(s.y,r.y,i),c=Ft(n.x,o.x,i),h=Ft(n.y,o.y,i);return[{x:a,y:l},{x:c,y:h}]}function sf(e,t,i,s,n,r){const[{x:o,y:a},{x:l,y:c}]=dM(t,i,s);if(lM(e,n,o,a,l,c,r),t.type==="cubic"&&i.type==="cubic"){const h=Ft(t.cp1x,i.cp1x,s),u=Ft(t.cp1y,i.cp1y,s),d=Ft(t.cp2x,i.cp2x,s),p=Ft(t.cp2y,i.cp2y,s);hM(e,o,a,h,u,d,p,l,c,r)}else if(t.type==="step"&&i.type==="step"){const h=Ft(t.stepX,i.stepX,s);uM(e,o,a,l,c,h,r)}else if(t.type==="linear"&&i.type==="linear")cM(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=aM(t,h),d=aM(i,h),p=Ft(u.leftCp1x,d.leftCp1x,s),g=Ft(u.leftCp1y,d.leftCp1y,s),m=Ft(u.leftCp2x,d.leftCp2x,s),b=Ft(u.leftCp2y,d.leftCp2y,s),y=Ft(u.stepX,d.stepX,s),v=Ft(u.stepY0,d.stepY0,s),M=Ft(u.stepY1,d.stepY1,s),S=Ft(u.rightCp1x,d.rightCp1x,s),D=Ft(u.rightCp1y,d.rightCp1y,s),A=Ft(u.rightCp2x,d.rightCp2x,s),I=Ft(u.rightCp2y,d.rightCp2y,s);r?(e.cubicCurveTo(A,I,S,D,y,M),e.lineTo(y,v),e.cubicCurveTo(m,b,p,g,o,a)):(e.cubicCurveTo(p,g,m,b,y,v),e.lineTo(y,M),e.cubicCurveTo(S,D,A,I,l,c))}}var B1=1e3,pM=(e=>(e[e.Zero=0]="Zero",e[e.Split=1]="Split",e))(pM||{});function V1(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 Li(e){return _p(e).valueOf()}function yi(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;const i=Li(e);let s=t.domain.findIndex(n=>Li(n)===i);return s===-1&&(s=t.domain.findIndex(n=>V1(e,n))),s>=0?t.inset+t.step*s:NaN}function gM({data:e},t){return e.map((i,s)=>({xValue0Index:t.indexOf(Li(i.xValue0)),xValue1Index:t.indexOf(Li(i.xValue1)),datumIndex:s}))}function fM(e){return Object.values(e.scales).every(t=>t.type==="category"?t.domain.length<B1:!0)}function G1(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=yi(r,s);if(Number.isFinite(o)){if(o<n)return!1;n=o}}return!0}function _1(e,t){let i=-1/0;for(const s of e){const n=yi(s.value,t.scales.x);if(Number.isFinite(n)){if(n<i)return!1;i=n}}return!0}function H1(e,t){const i=new Map;for(const{xValue0:h,xValue1:u}of e.data){const d=Li(h),p=Li(u);i.set(d,h).set(p,u)}const s=Array.from(i,([h,u])=>({axisValue:h,value:u}));s.sort((h,u)=>yi(h.value,e.scales.x)-yi(u.value,e.scales.x));const n=[];for(const{xValue0:h,xValue1:u}of t.data){const d=Li(h),p=Li(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)=>yi(h.value,t.scales.x)-yi(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=yi(h.value,t.scales.x),p=yi(r[u].value,t.scales.x);if(d>p){o=u+1;break}}r.splice(o,0,h),o+=1}if(!_1(r,t))return;const a=r.map(h=>h.axisValue),l=gM(t,a),c=gM(e,a);return{axisValues:a,oldDataAxisIndices:l,newDataAxisIndices:c}}function mM(e,t,i){if(i.xValue1Index===i.xValue0Index+1)return e;const s=es(e),n=(s[1].x-s[0].x)/(i.xValue1Index-i.xValue0Index),r=s[0].x+(t-i.xValue0Index)*n,o=r+n;return oM(e,r,o)}function yM(e,t){const[i,s]=es(e),n=yi(0,t.scales.y);return oc(e,{x:i.x,y:n},{x:s.x,y:n})}function bM(e){const[t,i]=es(e);return N1(e,{x:(t.x+i.x)/2,y:(t.y+i.y)/2})}function xM(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 yM(e,i);case 1:return bM(e)}const l=yi(o,i.scales.x),c=yi(a,i.scales.y),h={x:l,y:c};return oc(e,h,h)}function nf(e,t){if(t==null)return;const i=Li(e.xValue0),s=Li(e.xValue1);return t.find(n=>Li(n.xValue0)===i&&Li(n.xValue1)===s)?.span}function vM(e,t,i,s,n,r,o){const a=e.data[s.datumIndex],l=a.span,c=nf(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=xM(l,t,e,i,s,r);o.added.push({from:h,to:l})}}function MM(e,t,i,s,n,r,o){const a=e.data[s.datumIndex],l=a.span,c=nf(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=xM(l,t,e,i,s,r);o.removed.push({from:l,to:h})}}function SM(e,t,i,s,n){const r=t[n.xValue0Index],o=i.data.find(b=>Li(b.xValue0)===r),a=t[n.xValue1Index],l=i.data.find(b=>Li(b.xValue1)===a);if(o==null||l==null)return;const[{x:c},{x:h}]=es(e),u=yi(o.xValue0,i.scales.x),d=yi(o.yValue0,i.scales.y),p=yi(l.xValue1,i.scales.x),g=yi(l.yValue1,i.scales.y);let m=s.data[n.datumIndex].span;return m=oc(m,{x:u,y:d},{x:p,y:g}),m=oM(m,c,h),m}function U1(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){vM(e,i,r,u,d,a,l);return}else if(h!=null&&u==null){MM(t,i,o,h,p,a,l);return}else if(h==null||u==null)return;let g;h.xValue0Index===u.xValue0Index&&h.xValue1Index===u.xValue1Index?g=0:h.xValue0Index<=u.xValue0Index&&h.xValue1Index>=u.xValue1Index?g=-1:h.xValue0Index>=u.xValue0Index&&h.xValue1Index<=u.xValue1Index?g=1:g=0;const m=t.data[h.datumIndex],b=mM(m.span,n,h),y=e.data[u.datumIndex],v=mM(y.span,n,u);if(g===1){const M=SM(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})):MM(t,i,o,h,p,a,l)}else if(g===-1){const M=SM(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})):vM(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 $1(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)U1(t,i,s,r,c,a,o,l,n);return n}function DM(e,t,i){const{span:s}=t;switch(i){case 0:return nf(t,e.zeroData)??yM(s,e);case 1:return bM(s)}}function W1(e,t,i){const s=[],n=[];for(const r of t.data){const o=r.span,a=DM(t,r,i);n.push({from:o,to:a})}for(const r of e.data){const o=r.span,a=DM(e,r,i);s.push({from:a,to:o})}return{removed:n,moved:[],added:s}}function lc(e,t,i){if(!fM(e)||!fM(t)||!G1(e,t))return;const s=H1(e,t);return s==null?W1(e,t,i):$1(s,e,t,i)}function IM(e){return e.type==="continuous"||e.type==="log"}function AM(e){return e.type==="category"}function lo(e,t){return e===void 0||t===void 0?e!==void 0||t!==void 0:IM(e)&&IM(t)?e.type===t.type&&rn(e.domain,t.domain)&&rn(e.range,t.range):AM(e)&&AM(t)?e.inset===t.inset&&e.step===t.step&&rn(e.domain,t.domain):!1}function cc(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 wu(e,t){let i;const s=e.map(n=>n.point);switch(t.type){case"linear":i=E1(s);break;case"smooth":i=R1(s,t.tension);break;case"step":i=P1(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 hc(e,t,i=.001){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}function rf({path:e},t){let i;for(const{span:s}of t){const[n,r]=es(s),o=i!=null&&hc(i,n)?1:0;ac(e,s,o,!1),i=r}}function Nu(e,t,i){let s;for(const n of i){const[r,o]=dM(n.from,n.to,e),a=s!=null&&hc(s,r)?1:0;sf(t.path,n.from,n.to,e,a,!1),s=o}}function of(e,t,i){const s=(a,l)=>Nu(a,l,t.removed),n=(a,l)=>Nu(a,l,t.moved),r=(a,l)=>Nu(a,l,t.added),o=af(e,i);return{status:e,path:{addPhaseFn:r,updatePhaseFn:n,removePhaseFn:s},pathProperties:o}}function af(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:gs[i],...r}},toFn:n=>({phase:gs[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 CM(e,t,i){const s=e.scales.x?.type==="category",n=t.scales.x?.type==="category";if(s!==n||!cc(e.scales.x)||!cc(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=lc({scales:e.scales,data:e.strokeData.spans},{scales:t.scales,data:t.strokeData.spans},1);if(o==null)return;const a=of(r,o,"fade"),l=(i?.changed??!0)||!lo(e.scales.x,t.scales.x)||!lo(e.scales.y,t.scales.y)||r!=="updated";return{status:r,stroke:a,hasMotion:l}}function LM({path:e},{spans:t,phantomSpans:i}){let s=0,n={x:NaN,y:NaN},r={x:NaN,y:NaN};for(let o=0;o<t.length;o+=1){const{span:a}=t[o],{span:l}=i[o],{0:c,1:h}=es(a),{0:u,1:d}=es(l);if(hc(n,c)&&hc(r,u))ac(e,a,1,!1);else{for(let p=o-1;p>=s;p-=1)ac(e,i[p].span,1,!0);e.closePath(),ac(e,a,0,!1),s=o}n=h,r=d}for(let o=t.length-1;o>=s;o-=1)ac(e,i[o].span,1,!0);e.closePath()}function Eu(e,{path:t},i,s){for(let n=0;n<i.length;n+=1){const r=i[n],o=s[n];sf(t,r.from,r.to,e,0,!1),sf(t,o.from,o.to,e,1,!0),t.closePath()}}function TM(e,t,i,s){const n=(l,c)=>Eu(l,c,t.removed,i.removed),r=(l,c)=>Eu(l,c,t.moved,i.moved),o=(l,c)=>Eu(l,c,t.added,i.added),a=af(e,s);return{status:e,path:{addPhaseFn:o,updatePhaseFn:r,removePhaseFn:n},pathProperties:a}}function kM(e,t){const i=e.scales.x?.type==="category",s=t.scales.x?.type==="category";if(i!==s||!cc(e.scales.x)||!cc(t.scales.x))return;let n="updated";t.visible&&!e.visible?n="removed":!t.visible&&e.visible&&(n="added");const r=lc({scales:e.scales,data:e.fillData.spans},{scales:t.scales,data:t.fillData.spans},0);if(r==null)return;const o=lc({scales:e.scales,data:e.fillData.phantomSpans},{scales:t.scales,data:t.fillData.phantomSpans},0);if(o==null)return;const a=lc({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=TM(n,r,o,l),h=of(n,a,l);return{status:n,fill:c,stroke:h}}var Mi=0,Vi=1,ts=2,is=3,Qs=4;function lf(e){let t=Math.ceil(Math.log2(e.length))-1;return t=Math.min(Math.max(t,0),24),2**t|0}function uc(e,t){switch(e){case"category":return[NaN,NaN];case"number":case"time":case"ordinal-time":case"unit-time":{let i=1/0,s=-1/0;for(const n of t){const r=Number(n);i=Math.min(i,r),s=Math.max(s,r)}return[i,s]}case"color":case"log":case"mercator":return[0,0]}}function cf(e,t){return e/t}function kn(e,t,i){return(e.valueOf()-t)/(i-t)}function hf(e,t){return Math.min(Math.floor(e*t),t-1)*Qs|0}function uf(e,t,i,s,n,r){const o=new Int32Array(r*Qs).fill(-1),a=new Float64Array(r*Qs).fill(NaN),l=Number.isFinite(s)&&Number.isFinite(n),c=e.length;for(let h=0;h<e.length;h+=1){const u=e[h];if(u==null)continue;const d=l?kn(u,s,n):cf(h,c),p=hf(d,r),g=t[h],m=i[h],b=g!=null?g.valueOf():NaN,y=m!=null?m.valueOf():NaN,v=o[p+Mi]===-1;(v||d<a[p+Mi])&&(o[p+Mi]=h,a[p+Mi]=d),(v||d>a[p+Vi])&&(o[p+Vi]=h,a[p+Vi]=d),!Number.isNaN(y)&&(v||y<a[p+ts])&&(o[p+ts]=h,a[p+ts]=y),!Number.isNaN(b)&&(v||b>a[p+is])&&(o[p+is]=h,a[p+is]=b)}return{indexData:o,valueData:a}}function df(e,t,i,{inPlace:s=!1}={}){const n=i/2|0,r=s?e:new Int32Array(n*Qs),o=s?t:new Float64Array(n*Qs);for(let a=0;a<n;a+=1){const l=a*Qs|0,c=l*2|0,h=c+Qs|0,u=e[h+Mi]===-1,d=u||t[c+Mi]<t[h+Mi]?c:h;r[l+Mi]=e[d+Mi],o[l+Mi]=t[d+Mi];const p=u||t[c+Vi]>t[h+Vi]?c:h;r[l+Vi]=e[p+Vi],o[l+Vi]=t[p+Vi];const g=u||t[c+ts]<t[h+ts]?c:h;r[l+ts]=e[g+ts],o[l+ts]=t[g+ts];const m=u||t[c+is]>t[h+is]?c:h;r[l+is]=e[m+is],o[l+is]=t[m+is]}return{maxRange:n,indexData:r,valueData:o}}var Y1=1e3,K1=10;function wM(e,t,i,s,n,r){const o=e[r];if(o==null)return!1;const a=Number.isFinite(t)?kn(o,t,i):cf(r,e.length),l=hf(a,n);return r===s[l+Mi]||r===s[l+Vi]||r===s[l+ts]||r===s[l+is]}function NM(e,t,i,s){if(t.length<Y1)return;const[n,r]=uc(e,s);let o=lf(t);const{indexData:a,valueData:l}=uf(t,i,i,n,r,o);let c=[];for(let u=0;u<t.length;u+=1)wM(t,n,r,a,o,u)&&c.push(u);const h=[{maxRange:o,indices:c}];for(;c.length>K1&&o>64;)({maxRange:o}=df(a,l,o,{inPlace:!0})),c=c.filter(wM.bind(null,t,n,r,a,o)),h.push({maxRange:o,indices:c});return h.reverse(),h}function dc({id:e},t,i,...s){const n={phase:i?gs[i]:"trailing"};gn(e,"markers",t,s,{opacity:0},{opacity:1},n),s.forEach(r=>r.cleanup())}function EM({id:e},t,...i){gn(e,"markers",t,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"}),i.forEach(s=>s.cleanup())}function pf({id:e,nodeDataDependencies:t},i,...s){const n=t.seriesRectWidth;Ot(e,"markers",i,s,{fromFn:(a,l)=>{const c=l.midPoint?.x??n;let h=se(0,xb(c/n),1);return isNaN(h)&&(h=0),{scalingX:0,scalingY:0,delay:h,duration:fh,phase:"initial"}},toFn:()=>({scalingX:1,scalingY:1})})}function Ou(e){return{opacity:1,scalingX:1,scalingY:1}}function pc(e,t){return{x:t.point?.x??NaN,y:t.point?.y??NaN,scalingCenterX:t.point?.x??NaN,scalingCenterY:t.point?.y??NaN}}function Pu(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=e.getFormattedMarkerStyle(s),o=Pt.anchor(r.shape),a=n.focusSize??r.size,l=4+a,c=l/2,h=(o.x-.5)*a,u=(o.y-.5)*a,d=s.point.x-c-h,p=s.point.y-c-u;return dt.toCanvas(e.contentGroup,new U(d,p,l,l))}function gf({id:e,visible:t,nodeDataDependencies:i},s,...n){const{seriesRectWidth:r,seriesRectHeight:o}=i;gn(e,"path_properties",s,n,{clipX:0},{clipX:r},{phase:"initial",start:{clip:!0,clipY:o,visible:t},finish:{clip:!1,visible:t}})}function Ru({id:e},t,i,s="add",...n){gn(e,t,i,n,{opacity:0},{opacity:1},{phase:s})}function ff(e){return t=>({visible:e.getVisible(),opacity:e.getOpacity(),clipScalingX:1,clip:!1})}function zu({nodeDataDependencies:e},t){const i=s=>isFinite(s)?s:0;t.clipX=i(e.seriesRectWidth),t.clipY=i(e.seriesRectHeight)}var Z1=.125,X1=.25,q1=il(NM),Fu=class extends ao{constructor(e){super({moduleCtx:e,propertyKeys:xa,propertyNames:va,categoryKey:"xValue",pathsPerSeries:["fill","stroke"],pathsZIndexSubOrderOffset:[0,1e3],datumSelectionGarbageCollection:!1,pickModes:[2,0],animationResetFns:{path:ff({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:ro,datum:(t,i)=>({...Ou(t),...pc(t,i)})},clipFocusBox:!1}),this.properties=new xt,this.connectsToYAxis=!0,this.dataAggregationFilters=void 0,this.backgroundGroup=new ge({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>Tu||this.contextNodeData.strokeData.spans.length>Tu)}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 i=this.isStacked()===this._isStacked;return this._isStacked=i,super.setSeriesIndex(e,i)}setZIndex(e){super.setZIndex(e),this.isStacked()?(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])}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:g}=this.getScaleInformation({xScale:u,yScale:d}),m=n>1||c!=null,b={value:`area-stack-${s}-yValue`,values:`area-stack-${s}-yValues`,stack:`area-stack-${s}-yValue-stack`,marker:`area-stack-${s}-yValues-marker`},y={invalidValue:null};(Na(c)||l)&&n>1&&(y.invalidValue=0),i||(y.forceValue=0);const v=[ir(r,p,{id:"xValue"}),tt(o,g,{id:"yValueRaw",...y}),...a!=null?[tt(a,g,{id:"yFilterRaw"})]:[],...E0(o,g,{id:"yValueStack",...y,groupId:b.stack}),tt(o,g,{id:"yValue",...y,groupId:b.value})];m&&v.push(...sr(o,"window","current",{id:"yValueEnd",...y,groupId:b.values},g),...sr(o,"normal","current",{id:"yValueCumulative",...y,groupId:b.marker},g)),Na(c)&&v.push(du(Object.values(b),c)),h&&v.push(Yl());const{dataModel:M,processedData:S}=await this.requestDataModel(e,t,{props:v,groupByKeys:m,groupByData:!m});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]}yCumulativeKey(e){return e.type==="grouped"?"yValueCumulative":"yValue"}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:Ri(tr(a))}const r=this.domainForClippedRange("y",[this.yCumulativeKey(t)],"xValue");if(n instanceof ia||n instanceof Ks)return Ri(r);{const o=Number.isFinite(r[1]-r[0])?[r[0]>0?0:r[0],r[1]<0?0:r[1]]:[];return Ri(o)}}getSeriesRange(e,t){const[i,s]=this.domainForVisibleRange("y",[this.yCumulativeKey(this.processedData)],"xValue",t);return[Math.min(i,0),Math.max(s,0)]}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],e,t,i)}aggregateData(e,t){if(t.type==="grouped"||ta(t))return;const i=this.axes.x;if(i==null)return;const{scale:s}=i,n=e.resolveColumnById(this,"xValue",t),r=e.resolveColumnById(this,"yValueRaw",t),o=e.getDomain(this,"xValue","value",t);return q1(s.type,n,r,o)}createNodeData(){const{axes:e,data:t,processedData:i,dataModel:s,dataAggregationFilters:n}=this,r=e.x,o=e.y;if(!r||!o||!t||!s||!i)return;const{yKey:a,xKey:l,xName:c,yName:h,yFilterKey:u,marker:d,label:p,fill:g,stroke:m,connectMissingData:b,interpolation:y}=this.properties,{scale:v}=r,{scale:M}=o,S=this.getSeriesDomain("y"),{isContinuousY:D}=this.getScaleInformation({xScale:v,yScale:M}),A=(v.bandwidth??0)/2,I=i.type==="grouped",L=s.resolveKeysById(this,"xValue",i),C=s.resolveColumnById(this,"yValueRaw",i),w=I?s.resolveColumnById(this,"yValueCumulative",i):C,E=u!=null?s.resolveColumnById(this,"yFilterRaw",i):void 0,R=i.type==="grouped"?s.resolveColumnById(this,"yValueStack",i):void 0,P=[],G=[],{visibleSameStackCount:H}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);let oe=!1;const{dataSources:me}=i,ke=me.get(this.id)??[],[Te,xe]=v.range,Z=Math.abs(xe-Te),ce=n?.find(ie=>ie.maxRange>Z);let X=0,ye=0;const Se=ce?.indices;[X,ye]=this.visibleRangeIndices("xValue",r.range,Se),X=Math.max(X-1,0),ye=Math.min(ye+1,Se?.length??L.length),i.input.count<1e3&&(X=0,ye=i.input.count);const ne=(ie,fe,De)=>{let Me;return(Na(this.properties.normalizedTo)?D&&Ah(De):!isNaN(De))&&(Me=fe),{x:v.convert(ie)+A,y:M.convert(Me),size:d.size}},ue=ie=>{const fe=L[ie];if(fe==null)return;const De=ke[ie],Me=C[ie],Ze=w[ie],Xe=Number.isFinite(Me),Si=ne(fe,+Ze,Me),os=E!=null?E[ie]===Me:void 0;if(os===!1&&(oe=!0),Xe&&d&&G.push({series:this,itemId:a,datum:De,datumIndex:ie,midPoint:{x:Si.x,y:Si.y},cumulativeValue:Ze,yValue:Me,xValue:fe,yKey:a,xKey:l,point:Si,fill:d.fill??g,stroke:d.stroke??m,strokeWidth:d.strokeWidth??this.properties.strokeWidth,selected:os}),p.enabled&&Xe){const dr=this.getLabelText(Me,De,a,"y",S,p,{value:Me,datum:De,xKey:l,yKey:a,xName:c,yName:h});P.push({series:this,itemId:a,datum:De,datumIndex:ie,x:Si.x,y:Si.y,labelText:dr})}};if(i.type==="grouped")for(const{datumIndex:ie}of s.forEachGroupDatum(this,i))ue(ie);else for(let ie=X;ie<ye;ie+=1){const fe=Se?.[ie]??ie;L[fe]!=null&&ue(fe)}const q=ie=>ie.flatMap(fe=>Array.isArray(fe)?wu(fe,y):new Array(fe.skip).fill(null)),Q=(ie,fe)=>({point:{x:v.convert(ie)+A,y:M.convert(fe)},xDatum:ie,yDatum:fe}),ae=ie=>{const fe=[],De=(Me,Ze,Xe)=>{const Si=L[Ze],os=R!=null?R?.[Ze][ie]:C[Ze];if(b&&!Number.isFinite(C[Ze]))return;const dr=Number.isFinite(os);let ho=0,sm=!0,vc=0,nm=!0;if(R==null)sm=Me==null||Number.isFinite(C[Me]),nm=Xe==null||Number.isFinite(C[Xe]),ho=Me!=null&&Number.isFinite(C[Me])?os:0,vc=Xe!=null&&Number.isFinite(C[Xe])?os:0;else{const Mc=R[Ze],pr=Me!=null?R[Me]:void 0,PS=Xe!=null?R[Xe]:void 0;for(let Sc=0;Sc<=ie;Sc+=1){const rm=Mc[Sc];if(Number.isFinite(rm)){const uO=pr==null||Number.isFinite(pr[Sc]),dO=PS==null||Number.isFinite(PS[Sc]);uO?ho+=rm:sm=!1,dO?vc+=rm:nm=!1}}}const tn=fe[fe.length-1];if(!b&&(!sm||!nm||!dr||ho!==vc))if(!dr&&Array.isArray(tn)&&tn.length===1)fe[fe.length-1]={skip:1};else{const Mc=Q(Si,ho),pr=Q(Si,vc);Array.isArray(tn)?tn.push(Mc):tn!=null&&(tn.skip+=1),fe.push(dr?[pr]:{skip:0})}else{const Mc=b?os:Math.max(ho,vc),pr=Q(Si,Mc);Array.isArray(tn)?tn.push(pr):tn!=null?(tn.skip+=1,fe.push([pr])):fe.push([pr])}};if(i.type==="grouped")for(const{datumIndexes:[Me,Ze,Xe]}of s.forEachGroupDatumTuple(this,i))De(Me,Ze,Xe);else{let Me,Ze;for(let Xe=X;Xe<ye;Xe+=1){const Si=Se?.[Xe]??Xe;L[Si]!=null&&(Ze!=null&&De(Me,Ze,Si),Me=Ze,Ze=Si)}Ze!=null&&De(Me,Ze,void 0)}return q(fe)},de=this.seriesGrouping?.stackIndex??0,J=()=>{const ie=De=>{const Me=L[De],Ze=R?.[De][de]??C[De];if(!(b&&!Number.isFinite(Ze)))return Q(Me,0)};let fe;if(i.type==="grouped")fe=Array.from(s.forEachGroupDatum(this,i),({datumIndex:De})=>ie(De));else{fe=[];for(let De=X;De<ye;De+=1){const Me=Se?.[De]??De;L[Me]!=null&&fe.push(ie(Me))}}return fe=fe.filter(De=>De!=null),wu(fe,y)},$e=ae(de),ht=$e.map(()=>null);for(let ie=de-1;ie>=-1;ie-=1){let fe;for(let De=0;De<ht.length;De+=1)ht[De]==null&&(fe??(fe=ie!==-1?ae(ie):J()),ht[De]=fe[De])}const ut=$e.map((ie,fe)=>ie??ht[fe]),Ke=$e.filter(ie=>ie!=null);return{itemId:a,fillData:{itemId:a,spans:ut,phantomSpans:ht},strokeData:{itemId:a,spans:Ke},labelData:P,nodeData:G,scales:this.calculateScaling(),visible:this.visible,stackVisible:H>0,crossFiltering:oe}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(e){const{visible:t,animationEnabled:i}=e,[s,n]=e.paths,r=this.contextNodeData?.crossFiltering===!0,{strokeWidth:o,stroke:a,strokeOpacity:l,lineDash:c,lineDashOffset:h,fill:u,fillOpacity:d,opacity:p}=Ee(this.getHighlightStyle(),this.properties);n.setProperties({fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:1,stroke:a,strokeWidth:o,strokeOpacity:l*(r?X1:1),lineDash:c,lineDashOffset:h,opacity:p,visible:t||i});const g=Ko(u,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults);bn(s,{fill:g,stroke:void 0,fillOpacity:d*(r?Z1:1)},this.getShapeFillBBox()),s.setProperties({lineJoin:"round",pointerEvents:1,fillShadow:this.properties.shadow,opacity:p,visible:t||i}),zu(this,n),zu(this,s)}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(),LM(i,t.fillData),i.markDirty("AreaSeries")}updateStrokePath(e,t){const{spans:i}=t.strokeData,[,s]=e;s.path.clear(),rf(s,i),s.markDirty("AreaSeries")}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=this.properties.marker.enabled||this.contextNodeData?.crossFiltering===!0;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(s?t:[])}updateDatumNodes(e){const{datumSelection:t,isHighlight:i}=e,{xKey:s,yKey:n,marker:r,stroke:o,strokeWidth:a,strokeOpacity:l}=this.properties,c=this.getSeriesDomain("x"),h=this.getSeriesDomain("y"),u=this.getShapeFillBBox();t.each((d,p)=>{const{xValue:g,yValue:m}=p,b=_n(g,m,s,n,c,h),y=this.getMarkerStyle(r,p,b,i,void 0,{stroke:o,strokeWidth:a,strokeOpacity:l});this.applyMarkerStyle(y,d,p.point,u,{selected:p.selected})}),i||this.properties.marker.markClean(),i||this.properties.marker.markClean()}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}updateLabelNodes(e){const{isHighlight:t=!1}=e,i=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((s,n)=>{const{x:r,y:o,labelText:a}=n,l=t||this.isSeriesHighlighted(i),c=this.getHighlightStateString(i,l,n.datumIndex),h=Xs(this,n,this.properties,this.properties.label,l,c),{enabled:u,fontStyle:d,fontWeight:p,fontSize:g,fontFamily:m,color:b}=h;a&&u&&this.visible?(s.fontStyle=d,s.fontWeight=p,s.fontSize=g,s.fontFamily=m,s.textAlign="center",s.textBaseline="bottom",s.text=a,s.x=r,s.y=o-10,s.fill=b,s.fillOpacity=this.getHighlightStyle(t,n.datumIndex).opacity??1,s.visible=!0,s.setBoxing(h)):s.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,legendItemName:d}=r,p=n.x,g=n.y;if(!i||!s||!p||!g)return;const m=s.dataSources.get(this.id)?.[e],b=i.resolveKeysById(this,"xValue",s)[e],y=i.resolveColumnById(this,"yValueRaw",s)[e],{xDomain:v,yDomain:M}=this.cachedDatumCallback("domain",()=>({xDomain:this.getSeriesDomain("x"),yDomain:this.getSeriesDomain("y")}));if(b==null)return;const S=this.getMarkerStyle(u,{datum:m,datumIndex:e},_n(b,y,o,l,v,M),!1);return this.formatTooltipWithContext(h,{heading:this.getAxisValueText(p,"tooltip",b,m,o,d),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(g,"tooltip",y,m,l,d)}]},{seriesId:t,datum:m,title:c,xKey:o,xName:a,yKey:l,yName:c,...S,...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?Ko(e,a,l,c):Ko(o.fill,o.fillGradientDefaults,o.fillPatternDefaults,o.fillImageDefaults);return{marker:{...this.getMarkerStyle(o,{},void 0,!1,{size:o.size,fill:u,fillOpacity:h?i:o.fillOpacity},void 0,!1),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{datumSelection:t,labelSelection:i,contextData:s,paths:n}=e,{animationManager:r}=this.ctx;this.updateAreaPaths(n,s),gf(this,r,...n),ti([t],pc),pf(this,r,t),It(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,{datumSelection:i,labelSelection:s,contextData:n,paths:r,previousContextData:o}=e,[a,l]=r;if(n.visible===!1&&o?.visible===!1||a==null&&l==null)return;this.resetDatumAnimation(e),this.resetLabelAnimation(e);const c=()=>{this.resetPathAnimation(e),this.updateAreaPaths(r,n)},h=()=>{t.skipCurrentBatch(),c()};if(n==null||o==null){c(),dc(this,t,"added",i),Ru(this,"fill_path_properties",t,"add",a),Ru(this,"stroke_path_properties",t,"add",l),It(this,"labels",t,s);return}if(n.crossFiltering!==o.crossFiltering){h();return}const u=kM(n,o);if(u===void 0){h();return}else if(u.status==="no-op")return;dc(this,t,void 0,i),Ot(this.id,"fill_path_properties",t,[a],u.fill.pathProperties),Cu(this.id,"fill_path_update",t,[a],u.fill.path),Ot(this.id,"stroke_path_properties",t,[l],u.stroke.pathProperties),Cu(this.id,"stroke_path_update",t,[l],u.stroke.path),It(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 Pt}getFormattedMarkerStyle(e){const{xValue:t,yValue:i,xKey:s,yKey:n}=e,r=this.getSeriesDomain("x"),o=this.getSeriesDomain("y");return this.getMarkerStyle(this.properties.marker,e,_n(t,i,s,n,r,o),!0)}computeFocusBounds(e){return Pu(this,e)}hasItemStylers(){return this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};Fu.className="AreaSeries",Fu.type="area";var Q1={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"area",moduleFactory:e=>new Fu(e),stackable:!0,defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{nodeClickRange:"nearest",fill:{$palette:"fill"},fillGradientDefaults:Xo,fillPatternDefaults:vn,fillImageDefaults:Fr,stroke:{$palette:"stroke"},fillOpacity:.8,strokeOpacity:1,strokeWidth:{$isUserOption:["./stroke",2,0]},lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:Yn,xOffset:3,yOffset:3,blur:5},interpolation:{type:"linear"},marker:{enabled:!1,shape:"circle",size:7,strokeWidth:{$isUserOption:["./stroke",1,0]},fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:jl,fillPatternDefaults:vn},label:{...Qi,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$path:["/tooltip/range","nearest"]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:Xn()}}},OM={type:"series",name:"area",chartType:"cartesian",options:Q0,create:e=>new Fu(e)},mf=class extends Et{constructor(){super(...arguments),this.direction="x",this.featherRatio=0}get feathered(){return Math.abs(this.featherRatio)>1e-6}isPointInPath(e,t){return this.feathered?this.getBBox().containsPoint(e,t):super.isPointInPath(e,t)}updatePath(){if(!this.feathered){super.updatePath();return}const{path:e,x:t,y:i,width:s,height:n,direction:r,featherRatio:o}=this;if(e.clear(),r==="x"){const a=Math.abs(o)*s;o>0?(e.moveTo(t,i),e.lineTo(t+s-a,i),e.lineTo(t+s,i+n/2),e.lineTo(t+s-a,i+n),e.lineTo(t,i+n),e.closePath()):(e.moveTo(t+a,i),e.lineTo(t+s,i),e.lineTo(t+s,i+n),e.lineTo(t+a,i+n),e.lineTo(t,i+n/2),e.closePath())}else{const a=Math.abs(o)*n;o>0?(e.moveTo(t,i+a),e.lineTo(t+s/2,i),e.lineTo(t+s,i+a),e.lineTo(t+s,i+n),e.lineTo(t,i+n),e.closePath()):(e.moveTo(t,i),e.lineTo(t+s,i),e.lineTo(t+s,i+n-a),e.lineTo(t+s/2,i+n),e.lineTo(t,i+n-a),e.closePath())}}};f([F()],mf.prototype,"direction",2),f([F()],mf.prototype,"featherRatio",2);function yf(e,t){for(const i of t){const s=i.datum;s===void 0?j.error("undefined datum"):e.addValue(i,s)}}function ju(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 bf=class extends cr{constructor(){super(...arguments),this.direction="vertical"}};f([x],bf.prototype,"direction",2);var PM=class extends ao{constructor(){super(...arguments),this.groupScale=new Ho,this.smallestDataInterval=void 0,this.largestDataInterval=void 0}padBandExtent(e,t){const i=typeof t=="boolean"?1:.5,s=je(this.smallestDataInterval)?this.smallestDataInterval*i:0,n=tr(e)??[NaN,NaN];return typeof t=="boolean"?n[t?0:1]-=(t?1:-1)*s:(n[0]-=s,n[1]+=s),Ri(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 Ye.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=Ye.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 Kr?i.paddingInner=e.groupPaddingInner:e instanceof ea?(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){yf(e,this.datumNodesIter())}pickNodesExactShape(e){const t=ju(this,e);return t!=null&&t.distance<=0?[t.datum]:[]}pickNodeClosestDatum(e){return ju(this,e)}},J1=Mi,eN=Vi,tN=ts,iN=is,sN=Qs,nN=1e3;function RM(e,t){return Array.from({length:e},(i,s)=>{const n=s*Qs,r=t[n+Mi],o=t[n+Vi];return(r+o)/2|0})}function rN(e,t,i,s){if(t.length<nN)return;const[n,r]=uc(e,s);let o=lf(t),{indexData:a,valueData:l}=uf(t,i,i,n,r,o),c=RM(o,a);const h=[{maxRange:o,indexData:a,indices:c}];for(;o>64;)({indexData:a,valueData:l,maxRange:o}=df(a,l,o)),c=RM(o,a),h.push({maxRange:o,indexData:a,indices:c});return h.reverse(),h}var xf=class extends pt{constructor(){super(...arguments),this.placement="inside-center",this.spacing=0}};f([x],xf.prototype,"placement",2),f([x],xf.prototype,"spacing",2);var rt=class extends bf{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new Ki,this.fillPatternDefaults=new nt,this.fillImageDefaults=new Ii,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 qs,this.label=new xf,this.tooltip=oo(),this.sparklineMode=!1}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:r,lineDashOffset:o,cornerRadius:a}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:r,lineDashOffset:o,cornerRadius:a,opacity:1}}};f([x],rt.prototype,"xKey",2),f([x],rt.prototype,"xName",2),f([x],rt.prototype,"yKey",2),f([x],rt.prototype,"yName",2),f([x],rt.prototype,"yFilterKey",2),f([x],rt.prototype,"stackGroup",2),f([x],rt.prototype,"normalizedTo",2),f([x],rt.prototype,"fill",2),f([x],rt.prototype,"fillGradientDefaults",2),f([x],rt.prototype,"fillPatternDefaults",2),f([x],rt.prototype,"fillImageDefaults",2),f([x],rt.prototype,"fillOpacity",2),f([x],rt.prototype,"stroke",2),f([x],rt.prototype,"strokeWidth",2),f([x],rt.prototype,"strokeOpacity",2),f([x],rt.prototype,"lineDash",2),f([x],rt.prototype,"lineDashOffset",2),f([x],rt.prototype,"cornerRadius",2),f([x],rt.prototype,"crisp",2),f([x],rt.prototype,"itemStyler",2),f([x],rt.prototype,"shadow",2),f([x],rt.prototype,"label",2),f([x],rt.prototype,"tooltip",2),f([x],rt.prototype,"sparklineMode",2);function zM(e,t,i,s){if(t!=null){const[n,r]=t;if(n!==0||r!==1)return!1}if(Ye.is(e)){const n=e.calcBandwidth(s)-e.calcBandwidth(i);if(n>0&&n<1)return!1}if(pn.is(e)){const{bandwidth:n,step:r}=e;if(n>0&&n<1)return!1;const o=r-n;if(o>0&&o<1)return!1}return!0}var vf=e=>Md(e.yValue??0);function Bu(e,t,i){const{startingX:s,startingY:n}=aN(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&&!vf(a)?c+=a.height:!e&&vf(a)&&(l+=a.width));let p;return o.clipBBox==null?p=void 0:vf(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 oN(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 Vu(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"?{...gc(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={...gc(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=gs[a];return{...l,phase:c}},applyFn:(r,o,a)=>{r.setProperties(o),r.crisp=a==="end"&&(r.datum?.crisp??!1)}}}function aN(e,t){const i=t[e?"y":"x"];let s=1/0,n=0;return i?(e?n=i.scale.convert(Ye.is(i.scale)?0:Math.max(...i.range)):s=i.scale.convert(Ye.is(i.scale)?0:Math.min(...i.range)),{startingX:s,startingY:n}):{startingX:s,startingY:n}}function gc(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 Mf(e,t){if(t===void 0)return;const{x:i,y:s,width:n,height:r}=t;return dt.toCanvas(e.contentGroup,new U(i,s,n,r))}function FM(e,t,i,s,n,r){let o=r?.reduced?.diff?.[e];if(o?.changed)return o;const a=lN(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 jM(e){return typeof e=="object"&&e!==null&&"groupScale"in e}function lN(e,t){if(!t)return!1;const i=e.scales,s=t.scales;if(!lo(i.x,s.x)||!lo(i.y,s.y))return!0;if(!jM(e)||!jM(t))return!1;const n=e.groupScale,r=t.groupScale;return!lo(n,r)}var cN=il(rN),fc=class extends PM{constructor(e){super({moduleCtx:e,propertyKeys:xa,propertyNames:va,categoryKey:"xValue",pickModes:[2,1,0],pathsPerSeries:[],datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:gc,label:ro}}),this.properties=new rt,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}=this.properties,{seriesGrouping:{groupIndex:r=this.id}={},data:o}=this,l=(this.seriesGrouping?.stackCount??0)>1||n!=null,c=l,h=!this.ctx.animationManager.isSkipped(),u=this.getCategoryAxis()?.scale,d=this.getValueAxis()?.scale,{isContinuousX:p,xScaleType:g,yScaleType:m}=this.getScaleInformation({xScale:u,yScale:d}),b=`bar-stack-${r}-yValues`,y=`${b}-trailing`,v=this.visible?{}:{forceValue:0},M=[ir(t,g,{id:"xValue"}),tt(i,m,{id:"yValue-raw",invalidValue:null,...v})];this.crossFilteringEnabled()&&M.push(tt(s,m,{id:"yFilterValue",invalidValue:null,...v})),l&&M.push(...sr(i,"normal","current",{id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:b,separateNegative:!0,...v},m),...sr(i,"trailing","current",{id:"yValue-start",invalidValue:null,missingValue:0,groupId:y,separateNegative:!0,...v},m)),p&&M.push(O0,P0),je(n)&&M.push(du([b,y],Math.abs(n))),h&&this.processedData&&M.push(Kl(this.id,this.processedData)),(h||!c)&&M.push(Yl());const{dataModel:S,processedData:D}=await this.requestDataModel(e,o,{props:M,groupByKeys:c,groupByData:!c});this.dataAggregationFilters=this.aggregateData(S,D),this.smallestDataInterval=D.reduced?.smallestKeyInterval,this.largestDataInterval=D.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");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 ia)return Ri(n);{const o=Number.isFinite(n[1]-n[0])?[Math.min(0,n[0]),Math.max(0,n[1])]:[];return Ri(o)}}getSeriesRange(e,t){const i=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw",[s,n]=this.domainForVisibleRange("y",[i],"xValue",t);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){if(t.type!=="ungrouped"||ta(t))return;const i=this.axes.x;if(i==null)return;const s=e.resolveKeysById(this,"xValue",t),n=e.resolveColumnById(this,"yValue-raw",t),{index:r}=e.resolveProcessedDataDefById(this,"xValue"),o=t.domain.keys[r];return cN(i.scale.type,s,n,o)}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:g}=this.properties,m=this.getSeriesDomain("y"),b=r.isReversed(),{barWidth:y,groupIndex:v}=this.updateGroupScale(n),M=i.convert(String(v)),S=Ye.is(a)?y*-.5:0,D=e.resolveKeysById(this,"xValue",t),A=e.resolveColumnById(this,"yValue-raw",t),I=this.crossFilteringEnabled()?e.resolveColumnById(this,"yFilterValue",t):void 0,L=!this.ctx.animationManager.isSkipped(),C=Z=>a.convert(D[Z])+M+S,w=this.properties.crisp??zM(n?.scale,n?.visibleRange,this.smallestDataInterval,this.largestDataInterval),E=l.convert(0),R=({datum:Z,datumIndex:ce,xValue:X,yValue:ye,cumulativeValue:Se,phantom:ne,currY:ue,prevY:q,x:Q,width:ae,isPositive:de,yRange:J,labelText:$e,opacity:ht,featherRatio:ut,crossScale:Ke=1})=>{const Yt=de!==b,ie=l.convert(ue),fe=l.convert(q),De=l.convert(J),Me=this.getBarDirection()==="x",Ze=ae*.5*(1-Ke),Xe={x:Me?Math.min(ie,fe):Q+Ze,y:Me?Q+Ze:Math.min(ie,fe),width:Me?Math.abs(fe-ie):ae*Ke,height:Me?ae*Ke:Math.abs(fe-ie)},Si=new U(Xe.x,Xe.y,Xe.width,Xe.height),os={x:Me?Math.min(E,De):Q+Ze,y:Me?Q+Ze:Math.min(E,De),width:Me?Math.abs(E-De):ae*Ke,height:Me?ae*Ke:Math.abs(E-De)},dr=this.shouldFlipXY()?Xe.height:Xe.width,ho=g.spacing+(typeof g.padding=="number"?g.padding:0);return{series:this,itemId:ne?Cn(h,ne):h,datum:Z,datumIndex:ce,cumulativeValue:Se,phantom:ne,xValue:X,yValue:ye,yKey:h,xKey:c,capDefaults:{lengthRatioMultiplier:dr,lengthMax:dr},x:os.x,y:os.y,width:os.width,height:os.height,midPoint:{x:Xe.x+Xe.width/2,y:Xe.y+Xe.height/2},opacity:ht,featherRatio:ut,topLeftCornerRadius:Me!==Yt,topRightCornerRadius:Yt,bottomRightCornerRadius:Me===Yt,bottomLeftCornerRadius:!Yt,clipBBox:Si,crisp:w,label:$e!=null?{text:$e,...sM({isUpward:Yt,isVertical:!Me,placement:g.placement,spacing:ho,rect:Xe})}:void 0,missing:ye==null,focusable:!ne}},P=[],G=[],H=[],oe=(Z,ce,X,ye,Se,ne,ue=0,q=1)=>{const Q=D[Z];if(Q==null)return;const ae=o[Z],de=A[Z],J=I!=null?Number(I[Z]):void 0,$e=de>=0&&!Object.is(de,-0);if(!Number.isFinite(Se)||J!=null&&!Number.isFinite(J))return;const ht=g.enabled&&de!=null?this.getLabelText(J??de,ae,h,"y",m,g,{datum:ae,value:J??de,xKey:c,yKey:h,xName:u,yName:d,legendItemName:p}):void 0,ut=J!=null&&J>de,Ke=R({datum:ae,datumIndex:Z,xValue:Q,yValue:J??de,cumulativeValue:J??Se,phantom:!1,currY:J!=null?ye+J:Se,prevY:ye,x:ce,width:X,isPositive:$e,yRange:Math.max(ye+(J??-1/0),ne),labelText:ht,opacity:q,featherRatio:ue,crossScale:ut?.6:void 0});if(G.push(Ke),H.push(Ke),J!=null){const Yt=R({datum:o[Z],datumIndex:Z,xValue:Q,yValue:J,cumulativeValue:J,phantom:!0,currY:Se,prevY:ye,x:ce,width:X,isPositive:$e,yRange:ne,labelText:void 0,opacity:q,featherRatio:ue,crossScale:void 0});P.push(Yt)}},[me,ke]=a.range,Te=Math.abs(ke-me),xe=s?.find(Z=>Z.maxRange>Te);if(t.type==="grouped"){const Z=y,ce=e.hasColumnById(this,"yValue-start"),X=ce?e.resolveColumnById(this,"yValue-start",t):void 0,ye=ce?e.resolveColumnById(this,"yValue-end",t):void 0,Se=ce?e.resolveProcessedDataIndexById(this,"yValue-range"):-1;for(const{datumIndex:ne,group:{aggregation:ue}}of e.forEachGroupDatum(this,t)){const q=C(ne),Q=A[ne],ae=Q>=0&&!Object.is(Q,-0),de=ce?Number(X?.[ne]):0,J=ce?Number(ye?.[ne]):Q;let $e=J;ce&&($e=ue[Se][ae?1:0]),oe(ne,q,Z,de,J,$e)}}else if(xe==null){const Z=t.invalidData?.get(this.id),ce=y;let[X,ye]=this.visibleRangeIndices("xValue",n.range);t.input.count<1e3&&(X=0,ye=t.input.count);for(let Se=X;Se<ye;Se+=1){if(Z?.[Se]===!0)continue;const ne=C(Se),ue=Number(A[Se]);oe(Se,ne,ce,0,ue,ue)}}else{const{indexData:Z,indices:ce}=xe,[X,ye]=this.visibleRangeIndices("xValue",n.range,ce),Se=b?-1:1;for(let ne=X;ne<ye;ne+=1){const ue=ne*sN,q=Z[ue+J1],Q=Z[ue+eN],ae=Z[ue+tN],de=Z[ue+iN];if(q===-1)continue;const J=C((q+Q)/2|0),$e=Math.abs(C(Q)-C(q))+y,ht=Math.abs(Q-q),ut=pn.is(a)?a.bandwidth*Math.max(ht-1,1)/(a.step*ht):1,Ke=D[de]!=null?Number(A[de]):NaN,Yt=D[ae]!=null?Number(A[ae]):NaN;if(Ke>0){const ie=Yt>=0?Se*(1-Yt/Ke):Se;oe(de,J,$e,0,Ke,Ke,ie,ut)}if(Yt<0){const ie=Ke<=0?-Se*(1-Ke/Yt):-Se;oe(ae,J,$e,0,Yt,Yt,ie,ut)}}}return{itemId:h,nodeData:P.length>0?[...P,...G]:G,labelData:H,scales:this.calculateScaling(),visible:this.visible||L,groupScale:this.getScaling(this.groupScale)}}nodeFactory(){return new mf}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))}getItemStyle(e,t){const{id:i,properties:s}=this,{xKey:n,yKey:r,itemStyler:o,fillGradientDefaults:a,fillPatternDefaults:l,fillImageDefaults:c}=s,{xValue:h,yValue:u,datum:d,datumIndex:p}=e,g=this.getHighlightStyle(t,p);let m=Us(Ee(g,s.getStyle()),a,l,c);if(o&&e!=null){const{xDomain:b,yDomain:y}=this.cachedDatumCallback("domain",()=>({xDomain:this.getSeriesDomain("x"),yDomain:this.getSeriesDomain("y")})),v=this.cachedDatumCallback(Cn(this.getDatumId(e),t?"highlight":"node"),()=>{const M=this.ctx.highlightManager?.getActiveHighlight(),S=this.getHighlightStateString(M,t,p);return this.callWithContext(o,{seriesId:i,..._n(h,u,n,r,b,y),datum:d,xValue:h,yValue:u,highlighted:t,highlightState:S,...m})});v&&(m=Us(Ee(v,m),a,l,c))}return m}updateDatumNodes(e){const{shadow:t}=this.properties,i=this.getCategoryDirection()==="x",s=this.getShapeFillBBox(),n=this.getBarDirection();e.datumSelection.each((r,o)=>{const a=this.getItemStyle(o,e.isHighlight);bn(r,a,s);const l=a.cornerRadius??0;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.direction=n,r.featherRatio=o.featherRatio,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){const{isHighlight:t=!1}=e,i={xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xKey,yKey:this.properties.yKey,yName:this.properties.yName??this.properties.yKey,legendItemName:this.properties.legendItemName??this.properties.xName??this.properties.xKey};e.labelSelection.each((s,n)=>{s.fillOpacity=this.getHighlightStyle(t,n?.datumIndex).opacity??1;const r=this.ctx.highlightManager?.getActiveHighlight(),o=this.getHighlightStateString(r,t,n.datumIndex);iM(this,s,i,this.properties.label,n.label,t,o)})}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(),g=this.contextNodeData?.nodeData?.[e];if(!i||!s||!d||!p||!g)return;const m=s.dataSources.get(this.id)?.[e],b=i.resolveKeysById(this,"xValue",s)[e],y=i.resolveColumnById(this,"yValue-raw",s)[e];if(b==null)return;const v=this.getItemStyle(g,!1);return this.formatTooltipWithContext(u,{heading:this.getAxisValueText(d,"tooltip",b,m,r,c),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:a,value:this.getAxisValueText(p,"tooltip",y,m,a,c)}]},{seriesId:t,datum:m,title:l,xKey:r,xName:o,yKey:a,yName:l,legendItemName:c,stackGroup:h,...v,...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:Us({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=Vu(Bu(this.isVertical(),this.axes,"normal"));Ot(this.id,"nodes",this.ctx.animationManager,[e],s),It(this,"labels",this.ctx.animationManager,t),It(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=FM(this.id,t,this.getDatumId.bind(this),e.contextData,r,this.processedData),a=r==null?"fade":"normal",l=Vu(Bu(this.isVertical(),this.axes,a));Ot(this.id,"nodes",this.ctx.animationManager,[t],l,(c,h)=>this.getDatumId(h),o),(o?.changed||!lo(n.groupScale,r?.groupScale))&&(It(this,"labels",this.ctx.animationManager,i),It(this,"annotations",this.ctx.animationManager,...s))}getDatumId(e){return Cn(e.xValue,e.phantom)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){const t=this.contextNodeData?.nodeData[e].clipBBox;return Mf(this,t)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};fc.className="BarSeries",fc.type="bar";var BM={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bar",moduleFactory:e=>new fc(e),stackable:!0,groupable:!0,defaultAxes:c0,themeTemplate:{series:{direction:"vertical",fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:Xo,fillPatternDefaults:vn,fillImageDefaults:Fr,fillOpacity:1,strokeWidth:{$isUserOption:["./stroke",2,0]},lineDash:[0],lineDashOffset:0,label:{...Qi,padding:{$isUserOption:["./spacing",0,8]},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:"chartBackgroundColor"}]},placement:"inside-center"},shadow:{enabled:!1,color:Yn,xOffset:3,yOffset:3,blur:5},errorBar:{cap:{lengthRatio:.3}},highlight:Xn()}}},VM={type:"series",name:"bar",chartType:"cartesian",options:mu,create:e=>new fc(e)},Gu=3,hN=5;function GM(e,t,i,s,n,r,o,a,l,c,h){let u=0,d=1/0;const p=(a+c)/2,g=(l+h)/2;for(const m of o){const b=e[m],y=t[m];if(b==null||y==null)continue;const v=kn(b,i,n),M=kn(y,s,r),S=(v-p)**2+(M-g)**2;S<d&&(d=S,u=m)}return u}function uN(e,t,i,s,n,r,o,a,l,c,h){let u=0;for(const d of o){const p=e[d],g=t[d];if(p==null||g==null)continue;const m=kn(p,i,n),b=kn(g,s,r);m>=a&&m<=c&&b>=l&&b<=h&&(u+=1)}return u}function Sf(e,t,i,s,n,r,o,a,l,c,h){if(o.length<hN)return;if(a===c&&l===h){const y=GM(e,t,i,s,n,r,o,a,l,c,h);return{scale:0,x0:a,y0:l,x1:c,y1:h,indices:o,primaryDatumIndex:y,children:null}}const u=[{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]}],d=(a+c)/2,p=(l+h)/2;for(const y of o){const v=e[y],M=t[y];if(v==null||M==null)continue;const S=kn(v,i,n),D=kn(M,s,r),A=(S>d?1:0)+(D>p?2:0),I=u[A];I.indices.push(y),I.x0=Math.min(I.x0,S),I.y0=Math.min(I.y0,D),I.x1=Math.max(I.x1,S),I.y1=Math.max(I.y1,D)}let g=[];for(const y of u){const{indices:v,x0:M,x1:S,y0:D,y1:A}=y,I=Sf(e,t,i,s,n,r,v,M,D,S,A);I!=null&&g.push(I)}if(g.length===1)return g[0];g.length===0&&(g=null);const m=Math.hypot(c-a,h-l),b=GM(e,t,i,s,n,r,o,a,l,c,h);return{scale:m,x0:a,y0:l,x1:c,y1:h,indices:o,primaryDatumIndex:b,children:g}}function dN(e,t,i,s,n,r,o,a){const[l,c]=uc(e,r),[h,u]=uc(t,o),[d,p]=a,g=[];if(n!=null&&p>d){const m=Array.from({length:Gu},()=>[]);for(let b=0;b<n.length;b+=1){const M=(n[b]-d)/(p-d)*Gu|0;M>=0&&M<Gu&&m[M].push(b)}for(let b=0;b<m.length;b+=1){const y=m[b],v=Sf(i,s,l,h,c,u,y,0,0,1,1);if(v!=null){const M=b/Gu;g.push({sizeRatio:M,node:v})}}}else{const m=i.map((y,v)=>v),b=Sf(i,s,l,h,c,u,m,0,0,1,1);b!=null&&g.push({sizeRatio:0,node:b})}return g.length>0?{xValues:i,yValues:s,xd0:l,xd1:c,yd0:h,yd1:u,filters:g}:void 0}function _M(e,t,i,s,n,r){const{xRange:o,yRange:a,xVisibleRange:[l,c],yVisibleRange:[h,u],minSize:d,maxSize:p}=i,{xValues:g,yValues:m,xd0:b,xd1:y,yd0:v,yd1:M}=t,S=1/Math.min(o/(c-l),a/(u-h));for(const{sizeRatio:D,node:A}of t.filters){const I=.5*(d+D*(p-d)),L=I*S,C=e*L,w=l-I/o,E=c+I/o,R=h-I/a,P=u+I/a,G=[A];for(;G.length>0;){const H=G.pop();if(!(H.x1<w||H.x0>E||H.y1<R||H.y0>P))if(H.scale<=C)s!=null&&(s.count+=1),n?.push({datumIndex:H.primaryDatumIndex,count:H.indices.length,dilation:se(1,H.scale/L,e)});else if(H.children==null){const{indices:oe}=H;if(s!=null){const ke=H.x0>=l&&H.x1<=c&&H.y0>=h&&H.y1<=u?oe.length:uN(g,m,b,v,y,M,oe,l,h,c,u);s.count+=ke}r?.push(...oe)}else G.push(...H.children)}}}function Df(e,t,i){const s={count:0};return _M(e,t,i,s,void 0,void 0),s.count}var pN=100,gN=12;function fN(e,t,i){let s=1,n=2;for(;Df(n,e,t)>i&&n<pN;)s*=2,n*=2;for(let r=0;r<gN;r+=1){const o=(n+s)/2;Df(o,e,t)>i?s=o:n=o}return s}function mN(e,t,i){const s=[],n=[];return _M(e,t,i,void 0,s,n),{groupedAggregation:s,singleDatumIndices:n}}var If=class extends Zt{constructor(){super(...arguments),this.maxSize=30}};f([x,F()],If.prototype,"maxSize",2),f([x,Pd()],If.prototype,"domain",2);var HM=class extends pt{constructor(){super(...arguments),this.placement="top"}};f([x],HM.prototype,"placement",2);var Ve=class extends cr{constructor(){super(...arguments),this.label=new HM,this.tooltip=oo(),this.maxRenderedItems=1/0,this.marker=new If}};f([x],Ve.prototype,"xKey",2),f([x],Ve.prototype,"yKey",2),f([x],Ve.prototype,"sizeKey",2),f([x],Ve.prototype,"labelKey",2),f([x],Ve.prototype,"xFilterKey",2),f([x],Ve.prototype,"yFilterKey",2),f([x],Ve.prototype,"sizeFilterKey",2),f([x],Ve.prototype,"xName",2),f([x],Ve.prototype,"yName",2),f([x],Ve.prototype,"sizeName",2),f([x],Ve.prototype,"labelName",2),f([x],Ve.prototype,"title",2),f([Gt("marker.shape")],Ve.prototype,"shape",2),f([Gt("marker.size")],Ve.prototype,"size",2),f([Gt("marker.maxSize")],Ve.prototype,"maxSize",2),f([Gt("marker.domain")],Ve.prototype,"domain",2),f([Gt("marker.fillGradientDefaults")],Ve.prototype,"fillGradientDefaults",2),f([Gt("marker.fillPatternDefaults")],Ve.prototype,"fillPatternDefaults",2),f([Gt("marker.fillImageDefaults")],Ve.prototype,"fillImageDefaults",2),f([Gt("marker.fill")],Ve.prototype,"fill",2),f([Gt("marker.fillOpacity")],Ve.prototype,"fillOpacity",2),f([Gt("marker.stroke")],Ve.prototype,"stroke",2),f([Gt("marker.strokeWidth")],Ve.prototype,"strokeWidth",2),f([Gt("marker.strokeOpacity")],Ve.prototype,"strokeOpacity",2),f([Gt("marker.lineDash")],Ve.prototype,"lineDash",2),f([Gt("marker.lineDashOffset")],Ve.prototype,"lineDashOffset",2),f([Gt("marker.itemStyler")],Ve.prototype,"itemStyler",2),f([x],Ve.prototype,"label",2),f([x],Ve.prototype,"tooltip",2),f([x],Ve.prototype,"maxRenderedItems",2);var yN=class extends tf{constructor(e,t,i,s){super(e,t,i,s),this.sizeKey=s.properties.sizeKey}},mc=class extends ao{constructor(e){super({moduleCtx:e,propertyKeys:{...xa,label:["labelKey"],size:["sizeKey"]},propertyNames:{...va,label:["labelName"],size:["sizeName"]},categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],datumSelectionGarbageCollection:!1,animationResetFns:{label:ro,datum:Ou},usesPlacedLabels:!0,clipFocusBox:!1}),this.NodeEvent=yN,this.properties=new Ve,this.dataAggregation=void 0,this.sizeScale=new Zr}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:g,processedData:m}=await this.requestDataModel(e,this.data,{props:[tt(o,s,{id:"xValue"}),tt(a,n,{id:"yValue"}),...c!=null?[tt(c,s,{id:"xFilterValue"})]:[],...h!=null?[tt(h,n,{id:"yFilterValue"})]:[],...u!=null?[tt(u,r,{id:"sizeFilterValue"})]:[],...l?[tt(l,r,{id:"sizeValue"})]:[],...d?[tt(d,"category",{id:"labelValue"})]:[]]});this.dataAggregation=this.aggregateData(g,m);const b=l?g.resolveProcessedDataIndexById(this,"sizeValue"):void 0,y=p.domain?[p.domain[0],p.domain[1]]:void 0;this.sizeScale.domain=y??(b==null?void 0:m.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);return Ri(tr(c))}getSeriesRange(e,t){return this.domainForVisibleRange("y",["yValue"],"xValue",t)}getVisibleItems(e,t,i){const{dataAggregation:s,axes:n}=this,r=n.x,o=n.y;if(s==null||r==null||o==null)return this.countVisibleItems("xValue",["yValue"],e,t,i);const a=this.aggregationOptions(r,o,e,t??[0,1]);return Df(0,s,a)}aggregateData(e,t){if(t.type==="grouped"||t.input.count<=this.properties.maxRenderedItems)return;const i=this.axes.x,s=this.axes.y;if(i==null||s==null)return;const n=i.scale,r=s.scale;if(!Ye.is(n)||!Ye.is(r))return;const{sizeScale:o,properties:a}=this,{sizeKey:l}=a,c=e.resolveColumnById(this,"xValue",t),h=e.resolveColumnById(this,"yValue",t),u=l?e.resolveColumnById(this,"sizeValue",t):void 0,d=e.getDomain(this,"xValue","value",t),p=e.getDomain(this,"yValue","value",t),g=l?o.domain:[0,0];return dN(n.type,r.type,c,h,u,d,p,g)}aggregationOptions(e,t,i=e.visibleRange,s=t.visibleRange){const{sizeKey:n,marker:r}=this.properties,o=Math.abs(e.range[1]-e.range[0]),a=Math.abs(t.range[1]-t.range[0]),l=r.size,c=n?r.maxSize:l;return{xRange:o,yRange:a,minSize:l,maxSize:c,xVisibleRange:i,yVisibleRange:s}}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:g,labelName:m,label:b,marker:y,maxRenderedItems:v}=this.properties,{enabled:M,placement:S}=b,D=Pt.anchor(y.shape),A=e.x,I=e.y;if(!(t&&i&&n&&A&&I))return;const L=t.resolveColumnById(this,"xValue",i),C=t.resolveColumnById(this,"yValue",i),w=a!=null?t.resolveColumnById(this,"sizeValue",i):void 0,E=u!=null?t.resolveColumnById(this,"labelValue",i):void 0,R=l!=null?t.resolveColumnById(this,"xFilterValue",i):void 0,P=c!=null?t.resolveColumnById(this,"yFilterValue",i):void 0,G=h!=null?t.resolveColumnById(this,"sizeFilterValue",i):void 0;let H;u?H=[]:a?H=t.getDomain(this,"sizeValue","value",i):H=[];const oe=A.scale,me=I.scale,ke=(oe.bandwidth??0)/2,Te=(me.bandwidth??0)/2,xe=[];s.range=[y.size,y.maxSize];const Z=Gn.getMeasurer({font:b}),ce=i.dataSources.get(this.id);if(ce==null)return;const X=_o(b),ye=(ne,ue,q)=>{const Q=ce[ne],ae=L[ne],de=C[ne],J=w?.[ne],$e=oe.convert(ae)+ke,ht=me.convert(de)+Te;let ut;R!=null&&P!=null&&(ut=R[ne]===ae&&P[ne]===de,G!=null&&ut&&(ut=G[ne]===J));let Ke;if(M){let ie,fe,De;u&&E?(ie=E[ne],fe=u,De="label"):a?(ie=J,fe=a,De="size"):(ie=de,fe=o,De="y");const Me=this.getLabelText(ie,Q,fe,De,H,b,{value:ie,datum:Q,xKey:r,yKey:o,sizeKey:a,labelKey:u,xName:d,yName:p,sizeName:g,labelName:m}),Ze=Z.measureText(String(Me));Ze.width+=X.left+X.right,Ze.height+=X.bottom+X.top,Ke={text:Me,...Ze}}else Ke={text:"",width:0,height:0};const Yt=J!=null?s.convert(J):y.size;xe.push({series:this,itemId:o,yKey:o,xKey:r,datum:Q,datumIndex:ne,xValue:ae,yValue:de,sizeValue:J,capDefaults:{lengthRatioMultiplier:y.getDiameter(),lengthMax:1/0},point:{x:$e,y:ht,size:Math.sqrt(q)*Yt},midPoint:{x:$e,y:ht},label:Ke,anchor:D,placement:S,count:ue,dilation:q,selected:ut})},{dataAggregation:Se}=this;if(Se==null)for(let ne=0;ne<ce.length;ne++)ye(ne,1,1);else{const ne=this.aggregationOptions(A,I),ue=fN(Se,ne,v),{groupedAggregation:q,singleDatumIndices:Q}=mN(ue,Se,ne);for(const{datumIndex:ae,count:de,dilation:J}of q)ye(ae,de,J);for(const ae of Q)ye(ae,1,1)}return{itemId:o,nodeData:xe,labelData:M?xe:[],scales:this.calculateScaling(),visible:this.visible}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,{sizeKey:s}=this.properties;this.properties.marker.isDirty()&&(i.clear(),i.cleanup());const n=this.properties.marker.enabled?t:[];let r;return s&&(r=o=>Cn([o.xValue,o.yValue,o.sizeValue,o.label.text])),i.update(n,void 0,r)}updateDatumNodes(e){const{datumSelection:t,isHighlight:i}=e,{xKey:s,yKey:n,sizeKey:r,labelKey:o,marker:a}=this.properties;this.sizeScale.range=[a.size,a.maxSize];const l=this.getShapeFillBBox(),c=this.dataAggregation!=null,h={xKey:s,yKey:n,sizeKey:r,labelKey:o};t.each((u,d,p)=>{const{count:g,dilation:m}=d,b=this.getMarkerStyle(a,d,h,i);b.fillOpacity=(1-(1-(b.fillOpacity??1))**g)/Math.sqrt(m),this.applyMarkerStyle(b,u,d.point,l,{selected:d.selected}),u.zIndex=c?[-g,p]:0}),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{isHighlight:t=!1}=e,i=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((s,n)=>{const r=t||this.isSeriesHighlighted(i),o=this.getHighlightStateString(i,r,n.datumIndex),a=Xs(this,n,this.properties,this.properties.label,r,o);s.text=n.label.text,s.fill=a.color,s.x=n.point?.x??0,s.y=n.point?.y??0,s.fontStyle=a.fontStyle,s.fontWeight=a.fontWeight,s.fontSize=a.fontSize,s.fontFamily=a.fontFamily,s.textAlign="left",s.textBaseline="top",s.fillOpacity=this.getHighlightStyle(t,n.datumIndex).opacity??1,s.setBoxing(a)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:r,ctx:o}=this,{formatManager:a}=o,{xKey:l,xName:c,yKey:h,yName:u,sizeKey:d,sizeName:p,labelKey:g,labelName:m,title:b,tooltip:y,marker:v,legendItemName:M}=r,S=n.x,D=n.y;if(!i||!s||!S||!D)return;const A=s.dataSources.get(this.id)?.[e],I=i.resolveColumnById(this,"xValue",s)[e],L=i.resolveColumnById(this,"yValue",s)[e],C=this.contextNodeData?.nodeData[e];if(I==null||C==null)return;const w=[];if(this.isLabelEnabled()&&g!=null){const R=i.resolveColumnById(this,"labelValue",s)[e],P=a.format(this.callWithContext.bind(this),{type:"category",value:R,datum:A,seriesId:t,legendItemName:M,key:g,source:"tooltip",property:"label",domain:[],boundSeries:this.getFormatterContext("label")});w.push({label:m,fallbackLabel:g,value:P??Eo(R)})}if(w.push({label:c,fallbackLabel:l,value:this.getAxisValueText(S,"tooltip",I,A,l,M)},{label:u,fallbackLabel:h,value:this.getAxisValueText(D,"tooltip",L,A,h,M)}),d!=null){const R=i.resolveColumnById(this,"sizeValue",s)[e],P=i.getDomain(this,"sizeValue","value",s),G=a.format(this.callWithContext.bind(this),{type:"number",value:R,datum:A,seriesId:t,legendItemName:M,key:d,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:P,fractionDigits:void 0});w.push({label:p,fallbackLabel:d,value:G??Eo(R)})}const E=this.getMarkerStyle(v,{datum:A,datumIndex:e},{xKey:l,yKey:h,sizeKey:d,labelKey:g,highlighted:!0},!1);return this.formatTooltipWithContext(y,{title:b,symbol:this.legendItemSymbol(),data:w},{seriesId:t,datum:A,title:h,xKey:l,xName:c,yKey:h,yName:u,sizeKey:d,sizeName:p,labelKey:g,labelName:m,...E,...this.getModuleTooltipParams()})}legendItemSymbol(){return{marker:this.getMarkerStyle(this.properties.marker,{},void 0,!1,void 0,void 0,!1)}}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({datumSelection:e,labelSelection:t}){EM(this,this.ctx.animationManager,e),It(this,"labels",this.ctx.animationManager,t)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Pt}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)}computeFocusBounds(e){return Pu(this,e)}hasItemStylers(){const{itemStyler:e,marker:t,label:i}=this.properties;return!!(e??t.itemStyler??i.itemStyler)}};mc.className="BubbleSeries",mc.type="bubble";var bN={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bubble",moduleFactory:e=>new mc(e),defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{shape:"circle",size:7,maxSize:30,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:jl,fillPatternDefaults:vn,fillImageDefaults:Fr,fillOpacity:.8,maxRenderedItems:1e4,label:{...Qi,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$path:["/tooltip/range","nearest"]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:Xn()}}},UM={type:"series",name:"bubble",chartType:"cartesian",options:sw,create:e=>new mc(e)},vt=class extends cr{constructor(){super(...arguments),this.fillGradientDefaults=new Ki,this.fillPatternDefaults=new nt,this.fillImageDefaults=new Ii,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 qs,this.label=new pt,this.tooltip=oo()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:r,lineDashOffset:o,cornerRadius:a}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:r,lineDashOffset:o,cornerRadius:a,opacity:1}}};f([x],vt.prototype,"xKey",2),f([x],vt.prototype,"yKey",2),f([x],vt.prototype,"xName",2),f([x],vt.prototype,"yName",2),f([x],vt.prototype,"fill",2),f([x],vt.prototype,"fillGradientDefaults",2),f([x],vt.prototype,"fillPatternDefaults",2),f([x],vt.prototype,"fillImageDefaults",2),f([x],vt.prototype,"fillOpacity",2),f([x],vt.prototype,"stroke",2),f([x],vt.prototype,"strokeWidth",2),f([x],vt.prototype,"strokeOpacity",2),f([x],vt.prototype,"lineDash",2),f([x],vt.prototype,"lineDashOffset",2),f([x],vt.prototype,"cornerRadius",2),f([x],vt.prototype,"areaPlot",2),f([x],vt.prototype,"bins",2),f([x],vt.prototype,"aggregation",2),f([x],vt.prototype,"binCount",2),f([x],vt.prototype,"shadow",2),f([x],vt.prototype,"label",2),f([x],vt.prototype,"tooltip",2);var $M=10,_u=class extends ao{constructor(e){super({moduleCtx:e,propertyKeys:xa,propertyNames:va,categoryKey:void 0,pickModes:[1,0],datumSelectionGarbageCollection:!0,animationResetFns:{datum:gc,label:ro}}),this.properties=new vt,this.calculatedBins=[]}deriveBins(e){const t=yl(e[0],e[1],$M).ticks,i=bl(e[0],e[1],$M),[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=[ir(t,a),R0];if(i){let u=Dg("groupAgg");n==="count"||(n==="sum"?u=S0("groupAgg"):n==="mean"&&(u=D0("groupAgg"))),s&&(u=Ig("groupAgg",u)),c.push(tt(i,l,{invalidValue:void 0}),u)}else{c.push(k0("count"));let u=Dg("groupAgg");s&&(u=Ig("groupAgg",u)),c.push(u)}const h=u=>{const d=Ri(u.domain.keys[0]);if(d.length===0)return u.domain.groups=[],()=>[];const p=Tc(this.properties.binCount)?this.calculateNiceBins(d,this.properties.binCount):this.properties.bins??this.deriveBins(d),g=p.length;return this.calculatedBins=[...p],m=>{let b=m[0];if(go(b)&&(b=b.getTime()),!Tc(b))return[];for(let y=0;y<g;y++){const v=p[y];if(b>=v[0]&&b<v[1]||y===g-1&&b<=v[1])return v}return[]}};!this.ctx.animationManager.isSkipped()&&this.processedData&&c.push(Kl(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 Ri(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,[g,m]=_t([r.convert(d),r.convert(p)]);if(m>=t&&g<=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{axes:e,processedData:t,dataModel:i}=this,s=e.x,n=e.y;if(!s||!n||!i)return;const{scale:r}=s,{scale:o}=n,{xKey:a,yKey:l,xName:c,yName:h,label:u}=this.properties,d=[],p={itemId:this.properties.yKey??this.id,nodeData:d,labelData:d,scales:this.calculateScaling(),animationValid:!0,visible:this.visible};return!this.visible||t==null||t.type!=="grouped"||(t.groups.forEach((g,m)=>{const{keys:b,aggregation:y}=g,[[v,M]=[0,0]]=y,S=this.frequency(g),D=b,[A,I]=D,L=[...i.forEachDatum(this,t,g)],C=r.convert(A),w=r.convert(I),E=v+M,R=o.convert(0),P=o.convert(E),G=Math.abs(w-C),H=Math.abs(P-R),oe=Math.min(C,w),me=Math.min(R,P);let ke;u.enabled&&E!==0&&(ke={x:oe+G/2,y:me+H/2,text:this.getLabelText(E,L,l,"y",[],u,{value:E,datum:L,xKey:a,yKey:l,xName:c,yName:h})});const Te={x:oe+G/2,y:me+H/2},xe=n.isReversed();d.push({series:this,datumIndex:m,datum:L,aggregatedValue:E,frequency:S,domain:D,yKey:l,xKey:a,x:oe,y:me,xValue:C,yValue:P,width:G,height:H,midPoint:Te,topLeftCornerRadius:!xe,topRightCornerRadius:!xe,bottomRightCornerRadius:xe,bottomLeftCornerRadius:xe,label:ke,crisp:!0})}),d.sort((g,m)=>g.x-m.x)),p}nodeFactory(){return new Et}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e;return i.update(t,void 0,s=>s.domain.join("_"))}getItemStyle(e,t){const{properties:i}=this,s=this.getHighlightStyle(e,t?.datumIndex);return Us(Ee(s,i.getStyle()),i.fillGradientDefaults,i.fillPatternDefaults,i.fillImageDefaults)}updateDatumNodes(e){const{isHighlight:t}=e,{shadow:i}=this.properties,s=this.getShapeFillBBox();e.datumSelection.each((n,r)=>{const o=this.getItemStyle(t,r),{cornerRadius:a=0}=o,{topLeftCornerRadius:l,topRightCornerRadius:c,bottomRightCornerRadius:h,bottomLeftCornerRadius:u}=r;bn(n,o,s),n.topLeftCornerRadius=l?a:0,n.topRightCornerRadius=c?a:0,n.bottomRightCornerRadius=h?a:0,n.bottomLeftCornerRadius=u?a:0,n.crisp=r.crisp,n.fillShadow=i,n.visible=r.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 t=this.isLabelEnabled();e.labelSelection.each((i,s)=>{const n=Xs(this,s,this.properties,this.properties.label),{enabled:r,fontStyle:o,fontWeight:a,fontSize:l,fontFamily:c,color:h}=n;r&&t&&s?.label?(i.text=s.label.text,i.x=s.label.x,i.y=s.label.y,i.fontStyle=o,i.fontWeight=a,i.fontFamily=c,i.fontSize=l,i.fill=h,i.visible=!0,i.fillOpacity=this.getHighlightStyle(!1,s.datumIndex).opacity??1,i.setBoxing(n)):i.visible=!1})}initQuadTree(e){const{value:t}=this.contentGroup.children().next();t instanceof ge&&yf(e,t.children())}pickNodeClosestDatum(e){return ju(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,legendItemName:d}=r,p=n.x,g=n.y;if(!i||s?.type!=="grouped"||!p||!g)return;const m=s.groups[e],{aggregation:b,keys:y}=m,[[v,M]=[0,0]]=b,S=this.frequency(m),D=y,[A,I]=D,L=v+M,C={data:[...i.forEachDatum(this,s,m)],aggregatedValue:L,frequency:S,domain:D},w=[{label:l,fallbackLabel:a,value:`${this.getAxisValueText(p,"tooltip",A,C,a,d)} - ${this.getAxisValueText(p,"tooltip",I,C,a,d)}`},{label:o.t("seriesHistogramTooltipFrequency"),value:this.getAxisValueText(g,"tooltip",S,C,c,d)}];if(c!=null){let E;switch(r.aggregation){case"sum":E=o.t("seriesHistogramTooltipSum",{yName:h??c});break;case"mean":E=o.t("seriesHistogramTooltipMean",{yName:h??c});break;case"count":E=o.t("seriesHistogramTooltipCount",{yName:h??c});break}w.push({label:E,value:this.getAxisValueText(g,"tooltip",L,C,c,d)})}return this.formatTooltipWithContext(u,{symbol:this.legendItemSymbol(),data:w},{seriesId:t,datum:C,title:h,xKey:a,xName:l,yKey:c,yName:h,xRange:[A,I],frequency:S,...this.getItemStyle(!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:Us({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=Vu(Bu(!0,this.axes,"normal"));Ot(this.id,"datums",this.ctx.animationManager,[e],i),It(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetDatumAnimation(e)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return Mf(this,this.contextNodeData?.nodeData[e])}hasItemStylers(){return this.properties.label.itemStyler!=null}};_u.className="HistogramSeries",_u.type="histogram";var xN={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"histogram",moduleFactory:e=>new _u(e),defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:Xo,fillPatternDefaults:vn,fillImageDefaults:Fr,strokeWidth:1,fillOpacity:1,strokeOpacity:1,lineDash:[0],lineDashOffset:0,label:{...Qi,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},shadow:{enabled:!1,color:Yn,xOffset:3,yOffset:3,blur:5},highlight:Xn()}}},WM={type:"series",name:"histogram",chartType:"cartesian",enterprise:!0,options:nw,create:e=>new _u(e)},jt=class extends cr{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new Ma,this.marker=new Zt,this.label=new pt,this.tooltip=oo(),this.connectMissingData=!1,this.sparklineMode=!1}};f([x],jt.prototype,"xKey",2),f([x],jt.prototype,"yKey",2),f([x],jt.prototype,"xName",2),f([x],jt.prototype,"yName",2),f([x],jt.prototype,"yFilterKey",2),f([x],jt.prototype,"stackGroup",2),f([x],jt.prototype,"normalizedTo",2),f([x],jt.prototype,"title",2),f([x],jt.prototype,"stroke",2),f([x],jt.prototype,"strokeWidth",2),f([x],jt.prototype,"strokeOpacity",2),f([x],jt.prototype,"lineDash",2),f([x],jt.prototype,"lineDashOffset",2),f([x],jt.prototype,"interpolation",2),f([x],jt.prototype,"marker",2),f([x],jt.prototype,"label",2),f([x],jt.prototype,"tooltip",2),f([x],jt.prototype,"connectMissingData",2),f([x],jt.prototype,"sparklineMode",2);var vN=.25,MN=il(NM),yc=class extends ao{constructor(e){super({moduleCtx:e,propertyKeys:xa,propertyNames:va,categoryKey:"xValue",pickModes:[2,1,0],datumSelectionGarbageCollection:!1,animationResetFns:{path:ff({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:ro,datum:(t,i)=>({...Ou(t),...pc(t,i)})},clipFocusBox:!1}),this.properties=new jt,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:g,yScaleType:m}=this.getScaleInformation({xScale:u,yScale:d}),b=n>1||c!=null,y={invalidValue:null};l&&b&&(y.invalidValue=0),b&&!i&&(y.forceValue=0);const v=[];if((!p||b)&&v.push(ir(r,g,{id:"xKey"})),v.push(tt(r,g,{id:"xValue"}),tt(o,m,{id:"yValueRaw",...y,invalidValue:void 0})),a!=null&&v.push(tt(a,m,{id:"yFilterRaw"})),b){const D=[`line-stack-${s}-yValues`,`line-stack-${s}-yValues-trailing`,`line-stack-${s}-yValues-marker`];v.push(...sr(o,"window","current",{id:"yValueEnd",...y,groupId:D[0]},m),...sr(o,"window-trailing","current",{id:"yValueStart",...y,groupId:D[1]},m),...sr(o,"normal","current",{id:"yValueCumulative",...y,groupId:D[2]},m)),Na(c)&&v.push(du([D[0],D[1],D[2]],c))}h&&(v.push(Yl(p?["xValue"]:void 0)),this.processedData&&v.push(Kl(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:Ri(tr(o))}const s=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw",n=this.domainForClippedRange("y",[s],"xValue");return Ri(n)}getSeriesRange(e,t){const i=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw";return this.domainForVisibleRange("y",[i],"xValue",t)}getVisibleItems(e,t,i){const s=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw";return this.countVisibleItems("xValue",[s],e,t,i)}aggregateData(e,t){if(t.type!=="ungrouped"||ta(t))return;const i=this.axes.x;if(i==null)return;const{scale:s}=i,n=e.resolveColumnById(this,"xValue",t),r=e.resolveColumnById(this,"yValueRaw",t),o=e.getDomain(this,"xValue","value",t);return MN(s.type,n,r,o)}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:g,legendItemName:m}=this.properties,b=this.dataModel?.hasColumnById(this,"yValueEnd"),y=n.scale,v=r.scale,M=(y.bandwidth??0)/2,S=(v.bandwidth??0)/2,D=u.enabled?u.size:0,A=t.dataSources.get(this.id)??[],I=e.resolveColumnById(this,"xValue",t),L=e.resolveColumnById(this,"yValueRaw",t),C=b?e.resolveColumnById(this,"yValueEnd",t):void 0,w=b?e.resolveColumnById(this,"yValueCumulative",t):L,E=l!=null?e.resolveColumnById(this,"yFilterRaw",t):void 0,R=this.getSeriesDomain("y"),P={lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},G=[],H=[],oe=ue=>{const q=A[ue],Q=I[ue],ae=L[ue],de=C?.[ue],J=E?.[ue],$e=y.convert(Q)+M,ht=v.convert(w[ue])+S;if(!Number.isFinite($e))return;if(ae!=null){const Ke=d.enabled?this.getLabelText(ae,q,a,"y",R,d,{value:ae,datum:q,xKey:o,yKey:a,xName:c,yName:h,legendItemName:m}):void 0;G.push({series:this,datum:q,datumIndex:ue,yKey:a,xKey:o,point:{x:$e,y:ht,size:D},midPoint:{x:$e,y:ht},cumulativeValue:de,yValue:ae,xValue:Q,capDefaults:P,labelText:Ke,selected:J})}const ut=H[H.length-1];if(ae!=null){const Ke={point:{x:$e,y:ht},xDatum:Q,yDatum:ae};Array.isArray(ut)?ut.push(Ke):ut!=null?(ut.skip+=1,H.push([Ke])):H.push([Ke])}else p||(Array.isArray(ut)||ut==null?H.push({skip:0}):ut.skip+=1)},[me,ke]=y.range,Te=Math.abs(ke-me),Z=s?.find(ue=>ue.maxRange>Te)?.indices;let[ce,X]=this.visibleRangeIndices("xValue",n.range,Z);ce=Math.max(ce-1,0),X=Math.min(X+1,Z?.length??I.length),t.input.count<1e3&&(ce=0,X=t.input.count);for(let ue=ce;ue<X;ue+=1)oe(Z?.[ue]??ue);const ye=H.flatMap(ue=>Array.isArray(ue)?wu(ue,g):[]),Se={itemId:a,spans:ye},ne=E?.some((ue,q)=>ue===L[q])??!1;return{itemId:a,nodeData:G,labelData:G,strokeData:Se,scales:this.calculateScaling(),visible:this.visible,crossFiltering:ne}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(e){const{paths:[t],visible:i,animationEnabled:s}=e,n=this.contextNodeData?.crossFiltering===!0,{strokeWidth:r,stroke:o,strokeOpacity:a,lineDash:l,lineDashOffset:c,opacity:h}=Ee(this.getHighlightStyle(),this.properties);t.setProperties({fill:void 0,lineJoin:"round",pointerEvents:1,opacity:h,stroke:o,strokeWidth:r,strokeOpacity:a*(n?vN:1),lineDash:l,lineDashOffset:c}),s||(t.visible=i),zu(this,t)}updateDatumSelection(e){let{nodeData:t}=e;const{datumSelection: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=>Cn(n.xValue))}updateDatumNodes(e){const{datumSelection:t,isHighlight:i}=e,{xKey:s,yKey:n,marker:r,stroke:o,strokeWidth:a,strokeOpacity:l}=this.properties,c=this.getSeriesDomain("x"),h=this.getSeriesDomain("y"),u=this.ctx.animationManager.isSkipped(),d=this.getShapeFillBBox();t.each((p,g)=>{const{xValue:m,yValue:b}=g,y=_n(m,b,s,n,c,h),v=this.getMarkerStyle(r,g,y,i,void 0,{stroke:o,strokeWidth:a,strokeOpacity:l});this.applyMarkerStyle(v,p,g.point,d,{applyTranslation:u,selected:g.selected})}),i||r.markClean()}updateLabelSelection(e){return e.labelSelection.update(this.isLabelEnabled()?e.labelData:[])}updateLabelNodes(e){const{isHighlight:t=!1}=e,i=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((s,n)=>{const r=t||this.isSeriesHighlighted(i),o=this.getHighlightStateString(i,r,n.datumIndex),a=Xs(this,n,this.properties,this.properties.label,r,o),{enabled:l,fontStyle:c,fontWeight:h,fontSize:u,fontFamily:d,color:p}=a;l&&n?.labelText?(s.fontStyle=c,s.fontWeight=h,s.fontSize=u,s.fontFamily=d,s.textAlign="center",s.textBaseline="bottom",s.text=n.labelText,s.x=n.point.x,s.y=n.point.y-10,s.fill=p,s.visible=!0,s.fillOpacity=this.getHighlightStyle(t,n.datumIndex).opacity??1,s.setBoxing(a)):s.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,legendItemName:u}=r,d=n.x,p=n.y;if(!i||!s||!d||!p)return;const g=s.dataSources.get(this.id)?.[e],m=i.resolveColumnById(this,"xValue",s)[e],b=i.resolveColumnById(this,"yValueRaw",s)[e];if(m==null)return;const y=this.getSeriesDomain("x"),v=this.getSeriesDomain("y"),M=_n(m,b,o,l,y,v),S=this.getMarkerStyle(this.properties.marker,{datumIndex:e,datum:g},M,!1);return this.formatTooltipWithContext(h,{heading:this.getAxisValueText(d,"tooltip",m,g,o,u),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(p,"tooltip",b,g,l,u)}]},{seriesId:t,datum:g,title:c,xKey:o,xName:a,yKey:l,yName:c,...S,...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,!1,{size:r.size,fill:r.fill??e,stroke:r.stroke??t??e},void 0,!1),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)}updateLinePaths(e,t){const i=t.strokeData.spans,[s]=e;s.path.clear(),rf(s,i),s.markDirty("LineSeries")}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,annotationSelections:s,contextData:n,paths:r}=e,{animationManager:o}=this.ctx;this.updateLinePaths(r,n),gf(this,o,...r),ti([t],pc),pf(this,o,t),It(this,"labels",o,i),It(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,{datumSelection:i,labelSelection:s,annotationSelections:n,contextData:r,paths:o,previousContextData:a}=e,[l]=o;if(r.visible===!1&&a?.visible===!1)return;this.resetDatumAnimation(e),this.resetLabelAnimation(e);const c=()=>{this.resetPathAnimation(e),this.updateLinePaths(o,r)},h=()=>{t.skipCurrentBatch(),c()};if(r==null||a==null){c(),dc(this,t,"added",i),Ru(this,"path_properties",t,"add",l),It(this,"labels",t,s),It(this,"annotations",t,...n);return}if(r.crossFiltering!==a.crossFiltering){h();return}const u=CM(r,a,this.processedData?.reduced?.diff?.[this.id]);if(u===void 0){h();return}else if(u.status==="no-op")return;Ot(this.id,"path_properties",t,[l],u.stroke.pathProperties),u.status==="added"?this.updateLinePaths(o,r):u.status==="removed"?this.updateLinePaths(o,a):Cu(this.id,"path_update",t,[l],u.stroke.path),u.hasMotion&&(dc(this,t,void 0,i),It(this,"labels",t,s),It(this,"annotations",t,...n))}isLabelEnabled(){return this.properties.label.enabled}getBandScalePadding(){return{inner:1,outer:.1}}nodeFactory(){return new Pt}getFormattedMarkerStyle(e){const{xKey:t,yKey:i}=this.properties,{xValue:s,yValue:n}=e,r=this.getSeriesDomain("x"),o=this.getSeriesDomain("y");return this.getMarkerStyle(this.properties.marker,e,_n(s,n,t,i,r,o),!0)}computeFocusBounds(e){return Pu(this,e)}hasItemStylers(){return this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};yc.className="LineSeries",yc.type="line";var YM={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"line",moduleFactory:e=>new yc(e),stackable:!0,defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{stroke:Xh,strokeWidth:2,strokeOpacity:1,lineDash:[0],lineDashOffset:0,interpolation:{type:"linear"},marker:{shape:"circle",size:7,strokeWidth:{$isUserOption:["./stroke",1,0]},fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:jl,fillPatternDefaults:vn,fillImageDefaults:Fr},label:{...Qi,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},errorBar:{cap:{lengthRatio:1}},tooltip:{range:{$path:["/tooltip/range","nearest"]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:Xn()}}},KM={type:"series",name:"line",chartType:"cartesian",options:yu,create:e=>new yc(e)},Hu=class extends mc{};Hu.className="ScatterSeries",Hu.type="scatter";var SN={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"scatter",moduleFactory:e=>new Hu(e),defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{shape:"circle",size:7,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:jl,fillPatternDefaults:vn,fillImageDefaults:Fr,fillOpacity:.8,maxRenderedItems:1e4,label:{...Qi,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},errorBar:{cap:{lengthRatio:1}},tooltip:{range:{$path:["/tooltip/range","nearest"]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:Xn()}}},ZM={type:"series",name:"scatter",chartType:"cartesian",options:rw,create:e=>new Hu(e)},XM=class hm{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 hm(t,i,s,n)}equals(t){return this.startAngle===t.startAngle&&this.endAngle===t.endAngle&&this.innerRadius===t.innerRadius&&this.outerRadius===t.outerRadius}[_c](t,i){return new hm(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 qM({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)),Sr(0,e,t)&&l(s,0),Sr(Math.PI*.5,e,t)&&l(0,s),Sr(Math.PI,e,t)&&l(-s,0),Sr(Math.PI*1.5,e,t)&&l(0,-s),new U(n,r,o-n,a-r)}function Af(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=Yc(i.startAngle),a=Yc(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 DN(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),g=Math.pow(e,2)+Math.pow(u-t,2)-Math.pow(i,2),m=Math.pow(p,2)-4*d*g;if(m<0)return 0;const b=(-p+Math.sqrt(m))/2/d,y=(-p-Math.sqrt(m))/2/d;let v=0;return[b,y].forEach(M=>{if(!(M>=Math.min(o,l)&&M<=Math.max(o,l)))return;const D=h*M+u,A=M-e,I=D-t,L=Math.atan2(I,A);Sr(L,s,n)&&v++}),v}function QM(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 $a(e.start.x,e.start.y,e.end.x,e.end.y,o.x,o.y,l.x,l.y)||$a(e.start.x,e.start.y,e.end.x,e.end.y,a.x,a.y,c.x,c.y)||DN(0,0,r,i,s,!0,e.start.x,e.start.y,e.end.x,e.end.y)}function IN(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 QM({start:i,end:s},t)||QM({start:n,end:r},t)}function JM(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 AN=1e-6;function hr(e,t){return Kc(e,t)<AN?t:Ct(e-t)+t}function Uu(e,t,i=0){const n=Math.abs(t-e)>=2*Math.PI?2*Math.PI:Ct(t-e);return e=hr(e,i),t=e+n,{startAngle:e,endAngle:t}}function $u(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),A=D**2-4*S*l;if(A<0)return;const I=(-D+Math.sqrt(A))/(2*S),L=(-D-Math.sqrt(A))/(2*S);c=I,h=I*M,u=L,d=L*M}else{const M=a/o,S=1+M**2,D=-2*(t+e*M),A=D**2-4*S*l;if(A<0)return;const I=(-D+Math.sqrt(A))/(2*S),L=(-D-Math.sqrt(A))/(2*S);c=I*M,h=I,u=L*M,d=L}const p=a,g=o,m=c*p+h*g,b=u*p+d*g,y=m>0?hr(Math.atan2(h-t,c-e),s):NaN,v=b>0?hr(Math.atan2(d-t,u-e),s):NaN;if(y>=s&&y<=n)return y;if(v>=s&&v<=n)return v}function Wu(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=hr(c+h,s),d=hr(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))}},ai=class extends di{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 qM(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}=Uu(this.startAngle,this.endAngle),{innerRadius:s,outerRadius:n}=this.normalizedRadii(),r=Uu(e.startAngle,e.endAngle,t);return new XM(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}=Uu(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),g=o?l+p+t:c-p-t,m=a?h+e:u-e,b=m*Math.cos(g),y=m*Math.sin(g);if(d!=null&&(!o&&!(g>=l-1e-6&&g<=d.endAngle-1e-6)||o&&!(g>=d.startAngle+1e-6&&g<=c-1e-6)||a&&m<d.innerRadius-1e-6||!a&&m>d.outerRadius+1e-6))return;const v=new Cf(b,y,e,i,s);if(d!=null){a?(v.clipStart($u(b,y,e,i,s,d.endAngle)),v.clipEnd($u(b,y,e,i,s,d.startAngle))):(v.clipStart($u(b,y,e,i,s,d.startAngle)),v.clipEnd($u(b,y,e,i,s,d.endAngle)));let I,L;if(o?(I=Wu(b,y,e,i,s,d.innerRadius),L=Wu(b,y,e,i,s,d.outerRadius)):(I=Wu(b,y,e,i,s,d.outerRadius),L=Wu(b,y,e,i,s,d.innerRadius)),v.clipStart(I),v.clipEnd(L),I!=null){const{x:C,y:w}=v.pointAt(I),E=hr(Math.atan2(w,C),l);o?r?.clipStart(E):n.clipEnd(E)}if(L!=null){const{x:C,y:w}=v.pointAt(L),E=hr(Math.atan2(w,C),l);o?n.clipStart(E):r?.clipEnd(E)}}if(d!=null){const{x:I,y:L}=v.pointAt((v.a0+v.a1)/2);if(!Af(I,L,d))return}const{x:M,y:S}=v.pointAt(o===a?v.a0:v.a1),D=hr(Math.atan2(S,M),l),A=a?r:n;return o?A?.clipStart(D):A?.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}=Uu(this.startAngle,this.endAngle),{innerRadius:d,outerRadius:p}=this.normalizedRadii(),g=this.normalizedClipSector(),m=u-h,b=m>=2*Math.PI-1e-6;if(t.clear(),d===0&&p===0||d>p)return;if((g?.startAngle??h)===(g?.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 y=this.getAngleOffset(d),v=this.getAngleOffset(p);if(m<2*v)return;const S=(g?.innerRadius??d)>n,D=d<n||m<2*y,A=p-d,I=Math.max(o,l,a,c),L=I>0?Math.min(A/I,1):1;o*=L,a*=L,l*=L,c*=L;const C=JM(p,m-2*v,-o,-a);if(o*=C,a*=C,!D&&S){const q=JM(d,m-2*y,l,c);l*=q,c*=q}else l=0,c=0;const w=Math.max(o+l,a+c),E=w>0?Math.min(A/w,1):1;o*=E,a*=E,l*=E,c*=E;let R=0,P=0;const G=o/(p-o),H=a/(p-a);if(G>=0&&G<1-1e-6)R=Math.asin(G);else{R=m/2;const q=p/(1/Math.sin(R)+1);o=Math.min(q,o)}if(H>=0&&H<1-1e-6)P=Math.asin(H);else{P=m/2;const q=p/(1/Math.sin(P)+1);a=Math.min(q,a)}const oe=Math.asin(l/(d+l)),me=Math.asin(c/(d+c)),ke=g?.outerRadius??p,Te=this.getAngleOffset(ke),xe=new Cf(0,0,ke,h+Te,u-Te),Z=g?.innerRadius??d,ce=this.getAngleOffset(Z),X=S?new Cf(0,0,Z,h+ce,u-ce):void 0;g!=null&&(xe.clipStart(g.startAngle),xe.clipEnd(g.endAngle),X?.clipStart(g.startAngle),X?.clipEnd(g.endAngle));const ye=this.arc(o,R,h-Math.PI*.5,h+R,xe,X,!0,!1),Se=this.arc(a,P,u-P,u+Math.PI*.5,xe,X,!1,!1),ne=this.arc(c,me,u+Math.PI*.5,u+Math.PI-me,xe,X,!1,!0),ue=this.arc(l,oe,h+Math.PI+oe,h+Math.PI*1.5,xe,X,!0,!0);if(D){const q=m<Math.PI*.5?r*(1+Math.cos(m))/Math.sin(m):NaN;let Q;q>0&&q<p?Q=Math.max(Math.hypot(r,q),d):Q=r,Q=Math.max(Q,d);const ae=h+m*.5;t.moveTo(i+Q*Math.cos(ae),s+Q*Math.sin(ae))}else if(!(ue?.isValid()===!0||X?.isValid()===!0)){const q=h+m/2,Q=d*Math.cos(q),ae=d*Math.sin(q);t.moveTo(i+Q,s+ae)}if(ye?.isValid()===!0){const{cx:q,cy:Q,r:ae,a0:de,a1:J}=ye;t.arc(i+q,s+Q,ae,de,J)}if(xe.isValid()){const{r:q,a0:Q,a1:ae}=xe;t.arc(i,s,q,Q,ae)}if(Se?.isValid()===!0){const{cx:q,cy:Q,r:ae,a0:de,a1:J}=Se;t.arc(i+q,s+Q,ae,de,J)}if(!D){if(ne?.isValid()===!0){const{cx:q,cy:Q,r:ae,a0:de,a1:J}=ne;t.arc(i+q,s+Q,ae,de,J)}if(X?.isValid()===!0){const{r:q,a0:Q,a1:ae}=X;t.arc(i,s,q,ae,Q,!0)}if(ue?.isValid()===!0){const{cx:q,cy:Q,r:ae,a0:de,a1:J}=ue;t.arc(i+q,s+Q,ae,de,J)}}t.closePath()}isPointInPath(e,t){const{startAngle:i,endAngle:s,innerRadius:n,outerRadius:r}=this.clipSector??this;return Af(e-this.centerX,t-this.centerY,{startAngle:i,endAngle:s,innerRadius:Math.min(n,r),outerRadius:Math.max(n,r)})}};ai.className="Sector",f([F()],ai.prototype,"centerX",2),f([F()],ai.prototype,"centerY",2),f([F()],ai.prototype,"innerRadius",2),f([F()],ai.prototype,"outerRadius",2),f([F()],ai.prototype,"startAngle",2),f([F()],ai.prototype,"endAngle",2),f([Ei({equals:(e,t)=>e.equals(t)})],ai.prototype,"clipSector",2),f([F()],ai.prototype,"concentricEdgeInset",2),f([F()],ai.prototype,"radialEdgeInset",2),f([F()],ai.prototype,"startOuterCornerRadius",2),f([F()],ai.prototype,"endOuterCornerRadius",2),f([F()],ai.prototype,"startInnerCornerRadius",2),f([F()],ai.prototype,"endInnerCornerRadius",2);var eS=class extends ct{constructor(){super(...arguments),this.showInLegend=!1}};f([x],eS.prototype,"showInLegend",2);var Lf=class extends pt{constructor(){super(...arguments),this.spacing=2}set(e,t){return super.set(e)}};f([x],Lf.prototype,"text",2),f([x],Lf.prototype,"spacing",2);var Tf=class extends re{constructor(){super(...arguments),this.fill="transparent",this.fillOpacity=1}};f([x],Tf.prototype,"fill",2),f([x],Tf.prototype,"fillOpacity",2);var Sa=class extends pt{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};f([x],Sa.prototype,"offset",2),f([x],Sa.prototype,"minAngle",2),f([x],Sa.prototype,"minSpacing",2),f([x],Sa.prototype,"maxCollisionOffset",2),f([x],Sa.prototype,"avoidCollisions",2);var kf=class extends pt{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};f([x],kf.prototype,"positionOffset",2),f([x],kf.prototype,"positionRatio",2);var Yu=class extends re{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};f([x],Yu.prototype,"colors",2),f([x],Yu.prototype,"length",2),f([x],Yu.prototype,"strokeWidth",2);var Ie=class extends Zi{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(Tt),this.strokes=Object.values(xn),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 Ua(Lf),this.title=new eS,this.innerCircle=new Tf,this.shadow=new qs,this.calloutLabel=new Sa,this.sectorLabel=new kf,this.calloutLine=new Yu,this.tooltip=oo()}};f([x],Ie.prototype,"angleKey",2),f([x],Ie.prototype,"angleName",2),f([x],Ie.prototype,"angleFilterKey",2),f([x],Ie.prototype,"radiusKey",2),f([x],Ie.prototype,"radiusName",2),f([x],Ie.prototype,"radiusMin",2),f([x],Ie.prototype,"radiusMax",2),f([x],Ie.prototype,"calloutLabelKey",2),f([x],Ie.prototype,"calloutLabelName",2),f([x],Ie.prototype,"sectorLabelKey",2),f([x],Ie.prototype,"sectorLabelName",2),f([x],Ie.prototype,"legendItemKey",2),f([x],Ie.prototype,"defaultColorRange",2),f([x],Ie.prototype,"defaultPatternFills",2),f([x],Ie.prototype,"fills",2),f([x],Ie.prototype,"strokes",2),f([x],Ie.prototype,"fillOpacity",2),f([x],Ie.prototype,"strokeOpacity",2),f([x],Ie.prototype,"lineDash",2),f([x],Ie.prototype,"lineDashOffset",2),f([x],Ie.prototype,"cornerRadius",2),f([x],Ie.prototype,"itemStyler",2),f([x],Ie.prototype,"rotation",2),f([x],Ie.prototype,"outerRadiusOffset",2),f([x],Ie.prototype,"outerRadiusRatio",2),f([x],Ie.prototype,"innerRadiusOffset",2),f([x],Ie.prototype,"innerRadiusRatio",2),f([x],Ie.prototype,"strokeWidth",2),f([x],Ie.prototype,"sectorSpacing",2),f([x],Ie.prototype,"hideZeroValueSectorsInLegend",2),f([x],Ie.prototype,"innerLabels",2),f([x],Ie.prototype,"title",2),f([x],Ie.prototype,"innerCircle",2),f([x],Ie.prototype,"shadow",2),f([x],Ie.prototype,"calloutLabel",2),f([x],Ie.prototype,"sectorLabel",2),f([x],Ie.prototype,"calloutLine",2),f([x],Ie.prototype,"tooltip",2);function Ku(e,t,i,s){const n=[i.convert(0),i.convert(1)],r=[s.convert(0),s.convert(1)],o=Math.PI/-2+Qt(t),a=e?"initial":"update",l=({radius:g})=>({innerRadius:n[0],outerRadius:n[0]+(n[1]-n[0])*g}),c=({radius:g})=>({innerRadius:r[0],outerRadius:r[0]+(r[1]-r[0])*g});return{nodes:{toFn:(g,m,b,{prevLive:y})=>{let{startAngle:v,endAngle:M,innerRadius:S,outerRadius:D}=m;const{stroke:A,fill:I}=m.sectorFormat;if(b==="removed"&&y?(v=y.datum?.endAngle,M=y.datum?.endAngle):b==="removed"&&!y&&(v=o,M=o),b==="removed"){const L=l(m);S=L.innerRadius,D=L.outerRadius}return{startAngle:v,endAngle:M,outerRadius:D,innerRadius:S,stroke:A,fill:I}},fromFn:(g,m,b,{prevFromProps:y})=>{let{startAngle:v,endAngle:M,innerRadius:S,outerRadius:D}=g,{fill:A,stroke:I}=m.sectorFormat;if(b==="updated"&&g.previousDatum==null&&(b="added"),b==="unknown"||b==="added"&&!y?(v=o,M=o,S=m.innerRadius,D=m.outerRadius):b==="added"&&y&&(v=y.endAngle??o,M=y.endAngle??o,S=y.innerRadius??m.innerRadius,D=y.outerRadius??m.outerRadius),b==="added"&&!e){const L=c(m);S=L.innerRadius,D=L.outerRadius}return b==="updated"&&(A=g.fill??A,I=(typeof g.stroke=="string"?g.stroke:void 0)??I),{startAngle:v,endAngle:M,innerRadius:S,outerRadius:D,fill:A,stroke:I,phase:a}}},innerCircle:{fromFn:(g,m)=>({size:g.previousDatum?.radius??g.size??0,phase:a}),toFn:(g,m)=>({size:m.radius??0})}}}function tS(e,t){return{startAngle:t.startAngle,endAngle:t.endAngle,innerRadius:t.innerRadius,outerRadius:t.outerRadius,stroke:t.sectorFormat.stroke}}function iS(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&&Sr(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 sS=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.FOREGROUND=1]="FOREGROUND",e[e.HIGHLIGHT=2]="HIGHLIGHT",e[e.LABEL=3]="LABEL",e))(sS||{}),nS={angle:["angleKey"],radius:["radiusKey"]},rS={angle:["angleName"],radius:["radiusName"]},wf=class extends ef{constructor({categoryKey:e,pickModes:t=[1,0],canHaveAxes:i=!1,animationResetFns:s,...n}){super({...n,categoryKey:e,pickModes:t,canHaveAxes:i}),this.directions=["angle","radius"],this.itemGroup=this.contentGroup.appendChild(new ge),this.nodeData=[],this.itemSelection=gi.select(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=gi.select(this.labelGroup,()=>this.labelFactory(),!1),this.highlightSelection=gi.select(this.highlightGroup,()=>this.nodeFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.animationResetFns=s,this.animationState=new ll("empty",{empty:{update:{target:"ready",action:r=>this.animateEmptyUpdateReady(r)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:r=>this.animateReadyHighlight(r),highlightMarkers:r=>this.animateReadyHighlightMarkers(r),resize:r=>this.animateReadyResize(r),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:r=>this.animateWaitingUpdateReady(r)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:r=>this.animateClearingUpdateEmpty(r)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getItemNodes(){return[...this.itemGroup.children()]}getNodeData(){return this.nodeData}setZIndex(e){super.setZIndex(e),this.contentGroup.zIndex=[e,1],this.highlightGroup.zIndex=[e,2],this.labelGroup.zIndex=[e,3]}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}labelFactory(){const e=new Oi;return e.pointerEvents=1,e}addChartEventListeners(){this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",e=>this.onLegendItemClick(e)),this.ctx.eventsHub.on("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&&ti([this.itemSelection,this.highlightSelection],e),t&&ti([this.labelSelection],t),this.itemSelection.cleanup(),this.labelSelection.cleanup(),this.highlightSelection.cleanup()}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateReadyHighlight(e){const{item:t}=this.animationResetFns??{};t&&ti([this.highlightSelection],t)}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 di&&i.datum===t)[0]}getSeriesRange(e,t){return[NaN,NaN]}isSeriesHighlighted(e,t){const{series:i,legendItemName:s,itemId:n}=e??{},r=t?.[n];return i===this||r!=null&&r===s}},CN=class extends Fh{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}},bc=class extends wf{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{...nS,sectorLabel:["sectorLabelKey"],calloutLabel:["calloutLabelKey"]},propertyNames:{...rS,sectorLabel:["sectorLabelName"],calloutLabel:["calloutLabelName"]},pickModes:[1,0],animationResetFns:{item:tS,label:ro}}),this.properties=new Ie,this.phantomNodeData=void 0,this.backgroundGroup=new hi({name:`${this.id}-background`,zIndex:0}),this.noVisibleData=!1,this.previousRadiusScale=new Zr,this.radiusScale=new Zr,this.phantomGroup=this.backgroundGroup.appendChild(new ge({name:"phantom"})),this.phantomSelection=gi.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new ge({name:"pieCalloutLabels"})),this.calloutLabelSelection=new gi(this.calloutLabelGroup,ge),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new ge({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new Pt({shape:"circle"})),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new Pt({shape:"circle"})),this.innerLabelsGroup=this.contentGroup.appendChild(new ge({name:"innerLabels"})),this.innerCircleGroup=this.backgroundGroup.appendChild(new ge({name:`${this.id}-innerCircle`})),this.innerLabelsSelection=gi.select(this.innerLabelsGroup,Oi),this.innerCircleSelection=gi.select(this.innerCircleGroup,()=>new Pt({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=CN,this.angleScale=new Zr,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(t=>t+Math.PI/2),this.phantomGroup.opacity=.2,this.innerLabelsGroup.pointerEvents=1}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)}setZIndex(e){super.setZIndex(e),this.backgroundGroup.zIndex=[0,e]}nodeFactory(){const e=new ai;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,y)=>t&&s.getItemEnabled({seriesId:i,itemId:y})?b:0,u=!this.ctx.animationManager.isSkipped(),d=[],p=[];c?d.push(ir(c,"category",{id:"legendItemKey"})):a?d.push(ir(a,"category",{id:"calloutLabelKey"})):l&&d.push(ir(l,"category",{id:"sectorLabelKey"}));const g=this.radiusScale.type,m=this.angleScale.type;o&&p.push(N0(o,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,missingValue:this.properties.radiusMax??1,processor:h}),tt(o,g,{id:"radiusRaw",processor:h}),pu("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),a&&p.push(tt(a,"category",{id:"calloutLabelValue"})),l&&p.push(tt(l,"category",{id:"sectorLabelValue"})),c&&p.push(tt(c,"category",{id:"legendItemValue"})),r&&p.push(Ag(r,m,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:h}),tt(r,m,{id:"angleFilterRaw"}),pu("angleFilterValue",[0,1],0,0)),u&&this.processedData?.reduced?.animationValidation?.uniqueKeys&&d.length>0&&p.push(Kl(this.id,this.processedData)),p.push(Yl()),await this.requestDataModel(e,this.data,{props:[...d,Ag(n,m,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:h}),tt(n,m,{id:"angleRaw"}),pu("angleValue",[0,1],0,0),...p]});for(const b of this.processedData?.defs?.values??[]){const{id:y,missing:v,property:M}=b,S=qb(this,v);y!=="angleRaw"&&S>0&&j.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 l=this.getProcessedDataValues(i,t),{angleValues:c,angleRawValues:h,angleFilterValues:u,angleFilterRawValues:d,radiusValues:p,radiusRawValues:g,legendItemValues:m}=l,b=d?.some((I,L)=>I>h[L])??!1;let y=0,v=0;const M=[],S=d!=null?[]:void 0,D=t.dataSources.get(this.id)??[],A=t.invalidData?.get(this.id);return D.forEach((I,L)=>{if(A?.[L]===!0)return;const C=b?u[L]:c[L],w=d!=null&&!b?Math.sqrt(d[L]/h[L]):1,E=s.convert(y)+Qt(o);y=C,v+=C;const R=s.convert(y)+Qt(o),P=Math.abs(R-E),G=E+P/2,H=h[L],me=(p?.[L]??1)*w,ke=g?.[L],Te=m?.[L],xe=this.getLabels(L,I,G,P,l),Z=this.getSectorFormat(I,L,!1),ce={itemId:L,series:this,datum:I,datumIndex:L,angleValue:H,midAngle:G,midCos:Math.cos(G),midSin:Math.sin(G),startAngle:E,endAngle:R,radius:me,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(me),0),sectorFormat:Z,radiusValue:ke,legendItemValue:Te,enabled:r&&n.getItemEnabled({seriesId:e,itemId:L}),focusable:!0,...xe};M.push(ce),S?.push({...ce,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0),focusable:!1})}),this.zerosumOuterRing.visible=v===0,this.zerosumInnerRing.visible=v===0&&a!=null&&a!==1&&a>0,{itemId:e,nodeData:M,labelData:M,phantomNodeData:S}}getLabelContent(e,t,i){const{id:s,ctx:n,properties:r}=this,{formatManager:o}=n,{calloutLabel:a,sectorLabel:l,calloutLabelKey:c,sectorLabelKey:h,legendItemKey:u}=r,d=i.calloutLabelValues?.[e],p=i.sectorLabelValues?.[e],g=i.legendItemValues?.[e],m={datum:t,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},b={callout:void 0,sector:void 0,legendItem:void 0};return c&&(b.callout=this.getLabelText(d,t,c,"calloutLabel",[],a,{...m,value:d})),h&&(b.sector=this.getLabelText(p,t,h,"sectorLabel",[],l,{...m,value:p})),u!=null&&g!=null&&(b.legendItem=o.format(this.callWithContext.bind(this),{type:"category",value:g,datum:t,seriesId:s,legendItemName:void 0,key:u,source:"legend-label",property:"legendItem",domain:[],boundSeries:this.getFormatterContext("legendItem")})??g),b}getLabels(e,t,i,s,n){const{properties:r}=this,{calloutLabel:o,sectorLabel:a,legendItemKey:l}=r,c=this.getLabelContent(e,t,n),h={};return o.enabled&&c.callout&&s>=Qt(o.minAngle)&&(h.calloutLabel={...this.getTextAlignment(i),text:c.callout,hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),a.enabled&&c.sector&&(h.sectorLabel={text:c.sector}),l&&c.legendItem&&(h.legendItem={key:l,text:c.legendItem}),h}getTextAlignment(e){const t=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"top"},{textAlign:"right",textBaseline:"middle"}],i=Yc(e),s=-.75*Math.PI,n=i-s,r=Math.floor(n/(Math.PI/2)),o=eI(r,t.length);return t[o]}getNodeFill(e,t,i){return Ko(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(!(!hs(e)||e.bounds==="item"))return{centerX:0,centerY:0,innerRadius:t,outerRadius:i}}getSectorFormat(e,t,i,s,n,r){const{angleKey:o,radiusKey:a,calloutLabelKey:l,sectorLabelKey:c,legendItemKey:h,fills:u,strokes:d,defaultColorRange:p,defaultPatternFills:g,itemStyler:m}=this.properties,b=d[t%d.length],y=u[t%u.length],{fill:v,fillOpacity:M,stroke:S,strokeWidth:D,strokeOpacity:A,lineDash:I,lineDashOffset:L,cornerRadius:C,opacity:w}=Ee(this.getHighlightStyle(i,s?.datumIndex,n),{fill:y,stroke:b},this.properties),E=p[t%p.length],R=g[t%g.length],P=v??"black";let G;return m&&(G=this.cachedDatumCallback(this.getDatumId(t)+(i?"-highlight":"-hide"),()=>this.callWithContext(m,{datum:e,angleKey:o,radiusKey:a,calloutLabelKey:l,sectorLabelKey:c,legendItemKey:h,fill:this.getNodeFill(P,E,R),fillOpacity:M,stroke:S,strokeWidth:D,strokeOpacity:A,lineDash:I,lineDashOffset:L,cornerRadius:C,highlighted:i,highlightState:this.getHighlightStateString(r??this.ctx.highlightManager?.getActiveHighlight(),i,t),seriesId:this.id}))),{fill:this.getNodeFill(G?.fill??P,E,R),fillOpacity:G?.fillOpacity??M,stroke:G?.stroke??S,strokeWidth:G?.strokeWidth??D,strokeOpacity:G?.strokeOpacity??A,lineDash:G?.lineDash??I,lineDashOffset:G?.lineDashOffset??L,cornerRadius:G?.cornerRadius??C,opacity:w}}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=hn(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(!1);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,calloutLabelSelection:s,labelSelection:n,innerLabelsSelection: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??[]),s.update(this.calloutNodeData,l=>{const c=new zi;c.tag=0,c.pointerEvents=1,l.appendChild(c);const h=new Oi;h.tag=1,h.pointerEvents=1,l.appendChild(h)}),n.update(this.nodeData),r.update(this.properties.innerLabels,l=>{l.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,dataModel:s,processedData:n}=this;if(this.backgroundGroup.visible=i,this.contentGroup.visible=i,!s||!n)return;const{legendItemValues:r}=this.getProcessedDataValues(s,n),o=this.isSeriesHighlighted(t,r);this.highlightGroup.visible=i&&o,this.labelGroup.visible=i,this.innerCircleSelection.each((d,{radius:p})=>{d.setProperties({fill:this.getNodeFill(this.properties.innerCircle?.fill,["black"],"black"),opacity:this.properties.innerCircle?.fillOpacity,size:p})});const a=this.radiusScale.range[0],l=this.radiusScale.range[1],c=this.getShapeFillBBox(),h=this.ctx.animationManager.isSkipped(),u=(d,p,g,m)=>{const b=this.getSectorFormat(p.datum,p.itemId,m,p,r,t);p.sectorFormat.fill=b.fill,p.sectorFormat.stroke=b.stroke,h&&(d.startAngle=p.startAngle,d.endAngle=p.endAngle,d.innerRadius=p.innerRadius,d.outerRadius=p.outerRadius),(m||h)&&(d.fill=b.fill,d.stroke=b.stroke);const y=this.getFillParams(b.fill,a,l);bn(d,b,c,y),d.cornerRadius=b.cornerRadius,d.fillShadow=this.properties.shadow;const v=Math.max((this.properties.sectorSpacing+(b.stroke!=null?b.strokeWidth:0))/2,0);d.inset=v,d.lineJoin=this.properties.sectorSpacing>=0||v>0?"miter":"round"};this.itemSelection.each((d,p,g)=>u(d,p,g,!1)),this.highlightSelection.each((d,p,g)=>{u(d,p,g,!0),d.visible=p.itemId===t?.itemId}),this.phantomSelection.each((d,p,g)=>u(d,p,g,!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=KI(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.strokeOpacity=this.getHighlightStyle(!1,l.datumIndex).opacity??1,a.fill=void 0;const d=l.midCos*h,p=l.midSin*h;let g=l.midCos*(h+e),m=l.midSin*(h+e);if((c.collisionTextAlign??c.collisionOffsetY!==0)&&c.box!=null){const y=c.box;let v=g,M=m;g<y.x?v=y.x:g>y.x+y.width&&(v=y.x+y.width),m<y.y?M=y.y:m>y.y+y.height&&(M=y.y+y.height);const S=v-g,D=M-m,A=Math.sqrt(Math.pow(S,2)+Math.pow(D,2)),I=A-o;I>0&&(g=g+S*I/A,m=m+D*I/A)}a.x1=d,a.y1=p,a.x2=g,a.y2=m}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=v=>!v.calloutLabel||v.outerRadius===0,a=this.calloutNodeData,l=a.filter(v=>!o(v));if(l.forEach(v=>{const M=v.calloutLabel;M!=null&&(M.hidden=!1,M.collisionTextAlign=void 0,M.collisionOffsetY=0)}),l.length<=1)return;const c=l.filter(v=>v.midCos<0).sort((v,M)=>v.midSin-M.midSin),h=l.filter(v=>v.midCos>=0).sort((v,M)=>v.midSin-M.midSin),u=l.filter(v=>v.midSin<0&&v.calloutLabel?.textAlign==="center").sort((v,M)=>v.midCos-M.midCos),d=l.filter(v=>v.midSin>=0&&v.calloutLabel?.textAlign==="center").sort((v,M)=>v.midCos-M.midCos),p={angleKey:this.properties.angleKey},g=v=>{const M=v.calloutLabel;if(M==null)return U.zero.clone();const S=Xs(this,v,p,t),D=_o(S),A=v.outerRadius+i.length+s,I=v.midCos*A,L=v.midSin*A+M.collisionOffsetY,C=M.collisionTextAlign??M.textAlign,w=M.textBaseline;return Oi.computeBBox(M.text,I,L,{font:this.properties.calloutLabel,textAlign:C,textBaseline:w},!1).grow(D)},m=(v,M,S)=>{const D=g(v).grow(n/2),A=g(M).grow(n/2);D.x<A.x+A.width&&D.x+D.width>A.x&&(S==="to-top"?D.y<A.y+A.height:D.y+D.height>A.y)&&(M.calloutLabel.collisionOffsetY=S==="to-top"?D.y-A.y-A.height:D.y+D.height-A.y)},b=v=>{const M=v.slice().sort((D,A)=>Math.abs(D.midSin)-Math.abs(A.midSin))[0],S=v.indexOf(M);for(let D=S-1;D>=0;D--){const A=v[D+1],I=v[D];m(A,I,"to-top")}for(let D=S+1;D<v.length;D++){const A=v[D-1],I=v[D];m(A,I,"to-bottom")}},y=v=>{const M=l.some(C=>C.calloutLabel.collisionOffsetY!==0),S=v.map(C=>g(C)),D=S.map(C=>C.clone().grow(n/2));let A=!1;for(let C=0;C<D.length&&!A;C++){const w=D[C];for(let E=C+1;E<v.length;E++){const R=D[E];if(w.collidesBBox(R)){A=!0;break}}}const I=a.map(C=>{const{startAngle:w,endAngle:E,outerRadius:R}=C;return{startAngle:w,endAngle:E,innerRadius:r,outerRadius:R}}),L=S.some(C=>I.some(w=>IN(C,w)));!A&&!M&&!L||v.filter(C=>C.calloutLabel.textAlign==="center").forEach(C=>{const w=C.calloutLabel;C.midCos<0?w.collisionTextAlign="right":C.midCos>0?w.collisionTextAlign="left":w.collisionTextAlign="center"})};b(c),b(h),y(u),y(d)}updateCalloutLabelNodes(e){const{radiusScale:t}=this,{calloutLabel:i,calloutLine:s}=this.properties,n=new Oi;this.calloutLabelSelection.selectByTag(1).forEach(r=>{const o=r.closestDatum(),a=o.calloutLabel,l=t.convert(o.radius),c=Math.max(0,l);if(!a?.text||c===0||a.hidden){r.visible=!1;return}const h=this.ctx.highlightManager?.getActiveHighlight(),u=!1,d=this.getHighlightStateString(h,u,o.datumIndex),p=Xs(this,o,this.properties,i,u,d),g=c+s.length+i.offset,m=o.midCos*g,b=o.midSin*g+a.collisionOffsetY,y={textAlign:a.collisionTextAlign??a.textAlign,textBaseline:a.textBaseline};n.text=a.text,n.x=m,n.y=b,n.setFont(p),n.setAlign(y),n.setBoxing(p);const v=n.getBBox(!1);let M=a.text,S=!0;if(i.avoidCollisions){const{textLength:D,hasVerticalOverflow:A}=this.getLabelOverflow(a.text,v,e);M=a.text.length===D?a.text:`${a.text.substring(0,D)}\u2026`,S=!A}r.text=M,r.x=m,r.y=b,r.setFont(p),r.setAlign(y),r.setBoxing(p),r.fill=p.color,r.fillOpacity=this.getHighlightStyle(!1,o.datumIndex).opacity??1,r.visible=S})}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 Oi;let h;const{title:u}=this.properties;if(u?.text&&u.enabled){const p=this.getTitleTranslationY();isFinite(p)&&(c.text=u.text,c.x=0,c.y=p,c.setFont(u),c.setAlign({textBaseline:"bottom",textAlign:"center"}),h=c.getBBox(!1),l.push(h))}const d={angleKey:this.properties.angleKey};return this.calloutNodeData.forEach(p=>{const g=p.calloutLabel;if(!g||p.outerRadius===0)return null;const m=Xs(this,p,d,i),b=p.outerRadius+n+r,y=p.midCos*b,v=p.midSin*b+g.collisionOffsetY;c.text=g.text,c.x=y,c.y=v,c.setFont(m),c.setAlign({textAlign:g.collisionTextAlign??g.textAlign,textBaseline:g.textBaseline}),c.setBoxing(m);const M=c.getBBox(!1);if(g.box=M,Math.abs(g.collisionOffsetY)>o){g.hidden=!0;return}if(h){const S=-this.centerY,D=new U(h.x-a,S,h.width+2*a,h.y+h.height+a-S);if(M.collidesBBox(D)){g.hidden=!0;return}}if(e.hideWhenNecessary){const{textLength:S,hasVerticalOverflow:D,hasSurroundingSeriesOverflow:A}=this.getLabelOverflow(g.text,M,t),I=g.text.length>2&&S<2;if(D||I||A){g.hidden=!0;return}}g.hidden=!1,l.push(M)}),l.length===0?null:U.merge(l)}updateSectorLabelNodes(){const{properties:e}=this,{positionOffset:t,positionRatio:i}=this.properties.sectorLabel,s=this.radiusScale.convert(0),n=s<=0&&this.ctx.legendManager.getData(this.id)?.filter(a=>a.enabled).length===1,r={textAlign:"center",textBaseline:"middle"},o=(a,l)=>{const{outerRadius:c,startAngle:h,endAngle:u}=l;let d=!1;if(l.sectorLabel&&c!==0){const p=this.ctx.highlightManager?.getActiveHighlight(),g=!1,m=this.getHighlightStateString(p,g,l.datumIndex),b=Xs(this,l,e,e.sectorLabel,g,m),y=s*(1-i)+c*i+t;a.fill=b.color,a.fillOpacity=this.getHighlightStyle(!1,l.datumIndex).opacity??1,a.text=l.sectorLabel.text,n?(a.x=0,a.y=0):(a.x=l.midCos*y,a.y=l.midSin*y),a.setFont(b),a.setAlign(r),a.setBoxing(b);const v=a.getBBox(!1),M=[[v.x,v.y],[v.x+v.width,v.y],[v.x+v.width,v.y+v.height],[v.x,v.y+v.height]],S={startAngle:h,endAngle:u,innerRadius:s,outerRadius:c};M.every(([D,A])=>Af(D,A,S))&&(d=!0)}a.visible=d};this.labelSelection.each(o)}updateInnerLabelNodes(){const e=[],t=[];this.innerLabelsSelection.each((h,u)=>{const{fontStyle:d,fontWeight:p,fontSize:g,fontFamily:m,color:b}=u;h.fontStyle=d,h.fontWeight=p,h.fontSize=g,h.fontFamily=m,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)=>h<u.width?u.width:h,0),r=e.reduce((h,u,d)=>h+u.height+i(d)+s(d),0),o=this.getInnerRadius(),l=Math.sqrt(Math.pow(n/2,2)+Math.pow(r/2,2))<=(o>0?o:this.getOuterRadius()),c=[];for(let h=0,u=-r/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.visible=l,Array.isArray(h.text)?h.y=c[d]-e[d].height:h.y=c[d]})}updateZerosumRings(){this.zerosumOuterRing.size=this.getOuterRadius()*2,this.zerosumInnerRing.size=this.getInnerRadius()*2}pickNodeClosestDatum(e){return iS(this,e)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n,ctx:{formatManager:r}}=this,{legendItemKey:o,calloutLabelKey:a,calloutLabelName:l,sectorLabelKey:c,sectorLabelName:h,angleKey:u,angleName:d,radiusKey:p,radiusName:g,tooltip:m}=n,b=this.properties.title.node.getPlainText();if(!i||!s)return;const y=s.dataSources.get(this.id)?.[e],v=this.getProcessedDataValues(i,s),{angleRawValues:M}=v,S=M[e],D=this.getLabelContent(e,y,v),A=D.legendItem??D.callout??D.sector??d,I=i.getDomain(this,"angleRaw","value",s),L=r.format(this.callWithContext.bind(this),{type:"number",value:S,datum:y,seriesId:t,legendItemName:void 0,key:u,source:"tooltip",property:"angle",domain:I,boundSeries:this.getFormatterContext("angle"),fractionDigits:void 0})??Eo(S,3);return this.formatTooltipWithContext(m,{title:b,symbol:this.legendItemSymbol(e),data:[{label:A,fallbackLabel:u,value:L}]},{seriesId:t,datum:y,title:d,legendItemKey:o,calloutLabelKey:a,calloutLabelName:l,sectorLabelKey:c,sectorLabelName:h,angleKey:u,angleName:d,radiusKey:p,radiusName:g,...this.getSectorFormat(y,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 hs(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 u=this.getProcessedDataValues(s,i),{angleRawValues:d}=u,p=this.properties.title?.showInLegend&&this.properties.title.text,g=[],m=this.properties.hideZeroValueSectorsInLegend,b=i.dataSources.get(this.id),y=i.invalidData?.get(this.id);for(let v=0;v<i.input.count;v++){const M=b?.[v],S=d[v];if(y?.[v]===!0||m&&S===0)continue;const D=[];p&&D.push(p);const A=this.getLabelContent(v,M,u);c&&A.legendItem!==void 0?D.push(A.legendItem):a&&a!==o&&A.callout!==void 0?D.push(A.callout):l&&l!==o&&A.sector!==void 0&&D.push(A.sector),D.length!==0&&g.push({legendType:"category",id:n,datum:M,itemId:v,seriesId:n,hideToggleOtherSeries:!0,enabled:t&&r.getItemEnabled({seriesId:n,itemId:v}),label:{text:D.join(" - ")},symbol:this.legendItemSymbol(v),legendItemName:c!=null?M[c]:void 0,hideInLegend:!h})}return g}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=Ku(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);Ot(this.id,"nodes",t,[this.itemSelection,this.highlightSelection,this.phantomSelection],i.nodes,(s,n)=>this.getDatumId(n.datumIndex)),Ot(this.id,"innerCircle",t,[this.innerCircleSelection],i.innerCircle),It(this,"callout",t,this.calloutLabelSelection),It(this,"sector",t,this.labelSelection),It(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=Ku(!1,this.properties.rotation,n,r);Ot(this.id,"nodes",o,[e,t,i],d.nodes,(p,g)=>this.getDatumId(g.datumIndex),a),Ot(this.id,"innerCircle",o,[this.innerCircleSelection],d.innerCircle),It(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),It(this,"sector",this.ctx.animationManager,this.labelSelection),this.noVisibleData!==u&&(this.noVisibleData=u,It(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=Ku(!1,this.properties.rotation,s,n);Ot(this.id,"nodes",r,[e,t,i],o.nodes,(a,l)=>this.getDatumId(l.datumIndex)),Ot(this.id,"innerCircle",r,[this.innerCircleSelection],o.innerCircle),Lu(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Lu(this,"sector",this.ctx.animationManager,this.labelSelection),Lu(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(e){return`${e}`}hasItemStylers(){const{itemStyler:e,calloutLabel:t,sectorLabel:i}=this.properties;return(e??t.itemStyler??i.itemStyler)!=null}};bc.className="DonutSeries",bc.type="donut";var LN={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:Pi.LARGE},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{...Qi,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{...Qi,enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"chartBackgroundColor"},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:dg,fillOpacity:1,strokeOpacity:1,strokeWidth:{$isUserOption:["./strokes/0",2,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:Yn,xOffset:3,yOffset:3,blur:5},innerLabels:{$apply:{...Qi,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:2}},highlight:u0()},legend:{enabled:!0}},TN={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"donut",moduleFactory:e=>new bc(e),themeTemplate:LN},kN={type:"series",name:"donut",chartType:"polar",options:ow,create:e=>new bc(e)},Zu=class extends bc{};Zu.className="PieSeries",Zu.type="pie";var wN={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:Pi.LARGE},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{...Qi,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{...Qi,enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"chartBackgroundColor"},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:dg,fillOpacity:1,strokeOpacity:1,strokeWidth:{$isUserOption:["./strokes/0",2,0]},lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,shadow:{enabled:!1,color:Yn,xOffset:3,yOffset:3,blur:5},highlight:Xn()},legend:{enabled:!0}},NN={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"pie",moduleFactory:e=>new Zu(e),themeTemplate:wN},EN={type:"series",name:"pie",chartType:"polar",options:Xr,create:e=>new Zu(e)};function Nf(){js.register(qv,D1,S1,g1,Q1,BM,bN,YM,SN,TN,NN,xN);for(const e of[Ys,ea,Ks,Kr,ia,nr])kr.register(e.type,{moduleFactory:t=>new e(t)})}function ON(){for(const e of js.modules){if(e.packageType==="enterprise"&&!CL(e)&&j.errorOnce("Unexpected enterprise module registered: "+e.identifier),e.type==="root"&&e.themeTemplate)for(const t of e.chartTypes)wp.set(t,e.themeTemplate);if(e.type==="series"){if(e.chartTypes.length>1)throw new Error(`AG Charts - Module definition error: ${e.identifier}`);ps.register(e.identifier,e)}if(e.type==="series-option"&&e.themeTemplate)for(const t of e.seriesTypes)ps.setThemeTemplate(t,e.themeTemplate);if(e.type==="axis-option"&&e.themeTemplate)for(const t of e.axisTypes){const i=kr.getThemeTemplate(t),s=Ee(e.themeTemplate,i);kr.setThemeTemplate(t,s)}e.type==="axis"&&kr.register(e.identifier,e),e.type==="legend"&&kp.register(e.identifier,e)}if(js.hasEnterpriseModules()){const e=LL();e.length>0&&j.errorOnce("Enterprise modules expected but not registered: ",e)}}var Ti=Symbol("IGNORED_PROP");function ss(e,t){const i={};for(const s of Object.keys(t)){const n=t[s];n!==Ti&&Object.hasOwn(e,s)&&(i[s]=n)}return i}function oS(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=ss(e,{enabled:t,showArrow:s,range:n,position:r,interaction:c,renderer:h,...u});return{chartTooltipOptions:ss(e,{enabled:Ti,showArrow:Ti,range:Ti,position:Ti,mode:i,pagination:o,delay:a,wrapping:l,...u}),seriesTooltipOptions:d}}function PN(e){const{animation:t,background:i,container:s,contextMenu:n,context:r,footnote:o,height:a,listeners:l,locale:c,minHeight:h,minWidth:u,overrideDevicePixelRatio:d,padding:p,subtitle:g,theme:m,title:b,width:y,type:v,cursor:M,nodeClickRange:S,tooltip:D={},value:A,scale:I={},startAngle:L,endAngle:C,highlightStyle:w,highlight:E,segmentation:R,bar:P,needle:G,targets:H,outerRadius:oe,innerRadius:me,outerRadiusRatio:ke,innerRadiusRatio:Te,cornerRadius:xe,cornerMode:Z,label:ce,secondaryLabel:X,spacing:ye,...Se}=e,{chartTooltipOptions:ne,seriesTooltipOptions:ue}=oS(D),q=ss(e,{animation:t,background:i,container:s,contextMenu:n,context:r,footnote:o,height:a,listeners:l,locale:c,minHeight:h,minWidth:u,overrideDevicePixelRatio:d,padding:p,subtitle:g,theme:m,title:b,tooltip:ne,width:y}),Q=ss(e,{needle:G!=null?{enabled:!0,...G}:Ti,startAngle:L,endAngle:C,scale:I,type:v,cursor:M,context:r,nodeClickRange:S,tooltip:ue,value:A,highlightStyle:w,highlight:E,segmentation:R,bar:P,targets:H,outerRadius:oe,innerRadius:me,outerRadiusRatio:ke,innerRadiusRatio:Te,cornerRadius:xe,cornerMode:Z,label:ce,secondaryLabel:X,spacing:ye,...Se});return{...q,series:[Q]}}function RN(e){const{animation:t,background:i,container:s,contextMenu:n,context:r,footnote:o,height:a,listeners:l,locale:c,minHeight:h,minWidth:u,overrideDevicePixelRatio:d,padding:p,subtitle:g,theme:m,title:b,width:y,type:v,cursor:M,nodeClickRange:S,tooltip:D={},value:A,scale:I={},direction:L="vertical",thickness:C,highlightStyle:w,highlight:E,segmentation:R,bar:P,targets:G,cornerRadius:H,cornerMode:oe,label:me,...ke}=e,{chartTooltipOptions:Te,seriesTooltipOptions:xe}=oS(D),Z=ss(e,{animation:t,background:i,container:s,contextMenu:n,context:r,footnote:o,height:a,listeners:l,locale:c,minHeight:h,minWidth:u,overrideDevicePixelRatio:d,padding:p,subtitle:g,theme:m,title:b,tooltip:Te,width:y}),ce=ss(e,{scale:I,type:v,cursor:M,context:r,nodeClickRange:S,tooltip:xe,value:A,direction:L,thickness:C,highlightStyle:w,highlight:E,segmentation:R,bar:P,targets:G,cornerRadius:H,cornerMode:oe,label:me,...ke});return{...Z,series:[ce]}}function aS(e,t){if(t==null)return e;const{targets:i,...s}=t;return e=Ee(e,s),e.targets!=null&&i!=null&&(e.targets=Km(e.targets,i)),e}function zN(e,t){switch(e.type){case"radial-gauge":return PN(aS(e,t));case"linear-gauge":return RN(aS(e,t));default:return{}}}var ns={stroke:mt},li={fill:Ll},lS={color:"white",fill:mt},wn={color:mt},co={color:Cl,fontSize:{$rem:Pi.LARGE},fontFamily:{$ref:"fontFamily"}},Ef={...co,fontSize:{$ref:"fontSize"},color:wl,fill:Tl,stroke:kl,strokeWidth:1,divider:{stroke:Nl,strokeWidth:1,strokeOpacity:.5}},Of={...ns,background:{fill:Rt,fillOpacity:.2},handle:{...li},text:{...wn},statistics:{...Ef}},FN={line:{...ns,handle:{...li},text:{...wn}},"horizontal-line":{...ns,handle:{...li},axisLabel:{...lS},text:{...wn}},"vertical-line":{...ns,handle:{...li},axisLabel:{...lS},text:{...wn}},"disjoint-channel":{...ns,background:{fill:Rt,fillOpacity:.2},handle:{...li},text:{...wn}},"parallel-channel":{...ns,background:{fill:Rt,fillOpacity:.2},handle:{...li},text:{...wn}},"fibonacci-retracement":{...ns,strokes:Al,rangeStroke:mt,handle:{...li},text:{...wn,position:"center"},label:{...co,color:void 0,fontSize:{$rem:Pi.SMALLER}}},"fibonacci-retracement-trend-based":{...ns,strokes:Al,rangeStroke:mt,handle:{...li},text:{...wn,position:"center"},label:{...co,color:void 0,fontSize:{$rem:Pi.SMALLER}}},callout:{...ns,...co,color:{$ref:"textColor"},handle:{...li},fill:Rt,fillOpacity:.2},comment:{...co,color:"white",fontWeight:700,handle:{...li},fill:mt},note:{...co,color:zl,fill:mt,stroke:{$ref:"chartBackgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...li},background:{fill:Pl,stroke:Rl,strokeWidth:1}},text:{...co,handle:{...li}},arrow:{...ns,handle:{...li},text:{...wn}},"arrow-up":{fill:{$palette:"up.fill"},handle:{...li,stroke:mt}},"arrow-down":{fill:{$palette:"down.fill"},handle:{...li,stroke:mt}},"date-range":{...Of},"price-range":{...Of},"date-price-range":{...Of},"quick-date-price-range":{up:{...ns,fill:Rt,fillOpacity:.2,handle:{...li},statistics:{...Ef,color:"#fff",fill:Rt,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...ns,stroke:Ol,fill:El,fillOpacity:.2,handle:{...li,stroke:Ol},statistics:{...Ef,color:"#fff",fill:El,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{enabled:!0}},jN=["ohlc","line","step-line","hlc","high-low","candlestick","hollow-candlestick"],BN=[{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 VN(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:g=!0,zoom:m=!0,sync:b=!1,theme:y,data:v,formatter:M,...S}=e,D=_N(c,s,n,o,r,a),A=GN(i,r,a,u,l),L={navigator:{enabled:h,...u?{miniChart:{enabled:h,series:[{type:"line",xKey:s,yKey:l,stroke:Xh,marker:{enabled:!1}}]},height:40,minHandle:{height:46},maxHandle:{height:46}}:null}},C={annotations:{enabled:g,optionsToolbar:{enabled:g},snap:!0,toolbar:{enabled:g,buttons:BN,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,E={zoom:{enabled:m,autoScaling:{enabled:!0},enableIndependentAxes:!0}},R={ranges:{enabled:d}},P=b?{sync:{enabled:b,nodeInteraction:!0,zoom:!0}}:null,G=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 y=="string"?y:"ag-financial",...Ee(typeof y=="object"?y:null,{overrides:{common:{title:{padding:4},padding:{top:6,right:8,bottom:6},chartToolbar:{enabled:g},annotations:{...FN},axes:{number:{interval:{maxSpacing:45},label:{format:".2f"}}}},bar:{series:{fillOpacity:.5}},line:{series:{marker:{enabled:!1},...uS(c,{hlc:{stroke:{$palette:"altNeutral.stroke"},strokeWidth:2},line:{stroke:{$palette:"neutral.stroke"}},"step-line":{stroke:{$palette:"neutral.stroke"},interpolation:{type:"step"}}})}},candlestick:{series:{...uS(c,{"hollow-candlestick":{item:{up:{fill:"transparent"}}}})}},"range-area":{series:{fillOpacity:.3,strokeWidth:2}}}})},animation:{enabled:!1},legend:{enabled:!1},series:[...A,...D],axes:[{type:"number",position:"right",keys:[r,a,n,o],crosshair:{enabled:!0,snap:!1},layoutConstraints:{stacked:!1,width:100,unit:"percent",align:"start"}},...G,{type:"ordinal-time",position:"bottom",line:{enabled:!1},label:{enabled:!0},crosshair:{enabled:!0}}],tooltip:{enabled:!1},data:v,formatter:M,...C,...L,...w,...E,...R,...P,...S}}function GN(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,highlight:{enabled:!1}}]:[]}var cS="range-area";function _N(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 HN(l,o);case"line":case"step-line":return UN(l,a);case"hlc":return $N(l,a,o);case"high-low":return WN(l,o);case"candlestick":case"hollow-candlestick":return hS(l,o);default:return j.warnOnce(`unknown chart type: ${e}; expected one of: ${jN.join(", ")}`),hS(l,o)}}function HN(e,t){return[{type:"ohlc",focusPriority:0,...e,...t}]}function UN(e,t){return[{type:"line",focusPriority:0,...e,...t}]}function $N(e,t,{xKey:i,highKey:s,closeKey:n,lowKey:r}){return[{type:cS,focusPriority:0,...e,xKey:i,yHighKey:s,yLowKey:n,fill:Uh,stroke:_h},{type:cS,focusPriority:0,...e,xKey:i,yHighKey:n,yLowKey:r,fill:$h,stroke:Hh},{type:"line",...e,...t}]}function WN(e,{xKey:t,highKey:i,lowKey:s}){return[{type:"range-bar",...e,xKey:t,yHighKey:i,yLowKey:s,fill:Yh,stroke:Wh,tooltip:{range:"nearest"},focusPriority:0}]}function hS(e,t){return[{type:"candlestick",focusPriority:0,...e,...t}]}function uS(e,t){return t[e]??t.default}var dS={title:{enabled:!1},label:{enabled:!1},line:{enabled:!1},gridLine:{enabled:!1},crosshair:{enabled:!1,stroke:Zh,lineDash:[0],label:{enabled:!1}}},Pf={...dS,nice:!1},Xu={mode:"compact",position:{anchorTo:"node",placement:["right","left"]},showArrow:!1},Rf={style:[{stroke:{$ref:"gridLineColor"}}],width:2},YN={number:{gridLine:Rf},time:{gridLine:Rf},category:{gridLine:Rf}},KN={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:{...Pf,interval:{values:[0]}},log:{...Pf},time:{...Pf},category:{...dS}}},bar:{series:{crisp:!1,label:{placement:"inside-end",padding:4},sparklineMode:!0},tooltip:{...Xu,position:{...Xu.position,anchorTo:"pointer"},range:"nearest"},axes:YN},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}}},pS=Jt(ZN);function ZN(e,t){return typeof e=="string"?{...t,baseTheme:e}:e!=null?{...e,baseTheme:pS(e.baseTheme,t)}:t}function gS(e){if(Array.isArray(e)&&e.length!==0){const t=e.find(i=>i!=null);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"}}else if(e?.length===0)return{data:e,series:[{xKey:"x",yKey:"y"}],datumKey:"y"};return{data:e}}function XN(e){switch(e?.type){case"number":{const{type:t,min:i,max:s,reverse:n}=e;return ss(e,{type:t,reverse:n,min:i,max:s})}case"time":{const{type:t,min:i,max:s,reverse:n}=e;return ss(e,{type:t,reverse:n,min:i,max:s})}case"category":default:{const{paddingInner:t,paddingOuter:i,reverse:s}=e??{};return ss({...e,type:"category"},{type:"category",reverse:s,paddingInner:t,paddingOuter:i})}}}function qN(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 QN=Jt((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 JN(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:g,min:m,max:b,tooltip:y,context:v,styleNonce:M,...S}=e,D=ss(e,{background:t,container:i,height:s,listeners:n,locale:r,minHeight:o,minWidth:a,overrideDevicePixelRatio:l,padding:c,width:h,styleNonce:M,tooltip:Ti,context:Ti,data:Ti,crosshair:Ti,axis:Ti,min:Ti,max:Ti,theme:Ti}),{data:A,series:[I]=[],datumKey:L}=gS(d),C=S;I!=null&&Object.assign(C,I),C.tooltip={...y,renderer:QN(v,y,L)},D.theme=pS(u,KN),D.data=A,D.series=[C];const w=C.type!=="bar"||C.direction!=="horizontal",[E,R]=w?["bottom","left"]:["left","bottom"],P={...XN(g),position:E,...ss(e,{crosshair:p})},G={type:"number",gridLine:qN(g,!1,e),position:R,...ss(e,{min:m,max:b})};return D.axes=w?[G,P]:[P,G],D}var eE={chartType:z("candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"),dateKey:N,openKey:N,highKey:N,lowKey:N,closeKey:N,volumeKey:N,navigator:k,volume:k,rangeButtons:k,statusBar:k,toolbar:k,zoom:k,sync:k,theme:ee,container:ee,width:ee,height:ee,minWidth:ee,minHeight:ee,listeners:ee,initialState:ee,title:ee,data:Ns,formatter:ee},zf={theme:ee,container:ee,animation:ee,background:ee,contextMenu:ee,context:()=>!0,listeners:ee,locale:ee,width:ee,height:ee,minWidth:ee,minHeight:ee,title:ee,subtitle:ee,footnote:ee,padding:ee,tooltip:{...Oe,...le.tooltip}};zf.overrideDevicePixelRatio=he(T);var Ff=["showInLegend","showInMiniChart","grouped","stacked","stackGroup","tooltip","listeners","errorBar","xKey","yKey","type"],jf={visible:k,reverse:k,stroke:_,strokeWidth:T},Bf={context:()=>!0,tooltip:ee,theme:ee,background:ee,container:ee,width:ee,height:ee,minWidth:ee,minHeight:ee,padding:ee,listeners:ee,locale:ee,data:ee,styleNonce:N,axis:Pa({number:{...jf,min:qe(O,Es("max")),max:qe(O,Os("min"))},category:{...jf,paddingInner:K,paddingOuter:K},time:{...jf,min:qe(pe(O,Pn),Es("max")),max:qe(pe(O,Pn),Os("min"))}},"axis options","category"),min:qe(O,Es("max")),max:qe(O,Os("min")),crosshair:{enabled:k,snap:k,...B,...Y},xKey:N,yKey:N},tE={type:"preset",name:"price-volume",enterprise:!0,options:eE,create:VN},iE={type:"preset",name:"gauge-preset",enterprise:!0,options:Pa({"linear-gauge":{...V(Jn,["type"]),...zf},"radial-gauge":{...V(Gl,["type"]),...zf}},"gauge options"),create:zN},sE={type:"preset",name:"sparkline",options:Pa({area:{...Bf,...V(Q0,Ff)},bar:{...Bf,...V(mu,Ff)},line:{...Bf,...V(yu,Ff)}},"sparkline options"),create:JN,processData:gS},nE=["top","right","bottom","left"],qu=class QS extends Gh{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 p of[i,s])p.translationX=Math.floor(a),p.translationY=Math.floor(l);else{const{translationX:p,translationY:g}=i;gn(this.id,"seriesRect",this.ctx.animationManager,[i,s],{translationX:p,translationY:g},{translationX:Math.floor(a),translationY:Math.floor(l)},{phase:"update"})}this.lastLayoutWidth=t.width,this.lastLayoutHeight=t.height;const c=this.modulesManager.getModule("seriesArea"),h=r.clone().grow(c.getPadding()),u=c.clip||n?h:void 0,{lastUpdateClipRect:d}=this;this.lastUpdateClipRect=u,this.ctx.animationManager.isActive()&&d!=null?this.ctx.animationManager.animate({id:this.id,groupId:"clip-rect",phase:"update",from:d,to:h,onUpdate:p=>this.setRootClipRects(p),onComplete:()=>this.setRootClipRects(u)}):this.setRootClipRects(u),this.ctx.layoutManager.emitLayoutComplete(t,{axes:this.axes.map(p=>p.getLayoutState()),series:{visible:o,rect:r,paddedRect:h},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){j.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 y of nE){const v=this.modulesManager.getModule("seriesArea").getPadding()[y],M=this.axes.findLast(S=>S.position===y);M?M.seriesAreaPadding=v:i.shrink(v,y)}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{scene:d}=this.ctx,p=i.clone().shrink(Object.fromEntries(t));for(const y of this.axes){const{position:v="left",direction:M}=y,S=M==="y";let D;this.sizeAxis(y,p,v),y.thickness==null?D=Vf(S,d)*(y.maxThicknessRatio??1):D=y.thickness;const{primaryTickCount:A,bbox:I}=y.calculateLayout(y.nice?n[M]:void 0,{sizeLimit:D,padding:this.padding});n[M]??(n[M]=A),o||(o=y.dataDomain.clipped||y.visibleRange[0]>0||y.visibleRange[1]<1),y.thickness==null&&(D=Math.min(Vf(S,I)??0,D)),s.set(y.id,Math.ceil(D))}const g=bd(this.axes,y=>y.position??"left"),m=new Map,b=new Map;for(const[y,v]of ls(g)){let M=Vf(y!=="left"&&y!=="right",d)%d.pixelRatio,S=0;for(const D of v??[]){b.set(D.id,M);const A=s.get(D.id)??0;S=Math.max(S,M+A),D.layoutConstraints.stacked&&(M+=A+QS.AxesPadding)}m.set(y,Math.ceil(S))}for(const[y,v]of ls(g))this.positionAxes({axes:v??[],position:y,axisWidths:s,axisOffsets:b,axisAreaWidths:m,axisBound:i,seriesRect:p});return{clipSeries:o,seriesRect:p,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 vi&&(o.position=n??"top",(a=o.label).parallel??(a.parallel=r.parallel)),o.calculatePadding?.(i)})});for(const[s,n=0]of ls(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 Ys,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:g,align:m}=t.layoutConstraints;g==="px"?h=c+p:h=h*p/100,m==="end"&&(c=l-(h-c),h=l),r&&(n?[c,h]=[h,c]:[u,d]=[1-d,1-u]),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 g of i){const m=o.get(u==="x"?"left":"top")??0,b=n.get(g.id)??0,y=r.get(g.id)??0;g.gridPadding=c-y-b,g.translation[u]=s[u]+m,g.translation[h]=this.clampToOutsideSeriesRect(a,p+d*(y+b),h,d)}}shouldFlipXY(){return this.series.every(t=>t instanceof ao&&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}}};qu.className="CartesianChart",qu.type="cartesian",qu.AxesPadding=15;var rE=qu;function Vf(e,t){return e?t?.width:t?.height}var Qu={mode:he(z("integrated","standalone")),container:vm,context:()=>!0,theme:ee,series:Ns,annotations:ee,navigator:ee,initialState:{chartType:N,annotations:ee,legend:qt({visible:k,seriesId:N,itemId:N,legendItemName:N},"legend state array"),zoom:ee}},fS={...le,...Qu,axes:yr(2),data:Ns},mS={...le,...Qu,axes:yr(2),data:Ns},oE={...le,...Qu,data:Ns,topology:nI},aE={...le,...Qu,data:Ns},lE=new Set(["number","log","time"]),cE=e=>ot(e)&&!lE.has(e.type),hE={type:"chart",name:"cartesian",options:fS,detect:zx,create(e,t){return new rE(e,t)},validate(e,t,i){const s=[];e?.series?.[0]?.type==="histogram"&&e?.axes?.some(cE)&&(s.push(new mr("invalid","only continuous axis types when histogram series is used",e.axes,i,"axes")),e=V(e,["axes"]));const n=ci(e,t,i);return n.invalid.push(...s),n}},yS=()=>{throw new Error("Enterprise module placeholder cannot be initialised")},uE={type:"chart",name:"standalone",placeholder:!0,options:{},detect:jx,create:yS},dE={type:"chart",name:"topology",placeholder:!0,options:{},detect:Fx,create:yS},Da=class extends $p{constructor(){super(...arguments),this.shape="polygon",this.innerRadiusRatio=0,this.defaultTickMinSpacing=20}layoutCrossLines(){const e=this.label.getSideFlag(),t=this.hasDefinedDomain()||this.hasVisibleSeries(),{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(Th())}computeLabelsBBox(e,t){return null}computeRange(){}getAxisLinePoints(){}};f([x],Da.prototype,"shape",2),f([x],Da.prototype,"innerRadiusRatio",2);var Gf=class extends Gh{constructor(e,t){super(e,t),this.padding=new Cr(40),this.ctx.axisManager.axisGroup.zIndex=8}getChartType(){return"polar"}async performLayout(e){const{layoutBox:t}=e,i=t.clone().shrink(this.modulesManager.getModule("seriesArea").getPadding());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:t}})}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 Da)||!(r instanceof Da))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(pE),i=this.axes.filter(gE),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(g=>{const m=g.getInnerRadius();return{series:g,innerRadius:m}}).sort((g,m)=>g.innerRadius-m.innerRadius);p.at(-1).series.surroundingRadius=void 0;for(let g=0;g<p.length-1;g++)p[g].series.surroundingRadius=p[g+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 mo(i,t)){const g=await p.computeLabelsBBox({hideWhenNecessary:c},e);g&&h.push(g)}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 mo(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 g=Math.min(d,p)/2;const m=.5*i.width/2,b=.5*i.height/2,y=Math.min(m,b);if(g<y){g=y;const S=l+h,D=c+u;if(2*g+D>i.height){const A=i.height-2*g;Math.min(c,u)*2>A?(c=A/2,u=A/2):c>u?c=A-u:u=A-c}if(2*g+S>i.width){const A=i.width-2*g;Math.min(l,h)*2>A?(l=A/2,h=A/2):l>h?l=A-h:h=A-l}}const v=l+2*g+h,M=c+2*g+u;return{centerX:(i.width-v)/2+l+g,centerY:(i.height-M)/2+c+g,radius:g}}};Gf.className="PolarChart",Gf.type="polar";function pE(e){return e instanceof wf}function gE(e){return e instanceof Da}var fE={type:"chart",name:"polar",options:mS,detect:bT,create(e,t){return new Gf(e,t)},validate(e,t,i){const s=[],n=e?.series?.[0]?.type;(n==="pie"||n==="donut")&&e?.axes&&(s.push(new pd([],e.axes,i,"axes")),e=V(e,["axes"]));const r=ci(e,t,i);return r.invalid.push(...s),r}},mE=[hE,Xk,qk,Qk,Jk,ew,tw,OM,VM,UM,WM,KM,ZM],yE=[fE,kN,EN],bE=[...mE,...yE,uE,dE,tE,iE,sE],xE=1e3,_f=class gr{constructor(t,i,s,n,r,o=xE){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 gr(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),gr.debug(()=>[`Pool[name=${this.name}]: Created instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i])):gr.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 gr.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.");gr.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),gr.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);gr.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()}};_f.pools=new Map,_f.debug=be.create(!0,"pool");var vE=_f;bi.registerMany(bE,Lr);var Nn=be.create(!0,"opts"),ur=class{static licenseCheck(e){this.licenseChecked||(this.licenseManager=rr.licenseManager?.(e),this.licenseManager?.validateLicense(),this.licenseChecked=!0)}static getLicenseDetails(e){return rr.licenseManager?.({}).getLicenseDetails(e)}static getInstance(e){return bS.getInstance(e)}static create(e,t){const i=be.check("scene:stats","scene:stats:verbose")?performance.now():void 0;return Nn.group("AgCharts.create()",()=>{e=be.inDevelopmentMode(()=>on(lt(e)))??e,this.licenseCheck(e);const s=bS.createOrUpdate({userOptions:e,licenseManager:this.licenseManager,optionsMetadata:t,apiStartTime:i});return this.licenseManager?.isDisplayWatermark()&&this.licenseManager&&rr.injectWatermark?.(s.chart.ctx.domManager,this.licenseManager.getWatermarkMessage()),s})}static createFinancialChart(e){return Nn.group("AgCharts.createFinancialChart()",()=>this.create(e,{presetType:"price-volume"}))}static createGauge(e){return Nn.group("AgCharts.createGauge()",()=>this.create(e,{presetType:"gauge-preset"}))}static __createSparkline(e){return Nn.group("AgCharts.__createSparkline()",()=>{const{pool:t,...i}=e;return this.create(i,{presetType:"sparkline",pool:t??!0,domMode:"minimal",withDragInterpretation:!1})})}};ur.licenseChecked=!1;var Js=class fr{static getInstance(t){const i=Gh.getInstance(t);return i?Xv.chartInstances.get(i):void 0}static initialiseModules(){fr.initialised||(Nf(),ON(),fr.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,data:c,stripSymbols:h=!1,apiStartTime:u}=t,d=rr.styles!=null?[["ag-charts-enterprise",rr.styles]]:[];fr.initialiseModules(),Nn(()=>[">>> AgCharts.createOrUpdate() user options",lt(s)]);const{presetType:p}=a;let g=s;ur.optionsMutationFn&&g&&(g=ur.optionsMutationFn(lt(g,sc.OPTIONS_CLONE_OPTS_FAST),p),Nn(()=>[">>> AgCharts.createOrUpdate() MUTATED user options",lt(g)]));const m=this.getPool(a);let b=!1,y,v=i?.chart;v==null&&m?.hasFree()&&(y=m.obtainFree(),v=y.item);const{document:M,window:S,styleContainer:D,...A}=g??{},I=v?.getChartOptions(),L=new sc(I,A,r,{...o,document:M,window:S,styleContainer:D},a,l,h,u);return(v==null||bi.detectChartDefinition(L.processedOptions)!==bi.detectChartDefinition(v.chartOptions.processedOptions))&&(y?.release(),y=this.getPool(L.optionMetadata)?.obtain(L),y?v=y.item:(b=!0,v=fr.createChartInstance(L,v))),d.forEach(([C,w])=>{v.ctx.domManager.addStyles(C,w)}),v.ctx.fontManager.updateFonts(L.googleFonts),c!=null&&v.ctx.dataService.restoreData(c),i==null?(i=new Xv(v,fr.callbackApi,n),i.releaseChart=y?.release):(y||b)&&(i.releaseChart?.(),i.chart=v,i.releaseChart=y?.release),Nn.check()&&typeof window<"u"&&(window.agChartInstances??(window.agChartInstances={}),window.agChartInstances[v.id]=v),v.queuedUserOptions.push(L.userOptions),v.queuedChartOptions.push(L),v.requestFactoryUpdate(C=>{Nn.group(">>>> Chart.applyOptions()",()=>{C.applyOptions(L);const w=C.queuedUserOptions.indexOf(L.userOptions)+1;C.queuedUserOptions.splice(0,w),C.queuedChartOptions.splice(0,w)})}),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,s){i=lt(i,sc.OPTIONS_CLONE_OPTS_FAST);const n=Bn(i,fr.markRemovedProperties,new Set(["data"]),void 0,void 0,!1);Nn(()=>[">>> AgCharts.updateUserDelta() user delta",lt(i)]),fr.createOrUpdate({proxy:t,deltaOptions:i,stripSymbols:n,apiStartTime:s})}static createChartInstance(t,i){const s=i?.destroy({keepTransferableResources:!0});return bi.detectChartDefinition(t.processedOptions).create(t,s)}static getPool(t){if(t.pool===!0)return vE.getPool(t.presetType??"default",this.createChartInstance,this.detachAndClear,this.destroy,1/0)}};Js.caretaker=new Uy(Lr),Js.initialised=!1,Js.callbackApi={caretaker:Js.caretaker,create(e,t,i,s,n){return Js.createOrUpdate({userOptions:e,processedOverrides:t,specialOverrides:i,optionsMetadata:s,data:n})},update(e,t,i,s){return Js.createOrUpdate({userOptions:e,proxy:t,specialOverrides:i,apiStartTime:s})},updateUserDelta(e,t,i){return Js.updateUserDelta(e,t,i)}},Js.detachAndClear=e=>e.detachAndClear(),Js.destroy=e=>e.destroy();var bS=Js,Hf={};Fs(Hf,{Arc:()=>en,BBox:()=>U,Caption:()=>ct,CategoryScale:()=>Ho,Group:()=>ge,Line:()=>zi,LinearScale:()=>Zr,Marker:()=>Pt,Path:()=>di,RadialColumnShape:()=>rs,Rect:()=>Et,Scene:()=>dh,Sector:()=>ai,Shape:()=>Lt,TranslatableGroup:()=>hi,getRadialColumnWidth:()=>xS,toRadians:()=>Qt});var en=class extends di{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.radius=10,this.startAngle=0,this.endAngle=Math.PI*2,this.counterClockwise=!1,this.type=0}get fullPie(){return _i(Ct(this.startAngle),Ct(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)}};en.className="Arc",f([F()],en.prototype,"centerX",2),f([F()],en.prototype,"centerY",2),f([F()],en.prototype,"radius",2),f([F()],en.prototype,"startAngle",2),f([F()],en.prototype,"endAngle",2),f([F()],en.prototype,"counterClockwise",2),f([F()],en.prototype,"type",2);function Uf(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 rs=class extends di{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:g}=Uf(d%2===0?n:r,d<2?o:a,s);l=Math.min(p,l),c=Math.min(g,c),h=Math.max(p,h),u=Math.max(g,u)}return new U(l,c,h-l,u-c)}getRotation(){const{startAngle:e,endAngle:t}=this,i=Kc(e,t);return Ct(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])=>Uf(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=_i(s,n),l=Math.asin(e/2/s),c=this.getRotation(),h=(L,C)=>Uf(L,C,c),u=(L,C)=>Math.sqrt(L**2+C**2),d=(L,C)=>C>L?0:Math.sqrt(L**2-C**2),p=(L,C,w)=>w?L<C:L>C,g=a&&!isNaN(l)&&l<Math.PI/6;let m=-e/2,b=e/2;const y=-i,v=-s*(g?Math.cos(l):1),M=p(r,u(s,e/2),!o);if(M){const L=d(r,s);m=-L,b=L}t.clear(!0);const S=h(m,v);t.moveTo(S.x,S.y);const D=_i(s,i),A=p(r,u(i,e/2),!o);if(D&&g)t.arc(0,0,s,Ct(-l-Math.PI/2)+c,Ct(l-Math.PI/2)+c,!1);else if(A){const L=-d(r,e/2),C=d(r,i);if(!M){const w=h(m,L);t.lineTo(w.x,w.y)}if(t.arc(0,0,r,Math.atan2(L,m)+c,Math.atan2(y,-C)+c,!1),!_i(C,0)){const w=h(C,y);t.lineTo(w.x,w.y)}t.arc(0,0,r,Math.atan2(y,C)+c,Math.atan2(L,b)+c,!1)}else{const L=h(m,y),C=h(b,y);t.lineTo(L.x,L.y),t.lineTo(C.x,C.y)}const I=h(b,v);if(t.lineTo(I.x,I.y),g)t.arc(0,0,s,Ct(l-Math.PI/2)+c,Ct(-l-Math.PI/2)+c,!0);else{const L=h(m,v);t.lineTo(L.x,L.y)}t.closePath()}};rs.className="RadialColumnShape",f([F()],rs.prototype,"isBeveled",2),f([F()],rs.prototype,"columnWidth",2),f([F()],rs.prototype,"startAngle",2),f([F()],rs.prototype,"endAngle",2),f([F()],rs.prototype,"outerRadius",2),f([F()],rs.prototype,"innerRadius",2),f([F()],rs.prototype,"axisInnerRadius",2),f([F()],rs.prototype,"axisOuterRadius",2),f([F()],rs.prototype,"isRadiusAxisReversed",2);function xS(e,t,i,s,n){const r=Kc(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 $f={};Fs($f,{ChartTheme:()=>ys,DEFAULT_ANNOTATION_HANDLE_FILL:()=>Ll,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>wl,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>Nl,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>El,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>Ol,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>Tl,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>kl,DEFAULT_CAPTION_ALIGNMENT:()=>Zn,DEFAULT_CAPTION_LAYOUT_STYLE:()=>Kn,DEFAULT_FIBONACCI_STROKES:()=>Al,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>Rt,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>mt,DEFAULT_GRIDLINE_ENABLED:()=>ms,DEFAULT_POLAR_SERIES_STROKE:()=>Kh,DEFAULT_SEPARATION_LINES_COLOUR:()=>Il,DEFAULT_SHADOW_COLOUR:()=>Yn,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>Zh,DEFAULT_TEXTBOX_COLOR:()=>zl,DEFAULT_TEXTBOX_FILL:()=>Pl,DEFAULT_TEXTBOX_STROKE:()=>Rl,DEFAULT_TEXT_ANNOTATION_COLOR:()=>Cl,DEFAULT_TOOLBAR_POSITION:()=>Fl,IS_DARK_THEME:()=>Zo,PALETTE_ALT_DOWN_FILL:()=>cg,PALETTE_ALT_DOWN_STROKE:()=>ag,PALETTE_ALT_NEUTRAL_FILL:()=>hg,PALETTE_ALT_NEUTRAL_STROKE:()=>ug,PALETTE_ALT_UP_FILL:()=>lg,PALETTE_ALT_UP_STROKE:()=>og,PALETTE_DOWN_FILL:()=>$h,PALETTE_DOWN_STROKE:()=>Hh,PALETTE_NEUTRAL_FILL:()=>Yh,PALETTE_NEUTRAL_STROKE:()=>Wh,PALETTE_UP_FILL:()=>Uh,PALETTE_UP_STROKE:()=>_h,getChartTheme:()=>Du,resolveOperation:()=>SE,themeNames:()=>ME,themeSymbols:()=>rg,themes:()=>Ug});var ME=Object.keys(Ug);function SE(e){const t=ys.getDefaultPublicParameters(),i=ys.getDefaultColors();return new Yv({line:{operation:e}},{series:[{type:"line"}]},t,i).resolve().operation}var Wf={};Fs(Wf,{Color:()=>We,interpolateColor:()=>yb});function vS(e,t,i,s){return{unit:e,step:t,epoch:i,utc:s,every(n){return vS(this.unit,(this.step??1)*n,this.epoch,this.utc)}}}var MS={};function wt(e,t=1,i,s=!1){j.warnOnce("time import is deprecated, use object notation instead");const n=`${e}:${t}:${i?.getTime()??0}:${s}`;let r=MS[n];return r==null&&(r=vS(e,t,i,s),MS[n]=r),r}var DE={get millisecond(){return wt("millisecond")},get second(){return wt("second")},get minute(){return wt("minute")},get hour(){return wt("hour")},get day(){return wt("day")},get monday(){return wt("day",7,new Date(1970,0,5))},get tuesday(){return wt("day",7,new Date(1970,0,6))},get wednesday(){return wt("day",7,new Date(1970,0,7))},get thursday(){return wt("day",7,new Date(1970,0,1))},get friday(){return wt("day",7,new Date(1970,0,2))},get saturday(){return wt("day",7,new Date(1970,0,3))},get sunday(){return wt("day",7,new Date(1970,0,4))},get month(){return wt("month")},get year(){return wt("year")},get utcMillisecond(){return wt("millisecond",1,void 0,!0)},get utcSecond(){return wt("second",1,void 0,!0)},get utcMinute(){return wt("minute",1,void 0,!0)},get utcHour(){return wt("hour",1,void 0,!0)},get utcDay(){return wt("day",1,void 0,!0)},get utcMonth(){return wt("month",1,void 0,!0)},get utcYear(){return wt("year",1,void 0,!0)}},SS={};Fs(SS,{AGGREGATION_INDEX_X_MAX:()=>Vi,AGGREGATION_INDEX_X_MIN:()=>Mi,AGGREGATION_INDEX_Y_MAX:()=>is,AGGREGATION_INDEX_Y_MIN:()=>ts,AGGREGATION_SPAN:()=>Qs,AbstractBarSeries:()=>PM,AbstractBarSeriesProperties:()=>bf,ActionOnSet:()=>ui,AnchoredPopover:()=>wS,Animation:()=>Mb,AnimationManager:()=>Cb,Arc:()=>en,Axis:()=>$p,AxisGroupZIndexMap:()=>mx,AxisInterval:()=>Or,AxisLabel:()=>it,AxisTick:()=>Pr,AxisTickGenerator:()=>Ex,BASE_FONT_SIZE:()=>dn,BBox:()=>U,Background:()=>ma,BackgroundModule:()=>qv,BandScale:()=>pn,BarSeries:()=>fc,BarSeriesModule:()=>BM,BaseModuleInstance:()=>Gc,BaseProperties:()=>re,BaseToolbar:()=>im,Border:()=>so,ButtonWidget:()=>Qa,CachedTextMeasurer:()=>Ey,CachedTextMeasurerPool:()=>Gn,CallbackCache:()=>Iy,Caption:()=>ct,CartesianAxis:()=>xl,CartesianSeries:()=>ao,CartesianSeriesNodeEvent:()=>tf,CartesianSeriesProperties:()=>cr,CategoryAxis:()=>ea,CategoryScale:()=>Ho,ChangeDetectableProperties:()=>Jg,Chart:()=>Gh,ChartAxisDirection:()=>np,ChartOptions:()=>sc,ChartUpdateType:()=>Ja,CollapseMode:()=>pM,Color:()=>We,ColorScale:()=>Mo,ConicGradient:()=>oy,ContextMenuBuiltins:()=>Lb,ContextMenuRegistry:()=>Tb,ContinuousScale:()=>Ye,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>xa,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>va,DEFAULT_POLAR_DIRECTION_KEYS:()=>nS,DEFAULT_POLAR_DIRECTION_NAMES:()=>rS,DEFAULT_TOOLTIP_CLASS:()=>Kt,DEFAULT_TOOLTIP_DARK_CLASS:()=>Qx,DIRECTION_SWAP_AXES:()=>c0,DOMManager:()=>eb,DataController:()=>ex,DataModel:()=>Jb,DataModelSeries:()=>ef,DataService:()=>ph,Debug:()=>be,Deprecated:()=>IE,DeprecatedAndRenamedTo:()=>AE,DiscreteTimeAxis:()=>$0,DiscreteTimeScale:()=>ds,DragInterpreter:()=>zb,DraggablePopover:()=>NS,DropShadow:()=>qs,ExtendedPath2D:()=>Do,FILL_GRADIENT_CONIC_DEFAULTS:()=>ak,FILL_GRADIENT_LINEAR_DEFAULTS:()=>Xo,FILL_GRADIENT_LINEAR_HIERARCHY_DEFAULTS:()=>sk,FILL_GRADIENT_LINEAR_SHADED_DEFAULTS:()=>nk,FILL_GRADIENT_RADIAL_DEFAULTS:()=>qh,FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS:()=>jl,FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS:()=>ok,FILL_GRADIENT_RADIAL_SERIES_DEFAULTS:()=>rk,FILL_IMAGE_DEFAULTS:()=>Fr,FILL_PATTERN_DEFAULTS:()=>vn,FILL_PATTERN_HIERARCHY_DEFAULTS:()=>lk,FONT_SIZE:()=>sp,FONT_SIZE_RATIO:()=>Pi,FillGradientDefaults:()=>Ki,FillImageDefaults:()=>Ii,FillPatternDefaults:()=>nt,FloatingToolbar:()=>rO,FormatManager:()=>Po,Gradient:()=>Xc,Group:()=>ge,GroupedCategoryAxis:()=>Kr,HdpiCanvas:()=>gp,HierarchyNode:()=>HE,HierarchySeries:()=>UE,HierarchySeriesProperties:()=>As,HighlightManager:()=>kb,HighlightProperties:()=>yn,HighlightState:()=>Vx,HighlightStyle:()=>vl,Image:()=>Aa,InteractionManager:()=>Ib,InteractionState:()=>Db,InterpolationProperties:()=>Ma,Invalidating:()=>Ha,LABEL_BOXING_DEFAULTS:()=>Qi,LARGEST_KEY_INTERVAL:()=>P0,LEGEND_CONTAINER_THEME:()=>d0,Label:()=>pt,LayoutElement:()=>Cp,LayoutManager:()=>Ub,LegendMarkerLabel:()=>Ji,Line:()=>zi,LineSeries:()=>yc,LineSeriesModule:()=>YM,LinearGradient:()=>ay,LinearScale:()=>Zr,LogScale:()=>wg,LonLatBBox:()=>$E,Marker:()=>Pt,Menu:()=>iO,MenuItemWidget:()=>em,MenuWidget:()=>TS,MercatorScale:()=>WE,ModuleRegistry:()=>bi,Motion:()=>yp,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>gs,NativeWidget:()=>No,NewAreaSeriesModule:()=>OM,NewBarSeriesModule:()=>VM,NewBubbleSeriesModule:()=>UM,NewHistogramSeriesModule:()=>WM,NewLineSeriesModule:()=>KM,NewScatterSeriesModule:()=>ZM,NiceMode:()=>ux,Node:()=>an,NumberAxis:()=>Ys,ObserveChanges:()=>Vn,OrdinalTimeScale:()=>Wo,PHASE_METADATA:()=>nl,PHASE_ORDER:()=>Ro,PREV_NEXT_KEYS:()=>ko,Padding:()=>Cr,ParallelStateMachine:()=>RL,Path:()=>di,PointerEvents:()=>ey,PolarAxis:()=>Da,PolarSeries:()=>wf,PolarZIndexMap:()=>sS,Popover:()=>tm,PropertiesArray:()=>Ua,Property:()=>x,ProxyInteractionService:()=>ob,ProxyOnWrite:()=>oA,ProxyProperty:()=>Gt,ProxyPropertyOnWrite:()=>Dt,QUICK_TRANSITION:()=>fh,QuadtreeNearest:()=>rM,RENDER_TO_OFFSCREEN_CANVAS_THRESHOLD:()=>Tu,RadialColumnShape:()=>rs,Range:()=>Hs,Rect:()=>Et,RepeatType:()=>vb,Rotatable:()=>Io,RotatableGroup:()=>JI,RotatableText:()=>Fy,SAFE_FILLS_OPERATION:()=>dg,SAFE_FILL_OPERATION:()=>tk,SAFE_RANGE2_OPERATION:()=>ik,SAFE_STROKE_FILL_OPERATION:()=>Xh,SKIP_JS_BUILTINS:()=>Nd,SMALLEST_KEY_INTERVAL:()=>O0,SORT_DOMAIN_GROUPS:()=>R0,Scalable:()=>Ud,ScalableGroup:()=>QI,ScaleAlignment:()=>sy,Scene:()=>dh,SceneArrayChangeDetection:()=>Pd,SceneChangeDetection:()=>F,SceneObjectChangeDetection:()=>Ei,SceneRefChangeDetection:()=>qm,Sector:()=>ai,SectorBox:()=>XM,Selection:()=>gi,Series:()=>Bh,SeriesContentZIndexMap:()=>Hx,SeriesGroupingChangedEvent:()=>jh,SeriesItemHighlightStyle:()=>mn,SeriesMarker:()=>Zt,SeriesNodeEvent:()=>Fh,SeriesNodePickMode:()=>$x,SeriesProperties:()=>Zi,SeriesTooltip:()=>Tn,SeriesZIndexMap:()=>_x,Shape:()=>Lt,SimpleTextMeasurer:()=>ep,SliderWidget:()=>dp,StateMachine:()=>ll,StateMachineProperty:()=>PL,StopProperties:()=>Vd,SvgPath:()=>CS,TRIPLE_EQ:()=>vo,Text:()=>Oi,TextUtils:()=>He,TextWrapper:()=>Xa,ThemeConstants:()=>jy,ThemeSymbols:()=>rg,TimeAxisParentLevel:()=>sa,TimeScale:()=>$o,Toolbar:()=>sO,ToolbarButtonProperties:()=>xc,ToolbarButtonWidget:()=>ES,ToolbarWidget:()=>uh,Tooltip:()=>Xi,TooltipManager:()=>yh,TooltipPosition:()=>zr,Transformable:()=>dt,TransformableGroup:()=>Co,TransformableText:()=>To,Translatable:()=>Ao,TranslatableGroup:()=>hi,TranslatableSvgPath:()=>eO,UnitTimeScale:()=>Wn,UpdateService:()=>$b,Vec2:()=>Ia,Vec4:()=>ol,WIDGET_HTML_EVENTS:()=>Zd,Widget:()=>Bs,WidgetEventUtil:()=>un,ZIndexMap:()=>lb,ZoomManager:()=>Hb,accumulateGroup:()=>F0,accumulateStack:()=>j0,accumulatedValue:()=>I0,accumulativeValueProperty:()=>Ag,addEscapeEventListener:()=>ah,addHitTestersToQuadtree:()=>yf,addMouseCloseListener:()=>op,addOverrideFocusVisibleEventListener:()=>lp,addTouchCloseListener:()=>ap,adjustLabelPlacement:()=>sM,aggregationDomain:()=>uc,aggregationIndexForXRatio:()=>hf,aggregationRangeFittingPoints:()=>lf,aggregationXRatioForDatumIndex:()=>cf,aggregationXRatioForXValue:()=>kn,angleBetween:()=>Kc,angleCategoryAxisOptionsDefs:()=>Y0,angleNumberAxisOptionsDefs:()=>W0,angularPadding:()=>zd,animationValidation:()=>Yl,annotationCalloutStylesDefs:()=>uv,annotationChannelStyleDefs:()=>zg,annotationChannelTextDefs:()=>ov,annotationCommentStylesDefs:()=>dv,annotationCrossLineStyleDefs:()=>Rg,annotationDisjointChannelStyleDefs:()=>cv,annotationFibonacciStylesDefs:()=>Fg,annotationLineStyleDefs:()=>xu,annotationLineTextDefs:()=>bu,annotationMeasurerStylesDefs:()=>vu,annotationNoteStylesDefs:()=>pv,annotationOptionsDef:()=>da,annotationParallelChannelStyleDefs:()=>hv,annotationQuickMeasurerStylesDefs:()=>gv,annotationShapeStylesDefs:()=>jg,annotationTextStylesDef:()=>Zl,applyShapeFillBBox:()=>Ux,applyShapeStyle:()=>bn,areScalingEqual:()=>lo,area:()=>Ig,autoSizedLabelOptionsDefs:()=>Qn,bezier2DDistance:()=>fy,bezier2DExtrema:()=>gy,boxPlotHighlightStyleOptionsDef:()=>Vg,boxPlotSeriesThemeableOptionsDef:()=>fv,boxPlotStyleOptionsDef:()=>Bg,buildDateFormatter:()=>Tr,buildResetPathFn:()=>ff,calculateDataDiff:()=>FM,calculateLabelTranslation:()=>ZE,calculatePlacement:()=>Yx,callWithContext:()=>us,candlestickSeriesThemeableOptionsDef:()=>yv,cartesianAxisBandHighlightOptions:()=>$l,cartesianAxisCrosshairOptions:()=>er,cartesianAxisLabelOptionsDefs:()=>Hl,cartesianAxisOptionsDefs:()=>An,cartesianChartOptionsDefs:()=>fS,cartesianCrossLineOptionsDefs:()=>Dn,cartesianNumericAxisLabel:()=>xg,cartesianTimeAxisLabel:()=>Ul,cartesianTimeAxisParentLevel:()=>hu,checkCrisp:()=>zM,chordSeriesThemeableOptionsDef:()=>bv,clampArray:()=>rl,clippedRoundRect:()=>rh,collapsedStartingBarPosition:()=>Bu,commonAxisIntervalOptionsDefs:()=>vg,commonAxisLabelOptionsDefs:()=>In,commonAxisOptionsDefs:()=>Yr,commonChartOptionsDefs:()=>le,commonCrossLineLabelOptionsDefs:()=>Wr,commonCrossLineOptionsDefs:()=>Ws,commonSeriesOptionsDefs:()=>vs,commonSeriesThemeableOptionsDefs:()=>Le,compactAggregationIndices:()=>df,compareDates:()=>Kp,computeBarFocusBounds:()=>Mf,computeMarkerFocusBounds:()=>Pu,coneFunnelSeriesThemeableOptionsDef:()=>xv,continuousAxisOptions:()=>Qo,countExpandingSearch:()=>Eb,createAggregationIndices:()=>uf,createButton:()=>XE,createCheckbox:()=>qE,createDatumId:()=>Cn,createDeprecationWarning:()=>Yf,createIcon:()=>AS,createIdsGenerator:()=>Jp,createSelect:()=>QE,createTextArea:()=>JE,dateToNumber:()=>Fi,dateTruncationForDomain:()=>Yp,datesSortOrder:()=>Xp,datumKeys:()=>xh,datumStylerProperties:()=>_n,deconstructSelectionsOrNodes:()=>mh,deepClone:()=>lt,deepFreeze:()=>on,diff:()=>Kl,discreteTimeAxisIntervalOptionsDefs:()=>Mg,drawCorner:()=>Za,drawMarkerUnitPolygon:()=>Sl,durationDay:()=>Nr,durationHour:()=>wr,durationMinute:()=>Un,durationMonth:()=>Fp,durationSecond:()=>Bo,durationWeek:()=>rx,durationYear:()=>cl,easing:()=>yp,enterpriseModule:()=>rr,errorBarOptionsDefs:()=>su,errorBarThemeableOptionsDefs:()=>Bl,estimateTickCount:()=>Tx,evaluateBezier:()=>So,expandLegendPosition:()=>Au,extent:()=>tr,extractDecoratedProperties:()=>Ym,fillsOptionsDef:()=>Vl,findMinMax:()=>_t,findQuadtreeMatch:()=>ju,findRangeExtent:()=>zo,fixNumericExtent:()=>Ri,focusCursorAtEnd:()=>tA,formatNumber:()=>nb,formatObjectValidator:()=>b0,formatPercent:()=>ib,formatValue:()=>Eo,fromToMotion:()=>Ot,funnelSeriesThemeableOptionsDef:()=>vv,getAngleRatioRadians:()=>ty,getColorStops:()=>cy,getCrossLineValue:()=>cx,getDateTicksForInterval:()=>Qp,getDatumRefPoint:()=>xp,getElementBBox:()=>Ay,getIconClassNames:()=>eh,getLabelStyles:()=>Xs,getLastFocus:()=>hh,getMissCount:()=>qb,getPath:()=>wd,getPathComponents:()=>Qb,getRadialColumnWidth:()=>xS,getSequentialColors:()=>ji,getShapeFill:()=>Ko,getShapeStyle:()=>Us,groupAccumulativeValueProperty:()=>sr,groupAverage:()=>D0,groupCount:()=>Dg,groupStackValueProperty:()=>E0,groupSum:()=>S0,hasNoModifiers:()=>qa,heatmapSeriesThemeableOptionsDef:()=>Mv,initMenuKeyNav:()=>Ky,initRovingTabIndex:()=>Yy,interpolatePoints:()=>wu,interpolationOptionsDefs:()=>nu,intervalCeil:()=>ox,intervalEpoch:()=>gl,intervalExtent:()=>jp,intervalFloor:()=>$i,intervalHierarchy:()=>fl,intervalMilliseconds:()=>xi,intervalNext:()=>lx,intervalPrevious:()=>ax,intervalRange:()=>Wi,intervalRangeCount:()=>Bp,intervalRangeStartIndex:()=>Ih,intervalStep:()=>$n,intervalUnit:()=>_s,isAgStandaloneChartOptions:()=>jx,isAgTopologyChartOptions:()=>Fx,isBetweenAngles:()=>Sr,isButtonClickEvent:()=>ch,isChartAxisDirection:()=>kA,isContinuous:()=>Ah,isDecoratedObject:()=>Wc,isDenseInterval:()=>Uo,isGradientFill:()=>hs,isGradientOrPatternFill:()=>ZI,isImageFill:()=>Ar,isInputPending:()=>Cy,isObjectWithProperty:()=>Xm,isObjectWithStringProperty:()=>II,isPatternFill:()=>Fn,isProperties:()=>Ir,isScaleValid:()=>cc,jsonApply:()=>Ka,jsonDiff:()=>hn,jsonPropertyCompare:()=>Ly,jsonWalk:()=>Bn,keyProperty:()=>ir,legendSymbolSvg:()=>qx,lineDistanceSquared:()=>qc,linearGaugeSeriesOptionsDef:()=>Jn,linearGaugeSeriesThemeableOptionsDef:()=>au,linearGaugeTargetOptionsDef:()=>ru,listDecoratedProperties:()=>zn,lowestGranularityForInterval:()=>ml,lowestGranularityUnitForTicks:()=>Wp,lowestGranularityUnitForValue:()=>kh,makeAccessibleClickListener:()=>FA,makeSeriesTooltip:()=>oo,mapLineBackgroundSeriesThemeableOptionsDef:()=>Iv,mapLineSeriesThemeableOptionsDef:()=>Dv,mapMarkerSeriesThemeableOptionsDef:()=>Av,mapShapeBackgroundSeriesThemeableOptionsDef:()=>Lv,mapShapeSeriesThemeableOptionsDef:()=>Cv,mapValues:()=>Zm,markerFadeInAnimation:()=>dc,markerOptionsDefs:()=>Sn,markerScaleInAnimation:()=>EM,markerSwipeScaleInAnimation:()=>pf,memo:()=>tl,merge:()=>Va,mergeArrayDefaults:()=>Km,mergeDefaults:()=>Ee,midpointStartingBarPosition:()=>oN,minimumTimeAxisDatumGranularity:()=>H0,moduleRegistry:()=>js,motion:()=>aO,multiSeriesHighlightStyle:()=>Xn,nearestSquared:()=>Uc,nearestSquaredInContainer:()=>vI,nextPowerOf2:()=>FC,nightingaleSeriesThemeableOptionsDef:()=>Tv,normaliseGroupTo:()=>du,normalisePropertyTo:()=>pu,normalisedExtentWithMetadata:()=>Sg,normalizeAngle180:()=>Yc,normalizeAngle360:()=>Ct,normalizeAngle360FromDegrees:()=>ln,normalizeAngle360Inclusive:()=>NI,normalizeContinuousDomains:()=>Dp,numberFormatValidator:()=>xs,objectsEqual:()=>Nt,objectsEqualWith:()=>Td,ohlcSeriesThemeableOptionsDef:()=>Sv,ordinalTimeAxisOptionsDefs:()=>ha,pairUpSpans:()=>lc,partialAssign:()=>Od,pathFadeInAnimation:()=>Ru,pathMotion:()=>Cu,pathSwipeInAnimation:()=>gf,pick:()=>kd,pickByMatchingAngle:()=>iS,plotAreaPathFill:()=>LM,plotInterpolatedAreaSeriesFillSpans:()=>Eu,plotInterpolatedLinePathStroke:()=>Nu,plotLinePathStroke:()=>rf,pointsEq:()=>hc,polarChartOptionsDefs:()=>mS,prepareAreaFillAnimationFns:()=>TM,prepareAreaPathAnimation:()=>kM,prepareAxisAnimationContext:()=>dx,prepareAxisAnimationFunctions:()=>px,prepareBarAnimationFunctions:()=>Vu,prepareLinePathAnimation:()=>CM,prepareLinePathPropertyAnimation:()=>af,prepareLinePathStrokeAnimationFns:()=>of,preparePieSeriesAnimationFunctions:()=>Ku,previousPowerOf2:()=>Sp,processedDataIsAnimatable:()=>ta,pyramidSeriesThemeableOptionsDef:()=>kv,radarAreaSeriesThemeableOptionsDef:()=>wv,radarLineSeriesThemeableOptionsDef:()=>Nv,radialBarSeriesThemeableOptionsDef:()=>Ev,radialColumnSeriesThemeableOptionsDef:()=>Ov,radialGaugeSeriesOptionsDef:()=>Gl,radialGaugeSeriesThemeableOptionsDef:()=>lu,radialGaugeTargetOptionsDef:()=>ou,radiusCategoryAxisOptionsDefs:()=>Z0,radiusNumberAxisOptionsDefs:()=>K0,range:()=>Nh,rangeAreaSeriesThemeableOptionsDef:()=>Pv,rangeBarSeriesThemeableOptionsDef:()=>Rv,rangeValidator:()=>eu,rangedValueProperty:()=>N0,resetAxisFillSelectionFn:()=>fx,resetAxisGroupFn:()=>gx,resetAxisLabelSelectionFn:()=>Th,resetAxisLineSelectionFn:()=>Up,resetBarSelectionsFn:()=>gc,resetLabelFn:()=>ro,resetMarkerFn:()=>Ou,resetMarkerPositionFn:()=>pc,resetMotion:()=>ti,resetPieSelectionsFn:()=>tS,rowCountProperty:()=>k0,sankeySeriesThemeableOptionsDef:()=>zv,scale:()=>yi,sectorBox:()=>qM,seriesLabelFadeInAnimation:()=>It,seriesLabelFadeOutAnimation:()=>Lu,seriesLabelOptionsDefs:()=>Ue,setElementBBox:()=>Jc,setPath:()=>Ed,shadowOptionsDefs:()=>$s,shallowClone:()=>Yd,simpleMemorize:()=>Jt,simpleMemorize2:()=>il,singleSeriesHighlightStyle:()=>u0,solveBezier:()=>Qc,sortAndUniqueDates:()=>Zp,splitBezier2D:()=>Wa,standaloneChartOptionsDefs:()=>aE,staticFromToMotion:()=>gn,stopPageScrolling:()=>Zy,sum:()=>Dk,sumValues:()=>uu,sunburstSeriesThemeableOptionsDef:()=>Fv,textOrSegments:()=>yg,tickFormat:()=>Cx,timeInterval:()=>cu,timeIntervalUnit:()=>_l,toDegrees:()=>EI,toRadians:()=>Qt,toolbarButtonOptionsDefs:()=>$r,tooltipContentAriaLabel:()=>e0,tooltipHtml:()=>s0,tooltipOptionsDefs:()=>Oe,topologyChartOptionsDefs:()=>oE,trailingAccumulatedValue:()=>A0,trailingAccumulatedValueProperty:()=>Tk,treemapSeriesThemeableOptionsDef:()=>jv,updateClipPath:()=>zu,updateLabelNode:()=>iM,validateCrossLineValue:()=>hx,valueProperty:()=>tt,visibleRangeIndices:()=>Nb,waterfallSeriesThemeableOptionsDef:()=>Bv,without:()=>V});function Yf(){return(e,t)=>{const i=[`Property [${e}] is deprecated.`,t].filter(Boolean).join(" ");j.warnOnce(i)}}function IE(e,t){const i=Yf(),s=t?.default;return Mr((n,r,o)=>(o!==s&&i(r.toString(),e),o))}function AE(e,t){const i=Yf();return Mr((s,n,r)=>(r!==s[e]&&(i(n.toString(),`Use [${e}] instead.`),Ed(s,e,t?t(r):r)),Cd),(s,n)=>(i(n.toString(),`Use [${e}] instead.`),wd(s,e)))}var Ia={add:CE,angle:EE,apply:GE,equal:BE,distance:kE,distanceSquared:wE,from:VE,gradient:PE,intercept:RE,intersectAtX:FE,intersectAtY:zE,length:Zf,lengthSquared:TE,multiply:LE,normalized:NE,origin:DS,required:_E,rotate:OE,round:jE,sub:Kf};function CE(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 LE(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 TE(e){return e.x*e.x+e.y*e.y}function kE(e,t){const i=Kf(e,t);return Math.sqrt(i.x*i.x+i.y*i.y)}function wE(e,t){const i=Kf(e,t);return i.x*i.x+i.y*i.y}function NE(e){const t=Zf(e);return{x:e.x/t,y:e.y/t}}function EE(e,t){return t==null?Math.atan2(e.y,e.x):Math.atan2(e.y,e.x)-Math.atan2(t.y,t.x)}function OE(e,t,i=DS()){const s=Zf(e);return{x:i.x+s*Math.cos(t),y:i.y+s*Math.sin(t)}}function PE(e,t,i){const s=t.x-e.x;return(i==null?t.y-e.y:i-t.y-(i-e.y))/s}function RE(e,t,i){return(i==null?e.y:i-e.y)-t*e.x}function zE(e,t,i=0,s){return{x:e===1/0?1/0:(i-t)/e,y:s==null?i:s-i}}function FE(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 jE(e,t=2){return{x:wm(e.x,t),y:wm(e.y,t)}}function BE(e,t){return e.x===t.x&&e.y===t.y}function VE(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 GE(e,t){return e.x=t.x,e.y=t.y,e}function _E(e){return{x:e?.x??0,y:e?.y??0}}function DS(){return{x:0,y:0}}var IS=class nd{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=nd.Walk.PreOrder){i===nd.Walk.PreOrder&&t(this),this.children.forEach(s=>{s.walk(t,i)}),i===nd.Walk.PostOrder&&t(this)}*[Symbol.iterator](){yield this;for(const t of this.children)yield*t}};IS.Walk={PreOrder:0,PostOrder:1};var HE=IS,UE=class extends Bh{constructor(e){super({moduleCtx:e,pickModes:[1,0]}),this.colorDomain=[0,0],this.maxDepth=0,this.colorScale=new Mo,this.animationState=new ll("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,g)=>{const m=g.depth!=null?g.depth+1:0,b=t!=null?d[t]:void 0,y=b==null||b.length===0;let v=i!=null?d[i]:void 0;Number.isFinite(v)?v=Math.max(v,0):v=y?1:0;const M=v;r=Math.max(r,m);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,m,g,[]),b)},c=(d,p)=>{const{datumIndex:g}=d;return p?.forEach((m,b)=>{const y=l(m,g.concat(b),d);d.children.push(y),d.sumSize+=y.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()}dataCount(){return NaN}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(e,t){return[NaN,NaN]}getLegendData(e){const{colorKey:t,colorRange:i}=this.properties,{id:s,ctx:{legendManager:n},visible:r}=this;return e==="gradient"&&t!=null&&i!=null?[{legendType:"gradient",enabled:r&&n.getItemEnabled({seriesId:s}),seriesId:s,series:this.getFormatterContext("color"),colorRange:i,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(rn(i.datumIndex,e))return t-1;return 0}pickFocus(e){if(!this.rootNode?.children.length)return;const t=se(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]=se(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)){j.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){}},As=class extends Zi{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(Tt),this.fillGradientDefaults=new Ki,this.fillPatternDefaults=new nt,this.fillImageDefaults=new Ii,this.strokes=Object.values(xn)}};f([x],As.prototype,"childrenKey",2),f([x],As.prototype,"sizeKey",2),f([x],As.prototype,"colorKey",2),f([x],As.prototype,"colorName",2),f([x],As.prototype,"fills",2),f([x],As.prototype,"fillGradientDefaults",2),f([x],As.prototype,"fillPatternDefaults",2),f([x],As.prototype,"fillImageDefaults",2),f([x],As.prototype,"strokes",2),f([x],As.prototype,"colorRange",2);var $E=class JS{constructor(t,i,s,n){this.lon0=t,this.lat0=i,this.lon1=s,this.lat1=n}extend(t,i,s,n){return this.lon0=Math.min(this.lon0,t),this.lat0=Math.min(this.lat0,i),this.lon1=Math.max(this.lon1,s),this.lat1=Math.max(this.lat1,n),this}merge(t){return this.extend(t.lon0,t.lat0,t.lon1,t.lat1)}static extend(t,i,s,n,r){return t?t.extend(i,s,n,r):new JS(i,s,n,r)}},Ju=Math.PI/180,Xf=e=>e*Ju,qf=e=>-Math.log(Math.tan(Math.PI*.25+e*Ju*.5)),Qf=e=>e/Ju,Jf=e=>(Math.atan(Math.exp(-e))-Math.PI*.25)/(Ju*.5),WE=class um extends Zc{constructor(t,i){super(),this.domain=t,this.range=i,this.type="mercator",this.defaultTickCount=0,this.bounds=um.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 um([[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)]}},YE={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}},KE={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 ZE({yDirection:e,padding:t=0,position:i="top",bbox:s}){const n=e?YE:KE,{xTranslationDirection:r,yTranslationDirection:o}=n[i],a=r*(t+s.width/2),l=o*(t+s.height/2);return{xTranslation:a,yTranslation:l}}function XE(e,t){const i=ve("button",ed("ag-charts-input ag-charts-button",t));return e.label!==void 0?i.append(e.label):(i.append(AS(e.icon)),i.ariaLabel=e.altText),i.addEventListener("click",e.onPress),yo(i,t),i}function qE(e,t){const i=ve("input",ed("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=>{ch(s)&&(s.preventDefault(),i.click())}),yo(i,t),i}function QE(e,t){const i=ve("select",ed("ag-charts-input ag-charts-select",t));return i.append(...e.options.map(s=>{const n=ve("option");return n.value=s.value,n.textContent=s.label,n})),Ce(i,"data-preventdefault",!1),i.value=e.value,i.addEventListener("change",s=>e.onChange(i.value,s)),yo(i,t),i}function JE(e,t){const i=ve("textarea",ed("ag-charts-input ag-charts-textarea",t));return i.value=e.value,i.addEventListener("input",s=>e.onChange(i.value,s)),yo(i,t),Ce(i,"data-preventdefault",!1),i}function AS(e){const t=ve("span",`ag-charts-icon ag-charts-icon-${e}`);return Ce(t,"aria-hidden",!0),t}function ed(e,t){return t==null?e:`${e} ${t.class}`}var CS=class extends di{constructor(e=""){super(),this._d="",this.d=e}get d(){return this._d}set d(e){e!==this._d&&(this._d=e,this.path.clear(),this.path.appendSvg(e),this.checkPathDirty())}},eO=class extends Ao(CS){isPointInPath(e,t){return super.isPointInPath(e-this.translationX,t-this.translationY)}},Aa=class extends an{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)}};f([F()],Aa.prototype,"x",2),f([F()],Aa.prototype,"y",2),f([F()],Aa.prototype,"width",2),f([F()],Aa.prototype,"height",2),f([F()],Aa.prototype,"opacity",2);var LS={};Fs(LS,{ButtonWidget:()=>Qa,MenuItemWidget:()=>em,MenuWidget:()=>TS,NativeWidget:()=>No,SliderWidget:()=>dp,ToolbarWidget:()=>uh,WIDGET_HTML_EVENTS:()=>Zd,Widget:()=>Bs,WidgetEventUtil:()=>un});var em=class extends tb{constructor(){super(ve("div"),"menuitem")}},tO=["Escape","ArrowLeft"],TS=class eD extends hp{constructor(t="vertical"){super(t,"menu"),this.closeSubMenu=i=>this.openSubMenu(i,void 0)}destructor(){this.selfClose("2")}addSeparator(){const t=ws().createElement("div");return Ce(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 em,i=Bc(),s=new eD(this.orientation),n=o=>{t.isDisabled()||this.openSubMenu(o,s)},r=o=>{qa(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){if(this.openScope!=null)return;this.openScope={lastFocus:hh(t.sourceEvent),openSubMenu:void 0,abort:()=>this.selfClose("1"),close:()=>this.selfClose("0"),removers:new at};const s=this.openScope,n=this.children.map(r=>r.getElement());Ce(s.lastFocus,"aria-expanded",!0),s.removers.register(op(this.elem,s.abort),ap(this.elem,s.abort),...this.children.map(r=>ah(r.getElement(),s.close,tO)),i?.overrideFocusVisible&&lp(this.elem,n,i.overrideFocusVisible)),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"),Ce(i,"aria-expanded",!1),t==="0"&&i?.focus({preventScroll:!0}),s.flush(),this.internalListener?.dispatch("close-widget",this,{type:"close-widget"})}close(){this.selfClose("0")}},kS="canvas-overlay",tm=class extends Gc{constructor(e,t,i){super(),this.ctx=e,this.hideFns=[],this.moduleId=`popover-${t}`,i?.detached?this.element=ve("div"):this.element=e.domManager.addChild(kS,this.moduleId),this.element.setAttribute("role","presentation"),this.cleanup.register(()=>e.domManager.removeChild(kS,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=ve("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=hh(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)}},wS=class extends tm{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),Fe().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=se(0,e.x,n.width-r),l=se(0,e.y,n.height-o);a!==e.x&&i?.x!=null&&(a=se(0,i.x-r,n.width-r)),l!==e.y&&i?.y!=null&&(l=se(0,i.y-o,n.height-o)),this.updatePosition({x:a,y:l})}},iO=class extends wS{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=Ky({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=ve("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=ve("span",`ag-charts-menu__icon ${eh(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=ve("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=>{ch(l)&&(o(),l.preventDefault(),l.stopPropagation())};return n.addEventListener("keydown",a),n.addEventListener("click",a),n.addEventListener("mousemove",()=>{n.focus({preventScroll:!0})}),n}},NS=class extends tm{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}},xc=class extends re{};f([x],xc.prototype,"icon",2),f([x],xc.prototype,"label",2),f([x],xc.prototype,"ariaLabel",2),f([x],xc.prototype,"tooltip",2);var ES=class extends Qa{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="${eh(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){Ce(this.elem,"aria-checked",e)}},OS="ag-charts-toolbar__button--active",im=class extends uh{constructor({eventsHub:e,localeManager:t},i,s){super(s),this.ariaLabelId=i,this.horizontalSpacing=10,this.verticalSpacing=10,this.events=new ub,this.hasPrefix=!1,this.buttonWidgets=[],this.updateAriaLabel=()=>this.setAriaLabel(this.localeManager.t(this.ariaLabelId)),this.eventsHub=e,this.localeManager=t,this.addClass("ag-charts-toolbar"),this.toggleClass("ag-charts-toolbar--horizontal",s==="horizontal"),this.toggleClass("ag-charts-toolbar--vertical",s==="vertical"),this.eventsHub.on("locale:change",this.updateAriaLabel),this.updateAriaLabel()}setAriaLabelId(e){this.ariaLabelId=e,this.updateAriaLabel()}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(OS,!1)}toggleActiveButtonByIndex(e){if(e!==-1)for(const[t,i]of this.buttonWidgets.entries())i.toggleClass(OS,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 re?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}},sO=class extends im{createButtonWidget(){return new ES(this.localeManager)}},nO=class extends NS{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(se(0,e.x,i.width-t.width)),e.y=Math.floor(se(0,e.y,i.height-t.height)),super.updatePosition(e),this.onPopoverMoved()}},rO=class extends im{constructor(e,t,i){super(e,t,"horizontal"),this.hasPrefix=!0,this.popover=new nO(e,i,this.onPopoverMoved.bind(this)),this.dragHandle=new oO(e.localeManager.t("toolbarAnnotationsDragHandle")),this.popover.setDragHandle(this.dragHandle)}destroy(){super.destroy(),this.popover.destroy()}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)}},oO=class extends No{constructor(e){super(ve("div","ag-charts-floating-toolbar__drag-handle"));const t=new No(ve("span",`${eh("drag-handle")} ag-charts-toolbar__icon`));t.setAriaHidden(!0),this.addChild(t),this.elem.title=e}},aO={...ix,...sx},lO={VERSION:Lr,_Scene:Hf,_Theme:$f,_Util:Wf,create:ur.create.bind(ur),createSparkline:ur.__createSparkline.bind(ur),setup:Nf,isEnterprise:!1};if(typeof Ls.exports=="object"&&typeof Ta=="object"){var cO=(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};Ls.exports=cO(Ls.exports,Ta)}return Ls.exports});