UNPKG

ag-charts-community

Version:

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

28 lines 1.2 MB
(function(Ml,Gn){typeof exports=="object"&&typeof module=="object"?module.exports=Gn():typeof define=="function"&&define.amd?define("agCharts",[],Gn):typeof exports=="object"?exports.agCharts=Gn():Ml.agCharts=Gn()})(this,()=>{var Ml={},Gn={exports:Ml};if(typeof p_>"u")var p_=function(e){throw new Error("Unknown module: "+e)};var Ih=Object.defineProperty,Eb=Object.getOwnPropertyDescriptor,nw=Object.getOwnPropertyNames,sw=Object.prototype.hasOwnProperty,wi=(t,e)=>{for(var i in e)Ih(t,i,{get:e[i],enumerable:!0})},rw=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of nw(e))!sw.call(t,s)&&s!==i&&Ih(t,s,{get:()=>e[s],enumerable:!(n=Eb(e,s))||n.enumerable});return t},aw=t=>rw(Ih({},"__esModule",{value:!0}),t),x=(t,e,i,n)=>{for(var s=n>1?void 0:n?Eb(e,i):e,r=t.length-1,a;r>=0;r--)(a=t[r])&&(s=(n?a(e,i,s):a(s))||s);return n&&s&&Ih(e,i,s),s},Rb={};wi(Rb,{AG_CHARTS_LOCALE_EN_US:()=>lI,AgCharts:()=>Vr,AgChartsCommunityModule:()=>d_,AgTooltipAnchorToType:()=>dv,AgTooltipPlacementType:()=>gv,AllCartesianAxesModule:()=>FI,AllCartesianModule:()=>zD,AllCartesianSeriesModule:()=>BD,AllCommunityModule:()=>qy,AllPolarModule:()=>eC,AreaSeriesModule:()=>yD,BarSeriesModule:()=>MD,BubbleSeriesModule:()=>ND,CartesianChartModule:()=>sn,CategoryAxisModule:()=>DI,CrossLinesModule:()=>Ts,DonutSeriesModule:()=>JD,GroupedCategoryAxisModule:()=>LI,HistogramSeriesModule:()=>RD,LegendModule:()=>Xf,LineSeriesModule:()=>FD,LocaleModule:()=>Jf,LogAxisModule:()=>NI,ModuleRegistry:()=>ee,NumberAxisModule:()=>OI,PieSeriesModule:()=>QD,PolarChartModule:()=>sg,ScatterSeriesModule:()=>_D,SparklinePresetModule:()=>X0,TimeAxisModule:()=>EI,UnitTimeAxisModule:()=>PI,VERSION:()=>Ye,_ModuleSupport:()=>dA,_Scene:()=>Db,_Theme:()=>Cb,_Util:()=>Ab,_Widget:()=>RA,time:()=>UF}),Gn.exports=aw(Rb);var Pb=(t=>(t.Chart="chart",t.Axis="axis",t.Series="series",t.Plugin="plugin",t.AxisPlugin="axis:plugin",t.SeriesPlugin="series:plugin",t.Preset="preset",t))(Pb||{});function Il(t){return t.domain}var Fb=(t=>(t[t.Leading=0]="Leading",t[t.Trailing=1]="Trailing",t[t.Interpolate=2]="Interpolate",t))(Fb||{}),ms=class{constructor(){this.events=new Map}on(t,e){return this.events.has(t)||this.events.set(t,new Set),this.events.get(t)?.add(e),()=>this.off(t,e)}off(t,e){const i=this.events.get(t);i&&(i.delete(e),i.size===0&&this.events.delete(t))}emit(t,e){const i=this.events.get(t);if(i)for(const n of i)n(e)}clear(t){t?this.events.delete(t):this.events.clear()}},Dh=class{constructor(t){if(this.maxCacheSize=t,this.store=new Map,t<=0)throw new Error("LRUCache size must be greater than 0")}get(t){if(!this.store.has(t))return;const e=this.store.get(t);return this.store.delete(t),this.store.set(t,e),e}has(t){return this.store.has(t)}set(t,e){return this.store.set(t,e),this.store.size>this.maxCacheSize&&this.store.delete(this.store.keys().next().value),e}clear(){this.store.clear()}},ue={};wi(ue,{Time:()=>pw,check:()=>Qa,create:()=>qb,inDevelopmentMode:()=>Jb});function Dl(t){return t===void 0?[]:Array.isArray(t)?t:[t]}function Dg(t){return Array.from(new Set(t))}function Cl(t,e){return t.reduce((i,n)=>{const s=e(n);return i[s]??(i[s]=[]),i[s].push(n),i},{})}function jn(t,e){if(t==null||e==null||t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(Array.isArray(t[i])&&Array.isArray(e[i])){if(!jn(t[i],e[i]))return!1}else if(t[i]!==e[i])return!1;return!0}function Mn(t,e,i=0){if(t.length===0)return[];const n=[];for(let s=0;s<e;s++)n.push(t.at((s+i)%t.length));return n}function Vb(t,e){const i=new Map;for(const[n,s]of e.entries())i.set(s,n);return t.sort((n,s)=>{const r=i.get(n)??1/0,a=i.get(s)??1/0;return r-a})}function _b(t,e){let i=0;for(;i<t.length&&e(t[i]);)i+=1;const n=i;n!==0&&t.splice(0,n)}function Bb(t,e){let i=t.length-1;for(;i>=0&&e(t[i]);)i-=1;const n=t.length-1-i;n!==0&&t.splice(t.length-n,n)}function zb(t,e,i){const n=[t],s=Math.round((e-t)/(i-1));if(s>0)for(let r=t+s;r<e&&!(n.push(r)>=i-1);r+=s);return n.push(e),n}var ki={};typeof globalThis.window<"u"&&(ki.window=globalThis.window),typeof document<"u"?ki.document=document:typeof globalThis.global<"u"&&(ki.document=globalThis.document);function Gr(t){return t?ki.document?.[t]:ki.document}function Hn(t){return t?ki.window?.[t]:ki.window}function Gb(t){ki.document=t}function jb(t){ki.window=t}function Ch(){return ki.window?.OffscreenCanvas??globalThis.OffscreenCanvas}function Al(){return ki.window?.Path2D??globalThis.Path2D}function Cg(){return ki.window?.DOMMatrix??globalThis.DOMMatrix}function Hb(){return ki.window?.Image??globalThis.Image}function $b(){return ki.window?.ResizeObserver??globalThis.ResizeObserver}var Ub=1,ow=11;function Ah(t){return t!=null&&typeof t.nodeType=="number"}function Ag(t){return t!=null&&t.nodeType===Ub}function Wb(t){return t!=null&&t.nodeType===ow}function Ja(t){return t!=null&&t.nodeType===Ub&&"style"in t}var j={};wi(j,{error:()=>Kb,errorOnce:()=>cw,log:()=>wh,logGroup:()=>Zb,reset:()=>hw,table:()=>lw,warn:()=>$n,warnOnce:()=>vi});var wg=new Set;function wh(...t){console.log(...t)}function $n(t,...e){console.warn(`AG Charts - ${t}`,...e)}function Kb(t,...e){typeof t=="object"?console.error("AG Charts error",t,...e):console.error(`AG Charts - ${t}`,...e)}function lw(...t){console.table(...t)}function Yb(t,e,i){let n;t instanceof Error?n=t.message:typeof t=="string"?n=t:typeof t=="object"?n=JSON.stringify(t):n=String(t);const s=`${e}: ${n}`;wg.has(s)||(i(t),wg.add(s))}function vi(t,...e){Yb(t,"Logger.warn",i=>$n(i,...e))}function cw(t,...e){Yb(t,"Logger.error",i=>Kb(i,...e))}function hw(){wg.clear()}function uw(t){return typeof t=="object"&&t!==null&&"then"in t}function Zb(t,e){console.groupCollapsed(t);let i=!0;try{const n=e();return uw(n)?(i=!1,n.finally(()=>{console.groupEnd()})):n}finally{i&&console.groupEnd()}}var dw=2e3,Xb=Date.now();function gw(){const t=Date.now()-Xb;if(t>dw){const e=(Math.floor(t/100)/10).toFixed(1);wh(`**** ${e}s since last log message ****`)}Xb=Date.now()}function qb(...t){return Object.assign((...i)=>{Qa(...t)&&(typeof i[0]=="function"&&(i=Dl(i[0]())),gw(),wh(...i))},{check:()=>Qa(...t),group:(i,n)=>Qa(...t)?Zb(i,n):n()})}function Qa(...t){return t.length===0&&t.push(!0),Dl(Hn("agChartsDebug")).some(i=>t.includes(i))}function Jb(t){if(Qa("dev"))return t()}function pw(t,e={}){const{logResult:i=!0,logStack:n=!1,logArgs:s=!1,logData:r}=e;return function(a,o,l){const c=l.value;l.value=function(...h){const u=performance.now(),d=c.apply(this,h),p={duration:performance.now()-u};return i&&(p.result=d),s&&(p.args=h),n&&(p.stack=new Error("Stack trace for timing debug").stack),r&&(p.logData=r(this)),wh(t,p),d}}}var js={};wi(js,{flush:()=>ev,record:()=>Qb});var kg=new Map;function Qb(t,e){Qa("scene:stats:verbose")&&kg.set(t,e)}function ev(){const t=Object.fromEntries(kg);return kg.clear(),t}var Hs={},ee={};wi(ee,{RegistryMode:()=>tv,getAxisModule:()=>Cw,getChartModule:()=>Aw,getPresetModule:()=>ww,getSeriesModule:()=>kw,hasModule:()=>Mw,ifRegistryChanged:()=>vw,isEnterprise:()=>iv,isIntegrated:()=>yw,isModuleType:()=>eo,isUmd:()=>bw,listModules:()=>Iw,listModulesByType:()=>Dw,register:()=>Tg,registerModules:()=>xw,reset:()=>Sw,setRegistryMode:()=>fw});var tv=(t=>(t.Enterprise="enterprise",t.Integrated="integrated",t.UMD="umd",t))(tv||{}),wl=new Set;function fw(t){wl.add(t)}function mw(){wl.clear()}function iv(){return wl.has("enterprise")}function yw(){return wl.has("integrated")}function bw(){return wl.has("umd")}var Un=new Map,kh=0;function nv(t){if(Un.set(t.name,t),kh++,t.dependencies)for(const e of t.dependencies)Tg(e)}function vw(t,e){return kh!==t&&e(),kh}function Tg(t){const e=Un.get(t.name);if(!e){nv(t);return}if(e.version===t.version){!e.enterprise&&t.enterprise&&nv(t);return}throw new Error([`AG Charts - Module '${t.name}' already registered with different version:`,`${e.version} vs ${t.version}`,"","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 xw(t){for(const e of t.flat())Tg(e)}function Sw(){mw(),Un.clear(),kh++}function Mw(t){return Un.has(t)}function*Iw(){for(const t of Un.values())yield t}function*Dw(t){for(const e of Un.values())eo(t,e)&&(yield e)}function Cw(t){const e=Un.get(t);if(eo("axis",e))return e}function Aw(t){const e=Un.get(t);if(eo("chart",e))return e;throw new Error("AG Charts - Unknown chart type; Check options are correctly structured and series types are specified")}function ww(t){const e=Un.get(t);if(eo("preset",e))return e}function kw(t){const e=Un.get(t);if(eo("series",e))return e}function eo(t,e){return e?.type===t}var nt=class{constructor(){this.callbacks=new Set}flush(){for(const t of this.callbacks)t();this.callbacks.clear()}merge(t){for(const e of t.callbacks)this.callbacks.add(e)}register(...t){for(const e of t)e&&this.callbacks.add(e)}},kl=class{constructor(){this.cleanup=new nt}destroy(){this.cleanup.flush()}};function f_(t){return t}var sv=new WeakMap;function Wn(t){const e=sv.get(t);if(!e)throw new Error("AG Charts - DynamicContext: missing internal state.");return e}var Tw=class PA{constructor(e){const i={cleanup:new nt,self:this,resolving:new Set,children:new Set,refs:new Set,parent:e,destroyed:!1};sv.set(this,i),e&&Wn(e).children.add(this)}get cleanup(){return Wn(this).cleanup}constant(e,i){return this.assertNotDestroyed(),Object.defineProperty(this,e,{value:i,configurable:!0,enumerable:!0}),Wn(this).self}ref(e,i){this.assertNotDestroyed();const n=Wn(this);return n.refs.add(e),Object.defineProperty(this,e,{value:i,configurable:!0,enumerable:!0}),n.self}service(e,i){return this.assertNotDestroyed(),Object.defineProperty(this,e,{configurable:!0,enumerable:!0,get:()=>{const n=this.resolve(e,i);return Object.defineProperty(this,e,{value:n,configurable:!0,enumerable:!0}),n}}),Wn(this).self}factory(e,i){return this.assertNotDestroyed(),Object.defineProperty(this,e,{configurable:!0,enumerable:!0,get:()=>this.resolve(e,i)}),Wn(this).self}has(e){return e in this}child(){const e=new PA(this);return Object.setPrototypeOf(e,this),e}destroy(){const e=Wn(this);if(e.destroyed)return;e.destroyed=!0;for(const n of e.children)n.destroy();e.children.clear();const i=Object.keys(this);for(let n=i.length-1;n>=0;n--){const s=i[n];if(e.refs.has(s))continue;const r=Object.getOwnPropertyDescriptor(this,s);r?.value!=null&&typeof r.value=="object"&&r.value.destroy?.()}e.cleanup.flush(),e.parent&&Wn(e.parent).children.delete(this)}resolve(e,i){const n=Wn(this);if(n.destroyed)throw new Error(`AG Charts - DynamicContext: cannot resolve '${e}' on a destroyed context.`);if(n.resolving.has(e))throw new Error(`AG Charts - DynamicContext: circular dependency detected while resolving '${e}'.`);n.resolving.add(e);try{return i(n.self)}finally{n.resolving.delete(e)}}assertNotDestroyed(){if(Wn(this).destroyed)throw new Error("AG Charts - DynamicContext: cannot register on a destroyed context.")}};function Lg(){return new Tw}function te(t,e,i){return Math.min(i,Math.max(t,e))}function rv(t,e,i=1e-10){return t>=e[0]-i&&t<=e[1]+i}function Ti(t,e,i=1e-10){return t===e||Math.abs(t-e)<i}function to(t){return Math.sign(t)===-1||Object.is(t,-0)}function av(t){return t%1===0}function Th(t,e=2){const i=10**e;return Math.round(t*i)/i}function Lw(t,e=2){const i=10**e;return Math.ceil(t*i)/i}function ov(t,e){return Math.floor(t%e+(t<0?Math.abs(e):0))}function Lh(t){if(Math.floor(t)===t)return 0;let e=String(t),i=0;if(t<1e-6||t>=1e21){let s;[e,s]=e.split("e"),s!=null&&(i=Number(s))}const n=e.split(".")[1]?.length??0;return Math.max(n-i,0)}function Nw(t,e){for(let i=e+1;i<t.length;i++)if(t[i]?.stop!=null)return i;return t.length-1}function Ng(t,e,i,n){const s=new Array(t.length);let r=0,a=-1;for(let o=0;o<t.length;o++){o>=a&&(a=Nw(t,o));const l=t[o]?.stop;if(l==null){const c=t[r]?.stop,h=t[a]?.stop,u=c??e,d=h??i,g=n&&c==null?1:0;s[o]=u+(d-u)*(o-r+g)/(a-r+g)}else s[o]=l,r=o}return s}function lv(t,e,i,n){if(t.name!=null)return t.name;const s=e===i.length-1;return Number.isInteger(t.start)&&Number.isInteger(t.end)&&!s&&t.end-t.start>=1?`${n(t.start,0)}\u2013${n(t.end-1,0)}`:`${n(t.start)}\u2013${n(t.end)}`}function cv(t,e,i){if(t.length===0)return{domain:[],range:[],bins:[]};const[n,s]=e,r=i==="discrete",a=Ng(t,n,s,r),o=t.map(l=>l.color);return r?Ow(a,o,t,n,s):{domain:a,range:o,bins:[]}}function Ow(t,e,i,n,s){const r=[],a=[],o=[];for(let l=0;l<i.length;l++){const c=l===0?n:t[l-1],h=t[l],u=te(n,c,s),d=Math.max(u,te(n,h,s));r.push(u),a.push(e[l]),o.push({start:u,end:d,color:e[l],name:i[l].name})}return r.push(o.at(-1).end),{domain:r,range:a,bins:o}}function hv(t){const{domain:e,range:i,mode:n,displayDomain:s}=t;if(i.length===0)return[];const[r,a]=s??[e[0],e.at(-1)],o=a-r||1;if(n==="discrete"){const l=[];for(let c=0;c<i.length;c++){const h=te(0,(e[c]-r)/o,1),u=te(0,(e[c+1]-r)/o,1);u<h||(l.push({stop:h,color:i[c]}),u>h&&l.push({stop:u,color:i[c]}))}return l}if(e.length<i.length){const l=Math.max(i.length-1,1);return i.map((c,h)=>({stop:h/l,color:c}))}return e.map((l,c)=>({stop:(l-r)/o,color:i[c]}))}function Og(t,e,i,n,s){return lv({start:t,end:e,color:""},i,{length:n},s)}function uv(t,e,i,n){const{domain:s,range:r,mode:a}=t;if(a!=="discrete"||r.length===0)return;let o=0;for(;o<r.length-1&&i>=s[o+1];)o++;return e[o]?.name??Og(s[o],s[o+1],o,r.length,n)}function Eg(t){return t.flatMap((e,i)=>{const{stop:n}=e,s=t.at(i+1)?.color;return s==null?[e]:[e,{stop:n,color:s}]})}var Ew=void 0,Rw=void 0;Rw=Ew;var Pw=void 0,Fw=void 0;Fw=Pw;var dv=(t=>(t.POINTER="pointer",t.NODE="node",t.CHART="chart",t))(dv||{}),gv=(t=>(t.TOP="top",t.RIGHT="right",t.BOTTOM="bottom",t.LEFT="left",t.TOP_RIGHT="top-right",t.BOTTOM_RIGHT="bottom-right",t.BOTTOM_LEFT="bottom-left",t.TOP_LEFT="top-left",t.CENTER="center",t))(gv||{}),Vw=void 0,_w=void 0;_w=Vw;var Bw=void 0,zw=void 0;zw=Bw;var io="\u2026",$s=/\r?\n/g,Tl="\u200B",pv=/[\s.,;:-]{1,5}$/,Ll;function fv(t){if(Ll==null){const i=Hn("Option");Ll=new i().style}Ll.color=t;const e=Ll.color||null;return Ll.color="",e}function no(t){return t?.ownerDocument.defaultView?.getComputedStyle(t).direction==="rtl"}function Nh(t,e){if(!t)return;const{x:i,y:n,width:s,height:r}=jw(e);Oh(t.style,"width",s),Oh(t.style,"height",r),Oh(t.style,"left",i),Oh(t.style,"top",n)}function mv(t){const e=Number.parseFloat(t.style.width),i=Number.parseFloat(t.style.height),n=Number.parseFloat(t.style.left),s=Number.parseFloat(t.style.top),r=Number.isFinite(e)?e:t.offsetWidth,a=Number.isFinite(i)?i:t.offsetHeight,o=Number.isFinite(n)?n:t.offsetLeft,l=Number.isFinite(s)?s:t.offsetTop;return{x:o,y:l,width:r,height:a}}function Gw(t){if(t.focus({preventScroll:!0}),t.lastChild?.textContent==null)return;const{ownerDocument:e}=t,i=e.createRange();i.setStart(t.lastChild,t.lastChild.textContent.length),i.setEnd(t.lastChild,t.lastChild.textContent.length);const n=e.defaultView?.getSelection();n?.removeAllRanges(),n?.addRange(i)}function yv(){const t=Hn("navigator");if("scheduling"in t){const e=t.scheduling;if("isInputPending"in e)return e.isInputPending({includeContinuous:!0})}return!1}function Nl(t){return`ag-charts-icon ag-charts-icon-${t}`}function jw(t){let{x:e,y:i,width:n,height:s}=t;return(n==null||n>0)&&(s==null||s>0)?t:(e!=null&&n!=null&&n<0&&(n=-n,e=e-n),i!=null&&s!=null&&s<0&&(s=-s,i=i-s),{x:e,y:i,width:n,height:s})}function Oh(t,e,i){i==null?t.removeProperty(e):t.setProperty(e,`${i}px`)}function Kn(t){return t!=null}function ce(t){return Array.isArray(t)}function bv(t){return typeof t=="boolean"}function rn(t){return t instanceof Date}function Ol(t){return rn(t)&&!Number.isNaN(Number(t))}function vv(t){return t instanceof RegExp}function an(t){return typeof t=="function"}function he(t){return typeof t=="object"&&t!==null&&!ce(t)}function El(t){return ce(t)||ke(t)}function ke(t){return typeof t=="object"&&t!==null&&t.constructor?.name==="Object"}function Rl(t){if(typeof t!="object"||t===null)return!1;for(const e in t)return!1;return!0}function ot(t){return typeof t=="string"}function Li(t){return typeof t=="number"}function Ee(t){return Number.isFinite(t)}function Rg(t){return t!=null&&t.nodeType===1&&"style"in t}function Hw(t,e){return ot(e)&&Object.keys(t).includes(e)}function $w(t,e){return Object.values(t).includes(e)}function Pl(t){return typeof t=="symbol"}function xv(t){return ot(t)&&(t==="none"||fv(t)!=null)}function Fl(t,e){return t in e}function Pg({fontSize:t,fontStyle:e,fontWeight:i,fontFamily:n}){let s="";return e&&e!=="normal"&&(s+=`${e} `),i&&i!=="normal"&&i!==400&&(s+=`${i===700?"bold":i} `),s+=`${t}px`,s+=` ${n}`,s}function Fg(t,e=1.15){return Math.round(t*e)}function et(t){return String(t??"")}function Sv(t){return Li(t)||rn(t)?et(t):t}function Vg(t){return _g(t.replace(pv,""))+io}var Uw=new Set([1575,1577,1583,1584,1585,1586,1608]);function Ww(t){return t>=1568&&t<=1610&&!Uw.has(t)}function _g(t){if(!t)return t;const e=t.codePointAt(t.length-1);return Ww(e)?t+"\u200D":t}function Mv(t){return Tl+t+Tl}function Iv(t){return t.replaceAll(Tl,"")}function Dv(t){return ce(t)?Eh(t.at(-1)):Us(et(t))}function Us(t){return t.endsWith(io)}function Eh(t){return et(t?.text).endsWith(io)}var Cv=typeof Intl<"u"&&typeof Intl.Segmenter=="function"?new Intl.Segmenter(void 0,{granularity:"grapheme"}):void 0;function ys(t){return Cv?Array.from(Cv.segment(t),e=>e.segment):Array.from(t)}function Ws(t,e="and",i=String,n=1/0){if(t.length===0)return"";if(t.length===1)return i(t[0]);t=t.map(i);const s=t.pop();if(t.length>=n){const r=t.length-(n-1);return`${t.slice(0,n-1).join(", ")}, and ${r} more ${e} ${s}`}return`${t.join(", ")} ${e} ${s}`}function Vl(t,e=1/0){if(typeof t=="number"){if(Number.isNaN(t))return"NaN";if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity"}const i=JSON.stringify(t)??typeof t;return i.length>e?`${i.slice(0,e)}... (+${i.length-e} characters)`:i}function Av(t){let e=1;for(let i=0;i<t.length;i++)t.codePointAt(i)===10&&e++;return e}function wv(t,e){if(t===e)return 0;const[i,n]=t.length<e.length?[t,e]:[e,t],s=i.length,r=n.length;let a=new Array(s+1).fill(0).map((l,c)=>c),o=new Array(s+1);for(let l=1;l<=r;l++){o[0]=l;for(let c=1;c<=s;c++){const h=n[l-1]===i[c-1]?0:1;o[c]=Math.min(a[c]+1,o[c-1]+1,a[c-1]+h)}[a,o]=[o,a]}return a[s]}function kv(t){return t.replaceAll(Kw,(e,i)=>(i>0?"-":"")+e.toLowerCase())}var Kw=/[A-Z]+(?![a-z])|[A-Z]/g;function Ue(t,e=""){return t==null?e:ce(t)?t.map(i=>et(i.text)).join(""):ot(t)?t:String(t)}function Yw(t,e=0,i){const{leading:n=!1,trailing:s=!0,maxWait:r=1/0}=i??{};let a,o;if(r<e)throw new Error("Value of maxWait cannot be lower than waitMs.");function l(...c){if(n&&!o){o=Date.now(),a=setTimeout(()=>o=null,e),t(...c);return}let h=e;if(r!==1/0&&o){const u=Date.now()-o;e>r-u&&(h=r-u)}clearTimeout(a),o??(o=Date.now()),a=setTimeout(()=>{o=null,s&&t(...c)},h)}return Object.assign(l,{cancel(){clearTimeout(a),o=null}})}function Bg(t,e,i){const{leading:n=!0,trailing:s=!0}=i??{};let r,a,o=!1;function l(){s&&a?(r=setTimeout(l,e),t(...a)):o=!1,a=null}function c(...h){o?a=h:(o=!0,r=setTimeout(l,e),n?t(...h):a=h)}return Object.assign(c,{cancel(){clearTimeout(r),o=!1,a=null}})}function zg(t,e,i=""){try{return t(...e)}catch(n){const s=i?` \`${i}\``:"";vi(`Uncaught exception in user callback${s}`,n)}}var li=Symbol("description"),Gg=Symbol("required"),Rh=Symbol("marked"),Ph=Symbol("undocumented"),Tv=Symbol("enterprise"),Zw=Symbol("deprecated"),_l=Symbol("union"),Xw=[["placement","position"],["padding","spacing","gap"],["color","fill","stroke"],["whisker","wick"],["src","url"],["width","thickness"],["show","visible","enabled"]].reduce((t,e)=>{for(const i of e)t.set(i.toLowerCase(),new Set(e.filter(n=>n!==i)));return t},new Map),Lv=(t=>(t.Enterprise="enterprise",t.Invalid="invalid",t.Required="required",t.Unknown="unknown",t))(Lv||{});function Bl(t,e){return Ee(e)?`${t}[${e}]`:t?`${t}.${e}`:e}var bs=class{constructor(t,e,i,n,s){this.type=t,this.description=e,this.value=i,this.path=n,this.key=s}setUnionType(t,e){if(this.path.startsWith(e)){const i=this.path.slice(e.length);this.altPath=`${e}[type=${t}]${i}`}}getPrefix(){const{altPath:t=this.path,key:e}=this;return!t&&!e?"Value":`Option \`${e?Bl(t,e):t}\``}toString(){const{description:t="unknown",type:e,value:i}=this;return e==="required"&&i==null?`${this.getPrefix()} is required and has not been provided; expecting ${t}, ignoring.`:e==="enterprise"?`${this.getPrefix()} is an AG Charts Enterprise feature; ignoring.`:`${this.getPrefix()} cannot be set to \`${Vl(i,50)}\`; expecting ${t}, ignoring.`}},Fh=class extends bs{constructor(t,e,i,n){super("unknown",void 0,e,i,n),this.suggestions=t,this.key=n}getPrefix(){return`Unknown option \`${Bl(this.altPath??this.path,this.key)}\``}getPostfix(){const t=Ws(qw(this.key,this.suggestions),"or",e=>`\`${e}\``);return t?`; Did you mean ${t}? Ignoring.`:", ignoring."}toString(){return`${this.getPrefix()}${this.getPostfix()}`}};function zt(t,e,i="",n={}){if(!he(t))return{cleared:null,invalid:[new bs("required","an object",t,i)]};const s={},r=[],a=new Set(Object.keys(t)),o=[];if(_l in e){const l=Object.keys(e),c=e[_l];if(t.type!=null&&l.includes(t.type)||t.type==null&&c!=null){const{type:h=c,...u}=t,d=zt(u,e[h],i,n);Object.assign(s,{type:h},d.cleared);for(const g of d.invalid)g.setUnionType(h,i);r.push(...d.invalid)}else{const h=Ws(l,"or",u=>`'${u}'`);r.push(new bs("required",`a keyword such as ${h}`,t.type,i,"type"))}return{cleared:s,invalid:r}}for(const l of Object.keys(e)){const c=e[l],h=c[Gg],u=t[l];if(a.delete(l),u===void 0&&(c[Ph]||o.push(l),!h))continue;const d=Bl(i,l);if(an(c)){const g={options:t,path:d,silentAdvisories:n.silentAdvisories},p=c(u,g);if(typeof p=="object"){if(r.push(...p.invalid),p.valid){s[l]=p.cleared;continue}else if(jr(p.invalid,d))continue}else if(p){s[l]=u;continue}r.push(new bs(h?"required":"invalid",c[li],u,i,l))}else{const g=zt(u,c,d,n);g.cleared!=null&&(s[l]=g.cleared),r.push(...g.invalid)}}for(const l of a){const c=t[l];c!==void 0&&r.push(new Fh(o,c,i,l))}return{cleared:s,invalid:r}}function qw(t,e,i=2){const n=t.toLowerCase(),s=Xw.get(n);return e.filter(r=>{const a=r.toLowerCase();return s?.has(r)===!0||a.includes(n)||wv(n,a)<=i})}function ye(t,e){if(an(t)){let n=function(s,r){return t(s,r)};var i=n;return n[li]=e,n}else return{...t,[li]:e}}function X(t){if(t[Tv])throw new Error("`required()` cannot wrap an `enterprise()` validator; enterprise options must remain optional.");return Object.assign(an(t)?(e,i)=>t(e,i):ze(t),{[Gg]:!0,[li]:t[li]})}function J(t){return Object.assign(an(t)?(e,i)=>t(e,i):ze(t),{[Ph]:!0,[li]:t[li]})}function In(t){if(t[Gg])throw new Error("`enterprise()` cannot wrap a `required()` validator; enterprise options must remain optional.");const e=an(t)?t:ze(t),i=t[li];return Object.assign((s,r)=>s!==void 0&&!iv()?(vi(new bs("enterprise",i,s,r.path).toString()),{valid:!0,cleared:null,invalid:[]}):e(s,r),{[Tv]:!0,[li]:i})}function zl(t,e){const i=an(t)?t:ze(t),n=t[li];return Object.assign((r,a)=>(r!==void 0&&!a.silentAdvisories&&vi(`Option \`${a.path}\` is deprecated. ${e}`),i(r,a)),{[Zw]:e,[li]:n})}var ze=(t,e="an object",i=!1)=>ye((n,s)=>{const r=zt(n,t,s.path,{silentAdvisories:s.silentAdvisories}),a=!jr(r.invalid,s.path);return{valid:a,cleared:a||!i?r.cleared:null,invalid:r.invalid}},e),Gl=(t,e,i)=>({...t,[li]:e,[_l]:i}),Ie=(...t)=>ye((e,i)=>{const n=[];for(const s of t){const r=s(e,i);if(typeof r=="object"){if(n.push(...r.invalid),!r.valid)return{valid:!1,cleared:e,invalid:n};e=r.cleared}else if(!r)return!1}return{valid:!0,cleared:e,invalid:n}},Ws(t.filter(e=>!e[Ph]).map(e=>e[li]).filter(Kn),"and")),se=(...t)=>ye((e,i)=>{for(const n of t){const s=n(e,i);if(typeof s=="object"?s.valid:s)return s}return!1},Ws(t.filter(e=>!e[Ph]).map(e=>e[li]).filter(Kn),"or")),so=t=>Ee(t)||Ol(t),Jw=t=>rn(t)||(Ee(t)||ot(t))&&Ol(new Date(t)),Yn=ye(ce,"an array"),T=ye(bv,"a boolean"),Re=ye(an,"a function"),H=ye(xv,"a color string"),Gt=ye(Jw,"a date"),le=ye(Kn,"a defined value"),P=ye(Ee,"a number"),Ks=ye(he,"an object"),N=ye(ot,"a string"),jg=ye(Rg,"an html element"),Ys=(t,e=1/0)=>{let i;return e===1/0?i=`an array of at least ${t} items`:t===e?i=`an array of exactly ${t} items`:t===0?i=`an array of no more than ${e} items`:i=`an array of at least ${t} and no more than ${e} items`,ye(n=>ce(n)&&n.length>=t&&n.length<=e,i)},Hg=(t,e=1/0)=>{let i;return e===1/0?i=`a string of at least ${t} characters`:t===e?i=`an string of exactly ${t} characters`:t===0?i=`an string of no more than ${e} characters`:i=`an string of at least ${t} and no more than ${e} characters`,ye(n=>ot(n)&&n.length>=t&&n.length<=e,i)},$g=(t,e=!0)=>ye(i=>Ee(i)&&(i>t||e&&i===t),`a number greater than ${e?"or equal to ":""}${t}`),Nv=(t,e)=>ye(i=>Ee(i)&&i>=t&&i<=e,`a number between ${t} and ${e} inclusive`),k=$g(0),Zn=$g(0,!1),q=Nv(0,1),xi=t=>ye((e,{options:i})=>!so(e)||!so(i[t])||e<i[t],`the value to be less than \`${t}\``),Ov=t=>ye((e,{options:i})=>!so(e)||!so(i[t])||e<=i[t],`the value to be less than or equal to \`${t}\``),Si=t=>ye((e,{options:i})=>!so(e)||!so(i[t])||e>i[t],`the value to be greater than \`${t}\``);function V(...t){he(t[0])&&(t=Object.values(t[0]));const e=Ws(t,"or",i=>`'${i}'`);return ye(i=>t.includes(i),`a keyword such as ${e}`)}function Vh(){return V}var Ge=t=>ye(e=>t===e,`the value ${JSON.stringify(t)}`),Qw=(t,e)=>ye(i=>i instanceof t,e??`an instance of ${t.name}`),Q=(t,e,i=!0)=>ye((n,s)=>{if(!ce(n))return!1;let r=i;const a=[],o=[],l=c=>{r=i?r&&c:r||c};if(n.length===0)return{valid:!0,cleared:a,invalid:o};for(let c=0;c<n.length;c++){const h=n[c],u=t(h,{options:h,path:`${s.path}[${c}]`});typeof u=="object"?(l(u.valid),o.push(...u.invalid),u.cleared!=null&&a.push(u.cleared)):(l(u),u&&a.push(h))}return{valid:r,cleared:r||!i?a:null,invalid:o}},e??`${t[li]} array`),Pt=(t,e="an object array")=>ye((i,n)=>{if(!ce(i))return!1;const s=[],r=[];for(let a=0;a<i.length;a++){const o=`${n.path}[${a}]`,l=zt(i[a],t,o);jr(l.invalid,o)||s.push(l.cleared),r.push(...l.invalid)}return{valid:!0,cleared:s,invalid:r}},e),ci=(t,e)=>ye((i,n)=>{if(!an(i))return!1;if(Rh in i)return!0;const s=e??t[li];return{valid:!0,cleared:Object.assign((...a)=>{const o=zg(i,a);if(o==null)return;const l=t(o,{options:o,path:""});if(typeof l=="object"){if(Ev(l,n,s,o),l.valid)return l.cleared}else{if(l)return o;vi(`Callback \`${n.path}\` returned an invalid value \`${Vl(o,50)}\`; expecting ${s}, ignoring.`)}},{[Rh]:!0}),invalid:[]}},"a function"),De=(t,e="an object")=>ye((i,n)=>{if(!an(i))return!1;if(Rh in i)return!0;const s=e;return{valid:!0,cleared:Object.assign((...a)=>{const o=zg(i,a,n.path);if(o==null)return;const l=zt(o,t);return Ev(l,n,s,o),l.cleared},{[Rh]:!0}),invalid:[]}},"a function");function jr(t,e){return t.some(i=>i.type==="required"&&i.path===e)}function Ev(t,e,i,n){if(t.invalid.length!==0){if(ce(n)){const s=i??t.invalid[0]?.description??"a valid value";return vi(`Callback \`${e.path}\` returned an invalid value \`${Vl(n,50)}\`; expecting ${s}, ignoring.`)}for(const s of t.invalid){if(s instanceof Fh)return vi(`Callback \`${e.path}\` returned an unknown property \`${Bl(s.path,s.key)}\`${s.getPostfix()}`);const r=Vl(s.value,50);vi(s.key?`Callback \`${e.path}\` returned an invalid property \`${Bl(s.path,s.key)}\`: \`${r}\`; expecting ${s.description}, ignoring.`:`Callback \`${e.path}\` returned an invalid value \`${r}\`; expecting ${i??s.description}, ignoring.`)}}}var Rv=/^(?:(.)?([<>=^]))?([+\-( ])?([$€£¥₣₹#])?(0)?(\d+)?(,)?(?:\.(\d+))?(~)?([%a-z])?$/i,Pv=/^((?:[^#]|#[^{])*)#{([^}]+)}(.*)$/;function Fv(t){if(!ot(t))return!1;const e=Pv.exec(t);return Rv.test(e?e[2]:t)}function _h(t){let e,i;const n=Pv.exec(t);n&&([,e,t,i]=n);const s=Rv.exec(t);if(!s){vi(`The number formatter is invalid: ${t}`);return}const[,r,a,o,l,c,h,u,d,g,p]=s;return{fill:r,align:a,sign:o,symbol:l,zero:c,width:Number.parseInt(h),comma:u,precision:Number.parseInt(d),trim:!!g,type:p,prefix:e,suffix:i}}function Ug(t){const e=typeof t=="string"?_h(t):t;if(e==null)return;const{fill:i,align:n,sign:s="-",symbol:r,zero:a,width:o,comma:l,type:c,prefix:h="",suffix:u="",precision:d}=e;let{trim:g}=e;const p=d==null||Number.isNaN(d);let f;if(!c)f=on.g,g=!0;else if(c in on&&c in ro)f=p?ro[c]:on[c];else if(c in on)f=on[c];else if(c in ro)f=ro[c];else throw new Error(`The number formatter type is invalid: ${c}`);const m=c?6:12;let y;p||(y=d);let b=n,v=i;return a&&(v??(v="0"),b??(b="=")),(S,M)=>{let C;y!=null?C=y:c==="f"||c==="%"?C=M??m:c?C=m:C=M??m;let D=f(S,C);g&&(D=ik(D)),l&&(D=nk(D,l));const A=ok(r,c),w=A?.length??0;A&&(D=`${A}${D}`),c==="s"&&(D=`${D}${sk(S)}`),(c==="%"||c==="p")&&(D=`${D}%`);const{value:L,prefixLength:O}=rk(S,D,s),R=O+w;let _=L;return o!=null&&!Number.isNaN(o)&&(_=ak(_,o,v??" ",b,R)),_=`${h}${_}${u}`,_}}var ro={b:t=>Bh(t).toString(2),c:t=>String.fromCodePoint(t),d:t=>Math.round(Math.abs(t)).toFixed(0),o:t=>Bh(t).toString(8),x:t=>Bh(t).toString(16),X:t=>ro.x(t).toUpperCase(),n:t=>ro.d(t),"%":t=>`${Bh(t*100).toFixed(0)}`},on={e:(t,e)=>Math.abs(t).toExponential(e),E:(t,e)=>on.e(t,e).toUpperCase(),f:(t,e)=>Math.abs(t).toFixed(e),F:(t,e)=>on.f(t,e).toUpperCase(),g:(t,e)=>{if(t===0)return"0";const i=Math.abs(t),n=Math.floor(Math.log10(i));return n>=-4&&n<e?i.toFixed(e-1-n):i.toExponential(e-1)},G:(t,e)=>on.g(t,e).toUpperCase(),n:(t,e)=>on.g(t,e),p:(t,e)=>on.r(t*100,e),r:(t,e)=>{if(t===0)return"0";const i=Math.abs(t),s=Math.floor(Math.log10(i))-(e-1);if(s<=0)return i.toFixed(-s);const r=10**s;return(Math.round(i/r)*r).toFixed()},s:(t,e)=>{const i=Bv(t);return on.r(t/10**i,e)},"%":(t,e)=>on.f(t*100,e)},Vv=-24,_v=24,ek={[Vv]:"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",[_v]:"Y"},tk="\u2212";function Bh(t){return Math.floor(Math.abs(t))}function ik(t){if(!t.endsWith("0")||!t.includes("."))return t;let e=t.length-1;for(;e>0;)if(t[e]=="0")e-=1;else if(t[e]=="."){e-=1;break}else break;return t.substring(0,e+1)}function nk(t,e){let i=t.indexOf(".");i<0&&(i=t.length);const n=t.substring(0,i).split(""),s=t.substring(i);for(let r=n.length-3;r>0;r-=3)n.splice(r,0,e);return`${n.join("")}${s}`}function sk(t){return ek[Bv(t)]}function Bv(t){return te(Vv,t?Math.floor(Math.log10(Math.abs(t))/3)*3:0,_v)}function rk(t,e,i=""){if(i==="(")return t>=0?{value:e,prefixLength:0}:{value:`(${e})`,prefixLength:1};let n="";return t<0?n=tk:i==="+"?n="+":i===" "&&(n=" "),{value:`${n}${e}`,prefixLength:n.length}}function ak(t,e,i=" ",n=">",s=0){const r=e-t.length;if(r<=0)return t;const a=i.repeat(r);if(n==="="){const o=Math.min(Math.max(s,0),t.length),l=t.slice(0,o),c=t.slice(o);return`${l}${a}${c}`}if(n===">"||!n)return a+t;if(n==="<")return`${t}${a}`;if(n==="^"){const o=Math.ceil(r/2),l=Math.floor(r/2);return`${i.repeat(o)}${t}${i.repeat(l)}`}return a+t}function ok(t,e){if(t==="#")switch(e){case"b":return"0b";case"o":return"0o";case"x":return"0x";case"X":return"0X";default:return""}return t??""}var jl=t=>{if(!he(t))return!1;const e=Object.keys(t);return e.length===1&&e[0].startsWith("$")},lk=ze({color:H,stop:q},""),zh=ye(t=>{let e=-1/0;for(const i of t)if(i?.stop!=null){if(i.stop<e)return!1;e=i.stop}return!0},"colour stops to be defined in ascending order"),Gh=Ie(Ys(2),Q(lk),zh),ck=ze({color:X(H),stop:P,name:N},"a color scale color stop"),Zs=ze({fills:Ie(Ys(2),Q(ck),zh),domain:Ie(Ys(2),Q(P),ye(t=>t[0]<=t[1],"domain to be in ascending order")),mode:V("continuous","discrete"),missingDataFill:H},"a colour scale configuration"),Wg=V("axis","item","series"),hk={type:X(Ge("gradient")),colorStops:X(Gh),rotation:P,gradient:J(V("linear","radial","conic")),bounds:J(Wg),reverse:J(T),colorSpace:J(V("rgb","oklch"))},jh=ze(hk,"a gradient object with colour stops"),B={stroke:H,strokeWidth:k,strokeOpacity:q},zv=ze({type:X(Ge("gradient")),gradient:X(V("linear","radial","conic")),bounds:X(Wg),colorStops:X(se(Gh,Ie(Ys(2),Q(H)))),rotation:X(P),reverse:X(T),colorSpace:X(V("rgb","oklch"))}),Gv=ze({type:X(Ge("pattern")),pattern:X(V("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses")),path:Hg(2),width:X(k),height:X(k),fill:X(H),fillOpacity:X(q),backgroundFill:X(H),backgroundFillOpacity:X(q),padding:X(k),rotation:X(P),scale:X(k),stroke:X(H),strokeWidth:X(k),strokeOpacity:X(q)}),jv=ze({type:X(Ge("image")),url:N,width:k,height:k,rotation:X(P),backgroundFill:X(H),backgroundFillOpacity:q,fit:X(V("stretch","contain","cover")),repeat:X(V("repeat","repeat-x","repeat-y","no-repeat"))}),uk={gradient:{colorStops:Gh,rotation:P,gradient:J(V("linear","radial","conic")),bounds:J(Wg),reverse:J(T),colorSpace:J(V("rgb","oklch"))},pattern:{pattern:V("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses"),path:Hg(2),width:k,height:k,rotation:P,scale:k,fill:H,fillOpacity:q,backgroundFill:H,backgroundFillOpacity:q,...B,padding:J(k)},image:{url:X(N),backgroundFill:H,backgroundFillOpacity:q,width:k,height:k,fit:V("stretch","contain","cover","none"),repeat:V("repeat","repeat-x","repeat-y","no-repeat"),rotation:P}},dk=Gl(uk,"a color object"),Ni=se(H,ze(dk,"a color object")),$={fill:Ni,fillOpacity:q};$.fillGradientDefaults=J(zv),$.fillPatternDefaults=J(Gv),$.fillImageDefaults=J(jv);var Wi={fill:H,fillOpacity:q},W={lineDash:Q(k),lineDashOffset:P},Dn={...$,...B,...W,opacity:q,cornerRadius:k},Xs={...B,...W,opacity:q},je={...$,...B,...W,opacity:q},Hv=je,$v=Vh()("any","all");function Kg(t){return{enabled:T,range:V("tooltip","node"),highlightedItem:t,unhighlightedItem:t}}function Yg(t){return{enabled:T,containment:$v,selectedItem:t,unselectedItem:t,unselectedSeries:t}}function lt(t,e){return{enabled:T,range:V("tooltip","node"),highlightedItem:t,unhighlightedItem:t,highlightedSeries:e,unhighlightedSeries:e,bringToFront:T}}var Uv={start:le,stop:le,...B,...$,...W},Wv={start:le,stop:le,...B,...W},ao=ze({enabled:T,key:X(V("x","y")),segments:Pt(Uv,"path segments array")},"a segmentation object",!0),Kv=ze({enabled:T,key:X(V("x","y")),segments:Pt(Wv,"path segments array")},"a segmentation object",!0),Zg=ze({googleFont:N},"google font"),Hh=se(N,jl,Zg,Q(se(N,Zg))),Hl=se(k,V("normal","bold","bolder","lighter")),Ce={color:H,fontFamily:Hh,fontSize:k,fontStyle:V("normal","italic","oblique"),fontWeight:Hl},Hr=V("never","always","hyphenate","on-space"),gk=V("left","center","right"),$h=V("ellipsis","hide"),Yv=ze({top:P,right:P,bottom:P,left:P},"padding object"),Xn=se(P,Yv),$r={enabled:T,stroke:H,strokeWidth:k,strokeOpacity:q},ln={border:$r,cornerRadius:P,padding:Xn,...$},Xg=["top","top-right","top-left","bottom","bottom-right","bottom-left","right","right-top","right-bottom","left","left-top","left-bottom"],pk={floating:T,placement:V(...Xg),xOffset:P,yOffset:P},Uh=ye((t,e)=>{let i;if(typeof t=="string")Xg.includes(t)?i=!0:(i={valid:!1,invalid:[],cleared:null},i.invalid.push(new bs("invalid",`a legend placement string: ["${Xg.join('", "')}"]`,t,e.path)));else{const{cleared:n,invalid:s}=zt(t,pk);i={valid:s.length===0,cleared:n,invalid:s}}return i},"a legend position object or placement string"),qs=se(V("circle","cross","diamond","heart","plus","pin","square","star","triangle"),Re),Wh=V("top","right","bottom","left","top-right","bottom-right","bottom-left","top-left","center"),Kh=se(k,V("exact","nearest","area")),Zv=se(k,V("exact","nearest")),cn=se(N,P,Gt,Pt({text:X(N),...Ce},"text segments array")),$l={enabled:T,text:cn,textAlign:V("left","center","right"),wrapping:Hr,spacing:k,maxWidth:k,maxHeight:k,...Ce,tooltip:{visible:V("auto","always","never"),text:N,renderer:ci(se(N,P,Gt))}};$l.padding=J(k),$l.truncate=J(T);var Yh={enabled:T,text:cn,renderer:ci(se(N,P,Gt,jg))},qg=["defaults","download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series","separator"],Xv={type:V("action","separator"),showOn:V("always","series-area","series-node","legend-item"),label:X(N),enabled:T,action:Re,items:(t,e)=>qv(t,e)};Xv.iconUrl=J(N);var fk=ze(Xv),mk=ye((t,e)=>{let i;return typeof t=="string"?qg.includes(t)?i=!0:(i={valid:!1,invalid:[],cleared:null},i.invalid.push(new bs("invalid",`a context menu item string alias: ["${qg.join('", "')}"]`,t,e.path))):i=fk(t,e),i},`a context menu item object or string alias: [${qg.join(", ")}]`),qv=Q(mk,"a menu items array",!1),oo={label:N,ariaLabel:N,tooltip:N,iconPosition:V("before","after"),icon:V("align-center","align-left","align-right","arrow-drawing","arrow-down-drawing","arrow-up-drawing","callout-annotation","candlestick-series","chevron-filled-down","chevron-right","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")},Cn=se(N,ci(cn)),Jv=ze({x:Cn,y:Cn,angle:Cn,radius:Cn,size:Cn,color:Cn,label:Cn,secondaryLabel:Cn,sectorLabel:Cn,calloutLabel:Cn,legendItem:Cn}),An=ye(Fv,"a valid number format string"),lo=V("millisecond","second","minute","hour","day","month","year"),Qv={unit:X(lo),step:Zn,epoch:Gt,utc:T};Qv.every=Re;var Ul=ze(Qv,"a time interval object"),re={width:k,height:k,minWidth:k,minHeight:k,suppressFieldDotNotation:T,title:$l,subtitle:$l,footnote:$l,padding:{top:k,right:k,bottom:k,left:k},seriesArea:{border:$r,clip:T,cornerRadius:P,padding:Xn},legend:{enabled:T,position:Uh,orientation:V("horizontal","vertical"),maxWidth:k,maxHeight:k,spacing:k,border:$r,cornerRadius:P,padding:Xn,fill:Ni,fillOpacity:q,preventHidingAll:T,reverseOrder:T,toggleSeries:T,item:{marker:{size:k,shape:qs,padding:k,strokeWidth:k},line:{length:k,strokeWidth:k},label:{maxLength:k,formatter:Re,...Ce},tooltip:{visible:V("auto","always","never"),text:N,renderer:Re},maxWidth:k,paddingX:k,paddingY:k,showSeriesStroke:T},pagination:{marker:{size:k,shape:qs,padding:k},activeStyle:{...$,...B},inactiveStyle:{...$,...B},highlightStyle:{...$,...B},label:Ce},listeners:{legendItemClick:Re,legendItemDoubleClick:Re}},gradientLegend:{enabled:T,position:Uh,spacing:k,reverseOrder:T,border:$r,cornerRadius:P,padding:Xn,fill:Ni,fillOpacity:q,gradient:{preferredLength:k,thickness:k},scale:{label:{...Ce,minSpacing:k,format:An,formatter:Re},padding:k,interval:{step:P,values:Yn,minSpacing:Ie(k,xi("maxSpacing")),maxSpacing:Ie(k,Si("minSpacing"))}}},listeners:{seriesNodeClick:Re,seriesNodeDoubleClick:Re,seriesVisibilityChange:Re,activeChange:Re,selectionChange:Re,click:Re,doubleClick:Re,annotations:Re,zoom:Re},loadGoogleFonts:T,highlight:{drawingMode:V("overlay","cutout"),range:V("tooltip","node")},overlays:{loading:Yh,noData:Yh,noVisibleSeries:Yh,unsupportedBrowser:Yh},tooltip:{enabled:T,showArrow:T,pagination:T,delay:k,range:Kh,wrapping:Hr,mode:V("single","shared","compact"),position:{anchorTo:V("pointer","node","chart"),placement:se(Wh,Q(Wh)),xOffset:P,yOffset:P,offset:k}},animation:le,flashOnUpdate:le,contextMenu:le,context:()=>!0,dataSource:{getData:Re},keyboard:{enabled:T,tabIndex:P,initialFocus:Vh()("data-start","data-end","viewport-start","viewport-end")},touch:{dragAction:V("none","drag","hover")},selection:le,ranges:{enabled:T,enableOutOfRange:T,position:V("top-left","top","top-right","bottom-left","bottom","bottom-right"),spacing:k,button:{...Wi,...B,textColor:H,...Ce,cornerRadius:k,padding:Xn,active:{...Wi,stroke:B.stroke,textColor:H},disabled:{...Wi,stroke:B.stroke,textColor:H},hover:{...Wi,stroke:B.stroke,textColor:H}},dropdown:{visible:V("auto","always","never"),...Wi,...B,textColor:H,...Ce,cornerRadius:k,padding:Xn,active:{...Wi,stroke:B.stroke,textColor:H},disabled:{...Wi,stroke:B.stroke,textColor:H},hover:{...Wi,stroke:B.stroke,textColor:H}},gap:k,...Wi,...B,textColor:H,...Ce,cornerRadius:k,padding:Xn,active:{...Wi,stroke:B.stroke,textColor:H},disabled:{...Wi,stroke:B.stroke,textColor:H},hover:{...Wi,stroke:B.stroke,textColor:H},buttons:Pt({...oo,enabled:T,value:se(P,Ie(Q(se(P,Gt)),Ys(2,2)),Ul,lo,Re)},"range button options array")},locale:{localeText:Ks,getLocaleText:ci(N)},background:{visible:T,fill:H,image:{url:X(N),top:P,right:P,bottom:P,left:P,width:k,height:k,opacity:q}},styleNonce:N,sync:le,zoom:le,scrollbar:le,formatter:se(ci(cn),Jv),enableRtl:T};re.highlight.enabled=J(T),re.dataSource.requestThrottle=J(k),re.dataSource.updateThrottle=J(k),re.dataSource.updateDuringInteraction=J(T),re.statusBar=J(le),re.ranges.minSize=J(k),re.foreground=J({visible:T,text:N,image:{url:N,top:P,right:P,bottom:P,left:P,width:k,height:k,opacity:q},...$}),re.overrideDevicePixelRatio=J(P),re.sync.domainMode=J(V("direction","position","key")),re.displayNullData=J(T);var Se={cursor:N,context:()=>!0,showInLegend:T,nodeClickRange:Kh,listeners:{seriesNodeClick:Re,seriesNodeDoubleClick:Re},highlight:Kg(je),selection:Yg(Hv)};Se.allowNullKeys=J(T);var wn={...Se,id:N,visible:T,context:()=>!0,data:Yn};wn.seriesGrouping=J(le);var Js={shape:qs,size:k,...$,...B,...W},kn={enabled:T,itemStyler:De({...$,...B,...W,shape:qs,size:k}),...Js},Fe={enabled:T,formatter:ci(cn),format:An,itemStyler:De({enabled:T,...ln,...Ce}),...ln,...Ce},Qs={...Fe,lineHeight:k,minimumFontSize:k,wrapping:Hr,overflowStrategy:$h},Wl={visible:T,cap:{visible:T,length:k,lengthRatio:q,...B,...W},...B,...W},Zh={...Wl,xLowerKey:N,xUpperKey:N,yLowerKey:N,yUpperKey:N,xLowerName:N,xUpperName:N,yLowerName:N,yUpperName:N,itemStyler:De({visible:T,...B,...W,cap:{visible:T,length:k,lengthRatio:q,...B,...W}})},Ae={enabled:T,showArrow:T,range:Zv,renderer:ci(se(N,P,Gt,ze({heading:N,title:N,symbol:{marker:{enabled:T,shape:qs,...$,stroke:H,strokeOpacity:q,strokeWidth:k,...W},line:{enabled:T,stroke:H,strokeWidth:k,strokeOpacity:q,...W}},data:Pt({label:X(N),value:X(se(N,P,Gt))})},"tooltip renderer result object"))),position:{anchorTo:V("node","pointer","chart"),placement:se(Wh,Q(Wh)),xOffset:P,yOffset:P,offset:k},interaction:{enabled:T}},ex={...Ae,range:Kh},qn={enabled:T,xOffset:P,yOffset:P,blur:k,color:H},Xh=Gl({linear:{},smooth:{tension:q},step:{position:V("start","middle","end")}},"interpolation line options"),qh=Symbol("BREAK"),Kl="__decorator_config",Jh="__decorator_accessors";function I(t,e){Jg(t,e).optional=!0}function Jg(t,e){if(Object.getOwnPropertyDescriptor(t,Kl)==null&&Object.defineProperty(t,Kl,{value:{}}),Object.getOwnPropertyDescriptor(t,Jh)==null){const u=Object.getPrototypeOf(t)?.[Jh]?.slice()??[];Object.defineProperty(t,Jh,{value:u})}const i=t[Kl],n=e.toString();if(i[n]!=null)return i[n];i[n]={setters:[],getters:[],observers:[]};const s=Object.getOwnPropertyDescriptor(t,e);let r=s?.get,a=s?.set;if(r==null||a==null){const h=t[Jh];let u=h.indexOf(e);u===-1&&(u=h.push(e)-1),r??(r=function(){let d=this.__accessors;return d==null&&(d=h.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:d})),d[u]}),a??(a=function(d){let g=this.__accessors;g==null&&(g=h.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:g})),g[u]=d})}const o=i[n];return Object.defineProperty(t,e,{set:function(h){const u=o.setters,d=o.observers;let g;for(let p=0,f=u.length;p<f;p++)if(u[p].length>2){g=r.call(this);break}for(let p=0,f=u.length;p<f;p++)if(h=u[p](this,e,h,g),h===qh)return;a.call(this,h);for(let p=0,f=d.length;p<f;p++)d[p](this,h,g)},get:function(){const h=r.call(this),u=o.getters;if(u.length===0)return h;let d=h;for(let g=0,p=u.length;g<p;g++)if(d=u[g](this,e,d),d===qh)return;return d},enumerable:!0,configurable:!1}),i[n]}function er(t,e,i){return(n,s)=>{const r=Jg(n,s);r.setters.push(t),e&&r.getters.unshift(e),i&&Object.assign(r,i)}}function Qg(t){return(e,i)=>{Jg(e,i).observers.push(t)}}function Qh(t){return t!==void 0&&Kl in t}function tr(t){const e=new Set;for(;Qh(t);)e.add(t?.[Kl]),t=Object.getPrototypeOf(t);return Array.from(e).flatMap(i=>Object.keys(i))}function tx(t){return tr(t).reduce((e,i)=>(e[String(i)]=t[i]??null,e),{})}function*Ur(...t){for(const e of t)e!=null&&(e[Symbol.iterator]?yield*e:yield e)}function ix(t){return t!=null&&typeof t=="object"&&Symbol.iterator in t?t:[t]}function Oi(t){for(const e of t)return e;throw new Error("AG Charts - no first() value found")}function*vt(t){const e=[void 0,void 0];for(const i of Object.keys(t))e[0]=i,e[1]=t[i],yield e}function ir(t){return Object.keys(t)}function st(t,e){return Array.isArray(t)?!Array.isArray(e)||t.length!==e.length?!1:t.every((i,n)=>st(i,e[n])):ke(t)?ke(e)?ep(t,e,st):!1:t===e}function ep(t,e,i){if(Object.is(t,e))return!0;for(const n of Object.keys(e))if(!(n in t))return!1;for(const n of Object.keys(t))if(!(n in e)||!i(t[n],e[n]))return!1;return!0}function ge(...t){const e={};for(const i of t){if(!he(i))continue;const n=Qh(i)?tr(i):Object.keys(i);for(const s of n)ke(e[s])&&ke(i[s])?e[s]=ge(e[s],i[s]):e[s]??(e[s]=i[s])}return e}function Yl(...t){const e={};for(const i of t){if(!he(i))continue;const n=Qh(i)?tr(i):Object.keys(i);for(const s of n)ke(e[s])&&ke(i[s])?e[s]=Yl(e[s],i[s]):s in e||(e[s]??(e[s]=i[s]))}return e}function yk(t,...e){return e&&ce(t)?t.map(i=>ge(i,...e)):t}function tp(t,e){const i={};for(const[n,s]of vt(t))i[n]=e(s,n,t);return i}function Y(t,e){const i={...t};for(const n of e)delete i[n];return i}function eu(t,e){if(t==null)return;const i={};for(const n of e)Object.hasOwn(t,n)&&(i[n]=t[n]);return i}function nx(t,e){if(t==null)return!0;for(const[i,n]of vt(t))if(!e(i,n))return!1;return!0}function sx(t){const e={};if(t==null)return e;for(const[i,n]of t)e[i]=n;return e}function ip(t,e){return(ce(e)?e:e.split(".")).reduce((n,s)=>n[s],t)}var np=new Set(["__proto__","constructor","prototype"]);function sp(t,e,i){const n=ce(e)?e.slice():e.split("."),s=n.pop();if(n.some(a=>np.has(a)))return;const r=n.reduce((a,o)=>a[o],t);return r[s]=i,r[s]}function rp(t,e,i){if(i===void 0)return e;for(const n of t){const s=i[n];s!==void 0&&(e[n]=s)}return e}function bk(t,e,i){const n=i??Object.keys(e);for(let s=0,r=n.length;s<r;s++){const a=n[s],o=e[a];t[a]!==o&&(t[a]=o)}return t}function hn(t){if(t==null||typeof t!="object"||!ke(t))return t;Object.freeze(t);for(const e of Object.getOwnPropertyNames(t)){const i=t[e];i!==null&&(typeof i=="object"||typeof i=="function")&&!Object.isFrozen(i)&&hn(i)}return t}function rx(t,e){return ke(t)&&e in t}function vk(t,e){return rx(t,e)&&typeof t[e]=="string"}var tu={fills:Ie(Ys(2),Q(ze({color:H,stop:P},"")),zh),fillMode:V("continuous","discrete")},iu={value:X(P),text:N,shape:se(V("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),Re),placement:V("before","after","middle"),spacing:k,size:k,rotation:P,...$,...B,...W},nu={value:X(P),text:N,shape:se(V("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),Re),placement:V("inside","outside","middle"),spacing:k,size:k,rotation:P,label:{...Fe,spacing:k},...$,...B,...W},su={...Y(Se,["listeners"]),direction:V("horizontal","vertical"),cornerMode:V("container","item"),cornerRadius:k,thickness:k,segmentation:{enabled:T,spacing:k,interval:{values:Q(P),step:P,count:P}},bar:{enabled:T,thickness:k,thicknessRatio:q,...tu,...$,...B,...W},label:{...Qs,text:N,spacing:k,avoidCollisions:T,placement:V("inside-start","outside-start","inside-end","outside-end","inside-center","bar-inside","bar-inside-end","bar-outside-end","bar-end")},tooltip:Ae},Wr={...Y(wn,["listeners"]),...su,type:X(Ge("linear-gauge")),value:X(P),scale:{min:Ie(P,xi("max")),max:Ie(P,Si("min")),label:{enabled:T,formatter:Re,rotation:P,spacing:k,minSpacing:k,placement:V("before","after"),avoidCollisions:T,format:An,...Ce},interval:{values:Q(P),step:P},...tu,...$,...B,...W},targets:Pt(iu,"target options array")};Wr.margin=J(P),Wr.defaultColorRange=J(Q(H)),Wr.defaultTarget=J({...iu,value:P,label:{...Fe,spacing:P}}),Wr.defaultScale=J(Wr.scale),Wr.scale.defaultFill=J(H);var ru={...Y(Se,["listeners"]),outerRadius:k,innerRadius:k,outerRadiusRatio:q,innerRadiusRatio:q,startAngle:P,endAngle:P,spacing:k,cornerMode:V("container","item"),cornerRadius:k,scale:{min:Ie(P,xi("max")),max:Ie(P,Si("min")),label:{enabled:T,formatter:Re,rotation:P,spacing:k,minSpacing:k,avoidCollisions:T,format:An,...Ce},interval:{values:Q(P),step:P},...tu,...$,...B,...W},segmentation:{enabled:T,spacing:k,interval:{values:Q(P),step:P,count:P}},bar:{enabled:T,...tu,...$,...B,...W},needle:{enabled:T,spacing:k,radiusRatio:q,...$,...B,...W},label:{text:N,spacing:k,...Qs},secondaryLabel:{text:N,...Qs},tooltip:Ae},au={...Y(wn,["listeners"]),...ru,type:X(Ge("radial-gauge")),value:X(P),targets:Pt(nu,"target options array")};au.defaultColorRange=J(Q(H)),au.defaultTarget=J({...nu,value:P,label:{...Fe,spacing:P}}),au.scale.defaultFill=J(H);var ax=(t=>(t[t.SMALLEST=8]="SMALLEST",t[t.SMALLER=10]="SMALLER",t[t.SMALL=12]="SMALL",t[t.MEDIUM=13]="MEDIUM",t[t.LARGE=14]="LARGE",t[t.LARGEST=17]="LARGEST",t))(ax||{}),nr=12,sr={SMALLEST:8/nr,SMALLER:10/nr,SMALL:12/nr,MEDIUM:13/nr,LARGE:14/nr,LARGEST:17/nr},ox=(t=>(t.TOP="top",t.TOP_RIGHT="top-right",t.TOP_LEFT="top-left",t.RIGHT="right",t.RIGHT_TOP="right-top",t.RIGHT_BOTTOM="right-bottom",t.BOTTOM="bottom",t.BOTTOM_RIGHT="bottom-right",t.BOTTOM_LEFT="bottom-left",t.LEFT="left",t.LEFT_TOP="left-top",t.LEFT_BOTTOM="left-bottom",t))(ox||{}),lx=(t=>(t.CATEGORY="category",t.GROUPED_CATEGORY="grouped-category",t.ORDINAL_TIME="ordinal-time",t.UNIT_TIME="unit-time",t.TIME="time",t.NUMBER="number",t.LOG="log",t))(lx||{}),cx=(t=>(t.ANGLE_CATEGORY="angle-category",t.ANGLE_NUMBER="angle-number",t.RADIUS_CATEGORY="radius-category",t.RADIUS_NUMBER="radius-number",t))(cx||{}),hx=(t=>(t.CIRCLE="circle",t.POLYGON="polygon",t))(hx||{}),Kr=(t,e,i)=>t*(1-i)+e*i,ap=t=>{const e=t<0?-1:1,i=Math.abs(t);return i<=.04045?t/12.92:e*((i+.055)/1.055)**2.4},op=t=>{const e=t<0?-1:1,i=Math.abs(t);return i>.0031308?e*(1.055*i**(1/2.4)-.055):12.92*t},ux=class Ne{constructor(e,i,n,s=1){this.r=te(0,e||0,1),this.g=te(0,i||0,1),this.b=te(0,n||0,1),this.a=te(0,s||0,1)}static validColorString(e){return e.includes("#")?!!Ne.parseHex(e):e.includes("rgb")?!!Ne.stringToRgba(e):Ne.nameToHex.has(e.toLowerCase())}static fromString(e){if(e.includes("#"))return Ne.fromHexString(e);const i=Ne.nameToHex.get(e.toLowerCase());if(i)return Ne.fromHexString(i);if(e.includes("rgb"))return Ne.fromRgbaString(e);throw new Error(`Invalid color string: '${e}'`)}static parseHex(e){e=e.replaceAll(" ","").slice(1);let i;switch(e.length){case 6:case 8:i=[];for(let n=0;n<e.length;n+=2)i.push(Number.parseInt(`${e[n]}${e[n+1]}`,16));break;case 3:case 4:i=e.split("").map(n=>Number.parseInt(n,16)).map(n=>n+n*16);break}if(i?.length>=3&&i.every(n=>n>=0))return i.length===3&&i.push(255),i}static fromHexString(e){const i=Ne.parseHex(e);if(i){const[n,s,r,a]=i;return new Ne(n/255,s/255,r/255,a/255)}throw new Error(`Malformed hexadecimal color string: '${e}'`)}static stringToRgba(e){let i=-1,n=-1;for(let o=0;o<e.length;o++){const l=e[o];if(i===-1&&l==="(")i=o;else if(l===")"){n=o;break}}if(i===-1||n===-1)return;const r=e.substring(i+1,n).split(","),a=[];for(let o=0;o<r.length;o++){const l=r[o];let c=Number.parseFloat(l);if(!Number.isFinite(c))return;l.includes("%")?(c=te(0,c,100),c/=100):o===3?c=te(0,c,1):(c=te(0,c,255),c/=255),a.push(c)}return a}static fromRgbaString(e){const i=Ne.stringToRgba(e);if(i){if(i.length===3)return new Ne(i[0],i[1],i[2]);if(i.length===4)return new Ne(i[0],i[1],i[2],i[3])}throw new Error(`Malformed rgb/rgba color string: '${e}'`)}static fromArray(e){if(e.length===4)return new Ne(e[0],e[1],e[2],e[3]);if(e.length===3)return new Ne(e[0],e[1],e[2]);throw new Error("The given array should contain 3 or 4 color components (numbers).")}static fromHSB(e,i,n,s=1){const r=Ne.HSBtoRGB(e,i,n);return new Ne(r[0],r[1],r[2],s)}static fromHSL(e,i,n,s=1){const r=Ne.HSLtoRGB(e,i,n);return new Ne(r[0],r[1],r[2],s)}static fromOKLCH(e,i,n,s=1){const r=Ne.OKLCHtoRGB(e,i,n);return new Ne(r[0],r[1],r[2],s)}static padHex(e){return e.length===1?"0"+e:e}toHexString(){let e="#"+Ne.padHex(Math.round(this.r*255).toString(16))+Ne.padHex(Math.round(this.g*255).toString(16))+Ne.padHex(Math.round(this.b*255).toString(16));return this.a<1&&(e+=Ne.padHex(Math.round(this.a*255).toString(16))),e}toRgbaString(e=3){const i=[Math.round(this.r*255),Math.round(this.g*255),Math.round(this.b*255)],n=Math.pow(10,e);return this.a!==1?(i.push(Math.round(this.a*n)/n),`rgba(${i.join(", ")})`):`rgb(${i.join(", ")})`}toString(){return this.a===1?this.toHexString():this.toRgbaString()}toHSB(){return Ne.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(e,i,n){const s=ap(e),r=ap(i),a=ap(n),o=Math.cbrt(.4122214708*s+.5363325363*r+.0514459929*a),l=Math.cbrt(.2119034982*s+.6806995451*r+.1073969566*a),c=Math.cbrt(.0883024619*s+.2817188376*r+.6299787005*a),h=.2104542553*o+.793617785*l-.0040720468*c,u=1.9779984951*o-2.428592205*l+.4505937099*c,d=.0259040371*o+.7827717662*l-.808675766*c,g=Math.atan2(d,u)*180/Math.PI,p=h,f=Math.hypot(u,d),m=g>=0?g:g+360;return[p,f,m]}static OKLCHtoRGB(e,i,n){const s=e,r=i*Math.cos(n*Math.PI/180),a=i*Math.sin(n*Math.PI/180),o=(s+.3963377774*r+.2158037573*a)**3,l=(s-.1055613458*r-.0638541728*a)**3,c=(s-.0894841775*r-1.291485548*a)**3,h=4.0767416621*o-3.3077115913*l+.2309699292*c,u=-1.2684380046*o+2.6097574011*l-.3413193965*c,d=-.0041960863*o-.7034186147*l+1.707614701*c,g=op(h),p=op(u),f=op(d);return[g,p,f]}static RGBtoHSL(e,i,n){const s=Math.min(e,i,n),r=Math.max(e,i,n),a=(r+s)/2;let o,l;if(r===s)o=0,l=0;else{const c=r-s;l=a>.5?c/(2-r-s):c/(r+s),r===e?o=(i-n)/c+(i<n?6:0):r===i?o=(n-e)/c+2:o=(e-i)/c+4,o*=360/6}return[o,l,a]}static HSLtoRGB(e,i,n){if(e=(e%360+360)%360,i===0)return[n,n,n];const s=n<.5?n*(1+i):n+i-n*i,r=2*n-s;function a(h){return h<0&&(h+=1),h>1&&(h-=1),h<1/6?r+(s-r)*6*h:h<1/2?s:h<2/3?r+(s-r)*(2/3-h)*6:r}const o=a(e/360+1/3),l=a(e/360),c=a(e/360-1/3);return[o,l,c]}static RGBtoHSB(e,i,n){const s=Math.min(e,i,n),r=Math.max(e,i,n),a=r===0?0:(r-s)/r;let o=0;if(s!==r){const l=r-s,c=(r-e)/l,h=(r-i)/l,u=(r-n)/l;e===r?o=u-h:i===r?o=2+c-u:o=4+h-c,o/=6,o<0&&(o=o+1)}return[o*360,a,r]}static HSBtoRGB(e,i,n){e=(e%360+360)%360/360;let s=0,r=0,a=0;if(i===0)s=r=a=n;else{const o=(e-Math.floor(e))*6,l=o-Math.floor(o),c=n*(1-i),h=n*(1-i*l),u=n*(1-i*(1-l));switch(Math.trunc(o)){case 0:s=n,r=u,a=c;break;case 1:s=h,r=n,a=c;break;case 2:s=c,r=n,a=u;break;case 3:s=c,r=h,a=n;break;case 4:s=u,r=c,a=n;break;case 5:s=n,r=c,a=h;break}}return[s,r,a]}static mix(e,i,n){return new Ne(Kr(e.r,i.r,n),Kr(e.g,i.g,n),Kr(e.b,i.b,n),Kr(e.a,i.a,n))}static lighten(e,i){const n=Ne.RGBtoOKLCH(e.r,e.g,e.b);return Ne.fromOKLCH(te(0,n[0]+i,1),n[1],n[2])}static darken(e,i){const n=Ne.RGBtoOKLCH(e.r,e.g,e.b);return Ne.fromOKLCH(te(0,n[0]-i,1),n[1],n[2])}static interpolate(e,i){const n=1/(e.length-1),s=e.map(r=>Ne.RGBtoOKLCH(r.r,r.g,r.b));return Array.from({length:i},(r,a)=>{const o=a/(i-1),l=e.length<=2?0:Math.min(Math.floor(o*(e.length-1)),e.length-2),c=(o-l*n)/n,h=s[l],u=s[l+1];return Ne.fromOKLCH(Kr(h[0],u[0],c),Kr(h[1],u[1],c),Kr(h[2],u[2],c))})}};ux.nameToHex=new Map([["aliceblue","#F0F8FF"],["antiquewhite","#FAEBD7"],["aqua","#00FFFF"],["aquamarine","#7FFFD4"],["azure","#F0FFFF"],["beige","#F5F5DC"],["bisque","#FFE4C4"],["black","#000000"],["blanchedalmond","#FFEBCD"],["blue","#0000FF"],["blueviolet","#8A2BE2"],["brown","#A52A2A"],["burlywood","#DEB887"],["cadetblue","#5F9EA0"],["chartreuse","#7FFF00"],["chocolate","#D2691E"],["coral","#FF7F50"],["cornflowerblue","#6495ED"],["cornsilk","#FFF8DC"],["crimson","#DC143C"],["cyan","#00FFFF"],["darkblue","#00008B"],["darkcyan","#008B8B"],["darkgoldenrod","#B8860B"],["darkgray","#A9A9A9"],["darkgreen","#006400"],["darkgrey","#A9A9A9"],["darkkhaki","#BDB76B"],["darkmagenta","#8B008B"],["darkolivegreen","#556B2F"],["darkorange","#FF8C00"],["darkorchid","#9932CC"],["darkred","#8B0000"],["darksalmon","#E9967A"],["darkseagreen","#8FBC8F"],["darkslateblue","#483D8B"],["darkslategray","#2F4F4F"],["darkslategrey","#2F4F4F"],["darkturquoise","#00CED1"],["darkviolet","#9400D3"],["deeppink","#FF1493"],["deepskyblue","#00BFFF"],["dimgray","#696969"],["dimgrey","#696969"],["dodgerblue","#1E90FF"],["firebrick","#B22222"],["floralwhite","#FFFAF0"],["forestgreen","#228B22"],["fuchsia","#FF00FF"],["gainsboro","#DCDCDC"],["ghostwhite","#F8F8FF"],["gold","#FFD700"],["goldenrod","#DAA520"],["gray","#808080"],["green","#008000"],["greenyellow","#ADFF2F"],["grey","#808080"],["honeydew","#F0FFF0"],["hotpink","#FF69B4"],["indianred","#CD5C5C"],["indigo","#4B0082"],["ivory","#FFFFF0"],["khaki","#F0E68C"],["lavender","#E6E6FA"],["lavenderblush","#FFF0F5"],["lawngreen","#7CFC00"],["lemonchiffon","#FFFACD"],["lightblue","#ADD8E6"],["lightcoral","#F08080"],["lightcyan","#E0FFFF"],["lightgoldenrodyellow","#FAFAD2"],["lightgray","#D3D3D3"],["lightgreen","#90EE90"],["lightgrey","#D3D3D3"],["lightpink","#FFB6C1"],["lightsalmon","#FFA07A"],["lightseagreen","#20B2AA"],["lightskyblue","#87CEFA"],["lightslategray","#778899"],["lightslategrey","#778899"],["lightsteelblue","#B0C4DE"],["lightyellow","#FFFFE0"],["lime","#00FF00"],["limegreen","#32CD32"],["linen","#FAF0E6"],["magenta","#FF00FF"],["maroon","#800000"],["mediumaquamarine","#66CDAA"],["mediumblue","#0000CD"],["mediumorchid","#BA55D3"],["mediumpurple","#9370DB"],["mediumseagreen","#3CB371"],["mediumslateblue","#7B68EE"],["mediumspringgreen","#00FA9A"],["mediumturquoise","#48D1CC"],["mediumvioletred","#C71585"],["midnightblue","#191970"],["mintcream","#F5FFFA"],["mistyrose","#FFE4E1"],["moccasin","#FFE4B5"],["navajowhite","#FFDEAD"],["navy","#000080"],["oldlace","#FDF5E6"],["olive","#808000"],["olivedrab","#6B8E23"],["orange","#FFA500"],["orangered","#FF4500"],["orchid","#DA70D6"],["palegoldenrod","#EEE8AA"],["palegreen","#98FB98"],["paleturquoise","#AFEEEE"],["palevioletred","#DB7093"],["papayawhip","#FFEFD5"],["peachpuff","#FFDAB9"],["peru","#CD853F"],["pink","#FFC0CB"],["plum","#DDA0DD"],["powderblue","#B0E0E6"],["purple","#800080"],["rebeccapurple","#663399"],["red","#FF0000"],["rosybrown","#BC8F8F"],["royalblue","#4169E1"],["saddlebrown","#8B4513"],["salmon","#FA8072"],["sandybrown","#F4A460"],["seagreen","#2E8B57"],["seashell","#FFF5EE"],["sienna","#A0522D"],["silver","#C0C0C0"],["skyblue","#87CEEB"],["slateblue","#6A5ACD"],["slategray","#708090"],["slategrey","#708090"],["snow","#FFFAFA"],["springgreen","#00FF7F"],["steelblue","#4682B4"],["tan","#D2B48C"],["teal","#008080"],["thistle","#D8BFD8"],["tomato","#FF6347"],["transparent","#00000000"],["turquoise","#40E0D0"],["violet","#EE82EE"],["wheat","#F5DEB3"],["white","#FFFFFF"],["whitesmoke","#F5F5F5"],["yellow","#FFFF00"],["yellowgreen","#9ACD32"]]);var Oe=ux,dx={x:{position:"bottom",type:{$if:[{$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},"number","category"]}},y:{position:"left",type:{$if:[{$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},"category","number"]}}},xk={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},{$palette:"fillFallback"},{$palette:"fill"}]},Sk={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},{$palette:"fillsFallback"},{$palette:"fills"}]},lp={$if:[{$isGradient:{$palette:"fill"}},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/stroke",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},Mk={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},[{$palette:"fillFallback"},{$palette:"fillFallback"}],{$palette:"range2"}]},cp={type:"gradient",gradient:"linear",bounds:"item",colorStops:[{color:"black"}],rotation:0,reverse:!1,colorSpace:"rgb"},rr={type:"gradient",gradient:"linear",bounds:"item",colorStops:{$shallow:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]}},rotation:0,reverse:!1,colorSpace:"rgb"},Ik={...rr,colorStops:{$shallow:[{color:{$mix:[{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"black",.15]}},{color:{$mix:[{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"white",.15]}}]}},Dk={...rr,colorStops:{$map:[{color:{$value:"$1"}},{$path:["/0",void 0,{$palette:"gradients"}]}]}},Ck=t=>({...rr,colorStops:{$shallow:{$if:[{$or:[{$isGradient:{$palette:`${t}.fill`}},{$isPattern:{$palette:`${t}.fill`}},{$isImage:{$palette:`${t}.fill`}}]},{$path:["/colorStops",void 0,{$palette:`${t}.fill`}]},[{color:{$mix:[{$palette:`${t}.fill`},"black",.15]}},{color:{$mix:[{$palette:`${t}.fill`},"white",.15]}}]]}}}),ou={type:"gradient",gradient:"radial",bounds:"item",colorStops:{$shallow:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]}},rotation:0,reverse:!1,colorSpace:"rgb"},Zl={...ou,reverse:!0},Ak={...ou,bounds:"series"},gx={...ou,bounds:"series",reverse:!0},wk={type:"gradient",gradient:"conic",bounds:"series",colorStops:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]},rotation:0,reverse:!1,colorSpace:"rgb"},Ki={type:"pattern",pattern:"forward-slanted-lines",width:{$isUserOption:["./height",{$path:"./height"},10]},height:{$isUserOption:["./width",{$path:"./width"},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:lp,strokeOpacity:1,strokeWidth:{$switch:[{$path:"./pattern"},0,[["backward-slanted-lines","forward-slanted-lines","horizontal-lines","vertical-lines"],4]]},backgroundFill:"none",backgroundFillOpacity:1,rotation:0,scale:1},kk={...Ki,stroke:{$if:[{$isGradient:{$palette:"fill"}},{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/stroke",{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$path:["/0",void 0,{$palette:"fills"}]}]},{$path:["/0",void 0,{$palette:"fills"}]}]}]},fill:{$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isImage:{$palette:"fill"}}]},{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/fill",{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$path:["/0",void 0,{$palette:"fills"}]}]},{$path:["/0",void 0,{$palette:"fills"}]}]}]}},hp={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},Tk={...Ki,fill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]}},Lk=t=>({...Ki,stroke:{$if:[{$isGradient:{$palette:`${t}.fill`}},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:`${t}.fill`}},{$path:["/stroke",{$palette:"fillFallback"},{$palette:`${t}.fill`}]},{$palette:`${t}.fill`}]}]}}),vs={type:"image",backgroundFill:{$palette:"fillFallback"},backgroundFillOpacity:1,repeat:"no-repeat",fit:"contain",rotation:0},up={type:"image",backgroundFill:"black",backgroundFillOpacity:1,rotation:0,repeat:"no-repeat",fit:"contain",width:8,height:8};function Yi(t){return tp(t,e=>{const i=Oe.fromString(e);return[Oe.darken(i,.15).toString(),e,Oe.lighten(i,.15).toString()]})}var Jn={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}}},Xl={enabled:{$circular:{$path:"/highlight/enabled"}},unhighlightedItem:{opacity:.6},unhighlightedSeries:{opacity:.2}},dp={enabled:{$circular:{$path:"/highlight/enabled"}},unhighlightedSeries:{opacity:.2}},gp={enabled:{$circular:{$path:"/highlight/enabled"}},unhighlightedItem:{opacity:.2},unhighlightedSeries:{opacity:.2}},Nk={enabled:{$circular:{$path:"/highlight/enabled"}},unhighlightedItem:{opacity:.2}},ar={enabled:{$path:["/selection/enabled",!1]},containment:{$path:"/selection/containment"},selectedItem:{strokeWidth:2},unselectedItem:{opacity:.6},unselectedSeries:{opacity:.2}},px={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]}]}},lu={enabled:!1,key:"x",segments:{$apply:{fill:{$applySwitch:[{$path:"type"},{$path:"../../../fill"},["gradient",rr],["image",vs],["pattern",Ki]]},stroke:{$path:"../../../stroke"},fillOpacity:{$path:"../../../fillOpacity"},strokeWidth:{$isUserOption:["./stroke",{$isUserOption:["../../../strokeWidth",{$path:"../../../strokeWidth"},{$if:[{$greaterThan:[{$path:"../../../strokeWidth"},0]},{$path:"../../../strokeWidth"},2]}]},{$path:"../../../strokeWidth"}]},strokeOpacity:{$path:"../../../strokeOpacity"},lineDash:{$path:"../../../lineDash"},lineDashOffset:{$path:"../../../lineDashOffset"}}}},pp=class wb{constructor(e){this.version=e.split("-")[0]}save(...e){const i={version:this.version};for(const n of Object.values(e))i[n.mementoOriginatorKey]=this.encode(n,n.createMemento());return i}restore(e,...i){if(!he(e)){vi(`Could not restore data of type [${e===null?"null":typeof e}], expecting an object, ignoring.`);return}if(!("version"in e)||typeof e.version!="string"){vi("Could not restore data, missing [version] string in object, ignoring.");return}for(const n of i){const s=this.decode(n,e[n.mementoOriginatorKey]),r=[];if(!n.guardMemento(s,r)){let a=`Could not restore [${n.mementoOriginatorKey}] data, value was invalid, ignoring.`;r.length>0&&(a+=`

${r.join(`

`)}

`),vi(a,s);return}n.restoreMemento(this.version,e.version,s)}}encode(e,i){try{return JSON.parse(JSON.stringify(i,wb.encodeTypes))}catch(n){throw new Error(`Failed to encode [${e.mementoOriginatorKey}] value [${n}].`,{cause:n})}}decode(e,i){if(i==null)return i;try{return JSON.parse(JSON.stringify(i),wb.decodeTypes)}catch(n){throw new Error(`Failed to decode [${e.mementoOriginatorKey}] value [${n}].`,{cause:n})}}static encodeTypes(e,i){return rn(this[e])?{__type:"date",value:this[e].toISOString()}:i}static decodeTypes(e,i){return he(this[e])&&"__type"in this[e]&&this[e].__type==="date"?new Date(this[e].value):i}};function cu(t,e){let i=t;for(const n of e){if(i==null||typeof i!="object")return;i=i[n]}return i}var fx=class{constructor(){this.dirtyKeys=new Set,this.stateMap=new Map,this.isFlushing=!1}getState(t){let e=this.stateMap.get(t);return e||(e={value:void 0,flushedValue:void 0,observers:new Map},this.stateMap.set(t,e)),e}observe(t){const e=new Map;t((n,s)=>{const r=s??"";let a=e.get(n);return a==null&&(a=new Set,e.set(n,a)),a.add(r),r.length===0?this.getValue(n):cu(this.stateMap.get(n)?.value,r.split("."))});for(const[n,s]of e)this.getState(n).observers.set(t,s);return()=>{for(const n of e.keys())this.stateMap.get(n)?.observers.delete(t)}}getValue(t,e=""){const i=this.stateMap.get(t)?.value;return e.length===0?i:cu(i,e.split("."))}setValue(t,e){this.getState(t).value=e,this.dirtyKeys.add(t)}flushChanges(t){if(!this.isFlushing){this.isFlushing=!0;try{const e=this.getValue.bind(this);let i;t==null?(i=new Set(this.dirtyKeys),this.dirtyKeys.clear()):(i=new Set(this.dirtyKeys.has(t)?[t]:[]),this.dirtyKeys.delete(t));for(const n of this.collectObservers(i))n(e)}finally{this.isFlushing=!1}}}destroy(){for(const{observers:t}of this.stateMap.values())t.clear();this.dirtyKeys.clear(),this.stateMap.clear()}collectObservers(t){const e=new Set;for(const i of t){const n=this.getState(i),{flushedValue:s,value:r}=n;if(s!==r){n.flushedValue=r;for(const[a,o]of n.observers){if(o.size===0||o.has("")){e.add(a);continue}for(const l of o){const c=l.split(".");if(cu(s,c)!==cu(r,c)){e.add(a);break}}}}}return e}},fp=(t=>(t.X="x",t.Y="y",t.Angle="angle",t.Radius="radius",t))(fp||{}),Tn=(t=>(t[t.FULL=0]="FULL",t[t.UPDATE_DATA=1]="UPDATE_DATA",t[t.PROCESS_DATA=2]="PROCESS_DATA",t[t.PROCESS_DOMAIN=3]="PROCESS_DOMAIN",t[t.PROCESS_RANGE=4]="PROCESS_RANGE",t[t.PERFORM_LAYOUT=5]="PERFORM_LAYOUT",t[t.PRE_SERIES_UPDATE=6]="PRE_SERIES_UPDATE",t[t.SERIES_UPDATE=7]="SERIES_UPDATE",t[t.PRE_SCENE_RENDER=8]="PRE_SCENE_RENDER",t[t.SCENE_RENDER=9]="SCENE_RENDER",t[t.NONE=10]="NONE",t))(Tn||{}),mx=(t=>(t[t.CHART_BACKGROUND=0]="CHART_BACKGROUND",t[t.AXIS_BAND_HIGHLIGHT=1]="AXIS_BAND_HIGHLIGHT",t[t.AXIS_GRID=2]="AXIS_GRID",t[t.AXIS=3]="AXIS",t[t.SERIES_AREA_CONTAINER=4]="SERIES_AREA_CONTAINER",t[t.ZOOM_SELECTION=5]="ZOOM_SELECTION",t[t.SERIES_CROSSLINE_RANGE=6]="SERIES_CROSSLINE_RANGE",t[t.SERIES_LAYER=7]="SERIES_LAYER",t[t.AXIS_FOREGROUND=8]="AXIS_FOREGROUND",t[t.SERIES_CROSSHAIR=9]="SERIES_CROSSHAIR",t[t.SERIES_CROSSLINE_LINE=10]="SERIES_CROSSLINE_LINE",t[t.SERIES_ANNOTATION=11]="SERIES_ANNOTATION",t[t.CHART_ANNOTATION=12]="CHART_ANNOTATION",t[t.CHART_ANNOTATION_FOCUSED=13]="CHART_ANNOTATION_FOCUSED",t[t.STATUS_BAR=14]="STATUS_BAR",t[t.SERIES_LABEL=15]="SERIES_LABEL",t[t.LEGEND=16]="LEGEND",t[t.NAVIGATOR=17]="NAVIGATOR",t[t.FOREGROUND=18]="FOREGROUND",t))(mx||{}),yx=(t=>(t[t.BACKGROUND=0]="BACKGROUND",t[t.ANY_CONTENT=1]="ANY_CONTENT",t))(yx||{}),bx=(t=>(t[t.FOREGROUND=0]="FOREGROUND",t[t.HIGHLIGHT=1]="HIGHLIGHT",t[t.LABEL=2]="LABEL",t))(bx||{}),vx=(t=>(t[t.BACKGROUND=0]="BACKGROUND",t[t.FOREGROUND=1]="FOREGROUND",t[t.HIGHLIGHT=2]="HIGHLIGHT",t[t.LABEL=3]="LABEL",t))(vx||{});function hu(t){const{placement:e="bottom",floating:i=!1,xOffset:n=0,yOffset:s=0}=typeof t=="string"?{placement:t,floating:!1}:t;return{placement:e,floating:i,xOffset:n,yOffset:s}}var Te=class{handleUnknownProperties(t,e){}set(t){const{className:e=this.constructor.name}=this.constructor;if(t==null)return this.clear(),this;if(typeof t!="object")return $n(`unable to set ${e} - expecting a properties object`),this;const i=new Set(Object.keys(t));for(const n of tr(this))if(i.has(n)){const s=t[n],r=this;if(ho(r[n]))if(r[n]instanceof co){const a=r[n].reset(s);a==null?$n(`unable to set [${String(n)}] - expecting a properties array`):r[n]=a}else r[n].set(s);else ke(s)?r[n]=Yl(s,r[n]??{}):r[n]=s;i.delete(n)}this.handleUnknownProperties(i,t);for(const n of i)$n(`unable to set [${String(n)}] in ${e} - property is unknown`);return this}clear(){for(const t of tr(this)){const e=this[t];ho(e)?e.clear():this[t]=void 0}return this}toJson(){return tr(this).reduce((t,e)=>{const i=this[e];return t[String(e)]=ho(i)?i.toJson():i,t},{})}},co=class FA extends Array{constructor(e,...i){super(i.length);const s=(r=>!!r?.prototype?.constructor?.name)(e)?r=>new e().set(r):e;Object.defineProperty(this,"itemFactory",{value:s,enumerable:!1,configurable:!1}),this.set(i)}set(e){if(ce(e)){this.length=e.length;for(let i=0;i<e.length;i++)this[i]=this.itemFactory(e[i])}return this}reset(e){if(Array.isArray(e))return new FA(this.itemFactory,...e)}clear(){return this.length=0,this}toJson(){return this.map(e=>e?.toJson?.()??e)}};function ho(t){return t instanceof Te||t instanceof co}var uo=class extends Te{constructor(){super(...arguments),this.type="linear",this.tension=1,this.position="end"}};x([I],uo.prototype,"type",2),x([I],uo.prototype,"tension",2),x([I],uo.prototype,"position",2);function go(t,e){const[i,n]=At(e);return te(i,t,n)}function At(t){if(t.length===0)return[];const e=[1/0,-1/0];for(const i of t)i<e[0]&&(e[0]=i),i>e[1]&&(e[1]=i);return e}function Yr(t){const[e,i]=At(t);return i-e}function po(t){return t=Math.trunc(t),t<=0?1:t===1?2:1<<32-Math.clz32(t-1)}function mp(t){return t=Math.trunc(t),t<=0?0:t===1?1:1<<31-Math.clz32(t)}var ct=0,yt=1,wt=2,ht=3,jt=4,Mi=5,xs=1e3,Ok=10,or=64,ql=4294967295,Ek=3,Rk=20,yp=100;function bp(t,e,i,n,s,r,a,o){let l=0;for(;l<yp&&t[n]==null&&n<s;)n+=1,l+=1;for(;l<yp&&t[s]==null&&s>n;)s-=1,l+=1;if(l>=yp||n>=s)return r;const c=Number.isFinite(e)?un(t[s],e,i,o)-un(t[n],e,i,o):fo(s,t.length)-fo(n,t.length);if(c===0||!Number.isFinite(c))return r;const h=Math.abs(c)/(s-n);let u;if(a<Ek?u=!0:a>Rk?u=!1:u=h<=r,r=Math.min(r,h),!u)return r;const d=Math.floor((n+s)/2),g=bp(t,e,i,n,d,r,a+1,o),p=bp(t,e,i,d+1,s,r,a+1,o);return Math.min(g,p,r)}function Pk(t,e,i,n){return bp(t,e,i,0,t.length-1,1/(t.length-1),0,n)}function Ss(t,e,i,n){if(Number.isFinite(e)){const s=n?.smallestKeyInterval,r=n?.xNeedsValueOf??!0,a=s==null?Pk(t,e,i,r):s/(i-e);return po(Math.trunc(1/a))>>3}else{let s=Math.ceil(Math.log2(t.length))-1;return s=Math.min(Math.max(s,0),24),Math.trunc(2**s)}}function Zi(t,e){const{domain:i,sortMetadata:n}=e;switch(t){case"category":return[Number.NaN,Number.NaN];case"number":case"time":case"ordinal-time":case"unit-time":{if(i.length===0)return[1/0,-1/0];if(n?.sortOrder===1)return[Number(i[0]),Number(i.at(-1))];if(n?.sortOrder===-1)return[Number(i.at(-1)),Number(i[0])];let s=1/0,r=-1/0;for(const a of i){const o=Number(a);s=Math.min(s,o),r=Math.max(r,o)}return[s,r]}case"color":case"log":case"mercator":return[0,0]}}function fo(t,e){return t/e}function un(t,e,i,n){return n?(t.valueOf()-e)/(i-e):(t-e)/(i-e)}function uu(t,e){return Math.trunc(Math.min(Math.floor(t*e),e-1)*Mi)}function Jl(t,e,i,n,s,{xNeedsValueOf:r=!0,xValuesLength:a}={}){const o=t[s];if(o==null)return-1;const l=a??t.length,c=Number.isFinite(e)?un(o,e,i,r):fo(s,l);return uu(c,n)}function vp(t,e,i,n){for(const s of n)if(i===t[e+s])return!0;return!1}function Ms(t,e,i,n,s,r,{positive:a,split:o=!1,xNeedsValueOf:l=!0,yNeedsValueOf:c=!0,reuseIndexData:h,reuseValueData:u,reuseNegativeIndexData:d,reuseNegativeValueData:g}={}){const p=Number.NaN,f=r*Mi,m=h?.length===f?h:new Uint32Array(f),y=u?.length===f?u:new Float64Array(f);let b,v;o&&(d?.length===f?b=d:b=new Uint32Array(f),g?.length===f?v=g:v=new Float64Array(f));const S=Number.isFinite(n)&&Number.isFinite(s),M=t.length;S&&(y.fill(p),m.fill(ql),o&&(v.fill(p),b.fill(ql)));const C=S?r/(s-n):r*(1/M);let D=-1,A=-1,w=p,L=-1,O=p,R=-1,_=p,E=-1,F=p,z=-1,K=-1,G=p,ie=-1,de=p,ae=-1,oe=p,mt=-1,pe=p;const _t=t.length,oi=e===i;for(let fe=0;fe<_t;fe++){const fs=t[fe];if(fs==null)continue;const vn=e[fe],zn=oi?vn:i[fe];let Qe,me;c?(Qe=vn==null?p:vn.valueOf(),me=zn==null?p:zn.valueOf()):(Qe=vn??p,me=zn??p);let Be=!0;if(o)Be=Qe>=0;else if(a!=null&&Qe>=0!==a)continue;let xe;S?l?xe=(fs.valueOf()-n)*C:xe=(fs-n)*C:xe=fe*C;const Ai=Math.floor(xe),xn=(Ai<r?Ai:r-1)*Mi;if(Be){xn!==D&&(D!==-1&&(m[D+ct]=A,m[D+yt]=L,m[D+wt]=R,m[D+ht]=E,m[D+jt]=0,y[D+ct]=w,y[D+yt]=O,y[D+wt]=_,y[D+ht]=F),D=xn,A=-1,w=p,L=-1,O=p,R=-1,_=p,E=-1,F=p);const dh=me===me,gh=Qe===Qe;A===-1?(A=fe,w=xe,L=fe,O=xe,dh&&(R=fe,_=me),gh&&(E=fe,F=Qe)):(xe<w&&(A=fe,w=xe),xe>O&&(L=fe,O=xe),dh&&me<_&&(R=fe,_=me),gh&&Qe>F&&(E=fe,F=Qe))}else{xn!==z&&(z!==-1&&(b[z+ct]=K,b[z+yt]=ie,b[z+wt]=ae,b[z+ht]=mt,b[z+jt]=0,v[z+ct]=G,v[z+yt]=de,v[z+wt]=oe,v[z+ht]=pe),z=xn,K=-1,G=p,ie=-1,de=p,ae=-1,oe=p,mt=-1,pe=p);const dh=me===me,gh=Qe===Qe;K===-1?(K=fe,G=xe,ie=fe,de=xe,dh&&(ae=fe,oe=me),gh&&(mt=fe,pe=Qe)):(xe<G&&(K=fe,G=xe),xe>de&&(ie=fe,de=xe),dh&&me<oe&&(ae=fe,oe=me),gh&&Qe>pe&&(mt=fe,pe=Qe))}}return D!==-1&&(m[D+ct]=A,m[D+yt]=L,m[D+wt]=R,m[D+ht]=E,m[D+jt]=0,y[D+ct]=w,y[D+yt]=O,y[D+wt]=_,y[D+ht]=F),o&&z!==-1&&(b[z+ct]=K,b[z+yt]=ie,b[z+wt]=ae,b[z+ht]=mt,b[z+jt]=0,v[z+ct]=G,v[z+yt]=de,v[z+wt]=oe,v[z+ht]=pe),{indexData:m,valueData:y,negativeIndexData:b,negativeValueData:v}}function Zr(t,e,i,{inPlace:n=!1,midpointData:s,reuseIndexData:r,reuseValueData:a}={}){const o=Math.trunc(i/2),l=o*Mi;let c;n?c=t:r?.length===l?c=r:c=new Uint32Array(l);let h;n?h=e:a?.length===l?h=a:h=new Float64Array(l);const u=s??new Uint32Array(o);for(let d=0;d<o;d+=1){const g=Math.trunc(d*Mi),p=Math.trunc(g*2),f=Math.trunc(p+Mi),m=t[f+ct]===ql,y=m||e[p+ct]<e[f+ct]?p:f,b=t[y+ct];c[g+ct]=b,h[g+ct]=e[y+ct];const v=m||e[p+yt]>e[f+yt]?p:f,S=t[v+yt];c[g+yt]=S,h[g+yt]=e[v+yt],u[d]=b+S>>1;const M=m||e[p+wt]<e[f+wt]?p:f;c[g+wt]=t[M+wt],h[g+wt]=e[M+wt];const C=m||e[p+ht]>e[f+ht]?p:f;c[g+ht]=t[C+ht],h[g+ht]=e[C+ht],c[g+jt]=t[p+jt]|t[f+jt]}return{maxRange:o,indexData:c,valueData:h,midpointData:u}}function xx(t){let e=0;for(let s=0;s<t.length;s++)t[s]===1&&e++;const i=new Uint32Array(e);let n=0;for(let s=0;s<t.length;s++)t[s]===1&&(i[n++]=s);return i}function Sx(t,e,i,n,s,r,a){for(let h=0;h<i;h++)e[h*Mi+jt]=0;if(t.length===0)return;const o=Number.isFinite(s)&&Number.isFinite(r),l=n.length,c=o?i/(r-s):i*(1/l);for(let h=0;h<t.length;h++){const u=t[h];if(u>=l)continue;const d=n[u];if(d==null)continue;let g;o?g=a?(d.valueOf()-s)*c:(d-s)*c:g=u*c;const p=Math.floor(g),f=(p<i?p:i-1)*Mi;e[f+jt]=1}}function Mx(t,e,i,n,s,r,a,o,l,c){for(let g=0;g<n;g++){const p=g*Mi;e[p+jt]=0,i[p+jt]=0}if(t.length===0)return;const h=Number.isFinite(a)&&Number.isFinite(o),u=s.length,d=h?n/(o-a):n*(1/u);for(let g=0;g<t.length;g++){const p=t[g];if(p>=u)continue;const f=s[p];if(f==null)continue;const m=r[p];if(m==null)continue;const y=c?m.valueOf():m;if(y!==y)continue;let b;h?b=l?(f.valueOf()-a)*d:(f-a)*d:b=p*d;const v=Math.floor(b),S=(v<n?v:n-1)*Mi;y>=0?e[S+jt]=1:i[S+jt]=1}}function Qn(t,e,i,n=ct,s=yt,r=-1){const a=i?.length===t?i:new Uint32Array(t);for(let o=0,l=0;o<t;o+=1,l+=Mi){const c=e[l+n],h=e[l+s];a[o]=c===r?r:c+h>>1}return a}function Fk(t,{collectLevel:e,shouldContinue:i,minRange:n=or,compactInPlace:s=!1}){let r=t,a=e(r);const o=[a];for(;r.maxRange>n&&i(a,r);){const l=Zr(r.indexData,r.valueData,r.maxRange,{inPlace:s});r={maxRange:l.maxRange,indexData:l.indexData,valueData:l.valueData,midpointData:l.midpointData},a=e(r),o.push(a)}return o.reverse(),o}function Ix(t,e,i,n,s){if(e.length<xs)return;const[r,a]=t,{smallestKeyInterval:o,xNeedsValueOf:l,yNeedsValueOf:c,existingFilters:h}=s;let u=Ss(e,r,a,{smallestKeyInterval:o,xNeedsValueOf:l});const d=h?.find(y=>y.maxRange===u);let{indexData:g,valueData:p}=Ms(e,i,n,r,a,u,{xNeedsValueOf:l,yNeedsValueOf:c,reuseIndexData:d?.indexData,reuseValueData:d?.valueData}),f=Qn(u,g,d?.midpointIndices);const m=[{maxRange:u,indexData:g,valueData:p,midpointIndices:f}];for(;u>or;){const y=u,b=Math.trunc(y/2),v=h?.find(M=>M.maxRange===b),S=Zr(g,p,y,{reuseIndexData:v?.indexData,reuseValueData:v?.valueData});u=S.maxRange,g=S.indexData,p=S.valueData,f=S.midpointData??Qn(u,g,v?.midpointIndices),m.push({maxRange:u,indexData:g,valueData:p,midpointIndices:f})}return m.reverse(),m}function Vk(t,e,i,n,s){if(e.length<xs)return;const[r,a]=t,{smallestKeyInterval:o,targetRange:l,xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:u}=s,d=Ss(e,r,a,{smallestKeyInterval:o,xNeedsValueOf:c}),g=Math.min(d,po(Math.max(l,or))),p=u?.find(S=>S.maxRange===g),{indexData:f,valueData:m}=Ms(e,i,n,r,a,g,{xNeedsValueOf:c,yNeedsValueOf:h,reuseIndexData:p?.indexData,reuseValueData:p?.valueData}),y=Qn(g,f,p?.midpointIndices),b={maxRange:g,indexData:f,valueData:m,midpointIndices:y};function v(){return Ix([r,a],e,i,n,{smallestKeyInterval:o,xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:u})?.filter(M=>M.maxRange!==g)??[]}return{immediate:[b],computeRemaining:v}}var mo=Symbol("is-dark-theme"),Xr=Symbol("default-shadow-colour"),lr=Symbol("default-caption-layout-style"),cr=Symbol("default-caption-alignment"),xp=Symbol("palette-up-stroke"),Sp=Symbol("palette-down-stroke"),Mp=Symbol("palette-up-fill"),Ip=Symbol("palette-down-fill"),Dp=Symbol("palette-neutral-stroke"),Cp=Symbol("palette-neutral-fill"),Ap=Symbol("palette-alt-up-stroke"),wp=Symbol("palette-alt-down-stroke"),kp=Symbol("palette-alt-up-fill"),Tp=Symbol("palette-alt-down-fill"),Lp=Symbol("palette-gray-fill"),Np=Symbol("palette-gray-stroke"),du=Symbol("default-polar-series-stroke"),gu=Symbol("default-sparkline-crosshair-stroke"),Ei=Symbol("default-financial-charts-annotation-stroke"),Op=Symbol("default-hierarchy-strokes"),pu=Symbol("default-text-annotation-color"),Ri=Symbol("default-financial-charts-annotation-background-fill"),fu=Symbol("default-annotation-handle-fill"),mu=Symbol("default-annotation-statistics-fill"),yu=Symbol("default-annotation-statistics-stroke"),bu=Symbol("default-annotation-statistics-color"),vu=Symbol("default-annotation-statistics-divider-stroke"),Ep=Symbol("default-annotation-statistics-fill"),Rp=Symbol("default-annotation-statistics-stroke"),xu=Symbol("default-textbox-fill"),Su=Symbol("default-textbox-stroke"),Mu=Symbol("default-textbox-color"),Ql=Symbol("default-toolbar-position");function _k(t,e){return"context"in t}function Dx(t,e){return t!=null&&_k(t,e)&&e!=null&&typeof e=="object"&&e.context===void 0?(e.context=t.context,!0):!1}function dn(t,e,i){if(Array.isArray(t)){for(const n of t)if(Dx(n,i))break}else Dx(t,i);return e(i)}var Cx=class{constructor(){this.cache=new WeakMap}call(t,e,i){let n,s=this.cache.get(e);try{n=JSON.stringify(i)}catch{return this.invoke(t,e,s,void 0,i)}return s==null&&(s=new Map,this.cache.set(e,s)),s.has(n)?s.get(n):this.invoke(t,e,s,n,i)}invoke(t,e,i,n,s){try{const r=dn(t,e,s);return i&&n!=null&&i.set(n,r),r}catch(r){vi("User callback errored, ignoring",r);return}}invalidateCache(){this.cache=new WeakMap}destroy(){this.invalidateCache()}},Ax=class{constructor(t,e=t.defaultView){this.fallbackDocument=t,this.fallbackWindow=e,this.windowEvents=new Map}destroy(){this.removeWindowEvents(),this.container=void 0,this.cachedDocument=void 0,this.cachedWindow=void 0,this.windowEvents.clear()}get document(){return this.cachedDocument??this.fallbackDocument}get window(){return this.cachedWindow??this.fallbackWindow}getContainer(){return this.container}setContainer(t){if(this.container=t,t==null)return;const e=t.ownerDocument,i=e.defaultView??void 0,n=e!==this.document;n&&this.removeWindowEvents(),this.cachedDocument=e,this.cachedWindow=i,n&&this.reattachWindowEvents()}removeWindowEvents(){for(const[t,e]of this.windowEvents)for(const{listener:i,options:n}of e)this.window.removeEventListener(t,i,n)}reattachWindowEvents(){for(const[t,e]of this.windowEvents)for(const{listener:i,options:n}of e)this.window.addEventListener(t,i,n)}get devicePixelRatio(){return this.window.devicePixelRatio}get innerWidth(){return this.window.innerWidth}get innerHeight(){return this.window.innerHeight}get navigator(){return this.window.navigator}getComputedStyle(t,e){return this.window.getComputedStyle(t,e)}matchMedia(t){return this.window.matchMedia?.(t)}getSelection(){return this.window.getSelection()}requestAnimationFrame(t){return this.window.requestAnimationFrame(t)}cancelAnimationFrame(t){this.window.cancelAnimationFrame(t)}shimIdleCallback(t,e){return setTimeout(()=>t(null),e?.timeout)}requestIdleCallback(t,e){return typeof this.window.requestIdleCallback=="function"?this.window.requestIdleCallback(t,e):this.shimIdleCallback(t,e)}cancelIdleCallback(t){return typeof this.window.cancelIdleCallback=="function"?this.window.cancelIdleCallback(t):clearTimeout(t)}attachListener(t,e,i){let n=this.windowEvents.get(t);n==null&&(n=new Set,this.windowEvents.set(t,n));const s=()=>{n?.delete(a),n?.size===0&&this.windowEvents.delete(t)},r=he(i)&&i.once?o=>{s(),e(o)}:e,a={listener:r,options:i};return n.add(a),this.window.addEventListener(t,r,i),()=>{s(),this.window.removeEventListener(t,r,i)}}get body(){return this.document.body}get head(){return this.document.head}isReady(){return this.document.readyState==="complete"}createElement(t,e,i){const n=this.document.createElement(t);if(typeof e=="object"&&(i=e,e=void 0),e)for(const s of e.split(" "))n.classList.add(s);return i&&Object.assign(n.style,i),n}createSvgElement(t){return this.document.createElementNS("http://www.w3.org/2000/svg",t)}createResizeObserver(t){const e=this.window.ResizeObserver;if(e!=null)return new e(t)}createIntersectionObserver(t,e){const i=this.window.IntersectionObserver;if(i!=null)return new i(t,e)}};function Pp(t,e,i=1/0){const n=e,s=i,r=t%180*(Math.PI/180),a=Math.abs(Math.sin(r)),o=Math.abs(Math.cos(r));if(a===0)return{width:n,height:s};if(o===0)return{width:s,height:n};if(!Number.isFinite(s)){const c=o/a,h=n/(o+c*a);return{width:h,height:c*h}}const l=o*o-a*a;if(l===0){const c=Math.min(n,s)/Math.SQRT2;return{width:c,height:c}}return{width:Math.abs((n*o-s*a)/l),height:Math.abs((s*o-n*a)/l)}}function Bk(t,e,i=1/0){const n=e,s=i,r=t%180*(Math.PI/180),a=Math.abs(Math.sin(r)),o=Math.abs(Math.cos(r));return a===0?{width:n,height:s}:o===0?{width:s,height:n}:{width:n*o+s*a,height:n*a+s*o}}function Fp(t,e,i,n=0,s=0){const r=Math.cos(i),a=Math.sin(i),o=t-n,l=e-s;return{x:n+o*r-l*a,y:s+o*a+l*r}}var gn=Math.PI*2,ec=Math.PI/2;function Ii(t){return t%=gn,t+=gn,t%=gn,t}function zk(t){return t%=gn,t+=gn,t!==gn&&(t%=gn),t}function Iu(t){return t%=gn,t<-Math.PI?t+=gn:t>=Math.PI&&(t-=gn),t}function hr(t,e,i){const n=Ii(t),s=Ii(e),r=Ii(i);return s<r?s<=n&&n<=r:s>r?s<=n||n<=r:e!==i}function Zt(t){return t/180*Math.PI}function Gk(t){return t/Math.PI*180}function Du(t,e){return t=Ii(t),e=Ii(e),e-t+(t>e?gn:0)}function wx(t){const e=Ii(t);return e<=ec?e/ec:e<=Math.PI?(Math.PI-e)/ec:e<=1.5*Math.PI?(e-Math.PI)/ec:(gn-e)/ec}function Vp(t,e,i){const n=wx(i);return t*n+e*Math.abs(1-n)}function Is(t){return t?Ii(Zt(t)):0}var _p=class{constructor(){this.queue=[]}waitForCompletion(t=50){const e=this.queue;function i(n){function s(){clearTimeout(a),n(!0)}function r(){const o=e.indexOf(s);o<0||(e.splice(o,1),n(!1))}const a=setTimeout(r,t);e.push(s)}return new Promise(i)}notify(){for(const t of this.queue.splice(0))t()}};function Bp(t=0){function e(i){setTimeout(i,t)}return new Promise(e)}async function jk(t,e,i=`Timeout after ${e}ms`){let n;const s=new Promise((r,a)=>{n=setTimeout(()=>a(new Error(i)),e)});try{return await Promise.race([t,s])}finally{clearTimeout(n)}}function ur(t){return t==="true"}function Hk(t){return Number(t)}function Xi(t){return t}var $k={role:Xi,"aria-checked":ur,"aria-controls":Xi,"aria-describedby":Xi,"aria-disabled":ur,"aria-expanded":ur,"aria-haspopup":Xi,"aria-hidden":ur,"aria-label":Xi,"aria-labelledby":Xi,"aria-live":Xi,"aria-orientation":Xi,"aria-selected":ur,"data-focus-override":ur,"data-focus-visible-override":ur,"data-preventdefault":ur,class:Xi,for:Xi,id:Xi,tabindex:Hk,title:Xi,placeholder:Xi};function Me(t,e,i){i==null||i===""||i===""?t?.removeAttribute(e):t?.setAttribute(e,i.toString())}function qr(t,e){if(e!=null)for(const[i,n]of vt(e))i!=="class"&&Me(t,i,n)}function Jr(t,e,i){if(!Ja(t))return;const n=t.getAttribute(e);return n===null?i:$k[e]?.(n)??void 0}function Ln(t,e,i){t!=null&&(i==null?t.style.removeProperty(e):t.style.setProperty(e,i.toString()))}function kx(t,e){for(const[i,n]of vt(e))Ln(t,i,n)}function hi(t,e){const i=Array.isArray(t)?t:t.split(".");if(i.length===1){const[n]=i;return er((s,r,a)=>s[n]=a,s=>s[n],e)}return er((n,s,r)=>sp(n,i,r),n=>ip(n,i),e)}function Uk(t){return er((e,i,n)=>e[t]=n)}function xt(t,e){return er((i,n,s)=>i[t][e??n]=s)}function ui(t){const{newValue:e,oldValue:i,changeValue:n}=t;return er((s,r,a,o)=>(a!==o&&(o!==void 0&&i?.call(s,o),a!==void 0&&e?.call(s,a),n?.call(s,a,o)),a))}function yo(t){return Qg(t)}var bo=class extends Te{constructor(t){super(),this.node=t,this.enabled=!1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=1}};x([ui({changeValue(t){t?this.node.strokeWidth=this.strokeWidth:this.node.strokeWidth=0}}),I],bo.prototype,"enabled",2),x([xt("node","stroke"),I],bo.prototype,"stroke",2),x([xt("node","strokeOpacity"),I],bo.prototype,"strokeOpacity",2),x([ui({changeValue(t){this.enabled?this.node.strokeWidth=t:this.node.strokeWidth=0}}),I],bo.prototype,"strokeWidth",2);function Cu(t,e,i,n,s){return e<t.x+t.width&&e+n>t.x&&i<t.y+t.height&&i+s>t.y}function tc(t,e,i,n=0,s=0){return e>=t.x&&e+n<=t.x+t.width&&i>=t.y&&i+s<=t.y+t.height}function Wk(t){return t==null||t.height===0||t.width===0||Number.isNaN(t.height)||Number.isNaN(t.width)}function Au(t,e){return t===e?!0:t==null||e==null?!1:t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function vo(t,e,i){if(t>e)return;let n;for(;e>=t;){const s=Math.floor((e+t)/2);i(s)?(n=s,t=s+1):e=s-1}return n}function xo(t,e,i){if(t>e)return;let n;for(;e>=t;){const s=Math.floor((e+t)/2);i(s)?(n=s,e=s-1):t=s+1}return n}function Kk(t,e,i){if(t>e)return;let n;for(;e>=t;){const s=Math.floor((e+t)/2),r=i(s);r==null?e=s-1:(n=r,t=s+1)}return n}function Yk(t,e,i){if(t>e)return;let n;for(;e>=t;){const s=Math.floor((e+t)/2),r=i(s);r==null?t=s+1:(n=r,e=s-1)}return n}function Tx(t=0,e=0){const i=Ch();return new i(t,e).getContext("2d")}var Zk=800,Xk=600,qk={quality:1};function Jk(t){const e=class extends t{constructor(...n){super(...n),this.gpu=!1}toBuffer(n,s){return super.toBuffer(n,{...s,msaa:!1})}transferToImageBitmap(){const{width:n,height:s}=this,r=new e(Math.max(1,n),Math.max(1,s));return n>0&&s>0&&r.getContext("2d").drawCanvas(this,0,0,n,s),Object.defineProperty(r,"close",{value:()=>{}}),r}};return e}var Lx=!1;function Qk(t,e){Lx||(Lx=!0,Object.defineProperty(t.prototype,"fillText",{value:function(i,n,s){let r=this.outlineText(i);r=r.transform(new e([1,0,0,1,n,s])),this.fill(r)},writable:!0,configurable:!0}))}var eT=class{constructor(t){this.getter=t}get(){return this.result??(this.result=this.getter()),this.result}clear(){this.result=void 0}},Nx=class{constructor(t){this.getter=t}get(){let t=this.result?.deref();return t||(t=this.getter(),this.result=new WeakRef(t),t)}clear(){this.result=void 0}};function zp(t,e){return t.valueOf()-e.valueOf()}function tT(t){let e=Number.NaN;const i=[];for(const n of t){const s=n.valueOf();e!==s&&i.push(n),e=s}return i}function Gp(t){const e=t.slice().sort(zp);return jp(e)==null?tT(e):e}function jp(t){if(t.length===0)return 1;const e=Number(t.at(-1))>Number(t[0])?1:-1;let i=-1/0*e;for(const n of t){const s=n.valueOf();if(Math.sign(s-i)!==e)return;i=s}return e}function Hp(){return(t,e)=>{const i=[`Property [${t}] is deprecated.`,e].filter(Boolean).join(" ");vi(i)}}function iT(t,e){const i=Hp(),n=e?.default;return er((s,r,a)=>(a!==n&&i(r.toString(),t),a))}function nT(t,e){const i=Hp();return er((n,s,r)=>(r!==n[t]&&(i(s.toString(),`Use [${t}] instead.`),sp(n,t,e?e(r):r)),qh),(n,s)=>(i(s.toString(),`Use [${t}] instead.`),ip(n,t)))}function Ox(t,e){const i=Math.max(t.length,e.length),n=new Set,s=new Set;for(let r=0;r<i;r++){const a=t[r],o=e[r];a!==o&&(s.has(o)?s.delete(o):o&&n.add(o),n.has(a)?n.delete(a):a&&s.add(a))}return{changed:n.size>0||s.size>0,added:n,removed:s}}function ic(t,e,i,n){const s=t-i,r=e-n;return s*s+r*r}function wu(t,e,i,n,s,r,a){if(i===s&&n===r)return Math.min(a,ic(t,e,i,n));const o=s-i,l=r-n,c=Math.max(0,Math.min(1,((t-i)*o+(e-n)*l)/(o*o+l*l))),h=i+c*o,u=n+c*l;return Math.min(a,ic(t,e,h,u))}function sT(t,e,i,n,s,r,a,o,l){o&&([a,r]=[r,a]);const c=Math.atan2(e-n,t-i);if(!hr(c,r,a)){const u=i+Math.cos(r)*s,d=n+Math.sin(r)*s,g=i+Math.cos(r)*s,p=n+Math.sin(r)*s;return Math.min(l,ic(t,e,u,d),ic(t,e,g,p))}const h=s-Math.sqrt(ic(t,e,i,n));return Math.min(l,h*h)}function dr(t,e){if(t.length===0)return null;if(e!==void 0){const r=t.at(0),a=t.at(-1),o=r instanceof Date?r.getTime():r,l=a instanceof Date?a.getTime():a;if(typeof o=="number"&&typeof l=="number")return e===1?[o,l]:[l,o]}let i=1/0,n=-1/0;for(const r of t){const a=r instanceof Date?r.getTime():r;typeof a=="number"&&(a<i&&(i=a),a>n&&(n=a))}const s=[i,n];return s.every(Number.isFinite)?s:null}function ku(t,e,i,n,s,r,a){let o=!1;const l=dr(t,a),c=l&&r?[r(l[0]),r(l[1])]:l;if(c==null){let d;return e!=null&&i!=null&&e<=i?d=[e,i]:n!=null&&s!=null&&n<=s&&(d=[n,s]),{extent:d??[],clipped:!1}}let[h,u]=c;return e!=null?(o||(o=e>h),h=e):n!=null&&n<h&&(h=n),i!=null?(o||(o=i<u),u=i):s!=null&&s>u&&(u=s),h>u?{extent:[],clipped:!1}:{extent:[h,u],clipped:o}}function Tu(t,e,i,n,s){const{extent:r,clipped:a}=ku(t.domain,Li(e)?new Date(e):e,Li(i)?new Date(i):i,Li(n)?new Date(n):n,Li(s)?new Date(s):s,o=>new Date(o),t.sortMetadata?.sortOrder);return{extent:r.map(o=>new Date(o)),clipped:a}}var rT=new Intl.NumberFormat("en-US",{style:"percent"});function Qr(t,e=2){return typeof t=="number"?Px(t,e):typeof t=="string"?t:String(t??"")}function Ex(t){return rT.format(t)}var Rx=new Map().set(2,new Intl.NumberFormat("en-US",{maximumFractionDigits:2,useGrouping:!1}));function Px(t,e){let i=Rx.get(e);return i||(i=new Intl.NumberFormat("en-US",{maximumFractionDigits:e,useGrouping:!1}),Rx.set(e,i)),i.format(t)}function Fx(t){return Array.isArray(t)&&t.length>=2&&t.every(Ee)}function Lu(t){return Array.isArray(t)&&t.length>=2&&t.every(Fx)}function aT(t){const e=t[0],i=t.at(-1);return i===void 0?!1:Ti(e[0],i[0],.001)&&Ti(e[1],i[1],.001)}function Vx(t){return Array.isArray(t)&&t.every(Lu)&&t.every(aT)}function _x(t){if(t===null)return!0;if(!he(t)||t.type==null)return!1;const{type:e,coordinates:i}=t;switch(e){case"GeometryCollection":return Array.isArray(t.geometries)&&t.geometries.every(_x);case"MultiPolygon":return Array.isArray(i)&&i.every(Vx);case"Polygon":return Vx(i);case"MultiLineString":return Array.isArray(i)&&i.every(Lu);case"LineString":return Lu(i);case"MultiPoint":return Lu(i);case"Point":return Fx(i);default:return!1}}function oT(t){return he(t)&&t.type==="Feature"&&_x(t.geometry)}function lT(t){return he(t)&&t.type==="FeatureCollection"&&Array.isArray(t.features)&&t.features.every(oT)}var Bx=ye(lT,"a GeoJSON object"),zx=class{constructor(t){this._vertexCount=0,this._edgeCount=0,this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[],this.cachedNeighboursEdge=t?.cachedNeighboursEdge,this.processedEdge=t?.processedEdge,this.singleValueEdges=t?.singleValueEdges}clear(){this._vertexCount=0,this._edgeCount=0,this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[],this.singleValueEdges?.clear()}getVertexCount(){return this._vertexCount}getEdgeCount(){return this._edgeCount}addVertex(t){const e=new Gx(t);return this._vertexCount++,e}addEdge(t,e,i){i===this.cachedNeighboursEdge?t.updateCachedNeighbours().set(e.value,e):i===this.processedEdge&&(this.pendingProcessingEdgesFrom.push(t),this.pendingProcessingEdgesTo.push(e));const{edges:n}=t,s=n.get(i);s?s.includes(e)||(this.singleValueEdges?.has(i)?n.set(i,[e]):(s.push(e),this._edgeCount++)):(n.set(i,[e]),this._edgeCount++)}removeVertex(t){this._vertexCount--;const e=t.edges;if(e){for(const[,i]of e)this._vertexCount-=i.length;t.clear()}}removeEdge(t,e,i){const n=t.edges.get(i);if(!n)return;const s=n.indexOf(e);s!==-1&&(n.splice(s,1),n.length===0&&t.edges.delete(i),this._edgeCount--,i===this.cachedNeighboursEdge&&t.readCachedNeighbours()?.delete(e.value))}removeEdges(t,e){this._edgeCount-=t.edges.get(e)?.length??0,t.edges.delete(e)}getVertexValue(t){return t.value}*neighbours(t){for(const[,e]of t.edges)for(const i of e)yield i}*neighboursAndEdges(t){for(const[e,i]of t.edges)for(const n of i)yield[n,e]}neighboursWithEdgeValue(t,e){return t.edges.get(e)}findNeighbour(t,e){return t.edges.get(e)?.[0]}findNeighbourValue(t,e){const i=this.findNeighbour(t,e);if(i)return this.getVertexValue(i)}findNeighbourWithValue(t,e,i){const n=i==null?this.neighbours(t):this.neighboursWithEdgeValue(t,i);if(n){for(const s of n)if(this.getVertexValue(s)===e)return s}}findVertexAlongEdge(t,e,i){if(i===this.cachedNeighboursEdge){let s;for(const r of e)if(s=(s??t).readCachedNeighbours()?.get(r),!s)return;return s}if(e.length===0)return;let n=t;for(const s of e){const r=n?this.neighboursWithEdgeValue(n,i):void 0;if(!r)return;n=r.find(a=>a.value===s)}return n}adjacent(t,e){for(const[,i]of t.edges)if(i.includes(e))return!0;return!1}},Gx=class{constructor(t){this.value=t,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()}},$p="class-instance";function es(t,e,i){if(ce(e)){if(!ce(t)||t.length!==e.length||e.some((n,s)=>es(t[s],n,i)!=null))return e}else if(ke(e)){if(!ke(t))return e;const n={},s=new Set([...Object.keys(t),...Object.keys(e)]);for(const r of s)if(t[r]!==e[r])if(i?.has(r))n[r]=e[r];else if(typeof t[r]==typeof e[r]){const a=es(t[r],e[r],i);a!==null&&(n[r]=a)}else n[r]=e[r];return Object.keys(n).length?n:null}else if(t!==e)return e;return null}function jx(t,e){for(const i of Object.keys(t))if(t[i]!==e?.[i])return!1;return!0}function He(t,e){return ce(t)?cT(t,e):ke(t)?hT(t,e):t instanceof Map?new Map(He(Array.from(t))):ea(t)}function cT(t,e){const i=[],n=e?.seen;for(const s of t){if(typeof s=="object"&&n?.includes(s)){$n("cycle detected in array",s);continue}n?.push(s),i.push(He(s,e)),n?.pop()}return i}function hT(t,e){const i={};for(const n of Object.keys(t))e?.assign?.has(n)?i[n]=t[n]:e?.shallow?.has(n)?i[n]=ea(t[n]):i[n]=He(t[n],e);return i}function ea(t){return ce(t)?t.slice(0):ke(t)?{...t}:rn(t)?new Date(t):vv(t)?new RegExp(t.source,t.flags):t}function gr(t,e,i,n,s,r){if(ce(t)){r=e(t,n,s,r);let a=0;for(const o of t)r=gr(o,e,i,n?.[a],s,r),a++}else if(ke(t)){r=e(t,n,s,r);for(const a of Object.keys(t)){if(i?.has(a))continue;const o=t[a];r=gr(o,e,i,n?.[a],s,r)}}return r}function Up(t,e,i={}){const{path:n,matcherPath:s=n?.replace(/(\[[0-9+]+])/i,"[]"),skip:r=[]}=i;if(t==null)throw new Error(`AG Charts - target is uninitialised: ${n??"<root>"}`);if(e==null)return t;if(ho(t))return t.set(e);const a=t,o=Wp(t);for(const l of Object.keys(e)){if(np.has(l))continue;const c=`${s?s+".":""}${l}`;if(r.includes(c))continue;const h=e[l],u=`${n?n+".":""}${l}`,d=a.constructor,g=a[l];try{const p=Wp(g),f=Wp(h);if(o===$p&&!(l in t||l==="context")){if(h===void 0)continue;$n(`unable to set [${u}] in ${d?.name} - property is unknown`);continue}if(p!=null&&f!=null&&f!==p&&(p!==$p||f!=="object")){$n(`unable to set [${u}] in ${d?.name} - can't apply type of [${f}], allowed types are: [${p}]`);continue}if(ho(g))h===void 0?g.clear():g.set(h);else if(f==="object"&&l!=="context"){if(!(l in a)){$n(`unable to set [${u}] in ${d?.name} - property is unknown`);continue}g==null?a[l]=h:Up(g,h,{...i,path:u,matcherPath:c})}else a[l]=h}catch(p){$n(`unable to set [${u}] in [${d?.name}]; nested error is: ${p.message}`)}}return t}function Wp(t){return t==null?null:Rg(t)||rn(t)?"primitive":ce(t)?"array":he(t)?ke(t)?"object":$p:an(t)?"function":"primitive"}function _e(t,e,i,n){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)}function Kp(t,e,i){return _e(t,"keydown",n=>{const s=i?.()??["Escape"];Nu(n,...s)&&e(n)})}function Hx(t,e){const i=t.ownerDocument.defaultView,n=_e(i,"mousedown",s=>{[0,2].includes(s.button)&&!Ux(t,s)&&(e(),n())});return n}function $x(t,e){const i=t.ownerDocument.defaultView,n=_e(i,"touchstart",s=>{Array.from(s.targetTouches).some(a=>!Ux(t,a))&&(e(),n())});return n}function Ux(t,e){return Ag(e.target)&&e.target.shadowRoot!=null?!0:Ah(e.target)&&t.contains(e.target)}function Wx(t,e,i){const n=s=>{for(const r of e)Me(r,"data-focus-visible-override",s)};return n(i),_e(t,"keydown",()=>n(!0),{once:!0})}function ta(t){return!(t.shiftKey||t.altKey||t.ctrlKey||t.metaKey)}function Nu(t,...e){return ta(t)&&e.includes(t.key)}function Kx(t,e,i){return _e(t,"keydown",n=>{Nu(n,i)&&e.focus()})}var uT={horizontal:{nextKey:"ArrowRight",prevKey:"ArrowLeft"},vertical:{nextKey:"ArrowDown",prevKey:"ArrowUp"}},dT={nextKey:"ArrowLeft",prevKey:"ArrowRight"};function nc(t,e){return e&&t==="horizontal"?dT:uT[t]}function gT(t){const{orientation:e,buttons:i,wrapAround:n=!1,onEscape:s,onFocus:r,onBlur:a}=t,{nextKey:o,prevKey:l}=nc(e,no(i[0])),c=g=>{if(g.target&&"tabIndex"in g.target){for(const p of i)p.tabIndex=-1;g.target.tabIndex=0}},[h,u]=n?[i.length,i.length]:[0,1/0],d=new nt;for(let g=0;g<i.length;g++){const p=i[(h+g-1)%u],f=i[g],m=i[(h+g+1)%u];d.register(_e(f,"focus",c),r&&_e(f,"focus",r),a&&_e(f,"blur",a),s&&Kp(f,s),p&&Kx(f,p,l),m&&Kx(f,m,o),_e(f,"keydown",y=>{Nu(y,o,l)&&y.preventDefault()})),f.tabIndex=g===0?0:-1}return d}function pT(t,e){return i=>{if(t.ariaDisabled==="true")return i.preventDefault();e(i)}}function Yp(t){return"button"in t?t.button===0:ta(t)&&(t.code==="Space"||t.key==="Enter")}function Zp(t){const e=t?.target;if(Ag(e)&&"tabindex"in e.attributes)return e}function Yx(t){return _e(t,"keydown",e=>{if(e.defaultPrevented)return;Jr(e.target,"data-preventdefault",!0)&&Nu(e,"ArrowRight","ArrowLeft","ArrowDown","ArrowUp")&&e.preventDefault()})}var Xp=new Map,Zx=1;function fT(){Xp.clear(),Zx=1}function Nn(t){const e=t.constructor;let i=Object.hasOwn(e,"className")?e.className:e.name;Jb(()=>{if(!i)throw new Error(`The ${String(e)} is missing the 'className' property.`)}),i??(i="Unknown");const n=(Xp.get(i)??0)+1;return Xp.set(i,n),`${i}-${n}`}function sc(){return`ag-charts-${Zx++}`}function Ou(){return crypto.randomUUID?.()??mT()}function mT(){const t=new Uint8Array(16);crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let e="";for(let i=0;i<t.length;i++)(i===4||i===6||i===8||i===10)&&(e+="-"),e+=t[i].toString(16).padStart(2,"0");return e}function Xx(t,e,i){let n=t,s=n;for(const r of e)if(n==null||i(n.value,r)>0)n={value:r,next:n},s=n;else{for(s=s;s.next!=null&&i(s.next.value,r)<=0;)s=s.next;s.next={value:r,next:s.next}}return n}var rc=new WeakMap;function So(t,e){const i=JSON.stringify(t,null,0);return rc.has(e)||rc.set(e,new Map),rc.get(e)?.has(i)||rc.get(e)?.set(i,e(t)),rc.get(e)?.get(i)}var qp=class{constructor(){this.weak=new WeakMap,this.strong=new Map,this.set=!1,this.value=void 0}};function ac(t,e){let i=new qp;const n=(...s)=>{let r=i;for(const a of s){const o=typeof a=="object"||typeof a=="symbol"?r.weak:r.strong;let l=o.get(a);l==null&&(l=new qp,o.set(a,l)),r=l}if(r.set)return e?.("hit",t,s),r.value;{const a=t(...s);return r.set=!0,r.value=a,e?.("miss",t,s),a}};return n.reset=()=>{i=new qp},n}function Eu(t,e){const i=new Map,n=(...a)=>a.map(o=>typeof o=="object"||typeof o=="symbol"?o:(i.has(o)||i.set(o,{v:o}),i.get(o))),s={},r=new WeakMap;return(...a)=>{const o=a.length===0?[s]:n(...a);let l=r;for(const u of o.slice(0,-1))l.has(u)||l.set(u,new WeakMap),l=l.get(u);const c=o.at(-1);let h=l.get(c);return h?e?.("hit",t,a):(h=t(...a),l.set(c,h),e?.("miss",t,a)),h}}function Ru(t,e,i,n=1/0){const s={nearest:void 0,distanceSquared:n};for(const r of i){const a=r.distanceSquared(t,e);if(a===0)return{nearest:r,distanceSquared:0};a<s.distanceSquared&&(s.nearest=r,s.distanceSquared=a)}return s}function yT(t,e,i,n=1/0){const{x:s=t,y:r=e}=i.transformPoint?.(t,e)??{},a={nearest:void 0,distanceSquared:n};for(const o of i.children){const{nearest:l,distanceSquared:c}=o.nearestSquared(s,r,a.distanceSquared);if(c===0)return{nearest:l,distanceSquared:c};c<a.distanceSquared&&(a.nearest=l,a.distanceSquared=c)}return a}var ia=class extends Te{constructor(t=0,e=t,i=t,n=e){super(),this.top=t,this.right=e,this.bottom=i,this.left=n}};x([I],ia.prototype,"top",2),x([I],ia.prototype,"right",2),x([I],ia.prototype,"bottom",2),x([I],ia.prototype,"left",2);function qx(t,e,i,n){let{top:s,right:r,bottom:a,left:o,width:l,height:c}=n;return o!=null?l!=null?r=i.width-o+l:r!=null&&(l=i.width-o-r):r!=null&&l!=null&&(o=i.width-r-l),s!=null?c!=null?a=i.height-s-c:a!=null&&(c=i.height-a-s):a!=null&&c!=null&&(s=i.height-a-c),l==null?c==null?(c=e,l=t):l=Math.ceil(t*c/e):c??(c=Math.ceil(e*l/t)),o==null&&(r==null?o=Math.floor((i.width-l)/2):o=i.width-r-l),s==null&&(a==null?s=Math.floor((i.height-c)/2):s=i.height-c-a),{x:o,y:s,width:l,height:c}}var Jp="color: green",Qp="color: grey";function bT(){return Qg(()=>{})}function ef(t,e){const i=tr(e);if(i.length===0)return;const n=tx(t);for(const s of i)s in n&&(e[s]=n[s])}var Jx=class{transitionRoot(t,e){this.parent?this.parent.transitionRoot(t,e):this.transition(t,e)}},tf=class $i extends Jx{constructor(e,i,n){super(),this.defaultState=e,this.states=i,this.enterEach=n,this.debug=qb(!0,"animation"),this.state=e,this.debug(`%c${this.constructor.name} | init -> ${e}`,Jp)}transition(e,i){if(!this.transitionChild(e,i)||this.state===$i.child||this.state===$i.parent)return;const s=this.state,r=this.states[this.state];let a=r[e];const o=`%c${this.constructor.name} | ${this.state} -> ${e} ->`;if(Array.isArray(a))a=a.find(h=>{if(!h.guard)return!0;const u=h.guard(i);return u||this.debug(`${o} (guarded)`,h.target,Qp),u});else if(typeof a=="object"&&!(a instanceof $i)&&a.guard&&!a.guard(i)){this.debug(`${o} (guarded)`,a.target,Qp);return}if(!a){this.debug(`${o} ${this.state}`,Qp);return}const l=this.getDestinationState(a),c=l===this.state?void 0:r.onExit;this.debug(`${o} ${l}`,Jp),this.state=l,typeof a=="function"?a(i):typeof a=="object"&&!(a instanceof $i)&&a.action?.(i),c?.(),this.enterEach?.(s,l),l!==s&&l!==$i.child&&l!==$i.parent&&this.states[l].onEnter?.(s,i)}transitionAsync(e,i){setTimeout(()=>{this.transition(e,i)},0)}is(e){return this.state===$i.child&&this.childState?this.childState.is(e):this.state===e}resetHierarchy(){this.debug(`%c${this.constructor.name} | ${this.state} -> [resetHierarchy] -> ${this.defaultState}`,"color: green"),this.state=this.defaultState}transitionChild(e,i){return this.state!==$i.child||!this.childState||(ef(this,this.childState),this.childState.transition(e,i),!this.childState.is($i.parent))?!0:(this.debug(`%c${this.constructor.name} | ${this.state} -> ${e} -> ${this.defaultState}`,Jp),this.state=this.defaultState,this.states[this.state].onEnter?.(),this.childState.resetHierarchy(),!1)}getDestinationState(e){let i=this.state;return typeof e=="string"?i=e:e instanceof $i?(this.childState=e,this.childState.parent=this,i=$i.child):typeof e=="object"&&(e.target instanceof $i?(this.childState=e.target,this.childState.parent=this,i=$i.child):e.target!=null&&(i=e.target)),i}};tf.child="__child",tf.parent="__parent";var oc=tf,vT=class extends Jx{constructor(...t){super(),this.stateMachines=t;for(const e of t)e.parent=this}transition(t,e){for(const i of this.stateMachines)ef(this,i),i.transition(t,e)}transitionAsync(t,e){for(const i of this.stateMachines)ef(this,i),i.transitionAsync(t,e)}},nf=class{constructor(t,e){this.ctx=t,this.measureTextCached=e,this.baselineMap=new Map,this.charMap=new Map,this.lineHeightCache=null}baselineDistance(t){if(t==="alphabetic")return 0;if(this.baselineMap.has(t))return this.baselineMap.get(t);this.ctx.textBaseline=t;const{alphabeticBaseline:e}=this.ctx.measureText("");return this.baselineMap.set(t,e),this.ctx.textBaseline="alphabetic",e}lineHeight(){return this.lineHeightCache??(this.lineHeightCache=this.measureText("").height),this.lineHeightCache}measureText(t){const e=this.measureTextCached?.(t)??this.ctx.measureText(t),{width:i,fontBoundingBoxAscent:n=e.emHeightAscent,fontBoundingBoxDescent:s=e.emHeightDescent}=e,r=n+s;return{width:i,height:r,ascent:n,descent:s}}measureLines(t){const e=typeof t=="string"?t.split($s):t;let i=0,n=0;const s=e.map(r=>{const a=this.measureText(r);return i<a.width&&(i=a.width),n+=a.height,{text:r,...a}});return{width:i,height:n,lineMetrics:s}}textWidth(t,e){if(e){let i=0;for(let n=0;n<t.length;n++)i+=this.textWidth(t.charAt(n));return i}return t.length>1?this.ctx.measureText(t).width:this.charMap.get(t)??this.charWidth(t)}charWidth(t){const{width:e}=this.ctx.measureText(t);return this.charMap.set(t,e),e}},sf=new Dh(50);function di(t){typeof t=="object"&&(t=Pg(t));let e=sf.get(t);if(e)return e;const i=new Dh(1e4),n=Tx();return n.font=t,e=new nf(n,s=>{let r=i.get(s);return r||(r=n.measureText(s),i.set(s,r),r)}),sf.set(t,e),e}di.clear=()=>sf.clear();function Ds(t,e){let i={segments:[],width:0,height:0,ascent:0,descent:0};const n=[i];for(const a of t){const{text:o,fontSize:l=e.fontSize,fontStyle:c=e.fontStyle,fontWeight:h=e.fontWeight,fontFamily:u=e.fontFamily,...d}=a,g={fontSize:l,fontStyle:c,fontWeight:h,fontFamily:u},p=di(g),f=et(o).split($s);for(let m=0;m<f.length;m++){const y=f[m],b=p.measureText(y);m>0&&(i={segments:[],width:0,height:0,ascent:0,descent:0},n.push(i)),y&&(i.width+=b.width,i.ascent=Math.max(i.ascent,b.ascent),i.descent=Math.max(i.descent,b.descent),i.height=Math.max(i.height,i.ascent+i.descent),i.segments.push({...g,...d,text:y,textMetrics:b}))}}let s=0,r=0;for(const a of n)s=Math.max(s,a.width),r+=a.height;return{width:s,height:r,lineMetrics:n}}function ve(t,e,i){const n=Gr().createElement(t);if(typeof e=="object"&&(i=e,e=void 0),e)for(const s of e.split(" "))n.classList.add(s);return i&&Object.assign(n.style,i),n}function ut(t){return Gr().createElementNS("http://www.w3.org/2000/svg",t)}function Qx(t,e){const i=Gr("body"),n=ve("a",{display:"none"});n.href=t,n.download=e,i.appendChild(n),n.click(),setTimeout(()=>n.remove())}function e0(t,e){return e.overflow==="hide"&&t.some(Us)}function Pu(t,e){return ce(t)?af(t,e):rf(et(t),e).join(`
`)}function t0(t,e){return rf(t,e).join(`
`)}function rf(t,e){return Fu(t,e)}function na(t,e,i,n){const s=e.textWidth(io),r=ys(t);let a=0,o=0;for(const c of r){const h=e.textWidth(c);if(a+h>i)break;a+=h,o+=c.length}if(o===t.length&&(!n||a+s<=i))return n?Vg(t):t;t=t.slice(0,o).trimEnd();const l=ys(t);for(;l.length&&e.textWidth(t)+s>i;){for(l.pop();l.length&&l.at(-1).trim()==="";)l.pop();t=l.join("")}return Vg(t)}function Fu(t,e,i=0){const n=t.split($s),s=di(e.font),r=[];if(e.textWrap==="never"){for(const c of n){const h=na(c.trimEnd(),s,Math.max(0,e.maxWidth-i));if(!h)break;r.push(h),i=0}return e0(r,e)?[]:r}const a=e.textWrap==="hyphenate",o=e.textWrap==null||e.textWrap==="on-space";for(const c of n){let h=c.trimEnd();if(h===""){r.push(h);continue}let u=ys(h),d=0,g=0,p=0,f=0;for(r.length||(p=i);d<u.length;){const m=u[d];if(m===" "&&(f=g),p+=s.textWidth(m),p>e.maxWidth){if(d===0){h="";break}let y=s.textWidth(h.slice(0,g+m.length));if(r.length||(y+=i),y<=e.maxWidth){p=y,g+=m.length,d++;continue}if(f){const M=xT(h,f+1),C=s.textWidth(M);if(C<=e.maxWidth){r.push(h.slice(0,f).trimEnd()),h=h.slice(f).trimStart(),u=ys(h),d=0,g=0,p=0,f=0;continue}else o&&C>e.maxWidth&&r.push(h.slice(0,f).trimEnd(),na(h.slice(f).trimStart(),s,e.maxWidth,!0))}else if(o){const M=na(h,s,e.maxWidth,!0);M&&r.push(M)}if(o){h="";break}const b=a?"-":"";let v=h.slice(0,g).trim();const S=ys(v);for(;S.length&&s.textWidth(v+b)>e.maxWidth;){for(S.pop();S.length&&S.at(-1).trim()==="";)S.pop();v=S.join("")}if(v&&v!==Tl)r.push(_g(v)+b);else{h="";break}h=h.slice(v.length).trimStart(),u=ys(h),d=0,g=0,p=0,f=0;continue}g+=m.length,d++}h&&r.push(h)}ST(r,s,e);const l=i0(r,s,e);return e0(l,e)?[]:l}function xT(t,e){const i=t.indexOf(" ",e);return i===-1?t.slice(e):t.slice(e,i)}function i0(t,e,i){if(!Ee(i.maxHeight))return t;const{height:n,lineMetrics:s}=e.measureLines(t);if(n<=i.maxHeight)return t;for(let r=0,a=0;r<s.length;r++)if(a+=s[r].height,a>i.maxHeight){if(i.overflow==="hide"||r===0)return[];const o=t.slice(0,r),l=o.pop();return o.concat(Us(l)?l:na(l,e,i.maxWidth,!0))}return t}function ST(t,e,i){if(i.avoidOrphans===!1||t.length<2)return;const{length:n}=t,s=t[n-1],r=t[n-2];if(ys(r).length<ys(s).length)return;const a=r.lastIndexOf(" ");if(a===-1||a===r.indexOf(" ")||s.includes(" "))return;const o=r.slice(a+1);e.textWidth(s+o)<=i.maxWidth&&(t[n-2]=r.slice(0,a),t[n-1]=o+" "+s)}function af(t,e){const{maxHeight:i=1/0}=e,n=[];let s=0,r=0;function a(){const o=n.pop();if(!o)return;const l=di(o),c=na(o.text,l,e.maxWidth,!0),h=l.measureText(c);n.push({...o,text:c,textMetrics:h})}for(const{width:o,height:l,segments:c}of Ds(t,e.font).lineMetrics){if(r+l>i){n.length&&a();break}if(s+o<=e.maxWidth){s+=o,r+=l,n.push(...c);continue}for(const h of c){if(s+h.textMetrics.width<=e.maxWidth){s+=h.textMetrics.width,n.push(h);continue}const u=di(h),d=Mv(h.text),g={...e,font:h,maxHeight:i-r};let p=Fu(d,{...g,overflow:"hide"},s);if(p.length===0)if(e.textWrap==="never")p=Fu(d,g,s);else{p=Fu(d,g);const y=n.at(-1);y&&(y.text+=`
`,s=0)}if(p.length===0){a();break}const f=p.findIndex(Us);f!==-1&&(p=p.slice(0,f+1));const m=p.at(-1);for(const y of p){const b=Iv(y),v=u.measureText(b),S={...h,text:b,textMetrics:v};y===m?s+=v.width:(S.text+=`
`,s=0),r+=v.height,n.push(S)}if(f!==-1)break}}return n}function Vu(t,[e,i],[n,s]){const r=s-n,a=i-e,o=e+a*t[0],l=e+a*t[1];return[(o-n)/r,(l-n)/r]}var Mo=1e3,pr=Mo*60,sa=pr*60,ra=sa*24,n0=ra*7,of=ra*30,lc=ra*365,Io=new Date().getTimezoneOffset()*pr,Do={millisecond:{milliseconds:1,hierarchy:"day",encode(t){return t.getTime()},decode(t){return new Date(t)}},second:{milliseconds:Mo,hierarchy:"day",encode(t,e){const i=e?0:Io;return Math.floor((t.getTime()-i)/Mo)},decode(t,e){const i=e?0:Io;return new Date(i+t*Mo)}},minute:{milliseconds:pr,hierarchy:"day",encode(t,e){const i=e?0:Io;return Math.floor((t.getTime()-i)/pr)},decode(t,e){const i=e?0:Io;return new Date(i+t*pr)}},hour:{milliseconds:sa,hierarchy:"day",encode(t,e){const i=e?0:Io;return Math.floor((t.getTime()-i)/sa)},decode(t,e){const i=e?0:Io;return new Date(i+t*sa)}},day:{milliseconds:ra,hierarchy:"month",encode(t,e){const i=e?0:t.getTimezoneOffset()*pr;return Math.floor((t.getTime()-i)/ra)},decode(t,e){let i;return e?(i=new Date(0),i.setUTCDate(i.getUTCDate()+t),i.setUTCHours(0,0,0,0)):(i=new Date(1970,0,1),i.setDate(i.getDate()+t)),i}},month:{milliseconds:of,hierarchy:"year",encode(t,e){return e?t.getUTCFullYear()*12+t.getUTCMonth():t.getFullYear()*12+t.getMonth()},decode(t,e){if(e){const i=Math.floor(t/12),n=t-i*12;return new Date(Date.UTC(i,n,1))}else{const i=Math.floor(t/12),n=t-i*12;return new Date(i,n,1)}}},year:{milliseconds:lc,hierarchy:void 0,encode(t,e){return e?t.getUTCFullYear():t.getFullYear()},decode(t,e){let i;return e?(i=new Date,i.setUTCFullYear(t),i.setUTCMonth(0,1),i.setUTCHours(0,0,0,0)):i=new Date(t,0,1,0,0,0,0),i}}};function Co(t){return typeof t=="string"?{unit:t,step:1,epoch:void 0,utc:!1}:{unit:t.unit,step:t.step??1,epoch:t.epoch,utc:t.utc??!1}}function cc(t,e,i,n){if(i==null)return 0;const s=Do[t];return Math.floor(s.encode(new Date(i),n))%e}function Ao(t,e,i,n,s){const r=Do[e];return Math.floor((r.encode(new Date(t),n)-s)/i)}function wo(t,e,i,n,s){return Do[e].decode(t*i+s,n)}function _u(t,e,i,n,s){const r=new Date(t),a=Ao(r,e,i,n,s);return wo(a,e,i,n,s)}function Bu(t,e,i,n,s){const r=new Date(Number(t)-1),a=Ao(r,e,i,n,s);return wo(a+1,e,i,n,s)}function Pi(t,e){const{unit:i,step:n,epoch:s,utc:r}=Co(t),a=cc(i,n,s,r);return _u(e,i,n,r,a)}function s0(t,e){const{unit:i,step:n,epoch:s,utc:r}=Co(t),a=cc(i,n,s,r);return Bu(e,i,n,r,a)}function r0(t,e){const{unit:i,step:n,epoch:s,utc:r}=Co(t),a=cc(i,n,s,r);return wo(Ao(Bu(e,i,n,r,a),i,n,r,a)-1,i,n,r,a)}function lf(t,e){const{unit:i,step:n,epoch:s,utc:r}=Co(t),a=cc(i,n,s,r);return wo(Ao(_u(e,i,n,r,a),i,n,r,a)+1,i,n,r,a)}function cf(t,e,i){if(t.valueOf()>e.valueOf()&&([t,e]=[e,t],i!=null&&(i=[1-i[1],1-i[0]])),i!=null){const n=e.valueOf()-t.valueOf(),s=t.valueOf();t=new Date(s+i[0]*n),e=new Date(s+i[1]*n)}return[new Date(t),new Date(e)]}function hc(t,e,i,{extend:n=!1,visibleRange:s=[0,1],limit:r,defaultAlignment:a="start"}={}){const o=Co(t),{unit:l,step:c,utc:h}=o;let u;o.epoch!=null?u=o.epoch:a==="interval"?u=void 0:e.valueOf()>i.valueOf()?u=i:u=e;const d=cc(o.unit,o.step,u,o.utc);let[g,p]=cf(e,i,s);g=n?_u(g,l,c,h,d):Bu(g,l,c,h,d),p=n?Bu(p,l,c,h,d):_u(p,l,c,h,d);const f=Ao(g,l,c,h,d);let m=Ao(p,l,c,h,d);return r!=null&&m-f>r&&(m=f+r),{range:[f,m],unit:l,step:c,utc:h,offset:d}}function hf(t,e,i,n){const{range:[s,r]}=hc(t,e,i,n);return Math.abs(r-s)}function On(t,e,i,n){const{range:[s,r],unit:a,step:o,utc:l,offset:c}=hc(t,e,i,n),h=[];for(let u=s;u<=r;u+=1){const d=wo(u,a,o,l,c);h.push(d)}return h}function a0(t,e,i,n){const{range:[s,r],unit:a,step:o,utc:l,offset:c}=hc(t,e,i,n),h=Math.max(0,r-s+1),u=new Array(h);for(let d=0;d<h;d++)u[d]=s+d;return{encodedValues:u,encodingParams:{unit:a,step:o,utc:l,offset:c}}}function o0(t,e){return wo(t,e.unit,e.step,e.utc,e.offset)}var uf=new Date().getTimezoneOffset()*6e4,MT=1e3,IT=6e4,DT=36e5;function fr(t,e){const{unit:i,step:n,utc:s,offset:r}=e,a=t*n+r;switch(i){case"millisecond":return a;case"second":return(s?0:uf)+a*MT;case"minute":return(s?0:uf)+a*IT;case"hour":return(s?0:uf)+a*DT;default:return Do[i].decode(a,s).valueOf()}}function l0(t,e,i,{extend:n,visibleRange:s,limit:r,defaultAlignment:a}={}){const{range:[o]}=hc(t,e,i,{extend:n,visibleRange:s,limit:r,defaultAlignment:a}),{range:[l]}=hc(t,e,i,{extend:n,limit:r,defaultAlignment:a});return o-l}var CT={millisecond:{adjust(t,e,i){const n=new Date;return n.setTime(t.getTime()+e),n}},second:{adjust(t,e,i){const n=new Date(t.getTime());return i?n.setUTCSeconds(t.getUTCSeconds()+e):n.setSeconds(t.getSeconds()+e),n}},minute:{adjust(t,e,i){const n=new Date(t.getTime());return i?n.setUTCMinutes(t.getUTCMinutes()+e):n.setMinutes(t.getMinutes()+e),n}},hour:{adjust(t,e,i){const n=new Date(t.getTime());return i?n.setUTCHours(t.getUTCHours()+e):n.setHours(t.getHours()+e),n}},day:{adjust(t,e,i){const n=new Date(t.getTime());return i?n.setUTCDate(t.getUTCDate()+e):n.setDate(t.getDate()+e),n}},month:{adjust(t,e,i){const n=new Date(t.getTime());if(i){if(n.setUTCMonth(t.getUTCMonth()+e),e!==0)for(;n.getUTCMonth()===t.getUTCMonth();)n.setUTCDate(n.getUTCDate()+(e>0?1:-1))}else if(n.setMonth(t.getMonth()+e),e!==0)for(;n.getMonth()===t.getMonth();)n.setDate(n.getDate()+(e>0?1:-1));return n}},year:{adjust(t,e,i){const n=new Date(t.getTime());return i?n.setUTCFullYear(t.getUTCFullYear()+e):n.setFullYear(t.getFullYear()+e),n}}};function AT(t,e){const{unit:i,step:n,utc:s}=Co(t);return CT[i].adjust(e,-n,s)}function Cs(t){return typeof t=="string"?t:t.unit}function mr(t){return typeof t=="string"?1:t.step??1}function uc(t){return typeof t=="string"?void 0:t.epoch}function dc(t){return Do[Cs(t)].hierarchy}function Fi(t){return mr(t)*Do[Cs(t)].milliseconds}function df(t){return typeof t=="string"?{unit:t}:t}var c0=["millisecond","second","minute","hour","day","month","year"];function wT(t){return ke(t)?"unit"in t&&c0.includes(t.unit):!1}function kT(t){return ot(t)&&c0.includes(t)}var dt=(t,e)=>({duration:Fi(t)*e,timeInterval:t,step:e}),zu=[dt({unit:"second"},1),dt({unit:"second"},5),dt({unit:"second"},15),dt({unit:"second"},30),dt({unit:"minute"},1),dt({unit:"minute"},5),dt({unit:"minute"},15),dt({unit:"minute"},30),dt({unit:"hour"},1),dt({unit:"hour"},3),dt({unit:"hour"},6),dt({unit:"hour"},12),dt({unit:"day"},1),dt({unit:"day"},2),dt({unit:"day",step:7},1),dt({unit:"day",step:7},2),dt({unit:"day",step:7},3),dt({unit:"month"},1),dt({unit:"month"},2),dt({unit:"month"},3),dt({unit:"month"},4),dt({unit:"month"},6),dt({unit:"year"},1)],h0=[1,2,5,10];function u0(t,e){return Math.abs(Math.round(t)-t)<e}function d0(t,e,i){return Math.abs(e-t)>=i?Math.abs(e-t)/i+1:1}function ko(t,e,i,n,s,r){if(t===e)return{ticks:[t],count:1,firstTickIndex:0};if(i<2)return{ticks:[t,e],count:2,firstTickIndex:0};const a=To(t,e,i,n,s);if(!Number.isFinite(a))return{ticks:[],count:0,firstTickIndex:void 0};let o=t,l=e;u0(o/a,1e-12)||(o=Math.ceil(o/a)*a),u0(l/a,1e-12)||(l=Math.floor(l/a)*a),r!=null&&(r=Vu(r,[t,e],[o,l]));const{ticks:c}=Gu(o,l,a,r),h=c.at(0);return{ticks:c,count:d0(o,l,a),firstTickIndex:h==null?void 0:Math.round((h-o)/a)}}var TT=Math.floor(2*n0/of*10)/10;function g0({timeInterval:t,step:e}){const i=Fi(t)*e,n=dc(t),s=n?Fi(n):void 0;return i<=(s??1/0)*TT}function gf(t,{weekStart:e}){if(t.unit==="day"&&t.step===7)return e}function gc(t,e,i,n,s,{weekStart:r,primaryOnly:a=!1,targetInterval:o}){if(i<=0)return;const l=o??Math.abs(e-t)/Math.max(i,1),c=zu.findLast(g=>(!a||g0(g))&&l>g.duration),h=zu.find(g=>(!a||g0(g))&&l<=g.duration);if(c==null)return{unit:"millisecond",step:Math.max(To(t,e,i,n,s),1)};if(h==null)return{unit:"year",step:o==null?To(t/lc,e/lc,i,n,s):1};const{timeInterval:u,step:d}=l-c.duration<h.duration-l?c:h;return{unit:u.unit,step:mr(u)*d,epoch:gf(u,{weekStart:r})}}function To(t,e,i,n=0,s=1/0){if(t===e)return te(1,n,s);if(i<1)return Number.NaN;const r=Math.abs(e-t),a=10**Math.floor(Math.log10(r/i));let o=Number.NaN,l=1/0,c=!1;for(const h of h0){const u=Math.ceil(r/(h*a)),d=u>=n&&u<=s;if(c&&!d)continue;const g=Math.abs(u-i);(l>g||c!==d)&&(c||(c=d),l=g,o=h)}return o*a}function p0(t){for(let e=t.length-1;e>=0;e-=1)if(t[e]!=="0")return e+1;return 0}function LT(t,e){const i=_h(e??",f");if(i==null)return;(i.precision==null||Number.isNaN(i.precision))&&(!i.type||"eEFgGnprs".includes(i.type)?i.precision=Math.max(...t.map(s=>{if(!Number.isFinite(s))return 0;const[r,a]=s.toExponential((i.type?6:12)-1).split(/[.e]/g);return(r!=="1"&&r!=="-1"?1:0)+p0(a)+1})):"f%".includes(i.type)&&(i.precision=Math.max(...t.map(s=>{if(!Number.isFinite(s)||s===0)return 0;const r=Math.floor(Math.log10(Math.abs(s))),a=i.type?6:12,o=s.toExponential(a-1).split(/[.e]/g)[1],l=p0(o);return Math.max(0,l-r)}))));const n=Ug(i);return s=>n(Number(s))}function Gu(t,e,i,n){if(!Number.isFinite(i)||i<=0)return{ticks:[],count:0,firstTickIndex:void 0};if(t===e)return{ticks:[t],count:1,firstTickIndex:0};const s=10**Lh(i),r=Math.min(t,e),a=Math.max(t,e);let o,l;if(n!=null&&(n[0]!==0||n[1]!==1)){const u=e-t,d=t+u*n[0],g=e-u*(1-n[1]);o=Math.min(d,g),l=Math.max(d,g)}else o=r,l=a;o=Math.floor(o*s)/s,l=Math.ceil(l*s)/s;const c=[];for(let u=0;;u+=1){const d=Math.round((r+i*u)*s)/s;if(d>a)break;d>=o&&d<=l&&c.push(d)}const h=c.at(0);return{ticks:c,count:d0(r,a,i),firstTickIndex:h==null?void 0:Math.round((h-r)/i)}}function Lo(t,e){return t>=e?(vi("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0):!1}function pf(t,e){const i=Math.abs(e-t),n=10**Math.floor(Math.log10(i));let s=1/0,r=[t,e];for(const a of h0){const o=a*n,l=Math.floor(t/o)*o,c=Math.ceil(e/o)*o,h=1-i/Math.abs(c-l);s>h&&(s=h,r=[l,c])}return r}function f0(t,e,i,n,s,r){if(t<=0)return{minTickCount:0,maxTickCount:0,tickCount:0};r=Math.max(r,t/(s+1)),i??(i=r),n??(n=t),i>n&&(i===r?i=n:n=i),i=Math.max(i,1);const a=Math.max(1,Math.floor(t/(e*i))),o=Math.min(a,Math.ceil(t/(e*n))),l=te(o,Math.floor(s/e),a);return{minTickCount:o,maxTickCount:a,tickCount:l}}function Xt(t){return t instanceof Date?t.getTime():t}function pc(t){return t<Mo?"millisecond":t<pr?"second":t<sa?"minute":t<sa*23?"hour":t<28*ra?"day":t<lc?"month":"year"}function ff(t){if(t.length===0)return"millisecond";if(t.length===1)return ju(t[0]);let e=1/0;for(let i=1;i<t.length;i++)e=Math.min(e,Math.abs(t[i].valueOf()-t[i-1].valueOf()));return pc(e)}function ju(t){return Pi("second",t)<t?"millisecond":Pi("minute",t)<t?"second":Pi("hour",t)<t?"minute":Pi("day",t)<t?"hour":Pi("month",t)<t?"day":Pi("year",t)<t?"month":"year"}function mf(t){const[e,i]=t.length===0?[0,0]:At([t[0].valueOf(),t.at(-1).valueOf()]),n=new Date(e).getFullYear(),s=new Date(i).getFullYear();if(n!==s)return;const r=new Date(e).getMonth(),a=new Date(i).getMonth();if(r!==a)return"year";const o=new Date(e).getDate(),l=new Date(i).getDate();return o!==l?"month":"day"}function yf(){const t=new Map;return e=>{const i=t.get(e);return i?(t.set(e,i+1),`${e}_${i}`):(t.set(e,1),e)}}function bf(t){return t!=null&&Object.hasOwn(t,"toString")&&ot(t.toString())}function m0(t){return t!=null&&Object.hasOwn(t,"valueOf")&&Ee(t.valueOf())}function Hu(t){return Ee(t)||Ol(t)||m0(t)}function y0(t,e){return t!=null&&(!e||Hu(t))}function $u(t){return bf(t)&&Object.hasOwn(t,"id")?t.id:t}function vf(t){return bf(t)&&Object.hasOwn(t,"value")?t.value:t}var aa={};wi(aa,{add:()=>NT,angle:()=>FT,apply:()=>UT,distance:()=>ET,distanceSquared:()=>RT,equal:()=>HT,from:()=>$T,gradient:()=>_T,intercept:()=>BT,intersectAtX:()=>GT,intersectAtY:()=>zT,length:()=>Uu,lengthSquared:()=>b0,multiply:()=>OT,normalized:()=>PT,origin:()=>v0,required:()=>WT,rotate:()=>VT,round:()=>jT,sub:()=>xf});function NT(t,e){return typeof e=="number"?{x:t.x+e,y:t.y+e}:{x:t.x+e.x,y:t.y+e.y}}function xf(t,e){return typeof e=="number"?{x:t.x-e,y:t.y-e}:{x:t.x-e.x,y:t.y-e.y}}function OT(t,e){return typeof e=="number"?{x:t.x*e,y:t.y*e}:{x:t.x*e.x,y:t.y*e.y}}function Uu(t){return Math.hypot(t.x,t.y)}function b0(t){return t.x*t.x+t.y*t.y}function ET(t,e){return Uu(xf(t,e))}function RT(t,e){return b0(xf(t,e))}function PT(t){const e=Uu(t);return{x:t.x/e,y:t.y/e}}function FT(t,e){return e==null?Math.atan2(t.y,t.x):Math.atan2(t.y,t.x)-Math.atan2(e.y,e.x)}function VT(t,e,i=v0()){const n=Uu(t);return{x:i.x+n*Math.cos(e),y:i.y+n*Math.sin(e)}}function _T(t,e,i){const n=e.x-t.x;return(i==null?e.y-t.y:i-e.y-(i-t.y))/n}function BT(t,e,i){return(i==null?t.y:i-t.y)-e*t.x}function zT(t,e,i=0,n){return{x:t===1/0?1/0:(i-e)/t,y:n==null?i:n-i}}function GT(t,e,i=0,n){const s=t===1/0?1/0:t*i+e;return{x:i,y:n==null?s:n-s}}function jT(t,e=2){return{x:Th(t.x,e),y:Th(t.y,e)}}function HT(t,e){return t.x===e.x&&t.y===e.y}function $T(t,e){if(typeof t=="number")return{x:t,y:e};if("currentX"in t)return{x:t.currentX,y:t.currentY};if("offsetWidth"in t)return{x:t.offsetWidth,y:t.offsetHeight};if("width"in t)return[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y+t.height}];if("x1"in t)return[{x:t.x1,y:t.y1},{x:t.x2,y:t.y2}];throw new Error(`Values can not be converted into a vector: [${JSON.stringify(t)}] [${e}]`)}function UT(t,e){return t.x=e.x,t.y=e.y,t}function WT(t){return{x:t?.x??0,y:t?.y??0}}function v0(){return{x:0,y:0}}var oa={};wi(oa,{bottomCenter:()=>qT,center:()=>XT,clone:()=>tL,collides:()=>iL,end:()=>YT,from:()=>nL,height:()=>QT,normalise:()=>Wu,origin:()=>sL,round:()=>eL,start:()=>KT,topCenter:()=>ZT,width:()=>JT});function KT(t){return{x:t.x1,y:t.y1}}function YT(t){return{x:t.x2,y:t.y2}}function ZT(t){return{x:(t.x1+t.x2)/2,y:Math.min(t.y1,t.y2)}}function XT(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function qT(t){return{x:(t.x1+t.x2)/2,y:Math.max(t.y1,t.y2)}}function JT(t){return Math.abs(t.x2-t.x1)}function QT(t){return Math.abs(t.y2-t.y1)}function eL(t){return{x1:Math.round(t.x1),y1:Math.round(t.y1),x2:Math.round(t.x2),y2:Math.round(t.y2)}}function tL(t){return{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}}function iL(t,e){const i=Wu(t),n=Wu(e);return i.x1<=n.x2&&i.x2>=n.x1&&i.y1<=n.y2&&i.y2>=n.y1}function Wu(t){return{x1:Math.min(t.x1,t.x2),x2:Math.max(t.x1,t.x2),y1:Math.min(t.y1,t.y2),y2:Math.max(t.y1,t.y2)}}function nL(t,e,i,n){if(typeof t=="number")return{x1:t,y1:e,x2:i,y2:n};if("width"in t)return Wu({x1:t.x,y1:t.y,x2:t.x+t.width,y2:t.y+t.height});throw new Error(`Values can not be converted into a vector4: [${JSON.stringify(t)}] [${e}] [${i}] [${n}]`)}function sL(){return{x1:0,y1:0,x2:0,y2:0}}function qi(t){return he(t)&&t.type=="gradient"}function rL(t){return ce(t)&&t.every(qi)}function x0(t){return ce(t)&&t.every(e=>typeof e=="string")}function As(t){return t!==null&&he(t)&&t.type=="pattern"}function la(t){return t!==null&&he(t)&&t.type=="image"}function aL(t){return qi(t)||As(t)}function No(t,e,i,n,s){return(1-s)**3*t+3*(1-s)**2*s*e+3*(1-s)*s**2*i+s**3*n}function Ku(t,e,i,n,s){if(s<=Math.min(t,n))return t<n?0:1;if(s>=Math.max(t,n))return t<n?1:0;let r=0,a=1,o=Number.NaN;for(let l=0;l<12;l+=1)o=(r+a)/2,No(t,e,i,n,o)<s?r=o:a=o;return o}function fc(t,e,i,n,s,r,a,o,l){const c=(1-l)*t+l*i,h=(1-l)*e+l*n,u=(1-l)*i+l*s,d=(1-l)*n+l*r,g=(1-l)*s+l*a,p=(1-l)*r+l*o,f=(1-l)*c+l*u,m=(1-l)*h+l*d,y=(1-l)*u+l*g,b=(1-l)*d+l*p,v=(1-l)*f+l*y,S=(1-l)*m+l*b;return[[{x:t,y:e},{x:c,y:h},{x:f,y:m},{x:v,y:S}],[{x:v,y:S},{x:y,y:b},{x:g,y:p},{x:a,y:o}]]}function S0(t,e,i,n){const s=-t+3*e-3*i+n,r=2*(t-2*e+i),a=-t+e;if(s===0){if(r!==0){const l=-a/r;if(l>0&&l<1)return[l]}return[]}const o=r*r-4*s*a;if(o>=0){const l=Math.sqrt(o),c=(-r+l)/(2*s),h=(-r-l)/(2*s);return[c,h].filter(u=>u>0&&u<1)}return[]}function M0(t,e,i,n,s,r,a,o){const l=S0(t,i,s,a),c=S0(e,n,r,o);return[...l,...c]}function Sf(t,e,i){const n=No(t[0].x,t[1].x,t[2].x,t[3].x,.5),s=No(t[0].y,t[1].y,t[2].y,t[3].y,.5),r=Math.hypot(n-e,s-i),a=Math.min(Math.hypot(t[0].x-e,t[0].y-i),Math.hypot(t[1].x-e,t[1].y-i),Math.hypot(t[2].x-e,t[2].y-i),Math.hypot(t[3].x-e,t[3].y-i));return{points:t,distance:r,minDistance:a}}function I0(t,e,i,n,s,r,a,o,l,c,h=1){let d={value:Sf([{x:t,y:e},{x:i,y:n},{x:s,y:r},{x:a,y:o}],l,c),next:null},g;for(;d!=null;){const{points:p,distance:f,minDistance:m}=d.value;if(d=d.next,(g==null||f<g.distance)&&(g={distance:f,minDistance:m}),g!=null&&g.distance-m<=h)continue;const[y,b]=fc(p[0].x,p[0].y,p[1].x,p[1].y,p[2].x,p[2].y,p[3].x,p[3].y,.5),v=[Sf(y,l,c),Sf(b,l,c)].sort(D0);d=Xx(d,v,D0)}return g?.distance??1/0}var D0=(t,e)=>e.minDistance-t.minDistance;function oL({point:t,anchor:e},i,n,s,r){if(t.size===0)return!1;let a=t.x,o=t.y;e!=null&&(a-=(e.x-.5)*t.size,o-=(e.y-.5)*t.size);let l=a;a<i?l=i:a>i+s&&(l=i+s);let c=o;o<n?c=n:o>n+r&&(c=n+r);const h=a-l,u=o-c;return Math.hypot(h,u)<=t.size/2}function C0(t){return t!=null&&typeof t.point=="object"&&typeof t.label=="object"}var lL={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 A0(t,e,i=5){const n=new Map,s=[],r=new Map(Array.from(t.entries(),([o,l])=>[o,l.toSorted((c,h)=>h.point.size-c.point.size)])),a=[...r.values()].flat();for(const[o,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:g,label:p,anchor:f}=d,{text:m,width:y,height:b}=p,v=g.size/2;let S=0,M=0;if(v>0&&d.placement!=null){const A=lL[d.placement];S=(y/2+v+i)*A.x,M=(b/2+v+i)*A.y}let C=g.x-y/2+S,D=g.y-b/2+M;if(f&&(C-=(f.x-.5)*g.size,D-=(f.y-.5)*g.size),tc(e,C,D,y,b)&&!a.some(A=>oL(A,C,D,y,b))&&!s.some(A=>Cu(A,C,D,y,b))){const A={index:h,text:m,x:C,y:D,width:y,height:b,datum:d};c.push(A),s.push(A)}}n.set(o,c)}}return n}function w0(t){return t.type==="continuous"||t.type==="log"}function k0(t){return t.type==="category"}function yr(t){return"variant"in t&&t.variant==="unit-time"}function T0(t){return!("variant"in t)}function ca(t,e){return t===void 0||e===void 0?t!==void 0||e!==void 0:w0(t)&&w0(e)?t.type===e.type&&jn(t.domain,e.domain)&&jn(t.range,e.range):k0(t)&&k0(e)?yr(t)&&yr(e)?t.firstBandTime===e.firstBandTime&&t.lastBandTime===e.lastBandTime&&t.bandCount===e.bandCount&&t.intervalMs===e.intervalMs&&t.inset===e.inset&&t.step===e.step:T0(t)&&T0(e)?t.inset===e.inset&&t.step===e.step&&jn(t.domain,e.domain):!1:!1}function mc(t){return t==null?!1:t.type==="category"?yr(t)?Number.isFinite(t.firstBandTime)&&Number.isFinite(t.lastBandTime)&&Number.isFinite(t.bandCount)&&t.bandCount>0:t.domain.every(e=>e!=null):t.domain.every(e=>Number.isFinite(e)||e instanceof Date)&&t.range.every(e=>Number.isFinite(e))}function Di(t){switch(t.type){case"linear":case"step":case"multi-line":return[{x:t.x0,y:t.y0},{x:t.x1,y:t.y1}];case"cubic":return[{x:t.cp0x,y:t.cp0y},{x:t.cp3x,y:t.cp3y}]}}function cL(t){const e=Di(t);return e[0].x>e[1].x&&e.reverse(),e}function Yu(t,e){const{x:i,y:n}=e;switch(t.type){case"linear":return{type:"linear",moveTo:t.moveTo,x0:i,y0:n,x1:i,y1:n};case"step":return{type:"step",moveTo:t.moveTo,x0:i,y0:n,x1:i,y1:n,stepX:i};case"cubic":return{type:"cubic",moveTo:t.moveTo,cp0x:i,cp0y:n,cp1x:i,cp1y:n,cp2x:i,cp2y:n,cp3x:i,cp3y:n};case"multi-line":return{type:"multi-line",moveTo:t.moveTo,x0:i,y0:n,x1:i,y1:n,midPoints:t.midPoints.map(()=>({x:i,y:n}))}}}function Oo(t,e,i){const[n,s]=Di(t),r=s.x===n.x?0:(i.x-e.x)/(s.x-n.x),a=s.y===n.y?0:(i.y-e.y)/(s.y-n.y);switch(t.type){case"linear":return{type:"linear",moveTo:t.moveTo,x0:e.x,y0:e.y,x1:i.x,y1:i.y};case"cubic":return{type:"cubic",moveTo:t.moveTo,cp0x:e.x,cp0y:e.y,cp1x:i.x-(t.cp2x-n.x)*r,cp1y:i.y-(t.cp2y-n.y)*a,cp2x:i.x-(t.cp1x-n.x)*r,cp2y:i.y-(t.cp1y-n.y)*a,cp3x:i.x,cp3y:i.y};case"step":return{type:"step",moveTo:t.moveTo,x0:e.x,y0:e.y,x1:i.x,y1:i.y,stepX:i.x-(t.stepX-n.x)*r};case"multi-line":return{type:"multi-line",moveTo:t.moveTo,x0:e.x,y0:e.y,x1:i.x,y1:i.y,midPoints:t.midPoints.map(o=>({x:e.x+(o.x-n.x)*r,y:e.y+(o.y-n.y)*a}))}}}function Mf(t,e,i){const{moveTo:n}=t,[s,r]=cL(t),{x:a,y:o}=s,{x:l,y:c}=r;if(i<a)return Oo(t,s,s);if(e>l)return Oo(t,r,r);switch(t.type){case"linear":{const h=o===c?void 0:(c-o)/(l-a),u=h==null?o:h*(e-a)+o,d=h==null?o:h*(i-a)+o;return{type:"linear",moveTo:n,x0:e,y0:u,x1:i,y1:d}}case"step":if(i<=t.stepX){const h=t.y0;return{type:"step",moveTo:n,x0:e,y0:h,x1:i,y1:h,stepX:i}}else if(e>=t.stepX){const h=t.y1;return{type:"step",moveTo:n,x0:e,y0:h,x1:i,y1:h,stepX:e}}else{const{y0:h,y1:u,stepX:d}=t;return{type:"step",moveTo:n,x0:e,y0:h,x1:i,y1:u,stepX:d}}case"cubic":{const h=Ku(t.cp0x,t.cp1x,t.cp2x,t.cp3x,e);let[u,d]=fc(t.cp0x,t.cp0y,t.cp1x,t.cp1y,t.cp2x,t.cp2y,t.cp3x,t.cp3y,h);const g=Ku(d[0].x,d[1].x,d[2].x,d[3].x,i);return[d,u]=fc(d[0].x,d[0].y,d[1].x,d[1].y,d[2].x,d[2].y,d[3].x,d[3].y,g),{type:"cubic",moveTo:n,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}}case"multi-line":{const{midPoints:h}=t,u=h.findLastIndex(C=>C.x<=e);let d=h.findIndex(C=>C.x>=i);d===-1&&(d=h.length);const g=u>=0?h[u]:void 0,p=g?.x??a,f=g?.y??o,m=d<h.length?h[d]:void 0,y=m?.x??l,b=m?.y??c,v=f===b?void 0:(b-f)/(y-p),S=v==null?f:v*(p-a)+f,M=v==null?f:v*(y-a)+f;return{type:"multi-line",moveTo:n,x0:e,y0:S,x1:i,y1:M,midPoints:h.slice(Math.max(u,0),d)}}}}var L0=(t=>(t[t.MoveTo=0]="MoveTo",t[t.LineTo=1]="LineTo",t[t.Skip=2]="Skip",t))(L0||{});function N0(t){const e=[];let i=0,n=Number.NaN,s=Number.NaN;for(const{x:r,y:a}of t){if(i>0){const o=i===1;e.push({type:"linear",moveTo:o,x0:n,y0:s,x1:r,y1:a})}i+=1,n=r,s=a}return e}var hL={start:0,middle:.5,end:1};function O0(t,e){const i=[];let n=0,s=Number.NaN,r=Number.NaN;const a=typeof e=="number"?e:hL[e];for(const{x:o,y:l}of t){if(n>0){const c=n===1,h=s+(o-s)*a;i.push({type:"step",moveTo:c,x0:s,y0:r,x1:o,y1:l,stepX:h})}n+=1,s=o,r=l}return i}function E0(t,e){const i=Array.isArray(t)?t:Array.from(t);if(i.length<=1)return[];const n=.05,s=i.map((a,o)=>{const l=o===0?a:i[o-1],c=o===i.length-1?a:i[o+1],h=o===0||o===i.length-1;if(Math.sign(l.y-a.y)===Math.sign(c.y-a.y))return 0;if(!h){const u=Math.abs(l.y-c.y),d=Math.abs(a.y-l.y)/u,g=Math.abs(a.y-c.y)/u;if(d<=n||1-d<=n||g<=n||1-g<=n)return 0}return(c.y-l.y)/(c.x-l.x)});s[1]===0&&(s[0]*=2),s.at(-2)===0&&(s[s.length-1]*=2);const r=[];for(let a=1;a<i.length;a+=1){const o=i[a-1],l=s[a-1],c=i[a],h=s[a],u=c.x-o.x,d=c.y-o.y;let g=u*e/3,p=u*l*e/3,f=u*e/3,m=u*h*e/3;h===0&&Math.abs(p)>Math.abs(d)&&(g*=Math.abs(d/p),p=Math.sign(p)*Math.abs(d)),l===0&&Math.abs(m)>Math.abs(d)&&(f*=Math.abs(d/m),m=Math.sign(m)*Math.abs(d)),r.push({type:"cubic",moveTo:a===1,cp0x:o.x,cp0y:o.y,cp1x:o.x+g,cp1y:o.y+p,cp2x:c.x-f,cp2y:c.y-m,cp3x:c.x,cp3y:c.y})}return r}var If=0,Df=1;function yc(t){return{x:{min:t?.x?.min??If,max:t?.x?.max??Df},y:{min:t?.y?.min??If,max:t?.y?.max??Df}}}function bc(t,e){if(e==="x")return t?.x;if(e==="y")return t?.y}function ts(t){let e,i;for(const n of Object.keys(t)){const s=t[n];s&&(s.direction==="x"?e??(e={min:s.min,max:s.max}):s.direction==="y"&&(i??(i={min:s.min,max:s.max})))}if(e||i)return{x:e,y:i}}var Cf=class extends Te{constructor(){super(...arguments),this._dirty=!0}markDirty(){this._dirty=!0}markClean(t){this._dirty=!1}isDirty(){return this._dirty}onChangeDetection(t){this.markDirty()}},Zu={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 Af(t,e=new Date(t.getFullYear(),0,1)){const i=t.getTimezoneOffset()-e.getTimezoneOffset(),n=t.getTime()-e.getTime()+i*6e4,s=36e5*24;return Math.floor(n/s)}function R0(t,e){const n=new Date(t.getFullYear(),0,1).getDay(),s=(e-n+7)%7,r=new Date(t.getFullYear(),0,s+1);return r<=t?Math.floor(Af(t,r)/7)+1:0}var uL=0,P0=1,F0=4;function V0(t,e=t.getFullYear()){const n=new Date(e,0,1).getDay(),s=(F0-n+7)%7,r=new Date(e,0,s-(F0-P0)+1);return r<=t?Math.floor(Af(t,r)/7)+1:V0(t,e-1)}function dL(t){const e=t.getTimezoneOffset(),i=Math.abs(e);return`${e>0?"-":"+"}${qt(Math.floor(i/60),2,"0")}${qt(Math.floor(i%60),2,"0")}`}var gL={a:t=>Zu.shortDays[t.getDay()],A:t=>Zu.days[t.getDay()],b:t=>Zu.shortMonths[t.getMonth()],B:t=>Zu.months[t.getMonth()],c:"%x, %X",d:(t,e)=>qt(t.getDate(),2,e??"0"),e:"%_d",f:(t,e)=>qt(t.getMilliseconds()*1e3,6,e??"0"),H:(t,e)=>qt(t.getHours(),2,e??"0"),I:(t,e)=>{const i=t.getHours()%12;return i===0?"12":qt(i,2,e??"0")},j:(t,e)=>qt(Af(t)+1,3,e??"0"),m:(t,e)=>qt(t.getMonth()+1,2,e??"0"),M:(t,e)=>qt(t.getMinutes(),2,e??"0"),L:(t,e)=>qt(t.getMilliseconds(),3,e??"0"),p:t=>t.getHours()<12?"AM":"PM",Q:t=>String(t.getTime()),s:t=>String(Math.floor(t.getTime()/1e3)),S:(t,e)=>qt(t.getSeconds(),2,e??"0"),u:t=>{let e=t.getDay();return e<1&&(e+=7),String(e%7)},U:(t,e)=>qt(R0(t,uL),2,e??"0"),V:(t,e)=>qt(V0(t),2,e??"0"),w:(t,e)=>qt(t.getDay(),2,e??"0"),W:(t,e)=>qt(R0(t,P0),2,e??"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(t,e)=>qt(t.getFullYear()%100,2,e??"0"),Y:(t,e)=>qt(t.getFullYear(),4,e??"0"),Z:t=>dL(t),"%":()=>"%"},pL={_:" ",0:"0","-":""};function qt(t,e,i){const n=String(Math.floor(t));return n.length>=e?n:`${i.repeat(e-n.length)}${n}`}function Eo(t){const e=[];for(;t.length>0;){let i=t.indexOf("%");if(i!==0){const o=i>0?t.substring(0,i):t;e.push(o)}if(i<0)break;const n=t[i+1],s=pL[n];s!=null&&i++;const r=t[i+1],a=gL[r];if(typeof a=="function")e.push([a,s]);else if(typeof a=="string"){const o=Eo(a);e.push([o,s])}else e.push(`${s??""}${r}`);t=t.substring(i+2)}return i=>{const n=typeof i=="number"?new Date(i):i;return e.map(s=>typeof s=="string"?s:s[0](n,s[1])).join("")}}function fL(t,e){const i=ve("button",Xu("ag-charts-input ag-charts-button",e));return t.label===void 0?(i.append(_0(t.icon)),i.ariaLabel=t.altText):i.append(t.label),i.addEventListener("click",t.onPress),qr(i,e),i}function mL(t,e){const i=ve("input",Xu("ag-charts-input ag-charts-checkbox",e));return i.type="checkbox",i.checked=t.checked,i.addEventListener("change",n=>t.onChange(i.checked,n)),i.addEventListener("keydown",n=>{Yp(n)&&(n.preventDefault(),i.click())}),qr(i,e),i}function yL(t,e){const i=ve("select",Xu("ag-charts-input ag-charts-select",e));return i.append(...t.options.map(n=>{const s=ve("option");return s.value=n.value,s.textContent=n.label,s})),Me(i,"data-preventdefault",!1),i.value=t.value,i.addEventListener("change",n=>t.onChange(i.value,n)),qr(i,e),i}function bL(t,e){const i=ve("textarea",Xu("ag-charts-input ag-charts-textarea",e));return i.value=t.value,i.addEventListener("input",n=>t.onChange(i.value,n)),qr(i,e),Me(i,"data-preventdefault",!1),i}function _0(t){const e=ve("span",`ag-charts-icon ag-charts-icon-${t}`);return Me(e,"aria-hidden",!0),e}function Xu(t,e){return e==null?t:`${t} ${e.class}`}var B0=t=>t,vL=t=>1-Math.cos(t*Math.PI/2),vc=t=>Math.sin(t*Math.PI/2),xL=t=>-(Math.cos(t*Math.PI)-1)/2,SL=t=>t*t,ML=t=>1-(1-t)**2,IL=t=>t<.5?2*t*t:1-(-2*t+2)**2/2,z0=t=>2*Math.asin(t)/Math.PI,Ro=(t,e)=>t===e;function Z(t){return function(e,i){const n=`__${i}`;e[i]||kf(e,i,n,t)}}function qu(t){return Z(t)}function ha(t){return Z(t)}function wf(t){const e=t??{};return e.equals=jn,Z(t)}function We(t){return function(e,i){const n=`__${i}`;e[i]||kf(e,i,n,t)}}function xc(t){return function(e,i){const n=`__${i}`;e[i]||kf(e,i,n,t)}}function kf(t,e,i,n){const{changeCb:s,convertor:r,checkDirtyOnAssignment:a=!1}=n??{},o={changeCb:s,checkDirtyOnAssignment:a,convertor:r},l=AL(i,CL(DL(wL(i,o),o),o),o);function c(){return this[i]}Object.defineProperty(t,e,{set:l,get:c,enumerable:!0,configurable:!0})}function DL(t,e){const{convertor:i}=e;if(i){let s=function(a){t.call(this,r(a))};var n=s;const r=i;return s}return t}var G0=Symbol("no-change");function CL(t,e){const{changeCb:i}=e;if(i){let s=function(a){const o=t.call(this,a);return o!==G0&&r.call(this,this),o};var n=s;const r=i;return s}return t}function AL(t,e,i){const{checkDirtyOnAssignment:n}=i;if(n){let r=function(a){const o=e.call(this,a);return a?._dirty===!0&&this.markDirty(t),o};var s=r;return r}return e}function wL(t,e){const{equals:i=Ro}=e;function n(s){const r=this[t];return i(s,r)?G0:(this[t]=s,this.onChangeDetection(t),s)}return n}var j0=lt(je,je),kL=De({...B,...$,...W,marker:Js}),H0={showInMiniChart:T,connectMissingData:T,interpolation:Xh,label:Fe,styler:kL,marker:kn,tooltip:ex,shadow:qn,...Se,...$,...B,...W,highlight:j0,segmentation:ao},Tf={...H0,...wn,highlight:j0,type:X(Ge("area")),xKey:X(N),yKey:X(N),xKeyAxis:N,yKeyAxis:N,xName:N,yName:N,legendItemName:N,stacked:T,stackGroup:N,normalizedTo:P};Tf.selectedKey=J(N);var $0=lt(Dn,Dn),U0=De({...$,...B,...W,cornerRadius:k}),Lf={direction:V("horizontal","vertical"),showInMiniChart:T,cornerRadius:k,styler:U0,itemStyler:U0,crisp:T,label:{...Fe,placement:V("inside-center","inside-start","inside-end","outside-start","outside-end"),spacing:k},errorBar:Wl,shadow:qn,tooltip:Ae,...Se,highlight:$0,...$,...B,...W,segmentation:ao,width:Zn,widthRatio:q};Lf.sparklineMode=J(T);var Po={...Lf,...wn,highlight:$0,type:X(Ge("bar")),xKey:X(N),yKey:X(N),xKeyAxis:N,yKeyAxis:N,xName:N,yName:N,direction:V("horizontal","vertical"),grouped:T,stacked:T,stackGroup:N,normalizedTo:P,legendItemName:N,errorBar:Zh};Po.yFilterKey=J(N),Po.pickOutsideVisibleMinorAxis=J(T),Po.focusPriority=J(P),Po.simpleItemStyler=J(Re);var W0=lt(je,Xs),TL=De({...B,...W,marker:Js}),Nf={title:N,showInMiniChart:T,connectMissingData:T,interpolation:Xh,label:Fe,styler:TL,marker:kn,tooltip:Ae,errorBar:Wl,...Se,...B,...W,highlight:W0,segmentation:Kv};Nf.sparklineMode=J(T);var Sc={...Nf,...wn,highlight:W0,type:X(Ge("line")),xKey:X(N),yKey:X(N),xKeyAxis:N,yKeyAxis:N,xName:N,yName:N,stacked:T,stackGroup:N,normalizedTo:P,legendItemName:N,errorBar:Zh};Sc.selectedKey=J(N),Sc.pickOutsideVisibleMinorAxis=J(T),Sc.focusPriority=J(P);var Ye="13.3.0",K0={title:{enabled:!1},label:{enabled:!1},line:{enabled:!1},gridLine:{enabled:!1},crosshair:{enabled:!1,stroke:gu,lineDash:[0],label:{enabled:!1}}},Of={...K0,nice:!1},Ju={mode:"compact",position:{anchorTo:"node",placement:["right","left"]},showArrow:!1},Ef={style:[{stroke:{$ref:"gridLineColor"}}],width:2},LL={number:{gridLine:Ef},time:{gridLine:Ef},category:{gridLine:Ef}},NL={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:{...Of,interval:{values:[0]}},log:{...Of},time:{...Of},category:{...K0}}},bar:{series:{crisp:!1,label:{placement:"inside-end",padding:4},sparklineMode:!0},tooltip:{...Ju,position:{...Ju.position,anchorTo:"pointer"},range:"nearest"},axes:LL},line:{seriesArea:{padding:{top:2,right:2,bottom:2,left:2}},series:{sparklineMode:!0,strokeWidth:1,marker:{enabled:!1,size:3}},tooltip:Ju},area:{seriesArea:{padding:{top:1,right:0,bottom:1,left:0}},series:{strokeWidth:1,fillOpacity:.4},tooltip:Ju}}},Y0=Eu(OL);function OL(t,e){return typeof t=="string"?{...e,baseTheme:t}:t!=null?{...t,baseTheme:Y0(t.baseTheme,e)}:e}function Z0(t){if(Array.isArray(t)&&t.length!==0){const e=t.find(i=>i!=null);if(typeof e=="number")return{data:t.map((n,s)=>({x:s,y:n})),series:[{xKey:"x",yKey:"y"}],datumKey:"y"};if(Array.isArray(e))return{data:t.map(n=>({x:n?.[0],y:n?.[1],datum:n})),series:[{xKey:"x",yKey:"y"}],datumKey:"datum"}}else if(t?.length===0)return{data:t,series:[{xKey:"x",yKey:"y"}],datumKey:"y"};return{data:t}}function EL(t){switch(t?.type){case"number":{const{reverse:e,min:i,max:n}=t??{};return{type:"number",reverse:e,min:i,max:n}}case"time":{const{reverse:e,min:i,max:n}=t??{};return{type:"time",reverse:e,min:i,max:n}}case"category":default:{if(t==null)return{type:"category"};const{reverse:e,paddingInner:i,paddingOuter:n}=t;return{type:"category",reverse:e,paddingInner:i,paddingOuter:n}}}}function RL(t,e,i){const n={};return t?.stroke!=null&&(n.style=[{stroke:t?.stroke}],n.enabled??(n.enabled=!0)),t?.strokeWidth!=null&&(n.width=t?.strokeWidth,n.enabled??(n.enabled=!0)),i.type==="bar"&&i.direction!=="horizontal"&&(n.enabled??(n.enabled=!0)),t?.visible!=null&&(n.enabled=t.visible),n.enabled??(n.enabled=e),n}var PL=Eu((t,e,i)=>n=>{const s=n.datum[n.xKey],r=n.datum[n.yKey],a=i==null?n.datum:n.datum[i],o=e?.renderer?.({context:t,datum:a,xValue:s,yValue:r});if(ot(o)||Li(o)||rn(o))return et(o);const l=o?.content??r.toFixed(2);return o?.title?{heading:void 0,title:void 0,data:[{label:o.title,value:l}]}:{heading:void 0,title:l,data:[]}});function FL(t){const{background:e,container:i,foreground:n,height:s,listeners:r,locale:a,minHeight:o,minWidth:l,overrideDevicePixelRatio:c,padding:h,width:u,theme:d,data:g,crosshair:p,axis:f,min:m,max:y,tooltip:b,context:v,styleNonce:S,...M}=t,C={background:e,container:i,foreground:n,height:s,listeners:r,locale:a,minHeight:o,minWidth:l,overrideDevicePixelRatio:c,padding:h,width:u,styleNonce:S},{data:D,series:[A]=[],datumKey:w}=Z0(g),L=M;A!=null&&Object.assign(L,A),L.tooltip={...b,renderer:PL(v,b,w)},C.theme=Y0(d,NL),C.data=D,C.series=[L];const O=L.type==="bar"&&L.direction==="horizontal",[R,_]=O?["left","bottom"]:["bottom","left"],E={...EL(f),position:R,...p==null?{}:{crosshair:p}},F={type:"number",gridLine:RL(f,!1,t),position:_,...m==null?{}:{min:m},...y==null?{}:{max:y}};return C.axes=O?{x:F,y:E}:{x:E,y:F},C}var Rf=["showInLegend","showInMiniChart","grouped","stacked","stackGroup","tooltip","listeners","errorBar","xKey","yKey","type"],Pf={visible:T,reverse:T,stroke:H,strokeWidth:k},Mc={context:()=>!0,tooltip:le,theme:le,background:le,container:le,width:le,height:le,minWidth:le,minHeight:le,padding:le,listeners:le,locale:le,data:le,styleNonce:N,axis:Gl({number:{...Pf,min:Ie(P,xi("max")),max:Ie(P,Si("min"))},category:{...Pf,paddingInner:q,paddingOuter:q},time:{...Pf,min:Ie(se(P,Gt),xi("max")),max:Ie(se(P,Gt),Si("min"))}},"axis options","category"),min:Ie(P,xi("max")),max:Ie(P,Si("min")),crosshair:{enabled:T,snap:T,...B,...W},xKey:N,yKey:N};Mc.overrideDevicePixelRatio=J(P),Mc.foreground=J(le);var X0={type:"preset",name:"sparkline",version:Ye,options:Gl({area:{...Mc,...Y(Tf,Rf)},bar:{...Mc,...Y(Po,Rf)},line:{...Mc,...Y(Sc,Rf)}},"sparkline options"),create:FL,processData:Z0},Qu=class{ticks(t,e,i){}niceDomain(t,e=this.domain){return e}get bandwidth(){}get step(){}get inset(){}},Ic=(t,e)=>{const i=Symbol(String(e));t[i]=void 0,Object.defineProperty(t,e,{get(){return this[i]},set(n){this[i]!==n&&(this[i]=n,this.invalid=!0)},enumerable:!0,configurable:!1})};function VL(t,e,i){if(i==null||i[0]===0&&i[1]===1)return;const n=te(0,Math.floor(i[0]*t.length),t.length),s=te(0,Math.ceil(i[1]*t.length),t.length),r=e?t.length-s:n,a=e?t.length-n:s;return[r,a]}function q0(t,e,i){const n=VL(t,e,i);if(n==null)return{ticks:t,count:t.length,firstTickIndex:0};const[s,r]=n;return{ticks:t.slice(s,r),count:t.length,firstTickIndex:s}}function ed(t){const e=vf(t.at(0)),i=vf(t.at(-1));return e!=null&&i!=null?[e,i]:[void 0,void 0]}var Ff=class VA extends Qu{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(e){return e instanceof VA}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(e){e=te(0,e,1),this._paddingInner=e,this._paddingOuter=e}get padding(){return this._paddingInner}set paddingInner(e){this.invalid=!0,this._paddingInner=te(0,e,1)}get paddingInner(){return this._paddingInner}set paddingOuter(e){this.invalid=!0,this._paddingOuter=te(0,e,1)}get paddingOuter(){return this._paddingOuter}getBandCountForUpdate(){return this.bands.length}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&j.warnOnce("Expected update to not invalidate scale"))}convert(e,i){this.refresh();const n=this.findIndex(e,i?.alignment,i?.alignmentExclusive);return n==null||n<0||n>=this.getBandCountForUpdate()?Number.NaN:this.ordinalRange(n)}getDomainMinMax(){return ed(this.domain)}invertNearestIndex(e){this.refresh();const i=this.getBandCountForUpdate();if(i===0)return-1;let n=0,s=i-1,r=1/0,a=0;for(;n<=s;){const o=Math.trunc((s+n)/2),l=this.ordinalRange(o),c=Math.abs(l-e);if(c===0)return o;c<r&&(r=c,a=o),l<e?n=o+1:s=o-1}return a}update(){const[e,i]=this.range;let{_paddingInner:n}=this;const{_paddingOuter:s}=this,r=this.getBandCountForUpdate();if(r===0)return;const a=i-e;let o;r===1?(n=0,o=a*(1-s*2)):o=a/Math.max(1,r-n+s*2);const l=this.round&&Math.floor(o)>0,c=l?Math.floor(o):o;let h=e+(a-c*(r-n))/2,u=c*(1-n);l&&(h=Math.round(h),u=Math.round(u)),this._step=c,this._inset=h,this._bandwidth=u,this._rawBandwidth=o*(1-n)}ordinalRange(e){const{_inset:i,_step:n,range:s}=this,r=Math.min(s[0],s[1]),a=Math.max(s[0],s[1]);return te(r,i+n*e,a)}};x([Ic],Ff.prototype,"range",2),x([Ic],Ff.prototype,"round",2);var En=Ff,td=Symbol("interpolate"),id=t=>t[td]!=null,Dc=class Sl{constructor(e,i,n,s){this.x=e,this.y=i,this.width=n,this.height=s}static fromObject({x:e,y:i,width:n,height:s}){return new Sl(e,i,n,s)}static merge(e){let i=1/0,n=1/0,s=-1/0,r=-1/0;for(const a of e)a.x<i&&(i=a.x),a.y<n&&(n=a.y),gi(a.x,a.width)>s&&(s=gi(a.x,a.width)),gi(a.y,a.height)>r&&(r=gi(a.y,a.height));return new Sl(i,n,s-i,r-n)}static nearestBox(e,i,n){return Ru(e,i,n)}toDOMRect(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.y,left:this.x,right:gi(this.x,this.width),bottom:gi(this.y,this.height),toJSON(){return{}}}}clone(){const{x:e,y:i,width:n,height:s}=this;return new Sl(e,i,n,s)}equals(e){return Au(this,e)}containsPoint(e,i){return tc(this,e,i)}intersectsWith(e){return!(this.x+this.width<=e.x||e.x+e.width<=this.x||this.y+this.height<=e.y||e.y+e.height<=this.y)}intersection(e){const i=Math.max(this.x,e.x),n=Math.max(this.y,e.y),s=Math.min(gi(this.x,this.width),gi(e.x,e.width)),r=Math.min(gi(this.y,this.height),gi(e.y,e.height));if(!(i>s||n>r))return new Sl(i,n,s-i,r-n)}collidesBBox(e){return this.x<gi(e.x,e.width)&&gi(this.x,this.width)>e.x&&this.y<gi(e.y,e.height)&&gi(this.y,this.height)>e.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(e,i){if(this.containsPoint(e,i))return 0;const n=e-te(this.x,e,gi(this.x,this.width)),s=i-te(this.y,i,gi(this.y,this.height));return n*n+s*s}shrink(e,i){if(typeof e=="number")this.applyMargin(e,i);else for(const n of Object.keys(e)){const s=e[n];typeof s=="number"&&this.applyMargin(s,n)}return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this}grow(e,i){if(typeof e=="number")this.applyMargin(-e,i);else for(const n of Object.keys(e)){const s=e[n];typeof s=="number"&&this.applyMargin(-s,n)}return this}applyMargin(e,i){switch(i){case"top":this.y+=e;case"bottom":this.height-=e;break;case"left":this.x+=e;case"right":this.width-=e;break;case"vertical":this.y+=e,this.height-=e*2;break;case"horizontal":this.x+=e,this.width-=e*2;break;case void 0:this.x+=e,this.y+=e,this.width-=e*2,this.height-=e*2;break}}translate(e,i){return this.x+=e,this.y+=i,this}[td](e,i){return new Sl(this.x*(1-i)+e.x*i,this.y*(1-i)+e.y*i,this.width*(1-i)+e.width*i,this.height*(1-i)+e.height*i)}};Dc.zero=Object.freeze(new Dc(0,0,0,0)),Dc.NaN=Object.freeze(new Dc(Number.NaN,Number.NaN,Number.NaN,Number.NaN));var U=Dc;function gi(t,e){return t===-1/0&&e===1/0?1/0:t+e}function J0({context:t,pixelRatio:e,width:i,height:n}){t.save();try{t.resetTransform(),t.clearRect(0,0,Math.ceil(i*e),Math.ceil(n*e))}finally{t.restore()}}function Q0(t){if(ue.check("canvas")){const e=t.save.bind(t),i=t.restore.bind(t);let n=0;Object.assign(t,{save(){e(),n++},restore(){if(n===0)throw new Error("AG Charts - Unable to restore() past depth 0");i(),n--},verifyDepthZero(){if(n!==0)throw new Error(`AG Charts - Save/restore depth is non-zero: ${n}`)}})}}function eS(t,e,i){return[Math.floor(t*i),Math.floor(e*i)]}var Vf;function _L(){const t=Ch();return Vf??(Vf=new t(1,1)),Vf}var _f=class{constructor(t){const{width:e,height:i,pixelRatio:n,willReadFrequently:s=!1}=t;this.width=e,this.height=i,this.pixelRatio=n;const[r,a]=eS(e,i,n),o=Ch();this.canvas=new o(r,a),this.context=this.canvas.getContext("2d",{willReadFrequently:s}),this.context.setTransform(n,0,0,n,0,0),Q0(this.context)}drawImage(t,e=0,i=0){return t.drawImage(this.canvas,e,i)}transferToImageBitmap(){return this.canvas.width<1||this.canvas.height<1?_L().transferToImageBitmap():this.canvas.transferToImageBitmap()}resize(t,e,i){if(!(t>0&&e>0))return;const{canvas:n,context:s}=this;if(t!==this.width||e!==this.height||i!==this.pixelRatio){const[r,a]=eS(t,e,i);n.width=r,n.height=a}s.setTransform(i,0,0,i,0,0),this.width=t,this.height=e,this.pixelRatio=i}clear(){J0(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)}},Bf=(t,e)=>Math.sign(t-e);function tS(t,e){if(typeof t=="number"&&typeof e=="number")return Bf(t,e);const i=typeof t=="number"?[t]:t,n=typeof e=="number"?[e]:e,s=Math.min(i.length,n.length);for(let r=0;r<s;r+=1){const a=Bf(i[r],n[r]);if(a!==0)return a}return Bf(i.length,n.length)}var iS=(t=>(t[t.All=0]="All",t[t.None=1]="None",t))(iS||{}),BL=5,ua=class kb{constructor(e){this.serialNumber=kb._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=Nn(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=e?.name,this.tag=e?.tag??Number.NaN,this.zIndex=e?.zIndex??0,this.scene=e?.scene,(e?.debugDirty??kb._debugEnabled)&&(this._debugDirtyProperties=new Map([["__first__",[]]]))}static toSVG(e,i,n){const s=e?.toSVG();if(s==null||!s.elements.length&&!s.defs?.length)return;const r=ut("svg");if(r.setAttribute("width",String(i)),r.setAttribute("height",String(n)),r.setAttribute("viewBox",`0 0 ${i} ${n}`),r.setAttribute("overflow","visible"),s.defs?.length){const a=ut("defs");a.append(...s.defs),r.append(a)}return r.append(...s.elements),r.outerHTML}static*extractBBoxes(e,i){for(const n of e)if(!i||n.visible&&!n.transitionOut){const s=n.getBBox();s&&(yield s)}}get datum(){return this._datum}set datum(e){this._datum!==e&&(this._previousDatum=this._datum,this._datum=e)}get previousDatum(){return this._previousDatum}get unsafeNonNullDatum(){return this.datum}get unsafeDatum(){return this.datum}set unsafeDatum(e){this.datum=e}get unsafePreviousDatum(){return this.previousDatum}get layerManager(){return this.scene?.layersManager}get imageLoader(){return this.scene?.imageLoader}closestDatum(){for(const{datum:e}of this.traverseUp(!0))if(e!=null)return e}unsafeClosestDatum(){return this.closestDatum()}preRender(e,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(e){e.ctx.save();try{this.render(e)}catch(i){const n=i.errorCount??1;if(n>=BL)throw i.errorCount=n,i;j.warnOnce("Error during rendering",i,i.stack)}finally{e.ctx.restore()}}render(e){const{stats:i}=e;if(this.debugDirtyProperties(),e.debugNodeSearch){const n=this.name??this.id;e.debugNodeSearch.some(s=>typeof s=="string"?s===n:s.test(n))&&(e.debugNodes[this.name??this.id]=this)}i&&(i.nodesRendered++,i.opsPerformed+=this.childNodeCounts.thisComplexity)}setScene(e){this.scene=e}*traverseUp(e){e&&(yield this);let i=this.parentNode;for(;i;)yield i,i=i.parentNode}isRoot(){return!this.parentNode}removeChild(e){throw new Error(`AG Charts - internal error, unknown child node ${e.name??e.id} in $${this.name??this.id}`)}remove(){this.parentNode?.removeChild(this)}destroy(){this.parentNode&&this.remove()}batchedUpdate(e){this.batchLevel++;try{e()}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}}setProperties(e){this.batchLevel++;try{const i=this,n=e,s=Object.keys(n);for(let r=0,a=s.length;r<a;r++){const o=s[r];i[o]=n[o]}}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}return this}setPropertiesWithKeys(e,i){this.batchLevel++;try{const n=this,s=e;for(let r=0,a=i.length;r<a;r++){const o=i[r];n[o]=s[o]}}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}return this}containsPoint(e,i){return!1}pickNode(e,i){if(!(!this.visible||this.pointerEvents===1)&&this.containsPoint(e,i))return this}pickNodes(e,i,n=[]){return!this.visible||this.pointerEvents===1||this.containsPoint(e,i)&&n.push(this),n}getBBox(){return this.cachedBBox??(this.cachedBBox=Object.freeze(this.computeBBox())),this.cachedBBox}computeBBox(){}onChangeDetection(e){this.markDirty(e)}markDirtyChildrenOrder(){this.cachedBBox=void 0}markDirty(e){if(this.batchLevel>0){this.batchDirty=!0;return}e!=null&&this._debugDirtyProperties&&this.markDebugProperties(e),this.cachedBBox=void 0,this.parentNode?.markDirty()}markDebugProperties(e){const i=this._debugDirtyProperties?.get(e)??[],n=new Error("Stack trace for property change tracking").stack?.split(`
`).filter(s=>s!=="Error"&&!s.includes(".markDebugProperties")&&!s.includes(".markDirty")&&!s.includes("Object.assign ")&&!s.includes(`${this.constructor.name}.`))??"unknown";i.push(n[0].replace(" at ","").trim()),this._debugDirtyProperties?.set(e,i)}debugDirtyProperties(){if(this._debugDirtyProperties!=null){if(!this._debugDirtyProperties.has("__first__"))for(const[e,i]of this._debugDirtyProperties.entries())i.length>1&&j.logGroup(`Property changed multiple times before render: ${this.constructor.name}.${e} (${i.length}x)`,()=>{for(const n of i)j.log(n)});this._debugDirtyProperties.clear()}}static handleNodeZIndexChange(e){e.onZIndexChange()}onZIndexChange(){this.parentNode?.markDirtyChildrenOrder()}resolveFont(){}toSVG(){}};ua.className="AbstractNode",ua._nextSerialNumber=0,ua._debugEnabled=!1,x([We()],ua.prototype,"visible",2),x([We({equals:st,changeCb:ua.handleNodeZIndexChange})],ua.prototype,"zIndex",2);var ws=ua,nS=t=>{const e=Oe.fromString(t),[i,n,s]=Oe.RGBtoOKLCH(e.r,e.g,e.b);return{l:i,c:n,h:s,a:e.a}},zf=1e-6,sS=t=>t.c<zf||t.l<zf||t.l>1-zf,zL=(t,e,i)=>{i=te(0,i,1);let n;if(sS(t))n=e.h;else if(sS(e))n=t.h;else{const o=t.h;let l=e.h;const c=e.h-t.h;c>180?l-=360:c<-180&&(l+=360),n=o*(1-i)+l*i}const s=t.c*(1-i)+e.c*i,r=t.l*(1-i)+e.l*i,a=t.a*(1-i)+e.a*i;return Oe.fromOKLCH(r,s,n,a)},br=class extends Qu{constructor(){super(...arguments),this.type="color",this.defaultTickCount=0,this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.mode="continuous",this.parsedRange=this.range.map(nS)}update(){const{domain:t,range:e}=this;t.length<2&&(j.warnOnce("`colorDomain` should have at least 2 values."),t.length===0?t.push(0,1):t.length===1&&t.push(t[0]+1));for(let n=1;n<t.length;n++){const s=t[n-1],r=t[n];if(s>r){j.warnOnce("`colorDomain` values should be supplied in ascending order."),t.sort((a,o)=>a-o);break}}const i=this.mode==="discrete"?t.length-1:t.length;if(e.length<i)for(let n=e.length;n<i;n++)e.push(e.length>0?e[0]:"black");this.parsedRange=this.range.map(nS)}normalizeDomains(...t){return{domain:t.map(e=>e.domain).flat(),animatable:!0}}toDomain(){}convert(t){this.refresh();const{domain:e,range:i,parsedRange:n}=this,s=e[0],r=e.at(-1),a=i[0],o=i.at(-1);if(t<=s)return a;if(t>=r)return o;let l,c;if(e.length===2){const d=(t-s)/(r-s),g=1/(i.length-1);l=i.length<=2?0:Math.min(Math.floor(d*(i.length-1)),i.length-2),c=(d-l*g)/g}else{for(l=0;l<e.length-2&&!(t<e[l+1]);l++);const d=e[l],g=e[l+1];c=(t-d)/(g-d)}if(this.mode==="discrete")return i[l];const h=n[l],u=n[l+1];return zL(h,u,c).toRgbaString()}invert(){}getDomainMinMax(){return ed(this.domain)}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&j.warnOnce("Expected update to not invalidate scale"))}};x([Ic],br.prototype,"domain",2),x([Ic],br.prototype,"range",2),x([Ic],br.prototype,"mode",2);var Gf=class{constructor(t,e=[],i){this.colorSpace=t,this.stops=e,this.bbox=i,this._cache=void 0}createGradient(t,e,i){const n=this.bbox??e;if(!n.isFinite())return;if(this._cache?.ctx===t&&this._cache.bbox.equals(n))return this._cache.gradient;const{stops:s,colorSpace:r}=this;if(s.length===0)return;if(s.length===1)return s[0].color;let a=this.createCanvasGradient(t,n,i);if(a==null)return;const o=r==="oklch",l=.05;let c=s[0];a.addColorStop(c.stop,c.color);for(let h=1;h<s.length;h+=1){const u=s[h];if(o){const d=new br;d.domain=[c.stop,u.stop],d.range=[c.color,u.color];for(let g=c.stop+l;g<u.stop;g+=l)a.addColorStop(g,d.convert(g)??"transparent")}a.addColorStop(u.stop,u.color),c=u}return"createPattern"in a&&(a=a.createPattern()),this._cache={ctx:t,bbox:n,gradient:a},a}toSvg(t){const e=this.bbox??t,i=this.createSvgGradient(e);for(const{stop:n,color:s}of this.stops){const r=ut("stop");r.setAttribute("offset",`${n}`),r.setAttribute("stop-color",`${s}`),i.appendChild(r)}return i}},GL=class extends Gf{constructor(t,e,i=0,n){super(t,e,n),this.angle=i}createCanvasGradient(t,e,i){const{angle:s}=this,r=Is(s+-90),a=i?.centerX??e.x+e.width*.5,o=i?.centerY??e.y+e.height*.5;return t.createConicGradient(r,a,o)}createSvgGradient(t){return ut("linearGradient")}},jL=class extends Gf{constructor(t,e,i=0,n){super(t,e,n),this.angle=i}getGradientPoints(t){const{angle:i}=this,n=Is(i+90),s=Math.cos(n),r=Math.sin(n),a=t.width,o=t.height,l=t.x+a*.5,c=t.y+o*.5,h=Math.hypot(o,a)/2,u=Math.atan2(o,a);let d;n<Math.PI/2?d=n:n<Math.PI?d=Math.PI-n:n<1.5*Math.PI?d=n-Math.PI:d=2*Math.PI-n;const g=h*Math.abs(Math.cos(d-u));return{x0:l+s*g,y0:c+r*g,x1:l-s*g,y1:c-r*g}}createCanvasGradient(t,e){const{x0:i,y0:n,x1:s,y1:r}=this.getGradientPoints(e);if(!(Number.isNaN(i)||Number.isNaN(n)||Number.isNaN(s)||Number.isNaN(r)))return t.createLinearGradient(i,n,s,r)}createSvgGradient(t){const{x0:e,y0:i,x1:n,y1:s}=this.getGradientPoints(t),r=ut("linearGradient");return r.setAttribute("x1",String(e)),r.setAttribute("y1",String(i)),r.setAttribute("x2",String(n)),r.setAttribute("y2",String(s)),r.setAttribute("gradientUnits","userSpaceOnUse"),r}},HL=class extends Gf{constructor(t,e,i){super(t,e,i)}createCanvasGradient(t,e,i){const n=i?.centerX??e.x+e.width*.5,s=i?.centerY??e.y+e.height*.5,r=i?.innerRadius??0,a=i?.outerRadius??Math.hypot(e.width*.5,e.height*.5)/Math.SQRT2;return t.createRadialGradient(n,s,r,n,s,a)}createSvgGradient(t){const e=t.x+t.width*.5,i=t.y+t.height*.5,n=ut("radialGradient");return n.setAttribute("cx",String(e)),n.setAttribute("cy",String(i)),n.setAttribute("r",String(Math.hypot(t.width*.5,t.height*.5)/Math.SQRT2)),n.setAttribute("gradientUnits","userSpaceOnUse"),n}},Cc=class extends Te{constructor(){super(...arguments),this.color="black"}};x([I],Cc.prototype,"stop",2),x([I],Cc.prototype,"color",2),x([I],Cc.prototype,"name",2);var da=class extends Te{constructor(){super(...arguments),this.fills=new co(Cc),this.mode="continuous"}};x([I],da.prototype,"fills",2),x([I],da.prototype,"domain",2),x([I],da.prototype,"mode",2),x([I],da.prototype,"missingDataFill",2);function $L(t,e){const i=e==="discrete"?1:0,n=t.map((s,r,{length:a})=>({stop:(r+i)/(a-1+i),color:s}));return e==="discrete"?Eg(n):n}function rS(t,e,i,n="continuous"){const s=t.map(d=>typeof d=="string"?{color:d}:d);if(s.length===0)return $L(e,n);const r=Math.min(...i),a=Math.max(...i),l=Ng(s,r,a,n==="discrete");let c=s.find(d=>d.color!=null)?.color,h;const u=s.map((d,g)=>{let p=d?.color;const f=Math.max(0,Math.min(1,(l[g]-r)/(a-r)));return p!=null?c=p:c==null?(h==null&&(h=new br,h.domain=[0,1],h.range=e),p=h.convert(f)):p=c,{stop:f,color:p}});return n==="discrete"?Eg(u):u}var UL=class{constructor(t,e){this.imageLoader=t,this._cache=void 0,this.url=e.url,this.backgroundFill=e.backgroundFill??"black",this.backgroundFillOpacity=e.backgroundFillOpacity??1,this.repeat=e.repeat??"no-repeat",this.width=e.width,this.height=e.height,this.fit=e.fit??"stretch",this.rotation=e.rotation??0}createCanvasImage(t,e,i,n){if(!e)return null;const[s,r]=this.getSize(e.width,e.height,i,n);return s<1||r<1?(j.warnOnce("Image fill is too small to render, ignoring."),null):t.createPattern(e,this.repeat)}getSize(t,e,i,n){const{fit:s}=this;let r=t,a=e,o=1;const l=i/n,c=t/e;return s==="stretch"||t===0||e===0?(r=i,a=n):s==="contain"?o=c>l?i/t:n/e:s==="cover"&&(o=c>l?n/e:i/t),[Math.max(1,r*o),Math.max(1,a*o)]}setImageTransform(t,e){if(typeof t=="string")return;const{url:i,rotation:n,width:s,height:r}=this,a=this.imageLoader?.loadImage(i);if(!a)return;const o=Is(n),l=Math.cos(o),c=Math.sin(o),[h,u]=this.getSize(a.width,a.height,s??e.width,r??e.height),d=h/a.width,g=u/a.height,p=e.x+e.width/2,f=e.y+e.height/2,m=l*h-c*u,y=c*h+l*u,b=m/2,v=y/2,S=Cg();t?.setTransform(new S([l*d,c*g,-c*d,l*g,p-b,f-v]))}createPattern(t,e,i,n){const s=this.width??e,r=this.height??i,a=this._cache;if(a?.ctx===t&&a.width===s&&a.height===r)return a.pattern;const o=this.imageLoader?.loadImage(this.url,n),l=this.createCanvasImage(t,o,s,r);if(l!=null)return this._cache={ctx:t,pattern:l,width:s,height:r},l}toSvg(t,e){const{url:i,rotation:n,backgroundFill:s,backgroundFillOpacity:r}=this,{x:a,y:o,width:l,height:c}=t,h=ut("pattern");h.setAttribute("viewBox",`0 0 ${l} ${c}`),h.setAttribute("x",String(a)),h.setAttribute("y",String(o)),h.setAttribute("width",String(l)),h.setAttribute("height",String(c)),h.setAttribute("patternUnits","userSpaceOnUse");const u=ut("rect");u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(l)),u.setAttribute("height",String(c)),u.setAttribute("fill",s),u.setAttribute("fill-opacity",String(r)),h.appendChild(u);const d=ut("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/e}) rotate(${n}, ${l/2}, ${c/2})`),h.appendChild(d),h}},WL=/^[\t\n\f\r ]*([achlmqstvz])[\t\n\f\r ]*/i,Ke=/^[+-]?((\d*\.\d+)|(\d+\.)|(\d+))(e[+-]?\d+)?/i,KL=/[\t\n\f\r ]*,?[\t\n\f\r ]*/,aS=/^[01]/,YL={z:[],h:[Ke],v:[Ke],m:[Ke,Ke],l:[Ke,Ke],t:[Ke,Ke],s:[Ke,Ke,Ke,Ke],q:[Ke,Ke,Ke,Ke],c:[Ke,Ke,Ke,Ke,Ke,Ke],a:[Ke,Ke,Ke,aS,aS,Ke,Ke]};function ZL(t){if(!t)return;const e=[];let i=0,n;for(;i<t.length;){const s=WL.exec(t.slice(i));let r;if(s==null){if(!n){j.warnOnce(`Invalid SVG path, error at index ${i}: Missing command.`);return}r=n}else r=s[1],i+=s[0].length;const a=XL(r,t,i);if(!a)return;i=a[0],n=r,e.push(a[1])}return e}function XL(t,e,i){const n=YL[t.toLocaleLowerCase()],s={command:t,params:[]};for(const r of n){const a=e.slice(i),o=r.exec(a);if(o!=null){s.params.push(Number.parseFloat(o[0])),i+=o[0].length;const l=KL.exec(a.slice(o[0].length));l!=null&&(i+=l[0].length)}else{if(s.params.length===1)return[i,s];j.warnOnce(`Invalid SVG path, error at index ${i}: No path segment parameters for command [${t}]`);return}}return[i,s]}function qL(t,e){const i=-e/t;return t!==0&&i>=0&&i<=1?[i]:[]}function JL(t,e,i,n=1e-6){if(Math.abs(t)<n)return qL(e,i);const s=e*e-4*t*i,r=[];if(Math.abs(s)<n){const a=-e/(2*t);a>=0&&a<=1&&r.push(a)}else if(s>0){const a=Math.sqrt(s),o=(-e-a)/(2*t),l=(-e+a)/(2*t);o>=0&&o<=1&&r.push(o),l>=0&&l<=1&&r.push(l)}return r}function QL(t,e,i,n,s=1e-6){if(Math.abs(t)<s)return JL(e,i,n,s);const r=e/t,a=i/t,o=n/t,l=(3*a-r*r)/9,c=(9*r*a-27*o-2*r*r*r)/54,h=l*l*l+c*c,u=1/3,d=[];if(h>=0){const g=Math.sqrt(h),p=Math.sign(c+g)*Math.pow(Math.abs(c+g),u),f=Math.sign(c-g)*Math.pow(Math.abs(c-g),u),m=Math.abs(Math.sqrt(3)*(p-f)/2),y=-u*r+(p+f);if(y>=0&&y<=1&&d.push(y),Math.abs(m)<s){const b=-u*r-(p+f)/2;b>=0&&b<=1&&d.push(b)}}else{const g=Math.acos(c/Math.sqrt(-l*l*l)),p=u*r,f=2*Math.sqrt(-l),m=f*Math.cos(u*g)-p,y=f*Math.cos(u*(g+2*Math.PI))-p,b=f*Math.cos(u*(g+4*Math.PI))-p;m>=0&&m<=1&&d.push(m),y>=0&&y<=1&&d.push(y),b>=0&&b<=1&&d.push(b)}return d}function Ac(t,e,i,n,s,r,a,o){const l=(i-t)*(o-r)-(n-e)*(a-s);if(l===0)return 0;const c=((a-s)*(e-r)-(t-s)*(o-r))/l,h=((i-t)*(e-r)-(n-e)*(t-s))/l;return c>=0&&c<=1&&h>=0&&h<=1?1:0}function e1(t,e,i,n,s,r,a,o,l,c,h,u){let d=0;const g=c-u,p=h-l,f=l*(u-c)-c*(h-l),m=oS(t,i,s,a),y=oS(e,n,r,o),b=g*m[0]+p*y[0],v=g*m[1]+p*y[1],S=g*m[2]+p*y[2],M=g*m[3]+p*y[3]+f,C=QL(b,v,S,M);for(const D of C){const A=D*D,w=D*A,L=m[0]*w+m[1]*A+m[2]*D+m[3],O=y[0]*w+y[1]*A+y[2]*D+y[3];let R;l===h?R=(O-c)/(u-c):R=(L-l)/(h-l),R>=0&&R<=1&&d++}return d}function oS(t,e,i,n){return[-t+3*e-3*i+n,3*t-6*e+3*i,-3*t+3*e,t]}var Fo=class{constructor(){this.previousCommands=[],this.previousParams=[],this.previousClosedPath=!1,this.commands=[],this.params=[],this.commandsLength=0,this.paramsLength=0,this.cx=Number.NaN,this.cy=Number.NaN,this.sx=Number.NaN,this.sy=Number.NaN,this.openedPath=!1,this.closedPath=!1;const t=Al();this.path2d=new t}isEmpty(){return this.commandsLength===0}isDirty(){return this.closedPath!==this.previousClosedPath||this.previousCommands.length!==this.commandsLength||this.previousParams.length!==this.paramsLength||this.previousCommands.toString()!==this.commands.slice(0,this.commandsLength).toString()||this.previousParams.toString()!==this.params.slice(0,this.paramsLength).toString()}getPath2D(){return this.path2d}moveTo(t,e){this.openedPath=!0,this.sx=t,this.sy=e,this.cx=t,this.cy=e,this.path2d.moveTo(t,e),this.commands[this.commandsLength++]=0,this.params[this.paramsLength++]=t,this.params[this.paramsLength++]=e}lineTo(t,e){this.openedPath?(this.cx=t,this.cy=e,this.path2d.lineTo(t,e),this.commands[this.commandsLength++]=1,this.params[this.paramsLength++]=t,this.params[this.paramsLength++]=e):this.moveTo(t,e)}cubicCurveTo(t,e,i,n,s,r){this.openedPath||this.moveTo(t,e),this.path2d.bezierCurveTo(t,e,i,n,s,r),this.commands[this.commandsLength++]=2,this.params[this.paramsLength++]=t,this.params[this.paramsLength++]=e,this.params[this.paramsLength++]=i,this.params[this.paramsLength++]=n,this.params[this.paramsLength++]=s,this.params[this.paramsLength++]=r}closePath(){this.openedPath&&(this.cx=this.sx,this.cy=this.sy,this.sx=Number.NaN,this.sy=Number.NaN,this.path2d.closePath(),this.commands[this.commandsLength++]=3,this.openedPath=!1,this.closedPath=!0)}rect(t,e,i,n){this.moveTo(t,e),this.lineTo(t+i,e),this.lineTo(t+i,e+n),this.lineTo(t,e+n),this.closePath()}roundRect(t,e,i,n,s){s=Math.min(s,i/2,n/2),this.moveTo(t,e+s),this.arc(t+s,e+s,s,Math.PI,1.5*Math.PI),this.lineTo(t+s,e),this.lineTo(t+i-s,e),this.arc(t+i-s,e+s,s,1.5*Math.PI,2*Math.PI),this.lineTo(t+i,e+s),this.lineTo(t+i,e+n-s),this.arc(t+i-s,e+n-s,s,0,Math.PI/2),this.lineTo(t+i-s,e+n),this.lineTo(t+s,e+n),this.arc(t+ +s,e+n-s,s,Math.PI/2,Math.PI),this.lineTo(t,e+n-s),this.closePath()}ellipse(t,e,i,n,s,r,a,o=!1){const l=i,c=n/i,h=Math.cos(s),u=Math.sin(s),d=-c*u,g=c*h,p=l*Math.cos(r),f=l*Math.sin(r),m=t+h*p+d*f,y=e+u*p+g*f,b=(m-this.cx)**2+(y-this.cy)**2;this.openedPath?b>1e-6&&this.lineTo(m,y):this.moveTo(m,y);let v=o?-Ii(r-a):Ii(a-r);Math.abs(Math.abs(a-r)-2*Math.PI)<1e-6&&v<2*Math.PI&&(v+=2*Math.PI*(o?-1:1));const S=Math.max(Math.ceil(Math.abs(v)/(Math.PI/2)),1),M=v/S,C=4/3*Math.tan(M/4);for(let D=0;D<S;D+=1){const A=r+M*(D+0),w=r+M*(D+1),L=l*Math.sin(A),O=l*Math.cos(A),R=l*Math.sin(w),_=l*Math.cos(w),E=O-C*L,F=L+C*O,z=_+C*R,K=R-C*_,G=_,ie=R;this.cubicCurveTo(t+h*E+d*F,e+u*E+g*F,t+h*z+d*K,e+u*z+g*K,t+h*G+d*ie,e+u*G+g*ie)}}arc(t,e,i,n,s,r){this.ellipse(t,e,i,i,0,n,s,r)}appendSvg(t){const e=ZL(t);if(e==null)return!1;let i=0,n=0,s,r,a=0,o=0;for(const{command:l,params:c}of e){s??(s=c[0]),r??(r=c[1]);const h=l===l.toLowerCase(),u=h?s:0,d=h?r:0;switch(l.toLowerCase()){case"m":this.moveTo(u+c[0],d+c[1]),s=u+c[0],r=d+c[1],i=s,n=r;break;case"c":this.cubicCurveTo(u+c[0],d+c[1],u+c[2],d+c[3],u+c[4],d+c[5]),a=u+c[2],o=d+c[3],s=u+c[4],r=d+c[5];break;case"s":this.cubicCurveTo(s+s-a,r+r-o,u+c[0],d+c[1],u+c[2],d+c[3]),a=u+c[0],o=d+c[1],s=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]),a=c[0],o=c[1],s=c[2],r=c[3];break;case"t":this.cubicCurveTo((s+2*(s+s-a))/3,(r+2*(r+r-o))/3,(2*(s+s-a)+c[0])/3,(2*(r+r-o)+c[1])/3,c[0],c[1]),a=s+s-a,o=r+r-o,s=c[0],r=c[1];break;case"a":this.svgEllipse(s,r,c[0],c[1],c[2]*Math.PI/180,c[3],c[4],u+c[5],d+c[6]),s=u+c[5],r=d+c[6];break;case"h":this.lineTo(u+c[0],r),s=u+c[0];break;case"l":this.lineTo(u+c[0],d+c[1]),s=u+c[0],r=d+c[1];break;case"v":this.lineTo(s,d+c[0]),r=d+c[0];break;case"z":this.closePath(),s=i,r=n;break;default:throw new Error(`Could not translate command '${l}' with '${c.join(" ")}'`)}}return!0}svgEllipse(t,e,i,n,s,r,a,o,l){i=Math.abs(i),n=Math.abs(n);const c=(t-o)/2,h=(e-l)/2,u=Math.sin(s),d=Math.cos(s),g=d*c+u*h,p=-u*c+d*h,f=g/i,m=p/n;let y=f*f+m*m,b=(t+o)/2,v=(e+l)/2,S=0,M=0;y>=1?(y=Math.sqrt(y),i*=y,n*=y):(y=Math.sqrt(1/y-1),r===a&&(y=-y),S=y*i*m,M=-y*n*f,b+=d*S-u*M,v+=u*S+d*M);const C=Math.atan2((p-M)/n,(g-S)/i),D=Math.atan2((-p-M)/n,(-g-S)/i)-C,A=C+D,w=!!(1-a);this.ellipse(b,v,i,n,s,C,A,w)}clear(t){t?(this.previousCommands=this.commands.slice(0,this.commandsLength),this.previousParams=this.params.slice(0,this.paramsLength),this.previousClosedPath=this.closedPath,this.commands=[],this.params=[],this.commandsLength=0,this.paramsLength=0):(this.commandsLength=0,this.paramsLength=0);const e=Al();this.path2d=new e,this.openedPath=!1,this.closedPath=!1}isPointInPath(t,e){const i=this.commands,n=this.params,s=this.commandsLength,r=-1e4,a=-1e4;let o=Number.NaN,l=Number.NaN,c=0,h=0,u=0;for(let d=0,g=0;d<s;d++)switch(i[d]){case 0:u+=Ac(o,l,c,h,r,a,t,e),c=n[g++],o=c,h=n[g++],l=h;break;case 1:u+=Ac(c,h,n[g++],n[g++],r,a,t,e),c=n[g-2],h=n[g-1];break;case 2:u+=e1(c,h,n[g++],n[g++],n[g++],n[g++],n[g++],n[g++],r,a,t,e),c=n[g-2],h=n[g-1];break;case 3:u+=Ac(o,l,c,h,r,a,t,e);break}return u%2===1}distanceSquared(t,e){let i=1/0;const n=this.commands,s=this.params,r=this.commandsLength;let a=Number.NaN,o=Number.NaN,l=0,c=0;for(let h=0,u=0;h<r;h++)switch(n[h]){case 0:l=a=s[u++],c=o=s[u++];break;case 1:{const d=l,g=c;l=s[u++],c=s[u++],i=wu(t,e,d,g,l,c,i);break}case 2:{const d=l,g=c,p=s[u++],f=s[u++],m=s[u++],y=s[u++];l=s[u++],c=s[u++],i=I0(d,g,p,f,m,y,l,c,t,e)**2;break}case 3:i=wu(t,e,l,c,a,o,i);break}return i}toSVG(t=(e,i)=>({x:e,y:i})){const e=[],{commands:i,params:n}=this,s=(a,o)=>{e.push(a);for(let l=0;l<o;l+=2){const{x:c,y:h}=t(n[r++],n[r++]);e.push(c,h)}};let r=0;for(let a=0;a<this.commandsLength;a++)switch(i[a]){case 0:s("M",2);break;case 1:s("L",2);break;case 2:s("C",6);break;case 3:s("Z",0);break}return e.join(" ")}computeBBox(){const{commands:t,params:e}=this;let[i,n,s,r]=[1/0,1/0,-1/0,-1/0],[a,o]=[Number.NaN,Number.NaN],[l,c]=[Number.NaN,Number.NaN];const h=(d,g)=>{i=Math.min(g,i),n=Math.min(d,n),s=Math.max(d,s),r=Math.max(g,r),a=d,o=g};let u=0;for(let d=0;d<this.commandsLength;d++)switch(t[d]){case 0:h(e[u++],e[u++]),l=a,c=o;break;case 1:h(e[u++],e[u++]);break;case 2:{const p=a,f=o,m=e[u++],y=e[u++],b=e[u++],v=e[u++],S=e[u++],M=e[u++],C=M0(p,f,m,y,b,v,S,M);for(const D of C){const A=No(p,m,b,S,D),w=No(f,y,v,M,D);h(A,w)}h(S,M);break}case 3:h(l,c),l=Number.NaN,c=Number.NaN;break}return new U(n,i,s-n,r-i)}},lS=1e-8;function cS(t,e){const i=e*t,n=i-Math.floor(i),s=Math.abs(n-.5)<lS?i+lS:i;return Math.round(s)/t}function Ft(t,e,i){const n=cS(t,e);return i==null?n:i===0?0:i<1?t1(t,i):cS(t,i+e)-n}function hS(t,e){return Math.floor(e*t)/t}function t1(t,e){return Math.ceil(e*t)/t}function jf(t,e,i){const{width:n,height:s,padding:r,strokeWidth:a}=e,o=n/2,l=s/2,c=Math.max(1,n-r-a/2),h=Math.max(1,s-r-a/2);let u=!1;for(const[d,g]of i){const p=o+(d-.5)*c,f=l+(g-.5)*h;u?t.lineTo(p,f):t.moveTo(p,f),u=!0}t.closePath()}var uS={circles(t,{width:e,strokeWidth:i,padding:n}){const s=e/2,r=Math.max(1,s-n-i/2);t.arc(s,s,r,0,Math.PI*2)},squares(t,{width:e,height:i,pixelRatio:n,padding:s,strokeWidth:r}){const a=s+r/2;t.moveTo(Ft(n,a),Ft(n,a)),t.lineTo(Ft(n,e-a),Ft(n,a)),t.lineTo(Ft(n,e-a),Ft(n,i-a)),t.lineTo(Ft(n,a),Ft(n,i-a)),t.closePath()},triangles(t,e){jf(t,e,[[.5,0],[1,1],[0,1]])},diamonds(t,e){jf(t,e,[[.5,0],[1,.5],[.5,1],[0,.5]])},stars(t,{width:e,height:i,padding:n}){const r=Math.max(1,(e-n)/2),a=r/2,o=Math.PI/2;for(let l=0;l<5*2;l++){const c=l%2===0?r:a,h=l*Math.PI/5-o,u=e/2+Math.cos(h)*c,d=i/2+Math.sin(h)*c;t.lineTo(u,d)}t.closePath()},hearts(t,{width:e,height:i,padding:n}){const s=Math.max(1,e/4-n/2),r=e/2,a=i/2+s/2;t.arc(r-s,a-s,s,Zt(130),Zt(330)),t.arc(r+s,a-s,s,Zt(220),Zt(50)),t.lineTo(r,a+s),t.closePath()},crosses(t,e){jf(t,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]])},"vertical-lines"(t,{width:e,height:i,pixelRatio:n,strokeWidth:s}){const r=Ft(n,e/2)-s%2/2;t.moveTo(r,0),t.lineTo(r,i)},"horizontal-lines"(t,{width:e,height:i,pixelRatio:n,strokeWidth:s}){const r=Ft(n,i/2)-s%2/2;t.moveTo(0,r),t.lineTo(e,r)},"forward-slanted-lines"(t,{width:e,height:i,strokeWidth:n}){const s=Math.atan2(i,e),r=n*Math.cos(s),a=n*Math.sin(s);t.moveTo(-r,a),t.lineTo(r,-a),t.moveTo(-r,i+a),t.lineTo(e+r,-a),t.moveTo(e-r,i+a),t.lineTo(e+r,i-a)},"backward-slanted-lines"(t,{width:e,height:i,strokeWidth:n}){const s=Math.atan2(i,e),r=n*Math.cos(s),a=n*Math.sin(s);t.moveTo(e-r,-a),t.lineTo(e+r,a),t.moveTo(-r,-a),t.lineTo(e+r,i+a),t.moveTo(-r,i-a),t.lineTo(r,i+a)}},i1=class{constructor(t){this._cache=void 0,this.width=Math.max(t?.width??10,1),this.height=Math.max(t?.height??10,1),this.fill=t.fill??"none",this.fillOpacity=t.fillOpacity??1,this.backgroundFill=t.backgroundFill??"none",this.backgroundFillOpacity=t.backgroundFillOpacity??1,this.stroke=t.stroke??"black",this.strokeOpacity=t.strokeOpacity??1,this.strokeWidth=t.strokeWidth??1,this.padding=t.padding??1,this.pattern=t.pattern??"forward-slanted-lines",this.rotation=t.rotation??0,this.scale=t.scale??1,this.path=t.path}getPath(t){const{pattern:e,width:i,height:n,padding:s,strokeWidth:r,path:a}=this,o=new Fo;let l=uS[e]!=null;return a&&l&&(l=!o.appendSvg(a)),l&&uS[e](o,{width:i,height:n,pixelRatio:t,strokeWidth:r,padding:s}),o}renderStroke(t,e){const{stroke:i,strokeWidth:n,strokeOpacity:s}=this;n&&(e.strokeStyle=i,e.lineWidth=n,e.globalAlpha=s,e.stroke(t))}renderFill(t,e){const{fill:i,fillOpacity:n}=this;i!=="none"&&(e.fillStyle=i,e.globalAlpha=n,e.fill(t))}createCanvasPattern(t,e){const{width:i,height:n,scale:s,backgroundFill:r,backgroundFillOpacity:a}=this;if(i*s<1||n*s<1)return j.warnOnce("Pattern fill is too small to render, ignoring."),null;const o=new _f({width:i,height:n,pixelRatio:e*s}),l=o.context;r!=="none"&&(l.fillStyle=r,l.globalAlpha=a,l.fillRect(0,0,i,n));const c=this.getPath(e).getPath2D();this.renderFill(c,l),this.renderStroke(c,l);const h=t.createPattern(o.canvas,"repeat");return this.setPatternTransform(h,e),o.destroy(),h}setPatternTransform(t,e,i=0,n=0){if(t==null)return;const s=Is(this.rotation),r=1/e,a=Math.cos(s)*r,o=Math.sin(s)*r,l=Cg();t.setTransform(new l([a,o,-o,a,i,n]))}createPattern(t,e){if(this._cache?.ctx===t&&this._cache.pixelRatio===e)return this._cache.pattern;const i=this.createCanvasPattern(t,e);if(i!=null)return this._cache={ctx:t,pattern:i,pixelRatio:e},i}toSvg(){const{width:t,height:e,fill:i,fillOpacity:n,backgroundFill:s,backgroundFillOpacity:r,stroke:a,strokeWidth:o,strokeOpacity:l,rotation:c,scale:h}=this,u=ut("pattern");u.setAttribute("viewBox",`0 0 ${t} ${e}`),u.setAttribute("width",String(t)),u.setAttribute("height",String(e)),u.setAttribute("patternUnits","userSpaceOnUse");const d=ut("rect");d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("width",String(t)),d.setAttribute("height",String(e)),d.setAttribute("fill",s),d.setAttribute("fill-opacity",String(r)),u.appendChild(d);const g=ut("path");return g.setAttribute("fill",i),g.setAttribute("fill-opacity",String(n)),g.setAttribute("stroke-opacity",String(l)),g.setAttribute("stroke",a),g.setAttribute("stroke-width",String(o)),g.setAttribute("transform",`rotate(${c}) scale(${h})`),g.setAttribute("d",this.getPath(1).toSVG()),u.appendChild(g),u}};function dS(t,e){const{fontStyle:i,fontWeight:n,fontSize:s,fontFamily:r}=e;i&&t.setAttribute("font-style",i),n&&t.setAttribute("font-weight",String(n)),s!=null&&t.setAttribute("font-size",String(s)),r&&t.setAttribute("font-family",r)}function n1(t,e){const{stroke:i,strokeWidth:n,strokeOpacity:s}=e;i&&t.setAttribute("stroke",i),n!=null&&t.setAttribute("stroke-width",String(n)),s!=null&&t.setAttribute("stroke-opacity",String(s))}function s1(t,e){const{lineDash:i,lineDashOffset:n}=e;if(i?.some(s=>s!==0)){const s=i.length%2===1?[...i,...i]:i;t.setAttribute("stroke-dasharray",s.join(" ")),n!=null&&t.setAttribute("stroke-dashoffset",String(n))}}var Ht=class extends ws{constructor(){super(...arguments),this.drawingMode="overlay",this.fillOpacity=1,this.strokeOpacity=1,this.fill="black",this.strokeWidth=0,this.lineDashOffset=0,this.opacity=1}getGradient(e){if(qi(e))return this.createGradient(e)}createGradient(e){const{colorSpace:i="rgb",gradient:n="linear",colorStops:s,rotation:r=0,reverse:a=!1}=e;if(s==null)return;let o=rS(s,["black"],[0,1]);switch(a&&(o=o.map(l=>({color:l.color,stop:1-l.stop})).reverse()),n){case"linear":return new jL(i,o,r);case"radial":return new HL(i,o);case"conic":return new GL(i,o,r)}}getPattern(e){if(As(e))return this.createPattern(e)}createPattern(e){return new i1(e)}getImage(e){if(la(e))return this.createImage(e)}createImage(e){return new UL(this.imageLoader,e)}onFillChange(){typeof this.fill=="object"&&st(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,i){return Ft(this.layerManager?.canvas?.pixelRatio??1,e,i)}markDirty(e){super.markDirty(e),this.cachedDefaultGradientFillBBox=void 0}fillStroke(e,i){this.__drawingMode==="cutout"&&(e.globalCompositeOperation="destination-out",this.executeFill(e,i),e.globalCompositeOperation="source-over"),this.renderFill(e,i),this.renderStroke(e,i)}renderFill(e,i){const{__fill:n,__fillOpacity:s=1,fillImage:r}=this;if(n!=null&&n!=="none"&&s>0){const a=e.globalAlpha;r&&(e.globalAlpha=r.backgroundFillOpacity,e.fillStyle=r.backgroundFill,this.executeFill(e,i),e.globalAlpha=a),this.applyFillAndAlpha(e),this.applyShadow(e),this.executeFill(e,i),e.globalAlpha=a,this.fillShadow?.enabled&&(e.shadowColor="rgba(0, 0, 0, 0)")}}executeFill(e,i){i?e.fill(i):e.fill()}applyFillAndAlpha(e){const{__fill:i,fillGradient:n,fillPattern:s,fillImage:r,__fillOpacity:a=1,__opacity:o=1}=this,l=o*a;if(l!==1&&(e.globalAlpha*=l),n){const{fillBBox:c=this.getDefaultGradientFillBBox()??this.getBBox(),fillParams:h}=this;e.fillStyle=n.createGradient(e,c,h)??"black"}else if(s){const{x:c,y:h}=this.getBBox(),u=this.layerManager?.canvas?.pixelRatio??1,d=s.createPattern(e,u);s.setPatternTransform(d,u,c,h),d?e.fillStyle=d:(e.fillStyle=s.fill,e.globalAlpha*=s.fillOpacity)}else if(r){const c=this.getBBox(),h=r.createPattern(e,c.width,c.height,this);r.setImageTransform(h,c),e.fillStyle=h??"transparent"}else e.fillStyle=typeof i=="string"?i:"black"}applyStrokeAndAlpha(e){const{__stroke:i,__strokeOpacity:n=1,strokeGradient:s,__opacity:r=1}=this;e.strokeStyle=s?.createGradient(e,this.getBBox())??(typeof i=="string"?i:void 0)??"black";const a=r*n;a!==1&&(e.globalAlpha*=a)}applyShadow(e){const i=this.layerManager?.canvas.pixelRatio??1,{__fillShadow:n}=this;n?.enabled&&(e.shadowColor=n.color,e.shadowOffsetX=n.xOffset*i,e.shadowOffsetY=n.yOffset*i,e.shadowBlur=n.blur*i)}renderStroke(e,i){const{__stroke:n,__strokeWidth:s=0,__strokeOpacity:r=1,__lineDash:a,__lineDashOffset:o,__lineCap:l,__lineJoin:c,__miterLimit:h}=this;if(n!=null&&n!=="none"&&s>0&&r>0){const{globalAlpha:u}=e;this.applyStrokeAndAlpha(e),e.lineWidth=s,a&&e.setLineDash(a),o&&(e.lineDashOffset=o),l&&(e.lineCap=l),c&&(e.lineJoin=c),h!=null&&(e.miterLimit=h),this.executeStroke(e,i),e.globalAlpha=u}}executeStroke(e,i){i?e.stroke(i):e.stroke()}getDefaultGradientFillBBox(){return this.cachedDefaultGradientFillBBox??(this.cachedDefaultGradientFillBBox=Object.freeze(this.computeDefaultGradientFillBBox())),this.cachedDefaultGradientFillBBox}computeDefaultGradientFillBBox(){}containsPoint(e,i){return this.isPointInPath(e,i)}applySvgFillAttributes(e,i){const{fill:n,fillOpacity:s}=this;if(typeof n=="string")e.setAttribute("fill",n);else if(qi(n)&&this.fillGradient){i??(i=[]);const r=this.fillGradient.toSvg(this.fillBBox??this.getBBox()),a=Ou();r.setAttribute("id",a),i.push(r),e.setAttribute("fill",`url(#${a})`)}else if(As(n)&&this.fillPattern){i??(i=[]);const r=this.fillPattern.toSvg(),a=Ou();r.setAttribute("id",a),i.push(r),e.setAttribute("fill",`url(#${a})`)}else if(la(n)&&this.fillImage){i??(i=[]);const r=this.layerManager?.canvas?.pixelRatio??1,a=this.fillImage.toSvg(this.getBBox(),r),o=Ou();a.setAttribute("id",o),i.push(a),e.setAttribute("fill",`url(#${o})`)}else e.setAttribute("fill","none");return e.setAttribute("fill-opacity",String(s)),i}applySvgStrokeAttributes(e){const{stroke:i,strokeOpacity:n,strokeWidth:s,lineDash:r,lineDashOffset:a}=this;n1(e,{stroke:ot(i)?i:void 0,strokeOpacity:n,strokeWidth:s}),s1(e,{lineDash:r,lineDashOffset:a})}static handleFillChange(e){e.onFillChange()}static handleStrokeChange(e){e.onStrokeChange()}setStyleProperties(e,i,n){const s=e?.opacity??1,r=e?.fill,a=(e?.fillOpacity??1)*s,o=(e?.strokeOpacity??1)*s,l=e?.strokeWidth??0,c=e?.lineDashOffset??0;let h=!1;this.__fillOpacity!==a&&(this.__fillOpacity=a,h=!0),this.__strokeOpacity!==o&&(this.__strokeOpacity=o,h=!0),this.__strokeWidth!==l&&(this.__strokeWidth=l,h=!0),this.__lineDashOffset!==c&&(this.__lineDashOffset=c,h=!0),this.__lineDash!==e?.lineDash&&(this.__lineDash=e?.lineDash,h=!0),this.setFillProperties(r,i,n),r!==this.fill&&(this.fill=r),e?.stroke!==this.stroke&&(this.stroke=e?.stroke),h&&this.markDirty()}setFillProperties(e,i,n){const s=i==null||!qi(e)||e.bounds==null||e.bounds==="item"?void 0:i[e.bounds];let r=!1;this.__fillBBox!==s&&(this.__fillBBox=s,r=!0),this.__fillParams!==n&&(this.__fillParams=n,r=!0),r&&(this.onFillChange(),this.markDirty())}};x([We()],Ht.prototype,"drawingMode",2),x([We()],Ht.prototype,"fillOpacity",2),x([We()],Ht.prototype,"strokeOpacity",2),x([xc({equals:st,changeCb:Ht.handleFillChange})],Ht.prototype,"fill",2),x([ha({equals:st,changeCb:Ht.handleStrokeChange})],Ht.prototype,"stroke",2),x([We()],Ht.prototype,"strokeWidth",2),x([wf()],Ht.prototype,"lineDash",2),x([We()],Ht.prototype,"lineDashOffset",2),x([We()],Ht.prototype,"lineCap",2),x([We()],Ht.prototype,"lineJoin",2),x([We()],Ht.prototype,"miterLimit",2),x([We({convertor:t=>te(0,t??1,1)})],Ht.prototype,"opacity",2),x([ha({equals:Ro,checkDirtyOnAssignment:!0})],Ht.prototype,"fillShadow",2),x([xc({equals:Au,changeCb:t=>t.onFillChange()})],Ht.prototype,"fillBBox",2),x([xc({equals:st,changeCb:t=>t.onFillChange()})],Ht.prototype,"fillParams",2);var ga=Ht,gS=[1,0,0,1,0,0],pa=class xg{get e(){return[...this.elements]}constructor(e=gS){this.elements=[...e]}setElements(e){const i=this.elements;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],this}get identity(){const e=this.elements;return Ti(e[0],1)&&Ti(e[1],0)&&Ti(e[2],0)&&Ti(e[3],1)&&Ti(e[4],0)&&Ti(e[5],0)}AxB(e,i,n){const s=e[0]*i[0]+e[2]*i[1],r=e[1]*i[0]+e[3]*i[1],a=e[0]*i[2]+e[2]*i[3],o=e[1]*i[2]+e[3]*i[3],l=e[0]*i[4]+e[2]*i[5]+e[4],c=e[1]*i[4]+e[3]*i[5]+e[5];n=n??e,n[0]=s,n[1]=r,n[2]=a,n[3]=o,n[4]=l,n[5]=c}multiplySelf(e){return this.AxB(this.elements,e.elements),this}multiply(e){const i=[Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN];return e instanceof xg?this.AxB(this.elements,e.elements,i):this.AxB(this.elements,[e.a,e.b,e.c,e.d,e.e,e.f],i),new xg(i)}preMultiplySelf(e){return this.AxB(e.elements,this.elements,this.elements),this}inverse(){const e=this.elements;let i=e[0],n=e[1],s=e[2],r=e[3];const a=e[4],o=e[5],l=1/(i*r-n*s);return i*=l,n*=l,s*=l,r*=l,new xg([r,-n,-s,i,s*o-r*a,n*a-i*o])}invertSelf(){const e=this.elements;let i=e[0],n=e[1],s=e[2],r=e[3];const a=e[4],o=e[5],l=1/(i*r-n*s);return i*=l,n*=l,s*=l,r*=l,e[0]=r,e[1]=-n,e[2]=-s,e[3]=i,e[4]=s*o-r*a,e[5]=n*a-i*o,this}transformPoint(e,i){const n=this.elements;return{x:e*n[0]+i*n[2]+n[4],y:e*n[1]+i*n[3]+n[5]}}transformBBox(e,i){const n=this.elements,s=n[0],r=n[1],a=n[2],o=n[3],l=e.width*.5,c=e.height*.5,h=e.x+l,u=e.y+c,d=Math.abs(l*s)+Math.abs(c*a),g=Math.abs(l*r)+Math.abs(c*o);return i??(i=new U(0,0,0,0)),i.x=h*s+u*a+n[4]-d,i.y=h*r+u*o+n[5]-g,i.width=d+d,i.height=g+g,i}toContext(e){if(this.identity)return;const i=this.elements;e.transform(i[0],i[1],i[2],i[3],i[4],i[5])}static updateTransformMatrix(e,i,n,s,r,a,o){const l=i,c=n;let h,u;l===1&&c===1?(h=0,u=0):(h=o?.scalingCenterX??0,u=o?.scalingCenterY??0);const d=s,g=Math.cos(d),p=Math.sin(d);let f,m;d===0?(f=0,m=0):(f=o?.rotationCenterX??0,m=o?.rotationCenterY??0);const y=r,b=a,v=h*(1-l)-f,S=u*(1-c)-m;return e.setElements([g*l,p*l,-p*c,g*c,g*v-p*S+f+y,p*v+g*S+m+b]),e}};function vr(t){return fS(t.constructor)}var pS=Symbol("isMatrixTransform");function fS(t){return t[pS]===!0}function Hf(t){var e,i;const n=t;if(fS(t))return t;const s=Symbol("matrix_combined_transform");class r extends n{constructor(){super(...arguments),this[i]=new pa,this._dirtyTransform=!0}onChangeDetection(o){super.onChangeDetection(o),this._dirtyTransform=!0,!(this.batchLevel>0)&&this.markDirty("transform")}updateMatrix(o){}computeTransformMatrix(){this._dirtyTransform&&(this[s].setElements(gS),this.updateMatrix(this[s]),this._dirtyTransform=!1)}toParent(o){return this.computeTransformMatrix(),this[s].identity?o.clone():this[s].transformBBox(o)}toParentPoint(o,l){return this.computeTransformMatrix(),this[s].identity?{x:o,y:l}:this[s].transformPoint(o,l)}fromParent(o){return this.computeTransformMatrix(),this[s].identity?o.clone():this[s].inverse().transformBBox(o)}fromParentPoint(o,l){return this.computeTransformMatrix(),this[s].identity?{x:o,y:l}:this[s].inverse().transformPoint(o,l)}computeBBox(){const o=super.computeBBox();return o&&this.toParent(o)}computeBBoxWithoutTransforms(){return super.computeBBox()}pickNode(o,l){return{x:o,y:l}=this.fromParentPoint(o,l),super.pickNode(o,l)}pickNodes(o,l,c){return{x:o,y:l}=this.fromParentPoint(o,l),super.pickNodes(o,l,c)}render(o){this.computeTransformMatrix();const{ctx:l}=o,c=this[s];let h=!1;try{c.identity||(l.save(),h=!0,c.toContext(l)),super.render(o)}finally{h&&l.restore()}}toSVG(){this.computeTransformMatrix();const o=super.toSVG(),l=this[s];if(l.identity||o==null)return o;const c=ut("g");c.append(...o.elements);const[h,u,d,g,p,f]=l.e;return c.setAttribute("transform",`matrix(${h} ${u} ${d} ${g} ${p} ${f})`),{elements:[c],defs:o.defs}}}return e=pS,i=s,r[e]=!0,r}function fa(t){var e;const i=t,n=Symbol("matrix_rotation");class s extends Hf(i){constructor(){super(...arguments),this[e]=new pa,this.rotationCenterX=0,this.rotationCenterY=0,this.rotation=0}updateMatrix(a){super.updateMatrix(a);const{rotation:o,rotationCenterX:l,rotationCenterY:c}=this;o!==0&&(pa.updateTransformMatrix(this[n],1,1,o,0,0,{rotationCenterX:l,rotationCenterY:c}),a.multiplySelf(this[n]))}}return e=n,x([Z()],s.prototype,"rotationCenterX",2),x([Z()],s.prototype,"rotationCenterY",2),x([Z()],s.prototype,"rotation",2),s}function r1(t){return"scalingX"in t&&"scalingY"in t&&"scalingCenterX"in t&&"scalingCenterY"in t}function nd(t){var e;const i=t,n=Symbol("matrix_scale");class s extends Hf(i){constructor(){super(...arguments),this[e]=new pa,this.scalingX=1,this.scalingY=1,this.scalingCenterX=0,this.scalingCenterY=0}updateMatrix(a){super.updateMatrix(a);const{scalingX:o,scalingY:l,scalingCenterX:c,scalingCenterY:h}=this;o===1&&l===1||(pa.updateTransformMatrix(this[n],o,l,0,0,0,{scalingCenterX:c,scalingCenterY:h}),a.multiplySelf(this[n]))}resetScalingProperties(a,o,l,c){this.__scalingX=a,this.__scalingY=o,this.__scalingCenterX=l,this.__scalingCenterY=c,this.onChangeDetection("scaling")}}return e=n,x([Z()],s.prototype,"scalingX",2),x([Z()],s.prototype,"scalingY",2),x([Z()],s.prototype,"scalingCenterX",2),x([Z()],s.prototype,"scalingCenterY",2),s}function Vo(t){var e;const i=t,n=Symbol("matrix_translation");class s extends Hf(i){constructor(){super(...arguments),this[e]=new pa,this.translationX=0,this.translationY=0}updateMatrix(a){super.updateMatrix(a);const{translationX:o,translationY:l}=this;o===0&&l===0||(pa.updateTransformMatrix(this[n],1,1,0,o,l),a.multiplySelf(this[n]))}}return e=n,x([Z()],s.prototype,"translationX",2),x([Z()],s.prototype,"translationY",2),s}var Ze=class{static fromCanvas(t,e){const i=[];for(const n of t.traverseUp())vr(n)&&i.unshift(n);for(const n of i)e=n.fromParent(e);return vr(t)&&(e=t.fromParent(e)),e}static toCanvas(t,e){e==null?e=t.getBBox():vr(t)&&(e=t.toParent(e));for(const i of t.traverseUp())vr(i)&&(e=i.toParent(e));return e}static fromCanvasPoint(t,e,i){const n=[];for(const s of t.traverseUp())vr(s)&&n.unshift(s);for(const s of n)({x:e,y:i}=s.fromParentPoint(e,i));return vr(t)&&({x:e,y:i}=t.fromParentPoint(e,i)),{x:e,y:i}}static toCanvasPoint(t,e,i){vr(t)&&({x:e,y:i}=t.toParentPoint(e,i));for(const n of t.traverseUp())vr(n)&&({x:e,y:i}=n.toParentPoint(e,i));return{x:e,y:i}}},sd,$f=class ph extends ws{constructor(e){super(e),this.childNodes=new Set,this.dirty=!1,this.dirtyZIndex=!1,this.clipRect=void 0,this.opacity=1,this._childFontDirty=!0,this.layer=void 0,this.image=void 0,this._lastWidth=Number.NaN,this._lastHeight=Number.NaN,this._lastDevicePixelRatio=Number.NaN,this.isContainerNode=!0,this.renderToOffscreenCanvas=e?.renderToOffscreenCanvas===!0,this.optimizeForInfrequentRedraws=e?.optimizeForInfrequentRedraws===!0}static is(e){return e instanceof ph}static computeChildrenBBox(e,i=!0){return U.merge(ws.extractBBoxes(e,i))}static compareChildren(e,i){return tS(e.__zIndex,i.__zIndex)||e.serialNumber-i.serialNumber}containsPoint(e,i){return!0}computeBBox(){return ph.computeChildrenBBox(this.children())}computeSafeClippingBBox(e){const i=this.computeBBox();if(i?.isFinite()!==!0)return;let n=0;const s=4;for(const d of this.descendants())d instanceof ga&&(n=Math.max(n,d.strokeWidth));const r=Math.max(1,n/2*s),{x:a,y:o}=Ze.toCanvasPoint(this,0,0),l=hS(e,a+i.x-r)-a,c=hS(e,o+i.y-r)-o,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(e,i,n){return sd?.pixelRatio===n?sd.resize(e,i,n):sd=new _f({width:e,height:i,pixelRatio:n}),sd}setScene(e){const i=this.scene;super.setScene(e),this.layer&&i&&i!==e&&(i.layersManager.removeLayer(this.layer),this.layer=void 0);for(const n of this.children())n.setScene(e)}resolveFont(){if(!this.renderToOffscreenCanvas)return this.resolveChildFont()}resolveChildFont(){if(this._childFontDirty){this._cachedChildFont=void 0;for(const e of this.children()){const i=e.resolveFont();if(i!=null){this._cachedChildFont=i;break}}this._childFontDirty=!1}return this._cachedChildFont}markDirty(e){this.dirty=!0,this._childFontDirty=!0,super.markDirty(e)}markDirtyChildrenOrder(){super.markDirtyChildrenOrder(),this.dirtyZIndex=!0,this.markDirty()}append(e){for(const i of ix(e))i.remove(),this.childNodes.add(i),i.parentNode=this,i.setScene(this.scene);this.markDirtyChildrenOrder(),this.markDirty()}appendChild(e){return this.append(e),e}removeChild(e){if(!this.childNodes?.delete(e))throw new Error(`AG Charts - internal error, unknown child node ${e.name??e.id} in $${this.name??this.id}`);e.parentNode=void 0,e.setScene(),this.markDirtyChildrenOrder(),this.markDirty()}clear(){for(const e of this.children())delete e.parentNode,e.setScene();this.childNodes?.clear(),this.markDirty()}pickNode(e,i){if(!(!this.visible||this.pointerEvents===1||!this.containsPoint(e,i))){if(this.childNodes!=null&&this.childNodes.size!==0){const n=[...this.children()];for(let s=n.length-1;s>=0;s--){const a=n[s].pickNode(e,i);if(a!=null)return a}}else if(!this.isContainerNode)return this}}pickNodes(e,i,n=[]){if(!this.visible||this.pointerEvents===1||!this.containsPoint(e,i))return n;this.isContainerNode||n.push(this);for(const s of this.children())s.pickNodes(e,i,n);return n}isDirty(e){const{width:i,height:n,devicePixelRatio:s}=e,{dirty:r,layer:a}=this,o=a!=null&&(this._lastWidth!==i||this._lastHeight!==n),l=this._lastDevicePixelRatio!==s;return this._lastWidth=i,this._lastHeight=n,this._lastDevicePixelRatio=s,r||o||l}preRender(e){let i;if(this.dirty){i=super.preRender(e,0);for(const n of this.children()){const s=n.preRender(e);i.groups+=s.groups,i.nonGroups+=s.nonGroups,i.complexity+=s.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(e){const{layer:i,renderToOffscreenCanvas:n}=this,s={...e},r=this.isDirty(e);if(this.dirty=!1,!n){this.renderInContext(s),super.render(s);return}const{ctx:a,stats:o,devicePixelRatio:l}=e;let{image:c}=this;if(r){c?.bitmap.close(),c=void 0;const u=i?void 0:this.computeSafeClippingBBox(l),d=(g,...p)=>{const f=g.context;f.direction=s.direction,s.ctx=f,g.clear(),f.save();try{f.setTransform(...p),f.globalAlpha=1,this.renderInContext(s)}finally{f.restore(),f.verifyDepthZero?.()}};if(i)d(i,a.getTransform());else if(u){const{x:g,y:p,width:f,height:m}=u,y=Math.floor(f*l),b=Math.floor(m*l);if(y>0&&b>0){const v=this.prepareSharedCanvas(f,m,l);d(v,l,0,0,l,-g*l,-p*l),c={bitmap:v.transferToImageBitmap(),x:g,y:p,width:f,height:m}}}this.image=c,o&&o.layersRendered++}else o&&o.layersSkipped++;const{globalAlpha:h}=a;if(a.globalAlpha=h*this.opacity,i){a.save();try{a.resetTransform(),i.drawImage(a)}finally{a.restore()}}else if(c){const{bitmap:u,x:d,y:g,width:p,height:f}=c;a.drawImage(u,0,0,p*l,f*l,d,g,p,f)}a.globalAlpha=h,super.render(s)}applyClip(e,i){const{x:n,y:s,width:r,height:a}=i;e.beginPath(),e.rect(n,s,r,a),e.clip()}renderInContext(e){const{ctx:i,stats:n}=e;this.dirtyZIndex&&(this.sortChildren(ph.compareChildren),this.dirtyZIndex=!1),i.save();try{i.globalAlpha*=this.opacity;const s=this.resolveChildFont();s!=null&&i.font!==s&&(i.font=s),this.clipRect!=null&&(this.applyClip(i,this.clipRect),e.clipBBox=Ze.toCanvas(this,this.clipRect));for(const r of this.children()){if(!r.visible){n&&(n.nodesSkipped+=r.childNodeCounts.nonGroups+r.childNodeCounts.groups,n.opsSkipped+=r.childNodeCounts.complexity);continue}r.isolatedRender(e)}}finally{i.restore()}}sortChildren(e){if(!this.childNodes)return;const i=[...this.childNodes].sort(e);this.childNodes.clear();for(const n of i)this.childNodes.add(n)}*children(){yield*this.childNodes}*excludeChildren(e){for(const i of this.children())(e.instance&&!(i instanceof e.instance)||e.name&&i.name!==e.name)&&(yield i)}*descendants(){for(const e of this.children())yield e,e instanceof ph&&(yield*e.descendants())}setClipRect(e){this.clipRect=e?Ze.fromCanvas(this,e):void 0}setClipRectCanvasSpace(e){this.clipRect=e}getVisibility(){for(const e of this.traverseUp(!0))if(!e.visible)return!1;return!0}toSVG(){if(!this.visible)return;const e=[],i=[];for(const n of this.children()){const s=n.toSVG();s!=null&&(i.push(...s.elements),s.defs!=null&&e.push(...s.defs))}return{elements:i,defs:e}}};$f.className="Group",x([Z({convertor:t=>te(0,t,1)})],$f.prototype,"opacity",2);var ne=$f,a1=nd(ne),m_=fa(ne),$t=Vo(ne),_o=fa(Vo(ne)),is=class extends ga{constructor(t={}){super(t),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(t,e){return!1}render(t){const{ctx:e}=t;let{x1:i,y1:n,x2:s,y2:r}=this;i=this.align(i),n=this.align(n),s=this.align(s),r=this.align(r);const{fill:a,horizontal:o}=this,{globalAlpha:l}=e;a!=null&&(this.applyFillAndAlpha(e),e.beginPath(),e.moveTo(i,n),e.lineTo(s,n),e.lineTo(s,r),e.lineTo(i,r),e.closePath(),e.fill(),e.globalAlpha=l);const{stroke:c,strokeWidth:h,startLine:u,endLine:d}=this;if(!!((u||d)&&c&&h)){const{lineDash:p,lineDashOffset:f,lineCap:m,lineJoin:y}=this;this.applyStrokeAndAlpha(e),e.lineWidth=h,p&&e.setLineDash([...p]),f&&(e.lineDashOffset=f),m&&(e.lineCap=m),y&&(e.lineJoin=y),e.beginPath(),u&&(e.moveTo(i,n),o?e.lineTo(i,r):e.lineTo(s,n)),d&&(e.moveTo(s,r),o?e.lineTo(s,n):e.lineTo(i,r)),e.stroke(),e.globalAlpha=l}this.fillShadow?.markClean(),super.render(t)}};is.className="Range",x([Z()],is.prototype,"x1",2),x([Z()],is.prototype,"y1",2),x([Z()],is.prototype,"x2",2),x([Z()],is.prototype,"y2",2),x([Z()],is.prototype,"startLine",2),x([Z()],is.prototype,"endLine",2),x([Z()],is.prototype,"horizontal",2);var o1=class{constructor(){this.stats=new Map,this.lastLogTime=Date.now(),this.LOG_INTERVAL_MS=1e4,this.startPeriodicLogging()}startPeriodicLogging(){ue.check("scene:stats","scene:stats:verbose")&&(this.stopPeriodicLogging(),this.intervalId=setInterval(()=>{this.logAccumulatedStats()},this.LOG_INTERVAL_MS))}stopPeriodicLogging(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0)}recordTiming(t,e){const i=this.stats.get(t);i?(i.min=Math.min(i.min,e),i.max=Math.max(i.max,e),i.sum+=e,i.count+=1):this.stats.set(t,{min:e,max:e,sum:e,count:1})}recordTimings(t){for(const[e,i]of Object.entries(t))e!=="start"&&typeof i=="number"&&this.recordTiming(e,i)}logAccumulatedStats(){if(this.stats.size===0)return;const t=(Date.now()-this.lastLogTime)/1e3,e=Array.from(this.stats.keys()).sort((r,a)=>r==="\u23F1\uFE0F"?-1:a==="\u23F1\uFE0F"?1:r.localeCompare(a)),i=[];for(const r of e){const a=this.stats.get(r),o=a.sum/a.count;i.push(`${r}[${a.min.toFixed(1)}/${o.toFixed(1)}/${a.max.toFixed(1)}]ms`)}const s=this.stats.get("\u23F1\uFE0F")?.count??0;j.log(`\u{1F4CA} Stats (${t.toFixed(0)}s, ${s} renders): ${i.join(" ")}`),this.stats.clear(),this.lastLogTime=Date.now()}destroy(){this.stopPeriodicLogging(),this.stats.clear()}},Bo,ma=0;function l1(){return Bo??(Bo=new o1),Bo}function c1(){ma++;let t=!1;return()=>{t||ma===0||(t=!0,ma--,ma===0&&vS())}}function h1(t){for(const e of["B","KB","MB","GB"]){if(t<1536)return`${t.toFixed(1)}${e}`;t/=1024}return`${t.toFixed(1)}TB}`}function u1(){if(!("memory"in performance))return;const{totalJSHeapSize:t,usedJSHeapSize:e,jsHeapSizeLimit:i}=performance.memory,n=[];for(const s of[e,t,i])typeof s=="number"&&n.push(h1(s));return`Heap ${n.join(" / ")}`}function mS(t,e,i,n,s={},r=U.zero,a){if(!ue.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:o=0,layersSkipped:l=0,nodesRendered:c=0,nodesSkipped:h=0,opsPerformed:u=0,opsSkipped:d=0}=n??{},g=performance.now(),{start:p,...f}=e,m=g-p,y=l1();y.recordTimings(f),y.recordTiming("\u23F1\uFE0F",m);const b=Object.entries(f).map(([G,ie])=>bS(G,ie)).filter(G=>G!=null).join(" + "),v=Object.entries(s).map(([G,ie])=>`${G}: ${JSON.stringify(ie)}`).join(" ; "),S=ue.check("scene:stats:verbose"),M=S?u1():null,C=S?js.flush():{},D=Object.entries(C),A=[],w=[];for(const[G,ie]of D)G.endsWith(":aggregation")&&Array.isArray(ie)?A.push(`${G.replace(":aggregation","")}(${ie.join(",")})`):G.endsWith(":nodeData")&&typeof ie=="number"&&w.push(`${G.replace(":nodeData","")}(${ie})`);const L=A.length>0?`Aggregation: ${A.join(", ")}`:null,O=w.length>0?`NodeData: ${w.join(", ")}`:null,R=[`${bS("\u23F1\uFE0F",p,g)} (${b})`,`${v}`,L,O,`Layers: ${S?Uf(o,l):t.size}`,S?`Nodes: ${Uf(c,h)}`:null,S?`Ops: ${Uf(u,d)}`:null,M].filter(ot),_=new nf(i),E=new Map(R.map(G=>[G,_.measureText(G)])),F=Math.max(...Array.from(E.values(),G=>G.width)),z=y1(E.values(),G=>G.height),K=2+r.x;i.save();try{i.fillStyle=a?.background??"white",i.fillRect(K,0,F,z),i.fillStyle=a?.foreground??"black";let G=0;for(const[ie,de]of E.entries())G+=de.height,i.fillText(ie,K,G)}catch(G){j.warnOnce("Error during debug stats rendering",G)}finally{i.restore()}}function d1(t){const e=Dl(Hn("agChartsSceneDebug")),i=[];for(const n of e)n==="layout"?i.push("seriesRoot","legend","root",/Axis-\d+-axis/):i.push(n);t.debugNodeSearch=i}function g1(t,e){t.save();try{for(const[i,n]of Object.entries(e)){const s=Ze.toCanvas(n);if(!s){j.log(`Scene.render() - no bbox for debugged node [${i}].`);continue}t.globalAlpha=.8,t.strokeStyle="red",t.lineWidth=1,t.strokeRect(s.x,s.y,s.width,s.height),t.fillStyle="red",t.strokeStyle="white",t.font="16px sans-serif",t.textBaseline="top",t.textAlign="left",t.lineWidth=2,t.strokeText(i,s.x,s.y,s.width),t.fillText(i,s.x,s.y,s.width)}}catch(i){j.warnOnce("Error during debug rendering",i)}finally{t.restore()}}var p1=new Set,f1=new Set(["gradient","zIndex","clipRect","cachedBBox","childNodeCounts","path","__zIndex","name","__scalingCenterX","__scalingCenterY","__rotationCenterX","__rotationCenterY","_previousDatum","__fill","__lineDash","borderPath","borderClipPath","_clipPath"]);function m1(t){const{...e}=t;for(const i of Object.keys(e))f1.has(i)||typeof e[i]!="number"&&typeof e[i]!="string"&&typeof e[i]!="boolean"&&(p1.add(i),delete e[i]);return e}function rd(t,e){if(!ue.check(!0,"scene"))return{};let i=0;return{node:e==="json"?m1(t):t,name:t.name??t.id,dirty:t instanceof ne?t.dirty:void 0,...Array.from(t instanceof ne?t.children():[],n=>rd(n,e)).reduce((n,s)=>{let{name:r}=s;const{node:{visible:a,opacity:o,zIndex:l,translationX:c,translationY:h,rotation:u,scalingX:d,scalingY:g},node:p}=s;(!a||o<=0)&&(r=`(${r})`),ne.is(p)&&p.renderToOffscreenCanvas&&(r=`*${r}*`);const f=Array.isArray(l)?`(${l.join(", ")})`:l,m=[`${(i++).toString().padStart(3,"0")}|`,`${r??"<unknown>"}`,`z: ${f}`,c&&`x: ${c}`,h&&`y: ${h}`,u&&`r: ${u}`,d!=null&&d!==1&&`sx: ${d}`,g!=null&&g!==1&&`sy: ${g}`].filter(v=>!!v).join(" ");let y=m,b=1;for(;n[y]!=null&&b<100;)y=`${m} (${b++})`;return n[y]=s,n},{})}}function yS(t){const e=t instanceof ne?t.dirty:void 0;if(!e)return{dirtyTree:{},paths:[]};const i=Array.from(t instanceof ne?t.children():[],r=>yS(r)).filter(r=>r.paths.length>0),n=ne.is(t)?t.name??t.id:t.id,s=i.length?i.flatMap(r=>r.paths).map(r=>`${n}.${r}`):[n];return{dirtyTree:{name:n,node:t,dirty:e,...i.map(r=>r.dirtyTree).filter(r=>r.dirty!=null).reduce((r,a)=>(r[a.name??"<unknown>"]=a,r),{})},paths:s}}function Uf(t,e){const i=t+e;return`${t} / ${i} (${Math.round(100*t/i)}%)`}function bS(t,e,i){const n=i==null?e:i-e;return`${t}: ${Math.round(n*100)/100}ms`}function y1(t,e){let i=0;for(const n of t)i+=e(n);return i}function vS(t=!1){if(!Bo){t&&(ma=0);return}!t&&ma>0||(Bo.destroy(),Bo=void 0,t&&(ma=0))}var wc=(t,{x0:e,y0:i,x1:n,y1:s,cx:r,cy:a},o,l)=>{if(l&&t.moveTo(e,i),e!==n||i!==s){const c=Math.atan2(i-a,e-r),h=Math.atan2(s-a,n-r);t.arc(r,a,o,c,h)}else t.lineTo(e,i)},kt=class extends ga{constructor(){super(...arguments),this.path=new Fo,this._clipX=Number.NaN,this._clipY=Number.NaN,this.clip=!1,this._dirtyPath=!0,this.lastPixelRatio=Number.NaN}set clipX(t){this._clipX=t,this.dirtyPath=!0}set clipY(t){this._clipY=t,this.dirtyPath=!0}set dirtyPath(t){this._dirtyPath!==t&&(this._dirtyPath=t,t&&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(t){this._dirtyPath=!0,super.onChangeDetection(t)}computeBBox(){return this.updatePathIfDirty(),this.path.computeBBox()}isPointInPath(t,e){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(t,e)}distanceSquared(t,e){return this.distanceSquaredTransformedPoint(t,e)}svgPathData(t){return this.updatePathIfDirty(),this.path.toSVG(t)}distanceSquaredTransformedPoint(t,e){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(t,e)?0:this.path.distanceSquared(t,e)}isDirtyPath(){return!1}updatePath(){}updatePathIfDirty(){(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1)}preRender(t){return t.devicePixelRatio!==this.lastPixelRatio&&(this.dirtyPath=!0),this.lastPixelRatio=t.devicePixelRatio,this.updatePathIfDirty(),super.preRender(t,this.path.commands.length)}render(t){const{ctx:e}=t;if(this.clip&&!Number.isNaN(this._clipX)&&!Number.isNaN(this._clipY)){e.save();try{const i=this.strokeWidth/2;this._clipPath??(this._clipPath=new Fo),this._clipPath.clear(),this._clipPath.rect(-i,-i,this._clipX+i,this._clipY+i+i),e.clip(this._clipPath?.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(e)}finally{e.restore()}}else this._clipPath=void 0,this.drawPath(e);this.fillShadow?.markClean(),super.render(t)}drawPath(t){this.fillStroke(t,this.path.getPath2D())}toSVG(){if(!this.visible)return;const t=ut("path");t.setAttribute("d",this.svgPathData());const e=this.applySvgFillAttributes(t,[]);return this.applySvgStrokeAttributes(t),{elements:[t],defs:e}}};kt.className="Path",x([Z()],kt.prototype,"clip",2),x([Z()],kt.prototype,"clipX",1),x([Z()],kt.prototype,"clipY",1);function ad(t,e,i,n,s){let r=!1,a=!1,o=n-Math.sqrt(Math.max(s**2-i**2,0)),l=0,c=0,h=i-Math.sqrt(Math.max(s**2-n**2,0));return o>t?(r=!0,o=t,l=i-Math.sqrt(Math.max(s**2-(n-t)**2))):Ti(o,0)&&(o=0),h>e?(a=!0,c=n-Math.sqrt(Math.max(s**2-(i-e)**2)),h=e):Ti(h,0)&&(h=0),{leading0:o,leading1:l,trailing0:c,trailing1:h,leadingClipped:r,trailingClipped:a}}function od(t,e,i,n,s,r,a){let{topLeft:o,topRight:l,bottomRight:c,bottomLeft:h}=r;const u=Math.max(o+h,l+c),d=Math.max(o+l,h+c);if(u<=0&&d<=0){if(a==null)t.rect(e,i,n,s);else{const D=Math.max(e,a.x),A=Math.min(e+n,a.x+a.width),w=Math.max(i,a.y),L=Math.min(i+s,a.y+a.height);t.rect(D,w,A-D,L-w)}return}else if(a==null&&o===l&&o===c&&o===h){t.roundRect(e,i,n,s,o);return}if(n<0&&(e+=n,n=Math.abs(n)),s<0&&(i+=s,s=Math.abs(s)),n<=0||s<=0)return;if(a==null)a=new U(e,i,n,s);else{const D=Math.max(e,a.x),A=Math.min(e+n,a.x+a.width),w=Math.max(i,a.y),L=Math.min(i+s,a.y+a.height);a=new U(D,w,A-D,L-w)}const g=Math.max(u/s,d/n,1);g>1&&(o/=g,l/=g,c/=g,h/=g);let p=!0,f=!0,m=!0,y=!0,b,v,S,M;if(p){const D=ad(a.height,a.width,Math.max(e+o-a.x,0),Math.max(i+o-a.y,0),o);D.leadingClipped&&(y=!1),D.trailingClipped&&(f=!1);const A=Math.max(a.x+D.leading1,a.x),w=Math.max(a.y+D.leading0,a.y),L=Math.max(a.x+D.trailing1,a.x),O=Math.max(a.y+D.trailing0,a.y),R=e+o,_=i+o;b={x0:A,y0:w,x1:L,y1:O,cx:R,cy:_}}if(f){const D=ad(a.width,a.height,Math.max(i+l-a.y,0),Math.max(a.x+a.width-(e+n-l),0),l);D.leadingClipped&&(p=!1),D.trailingClipped&&(m=!1);const A=Math.min(a.x+a.width-D.leading0,a.x+a.width),w=Math.max(a.y+D.leading1,a.y),L=Math.min(a.x+a.width-D.trailing0,a.x+a.width),O=Math.max(a.y+D.trailing1,a.y),R=e+n-l,_=i+l;v={x0:A,y0:w,x1:L,y1:O,cx:R,cy:_}}if(m){const D=ad(a.height,a.width,Math.max(a.x+a.width-(e+n-c),0),Math.max(a.y+a.height-(i+s-c),0),c);D.leadingClipped&&(f=!1),D.trailingClipped&&(y=!1);const A=Math.min(a.x+a.width-D.leading1,a.x+a.width),w=Math.min(a.y+a.height-D.leading0,a.y+a.height),L=Math.min(a.x+a.width-D.trailing1,a.x+a.width),O=Math.min(a.y+a.height-D.trailing0,a.y+a.height),R=e+n-c,_=i+s-c;S={x0:A,y0:w,x1:L,y1:O,cx:R,cy:_}}if(y){const D=ad(a.width,a.height,Math.max(a.y+a.height-(i+s-h),0),Math.max(e+h-a.x,0),h);D.leadingClipped&&(m=!1),D.trailingClipped&&(p=!1);const A=Math.max(a.x+D.leading0,a.x),w=Math.min(a.y+a.height-D.leading1,a.y+a.height),L=Math.max(a.x+D.trailing0,a.x),O=Math.min(a.y+a.height-D.trailing1,a.y+a.height),R=e+h,_=i+s-h;M={x0:A,y0:w,x1:L,y1:O,cx:R,cy:_}}let C=!1;p&&b!=null&&(wc(t,b,o,!C),C||(C=!0)),f&&v!=null&&(wc(t,v,l,!C),C||(C=!0)),m&&S!=null&&(wc(t,S,c,!C),C||(C=!0)),y&&M!=null&&wc(t,M,h,!C),t.closePath()}var Tt=class extends kt{constructor(){super(...arguments),this.borderPath=new Fo,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(t){this.topLeftCornerRadius=t,this.topRightCornerRadius=t,this.bottomRightCornerRadius=t,this.bottomLeftCornerRadius=t}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.__strokeWidth||!!(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){const{path:t,borderPath:e,__crisp:i,__topLeftCornerRadius:n,__topRightCornerRadius:s,__bottomRightCornerRadius:r,__bottomLeftCornerRadius:a}=this;let{__x:o,__y:l,__width:c,__height:h,__strokeWidth:u,__clipBBox:d}=this;const p=1/(this.layerManager?.canvas.pixelRatio??1);let f=1;if(t.clear(),e.clear(),c===0||h===0){this.effectiveStrokeWidth=0,this.lastUpdatePathStrokeWidth=0,this.microPixelEffectOpacity=0;return}if(i&&(c<=p&&(f*=c/p),h<=p&&(f*=h/p),c=this.align(o,c),h=this.align(l,h),o=this.align(o),l=this.align(l),d=d==null?void 0:new U(this.align(d.x),this.align(d.y),this.align(d.x,d.width),this.align(d.y,d.height))),u)if(c<p){const y=o+p/2;e.moveTo(y,l),e.lineTo(y,l+h),u=p,this.borderClipPath=void 0}else if(h<p){const y=l+p/2;e.moveTo(o,y),e.lineTo(o+c,y),u=p,this.borderClipPath=void 0}else if(u<c&&u<h){const y=u/2;o+=y,l+=y,c-=u,h-=u;const b=d?.clone().shrink(y),v={topLeft:n>0?n-u:0,topRight:s>0?s-u:0,bottomRight:r>0?r-u:0,bottomLeft:a>0?a-u:0};this.borderClipPath=void 0,c>0&&h>0&&(b==null||b?.width>0&&b?.height>0)&&(od(t,o,l,c,h,v,b),od(e,o,l,c,h,v,b))}else this.borderClipPath=this.borderClipPath??new Fo,this.borderClipPath.clear(),this.borderClipPath.rect(o,l,c,h),e.rect(o,l,c,h);else{const y={topLeft:n,topRight:s,bottomRight:r,bottomLeft:a};this.borderClipPath=void 0,od(t,o,l,c,h,y,d)}if([n,s,r,a].every(b1)){let y=function(S,M){return v.getBBox().distanceSquared(S,M)};var m=y;const b=this.getBBox();this.hittester=b.containsPoint.bind(b);const v=this;this.distanceSquared=y}else this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquaredTransformedPoint;this.effectiveStrokeWidth=u,this.lastUpdatePathStrokeWidth=u,this.microPixelEffectOpacity=f}computeBBox(){const{__x:t,__y:e,__width:i,__height:n,__clipBBox:s}=this;return s?.clone()??new U(t,e,i,n)}isPointInPath(t,e){return this.hittester(t,e)}get midPoint(){return{x:this.__x+this.__width/2,y:this.__y+this.__height/2}}setStaticProperties(t,e,i,n,s,r,a,o){this.__drawingMode=t,this.__topLeftCornerRadius=e,this.__topRightCornerRadius=i,this.__bottomRightCornerRadius=n,this.__bottomLeftCornerRadius=s,this.__visible=r,this.__crisp=a,this.__fillShadow=o,this.dirtyPath=!0,this.markDirty()}resetAnimationProperties(t,e,i,n,s,r){this.__x=t,this.__y=e,this.__width=i,this.__height=n,this.__opacity=s,this.__clipBBox=r,this.dirtyPath=!0,this.markDirty()}distanceSquared(t,e){return this.distanceCalculator(t,e)}applyFillAndAlpha(t){super.applyFillAndAlpha(t),t.globalAlpha*=this.microPixelEffectOpacity}applyStrokeAndAlpha(t){super.applyStrokeAndAlpha(t),t.globalAlpha*=this.microPixelEffectOpacity}renderStroke(t){const{stroke:e,effectiveStrokeWidth:i}=this;if(e&&i){const{globalAlpha:n}=t,{lineDash:s,lineDashOffset:r,lineCap:a,lineJoin:o,borderPath:l,borderClipPath:c}=this;c&&t.clip(c.getPath2D()),this.applyStrokeAndAlpha(t),t.lineWidth=i,s&&t.setLineDash(s),r&&(t.lineDashOffset=r),a&&(t.lineCap=a),o&&(t.lineJoin=o),t.stroke(l.getPath2D()),t.globalAlpha=n}}};Tt.className="Rect",x([We()],Tt.prototype,"x",2),x([We()],Tt.prototype,"y",2),x([We()],Tt.prototype,"width",2),x([We()],Tt.prototype,"height",2),x([We()],Tt.prototype,"topLeftCornerRadius",2),x([We()],Tt.prototype,"topRightCornerRadius",2),x([We()],Tt.prototype,"bottomRightCornerRadius",2),x([We()],Tt.prototype,"bottomLeftCornerRadius",2),x([We({equals:Au})],Tt.prototype,"clipBBox",2),x([We()],Tt.prototype,"crisp",2);function b1(t){return t===0}var Vi=class Ui extends ga{constructor(e){super(e),this.x=0,this.y=0,this.lines=[],this.text=void 0,this.fontCache=void 0,this.fontSize=Ui.defaultFontSize,this.fontFamily="sans-serif",this.textAlign="start",this.textBaseline="alphabetic",this.boxPadding=0,this.trimText=e?.trimText??!0}onTextChange(){if(this.richText?.clear(),this.textMap?.clear(),ce(this.text))this.lines=[],this.richText??(this.richText=new ne),this.richText.setScene(this.scene),this.richText.append(this.text.flatMap(e=>et(e.text).split($s)).filter(Boolean).map(()=>new Ui({trimText:!1})));else{const e=et(this.text).split($s);this.lines=this.trimText?e.map(i=>i.trim()):e}}get font(){return this.fontCache??(this.fontCache=Pg(this)),this.fontCache}resolveFont(){if(this.hasRenderableText())return this.font}static measureBBox(e,i,n,s){if(ce(e)){const{font:r,lineHeight:a,textAlign:o,textBaseline:l}=s,{width:c,height:h,lineMetrics:u}=Ds(e,r),d=a?a*u.length:h,g=Ui.calcTopOffset(d,u[0],l),p=Ui.calcLeftOffset(c,o);return new U(i-p,n-g,c,d)}else return Ui.computeBBox(et(e).split($s),i,n,s)}static computeBBox(e,i,n,s){const{font:r,lineHeight:a,textAlign:o,textBaseline:l,isRtl:c}=s,{width:h,height:u,lineMetrics:d}=di(r).measureLines(e),g=a?a*d.length:u,p=Ui.calcTopOffset(g,d[0],l),f=Ui.calcLeftOffset(h,o,c);return new U(i-f,n-p,h,g)}static calcTopOffset(e,i,n){switch(n){case"alphabetic":return i?.ascent??0;case"middle":return e/2;case"bottom":return e;default:return 0}}static calcSegmentedTopOffset(e,i,n){switch(n){case"alphabetic":return i[0]?.ascent??0;case"middle":return i.length===1?i[0].ascent+i[0].segments.reduce((s,r)=>Math.min(s,di(r).baselineDistance("middle")),0):e/2;case"bottom":return e;default:return 0}}static calcLeftOffset(e,i,n){let s=0;switch(i){case"center":s=.5;break;case"right":case(n?"start":"end"):s=1}return e*s}getBBox(){const e=super.getBBox();if(!this.textMap?.size||!ce(this.text))return e;const{height:i,lineMetrics:n}=Ds(this.text,this),s=Ui.calcSegmentedTopOffset(i,n,this.textBaseline),r=this.y-s;return e.y===r?e:new U(e.x,r,e.width,e.height)}computeBBox(){if(!this.hasRenderableText())return new U(this.x,this.y,0,0);if(this.generateTextMap(),this.textMap?.size){const l=U.merge(this.textMap.values());return l.x=this.x-Ui.calcLeftOffset(l.width,this.textAlign),l.y=this.y,l}const e=this.scene?.isRtl,{x:i,y:n,lines:s,textBaseline:r,textAlign:a}=this,o=Ui.computeBBox(s,i,n,{font:this,textBaseline:r,textAlign:a,isRtl:e});return this.boxing!=null&&o.grow(this.boxPadding),o}getTextMeasureBBox(){return this.computeBBox()}getPlainText(){return Ue(this.text)}isPointInPath(e,i){return this.getBBox()?.containsPoint(e,i)??!1}setScene(e){this.richText?.setScene(e),super.setScene(e)}generateTextMap(){if(!ce(this.text)||this.textMap?.size)return;this.textMap??(this.textMap=new Map);let e=0;const i=this.richText.children();for(const{width:n,height:s,ascent:r,segments:a}of Ds(this.text,this).lineMetrics){let o=0;for(const{color:l,textMetrics:c,...h}of a){const u=i.next().value;u.x=this.x-n/2+o,u.y=r+e,u.setProperties({...h,fill:l??this.fill});const d=u.getBBox();this.textMap.set(u,d),o+=c.width}e+=s}}render(e){const{ctx:i,stats:n}=e;if(!this.layerManager||!this.hasRenderableText()){n&&(n.nodesSkipped+=1);return}if(ce(this.text)&&this.richText){this.generateTextMap();const s=this.richText.getBBox(),{width:r,height:a,lineMetrics:o}=Ds(this.text,this);let l=0;switch(this.textAlign){case"left":case"start":l=r/2;break;case"right":case"end":l=r/-2}const c=this.y-Ui.calcSegmentedTopOffset(a,o,this.textBaseline);this.renderBoxing(e,s.clone().translate(l,c)),i.save(),i.translate(l,c),this.richText.opacity=this.opacity,this.richText.render(e),i.restore()}else this.renderText(e);if(Ui.debug.check()){const s=this.getBBox();i.lineWidth=this.textMap?.size?2:1,i.strokeStyle=this.textMap?.size?"blue":"red",i.strokeRect(s.x,s.y,s.width,s.height)}super.render(e)}markDirty(e){return this.textMap?.clear(),super.markDirty(e)}renderText(e){const{fill:i,stroke:n,strokeWidth:s,font:r,textAlign:a}=this;if(!i&&!(n&&s)||!this.layerManager)return super.render(e);const{ctx:o}=e;o.font!==r&&(o.font=r),o.textAlign=a,this.renderBoxing(e),this.fillStroke(o)}renderBoxing(e,i){if(!this.boxing)return;const n=i??Ui.computeBBox(this.lines,this.x,this.y,this);if(n.width===0||n.height===0)return;const{x:s,y:r,width:a,height:o}=n.grow(this.boxPadding);this.boxing.opacity=this.opacity,this.boxing.x=s,this.boxing.y=r,this.boxing.width=a,this.boxing.height=o,this.boxing.preRender(e),this.boxing.render(e)}executeFill(e){this.renderLines((i,n,s)=>e.fillText(i,n,s))}executeStroke(e){this.renderLines((i,n,s)=>e.strokeText(i,n,s))}renderLines(e){const{x:i,y:n,lines:s}=this;if(!Number.isFinite(i)||!Number.isFinite(n))return;const r=di(this),{lineMetrics:a}=r.measureLines(s),{textBaseline:o,lineHeight:l=r.lineHeight()}=this;let c=0;o==="top"?c=a[0].ascent:(o==="middle"||o==="bottom")&&(c=l*(1-s.length),o==="middle"?(c/=2,c-=r.baselineDistance(o)):c-=a[0].descent);for(const h of a)e(h.text,i,n+c),c+=l}setFont(e){this.fontFamily=e.fontFamily,this.fontSize=e.fontSize,this.fontStyle=e.fontStyle,this.fontWeight=e.fontWeight}setAlign(e){this.textAlign=e.textAlign,this.textBaseline=e.textBaseline}setBoxing(e){const i=e.border?.enabled?e.border?.stroke:void 0;e.fill!=null||i!=null?(this.boxing??(this.boxing=new Tt({scene:this.scene})),this.boxing.fill=e.fill,this.boxing.fillOpacity=e.fillOpacity??1,this.boxing.cornerRadius=e.cornerRadius??0,this.boxing.stroke=i,this.boxing.strokeWidth=e.border?.strokeWidth??0,this.boxing.strokeOpacity=e.border?.strokeOpacity??1,this.boxPadding=e.padding??0):this.boxing&&(this.boxing.destroy(),this.boxing=void 0)}hasBoxing(){return this.boxing!=null}getBoxingProperties(){const{fill:e,fillOpacity:i,cornerRadius:n,stroke:s,strokeWidth:r,strokeOpacity:a}=this.boxing??{};return{border:{enabled:s!=null,stroke:s,strokeWidth:r,strokeOpacity:a},cornerRadius:n,fill:e,fillOpacity:i,padding:this.boxPadding}}toSVG(){if(!this.visible||!this.hasRenderableText())return;const e=this.text;if(e==null)return;const i=ut("text");if(ce(e))for(const n of e){const s=ut("tspan");dS(s,{fontSize:n.fontSize??this.fontSize,fontFamily:n.fontFamily??this.fontFamily,fontWeight:n.fontWeight??this.fontWeight,fontStyle:n.fontStyle??this.fontStyle}),this.applySvgFillAttributes(s),s.textContent=et(n.text),i.append(s)}else this.applySvgFillAttributes(i),dS(i,this),i.setAttribute("text-anchor",{center:"middle",left:"start",right:"end",start:"start",end:"end"}[this.textAlign??"start"]),i.setAttribute("alignment-baseline",this.textBaseline),i.setAttribute("x",String(this.x)),i.setAttribute("y",String(this.y)),i.textContent=et(e);return{elements:[i]}}hasRenderableText(){const{text:e}=this;return e==null?!1:ce(e)?!0:et(e)!==""}};Vi.className="Text",Vi.debug=ue.create(!0,"scene:text"),Vi.defaultFontSize=10,x([Z()],Vi.prototype,"x",2),x([Z()],Vi.prototype,"y",2),x([qu({changeCb:t=>t.onTextChange()})],Vi.prototype,"text",2),x([Z({changeCb:t=>{t.fontCache=void 0}})],Vi.prototype,"fontStyle",2),x([Z({changeCb:t=>{t.fontCache=void 0}})],Vi.prototype,"fontWeight",2),x([Z({changeCb:t=>{t.fontCache=void 0}})],Vi.prototype,"fontSize",2),x([Z({changeCb:t=>{t.fontCache=void 0}})],Vi.prototype,"fontFamily",2),x([Z()],Vi.prototype,"textAlign",2),x([Z()],Vi.prototype,"textBaseline",2),x([Z()],Vi.prototype,"lineHeight",2);var _i=Vi,xS=fa(_i),zo=fa(Vo(_i)),SS=class{constructor(){this.registeredListeners=new Map}addListener(t,e){const i={symbol:Symbol(t),handler:e};return this.registeredListeners.has(t)?this.registeredListeners.get(t).push(i):this.registeredListeners.set(t,[i]),()=>this.removeListener(i.symbol)}removeListener(t){for(const[e,i]of this.registeredListeners.entries()){const n=i.findIndex(s=>s.symbol===t);if(n>=0){i.splice(n,1),i.length===0&&this.registeredListeners.delete(e);break}}}dispatch(t,...e){for(const i of this.getListenersByType(t))try{i.handler(...e)}catch(n){j.errorOnce(n)}}getListenersByType(t){return this.registeredListeners.get(t)??[]}destroy(){this.registeredListeners.clear()}},ns={millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e",month:"%b",year:"%Y"},v1={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},x1=/%[-_0]?L/,S1=/%[-_0]?S/,M1=/%[-_0]?M/,I1=/%[-_0]?[HI]/,D1=/^%[-_0]?[de]$/,C1=/^%[-_0]?[Bbm]$/,A1=/^%[-_0]?[Yy]$/;function w1(t,e,i){if(typeof t=="string")return t;t??(t=ns);const{millisecond:n=ns.millisecond,second:s=ns.second,minute:r=ns.minute,hour:a=ns.hour,day:o=ns.day,month:l=ns.month,year:c=ns.year}=t,h=pi[e],u=v1[e],d=i?pi[i]:-1;if(d<pi.year&&h>=pi.year&&!A1.test(c)||d<pi.month&&h>=pi.month&&!C1.test(l)||d<pi.day&&h>=pi.day&&!D1.test(o))return u;let g;switch(e){case"year":return c;case"month":return d<pi.year?`${l} ${c}`:l;case"day":return d<pi.year?`${l} ${o} ${c}`:`${l} ${o}`;case"hour":g=a;break;case"minute":g=r;break;case"second":g=s;break;case"millisecond":g=n;break;default:return u}if(h>=pi.hour&&!I1.test(g)||h>=pi.minute&&!M1.test(g)||h>=pi.second&&!S1.test(g)||h>=pi.millisecond&&!x1.test(g))return u;let p;return d<pi.year?p=`${l} ${o} ${c}`:d<pi.month&&(p=`${l} ${o}`),p?`${g} ${p}`:g}var xr=class Sg extends SS{constructor(){super(...arguments),this.formats=new Map,this.dateFormatter=ac((e,i,n,s,r)=>{const a=Sg.mergeSpecifiers(e,i)??ns;return Sg.getFormatter("date",a,n,s,{truncateDate:r})}),this.formatter=void 0}static mergeSpecifiers(...e){let i;for(const n of e)ke(n)&&ke(i)?i={...i,...n}:i=n;return i}static getFormatter(e,i,n,s="long",{truncateDate:r}={}){if(ke(i)){if(e!=="date"){j.warn("Date formatter configuration is not supported for non-date types.");return}n??(n="millisecond");const a=s==="component"?i?.[n]??ns[n]:w1(i,n,r);return Eo(a)}switch(e){case"number":{const a=_h(i);return a==null?void 0:Ug(a)}case"date":return Eo(i);case"category":return a=>i.replace("%s",String(a))}}setFormatter(e){this.formatter!==e&&(this.formatter=e,this.formats.clear(),this.dateFormatter.reset(),this.dispatch("format-changed"))}format(e,i,{specifier:n,truncateDate:s,allowNull:r}={}){if(i.value==null&&!r)return;const{formatter:a}=this;if(a==null)return;if(typeof a=="function"){const h=e(a,i);return h==null?void 0:String(h)}const o=a[i.property];if(o==null)return;if(typeof o=="function"){const h=e(o,i);return h==null?h:et(h)}else if(i.type==="date"){const{unit:h,style:u}=i;return this.dateFormatter(o,n,h,u,s)?.(i.value)}const l=n??o;if(typeof l!="string")return;let c=this.formats.get(l);return c==null&&(c=Sg.getFormatter(i.type,l),this.formats.set(l,c)),c?.(i.value,i.type==="number"?i.fractionDigits:void 0)}defaultFormat(e,{specifier:i,truncateDate:n}={}){const{formatter:s}=this,r=typeof s=="function"?void 0:s?.[e.property];switch(e.type){case"date":{const{unit:a,style:o}=e,l=r!=null&&typeof r!="function"?r:void 0;return this.dateFormatter(l,i,a,o,n)?.(e.value)??String(e.value)}case"number":return Qr(e.value,e.fractionDigits);case"category":return e.value==null?"":Array.isArray(e.value)?e.value.join(" - "):typeof e.value=="string"?e.value:typeof e.value=="number"?Qr(e.value):String(e.value)}}},Go=class{constructor(){this.enabled=!0}};x([I],Go.prototype,"enabled",2),x([I],Go.prototype,"stroke",2),x([I],Go.prototype,"strokeWidth",2),x([I],Go.prototype,"strokeOpacity",2);var Ji=class extends Te{constructor(){super(...arguments),this.border=new Go}};x([I],Ji.prototype,"border",2),x([I],Ji.prototype,"color",2),x([I],Ji.prototype,"cornerRadius",2),x([I],Ji.prototype,"fill",2),x([I],Ji.prototype,"fillOpacity",2),x([I],Ji.prototype,"fontStyle",2),x([I],Ji.prototype,"fontWeight",2),x([I],Ji.prototype,"fontSize",2),x([I],Ji.prototype,"fontFamily",2),x([I],Ji.prototype,"padding",2);var Qi=class extends Ji{constructor(){super(...arguments),this.enabled=!1,this._cachedFormatter=void 0}formatValue(t,e,i,n){const{formatter:s,format:r}=this;let a;if(s!=null&&(a??(a=t(s,n))),r!=null){let o=this._cachedFormatter;(o?.type!==e||o?.format!==r)&&(o={type:e,format:r,formatter:xr.getFormatter(e,r)},this._cachedFormatter=o),a??(a=o.formatter?.(i))}return a==null||ce(a)?a:String(a)}};x([I],Qi.prototype,"enabled",2),x([I],Qi.prototype,"formatter",2),x([I],Qi.prototype,"format",2),x([I],Qi.prototype,"itemStyler",2);function jo(t){const{enabled:e=!1,stroke:i}=t?.border??{},s=t?.fill!=null||e&&i!=null?t?.padding:null;if(s==null)return{bottom:0,left:0,right:0,top:0};if(typeof s=="number")return{bottom:s,left:s,right:s,top:s};{const{bottom:r=0,left:a=0,right:o=0,top:l=0}=s;return{bottom:r,left:a,right:o,top:l}}}function MS(t,e){const i=t?.valueOf(),n=e?.valueOf();return typeof i!="number"||typeof n!="number"?[void 0,void 0]:i<n?[0,1]:[1,0]}var IS=class Tb extends Qu{constructor(e=[],i=[]){super(),this.range=i,this.defaultTickCount=Tb.defaultTickCount,this.defaultClamp=!1,this._domain=[],this.domainNeedsValueOf=!0,this.d0Cache=Number.NaN,this.d1Cache=Number.NaN,this.domain=e}static is(e){return e instanceof Tb}get domain(){return this._domain}set domain(e){if(this._domain=e,e&&e.length>=2){const i=e[0];this.domainNeedsValueOf=i!=null&&typeof i=="object",this.domainNeedsValueOf?(this.d0Cache=e[0].valueOf(),this.d1Cache=e[1].valueOf()):(this.d0Cache=e[0],this.d1Cache=e[1])}else this.d0Cache=Number.NaN,this.d1Cache=Number.NaN}normalizeDomains(...e){return DS(...e)}calcBandwidth(e=1,i=1){const{domain:n}=this,s=this.getPixelRange();if(n.length===0)return s;let a=Math.abs(this.d1Cache-this.d0Cache)/e+1;if(i!==0){const o=Math.floor(s);a=Math.min(a,o)}return s/Math.max(1,a)}convert(e,i){const{domain:n}=this;if(!n||n.length<2||e==null)return Number.NaN;const{range:s}=this,r=i?.clamp??this.defaultClamp;let a=this.d0Cache,o=this.d1Cache,l=typeof e=="number"?e:e.valueOf();if(this.transform&&(a=this.transform(a),o=this.transform(o),l=this.transform(l)),r){const[h,u]=At([a,o]);if(l<h)return s[0];if(l>u)return s[1]}if(a===o)return(s[0]+s[1])/2;if(l===a)return s[0];if(l===o)return s[1];const c=s[0];return c+(l-a)/(o-a)*(s[1]-c)}invert(e,i){const{domain:n}=this;if(n.length<2)return;let s=this.d0Cache,r=this.d1Cache;this.transform&&(s=this.transform(s),r=this.transform(r));const{range:a}=this,[o,l]=a;let c;return o===l?c=this.toDomain((s+r)/2):c=this.toDomain(s+(e-o)/(l-o)*(r-s)),this.transformInvert?this.transformInvert(c):c}getDomainMinMax(){return ed(this.domain)}getPixelRange(){const[e,i]=this.range;return Math.abs(i-e)}};IS.defaultTickCount=5;var Ve=IS;function DS(...t){let e,i=1/0,n,s=-1/0;for(const r of t){const a=r.domain;for(const o of a){const l=o.valueOf();l<i&&(i=l,e=o),l>s&&(s=l,n=o)}}return e!=null&&n!=null?{domain:[e,n],animatable:!0}:{domain:[],animatable:!1}}var k1=1e3,CS=20;function AS(t,e=0,i=t.length-1){const n=i-e+1;if(n<2)return{isUniform:!1};if(e<0||i>=t.length)return{isUniform:!1};const s=Array.from({length:CS},(l,c)=>e+Math.floor(c*(n-1)/(CS-1))),r=s.map(l=>t[l].valueOf()),a=(r.at(-1)-r[0])/(n-1);if(!Number.isFinite(a)||a===0)return{isUniform:!1};const o=Math.abs(a*.01);for(let l=1;l<r.length;l++){const c=s[l]-s[l-1],h=(r[l]-r[l-1])/c;if(Math.abs(h-a)>o)return{isUniform:!1}}return{isUniform:!0,interval:a}}var ks=class _A extends En{static is(e){return e instanceof _A}toDomain(e){return new Date(e)}get reversed(){const{domain:e}=this;return e.length>0&&e[0].valueOf()>e.at(-1).valueOf()}get numericBands(){return this.bands.map(e=>e.valueOf())}convert(e,i){this.refresh(),e instanceof Date||(e=new Date(e));const{domain:n,reversed:s}=this,r=this.numericBands,a=r.length;if(n.length<=0)return Number.NaN;const o=this.ordinalRange(0),l=this.ordinalRange(a-1);if(a===0)return o;if(i?.clamp===!0){const{range:v}=this;if(e.valueOf()<r[0])return v[0];if(e.valueOf()>r.at(-1))return v[1]}if((i?.alignment??0)!==2){const v=super.convert(e,i);return s?l-(v-o):v}const h=e.valueOf();let u=this.findIndex(e)??0,d;s?(u=Math.min(Math.max(u,1),a-1),d=-1):(u=Math.min(Math.max(u,0),a-2),d=1);const g=r[u],p=r[u+d],f=this.ordinalRange(u),m=this.ordinalRange(u+d),b=(h-g)/(p-g)*(m-f)+f;return s?l-(b-o):b}invert(e,i=!1){this.refresh();const{domain:n}=this;if(n.length<=0)return;const s=this.bands,r=this.getBandCountForUpdate(),a=n[0].valueOf()>n.at(-1).valueOf();let o;return i?o=this.invertNearestIndex(e-this.bandwidth/2):o=xo(0,r-1,c=>this.ordinalRange(c)>=e)??r-1,s[a?r-1-o:o]}getUniformityCache(e){}findIndex(e,i=0,n=!1){if(e==null)return;const s=this.numericBands,r=s.length;if(r===0)return;if(r===1)return 0;const a=e.valueOf();return i===1!==n?xo(0,r-1,l=>s[l]>=a):vo(0,r-1,l=>s[l]<=a)}};function wS(t){switch(t.type){case"line":return t.value;case"range":return t.range}}function kS(t,e){const i=wS(t);if(i==null)return!1;const n=Ve.is(e)||ks.is(e),s=r=>y0(r,n)&&!Number.isNaN(e.convert(r,{clamp:!0}));if(t.type==="range"){const[r,a]=i;return s(r)&&s(a)}else return s(i)}var T1={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}},L1={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}},N1={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}},O1={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}},ya=class extends Ji{constructor(){super(...arguments),this.padding=5}};x([I],ya.prototype,"enabled",2),x([I],ya.prototype,"padding",2),x([I],ya.prototype,"text",2),x([I],ya.prototype,"position",2),x([I],ya.prototype,"rotation",2),x([I],ya.prototype,"parallel",2);var fi=class extends Te{constructor(){super(),this.id=Nn(this),this.defaultColorRange=[],this.fill="#c16068",this.label=new ya,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.gridPadding=0,this.position="top",this.rangeGroup=new ne({name:this.id}),this.lineGroup=new ne({name:this.id}),this.labelGroup=new ne({name:this.id}),this.crossLineRange=this.lineGroup.appendChild(new is),this.crossLineLabel=this.labelGroup.appendChild(new zo),this.data=void 0,this.startLine=!1,this.endLine=!1,this._isRange=void 0,this.crossLineRange.pointerEvents=1}get defaultLabelPosition(){return"top"}update(t){const{enabled:e,type:i,data:n,scale:s}=this;if(!s||!e||!t||!kS(this,s)||n==null){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.rangeGroup.visible=t,this.lineGroup.visible=t,this.labelGroup.visible=t,this.updateNodes();const r=i==="range";r!==this._isRange&&(r?this.rangeGroup.appendChild(this.crossLineRange):this.lineGroup.appendChild(this.crossLineRange)),this._isRange=r}calculateLayout(t){if(this.data=void 0,!t)return;const{type:e,range:i,value:n,scale:s,clippedRange:r,strokeWidth:a=0}=this;if(!s)return;const o=s.bandwidth??0,l=s.step??0,c=s instanceof En?(l-o)/2:0;let[h,u]=At(r);h-=o,u+=o;let d,g,p,f;if(e==="line"){const m=o/2;if(d=s.convert(n)+m,g=Number.NaN,p=s.convert(n,{clamp:!0})+m,f=Number.NaN,p>=u||p<=h)return}else if(i){const[m,y]=i,[b,v]=MS(m,y);if(d=s.convert(m,{alignment:b}),g=s.convert(y,{alignment:v}),p=s.convert(m,{clamp:!0,alignment:b}),f=s.convert(y,{clamp:!0,alignment:v}),p>f&&([p,f]=[f,p],[d,g]=[g,d]),p>=u||f<=h)return;Number.isFinite(d)&&(p-=c),Number.isFinite(g)&&(g+=o,f+=o+c)}else return;p=go(p,r),f=go(f,r),d-c>=p&&(d-=c),g+c<=f&&(g+=c),this.startLine=a>0&&d>=p&&d<=p+c,this.endLine=a>0&&g>=f-o-c&&g<=f,this.data=[p,f],this.label.enabled===!1||this.label.text}updateNodes(){const{position:t,data:[e,i]=[0,0],gridLength:n,gridPadding:s}=this,r=Number.isFinite(i)?i-e:0,a=t==="bottom"||t==="right"?-1:1,o=Math.min(a*s,a*(n+s));let l;switch(t){case"top":case"bottom":l=new U(e,o,r,n);break;case"left":case"right":l=new U(o,e,n,r)}this.updateRangeNode(l);const{label:c}=this;c.enabled!==!1&&c.text&&(this.updateLabel(),this.positionLabel(l))}updateRangeNode(t){const{type:e,position:i,crossLineRange:n,startLine:s,endLine:r,fill:a,fillOpacity:o,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:u}=this;n.x1=t.x,n.x2=t.x+t.width,n.y1=t.y,n.y2=t.y+t.height,n.horizontal=i==="top"||i==="bottom",n.startLine=s,n.endLine=r,n.fill=e==="range"?a:void 0,n.fillOpacity=o??1,n.stroke=l,n.strokeWidth=c??1,n.strokeOpacity=h??1,n.lineDash=u}updateLabel(){const{crossLineLabel:t,label:e}=this;e.text&&(t.fill=e.color,t.text=e.text,t.textAlign="center",t.textBaseline="middle",t.setFont(e),t.setBoxing(e))}get anchor(){const t=this.position==="left"||this.position==="right",e=this.type==="range",{position:i=this.defaultLabelPosition}=this.label;return e?(t?N1:O1)[i]:(t?T1:L1)[i]}positionLabel(t){const{crossLineLabel:e,label:{padding:i,rotation:n},anchor:s}=this;e.rotation=Zt(n??0);const r=e.getBBox();if(!r)return;const{width:a,height:o}=r,l=typeof i=="number"?0:(i.right??0)-(i.left??0),c=typeof i=="number"?0:(i.bottom??0)-(i.top??0);let h=a/2,u=o/2;typeof i=="number"&&!e.hasBoxing()&&(h+=i,u+=i);const d=t.x+t.width*(s.rangeH+1)/2-h*s.labelH-l/2,g=t.y+t.height*(s.rangeV+1)/2-u*s.labelV-c/2;e.x=d,e.y=g,e.rotationCenterX=d,e.rotationCenterY=g}computeLabelSize(){const{label:t}=this;if(t.enabled===!1||!t.text)return;const e=new zo;e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.text=t.text,e.rotation=Zt(t.rotation??0),e.textBaseline="middle",e.textAlign="center";const i=e.getBBox();if(!i)return;const{width:n,height:s}=i;return{width:n,height:s}}calculatePadding(t){const{label:{padding:e},anchor:i}=this,n=this.computeLabelSize();if(!n)return;const{width:s,height:r}=n,a=typeof e=="number"?e*2:(e.left??0)+(e.right??0),o=typeof e=="number"?e*2:(e.top??0)+(e.bottom??0),l=a+s,c=o+r,h=this.position==="left"||this.position==="right";h&&(i.rangeH===-1&&i.labelH===1?t.left=Math.max(t.left??0,l):i.rangeH===1&&i.labelH===-1&&(t.right=Math.max(t.right??0,l))),h||(i.rangeV===-1&&i.labelV===1?t.top=Math.max(t.top??0,c):i.rangeV===1&&i.labelV===-1&&(t.bottom=Math.max(t.bottom??0,c)))}};fi.className="CrossLine",x([I],fi.prototype,"enabled",2),x([I],fi.prototype,"type",2),x([I],fi.prototype,"range",2),x([I],fi.prototype,"value",2),x([I],fi.prototype,"defaultColorRange",2),x([I],fi.prototype,"fill",2),x([I],fi.prototype,"fillOpacity",2),x([I],fi.prototype,"stroke",2),x([I],fi.prototype,"strokeWidth",2),x([I],fi.prototype,"strokeOpacity",2),x([I],fi.prototype,"lineDash",2),x([I],fi.prototype,"label",2);function TS(){return{"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}}function kc(t){return t?1:-1}function Wf(t,e,i,n,s,r){const a=t?.formatter,o=t?.format,{type:l,value:c,domain:h,boundSeries:u}=n,d=n.type==="number"?n.fractionDigits:void 0,g=n.type==="date"?n.unit:void 0;let p;if(a!=null){const f=n.type==="date"?n.step:void 0,m=n.type==="number"?n.visibleDomain:void 0;p=i(a,{type:l,value:c,index:s,domain:h,fractionDigits:d,unit:g,step:f,boundSeries:u,visibleDomain:m})}if(o!=null&&p==null){const{specifier:f,dateStyle:m="long",truncateDate:y}=r??{},b=`${m}:${y??"none"}`;let v=e[b];const S=xr.mergeSpecifiers(f,o);(v?.type!==l||v?.unit!==g||!st(v?.mergedFormat,S))&&(v={type:l,mergedFormat:S,unit:g,formatter:xr.getFormatter(l,S,g,m,{truncateDate:y})},e[b]=v),p=v.formatter?.(c,d)}return p==null||ce(p)?p:String(p)}var Kf=class extends kl{constructor(t){super(),this.rangeGroup=new ne({name:"CrossLines-Range"}),this.lineGroup=new ne({name:"CrossLines-Line"}),this.labelGroup=new ne({name:"CrossLines-Label"}),this.instances=[],this.ctx=t,this.axisCtx=t.parent,this.axisCtx.attachAxisOverlay(this.rangeGroup,"low"),this.axisCtx.attachAxisOverlay(this.lineGroup,"mid"),this.axisCtx.attachAxisOverlay(this.labelGroup,"high")}applyOptions(t){if(!this.optionsEquivalent(t)){this.lastOptions=t;for(const e of this.instances)this.detachInstance(e);if(t==null){this.instances=[];return}this.instances=t.map(e=>{const i=this.ctx.crossLine;return i.set(e),this.attachInstance(i),this.initInstance(i),i})}}onAxisUpdate(){const t=this.axisCtx.hasDefinedDomain()||this.axisCtx.hasVisibleSeries(),{gridPadding:e}=this.axisCtx,i=this.axisCtx.getPolarLayout?.();for(const n of this.instances)n.gridPadding=e,i&&n.applyPolarLayout(i),n.update(t)}onAxisLayout(){const t=this.axisCtx.getPolarLayout?.(),e=this.axisCtx.hasDefinedDomain()||this.axisCtx.hasVisibleSeries(),{reverse:i}=this.axisCtx;if(t){const n=-kc(this.axisCtx.mirrored);for(const s of this.instances){const r=s;r.sideFlag=n,r.parallelFlipRotation=t.parallelFlipRotation,r.regularFlipRotation=t.regularFlipRotation,r.calculateLayout?.(e,i)}}else for(const n of this.instances)n.calculateLayout?.(e,i)}onScaleChange(){const[t,e]=this.axisCtx.range;for(const i of this.instances)i.clippedRange=[t,e]}onGridChange(){for(const t of this.instances)this.initInstance(t)}setVisible(t){this.rangeGroup.visible=t,this.lineGroup.visible=t,this.labelGroup.visible=t}getInstances(){return this.instances}destroy(){for(const t of this.instances)this.detachInstance(t);this.instances=[],this.rangeGroup.remove(),this.lineGroup.remove(),this.labelGroup.remove(),super.destroy()}attachInstance(t){this.rangeGroup.appendChild(t.rangeGroup),this.lineGroup.appendChild(t.lineGroup),this.labelGroup.appendChild(t.labelGroup)}detachInstance(t){t.rangeGroup.remove(),t.lineGroup.remove(),t.labelGroup.remove()}initInstance(t){t.scale=this.axisCtx.scale,t.gridLength=this.axisCtx.gridLength,t.gridPadding=this.axisCtx.gridPadding}optionsEquivalent(t){const e=this.lastOptions;return t===e?!0:t==null||e==null?!1:es(e,t)==null}};Kf.className="CrossLines";var Ts={type:"axis:plugin",name:"crossLines",enterprise:!1,version:Ye,themeTemplate:{$apply:[{enabled:!0,fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},fillOpacity:.08,strokeWidth:1,label:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},padding:{$if:[{$path:"./border/enabled"},{left:12,right:12,top:8,bottom:8},5]},color:{$ref:"textColor"},cornerRadius:4,border:{enabled:!1,stroke:{$foregroundOpacity:.08},strokeOpacity:1,strokeWidth:1}}},void 0,{$pathString:["/common/axes/$axisType/crossLines",{axisType:{$path:["../type"]}}]},{$pathString:["/$seriesType/axes/$axisType/crossLines",{seriesType:{$path:["/series/0/type","line"]},axisType:{$path:["../type"]}}]}]},register:t=>{t.factory("crossLine",()=>new fi)},create:t=>new Kf(t)},St=class Br{constructor(e,i,n=!0){this.parentNode=e,this.autoCleanup=n,this.garbageBin=new Set,this._nodesMap=new Map,this._nodes=[],this.data=[],this.debug=ue.create(!0,"scene","scene:selections"),this.nodeFactory=Object.prototype.isPrototypeOf.call(ws,i)?()=>new i:i}static select(e,i,n=!0){return new Br(e,i,n)}static selectNoInference(e,i,n=!0){return new Br(e,i,n)}static selectAll(e,i){const n=[],s=r=>{if(i(r)&&n.push(r),r instanceof ne)for(const a of r.children())s(a)};return s(e),n}static selectByClass(e,...i){return Br.selectAll(e,n=>i.some(s=>n instanceof s))}static selectByTag(e,i){return Br.selectAll(e,n=>n.tag===i)}createNode(e,i,n){const s=this.nodeFactory(e);return s.datum=e,i?.(s),n==null?this._nodes.push(s):this._nodes.splice(n,0,s),this.parentNode.appendChild(s),s}update(e,i,n){if(this.garbageBin.size>0&&this.debug("Selection - update() called with pending garbage",e),n&&this._nodesMap.size===0&&this._nodes.length>0)for(const s of this._nodes)this.garbageBin.add(s);if(!n&&this._nodesMap.size>0&&this._nodesMap.clear(),n){const s=new Map,r=new Map;for(let a=0;a<e.length;a++){const o=e[a];let l=n(o);if(s.has(l)){const c=(r.get(l)??0)+1;r.set(l,c),l=`${l}:${c}`}s.set(l,a)}for(const[a,o]of this._nodesMap.entries()){const l=s.get(o);l==null?this.garbageBin.add(a):(a.datum=e[l],this.garbageBin.delete(a),s.delete(o))}for(const[a,o]of s.entries()){const l=e[o];this._nodesMap.set(this.createNode(l,i,o),a)}}else{const s=Math.max(e.length,this.data.length);for(let r=0;r<s;r++)r>=e.length?this.garbageBin.add(this._nodes[r]):r>=this._nodes.length?this.createNode(e[r],i):(this._nodes[r].datum=e[r],this.garbageBin.delete(this._nodes[r]))}return this.data=e.slice(),this.autoCleanup&&this.cleanup(),this}cleanup(){if(this.garbageBin.size===0)return this;const e=this;function i(n){return e.garbageBin.has(n)?(e._nodesMap.delete(n),e.garbageBin.delete(n),n.destroy(),!1):!0}return this._nodes=this._nodes.filter(i),this}clear(){this.update([]);for(const e of this._nodesMap.keys())this.garbageBin.add(e);return this._nodesMap.clear(),this}isGarbage(e){return this.garbageBin.has(e)}each(e){const i=this._nodes;return this.parentNode.batchedUpdate(function(){for(const s of i.entries())e(s[1],s[1].unsafeNonNullDatum,s[0])}),this}*[Symbol.iterator](){for(let e=0;e<this._nodes.length;e++){const i=this._nodes[e];yield{node:i,datum:i.unsafeNonNullDatum,index:e}}}select(e){return Br.selectAll(this.parentNode,e)}selectByClass(e){return Br.selectByClass(this.parentNode,e)}selectByTag(e){return Br.selectByTag(this.parentNode,e)}nodes(){return this._nodes}at(e){return this._nodes.at(e)}get length(){return this._nodes.length}batchedUpdate(e){this.parentNode.batchedUpdate(e)}};function E1({orientation:t,bboxes:e,maxHeight:i,maxWidth:n,itemPaddingY:s=0,itemPaddingX:r=0,forceResult:a=!1}){const o=t==="horizontal",l={max:o?n:i,fn:o?d=>d.width:d=>d.height,padding:o?r:s},c={max:o?i:n,fn:o?d=>d.height:d=>d.width,padding:o?s:r};let h=0;const u=[];for(;h<e.length;){const d=e.slice(h),g=R1(d,h,l,c,a);if(!g)return;h+=g.processedBBoxCount,u.push(g.pageIndices)}return F1(u,t,e,s,r)}function R1(t,e,i,n,s){let a=_1(t,i);if(a<1){if(!s)return;a=1}let o=a;for(;o>=1;){const l=P1(t,e,o,i,n,s);if(l==null&&o<=1)return;if(l==null){o--;continue}if(typeof l=="number"){if(l<=1)return;o=l<o&&l>1?l:o,o--;continue}return{processedBBoxCount:l.length*l[0].length,pageIndices:l}}}function P1(t,e,i,n,s,r){const a=[];let o=0,l=0,c=[];const h=[];for(let u=0;u<t.length;u++){const d=(u+i)%i;d===0&&(o+=l,l=0,c.length>0&&a.push(c),c=[]);const g=n.fn(t[u])+n.padding;h[d]=Math.max(h[d]??0,g),l=Math.max(l,s.fn(t[u])+s.padding);const p=o+l,f=!r||a.length>0;if(p>s.max&&f){c=[];break}if(h.reduce((y,b)=>y+b,0)>n.max&&!r)return h.length<i?h.length:void 0;c.push(u+e)}return c.length>0&&a.push(c),a.length>0?a:void 0}function F1(t,e,i,n,s){let r=0,a=0;return{pages:t.map(l=>{e==="horizontal"&&(l=V1(l));let c=0;const h=l.map(g=>{const p=g.map(y=>(c=Math.max(y,c),i[y]));let f=0,m=0;for(const y of p)f+=y.height+n,m=Math.max(m,y.width+s);return{indices:g,bboxes:p,columnHeight:Math.ceil(f),columnWidth:Math.ceil(m)}});let u=0,d=0;for(const g of h)u+=g.columnWidth,d=Math.max(d,g.columnHeight);return r=Math.max(u,r),a=Math.max(d,a),{columns:h,startIndex:l[0][0],endIndex:c,pageWidth:u,pageHeight:d}}),maxPageWidth:r,maxPageHeight:a}}function V1(t){const e=[];for(const i of t[0])e.push([]);for(const[i,n]of t.entries())for(const[s,r]of n.entries())e[s][i]=r;return e}function _1(t,e){const i=t.length;let n=0;for(let s=0;s<i;s++)if(n+=e.fn(t[s])+e.padding,n>e.max)return i/s<2?Math.ceil(i/2):s;return i}var LS=(t=>(t[t.Default=64]="Default",t[t.ZoomDrag=32]="ZoomDrag",t[t.Annotations=16]="Annotations",t[t.ContextMenu=8]="ContextMenu",t[t.Animation=4]="Animation",t[t.AnnotationsSelected=2]="AnnotationsSelected",t[t.Frozen=1]="Frozen",t[t.Hoverable=82]="Hoverable",t[t.Clickable=83]="Clickable",t[t.Focusable=69]="Focusable",t[t.Keyable=87]="Keyable",t[t.ContextMenuable=72]="ContextMenuable",t[t.AnnotationsMoveable=18]="AnnotationsMoveable",t[t.AnnotationsDraggable=114]="AnnotationsDraggable",t[t.ZoomDraggable=101]="ZoomDraggable",t[t.ZoomClickable=69]="ZoomClickable",t[t.ZoomWheelable=119]="ZoomWheelable",t[t.All=126]="All",t))(LS||{}),NS=class{constructor(){this.stateQueue=68}pushState(t){this.stateQueue|=t}popState(t){this.stateQueue&=~t}isState(t){return!!(this.stateQueue&-this.stateQueue&t)}},Yf=(t=>(t[t.Caption=0]="Caption",t[t.Legend=1]="Legend",t[t.ToolbarLeft=2]="ToolbarLeft",t[t.ToolbarBottom=3]="ToolbarBottom",t[t.Scrollbar=4]="Scrollbar",t[t.Navigator=5]="Navigator",t[t.Overlay=6]="Overlay",t))(Yf||{}),B1=class{constructor(t){this.eventsHub=t,this.elements=new Map}registerElement(t,e){return this.elements.has(t)?this.elements.get(t).add(e):this.elements.set(t,new Set([e])),()=>this.elements.get(t)?.delete(e)}createContext(t,e){const i={width:t,height:e,layoutBox:new U(0,0,t,e),scrollbars:{}};for(const n of Object.values(Yf)){if(typeof n!="number")continue;const s=this.elements.get(n);if(s)for(const r of s)r(i)}return i}emitLayoutComplete({width:t,height:e},i){this.eventsHub.emit("layout:complete",{axes:i.axes??{},chart:{width:t,height:e},clipSeries:i.clipSeries??!1,series:i.series,layoutBox:i.layoutBox})}};function Tc(t,e){const{path:i,size:n}=t,{x:s,y:r}=t;i.clear();let a=!1;for(const[o,l]of e){const c=s+(o-.5)*n,h=r+(l-.5)*n;a?i.lineTo(c,h):i.moveTo(c,h),a=!0}i.closePath()}var z1={circle({path:t,x:e,y:i,size:n}){const s=n/2;t.arc(e,i,s,0,Math.PI*2),t.closePath()},cross(t){Tc(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]])},diamond(t){Tc(t,[[.5,0],[1,.5],[.5,1],[0,.5]])},heart({path:t,x:e,y:i,size:n}){const s=n/4;i=i+s/2,t.arc(e-s,i-s,s,Zt(130),Zt(330)),t.arc(e+s,i-s,s,Zt(220),Zt(50)),t.lineTo(e,i+s),t.closePath()},pin({path:t,x:e,y:i,size:n}){t.moveTo(e+(.891-.5)*n,i+(.391-.5)*n),t.cubicCurveTo(e+(.891-.5)*n,i+(.606-.5)*n,e+(.5-.5)*n,i+(1-.5)*n,e+(.5-.5)*n,i+(1-.5)*n),t.cubicCurveTo(e+(.5-.5)*n,i+(1-.5)*n,e+(.109-.5)*n,i+(.606-.5)*n,e+(.109-.5)*n,i+(.391-.5)*n),t.cubicCurveTo(e+(.109-.5)*n,i+(.175-.5)*n,e+(.284-.5)*n,i+(0-.5)*n,e+(.5-.5)*n,i+(0-.5)*n),t.cubicCurveTo(e+(.716-.5)*n,i+(0-.5)*n,e+(.891-.5)*n,i+(.175-.5)*n,e+(.891-.5)*n,i+(.391-.5)*n),t.closePath()},plus(t){Tc(t,[[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:t,x:e,y:i,size:n,pixelRatio:s}){const r=n/2;t.moveTo(Ft(s,e-r),Ft(s,i-r)),t.lineTo(Ft(s,e+r),Ft(s,i-r)),t.lineTo(Ft(s,e+r),Ft(s,i+r)),t.lineTo(Ft(s,e-r),Ft(s,i+r)),t.closePath()},star({path:t,x:e,y:i,size:n}){const r=n/2,a=r/2,o=Math.PI/2;for(let l=0;l<5*2;l++){const c=l%2===0?r:a,h=l*Math.PI/5-o,u=e+Math.cos(h)*c,d=i+Math.sin(h)*c;t.lineTo(u,d)}t.closePath()},triangle(t){Tc(t,[[.5,0],[1,.87],[0,.87]])}},Lc=class extends kt{constructor(){super(...arguments),this.shape="square",this.x=0,this.y=0,this.size=12}isPointInPath(t,e){return this.distanceSquared(t,e)<=0}get midPoint(){return{x:this.x,y:this.y}}distanceSquared(t,e){const i=Lt.anchor(this.shape),n=t-this.x+(i.x-.5)*this.size,s=e-this.y+(i.y-.5)*this.size,r=this.size/2;return Math.max(n*n+s*s-r*r,0)}updatePath(){const{path:t,shape:e,x:i,y:n,size:s}=this,r=this.layerManager?.canvas?.pixelRatio??1,a=Lt.anchor(e),o={path:t,x:i-(a.x-.5)*s,y:n-(a.y-.5)*s,size:s,pixelRatio:r};t.clear(),typeof e=="string"?z1[e](o):typeof e=="function"&&e(o)}computeBBox(){const{x:t,y:e,size:i}=this,n=Lt.anchor(this.shape);return new U(t-i*n.x,e-i*n.y,i,i)}executeFill(t,e){if(e)return super.executeFill(t,e)}executeStroke(t,e){if(e)return super.executeStroke(t,e)}};x([xc({equals:Ro})],Lc.prototype,"shape",2),x([We()],Lc.prototype,"x",2),x([We()],Lc.prototype,"y",2),x([We({convertor:Math.abs})],Lc.prototype,"size",2);var Lt=class extends fa(nd(Vo(Lc))){get datum(){return super.datum}set datum(t){super.datum=t}get previousDatum(){return super.previousDatum}static anchor(t){return t==="pin"?{x:.5,y:1}:typeof t=="function"&&"anchor"in t?t.anchor:{x:.5,y:.5}}constructor(t){super(t),t?.shape!=null&&(this.shape=t.shape)}resetAnimationProperties(t,e,i,n,s,r){this.__x=t,this.__y=e,this.__size=i,this.__opacity=n,this.resetScalingProperties(s,r,t,e),this.dirtyPath=!0,this.markDirty()}setVisibilityAndPosition(t,e,i,n){let s=!1;this.__visible!==t&&(this.__visible=t,s=!0),this.__shape!==e&&(this.__shape=e,s=!0);const r=Math.abs(i);if(this.__size!==r&&(this.__size=r,s=!0),n){const{x:a,y:o}=n;this.__x!==a&&(this.__x=a,s=!0),this.__y!==o&&(this.__y=o,s=!0),this.__scalingCenterX!==a&&(this.__scalingCenterX=a,s=!0),this.__scalingCenterY!==o&&(this.__scalingCenterY=o,s=!0)}s&&(this.dirtyPath=!0,this.markDirty())}},OS=class{constructor(t,e){this.chartUpdateCallback=t,this.pageUpdateCallback=e,this.id=Nn(this),this.group=new $t({name:"pagination"}),this.labelNode=new _i,this.nextButton=new Lt,this.previousButton=new Lt,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.isRtl=!1,this.orientation="vertical",this.labelNode.setProperties({textBaseline:"middle",textAlign:"left",text:"1 / 0",y:1}),this.group.append([this.nextButton,this.previousButton,this.labelNode])}set visible(t){this._visible=t,this.updateGroupVisibility()}get visible(){return this._visible}set enabled(t){this._enabled=t,this.updateGroupVisibility()}get enabled(){return this._enabled}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible}applyRotations(){const{isRtl:t}=this;switch(this.orientation){case"horizontal":{this.previousButton.rotation=t?Math.PI/2:-Math.PI/2,this.nextButton.rotation=t?-Math.PI/2:Math.PI/2;break}case"vertical":default:this.previousButton.rotation=0,this.nextButton.rotation=Math.PI}}update(t){this.lastOpts=t,this.applyRotations(),this.updateLabel(t),this.updatePositions(t),this.enableOrDisableButtons()}updatePositions(t){this.group.translationX=this.translationX,this.group.translationY=this.translationY,this.updateLabelPosition(t),this.updateButtonPositions(t)}updateLabelPosition(t){const{size:e,padding:i}=t.marker;this.nextButton.size=e,this.previousButton.size=e,this.labelNode.x=e/2+i}updateButtonPositions(t){const i=this.labelNode.getBBox().width+(t.marker.size/2+t.marker.padding)*2;this.isRtl&&this.orientation==="horizontal"?(this.nextButton.translationX=0,this.previousButton.translationX=i):(this.previousButton.translationX=0,this.nextButton.translationX=i)}updateLabel(t){const{isRtl:e,labelNode:i,currentPage:n,totalPages:s}=this,{color:r,fontStyle:a,fontWeight:o,fontSize:l,fontFamily:c}=t.label,h=[n+1,s];e&&h.reverse(),i.text=h.join(" / "),i.fill=r,i.fontStyle=a,i.fontWeight=o,i.fontSize=l,i.fontFamily=c}updateMarkers(t){const{nextButton:e,previousButton:i,nextButtonDisabled:n,previousButtonDisabled:s,highlightActive:r}=this,a=(o,l)=>l?t.inactiveStyle:o===r?t.highlightStyle:t.activeStyle;this.updateMarker(e,t,a("next",n)),this.updateMarker(i,t,a("previous",s))}updateMarker(t,e,i){const{shape:n,size:s}=e.marker;t.shape=n,t.size=s,t.fill=i.fill,t.fillOpacity=i.fillOpacity??1,t.stroke=i.stroke,t.strokeWidth=i.strokeWidth,t.strokeOpacity=i.strokeOpacity}enableOrDisableButtons(){const{currentPage:t,totalPages:e}=this,i=e===0,n=t===e-1,s=t===0;this.nextButtonDisabled=n||i,this.previousButtonDisabled=s||i}setPage(t){t=te(0,t,Math.max(0,this.totalPages-1)),this.currentPage!==t&&(this.currentPage=t,this.onPaginationChanged())}getCursor(t){return{previous:this.previousButtonDisabled,next:this.nextButtonDisabled}[t]?void 0:"pointer"}onClick(t,e){t.preventDefault(),e==="next"&&!this.nextButtonDisabled?(this.incrementPage(),this.onPaginationChanged()):e==="previous"&&!this.previousButtonDisabled&&(this.decrementPage(),this.onPaginationChanged())}onMouseHover(t){this.highlightActive=t,this.lastOpts&&this.updateMarkers(this.lastOpts),this.chartUpdateCallback()}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)}attachPagination(t){t.append(this.group)}getBBox(){return this.group.getBBox()}computeCSSBounds(){const t=Ze.toCanvas(this.previousButton),e=Ze.toCanvas(this.nextButton);return{prev:t,next:e}}};OS.className="Pagination";function ES(t,e,i,n){if(qi(t))return{type:"gradient",gradient:t.gradient??e.gradient,colorStops:t.colorStops??e.colorStops,bounds:t.bounds??e.bounds,rotation:t.rotation??e.rotation,reverse:t.reverse??e.reverse,colorSpace:t.colorSpace??e.colorSpace};if(As(t)){const s=t.pattern??i.pattern;let r=t.strokeWidth;s==="backward-slanted-lines"||s==="forward-slanted-lines"||s==="horizontal-lines"||s==="vertical-lines"?r??(r=i.strokeWidth):r??(r=0);const a=t.width??t.height??i.width,o=t.height??t.width??i.height;return{type:"pattern",pattern:s,width:a,height:o,path:t.path,padding:t.padding??i.padding,fill:t.fill??i.fill,fillOpacity:t.fillOpacity??i.fillOpacity,backgroundFill:t.backgroundFill??i.backgroundFill,backgroundFillOpacity:t.backgroundFillOpacity??i.backgroundFillOpacity,stroke:t.stroke??i.stroke,strokeOpacity:t.strokeOpacity??i.strokeOpacity,strokeWidth:r,rotation:t.rotation??i.rotation,scale:t.scale??i.scale}}return la(t)?{type:"image",url:t.url,width:t.width,height:t.height,backgroundFill:t.backgroundFill??n.backgroundFill,backgroundFillOpacity:t.backgroundFillOpacity??n.backgroundFillOpacity,rotation:t.rotation??n.rotation,repeat:t.repeat??n.repeat,fit:t.fit??n.fit}:t}function Zf(t,e,i,n){return!qi(t?.fill)&&!As(t?.fill)&&!la(t?.fill)?t:{...t,fill:ES(t.fill,e,i,n)}}var RS=.1,PS=200,FS=12,G1=.5,j1=class{constructor(t){this.agDocument=t,this.events=new ms,this.x1=Number.NaN,this.y1=Number.NaN,this.x=Number.NaN,this.y=Number.NaN,this.vx=0,this.vy=0,this.t0=Number.NaN,this.animationFrameHandle=void 0}reset(){this.x=Number.NaN,this.y=Number.NaN,this.animationFrameHandle!=null&&(this.agDocument.cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0)}update(t,e){if(Number.isNaN(this.x)||Number.isNaN(this.y)){this.x=t,this.y=e,this.vx=0,this.vy=0,this.emitUpdate(),this.animationFrameHandle!=null&&(this.agDocument.cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0);return}this.x1=t,this.y1=e,this.t0=Date.now(),this.animationFrameHandle??(this.animationFrameHandle=this.agDocument.requestAnimationFrame(this.onFrame.bind(this)))}onFrame(){this.animationFrameHandle=void 0;const{x1:t,y1:e,t0:i}=this,n=Date.now(),s=n-i;this.t0=n;const r=.001,a=Math.trunc(Math.ceil(s/(r*1e3)));let{x:o,y:l,vx:c,vy:h}=this;for(let u=0;u<a;u+=1){const d=o-t,g=l-e,p=-(PS*d+FS*c)/RS,f=-(PS*g+FS*h)/RS;c+=p*r,h+=f*r,o+=c*r,l+=h*r}Math.hypot(o-t,l-e)<G1?(this.x=this.x1,this.y=this.y1,this.vx=0,this.vy=0):(this.x=o,this.y=l,this.vx=c,this.vy=h,this.animationFrameHandle=this.agDocument.requestAnimationFrame(this.onFrame.bind(this))),this.emitUpdate()}emitUpdate(){this.events.emit("update",{x:this.x,y:this.y})}},H1={left:-1,"top-left":-1,"bottom-left":-1,top:0,center:0,bottom:0,right:1,"top-right":1,"bottom-right":1},$1={"top-left":-1,top:-1,"top-right":-1,left:0,center:0,right:0,"bottom-left":1,bottom:1,"bottom-right":1};function U1(t){const{elementSize:e,anchorTo:i,placement:n,canvasX:s,canvasY:r,yOffset:a,xOffset:o,offset:l,canvasRect:c}=t,{width:h,height:u}=e,d={width:h,height:u};if(i==="node"||i==="pointer"){const g=H1[n],p=$1[n];return d.top=r+a+u*(p-1)/2+l*p,d.left=s+o+h*(g-1)/2+l*g,d}switch(n){case"top":return d.top=a+l,d.left=c.width/2-h/2+o,d;case"right":return d.top=c.height/2-u/2+a,d.left=c.width-h+o-l,d;case"left":return d.top=c.height/2-u/2+a,d.left=o+l,d;case"bottom":return d.top=c.height-u+a-l,d.left=c.width/2-h/2+o,d;case"top-left":return d.top=a+l,d.left=o+l,d;case"top-right":return d.top=a+l,d.left=c.width-h+o-l,d;case"bottom-right":return d.top=c.height-u+a-l,d.left=c.width-h+o-l,d;case"bottom-left":return d.top=c.height-u+a-l,d.left=o+l,d}return d}var ld=null;function Ho(t){const e=Ue(t);return e===""?"":(ld??(ld=ve("div")),ld.textContent=e,ld.innerHTML.replaceAll(`
`,"<br>"))}var en=class extends ga{constructor(t={}){super(t),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.fill=void 0,this.strokeWidth=1}set x(t){this.x1=t,this.x2=t}set y(t){this.y1=t,this.y2=t}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(t,e){return this.x1===this.x2||this.y1===this.y2?this.getBBox().clone().grow(this.strokeWidth/2).containsPoint(t,e):!1}distanceSquared(t,e){const{x1:i,y1:n,x2:s,y2:r}=this;return wu(t,e,i,n,s,r,1/0)}render(t){const{ctx:e,devicePixelRatio:i}=t;let{x1:n,y1:s,x2:r,y2:a}=this;if(n===r){const{strokeWidth:o}=this,l=Math.round(n*i)/i+Math.trunc(o*i)%2/(i*2);n=l,r=l}else if(s===a){const{strokeWidth:o}=this,l=Math.round(s*i)/i+Math.trunc(o*i)%2/(i*2);s=l,a=l}e.beginPath(),e.moveTo(n,s),e.lineTo(r,a),this.fillStroke(e),this.fillShadow?.markClean(),super.render(t)}toSVG(){if(!this.visible)return;const t=ut("line");return t.setAttribute("x1",String(this.x1)),t.setAttribute("y1",String(this.y1)),t.setAttribute("x2",String(this.x2)),t.setAttribute("y2",String(this.y2)),this.applySvgStrokeAttributes(t),{elements:[t]}}};en.className="Line",x([Z()],en.prototype,"x1",2),x([Z()],en.prototype,"y1",2),x([Z()],en.prototype,"x2",2),x([Z()],en.prototype,"y2",2);function W1(t,e,i=e*(5/3)){const n=new ne,s=Math.min(t.marker.strokeWidth??1,2),r=t.line?.enabled?Math.min(t.line.strokeWidth,2):0,a=Math.max(t.marker.enabled===!1?0:e,t.line==null?0:i),o=Math.max(t.marker.enabled===!1?0:e,r);if(t.line?.enabled){const{stroke:l,strokeOpacity:c,lineDash:h}=t.line,u=new en;u.x1=0,u.y1=o/2,u.x2=a,u.y2=o/2,u.stroke=l,u.strokeOpacity=c,u.strokeWidth=r,u.lineDash=h,n.append(u)}if(t.marker.enabled!==!1){const{shape:l,fill:c,fillOpacity:h,stroke:u,strokeOpacity:d,lineDash:g,lineDashOffset:p}=t.marker,f=new Lt;f.shape=l??"square",f.size=e,f.fill=c,f.fillOpacity=h??1,f.stroke=u,f.strokeOpacity=d??1,f.strokeWidth=s,f.lineDash=g,f.lineDashOffset=p??0;const m=Lt.anchor(l),y=a/2+(m.x-.5)*e,b=o/2+(m.y-.5)*e,v=e/(e+s);f.x=y,f.y=b,f.scalingCenterX=y,f.scalingCenterY=b,f.scalingX=v,f.scalingY=v,n.append(f)}return ne.toSVG(n,a,o)}var Ut="ag-charts-tooltip",K1="ag-charts-tooltip--dark";function Ls(t){return t==null?!1:Array.isArray(t)?t.some(e=>Ls(e.text)):et(t).trim()!==""}function ba(t,e=!1){return t==null?!e:typeof t=="number"&&!Number.isFinite(t)}function Y1(t){return t.type==="raw"||!t.data||t.data.length===0?!1:t.data.every(e=>e.missing===!0)}function VS(t){const e=[],i=new Map;for(const n of t)if(!Y1(n))if(n.type==="structured"){const{heading:s}=n,r=Ls(s)?i.get(s):void 0,a={type:"structured",heading:s,items:[n]};r==null?(i.set(s,a),e.push(a)):r.items.push(n)}else e.push(n);return e}function Z1(t){const e=Gr().createElement("div");e.innerHTML=t;const i=e.textContent?.trim();return i??(j.warnOnce("cannot retrieve tooltip textContent (required for aria-label)"),"")}function X1(t){const e=VS(t),i=[];for(const n of e){if(n.type==="raw"){i.push(Z1(n.rawHtmlString));continue}Ls(n.heading)&&i.push(Ue(n.heading));for(const s of n.items)if(Ls(s.title)&&i.push(Ue(s.title)),s.data)for(const r of s.data)r.missing!==!0&&i.push(r.label??r.fallbackLabel,Ue(r.value))}return i.filter(n=>n!=="").join("; ")}function _S(t,e,i){let n="";Ls(t)?(n+=`<span class="${Ut}-label">${Ho(t)}</span>`,n+=" ",n+=`<span class="${Ut}-value">${Ho(e)}</span>`):n+=`<span class="${Ut}-label">${Ho(e)}</span>`;const s=[`${Ut}-row`];return i&&s.push(`${Ut}-row--inline`),n=`<div class="${s.join(" ")}">${n}</div>`,n}function q1(t){let e="";if(t.data?.length&&t.data.every(r=>r.missing===!0))return e;const i=Ls(t.title),n=!i&&t.data?.length===1,s=t.symbol==null?void 0:W1(t.symbol,12);if(s!=null&&(i||t.data?.length)&&(e+=`<span class="${Ut}-symbol">${s}</span>`),i&&(e+=`<span class="${Ut}-title">${Ho(t.title)}</span>`,e+=" "),t.data)for(const r of t.data)r.missing!==!0&&(e+=_S(r.label??r.fallbackLabel,Ue(r.value),n),e+=" ");return e}function BS(t,e){if(t==null||e.length===1)return;const i=t?.t("tooltipPaginationStatus",{index:e.index+1,count:e.length});return`<div class="${Ut}-footer">${i}</div>`}function zS(t,e,i,n){const s=e.items.length===1?e.items[0]:void 0;let r,a,o;switch(i){case"compact":r=!0,a=Ue(s?.title);break;case"single":const h=Ls(e.heading);r=s!=null&&(!h||s.title==null)&&s.data?.length===1&&s.data[0].label==null&&s.data[0].value!=null,o=Ue(h?e.heading:s?.title);break;case"shared":r=!1}let l="";if(r&&s!=null){if(Ls(a)&&(l+=`<span class="${Ut}-title">${Ho(a)}</span>`),s.data)for(const h of s.data)h.missing!==!0&&(l+=_S(h.label??o,Ue(h.value),!1),l+=" ")}else{Ls(e.heading)&&(l+=`<span class="${Ut}-heading">${Ho(Ue(e.heading))}</span>`,l+=" ");for(const h of e.items)l+=q1(h)}if(l.length===0)return;const c=i!=="compact"&&n!=null?BS(t,n):void 0;return c+null&&(l+=c),l=`<div class="${Ut}-content">${l.trimEnd()}</div>`,l}function J1(t,e){const i=e==null?void 0:BS(t,e);return i==null?"":`<div class="${Ut}-content">${i}</div>`}function Q1(t,e,i,n){const s=VS(e);if(s.length!==0){if(s.length===1&&s[0].type==="structured")return zS(t,s[0],i,n);{const r=s.map(a=>a.type==="structured"?zS(t,a,i):a.rawHtmlString);return n!=null&&r.push(J1(t,n)??""),r.join("")}}}var eN=8,tN={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},GS={top:2,bottom:2,left:1,right:1,"top-right":3,"top-left":3,"bottom-right":3,"bottom-left":3,center:0},iN={pointer:"top",node:"top",chart:"top-left"},va=class extends Te{constructor(){super(...arguments),this.xOffset=0,this.yOffset=0}};x([I],va.prototype,"xOffset",2),x([I],va.prototype,"yOffset",2),x([I],va.prototype,"offset",2),x([I],va.prototype,"anchorTo",2),x([I],va.prototype,"placement",2);var Rn=class extends Te{constructor(t){super(),this.agDocument=t,this.enabled=!0,this.mode="single",this.delay=0,this.range=void 0,this.wrapping="hyphenate",this.position=new va,this.pagination=!1,this.darkTheme=!1,this.bounds="extended",this.cleanup=new nt,this.springAnimation=new j1(this.agDocument),this.enableInteraction=!1,this.wrapTypes=["always","hyphenate","on-space","never"],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()}))}get interactive(){return this.enableInteraction}setup(t,e){this.elementProxy=e.addDeferredProxyChild("tooltip-container",Ut),this.elementProxy.toggleClass(Ut,!0),this.elementProxy.setProperty("position-anchor",e.anchorName),this.elementProxy.setAttr("popover","manual");const i=this.elementProxy.addResizeListener(n=>{this._elementSize=n,this.updateTooltipPosition()});return this.localeManager=t,()=>{e.removeChild("tooltip-container",Ut),this.cleanup.flush(),i()}}isVisible(){return this._visible}contains(t){return this.elementProxy?.contains(t)??!1}updateTooltipPosition(){const{elementProxy:t,_elementSize:e,positionParams:i}=this;if(t==null||e==null||i==null)return;const{canvasRect:n,relativeRect:s,meta:r}=i,{x:a,y:o}=this.springAnimation,l=r.position?.anchorTo??"pointer";let c=r.position?.placement??iN[l];Array.isArray(c)||(c=[c]);const h=r.position?.xOffset??0,u=r.position?.yOffset??0,d=r.position?.offset??eN,g=s.x,p=s.y,f=s.width-e.width-1+g,m=s.height-e.height+p;let y=0,b,v,S=!1;do{b=c[y],y+=1;const w=U1({elementSize:e,placement:b,anchorTo:l,canvasX:a,canvasY:o,yOffset:u,xOffset:h,offset:d,canvasRect:n});v=qx(e.width,e.height,s,w),S=!1,GS[b]&1&&(S||(S=v.x<g||v.x>f)),GS[b]&2&&(S||(S=v.y<p||v.y>m))}while(y<c.length&&S);const M=te(g,v.x,f),C=te(p,v.y,m);S||(S=M!==v.x||C!==v.y);const D=l!=="chart"&&!S&&!h&&!u,A=r.showArrow??this.showArrow??D;this.arrowPosition=A?tN[b]:void 0,this.updateClassModifiers(),t.setProperty("translate",`${M}px ${C}px`)}show(t,e,i,n,s,r=!1){const{elementProxy:a}=this;if(a!=null&&n!=null&&n.length!==0){const c=Q1(this.localeManager,n,this.mode,this.pagination?s:void 0);if(c==null){a.setInnerHTML(""),this.toggle(!1);return}a.setInnerHTML(c)}else if(a==null||a.innerHTML===""){this.toggle(!1);return}const o={x:t.x-e.x,y:t.y-e.y,width:t.width,height:t.height};switch(this.positionParams={canvasRect:e,relativeRect:o,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()}this.enableInteraction=i.enableInteraction??!1,a.setProperty("pointer-events",this.enableInteraction?"auto":"none"),a.setAttr("aria-hidden",this.enableInteraction?null:"true"),a.setAttr("tabindex",this.enableInteraction?"-1":null),a.setProperty("--top",`${e.top}px`),a.setProperty("--left",`${e.left}px`),this.updateClassModifiers(),this.toggle(!0,r)}hide(){this.toggle(!1)}maybeEnterInteractiveTooltip({relatedTarget:t},e){const{interactive:i,interactiveLeave:n,enabled:s,elementProxy:r}=this;if(r==null)return!1;if(n)return!0;const a=i&&s&&this.isVisible()&&Ah(t)&&this.contains(t);return a&&(this.interactiveLeave={callback:e,listener:o=>{(o.relatedTarget==null||Ah(o.relatedTarget)&&!this.contains(o.relatedTarget))&&this.popInteractiveLeaveCallback()}},r.addEventListener("focusout",this.interactiveLeave.listener),r.addEventListener("mouseout",this.interactiveLeave.listener)),a}popInteractiveLeaveCallback(){const{interactiveLeave:t,elementProxy:e}=this;this.interactiveLeave=void 0,t&&(e&&(e.removeEventListener("focusout",t.listener),e.removeEventListener("mouseout",t.listener)),t.callback())}toggle(t,e=!1){const{delay:i}=this;t&&i>0&&!e?this._showTimeout??(this._showTimeout=setTimeout(()=>{this._showTimeout=void 0,this.toggleCallback(!0)},i)):(clearTimeout(this._showTimeout),this._showTimeout=void 0,this.toggleCallback(t))}toggleCallback(t){this.elementProxy?.isConnected&&this._visible!==t&&(this._visible=t,this.elementProxy.togglePopover(t),t?this.updateTooltipPosition():(this.springAnimation.reset(),this.popInteractiveLeaveCallback(),this.elementProxy.reset()))}updateClassModifiers(){if(!this.elementProxy?.isConnected)return;const{elementProxy:t}=this,{enableInteraction:e,arrowPosition:i,mode:n,darkTheme:s,wrapping:r}=this,a=(o,l)=>t.toggleClass(`${Ut}--${o}`,l);a("no-interaction",!e),a("arrow-top",i===1),a("arrow-right",i===3),a("arrow-bottom",i===2),a("arrow-left",i===0),a("compact",n==="compact"),t.toggleClass(K1,s);for(const o of this.wrapTypes)t.toggleClass(`${Ut}--wrap-${o}`,o===r)}};x([I],Rn.prototype,"enabled",2),x([I],Rn.prototype,"mode",2),x([I],Rn.prototype,"showArrow",2),x([I],Rn.prototype,"delay",2),x([I],Rn.prototype,"range",2),x([I],Rn.prototype,"wrapping",2),x([I],Rn.prototype,"position",2),x([I],Rn.prototype,"pagination",2),x([I],Rn.prototype,"darkTheme",2),x([I],Rn.prototype,"bounds",2);var nN=class{constructor(t,e){this.ctx=t,this.dirty=!0,this.itemList=t.proxyInteractionService.createProxyContainer({type:"list",domManagerId:`${e}-toolbar`,classList:["ag-charts-proxy-legend-toolbar"],ariaLabel:{id:"ariaLabelLegend"}}),this.paginationGroup=t.proxyInteractionService.createProxyContainer({type:"group",domManagerId:`${e}-pagination`,classList:["ag-charts-proxy-legend-pagination"],ariaLabel:{id:"ariaLabelLegendPagination"}}),this.itemDescription=t.agDocument.createElement("p"),this.itemDescription.style.display="none",this.itemDescription.id=sc(),this.itemDescription.textContent=this.getItemAriaDescription(),this.itemList.getElement().append(this.itemDescription)}shouldApplyHoverOnFocus(t){const e=t.getElement();return[":hover",":focus-visible"].some(i=>e.matches(i))}initLegendList(t){if(!this.dirty)return;const{itemSelection:e,datumReader:i,itemListener:n}=t,s=e.length;e.each((r,a,o)=>{r.proxyButton?.destroy(),r.proxyButton=this.ctx.proxyInteractionService.createProxyElement({type:"listswitch",textContent:this.getItemAriaText(Ue(i.getItemLabel(a)),o,s),ariaChecked:!!r.unsafeNonNullDatum.enabled,ariaDescribedBy:this.itemDescription.id,parent:this.itemList});const l=r.proxyButton;l.addListener("click",c=>n.onClick(c.sourceEvent,r.datum,l)),l.addListener("dblclick",c=>n.onDoubleClick(c.sourceEvent,r.datum)),l.addListener("mouseenter",c=>n.onHover(c.sourceEvent,r)),l.addListener("mouseleave",()=>n.onLeave()),l.addListener("contextmenu",c=>n.onContextClick(c,r)),l.addListener("blur",()=>n.onLeave()),l.addListener("focus",c=>this.shouldApplyHoverOnFocus(l)?n.onHover(c.sourceEvent,r):n.onLeave()),l.addListener("drag-start",()=>{})}),this.dirty=!1}update(t){t.visible&&(this.initLegendList(t),this.syncItemLabels(t),this.updateItemProxyButtons(t),this.updatePaginationProxyButtons(t,!0)),this.updateVisibility(t.visible)}syncItemLabels({itemSelection:t,datumReader:e}){const i=t.length;t.each(({proxyButton:n},s,r)=>{const a=n?.getElement();if(a!=null){const o=this.getItemAriaText(Ue(e.getItemLabel(s)),r,i);a.textContent!==o&&(a.textContent=o)}})}updateVisibility(t){this.itemList.setHidden(!t),this.paginationGroup.setHidden(!t)}updateItemProxyButtons({itemSelection:t,group:e,pagination:i,interactive:n}){const s=Ze.toCanvas(e);this.itemList.setBounds(s);const r=Math.max(...t.nodes().map(a=>a.getTextMeasureBBox().height));t.each((a,o)=>{if(a.proxyButton){const l=a.pageIndex===i.currentPage,{x:c,y:h,height:u,width:d}=Ze.toCanvas(a,a.getTextMeasureBBox()),g=(r-u)/2,p={x:c-s.x,y:h-g-s.y,height:r,width:d},f=n&&l;a.proxyButton.setCursor(o.suppressHighlight?"default":"pointer"),a.proxyButton.setEnabled(f),a.proxyButton.setPointerEvents(f?void 0:"none"),a.proxyButton.setBounds(p)}})}updatePaginationProxyButtons(t,e){const{pagination:i}=t;if(this.paginationGroup.setHidden(!i.visible),e&&"ctx"in t){const{oldPages:n,newPages:s}=t,r=(n?.length??s.length)>1,a=s.length>1;r!==a&&(a?this.createPaginationButtons(t):this.destroyPaginationButtons()),this.paginationGroup.setAriaHidden(a?void 0:!0)}if(this.prevButton&&this.nextButton){const{prev:n,next:s}=i.computeCSSBounds(),r=U.merge([n,s]);n.x-=r.x,n.y-=r.y,s.x-=r.x,s.y-=r.y,this.paginationGroup.setBounds(r),this.prevButton.setBounds(n),this.nextButton.setBounds(s),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"))}}createPaginationButtons(t){const{ctx:e,pagination:i}=t;this.prevButton||(this.prevButton=e.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPagePrevious"},tabIndex:0,parent:this.paginationGroup}),this.prevButton.addListener("click",n=>this.onPageButton(t,n,"previous")),this.prevButton.addListener("mouseenter",()=>i.onMouseHover("previous")),this.prevButton.addListener("mouseleave",()=>i.onMouseHover(void 0))),this.nextButton||(this.nextButton=e.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPageNext"},tabIndex:0,parent:this.paginationGroup}),this.nextButton.addListener("click",n=>this.onPageButton(t,n,"next")),this.nextButton.addListener("mouseenter",()=>i.onMouseHover("next")),this.nextButton.addListener("mouseleave",()=>i.onMouseHover(void 0)))}destroyPaginationButtons(){this.nextButton?.destroy(),this.prevButton?.destroy(),this.nextButton=void 0,this.prevButton=void 0}onPageButton(t,e,i){t.pagination.onClick(e.sourceEvent,i),this.updatePaginationProxyButtons(t,!1)}onDataUpdate(t,e){this.dirty=t.length!==e.length||t.some((i,n,s)=>{const[r,a]=[e[n],t[n]];return r.id!==a.id})}onLocaleChanged(t,e){const i=t.length;t.each(({proxyButton:n},s,r)=>{const a=n?.getElement();if(a!=null){const o=Ue(e.getItemLabel(s));a.textContent=this.getItemAriaText(o,r,i)}}),this.itemDescription.textContent=this.getItemAriaDescription()}onPageChange(t){this.updateItemProxyButtons(t),this.updatePaginationProxyButtons(t,!1)}getItemAriaText(t,e,i){return e>=0&&t?(e++,this.ctx.localeManager.t("ariaLabelLegendItem",{label:t,index:e,count:i})):this.ctx.localeManager.t("ariaLabelLegendItemUnknown")}getItemAriaDescription(){return this.ctx.localeManager.t("ariaDescriptionLegendItem")}};function jS(t,{itemId:e,seriesId:i,label:{text:n}},s){const r={defaultPrevented:!1,apiEvent:{type:t,itemId:e,seriesId:i,event:s,text:Ue(n),preventDefault:()=>r.defaultPrevented=!0}};return r}var pn=class extends $t{constructor(){super({name:"markerLabelGroup"}),this.symbolsGroup=this.appendChild(new ne({name:"legend-markerLabel-symbols",renderToOffscreenCanvas:!0,optimizeForInfrequentRedraws:!0})),this.label=this.appendChild(new _i),this.enabled=!0,this.pageIndex=Number.NaN,this.spacing=0,this.length=0,this.isCustomMarker=!1,this.isRtl=!1,this.marker=this.symbolsGroup.appendChild(new Lt({zIndex:1})),this.line=this.symbolsGroup.appendChild(new en({zIndex:0})),this.line.visible=!1,this.label.textBaseline="middle",this.label.y=1}destroy(){super.destroy(),this.proxyButton?.destroy()}setEnabled(t){this.enabled=t,this.refreshVisibilities()}getTextMeasureBBox(){return this.layout(),U.merge([this.symbolsGroup.getBBox(),this.label.getTextMeasureBBox()])}refreshVisibilities(){const t=this.enabled?1:.5;this.label.opacity=t,this.opacity=t}layout(){const{marker:t,line:e,length:i,isCustomMarker:n}=this;let s=0,r=0;if(t.visible){const{size:a}=t,o=Lt.anchor(t.shape);s=(o.x-.5)*a+i/2,r=(o.y-.5)*a,n?(t.x=0,t.y=0,t.translationX=s,t.translationY=r):(t.x=s,t.y=r,t.translationX=0,t.translationY=0)}e.visible&&(e.x1=0,e.x2=i,e.y1=0,e.y2=0)}preRender(t){const e=super.preRender(t);return this.layout(),e}layoutLabel(){const{length:t,spacing:e,isRtl:i}=this;this.label.x=i?-e:t+e,this.label.textAlign=i?"right":"left"}computeBBox(){return this.layout(),super.computeBBox()}};pn.className="MarkerLabel",x([xt("label")],pn.prototype,"text",2),x([xt("label")],pn.prototype,"fontStyle",2),x([xt("label")],pn.prototype,"fontWeight",2),x([xt("label")],pn.prototype,"fontSize",2),x([xt("label")],pn.prototype,"fontFamily",2),x([xt("label","fill")],pn.prototype,"color",2),x([yo(t=>t.layoutLabel())],pn.prototype,"spacing",2),x([yo(t=>t.layoutLabel())],pn.prototype,"length",2),x([Z()],pn.prototype,"isCustomMarker",2),x([yo(t=>t.layoutLabel())],pn.prototype,"isRtl",2);function sN(t,e){switch(typeof e.itemId){case"number":return{series:t,itemId:void 0,datum:void 0,datumIndex:e.itemId,legendItemName:e.legendItemName};case"string":return{series:t,itemId:e.itemId,datum:void 0,datumIndex:void 0,legendItemName:e.legendItemName};default:return e.itemId}}var HS=class{constructor(t){this.ctx=t,this.id=Nn(this),this.group=new $t({name:"legend",zIndex:16}),this.itemSelection=St.select(this.group,pn),this.containerNode=this.group.appendChild(new Tt({name:"legend-container"})),this.oldSize=[0,0],this.pages=[],this.paginationItemsOffsetX=0,this.maxPageSize=[0,0],this.paginationTrackingIndex=0,this.truncatedItems=new Set,this._data=[],this.size=[0,0],this._visible=!0,this.cleanup=new nt,this.group.visible=!1,this.pagination=new OS(()=>t.eventsHub.emit("chart:request-update",{type:9}),n=>this.updatePageNumber(n)),this.pagination.attachPagination(this.group);const e=t.contextMenuRegistry?.builtins.items;e&&(e["toggle-series-visibility"].action=n=>this.contextToggleVisibility(n),e["toggle-other-series"].action=n=>this.contextToggleOtherSeries(n));let i=this.opts?.enabled;this.cleanup.register(t.chartState.observe(n=>{const s=n("options","legend.enabled");i===!1&&s===!0&&t.legendManager&&t.stateManager.restoreState(t.legendManager),i=s,this.updateGroupVisibility()}),t.eventsHub.on("active:load-memento",n=>this.onActiveLoadMemento(n)),t.chartState.observe(n=>{n("activeItem")?.type==="series-node"&&this.ctx.highlightManager.updateHighlight(this.id,void 0)}),t.chartState.observe(n=>{const s=n("legendData");if(s==null)return;const r=Object.values(s).flat();this.data=r.filter(a=>!a.hideInLegend)}),t.layoutManager.registerElement(1,n=>this.positionLegend(n)),t.eventsHub.on("locale:change",()=>this.onLocaleChanged()),()=>{e&&(delete e["toggle-series-visibility"].action,delete e["toggle-other-series"].action)},()=>this.group.remove()),this.domProxy=new nN(this.ctx,this.id),t.legendManager&&this.ctx.historyManager.addMementoOriginator(t.legendManager)}set data(t){st(t,this._data)||(this.domProxy.onDataUpdate(this._data,t),this._data=t,this.syncProxyButtonStates(t),this.updateGroupVisibility())}get data(){return this._data}syncProxyButtonStates(t){const e=new Map(t.map(i=>[i.itemId,i.enabled]));this.itemSelection.each(({proxyButton:i},{itemId:n})=>{if(i==null)return;const s=e.get(n);s!=null&&i.setChecked(s)})}set visible(t){this._visible=t,this.ctx.chartState.setValue("legendVisible",t),this.updateGroupVisibility()}get visible(){return this._visible}get opts(){return this.ctx.chartState.getValue("options","legend")}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()}updateGroupVisibility(){const t=this.ctx.chartState.getValue("options");if(t===void 0)return;const e=t.legend?.enabled??!1;this.group.visible=e&&this.visible&&this.data.length>0}updateItemSelection(){const t=[...this.data];this.opts.reverseOrder&&t.reverse(),this.itemSelection.update(t)}isInteractive(){const{toggleSeries:t,listeners:{legendItemClick:e,legendItemDoubleClick:i},item:{tooltip:n}}=this.opts,s=n!=null&&n.visible!=="never";return t||i!=null||e!=null||s}checkInteractionState(){return this.ctx.interactionManager.isState(1)}attachLegend(t){t.appendChild(this.group)}getItemLabel(t){const{formatter:e}=this.opts.item.label;if(e){const i=t.datum;return this.cachedCallWithContext(e,{itemId:t.itemId,value:t.label.text,seriesId:t.seriesId,...i&&{datum:i}})}return t.label.text}calcLayout(t,e){const{item:i}=this.opts,{paddingX:n,paddingY:s,label:r,maxWidth:a,label:{maxLength:o=1/0,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:u}}=i;this.updateItemSelection();const d=[],g=di(r),f=a??t*.8,{markerWidth:m,anyLineEnabled:y}=this.calculateMarkerWidth(),{isRtl:b}=this.ctx.domManager;if(this.itemSelection.each((O,R)=>{O.fontStyle=l,O.fontWeight=c,O.fontSize=h,O.fontFamily=u,O.isRtl=b;const _=this.updateMarkerLabel(O,R,m,y,i),E=R.itemId??R.id,F=this.getItemLabel(R),z=Ue(F,"<unknown>").replace($s," ");O.text=this.truncate(z,o,f,_,g,E),d.push(O.getTextMeasureBBox())}),t=Math.max(1,t),e=Math.max(1,e),!Number.isFinite(t))return{};[t,e]=this.updateContainer(t,e);const v=this.size,S=this.oldSize;v[0]=t,v[1]=e,(v[0]!==S[0]||v[1]!==S[1])&&(S[0]=v[0],S[1]=v[1]);const{pages:M,maxPageHeight:C,maxPageWidth:D}=this.updatePagination(d,t,e),A=this.pages;this.pages=M,this.maxPageSize=[D-n,C-s];const w=this.pagination.currentPage,L=this.pages[w];return this.pages.length<1||!L?(this.visible=!1,{oldPages:A}):(this.visible=!0,this.updatePositions(w),this.update(),{oldPages:A})}isCustomMarker(t,e){return t&&e!==void 0&&typeof e!="string"}calcSymbolsEnabled(t,e){const i=!e||(t.marker.enabled??!0),n=!!(t.line&&e),s=this.isCustomMarker(i,t.marker.shape);return{markerEnabled:i,lineEnabled:n,isCustomMarker:s}}calcSymbolsLengths(t,e,i,n){const{marker:s,line:r}=n;let a;const{shape:o}=t.marker;if(this.isCustomMarker(e,o)){const h=new Lt;h.shape=o,h.updatePath();const u=h.getBBox();a=Math.max(u.width,u.height)}const l=e?s.size:0,c=i?r.length:0;return{markerLength:l,lineLength:c,customMarkerSize:a}}calculateMarkerWidth(){const{item:t}=this.opts,{showSeriesStroke:e}=t;let i=0,n=!1;return this.itemSelection.each((s,r)=>{const{symbol:a}=r,{lineEnabled:o,markerEnabled:l}=this.calcSymbolsEnabled(a,e),{markerLength:c,lineLength:h,customMarkerSize:u=-1/0}=this.calcSymbolsLengths(a,l,o,t);i=Math.max(i,h,u,c),n||(n=o)}),{markerWidth:i,anyLineEnabled:n}}updateMarkerLabel(t,e,i,n,s){const{marker:r,paddingX:a,showSeriesStroke:o}=s,{symbol:l}=e;let c=a;const{markerEnabled:h,isCustomMarker:u}=this.calcSymbolsEnabled(l,o),d=r.padding;(h||n)&&(c+=d+i);const{marker:g,line:p}=t;return g.visible=h,g.visible&&(g.shape=r.shape??l.marker.shape??"square",g.size=r.size,g.setStyleProperties(this.getMarkerStyles(He(l)))),p.visible=n,p.visible&&p.setStyleProperties(this.getLineStyles(l)),t.length=i,t.spacing=d,t.isCustomMarker=u,c}updateContainer(t,e){const i=this.getContainerStyles();return this.containerNode.width=0,this.containerNode.height=0,this.containerNode.setStyleProperties(i),this.containerNode.cornerRadius=i.cornerRadius,t-=i.strokeWidth*2+i.padding.left+i.padding.right,e-=i.strokeWidth*2+i.padding.top+i.padding.bottom,[t,e]}truncate(t,e,i,n,s,r){let a=!1;t.length>e&&(t=t.substring(0,e),a=!0);const o=na(t,s,i-n,a);return Us(o)?this.truncatedItems.add(r):this.truncatedItems.delete(r),o}updatePagination(t,e,i){const{item:n,pagination:s,orientation:r}=this.opts,a=Math.min(this.paginationTrackingIndex,t.length),{isRtl:o}=this.ctx.domManager;this.pagination.orientation=r,this.pagination.isRtl=o,this.pagination.translationX=0,this.pagination.translationY=0;const{pages:l,maxPageHeight:c,maxPageWidth:h,paginationBBox:u,paginationVertical:d}=this.calculatePagination(t,e,i,s),g=l.findIndex(D=>D.endIndex>=a);this.pagination.currentPage=te(0,g,Math.max(0,l.length-1));const{marker:p,paddingX:f,paddingY:m}=n,y=8,b=h-f,v=c-m;let S=0,M=-u.y-p.size/2;d?(o&&(S=e-u.width+u.x),M+=v+y):o?(S=-u.x,M+=(v-u.height)/2):(S+=-u.x+b+y,M+=(v-u.height)/2),this.paginationItemsOffsetX=o&&!d&&this.pagination.visible?u.width+y:0,this.pagination.translationX=S,this.pagination.translationY=M,this.pagination.update(s),this.pagination.updateMarkers(s);let C=0;return this.itemSelection.each((D,A,w)=>{w>(l[C]?.endIndex??1/0)&&C++,D.pageIndex=C}),{maxPageHeight:c,maxPageWidth:h,pages:l}}calculatePagination(t,e,i,n){const{item:s,maxWidth:r,maxHeight:a,position:o,orientation:l}=this.opts,{paddingX:c,paddingY:h}=s,u=["left","left-top","left-bottom","right","right-top","right-bottom"],{placement:d}=hu(o),g=u.includes(d);this.pagination.update(n),this.pagination.updateMarkers(n);let p=this.pagination.getBBox(),f=new U(0,0,0,0),m=[],y=0,b=0,v=0;const S=C=>C.width===p.width&&C.height===p.height,M=r!==void 0&&a!==void 0;do{if(v++>10){j.warn("unable to find stable legend layout.");break}p=f;const C=E1({orientation:l,bboxes:t,maxWidth:e-(g?0:p.width),maxHeight:i-(g?p.height:0),itemPaddingY:h,itemPaddingX:c,forceResult:M});m=C?.pages??[],y=C?.maxPageWidth??0,b=C?.maxPageHeight??0;const D=m.length;if(this.pagination.visible=D>1,this.pagination.totalPages=D,this.pagination.update(n),this.pagination.updateMarkers(n),f=this.pagination.getBBox(),!this.pagination.visible)break}while(!S(f));return{maxPageWidth:y,maxPageHeight:b,pages:m,paginationBBox:f,paginationVertical:g}}updatePositions(t=0){const{opts:{item:{paddingY:e}},itemSelection:i,pages:n}=this;if(n.length<1||!n[t])return;const{columns:s,startIndex:r,endIndex:a}=n[t];let o=0,l=0;const c=s.length,h=s[0].indices.length,u=this.opts.orientation==="horizontal",d=s[0].bboxes[0].height+e,{isRtl:g}=this.ctx.domManager,p=[],f=s.reduce((m,y)=>m+y.columnWidth,0);i.each((m,y,b)=>{if(b<r||b>a){m.visible=!1;return}const v=b-r;let S,M;u?(S=v%c,M=Math.floor(v/c)):(S=Math.floor(v/h),M=v%h),m.visible=!0;const C=s[S];C&&(l=Math.floor(d*M),g?o=Math.floor(f-(p[M]??0)):o=Math.floor(p[M]??0),p[M]=(p[M]??0)+C.columnWidth,m.translationX=o+this.paginationItemsOffsetX,m.translationY=l)})}updatePageNumber(t){const{itemSelection:e,group:i,pagination:n,pages:s,opts:{pagination:r}}=this,a=s[t];if(!a)return;const{startIndex:o,endIndex:l}=a;o===0?this.paginationTrackingIndex=0:t===s.length-1?this.paginationTrackingIndex=l:this.paginationTrackingIndex=Math.floor((o+l)/2),this.pagination.update(r),this.pagination.updateMarkers(r),this.updatePositions(t),this.domProxy.onPageChange({itemSelection:e,group:i,pagination:n,interactive:this.isInteractive()}),this.ctx.eventsHub.emit("chart:request-update",{type:9})}update(){const{color:t}=this.opts.item.label;this.itemSelection.each((e,i)=>{e.setEnabled(i.enabled),e.color=t}),this.updateContextMenu()}updateContextMenu(){const t=this.opts.toggleSeries?"show":"hide";this.ctx.contextMenuRegistry?.toggle("toggle-series-visibility",t),this.ctx.contextMenuRegistry?.toggle("toggle-other-series",t)}getLineStyles(t){const{stroke:e,strokeOpacity:i=1,strokeWidth:n,lineDash:s}=t.line??{},r=Math.min(2,n??1);return{stroke:e,strokeOpacity:i,strokeWidth:this.opts.item.line.strokeWidth??r,lineDash:s}}getMarkerStyles({marker:t}){const{fill:e,stroke:i,strokeOpacity:n=1,fillOpacity:s=1,strokeWidth:r,lineDash:a,lineDashOffset:o}=t,l=Math.min(2,r??1);return As(e)&&(e.width=8,e.height=8,e.padding=1,e.strokeWidth=Math.min(2,e.strokeWidth??2)),la(e)&&(e.fit="contain",e.width=void 0,e.height=void 0,e.repeat="no-repeat"),Zf({fill:e,stroke:i,strokeOpacity:n,fillOpacity:s,strokeWidth:this.opts.item.marker.strokeWidth??l,lineDash:a,lineDashOffset:o},cp,hp,up)}getContainerStyles(){const{border:t,cornerRadius:e,fill:i,fillOpacity:n,padding:s}=this.opts,{stroke:r,strokeOpacity:a,strokeWidth:o,enabled:l}=t,c=typeof s=="number";return Zf({cornerRadius:e,fill:i,fillOpacity:n,padding:{top:c?s:s.top??0,right:c?s:s.right??0,bottom:c?s:s.bottom??0,left:c?s:s.left??0},stroke:r,strokeOpacity:a,strokeWidth:l?o:0},cp,hp,up)}computePagedBBox(){const t=ne.computeChildrenBBox(this.group.excludeChildren({name:"legend-container"}));if(this.pages.length>1){const[n,s]=this.maxPageSize;t.height=Math.max(s,t.height),t.width=Math.max(n,t.width)}const{strokeWidth:e,padding:i}=this.getContainerStyles();return t.grow(i).grow(e),t}findNode(t){const{datum:e,proxyButton:i}=this.itemSelection.select(n=>n.datum?.itemId===t.itemId)[0]??{};if(e===void 0||i===void 0)throw new Error(`AG Charts - Missing required properties { datum: ${JSON.stringify(e)}, proxyButton: ${JSON.stringify(i)} }`);return{datum:e,proxyButton:i}}contextToggleVisibility(t){const{datum:e,proxyButton:i}=this.findNode(t);this.doClick(t.event,e,i),this.clearHighlight()}contextToggleOtherSeries(t){this.doDoubleClick(t.event,this.findNode(t).datum),this.clearHighlight()}onContextClick(t,e){if(this.checkInteractionState())return;const{sourceEvent:i}=t,n=e.unsafeNonNullDatum;this.clearHighlight();const s=this.ctx.contextMenuRegistry?.builtins.items;s&&(s["toggle-series-visibility"].enabled=!(this.opts.preventHidingAll&&this.contextMenuDatum?.enabled&&this.getVisibleItemCount()<=1));const a=this.ctx.chartService.series.length>1&&this.ctx.chartService.series[0]?.getLegendData("category")[0]?.hideToggleOtherSeries!==!0?"show":"hide";this.ctx.contextMenuRegistry?.toggle("toggle-other-series",a);const{offsetX:o,offsetY:l}=i,{x:c,y:h}=Ze.toCanvasPoint(e,o,l);this.ctx.contextMenuRegistry?.dispatchContext("legend-item",{widgetEvent:t,canvasX:c,canvasY:h},{legendItem:n})}onClick(t,e,i){this.doClick(t,e,i)&&t.preventDefault()}getVisibleItemCount(){return this.ctx.chartService.series.flatMap(t=>t.getLegendData("category")).filter(t=>t.enabled).length}doClick(t,e,i){const{opts:{listeners:{legendItemClick:n},preventHidingAll:s,toggleSeries:r},ctx:{chartService:a}}=this;if(!e)return!1;const{legendType:o,seriesId:l,itemId:c,enabled:h,legendItemName:u}=e,d=a.series.find(f=>f.id===l);if(!d)return!1;let g=h;const p=jS("click",e,t);return n&&dn([d.properties,this.ctx.chartService],n,p.apiEvent),p.defaultPrevented||(r&&(g=!h,s&&!g&&this.getVisibleItemCount()<2&&(g=!0),i.setChecked(g),this.ctx.eventsHub.emit("legend:item-click",{legendType:o,series:d,itemId:c,enabled:g,legendItemName:u})),this.updateHighlight(g,e,d),this.ctx.eventsHub.emit("chart:request-update",{type:2,opts:{forceNodeDataRefresh:!0,skipAnimations:e.skipAnimations??!1}})),!0}onDoubleClick(t,e){this.doDoubleClick(t,e)&&t.preventDefault()}doDoubleClick(t,e){const{opts:{listeners:{legendItemDoubleClick:i},toggleSeries:n},ctx:{chartService:s}}=this;if(!e)return!1;const{legendType:r,id:a,itemId:o,seriesId:l}=e,c=s.series.find(u=>u.id===a);if(!c)return!1;const h=jS("dblclick",e,t);if(i&&dn([c.properties,this.ctx.chartService],i,h.apiEvent),h.defaultPrevented)return!0;if(n){const u=s.series.flatMap(f=>f.getLegendData("category"));let d=0;const g=new Set;for(const f of u)f.enabled&&(d+=1,f.legendItemName!=null&&g.add(f.legendItemName));g.size>0&&(d=g.size);const p=u.find(f=>f.itemId===o&&f.seriesId===l);this.ctx.eventsHub.emit("legend:item-double-click",{legendType:r,series:c,itemId:o,numVisibleItems:d,enabled:p?.enabled??!1,legendItemName:p?.legendItemName})}return this.ctx.eventsHub.emit("chart:request-update",{type:2,opts:{forceNodeDataRefresh:!0}}),!0}toTooltipMeta(t,e){let i;return t instanceof FocusEvent?i=Ze.toCanvas(e).computeCenter():(t.preventDefault(),i=Ze.toCanvasPoint(e,t.offsetX,t.offsetY)),{canvasX:i.x,canvasY:i.y,showArrow:!1}}getTooltipContent(t){const e=this.opts.item.tooltip,i=this.truncatedItems.has(t.itemId??t.id),n=e?.text!=null||e?.renderer!=null,s=e?.visible??(n?"always":"auto");if(s!=="never"&&!(s==="auto"&&!i)){if(e?.renderer){const r={seriesId:t.seriesId,itemId:t.itemId??t.id,text:Ue(t.label.text),visible:t.enabled},a=this.cachedCallWithContext(e.renderer,r);if(a==="")return;if(a!=null)return[{type:"raw",rawHtmlString:et(a)}]}return e?.text!=null?[{type:"structured",title:e.text}]:[{type:"structured",title:this.getItemLabel(t)}]}}onHover(t,e){if(this.checkInteractionState())return;if(!this.opts.enabled)throw new Error("AG Charts - onHover handler called on disabled legend");this.pagination.setPage(e.pageIndex);const i=e.datum,n=i?this.ctx.chartService.series.find(r=>r.id===i?.id):void 0,s=i?this.getTooltipContent(i):void 0;if(s){const r=this.toTooltipMeta(t,e);this.ctx.tooltipManager.updateTooltip(this.id,r,s)}else this.ctx.tooltipManager.removeTooltip(this.id,void 0,!0);this.updateHighlight(i?.enabled,i,n),this.ctx.eventsHub.emit("legend:item-hover",null)}onLeave(){this.checkInteractionState()||(this.ctx.tooltipManager.removeTooltip(this.id,void 0,!0),this.clearHighlight())}clearHighlight(){this.updateHighlight(void 0,void 0,void 0)}updateHighlight(t,e,i,n){if(this.checkInteractionState())return;const s=c=>{if(c===void 0)return this.ctx.activeManager.clear();{const h=c.nodeDatum.series.id,u=c.itemId;return this.ctx.activeManager.update({type:"legend",seriesId:h,itemId:u},void 0)}},r=c=>{s(c)||this.ctx.highlightManager.updateHighlight(this.id,c?.nodeDatum)},a=c=>{this.ctx.interactionManager.isState(64)||n?.initialState?r(c):this.ctx.interactionManager.isState(4)?this.ctx.animationManager.onBatchStop(()=>{r(c)}):c===void 0&&r(c)},o=t===!0&&i!==void 0&&e!==void 0,l=e?.suppressHighlight===!0;if(o&&!l){const c=e.itemId,h=sN(i,e);a({itemId:c,nodeDatum:h})}else a(void 0)}onActiveLoadMemento(t){const{activeItem:e}=t;if(e?.type!=="legend")return this.ctx.highlightManager.updateHighlight(this.id,void 0);const i=this.data.find(s=>s.seriesId===e.seriesId&&s.itemId===e.itemId),n=this.ctx.chartService.series.find(s=>s.id===e.seriesId);if(n===void 0)j.warn(`Cannot find seriesId: "${e.seriesId}"`),t.reject();else if(i===void 0){const s=JSON.stringify({seriesId:e.seriesId,itemId:e.itemId});j.warn(`cannot find legend item: ${s}`),t.reject()}else this.updateHighlight(i.enabled,i,n,t)}onLocaleChanged(){this.updateItemSelection(),this.domProxy.onLocaleChanged(this.itemSelection,this)}positionLegend(t){if(this.opts==null)return;const e=this.positionLegendScene(t);this.positionLegendDOM(e)}positionLegendScene(t){const{enabled:e,position:i,spacing:n}=this.opts;if(!e||!this.data.length)return;const{placement:s,floating:r,xOffset:a,yOffset:o}=hu(i),l=r?new U(0,0,t.width,t.height):t.layoutBox,{x:c,y:h,width:u,height:d}=l,[g,p]=this.calculateLegendDimensions(l),{oldPages:f}=this.calcLayout(g,p),m=this.computePagedBBox();if(this.visible){let b=function(M){};var y=b;let v,S;switch(s){case"top":v=(u-m.width)/2,S=0;break;case"bottom":v=(u-m.width)/2,S=d-m.height;break;case"right":v=u-m.width,S=(d-m.height)/2;break;case"left":v=0,S=(d-m.height)/2;break;case"top-right":case"right-top":v=u-m.width,S=0;break;case"top-left":case"left-top":v=0,S=0;break;case"bottom-right":case"right-bottom":v=u-m.width,S=d-m.height;break;case"bottom-left":case"left-bottom":v=0,S=d-m.height;break;default:b(s)}if(!r){let M,C;switch(s){case"top":case"top-right":case"top-left":M=m.height+n,C="top";break;case"bottom":case"bottom-right":case"bottom-left":M=m.height+n,C="bottom";break;case"left":case"left-top":case"left-bottom":M=m.width+n,C="left";break;case"right":case"right-top":case"right-bottom":M=m.width+n,C="right";break;default:b(s)}l.shrink(M,C)}v+=a,S+=o,this.group.translationX=Math.floor(c+v-m.x),this.group.translationY=Math.floor(h+S-m.y),this.containerNode.x=m.x,this.containerNode.y=m.y,this.containerNode.width=m.width,this.containerNode.height=m.height}return f}positionLegendDOM(t){const{ctx:e,itemSelection:i,pagination:n,pages:s,group:r}=this,a=this.visible&&this.opts.enabled,o=this.isInteractive();this.domProxy.update({visible:a,interactive:o,ctx:e,itemSelection:i,group:r,pagination:n,oldPages:t,newPages:s,datumReader:this,itemListener:this})}calculateLegendDimensions(t){const{width:e,height:i}=t,{maxWidth:n,maxHeight:s,position:r}=this.opts,{placement:a}=hu(r),o=e/i,l=.5,c=.2,h=.25;let u,d;function g(p){}switch(a){case"top":case"top-left":case"top-right":case"bottom":case"bottom-left":case"bottom-right":{const p=o<1?Math.min(l,c*(1/o)):c;u=n?Math.min(n,e):e,d=s?Math.min(s,i):Math.round(i*p);break}case"left":case"left-top":case"left-bottom":case"right":case"right-top":case"right-bottom":{const p=o>1?Math.min(l,h*o):h;u=n?Math.min(n,e):Math.round(e*p),d=s?Math.min(s,i):i;break}default:}return[u,d]}cachedCallWithContext(t,e){const{callbackCache:i,chartService:n,chartState:s}=this.ctx,r={context:s.getValue("options","context")};return i.call([r,n],t,e)}};HS.className="Legend";var rN=class{constructor(t){this.mementoOriginatorKey="legend",this.chartState=t.chartState}createMemento(){return this.getData().filter(({hideInLegend:t,isFixed:e})=>!t&&!e).map(({enabled:t,seriesId:e,itemId:i,legendItemName:n})=>({visible:t,seriesId:e,itemId:i,legendItemName:n}))}guardMemento(t){return t==null||ce(t)}restoreMemento(t,e,i){if(i)for(const n of i){const{seriesId:s,data:r}=this.getRestoredData(n)??{};!s||!r||this.updateData(s,r)}}getRestoredData(t){const{seriesId:e,itemId:i,legendItemName:n,visible:s}=t;if(e){const a=(this.legendDataRecord[e]??[]).map(o=>{const l=o.seriesId===e&&(!i||o.itemId===i);return l&&o.isFixed&&this.warnFixed(o.seriesId,o.itemId),!o.isFixed&&l?{...o,enabled:s}:o});return{seriesId:e,data:a}}if(!(i==null&&n==null))for(const r of this.getData()){if(i!=null&&r.itemId!==i||n!=null&&r.legendItemName!==n)continue;if(r.isFixed){this.warnFixed(r.seriesId,i);return}const a=(this.legendDataRecord[r.seriesId]??[]).map(o=>o.itemId===i||o.legendItemName===n?{...o,enabled:s}:o);return{seriesId:r.seriesId,data:a}}}warnFixed(t,e){j.warnOnce(`The legend item with seriesId [${t}] and itemId [${e}] is not configurable, this series item cannot be toggled through the legend.`)}get legendDataRecord(){return this.chartState.getValue("legendData")??{}}updateData(t,e=[]){this.chartState.setValue("legendData",{...this.legendDataRecord,[t]:e})}clearData(){this.chartState.setValue("legendData",{})}toggleItem(t,e,i,n){if(n){const o=this.legendDataRecord;for(const l of this.getData()){const c=(o[l.seriesId]??[]).map(h=>h.legendItemName===n?{...h,enabled:t}:h);this.updateData(l.seriesId,c)}return}const s=this.getData(e),r=s.length===1,a=s.map(o=>i==null&&r||o.itemId===i?{...o,enabled:t}:o);this.updateData(e,a)}getData(t){const e=this.legendDataRecord;return t?e[t]??[]:Object.values(e).flat()}getDatum({seriesId:t,itemId:e}={}){return this.getData(t).find(i=>i.itemId===e)}getSeriesEnabled(t){const e=this.getData(t);if(e.length>0)return e.some(i=>i.enabled)}getItemEnabled({seriesId:t,itemId:e}={}){return this.getDatum({seriesId:t,itemId:e})?.enabled??!0}},Xf={type:"plugin",name:"legend",version:Ye,options:{enabled:T,position:Uh,orientation:V("horizontal","vertical"),maxWidth:k,maxHeight:k,spacing:k,border:$r,cornerRadius:P,padding:Xn,fill:Ni,fillOpacity:q,preventHidingAll:T,reverseOrder:T,toggleSeries:T,item:{marker:{size:k,shape:qs,padding:k,strokeWidth:k},line:{length:k,strokeWidth:k},label:{maxLength:k,formatter:Re,...Ce},tooltip:{visible:V("auto","always","never"),text:N,renderer:Re},maxWidth:k,paddingX:k,paddingY:k,showSeriesStroke:T},pagination:{marker:{size:k,shape:qs,padding:k},activeStyle:{...$,...B},inactiveStyle:{...$,...B},highlightStyle:{...$,...B},label:Ce},listeners:{legendItemClick:Re,legendItemDoubleClick:Re}},themeTemplate:{...px,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},line:{length:25},showSeriesStroke:!0,label:{color:{$ref:"textColor"},fontSize:{$rem:sr.SMALL},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"}}},reverseOrder:!1,pagination:{marker:{shape:"triangle",size:12,padding:8},activeStyle:{fill:{$ref:"foregroundColor"},strokeWidth:1,strokeOpacity:1},inactiveStyle:{fill:{$ref:"subtleTextColor"},strokeWidth:1,strokeOpacity:1},highlightStyle:{fill:{$ref:"foregroundColor"},strokeWidth:1,strokeOpacity:1},label:{color:{$ref:"textColor"},fontSize:{$rem:sr.SMALL},fontFamily:{$ref:"fontFamily"}}},fill:{$if:[{$path:["./position/floating",!1]},{$ref:"chartBackgroundColor"},"transparent"]}},create:t=>{const e=new HS(t);return e.attachLegend(t.scene),e},register:t=>{t.has("legendManager")||t.service("legendManager",e=>new rN(e))}},qf=class extends kl{constructor(t){super(),this.ctx=t,this.localeText=void 0}};x([yo(t=>{t.ctx.localeManager.setLocaleText(t.localeText)}),I],qf.prototype,"localeText",2),x([yo(t=>{t.ctx.localeManager.setLocaleTextFormatter(t.getLocaleText)}),I],qf.prototype,"getLocaleText",2);var Jf={type:"plugin",name:"locale",version:Ye,options:{localeText:Ks,getLocaleText:ci(N)},create:t=>new qf(t)},$o={enabled:T,text:N,padding:Xn,border:$r,cornerRadius:P,...Ce,...$},Ns=ye({enabled:T,type:X(V("line","range")),range:Ie(ye((t,{options:e})=>e.type==="range","crossLine type to be 'range'"),Q(le),Ys(2,2)),value:Ie(ye((t,{options:e})=>e.type==="line","crossLine type to be 'line'"),le),label:$o,fill:H,fillOpacity:q,...B,...W},"cross-line options"),$S={...Ns,label:{...$o,position:V("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:P}},Sr={enabled:T,rotation:P,avoidCollisions:T,minSpacing:k,spacing:k,formatter:ci(cn),itemStyler:De({...Ce,...ln,spacing:P}),...Ce,...ln},cd={autoRotate:T,autoRotateAngle:P,wrapping:Hr,truncate:T,...Sr},US={format:An,...cd},hd={format:se(N,Ks),...cd},WS={enabled:T,width:k,size:k,stroke:H},Qf={enabled:T,label:hd,tick:WS},KS={values:Q(le),minSpacing:k},Uo={reverse:T,gridLine:{enabled:T,width:k,style:Pt({fill:H,fillOpacity:k,stroke:se(H,jl),strokeWidth:k,lineDash:Q(k)},"a grid-line style object array")},interval:KS,label:Sr,line:{enabled:T,width:k,stroke:H},tick:WS,context:()=>!0};Uo.layoutConstraints=J({stacked:X(T),align:X(V("start","end")),unit:X(V("percent","px")),width:X(k)});var em={enabled:T,text:cn,spacing:k,maxWidth:k,maxHeight:k,wrapping:V("never","always","hyphenate","on-space"),truncate:T,formatter:ci(cn),...Ce},Mr={...Uo,title:em,crossAt:{value:X(se(P,Gt,N,Q(N))),sticky:T},crossLines:Pt($S,"a cross-line options array"),position:V("top","right","bottom","left"),thickness:k,maxThicknessRatio:q};Mr.title._enabledFromTheme=J(T);var ud={enabled:T,...$,...B,...W};function xa(t,e){const i={enabled:T,xOffset:P,yOffset:P,formatter:ci(N),renderer:ci(se(N,P,Gt,ze({text:N,color:H,backgroundColor:H,opacity:q},"crosshair label renderer result object")))};let n;return t&&(n={...i,format:e?se(N,ze({millisecond:N,second:N,hour:N,day:N,month:N,year:N})):N}),{enabled:T,snap:T,label:n??i,...B,...W}}function Nc(t,e){return{min:Ie(t,xi("max")),max:Ie(t,Si("min")),preferredMin:Ie(t,xi("preferredMax"),xi("max")),preferredMax:Ie(t,Si("preferredMin"),Si("min")),nice:T,interval:{step:e?se(Zn,lo,Ul):Zn,values:Q(t),minSpacing:Ie(k,xi("maxSpacing")),maxSpacing:Ie(k,Si("minSpacing"))}}}var YS={step:se(Zn,lo,Ul),values:Q(se(P,Gt)),minSpacing:Ie(k,xi("maxSpacing")),maxSpacing:Ie(k,Si("minSpacing")),placement:V("on","between")},Wo={...Mr,type:Ge("category"),label:cd,paddingInner:q,paddingOuter:q,groupPaddingInner:q,crosshair:xa(),bandAlignment:V("justify","start","center","end"),bandHighlight:ud,interval:{...KS,placement:V("on","between")},skipNullBars:T},Ko={...Mr,type:Ge("grouped-category"),label:cd,crosshair:xa(),bandHighlight:ud,paddingInner:q,groupPaddingInner:q,depthOptions:Pt({label:{enabled:T,avoidCollisions:T,wrapping:V("never","always","hyphenate","on-space"),truncate:T,rotation:P,spacing:P,...Ce,...ln},tick:{enabled:T,stroke:H,width:k}},"depth options objects array")},Yo={...Mr,...Nc(P),type:Ge("number"),label:US,crosshair:xa(!0)},Zo={...Mr,...Nc(P),type:Ge("log"),base:Ie(Zn,ye(t=>t!==1,"not equal to 1")),label:US,crosshair:xa(!0)},Xo={...Mr,...Nc(se(P,Gt),!0),type:Ge("time"),label:hd,parentLevel:Qf,crosshair:xa(!0,!0)},qo={...Mr,type:Ge("unit-time"),unit:se(Ul,lo),label:hd,parentLevel:Qf,paddingInner:q,paddingOuter:q,groupPaddingInner:q,crosshair:xa(!0,!0),bandAlignment:V("justify","start","center","end"),bandHighlight:ud,skipNullBars:T,min:Ie(se(P,Gt),xi("max")),max:Ie(se(P,Gt),Si("min")),preferredMin:Ie(se(P,Gt),xi("preferredMax"),xi("max")),preferredMax:Ie(se(P,Gt),Si("preferredMin"),Si("min")),interval:YS},Sa=class BA extends En{constructor(){super(...arguments),this.type="category",this.defaultTickCount=0,this.index=new Map,this.indexInitialized=!1,this._domain=[]}static is(e){return e instanceof BA}set domain(e){this._domain!==e&&(this.invalid=!0,this._domain=e,this.index.clear(),this.indexInitialized=!1)}get domain(){return this._domain}get bands(){return this._domain}normalizeDomains(...e){let i;const n=new Set;let s=!0;for(const r of e){const a=r.domain;n.has(a)||(n.add(a),i==null?i=ZS(a):(s&&(s=aN(a,i)),i=ZS([...i,...a])))}return i??(i=[]),{domain:i,animatable:s}}toDomain(e){}invert(e,i=!1){this.refresh();const n=i?this.bandwidth/2:0,s=this.invertNearestIndex(Math.max(0,e-n));return i||e===this.ordinalRange(s)?this.domain[s]:void 0}ticks(e,i=this.domain,n){const{bands:s}=this;let{tickCount:r}=e;if(r===0){const f=s.length>1?1:0;return{ticks:s[f]?[s[f]]:[],count:void 0,firstTickIndex:f}}let a=r!=null&&r!==0?Math.trunc(s.length/r):1;if(a=mp(a),a<=1)return q0(i,!1,n);r=Math.trunc(s.length/a);const o=a*r,l=mp(Math.trunc((s.length-o)/2)),c=te(0,Math.floor((n?.[0]??0)*s.length),s.length),h=te(0,Math.ceil((n?.[1]??1)*s.length),s.length),u=Math.floor((c-l)/a)*a+l,d=Math.ceil((h-l)/a)*a+l,g=[];for(let f=u;f<d;f+=a)f>=0&&f<s.length&&g.push(s[f]);let p=g.length>0?this.findIndex(g[0]):void 0;return p!=null&&(p=Math.floor((p-l)/a)),{ticks:g,count:void 0,firstTickIndex:p}}findIndex(e){const{index:i,indexInitialized:n}=this;if(!n){const{domain:s}=this;for(let r=0;r<s.length;r++)i.set(Xt(s[r]),r);this.indexInitialized=!0}return i.get(Xt(e))}};function ZS(t){let e;const i=new Set;for(const n of t){const s=Xt(n),r=i.size;i.add(s),i.size!==r?e?.push(n):e??(e=t.slice(0,i.size))}return e??t}function aN(t,e){let i=-1;for(const n of t){const s=e.indexOf(n);if(s===-1)i=1/0;else{if(s<=i)return!1;i=s}}return!0}var XS={};wi(XS,{NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Pn,fromToMotion:()=>Mt,staticFromToMotion:()=>Os});function oN(t,e){return i=>Number(t)*(1-i)+Number(e)*i}function qS(t,e){if(typeof t=="string")try{t=Oe.fromString(t)}catch{t=Oe.fromArray([0,0,0])}if(typeof e=="string")try{e=Oe.fromString(e)}catch{e=Oe.fromArray([0,0,0])}return i=>Oe.mix(t,e,i).toRgbaString()}var tm=.2,Oc=["initial","remove","update","add","trailing","end","none"],Ec={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:tm,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1+tm,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}};function lN(t){return t.every(e=>e instanceof ws)}function im(t){return lN(t)?{nodes:t,selections:[]}:{nodes:[],selections:t}}function nm(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((i,n)=>nm(i,e[n])):id(t)&&id(e)?t.equals(e):ke(t)&&ke(e)?ep(t,e,nm):!1}var cN=class{constructor(t){this.isComplete=!1,this.elapsed=0,this.iteration=0,this.isPlaying=!1,this.isReverse=!1,this.id=t.id,this.groupId=t.groupId,this.autoplay=t.autoplay??!0,this.ease=t.ease??B0,this.phase=t.phase;const e=t.duration??Ec[this.phase].animationDuration;this.duration=e*t.defaultDuration,this.delay=(t.delay??0)*t.defaultDuration,this.onComplete=t.onComplete,this.onPlay=t.onPlay,this.onStop=t.onStop,this.onUpdate=t.onUpdate,this.interpolate=this.createInterpolator(t.from,t.to),this.from=t.from,t.skip===!0&&(this.onUpdate?.(t.to,!1,this),this.onStop?.(this),this.onComplete?.(this),this.isComplete=!0),t.collapsable!==!1&&(this.duration=this.checkCollapse(t,this.duration))}checkCollapse(t,e){return nm(t.from,t.to)?0:e}play(t=!1){this.isPlaying||this.isComplete||(this.isPlaying=!0,this.onPlay?.(this),this.autoplay&&(this.autoplay=!1,t&&this.onUpdate?.(this.from,!0,this)))}stop(){this.isPlaying=!1,this.isComplete||(this.isComplete=!0,this.onStop?.(this))}update(t){if(this.isComplete)return t;!this.isPlaying&&this.autoplay&&this.play(!0);const e=this.elapsed;if(this.elapsed+=t,this.delay>this.elapsed)return 0;const i=this.interpolate(this.isReverse?1-this.delta:this.delta);this.onUpdate?.(i,!1,this);const n=this.delay+this.duration;return this.elapsed>=n?(this.stop(),this.isComplete=!0,this.onComplete?.(this),t-(n-e)):0}get delta(){return this.ease(te(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(t,e){if(typeof e!="object"||id(e))return this.interpolateValue(t,e);if(Array.isArray(e)){const n=[];for(let s=0;s<e.length;s++){const r=this.createInterpolator(t[s],e[s]);r!=null&&n.push(r)}return s=>{const r=[];for(const a of n)r.push(a(s));return r}}const i=[];for(const n of Object.keys(e)){const s=this.createInterpolator(t[n],e[n]);s!=null&&i.push([n,s])}return n=>{const s={};for(const[r,a]of i)s[r]=a(n);return s}}interpolateValue(t,e){if(!(t==null||e==null)){if(id(t))return i=>t[td](e,i);try{switch(typeof t){case"number":return oN(t,e);case"string":return qS(t,e);case"boolean":if(t===e)return()=>t;break;case"object":return()=>t;default:throw new Error(`Unable to interpolate values: ${t}, ${e}`)}}catch{}throw new Error(`Unable to interpolate values: ${t}, ${e}`)}}},Pn={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function Mt(t,e,i,n,s,r,a){const{fromFn:o,toFn:l,applyFn:c=(p,f)=>p.setProperties(f)}=s,{nodes:h,selections:u}=im(n),d=(p,f)=>{let m,y=0,b=0;for(const v of f){const S=p[y]===v,M={last:b>=f.length-1,lastLive:y>=p.length-1,prev:f[b-1],prevFromProps:m,prevLive:p[y-1],next:f[b+1],nextLive:p[y+(S?1:0)]},C=`${t}_${e}_${v.id}`;i.stopByAnimationId(C);let D="unknown";S?r&&a&&(D=hN(v,v.unsafeDatum,r,a)):D="removed",v.transitionOut=D==="removed";const{phase:A,start:w,finish:L,delay:O,duration:R,..._}=o(v,v.unsafeDatum,D,M),{phase:E,start:F,finish:z,delay:K,duration:G,...ie}=l(v,v.unsafeDatum,D,M),de=L==null;i.animate({id:C,groupId:t,phase:A??E??"update",duration:R??G,delay:O??K,from:_,to:ie,ease:vc,collapsable:de,onPlay:()=>{const ae={...w,...F,..._};c(v,ae,"start")},onUpdate(ae){c(v,ae,"update")},onStop:()=>{const ae={...w,...F,..._,...ie,...L,...z};c(v,ae,"end")}}),S&&y++,b++,m=_}};let g=0;for(const p of u){const f=p.nodes(),m=f.filter(y=>!p.isGarbage(y));d(m,f),i.animate({id:`${t}_${e}_selection_${g}`,groupId:t,phase:"end",from:0,to:1,ease:vc,onStop(){p.cleanup()}}),g++}d(h,h)}function Os(t,e,i,n,s,r,a){const{nodes:o,selections:l}=im(n),{start:c,finish:h,phase:u}=a;i.animate({id:`${t}_${e}`,groupId:t,phase:u??"update",from:s,to:r,ease:vc,onPlay:()=>{if(!c)return;const d=Object.keys(c);for(const g of o)g.setPropertiesWithKeys(c,d);for(const g of l){const p=g.nodes();g.batchedUpdate(function(){for(const m of p)m.setPropertiesWithKeys(c,d)})}},onUpdate(d){const g=Object.keys(d);for(const p of o)p.setPropertiesWithKeys(d,g);for(const p of l){const f=p.nodes();p.batchedUpdate(function(){for(const y of f)y.setPropertiesWithKeys(d,g)})}},onStop:()=>{const d={...r,...h},g=Object.keys(d);for(const p of o)p.setPropertiesWithKeys(d,g);for(const p of l){const f=p.nodes();p.batchedUpdate(function(){for(const y of f)y.setPropertiesWithKeys(d,g);p.cleanup()})}}})}function hN(t,e,i,n){const s=i(t,e);return n.added.has(s)?"added":n.removed.has(s)?"removed":t.previousDatum==null&&t.datum!=null?"added":t.previousDatum!=null&&t.datum==null?"removed":"updated"}var JS={};wi(JS,{resetMotion:()=>Wt});function Wt(t,e){const{nodes:i,selections:n}=im(t);for(const s of n){const r=s.nodes();s.batchedUpdate(function(){for(const o of r){const l=e(o,o.unsafeDatum);o.setProperties(l)}s.cleanup()})}for(const s of i){const r=e(s,s.unsafeDatum);s.setProperties(r)}}var dd=class extends Te{};x([I],dd.prototype,"visible",2),x([I],dd.prototype,"text",2),x([I],dd.prototype,"renderer",2);var tt=class extends Te{constructor(){super(...arguments),this.id=Nn(this),this.node=new xS({zIndex:1}).setProperties({textAlign:"center",pointerEvents:1}),this.enabled=!1,this.textAlign="center",this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always",this.truncate=!0,this.padding=0,this.layoutStyle="block",this.tooltip=new dd,this.truncated=!1}registerInteraction(t,e){return t.eventsHub.on("layout:complete",()=>this.updateA11yText(t,e))}computeTextWrap(t,e){const{text:i,padding:n,wrapping:s,truncate:r}=this,a=r?t:1/0,o=r?e:1/0,l=Math.min(this.maxWidth??1/0,a)-n*2,c=this.maxHeight??o-n*2,h={maxWidth:l,maxHeight:c,font:this,textWrap:s};if(!Number.isFinite(l)&&!Number.isFinite(c)){this.node.text=i;return}let u;ce(i)?(u=af(i,h),this.truncated=u.some(Eh)):(u=t0(et(i),h),this.truncated=Us(u)),this.node.text=u}updateA11yText(t,e){const{proxyInteractionService:i}=t;if(!this.enabled||!this.text){this.destroyProxyText();return}const n=Ze.toCanvas(this.node);if(!n)return;const{id:s}=this;this.proxyText==null&&(this.proxyText=i.createProxyElement({type:"text",domManagerId:s,where:e}),this.proxyTextListeners=[this.proxyText.addListener("mousemove",o=>this.handleMouseMove(t,o)),this.proxyText.addListener("mouseleave",()=>this.handleTooltipHide(t)),this.proxyText.addListener("focus",()=>this.handleFocus(t)),this.proxyText.addListener("blur",()=>this.handleTooltipHide(t))]);const r=Ue(this.text);r!==this.lastProxyTextContent&&(this.proxyText.textContent=r,this.lastProxyTextContent=r);const{lastProxyBBox:a}=this;(a==null||n.x!==a.x||n.y!==a.y||n.width!==a.width||n.height!==a.height)&&(this.proxyText.setBounds(n),this.lastProxyBBox={x:n.x,y:n.y,width:n.width,height:n.height})}getEffectiveTooltipVisible(){const{visible:t,text:e,renderer:i}=this.tooltip;return t??(e!=null||i!=null?"always":"auto")}getTooltipContent(t){const e=Ue(this.text),{renderer:i,text:n}=this.tooltip;if(i!=null){const r={text:e},a=dn(t.chartService,i,r);if(a==="")return;if(a!=null)return{type:"raw",rawHtmlString:et(a)}}return{type:"structured",title:n??e}}showTooltip(t,e,i){if(!this.enabled)return;const n=this.getEffectiveTooltipVisible();if(n==="never"||n==="auto"&&!this.truncated)return;const s=this.getTooltipContent(t);s!=null&&t.tooltipManager.updateTooltip(this.id,{canvasX:e,canvasY:i,showArrow:!1},[s])}handleMouseMove(t,e){if(e==null)return;const{x:i,y:n}=Ze.toCanvas(this.node),s=e.sourceEvent.offsetX+i,r=e.sourceEvent.offsetY+n;this.showTooltip(t,s,r)}handleFocus(t){const e=Ze.toCanvas(this.node);if(!e)return;const i=e.x+e.width/2,n=e.y+e.height/2;this.showTooltip(t,i,n)}handleTooltipHide(t){t.tooltipManager.removeTooltip(this.id,void 0,!0)}destroy(){this.destroyProxyText()}destroyProxyText(){if(this.proxyText!=null){for(const t of this.proxyTextListeners??[])t();this.proxyTextListeners=void 0,this.proxyText.destroy(),this.proxyText=void 0,this.lastProxyTextContent=void 0,this.lastProxyBBox=void 0}}};tt.className="Caption",x([I,xt("node","visible")],tt.prototype,"enabled",2),x([I,xt("node")],tt.prototype,"text",2),x([I,xt("node")],tt.prototype,"textAlign",2),x([I,xt("node")],tt.prototype,"fontStyle",2),x([I,xt("node")],tt.prototype,"fontWeight",2),x([I,xt("node")],tt.prototype,"fontSize",2),x([I,xt("node")],tt.prototype,"fontFamily",2),x([I,xt("node","fill")],tt.prototype,"color",2),x([I],tt.prototype,"spacing",2),x([I],tt.prototype,"maxWidth",2),x([I],tt.prototype,"maxHeight",2),x([I],tt.prototype,"wrapping",2),x([I],tt.prototype,"truncate",2),x([I],tt.prototype,"padding",2),x([I],tt.prototype,"layoutStyle",2),x([I],tt.prototype,"tooltip",2);var sm=class{constructor(){this.moduleMap=new Map,this._version=0}get version(){return this._version}modules(){return this.moduleMap.values()}addModule(t,e){if(this.moduleMap.has(t))throw new Error(`AG Charts - module already initialised: ${t}`);this.moduleMap.set(t,e),this._version++}removeModule(t){this.moduleMap.has(t)&&(this.moduleMap.get(t)?.destroy?.(),this.moduleMap.delete(t),this._version++)}getModule(t){return this.moduleMap.get(t)}isEnabled(t){return this.moduleMap.has(t)}mapModules(t){return Array.from(this.moduleMap.values(),t)}destroy(){for(const t of this.moduleMap.values())t?.destroy?.();this.moduleMap.clear()}},QS=(t=>(t[t.TickAndDomain=0]="TickAndDomain",t[t.TicksOnly=1]="TicksOnly",t[t.Off=2]="Off",t))(QS||{});function uN(t){const[e,i]=At(t.range),n=Math.floor(e),s=Math.ceil(i);return{min:n,max:s,visible:n!==s}}var rm=Math.PI*2,dN=rm/2;function gN(t,e){return Math.abs(e-t)<dN?e:t>e?e+rm:e-rm}function pN(t){const{min:e,max:i}=t,n=l=>l<e||l>i;return{tick:{fromFn(l,c,h){let{x1:u,x2:d,y1:g,y2:p}=l,f=l.opacity;return(h==="added"||n(c.offset))&&({x1:u,x2:d,y1:g,y2:p}=c,f=0),{x1:u,x2:d,y1:g,y2:p,opacity:f,phase:Pn[h]}},toFn(l,c,h){const{x1:u,x2:d,y1:g,y2:p}=c;let f=1;return h==="removed"&&(f=0),{x1:u,x2:d,y1:g,y2:p,opacity:f}},applyFn(l,c){l.setProperties(c),l.visible=!n(l.y)}},line:{fromFn(l,c){const{x1:h,x2:u,y1:d,y2:g}=l.unsafePreviousDatum??c;return{x1:h,x2:u,y1:d,y2:g,phase:Pn.updated}},toFn(l,c){const{x1:h,x2:u,y1:d,y2:g}=c;return{x1:h,x2:u,y1:d,y2:g}}},label:{fromFn(l,c,h){const u=l.previousDatum??c;let{x:d,y:g,rotationCenterX:p,rotationCenterY:f,rotation:m}=u,y=l.opacity;return h==="removed"||n(u.y)?m=c.rotation:(h==="added"||n(l.unsafeDatum.y))&&({x:d,y:g,rotationCenterX:p,rotationCenterY:f,rotation:m}=c,y=0),{x:d,y:g,rotationCenterX:p,rotationCenterY:f,rotation:m,opacity:y,phase:Pn[h]}},toFn(l,c,h){const{x:u,y:d,rotationCenterX:g,rotationCenterY:p}=c;let f=0,m=1;return h==="added"?f=c.rotation:h==="removed"?(m=0,f=c.rotation):f=gN(l.previousDatum?.rotation??c.rotation,c.rotation),{x:u,y:d,rotationCenterX:g,rotationCenterY:p,rotation:f,opacity:m,finish:{rotation:c.rotation}}}},group:{fromFn(l,c){const{translationX:h,translationY:u}=l;return{translationX:h,translationY:u,phase:Pn.updated}},toFn(l,c){const{translationX:h,translationY:u}=c;return{translationX:h,translationY:u}}}}}function fN(){return(t,e)=>({translationX:e.translationX,translationY:e.translationY})}function gd(){return(t,e)=>({x:e.x,y:e.y,rotationCenterX:e.rotationCenterX,rotationCenterY:e.rotationCenterY,rotation:e.rotation})}function eM(){return(t,e)=>{const{x1:i,x2:n,y1:s,y2:r}=e;return{x1:i,x2:n,y1:s,y2:r}}}function mN(){return(t,e)=>{const{x1:i,x2:n,y1:s,y2:r}=e;return{x:i,y:s,width:n-i,height:r-s}}}var tM=(t=>(t[t.TickLines=0]="TickLines",t[t.AxisLine=1]="AxisLine",t[t.TickLabels=2]="TickLabels",t))(tM||{});function iM(t,e){return t.domain===e.domain&&t.rangeExtent===e.rangeExtent&&t.nice[0]===e.nice[0]&&t.nice[1]===e.nice[1]&&t.gridLength===e.gridLength&&t.visibleRange[0]===e.visibleRange[0]&&t.visibleRange[1]===e.visibleRange[1]&&t.scrollbarKey===e.scrollbarKey&&t.initialPrimaryTickCount?.unzoomed===e.initialPrimaryTickCount?.unzoomed&&t.initialPrimaryTickCount?.zoomed===e.initialPrimaryTickCount?.zoomed}function nM(t,e,i){const n=t.bandwidth??0,r=((t.step??0)-n)/2,a=t.convert(i),o=a-r,l=a+n+r;return[a,go(o,e),go(l,e)]}var sM=class zA{constructor(e,i,n,s){this.moduleCtx=e,this.scale=n,this.id="unknown",this.nice=!0,this.mirrored=!1,this.parallel=!1,this.dataDomain={domain:[],clipped:!1},this.allowNull=!1,this.caption=new tt,this._gridLength=0,this.gridPadding=0,this.seriesAreaPadding=0,this._layoutConstraints={stacked:!0,align:"justify",width:100,unit:"percent"},this.boundSeries=[],this.includeInvisibleDomains=!1,this.interactionEnabled=!0,this.axisGroup=new ne({name:`${this.id}-axis`}),this.tickLineGroup=this.axisGroup.appendChild(new _o({name:`${this.id}-Axis-tick-lines`,zIndex:0})),this.tickLabelGroup=this.axisGroup.appendChild(new _o({name:`${this.id}-Axis-tick-labels`,zIndex:2})),this.labelGroup=new ne({name:`${this.id}-Labels`,zIndex:11}),this.gridGroup=new $t({name:`${this.id}-Axis-grid`,zIndex:2}),this.gridFillGroup=this.gridGroup.appendChild(new ne({name:`${this.id}-gridFills`})),this.gridLineGroup=this.gridGroup.appendChild(new ne({name:`${this.id}-gridLines`})),this.overlayLowGroup=new _o({name:`${this.id}-Overlay-Low`,zIndex:6}),this.overlayMidGroup=new _o({name:`${this.id}-Overlay-Mid`,zIndex:10}),this.overlayHighGroup=new _o({name:`${this.id}-Overlay-High`,zIndex:15}),this.tickLabelGroupSelection=St.select(this.tickLabelGroup,zo,!1),this.formatterCache=TS(),this.defaultTickMinSpacing=zA.defaultTickMinSpacing,this.translation={x:0,y:0},this.layout={label:{fractionDigits:0,spacing:5,format:void 0},labelThickness:0},this.axisContext=void 0,this.cleanup=new nt,this.isHovering=!1,this.range=[0,1],this.visibleRange=[0,1],this.animatable=!0,this.tickLayout=void 0,this.formatterBoundSeries=new Nx(()=>{const{direction:a,boundSeries:o}=this;return hn(o.flatMap(l=>l.getFormatterContext(a)))}),this.moduleMap=new sm,this.id=i,this.options=s;const r=s.context;r!==void 0&&(this.context=r),this.syncOptionDerivedState(s),this.range=this.scale.range.slice(),this.cleanup.register(this.moduleCtx.widgets.containerWidget.addListener("mousemove",a=>this.onMouseMove(a)),this.moduleCtx.widgets.containerWidget.addListener("mouseleave",()=>this.endHovering()))}get gridLength(){return this._gridLength}set gridLength(e){const i=this._gridLength;this._gridLength=e,i!==e&&this.onGridLengthChange(e,i)}get type(){return this.constructor.type??""}get layoutConstraints(){return this._layoutConstraints}get requiredRange(){return this._requiredRange}set requiredRange(e){this._requiredRange=e}get primaryLabel(){}get primaryTick(){}getLabelFormat(){}getPrimaryLabelFormat(){}isCategoryLike(){return!1}applyOptions(e){this.options=e,this.syncOptionDerivedState(e)}syncOptionDerivedState(e){this.nice=e.nice??!0;const i=e.layoutConstraints;i&&(this._layoutConstraints={...this._layoutConstraints,...i})}resetAnimation(e){}onMouseMove(e){const n=this.tickLabelGroup.pickNode(e.currentX,e.currentY)?.unsafeDatum,{textUntruncated:s=void 0}=n??{};s?(this.moduleCtx.tooltipManager.updateTooltip(this.id,{canvasX:e.currentX,canvasY:e.currentY,showArrow:!1},[{type:"structured",title:s}]),this.isHovering=!0):this.endHovering()}endHovering(){this.isHovering&&(this.moduleCtx.tooltipManager.removeTooltip(this.id,void 0,!0),this.isHovering=!1)}destroy(){this.moduleMap.destroy(),this.moduleContext?.destroy(),this.cleanup.flush()}setScaleRange(e){const{range:i,scale:n}=this,s=(i[1]-i[0])/(e[1]-e[0]),r=s*e[0],a=i[0]-r;n.range=[a,a+s]}updateScale(){this.setScaleRange(this.visibleRange),this.notifyAxisPlugins("onScaleChange")}attachAxis(e){e.gridNode.appendChild(this.gridGroup),e.axisNode.appendChild(this.axisGroup),e.labelNode.appendChild(this.labelGroup),e.overlayLowNode.appendChild(this.overlayLowGroup),e.overlayMidNode.appendChild(this.overlayMidGroup),e.overlayHighNode.appendChild(this.overlayHighGroup)}detachAxis(){this.gridGroup.remove(),this.axisGroup.remove(),this.labelGroup.remove(),this.overlayLowGroup.remove(),this.overlayMidGroup.remove(),this.overlayHighGroup.remove()}attachLabel(e){this.labelGroup.append(e)}inRange(e,i=0){const[n,s]=At(this.range);return e>=n-i&&e<=s+i}getRangeOverflow(e){const{range:i,visibleRange:n}=this,s=(i[1]-i[0])/(n[1]-n[0]),[r,a]=At([i[0]-s*n[0],i[0]-s*n[0]+s]);return e<r?e-r:e>a?e-a:0}onGridLengthChange(e,i){i^e&&this.onGridVisibilityChange(),this.notifyAxisPlugins("onGridChange")}onGridVisibilityChange(){}update(){this.formatterBoundSeries.clear(),this.updatePosition(),this.updateSelections(),this.gridLineGroup.visible=this.options.gridLine.enabled,this.updateLabels(),this.notifyAxisPlugins("onAxisUpdate")}getLabelStyles(e,i,n=this.options.label){const s={border:n.border,color:n.color,cornerRadius:n.cornerRadius,fill:n.fill,fillOpacity:n.fillOpacity,fontFamily:n.fontFamily,fontSize:n.fontSize,fontStyle:n.fontStyle,fontWeight:n.fontWeight,padding:n.padding,spacing:n.spacing};let r;n.itemStyler&&(r=this.cachedCallWithContext(n.itemStyler,{...e,...s}));const a=ge(r,i,s);return{border:a.border,color:a.color,cornerRadius:a.cornerRadius,fill:a.fill,fillOpacity:a.fillOpacity,fontFamily:a.fontFamily,fontSize:a.fontSize,fontStyle:a.fontStyle,fontWeight:a.fontWeight,padding:a.padding,spacing:a.spacing}}getTickSize(e=this.options.tick){return e.enabled?e.size:0}getTickSpacing(e=this.options.tick){if(!e.enabled)return 0;const i=this.chartLayout?.scrollbars?.[this.id];return!i?.enabled||i.placement!=="inner"?0:i.tickSpacing??0}processData(){this.invalidateLayoutCache();const{includeInvisibleDomains:e,boundSeries:i,direction:n}=this,r=(e?i:i.filter(a=>a.isEnabled())).map(a=>a.getDomain(n));this.setDomains(...r)}getDomainExtentsNice(){return[this.nice,this.nice]}setDomains(...e){let i,n;if(e.length>0){const s=this.scale.normalizeDomains(...e);i={domain:s.domain,sortMetadata:{sortOrder:1}},n=s.animatable}else i={domain:[]},n=!0;this.dataDomain=this.normaliseDataDomain(i),this.allowNull=this.dataDomain.domain.some(function(s){return s==null}),this.options.reverse&&(this.dataDomain={...this.dataDomain,domain:this.dataDomain.domain.toReversed()}),this.animatable=n}calculateDomain(e,i="none"){const{dataDomain:{domain:n},range:s,scale:r,gridLength:a}=this,o=Yr(s),l=[0,1],c=this.getDomainExtentsNice();this.updateScale();const{unzoomedTickLayoutCache:h}=this;let u;if(h==null||!iM(h,{domain:n,rangeExtent:o,nice:c,gridLength:a,visibleRange:l,initialPrimaryTickCount:e,scrollbarKey:i})){const d=r.range;this.setScaleRange([0,1]);const g=c.map(p=>p?0:2);u=this.calculateTickLayout(n,g,[0,1],e),r.range=d,this.unzoomedTickLayoutCache={domain:n,rangeExtent:o,nice:c,gridLength:a,visibleRange:l,initialPrimaryTickCount:e,scrollbarKey:i,tickLayout:u}}else u=h.tickLayout;return this.updateScale(),r.domain=u.niceDomain,{unzoomedTickLayout:u,domain:r.domain}}calculateLayout(e,i){this.chartLayout=i;const n=this.getScrollbarLayoutCacheKey(i),{visibleRange:s}=this,r=s[0]===0&&s[1]===1,{unzoomedTickLayout:a,domain:o}=this.calculateDomain(e,n),l=this.getDomainExtentsNice();let c;if(r)c=a;else{const{range:f,gridLength:m}=this,y=Yr(f),b=l.map(S=>S?1:2),{tickLayoutCache:v}=this;v==null||!iM(v,{domain:o,rangeExtent:y,nice:l,gridLength:m,visibleRange:s,initialPrimaryTickCount:e,scrollbarKey:n})?(c=this.calculateTickLayout(o,b,s,e),this.tickLayoutCache={domain:o,rangeExtent:y,nice:l,gridLength:m,visibleRange:s,initialPrimaryTickCount:e,scrollbarKey:n,tickLayout:c}):c=v.tickLayout}const{rawTickCount:h=0,fractionDigits:u,bbox:d}=c,g=a.rawTickCount??0,p=h!==0&&g!==0?{zoomed:h,unzoomed:g}:void 0;return this.tickLayout=c.layout,this.layout.label={fractionDigits:u,spacing:this.options.label.spacing,format:this.getLabelFormat()},this.notifyAxisPlugins("onAxisLayout"),{primaryTickCount:p,bbox:d}}invalidateLayoutCache(){this.unzoomedTickLayoutCache=void 0,this.tickLayoutCache=void 0,this.tickLayout=void 0}getScrollbarLayoutCacheKey(e){const i=e?.scrollbars?.[this.id];return i?.enabled?`${i.placement}:${i.spacing}:${i.thickness}:${i.tickSpacing}`:"none"}updatePosition(){const{gridGroup:e,overlayLowGroup:i,overlayMidGroup:n,overlayHighGroup:s,translation:r}=this,a=Math.floor(r.x),o=Math.floor(r.y);e.setProperties({translationX:a,translationY:o}),i.setProperties({translationX:a,translationY:o}),n.setProperties({translationX:a,translationY:o}),s.setProperties({translationX:a,translationY:o})}getOverlayGroup(e){return e==="low"?this.overlayLowGroup:e==="mid"?this.overlayMidGroup:this.overlayHighGroup}notifyAxisPlugins(e){for(const i of this.moduleMap.modules())i[e]?.()}tickFormatter(e,i,n,s,r,a="long"){const{moduleCtx:o}=this,l=this.options.label,{formatManager:c}=o,h=n?this.primaryLabel:void 0,u=this.tickFormatParams(e,i,s,r),d=this.formatterBoundSeries.get();let g,p,f;if(u.type==="number")g=u.fractionDigits;else if(u.type==="date"){const{unit:A,step:w,epoch:L}=u;p={unit:A,step:w,epoch:L},f=u.truncateDate}const m=this.uncachedCallWithContext.bind(this),y={datum:void 0,seriesId:void 0,legendItemName:void 0,key:void 0,source:"axis-label",property:this.getFormatterProperty(),domain:e,boundSeries:d},b=h??l,v=this.getLabelFormat(),S=n?v:void 0,{allowNull:M}=this,C={specifier:xr.mergeSpecifiers(this.getPrimaryLabelFormat(),v),truncateDate:f,allowNull:M},D=this.formatterCache;return(A,w)=>{const L=this.datumFormatParams(A,y,g,p,a);return L.value=A,Wf(b,D,m,L,w,{specifier:S,dateStyle:a,truncateDate:f})??c.format(m,L,C)??c.defaultFormat(L,C)}}formatDatum(e,i,n,s,r,a,o,l,c,h,u){if(i==null&&!u)return"";const{moduleCtx:d,dataDomain:g}=this;l??(l=g.domain);const{formatManager:p}=d,f=this.formatterBoundSeries.get();let m;switch(n){case"crosshair":case"annotation-label":m=this.layout.label.fractionDigits+1;break;case"series-label":m=2;break;case"tooltip":m=3;break;case"legend-label":m=void 0;break}const y=this.datumFormatParams(i,{source:n,datum:a,seriesId:s,legendItemName:r,key:o,property:this.getFormatterProperty(),domain:l,boundSeries:f},m,void 0,"long"),{type:b,value:v}=y,S=this.createCallWithContext(e),M=c?.formatValue(S,b,v,h??y)??p.format(S,y,{allowNull:u})??Wf(this.options.label,this.formatterCache,S,y,Number.NaN)??p.defaultFormat(y);return ce(M)?M:String(M)}getBBox(){return this.axisGroup.getBBox()}hasVisibleSeries(){return this.boundSeries.some(e=>e.isEnabled())}clipTickLines(e,i,n,s){this.tickLineGroup.setClipRect(new U(e,i,n,s))}clipGrid(e,i,n,s){this.gridGroup.setClipRect(new U(e,i,n,s))}getFormatterProperty(){const{direction:e,boundSeries:i}=this;let n=e;for(const s of i){const r=s.resolveKeyDirection(e);if(r!==e){n=r;break}}return n}getTitleFormatterParams(e){const{direction:i}=this,n=this.formatterBoundSeries.get(),s=this.options.title;return{domain:e,direction:i,boundSeries:n,defaultValue:s?.text}}normaliseDataDomain(e){return{domain:[...e.domain],clipped:!1}}getLayoutTranslation(){return this.translation}getLayoutState(){return{id:this.id,rect:this.getBBox(),translation:this.getLayoutTranslation(),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}getUpdateTypeOnResize(){return 5}createModuleContext(){return this.axisContext??(this.axisContext=this.createAxisContext()),this.moduleContext??(this.moduleContext=this.moduleCtx.child().constant("parent",this.axisContext)),this.moduleContext}createAxisContext(){const e=this,{scale:i}=this;return{axisId:this.id,axisType:this.type,scale:this.scale,direction:this.direction,continuous:Ve.is(i)||ks.is(i),get mirrored(){return e.mirrored},get reverse(){return e.options.reverse},get gridLength(){return e.gridLength},get gridPadding(){return e.gridPadding},get range(){return e.range},hasDefinedDomain:()=>this.hasDefinedDomain(),hasVisibleSeries:()=>this.hasVisibleSeries(),getCanvasBounds:()=>Ze.toCanvas(this.axisGroup),seriesKeyProperties:()=>this.boundSeries.reduce((n,s)=>{const r=s.getKeyProperties(this.direction);for(const a of r)n.add(a);return n},new Set),seriesIds:()=>this.boundSeries.map(n=>n.id),scaleInvert:n=>i.invert(n,!0),scaleInvertNearest:n=>i.invert(n,!0),formatScaleValue:(n,s,r)=>{const{allowNull:a}=this;return this.formatDatum(void 0,n,s,void 0,void 0,void 0,void 0,void 0,r,void 0,a)},attachLabel:n=>this.attachLabel(n),attachAxisOverlay:(n,s)=>this.getOverlayGroup(s).appendChild(n),inRange:(n,s)=>this.inRange(n,s),getRangeOverflow:n=>this.getRangeOverflow(n),pickBand:n=>this.pickBand(n),measureBand:n=>this.measureBand(n)}}pickBand(e){if(!En.is(this.scale))return;const{scale:i,range:n,id:s}=this,r=i.invert(this.isVertical()?e.y:e.x,!0),[a,o,l]=nM(i,n,r);return{id:s,value:r,band:[o,l],position:a}}measureBand(e){if(!En.is(this.scale))return;const[,i,n]=nM(this.scale,this.range,e);return{band:[i,n]}}isVertical(){return this.direction==="y"}isReversed(){return this.options.reverse}cachedCallWithContext(e,i){const{callbackCache:n,chartService:s}=this.moduleCtx;return n.call([this,s],e,i)}uncachedCallWithContext(e,i){const{chartService:n}=this.moduleCtx;return dn([this,n],e,i)}createCallWithContext(e){const{chartService:i}=this.moduleCtx;return(n,s)=>dn([e,this,i],n,s)}};sM.defaultTickMinSpacing=50;var am=sM,pd=new Date(1970,0,4),Jo=class GA extends Ve{constructor(){super([],[0,1]),this.type="time"}static is(e){return e instanceof GA}toDomain(e){return new Date(e)}convert(e,i){return super.convert(typeof e=="number"?e:e?.valueOf()??Number.NaN,i)}invert(e){return new Date(super.invert(e))}niceDomain(e,i=this.domain){if(i.length<2)return[];let[n,s]=i;const r=4,a=this.getPixelRange();for(let o=0;o<r;o++){const[l,c]=bN(n,s,e,a);if(Xt(n)===Xt(l)&&Xt(s)===Xt(c))break;n=l,s=c}return[n,s]}ticks(e,i=this.domain,n=[0,1],{extend:s=!1}={}){const{nice:r,interval:a,tickCount:o=Ve.defaultTickCount,minTickCount:l,maxTickCount:c}=e;if(i.length<2)return;const h=i.map(Xt),u=h[0],d=h.at(-1);if(a!=null){const m=this.getPixelRange();return{ticks:rM({start:u,stop:d,interval:a,availableRange:m,visibleRange:n,extend:s})??yN({start:u,stop:d,tickCount:o,minTickCount:l,maxTickCount:c,visibleRange:n,extend:s}),count:void 0}}else{if(r.every(Boolean)&&o===2)return{ticks:i,count:void 0};if(r.every(Boolean)&&o===1)return{ticks:i.slice(0,1),count:void 0}}const g=gc(u,d,o,l,c,{weekStart:pd});if(g==null)return;const p=On(g,new Date(u),new Date(d),{visibleRange:n,extend:s}),f=l0(g,new Date(u),new Date(d),{visibleRange:n,extend:s});return{ticks:p,count:void 0,firstTickIndex:f,timeInterval:g}}};function yN({start:t,stop:e,tickCount:i,minTickCount:n,maxTickCount:s,visibleRange:r,extend:a}){const o=gc(t,e,i,n,s,{weekStart:pd});return o?On(o,new Date(t),new Date(e),{visibleRange:r,extend:a}):[]}function rM({start:t,stop:e,interval:i,availableRange:n,visibleRange:s,extend:r}){if(!i)return[];if(typeof i!="number"){const u=On(i,new Date(t),new Date(e),{visibleRange:s,extend:r});return Lo(u.length,n)?void 0:u}const a=Math.abs(i);if(Lo(Math.abs(e-t)/a,n))return;const o=zu.findLast(u=>a%u.duration===0);if(o){const{timeInterval:u,step:d,duration:g}=o,p={...u,step:d*mr(u)*Math.round(a/g),epoch:gf(u,{weekStart:pd})};return On(p,new Date(t),new Date(e),{visibleRange:s,extend:r})}let l=new Date(Math.min(t,e));const c=new Date(Math.max(t,e)),h=[];for(;l<=c;)h.push(l),l=new Date(l),l.setMilliseconds(l.getMilliseconds()+a);return h}function bN(t,e,i,n){const{interval:s}=i,r=Math.min(Xt(t),Xt(e)),a=Math.max(Xt(t),Xt(e));let o;if(s!=null&&typeof s!="number")o=s;else{let u;typeof s=="number"&&(u=(a-r)/Math.max(s,1),Lo(u,n)&&(u=void 0)),u??(u=i.tickCount??Ve.defaultTickCount),o=gc(r,a,u,i.minTickCount,i.maxTickCount,{weekStart:pd})}if(o==null)return[t,e];const l=On(o,new Date(r),new Date(a),{extend:!0});if(l==null||l.length<2)return[t,e];const c=l[0],h=l.at(-1);return t<=e?[c,h]:[h,c]}var vN=1e3,Ir=class jA extends ks{constructor(){super(...arguments),this.type="ordinal-time",this.defaultTickCount=Ve.defaultTickCount,this._domain=[],this.isReversed=!1}static is(e){return e instanceof jA}set domain(e){e!==this._domain&&(this.invalid=!0,this._domain=e,this._bands=void 0,this._numericBands=void 0,this._uniformityCache=void 0,this._uniformityCacheVisibleStart=void 0,this._uniformityCacheVisibleEnd=void 0,this._uniformityCacheVisible=void 0,this.isReversed=aM(e))}get domain(){return this._domain}get bands(){return this._bands??(this._bands=this.isReversed?this.domain.slice().reverse():this.domain),this._bands}get numericBands(){return this._numericBands??(this._numericBands=this.bands.map(e=>e.valueOf())),this._numericBands}getUniformityCache(e){const{bands:i}=this,n=i.length;if(!e||e[0]===0&&e[1]===1)return n>vN&&this._uniformityCache===void 0&&(this._uniformityCache=AS(i)),this._uniformityCache;const s=Math.floor(e[0]*n),r=Math.min(Math.ceil(e[1]*n),n-1);if(this._uniformityCacheVisible!==void 0&&this._uniformityCacheVisibleStart===s&&this._uniformityCacheVisibleEnd===r)return this._uniformityCacheVisible;const a=AS(i,s,r);return this._uniformityCacheVisibleStart=s,this._uniformityCacheVisibleEnd=r,this._uniformityCacheVisible=a,a}normalizeDomains(...e){const i=e.filter(r=>r.domain.length>0);if(i.length===0)return{domain:[],animatable:!1};const n=i[0].domain,s=i.every(r=>r.domain===n);if(i.length===1||s){const r=i[0];let a=r.domain,o,l=!1;return r.sortMetadata?.sortOrder===void 0?o=jp(a):(o=r.sortMetadata.sortOrder,l=r.sortMetadata.isUnique??!1),o===-1?a=a.slice().reverse():o==null&&(a=l?a.slice().sort((c,h)=>c.valueOf()-h.valueOf()):Gp(a.slice())),{domain:a,animatable:!0}}return{domain:Gp(i.map(r=>r.domain).flat()),animatable:!0}}ticks(e,i,n=[0,1],{extend:s=!1,dropInitial:r=!1}={}){const{interval:a,maxTickCount:o,tickCount:l=o}=e,{bands:c,reversed:h}=this;if(!c.length)return;if(h&&(n=[1-n[1],1-n[0]]),this.refresh(),a==null){const{ticks:v,tickOffset:S,tickEvery:M}=this.getDefaultTicks(i,l,n,s);let C=v.length>0?this.findIndex(v[0]):void 0;return C=C==null?void 0:Math.floor((C-S)/M),{ticks:v,count:void 0,firstTickIndex:C}}let u,d;i&&i.length>=2?(u=i[0].valueOf(),d=i.at(-1).valueOf()):(u=c[0].valueOf(),d=c.at(-1).valueOf());const[g,p]=this.range,f=Math.abs(p-g),m=rM({start:u,stop:d,interval:a,availableRange:f,visibleRange:n,extend:s})??this.getDefaultTicks(i,l,n,s).ticks,y=[];let b=-1;for(const v of m){const S=this.findIndex(v,1)??-1,M=S===b;b=S,!(r&&S===0)&&S!==-1&&!M&&y.push(c[S])}return{ticks:y,count:void 0,firstTickIndex:void 0}}stepTicks(e,i,n=[0,1],s=!0){const r=i?this.bandDomainIndices(i):void 0,a=this.ticksEvery(r,n,e,0,!1),o=a.at(-1),l=s&&e>1?r?.[1]:void 0,c=l!=null&&o!=null?this.findIndex(o):void 0;return c!=null&&l!=null&&l-c<e&&a.pop(),a}bandCount(e=[0,1]){const{domain:i}=this,n=Math.floor(e[0]*i.length);return Math.ceil(e[1]*i.length)-n}getDefaultTicks(e,i,n,s){const{bands:r}=this,a=Math.ceil(r.length/i),o=Math.floor(a/2),l=e?this.bandDomainIndices(e):void 0;return{ticks:this.ticksEvery(l,n,a,o,s),tickOffset:o,tickEvery:a}}bandDomainIndices(e){const i=aM(e),n=this.findIndex(e[i?e.length-1:0],1)??0,s=this.findIndex(e[i?0:e.length-1],1)??this.bands.length-1;return[n,s]}ticksEvery([e,i]=[0,this.bands.length],n,s,r,a){const{bands:o}=this,l=e,c=i-e+1;let h=l+Math.floor(n[0]*c),u=l+Math.ceil(n[1]*c);a&&(h-=s,u+=s),h=Math.max(h,0),u=Math.min(u,o.length);let d;if(s<=1)d=o.slice(h,u);else{d=[];for(let g=h;g<u;g+=1)(g-l+r)%s===0&&d.push(o[g])}return d}};function aM(t){return t.length>0&&t[0]>t.at(-1)}var xN=1e3,oM=5e7,Dr=class HA extends ks{constructor(){super(...arguments),this.type="unit-time",this.defaultTickCount=1/0,this._domain=[],this._bands=void 0}static is(e){return e instanceof HA}static supportsInterval(e,i){return SN(e,i)}set domain(e){if(e===this._domain)return;const i=e.length===this._domain.length&&e.length>=2&&e[0].valueOf()===this._domain[0].valueOf()&&e[1].valueOf()===this._domain[1].valueOf();this._domain=e,i||this.invalidateCaches()}get domain(){return this._domain}get interval(){return this._interval}set interval(e){const i=e==null?void 0:df(e);this._interval?.unit===i?.unit&&this._interval?.step===i?.step||(this._interval=i,this.invalidateCaches())}invalidateCaches(){this._bands=void 0,this._numericBands=void 0,this._uniformityCache=void 0,this._domainBoundaries=void 0,this._bandRangeCache=void 0,this._encodedBands=void 0,this._encodingParams=void 0,this._linearParams=void 0}get bands(){if(this._bands===void 0)if(this.ensureEncodedBands(),this._encodedBands!=null&&this._encodingParams!=null){const e=this._encodingParams;this._bands=this._encodedBands.map(i=>o0(i,e))}else this._bands=[];return this._bands}get numericBands(){if(this._numericBands===void 0)if(this.ensureEncodedBands(),this._encodedBands!=null&&this._encodingParams!=null){const e=this._encodingParams;this._numericBands=this._encodedBands.map(i=>fr(i,e))}else this._numericBands=[];return this._numericBands}ensureEncodedBands(){if(this._encodedBands!==void 0)return;const{domain:e,interval:i}=this;if(e.length<2||i==null){this._encodedBands=[];return}const n=this.getCachedBandRange();if(n==null){this._encodedBands=[];return}const[s,r]=n,a={visibleRange:[0,1],extend:!1};if(hf(i,s,r,a)>oM){j.warnOnce("the configured unit results in too many bands, ignoring. Supply a larger unit."),this._encodedBands=[];return}const{encodedValues:o,encodingParams:l}=a0(i,s,r,a);this._encodedBands=o,this._encodingParams=l}getBandCountForUpdate(){return this.ensureEncodedBands(),this._encodedBands?.length??0}getUniformityCache(e){const i=this.getBandCountForUpdate();if(!e||e[0]===0&&e[1]===1){if(i>xN&&this._uniformityCache===void 0)if(this.ensureEncodedBands(),this._encodingParams!=null&&this._encodedBands!=null&&this._encodedBands.length>=2){const n=fr(this._encodedBands[0],this._encodingParams),s=fr(this._encodedBands[1],this._encodingParams);this._uniformityCache={isUniform:!0,interval:s-n}}else this._uniformityCache={isUniform:!1};return this._uniformityCache}if(this.ensureEncodedBands(),this._encodingParams!=null&&this._encodedBands!=null&&this._encodedBands.length>=2){const n=fr(this._encodedBands[0],this._encodingParams);return{isUniform:!0,interval:fr(this._encodedBands[1],this._encodingParams)-n}}return{isUniform:!1}}normalizeDomains(...e){return DS(...e)}getCachedBandRange(){const{domain:e,interval:i}=this;if(!(e.length<2||i==null))return this._bandRangeCache??(this._bandRangeCache={start:Pi(i,e[0]),stop:Pi(i,e[1])}),[this._bandRangeCache.start,this._bandRangeCache.stop]}getDomainBoundaries(){const{interval:e}=this;if(e!=null){if(this._domainBoundaries===void 0){const i=this.getCachedBandRange();if(i==null)return;const[n,s]=i,r=Math.min(n.valueOf(),s.valueOf()),a=Math.max(n.valueOf(),s.valueOf()),o=lf(e,new Date(a)).valueOf();this._domainBoundaries={d0:r,dNext:o}}return this._domainBoundaries}}getLinearParams(){if(this._linearParams===void 0&&(this.ensureEncodedBands(),this._encodedBands!=null&&this._encodingParams!=null&&this._encodedBands.length>=2)){const e=fr(this._encodedBands[0],this._encodingParams),i=fr(this._encodedBands[1],this._encodingParams);this._linearParams={firstBandTime:e,intervalMs:i-e}}return this._linearParams}isLinearUnit(){const e=this._encodingParams?.unit;return e==="millisecond"||e==="second"||e==="minute"||e==="hour"}findIndex(e,i=0){if(e==null)return;const n=this.getBandCountForUpdate();if(n===0)return;if(n===1)return 0;const s=this.getLinearParams();if(s==null||s.intervalMs===0)return super.findIndex(e,i);const{firstBandTime:r,intervalMs:a}=s,o=e.valueOf(),l=(o-r)/a;let c=i===1?Math.ceil(l):Math.floor(l);if(c=Math.max(0,Math.min(c,n-1)),this.isLinearUnit()){if(i===1){if(r+c*a<o&&c===n-1)return}else if(r+c*a>o&&c===0)return;return c}const h=this.numericBands;if(i===1){for(;c>0&&h[c-1]>=o;)c--;for(;c<n-1&&h[c]<o;)c++;if(h[c]<o)return}else{for(;c<n-1&&h[c+1]<=o;)c++;for(;c>0&&h[c]>o;)c--;if(h[c]>o)return}return c}convert(e,i){this.refresh(),e instanceof Date||(e=new Date(e));const{domain:n,interval:s}=this;if(n.length<2)return Number.NaN;if(i?.clamp!==!0&&s!=null){const r=this.getDomainBoundaries();if(r!=null){const a=e.valueOf();if(a<r.d0||a>=r.dNext)return Number.NaN}}return super.convert(e,i)}ticks({interval:e},i=this.domain,n=[0,1]){const s=this.numericBands;if(s.length===0||i.length<2)return;const r=Math.min(i[0].valueOf(),i[1].valueOf()),a=Math.max(i[0].valueOf(),i[1].valueOf()),[o,l]=this.visibleBandRange(r,a,n);if(e==null)return{ticks:s.slice(o,l).map(u=>new Date(u)),count:void 0,firstTickIndex:o};const c=this.intervalCandidates(e,i,n),h=this.snapCandidatesToBands(c,s,o,l);return{ticks:h.map(u=>new Date(u)),count:h.length,firstTickIndex:o}}visibleBandRange(e,i,n){const s=this.numericBands,r=s.length;if(r===0)return[0,0];const a=i-e,o=e+n[0]*a,l=e+n[1]*a,c=vo(0,r-1,u=>s[u]<=o)??0,h=(xo(0,r-1,u=>s[u]>=l)??r-1)+1;return[c,h]}intervalCandidates(e,i,n){return typeof e!="number"?On(e,i[0],i[1],{extend:!0,visibleRange:n}).map(s=>s.valueOf()):this.numericBands}snapCandidatesToBands(e,i,n,s){const r=this.interval?Fi(this.interval):1/0,a=[];let o=-1;for(const l of e){if(l<i[n]||l>i[s-1]+r)continue;const c=vo(n,s-1,h=>i[h]<=l);c!=null&&c!==o&&l-i[c]<=r&&(a.push(i[c]),o=c)}return a}};function SN(t,e,i){const n=Pi(e,t[0]),s=Pi(e,t[1]);return hf(e,n,s,i)<=oM}function MN(t,e,i,n,s){let[r,a]=At(e.map(Number));const o=Math.floor(i.unzoomed);if(o<=1){const[S,M]=DN(r,a),C=5*Math.pow(2,-Math.ceil(Math.log2(s[1]-s[0]))),{ticks:D}=ko(S,M,C,void 0,void 0,s),A=[t.toDomain(S),t.toDomain(M)];return n&&A.reverse(),{domain:A,ticks:D}}if(r===a){const S=Math.floor(Math.log10(r)),M=Math.pow(10,S),C=Math.min(M,1),D=o-1;r-=C*Math.floor(D/2),a=r+C*D}let l=r,c=a;l=CN(l,c,o);const h=wN(l,c,o),u=o-1;c=l+u*h;const d=Math.floor(l/h)*h,g=Math.floor(c/h)*h;d<=r&&g>=a&&(l=d,c=g);const p=[t.toDomain(l),t.toDomain(c)];n&&p.reverse();const f=Math.max(1,Math.floor(i.zoomed)-1),m=IN(f/u),y=h/m,b=Math.min(u*m+1,Math.floor(i.zoomed)),v=AN(l,y,b);return{domain:p,ticks:v}}function IN(t){if(t<=1)return 1;const e=Math.floor(Math.log10(t)),i=Math.pow(10,e),n=t/i;return n>=5?5*i:n>=2?2*i:i}function DN(t,e){let i=t,n=e,s=0;do{[i,n]=pf(i,n);const{ticks:r}=ko(i,n,5);if(r.length%2===1)return[i,n];i-=1,n+=1}while(s++<10);return[t,e]}function CN(t,e,i){t=Math.floor(t);const n=Math.abs(e-t)/(i-1),s=Math.floor(Math.log10(n)),r=Math.pow(10,s);return Math.floor(t/r)*r}function AN(t,e,i){const n=Lh(e),s=Math.pow(10,n),r=[];for(let a=0;a<i;a++){const o=t+e*a;r.push(Math.round(o*s)/s)}return r}function wN(t,e,i){const n=i-1,s=(e-t)/n;return kN(s)}function kN(t){const e=Math.floor(Math.log10(t)),i=Math.pow(10,e),n=t/i;return n>0&&n<=1?i:n>1&&n<=2?2*i:n>2&&n<=5?5*i:n>5&&n<=10?10*i:t}var TN=18,LN=[1,2,3,4,6,8,9,10,12];function lM(t,e=0){const i=[];for(const n of t){const{x:s,y:r,width:a,height:o}=n;if(i.some(l=>Cu(l,s,r,a+e,o+e)))return!0;i.push(n)}return!1}function NN(t,e,i,n){if(t==null)return e;if(typeof t!="number"){const o={...df(t),epoch:e[0]};return On(o,e[0],e[1],{visibleRange:i,extend:n})}const s=[],r=e[0].valueOf(),a=e[1].valueOf();for(let o=r;o<=a;o+=t)s.push(new Date(o));return s}function cM(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i+=1)if(t[i]?.valueOf()!==e[i]?.valueOf())return!1;return!0}function ON(t){if(t.length<2)return 1/0;let e=0,i=t[0].translation;for(let n=1;n<t.length;n++){const s=t[n].translation,r=Math.abs(s-i);e=Math.max(e,r),i=s}return e}function EN(t,{niceDomain:e,rawTicks:i,rawFirstTickIndex:n=0,generatePrimaryTicks:s,primaryTicksIndices:r,alignment:a,fractionDigits:o,timeInterval:l}){const{scale:c,label:h,tickFormatter:u,inRange:d,isVertical:g,sizeLimit:p=1/0}=t,f=Jo.is(c)||ks.is(c),m=di(h),y=yf(),b=[];return hM(c,e,()=>{const v=En.is(c)&&c.bandwidth||1/0,S=(c.bandwidth??0)/2,M=RN(h.enabled,s,e,i,o,l,u);let C=g?p:v,D=g?v:p;if(h.rotation){const w=Pp(h.rotation,C,D);C=w.width,D=w.height}const A={font:h,maxWidth:C,maxHeight:D,overflow:h.truncate?"ellipsis":"hide",textWrap:h.wrapping??"never"};for(let w=0;w<i.length;w++){const L=i[w],O=c.convert(L,{alignment:a})+S;if(d&&!d(O))continue;const R=r?.has(w)??!1,_=M(R,L,w);let E=null;h.avoidCollisions&&(E=Pu(_,A)||null,E===io&&(E=null));const F=E??_,z=ce(F),K=F!==_&&(z?Eh(F.at(-1)):Us(et(F)));let G;if(f){const ie=L?.valueOf();Number.isFinite(ie)&&(G=y(`v:${ie}`))}G??(G=y(`l:${z?Ue(F.flat()):F}`)),b.push({tick:L,tickId:G,tickLabel:F,isPrimary:R,index:w+n,textUntruncated:K?Ue(_):void 0,textMetrics:z?Ds(F,h):m.measureLines(et(F)),translation:Math.floor(O)})}}),b}function hM(t,e,i){const n=t.domain;try{t.domain=e,i()}finally{t.domain=n}}function RN(t,e,i,n,s,r,a){const o=e?"component":"long",l=e&&r?dc(r):void 0,c=e?a(i,n,!0,s,l,o):null,h=t?a(i,n,!1,s,r,o):null;return(u,d,g)=>(u?c:h)?.(d,g)??String(d)}function PN(t,e,i,n,s,r,a,o){if(!Jo.is(t)&&!ks.is(t))return;const l=dc(r);if(l==null)return;a&&(e=[1-e[1],1-e[0]]);const c=Math.min(t.domain[0].valueOf(),t.domain.at(-1).valueOf()),h=Math.max(t.domain[0].valueOf(),t.domain.at(-1).valueOf());let[u,d]=cf(new Date(c),new Date(h),e);u=Pi(l,u),u.valueOf()>=c&&(u=r0(l,u)),d=s0(l,d),d.valueOf()<=h&&(d=lf(l,d));const g=On(l,u,d),p=Fi(r),f=Ir.is(t),m={...s,interval:r},y=[];let b,v,S,M=0;if(Ir.is(t)){const C=Cs(r);v=o!=null&&Fi(o)>=Fi(C)?2:3,S=1;const D=i/n,A=t.bandCount(e)/(D*TN);M=LN.findLast(w=>A>=w)??1}else Dr.is(t)&&(t.interval==null||Fi(t.interval)>=p)?v=1:(v=0,S=2);for(let C=0;C<g.length-1;C++){const D=g[C],A=g[C+1],w=C===0,L=C===g.length-2,O=A.valueOf()-D.valueOf(),R=[Math.max((c-D.valueOf())/O,0),Math.min((h-D.valueOf())/O,1)];let _;switch(v){case 0:_=NN(m.interval,[D,A],R,!0);break;case 1:{_=t.ticks(m,[D,A],R)?.ticks??[];break}case 3:{_=t.ticks(m,[D,A],R,{extend:!0,dropInitial:!0})?.ticks??[];break}case 2:_=t.stepTicks(M,[D,A],void 0,!L);break}if(_b(_,K=>K.valueOf()<D.valueOf()),L||Bb(_,K=>{switch(v){case 0:case 3:return K.valueOf()+p>A.valueOf();case 1:case 2:return K.valueOf()>=A.valueOf()}}),_.length===0)continue;const E=_[0],F=zp(E,D);(v===0?F===0:F<=p)&&(!f||!w)&&(b??(b=new Set),b.add(y.length)),y.push(..._)}return b?.size===1&&b.has(0)&&(b=void 0),{ticks:y,primaryTicksIndices:b,alignment:S}}function FN(t,e,i,n,s){const r=uM(t.format,n);if(r==null)return{width:0,height:0};const a=Eo(r),o=n?dc(n):void 0,l=uM(e?.format,o),c=l?Eo(l):a,h=new Date(i[0]),u=new Date(i.at(-1)),d=o?On(o,new Date(i[0]),new Date(i.at(-1)),{extend:!0}):void 0;let g=0,p=0;if(a!=null){const f=jo(t),m=f.left+f.right,y=f.top+f.bottom;let b,v;d!=null&&d.length>1?(b=d[0],v=d[1]):(b=h,v=u);const S=On(n,b,v,{limit:50});for(const M of S){const C=a(M),{width:D,height:A}=s.measureLines(C);g=Math.max(g,D+m),p=Math.max(p,A+y)}}if(c!=null&&d!=null){const f=jo(e),m=f.left+f.right,y=f.top+f.bottom;for(const b of d){const v=c(b),{width:S,height:M}=s.measureLines(v);g=Math.max(g,S+m),p=Math.max(p,M+y)}}return{width:Math.ceil(g),height:Math.ceil(p)}}function VN(t,e,i,n){return t&&!e?i*n===-1?"top":"bottom":"middle"}function _N(t,e,i,n,s){const r=e>0&&e<=Math.PI,a=i>0&&i<=Math.PI,o=r||a?-1:1;if(t)if(e||i){if(n*o===-1)return"right"}else return"center";else if(n*s===-1)return"right";return"left"}function uM(t,e){if(t!=null){if(typeof t=="string")return t;if(ke(t)&&e!=null)return t[Cs(e)]}}function BN(t,e,i=0){const n=Is(t),s=!n&&i>=0&&i<=Math.PI?-1:1,r=!n&&i-Math.PI/2>=0&&i-Math.PI/2<=Math.PI?-1:1,a=e?s*(Math.PI/2):0;return{configuredRotation:n,defaultRotation:a,parallelFlipFlag:s,regularFlipFlag:r}}var zN=new Date(1970,0,4);function dM(t){const{label:e,parallel:i=!1,domain:n,axisRotation:s,labelOffset:r,sideFlag:a}=t,{defaultRotation:o,configuredRotation:l,parallelFlipFlag:c,regularFlipFlag:h}=BN(e.rotation,i,s),u=l+o,d=(w,L=0)=>{const O=e.minSpacing??(l===0&&L===0?10:0),R=u+L,_=jo(e);return lM(HN(t,w,R),O)||lM($N(w.ticks,r,R,_),O)},{maxTickCount:g}=gM(t),p=GN(t),f=e.enabled&&e.avoidCollisions,m=Number.isFinite(g)?g:10,y=f&&e.autoRotate&&e.rotation==null;let b=0,v=0,S=!0,M={tickDomain:[],niceDomain:n,ticks:[],rawTicks:[],rawTickCount:void 0,timeInterval:void 0,fractionDigits:0};for(;S&&b<=m;)({tickData:M,index:b}=jN(t,p,M,b)),v=y&&d(M,0)?Is(e.autoRotateAngle??335):0,S=f&&d(M,v);const C=_N(i,l,v,a,h),D=VN(i,l,a,c),A=l+v;return{tickData:M,textAlign:C,textBaseline:D,rotation:A}}function GN(t){return t.interval?.values?2:t.primaryTickCount!=null?1:0}function gM({scale:t,domain:e,range:i,visibleRange:n,label:s,defaultTickMinSpacing:r,interval:a}){const{minSpacing:o,maxSpacing:l}=a??{},{defaultTickCount:c}=t,h=Yr(i),u=Yr(n),d=Ir.is(t);if(Sa.is(t)||d&&e.length<1e3){const p=Sa.is(t)?e.length:Math.min(e.length,Math.max(1,Math.floor(h/(u*r)))),f=Math.ceil(h/(u*s.fontSize));return{tickCount:Math.min(f,p),minTickCount:0,maxTickCount:p}}const g=f0(h,u,o,l,c,r);return d&&(g.minTickCount=0),g}function jN(t,e,i,n){const{step:s,values:r}=t.interval??{},{maxTickCount:a,minTickCount:o,tickCount:l}=gM(t),c=w=>Math.max(l-w,o),h=s==null&&r==null&&c(n)>o,u=i.rawTicks,d=l-o,g={minTickCount:o,maxTickCount:a,tickCount:c(n)};let p=pM(t,e,g);if(h&&cM(p.rawTicks,u)){let w=n,L=d;for(;w<=L;){n=Math.trunc((w+L)/2),g.tickCount=c(n);const O=pM(t,e,g);cM(O.rawTicks,u)?w=n+1:(p=O,L=n-1)}}const{tickDomain:f,niceDomain:m,rawTicks:y,rawTickCount:b,rawFirstTickIndex:v,generatePrimaryTicks:S,primaryTicksIndices:M,alignment:C,fractionDigits:D,timeInterval:A}=p;return{tickData:{tickDomain:f,niceDomain:m,rawTicks:y,rawTickCount:b,fractionDigits:D,timeInterval:A,ticks:EN(t,{niceDomain:m,rawTicks:y,rawFirstTickIndex:v,generatePrimaryTicks:S,primaryTicksIndices:M,alignment:C,fractionDigits:D,timeInterval:A})},index:n+1}}function pM(t,e,i){const{domain:n,reverse:s,visibleRange:r,scale:a,interval:o,primaryLabel:l,niceMode:c,primaryTickCount:h,minimumTimeGranularity:u}=t,d={nice:c.map(w=>w===0),interval:o?.step,...i},g={...d,nice:c.map(w=>w===0||w===1)};let p;e===1&&h!=null&&Ve.is(a)&&(p=MN(a,n,h,s,r));const f=c.includes(0)?p?.domain??a.niceDomain(d,n):n;let m=f,y,b,v,S,M,C;const D=l?.enabled===!0&&g.interval==null;hM(a,f,()=>{switch(e){case 2:if(m=o.values,y=o.values,b=y.length,Ir.is(a)?C=1:Dr.is(a)&&(C=2),Ve.is(a)){const[w,L]=At(f.map(Number));y=y.filter(O=>Number(O)>=w&&Number(O)<=L).sort((O,R)=>Number(O)-Number(R))}break;case 1:if(p)y=p.ticks,b=p.ticks.length;else{const w=a.ticks(g,f,r);y=w?.ticks,b=w?.count}break;default:{const{tickCount:w,minTickCount:L,maxTickCount:O}=i;if(f.length>0&&g.interval==null&&(Dr.is(a)||D&&(Jo.is(a)||Ir.is(a)))){const E=f,F=Math.min(E[0].valueOf(),E.at(-1).valueOf()),z=Math.max(E[0].valueOf(),E.at(-1).valueOf());S=gc(F,z,w,L,O,{weekStart:l==null?zN:void 0,primaryOnly:!0})}let R;Ir.is(a)?R=u:Dr.is(a)&&(R=a.interval),R!=null&&S!=null&&Fi(R)>=Fi(S)&&(S=R);const _=S?PN(a,r,w,O,g,S,s,u):void 0;if(_)({ticks:y,primaryTicksIndices:M,alignment:C}=_);else{const E=Dr.is(a)&&g.interval==null&&S!=null?{...g,interval:S}:g,F=a.ticks(E,f,r);if(y=F?.ticks,b=F?.count,v=F?.firstTickIndex,Jo.is(a)||ks.is(a)){const z=typeof g.interval=="number"?pc(g.interval):g.interval;S??(S=z??F?.timeInterval)}}}}}),y??(y=[]);let A=0;for(const w of y){if(typeof w!="number")continue;const L=Lh(w);L>A&&(A=L)}return D||(M=void 0),{tickDomain:m,niceDomain:f,rawTicks:y,rawTickCount:b,rawFirstTickIndex:v,generatePrimaryTicks:D,primaryTicksIndices:M,alignment:C,fractionDigits:A,timeInterval:S}}function HN(t,e,i){const{niceDomain:n,ticks:s,timeInterval:r}=e;if(r==null)return[];const a=ON(s),{label:o,labelOffset:l,primaryLabel:c,domain:h}=t,{width:u,height:d}=FN(o,c,n??h,r,di(o)),g=[];for(const p of[0,a]){const{x:f,y:m}=Fp(l,p,i);g.push({x:f,y:m,width:u,height:d})}return g}function $N(t,e,i,n){const s=[],r=n.left+n.right,a=n.top+n.bottom;for(const{tickLabel:o,textMetrics:l,translation:c}of t){if(!o)continue;const{x:h,y:u}=Fp(e,c,i),d=l.width+r,g=l.height+a;s.push({x:h,y:u,width:d,height:g})}return s}var Rc=class $A extends am{constructor(e,i,n,s){super(e,i,n,s),this.crossAxisTranslation={x:0,y:0},this.minimumTimeGranularity=void 0,this.zoom={min:0,max:1},this.headingLabelGroup=this.axisGroup.appendChild(new $t({name:`${this.id}-Axis-heading`})),this.lineNodeGroup=this.axisGroup.appendChild(new $t({name:`${this.id}-Axis-line`})),this.lineNode=this.lineNodeGroup.appendChild(new en({zIndex:1})),this.tickLineGroupSelection=St.select(this.tickLineGroup,en,!1),this.gridLineGroupSelection=St.select(this.gridLineGroup,en,!1),this.gridFillGroupSelection=St.select(this.gridFillGroup,Tt,!1),this.tempText=new zo({debugDirty:!1}),this.tempCaption=new tt,this.animationManager=e.animationManager,this.animationState=new oc("empty",{empty:{update:{target:"ready",action:()=>this.resetSelectionNodes()},reset:"empty"},ready:{update:a=>this.animateReadyUpdate(a),resize:()=>this.resetSelectionNodes(),reset:"empty"}}),this.headingLabelGroup.appendChild(this.caption.node);let r;this.cleanup.register(e.eventsHub.on("layout:complete",a=>{const o=[a.chart.width,a.chart.height];r!=null&&!jn(o,r)&&this.animationState.transition("resize"),r=o}),this.caption.registerInteraction(this.moduleCtx,"afterend"))}static is(e){return e instanceof $A}get position(){return this.options.position}getZoom(){return this.zoom}setZoom(e){this.zoom={min:e.min,max:e.max}}get horizontal(){return this.position==="top"||this.position==="bottom"}onGridVisibilityChange(){}resetAnimation(e){e==="initial"&&this.animationState.transition("reset")}get direction(){return this.position==="top"||this.position==="bottom"?"x":"y"}createAxisContext(){const e=super.createAxisContext();return e.position=this.position,e}updateDirection(){switch(this.position){case"top":this.mirrored=!0,this.parallel=!0;break;case"right":this.mirrored=!0,this.parallel=!1;break;case"bottom":this.mirrored=!1,this.parallel=!0;break;case"left":this.mirrored=!1,this.parallel=!1;break}this.axisContext&&(this.axisContext.position=this.position,this.axisContext.direction=this.direction)}calculateLayout(e,i){return this.updateDirection(),super.calculateLayout(e,i)}calculateTickLayout(e,i,n,s){const r=kc(this.mirrored),a=this.options.label,o=r*(this.getTickSize()+this.getTickSpacing()+a.spacing+this.seriesAreaPadding),l=this.chartLayout?.scrollbars?.[this.id],c=this.getScrollbarThickness(l);if(i[0]===2&&i[1]===2&&!a.enabled&&this.options.tick.enabled===!1&&this.options.gridLine.enabled===!1){const{bbox:pe,spacing:_t}=this.measureAxisLayout(e,[],[],l,c);return{ticks:[],rawTickCount:0,tickDomain:e,niceDomain:e,fractionDigits:0,timeInterval:void 0,bbox:pe,layout:{ticks:[],tickLines:[],gridLines:[],gridFills:[],labels:[],spacing:_t}}}const{primaryLabel:h,scale:u,range:d,defaultTickMinSpacing:g,minimumTimeGranularity:p}=this,{interval:f,reverse:m}=this.options,y=dM({label:a,parallel:this.parallel,scale:u,interval:f,primaryLabel:h,domain:e,range:d,reverse:m,niceMode:i,visibleRange:n,defaultTickMinSpacing:g,minimumTimeGranularity:p,sideFlag:r,labelOffset:o,primaryTickCount:s,axisRotation:this.horizontal?Math.PI/-2:0,isVertical:this.direction==="y",sizeLimit:this.chartLayout?.sizeLimit,inRange:pe=>this.inRange(pe,.001),tickFormatter:(...pe)=>this.tickFormatter(...pe)}),{tickData:b}=y;if((a?.avoidCollisions??!0)&&this.horizontal&&b.ticks.length>2&&(Ve.is(this.scale)||ks.is(this.scale))){const pe=this.chartLayout?.padding.right??0,_t=b.ticks.at(-1);_t?.tickLabel!=null&&_t.translation+_t.textMetrics.width/2>d[1]+pe&&(_t.tickLabel=void 0,n[0]===0&&n[1]===1&&(b.ticks[0].tickLabel=void 0))}const{ticks:S,tickDomain:M,rawTicks:C,rawTickCount:D,fractionDigits:A,timeInterval:w,niceDomain:L}=b,O=S.map(pe=>this.getTickLabelProps(pe,y,c)),{position:R,gridPadding:_,gridLength:E}=this,F=R==="bottom"||R==="right"?-1:1,z=F*_,K=F*(E+_),G=this.calculateGridLines(S,z,K),ie=this.calculateGridFills(S,z,K),de=this.calculateTickLines(S,F,c),{bbox:ae,spacing:oe}=this.measureAxisLayout(M,S,O,l,c);return{ticks:C,rawTickCount:D,tickDomain:M,niceDomain:L,fractionDigits:A,timeInterval:w,bbox:ae,layout:{ticks:S,gridLines:G,gridFills:ie,tickLines:de,labels:O,spacing:oe}}}calculateGridLines(e,i,n){return e.map((s,r)=>this.calculateGridLine(s,r,i,n,e))}calculateGridLine({index:e,tickId:i,translation:n},s,r,a,o){const{horizontal:l}=this,c=this.options.gridLine,[h,u,d,g]=l?[n,r,n,a]:[r,n,a,n],{style:p}=c,{stroke:f,strokeWidth:m=0,lineDash:y}=p[e%p.length]??{};return{tickId:i,offset:n,x1:h,y1:u,x2:d,y2:g,stroke:f,strokeWidth:m,lineDash:y}}calculateGridFills(e,i,n){const{horizontal:s,range:r,type:a}=this,o=[];if(e.length==0)return o;let l=0;const c=!s&&a==="unit-time";if(c&&e[0].translation<r[0]||!c&&e[0].translation>r[0]){const u={tickId:`before:${e[0].tickId}`,translation:r[0]};o.push(this.calculateGridFill(u,-1,e[0].index,i,n,e)),l=1}return o.push(...e.map((u,d)=>this.calculateGridFill(u,d,u.index+l,i,n,e))),o}calculateGridFill({tickId:e,translation:i},n,s,r,a,o){const{horizontal:l,range:c}=this,h=this.options.gridLine,u=o[n+1],d=i,g=u?u.translation:c[1],[p,f,m,y]=l?[d,Math.max(r,a),g,Math.min(r,a)]:[Math.min(r,a),Math.min(d,g),Math.max(r,a),Math.max(d,g)],{fill:b,fillOpacity:v}=h.style[s%h.style.length]??{};return{tickId:e,x1:p,y1:f,x2:m,y2:y,fill:b,fillOpacity:v}}calculateTickLines(e,i,n=0){return e.map(s=>this.calculateTickLine(s,s.index,i,e,n))}calculateTickLine({isPrimary:e,tickId:i,translation:n},s,r,a,o=0){const{horizontal:l,primaryTick:c}=this,h=this.options.tick,u=e&&c?c:h,d=this.getTickSize(u),g=this.getTickSpacing(u),p=-r*(o+g),f=-r*d,[m,y,b,v]=l?[n,p,n,p+f]:[p,n,p+f,n],{stroke:S,width:M}=u;return{tickId:i,offset:n,x1:m,y1:y,x2:b,y2:v,stroke:S,strokeWidth:M,lineDash:void 0}}update(){this.updateDirection();const e=Array.from(this.tickLabelGroupSelection.nodes(),a=>a.unsafeDatum.tickId);super.update();const{tickLayout:i}=this;if(this.updateTitle(this.scale.domain,i?.spacing??0),this.animatable||this.moduleCtx.animationManager.skipCurrentBatch(),i){const{ticks:a}=i;if(this.animationManager.isSkipped())this.resetSelectionNodes();else{const o=a.map(c=>c.tickId),l=Ox(e,o);this.animationState.transition("update",l)}}const{enabled:n,stroke:s,width:r}=this.options.line;this.lineNode.setProperties({stroke:s,strokeWidth:n?r:0}),this.updateTickLines(),this.updateGridLines(),this.updateGridFills()}getAxisTransform(){return{translationX:Math.floor(this.translation.x+this.crossAxisTranslation.x),translationY:Math.floor(this.translation.y+this.crossAxisTranslation.y)}}getLayoutTranslation(){const{translationX:e,translationY:i}=this.getAxisTransform();return{x:e,y:i}}getLayoutState(){return{...super.getLayoutState(),position:this.position}}updatePosition(){super.updatePosition();const e=this.getAxisTransform();this.tickLineGroup.datum=e,this.tickLabelGroup.datum=e,this.lineNodeGroup.datum=e,this.headingLabelGroup.datum=e}setAxisVisible(e){this.tickLineGroup.visible=e&&(this.options.tick.enabled||(this.primaryTick?.enabled??!1)),this.tickLabelGroup.visible=e&&(this.options.label.enabled||(this.primaryTick?.enabled??!1)),this.lineNodeGroup.visible=e,this.headingLabelGroup.visible=e}getAxisLineCoordinates(){const{horizontal:e}=this,[i,n]=At(this.lineRange??this.range);return e?{x1:i,x2:n,y1:0,y2:0}:{x1:0,x2:0,y1:i,y2:n}}getTickLineBBox(e,i){const{translation:n}=e,{position:s,primaryTick:r}=this;let a=this.getTickSize();r?.enabled&&(a=Math.max(a,this.getTickSize(r)));const o=s==="bottom"||s==="right"?-1:1,l=this.getTickSpacing(this.options.tick),c=-o*(i+l),h=c,u=c-o*(a+l),d=Math.min(h,u),g=Math.max(h,u);switch(s){case"top":return new U(n,d,0,g-d);case"bottom":return new U(n,d,0,g-d);case"left":return new U(d,n,g-d,0);case"right":return new U(d,n,g-d,0)}}lineNodeBBox(){const{position:e,seriesAreaPadding:i}=this,{y1:n,y2:s}=this.getAxisLineCoordinates(),r=s-n;switch(e){case"top":return new U(n,-i,r,i);case"bottom":return new U(n,0,r,i);case"left":return new U(-i,n,i,r);case"right":return new U(0,n,i,r)}}titleBBox(e,i){const{tempCaption:n}=this,s=Math.abs(this.range[1]-this.range[0])||1/0;return n.node.setProperties(this.titleProps(n,e,i)),n.computeTextWrap(s,this.options.thickness??1/0),n.node.getBBox()}getScrollbarThickness(e){return e?.enabled&&e.placement==="inner"?e.spacing+e.thickness:0}resolveScrollbarLayout(e,i){if(!e)return;const{position:n}=this,s=n==="top"||n==="left"?-1:1;if(e.placement==="inner"){const a=s===1?e.spacing:-e.spacing-e.thickness;return{...e,offset:a}}const r=s===1?i+e.spacing:-i-e.spacing-e.thickness;return{...e,offset:r}}applyScrollbarLayout(e,i,n){const s=this.resolveScrollbarLayout(n,i);let r=i;if(s){const{offset:a,thickness:o,placement:l}=s;l==="outer"&&(r+=s.spacing+o),this.horizontal?e.push(new U(0,a,0,o)):e.push(new U(a,0,o,0))}return{spacing:r,scrollbarLayout:s}}measureAxisLayout(e,i,n,s,r){const{primaryTick:a,primaryLabel:o,position:l,horizontal:c,seriesAreaPadding:h}=this,u=this.options.tick,d=this.options.label,g=this.options.title,p=[];if(p.push(this.lineNodeBBox()),u.enabled||a?.enabled)for(const M of i)p.push(this.getTickLineBBox(M,r));const{tempText:f}=this;if(d.enabled)for(const M of n){if(!M.visible)continue;f.setProperties(M);const C=f.getBBox();C&&p.push(C)}if(o?.enabled&&l==="bottom"&&(p.push(new U(0,Fg(d.fontSize)+2,1,this.getTickSize(u)+this.getTickSpacing(u)+d.spacing+h)),o.format!=null)){const{format:C}=o,A=(ke(C)?Object.values(C):[C]).reduce((w,L)=>Math.max(w,Av(L)),0);p.push(new U(0,this.getTickSize(a??u)+this.getTickSpacing(a??u)+o.spacing+h,1,A*Fg(o.fontSize)+2))}const m=U.merge(p),y=c?m.height:m.width,{spacing:b,scrollbarLayout:v}=this.applyScrollbarLayout(p,y,s);return this.layout.labelThickness=y,this.layout.scrollbar=v,g.enabled&&p.push(this.titleBBox(e,b)),{bbox:U.merge(p),spacing:b}}titleProps(e,i,n){const s=this.options.title;if(!s.enabled)return e.enabled=!1,{visible:!1,text:"",textBaseline:"bottom",x:0,y:0,rotationCenterX:0,rotationCenterY:0,rotation:0};e.enabled=!0,e.color=s.color,e.fontFamily=s.fontFamily,e.fontSize=s.fontSize,e.fontStyle=s.fontStyle,e.fontWeight=s.fontWeight,e.wrapping=s.wrapping,e.truncate=s.truncate,e.maxWidth=s.maxWidth,e.maxHeight=s.maxHeight;const{range:r}=this,a=(r[0]+r[1])/2,o=s.spacing+n;let l,c,h,u;switch(this.position){case"top":l=a,c=-o,h=0,u="bottom";break;case"bottom":l=a,c=o,h=0,u="top";break;case"left":l=-o,c=a,h=Math.PI/-2,u="bottom";break;case"right":l=o,c=a,h=Math.PI/2,u="bottom";break}const{formatter:d=p=>p.defaultValue}=s,g=this.cachedCallWithContext(d,this.getTitleFormatterParams(i));return e.text=g,{visible:!0,text:g,textBaseline:u,x:l,y:c,rotationCenterX:l,rotationCenterY:c,rotation:h}}getTickLabelProps(e,i,n){const{horizontal:s,primaryLabel:r,primaryTick:a,seriesAreaPadding:o,scale:l}=this,{tickId:c,tickLabel:h="",translation:u,isPrimary:d,textUntruncated:g}=e,p=d&&r?.enabled?r:this.options.label,f=d&&a?.enabled?a:this.options.tick,{rotation:m,textBaseline:y,textAlign:b}=i,{range:v}=l,S=kc(this.mirrored),M=jo(p)[this.position];let C=S*(this.getTickSize(f)+this.getTickSpacing(f)+p.spacing+o)-M;n&&(C+=S*n);const D=h!=="",A=s?u:C,w=s?-C:u;return{...this.getLabelStyles({value:e.tick,formattedValue:h},void 0,p),tickId:c,rotation:m,text:h,textAlign:b,textBaseline:y,textUntruncated:g,visible:D,x:A,y:w,rotationCenterX:A,rotationCenterY:w,range:v}}updateSelections(){if(!this.tickLayout)return;const e=this.getAxisLineCoordinates(),{tickLines:i,gridLines:n,gridFills:s,labels:r}=this.tickLayout,a=o=>o.tickId;this.lineNode.datum=e,this.gridLineGroupSelection.update(this.options.gridLine.enabled?n:[],void 0,a),this.gridFillGroupSelection.update(this.options.gridLine.enabled?s:[],void 0,a),this.tickLineGroupSelection.update(i,void 0,a),this.tickLabelGroupSelection.update(r,void 0,a)}updateGridLines(){this.gridLineGroupSelection.each((e,i)=>{e.stroke=i.stroke,e.strokeWidth=i.strokeWidth,e.lineDash=i.lineDash})}updateGridFills(){this.gridFillGroupSelection.each((e,i)=>{e.fill=i.fill,e.fillOpacity=i.fillOpacity??1})}updateTickLines(){this.tickLineGroupSelection.each((e,i)=>{e.stroke=i.stroke,e.strokeWidth=i.strokeWidth,e.lineDash=i.lineDash})}updateTitle(e,i){const{caption:n}=this,s=this.titleProps(n,e,i);if(n.node.visible=s.visible,n.node.text=s.text,n.node.textBaseline=s.textBaseline,n.node.datum=s,s.visible){const r=Math.abs(this.range[1]-this.range[0])||1/0;n.computeTextWrap(r,this.options.thickness??1/0)}}updateLabels(){this.options.label.enabled&&this.tickLabelGroupSelection.each((e,i)=>{e.fill=i.color,e.text=i.text,e.textBaseline=i.textBaseline,e.textAlign=i.textAlign??"center",e.pointerEvents=i.textUntruncated==null?1:0,e.setFont(i),e.setBoxing(i)})}animateReadyUpdate(e){const{animationManager:i}=this.moduleCtx,n=uN(this),s=pN(n);Mt(this.id,"axis-group",i,[this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],s.group),Mt(this.id,"line",i,[this.lineNode],s.line),Mt(this.id,"line-paths",i,[this.gridLineGroupSelection,this.tickLineGroupSelection],s.tick,(r,a)=>a.tickId,e),Mt(this.id,"tick-labels",i,[this.tickLabelGroupSelection],s.label,r=>r.unsafeDatum.tickId,e),Mt(this.id,"title",i,[this.caption.node],s.label,r=>r.unsafeDatum.tickId,e)}resetSelectionNodes(){Wt([this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],fN()),Wt([this.gridLineGroupSelection,this.tickLineGroupSelection],eM()),Wt([this.gridFillGroupSelection],mN()),Wt([this.tickLabelGroupSelection],gd()),Wt([this.caption.node],gd()),Wt([this.lineNode],eM())}},om=class UA extends Rc{static is(e){return e instanceof UA}get layoutConstraints(){const e=this.options.bandAlignment;return e==null?this._layoutConstraints:{...this._layoutConstraints,align:e}}set requiredRange(e){this._requiredRange=e,e==null||e<=0?(this._layoutConstraints.width=100,this._layoutConstraints.unit="percent"):(this._layoutConstraints.width=e,this._layoutConstraints.unit="px",this.animationManager.skipCurrentBatch())}get requiredRange(){return this._requiredRange}constructor(e,i,n=new Sa,s,r=!0){super(e,i,n,s),this.includeInvisibleDomains=r,this.nice=!1}isCategoryLike(){return!0}hasDefinedDomain(){return!1}normaliseDataDomain(e){return{domain:e.domain,clipped:!1}}getUpdateTypeOnResize(){const{bandAlignment:e}=this.options;return e==null||e==="justify"?super.getUpdateTypeOnResize():3}updateScale(){super.updateScale();let{paddingInner:e,paddingOuter:i}=this.options;if(!Ee(e)||!Ee(i)){const n=this.reduceBandScalePadding();e??(e=n.inner),i??(i=n.outer)}this.scale.paddingInner=e??0,this.scale.paddingOuter=i??0}calculateGridLines(e,i,n){const s=super.calculateGridLines(e,i,n);return this.options.interval?.placement==="between"&&e.length>0&&s.push(super.calculateGridLine({index:e.at(-1).index+1,tickId:`after:${e.at(-1).tickId}`,translation:this.range[1]},e.length,i,n,e)),s}calculateGridLine({index:e,tickId:i,translation:n},s,r,a,o){const{horizontal:l,scale:c}=this,h=this.options.gridLine;if(this.options.interval?.placement!=="between")return super.calculateGridLine({index:e,tickId:i,translation:n},s,r,a,o);const u=n<c.step?Math.floor(c.step/2):c.step/2,d=n-u,[g,p,f,m]=l?[d,Math.max(r,a),d,Math.min(r,a)]:[Math.min(r,a),d,Math.max(r,a),d],{style:y}=h,{stroke:b,strokeWidth:v=0,lineDash:S}=y[e%y.length]??{};return{tickId:i,offset:d,x1:g,y1:p,x2:f,y2:m,stroke:b,strokeWidth:v,lineDash:S}}calculateGridFills(e,i,n){const{horizontal:s,range:r,scale:a}=this;if(this.options.interval?.placement!=="between")return super.calculateGridFills(e,i,n);const o=[];if(e.length==0)return o;const l=e[0],c=l.translation>r[0]+a.step/2,h=e.at(-1),u=s&&h.translation<r[1]-a.step/2;if(c){const d={tickId:`before:${l.tickId}`,translation:l.translation-a.step};o.push(this.calculateGridFill(d,-1,l.index-1,i,n,e))}if(o.push(...e.map((d,g)=>this.calculateGridFill(d,g,d.index,i,n,e))),u){const d={tickId:`after:${h.tickId}`,translation:h.translation+a.step};o.push(this.calculateGridFill(d,e.length,h.index+1,i,n,e))}return o}calculateGridFill({tickId:e,translation:i},n,s,r,a,o){const{horizontal:l,scale:c}=this,h=this.options.gridLine;if(this.options.interval?.placement!=="between")return super.calculateGridFill({tickId:e,translation:i},n,s,r,a,o);const u=i-c.step/2,d=i+c.step/2,[g,p,f,m]=l?[u,Math.max(r,a),d,Math.min(r,a)]:[Math.min(r,a),u,Math.max(r,a),d],{fill:y,fillOpacity:b}=h.style[s%h.style.length]??{};return{tickId:e,x1:g,y1:p,x2:f,y2:m,fill:y,fillOpacity:b}}calculateTickLines(e,i,n=0){const s=super.calculateTickLines(e,i,n);return this.options.interval?.placement==="between"&&e.length>0&&s.push(super.calculateTickLine({isPrimary:!1,tickId:`after:${e.at(-1)?.tickId}`,translation:this.range[1]},e.length,i,e,n)),s}calculateTickLine({isPrimary:e,tickId:i,translation:n},s,r,a,o=0){const{horizontal:l,primaryTick:c,scale:h}=this,u=this.options.tick;if(this.options.interval?.placement!=="between")return super.calculateTickLine({isPrimary:e,tickId:i,translation:n},s,r,a,o);const d=e&&c?.enabled?c:u,g=-r*this.getTickSize(d),p=n<h.step?Math.floor(h.step/2):h.step/2,f=n-p,m=-r*(o+this.getTickSpacing(d)),[y,b,v,S]=l?[f,m,f,m+g]:[m,f,m+g,f],{stroke:M,width:C}=d;return{tickId:i,offset:f,x1:y,y1:b,x2:v,y2:S,stroke:M,strokeWidth:C,lineDash:void 0}}reduceBandScalePadding(){return this.boundSeries.reduce((e,i)=>{const n=i.getBandScalePadding?.();return n&&(e.inner>n.inner&&(e.inner=n.inner),e.outer<n.outer&&(e.outer=n.outer)),e},{inner:1/0,outer:-1/0})}tickFormatParams(e,i,n,s){return{type:"category"}}datumFormatParams(e,i,n,s,r){const{datum:a,seriesId:o,legendItemName:l,key:c,source:h,property:u,domain:d,boundSeries:g}=i;return Array.isArray(e)&&e.some(p=>typeof p!="string")&&(e=e.map(String)),{type:"category",value:e,datum:a,seriesId:o,legendItemName:l,key:c,source:h,property:u,domain:d,boundSeries:g}}};om.className="CategoryAxis",om.type="category";var Qo=om,Ma=class Lb extends Ve{constructor(){super([0,1],[0,1]),this.type="number"}static is(e){return e instanceof Lb}static getTickStep(e,i,n){const{interval:s,tickCount:r=Ve.defaultTickCount,minTickCount:a,maxTickCount:o}=n;return s??To(e,i,r,a,o)}toDomain(e){return e}ticks({interval:e,tickCount:i=Ve.defaultTickCount,minTickCount:n,maxTickCount:s},r=this.domain,a){if(!r||r.length<2||i<1||!r.every(Number.isFinite))return{ticks:[],count:0,firstTickIndex:0};const[o,l]=r;if(e){const c=Math.abs(e);if(!Lo((l-o)/c,this.getPixelRange()))return Gu(o,l,c,a)}return ko(o,l,i,n,s,a)}niceDomain(e,i=this.domain){if(i.length<2)return[];const{tickCount:n=Ve.defaultTickCount}=e;let[s,r]=i;if(n===1)[s,r]=pf(s,r);else if(n>1){const a=s>r?Math.ceil:Math.floor,o=s>r?Math.floor:Math.ceil,l=4;for(let c=0;c<l;c++){const h=s,u=r,d=Lb.getTickStep(s,r,e),[g,p]=i;if(s=a(g/d)*d,r=o(p/d)*d,s===h&&r===u)break}}return[e.nice[0]?s:i[0],e.nice[1]?r:i[1]]}},Es=class extends Rc{constructor(t,e,i=new Ma,n){super(t,e,i,n)}hasDefinedDomain(){const{min:t,max:e}=this.options;return t!=null&&e!=null&&t<e}getLabelFormat(){return this.options.label.format}normaliseDataDomain(t){const{min:e,max:i,preferredMin:n,preferredMax:s}=this.options,{extent:r,clipped:a}=ku(t.domain,e,i,n,s,void 0,t.sortMetadata?.sortOrder);return{domain:r,clipped:a}}getDomainExtentsNice(){return[this.options.min==null&&this.nice,this.options.max==null&&this.nice]}getVisibleDomain(t){const[e,i]=t,[n,s]=this.visibleRange,r=i-e;return[e+n*r,i-(1-s)*r]}tickFormatParams(t,e,i){return{type:"number",visibleDomain:this.getVisibleDomain(t),fractionDigits:i}}datumFormatParams(t,e,i){const{datum:n,seriesId:s,legendItemName:r,key:a,source:o,property:l,domain:c,boundSeries:h}=e,u=this.getVisibleDomain(c);return{type:"number",value:t,datum:n,seriesId:s,legendItemName:r,key:a,source:o,property:l,domain:c,visibleDomain:u,boundSeries:h,fractionDigits:i}}};Es.className="NumberAxis",Es.type="number";var UN={2:(t,e)=>Math.log2(e),[Math.E]:(t,e)=>Math.log(e),10:(t,e)=>Math.log10(e)},WN=(t,e)=>Math.log(e)/Math.log(t);function lm(t,e,i){const n=Math.min(...e),s=UN[t]??WN;return n>=0?s(t,i):-s(t,-i)}var KN={[Math.E]:(t,e)=>Math.exp(e),10:(t,e)=>e>=0?10**e:1/10**-e},YN=(t,e)=>t**e;function cm(t,e,i){const n=Math.min(...e),s=KN[t]??YN;return n>=0?s(t,i):-s(t,-i)}var hm=class WA extends Ve{constructor(e=[1,10],i=[0,1]){super(e,i),this.type="log",this.defaultClamp=!0,this.base=10,this.log=n=>lm(this.base,this.domain,n),this.pow=n=>cm(this.base,this.domain,n)}static is(e){return e instanceof WA}transform(e){const[i,n]=At(this.domain);return i>=0!=n>=0?Number.NaN:i>=0?Math.log(e):-Math.log(-e)}transformInvert(e){const[i,n]=At(this.domain);return i>=0!=n>=0?Number.NaN:i>=0?Math.exp(e):-Math.exp(-e)}toDomain(e){return e}niceDomain(e,i=this.domain){if(i.length<2)return[];const{base:n}=this,[s,r]=i,a=s>r?Math.ceil:Math.floor,o=s>r?Math.floor:Math.ceil,l=cm(n,i,a(lm(n,i,s))),c=cm(n,i,o(lm(n,i,r)));return[e.nice[0]?l:i[0],e.nice[1]?c:i[1]]}ticks({interval:e,tickCount:i=Ve.defaultTickCount},n=this.domain,s){if(!n||n.length<2||i<1)return;const r=this.base,[a,o]=n,l=Math.min(a,o),c=Math.max(a,o);let h=this.log(l),u=this.log(c);if(e){const m=C=>C>=l&&C<=c,y=Math.min(Math.abs(e),Math.abs(u-h)),{ticks:b,count:v,firstTickIndex:S}=Gu(h,u,y,s),M=b.map(this.pow).filter(m);if(!Lo(M.length,this.getPixelRange()))return{ticks:M,count:v,firstTickIndex:S}}if(!av(r)||u-h>=i){const m=Math.min(u-h,i),{ticks:y,count:b,firstTickIndex:v}=ko(h,u,m,void 0,void 0,s);return{ticks:y.map(this.pow),count:b,firstTickIndex:v}}const d=[],g=l>0;h=Math.floor(h)-1,u=Math.round(u)+1;const p=Yr(this.range)/i;let f=1/0;for(let m=h;m<=u;m++){const y=this.convert(this.pow(m+1));for(let b=1;b<r;b++){const v=g?b:r-b+1,S=this.pow(m)*v,M=this.convert(S),C=Math.abs(f-M),D=Math.abs(M-y),A=C>=p&&D>=p;S>=l&&S<=c&&(b===1||A||d.length===0)&&(d.push(S),f=M)}}return q0(d,g,s)}},um=class extends kt{constructor(){super(...arguments),this.segmentPath=new kt}drawPath(t){if(!this.segments||this.segments.length===0){super.drawPath(t);return}t.save();const e=Al(),i=new e;el(i,{x0:0,y0:0,x1:t.canvas.width,y1:t.canvas.height},!1);for(const s of this.segments)el(i,s.clipRect);t.clip(i),super.drawPath(t),t.restore();const{segmentPath:n}=this;n.setProperties({opacity:this.opacity,visible:this.visible,lineCap:this.lineCap,lineJoin:this.lineJoin,pointerEvents:this.pointerEvents});for(const{clipRect:s,fill:r,stroke:a,...o}of this.segments){t.save(),n.path=this.path,n.setProperties(o),n.fill=this.fill==null?"none":r,n.stroke=this.stroke==null?"none":a;const l=new e;el(l,s),t.clip(l),n.drawPath(t),t.restore()}}};x([qu()],um.prototype,"segments",2);function el(t,{x0:e,y0:i,x1:n,y1:s},r=!0){const a=Math.min(e,n),o=Math.min(i,s),l=Math.max(e,n),c=Math.max(i,s);t.moveTo(a,o),r?(t.lineTo(l,o),t.lineTo(l,c),t.lineTo(a,c)):(t.lineTo(a,c),t.lineTo(l,c),t.lineTo(l,o)),t.closePath()}var fM=class extends $t{constructor(){super(...arguments),this.segments=[],this.scalablePath=new(nd(kt))}renderInContext(t){if(!this.visible)return;const{ctx:e}=t;if(!this.segments||this.segments?.length===0)return super.renderInContext(t);e.save();const i=Al(),n=new i;el(n,{x0:0,y0:0,x1:e.canvas.width,y1:e.canvas.height},!1);for(const r of this.segments)el(n,r.clipRect);e.clip(n);for(const r of this.children())r.visible&&r.render(t);e.restore();const{scalablePath:s}=this;for(const{clipRect:r,...a}of this.segments){e.save();const o=new i;el(o,r),e.clip(o),s.setProperties(a);for(const l of this.children())!l.visible||!(l instanceof kt)||(s.path=l.path,s.setProperties({opacity:l.opacity,lineCap:l.lineCap,lineJoin:l.lineJoin,...r1(l)&&{scalingX:l.scalingX,scalingY:l.scalingY,scalingCenterX:l.scalingCenterX,scalingCenterY:l.scalingCenterY}}),s.render(t));e.restore()}}};x([qu()],fM.prototype,"segments",2);var mM=class{constructor(t,e,i){this.root=new qN(t,e,i)}clear(t){this.root.clear(t)}addValue(t,e){const i={hitTester:t,value:e,distanceSquared:(n,s)=>t.distanceSquared(n,s)};this.root.addElem(i)}find(t,e){const i={best:{nearest:void 0,distanceSquared:1/0}};return this.root.find(t,e,i),i.best}},ZN=class{constructor(t,e,i,n){this.nw=t,this.ne=e,this.sw=i,this.se=n}addElem(t){this.nw.addElem(t),this.ne.addElem(t),this.sw.addElem(t),this.se.addElem(t)}find(t,e,i){this.nw.find(t,e,i),this.ne.find(t,e,i),this.sw.find(t,e,i),this.se.find(t,e,i)}},XN=class{constructor(t,e,i){this.capacity=t,this.maxdepth=e,this.boundary=i??U.NaN,this.elems=[],this.subdivisions=void 0}clear(t){this.elems.length=0,this.boundary=t,this.subdivisions=void 0}addElem(t){this.addCondition(t)&&(this.subdivisions===void 0?this.maxdepth===0||this.elems.length<this.capacity?this.elems.push(t):this.subdivide(t):this.subdivisions.addElem(t))}find(t,e,i){this.findCondition(t,e,i)&&(this.subdivisions===void 0?this.findAction(t,e,i):this.subdivisions.find(t,e,i))}subdivide(t){this.subdivisions=this.makeSubdivisions();for(const e of this.elems)this.subdivisions.addElem(e);this.subdivisions.addElem(t),this.elems.length=0}makeSubdivisions(){const{x:t,y:e,width:i,height:n}=this.boundary,{capacity:s}=this,r=this.maxdepth-1,a=i/2,o=n/2,l=new U(t,e,a,o),c=new U(t+a,e,a,o),h=new U(t,e+o,a,o),u=new U(t+a,e+o,a,o);return new ZN(this.child(s,r,l),this.child(s,r,c),this.child(s,r,h),this.child(s,r,u))}},qN=class KA extends XN{addCondition(e){const{x:i,y:n}=e.hitTester.midPoint;return this.boundary.containsPoint(i,n)}findCondition(e,i,n){const{best:s}=n;return s.distanceSquared!==0&&this.boundary.distanceSquared(e,i)<s.distanceSquared}findAction(e,i,n){const s=Ru(e,i,this.elems,n.best.distanceSquared);s.nearest!==void 0&&s.distanceSquared<n.best.distanceSquared&&(n.best=s)}child(e,i,n){return new KA(e,i,n)}},fd=class extends Rc{constructor(t,e,i){super(t,e,new Jo,i)}hasDefinedDomain(){const{min:t,max:e}=this.options;return t!=null&&e!=null&&t<e}isCategoryLike(){return!1}get primaryLabel(){const t=this.options.parentLevel;return t?.enabled?t.label:void 0}getLabelFormat(){const t=this.options.label.format;return t}getPrimaryLabelFormat(){const t=this.primaryLabel?.format;return t}get primaryTick(){const t=this.options.parentLevel;return t?.enabled?t.tick:void 0}normaliseDataDomain(t){const{min:e,max:i,preferredMin:n,preferredMax:s}=this.options,{extent:r,clipped:a}=Tu(t,e,i,n,s);return{domain:r,clipped:a}}processData(){super.processData();const{boundSeries:t,direction:e}=this,{min:i,max:n}=this.options;this.minimumTimeGranularity=yM(t,e,i,n)}tickFormatParams(t,e,i,n){n??(n=ff(e));const s=mf(t),r=Cs(n),a=mr(n),o=uc(n);return{type:"date",unit:r,step:a,epoch:o,truncateDate:s}}datumFormatParams(t,e,i,n,s){if(typeof t=="number"&&(t=new Date(t)),n==null){const{minimumTimeGranularity:m}=this,y=ju(t);m!=null&&Fi(m)<Fi(y)?n=m:n=y}const{datum:r,seriesId:a,legendItemName:o,key:l,source:c,property:h,domain:u,boundSeries:d}=e,g=Cs(n),p=mr(n),f=uc(n);return{type:"date",value:t,datum:r,seriesId:a,legendItemName:o,key:l,source:c,property:h,domain:u,boundSeries:d,unit:g,step:p,epoch:f,style:s}}};fd.className="TimeAxis",fd.type="time";function yM(t,e,i,n){const s=t.reduce((r,a)=>Math.min(a.minTimeInterval()??1/0,r),1/0);return Number.isFinite(s)?pc(s):bM(t,e,i,n)?.unit}function bM(t,e,i,n){let s=1/0,r=-1/0,a,o=0;const l=[];for(const d of t){if(!d.visible)continue;const{extent:g}=Tu(d.getDomain(e));if(g.length===0)continue;const p=g[0].valueOf(),f=g.at(-1).valueOf();l.push(p,f),s=Math.min(s??1/0,p,f),r=Math.max(r??-1/0,p,f);const m=Math.abs(f-p);if(m===0)continue;const y=d.dataCount();if(o=Math.max(o,y),y<=1)continue;const b=m/(y-1);a=Math.min(a??1/0,b)}if(s=Math.min(s,i?.valueOf()??1/0,n?.valueOf()??1/0),r=Math.max(r,i?.valueOf()??-1/0,n?.valueOf()??-1/0),!Number.isFinite(s)||!Number.isFinite(r))return;a??(a=Math.abs(r-s)),a=Math.min(a,JN(l));const c=pc(a);let h=a/Fi(c);o<=2?h=Math.floor(h):h=Math.round(h),h=Math.max(h,1);const u=h===1?void 0:Pi(c,s);return{unit:c,step:h,epoch:u}}function JN(t){t.sort((i,n)=>i-n);let e=1/0;for(let i=1;i<t.length;i++){const n=t[i-1],s=t[i];s-n>0&&(e=Math.min(e,Math.abs(s-n)))}return e}function QN(t,e,i,n){return e<t.startIndex?(t.startIndex+=i,t.endIndex+=i,!1):e<t.endIndex||e===t.endIndex&&n?(t.endIndex+=i,!0):!1}function eO(t,e,i){const n=e+i;if(n<=t.startIndex)return t.startIndex=Math.max(0,t.startIndex-i),t.endIndex=Math.max(t.startIndex,t.endIndex-i),!1;if(e>=t.endIndex)return!1;if(e<=t.startIndex&&n>=t.endIndex)t.startIndex=e,t.endIndex=e;else if(e<=t.startIndex){const s=n-t.startIndex,r=t.endIndex-t.startIndex;t.startIndex=e,t.endIndex=t.startIndex+Math.max(0,r-s)}else n>=t.endIndex?t.endIndex=Math.max(t.startIndex,e):t.endIndex=Math.max(t.startIndex,t.endIndex-i);return!0}function vM(t,e){const i=Math.ceil(t/1e3);return Math.max(e,i)}function xM(t,e){return Math.max(1,Math.ceil(t/e))}function tO(t){return t.filter(e=>e.endIndex>e.startIndex)}function iO(t,e,i){if(!e.enableBanding||t<e.minDataSizeForBanding)return[i(0,t)];const n=vM(t,e.targetBandCount),s=xM(t,n),r=[];for(let a=0;a<t;a+=s){const o=Math.min(a+s,t);r.push(i(a,o))}return r}function nO(t,e){for(const i of e)i.insertCount>0&&t.handleInsertion(i.index,i.insertCount),i.deleteCount>0&&t.handleRemoval(i.index,i.deleteCount)}function sO(t,e){for(const i of e)t.handleInsertion(i,0)}function rO(t,e){nO(t,e.spliceOps),e.updatedIndices.size>0&&sO(t,e.updatedIndices)}var aO=1e3,oO=10,SM=class{constructor(t={}){this.bands=[],this.dataSize=0,this.config={minDataSizeForBanding:t.minDataSizeForBanding??aO,targetBandCount:t.targetBandCount??oO,maxBandSize:t.maxBandSize??1/0,enableBanding:t.enableBanding??!0}}applyIndexMap(t){rO(this,t)}initializeBands(t){this.dataSize=Math.max(0,t),this.bands=iO(this.dataSize,this.config,(e,i)=>this.createBand(e,i))}getBandCount(){return this.bands.length}handleInsertion(t,e){if(this.dataSize+=e,this.bands.length===0){this.initializeBands(this.dataSize);return}const i=vM(this.dataSize,this.config.targetBandCount),n=xM(this.dataSize,i),s=Math.ceil(n*1.1);for(let r=0;r<this.bands.length;r++){const a=this.bands[r],o=r===this.bands.length-1;if(t===a.endIndex&&o&&e>0){a.endIndex-a.startIndex>=n?this.bands.push(this.createBand(t,t+e)):(a.endIndex+=e,a.isDirty=!0);break}QN(a,t,e,o)&&(a.isDirty=!0,e>0&&t<a.endIndex&&a.endIndex-a.startIndex>s&&this.splitBand(r,n))}}handleRemoval(t,e){if(e<=0||this.bands.length===0)return;const i=Math.min(e,Math.max(0,this.dataSize-t));if(!(i<=0)){this.dataSize=Math.max(0,this.dataSize-i);for(const n of this.bands)eO(n,t,i)&&(n.isDirty=!0);this.bands=tO(this.bands)}}splitBand(t,e){const i=this.bands[t],n=i.endIndex-i.startIndex,s=Math.min(e,Math.floor(n/2)),r=i.startIndex+s,a=this.createBand(i.startIndex,r),o=this.createBand(r,i.endIndex);this.bands.splice(t,1,a,o)}getStats(){const t=this.bands.filter(e=>e.isDirty);return{totalBands:this.bands.length,dirtyBands:t.length,dataSize:this.dataSize}}markRangeDirty(t,e){for(const i of this.bands)t<i.endIndex&&e>i.startIndex&&(i.isDirty=!0)}},tn=class YA{constructor(){this.domain=new Set,this.dateTimestamps=new Set,this.hasDateValues=!1,this.sortedValues=null,this.sortOrder=void 0,this.isSortedUnique=!1}static is(e){return e instanceof YA}setSortedUniqueMode(e,i){i&&(this.isSortedUnique=!0,this.sortOrder=e,this.sortedValues=[])}extend(e){this.isSortedUnique&&this.sortedValues?(this.sortedValues.push(e),e instanceof Date&&(this.hasDateValues=!0)):e instanceof Date?(this.hasDateValues=!0,this.dateTimestamps.add(e.valueOf())):this.domain.add(e)}getDomain(){if(this.isSortedUnique&&this.sortedValues){let e=!1;return this.sortedValues.filter(i=>{if(i==null)return e?!1:(e=!0,!0);if(i instanceof Date&&Number.isNaN(i.valueOf())){if(e)return!1;e=!0}return!0})}if(this.hasDateValues){const e=Array.from(this.dateTimestamps,i=>new Date(i));return this.domain.size>0?[...e,...Array.from(this.domain)]:e}return Array.from(this.domain)}isDateDomain(){return this.hasDateValues}isSortedUniqueMode(){return this.isSortedUnique}getSortOrder(){return this.sortOrder}mergeFrom(e){if(this.isSortedUnique&&e.isSortedUnique&&this.sortOrder===e.sortOrder&&this.sortOrder!==void 0&&e.sortedValues){e.hasDateValues&&(this.hasDateValues=!0),this.sortedValues??(this.sortedValues=[]),this.sortedValues.push(...e.sortedValues);return}if(this.convertToSetMode(),e.hasDateValues&&(this.hasDateValues=!0),e.isSortedUnique&&e.sortedValues)for(const i of e.sortedValues)i instanceof Date?this.dateTimestamps.add(i.valueOf()):this.domain.add(i);else{for(const i of e.dateTimestamps)this.dateTimestamps.add(i);for(const i of e.domain)this.domain.add(i)}}convertToSetMode(){if(this.isSortedUnique){if(this.sortedValues){for(const e of this.sortedValues)e instanceof Date?this.dateTimestamps.add(e.valueOf()):this.domain.add(e);this.sortedValues=null}this.isSortedUnique=!1,this.sortOrder=void 0}}},nn=class ZA{constructor(){this.domain=[1/0,-1/0]}static is(e){return e instanceof ZA}static extendDomain(e,i=[1/0,-1/0]){for(const n of e)typeof n=="number"&&(i[0]>n&&(i[0]=n),i[1]<n&&(i[1]=n));return i}extend(e){typeof e!="number"&&!(e instanceof Date)||(this.domain[0]>e&&(this.domain[0]=e),this.domain[1]<e&&(this.domain[1]=e))}getDomain(){return[...this.domain]}},Pc=class extends SM{constructor(t,e={},i=!1){super(e),this.fullDomainCache=null,this.sortOrder=void 0,this.isUnique=!1,this.domainFactory=t,this.isDiscrete=i}setSortOrderMetadata(t,e){this.sortOrder=t,this.isUnique=e}createBand(t,e){const i=this.domainFactory();return this.isDiscrete&&this.sortOrder!==void 0&&this.isUnique&&tn.is(i)&&i.setSortedUniqueMode(this.sortOrder,this.isUnique),{startIndex:t,endIndex:e,subDomain:i,isDirty:!0}}initializeBands(t){super.initializeBands(t),this.fullDomainCache=null}handleInsertion(t,e){super.handleInsertion(t,e),this.fullDomainCache=null}handleRemoval(t,e){super.handleRemoval(t,e),this.fullDomainCache=null}splitBand(t,e){this.bands.length>1&&super.splitBand(t,e)}markBandsDirty(t,e){this.markRangeDirty(t,e),this.fullDomainCache=null}markAllBandsDirty(){for(const t of this.bands)t.isDirty=!0;this.fullDomainCache=null}extendBandsFromData(t,e){const i=t.length;for(const n of this.bands){if(!n.isDirty)continue;const s=this.domainFactory();this.isDiscrete&&this.sortOrder!==void 0&&this.isUnique&&tn.is(s)&&s.setSortedUniqueMode(this.sortOrder,this.isUnique),n.subDomain=s;const{startIndex:r,endIndex:a}=n;for(let o=r;o<a&&o<i;o++)e?.[o]||n.subDomain.extend(t[o]);n.isDirty=!1}this.fullDomainCache=null}getDirtyBands(){return this.bands.filter(t=>t.isDirty)}extend(t){this.markAllBandsDirty(),this.fullDomainCache=null}canUseSortedConcatenation(){if(!this.sortOrder||!this.isUnique||!this.isDiscrete)return!1;for(const t of this.bands)if(!tn.is(t.subDomain)||!t.subDomain.isSortedUniqueMode()||t.subDomain.getSortOrder()!==this.sortOrder)return!1;return!0}concatenateSortedDomains(){const t=new tn;t.setSortedUniqueMode(this.sortOrder,this.isUnique);for(const e of this.bands)tn.is(e.subDomain)&&t.mergeFrom(e.subDomain);return t.getDomain()}deduplicateNulls(t){let e=!1;return t.filter(i=>{if(i==null)return e?!1:(e=!0,!0);if(i instanceof Date&&Number.isNaN(i.valueOf())){if(e)return!1;e=!0}return!0})}getDomain(){if(this.fullDomainCache!==null)return this.fullDomainCache;if(this.bands.length===0)return this.fullDomainCache=[],[];if(this.bands.length===1){const t=this.bands[0].subDomain.getDomain();return this.fullDomainCache=this.isDiscrete?this.deduplicateNulls(t):t,this.fullDomainCache}if(this.isDiscrete){const t=this.bands[0].subDomain;if(tn.is(t))if(this.canUseSortedConcatenation())this.fullDomainCache=this.deduplicateNulls(this.concatenateSortedDomains());else{const e=new tn;for(const i of this.bands)tn.is(i.subDomain)&&e.mergeFrom(i.subDomain);this.fullDomainCache=this.deduplicateNulls(e.getDomain())}else{const e=new Set;for(const i of this.bands)for(const n of i.subDomain.getDomain())e.add(n);this.fullDomainCache=Array.from(e)}}else{let t,e;for(const i of this.bands){const n=i.subDomain.getDomain();if(n.length===2){const[s,r]=n;(t===void 0||s!=null&&t!=null&&s<t)&&(t=s),(e===void 0||r!=null&&e!=null&&r>e)&&(e=r)}}t!==void 0&&e!==void 0?this.fullDomainCache=[t,e]:this.fullDomainCache=[]}return this.fullDomainCache}getStats(){const t=this.bands.filter(i=>i.isDirty).length,e=this.bands.reduce((i,n)=>i+(n.endIndex-n.startIndex),0);return{bandCount:this.bands.length,dirtyBandCount:t,averageBandSize:this.bands.length>0?e/this.bands.length:0,dataSize:this.dataSize}}};function MM(t,e=[0,0]){for(const i of t)typeof i=="number"&&(i<0&&(e[0]+=i),i>0&&(e[1]+=i));return e}function lO(t,e){const i=e?.visible??!0;return{id:t,type:"aggregate",matchGroupIds:e?.matchGroupId?[e?.matchGroupId]:void 0,aggregateFunction:n=>MM(n),groupAggregateFunction:(n,s=[0,0])=>(i&&(s[0]+=n?.[0]??0,s[1]+=n?.[1]??0),s)}}function cO(t,e){return{id:t,matchGroupIds:[e],type:"aggregate",aggregateFunction:n=>nn.extendDomain(n)}}function IM(t,e){const i=e?.visible??!0;return{id:t,type:"aggregate",aggregateFunction:()=>[0,1],groupAggregateFunction:(n,s=[0,0])=>(i&&(s[0]+=n?.[0]??0,s[1]+=n?.[1]??0),s)}}function hO(t,e){const i=e?.visible??!0;return{id:t,matchGroupIds:e?.matchGroupId?[e?.matchGroupId]:void 0,type:"aggregate",aggregateFunction:s=>MM(s),groupAggregateFunction:(s,r=[0,0,-1])=>(i&&(r[0]+=s?.[0]??0,r[2]++,r[1]+=s?.[1]??0),r),finalFunction:(s=[0,0,0])=>{const r=s[0]+s[1];return r>=0?[0,r/s[2]]:[r/s[2],0]}}}function DM(t,e,i){const n={id:t,matchGroupIds:i?[i]:void 0,type:"aggregate",aggregateFunction:(s,r=[])=>{const a=r[1]-r[0];return e.aggregateFunction(s).map(o=>o/a)}};return e.groupAggregateFunction&&(n.groupAggregateFunction=e.groupAggregateFunction),n}function uO(t){return()=>{let e=0;return i=>Ee(i)?(e+=t?Math.max(0,i):i,e):i}}function dO(){return()=>{let t=0;return e=>{if(!Ee(e))return e;const i=t;return t+=e,i}}}var dm="\0__AG_NULL__\0",gm="\0__AG_UNDEFINED__\0";function CM(t){return t===null?dm:t===void 0?gm:Array.isArray(t)?"["+t.map(CM).join(",")+"]":he(t)?JSON.stringify(t):String(t)}function pm(t){return t.map(CM).join("-")}function Bi(t){const e=t?.map(Number);return e?.every(Number.isFinite)?e:[]}function AM(t,e){return e?.get(t.id)??0}function fm(t){return"scopes"in t&&Array.isArray(t.scopes)}function ss(t,e){const i=[];for(let n=0;n<t;n+=1)i[n]=e;return i}function md(t){const e=new Set;for(const i of t.values())i&&e.add(i);return e}function mm(t,e,i=!1){const n=[];for(const s of t){const r=s?.[e];if(r==null&&!i)return;n.push(r)}return n}function gO(t){const e=[];let i=0,n;const s=/((?:(?:^|\.)\s*\w+|\[\s*(?:'(?:[^']|(?<!\\)\\')*'|"(?:[^"]|(?<!\\)\\")*"|-?\d+)\s*\])\s*)/g;for(;n=s.exec(t);){if(n.index!==i)return;i=n.index+n[0].length;const r=n[1].trim();if(r.startsWith("."))e.push(r.slice(1).trim());else if(r.startsWith("[")){const a=r.slice(1,-1).trim();a.startsWith("'")?e.push(a.slice(1,-1).replaceAll(/(?<!\\)\\'/g,"'")):a.startsWith('"')?e.push(a.slice(1,-1).replaceAll(/(?<!\\)\\"/g,'"')):e.push(a)}else e.push(r)}if(i===t.length)return e}function pO(t){return e=>{let i=e;for(const n of t)i=i[n];return i}}var fO=class{constructor(t,e,i){this.ctx=t,this.scopeCacheManager=e,this.resolvers=i}aggregateUngroupedData(t){const e=this.ctx.aggregates.map(()=>[1/0,-1/0]);t.domain.aggValues=e;const{columns:i,dataSources:n}=t,s=Oi(n.keys()),r=t.keys.map(l=>l.get(s)),a=n.get(s)?.data??[],o=this.ctx.keys.some(l=>l.allowNullKey===!0);t.aggregation=a?.map((l,c)=>{const h=[];for(const[u,d]of this.ctx.aggregates.entries()){const g=this.valueGroupIdxLookup(d);let p=d.groupAggregateFunction?.()??[1/0,-1/0];const f=g.map(v=>i[v][c]),m=mm(r,c,o),y=m==null?void 0:d.aggregateFunction(f,m);y&&(p=d.groupAggregateFunction?.(y,p)??nn.extendDomain(y,p));const b=d.finalFunction?.(p)??p;h[u]=b,nn.extendDomain(b,e[u])}return h})}aggregateGroupedData(t){const e=this.ctx.aggregates.map(()=>[1/0,-1/0]);t.domain.aggValues=e;const{columns:i}=t;for(const[n,s]of this.ctx.aggregates.entries()){const r=this.valueGroupIdxLookup(s);for(let a=0;a<t.groups.length;a++){const o=t.groups[a];o.aggregation??(o.aggregation=[]);const l=o.keys;let c=s.groupAggregateFunction?.()??[1/0,-1/0];const h=Math.max(...r.map(d=>o.datumIndices[d]?.length??0));for(let d=0;d<h;d++){const g=r.map(f=>{const m=o.datumIndices[f]?.[d];if(m==null)return;const y=this.resolvers.resolveAbsoluteIndex(a,m);return i[f][y]}),p=s.aggregateFunction(g,l);p&&(c=s.groupAggregateFunction?.(p,c)??nn.extendDomain(p,c))}const u=s.finalFunction?.(c)??c;o.aggregation[n]=u,nn.extendDomain(u,e[n])}}}postProcessGroups(t){const{groupProcessors:e}=this.ctx,{columnScopes:i,columns:n,invalidData:s}=t;for(const r of e){const a=this.valueGroupIdxLookup(r),o=r.adjust()();for(let l=0;l<t.groups.length;l++){const c=t.groups[l];o(n,a,c,l)}for(const l of a){const h=this.ctx.values[l].valueType==="category",u=n[l],d=Oi(i[l]),g=s?.get(d),p=h?new tn:new nn;for(let f=0;f<u.length;f+=1)g?.[f]!==!0&&p.extend(u[f]);t.domain.values[l]=p.getDomain()}}}valueGroupIdxLookup(t){return this.scopeCacheManager.valueGroupIdxLookup(t)}},mO=class{constructor(t){this.ctx=t}setupDomainForDefinition(t,e,i){const n=t.valueType==="category";let s=e.get(t);return!s&&this.ctx.bandingConfig?.enableBanding!==!1&&(s=new Pc(n?()=>new tn:()=>new nn,this.ctx.bandingConfig,n),e.set(t,s)),s&&n&&s.setSortOrderMetadata(i?.sortOrder,i?.isUnique??!1),s||(n?new tn:new nn)}extendDomainFromData(t,e,i){if(t instanceof Pc)t.extendBandsFromData(e,i);else for(let n=0;n<e.length;n++)i?.[n]!==!0&&t.extend(e[n])}initializeBandedDomain(t,e,i){if(!(t instanceof Pc))return;const n=t.getStats(),s=n.bandCount===0||n.dataSize!==e;this.ctx.debug.check()&&s&&i&&this.ctx.debug(`Reinitializing bands for ${i}: bandCount=${n.bandCount}, dataSize=${n.dataSize}, dataLength=${e}`),s&&t.initializeBands(e)}},Cr=Symbol("key-sort-orders"),ym=Symbol("column-sort-orders"),bm=Symbol("domain-ranges"),Fc=Symbol("domain-bands"),Ia=Symbol("reducer-bands"),wM=Object.freeze([0]);function vm(t,e){if(typeof e=="string")t.set(e,(t.get(e)??0)+1);else for(const i of e)t.set(i,(t.get(i)??0)+1)}function yd(t,e){if(t.reusableResult.valid=!1,t.hasInvalidValue){t.reusableResult.value=t.invalidValue,t.domain.extend(t.invalidValue);return}t.mode!=="integrated"&&j.warnOnce(`invalid value of type [${typeof e}] for [${t.def.scopes} / ${t.def.id}] ignored:`,`[${e}]`),t.reusableResult.value=void 0}function Vc(t,e,i,n,s,r){return t&&e&&t(i,n,s)===!1?(r.reusableResult.missing=!1,yd(r,i),r.reusableResult):null}function _c(t,e,i,n,s){s.missing=!t,!t&&!e&&vm(i,n)}function bd(t,e,i){return e.valid=!0,e.value=t,i.extend(t),e}var yO=class{constructor(t){this.ctx=t}createProcessValueFn(t,e,i,n,s,r){const a={def:t,accessor:e,domain:i,reusableResult:n,processorFns:s,mode:this.ctx.mode};return(r==="extend"?this.createSpecializedProcessValue(a,t.validation):null)??this.createGenericProcessValue(a,r)}createSpecializedProcessValue(t,e){return t.def.forceValue!=null?this.createSpecializedProcessValueForceValue(t):t.def.processor?this.createSpecializedProcessValueProcessor(t,e):e?t.def.type==="key"?this.createSpecializedProcessValueKeyValidation(t,e):this.createSpecializedProcessValueValueValidation(t,e):null}createValidationMeta(t){const{def:e,domain:i,reusableResult:n,mode:s}=t;return{reusableResult:n,hasInvalidValue:"invalidValue"in e,invalidValue:e.invalidValue,domain:i,def:e,mode:s}}createSpecializedProcessValueKeyValidation(t,e){const{def:i,accessor:n,domain:s,reusableResult:r}=t,a=i.property,o="missingValue"in i,l=i.missingValue,c=i.missing,h=i.allowNullKey??!1,u=this.createValidationMeta(t);if(n){const d=n;return function(p,f,m){let y;try{y=d(p)}catch{}const b=y!=null||h&&y==null,v=!h&&y==null;return!b||v||e(y,p,f)===!1?(r.missing=!b,!b&&!o&&vm(c,m),yd(u,y),r):(r.missing=!1,r.valid=!0,r.value=y,s.extend(y),r)}}return function(g,p,f){const m=a in g,y=m?g[a]:l,b=!h&&y==null;return!m||b||e(y,g,p)===!1?(r.missing=!m,!m&&!o&&vm(c,f),yd(u,y),r):(r.missing=!1,r.valid=!0,r.value=y,s.extend(y),r)}}createSpecializedProcessValueValueValidation(t,e){const{def:i,accessor:n,domain:s,reusableResult:r}=t,a=i.property,o="missingValue"in i,l=i.missingValue,c=i.missing,h=this.createValidationMeta(t);if(n){const u=n;return function(g,p,f){let m;try{m=u(g)}catch{}const y=m!=null,b=Vc(e,y,m,g,p,h);return b!==null?b:(_c(y,o,c,f,r),bd(m,r,s))}}return function(d,g,p){const f=a in d,m=f?d[a]:l,y=Vc(e,f,m,d,g,h);return y!==null?y:(_c(f,o,c,p,r),bd(m,r,s))}}createSpecializedProcessValueForceValue(t){const{def:e,accessor:i,domain:n,reusableResult:s}=t,r=e.property,a=e.forceValue;if(i){const o=i;return function(c,h,u){let d;try{d=o(c)}catch{}const f=d!=null&&to(d)?-1*a:a;return s.missing=!1,s.valid=!0,s.value=f,n.extend(f),s}}return function(l,c,h){const u=r in l,d=u?l[r]:void 0,p=u&&to(d)?-1*a:a;return s.missing=!1,s.valid=!0,s.value=p,n.extend(p),s}}createSpecializedProcessValueProcessor(t,e){const{def:i,accessor:n,domain:s,reusableResult:r,processorFns:a}=t,o=i.property,l="missingValue"in i,c=i.missingValue,h=i.missing,u=i.processor,d=this.createValidationMeta(t);if(n){const g=n;return function(f,m,y){let b;try{b=g(f)}catch{}const v=b!=null,S=Vc(e,v,b,f,m,d);if(S!==null)return S;_c(v,l,h,y,r);let M=a.get(i);return M==null&&(M=u(),a.set(i,M)),b=M(b,m),bd(b,r,s)}}return function(p,f,m){const y=o in p;let b=y?p[o]:c;const v=Vc(e,y,b,p,f,d);if(v!==null)return v;_c(y,l,h,m,r);let S=a.get(i);return S==null&&(S=u(),a.set(i,S)),b=S(b,f),bd(b,r,s)}}createGenericProcessValue(t,e){const{def:i,accessor:n,domain:s,processorFns:r}=t,a=i.property,o="missingValue"in i,l=i.missingValue,c=i.missing,h=e==="extend",u=t.reusableResult,d=this.createValidationMeta(t);return function(p,f,m){let y,b;if(n){try{y=n(p)}catch{}b=y!=null}else b=a in p,y=b?p[a]:l;i.forceValue!=null&&(y=b&&to(y)?-1*i.forceValue:i.forceValue,b=!0),_c(b,o,c,m,u);const v=i.allowNullKey??!1;if(i.type==="key"&&y==null&&!v)return yd(d,y),u;const M=Vc(i.validation,b,y,p,f,d);if(M!==null)return M;if(u.valid=!0,i.processor){let C=r.get(i);C==null&&(C=i.processor(),r.set(i,C)),y=C(y,f)}return h&&s.extend(y),u.value=y,u}}};function bO(t,e){return!t||!e||t.length===0||e.length===0?!0:t.some(i=>e.includes(i))}function kM(t,e){if(t.valueType==="category"){for(const i of e)if(i.property===t.property&&i.valueType===t.valueType&&bO(i.scopes,t.scopes)&&i.validation===t.validation)return i}}var vO=class{constructor(t,e,i){this.ctx=t,this.initializer=e,this.scopeCacheManager=i,this.processValueFactory=new yO(t)}recomputeDomains(t){const e=this.ctx.debug.check()?performance.now():0,i=t[Fc];let n;const s=t[Cr],r=this.setupDefinitionDomains(this.ctx.keys,i,s),a=new Map;for(const h of this.ctx.values){const u=kM(h,this.ctx.keys);u&&a.set(h,u)}const o=this.setupValueDomainsWithSharing(this.ctx.values,i,r,a),l=new Set;for(const[,h]of a){const u=r.get(h);u&&l.add(u)}this.initializeDomainBands(this.ctx.keys,r,h=>{const u=t.keys[h];return Math.max(...Array.from(u.values()).map(d=>d.length))},h=>String(h.property)),this.initializeDomainBands(this.ctx.values,o,h=>t.columns[h].length,h=>String(h.property));const c=new Map;if(i.size>0){n={totalBands:0,dirtyBands:0,totalData:0};for(const h of i.values())if(h instanceof Pc){const u=h.getStats();c.set(h,u),n.totalBands+=u.bandCount,n.dirtyBands+=u.dirtyBandCount,n.totalData=Math.max(n.totalData,u.dataSize)}}if(this.extendDomainsFromData(this.ctx.keys,r,(h,u)=>t.keys[h]?.get(u),h=>h.scopes??[],h=>t.invalidKeys?.get(h)),this.extendDomainsFromData(this.ctx.values,o,(h,u)=>t.columns[h],h=>[Oi(h.scopes)],h=>t.invalidKeys?.get(h),l),t.domain.keys=this.ctx.keys.map(function(u){const d=r.get(u),g=d.getDomain();return nn.is(d)&&g[0]>g[1]?[]:g}),t.domain.values=this.ctx.values.map(function(u){const d=o.get(u),g=d.getDomain();return nn.is(d)&&g[0]>g[1]?[]:g}),t.type==="grouped"&&(t.domain.groups=t.groups.map(h=>h.keys)),this.collectDomainBandingMetadata(t,r,o,i,c),this.ctx.debug.check()&&e>0){const u=performance.now()-e;if(n&&n.totalBands>0){const d=n.dirtyBands/n.totalBands,g=Math.round(d*n.totalData);this.ctx.debug(`recomputeDomains with banding: ${u.toFixed(2)}ms, bands: ${n.dirtyBands}/${n.totalBands} dirty, data scanned: ~${g}/${n.totalData} (${(d*100).toFixed(1)}%)`)}else this.ctx.debug(`recomputeDomains: ${u.toFixed(2)}ms (no banding)`)}}setupDefinitionDomains(t,e,i){const n=new Map;for(const[s,r]of t.entries()){const a=i?.get(s);n.set(r,this.initializer.setupDomainForDefinition(r,e,a))}return n}initializeDomainBands(t,e,i,n){for(const[s,r]of t.entries()){const a=e.get(r);if(!a)continue;const o=i(s);this.initializer.initializeBandedDomain(a,o,n(r))}}extendDomainsFromData(t,e,i,n,s,r){for(const[a,o]of t.entries()){const l=e.get(o);if(l&&!r?.has(l))for(const c of n(o)){if(!c)continue;const h=i(a,c);if(!h)continue;const u=s(c);this.initializer.extendDomainFromData(l,h,u)}}}setupValueDomainsWithSharing(t,e,i,n){const s=new Map;for(const r of t){const a=n.get(r);if(a){const o=i.get(a);if(o){s.set(r,o);continue}}s.set(r,this.initializer.setupDomainForDefinition(r,e))}return s}initDataDomainProcessor(t){const{keys:e,values:i}=this.ctx,n=new Set;for(const d of i)if(d.scopes)for(const g of d.scopes)n.add(g);const s=new Map,r=new Map;let a=!0;const o=()=>{for(const d of e)d.valueType==="category"?s.set(d,new tn):s.set(d,new nn);for(const d of i){const g=kM(d,e);if(g){const p=s.get(g);if(p){s.set(d,p),a&&(a=(d.scopes?.length??0)===n.size);continue}}d.valueType==="category"?s.set(d,new tn):(s.set(d,new nn),a&&(a=(d.scopes?.length??0)===n.size))}};o();const l=this.scopeCacheManager.buildAccessors(Ur(e,i)),c=new WeakMap;for(const d of Ur(e,i)){const g=l.get(d.property),p=s.get(d),f={value:void 0,missing:!1,valid:!1},m=this.processValueFactory.createProcessValueFn(d,g,p,f,r,t);c.set(d,m)}function h(d){const g=c.get(d);if(!g)throw new Error("AG Charts - missing processValue function for definition");return g}function u(d,g,p,f){return h(d)(g,p,f)}return{dataDomain:s,processValue:u,getProcessValue:h,initDataDomain:o,scopes:n,allScopesHaveSameDefs:a}}collectDomainBandingMetadata(t,e,i,n,s){t.optimizations??(t.optimizations={});const r=(l,c)=>l.map(h=>{const u=c.get(h),d=n.get(h),g=u instanceof Pc;let p;g||(p=h.valueType==="category"?"discrete domain":"not configured");let f;if(g&&d){const m=s.get(d)??d.getStats(),y=m.bandCount>0?m.dirtyBandCount/m.bandCount:0;f={totalBands:m.bandCount,dirtyBands:m.dirtyBandCount,dataSize:m.dataSize,scanRatio:y}}return{property:String(h.property),applied:g,reason:p,stats:f}}),a=r(this.ctx.keys,e),o=r(this.ctx.values,i);t.optimizations.domainBanding={keyDefs:a,valueDefs:o}}};function xO(){return{lastValue:void 0,sortOrder:0,isUnique:!0,isOrdered:!0}}function SO(t,e){const i=typeof e=="number"?e:e?.valueOf?.();if(typeof i!="number"||!Number.isFinite(i))return;if(t.lastValue===void 0){t.lastValue=i;return}const n=i-t.lastValue;if(n===0)t.isUnique=!1;else if(t.isOrdered){const s=n>0?1:-1;t.sortOrder===0?t.sortOrder=s:t.sortOrder!==s&&(t.isOrdered=!1)}t.lastValue=i}function MO(t){return{sortOrder:t.isOrdered&&t.sortOrder!==0?t.sortOrder:void 0,isUnique:t.isUnique,isDirty:!1}}var IO=class{constructor(t,e){this.ctx=t,this.domainManager=e}extractData(t){const{dataDomain:e,getProcessValue:i,allScopesHaveSameDefs:n}=this.domainManager.initDataDomainProcessor("extend"),{keys:s,values:r}=this.ctx,{invalidData:a,invalidKeys:o,invalidKeyCount:l,invalidDataCount:c,missingData:h,allKeyMappings:u,keySortOrders:d}=this.extractKeys(s,t,i),{columns:g,columnScopes:p,columnNeedValueOf:f,partialValidDataCount:m,maxDataLength:y}=this.extractValues(a,c,h,r,t,o,i),b=v=>{const S=e.get(v),M=S.getDomain();return nn.is(S)&&M[0]>M[1]?[]:M};return{type:"ungrouped",input:{count:y},scopes:new Set(t.keys()),dataSources:t,aggregation:void 0,keys:[...u.values()],columns:g,columnScopes:p,columnNeedValueOf:f,invalidKeys:o,invalidKeyCount:l,invalidData:a,invalidDataCount:c,missingData:h,domain:{keys:s.map(b),values:r.map(b)},defs:{allScopesHaveSameDefs:n,keys:s,values:r},partialValidDataCount:m,time:0,version:0,[bm]:new Map,[Cr]:d,[ym]:new Map,[Fc]:new Map,[Ia]:new Map}}extractKeys(t,e,i){const n=new Map,s=new Map,r=new Map,a=new Map,o=new Map,l=new Map,c=new Map;let h,u;const d=t.map(p=>i(p)),g=(p,f)=>{const m=u.get(p);h.set(f,h.get(m)),n.has(m)&&(n.set(f,n.get(m)),s.set(f,s.get(m)),a.set(f,a.get(m)))};for(const[p,f]of t.entries()){const{invalidValue:m,scopes:y}=f,b=d[p];h=new Map,u=new Map,l.set(f,h);const v=xO();for(const S of y??[]){const M=e.get(S)?.data??[];if(u.has(M)){g(M,S);continue}const C=[];h.set(S,C),u.set(M,S);let D,A,w=0,L;for(let O=0;O<M.length;O++){if(M[O]==null||typeof M[O]!="object"){D??(D=ss(M.length,!1)),A??(A=ss(M.length,!1)),w+=1,D[O]=!0,A[O]=!0,C.push(m);continue}const R=b(M[O],O,S);if(R.valid){C.push(R.value),SO(v,R.value);continue}R.missing&&(L??(L=ss(M.length,!1))),C.push(m),D??(D=ss(M.length,!1)),A??(A=ss(M.length,!1)),w+=1,D[O]=!0,A[O]=!0}D&&A&&(n.set(S,D),s.set(S,A),r.set(S,w),a.set(S,w)),L&&o.set(S,L)}c.set(p,MO(v))}return{invalidData:s,invalidKeys:n,invalidKeyCount:r,invalidDataCount:a,missingData:o,allKeyMappings:l,keySortOrders:c}}markScopeDatumInvalid(t,e,i,n,s){for(const r of t){n.has(r)||(n.set(r,ss(e.length,!1)),s.set(r,0));const a=n.get(r);a[i]||(a[i]=!0,s.set(r,s.get(r)+1))}}markScopeDatumMissing(t,e,i,n){for(const s of t){n.has(s)||n.set(s,ss(e.length,!1));const r=n.get(s);r[i]||(r[i]=!0)}}extractValues(t,e,i,n,s,r,a){let o=0;const l=[],c=[],h=[];let u=0;const d=n.map(g=>a(g));for(const[g,p]of n.entries()){const{invalidValue:f}=p,m=d[g];if(new Set(p.scopes.map(A=>s.get(A))).size>1)throw new Error(`AG Charts - more than one data source for: ${JSON.stringify(p)}`);const b=new Set(p.scopes),v=Oi(p.scopes),S=s.get(v)?.data??[],M=new Array,C=r.get(v);let D=!1;for(let A=0;A<S.length;A++){if(S[A]==null||typeof S[A]!="object"){this.markScopeDatumInvalid(p.scopes,S,A,t,e),M[A]=f;continue}const w=S[A],L=C==null?!1:C[A],O=m(w,A,p.scopes);let R=O.value;L||!O.valid?this.markScopeDatumInvalid(p.scopes,S,A,t,e):O.missing&&this.markScopeDatumMissing(p.scopes,S,A,i),L?R=f:O.valid||(o+=1,R=f),!D&&R!=null&&typeof R=="object"&&(D=!0),M[A]=R}l.push(M),c.push(b),h.push(D),u=Math.max(u,M.length)}return{columns:l,columnScopes:c,columnNeedValueOf:h,partialValidDataCount:o,maxDataLength:u}}warnDataMissingProperties(t){if(t.size!==0)for(const e of Ur(this.ctx.keys,this.ctx.values))for(const[i,n]of e.missing){if(n<(t.get(i)?.data.length??1/0))continue;const s=i==null?"":` for ${i}`;j.warnOnce(`the key '${e.property}' was not found in any data element${s}.`)}}},DO=class{constructor(t){this.ctx=t}groupData(t,e){var i;const{keys:n,columns:s,columnScopes:r,invalidKeys:a,invalidData:o}=t,l=t.scopes,c=[],h=[],u=l.size!==1||e!=null?new Map:void 0;let d=!0,g=0;const p=l.size,f=this.groupBatches(l,s,r,n,o,a),m=f.length;if(this.ctx.debug?.check()&&!t.optimizations&&(t.optimizations={}),this.ctx.debug?.check()){const v=p>0?1-m/p:0;t.optimizations.batchMerging={originalBatchCount:p,mergedBatchCount:m,mergeRatio:v}}const y=f.length===1,b=Object.freeze(ss(f[0][1].length,wM));for(const[v,S,M,C,D,A]of f){const w=s[Oi(S)];for(let L=0;L<w.length;L++){if(A?.[L]===!0)continue;const O=M.map(G=>G[L]);if(O==null||O.length===0)throw new Error("AG Charts - no keys found for scope(s): "+v.join(", "));const R=e?.(O)??O,_=u==null?void 0:pm(R);let E=u?.get(_),F,z,K=!1;if(E==null?(F={keys:R,datumIndices:[],aggregation:[],validScopes:l},z=g++,E=[z,F],K=!0,u?.set(_,E),c.push(F.keys),h.push(F)):([z,F]=E,d=!1),D?.[L]===!0){F.validScopes===l&&(F.validScopes=new Set(l.values()));for(const G of C)F.validScopes.delete(G)}if(K&&L===z&&y)F.datumIndices=b;else{!K&&F.datumIndices===b&&(F.datumIndices=b.map(G=>[...G]));for(const G of S)(i=F.datumIndices)[G]??(i[G]=[]),F.datumIndices[G].push(L-z)}}}return{...t,type:"grouped",domain:{...t.domain,groups:c},groups:h,groupsUnique:d,optimizations:t.optimizations,[Fc]:t[Fc],[Ia]:t[Ia]}}groupBatches(t,e,i,n,s,r){const a=[],o=new Set;for(const l of t){const c=e.map((p,f)=>f).filter(p=>!o.has(p)&&i[p].has(l));if(c.length===0)continue;for(const p of c)o.add(p);const h=new Set;for(const p of c)for(const f of i[p])h.add(f);const u=n.map(p=>p.get(l)).filter(p=>p!=null),d=s?.get(l),g=r?.get(l);a.push([l,c,u,h,d,g])}return this.mergeCompatibleBatches(a)}areBatchesCompatible(t,e){const[,,i,,n,s]=t,[,,r,,a,o]=e;return i.every((l,c)=>l===r[c])&&s===o&&n===a}mergeCompatibleBatches(t){const e=[],i=new Set;for(let n=0;n<t.length;n++){if(i.has(n))continue;const[s,r,a,o,l,c]=t[n],h=[[s],[...r],a,new Set(o),l,c];this.findAndMergeCompatibleBatches(t,n,h,i),e.push(h),i.add(n)}return e}findAndMergeCompatibleBatches(t,e,i,n){const s=t[e];for(let r=e+1;r<t.length;r++){if(n.has(r))continue;const a=t[r],[o,l,,c]=a;if(this.areBatchesCompatible(s,a)){i[0].push(o),i[1].push(...l);for(const h of c)i[3].add(h);n.add(r)}}}};function TM(t){return t.removedIndices.size===0&&t.totalPrependCount===0&&t.totalAppendCount>0}function CO(t){return t.removedIndices.size===0&&t.totalAppendCount===0&&t.totalPrependCount>0}function AO(t){return t.removedIndices.size===0}function wO(t){return t.removedIndices.size===0&&t.totalPrependCount===0&&t.totalAppendCount===0&&t.spliceOps.every(e=>e.insertCount===0&&e.deleteCount===0)}function kO(t){return t.removedIndices.size>0&&t.totalPrependCount===0&&t.totalAppendCount===0&&t.spliceOps.every(e=>e.insertCount===0)}function TO(t){return xm(t.removedIndices)>0}function xm(t){if(t.size===0)return 0;const e=Array.from(t).sort((i,n)=>i-n);if(e[0]!==0)return 0;for(let i=0;i<e.length;i++)if(e[i]!==i)return 0;return e.length}function LO(t){return TO(t)&&t.totalAppendCount>0&&t.totalPrependCount===0}var NO=class{constructor(t,e){this.indexMap=t,this.prependValues=e.prependValues,this.appendValues=e.appendValues,this.insertionValues=e.insertionValues}getRemovedIndices(){return Array.from(this.indexMap.removedIndices).sort((t,e)=>t-e)}getUpdatedIndices(){return Array.from(this.indexMap.updatedIndices).sort((t,e)=>t-e)}forEachPreservedIndex(t){const{originalLength:e,removedIndices:i,totalPrependCount:n}=this.indexMap;let s=0;const r=Array.from(i).sort((o,l)=>o-l);let a=0;for(let o=0;o<e;o++){for(;a<r.length&&r[a]<o;)s++,a++;if(!i.has(o)){const l=o+n-s;t(o,l)}}}getPrependedValues(){return this.prependValues}getAppendedValues(){return this.appendValues}getInsertionValues(){return this.insertionValues}applyToArray(t,e,i){const{spliceOps:n,finalLength:s,originalLength:r}=this.indexMap;if(!(r===s&&n.length===0)){for(const a of n){const o=a.insertCount>0?Array.from({length:a.insertCount},function(h,u){return e(a.index+u)}):[],l=t.splice(a.index,a.deleteCount,...o);i&&l.length>0&&i(l,a)}t.length!==s&&(t.length=s)}}applyToTypedArray(t,e=0){const{finalLength:i,removedIndices:n,totalPrependCount:s,totalAppendCount:r,spliceOps:a}=this.indexMap;if(i===t.length&&n.size===0&&a.length===0)return t;const o=new Uint8Array(i);e!==0&&o.fill(e);let l=0;for(const c of a)l+=c.insertCount;if(l>s+r){const c=this.collectMidArrayInsertions();this.forEachPreservedIndex(function(u,d){let g=0;for(const p of c)if(p.destIndex<=d+g)g+=p.count;else break;o[d+g]=t[u]})}else{const c=n.size>0?Array.from(n).sort((g,p)=>g-p):[];let h=0,u=s;for(const g of c){const p=g-h;p>0&&(o.set(t.subarray(h,h+p),u),u+=p),h=g+1}const d=t.length-h;d>0&&o.set(t.subarray(h,h+d),u)}return o}collectMidArrayInsertions(){const{totalPrependCount:t,totalAppendCount:e,finalLength:i,spliceOps:n}=this.indexMap,s=i-e,r=[];for(const a of n)if(a.insertCount>0){if(a.deleteCount===0&&a.index===0&&a.insertCount===t||a.deleteCount===0&&a.index===s&&a.insertCount===e)continue;r.push({destIndex:a.index,count:a.insertCount})}return r.sort((a,o)=>a.destIndex-o.destIndex)}},OO=class extends SM{constructor(t={}){super(t),this.lastDirtyBandCount=0,this.lastScanRatio=0,this.statsCaptured=!1}createBand(t,e){return{startIndex:t,endIndex:e,cachedResult:void 0,isDirty:!0}}initializeBands(t){super.initializeBands(t),this.statsCaptured=!1}getBands(){return this.bands}evaluateFromData(t,e,i=!1){const n=t.reducer();for(const s of this.bands){if(i&&!s.isDirty)continue;const r=t.needsOverlap&&s.startIndex>0?Math.max(0,s.startIndex-1):s.startIndex,a=this.evaluateRange(t,n,e,r,s.endIndex);s.cachedResult=a,s.isDirty=!1}}getResult(t){const e=this.bands.map(i=>i.cachedResult);return t.combineResults(e)}evaluateRange(t,e,i,n,s){let r=t.initialValue;const{keyColumns:a,keysParam:o,rawData:l}=i,c=Math.min(s,l.length);for(let h=n;h<c;h+=1){for(let u=0;u<o.length;u++)o[u]=a[u]?.[h];r=e(r,o)}return r}captureStatsBeforeProcessing(){const t=this.bands.filter(i=>i.isDirty),e=t.reduce((i,n)=>i+(n.endIndex-n.startIndex),0);this.lastDirtyBandCount=t.length,this.lastScanRatio=this.dataSize>0?e/this.dataSize:0,this.statsCaptured=!0}getStats(){const t=this.bands.filter(n=>!n.isDirty&&n.cachedResult!==void 0);let e,i;if(this.statsCaptured)e=this.lastDirtyBandCount,i=this.lastScanRatio;else{const n=this.bands.filter(r=>r.isDirty),s=n.reduce((r,a)=>r+(a.endIndex-a.startIndex),0);e=n.length,i=this.dataSize>0?s/this.dataSize:0}return{totalBands:this.bands.length,dirtyBands:e,dataSize:this.dataSize,scanRatio:i,cacheHits:t.length}}},LM=class{constructor(t={}){this.bandingConfig=t}static evaluateRange(t,e,i,n,s){let r=t.initialValue;const{keyColumns:a,keysParam:o,rawData:l}=i,c=Math.min(s,l.length);for(let h=n;h<c;h+=1){for(let u=0;u<o.length;u++)o[u]=a[u]?.[h];r=e(r,o)}return r}evaluate(t,e,i={}){var n;const s=this.createContext(t,e);if(!s)return;e[n=Ia]??(e[n]=new Map);const r=e[Ia],a=t.property;let o=r.get(a);return o||(o=new OO(this.bandingConfig),r.set(a,o)),o.getBandCount()===0&&o.initializeBands(s.rawData.length),i.beforeEvaluate?.(o,s),o.captureStatsBeforeProcessing(),o.evaluateFromData(t,s,i.reuseCleanBands??!1),o.getResult(t)}applyIndexMap(t,e){const i=t[Ia];if(i)for(const n of i.values())n.applyIndexMap(e)}createContext(t,e){if(e.type!=="ungrouped")return;const i=fm(t)?t.scopes[0]:Oi(e.dataSources.keys());if(i==null)return;const n=e.dataSources.get(i)?.data??[],s=e.keys.map(a=>a.get(i)).filter(a=>a!=null),r=s.map(()=>{});return{scopeId:i,rawData:n,keyColumns:s,keysParam:r}}},EO=class{constructor(t,e){this.ctx=t,this.reducerManager=e}isReprocessingSupported(t){if(t.type==="grouped"){if(!t.groupsUnique||this.getUniqueDataSets(t).size!==1)return!1;const s=Oi(t.scopes);if(t.invalidKeys?.get(s)?.some(a=>a))return!1}return this.ctx.aggregates.length>0||this.ctx.reducers.some(n=>n.supportsBanding!==!0||typeof n.combineResults!="function")||this.ctx.processors.some(n=>n.incrementalCalculate===void 0)||this.ctx.propertyProcessors.length>0?!1:this.ctx.groupProcessors.every(n=>n.supportsReprocessing??!1)}reprocessData(t,e,i,n,s,r){const a=performance.now(),o=this.collectScopeChanges(t,e);if(o.size===0)return t;this.commitPendingTransactions(t);const l=this.buildDefinitionProcessors(this.ctx.keys,i),c=this.buildDefinitionProcessors(this.ctx.values,i),h=this.processAllInsertions(t,o,l,c);this.processAllUpdates(t,o,l,c,h),this.updateBandsForChanges(t,o);const u=this.transformKeysArrays(t,o,h);this.transformColumnsArrays(t,o,h),this.transformInvalidityArrays(t,o,h),this.reprocessBandedReducers(t,o),t.type==="grouped"&&(this.transformGroupsArray(t,o,h),this.ctx.groupProcessors.length>0&&n(t,o)),this.invalidateSortOrdersForChanges(t,o),s(t),this.reprocessProcessors(t),t.reduced?.diff!=null&&o.size>0&&this.generateDiffMetadata(t,o,u),this.updateProcessedDataMetadata(t);const d=performance.now();t.time=d-a,t.version+=1,r(t,"reprocess");const g=md(o);return t.changeDescription=g.size===1?g.values().next().value:void 0,t}updateBandsForChanges(t,e){const i=t[Fc];if(i.size===0)return;const n=md(e);for(const s of n){const{indexMap:r}=s;for(const a of i.values())a.applyIndexMap(r)}}reprocessBandedReducers(t,e){if(t.type!=="ungrouped")return;const i=this.ctx.reducers.filter(n=>n.supportsBanding&&typeof n.combineResults=="function");if(i.length!==0){t.reduced??(t.reduced={});for(const n of i){const s=this.reducerManager.evaluate(n,t,{reuseCleanBands:!0,beforeEvaluate:(r,a)=>{if(!a.scopeId)return;const o=e.get(a.scopeId);o&&r.applyIndexMap(o.indexMap)}});s!==void 0&&(t.reduced[n.property]=s)}}}collectScopeChanges(t,e){const i=new Map;for(const[n,s]of t.dataSources){const r=e?.get(s)??s.getChangeDescription();r&&i.set(n,r)}return i}commitPendingTransactions(t){const e=this.getUniqueDataSets(t);for(const i of e)i.commitPendingTransactions()}buildDefinitionProcessors(t,e){return t.map((i,n)=>({def:i,index:n,processValue:e(i)}))}processAllInsertions(t,e,i,n){const s=new Map;for(const[r,a]of e){const o=t.dataSources.get(r);if(!o)continue;const l=this.processInsertionsOnce(r,a,o,i,n);s.set(r,l)}return s}processAllUpdates(t,e,i,n,s){for(const[r,a]of e){const o=t.dataSources.get(r);if(!o)continue;const l=a.getUpdatedIndices();if(l.length===0)continue;let c=s.get(r);c||(c=new Map,s.set(r,c));for(const h of l){if(h<0||h>=o.data.length)continue;const u=this.processDatum(o,h,r,i,n);u&&c.set(h,u)}}}processInsertionsOnce(t,e,i,n,s){const r=new Map,{finalLength:a}=e.indexMap;for(const o of e.indexMap.spliceOps)if(!(o.insertCount<=0))for(let l=0;l<o.insertCount;l++){const c=o.index+l;if(c<0||c>=a)continue;const h=this.processDatum(i,c,t,n,s);h&&r.set(c,h)}return r}processDatum(t,e,i,n,s){const r=t.data[e],a=new Map,o=new Map;let l=!1,c=!1,h=!1;if(r==null||typeof r!="object")l=!0,c=!0;else{for(const{index:u,def:d,processValue:g}of n){if(!d.scopes?.includes(i))continue;const p=g(r,e,i);a.set(u,{value:p.value,valid:p.valid}),p.valid||(l=!0)}for(const{index:u,def:d,processValue:g}of s){if(!d.scopes?.includes(i))continue;const p=g(r,e,d.scopes);o.set(u,{value:p.value,valid:p.valid}),p.valid||(c=!0),p.missing&&(h=!0)}}return{keys:a,values:o,hasInvalidKey:l,hasInvalidValue:c,hasMissingValue:h}}transformArraysWithCache(t,e,i,n,s,r){for(const[a,o]of t.entries())for(const l of s(o)){const c=e.get(l);if(!c)continue;const h=n(a,l);if(!h)continue;const u=i.get(l);this.applyChangeDescWithCache(c,h,u,(d,g)=>r(d,o,a))}}transformKeysArrays(t,e,i){const n=new Map,s=o=>{let l=n.get(o);return l||(l={tuples:[]},n.set(o,l)),l},r=new WeakSet;for(const[o,l]of this.ctx.keys.entries())for(const c of l.scopes??[]){const h=e.get(c);if(!h)continue;const u=t.keys[o]?.get(c);if(!u)continue;if(r.has(u)){const f=Array.from(t.keys[o].entries()).find(([m,y])=>y===u)?.[0];f&&f!==c&&n.has(f)&&n.set(c,n.get(f));continue}r.add(u);const d=i.get(c),g=s(c);let p=0;this.applyChangeDescWithCache(h,u,d,f=>{const m=f?.keys.get(o);return m?.valid?m.value:l.invalidValue},f=>{for(const m of f)g.tuples[p]||(g.tuples[p]=new Array(this.ctx.keys.length)),g.tuples[p][o]=m,p+=1})}const a=new Map;for(const[o,{tuples:l}]of n){if(l.length===0)continue;const c=new Set;for(const h of l){const u=[];for(const[d,g]of h.entries())this.ctx.keys[d].scopes?.includes(o)&&u.push(g);u.length>0&&c.add(pm(u))}a.set(o,c)}return a}transformColumnsArrays(t,e,i){this.transformArraysWithCache(this.ctx.values,e,i,n=>t.columns[n],n=>[Oi(n.scopes)],(n,s,r)=>{if(n){if(n.hasInvalidKey)return s.invalidValue;const a=n.values.get(r);return a?.valid?a.value:s.invalidValue}return s.invalidValue})}transformInvalidityMap(t,e,i,n){const s=new Set;for(const[r,a]of e){let o=t.get(r);if(!o){const c=i.get(r);if(c&&Array.from(c.values()).some(n))o=ss(a.indexMap.originalLength,!1),t.set(r,o);else continue}if(s.has(o))continue;s.add(o);const l=i.get(r);this.applyChangeDescWithCache(a,o,l,(c,h)=>n(c))}}transformInvalidityArrays(t,e,i){t.invalidKeys&&this.transformInvalidityMap(t.invalidKeys,e,i,n=>n?.hasInvalidKey??!1),t.invalidData&&this.transformInvalidityMap(t.invalidData,e,i,n=>n?n.hasInvalidKey||n.hasInvalidValue:!1),t.missingData&&this.transformInvalidityMap(t.missingData,e,i,n=>n?.hasMissingValue??!1)}applyChangeDescWithCache(t,e,i,n,s){t.applyToArray(e,a=>{const o=i?.get(a);return n(o,a)},s);const r=t.getUpdatedIndices();if(r.length!==0)for(const a of r){if(a<0||a>=e.length)continue;const o=i?.get(a);e[a]=n(o,a)}}transformGroupsArray(t,e,i){const n=Oi(t.scopes),s=e.get(n);if(!s)return;const r=i.get(n);for(const[,o]of r??[])if(o.hasInvalidKey)throw new Error("AG Charts - reprocessing grouped data with invalid keys not supported. This typically indicates a data quality issue that requires full reprocessing.");s.applyToArray(t.groups,o=>this.createDataGroupForInsertion(o,t,n,r));const a=s.getUpdatedIndices();if(a.length>0)for(const o of a)o<0||o>=t.groups.length||(t.groups[o]=this.createDataGroupForInsertion(o,t,n,r))}createDataGroupForInsertion(t,e,i,n){const s=[];for(const u of e.keys){const d=u.get(i);d&&s.push(d[t])}const r=e.groups[0],a=()=>Object.freeze(ss(e.columnScopes.length,wM)),o=r?.datumIndices??a(),c=n?.get(t)?.hasInvalidValue??!1;let h;return c?(h=new Set(e.scopes),h.delete(i)):h=e.scopes,{keys:s,datumIndices:o,aggregation:[],validScopes:h}}generateDiffMetadata(t,e,i){const n=(s,r)=>{const a=[];for(const o of t.keys){const l=o.get(s);if(!l)return;a.push(l[r])}return a.length>0?pm(a):void 0};for(const[s,r]of e){const a={changed:!0,added:new Set,removed:i.get(s)??new Set,updated:new Set,moved:new Set};for(const c of r.indexMap.spliceOps)if(c.insertCount>0)for(let h=0;h<c.insertCount;h++){const u=c.index+h,d=n(s,u);d&&a.added.add(d)}const{originalLength:o,totalPrependCount:l}=r.indexMap;if(!TM(r.indexMap))if(CO(r.indexMap)&&o>0)for(let c=l;c<l+o;c++){const h=n(s,c);h&&a.moved.add(h)}else if(AO(r.indexMap)&&l>0)for(let c=0;c<o;c++){const h=c+l,u=n(s,h);u&&a.moved.add(u)}else r.forEachPreservedIndex((c,h)=>{if(c!==h){const u=n(s,h);u&&a.moved.add(u)}});t.reduced.diff[s]=a}}updateProcessedDataMetadata(t){let e=0;for(const n of t.dataSources.values())e=Math.max(e,n.data.length);t.input.count=e;let i=0;for(const[n,s]of t.invalidData??new Map){const r=t.invalidKeys?.get(n);for(let a=0;a<s.length;a++)s[a]&&!r?.[a]&&(i+=1)}if(t.partialValidDataCount=i,this.recountInvalid(t.invalidKeys,t.invalidKeyCount),this.recountInvalid(t.invalidData,t.invalidDataCount),t.missingData)for(const[n,s]of t.missingData)s.includes(!1)||t.missingData.delete(n);this.invalidateCachesForChanges(t)}updateSortOrderForAppend(t,e,i){if(i.length===0)return;const n=a=>{if(typeof a=="number")return a;if(a instanceof Date)return a.valueOf()};let s=n(e);const r=t.sortOrder;for(const a of i){const o=n(a);if(o===void 0)continue;if(s===void 0){s=o;continue}const l=o-s;if(l===0&&(t.isUnique=!1),t.sortOrder!==void 0){let c=0;l>0?c=1:l<0&&(c=-1),c!==0&&c!==r&&(t.sortOrder=void 0)}s=o}}updateKeySortOrdersForAppend(t,e){for(const[i,n]of t.keys.entries()){const s=t[Cr].get(i);if(!s)continue;const r=Oi(n.values());if(!r||r.length<=e)continue;const a=e>0?r[e-1]:void 0,o=r.slice(e);this.updateSortOrderForAppend(s,a,o)}}invalidateSortOrdersForChanges(t,e){const i=md(e);let n=!0,s=!1,r=!1,a,o;for(const l of i){const{indexMap:c}=l;wO(c)||(TM(c)?(s=!0,a=c.originalLength):kO(c)||(LO(c)?(r=!0,o={originalLength:c.originalLength,removedCount:c.removedIndices.size}):n=!1))}n?s&&a!==void 0?this.updateKeySortOrdersForAppend(t,a):r&&o&&this.updateKeySortOrdersForRollingWindow(t,o):(t[Cr].clear(),t[ym].clear())}updateKeySortOrdersForRollingWindow(t,e){const{originalLength:i,removedCount:n}=e;for(const[s,r]of t.keys.entries()){const a=t[Cr].get(s);if(!a)continue;const o=Oi(r.values());if(!o||o.length===0)continue;const l=i-n,c=l>0?o[l-1]:void 0,h=o.slice(l);this.updateSortOrderForAppend(a,c,h)}}invalidateCachesForChanges(t){this.markDomainRangesDirty(t[bm])}markDomainRangesDirty(t){for(const e of t.values())e.isDirty=!0}recountInvalid(t,e){if(!(!t||!e))for(const[i,n]of t){const s=n.filter(Boolean).length;s===0?(t.delete(i),e.delete(i)):e.set(i,s)}}reprocessProcessors(t){if(this.ctx.processors.length!==0){t.reduced??(t.reduced={});for(const e of this.ctx.processors){const i=t.reduced[e.property],n=e.incrementalCalculate?.(t,i)??e.calculate(t,i);t.reduced[e.property]=n}}}getUniqueDataSets(t){return new Set(t.dataSources.values())}},Da=0,Ca=1,rs=2,RO=class fh{constructor(e){this.isDirty=!1;const i=e.reduce((r,a)=>Math.max(r,a.length),0),{maxLevelSize:n,buffer:s}=fh.createBuffer(i);this.maxLevelSize=n,this.buffer=s,this.dataLength=i,this.populateBuffer(e)}static computeMaxLevelSize(e){let n=1<<32-Math.clz32(e);return e===n/2&&(n=n>>>1),n}static createBuffer(e){const i=fh.computeMaxLevelSize(e),n=new Float64Array((i*2-1)*2).fill(Number.NaN);return{maxLevelSize:i,buffer:n}}populateBuffer(e){const{maxLevelSize:i,buffer:n}=this,s=i-1;for(const r of e){const a=r.length;for(let o=0;o<a;o+=1){const l=Number(r[o]);if(l!==l)continue;const c=s+o<<1,h=n[c],u=n[c+1];(h!==h||l<h)&&(n[c]=l),(u!==u||l>u)&&(n[c+1]=l)}}for(let r=i>>>1;r>=1;r>>>=1){const a=r-1,o=a+r<<1;let l=a<<1,c=o;for(let h=0;h<r;h+=1){const u=c+2,d=n[c],g=n[u];n[l]=g!==g||d<g?d:g;const p=n[c+1],f=n[u+1];n[l+1]=f!==f||p>f?p:f,l+=2,c+=4}}}rebuild(e){const i=e.reduce((s,r)=>Math.max(s,r.length),0);if(fh.computeMaxLevelSize(i)===this.maxLevelSize)this.buffer.fill(Number.NaN);else{const{maxLevelSize:s,buffer:r}=fh.createBuffer(i);this.maxLevelSize=s,this.buffer=r}this.dataLength=i,this.populateBuffer(e)}updateValue(e,i){const{maxLevelSize:n,buffer:s}=this,r=n+e-1,a=Math.trunc(r*rs)+Da,o=Math.trunc(r*rs)+Ca;s[a]=Number.NaN,s[o]=Number.NaN;for(const l of i){const c=Number(l),h=s[a],u=s[o];(!Number.isFinite(h)||c<h)&&(s[a]=c),(!Number.isFinite(u)||c>u)&&(s[o]=c)}this.propagateUp(r)}updateValues(e){for(const{index:i,values:n}of e)this.updateValue(i,n)}propagateUp(e){const{buffer:i}=this;for(;e>0;){const n=Math.trunc((e-1)/2),s=2*n+1,r=2*n+2,a=i[Math.trunc(s*rs)+Da],o=i[Math.trunc(s*rs)+Ca],l=i[Math.trunc(r*rs)+Da],c=i[Math.trunc(r*rs)+Ca];i[Math.trunc(n*rs)+Da]=!Number.isFinite(l)||a<l?a:l,i[Math.trunc(n*rs)+Ca]=!Number.isFinite(c)||o>c?o:c,e=n}}computeRangeInto(e,i,n,s,r,a,o){const l=r+a-1;if(l<i||r>=n)return o;if(r>=i&&l<n){const c=e[Math.trunc(s*rs)+Da],h=e[Math.trunc(s*rs)+Ca];Number.isFinite(c)&&(o[0]=Math.min(o[0],c)),Number.isFinite(h)&&(o[1]=Math.max(o[1],h))}else a>1&&(s=Math.trunc(s*2),a=Math.trunc(a/2),this.computeRangeInto(e,i,n,Math.trunc(s+1),r,a,o),this.computeRangeInto(e,i,n,Math.trunc(s+2),r+a,a,o));return o}rangeBetween(e,i,n){const s=n??[0,0];if(e>i)return s[0]=Number.NaN,s[1]=Number.NaN,s;const{maxLevelSize:r,buffer:a}=this;return s[0]=1/0,s[1]=-1/0,this.computeRangeInto(a,e,i,0,0,r,s),s}getRange(e){const{buffer:i}=this,n=e??[0,0];return n[0]=i[Da],n[1]=i[Ca],n}get range(){const{buffer:e}=this;return[e[Da],e[Ca]]}get length(){return this.dataLength}};function PO(t,e){const i=t.length;if(t.length<=1)return 1;let n=0,s=t[0];for(let r=1;r<i;r++){const a=t[r];if(a==null)continue;if(typeof(e?a.valueOf():a)!="number")return;const l=Math.sign(a-s);if(l!==0){if(n!==0&&n!==l)return;n=l}s=a}return n===0?1:n}var FO=class{constructor(t){this.ctx=t,this.rangeBetweenBuffer=[0,0]}resolveMissingDataCount(t){let e=0;for(const i of this.ctx.values)e=Math.max(e,i.missing.get(t.id)??0);return e}resolveProcessedDataDefById(t,e){const i=this.ctx.scopeCache.get(t.id)?.get(e);if(!i)throw new Error(`AG Charts - didn't find property definition for [${e}, ${t.id}]`);return{index:i.index,def:i}}resolveProcessedDataIndexById(t,e){const i=this.ctx.scopeCache.get(t.id)?.get(e);if(!i)throw new Error(`AG Charts - didn't find property definition for [${e}, ${t.id}]`);return i.index}resolveKeysById(t,e,i){const n=this.resolveProcessedDataIndexById(t,e),s=i.keys[n];if(s==null)throw new Error(`AG Charts - didn't find keys for [${e}, ${t.id}]`);return s.get(t.id)}hasColumnById(t,e){return this.ctx.scopeCache.get(t.id)?.get(e)!=null}resolveColumnById(t,e,i){const n=this.resolveProcessedDataIndexById(t,e),s=i.columns?.[n];if(s==null)throw new Error(`AG Charts - didn't find column for [${e}, ${t.id}]`);return s}resolveColumnNeedsValueOf(t,e,i){const n=this.resolveProcessedDataIndexById(t,e);return i.columnNeedValueOf?.[n]??!0}resolveAbsoluteIndex(t,e){return t+e}getDomain(t,e,i,n){return this.getDomainsByType(i??"value",n)?.[this.resolveProcessedDataIndexById(t,e)]??[]}getDomainBetweenRange(t,e,[i,n],s){const r=e.map(u=>this.resolveProcessedDataIndexById(t,u)),a=s.input.count;if(i<=0&&n>=a){const u=s.domain.values;let d=1/0,g=-1/0;for(const p of r){const f=u[p];f!=null&&(f[0]<d&&(d=f[0]),f[1]>g&&(g=f[1]))}return this.rangeBetweenBuffer[0]=d,this.rangeBetweenBuffer[1]=g,this.rangeBetweenBuffer}const o=r.join(":"),l=s[bm],c=r.map(u=>s.columns[u]);let h=l.get(o);return h==null?(h=new RO(c),l.set(o,h)):h.isDirty&&(h.rebuild(c),h.isDirty=!1),h.rangeBetween(i,n,this.rangeBetweenBuffer)}getSortOrder(t,e,i,n){const s=i.get(e);if(s==null||s.isDirty){const r={sortOrder:PO(t,n)};return i.set(e,r),r.sortOrder}return s.sortOrder}getKeySortOrder(t,e,i){const n=this.resolveProcessedDataIndexById(t,e),s=i.keys[n]?.get(t.id);return s?this.getSortOrder(s,n,i[Cr],!0):void 0}getKeySortEntry(t,e,i){const n=this.resolveProcessedDataIndexById(t,e),s=i[Cr].get(n);return s?.isDirty?void 0:s}getColumnSortOrder(t,e,i){const n=this.resolveProcessedDataIndexById(t,e),s=i.columnNeedValueOf?.[n]??!0;return this.getSortOrder(i.columns[n],n,i[ym],s)}getDomainsByType(t,e){switch(t){case"key":return e.domain.keys;case"value":return e.domain.values;case"aggregate":return e.domain.aggValues;case"group-value-processor":return e.domain.groups;default:return null}}},VO=class{constructor(t){this.ctx=t}processScopeCache(){this.ctx.scopeCache.clear();for(const t of Ur(this.ctx.keys,this.ctx.values,this.ctx.aggregates))if(t.idsMap)for(const[e,i]of t.idsMap)for(const n of i)if(!this.ctx.scopeCache.has(e))this.ctx.scopeCache.set(e,new Map([[n,t]]));else{if(this.ctx.scopeCache.get(e)?.has(n))throw new Error("duplicate definition ids on the same scope are not allowed.");this.ctx.scopeCache.get(e).set(n,t)}}valueGroupIdxLookup({matchGroupIds:t}){const e=[];for(const[i,n]of this.ctx.values.entries())(!t||n.groupId&&t.includes(n.groupId))&&e.push(i);return e}valueIdxLookup(t,e){const i=t==null||t.length===0,n=typeof e=="string"?e:e.id,s=a=>{if(a.idsMap){for(const[o,l]of a.idsMap)if(t?.includes(o)&&l.has(n))return!0}return!1},r=this.ctx.values.reduce((a,o,l)=>((o.scopes==null||i&&!o.scopes.length||o.scopes.some(h=>t?.includes(h)))&&(o.property===n||o.id===n||s(o))&&a.push(l),a),[]);if(r.length===0)throw new Error(`AG Charts - configuration error, unknown property ${JSON.stringify(e)} in scope(s) ${JSON.stringify(t)}`);return r}buildAccessors(t){const e=new Map;if(this.ctx.suppressFieldDotNotation)return e;for(const i of t){if(!(i.property.includes(".")||i.property.includes("[")))continue;const s=gO(i.property);if(s==null){j.warnOnce("Invalid property path [%s]",i.property);continue}const r=pO(s);e.set(i.property,r)}return e}},Sm=class{constructor(t,e="standalone",i=!1,n){this.opts=t,this.mode=e,this.suppressFieldDotNotation=i,this.eventsHub=n,this.debug=ue.create(!0,"data-model"),this.scopeCache=new Map,this.keys=[],this.values=[],this.aggregates=[],this.groupProcessors=[],this.propertyProcessors=[],this.reducers=[],this.processors=[];let s=!0;for(const c of t.props){if(c.type==="key"&&!s)throw new Error("AG Charts - internal config error: keys must come before values.");c.type==="value"&&s&&(s=!1)}const r=({matchGroupIds:c=[]})=>{for(const h of c)if(this.values.every(u=>u.groupId!==h))throw new Error(`AG Charts - internal config error: matchGroupIds properties must match defined groups (${h}).`)},a=new Set,o=new Set;for(const c of t.props){const h=c.type==="key"?a:o;if(fm(c)&&c.scopes)for(const u of c.scopes)h.add(u);switch(c.type){case"key":this.keys.push({...c,index:this.keys.length,missing:new Map});break;case"value":if(c.property==null)throw new Error(`AG Charts - internal config error: no properties specified for value definitions: ${JSON.stringify(c)}`);this.values.push({...c,index:this.values.length,missing:new Map});break;case"aggregate":r(c),this.aggregates.push({...c,index:this.aggregates.length});break;case"group-value-processor":r(c),this.groupProcessors.push({...c,index:this.groupProcessors.length});break;case"property-value-processor":this.propertyProcessors.push({...c,index:this.propertyProcessors.length});break;case"reducer":this.reducers.push({...c,index:this.reducers.length});break;case"processor":this.processors.push({...c,index:this.processors.length});break}}if(this.opts.groupByKeys||this.opts.groupByFn!=null){const c=new Set(o.values());for(const h of a)c.delete(h);if(c.size>0)throw new Error(`AG Charts - scopes missing key for grouping, illegal configuration: ${[...c.values()]}`)}const l={keys:this.keys,values:this.values,aggregates:this.aggregates,groupProcessors:this.groupProcessors,propertyProcessors:this.propertyProcessors,reducers:this.reducers,processors:this.processors,debug:this.debug,mode:this.mode,bandingConfig:this.opts.domainBandingConfig,suppressFieldDotNotation:this.suppressFieldDotNotation,scopeCache:this.scopeCache};this.resolvers=new FO(l),this.scopeCacheManager=new VO(l),this.domainInitializer=new mO(l),this.domainManager=new vO(l,this.domainInitializer,this.scopeCacheManager),this.reducerManager=new LM(this.opts.domainBandingConfig),this.dataExtractor=new IO(l,this.domainManager),this.dataGrouper=new DO(l),this.aggregator=new fO(l,this.scopeCacheManager,this.resolvers),this.incrementalProcessor=new EO(l,this.reducerManager)}resolveProcessedDataDefById(t,e){return this.resolvers.resolveProcessedDataDefById(t,e)}resolveProcessedDataIndexById(t,e){return this.resolvers.resolveProcessedDataIndexById(t,e)}resolveKeysById(t,e,i){return this.resolvers.resolveKeysById(t,e,i)}hasColumnById(t,e){return this.resolvers.hasColumnById(t,e)}resolveColumnById(t,e,i){return this.resolvers.resolveColumnById(t,e,i)}resolveColumnNeedsValueOf(t,e,i){return this.resolvers.resolveColumnNeedsValueOf(t,e,i)}resolveMissingDataCount(t){return this.resolvers.resolveMissingDataCount(t)}*forEachDatum(t,e,i,n){const s=e.columnScopes.findIndex(r=>r.has(t.id));for(const r of i.datumIndices[s]??[]){const a=this.resolvers.resolveAbsoluteIndex(n,r);yield e.columns[s][a]}}getUniqueDataSets(t){return new Set(t.dataSources.values())}*forEachGroupDatum(t,e){const i=e.columnScopes.findIndex(r=>r.has(t.id)),n={groupIndex:0,columnIndex:i},s=[];for(const r of e.groups){n.group=r;for(const a of r.datumIndices[i]??s)n.datumIndex=this.resolvers.resolveAbsoluteIndex(n.groupIndex,a),yield n;n.groupIndex++}}getDomain(t,e,i,n){const s=this.resolvers.getDomain(t,e,i,n);if(i==="key"&&s.length>0){const r=this.getKeySortMetadata(t,e,n);return{domain:s,sortMetadata:r}}return{domain:s}}getDomainBetweenRange(t,e,[i,n],s){return this.resolvers.getDomainBetweenRange(t,e,[i,n],s)}getKeySortOrder(t,e,i){return this.resolvers.getKeySortOrder(t,e,i)}getColumnSortOrder(t,e,i){return this.resolvers.getColumnSortOrder(t,e,i)}getKeySortMetadata(t,e,i){const n=this.resolvers.getKeySortEntry(t,e,i);if(n?.sortOrder!=null)return{sortOrder:n.sortOrder,isUnique:n.isUnique}}processData(t){const{opts:{groupByKeys:e,groupByFn:i},aggregates:n,groupProcessors:s,reducers:r,processors:a,propertyProcessors:o}=this,l=performance.now();if(e&&this.keys.length===0)return;let c=this.extractData(t);e?c=this.dataGrouper.groupData(c):i&&(c=this.dataGrouper.groupData(c,i(c))),s.length>0&&c.type==="grouped"&&this.aggregator.postProcessGroups(c),n.length>0&&c.type==="ungrouped"?this.aggregator.aggregateUngroupedData(c):n.length>0&&c.type==="grouped"&&this.aggregator.aggregateGroupedData(c),o.length>0&&this.postProcessProperties(c),r.length>0&&this.reduceData(c),a.length>0&&this.postProcessData(c),this.warnDataMissingProperties(t);const h=performance.now();return c.time=h-l,c.version+=1,this.collectOptimizationMetadata(c,"full-process"),this.debug.check()&&_O(c),this.processScopeCache(),c}isReprocessingSupported(t){return this.incrementalProcessor.isReprocessingSupported(t)}reprocessData(t,e){if(!this.isReprocessingSupported(t)){this.debug.check()&&this.debug("Falling back to full reprocessing - incremental not supported for current configuration");const r=this.getUniqueDataSets(t);for(const a of r)a.commitPendingTransactions();return this.processData(t.dataSources)}const{getProcessValue:i}=this.initDataDomainProcessor("skip"),n=this.incrementalProcessor.reprocessData(t,e,i,this.reprocessGroupProcessors.bind(this),this.recomputeDomains.bind(this),this.collectOptimizationMetadata.bind(this)),{diff:s}=n.reduced??{};return s&&this.eventsHub?.emit("datamodel:diff",{diff:s}),n}recomputeDomains(t){this.domainManager.recomputeDomains(t)}warnDataMissingProperties(t){this.dataExtractor.warnDataMissingProperties(t)}processScopeCache(){this.scopeCacheManager.processScopeCache()}valueGroupIdxLookup(t){return this.scopeCacheManager.valueGroupIdxLookup(t)}valueIdxLookup(t,e){return this.scopeCacheManager.valueIdxLookup(t,e)}extractData(t){return this.dataExtractor.extractData(t)}reprocessGroupProcessors(t,e){const{groupProcessors:i}=this,{columns:n}=t;for(const r of i)if(!r.supportsReprocessing)throw new Error("AG Charts - attempted to reprocess group processor that does not support reprocessing. This is an internal error that should not occur.");const s=md(e);for(const r of i){const a=this.valueGroupIdxLookup(r),o=r.adjust()();for(const l of s){const{indexMap:c}=l;for(const h of c.spliceOps)if(h.insertCount>0)for(let u=0;u<h.insertCount;u++){const d=h.index+u,g=t.groups[d];o(n,a,g,d)}}}}postProcessProperties(t){for(const{adjust:e,property:i,scopes:n}of this.propertyProcessors)for(const s of this.valueIdxLookup(n,i))e()(t,s)}reduceData(t){t.reduced??(t.reduced={});for(const e of this.reducers)this.shouldUseReducerBanding(e,t)?t.reduced[e.property]=this.reduceWithBands(e,t):t.reduced[e.property]=this.reduceStandard(e,t)}shouldUseReducerBanding(t,e){return e.type==="ungrouped"&&t.supportsBanding===!0&&typeof t.combineResults=="function"}reduceWithBands(t,e){const i=this.reducerManager.evaluate(t,e,{reuseCleanBands:!1});return i===void 0?this.reduceStandard(t,e):i}reduceStandard(t,e){const i=t.reducer();if(e.type==="grouped"){let o=t.initialValue;for(const l of e.groups)o=i(o,l.keys);return o}const n=fm(t)?t.scopes[0]:Oi(e.scopes);if(n==null)return t.initialValue;const s=e.dataSources.get(n)?.data??[],r=e.keys.map(o=>o.get(n)).filter(o=>o!=null),a=r.map(()=>{});return LM.evaluateRange(t,i,{rawData:s,keyColumns:r,keysParam:a},0,s.length)}postProcessData(t){t.reduced??(t.reduced={});for(const i of this.processors)t.reduced[i.property]=i.calculate(t,t.reduced[i.property]);const{diff:e}=t.reduced;e&&this.eventsHub?.emit("datamodel:diff",{diff:e})}initDataDomainProcessor(t){return this.domainManager.initDataDomainProcessor(t)}collectOptimizationMetadata(t,e){const i=t.optimizations?.domainBanding,n=t[Ia];this.reducers.length>0&&n&&this.collectReducerBandingMetadata(t,n);const s=t.optimizations?.reducerBanding;t.optimizations={performance:{processingTime:t.time,pathTaken:e},...i&&{domainBanding:i},...s&&{reducerBanding:s}};const r=this.isReprocessingSupported(t),a=e==="reprocess";let o;if(!r){const l=[];if(t.type==="grouped"){t.groupsUnique||l.push("groupsUnique=false"),this.getUniqueDataSets(t).size!==1&&l.push("multiple data sources");const h=Oi(t.scopes);t.invalidKeys?.get(h)?.some(d=>d)&&l.push("has invalid keys")}this.aggregates.length>0&&l.push("has aggregates"),this.reducers.filter(c=>!c.supportsBanding).length>0&&l.push("has reducers"),this.processors.filter(c=>c.incrementalCalculate===void 0).length>0&&l.push("has processors"),this.propertyProcessors.length>0&&l.push("has property processors"),o=l.length>0?l.join(", "):void 0}if(t.optimizations.reprocessing={applied:a,reason:o},t.type==="grouped"){let l=0;const c=t.groups[0];if(c){const h=c.datumIndices;for(const u of t.groups)u.datumIndices===h&&l++}t.optimizations.sharedDatumIndices={applied:l>0,sharedGroupCount:l,totalGroupCount:t.groups.length}}}collectReducerBandingMetadata(t,e){if(this.reducers.length===0)return;t.optimizations??(t.optimizations={});const i=[];for(const n of this.reducers){const s=e.get(n.property),r=this.shouldUseReducerBanding(n,t)&&s!=null;let a;r||(n.supportsBanding!==!0?a="reducer does not support banding":t.type!=="ungrouped"?a="grouped data not supported":n.combineResults===void 0?a="missing combineResults function":a="banding not applied");let o;r&&s&&(o=s.getStats()),i.push({property:String(n.property),applied:r,reason:a,stats:o})}t.optimizations.reducerBanding={reducers:i}}buildAccessors(t){return this.scopeCacheManager.buildAccessors(t)}};function _O(t){const e=(i,n)=>{n.length>0&&(j.log(`DataModel.processData() - ${i}`),j.table(n))};if(j.log("DataModel.processData() - processedData",t),e("Key Domains",t.domain.keys),e("Value Domains",t.domain.values),e("Aggregate Domains",t.domain.aggValues??[]),t.optimizations){j.log("DataModel.processData() - Optimization Summary");const i=t.optimizations;if(i.performance&&j.log(`  Performance: ${i.performance.processingTime.toFixed(2)}ms (${i.performance.pathTaken})`),i.reprocessing){const n=i.reprocessing.applied?"\u2713":"\u2717",s=i.reprocessing.reason?` (${i.reprocessing.reason})`:"";j.log(`  Reprocessing: ${n}${s}`)}if(i.domainBanding){const n=i.domainBanding.keyDefs.filter(o=>o.applied),s=i.domainBanding.valueDefs.filter(o=>o.applied),r=n.length+s.length,a=i.domainBanding.keyDefs.length+i.domainBanding.valueDefs.length;if(r>0){j.log(`  Domain Banding: \u2713 (${r}/${a} definitions)`);for(const o of[...n,...s])if(o.stats){const l=(o.stats.scanRatio*100).toFixed(1);j.log(`    ${o.property}: scanned ${o.stats.dirtyBands}/${o.stats.totalBands} bands (${l}%)`)}}else{const o=[...i.domainBanding.keyDefs.filter(c=>!c.applied).map(c=>c.reason),...i.domainBanding.valueDefs.filter(c=>!c.applied).map(c=>c.reason)],l=[...new Set(o)].join(", ");j.log(`  Domain Banding: \u2717 (${l})`)}}if(i.sharedDatumIndices){const n=i.sharedDatumIndices.applied?"\u2713":"\u2717",s=`${i.sharedDatumIndices.sharedGroupCount}/${i.sharedDatumIndices.totalGroupCount}`;j.log(`  Shared DatumIndices: ${n} (${s} groups)`)}if(i.batchMerging){const n=(i.batchMerging.mergeRatio*100).toFixed(0),s=`${i.batchMerging.originalBatchCount} \u2192 ${i.batchMerging.mergedBatchCount}`;j.log(`  Batch Merging: ${s} (${n}% reduction)`)}}}var NM=1e3;function OM(t,e,i){const n=t.filter(s=>typeof s=="number"&&Number.isFinite(s));return n.length>0?i(n):e}function fn(t){return t.input.count<=NM}function EM(t){return t!=null&&Hu(t)}function BO(t){return t!=null}function zO(t){return!0}function RM(t,e){switch(t){case"number":case"log":case"time":case"unit-time":case"ordinal-time":case"color":return EM;default:return e?zO:BO}}function PM(t){switch(t){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function Ar(t,e,i={}){const n=i.allowNullKey??!1;return{property:t,type:"key",valueType:PM(e),validation:i.validation??RM(e,n),...i}}function Xe(t,e,i={}){const n=i.allowNullKey??!1;return{property:t,type:"value",valueType:PM(e),validation:i.validation??RM(e,n),...i}}function GO(t,e={}){return{property:t,type:"value",valueType:"range",missingValue:1,processor:function(){return function(){return 1}},...e}}var jO=function(t){return t};function FM(...t){const e=t.filter(i=>i!=null);return e.length===0?()=>jO:e.length===1?e[0]:function(){const n=e.map(s=>s());return function(r,a){return n.reduce((o,l)=>l(o,a),r)}}}function HO(t,e={}){const{min:i=-1/0,max:n=1/0,processor:s,...r}=e;return{type:"value",property:t,valueType:"range",validation:EM,processor:FM(s,function(){return function(l){return Ee(l)?te(i,l,n):l}}),...r}}function Mm(t,e,i={}){const{onlyPositive:n,processor:s,...r}=i;return{...Xe(t,e,r),processor:FM(s,uO(n))}}function $O(t,e,i={}){return{...Xe(t,e,i),processor:dO()}}function Aa(t,e,i,n){return[Xe(t,n,i),tE(i.groupId,e,i.separateNegative),...i.rangeId==null?[]:[cO(i.rangeId,i.groupId)]]}var VM={type:"reducer",property:"smallestKeyInterval",initialValue:1/0,reducer(){let t=Number.NaN;return function(i,n){const s=n[0],r=typeof s=="number"?s:Number(s);if(!Number.isFinite(r))return i;const a=t;if(t=r,!Number.isFinite(t))return i;const o=Math.abs(r-a),l=i??1/0;return o>0&&o<l?o:l}},supportsBanding:!0,combineResults(t){return OM(t,1/0,e=>Math.min(...e))},needsOverlap:!0},_M={type:"reducer",property:"largestKeyInterval",initialValue:-1/0,reducer(){let t=Number.NaN;return function(i,n){const s=n[0],r=typeof s=="number"?s:Number(s);if(!Number.isFinite(r))return i;const a=t;if(t=r,!Number.isFinite(t))return i;const o=Math.abs(r-a),l=i??-1/0;return o>0&&o>l?o:l}},supportsBanding:!0,combineResults(t){return OM(t,-1/0,e=>Math.max(...e))},needsOverlap:!0},UO={type:"processor",property:"sortedGroupDomain",calculate:function({domain:{groups:e}}){return e?.slice().sort((i,n)=>{for(let s=0;s<i.length;s++){const r=i[s]-n[s];if(r!==0)return r}return 0})}};function WO({normaliseTo:t}){const e=(i,n)=>{if(n===0)return 0;const s=(i??0)*t/n;return s>=0?Math.min(t,s):Math.max(-t,s)};return()=>()=>(i,n,s,r)=>{const a=KO(i,n,s,r);for(const o of n){const l=s.datumIndices[o];if(l!=null)for(const c of l){const h=r+c,u=i[o],d=u[h];if(d==null){u[h]=void 0;continue}u[h]=e(d,a)}}}}function KO(t,e,i,n){const s=[0,0];for(const r of e){const a=t[r],o=i.datumIndices[r];if(o!=null)for(const l of o){const c=n+l,h=a[c];if(h==null)continue;const u=typeof h=="number"?h:Math.max(...h.map(g=>g??0)),d=u<0?0:1;d===0?s[d]=Math.min(s[d],u):s[d]=Math.max(s[d],u)}}return Math.max(Math.abs(s[0]),s[1])}function vd(t,e){return{type:"group-value-processor",matchGroupIds:t,adjust:So({normaliseTo:e},WO)}}function YO({normaliseTo:t,zeroDomain:e,rangeMin:i,rangeMax:n}){const s=t[1]-t[0],r=function(o,l,c){const h=t[0]+(o-l)/c*s;return c===0?e:h>=t[1]?t[1]:h<t[0]?t[0]:h};return function(){return function(l,c){let[h,u]=l.domain.values[c];i!=null&&(h=i),n!=null&&(u=n);const d=u-h;l.domain.values[c]=[t[0],t[1]];const g=l.columns[c];for(let p=0;p<g.length;p+=1)g[p]=r(g[p],h,d)}}}function Im(t,e,i,n,s){return{type:"property-value-processor",property:t,adjust:So({normaliseTo:e,rangeMin:n,rangeMax:s,zeroDomain:i},YO)}}function ZO([t,e,i]){return function(s,r){if(r===!0)return!0;const a=s.defs.values.findIndex(h=>h.scopes.includes(t)&&h.id===e),o=s.defs.values.findIndex(h=>h.scopes.includes(t)&&h.id===i),l=s.columns[a],c=s.columns[o];if(l.length!==c.length)return!0;for(let h=0;h<l.length;h++)if(Math.abs(c[h])>Math.abs(l[h]))return!0;return!1}}function XO(t,e,i){return{type:"processor",property:"filteredValueExceedUnfiltered",calculate:So([t,e,i],ZO)}}var Bc=1,xd=2;function qO(t,e,i){let n=Bc|xd;if(t.valueType==="category")return e.length<i.length&&(n&=~Bc),n;let s=i[0]?.valueOf();for(let r=1;n!==0&&r<i.length;r++){const a=i[r]?.valueOf();(!Number.isFinite(a)||s>a)&&(n&=~xd),Number.isFinite(a)&&s===a&&(n&=~Bc),s=a}return n}function JO(t){return function(i,n){if(!fn(i))return;const{keys:s,values:r}=i.defs,{input:a,domain:{values:o},columns:l}=i;let c=!0,h=!0;if(a.count!==0){const u=i[Cr];for(let d=0;(c||h)&&d<s.length;d++){const g=s[d],p=u.get(d);if(g.valueType==="category"){const f=i.domain.keys[d]?.length??0,m=i.keys[d]?.values().next().value?.length??0;f<m&&(c=!1)}else p&&(p.isUnique===!1&&(c=!1),p.sortOrder!==1&&(h=!1))}if(t&&t.length>0){let d=Bc|xd;for(let g=0;d!==0&&g<r.length;g++){const p=r[g];t.includes(p.id)&&(d&=qO(p,o[g],l[g]))}d&Bc||(c=!1),d&xd||(h=!1)}}return{uniqueKeys:c,orderedKeys:h}}}function QO(){return{uniqueKeys:!0,orderedKeys:!1}}function zc(t){return{type:"processor",property:"animationValidation",calculate:So(t,JO),incrementalCalculate:QO}}function eE({mode:t,separateNegative:e}){return function(){return function(){return function(r,a,o,l){const c=[0,0];for(const h of a){const u=o.datumIndices[h];if(u==null)continue;const d=c[0],g=c[1],p=r[h];let f=!1;for(const m of u){const y=l+m,b=p[y];if(!Ee(b))continue;const v=e&&to(b),S=v?d:g;if(t==="normal"?p[y]=S+b:p[y]=S,!f){const M=v?0:1;c[M]=S+b,f=!0}}}}}}}function tE(t,e,i=!1){const n=So({mode:e,separateNegative:i},eE);return{type:"group-value-processor",matchGroupIds:[t],adjust:n,supportsReprocessing:!0}}function BM(t){return t.id??t.property}function iE(t,e,i){const n=new Map,s=e.defs.values;for(let o=0;o<s.length;o+=1){const l=s[o];if(l.scopes?.includes(t)===!1)continue;const c=BM(l);if(n.has(c))return;n.set(c,o)}const r=[],a=i.defs.values;for(let o=0;o<a.length;o+=1){const l=a[o];if(l.scopes?.includes(t)===!1)continue;const c=BM(l),h=n.get(c);if(h==null)return;n.delete(c),r.push({previousIndex:h,nextIndex:o})}if(n.size===0)return r}function Dm(t,e,i,n,s){for(const{previousIndex:r,nextIndex:a}of i){const o=t[r],l=e[a],c=o[n],h=l[s];if(c!==h)return!1}return!0}function Sd(t,e,i=!0){return{type:"processor",property:"diff",calculate(n,s){if(!fn(n))return{...s,[t]:{changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set}};const r=new Map,a=new Map,o=new Map,l=new Map,c=e.keys.map(b=>b.get(t)),h=n.keys.map(b=>b.get(t)),u=e.columns,d=n.columns,g=iE(t,e,n);if(g==null)return s;const p=Math.max(e.input.count,n.input.count),f=n.defs.keys.some(b=>b.allowNullKey===!0);for(let b=0;b<p;b++){const v=b<e.input.count,S=b<n.input.count,M=v?mm(c,b,f):void 0,C=M==null?"":Jt(...M),D=S?mm(h,b,f):void 0,A=D==null?"":Jt(...D);if(S&&v&&C===A){Dm(u,d,g,b,b)||o.set(A,b);continue}const w=l.get(A);w!=null?((i||!Dm(u,d,g,w,b))&&(o.set(A,b),r.set(A,b)),l.delete(A)):S&&a.set(A,b);const L=a.get(C);L!=null?((i||!Dm(u,d,g,L,b))&&(o.set(C,b),r.set(C,b)),a.delete(C)):v&&(o.delete(C),l.set(C,b))}const y={changed:a.size>0||o.size>0||l.size>0,added:new Set(a.keys()),updated:new Set(o.keys()),removed:new Set(l.keys()),moved:new Set(r.keys())};return{...s,[t]:y}}}}function Jt(...t){if(t.length===1){const e=$u(t[0]);if(e===null)return dm;if(e===void 0)return gm;if(typeof e=="boolean"||typeof e=="number"||typeof e=="string")return e}return t.map(e=>{const i=$u(e);return i===null?dm:i===void 0?gm:i}).join("___")}var zM=(t=>(t[t.None=0]="None",t[t.Item=1]="Item",t[t.Series=2]="Series",t[t.OtherSeries=3]="OtherSeries",t[t.OtherItem=4]="OtherItem",t))(zM||{}),GM=(t=>(t[t.None=0]="None",t[t.Item=1]="Item",t[t.OtherItem=2]="OtherItem",t[t.OtherSeries=3]="OtherSeries",t))(GM||{}),Cm=[0,1,2,3,4];function nE(t){switch(t){case 1:return["highlightedItem","highlightedSeries"];case 4:return["unhighlightedItem","highlightedSeries"];case 2:return["highlightedSeries"];case 3:return["unhighlightedSeries"];case 0:return[]}}function sE(t){switch(t){case 1:return["selectedItem"];case 2:return["unselectedItem"];case 3:return["unselectedSeries"];case 0:return[];default:return(i=>i)(t)}}function wa(t){const e=i=>i;switch(t){case 1:return"highlighted-item";case 4:return"unhighlighted-item";case 2:return"highlighted-series";case 3:return"unhighlighted-series";case 0:return"none";default:return e(t)}}function ka(t){const e=i=>i;switch(t){case 1:return"selected-item";case 2:return"unselected-item";case 3:return"unselected-series";case 0:return"none";case void 0:return;default:return e(t)}}function jM(t){return t===0||t===2||t==3}var Rs=class extends Te{constructor(){super(...arguments),this.enabled=!0,this.range="tooltip",this.bringToFront=!0,this.highlightedItem={},this.unhighlightedItem={},this.highlightedSeries={},this.unhighlightedSeries={}}getStyle(t){const e=nE(t);return e.length===0?{}:ge(...e.map(i=>this[i]))}};x([I],Rs.prototype,"enabled",2),x([I],Rs.prototype,"range",2),x([I],Rs.prototype,"bringToFront",2),x([I],Rs.prototype,"highlightedItem",2),x([I],Rs.prototype,"unhighlightedItem",2),x([I],Rs.prototype,"highlightedSeries",2),x([I],Rs.prototype,"unhighlightedSeries",2);var Ta=class extends Te{constructor(){super(...arguments),this.enabled=!1,this.containment="any",this.selectedItem={},this.unselectedItem={},this.unselectedSeries={},this.selectedOffset=0}getStyle(t){const e=sE(t);return e.length===0?{}:ge(...e.map(i=>this[i]))}};x([I],Ta.prototype,"enabled",2),x([I],Ta.prototype,"containment",2),x([I],Ta.prototype,"selectedItem",2),x([I],Ta.prototype,"unselectedItem",2),x([I],Ta.prototype,"unselectedSeries",2),x([I],Ta.prototype,"selectedOffset",2);var as=class extends Te{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};x([I],as.prototype,"start",2),x([I],as.prototype,"stop",2),x([I],as.prototype,"fill",2),x([I],as.prototype,"fillOpacity",2),x([I],as.prototype,"stroke",2),x([I],as.prototype,"strokeWidth",2),x([I],as.prototype,"strokeOpacity",2),x([I],as.prototype,"lineDash",2),x([I],as.prototype,"lineDashOffset",2);var Md=class{constructor(){this.key="x",this.segments=new co(as)}};x([I],Md.prototype,"enabled",2),x([I],Md.prototype,"key",2),x([I],Md.prototype,"segments",2);var wr=class extends Te{constructor(){super(...arguments),this.type="gradient",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.reverse=!1,this.colorSpace="rgb"}};x([I],wr.prototype,"type",2),x([I],wr.prototype,"colorStops",2),x([I],wr.prototype,"bounds",2),x([I],wr.prototype,"gradient",2),x([I],wr.prototype,"rotation",2),x([I],wr.prototype,"reverse",2),x([I],wr.prototype,"colorSpace",2);var Nt=class extends Te{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}};x([I],Nt.prototype,"type",2),x([I],Nt.prototype,"colorStops",2),x([I],Nt.prototype,"bounds",2),x([I],Nt.prototype,"gradient",2),x([I],Nt.prototype,"rotation",2),x([I],Nt.prototype,"scale",2),x([I],Nt.prototype,"reverse",2),x([I],Nt.prototype,"path",2),x([I],Nt.prototype,"pattern",2),x([I],Nt.prototype,"width",2),x([I],Nt.prototype,"height",2),x([I],Nt.prototype,"padding",2),x([I],Nt.prototype,"fill",2),x([I],Nt.prototype,"fillOpacity",2),x([I],Nt.prototype,"backgroundFill",2),x([I],Nt.prototype,"backgroundFillOpacity",2),x([I],Nt.prototype,"stroke",2),x([I],Nt.prototype,"strokeOpacity",2),x([I],Nt.prototype,"strokeWidth",2);var Ps=class extends Te{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"}};x([I],Ps.prototype,"type",2),x([I],Ps.prototype,"url",2),x([I],Ps.prototype,"rotation",2),x([I],Ps.prototype,"scale",2),x([I],Ps.prototype,"backgroundFill",2),x([I],Ps.prototype,"backgroundFillOpacity",2),x([I],Ps.prototype,"repeat",2),x([I],Ps.prototype,"fit",2);var mn=class extends Te{constructor(){super(...arguments),this.visible=!0,this.focusPriority=1/0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlight=new Rs,this.selection=new Ta}handleUnknownProperties(t,e){"context"in e&&(this.context=e.context,t.delete("context")),"allowNullKeys"in e&&(this.allowNullKeys=e.allowNullKeys,t.delete("allowNullKeys"))}};x([I],mn.prototype,"id",2),x([I],mn.prototype,"visible",2),x([I],mn.prototype,"focusPriority",2),x([I],mn.prototype,"showInLegend",2),x([I],mn.prototype,"cursor",2),x([I],mn.prototype,"nodeClickRange",2),x([I],mn.prototype,"highlight",2),x([I],mn.prototype,"selection",2);function HM(t,e){if(e.length===0)return[!1,!1];const i=e[0],n=e.at(-1);if(typeof i=="string"||i===null||i===void 0)return[t===i,t===n];if(t==null)return[!1,!1];const s=t.valueOf();if(i==null||n==null)return[!1,!1];let r=i.valueOf(),a=n.valueOf();return r>a&&([r,a]=[a,r]),[s===r,s===a]}function Id(t,e,i,n,s,r){const[a,o]=HM(e,r),[l,c]=HM(t,s);return{xKey:i,yKey:n,xValue:t,yValue:e,first:l,last:c,min:a,max:o}}function Gc(t,e,[i,n],s){let r=xo(0,e-1,o=>{const l=t===1?o:e-o,c=s(l)?.[1]??Number.NaN;return!Number.isFinite(c)||c>=i})??0,a=vo(0,e-1,o=>{const l=t===1?o:e-o,c=s(l)?.[0]??Number.NaN;return!Number.isFinite(c)||c<=n})??e-1;return t===-1&&([r,a]=[e-a,e-r]),r=Math.max(r,0),a=Math.min(a+1,e),[r,a]}function Am(t,e,i){if(i){const{x:s,y:r,width:a,height:o}=i;return{canvasX:s+a/2,canvasY:r+o/2}}const n=e.yBar?.upperPoint??e.midPoint??t.datumMidPoint?.(e);if(n){const{x:s,y:r}=Ze.toCanvasPoint(t.contentGroup,n.x,n.y);return{canvasX:Math.round(s),canvasY:Math.round(r)}}}function rE(t,e,i,n,s){let r=-1,a=0,o=0,l=!1;for(;a<n&&r<=e-t;){r+=1;const c=i+o;if(l||(o*=-1),o>=0&&(o+=1),l&&o<0&&(o-=1),c<t||c>e){l=!0;continue}s(c)&&(a+=1)}return a}function wm(t){const e={};for(const i of Cm)e[i]=t(void 0,!1,i,void 0);return e}function aE(t,...e){const i={};for(const n of e??["default"])for(const s of Cm){const r=i[n]??(i[n]={});r[s]=t(void 0,!1,s,n)}return i}function km(t){return(t?.opacity??1)<1||(t?.fillOpacity??1)<1||(t?.strokeOpacity??1)<1}var $M=new Map;function oE(t){if(t==null)return!1;const e=t.fill;if(!ot(e))return!1;const i=e.trim(),n=i.toLowerCase();if(n==="transparent"||n==="none")return!1;let s=$M.get(i);if(s==null){try{s=Oe.fromString(i).a===1}catch{s=!1}$M.set(i,s)}return s}function lE(t,e){return t!=="cutout"?t:oE(e)?"cutout":"overlay"}function UM(t,e,i){for(const n of e??[])switch(typeof t){case"string":if(n.itemId===t)return n;if(n.itemId===void 0&&i!==void 0){const s=n.datum?.[i];if(s!=null&&String(s)===t)return n}break;case"number":if(n.datumIndex===t||n.itemId===void 0&&i!==void 0&&n.datum?.[i]===t)return n;break;default:return t}}function cE(t,e,i){const n=Am(t,i.datum,i.movedBounds);if(n!=null)return{x:n.canvasX,y:n.canvasY};const s=i.bounds;if(s!=null){if(s instanceof U){const{x:r,y:a}=s.computeCenter();return{x:e.x+r,y:e.y+a}}return Ze.toCanvas(s).computeCenter()}}function Tm({bounds:t}){return t instanceof U?t:t!=null?Ze.toCanvas(t):U.NaN}function hE(t,e,i){const{x:n,y:s}=cE(t,e,i)??{};if(n!==void 0&&s!==void 0)return{type:"keyboard",canvasX:n,canvasY:s}}var WM=class{constructor(t){this.count=0,this.selection=new Uint8Array(t)}select(t){const e=1-this.selection[t];return this.count+=e,this.selection[t]=1,e}deselect(t){const e=-this.selection[t];return this.count+=e,this.selection[t]=0,e}toggle(t){const e=1-2*this.selection[t];return this.count+=e,this.selection[t]^=1,e}isSelected(t){return this.selection[t]===1}isNotSelected(){return this.count===0}isAllSelected(){return this.count===this.selection.length}selectRange(t,e){if(t>e)return 0;let i;return this.isAllSelected()?i=0:this.isNotSelected()?i=e-t:i=e-t-this.countRange(t,e),this.count+=i,this.selection.fill(1,t,e),i}deselectRange(t,e){if(t>e)return 0;let i;return this.isNotSelected()?i=0:this.isAllSelected()?i=-(e-t):i=-this.countRange(t,e),this.count+=i,this.selection.fill(0,t,e),i}countRange(t,e){let i=0;for(let n=t;n<e;n++)i+=this.selection[n];return i}clear(){this.count=0,this.selection.fill(0)}applyDataChange(t){this.selection=t.applyToTypedArray(this.selection),this.count=this.countRange(0,this.selection.length)}getLength(){return this.selection.length}getSelectedCount(){return this.count}getSelection(){return this.selection}},jc=class mh{constructor(e,i){this.data=e,this.dataIdKey=i,this.pendingTransactions=[],this.selections=new Map}static empty(e){return new mh([],e)}static wrap(e,i){return new mh(e,i)}netSize(){if(!this.hasPendingTransactions())return this.data.length;const e=this.getChangeDescription();return e?e.indexMap.finalLength:this.data.length}addTransaction(e){const i=this.normalizeTransaction(e);this.pendingTransactions.push(i),this.cachedChangeDescription=void 0}deepClone(){const e=new mh([...this.data],this.dataIdKey);return e.transferFrom(this),e}static replaceWith(e,i,n){const s=new mh(i,n);return e&&s.transferFrom(e),s}enableSelection(e){let i=this.selections.get(e);return i||(i=new WM(this.data.length),this.selections.set(e,i)),i}getIdArray(){if(this.dataIdKey!=null){if(this.idArrayCache===void 0){this.idArrayCache=[];for(let e=0;e<this.data.length;e++)this.idArrayCache.push(this.getIdValue(this.data[e]))}return this.idArrayCache}}getItemIdFromIndex(e){const i=this.data.at(e);return(i?this.getIdValue(i):void 0)??e}getIndexFromItemId(e){return typeof e=="number"?!Number.isInteger(e)||e<0||e>=this.data.length?void 0:e:this.getIdToIndexMap().get(e)}transferFrom(e){if(e.selections.size===0)return;const i=e.getIdArray();if(!i){if(e.data.length===this.data.length)for(const[s,r]of e.selections)this.selections.set(s,r);return}if(!this.dataIdKey||this.dataIdKey!==e.dataIdKey)return;const n=this.getIdToIndexMap();for(const[s,r]of e.selections){const a=r.getSelection(),o=new Set;for(let c=0;c<a.length;c++){const h=i[c];a[c]&&h!=null&&o.add(h)}if(o.size===0)continue;const l=this.enableSelection(s);for(const c of o){const h=n.get(c);h!=null&&l.select(h)}}}normalizeTransaction(e){const{add:i,addIndex:n,prepend:s,append:r,remove:a,update:o}=e;if(i===void 0)return e;const l={remove:a,update:o};if(s&&(l.prepend=s),r&&(l.append=r),i&&i.length>0){const c=this.netSize();n===void 0||n>=c?l.append=r?[...r,...i]:i:n===0?l.prepend=s?[...i,...s]:i:l.insertions=[{index:n,items:i}]}return l}hasPendingTransactions(){return this.pendingTransactions.length>0}getPendingTransactionCount(){return this.pendingTransactions.length}commitPendingTransactions(){if(this.dataIdKey!=null&&this.data.length>0&&this.getIdToIndexMap(),!this.hasPendingTransactions())return!1;const e=this.getChangeDescription();if(!e)return!1;const i=e.getPrependedValues(),n=e.getInsertionValues(),s=e.getAppendedValues(),r=[...i,...n,...s];let a=0;if(e.applyToArray(this.data,function(l){if(a>=r.length)throw new Error(`AG Charts - Internal error: No insertion value found for index ${l}`);return r[a++]}),this.cachedPendingReplacements&&this.cachedPendingReplacements.size>0){const{updatedIndices:o}=e.indexMap;for(const l of o){const c=this.getIdValue(this.data[l]);c!==void 0&&this.cachedPendingReplacements.has(c)&&(this.data[l]=this.cachedPendingReplacements.get(c))}}if(this.pendingTransactions=[],this.cachedChangeDescription=void 0,this.cachedPendingReplacements=void 0,this.updateItemToIndexCache(e,s,i,n),this.updateIdToIndexCache(e,s,i,n),this.selections.size>0)for(const o of this.selections.values())o.applyDataChange(e);if(this.idArrayCache){e.applyToArray(this.idArrayCache,l=>this.getIdValue(this.data[l]));const{updatedIndices:o}=e.indexMap;for(const l of o)this.idArrayCache[l]=this.getIdValue(this.data[l])}return!0}updateItemToIndexCache(e,i,n,s){if(!this.itemToIndexCache)return;if(this.dataIdKey){this.itemToIndexCache=void 0;return}const{indexMap:r}=e,{totalPrependCount:a,totalAppendCount:o,removedIndices:l}=r,c=l.size>0,h=s.length>0;if(!c&&a===0&&o===0&&!h)return;if(h){this.itemToIndexCache=void 0;return}const u=xm(l);if(c&&u===0){this.itemToIndexCache=void 0;return}const d=this.itemToIndexCache,g=a-u;if(g!==0)for(const[f,m]of d)l.has(m)?d.delete(f):d.set(f,m+g);else if(c)for(const[f,m]of d)l.has(m)&&d.delete(f);for(let f=0;f<n.length;f++){const m=n[f];d.has(m)||d.set(m,f)}const p=r.finalLength-o;for(let f=0;f<i.length;f++){const m=i[f];d.has(m)||d.set(m,p+f)}}updateIdToIndexCache(e,i,n,s){if(!this.idToIndexCache)return;const{indexMap:r}=e,{totalPrependCount:a,totalAppendCount:o,removedIndices:l}=r,c=l.size>0,h=s.length>0;if(!c&&a===0&&o===0&&!h)return;if(h){this.idToIndexCache=void 0;return}const u=xm(l);if(c&&u===0){this.idToIndexCache=void 0;return}const d=this.idToIndexCache,g=a-u;if(g!==0)for(const[f,m]of d)l.has(m)?d.delete(f):d.set(f,m+g);else if(c)for(const[f,m]of d)l.has(m)&&d.delete(f);for(let f=n.length-1;f>=0;f--){const m=this.getIdValue(n[f]);m!==void 0&&d.set(m,f)}const p=r.finalLength-o;for(let f=0;f<i.length;f++){const m=this.getIdValue(i[f]);m!==void 0&&!d.has(m)&&d.set(m,p+f)}}clearPendingTransactions(){const e=this.pendingTransactions.length;return this.pendingTransactions=[],this.cachedChangeDescription=void 0,this.cachedPendingReplacements=void 0,e}getPendingTransactions(){return[...this.pendingTransactions]}toJSON(){return this.data}getChangeDescription(){if(!this.hasPendingTransactions())return;if(this.cachedChangeDescription)return this.cachedChangeDescription;const{indexMap:e,prependValues:i,appendValues:n,insertionValues:s,pendingReplacements:r}=this.buildIndexMap(),a=new NO(e,{prependValues:i,appendValues:n,insertionValues:s});return this.cachedChangeDescription=a,this.cachedPendingReplacements=r,a}removeFromGroups(e,i){for(const n of e){let s=0;for(;s<n.length&&i.size>0;)i.has(n[s])?(i.delete(n[s]),n.splice(s,1)):s++;if(i.size===0)break}}buildIndexMap(){const e=this.data.length,i=this.collectTransactionEffects(),n=i.prependsList.flat(),s=i.appendsList.flat(),r=i.insertionsList.flat(),a=n.length,o=s.length,l=r.length,c=e-i.removedOriginalIndices.size,h=a+c+l+o,u=i.removedOriginalIndices.size>0?this.getSortedRemovedIndices(i.removedOriginalIndices):void 0,d=this.buildSpliceOperations(a,l,o,c,i.trackedInsertions,u?.desc,u?.asc),g=this.resolveUpdatedIndices(a,l,c,i.updateTracking,u?.asc,i.updatedOriginalIndices,i.trackedInsertions);return{indexMap:{originalLength:e,finalLength:h,spliceOps:d,removedIndices:i.removedOriginalIndices,updatedIndices:g,totalPrependCount:a,totalAppendCount:o},prependValues:n,appendValues:s,insertionValues:r,pendingReplacements:i.pendingReplacements}}getSortedRemovedIndices(e){const i=Array.from(e).sort((n,s)=>n-s);return{asc:i,desc:[...i].reverse()}}collectTransactionEffects(){const e={prependsList:[],appendsList:[],insertionsList:[],trackedInsertions:[],removedOriginalIndices:new Set,updatedOriginalIndices:new Set,virtualLength:this.data.length};for(const i of this.pendingTransactions){const{prepend:n,append:s,insertions:r,remove:a,update:o}=i;this.applyPrepends(n,e),this.applyInsertions(r,e),this.applyAppends(s,e),this.applyRemovals(a,e),this.applyUpdates(o,e)}return{prependsList:e.prependsList,appendsList:e.appendsList,insertionsList:e.insertionsList,trackedInsertions:e.trackedInsertions,removedOriginalIndices:e.removedOriginalIndices,updatedOriginalIndices:e.updatedOriginalIndices,updateTracking:e.updateTracking,pendingReplacements:e.pendingReplacements}}applyPrepends(e,i){!Array.isArray(e)||e.length===0||(i.prependsList.unshift([...e]),i.virtualLength+=e.length)}applyInsertions(e,i){if(Array.isArray(e))for(const{index:n,items:s}of e)n>=0&&n<=i.virtualLength&&s.length>0&&(i.trackedInsertions.push({virtualIndex:n,items:[...s]}),i.insertionsList.push([...s]),i.virtualLength+=s.length)}applyAppends(e,i){!Array.isArray(e)||e.length===0||(i.appendsList.push([...e]),i.virtualLength+=e.length)}applyRemovals(e,i){!Array.isArray(e)||e.length===0||(this.dataIdKey?this.applyRemovalsById(e,i):this.applyRemovalsByRef(e,i))}applyRemovalsByRef(e,i){const n=new Set(e);if(this.removeFromGroups(i.prependsList,n),n.size>0&&this.removeFromGroups(i.insertionsList,n),i.trackedInsertions.length>0&&this.removeFromTrackedInsertions(e,i),n.size>0&&this.removeFromGroups(i.appendsList,n),n.size>0)for(let s=0;s<this.data.length&&n.size>0;s++){const r=this.data[s];n.has(r)&&(i.removedOriginalIndices.add(s),n.delete(r),i.virtualLength--)}n.size>0&&j.warnOnce("applyTransaction() remove includes items not present in current data; ignoring missing items.")}applyRemovalsById(e,i){const n=new Set;for(const s of e){const r=this.getIdValue(s);r===void 0?j.warnOnce(`applyTransaction() remove item is missing '${this.dataIdKey}' field; ignoring.`):n.add(r)}if(n.size!==0){if(this.removeFromGroupsById(i.prependsList,n),n.size>0&&this.removeFromGroupsById(i.insertionsList,n),i.trackedInsertions.length>0&&this.removeFromTrackedInsertionsById(e,i),n.size>0&&this.removeFromGroupsById(i.appendsList,n),n.size>0){const s=this.getIdToIndexMap();for(const r of n){const a=s.get(r);a!==void 0&&(i.removedOriginalIndices.add(a),i.virtualLength--,n.delete(r))}}n.size>0&&j.warnOnce("applyTransaction() remove includes items not present in current data; ignoring missing items.")}}applyUpdates(e,i){!Array.isArray(e)||e.length===0||(this.dataIdKey?this.applyUpdatesById(e,i):this.applyUpdatesByRef(e,i))}applyUpdatesByRef(e,i){const n=new Set(e),s=this.collectUpdatedIndicesFromGroups(i.prependsList,n),r=n.size>0?this.collectUpdatedIndicesFromGroups(i.insertionsList,n):[],a=n.size>0?this.collectUpdatedIndicesFromGroups(i.appendsList,n):[];n.size>0&&this.collectUpdatedOriginalIndices(n,i),i.updateTracking={updatedPrependsIndices:s,updatedAppendsIndices:a,updatedInsertionsIndices:r},n.size>0&&j.warnOnce("applyTransaction() update includes items not present in current data; ignoring missing items.")}applyUpdatesById(e,i){const n=new Map;for(const o of e){const l=this.getIdValue(o);l===void 0?j.warnOnce(`applyTransaction() update item is missing '${this.dataIdKey}' field; ignoring.`):n.set(l,o)}if(n.size===0)return;const s=this.collectUpdatedIndicesFromGroupsById(i.prependsList,n),r=n.size>0?this.collectUpdatedIndicesFromGroupsById(i.insertionsList,n):[],a=n.size>0?this.collectUpdatedIndicesFromGroupsById(i.appendsList,n):[];n.size>0&&this.collectUpdatedOriginalIndicesById(n,i),i.updateTracking={updatedPrependsIndices:s,updatedAppendsIndices:a,updatedInsertionsIndices:r},n.size>0&&j.warnOnce("applyTransaction() update includes items not present in current data; ignoring missing items.")}collectUpdatedIndicesFromGroups(e,i){if(i.size===0||e.length===0)return[];const n=[];let s=0;for(const r of e){for(const a of r)i.has(a)&&(n.push(s),i.delete(a)),s++;if(i.size===0)break}return n}getItemToIndexMap(){if(this.itemToIndexCache===void 0){this.itemToIndexCache=new Map;for(let e=0;e<this.data.length;e++)this.itemToIndexCache.has(this.data[e])||this.itemToIndexCache.set(this.data[e],e)}return this.itemToIndexCache}getIdValue(e){if(this.dataIdKey==null||e==null||typeof e!="object")return;const i=e[this.dataIdKey];if(typeof i=="string"||typeof i=="number"&&!Number.isNaN(i))return i}getIdToIndexMap(){if(this.idToIndexCache===void 0){this.idToIndexCache=new Map;for(let e=0;e<this.data.length;e++){const i=this.getIdValue(this.data[e]);i!==void 0&&(this.idToIndexCache.has(i)?j.warnOnce(`dataIdKey '${this.dataIdKey}' has duplicate value '${i}'; first occurrence used.`):this.idToIndexCache.set(i,e))}this.idToIndexCache.size===0&&this.data.length>0&&j.warnOnce(`dataIdKey '${this.dataIdKey}' was not found on any data item.`)}return this.idToIndexCache}removeFromGroupsById(e,i){for(const n of e){let s=0;for(;s<n.length&&i.size>0;){const r=this.getIdValue(n[s]);r!==void 0&&i.has(r)?(i.delete(r),n.splice(s,1)):s++}if(i.size===0)break}}collectUpdatedIndicesFromGroupsById(e,i){if(i.size===0||e.length===0)return[];const n=[];let s=0;for(const r of e){for(let a=0;a<r.length;a++){const o=this.getIdValue(r[a]);o!==void 0&&i.has(o)&&(r[a]=i.get(o),n.push(s),i.delete(o)),s++}if(i.size===0)break}return n}collectUpdatedOriginalIndicesById(e,i){const n=this.getIdToIndexMap();for(const[s,r]of e){const a=n.get(s);a!==void 0&&!i.removedOriginalIndices.has(a)&&(i.updatedOriginalIndices.add(a),i.pendingReplacements??(i.pendingReplacements=new Map),i.pendingReplacements.set(s,r),e.delete(s))}}collectUpdatedOriginalIndices(e,i){const n=this.getItemToIndexMap();for(const s of e){const r=n.get(s);r!==void 0&&!i.removedOriginalIndices.has(r)&&(i.updatedOriginalIndices.add(r),e.delete(s))}}removeFromTrackedInsertions(e,i){for(let n=0;n<i.trackedInsertions.length;n++){const s=i.trackedInsertions[n],r=s.items.length,a=[];let o=0;for(;o<s.items.length;)e.includes(s.items[o])?(a.push(o+a.length),s.items.splice(o,1),i.virtualLength--):o++;a.length>0&&this.adjustLaterInsertionsAfterRemoval(i.trackedInsertions,n,s,r,a)}}removeFromTrackedInsertionsById(e,i){const n=new Set;for(const s of e){const r=this.getIdValue(s);r!==void 0&&n.add(r)}if(n.size!==0)for(let s=0;s<i.trackedInsertions.length;s++){const r=i.trackedInsertions[s],a=r.items.length,o=[];let l=0;for(;l<r.items.length;){const c=this.getIdValue(r.items[l]);c!==void 0&&n.has(c)?(o.push(l+o.length),r.items.splice(l,1),i.virtualLength--,n.delete(c)):l++}if(o.length>0&&this.adjustLaterInsertionsAfterRemoval(i.trackedInsertions,s,r,a,o),n.size===0)break}}adjustLaterInsertionsAfterRemoval(e,i,n,s,r){const a=r.length;for(let o=i+1;o<e.length;o++){const l=e[o];if(l.virtualIndex<=n.virtualIndex)continue;const c=Math.min(Math.max(l.virtualIndex-n.virtualIndex,0),s);let h=0;for(const u of r)if(u<c)h++;else break;c===s&&(h=a),h>0&&(l.virtualIndex-=h)}}buildSpliceOperations(e,i,n,s,r,a,o){const l=[];if(e>0&&l.push({index:0,deleteCount:0,insertCount:e}),a&&a.length>0){let c=a[0],h=1;for(let u=1;u<a.length;u++){const d=a[u];a[u-1]-d===1?h++:(l.push({index:c-h+1+e,deleteCount:h,insertCount:0}),c=d,h=1)}l.push({index:c-h+1+e,deleteCount:h,insertCount:0})}if(r.length>0)for(const c of r){const h=this.countRemovalsBeforeIndex(o,e,c.virtualIndex),u=c.virtualIndex-h;l.push({index:u,deleteCount:0,insertCount:c.items.length})}return n>0&&l.push({index:e+s+i,deleteCount:0,insertCount:n}),l}countRemovalsBeforeIndex(e,i,n){if(!e||e.length===0)return 0;let s=0;for(const r of e)if(r+i<n)s++;else break;return s}resolveUpdatedIndices(e,i,n,s,r,a,o){const l=new Set;if(s)for(const c of s.updatedPrependsIndices)l.add(c);if(a.size>0){const c=Array.from(a).sort((u,d)=>u-d);let h=0;for(const u of c){if(r)for(;h<r.length&&r[h]<u;)h++;const d=r?h:0,g=u+e;let p=0;for(const m of o)m.virtualIndex<=g&&(p+=m.items.length);const f=u+e-d+p;l.add(f)}}if(s){const c=e+n+i;for(const h of s.updatedAppendsIndices)l.add(c+h);if(s.updatedInsertionsIndices.length>0&&o.length>0){let h=0;for(const u of o){const d=this.countRemovalsBeforeIndex(r,e,u.virtualIndex),g=u.virtualIndex-d;for(let p=0;p<u.items.length;p++)s.updatedInsertionsIndices.includes(h)&&l.add(g+p),h++}}}return l}},KM=class{constructor(){this.eventListeners=new Map}addEventListener(t,e){if(typeof e!="function")throw new TypeError("AG Charts - listener must be a Function");const i=this.eventListeners.get(t);i?i.add(e):this.eventListeners.set(t,new Set([e]))}removeEventListener(t,e){const i=this.eventListeners.get(t);i!=null&&(i.delete(e),i.size===0&&this.eventListeners.delete(t))}hasEventListener(t){return this.eventListeners.has(t)}clearEventListeners(){this.eventListeners.clear()}fireEvent(t){const e=this.eventListeners.get(t.type);if(e)for(const i of e)i(t)}};function Dd(t,e){if(t.itemId!==void 0)return t.itemId;if(e!==void 0){const i=t.datum?.[e];if(i!=null)return typeof i=="number"?i:String(i)}return typeof t.datumIndex=="number"?t.datumIndex:JSON.stringify(t.datumIndex)}function Lm(t,e){return t.series===e.series&&st(t.datumIndex,e.datumIndex)}function uE(t,e){return e==null?-1:t.findIndex(i=>Lm(i,e))}var dE=class{constructor(t,e){this.activeManager=t,this.tooltipProperties=e,this.candidates=[],this.blockEntrance=!1,this.activationPrevented=!1}clear(){this.candidates.length=0,this.pendingPickedNodes=void 0}popPendingPickedNodes(){const t=this.pendingPickedNodes;return this.pendingPickedNodes=void 0,t}getActivationArgs(t){if(t===void 0)return[void 0,void 0];{const e=t.series.id,i=Dd(t,t.series.data?.dataIdKey);return[{type:"series-node",seriesId:e,itemId:i},t]}}maybeActivate(t,e,i){if(this.blockEntrance)throw new Error("PickManager.maybeActivate is not re-entrant");try{this.activationPrevented=!1,this.blockEntrance=!0;const[n,s]=this.getActivationArgs(t);this.activeManager.update(n,s)?this.activationPrevented=!0:(this.active=t,e(i?.defaultCbArg))}finally{this.blockEntrance=!1}}onClearUI(){this.activeManager.clear(),this.clear()}onClearAPI(){this.clear()}onPickedNodesHighlight(t){if(t!==void 0){const i=this.active;if(this.tooltipProperties.pagination&&i!==void 0){const n=t.matches.find(s=>Lm(s,i));if(n)return n}}return t?.matches[0]}onPickedNodesTooltip(t){if(t!==void 0&&this.tooltipProperties.pagination){const i=this.active,n=t.matches;this.candidates=n;let s=uE(n,i);s===-1&&(s=0);const r=n[s],a={index:s,length:n.length};return{active:r,paginationState:a}}return{active:t?.matches[0]}}onPickedNodesAPI(t){return this.pendingPickedNodes=t,t.matches[0]}onPickedNodesAPIDebounced(){return{active:this.onPickedNodesHighlight(this.popPendingPickedNodes())}}nextCandidate(){if(this.tooltipProperties.pagination){const{candidates:t}=this,e=this.active,i=e==null?-1:t.findIndex(a=>Lm(a,e));if(i===-1)return{active:void 0,paginationState:void 0};let n=i+1;n>=t.length&&(n=0);const s=t[n],r={index:n,length:this.candidates.length};return{active:s,paginationState:r}}return{active:this.active}}wasActivationPrevented(){return this.activationPrevented}},Ci=class extends Cf{constructor(){super(...arguments),this.enabled=!0,this.shape="circle",this.size=0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}onChangeDetection(t){this._cachedStyle=void 0,super.onChangeDetection(t)}getStyle(){if(this._cachedStyle!==void 0)return this._cachedStyle;const{size:t,shape:e,fill:i,fillOpacity:n,stroke:s,strokeWidth:r,strokeOpacity:a,lineDash:o,lineDashOffset:l}=this,c={size:t,shape:e,fill:i,fillOpacity:n,stroke:s,strokeWidth:r,strokeOpacity:a,lineDash:o,lineDashOffset:l};return this._cachedStyle=c,c}getDiameter(){return this.size+this.strokeWidth}};x([I,Z()],Ci.prototype,"enabled",2),x([I,ha({equals:Ro})],Ci.prototype,"shape",2),x([I,Z()],Ci.prototype,"size",2),x([I,ha({equals:st})],Ci.prototype,"fill",2),x([I,Z()],Ci.prototype,"fillOpacity",2),x([I,Z()],Ci.prototype,"stroke",2),x([I,Z()],Ci.prototype,"strokeWidth",2),x([I,Z()],Ci.prototype,"strokeOpacity",2),x([I],Ci.prototype,"lineDash",2),x([I],Ci.prototype,"lineDashOffset",2),x([I,ha({equals:Ro})],Ci.prototype,"itemStyler",2);function gE(t,e,i,n,s){return{size:t?.size??e?.size??i.size,shape:t?.shape??e?.shape??i.shape??n.shape??s?.shape,fill:t?.fill??e?.fill??i.fill??n.fill??s?.fill,fillOpacity:t?.fillOpacity??e?.fillOpacity??i.fillOpacity??n.fillOpacity??s?.fillOpacity,stroke:t?.stroke??e?.stroke??i.stroke??n.stroke??s?.stroke,strokeWidth:t?.strokeWidth??e?.strokeWidth??i.strokeWidth??n.strokeWidth??s?.strokeWidth,strokeOpacity:t?.strokeOpacity??e?.strokeOpacity??i.strokeOpacity??n.strokeOpacity??s?.strokeOpacity,lineDash:t?.lineDash??e?.lineDash??i.lineDash??n.lineDash??s?.lineDash,lineDashOffset:t?.lineDashOffset??e?.lineDashOffset??i.lineDashOffset??n.lineDashOffset??s?.lineDashOffset,opacity:t?.opacity??e?.opacity??s?.opacity}}function pE(t,e){return t==null?e:{size:t.size??e.size,shape:t.shape??e.shape,fill:t.fill??e.fill,fillOpacity:t.fillOpacity??e.fillOpacity,stroke:t.stroke??e.stroke,strokeWidth:t.strokeWidth??e.strokeWidth,strokeOpacity:t.strokeOpacity??e.strokeOpacity,lineDash:t.lineDash??e.lineDash,lineDashOffset:t.lineDashOffset??e.lineDashOffset,opacity:t.opacity??e.opacity}}var YM=(t=>(t[t.EXACT_SHAPE_MATCH=0]="EXACT_SHAPE_MATCH",t[t.NEAREST_NODE=1]="NEAREST_NODE",t[t.AXIS_ALIGNED=2]="AXIS_ALIGNED",t))(YM||{}),fE=.25,mE=.125,Cd=class{constructor(t,e,i,n,s){this.type=t,this.event=e,this.defaultPrevented=!1,this.datum=i.datum,this.seriesId=n.id,this.dataIdKey=n.data?.dataIdKey,this.itemId=Dd(i,this.dataIdKey),this.selectionState=s}preventDefault(){this.defaultPrevented=!0}},Nm=class{constructor(t,e){this.series=t,this.seriesGrouping=e,this.type="groupingChanged"}};function ZM(t){switch(t){case"x":return"x";case"y":return"y";case"angle":return"angle";case"radius":return"radius"}}function Om(t){switch(t){case"x":return"x";case"y":return"y";case"angle":return"angle";case"radius":return"radius";default:return"x"}}var Hc=class extends KM{constructor(t){super(),this.cleanup=new nt,this.usesPlacedLabels=!1,this.alwaysClip=!1,this.supportsStandaloneZoom=!1,this.hasChangesOnHighlight=!1,this.hasChangesOnSelection=!1,this.seriesGrouping=void 0,this.NodeEvent=Cd,this.internalId=Nn(this),this.contentGroup=new $t({name:`${this.internalId}-content`,zIndex:1}),this.highlightGroup=new $t({name:`${this.internalId}-highlight`,zIndex:1}),this.highlightNodeGroup=this.highlightGroup.appendChild(new ne({name:`${this.internalId}-highlight-node`})),this.highlightLabelGroup=this.highlightGroup.appendChild(new ne({name:`${this.internalId}-highlight-label`,zIndex:2})),this.annotationGroup=new $t({name:`${this.internalId}-annotation`}),this.labelGroup=new $t({name:`${this.internalId}-series-labels`}),this.axes={},this.directions=["x","y"],this.nodeDataRefresh=!0,this.processedDataUpdated=!0,this.moduleMap=new sm,this.datumCallbackCache=new Map,this.connectsToYAxis=!1,this.declarationOrder=-1,this._broughtToFront=!1,this.events=new ms,this._pickNodeCache=new Dh(5),this.fireEventWrapper=c=>super.fireEvent(c);const{moduleCtx:e,pickModes:i,propertyKeys:n={},propertyNames:s={},canHaveAxes:r=!1,usesPlacedLabels:a=!1,alwaysClip:o=!1,supportsStandaloneZoom:l=!1}=t;this.ctx=e,this.propertyKeys=n,this.propertyNames=s,this.canHaveAxes=r,this.usesPlacedLabels=a,this.pickModes=i,this.alwaysClip=o,this.supportsStandaloneZoom=l,this.highlightLabelGroup.pointerEvents=1,this.cleanup.register(this.ctx.eventsHub.on("data:update",c=>this.setChartData(c)),this.ctx.eventsHub.on("highlight:change",c=>this.onChangeHighlight(c)),this.events.on("data-selection-change",()=>{this.hasChangesOnSelection=!0,this.bucketLookup?.refresh()}))}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(t){this.properties.visible=t,this.ctx.legendManager?.toggleItem(t,this.id),this.visibleMaybeChanged()}get visible(){return this.ctx.legendManager?.getSeriesEnabled(this.id)??this.properties.visible}get hasData(){const t=this.data;return t==null?!1:t.netSize()>0}get tooltipEnabled(){return this.properties.tooltip?.enabled}onDataChange(){this.nodeDataRefresh=!0,this.processedDataUpdated=!0,this._pickNodeCache.clear()}setOptionsData(t){this._data=t,this.onDataChange()}isHighlightEnabled(){return this.properties.highlight.enabled}setChartData(t){this._chartData=t,this.data===t&&this.onDataChange()}onSeriesGroupingChange(t,e){const{internalId:i,type:n,visible:s}=this;t&&this.ctx.seriesStateManager.deregisterSeries(this),e&&this.ctx.seriesStateManager.registerSeries({internalId:i,type:n,visible:s,seriesGrouping:e,width:"width"in this.properties?this.properties.width:0}),this.fireEvent(new Nm(this,e))}getBandScalePadding(){return{inner:1,outer:0}}attachSeries(t,e,i){t.appendChild(this.contentGroup),e.appendChild(this.highlightGroup),e.appendChild(this.labelGroup),i?.appendChild(this.annotationGroup)}detachSeries(t,e,i){this.contentGroup.remove(),this.highlightGroup.remove(),this.labelGroup.remove(),this.annotationGroup.remove()}setSeriesIndex(t,e=!1){const i=this.bringToFront();return!e&&t===this.declarationOrder&&i===this._broughtToFront?!1:(this.declarationOrder=t,this._broughtToFront=i,this.setZIndex(i?Number.MAX_VALUE:t),this.fireEvent(new Nm(this,this.seriesGrouping)),!0)}setZIndex(t){this.contentGroup.zIndex=[1,t,0],this.highlightGroup.zIndex=[1,t,1],this.labelGroup.zIndex=[1,t,2],this.annotationGroup.zIndex=t}renderToOffscreenCanvas(){return!1}hasHighlightOpacity(){if(!this.properties.highlight.enabled)return!1;const t=this.ctx.highlightManager.getActiveHighlight();if(t==null||t.series?.isHighlightEnabled()===!1)return!1;const{unhighlightedItem:e,unhighlightedSeries:i}=this.properties.highlight;return km(e)||km(i)}getDrawingMode(t,e="cutout"){return t?e:this.hasHighlightOpacity()?this.ctx.chartService.highlight?.drawingMode??"overlay":"overlay"}getAnimationDrawingModes(){const t=this.getDrawingMode(!1);return{start:{drawingMode:"overlay"},finish:{drawingMode:t}}}addEventListener(t,e){return super.addEventListener(t,e)}removeEventListener(t,e){return super.removeEventListener(t,e)}hasEventListener(t){return super.hasEventListener(t)}updatedDomains(){}destroy(){this.cleanup.flush(),this.resetDatumCallbackCache(),this.ctx.seriesStateManager.deregisterSeries(this),this.moduleContext?.destroy()}getPropertyValues(t,e){const i=ZM(t),n=i==null?t:Om(this.resolveKeyDirection(i)),s=e?.[n],r=[];if(!s)return r;const a=(...o)=>{for(const l of o)Array.isArray(l)?a(...l):typeof l=="object"?a(...Object.values(l)):r.push(l)};return a(...s.map(o=>this.properties[o])),r}getKeyAxis(t){}getKeys(t){return this.getPropertyValues(Om(t),this.propertyKeys)}getKeyProperties(t){return this.propertyKeys[this.resolveKeyDirection(t)]??[]}getNames(t){return this.getPropertyValues(Om(t),this.propertyNames)}getFormatterContext(t){const{id:e}=this,i=this.getPropertyValues(t,this.propertyKeys),n=this.getPropertyValues(t,this.propertyNames),s=[];for(let r=0;r<i.length;r++)s.push({seriesId:e,key:i[r],name:n[r]});return s}resolveKeyDirection(t){return t}getDomain(t){const e=this.getSeriesDomain(t),i=this.moduleMap.mapModules(n=>n.getDomain(t)).flat();return i.length===0?e:{domain:e.domain.concat(i)}}getRange(t,e){return this.getSeriesRange(t,e)}getMinimumRangeSeries(t){}getMinimumRangeChart(t){return 0}getZoomRangeFittingItems(t,e,i){}getVisibleItems(t,e,i){return 1/0}toCanvasFromMidPoint(t){const{x:e=0,y:i=0}=t.midPoint??{};return Ze.toCanvasPoint(this.contentGroup,e,i)}markNodeDataDirty(){this.nodeDataRefresh=!0,this._pickNodeCache.clear(),this.visibleMaybeChanged()}visibleMaybeChanged(){const{internalId:t,seriesGrouping:e,type:i,visible:n}=this;this.ctx.seriesStateManager.updateSeries({internalId:t,type:i,visible:n,seriesGrouping:e,width:"width"in this.properties?this.properties.width:0})}getOpacity(){if(!this.properties.highlight)return 1;const{opacity:e=1}=this.getHighlightStyle();return e}getHighlightState(t,e,i,n){return this.properties.highlight.enabled?e?1:t?.series==null||t.series.isHighlightEnabled()===!1?0:this.isSeriesHighlighted(t,n)?this.isItemHighlighted(t,i)==null?2:4:3:0}getDataSelectionState(t){}createBucketLookupFeature(){}ensureBucketLookupFeature(){if(this.bucketLookup===void 0){const t=this.createBucketLookupFeature();t&&(this.bucketLookup=t,t.refresh())}return this.bucketLookup}getHighlightStateString(t,e,i,n){return wa(this.getHighlightState(t,e,i,n))}getSelectionStateString(t,e){if(e??(e=this.getDataSelectionState(t)),e!==void 0)return ka(e)}onChangeHighlight(t){const e=t.previousHighlight,i=t.currentHighlight,n=this.getHighlightState(i),s=this.getHighlightState(e);this.setSeriesIndex(this.declarationOrder);const r=this.hasItemStylers();if(!r&&n===s){this.hasChangesOnHighlight=!1;return}const{highlightedSeries:a,unhighlightedItem:o,unhighlightedSeries:l}=this.properties.highlight;this.hasChangesOnHighlight=r||!Rl(a)||!Rl(o)||!Rl(l)}bringToFront(){return this.hasDataSelection()?!0:this.properties.highlight.enabled&&this.properties.highlight.bringToFront&&this.isSeriesHighlighted(this.ctx.highlightManager.getActiveHighlight())}isSeriesHighlighted(t,e){return this.properties.highlight.enabled?t?.series===this:!1}isItemHighlighted(t,e){if(!(t?.datumIndex==null||e==null))return t.datumIndex===e}getDataSelectionCount(){return this.data?.selections?.get(this.id)?.getSelectedCount()??0}hasDataSelection(){return this.getDataSelectionCount()>0}getHighlightStyle(t,e,i,n){if(i===void 0){const s=this.ctx.highlightManager?.getActiveHighlight();i=this.getHighlightState(s,t,e,n)}return this.properties.highlight.getStyle(i)}getSelectionStyle(t,e){if(e??(e=this.getDataSelectionState(t)),e!==void 0)return this.properties.selection.getStyle(e)}resolveMarkerDrawingModeForState(t,e){return lE(t,e)}filterItemStylerFillParams(t){return qi(t)?Y(t,["bounds","colorSpace","gradient","reverse"]):As(t)?Y(t,["padding"]):t}getModuleTooltipParams(){return this.moduleMap.mapModules(t=>t.getTooltipParams()).reduce((t,e)=>Object.assign(t,e),{})}pickNodes(t,e,i=!1){const{pickModes:n,pickModeAxis:s,visible:r,contentGroup:a}=this;if(!r||!a.visible)return;let o=1/0;if(e==="tooltip"||e==="highlight-tooltip"){const{tooltip:d}=this.properties;o=typeof d.range=="number"?d.range:1/0,i||(i=d.range==="exact")}else if(e==="event"||e==="context-menu"){const{nodeClickRange:d}=this.properties;o=typeof d=="number"?d:1/0,i||(i=d==="exact")}const l=n.filter(d=>!i||d===0),{x:c,y:h}=t,u=JSON.stringify({x:c,y:h,maxDistance:o,selectedPickModes:l});if(this._pickNodeCache.has(u))return this._pickNodeCache.get(u);for(const d of l){let g;switch(d){case 0:{const p=this.pickNodesExactShape(t);g=p.length===0?void 0:{datums:p,distance:0};break}case 1:{const p=this.pickNodeClosestDatum(t),f=p?.distance===0?this.pickNodesExactShape(t):void 0;f!=null&&f.length!==0?g={datums:f,distance:0}:p?g={datums:[p.datum],distance:p.distance}:g=void 0;break}case 2:{const p=s==null?void 0:this.pickNodeMainAxisFirst(t,s==="main-category");g=p==null?void 0:{datums:[p.datum],distance:p.distance};break}}if(g&&g.distance<=o)return this._pickNodeCache.set(u,{pickMode:d,datums:g.datums,distance:g.distance})}return this._pickNodeCache.set(u,void 0)}pickNodesExactShape(t){const e=[];for(const i of this.contentGroup.pickNodes(t.x,t.y)){const n=i.unsafeClosestDatum();typeof n=="object"&&n!=null&&n.missing!==!0&&e.push(n)}return e}pickNodeClosestDatum(t){throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented")}pickNodeNearestDistantObject(t,e){const i=Ru(t.x,t.y,e),n=i.nearest?.unsafeClosestDatum();if(typeof n=="object"&&n!=null&&n.missing!==!0)return{datum:n,distance:Math.sqrt(i.distanceSquared)}}pickNodeMainAxisFirst(t,e){throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented")}*pickNodesInBBox(t){function*e(n,s){for(const r of n.children())if(r.datum!=null&&typeof r.datum=="object"&&"datumIndex"in r.datum){const a=s(r);a!==void 0&&(yield a)}else r instanceof ne&&(yield*e(r,s))}const i=(()=>{const{containment:n}=this.properties.selection,s=r=>r;switch(n){case"any":return Cu;case"all":return tc;default:return s(n)}})();yield*e(this.contentGroup,n=>{const{x:s,y:r,width:a,height:o}=n.getBBox();if(i(t,s,r,a,o))return n.unsafeDatum})}getLabelData(){return[]}updatePlacedLabelData(t){}fireEvent(t){dn([this.properties,this.ctx.chartService],this.fireEventWrapper,t)}fireNodeClickEvent(t,e){const i=this.getSelectionStateString(e.datumIndex),n=new this.NodeEvent("seriesNodeClick",t,e,this,i);return this.fireEvent(n),!n.defaultPrevented}fireNodeDoubleClickEvent(t,e){const i=this.getSelectionStateString(e.datumIndex),n=new this.NodeEvent("seriesNodeDoubleClick",t,e,this,i);return this.fireEvent(n),!n.defaultPrevented}createNodeContextMenuActionEvent(t,e){const i=this.getSelectionStateString(e.datumIndex);return new this.NodeEvent("nodeContextMenuAction",t,e,this,i)}onLegendInitialState(t,e){const{visible:i=!0,itemId:n,legendItemName:s}=e??{};this.toggleSeriesItem(i,t,n,s)}onLegendItemClick(t){const{enabled:e,itemId:i,series:n,legendType:s}=t,r="legendItemName"in this.properties?this.properties.legendItemName:void 0,a="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,o=r!=null&&r===t.legendItemName;(n.id===this.id||o||a!=null)&&this.toggleSeriesItem(e,s,i,r,t)}onLegendItemDoubleClick(t){const{enabled:e,itemId:i,series:n,numVisibleItems:s,legendType:r}=t,a="legendItemName"in this.properties?this.properties.legendItemName:void 0,o="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,l=a!=null&&a===t.legendItemName;n.id===this.id||l||o!=null?this.toggleSeriesItem(!0,r,i,a,t):e&&s===1?this.toggleSeriesItem(!0,r,void 0,a):this.toggleSeriesItem(!1,r,void 0,a)}toggleSeriesItem(t,e,i,n,s){const r=this.id;(t||e!=="category")&&(this.visible=t),this.nodeDataRefresh=!0,this._pickNodeCache.clear();const a={type:"seriesVisibilityChange",seriesId:r,itemId:i,legendItemName:s?.legendItemName??n,visible:t};this.fireEvent(a),this.ctx.legendManager?.toggleItem(t,r,i,n)}isEnabled(){return this.visible}getModuleMap(){return this.moduleMap}createModuleContext(){return this.moduleContext??(this.moduleContext=this.ctx.child().constant("series",this)),this.moduleContext}getAxisValueText(t,e,i,n,s,r,a){const{id:o,properties:l}=this;return t.formatDatum(l,i,e,o,r,n,s,void 0,void 0,void 0,a)}getLabelText(t,e,i,n,s,r,a,o=!1){if(t==null&&!o)return"";const{axes:l,canHaveAxes:c,ctx:h,id:u,properties:d}=this,g="series-label",p="legendItemName"in d?d.legendItemName:void 0,f={seriesId:this.id,...a},m=c?ZM(n):void 0,y=m==null?void 0:l[this.resolveKeyDirection(m)];if(y!=null)return y.formatDatum(d,t,g,u,p,e,i,s,r,f,o);const{formatManager:b}=h,v=this.callWithContext.bind(this),S=C=>r.formatValue(v,C.type,C.value,f)??b.format(v,C)??(t==null?"":String(t)),M=this.getFormatterContext(n);switch(n){case"y":case"color":case"size":return S({type:"number",value:t,datum:e,seriesId:u,legendItemName:p,key:i,source:g,property:n,domain:s,boundSeries:M,fractionDigits:void 0,visibleDomain:void 0});case"x":case"radius":case"angle":case"label":case"secondaryLabel":case"calloutLabel":case"sectorLabel":case"legendItem":return S({type:"category",value:t,datum:e,seriesId:u,legendItemName:p,key:i,source:g,property:n,domain:s,boundSeries:M})}}getMarkerStyle(t,{datumIndex:e,datum:i,point:n},s,r,a={size:n?.size??t.size??0},o){const{itemStyler:l}=t,{highlightState:c,isHighlight:h=!1,checkForHighlight:u=!0,resolveMarkerSubPath:d=["marker"],resolveStyler:g=!1,hideWithSize0:p=!1}=r??{},f=r?.selectionState??this.getDataSelectionState(e);if(p&&jM(f))return{size:0};let m;const y=()=>m??(m=["series",`${this.declarationOrder}`,...d]);if(g){const M={permissivePath:!0},C=this.ctx.optionsGraphService.resolvePartial(y(),a,M);C&&(a={...C,size:C.size??a.size})}const b=u?this.getHighlightStyle(h,e,c):void 0,v=u&&this.properties.selection.enabled?this.getSelectionStyle(e,f):void 0;let S=gE(v,b,a,t.getStyle(),o);if(l&&s){const M=c===void 0?this.getHighlightStateString(this.ctx.highlightManager?.getActiveHighlight(),h,e):wa(c),C=f===void 0?void 0:ka(f),D=this.filterItemStylerFillParams(S.fill),A=this.cachedCallWithContext(l,{seriesId:this.id,...S,fill:D,...s,highlightState:M,selectionState:C,datum:i}),w=this.ctx.optionsGraphService.resolvePartial(y(),A);S=pE(w,S)}return S}applyMarkerStyle(t,e,i,n,{applyTranslation:s=!0,selected:r=!0}={}){const{shape:a,size:o=0}=t,l=this.visible&&o>0&&i&&!Number.isNaN(i.x)&&!Number.isNaN(i.y);if(e.setStyleProperties(t,n),e.setVisibilityAndPosition(!!l,a,o,s?i:void 0),r||(e.fillOpacity*=fE,e.strokeOpacity*=mE),typeof a=="function"&&!e.dirtyPath){e.path.clear(!0),e.updatePath(),e.checkPathDirty();const c=e.getBBox();if(i!=null&&c.isFinite()){const h=c.computeCenter(),[u,d]=["x","y"].map(g=>(t.strokeWidth??0)+Math.abs(h[g]-i[g]));i.focusSize=Math.max(c.width+u,c.height+d)}}}runMarkerStylePass(t,e,i,n,s,r,a){const o=s?new Map:null,l=this.ctx.highlightManager.getActiveHighlight(),c=this,h=c;t.each(function(d,g){if(t.isGarbage(d))return;const p=c.getHighlightState(l,e,g.datumIndex),f=c.getDataSelectionState(g.datumIndex),m=n===void 0?"":`:${n(g)}`,y=`${p}:${f??"-"}${m}`;let b=o?.get(y);b===void 0&&(b=r(h,i,p,f,g),o?.set(y,b)),a(h,i,g,p,f,b)})}static assignCachedStyle(t,e,i,n,s,r){i.style=r}get nodeDataDependencies(){return this._nodeDataDependencies??{seriesRectWidth:Number.NaN,seriesRectHeight:Number.NaN}}checkResize(t){const{width:e,height:i}=t??{width:Number.NaN,height:Number.NaN},n=t?{seriesRectWidth:e,seriesRectHeight:i}:void 0,s=es(this.nodeDataDependencies,n)!=null;return s&&(this._nodeDataDependencies=n,this.markNodeDataDirty()),s}pickFocus(t){}pickViewportFocus(t){}mapFocusBBoxToPanTarget(t,e){return e}resetDatumCallbackCache(){this.datumCallbackCache.clear()}cachedDatumCallback(t,e){const{datumCallbackCache:i}=this,n=i.get(t);if(n!=null)return n;try{const s=e();return i.set(t,s),s}catch(s){j.error(String(s))}}cachedCallWithContext(t,e){return this.ctx.callbackCache.call([this.properties,this.ctx.chartService],t,e)}callWithContext(t,e){return dn([this.properties,this.ctx.chartService],t,e)}formatTooltipWithContext(t,e,i){return t.formatTooltip([this.properties,this.ctx.chartService],e,i)}minTimeInterval(){}needsDataModelDiff(){return!this.ctx.animationManager.isSkipped()||!!this.chart?.flashOnUpdateEnabled}};Hc.className="Series",x([ui({changeValue:function(t,e){this.onSeriesGroupingChange(e,t)}})],Hc.prototype,"seriesGrouping",2);var Em=class extends Hc{constructor({clipFocusBox:t,categoryKey:e,...i}){super(i),this.categoryKey=e,this.clipFocusBox=t??!0}dataCount(){return this.processedData?.dataSources?.get(this.id)?.data?.length??0}invalidDataCount(){return this.processedData?.invalidDataCount?.get(this.id)??0}missingDataCount(){return this.dataModel?.resolveMissingDataCount(this)??0}get hasData(){return Math.max(0,this.dataCount()-this.invalidDataCount()-this.missingDataCount())>0}getScaleInformation({xScale:t,yScale:e}){const i=Ve.is(t),n=Ve.is(e);return{isContinuousX:i,isContinuousY:n,xScaleType:t?.type,yScaleType:e?.type}}getModulePropertyDefinitions(){const t=this.axes.x?.scale,e=this.axes.y?.scale;return this.moduleMap.mapModules(i=>i.getPropertyDefinitions(this.getScaleInformation({xScale:t,yScale:e}))).flat()}async requestDataModel(t,e,i){i.props.push(...this.getModulePropertyDefinitions());const{dataModel:n,processedData:s}=await t.request(this.id,e??jc.empty(),i);return this.dataModel=n,this.processedData=s,this.events.emit("data-processed",{dataModel:n,processedData:s}),{dataModel:n,processedData:s}}isProcessedDataAnimatable(){const{processedData:t,ctx:e}=this;if(!t)return!1;const i=this.getNodeData();if(i!=null&&i.length>e.animationManager.maxAnimatableItems)return!1;const n=t.reduced?.animationValidation;if(!n)return!0;const{orderedKeys:s,uniqueKeys:r}=n;return s&&r}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}findNodeDatum(t){return UM(t,this.getNodeData(),this.data?.dataIdKey)}pickFocus(t){const e=this.getNodeData();if(e===void 0||e.length===0)return;const i=this.computeFocusDatumIndex(t,e);if(i===void 0)return;const{clipFocusBox:n}=this,s=e[i],r={...t,datumIndex:i},a=this.computeFocusBounds(r);if(a!==void 0)return{bounds:a,clipFocusBox:n,datum:s,datumIndex:i}}pickNodesExactShape(t){const e=super.pickNodesExactShape(t);return e.sort((i,n)=>i.datumIndex-n.datumIndex),e}isDatumEnabled(t,e){const{missing:i=!1,enabled:n=!0,focusable:s=!0}=t[e];return!i&&n&&s}computeFocusDatumIndex(t,e){const i=(a,o)=>{for(;a>=0&&!this.isDatumEnabled(e,a);)a+=o;return a===-1?void 0:a},n=(a,o)=>{for(;a<e.length&&!this.isDatumEnabled(e,a);)a+=o;return a===e.length?void 0:a};let s;const r=te(0,t.datumIndex,e.length-1);return t.datumIndexDelta<0?s=i(r,t.datumIndexDelta):t.datumIndexDelta>0?s=n(r,t.datumIndexDelta):s=n(r,1)??i(r,-1),s===void 0?t.datumIndexDelta===0?void 0:t.datumIndex-t.datumIndexDelta:s}dataModelPropertyIsKey(t){const{processedData:e}=this;return e?e.defs.keys.some(i=>i.id===t&&i.idsMap?.get(this.id)?.has(t)===!0):!1}keysOrValues(t){const{dataModel:e,processedData:i}=this;return!e||!i?[]:this.dataModelPropertyIsKey(t)?e.resolveKeysById(this,t,i):e.resolveColumnById(this,t,i)}sortOrder(t){const{dataModel:e,processedData:i}=this;if(!(!e||!i))return this.dataModelPropertyIsKey(t)?e.getKeySortOrder(this,t,i):e.getColumnSortOrder(this,t,i)}getCategoryKey(){return this.categoryKey}getCategoryValue(t){const{processedData:e,dataModel:i}=this,n=this.getCategoryKey();return!e||!i||!n||(e.invalidData?.get(this.id)?.[t]??!1)?void 0:this.keysOrValues(n)[t]}datumIndexForCategoryValue(t){const{processedData:e,dataModel:i}=this,n=this.getCategoryKey();if(!e||!i||!n)return;t=t.valueOf();const s=e.invalidData?.get(this.id),r=this.keysOrValues(n);for(let a=0;a<r.length;a+=1){if(s?.[a]===!0)continue;const o=r[a]?.valueOf();if(st(t,o))return a}}getDataSelectionState(t){if(!this.properties.selection.enabled)return;const e=this.ctx.chartState.getValue("selectionState");if(e===void 0||!this.ctx.chartState.getValue("options")?.selection?.enabled)return;if(e.selectedCount===0)return 0;const s=this.data?.selections.get(this.id);return typeof t=="number"?this.ensureBucketLookupFeature()?.isBucketSelected(t)??s?.isSelected(t)??!1?1:2:3}},tl={x:["xKey"],y:["yKey"]},il={x:["xName"],y:["yName"]},Rm=class extends Cd{constructor(t,e,i,n,s){super(t,e,i,n,s),this.xKey=n.properties.xKey,this.yKey=n.properties.yKey}},Fn=class extends mn{constructor(){super(...arguments),this.xKeyAxis="x",this.yKeyAxis="y",this.pickOutsideVisibleMinorAxis=!1,this.segmentation=new Md}};x([I],Fn.prototype,"xKeyAxis",2),x([I],Fn.prototype,"yKeyAxis",2),x([I],Fn.prototype,"legendItemName",2),x([I],Fn.prototype,"pickOutsideVisibleMinorAxis",2),x([I],Fn.prototype,"segmentation",2);var Pm=100,kr=class extends Em{constructor({pathsPerSeries:t=["path"],pathsZIndexSubOrderOffset:e=[],datumSelectionGarbageCollection:i=!0,animationAlwaysUpdateSelections:n=!1,animationAlwaysPopulateNodeData:s=!1,segmentedDataNodes:r=!0,animationResetFns:a,propertyKeys:o,propertyNames:l,...c}){if(super({propertyKeys:o,propertyNames:l,canHaveAxes:!0,...c}),this.NodeEvent=Rm,this.dataNodeGroup=this.contentGroup.appendChild(new fM({name:`${this.id}-series-dataNodes`,zIndex:1})),this.labelGroup=this.contentGroup.appendChild(new $t({name:`${this.id}-series-labels`})),this.labelSelection=St.select(this.labelGroup,_i),this.highlightSelection=St.selectNoInference(this.highlightNodeGroup,()=>this.nodeFactory()),this.highlightLabelSelection=St.select(this.highlightLabelGroup,_i),this.annotationSelections=new Set,this.seriesBelowStackContext=void 0,this.debug=ue.create(),!o||!l)throw new Error(`Unable to initialise series type ${this.type}`);this.opts={pathsPerSeries:t,pathsZIndexSubOrderOffset:e,propertyKeys:o,propertyNames:l,animationResetFns:a,animationAlwaysUpdateSelections:n,animationAlwaysPopulateNodeData:s,datumSelectionGarbageCollection:i,segmentedDataNodes:r},this.paths=t.map(h=>new um({name:`${this.id}-${h}`})),this.datumSelection=St.selectNoInference(this.dataNodeGroup,()=>this.nodeFactory(),i),this.animationState=new oc("empty",{empty:{update:{target:"ready",action:h=>this.animateEmptyUpdateReady(h)},reset:"empty",skip:"ready",disable:"disabled"},ready:{updateData:"waiting",clear:"clearing",highlight:h=>this.animateReadyHighlight(h),resize:h=>this.animateReadyResize(h),reset:"empty",skip:"ready",disable:"disabled"},waiting:{update:{target:"ready",action:h=>{this.ctx.animationManager.isSkipped()?this.resetAllAnimation(h):this.animateWaitingUpdateReady(h)}},reset:"empty",skip:"ready",disable:"disabled"},disabled:{update:h=>this.resetAllAnimation(h),reset:"empty"},clearing:{update:{target:"empty",action:h=>this.animateClearingUpdateEmpty(h)},reset:"empty",skip:"ready"}},this.checkProcessedDataAnimatable.bind(this)),this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",h=>this.onLegendItemClick(h)),this.ctx.eventsHub.on("legend:item-double-click",h=>this.onLegendItemDoubleClick(h)))}get contextNodeData(){return this._contextNodeData}getNodeData(){return this.contextNodeData?.nodeData}getKeyAxis(t){if(this.shouldFlipXY()){if(t==="x")return this.properties.yKeyAxis;if(t==="y")return this.properties.xKeyAxis}if(t==="x")return this.properties.xKeyAxis;if(t==="y")return this.properties.yKeyAxis}attachSeries(t,e,i){super.attachSeries(t,e,i),this.attachPaths(this.paths)}detachSeries(t,e,i){super.detachSeries(t,e,i),this.detachPaths(this.paths)}updatedDomains(){this.animationState.transition("updateData")}attachPaths(t){for(const e of t)this.contentGroup.appendChild(e)}detachPaths(t){for(const e of t)e.remove()}renderToOffscreenCanvas(){const t=this.getNodeData();return t!=null&&t.length>Pm}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"?this.animationState.transition("skip"):t==="disabled"&&this.animationState.transition("disable")}destroy(){super.destroy(),this._contextNodeData=void 0}isSeriesHighlighted(t){if(!this.properties.highlight.enabled)return!1;const{series:e,legendItemName:i}=t??{},{legendItemName:n}=this.properties;return e===this||n!=null&&n===i}strokewidthChange(){const t=("strokeWidth"in this.properties&&this.properties.strokeWidth)??0,e=this.properties.highlight.highlightedSeries.strokeWidth??t,i=this.properties.highlight.highlightedItem?.strokeWidth??t;return t>i||e>i}update({seriesRect:t}){const{_contextNodeData:e}=this,i=this.checkResize(t),n=this.updateHighlightSelection(),s=this;this.contentGroup.batchedUpdate(function(){const o=s.updateSelections(),l=s.contextNodeData?.segments;s.opts.segmentedDataNodes?s.dataNodeGroup.segments=l??s.dataNodeGroup.segments:s.dataNodeGroup.segments=void 0,s.updateNodes(n,i||o)});const r=this.getAnimationData(t,e);r&&(i&&this.animationState.transition("resize",r),this.animationState.transition("update",r),this.processedDataUpdated=!1)}createStackContext(){}canIncrementallyUpdateNodes(t=!1){if(this.contextNodeData?.nodeData==null)return!1;const{processedData:i}=this;return i?i.changeDescription!=null||!fn(i)||t:!1}trimIncrementalNodeArray(t,e){e<t.length&&(t.length=e)}createNodeData(){const t=this.validateCreateNodeDataPreconditions();if(!t)return;const{xAxis:e,yAxis:i}=t,n=this.createNodeDatumContext(e,i);if(!n)return this.getEmptyResult();const s=this.initializeResult(n);return!this.visible&&(this.seriesGrouping==null&&!this.opts.animationAlwaysPopulateNodeData||!n.animationEnabled)?s:(this.populateNodeData(n),this.finalizeNodeData(n),this.assembleResult(n,s))}createNodeDatumContext(t,e){throw new Error(`${this.constructor.name}: createNodeDatumContext() must be implemented when using the template method pattern`)}populateNodeData(t){throw new Error(`${this.constructor.name}: populateNodeData() must be implemented when using the template method pattern`)}initializeResult(t){throw new Error(`${this.constructor.name}: initializeResult() must be implemented when using the template method pattern`)}validateCreateNodeDataPreconditions(){const t=this.axes.x,e=this.axes.y;if(!(!t||!e||!this.dataModel||!this.processedData))return{xAxis:t,yAxis:e}}getEmptyResult(){}finalizeNodeData(t){t.canIncrementallyUpdate&&this.trimIncrementalNodeArray(t.nodes,t.nodeIndex)}assembleResult(t,e){return e}updateSelections(){var t;const e=!this.opts.animationAlwaysUpdateSelections&&this.ctx.animationManager.isSkipped();if(!this.visible&&e)return this._contextNodeData&&(this._contextNodeData.visible=!1),!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 n=this.isProcessedDataAnimatable();if(this._contextNodeData){(t=this._contextNodeData).animationValid??(t.animationValid=n);const a=this._contextNodeData.nodeData?.length;a!=null&&js.record(`${this.type}:nodeData`,a)}const{dataModel:s,processedData:r}=this;s!==void 0&&r!==void 0&&this.events.emit("data-update",{dataModel:s,processedData:r}),this.updateSeriesSelections()}return i}updateSeriesSelections(){const{datumSelection:t,labelSelection:e,paths:i}=this,n=this._contextNodeData;if(!n)return;const{nodeData:s,labelData:r,itemId:a}=n;this.updatePaths({itemId:a,contextData:n,paths:i}),this.datumSelection=this.updateDatumSelection({nodeData:s,datumSelection:t}),this.labelGroup.batchedUpdate(()=>{this.labelSelection=this.updateLabelSelection({labelData:r,labelSelection:e})??e})}getShapeFillBBox(){const{axes:t}=this,e=t.x,i=t.y,[n,s]=At(e?.range??[0,1]),[r,a]=At(i?.range??[0,1]),o=Il(this.getSeriesDomain("x")),l=[e?.scale.convert(o.at(0)),e?.scale.convert(o.at(-1))],c=Il(this.getSeriesDomain("y")),h=[i?.scale.convert(c.at(0)),i?.scale.convert(c.at(-1))],[u,d]=At(l),[g,p]=At(h);return{axis:new U(n,r,s-n,a-r),series:new U(u,g,d-u,p-g)}}updateNodes(t,e){const{highlightSelection:i,datumSelection:n}=this,s=!this.ctx.animationManager.isSkipped(),r=this.visible&&this._contextNodeData!=null;this.contentGroup.visible=s||r,this.annotationGroup.visible=s||r,this.highlightGroup.visible=(s||r)&&t,this.updateDatumStyles({datumSelection:i,isHighlight:!0});const a=this.ctx.chartService.highlight?.drawingMode??"overlay";this.updateDatumNodes({datumSelection:i,isHighlight:!0,drawingMode:a}),this.highlightLabelGroup.batchedUpdate(()=>{this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})}),this.animationState.transition("highlight",i),this.ctx.eventsHub.emit("highlight:selection-updated",{highlightSelection:i});const{dataNodeGroup:o,labelSelection:l,paths:c,labelGroup:h}=this,{itemId:u}=this.contextNodeData??{};if(this.updatePathNodes({itemId:u,paths:c,visible:r,animationEnabled:s}),o.visible=s||r,h.visible=r,!o.visible)return;this.hasItemStylers()&&this.updateDatumStyles({datumSelection:n,isHighlight:!1});const d=this.strokewidthChange()||this.hasChangesOnHighlight||this.hasChangesOnSelection;this.hasChangesOnSelection=!1,(e||d)&&(this.updateDatumNodes({datumSelection:n,isHighlight:!1,drawingMode:"overlay"}),this.usesPlacedLabels||this.labelGroup.batchedUpdate(()=>{this.updateLabelNodes({labelSelection:l,isHighlight:!1})}))}getHighlightData(t,e){return e?[{...e}]:void 0}getHighlightLabelData(t,e){const i=t.filter(n=>n.datum===e.datum&&n.itemId===e.itemId);return i.length===0?void 0:i}updateHighlightSelection(){const{highlightSelection:t,highlightLabelSelection:e,_contextNodeData:i}=this;if(!i)return!1;const n=this.ctx.highlightManager?.getActiveHighlight(),r=this.isSeriesHighlighted(n)&&n?.datum?n:void 0;if(r==null)return!1;const{nodeData:a,labelData:o}=i,l=this.getHighlightData(a,r);this.highlightSelection=this.updateHighlightSelectionItem({items:l,highlightSelection:t});const c=this.getHighlightLabelData(o,r)??[];return this.highlightLabelSelection=this.updateLabelSelection({labelData:c,labelSelection:e})??e,!0}markQuadtreeDirty(){this.quadtree=void 0}*datumNodesIter(){for(const{node:t}of this.datumSelection)t.datum?.missing!==!0&&(yield t)}getQuadTree(){if(this.quadtree===void 0){const t=this.ctx.scene?.canvas??{width:0,height:0},e=new U(0,0,t.width,t.height);this.quadtree=new mM(100,10,e),this.initQuadTree(this.quadtree)}return this.quadtree}initQuadTree(t){}pickViewportFocus(t){if(this.contextNodeData?.nodeData===void 0)return;const{otherIndex:e,where:i,hoverRect:n}=t;if(i==="data-start")return this.pickFocus({datumIndex:0,datumIndexDelta:0,otherIndex:e,otherIndexDelta:0});if(i==="data-end"){const b=this.contextNodeData.nodeData.length-1;return this.pickFocus({datumIndex:b,datumIndexDelta:0,otherIndex:e,otherIndexDelta:0})}let s,r=0,a,o=this.contextNodeData.nodeData.length-1;const l=this.axes.x?.options.reverse===!0;function c(b){const v=n.x+n.width;return b.x+b.width<=v}function h(b){return b.x>=n.x}function u(b,v){const S=Tm(v);b(S)?(s=v,o=a-1):r=a+1}function d(b,v){const S=Tm(v);b(S)?(s=v,r=a+1):o=a-1}const g={"viewport-start + true":{predicate:c,iterator:u},"viewport-start + false":{predicate:h,iterator:u},"viewport-end + true":{predicate:h,iterator:d},"viewport-end + false":{predicate:c,iterator:d}},{predicate:p,iterator:f}=g[`${i} + ${l}`];let m=0;const y=Math.ceil(Math.log2(this.contextNodeData.nodeData.length))+1;for(;r<=o&&m<=y;){a=Math.floor((r+o)/2);const b=this.pickFocus({datumIndex:a,datumIndexDelta:0,otherIndex:e,otherIndexDelta:0});if(b===void 0){j.error(`pickFocus (datumIndex: ${a}) failed`);return}f(p,b),m++}return s}pickNodeDataExactShape(t){const{x:e,y:i}=t,{dataNodeGroup:n}=this,s=n.pickNodes(e,i).filter(r=>{const{unsafeDatum:a}=r;return a!==void 0&&a?.missing!==!0});if(s.length!==0)return s.map(a=>a.datum)}pickModulesExactShape(t){for(const e of this.moduleMap.modules()){const{unsafeDatum:i}=e.pickNodeExact(t)??{};if(i!=null&&i?.missing!==!0)return[i]}}pickNodesExactShape(t){const e=super.pickNodesExactShape(t);return e.length!==0?e:this.pickNodeDataExactShape(t)??this.pickModulesExactShape(t)??[]}pickNodeDataClosestDatum(t){const{x:e,y:i}=t,{axes:n,_contextNodeData:s}=this;if(!s)return;const r=n.x,a=n.y,o={x:e,y:i};let l=1/0,c;for(const h of s.nodeData){const{point:{x:u=Number.NaN,y:d=Number.NaN}={}}=h;if(Number.isNaN(u)||Number.isNaN(d)||!(r?.inRange(u)&&a?.inRange(d)))continue;const p=Math.max((o.x-u)**2+(o.y-d)**2,0);p<l&&(l=p,c=h)}if(l!=null)return{datum:c,distance:Math.sqrt(l)}}pickModulesClosestDatum(t){let e=1/0,i;for(const n of this.moduleMap.modules()){const s=n.pickNodeNearest(t);s!==void 0&&s.distanceSquared<e&&(e=s.distanceSquared,i=s.unsafeDatum)}if(e!=null)return{unsafeClosestDatum:i,distance:Math.sqrt(e)}}pickNodeClosestDatum(t){let e=1/0,i;const n=this.pickNodeDataClosestDatum(t);n!=null&&n.distance<e&&(e=n.distance,i=n.datum);const s=this.pickModulesClosestDatum(t);if(s!=null&&s.distance<e&&(e=s.distance,i=s.unsafeClosestDatum),i){const r=Math.max(e-(i.point?.size??0)/2,0);return{datum:i,distance:r}}}pickNodeMainAxisFirst(t,e){const{x:i,y:n}=t,{axes:s,_contextNodeData:r}=this,{pickOutsideVisibleMinorAxis:a}=this.properties;if(!r)return;const o=s.x,l=s.y;if(o==null||l==null)return;const c=[o,l].filter(p=>p.isCategoryLike()).map(p=>p.direction);if(e&&c.length===0)return;const[h="x"]=c,u=[i,n];h!=="x"&&u.reverse();const d=[1/0,1/0];let g;for(const p of r.nodeData){const{x:f=Number.NaN,y:m=Number.NaN}=p.point??p.midPoint??{};if(Number.isNaN(f)||Number.isNaN(m)||p.missing===!0)continue;const y=[o?.inRange(f,1),l?.inRange(m,1)];if(h!=="x"&&y.reverse(),!y[0]||!a&&!y[1])continue;const b=[f,m];h!=="x"&&b.reverse();let v=!0;for(let S=0;S<b.length;S++){const M=Math.abs(b[S]-u[S]);if(M>d[S]){v=!1;break}else M<d[S]&&(d[S]=M,d.fill(1/0,S+1,d.length))}v&&(g=p)}if(g){let p=Math.max(d[0]**2+d[1]**2-(g.point?.size??0),0);for(const f of this.moduleMap.modules()){const m=f.pickNodeMainAxisFirst(t,h);if(m!=null&&m.distanceSquared<p){g=m.unsafeDatum,p=m.distanceSquared;break}}return{datum:g,distance:Math.sqrt(p)}}}isPathOrSelectionDirty(){return!1}shouldFlipXY(){return!1}visibleRangeIndices(t,e,i,n){let s;if(n==null){const{processedData:c,dataModel:h}=this;s=h.getColumnSortOrder(this,t,c)??1}else s=n.sortOrder;const r=this.keysOrValues(t),a=0,[o,l]=Gc(s,i?.length??r.length,e,c=>{const h=i?.[c]??c;return this.xCoordinateRange(r[h],a,h)});return o<l?[o,l]:[l,o]}domainForVisibleRange(t,e,i,n,s){const{processedData:r,dataModel:a}=this,[o,l]=n,c=this.keysOrValues(i),h=this.sortOrder(i);if(h!=null){const p=this.visibleRangeIndices(i,n,s,{sortOrder:h});return a.getDomainBetweenRange(this,e,p,r)}const u=e.map(p=>this.keysOrValues(p));let d=1/0,g=-1/0;for(const[p,f]of c.entries()){const[m,y]=this.xCoordinateRange(f,0,p);if(!(y<o||m>l))for(let b=0;b<e.length;b++){const v=u[b][p];typeof v=="number"&&Number.isFinite(v)&&(d=Math.min(d,v),g=Math.max(g,v))}}return d>g?[Number.NaN,Number.NaN]:[d,g]}domainForClippedRange(t,e,i){const{processedData:n,dataModel:s,axes:r}=this,o=yE(r[t==="x"?"y":"x"]);if(!o)return e.flatMap(f=>s.getDomain(this,f,"value",n).domain);const l=this.keysOrValues(i),c=this.sortOrder(i);if(c!=null){const f=bE(c,l.length,o,m=>l[m]);return s.getDomainBetweenRange(this,e,f,n)}const h=e.map(f=>this.keysOrValues(f)),u=o[0].valueOf(),d=o[1].valueOf();let g=1/0,p=-1/0;for(const[f,m]of l.entries()){const y=m.valueOf();if(!(y<u||y>d))for(let b=0;b<e.length;b++){const v=h[b][f];typeof v=="number"&&Number.isFinite(v)&&(g=Math.min(g,v),p=Math.max(p,v))}}return g>p?[Number.NaN,Number.NaN]:[g,p]}zoomFittingVisibleItems(t,e,i,n,s){const{dataModel:r,processedData:a}=this;if(!r||!a)return;const o=this.axes.x;if(n!=null)return;const l=this.sortOrder(t);if(l==null)return;const c=this.keysOrValues(t);if(s>c.length)return{x:[0,1],y:void 0};const h=o.scale,u=h.range;h.range=[0,1];let[d,g]=this.visibleRangeIndices(t,i,void 0,{sortOrder:l});g-=1;const p=0;this.xCoordinateRange(c[d],p,d)[0]<i[0]&&(d+=1),this.xCoordinateRange(c[g],p,g)[1]>i[1]&&(g-=1);let f;if(Math.abs(g-d)>=s-1)f=i;else{const m=(i[0]+i[1])/2;for(;Math.abs(g-d)<s-1&&(d>0||g<c.length-1);)if(d===0)g+=1;else if(g===c.length-1)d-=1;else{const v=this.xCoordinateRange(c[d-1],p,d-1)[0],S=this.xCoordinateRange(c[g+1],p,g+1)[1];Math.abs(v-m)<Math.abs(S-m)?d-=1:g+=1}const y=this.xCoordinateRange(c[d],p,d)[0],b=this.xCoordinateRange(c[g],p,g)[1];f=[Math.min(i[0],y),Math.max(i[1],b)]}return h.range=u,{x:f,y:void 0}}countVisibleItems(t,e,i,n,s){const{dataModel:r,processedData:a}=this;if(!r||!a)return 1/0;const o=this.keysOrValues(t),l=e.map(D=>r.resolveColumnById(this,D,a)),c=this.shouldFlipXY(),h=c?this.axes.y:this.axes.x,u=c?this.axes.x:this.axes.y,d=c?n??[0,1]:i,g=c?i:n??[0,1];if(n==null){const D=this.sortOrder(t);if(D!=null){const A=h.scale,w=A.range;A.range=[0,1];const L=this.keysOrValues(t);let[O,R]=this.visibleRangeIndices(t,d,void 0,{sortOrder:D});if(R-=1,R<O)return 0;const _=0;this.xCoordinateRange(L[O],_,O)[0]<d[0]&&(O+=1),this.xCoordinateRange(L[R],_,R)[1]>d[1]&&(R-=1);const E=Math.abs(R-O)+1;return A.range=w,E}}const p=(D,A,w)=>D[0]+(w-A[0])/(A[1]-A[0])*(D[1]-D[0]),f=h.range.toSorted(),m=u.range.toSorted(),y=p(f,h.visibleRange,d[0]),b=p(f,h.visibleRange,d[1]),v=p(m,u.visibleRange,Math.min(...g)),S=p(m,u.visibleRange,Math.max(...g)),M=Math.round((d[0]+(d[1]-d[0])/2)*o.length),C=0;return rE(0,o.length-1,M,s,D=>{const[A,w]=this.xCoordinateRange(o[D],C,D),[L,O]=this.yCoordinateRange(l.map(R=>R[D]),C,D);return!Ee(A)||!Ee(w)||!Ee(L)||!Ee(O)?!1:A>=y&&w<=b&&L>=v&&O<=S})}minTimeInterval(){let t;try{t=this.keysOrValues("xValue")}catch{}if(t==null||t.length>1e3)return;let e=1/0,i=t[0],n;for(let s=1;s<t.length;s++){const r=t[s];if(r!=null&&i!=null){const a=r.valueOf()-i.valueOf(),o=Math.sign(a);if(o===0)continue;if(n!==void 0&&o!==n)return;e=Math.min(e,Math.abs(a)),n=o}i=r}if(Number.isFinite(e))return e}updateHighlightSelectionItem(t){const{items:e,highlightSelection:i}=t,n=e??[];return this.updateDatumSelection({nodeData:n,datumSelection:i})}updateDatumSelection(t){return t.datumSelection}updateDatumNodes(t){}updateDatumStyles(t){}updatePaths(t){for(const e of t.paths)e.visible=!1}updatePathNodes(t){const{paths:e,visible:i}=t;for(const n of e)n.visible=i}resetPathAnimation(t){const{path:e}=this.opts?.animationResetFns??{};if(e)for(const i of t.paths)Wt([i],e)}resetDatumAnimation(t){const{datum:e}=this.opts?.animationResetFns??{};e&&Wt([t.datumSelection],e)}resetLabelAnimation(t){const{label:e}=this.opts?.animationResetFns??{};e&&Wt([t.labelSelection],e)}resetAllAnimation(t){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.resetPathAnimation(t),this.resetDatumAnimation(t),this.resetLabelAnimation(t),t.contextData?.animationValid===!1&&this.ctx.animationManager.skipCurrentBatch()}animateEmptyUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateWaitingUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateReadyHighlight(t){const{datum:e}=this.opts?.animationResetFns??{};e&&Wt([t],e)}animateReadyResize(t){this.resetAllAnimation(t)}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}getAnimationData(t,e){const{_contextNodeData:i}=this;return i?{datumSelection:this.datumSelection,labelSelection:this.labelSelection,annotationSelections:[...this.annotationSelections],contextData:i,previousContextData:e,paths:this.paths,seriesRect:t}:void 0}updateLabelSelection(t){return t.labelSelection}getScaling(t){if(t instanceof hm){const{range:e,domain:i}=t;return{type:"log",convert:n=>t.convert(n),domain:[i[0],i[1]],range:[e[0],e[1]]}}else if(t instanceof Ve){const{range:e,domain:i}=t;return{type:"continuous",domain:[i[0],i[1]],range:[e[0],e[1]]}}else if(t instanceof En){if(t instanceof Dr){const e=t.getLinearParams(),i=t.getBandCountForUpdate();if(e!=null&&i>0)return{type:"category",variant:"unit-time",firstBandTime:e.firstBandTime,lastBandTime:e.firstBandTime+(i-1)*e.intervalMs,bandCount:i,intervalMs:e.intervalMs,inset:t.inset,step:t.step}}return{type:"category",domain:t.domain,inset:t.inset,step:t.step}}}calculateScaling(){const t={};for(const e of Object.values(fp)){const i=this.axes[e];if(!i)continue;const n=this.getScaling(i.scale);n!=null&&(t[e]=n)}return t}};function yE(t){let e,i;if((t instanceof Es||t instanceof fd)&&({min:e,max:i}=t.options),!(e==null&&i==null))return e??(e=-1/0),i??(i=1/0),[e,i]}function bE(t,e,i,n){const s=i[0].valueOf(),r=i[1].valueOf();let a=xo(0,e-1,l=>{const c=t===1?l:e-l,h=n(c)?.valueOf();return!Number.isFinite(h)||h>=s}),o=vo(0,e-1,l=>{const c=t===1?l:e-l,h=n(c)?.valueOf();return!Number.isFinite(h)||h<=r});return a==null||o==null?[0,0]:(t===-1&&([a,o]=[e-o,e-a]),a=Math.max(a,0),o=Math.min(o+1,e),[a,o])}function XM(t){const e=new Map;for(const i of t){if(!(i instanceof kr))continue;const s=(i.seriesGrouping?.stackCount??0)>0?i.seriesGrouping?.groupIndex:void 0;if(s==null){i.seriesBelowStackContext=void 0,i.createStackContext();continue}const r=`${i.type}-${s}`;let a=e.get(r);a==null&&(a=[],e.set(r,a)),a.push(i)}for(const i of e.values()){i.sort((s,r)=>(s.seriesGrouping?.stackIndex??0)-(r.seriesGrouping?.stackIndex??0));let n;for(const s of i)s.seriesBelowStackContext=n,n=s.createStackContext()}}var vE=class{constructor(){this.available=!0,this.acquireQueue=[]}acquire(t){return new Promise((e,i)=>{this.acquireQueue.push([t,e,i]),this.available&&this.dispatchNext().catch(i)})}async acquireImmediately(t){return this.available?(await this.acquire(t),!0):!1}async waitForClearAcquireQueue(){return this.acquire(()=>Promise.resolve(void 0))}async dispatchNext(){this.available=!1;let[t,e,i]=this.acquireQueue.shift()??[];for(;t;){try{await t(),e?.()}catch(n){i?.(n)}[t,e,i]=this.acquireQueue.shift()??[]}this.available=!0}};function xE(t,e){function i(s,r){return t.requestAnimationFrame(s)}function n(s){t.cancelAnimationFrame(s)}return qM(i,e,n)}function Fm(t){function e(n,s=0){if(s===0){queueMicrotask(n);return}return setTimeout(n,s)}function i(n){clearTimeout(n)}return qM(e,t,i)}function qM(t,e,i){let n=0,s=!1,r,a,o;function l(){return s}function c(){s=!1,o=void 0,a?.(),a=void 0,r=void 0,n>0&&(o=t(h))}function h(){const f=n;n=0,s=!0;const m=e({count:f});if(!m){c();return}m.then(c,c)}function u(f){n===0&&!l()&&(o=t(h,f)),n++}function d(){o!=null&&i&&(i(o),o=void 0,n=0)}async function g(){if(l())for(r??(r=new Promise(p));l();)await r}function p(f){a=f}return{schedule:u,cancel:d,waitForCompletion:g}}var nl=class extends kl{constructor(t){super(),this.ctx=t,this.rectNode=new Tt,this.textNode=new _i,this.fill="white",this.node=this.createNode(),this.node.append([this.rectNode,this.textNode]),this.visible=!0,this.cleanup.register(t.scene.attachNode(this.node),t.eventsHub.on("layout:complete",e=>this.onLayoutComplete(e)))}createNode(){return new ne({name:"background",zIndex:0})}onLayoutComplete(t){const{width:e,height:i}=t.chart;this.rectNode.width=e,this.rectNode.height=i}};x([I,xt("node","visible")],nl.prototype,"visible",2),x([I,xt("rectNode","fill")],nl.prototype,"fill",2),x([I],nl.prototype,"image",2),x([I,xt("textNode")],nl.prototype,"text",2);var Ad=class extends Array{destroy(){for(const t of this)t.destroy();this.length=0}findById(t){return this.find(e=>e.id===t)}matches(t){return this.length===Object.keys(t).length&&nx(t,(e,i)=>he(i)&&"type"in i&&this.findById(e)?.type===i.type)}getById(t){const e=this.findById(t);if(!e)throw new Error(`Could not find axis by id [${t}].`);return e}},SE=class extends Ad{get x(){return this.getById("x")}get y(){return this.getById("y")}perpendicular(t){const e=t.direction==="x"?"y":"x";return this[e]}},ME=class extends Ad{get angle(){return this.getById("angle")}get radius(){return this.getById("radius")}},wd=class{constructor(){this.title=new tt,this.subtitle=new tt,this.footnote=new tt}positionCaptions({layoutBox:t}){const{title:e,subtitle:i,footnote:n}=this,s=t.height/10;e.enabled&&(this.positionCaption("top",e,t,s),this.shrinkLayoutByCaption("top",e,t)),i.enabled&&(this.positionCaption("top",i,t,s),this.shrinkLayoutByCaption("top",i,t)),n.enabled&&(this.positionCaption("bottom",n,t,s),this.shrinkLayoutByCaption("bottom",n,t))}positionAbsoluteCaptions(t){const{title:e,subtitle:i,footnote:n}=this,{rect:s}=t.series;for(const r of[e,i,n])if(r.layoutStyle==="overlay"){if(r.textAlign==="left")r.node.x=s.x+r.padding;else if(r.textAlign==="right"){const a=r.node.getBBox();r.node.x=s.x+s.width-a.width-r.padding}}}computeX(t,e){return t==="left"?e.x:t==="right"?e.x+e.width:e.x+e.width/2}positionCaption(t,e,i,n){if(e.node.x=this.computeX(e.textAlign,i)+e.padding,e.node.y=i.y+(t==="top"?0:i.height)+e.padding,e.node.textBaseline=t,!e.text)return;const{lineMetrics:s}=ce(e.text)?Ds(e.text,e):di(e).measureLines(et(e.text)),r=Math.max(s[0].height,n);e.computeTextWrap(i.width,r)}shrinkLayoutByCaption(t,e,i){if(e.layoutStyle!=="block")return;const n=e.node.getBBox().clone(),{spacing:s=0}=e;n.height===0&&(n.height=di(e).lineHeight(),t==="bottom"&&(n.y-=n.height)),t==="bottom"&&ce(e.text)&&(n.y-=n.height),i.shrink(Math.ceil(t==="top"?n.y-i.y+n.height+s:i.y+i.height-n.y+s),t)}};x([I],wd.prototype,"title",2),x([I],wd.prototype,"subtitle",2),x([I],wd.prototype,"footnote",2);var IE=["candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"],DE=class{constructor(t){this.chartService=t,this.mementoOriginatorKey="chartType"}createMemento(){let t=this.chartService.publicApi?.getOptions()?.chartType;return t??(t="candlestick"),t}guardMemento(t){return t==null||IE.includes(t)}restoreMemento(t,e,i){if(i==null)return;const n={chartType:i};this.chartService.publicApi?.updateDelta(n).catch(s=>j.error("error restoring state",s))}},JM=Symbol("previous-memento-not-found"),CE=class{constructor(t){this.history=[],this.historyIndex=-1,this.originators=new Map,this.clearState=new Map,this.maxHistoryLength=100,this.debug=ue.create(!0,"history"),this.cleanup=new nt,this.cleanup.register(t.eventsHub.on("series:undo",this.undo.bind(this)),t.eventsHub.on("series:redo",this.redo.bind(this)))}destroy(){this.cleanup.flush()}addMementoOriginator(t){this.originators.set(t.mementoOriginatorKey,t),this.clearState.set(t.mementoOriginatorKey,t.createMemento()),this.debugEvent("History add originator:",t.mementoOriginatorKey)}clear(){this.debug("History clear:",Object.keys(this.originators)),this.history=[],this.historyIndex=-1;for(const[t,e]of this.originators.entries())this.clearState.set(t,e.createMemento())}record(t,...e){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 n of e){if(!this.originators.has(n.mementoOriginatorKey))throw new Error(`Originator [${n.mementoOriginatorKey}] has not been added to the HistoryManager.`);i.set(n.mementoOriginatorKey,n.createMemento())}this.history.push({label:t,mementos:i}),this.historyIndex=this.history.length-1,this.debugEvent(`History record: [${t}]`)}undo(){const t=this.history[this.historyIndex];if(t){for(const e of t.mementos.keys()){const i=this.findPreviousMemento(e);if(i===JM)throw new Error(`Could not find previous memento for [${e}].`);this.restoreMemento(e,i)}this.historyIndex-=1,this.debugEvent(`History undo: [${t.label}]`)}}redo(){const t=this.history[this.historyIndex+1];if(t){for(const[e,i]of t.mementos.entries())this.restoreMemento(e,i);this.historyIndex+=1,this.debugEvent(`History redo: [${t.label}]`)}}findPreviousMemento(t){for(let e=this.historyIndex-1;e>=0;e--)if(this.history[e].mementos.has(t))return this.history[e].mementos.get(t);return this.clearState.has(t)?this.clearState.get(t):JM}restoreMemento(t,e){this.originators.get(t)?.restoreMemento(Ye,Ye,e)}debugEvent(...t){this.debug(...t,this.history.map((e,i)=>i===this.historyIndex?`** ${e.label} **`:e.label))}},AE=class{constructor(){this.caretaker=new pp(Ye),this.state=new Map}setState(t,e){st(this.state.get(t.mementoOriginatorKey),e)||this.setStateAndRestore(t,e)}setStateAndRestore(t,e){this.state.set(t.mementoOriginatorKey,e),this.restoreState(t)}restoreState(t){const{caretaker:e,state:i}=this;if(!i.has(t.mementoOriginatorKey))return;const n=i.get(t.mementoOriginatorKey);e.restore({version:e.version,[t.mementoOriginatorKey]:n},t)}},wE=`.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-background{position:absolute}.ag-charts-canvas-center{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{position:absolute;inset:0;pointer-events:none;user-select:none;-webkit-user-select:none}.ag-charts-canvas-overlay>*{position:absolute;pointer-events:auto}.ag-charts-canvas-overlay>[role=presentation]{left:0}.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-color: #e4f2fe;--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-width: 1px;--ag-charts-button-font-weight: normal;--ag-charts-button-text-color: inherit;--ag-charts-input-background-color: #fff;--ag-charts-input-border-width: 1px;--ag-charts-input-text-color: #181d1f;--ag-charts-menu-background-color: #fafafa;--ag-charts-menu-border-width: 1px;--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-width: 1px;--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-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-width: 1px;--ag-charts-border: var(--ag-charts-border-width) 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-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-chevron-filled-down{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMy42NjcgNS4zMzQgOCAxMC42NjdsNC4zMzQtNS4zMzN6IiBmaWxsPSIjMTgxZDFmIi8+PC9zdmc+)}.ag-charts-icon-chevron-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjQ3IDUuNDdhLjc1Ljc1IDAgMCAxIDEuMDYgMGw0IDRhLjc1Ljc1IDAgMCAxIDAgMS4wNmwtNCA0YS43NS43NSAwIDAgMS0xLjA2LTEuMDZMMTAuOTQgMTAgNy40NyA2LjUzYS43NS43NSAwIDAgMSAwLTEuMDYiIGZpbGw9IiMwMDAiLz48L3N2Zz4=)}.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-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-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-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-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-button-border-radius);border-style:solid;border-width:var(--ag-charts-button-border-width);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-inline-start:13px}.ag-charts-select{background:var(--ag-charts-input-background-color);border-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-input-border-radius);border-style:solid;border-width:var(--ag-charts-input-border-width);padding:3px 2px 4px;font-size:inherit}.ag-charts-textarea{--textarea-line-height: 1.38;background:var(--ag-charts-input-background-color);border-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-input-border-radius);border-style:solid;border-width:var(--ag-charts-input-border-width);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[data-focus-override=true],.ag-charts-proxy-elem:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-proxy-elem[data-focus-override=false]{outline:none;box-shadow:none}.ag-charts-proxy-elem svg{display:block}.ag-charts-proxy-scrollbar-slider:focus-visible{outline:none;box-shadow:none}.ag-charts-proxy-scrollbar-thumb-focus{border:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);box-sizing:border-box;opacity:0;pointer-events:none}.ag-charts-proxy-scrollbar-slider:focus-visible~.ag-charts-proxy-scrollbar-thumb-focus{opacity:1}.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-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-tooltip-border-radius);border-style:solid;border-width:var(--ag-charts-tooltip-border-width);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-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-border-radius);border-style:solid;border-width:var(--ag-charts-border-width);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__row[aria-disabled=true]{background:var(--ag-charts-button-disabled-background-color);color:var(--ag-charts-button-disabled-text-color);cursor:default}.ag-charts-menu__label{grid-column:-1 / span 1;text-wrap:nowrap}.ag-charts-toolbar{--toolbar-size: 34px;--toolbar-border-radius: var(--ag-charts-border-radius);--toolbar-button-background-color: var(--ag-charts-chrome-background-color);--toolbar-button-border-color: var(--ag-charts-border-color);--toolbar-button-border-width: var(--ag-charts-button-border-width);--toolbar-button-gap: 0;--toolbar-button-padding: 6px;--toolbar-button-text-color: var(--ag-charts-button-text-color);--toolbar-button-background-color--active: var(--ag-charts-focus-color);--toolbar-button-border-color--active: var(--ag-charts-accent-color);--toolbar-button-text-color--active: var(--ag-charts-accent-color);--toolbar-button-background-color--disabled: var(--ag-charts-button-disabled-background-color);--toolbar-button-border-color--disabled: var(--toolbar-button-border-color);--toolbar-button-text-color--disabled: var(--ag-charts-button-disabled-text-color);--toolbar-button-background-color--hover: var(--ag-charts-focus-color);--toolbar-button-border-color--hover: var(--toolbar-button-border-color);--toolbar-button-text-color--hover: var(--toolbar-button-text-color);align-items:center;display:flex;flex-wrap:nowrap;gap:var(--toolbar-button-gap);position:absolute}.ag-charts-toolbar__button{align-items:center;background:var(--toolbar-button-background-color);border-color:var(--toolbar-button-border-color);border-style:solid;border-width:var(--toolbar-button-border-width);color:var(--toolbar-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(--toolbar-button-background-color--hover);border-color:var(--toolbar-button-border-color--hover);color:var(--toolbar-button-text-color--hover);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,.ag-charts-toolbar__button--active:hover{background:var(--toolbar-button-background-color--active);border-color:var(--toolbar-button-border-color--active);color:var(--toolbar-button-text-color--active);z-index:2}.ag-charts-toolbar__button[aria-disabled=true]{background:var(--toolbar-button-background-color--disabled);border-color:var(--toolbar-button-border-color--disabled);color:var(--toolbar-button-text-color--disabled);cursor:default}.ag-charts-toolbar--horizontal{flex-direction:row;.ag-charts-toolbar__button{border-inline-end-width:0}.ag-charts-toolbar__button--first{border-end-start-radius:var(--toolbar-border-radius);border-start-start-radius:var(--toolbar-border-radius);margin:0}.ag-charts-toolbar__button--last{border-end-end-radius:var(--toolbar-border-radius);border-start-end-radius:var(--toolbar-border-radius);border-inline-end-width:var(--toolbar-button-border-width);margin-inline-end:0}.ag-charts-toolbar__button:hover,.ag-charts-toolbar__button--active,.ag-charts-toolbar__button--active:hover{border-inline-end-width:var(--toolbar-button-border-width);margin-inline-end:calc(-1 * var(--toolbar-button-border-width));&.ag-charts-toolbar__button--last{margin-inline-end:0}}.ag-charts-toolbar__button:hover+.ag-charts-toolbar__button:not(.ag-charts-toolbar__button--active){border-inline-start-color:var(--toolbar-button-border-color--hover)}.ag-charts-toolbar__button--active+.ag-charts-toolbar__button{border-inline-start-color:var(--toolbar-button-border-color--active)}}.ag-charts-toolbar--vertical{flex-direction:column;.ag-charts-toolbar__button{margin:-1px 0 0;max-width:100%}.ag-charts-toolbar__button--first{border-start-start-radius:var(--ag-charts-border-radius);border-start-end-radius:var(--ag-charts-border-radius);margin:0}.ag-charts-toolbar__button--last{border-end-start-radius:var(--ag-charts-border-radius);border-end-end-radius:var(--ag-charts-border-radius)}}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{margin-inline-start:calc(var(--ag-charts-spacing) * 2)}.ag-charts-toolbar__label+.ag-charts-toolbar__icon{margin-inline-start:calc(var(--ag-charts-spacing) * 2)}.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-toolbar__button:hover{border-inline-end-width:0;margin-inline-end:0;+.ag-charts-toolbar__button:not(.ag-charts-toolbar__button--active){border-inline-start-width:var(--toolbar-button-border-width);border-inline-start-color:var(--toolbar-button-border-color--hover)}&.ag-charts-toolbar__button--last{margin-inline-end:0}}.ag-charts-toolbar__button--active,.ag-charts-toolbar__button--active:hover{border-inline-end-width:0;margin-inline-end:0;+.ag-charts-toolbar__button:not(.ag-charts-toolbar__button--active){border-inline-start-width:var(--toolbar-button-border-width);border-inline-start-color:var(--toolbar-button-border-color--active)}&.ag-charts-toolbar__button--last{margin-inline-end:0}}}.ag-charts-floating-toolbar__drag-handle{align-items:center;background:var(--ag-charts-chrome-background-color);border-color:var(--ag-charts-border-color);border-style:solid;border-width:var(--ag-charts-border-width);border-end-start-radius:var(--ag-charts-border-radius);border-start-start-radius:var(--ag-charts-border-radius);border-inline-end-width:0;cursor:grab;display:flex;justify-content:center;min-width:24px;padding-inline-start:0;padding-inline-end:0}.ag-charts-floating-toolbar__drag-handle--dragging{cursor:grabbing}
`,Vm=class{constructor(){this.cleanup=new nt,this.destroyed=!1}destroy(){this.cleanup.flush(),this.destroyed=!0}},kE=class Mg{constructor(e,i,n){this.element=e,this.topTabGuard=i,this.bottomTabGuard=n,this.cleanup=new nt,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",s=>this.onBlur(s),{capture:!0})}set tabIndex(e){this.guardTabIndex=e,this.guardTabIndex===0?this.setGuardIndices(void 0):this.hasFocus||this.setGuardIndices(this.guardTabIndex)}destroy(){this.cleanup.flush()}initTabGuard(e,i){this.cleanup.register(_e(e,"focus",()=>this.onTab(e,i)))}setGuardIndices(e){const i=e;Me(this.topTabGuard,"tabindex",i),Me(this.bottomTabGuard,"tabindex",i)}onFocus(){this.hasFocus=!0,this.guardTabIndex!==0&&this.setGuardIndices(0)}onBlur({relatedTarget:e}){const{topTabGuard:i,bottomTabGuard:n}=this;this.hasFocus=!1,this.guardTabIndex!==0&&e!==i&&e!==n&&this.setGuardIndices(this.guardTabIndex)}onTab(e,i){if(this.guardTabIndex!==0){let n;e.tabIndex===0?(n=this.findExitTarget(!i),this.setGuardIndices(this.guardTabIndex)):n=this.findEnterTarget(i),n?.focus()}}static queryFocusable(e,i){const n=e.ownerDocument.defaultView;return Array.from(e.querySelectorAll(i)).filter(s=>{if(Ja(s)){const r=n.getComputedStyle(s);return r.display!=="none"&&r.visibility!=="none"}return!1})}findEnterTarget(e){const i=Mg.queryFocusable(this.element,'[tabindex="0"]'),n=e?i.length-1:0;return i[n]}findExitTarget(e){const i=Mg.queryFocusable(this.element.ownerDocument.body,"[tabindex]").filter(r=>r.tabIndex>0).sort((r,a)=>r.tabIndex-a.tabIndex),{before:n,after:s}=Mg.findBeforeAndAfter(i,this.guardTabIndex);return e?n:s}static findBeforeAndAfter(e,i){let n=0,s=e.length-1,r,a;for(;n<=s;){const o=Math.floor((n+s)/2),l=e[o].tabIndex;if(l===i){r=e[o-1]||void 0,a=e[o+1]||void 0;break}else l<i?(r=e[o],n=o+1):(a=e[o],s=o-1)}return{before:r,after:a}}},TE=class{constructor(t,e){this.agDocument=t,this.callback=e,this.devicePixelRatioMediaQuery=void 0,this.devicePixelRatioListener=i=>{i.matches||(this.devicePixelRatio=this.agDocument.devicePixelRatio,this.unregisterDevicePixelRatioListener(),this.registerDevicePixelRatioListener(),this.callback(this.pixelRatio))},this.devicePixelRatio=t.devicePixelRatio}get pixelRatio(){return this.devicePixelRatio}observe(){this.registerDevicePixelRatioListener()}disconnect(){this.unregisterDevicePixelRatioListener()}unregisterDevicePixelRatioListener(){this.devicePixelRatioMediaQuery?.removeEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=void 0}registerDevicePixelRatioListener(){const t=this.agDocument.matchMedia(`(resolution: ${this.pixelRatio}dppx)`);t?.addEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=t}},LE=class{constructor(t){this.elements=new Map,this.documentReady=!1,this.queuedObserveRequests=[],this.onLoad=()=>{this.documentReady=!0;for(const[i,n,s]of this.queuedObserveRequests)this.observe(i,n,s);this.queuedObserveRequests=[],this.observeWindow()},this.resizeObserver=t.createResizeObserver(i=>{for(const{target:n,contentRect:{width:s,height:r}}of i){const a=this.elements.get(n);this.checkSize(a,n,s,r)}});let e;this.pixelRatioObserver=new TE(t,()=>{clearTimeout(e),e=setTimeout(()=>this.checkPixelRatio(),0)}),this.documentReady=t.isReady(),this.documentReady?this.observeWindow():this.removeLoadListener=t.attachListener("load",this.onLoad)}destroy(){this.removeLoadListener?.(),this.removeLoadListener=void 0,this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.pixelRatioObserver?.disconnect(),this.pixelRatioObserver=void 0}observeWindow(){this.pixelRatioObserver?.observe()}checkPixelRatio(){const t=this.pixelRatioObserver?.pixelRatio??1;for(const[e,i]of this.elements)if(i.size!=null&&i.size.pixelRatio!==t){const{width:n,height:s}=i.size;i.size={width:n,height:s,pixelRatio:t},i.cb(i.size,e)}}checkSize(t,e,i,n){if(t&&(i!==t.size?.width||n!==t.size?.height)){const s=this.pixelRatioObserver?.pixelRatio??1;t.size={width:i,height:n,pixelRatio:s},t.cb(t.size,e)}}observe(t,e,i){if(!this.documentReady){this.queuedObserveRequests.push([t,e,i]);return}this.elements.has(t)?this.removeFromQueue(t):this.resizeObserver?.observe(t);const n={cb:e};if(this.elements.set(t,n),!i?.skipInitialRead){const s=t.ownerDocument.defaultView?.getComputedStyle(t),r=t.clientWidth-(Number.parseFloat(s?.paddingLeft??"0")+Number.parseFloat(s?.paddingRight??"0")),a=t.clientHeight-(Number.parseFloat(s?.paddingTop??"0")+Number.parseFloat(s?.paddingBottom??"0"));(r>0||a>0)&&this.checkSize(n,t,r,a)}}unobserve(t){this.resizeObserver?.unobserve(t),this.elements.delete(t),this.removeFromQueue(t),this.elements.size||this.destroy()}removeFromQueue(t){this.queuedObserveRequests=this.queuedObserveRequests.filter(([e])=>e!==t)}},kd=class extends Map{constructor(t,e){super(),this.defaultValue=t,this.defaultState=e}set(t,e){return this.delete(t),e!==void 0&&super.set(t,e),delete this.cachedState,delete this.cachedValue,this}delete(t){return delete this.cachedState,delete this.cachedValue,super.delete(t)}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}},NE=["translate"],OE=new Set(["updatePending","animating","sceneRenders","animationTimeMs"]),Td=class{constructor(t,e){this.element=t,this.cache={},this.pendingWrites=new Map,this.deferredMode=e?.deferredMode,this.sizeMonitor=e?.sizeMonitor,this.skipInitialRead=e?.skipInitialRead??!1}get isConnected(){return this.element.isConnected}scheduleFlush(){this.deferredMode?this.deferredMode.scheduleFlush():this.flush()}contains(t){return this.element.contains(t)}addEventListener(t,e,i){this.element.addEventListener(t,e,i)}removeEventListener(t,e,i){this.element.removeEventListener(t,e,i)}get innerHTML(){return this.pendingWrites?this.cache.innerHTML??"":this.element.innerHTML}changed(t,e){return this.cache[t]===e?!1:(this.cache[t]=e,!0)}invalidate(t){delete this.cache[t]}setProperty(t,e){const i=`p:${t}`;if(this.changed(i,e)){if(NE.includes(t)){this.element.style.setProperty(t,e);return}this.pendingWrites.set(i,()=>{this.element.style.setProperty(t,e)}),this.scheduleFlush()}}toggleClass(t,e){const i=`c:${t}`;this.changed(i,e)&&(this.pendingWrites.set(i,()=>{this.element.classList.toggle(t,e)}),this.scheduleFlush())}setAttr(t,e){const i=`a:${t}`;this.changed(i,e)&&(this.pendingWrites.set(i,()=>{e==null?this.element.removeAttribute(t):this.element.setAttribute(t,e)}),this.scheduleFlush())}setData(t,e){const i=`d:${t}`;if(this.changed(i,e)){if(OE.has(t)){this.element.dataset[t]=e;return}this.pendingWrites.set(i,()=>{this.element.dataset[t]=e}),this.scheduleFlush()}}getData(t){const e=`d:${t}`;return this.pendingWrites?this.cache[e]:this.element.dataset[t]}setInnerHTML(t){return this.changed("innerHTML",t)?(this.pendingWrites.set("innerHTML",()=>{this.element.innerHTML=t}),this.scheduleFlush(),this.invalidate("contentStyles"),!0):!1}setContentStyles(t){if(this.changed("contentStyles",JSON.stringify(t))){const e=()=>{const i=this.element.firstElementChild??this.element;Object.assign(i.style,t)};this.pendingWrites.set("contentStyles",e),this.scheduleFlush()}}flush(){if(this.pendingWrites){for(const t of this.pendingWrites.values())t();this.pendingWrites.clear()}}flushKey(t){const e=this.pendingWrites.get(t);e&&(e(),this.pendingWrites.delete(t))}togglePopover(t){t?this.changed("popover",!0)&&(this.pendingWrites.set("popover",()=>{this.element.togglePopover(!0)}),this.scheduleFlush()):(this.pendingWrites.delete("popover"),this.changed("popover",!1)&&this.element.togglePopover(!1))}appendChild(t){this.element.appendChild(t)}set innerText(t){this.element.innerText=t,this.invalidate("innerHTML")}addResizeListener(t){const{sizeMonitor:e,element:i,skipInitialRead:n}=this;if(e==null)throw new Error("AG Charts - addResizeListener requires a SizeMonitor");return e.observe(i,s=>t(s),{skipInitialRead:n}),()=>e.unobserve(i)}reset(){this.cache={}}},EE='<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-background" aria-hidden="true"></div><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>',RE=["styles","canvas","canvas-background","canvas-center","canvas-container","canvas-overlay","canvas-proxy","series-area","tooltip-container"],PE=new Set(["styles","canvas-container","canvas","tooltip-container"]),QM={safeHorizontal:"ag-charts-wrapper--safe-horizontal",safeVertical:"ag-charts-wrapper--safe-vertical"},FE=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 VE(t,e,i){const n=t.createIntersectionObserver(s=>{for(const r of s)r.target===e&&i(r.intersectionRatio)},{root:e});return n?.observe(e),n}var eI={x:0,y:0,width:0,height:0,top:0,bottom:0,left:0,right:0,toJSON(){return eI}};function tI(t,e){const i=ve("div");return i.className="ag-charts-tab-guard",t.insertAdjacentElement(e,i),i}var Ld=class qa extends Vm{constructor(e,i,n,s,r,a,o="normal"){super(),this.eventsHub=e,this.chart=i,this.agDocument=n,this.styleContainer=r,this.skipCss=a,this.mode=o,this.anchorName=`--${Nn(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.cursorState=new kd("default"),this._lastCursor=void 0,this._lastCenterSize=void 0,this.deferredProxies=new Map,this.deferredMode={scheduleFlush:this.scheduleFlush.bind(this)},this.minWidth=0,this.minHeight=0,this._isRtl=!1,this._deferring=!1,this.sizeMonitor=new LE(n),this.element=this.initDOM(),this.elementProxy=new Td(this.element,{deferredMode:this.deferredMode}),this.rootElements=this.initRootElements(),this.rootElements.canvas.element.style.setProperty("anchor-name",this.anchorName),this.sizeMonitor.observe(this.rootElements.canvas.element,()=>this.invalidateRectCaches(),{skipInitialRead:this.mode==="minimal"});let l=!1;if(this.observer=VE(n,this.element,c=>{c===0&&!l&&this.eventsHub.emit("dom:hidden",null),l=c===0}),this.setSizeOptions(),this.updateContainerSize(),this.addStyles("ag-charts-community",wE),this.setContainer(s),this.cleanup.register(Yx(this.element)),this.setupGlobalListeners(),this.mode==="normal"){const c=this.rootElements["canvas-center"].element;if(c==null)throw new Error("Error initializing tab guards");const h=tI(c,"beforebegin"),u=tI(c,"afterend");this.tabGuards=new kE(c,h,u)}}initDOM(){if(this.mode==="normal"){const n=ve("div");return n.innerHTML=EE,n.firstChild}const e=ve("div");e.role="presentation",e.dataset.agCharts="",e.classList.add("ag-charts-wrapper");const i=ve("div");return e.appendChild(i),i.role="presentation",i.classList.add("ag-charts-series-area"),e}initRootElements(){const{mode:e,element:i}=this,n={};for(const s of RE){const r=`ag-charts-${s}`;let a;if(e==="normal"?a=i.classList.contains(r)?i:i.getElementsByClassName(r)[0]:PE.has(s)?a=i:a=i.getElementsByClassName(r)[0]??ve("div"),a==null)throw new Error(`AG Charts - unable to find DOM element ${r}`);n[s]={element:a,children:new Map,listeners:[]}}return n}destroy(){super.destroy(),this.observer?.unobserve(this.element),this.sizeMonitor.unobserve(this.rootElements.canvas.element),this.container&&this.sizeMonitor.unobserve(this.container),this.pendingContainer=void 0;for(const e of Object.values(this.rootElements)){for(const i of e.children.values())i.remove();e.element.remove()}this.element.remove()}scheduleFlush(){this._deferring||this._pendingFlush==null&&(this._pendingFlush=setTimeout(()=>{this._pendingFlush=void 0,!this._deferring&&this.flushDeferredProxies()}))}flushDeferredProxies(){this._pendingFlush!=null&&(clearTimeout(this._pendingFlush),this._pendingFlush=void 0),this.elementProxy.flush();for(const e of this.deferredProxies.values())e.flush();this.updateStylesLocation(),this.mode!=="minimal"&&(this.pendingContainer==null||this.pendingContainer===this.container||(qa.batchedUpdateContainer.length===0&&setTimeout(this.applyBatchedUpdateContainer.bind(this),0),qa.batchedUpdateContainer.push(this)))}applyBatchedUpdateContainer(){for(const e of qa.batchedUpdateContainer)e.destroyed||e.updateContainer();qa.batchedUpdateContainer.splice(0)}updateStylesLocation(){if(!(this.initiallyConnected===!0||this.container?.isConnected===!1)){this.documentRoot=this.getShadowDocumentRoot(this.container),this.initiallyConnected=!0;for(const e of this.rootElements.styles.children.keys())this.removeChild("styles",e);for(const[e,i]of this.styles)this.addStyles(e,i)}}setSizeOptions(e=300,i=300,n,s){const{style:r}=this.element;this.minWidth=n??e,this.minHeight=s??i,r.minWidth=`${this.minWidth}px`,r.minHeight=`${this.minHeight}px`,this.updateContainerClassName()}updateContainerSize(){const e=this.containerSize==null?"hidden":"",i=this.containerSize?`${this.containerSize.width??0}px`:"",n=this.containerSize?`${this.containerSize.height??0}px`:"",s=this._lastCenterSize;if(s==null||s.visibility!==e||s.width!==i||s.height!==n){this._lastCenterSize={visibility:e,width:i,height:n};const{style:r}=this.rootElements["canvas-center"].element;r.visibility=e,r.width=i,r.height=n}this.updateContainerClassName()}setTabGuardIndex(e){this.tabGuards&&(this.tabGuards.tabIndex=e)}setContainer(e){e!==this.container&&(this.pendingContainer=e,(this.mode==="minimal"||this.container==null)&&this.updateContainer())}updateContainer(){const{pendingContainer:e}=this;if(!(e==null||e===this.container)){if(this.container&&(this.element.remove(),this.sizeMonitor.unobserve(this.container)),this.documentRoot!=null)for(const i of this.rootElements.styles.children.keys())this.removeChild("styles",i);this.container=e,this.pendingContainer=void 0,this.agDocument.setContainer(e),this.documentRoot=this.getShadowDocumentRoot(e),this.initiallyConnected=e.isConnected;for(const[i,n]of this.styles)this.addStyles(i,n);e.appendChild(this.element),this.sizeMonitor.observe(e,i=>{this.containerSize=i,this.updateContainerSize(),this.invalidateRectCaches(),this.eventsHub.emit("dom:resize",null)},{skipInitialRead:this.mode==="minimal"}),this.invalidateAllCaches(),this.updateRtl(),this.eventsHub.emit("dom:container-change",null)}}setThemeClass(e){const i="ag-charts-theme-";for(const n of Array.from(this.element.classList))n.startsWith(i)&&n!==e&&this.element.classList.remove(n);this.element.classList.add(e)}setThemeParameters(e){this.setCSSVariables("--ag-charts",void 0,void 0,e)}setModuleCSSVariables(e,i,n,s,r){this.setCSSVariables(`--ag-charts-${e}`,i,n,s,r)}setCSSVariables(e,i,n,s,r){for(const[a,o]of vt(s)){let l=a,c=`${o}`;a.endsWith("Size")||a.endsWith("Radius")||r?.includes(a)?c=`${o}px`:a.endsWith("Border")&&typeof o=="boolean"&&(l=`${a}Width`,c=o?"var(--ag-charts-border-width)":"0"),l=`${e}${i?"__":""}${i??""}-${kv(l)}${n?"--":""}${n??""}`,this.element.style.setProperty(l,c)}}updateCanvasLabel(e){Me(this.rootElements["canvas-proxy"].element,"aria-label",e)}getEventElement(e,i){return["focus","blur","keydown","keyup"].includes(i)?this.rootElements["series-area"].element:e}addEventListener(e,i,n){const s=this.getEventElement(this.element,e);return _e(s,e,i,n)}removeEventListener(e,i,n){this.getEventElement(this.element,e).removeEventListener(e,i,n)}getBoundingClientRect(){return this._cachedCanvasRect??(this._cachedCanvasRect=this.rootElements.canvas.element.getBoundingClientRect()),this._cachedCanvasRect}getOverlayClientRect(){const{innerWidth:e,innerHeight:i}=this.agDocument,n=new U(0,0,e,i),s=this.getRawOverlayClientRect();return n.intersection(s)?.toDOMRect()??eI}findScrollableContainer(){if(this._cachedScrollableContainer!==void 0)return this._cachedScrollableContainer;let e=this.element;const i=this.element.getRootNode()?.fullscreenElement;for(;e!=null;){let n;if(i!=null&&e===i)n=!0;else{const r=e.computedStyleMap?.()?.get("overflow-y")?.toString();n=r==="auto"||r==="scroll"}if(n)return this._cachedScrollableContainer=e,e;e=e.parentElement}return this._cachedScrollableContainer=null,null}getRawOverlayClientRect(){if(this._cachedRawOverlayRect!=null)return this._cachedRawOverlayRect;const e=this.findScrollableContainer();if(e!=null)return this._cachedRawOverlayRect=U.fromObject(e.getBoundingClientRect()),this._cachedRawOverlayRect;if(this.documentRoot!=null)return this._cachedRawOverlayRect=U.fromObject(this.documentRoot.getBoundingClientRect()),this._cachedRawOverlayRect;const{innerWidth:i,innerHeight:n}=this.agDocument;return this._cachedRawOverlayRect=new U(0,0,i,n),this._cachedRawOverlayRect}getShadowDocumentRoot(e=this.container){const i=e?.ownerDocument?.body??this.agDocument.body;for(;e!=null;){if(e===i)return;if(Wb(e.parentNode))return e;e=e.parentNode}}getParent(e){return this.rootElements[e].element}getChildBoundingClientRect(e){const{children:i}=this.rootElements[e],n=[];for(const s of i.values())n.push(U.fromObject(s.getBoundingClientRect()));return U.merge(n)}isManagedChildDOMElement(e,i,n){const{children:s}=this.rootElements[i],r=s?.get(n);return r!=null&&e.contains(r)}contains(e,i){return i==null?this.element.contains(e):this.rootElements[i].element.contains(e)}addStyles(e,i){const n="data-ag-charts";if(this.styles.set(e,i),this.container==null||this.skipCss)return;const s=o=>o.getAttribute(n)===e,r=o=>{const l=new Set(["TITLE","META"]);let c=!0,h;for(const d of o.children){if(c&&l.has(d.tagName)){h=d;continue}if(c=!1,s(d))return;d.hasAttribute(n)&&(h=d)}const u=ve("style");return this.chart.styleNonce!=null&&(u.nonce=this.chart.styleNonce),h==null?o.prepend(u):o.insertBefore(u,h.nextSibling),u};let a;this.styleContainer?a=r(this.styleContainer):this.initiallyConnected===!1?a=this.addChild("styles",e):this.documentRoot==null&&!qa.headStyles.has(e)?(a=r(this.agDocument.head),qa.headStyles.add(e)):this.documentRoot!=null&&(a=this.addChild("styles",e)),!(a==null||s(a))&&(a.setAttribute(n,e),a.innerHTML=i)}removeStyles(e){this.removeChild("styles",e)}updateCursor(e,i){this.cursorState.set(e,i);const n=this.cursorState.stateValue();n!==this._lastCursor&&(this._lastCursor=n,this.element.style.cursor=n)}getCursor(){return this.element.style.cursor}get isRtl(){return this._isRtl}setEnableRtl(e){this.enableRtl=e,this.updateRtl()}updateRtl(){const e=this.enableRtl??(this.mode==="minimal"?!1:no(this.container??this.pendingContainer));e!==this._isRtl&&(this._isRtl=e,this.element.dir=e?"rtl":"ltr",this.eventsHub.emit("rtl:change",null))}addChild(e,i,n,s){const{element:r,children:a,listeners:o}=this.rootElements[e];if(!a)throw new Error("AG Charts - unable to create DOM elements after destroy()");if(a.has(i))return a.get(i);const{childElementType:l="div"}=FE.get(e)??{};if(n&&n.tagName.toLowerCase()!==l.toLowerCase())throw new Error("AG Charts - mismatching DOM element type");const c=n??ve(l);for(const[h,u,d]of o)c.addEventListener(h,u,d);if(a.set(i,c),l==="style"&&this.chart.styleNonce!=null&&(c.nonce=this.chart.styleNonce),s){const h=r.querySelector(s.query);if(h==null)throw new Error(`AG Charts - addChild query failed ${s.query}`);h.insertAdjacentElement(s.where,c)}else r?.appendChild(c);return c}addProxyChild(e,i){const n=this.addChild(e,i),s=this.mode==="minimal";return new Td(n,{sizeMonitor:this.sizeMonitor,skipInitialRead:s})}addDeferredProxyChild(e,i){const n=this.addChild(e,i),s=this.mode==="minimal",r=new Td(n,{deferredMode:this.deferredMode,sizeMonitor:this.sizeMonitor,skipInitialRead:s});return this.deferredProxies.set(`${e}:${i}`,r),r}setDeferring(e){this.mode!=="minimal"&&(this._deferring=e,e||this.flushDeferredProxies())}removeChild(e,i){const{children:n}=this.rootElements[e];n&&(n.get(i)?.remove(),n.delete(i),this.deferredProxies.delete(`${e}:${i}`))}incrementDataCounter(e){const i=this.elementProxy.getData(e)??"0";this.elementProxy.setData(e,String(Number(i)+1))}setDataBoolean(e,i){this.elementProxy.setData(e,String(i))}setDataNumber(e,i){this.elementProxy.setData(e,String(i))}getDocument(){return this.agDocument}invalidateRectCaches(){this._cachedCanvasRect=void 0,this._cachedRawOverlayRect=void 0}invalidateAllCaches(){this.invalidateRectCaches(),this._cachedScrollableContainer=void 0}setupGlobalListeners(){const e=this.element.ownerDocument.defaultView;if(e==null)return;const i=()=>this.invalidateRectCaches(),n=()=>this.invalidateAllCaches();e.addEventListener("scroll",i,{capture:!0,passive:!0}),e.addEventListener("resize",i,{capture:!0,passive:!0}),this.element.ownerDocument.addEventListener("fullscreenchange",n),this.cleanup.register(()=>{e.removeEventListener("scroll",i,{capture:!0}),e.removeEventListener("resize",i,{capture:!0}),this.element.ownerDocument.removeEventListener("fullscreenchange",n)})}updateContainerClassName(){const{element:e,containerSize:i,minWidth:n,minHeight:s}=this;e.classList.toggle(QM.safeHorizontal,n>=(i?.width??1/0)),e.classList.toggle(QM.safeVertical,s>=(i?.height??1/0))}};Ld.className="DOMManager",Ld.batchedUpdateContainer=[],Ld.headStyles=new Set;var iI=Ld;function sl(t,e,i){const{offsetX:n,offsetY:s,clientX:r,clientY:a}=e,{currentX:o,currentY:l}=Tr.calcCurrentXY(i,e);return{type:t,device:"mouse",offsetX:n,offsetY:s,clientX:r,clientY:a,currentX:o,currentY:l,sourceEvent:e}}function Nd(t,e,i){return{type:t,sourceEvent:e}}function y_(){}var nI={change:{isNative:!0,allocator(t,e){return{type:"change",sourceEvent:t}}},blur:{isNative:!0,allocator(t,e){return{type:"blur",sourceEvent:t}}},focus:{isNative:!0,allocator(t,e){return{type:"focus",sourceEvent:t}}},keydown:{isNative:!0,allocator(t){return{type:"keydown",sourceEvent:t}}},keyup:{isNative:!0,allocator(t){return{type:"keyup",sourceEvent:t}}},contextmenu:{isNative:!0,allocator(t,e){return sl("contextmenu",t,e)}},click:{isNative:!0,allocator(t,e){return sl("click",t,e)}},dblclick:{isNative:!0,allocator(t,e){return sl("dblclick",t,e)}},mouseenter:{isNative:!0,allocator(t,e){return sl("mouseenter",t,e)}},mousemove:{isNative:!0,allocator(t,e){return sl("mousemove",t,e)}},mouseleave:{isNative:!0,allocator(t,e){return sl("mouseleave",t,e)}},wheel:{isNative:!0,allocator(t,e){const{offsetX:i,offsetY:n,clientX:s,clientY:r}=t,a=t.deltaMode===0?.01:1;let o=t.deltaX*a,l=t.deltaY*a;return Math.abs(t.deltaX)===0&&t.shiftKey&&([o,l]=[l,o]),{type:"wheel",offsetX:i,offsetY:n,clientX:s,clientY:r,deltaX:o,deltaY:l,sourceEvent:t}}},touchstart:{isNative:!0,allocator(t,e){return Nd("touchstart",t,e)}},touchmove:{isNative:!0,allocator(t,e){return Nd("touchmove",t,e)}},touchend:{isNative:!0,allocator(t,e){return Nd("touchend",t,e)}},touchcancel:{isNative:!0,allocator(t,e){return Nd("touchcancel",t,e)}},"drag-start":void 0,"drag-move":void 0,"drag-end":void 0,"collapse-widget":void 0,"expand-widget":void 0,"expand-controlled-widget":void 0},Tr=class{static alloc(t,e,i){const n=nI[t].allocator;return n(e,i)}static isHTMLEvent(t){return nI[t]?.isNative===!0}static calcCurrentXY(t,e){const i=t.getBoundingClientRect();return{currentX:e.clientX-i.x,currentY:e.clientY-i.y}}},_E=class{constructor(){this.widgetListeners={},this.sourceListeners={}}initSourceHandler(t,e){this.sourceListeners??(this.sourceListeners={}),this.sourceListeners[t]=e}lazyGetWidgetListeners(t,e){var i;if(!(t in(this.sourceListeners??{}))){const n=r=>{const a=Tr.alloc(t,r,e.getElement());this.dispatch(t,e,a)},s={};(t.startsWith("touch")||t==="wheel")&&(s.passive=!1),this.initSourceHandler(t,n),e.getElement().addEventListener(t,n,s)}return this.widgetListeners??(this.widgetListeners={}),(i=this.widgetListeners)[t]??(i[t]=[]),this.widgetListeners[t]}add(t,e,i){this.lazyGetWidgetListeners(t,e).push(i)}remove(t,e,i){const n=this.lazyGetWidgetListeners(t,e),s=n.indexOf(i);s>-1&&n.splice(s,1)}destroy(t){if(this.widgetListeners=void 0,this.sourceListeners){for(const[e,i]of vt(this.sourceListeners))t.getElement().removeEventListener(e,i);this.sourceListeners=void 0}}dispatch(t,e,i){for(const n of this.widgetListeners?.[t]??[])n(i,e)}},BE=class{constructor(t,e,i,n){this.glob=t,this.self=e,this.cleanup=new nt,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{mousegeneral:s,mousemove:r,mouseup:a}=this,o=n.view;this.cleanup.register(_e(o,"mousedown",s,{capture:!0}),_e(o,"mouseenter",s,{capture:!0}),_e(o,"mouseleave",s,{capture:!0}),_e(o,"mouseout",s,{capture:!0}),_e(o,"mouseover",s,{capture:!0}),_e(o,"mousemove",r,{capture:!0}),_e(o,"mouseup",a,{capture:!0})),e.mouseDragger=this,t.globalMouseDragCallbacks=i,t.globalMouseDragCallbacks.mousedown(n),n.stopPropagation(),n.stopImmediatePropagation()}destroy(){this.cleanup.flush(),this.glob.globalMouseDragCallbacks=void 0,this.self.mouseDragger=void 0}};function zE(t,e,i,n){if(t.globalMouseDragCallbacks==null)return new BE(t,e,i,n)}var GE=500,jE=100;function HE(t,e){const i=t.clientX-e.clientX,n=t.clientY-e.clientY;return i*i+n*n}var _m=!1,$E=class{constructor(t,e,i,n,s){this.glob=t,this.self=e,this.initialTouch=n,this.target=s,this.cleanup=new nt,this.longTapInterrupted=!1,this.longtap=()=>{const{target:o,initialTouch:l}=this;if(!this.longTapInterrupted){const c=new nt;o.dispatchEvent(new TouchEvent("touchcancel",{touches:[l],bubbles:!0})),_m=!0;const h=f=>f.preventDefault(),u=f=>{_m=!1,f.preventDefault(),c.flush()};c.register(_e(o,"touchmove",h,{passive:!1}),_e(o,"touchend",u,{passive:!1}),_e(o,"touchcancel",u,{passive:!1}));const{clientX:d,clientY:g}=l,p=new PointerEvent("contextmenu",{bubbles:!0,cancelable:!0,view:o.ownerDocument.defaultView,clientX:d,clientY:g,pointerType:"touch"});o.dispatchEvent(p)}},this.touchmove=o=>{const{glob:l,self:c,initialTouch:h}=this,u=this.findInitialFinger(o.targetTouches);u!=null&&(this.longTapInterrupted=this.longTapInterrupted||HE(h,u)>jE,c.dragTouchEnabled&&l.globalTouchDragCallbacks?.touchmove(o,u))},this.touchend=o=>{this.longTapInterrupted=!0;const l=this.findInitialFinger(o.changedTouches,o.touches);l!=null&&this.glob.globalTouchDragCallbacks?.touchend(o,l),this.destroy()},this.longtapTimer=setTimeout(this.longtap,GE);const{touchmove:r,touchend:a}=this;this.cleanup.register(_e(s,"touchmove",r,{passive:!1}),_e(s,"touchstart",a,{passive:!1}),_e(s,"touchend",a,{passive:!1}),_e(s,"touchcancel",a,{passive:!1})),e.touchDragger=this,t.globalTouchDragCallbacks=i}destroy(){clearTimeout(this.longtapTimer),this.cleanup.flush(),this.glob.globalTouchDragCallbacks=void 0,this.self.touchDragger=void 0}findInitialFinger(...t){const e=t.flatMap(i=>Array.from(i));return Array.from(e).find(i=>i.identifier===this.initialTouch.identifier)}};function UE(t,e,i,n,s){if(!(t.globalTouchDragCallbacks!=null||_m))return new $E(t,e,i,n,s)}function Bm(t,e,i,n){const{currentX:s,currentY:r}=Tr.calcCurrentXY(t.getElement(),n),a=n.pageX-i.pageX,o=n.pageY-i.pageY;return{type:e,device:"mouse",offsetX:i.offsetX+a,offsetY:i.offsetY+o,clientX:n.clientX,clientY:n.clientY,currentX:s,currentY:r,originDeltaX:a,originDeltaY:o,sourceEvent:n}}function WE(t,{pageX:e,pageY:i}){const{x:n,y:s}=t.getElement().getBoundingClientRect();return{offsetX:e-n,offsetY:i-s}}function zm(t,e,i,n,s){const{currentX:r,currentY:a}=Tr.calcCurrentXY(t.getElement(),s),o=s.pageX-i.pageX,l=s.pageY-i.pageY;return{type:e,device:"touch",offsetX:i.offsetX+o,offsetY:i.offsetY+l,clientX:s.clientX,clientY:s.clientY,currentX:r,currentY:a,originDeltaX:o,originDeltaY:l,sourceEvent:n}}var sI={},rI=class{constructor(t){this.dispatchCallback=t,this.dragTouchEnabled=!0}destroy(){this.dragTriggerRemover?.(),this.dragTriggerRemover=void 0,this.listeners?.clear(),this.mouseDragger?.destroy(),this.touchDragger?.destroy()}getListenerSet(t){this.listeners??(this.listeners=new Map);let e=this.listeners.get(t);return e===void 0&&(e=new Set,this.listeners.set(t,e)),e}add(t,e,i){switch(this.getListenerSet(t).add(i),t){case"drag-start":case"drag-move":case"drag-end":{this.registerDragTrigger(e);break}}}remove(t,e,i){this.getListenerSet(t).delete(i)}registerDragTrigger(t){if(this.dragTriggerRemover==null){const e=t.getElement(),i=new nt;i.register(_e(e,"mousedown",n=>this.triggerMouseDrag(t,n)),_e(e,"touchstart",n=>this.triggerTouchDrag(t,n),{passive:!1})),this.dragTriggerRemover=()=>i.flush()}}triggerMouseDrag(t,e){if(e.button===0){if(e.view==null){const i=t.getElement().ownerDocument.defaultView;e=new i.MouseEvent(e.type,{...e,view:i})}this.startMouseDrag(t,e)}}startMouseDrag(t,e){const i={pageX:Number.NaN,pageY:Number.NaN,offsetX:Number.NaN,offsetY:Number.NaN};rp(["pageX","pageY","offsetX","offsetY"],i,e);const n={mousedown:s=>{const r=Bm(t,"drag-start",i,s);this.dispatch("drag-start",t,r)},mousemove:s=>{const r=Bm(t,"drag-move",i,s);this.dispatch("drag-move",t,r)},mouseup:s=>{const r=Bm(t,"drag-end",i,s);this.dispatch("drag-end",t,r),this.endDrag(t,r)}};this.mouseDragger=zE(sI,this,n,e)}endDrag(t,{sourceEvent:e,clientX:i,clientY:n}){const s=t.getElement(),r=s.getBoundingClientRect();tc(r,i,n)||(s.dispatchEvent(new MouseEvent("mouseleave",e)),e.target?.dispatchEvent(new MouseEvent("mouseenter",e)))}triggerTouchDrag(t,e){const i=e.targetTouches[0];e.targetTouches.length===1&&i!=null&&this.startOneFingerTouch(t,e,i)}startOneFingerTouch(t,e,i){const n={pageX:Number.NaN,pageY:Number.NaN,...WE(t,i)};rp(["pageX","pageY"],n,i);const s={touchmove:(o,l)=>{const c=zm(t,"drag-move",n,o,l);this.dispatch("drag-move",t,c)},touchend:(o,l)=>{const c=zm(t,"drag-end",n,o,l);this.dispatch("drag-end",t,c)}},r=t.getElement();this.touchDragger=UE(sI,this,s,i,r);const a=zm(t,"drag-start",n,e,i);this.dispatch("drag-start",t,a)}dispatch(t,e,i){for(const n of this.getListenerSet(t))n(i,e);this.dispatchCallback(t,i)}},KE=class{constructor(t){this.elem=t}setBounds(t){Nh(this.elemContainer??this.elem,t)}getBounds(){return mv(this.elemContainer??this.elem)}static setElementContainer(t,e){const i=t.getBounds();Nh(e,i),kx(t.elem,{width:"100%",height:"100%"}),t.elem.remove(),t.elemContainer=e,t.elemContainer.replaceChildren(t.elem)}},Lr=class extends KE{constructor(){super(...arguments),this.index=Number.NaN,this.children=[]}set id(t){Me(this.elem,"id",t)}get id(){return Jr(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.remove();for(const t of this.children)t.parent=void 0,t.destroy();this.children.length=0,this.destructor(),this.remove(),this.internalListener?.destroy(),this.htmlListener?.destroy(this)}remove(){this.elem.remove(),this.elemContainer?.remove()}setHidden(t){Ln(this.elem,"display",t?"none":void 0)}isHidden(){const{defaultView:t}=this.elem.ownerDocument;return t?.getComputedStyle(this.elem).display==="none"}setCursor(t){Ln(this.elem,"cursor",t)}setTextContent(t){this.elem.textContent=t??null}setAriaDescribedBy(t){Me(this.elem,"aria-describedby",t)}setAriaHidden(t){Me(this.elem,"aria-hidden",t)}setAriaLabel(t){Me(this.elem,"aria-label",t)}setAriaExpanded(t){Me(this.elem,"aria-expanded",t)}setAriaControls(t){Me(this.elem,"aria-controls",t)}setAriaHasPopup(t){Me(this.elem,"aria-haspopup",t)}setInnerHTML(t){this.elem.innerHTML=t}setPointerEvents(t){Ln(this.elem,"pointer-events",t)}setTouchAction(t){t==null?this.elem.style.touchAction="":this.elem.style.touchAction=t}setCSSVariable(t,e){this.elem.style.setProperty(t,e)}isDisabled(){return Jr(this.elem,"aria-disabled",!1)}hasPopup(){const t=Jr(this.elem,"aria-haspopup");return t!==void 0&&t!=="false"}parseFloat(t){return t===""?0:Number.parseFloat(t)}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(t){this.elem.focus(t)}setFocusOverride(t){Me(this.elem,"data-focus-override",t)}setPreventsDefault(t){Me(this.elem,"data-preventdefault",t)}setTabIndex(t){Me(this.elem,"tabindex",t)}addChild(t){this.addChildToDOM(t,this.getBefore(t)),this.children.push(t),t.index=this.children.length-1,t.parent=this,this.onChildAdded(t)}removeChild(t){const e=this.children.indexOf(t);this.children.splice(e,1),this.removeChildFromDOM(t),this.onChildRemoved(t)}moveChild(t,e){t.domIndex!==e&&(t.domIndex=e,this.removeChildFromDOM(t),this.addChildToDOM(t,this.getBefore(t)))}addClass(...t){this.elem.classList.add(...t)}removeClass(...t){this.elem.classList.remove(...t)}toggleClass(t,e){this.elem.classList.toggle(t,e)}appendOrInsert(t,e){e?e.getElement().insertAdjacentElement("beforebegin",t):this.elem.appendChild(t)}addChildToDOM(t,e){this.appendOrInsert(t.getElement(),e)}removeChildFromDOM(t){t.getElement().remove()}onChildAdded(t){}onChildRemoved(t){}getBefore({domIndex:t}){if(t!==void 0)return this.children.filter(e=>e.domIndex!==void 0&&e.domIndex>t).reduce((e,i)=>!e||i.domIndex<e.domIndex?i:e,void 0)}addListener(t,e){return Tr.isHTMLEvent(t)?(this.htmlListener??(this.htmlListener=new _E),this.htmlListener.add(t,this,e)):(this.internalListener??(this.internalListener=new rI(this.onDispatch.bind(this))),this.internalListener.add(t,this,e)),()=>this.removeListener(t,e)}removeListener(t,e){Tr.isHTMLEvent(t)?this.htmlListener?.remove(t,this,e):this.htmlListener!=null&&this.internalListener?.remove(t,this,e)}setDragTouchEnabled(t){this.internalListener??(this.internalListener=new rI(this.onDispatch.bind(this))),this.internalListener.dragTouchEnabled=t}onDispatch(t,e){if(!e.sourceEvent?.bubbles)return;let{parent:i}=this;for(;i!=null;){const{internalListener:n}=i;if(n!=null){const s={...e,...Tr.calcCurrentXY(i.getElement(),e)};n.dispatch(t,i,s)}i=i.parent}}},YE=class extends Lr{constructor(){super(ve("div")),this.textElement=ut("text"),this.textElement.role="presentation",this.svgElement=ut("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(t){this.textElement.textContent=t;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(){}},ZE=class{constructor(t,e){this.getDispatcher=e,this.onExpanded=()=>{this.controller.setAriaExpanded(!0);const i=this.getDispatcher();if(i&&this.controls){const n={type:"expand-controlled-widget",controlled:this.controls};i.dispatch("expand-controlled-widget",this.controller,n)}},this.onCollapsed=i=>{this.controller.setAriaExpanded(!1),i.mode==="0"&&this.controller.focus()},t.setAriaExpanded(!1),this.controller=t}destroy(){this.controls?.collapse({mode:"2"}),this.setControlled(void 0)}setControlled(t){this.controls&&(this.controls.removeListener("expand-widget",this.onExpanded),this.controls.removeListener("collapse-widget",this.onCollapsed)),this.controls=t,this.controls&&(this.controller.setAriaControls(this.controls.id),this.controls.addListener("expand-widget",this.onExpanded),this.controls.addListener("collapse-widget",this.onCollapsed))}getControlled(){return this.controls}expandControlled(t){this.controller.isDisabled()||this.controls?.expand({controller:this.controller,sourceEvent:void 0,overrideFocusVisible:t?.overrideFocusVisible})}};function XE(t){return Yp(t.sourceEvent)}var Gm=class extends Lr{constructor(t,e){super(t),Me(this.elem,"role",e),this.setEnabled(!0),this.addKeyboardClickBinding(XE)}lazyControllerImpl(){return this.controllerImpl??(this.controllerImpl=new ZE(this,()=>this.internalListener)),this.controllerImpl}destructor(){this.controllerImpl?.destroy()}addKeyboardClickBinding(t){this.addListener("keydown",e=>{const{sourceEvent:i}=e;t(e)&&(i.preventDefault(),this.htmlListener?.dispatch("click",this,{type:"click",device:"keyboard",sourceEvent:i}))})}setEnabled(t){Me(this.elem,"aria-disabled",!t)}setControlled(t){return this.lazyControllerImpl().setControlled(t)}getControlled(){return this.lazyControllerImpl().getControlled()}expandControlled(t){return this.lazyControllerImpl().expandControlled(t)}addListener(t,e){return super.addListener(t,(i,n)=>{(t==="click"||t==="dblclick")&&this.isDisabled()||e(i,n)})}},Od=class extends Gm{constructor(){super(ve("button"))}},aI=class extends Lr{constructor(){super(ve("div")),Me(this.elem,"role","group")}destructor(){}},jm=class extends Lr{constructor(t,e){super(ve("div")),this.focusedChildIndex=0,this.onChildFocus=(i,n)=>{const s=this.children[this.focusedChildIndex];this.focusedChildIndex=n.index,s?.setTabIndex(-1),n.setTabIndex(0)},this.onChildKeyDown=(i,n)=>{const s=this.orientation,r=no(this.elem);let a,o;s==="both"?(a=nc("horizontal",r),o=nc("vertical")):(a=nc(s,r),o=void 0);let l=-1;if(ta(i.sourceEvent)){const c=i.sourceEvent.key;c===a.nextKey||c===o?.nextKey?l=n.index+1:(c===a.prevKey||c===o?.prevKey)&&(l=n.index-1)}this.children[l]?.focus()},Me(this.elem,"role",e),this.orientation=t}get orientation(){return Jr(this.elem,"aria-orientation")??"both"}set orientation(t){Me(this.elem,"aria-orientation",t==="both"?void 0:t)}focus(){this.children[this.focusedChildIndex]?.focus()}clear(){this.focusedChildIndex=0;for(const t of this.children)this.removeChildListeners(t),t.parent=void 0;this.elem.textContent="",this.children.length=0}addChildListeners(t){t.addListener("focus",this.onChildFocus),t.addListener("keydown",this.onChildKeyDown)}removeChildListeners(t){t.removeListener("focus",this.onChildFocus),t.removeListener("keydown",this.onChildKeyDown)}onChildAdded(t){this.addChildListeners(t),t.setTabIndex(this.children.length===1?0:-1)}onChildRemoved(t){this.removeChildListeners(t);const{focusedChildIndex:e,children:i}=this,n=e===t.index;for(let s=0;s<i.length;s++){const r=i[s];r.index===e&&(this.focusedChildIndex=s),r.index=s}if(n){const s=i[e]??i[e-1];s?(this.focusedChildIndex=s.index,s.setTabIndex(0)):this.focusedChildIndex=0}}},qE=class extends jm{constructor(){super("both","list"),this.setHidden(!0)}destructor(){for(const t of this.children)t.getElement().parentElement.remove()}addChildToDOM(t,e){const i=ve("div");Me(i,"role","listitem"),Ln(i,"position","absolute"),Lr.setElementContainer(t,i),this.appendOrInsert(i,e),this.setHidden(!1)}removeChildFromDOM(t){t.getElement().parentElement.remove(),this.setHidden(this.children.length===0)}setHidden(t){this.children.length===0&&(t=!0),super.setHidden(t)}},rl=class extends Lr{constructor(t){super(t)}destructor(){}},Hm=class yh extends Lr{constructor(){super(ve("input")),this._step=yh.STEP_ONE,this.orientation="both"}get step(){return this._step}set step(e){this._step=e,this.getElement().step=e.attributeValue}get keyboardStep(){return this._keyboardStep?.step??this._step}set keyboardStep(e){if(e!==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),e!==void 0)){const i=()=>this.getElement().step=e.attributeValue,n=()=>this.getElement().step=this._step.attributeValue;this._keyboardStep={step:e,onKeyDown:i,onKeyUp:n,onBlur:n},this.addListener("keydown",this._keyboardStep.onKeyDown),this.addListener("keyup",this._keyboardStep.onKeyUp),this.addListener("blur",this._keyboardStep.onBlur)}}get orientation(){return Jr(this.elem,"aria-orientation")??"both"}set orientation(e){Me(this.elem,"aria-orientation",e==="both"?void 0:e),yh.registerDefaultPreventers(this,e)}destructor(){}clampValueRatio(e,i){const n=this.getValueRatio(),s=te(e,n,i);return s!==n&&this.setValueRatio(s),s}setValueRatio(e,i){const{divider:n}=this.step,s=Math.round(e*1e4)/n,{ariaValueText:r=Ex(s/n)}=i??{},a=this.getElement();a.value=`${s}`,a.ariaValueText=r,a.ariaValueNow=`${s}`}getValueRatio(){return this.getElement().valueAsNumber/this.step.divider}static registerDefaultPreventers(e,i){i==="both"?e.removeListener("keydown",yh.onKeyDown):e.addListener("keydown",yh.onKeyDown)}static onKeyDown(e,i){let n=[];const{orientation:s}=i;s==="horizontal"?n=["ArrowUp","ArrowDown"]:s==="vertical"&&(n=["ArrowLeft","ArrowRight"]),n.includes(e.sourceEvent.code)&&e.sourceEvent.preventDefault()}};Hm.STEP_ONE={attributeValue:"1",divider:1},Hm.STEP_HUNDRETH={attributeValue:"0.01",divider:100};var $m=Hm,JE=class extends Od{constructor(){super(),Me(this.elem,"role","switch"),this.setChecked(!1)}setChecked(t){Me(this.elem,"aria-checked",t)}},Ed=class extends jm{constructor(t="horizontal"){super(t,"toolbar")}destructor(){}};function al(t,e){return e.params?.type===t}function QE(t){if(t==="button")return new Od;if(t==="slider")return new $m;if(t==="toolbar")return new Ed;if(t==="group")return new aI;if(t==="list")return new qE;if(t==="region")return new rl(ve("div"));if(t==="text")return new YE;if(t==="listswitch")return new JE;throw new Error("AG Charts - error allocating meta")}function oI(t){const e={params:t,result:void 0};return e.result=QE(e.params.type),e}var eR=class{constructor(t){this.ctx=t,this.cleanup=new nt}destroy(){this.cleanup.flush()}addLocalisation(t){t(),this.cleanup.register(this.ctx.eventsHub.on("locale:change",t))}createProxyContainer(t){const e=oI(t),{params:i,result:n}=e,s=n.getElement();this.ctx.domManager.addChild("canvas-proxy",i.domManagerId,s),s.classList.add(...i.classList,"ag-charts-proxy-container"),s.role=i.role??i.type,al("toolbar",e)&&(e.result.orientation=e.params.orientation);const{ariaLabel:r}=i;return r&&this.addLocalisation(()=>{s.ariaLabel=this.ctx.localeManager.t(r.id,r.params)}),n}createProxyElement(t){const e=oI(t);if(al("button",e)){const{params:i,result:n}=e,s=n.getElement();if(this.initInteract(i,n),typeof i.textContent=="string")s.textContent=i.textContent;else{const{textContent:r}=i;this.addLocalisation(()=>{s.textContent=this.ctx.localeManager.t(r.id,r.params)})}this.setParent(e.params,e.result)}if(al("slider",e)){const{params:i,result:n}=e,s=n.getElement();this.initInteract(i,n),s.type="range",s.role=i.role??"presentation",s.style.margin="0px",this.addLocalisation(()=>{s.ariaLabel=this.ctx.localeManager.t(i.ariaLabel.id,i.ariaLabel.params)}),this.setParent(e.params,e.result)}if(al("text",e)){const{params:i,result:n}=e;this.initElement(i,n),this.setParent(e.params,e.result)}if(al("listswitch",e)){const{params:i,result:n}=e;this.initInteract(i,n),n.setTextContent(i.textContent),n.setChecked(i.ariaChecked),n.setAriaDescribedBy(i.ariaDescribedBy),this.setParent(e.params,e.result)}if(al("region",e)){const{params:i,result:n}=e,s=n.getElement();this.initInteract(i,n),s.role=i.role??"region",this.setParent(e.params,e.result)}return e.result}initElement(t,e){const i=e.getElement();return Ln(i,"cursor",t.cursor),i.classList.toggle("ag-charts-proxy-elem",!0),t.classList?.length&&i.classList.add(...t.classList),i}initInteract(t,e){const{tabIndex:i,domIndex:n}=t,s=this.initElement(t,e);i!==void 0&&(s.tabIndex=i),n!==void 0&&(e.domIndex=n)}setParent(t,e){if("parent"in t)t.parent?.addChild(e);else{const i={where:t.where,query:".ag-charts-series-area"};this.ctx.domManager.addChild("canvas-proxy",t.domManagerId,e.getElement(),i),e.destroyListener=()=>{this.ctx.domManager.removeChild("canvas-proxy",t.domManagerId)}}}},lI={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}",ariaAnnounceOrgChartLeaf:"${description}, level ${level}[number], ${posInSet}[number] of ${setSize}[number]",ariaAnnounceOrgChartParent:"${description}, level ${level}[number], ${posInSet}[number] of ${setSize}[number], ${collapsedState}, ${childCount}[number] children, press Enter or Space to toggle",ariaAnnounceOrgChartParentSingular:"${description}, level ${level}[number], ${posInSet}[number] of ${setSize}[number], ${collapsedState}, 1 child, press Enter or Space to toggle",ariaOrgChartCollapsed:"collapsed",ariaOrgChartExpanded:"expanded",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",ariaLabelGaugeTarget:"Target",ariaLabelGaugeValue:"Value",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",ariaLabelScrollbarHorizontal:"X-axis scrollbar",ariaLabelScrollbarVertical:"Y-axis scrollbar",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",toolbarRangeSelectRange:"Select range",toolbarRangeSelectRangeAria:"Select range",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]"},tR=/\$\{(\w+)}(?:\[(\w+)])?/gi,Um={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"})},iR=({defaultValue:t,variables:e})=>t?.replaceAll(tR,(i,n,s)=>{const r=e[n],a=s==null?null:Um[s];return s!=null&&a==null&&j.warnOnce(`Format style [${s}] is not supported`),a!=null?a.format(r):typeof r=="number"?Um.number.format(r):r instanceof Date?Um.datetime.format(r):String(r)}),nR=class{constructor(t){this.eventsHub=t,this.localeText=void 0,this.getLocaleText=void 0}setLocaleText(t){this.localeText!==t&&(this.localeText=t,this.eventsHub.emit("locale:change",null))}setLocaleTextFormatter(t){this.getLocaleText=t,this.getLocaleText!==t&&(this.getLocaleText=t,this.eventsHub.emit("locale:change",null))}t(t,e={}){const{localeText:i=lI,getLocaleText:n}=this,s=i[t];return String(n?.({key:t,defaultValue:s,variables:e})??iR({key:t,defaultValue:s,variables:e})??t)}},sR=class{constructor(t){this.width=600,this.height=300,this.direction="ltr";const{width:e,height:i,willReadFrequently:n=!1}=t;this.element=t.canvasElement,this.pixelRatio=t.pixelRatio,this.element.style.display="block",this.element.style.width=(e??this.width)+"px",this.element.style.height=(i??this.height)+"px",this.element.width=Math.round((e??this.width)*this.pixelRatio),this.element.height=Math.round((i??this.height)*this.pixelRatio),this.context=this.element.getContext("2d",{willReadFrequently:n}),this.context.direction=this.direction,this.resize(e??0,i??0,this.pixelRatio),Q0(this.context)}drawImage(t,e=0,i=0){return t.drawImage(this.context.canvas,e,i)}toDataURL(t){return this.element.toDataURL(t)}resize(t,e,i){if(!(t>0&&e>0))return;const{element:n,context:s}=this;n.width=Math.round(t*i),n.height=Math.round(e*i),s.setTransform(i,0,0,i,0,0),n.style.width=t+"px",n.style.height=e+"px",this.width=t,this.height=e,this.pixelRatio=i}setDirection(t){this.direction=t?"rtl":"ltr",this.element.dir=this.direction,this.context.direction=this.direction}clear(){J0(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?.(),this.context.direction=this.direction}},rR=class extends ms{constructor(){super(...arguments),this.cache=new Map,this.imageLoadingCount=0}loadImage(t,e){const i=this.cache.get(t);if(i?.image)return i.image;if(i!=null&&e){i.nodes.add(e);return}if(!e)return;const n={image:void 0,nodes:new Set([e])},s=Hb(),r=new s;return this.imageLoadingCount++,r.onload=()=>{n.image=r;for(const a of n.nodes)a.markDirty();n.nodes.clear(),this.imageLoadingCount--,this.emit("image-loaded",{uri:t})},r.onerror=()=>{this.imageLoadingCount--,n.nodes.clear(),this.emit("image-error",{uri:t})},r.src=t,this.cache.set(t,n),n.image}waitingToLoad(){return this.imageLoadingCount>0}destroy(){for(const t of this.cache.values())t.nodes.clear();this.cache.clear()}},aR=class{constructor(t){this.canvas=t,this.debug=ue.create(!0,"scene"),this.layersMap=new Map,this.nextLayerId=0}get size(){return this.layersMap.size}resize(t,e,i){this.canvas.resize(t,e,i);for(const{canvas:n}of this.layersMap.values())n.resize(t,e,i)}addLayer(t){const{width:e,height:i,pixelRatio:n}=this.canvas,{name:s}=t,r=new _f({width:e,height:i,pixelRatio:n});return this.layersMap.set(r,{id:this.nextLayerId++,name:s,canvas:r}),this.debug("Scene.addLayer() - layers",this.layersMap),r}removeLayer(t){this.layersMap.has(t)&&(this.layersMap.delete(t),t.destroy(),this.debug("Scene.removeLayer() -  layers",this.layersMap))}clear(){for(const t of this.layersMap.values())t.canvas.destroy();this.layersMap.clear()}},Rd=class extends ms{constructor(t){super(),this.debug=ue.create(!0,"scene"),this.id=Nn(this),this.imageLoader=new rR,this.root=null,this.pendingSize=null,this.isDirty=!1,this.direction="ltr",this.cleanup=new nt,this.updateDebugFlags(),this.canvas=new sR(t),this.layersManager=new aR(this.canvas),this.cleanup.register(this.imageLoader.on("image-loaded",()=>{this.emit("scene-changed",{})}),this.imageLoader.on("image-error",({uri:e})=>{j.warnOnce(`Unable to load image ${e}`)}))}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}get isRtl(){return this.direction==="rtl"}setContainer(t){const{element:e}=this.canvas;return e.remove(),t.appendChild(e),this}setRoot(t){return this.root===t?this:(this.isDirty=!0,this.root?.setScene(),this.root=t,t&&(t.visible=!0,t.setScene(this)),this)}updateDebugFlags(){ue.inDevelopmentMode(()=>ws._debugEnabled=!0)}clearCanvas(){this.canvas.clear()}attachNode(t){return this.appendChild(t),()=>t.remove()}appendChild(t){return this.root?.appendChild(t),this}removeChild(t){return t.remove(),this}download(t,e){Qx(this.canvas.toDataURL(e),t?.trim()??"image")}getDataURL(t){return this.canvas.toDataURL(t)}resize(t,e,i){return t=Math.round(t),e=Math.round(e),i??(i=this.pixelRatio),t>0&&e>0&&(t!==this.width||e!==this.height||i!==this.pixelRatio)?(this.pendingSize=[t,e,i],this.isDirty=!0,!0):!1}setDirection(t){this.direction=t?"rtl":"ltr",this.canvas.setDirection(t)}updateBaseFont(){const t=this.root?.resolveFont();t!=null&&t!==this._baseFont&&(this._baseFont=t,this.canvas.context.font=t)}applyPendingResize(){return this.pendingSize?(this.layersManager.resize(...this.pendingSize),this.pendingSize=null,this._baseFont!=null&&(this.canvas.context.font=this._baseFont),!0):!1}render(t){const{debugSplitTimes:e={start:performance.now()},extraDebugStats:i,seriesRect:n,debugColors:s}=t??{},{canvas:r,canvas:{context:a}={},root:o,width:l,height:c,pixelRatio:h}=this;if(!a)return;const u=ue.check("scene:stats","scene:stats:verbose");u&&this.ensureDebugStatsRegistration();const d=performance.now(),g=this.applyPendingResize();if(o&&!o.visible){this.isDirty=!1;return}let p;if(o instanceof ne&&(p=o.dirty),o!=null&&p===!1&&!this.isDirty){this.debug.check()&&this.debug("Scene.render() - no-op",{tree:rd(o,"console")}),u&&mS(this.layersManager,e,a,void 0,i,n,s);return}const f={ctx:a,direction:this.direction,width:l,height:c,devicePixelRatio:h,debugNodes:{}};ue.check("scene:stats:verbose")&&(f.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),d1(f);let m=!1;if((p!==!1||g)&&(m=!0,r.clear()),o&&ue.check("scene:dirtyTree")){const{dirtyTree:y,paths:b}=yS(o);ue.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:y,paths:b})}if(o&&m){if(o.visible&&o.preRender(f),this.debug.check()){const y=rd(o,"console");this.debug("Scene.render() - before",{canvasCleared:m,tree:y})}if(o.visible)try{a.save(),o.render(f),a.restore()}catch(y){throw this.canvas.reset(),y}}e["\u270D\uFE0F"]=performance.now()-d,a.verifyDepthZero?.(),this.isDirty=!1,u&&mS(this.layersManager,e,a,f.stats,i,n,s),g1(a,f.debugNodes),o&&this.debug.check()&&this.debug("Scene.render() - after",{tree:rd(o,"console"),canvasCleared:m})}ensureDebugStatsRegistration(){if(this.releaseDebugStats)return;const t=c1(),e=()=>{t(),this.releaseDebugStats=void 0};this.releaseDebugStats=e,this.cleanup.register(e)}toSVG(){const{root:t,width:e,height:i}=this;if(t!=null)return ws.toSVG(t,e,i)}strip(){const{context:t,pixelRatio:e}=this.canvas;t.setTransform(e,0,0,e,0,0),this.layersManager.clear(),this.setRoot(null),this.isDirty=!1,this.clear()}destroy(){this.canvas!=null&&(this.strip(),this.canvas.destroy(),this.imageLoader.destroy(),this.cleanup.flush(),vS(),Object.assign(this,{canvas:void 0}))}};Rd.className="Scene";var oR=class{constructor(t,e){this.eventsHub=t,this.sceneRoot=e,this.axes=new Map,this.axisGridGroup=new ne({name:"Axes-Grids",zIndex:2}),this.axisGroup=new ne({name:"Axes",zIndex:3}),this.axisLabelGroup=new ne({name:"Axes-Labels",zIndex:15}),this.axisOverlayLowGroup=new ne({name:"Axes-Overlay-Low",zIndex:6}),this.axisOverlayMidGroup=new ne({name:"Axes-Overlay-Mid",zIndex:10}),this.axisOverlayHighGroup=new ne({name:"Axes-Overlay-High",zIndex:15}),this.sceneRoot.appendChild(this.axisGroup),this.sceneRoot.appendChild(this.axisGridGroup),this.sceneRoot.appendChild(this.axisLabelGroup),this.sceneRoot.appendChild(this.axisOverlayLowGroup),this.sceneRoot.appendChild(this.axisOverlayMidGroup),this.sceneRoot.appendChild(this.axisOverlayHighGroup)}updateAxes(t,e){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,overlayLowNode:this.axisOverlayLowGroup,overlayMidNode:this.axisOverlayMidGroup,overlayHighNode:this.axisOverlayHighGroup};for(const n of t)e.includes(n)||(n.detachAxis(i),n.destroy());for(const n of e)t?.includes(n)||n.attachAxis(i);this.axes.clear();for(const n of e){const s=n.createAxisContext();this.axes.has(s.direction)?this.axes.get(s.direction)?.push(s):this.axes.set(s.direction,[s])}this.eventsHub.emit("axis:change",null)}getAxisIdContext(t){for(const[,e]of this.axes)for(const i of e)if(i.axisId===t)return i}getAxisContext(t){return this.axes.get(t)??[]}destroy(){this.axes.clear(),this.axisGroup.remove(),this.axisGridGroup.remove()}},Wm=class{constructor(t,e,i){this.eventsHub=t,this.caller=e,this.animationManager=i,this.dispatchOnlyLatest=!0,this.dispatchThrottle=0,this.requestThrottle=300,this.isLoadingInitialData=!1,this.isLoadingData=!1,this.isForcedLoadingData=void 0,this.freshRequests=[],this.requestCounter=0,this.pendingData=void 0,this.debug=ue.create(!0,"data-model","data-source"),this.throttledFetch=this.createThrottledFetch(this.requestThrottle),this.throttledDispatch=this.createThrottledDispatch(this.dispatchThrottle)}updateCallback(t){typeof t=="function"&&(this.debug("DataService - updated data source callback"),this.dataSourceCallback=t,this.isLoadingInitialData=!0,this.animationManager.skip(),this.eventsHub.emit("data:source-change",null))}clearCallback(){this.dataSourceCallback=void 0}load(t){const{pendingData:e}=this;if(e!=null&&(e.params.windowStart==null&&e.params.windowEnd==null||e.params.windowStart?.valueOf()===t.windowStart?.valueOf()&&e.params.windowEnd?.valueOf()===t.windowEnd?.valueOf())){const i=this.requestCounter++;this.isLoadingInitialData=!1,this.dispatch(i,e.data);return}this.isLoadingData=!0,this.throttledFetch(t)}isLazy(){return this.dataSourceCallback!=null}isLoading(){return this.isForcedLoadingData!=null?this.isForcedLoadingData:this.isLazy()&&(this.isLoadingInitialData||this.isLoadingData)}setForcedLoading(t){this.isForcedLoadingData=t}async getData(){const{latestRequest:t}=this;if(!t)return;const{params:e,fetchRequest:i}=t,n=await i;return{params:e,data:n}}restoreData(t){this.pendingData=t}createThrottledFetch(t){return Bg(e=>this.fetch(e).catch(i=>j.error("callback failed",i)),t,{leading:!1,trailing:!0})}createThrottledDispatch(t){return Bg((e,i)=>this.dispatch(e,i),t,{leading:!0,trailing:!0})}dispatch(t,e){this.debug(`DataService - dispatching 'data-load' | ${t}`),this.eventsHub.emit("data:load",{data:e})}async fetch(t){"context"in this.caller&&(t.context=this.caller.context);const e=Promise.resolve().then(async()=>{if(!this.dataSourceCallback)throw new Error("DataService - [dataSource.getData] callback not initialised");const i=performance.now(),n=this.requestCounter++;this.debug(`DataService - requesting | ${n}`);let s;try{s=await this.dataSourceCallback(t),this.debug(`DataService - response | ${performance.now()-i}ms | ${n}`)}catch(a){this.debug(`DataService - request failed | ${n}`),j.warnOnce(`DataService - request failed | [${a}]`)}this.isLoadingInitialData=!1;const r=this.freshRequests.indexOf(e);return r===-1||this.dispatchOnlyLatest&&r!==this.freshRequests.length-1?(this.debug(`DataService - discarding stale request | ${n}`),s):(this.freshRequests=this.freshRequests.slice(r+1),this.freshRequests.length===0&&(this.isLoadingData=!1),Array.isArray(s)?this.throttledDispatch(n,s):this.eventsHub.emit("data:error",null),s)});this.latestRequest={params:t,fetchRequest:e},this.freshRequests.push(e),await e}};x([ui({newValue(t){this.throttledDispatch=this.createThrottledDispatch(t)}})],Wm.prototype,"dispatchThrottle",2),x([ui({newValue(t){this.throttledFetch=this.createThrottledFetch(t)}})],Wm.prototype,"requestThrottle",2);var lR=class{constructor(t){this.ctx=t,this.observers=[]}updateFonts(t){if(!(!t||t.size===0)){this.loadFonts(t);for(const e of t)this.observeFontStatus(e)}}destroy(){for(const t of this.observers)t.disconnect();this.observers=[]}loadFonts(t){const e=Array.from(t).map(r=>encodeURIComponent(r)),i=":wght@100;200;300;400;500;600;700;800;900",n=`${i}&family=`,s=`@import url('https://fonts.googleapis.com/css2?family=${e.join(n)}${i}&display=swap');
`;this.ctx.domManager.addStyles(`google-font-${e.join("-")}`,s)}observeFontStatus(t){const e=$b();if(e===void 0)return;const n=this.ctx.domManager.getDocument().createElement("div",{position:"absolute",top:"0",margin:"0",padding:"0",overflow:"hidden",visibility:"hidden",width:"auto",maxWidth:"none",fontSynthesis:"none",fontFamily:t,fontSize:"16px",whiteSpace:"nowrap"});n.textContent="UVWxyz",this.ctx.domManager.addChild("canvas-container",`font-check-${encodeURIComponent(t)}`,n);const s=new e(r=>{const a=r?.at(0)?.contentBoxSize.at(0)?.inlineSize;a!=null&&a>0&&(di.clear(),this.ctx.eventsHub.emit("font:load",null))});s.observe(n),this.observers.push(s)}},cI={activeItem:{type:X(Vh()("series-node","legend")),seriesId:N,itemId:X(se(N,k))},frozen:T},$c={mode:J(V("integrated","standalone")),withinStudio:J(T),loading:J(T),container:jg,context:()=>!0,theme:le,series:Yn,annotations:le,navigator:le,scrollbar:le,initialState:{active:cI,chartType:N,collapsed:Q(N),annotations:le,legend:Pt({visible:T,seriesId:N,itemId:N,legendItemName:N},"legend state array"),zoom:le}},cR={...re,...$c,axes:Ks,data:Yn,dataIdKey:N},hR={...re,...$c,axes:Ks,data:Yn,dataIdKey:N},uR={...re,...$c,data:Yn,dataIdKey:N,topology:Bx},dR={...re,...$c,data:Yn,dataIdKey:N},gR=class{constructor(t){this.mementoOriginatorKey="active",this.updateable=!0,this.didLayout=!1,this.pendingMemento=void 0,this.ctx=t;const e=t.eventsHub.on("update:pre-scene-render",()=>{this.didLayout=!0;const{pendingMemento:i}=this;i&&(this.restoreMemento(i.version,i.mementoVersion,i.memento),this.pendingMemento=void 0,t.chartState.flushChanges("activeItem")),e()})}isFrozen(){return this.ctx.interactionManager.isState(1)}clear(){return this.update(void 0,void 0)}update(t,e){return this.performUpdate("user-interaction",t,e,!1)}performUpdate(t,e,i,n){if(!this.updateable)return!1;const s=this.currentItem;let r=!1;if(n||!st(s,e)){const{frozen:a,activeItem:o}=this.createMementoWithItem(e),{datum:l}=i??{};this.ctx.fireEvent({type:"activeChange",source:t,frozen:a,activeItem:o,datum:l,dataIdKey:i?.series.data?.dataIdKey,preventDefault:()=>{r=!0}})}return r||(this.currentItem=e,this.ctx.chartState.setValue("activeItem",e)),r}createMemento(){return this.createMementoWithItem(this.currentItem)}createMementoWithItem(t){const e=this.isFrozen();switch(t?.type){case"series-node":case"legend":{const{type:i,seriesId:n,itemId:s}=t;return{frozen:e,activeItem:{type:i,seriesId:n,itemId:s}}}default:return t?.type,{frozen:e}}}guardMemento(t,e){if(t==null)return!0;const i=zt(t,$c.initialState.active);return e.push(...i.invalid.map(n=>n.toString())),i.invalid.length===0}restoreMemento(t,e,i){if(!this.didLayout){this.pendingMemento={version:t,mementoVersion:e,memento:i};return}this.updateable=!1;const[n,s]=this.performRestoration(i?.activeItem);this.updateable=!0;const r=this.isFrozen(),a=i?.frozen,o=a===void 0?!1:r!==a;a===!0?this.ctx.interactionManager.pushState(1):a===!1&&this.ctx.interactionManager.popState(1),this.performUpdate("state-change",n,s,o)}performRestoration(t){let e=!1;const i=()=>e=!0;let n;const s=o=>n=o,r=this.pendingMemento!==void 0,a=this.ctx.chartService.id;return this.ctx.eventsHub.emit("active:load-memento",{initialState:r,chartId:a,activeItem:t,reject:i,setDatum:s}),e?[void 0,void 0]:[t,n]}},hI=class{constructor(t){this.maxAnimationTime=t,this.debug=ue.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(Oc.map(e=>[e,[]])),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(Oc[this.currentPhase])??[]}checkOverlappingId(t){t!=null&&this.controllers.has(t)&&(this.controllers.get(t).stop(),this.debug(`Skipping animation batch due to update of existing animation: ${t}`),this.skip())}addAnimation(t){if(t.isComplete)return;if(Oc.indexOf(t.phase)<this.currentPhase){this.debug("Skipping animation due to being for an earlier phase",t.id),t.stop();return}this.controllers.set(t.id,t),this.phases.get(t.phase)?.push(t)}removeAnimation(t){this.controllers.delete(t.id);const e=this.phases.get(t.phase),i=e?.indexOf(t);i!=null&&i>=0&&e?.splice(i,1)}progress(t){if(!this.isReady)return;let e=t===0?.01:t;const i=()=>{const c=Oc[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:c,phaseMeta:Ec[c]}};let{phase:n,phaseControllers:s,phaseMeta:r}=i();const a=()=>Oc[this.currentPhase]==null,o=()=>{for({phase:n,phaseControllers:s,phaseMeta:r}=i();!a()&&s.length===0;)this.currentPhase++,{phase:n,phaseControllers:s,phaseMeta:r}=i(),this.debug(`AnimationBatch - phase changing to ${n}`,{unusedTime:e},s)},l=this.controllers.size;this.debug(`AnimationBatch - ${t}ms; phase ${n} with ${s?.length} of ${l}`);do{const c=e,h=r.skipIfNoEarlierAnimations&&this.animationTimeConsumed===0;let u=0;for(const d of s)h?d.stop():e=Math.min(d.update(c),e),d.isComplete&&(u++,this.removeAnimation(d));this.animationTimeConsumed+=c-e,this.debug(`AnimationBatch - updated ${s.length} controllers; ${u} completed`,s),this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`),o()}while(e>0&&!a());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 t=!0;for(const[,e]of this.controllers)if(e.duration>0&&Ec[e.phase].skipIfNoEarlierAnimations!==!0){t=!1;break}if(!t)for(const[,e]of this.controllers)e.autoplay&&e.play(!0)}skip(t=!0){if(this.skipAnimations===!1&&t===!0){for(const e of this.controllers.values())e.stop();this.controllers.clear()}this.skipAnimations=t}play(){for(const t of this.controllers.values())t.play()}stop(){for(const t of this.controllers.values())try{t.stop(),this.removeAnimation(t)}catch(e){j.error("Error during animation stop",e)}this.dispatchStopped()}stopByAnimationId(t){if(t!=null&&this.controllers.has(t)){const e=this.controllers.get(t);e&&(e.stop(),this.removeAnimation(e))}}stopByAnimationGroupId(t){for(const e of this.controllers.values())e.groupId===t&&this.stopByAnimationId(e.id)}dispatchStopped(){for(const t of this.stoppedCbs)t();this.stoppedCbs.clear()}isSkipped(){return this.skipAnimations}getRemainingTime(t){if(!this.isActive())return 0;let e=0;for(const[i,n]of this.phases)n.length!==0&&(t!=null&&t!==i||(e+=Math.max(...n.map(s=>s.isComplete?0:s.delay+s.duration-(s.elapsed??0)))));return e}destroy(){this.stop(),this.controllers.clear()}};function uI(t){return t==null?!0:!Number.isNaN(t)&&t>=0&&t<=2}var pR=class{constructor(t,e,i){this.agDocument=t,this.interactionManager=e,this.chartUpdateMutex=i,this.defaultDuration=1e3,this.maxAnimatableItems=NM,this.batch=new hI(this.defaultDuration*1.5),this.debug=ue.create(!0,"animation"),this.events=new ms,this.rafAvailable=typeof requestAnimationFrame<"u",this.isPlaying=!0,this.requestId=null,this.skipAnimations=!0,this.currentAnonymousAnimationId=0,this.cumulativeAnimationTime=0}addListener(t,e){return this.events.on(t,e)}animate(t){const e=this.batch;try{e.checkOverlappingId(t.id)}catch(o){this.failsafeOnError(o);return}let{id:i}=t;i==null&&(i=`__${this.currentAnonymousAnimationId}`,this.currentAnonymousAnimationId+=1);const n=this.isSkipped()&&!t.forceAnimation||t.phase==="none";n&&this.debug("AnimationManager - skipping animation");const{delay:s,duration:r}=t;if(!uI(s))throw new Error(`Animation delay of ${s} is unsupported (${i})`);if(!uI(r))throw new Error(`Animation duration of ${r} is unsupported (${i})`);const a=new cN({...t,id:i,skip:n,autoplay:this.isPlaying?t.autoplay:!1,phase:t.phase,defaultDuration:this.defaultDuration});if(!this.forceTimeJump(a,this.defaultDuration))return this.batch.addAnimation(a),a}play(){if(!this.isPlaying){this.isPlaying=!0,this.debug("AnimationManager.play()");try{this.batch.play()}catch(t){this.failsafeOnError(t)}this.requestAnimation()}}stop(){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.stop()"),this.batch.stop()}stopByAnimationId(t){try{this.batch.stopByAnimationId(t)}catch(e){this.failsafeOnError(e)}}stopByAnimationGroupId(t){try{this.batch.stopByAnimationGroupId(t)}catch(e){this.failsafeOnError(e)}}reset(){this.isPlaying?(this.stop(),this.play()):this.stop()}skip(t=!0){this.skipAnimations=t}isSkipped(){return!this.rafAvailable||this.skipAnimations||this.batch.isSkipped()}isActive(){return this.isPlaying&&this.batch.isActive()}getRemainingTime(t){return this.batch.getRemainingTime(t)}getCumulativeAnimationTime(){return this.cumulativeAnimationTime}skipCurrentBatch(){this.debug.check()&&this.debug("AnimationManager - skipCurrentBatch()",{stack:new Error("Stack trace for animation skip tracking").stack}),this.batch.skip()}isSkippingFrames(){return!0}scheduleAnimationFrame(t){this.requestId=this.agDocument.requestAnimationFrame(e=>{t(e).catch(i=>j.error(i))})}forceTimeJump(t,e){return!1}requestAnimation(){if(!this.rafAvailable||!this.batch.isActive()||this.requestId!==null)return;let t;const e=async i=>{await this.debug.group("AnimationManager.onAnimationFrame()",async()=>{const n=()=>{const s=i-(t??i);t=i,this.debug("AnimationManager",{controllersCount:this.batch.size,deltaTime:s}),this.interactionManager.pushState(4);try{this.batch.progress(s),this.cumulativeAnimationTime+=s}catch(r){this.failsafeOnError(r)}this.events.emit("animation-frame",{type:"animation-frame",deltaMs:s})};this.isSkippingFrames()?await this.chartUpdateMutex.acquireImmediately(n):await this.chartUpdateMutex.acquire(n),this.batch.isActive()?this.scheduleAnimationFrame(e):(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(e)}cancelAnimation(){this.requestId!==null&&(this.agDocument.cancelAnimationFrame(this.requestId),this.events.emit("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}),this.requestId=null,this.startBatch())}failsafeOnError(t,e=!0){j.error("Error during animation, skipping animations",t),e&&this.cancelAnimation()}startBatch(t){this.debug(`AnimationManager - startBatch() with skipAnimations=${t}.`),this.reset(),this.batch.destroy(),this.batch=new hI(this.defaultDuration*1.5),t===!0&&this.batch.skip()}endBatch(){this.batch.isActive()?(this.batch.ready(),this.requestAnimation()):(this.interactionManager.popState(4),this.batch.isSkipped()&&this.batch.skip(!1))}onBatchStop(t){this.batch.stoppedCbs.add(t)}destroy(){this.stop(),this.events.clear()}},fR=class{constructor(t){this.eventsHub=t,this.mementoOriginatorKey="collapsed",this.collapsedIds={}}createMemento(){return Object.keys(this.collapsedIds)}guardMemento(t){return t==null||Array.isArray(t)}restoreMemento(t,e,i){i&&this.collapse(i),this.eventsHub.emit("collapsed:restore",{collapsed:this.createMemento()})}collapse(t){let e=!1;const i={};for(const n of t)e||(e=!this.collapsedIds[n]),i[n]=!0;if(!e){for(const n of Object.keys(this.collapsedIds))if(!i[n]){e=!0;break}}return this.collapsedIds=i,e&&this.eventsHub.emit("collapsed:change",null),e}collapseAppend(t){let e=!1;for(const i of t)e||(e=!this.collapsedIds[i]),this.collapsedIds[i]=!0;return e&&this.eventsHub.emit("collapsed:change",null),e}expand(t){let e=!1;for(const i of t)e||(e=!!this.collapsedIds[i]),delete this.collapsedIds[i];return e&&this.eventsHub.emit("collapsed:change",null),e}isCollapsed(t){return!!this.collapsedIds[t]}},dI=class XA{constructor(e){this.ctx=e,this.highlightStates=new kd,this.pendingUnhighlights=new Map,this.unhighlightDelay=100,this.highlightInViewport=!0}updateHighlight(e,i,n=!1,s){const r=this.getActiveHighlight();if(i==null&&n&&this.unhighlightDelay>0){if(!this.pendingUnhighlights.has(e)){const o=Fm(()=>{this.applyPendingUnhighlight(e)});this.pendingUnhighlights.set(e,{scheduler:o}),o.schedule(this.unhighlightDelay)}return}const a=this.pendingUnhighlights.get(e);a&&(a.scheduler.cancel(),this.pendingUnhighlights.delete(e)),i?this.highlightStates.set(e,i):this.highlightStates.delete(e),this.maybeEmitChange(e,r,s)}maybeEmitChange(e,i,n){const s=this.getActiveHighlight(),r=!this.isEqual(s,i),a=n??(r?!0:this.highlightInViewport);if(r||this.highlightInViewport!==a){const o=s?.series?.isHighlightEnabled()===!1;this.highlightInViewport=a,this.ctx.chartState.setValue("highlight",s),this.ctx.eventsHub.emit(XA.HIGHLIGHT_CHANGE_EVENT,{callerId:e,currentHighlight:s,previousHighlight:i,highlightSuppressed:o,highlightInViewport:a})}}applyPendingUnhighlight(e){if(!this.pendingUnhighlights.has(e))return;this.pendingUnhighlights.delete(e);const i=this.getActiveHighlight();this.highlightStates.delete(e),this.maybeEmitChange(e,i,!0)}getActiveHighlight(){return this.highlightStates.stateValue()}destroy(){for(const{scheduler:e}of this.pendingUnhighlights.values())e.cancel();this.pendingUnhighlights.clear()}isEqual(e,i){return e===i?!0:e!=null&&i!=null&&e.series===i.series&&this.idsMatch(e,i)&&this.pointsMatch(e,i)&&e.datum===i.datum}idsMatch(e,i){return e.itemId!=null&&i.itemId!=null&&e.itemId===i.itemId||e.datumIndex!=null&&i.datumIndex!=null&&st(e.datumIndex,i.datumIndex)}pointsMatch(e,i){return this.pointsAreEqual(e.point,i.point)&&this.pointsAreEqual(e.midPoint,i.midPoint)&&this.pointsAreEqual(e.xBar?.lowerPoint,i.xBar?.lowerPoint)&&this.pointsAreEqual(e.xBar?.upperPoint,i.xBar?.upperPoint)&&this.pointsAreEqual(e.yBar?.lowerPoint,i.yBar?.lowerPoint)&&this.pointsAreEqual(e.yBar?.upperPoint,i.yBar?.upperPoint)}pointsAreEqual(e,i){return e===i||e!==void 0&&i!==void 0&&e.x===i.x&&e.y===i.y}};dI.HIGHLIGHT_CHANGE_EVENT="highlight:change";var gI=dI,Pd=class{constructor(t,e,i,n){this.domManager=i,this.tooltip=n,this.stateTracker=new kd,this.suppressState=new kd(!1),this.appliedState=null,this.pendingRemovals=new Map,this.removeDelay=100,this.cleanup=new nt,this.cleanup.register(n.setup(e,i),t.on("dom:hidden",()=>this.tooltip.hide()))}destroy(){for(const{scheduler:t}of this.pendingRemovals.values())t.cancel();this.pendingRemovals.clear(),this.cleanup.flush()}updateTooltip(t,e,i,n){const s=this.pendingRemovals.get(t);s&&(s.scheduler.cancel(),this.pendingRemovals.delete(t)),i??(i=this.stateTracker.get(t)?.content),this.stateTracker.set(t,{meta:e,content:i,pagination:n}),this.applyStates()}removeTooltip(t,e,i=!1){if(i&&this.removeDelay>0){const s=this.pendingRemovals.get(t);if(s){e&&(s.lastMeta=e);return}const r=Fm(()=>{this.applyPendingRemoval(t)});this.pendingRemovals.set(t,{scheduler:r,lastMeta:e}),r.schedule(this.removeDelay);return}const n=this.pendingRemovals.get(t);n&&(n.scheduler.cancel(),this.pendingRemovals.delete(t)),this.stateTracker.delete(t),this.applyStates()}suppressTooltip(t){this.suppressState.set(t,!0)}unsuppressTooltip(t){this.suppressState.delete(t)}applyPendingRemoval(t){this.pendingRemovals.has(t)&&(this.pendingRemovals.delete(t),this.stateTracker.delete(t),this.applyStates())}applyStates(){const t=this.stateTracker.stateId(),e=t?this.stateTracker.get(t):void 0;if(this.suppressState.stateValue()||e?.meta==null||e?.content==null){this.appliedState=null,this.tooltip.hide();return}const i=this.domManager.getBoundingClientRect(),n=this.tooltip.bounds==="extended"?this.domManager.getOverlayClientRect():i;if(st(this.appliedState?.content,e?.content)&&st(this.appliedState?.pagination,e?.pagination)){const s=this.tooltip.isVisible();this.tooltip.show(n,i,e?.meta,null,void 0,s)}else this.tooltip.show(n,i,e?.meta,e?.content,e?.pagination);this.appliedState=e}static makeTooltipMeta(t,e,i,n){const{canvasX:s,canvasY:r}=t,a=e.properties.tooltip,{placement:o,anchorTo:l,xOffset:c,yOffset:h,offset:u}=a.position,d=Am(e,i,n);return{canvasX:s,canvasY:r,nodeCanvasX:d?.canvasX??s,nodeCanvasY:d?.canvasY??r,enableInteraction:a.interaction?.enabled??!1,showArrow:a.showArrow,position:{placement:o,anchorTo:l,xOffset:c,yOffset:h,offset:u}}}},pI=3,mR=505,fI=30;function Km(t,e){const{device:i,offsetX:n,offsetY:s,clientX:r,clientY:a,currentX:o,currentY:l,sourceEvent:c}=e;return{type:t,device:i,offsetX:n,offsetY:s,clientX:r,clientY:a,currentX:o,currentY:l,sourceEvent:c}}function mI(t,e){const i=t*t+e*e,n=pI*pI;return i>=n}function yR(t,e){const i=t.clientX-e.clientX,n=t.clientY-e.clientY,s=i*i+n*n,r=fI*fI;return s<r}var bR=class{constructor(t){this.cleanup=new nt,this.events=new ms,this.isDragging=!1,this.touch={distanceTravelledX:0,distanceTravelledY:0,clientX:0,clientY:0},this.cleanup.register(t.addListener("touchstart",this.onTouchStart.bind(this)),t.addListener("touchmove",this.onTouchMove.bind(this)),t.addListener("touchend",this.onTouchEnd.bind(this)),t.addListener("mousemove",this.onMouseMove.bind(this)),t.addListener("dblclick",this.onDblClick.bind(this)),t.addListener("drag-start",this.onDragStart.bind(this)),t.addListener("drag-move",this.onDragMove.bind(this)),t.addListener("drag-end",this.onDragEnd.bind(this)))}destroy(){this.cleanup.flush()}onTouchStart(t){const{clientX:e,clientY:i}=t.sourceEvent.targetTouches[0]??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX=0,this.touch.distanceTravelledY=0,this.touch.clientX=e,this.touch.clientY=i}onTouchMove(t){const{clientX:e,clientY:i}=t.sourceEvent.targetTouches[0]??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX+=Math.abs(this.touch.clientX-e),this.touch.distanceTravelledY+=Math.abs(this.touch.clientY-i),this.touch.clientX=e,this.touch.clientY=i}onTouchEnd(t){t.sourceEvent.preventDefault()}onMouseMove(t){this.events.emit("mousemove",t)}onDblClick(t){this.events.emit("dblclick",t)}onDragStart(t){this.dragStartEvent=t}onDragMove(t){this.dragStartEvent!=null&&mI(t.originDeltaX,t.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",t)}onDragEnd(t){if(this.isDragging){this.events.emit("drag-end",t),this.isDragging=!1;return}if(t.device==="mouse"){const e=Km("click",t);this.events.emit("click",e)}else if(t.sourceEvent.type==="touchend"){if(mI(this.touch.distanceTravelledX,this.touch.distanceTravelledY))return;const e=Km("click",t);this.events.emit("click",e);const i=Date.now();if(this.lastClick!==void 0&&i-this.lastClick.time<=mR&&yR(this.lastClick,t)){const n=Km("dblclick",t);this.events.emit("dblclick",n),this.lastClick=void 0}else this.lastClick={time:i,clientX:t.clientX,clientY:t.clientY}}}},Ym=class extends rl{constructor(t){super(t)}addChildToDOM(){}removeChildFromDOM(){}},vR=class{constructor(t,e){this.seriesWidget=new Ym(t.getParent("series-area")),this.chartWidget=new Ym(t.getParent("canvas-proxy")),this.containerWidget=new Ym(t.getParent("canvas-container")),this.containerWidget.addChild(this.chartWidget),this.chartWidget.addChild(this.seriesWidget),e.withDragInterpretation&&(this.seriesDragInterpreter=new bR(this.seriesWidget))}destroy(){this.seriesDragInterpreter?.destroy(),this.seriesWidget.destroy(),this.chartWidget.destroy(),this.containerWidget.destroy()}},xR=class{constructor(){this.labelData=new Map}updateLabels(t,e,i=U.zero){const n={x:-e.left,y:-e.top,width:i.width+e.left+e.right,height:i.height+e.top+e.bottom},s=new Set(t.map(a=>a.id));for(const a of this.labelData.keys())s.has(a)||this.labelData.delete(a);for(const a of t){const o=a.getLabelData();o.every(C0)&&this.labelData.set(a.id,o)}const r=A0(this.labelData,n,5);for(const a of t)a.updatePlacedLabelData?.(r.get(a.id)??[])}},SR=class{updateCallback(t){this.resolvePartialCallback=t}resolvePartial(t,e,i){return this.resolvePartialCallback?.(t,e,i)}},MR=class extends En{constructor(){super(...arguments),this.type="category",this.defaultTickCount=0,this._hasFixedWidth=!1,this._paddingInnerWidth=0,this._domain=[],this._bandRanges=new Map}set domain(t){this._domain!==t&&(t.length===0&&(this._bandRanges.clear(),this._hasFixedWidth=!1),this.invalid=!0,this._domain=t)}get domain(){return this._domain}get bands(){return this.domain}get paddingInnerWidth(){return this._hasFixedWidth?this._paddingInnerWidth:this.paddingInner*this._bandwidth}addBand(t,e,i){this._domain.push(this.getDomainValue(t,e)),this._bandRanges.has(t)||this._bandRanges.set(t,new Map),this._bandRanges.get(t).set(e,i),this._hasFixedWidth||(this._hasFixedWidth=i!=null),this.invalid=!0}getDomainValue(t,e){return`${t}-${e}`}findIndex(t){let e=0;for(const i of this._bandRanges.keys()){if(i===t)return e;e++}}convert(t){const{_bandwidth:e,_bandRanges:i,_inset:n,_paddingInnerWidth:s}=this;let r=n;const a=t.split("-"),o=Number(a[0]);if(!this._hasFixedWidth)return super.convert(o);for(let l=0;l<o;l++){const c=i.get(l);if(!c){r+=s;continue}let h=0;for(const u of c.values())h=Math.max(h,u??e);r+=h+s}return r}invert(t,e){}getBandCountForUpdate(){return this._bandRanges.size}update(){if(!this._hasFixedWidth)return super.update();const[t,e]=this.range;let{paddingInner:i}=this;const n=this.getBandCountForUpdate();if(n===0)return;let s=0,r=n,a=n;for(const f of this._bandRanges.values()){let m=0,y=!1;for(const b of f.values()){if(b==null){y=!0;continue}m=Math.max(m,b)}y?a-=1:(r-=1,s+=m)}n===1&&(i=0);const o=e-t,l=o/n*i,c=s+l*(n-1),h=o-c;let u=t,d=r>0&&h>=0?h/r:o/n,g=d;a===n&&h>0&&(u+=h/2),this.round&&Math.floor(g)>0&&(u=Math.round(u),g=Math.round(g)),h<0&&(d=0,g=0),this._inset=u,this._bandwidth=g,this._rawBandwidth=d,this._paddingInnerWidth=l}normalizeDomains(...t){return{domain:[],animatable:!1}}toDomain(t){}},IR=class{constructor(){this.groups=new Map,this.groupScales=new Map}registerSeries({internalId:t,seriesGrouping:e,visible:i,width:n,type:s}){if(!e)return;let r=this.groups.get(s);r==null&&(r=new Map,this.groups.set(s,r)),r.set(t,{grouping:e,visible:i,width:n})}updateSeries({internalId:t,seriesGrouping:e,visible:i,width:n,type:s}){if(!e)return;const r=this.groups.get(s)?.get(t);r&&(r.grouping=e,r.width=n,r.visible=i)}deregisterSeries({internalId:t,type:e}){const i=this.groups.get(e);i!=null&&(i.delete(t),i.size===0&&this.groups.delete(e))}getVisiblePeerGroupIndex({type:t,seriesGrouping:e,visible:i}){if(!e)return{visibleGroupCount:i?1:0,visibleSameStackCount:i?1:0,index:0};const n=new Set,s=new Set,r=this.groups.get(t);for(const o of r?.values()??[])o.visible&&(n.add(o.grouping.groupIndex),o.grouping.groupIndex===e.groupIndex&&s.add(o.grouping.stackIndex));const a=Array.from(n);return a.sort((o,l)=>o-l),{visibleGroupCount:a.length,visibleSameStackCount:s.size,index:a.indexOf(e.groupIndex)}}updateGroupScale({type:t},e,i){const n=this.groupScales.get(t)??new MR;this.groupScales.set(t,n),n.domain=[];const s=this.groups.get(t);for(const r of s?.values()??[])r.visible&&n.addBand(r.grouping.groupIndex,r.grouping.stackIndex,r.width);n.domain.length===0&&n.addBand(0,0,void 0),n.range=[0,e],i.type==="grouped-category"?n.paddingInner=i.options.groupPaddingInner:i.type==="category"||i.type==="unit-time"?(n.paddingInner=i.options.groupPaddingInner,n.round=n.padding!==0):n.padding=0,n.update()}getGroupScale({type:t}){return this.groupScales.get(t)}getGroupBandWidth(t){const{seriesGrouping:e}=t;if(!e)return 0;const i=this.getGroupScale(t);if(!i)return 0;const n=this.groups.get(t.type);if(!n)return i.bandwidth;let s=0;for(const r of n.values())r.visible&&r.grouping.groupIndex===e.groupIndex&&(s=Math.max(s,r.width??i.bandwidth));return s||i.bandwidth}getGroupOffset(t){const{seriesGrouping:e}=t;if(!e)return 0;const i=this.getGroupScale(t);if(!i)return 0;const n=i.getDomainValue(e.groupIndex,e.stackIndex);return i.convert(n)}getStackOffset(t,e){const{seriesGrouping:i}=t;if(!i)return 0;const n=this.groups.get(t.type);if(!n)return 0;const s=this.getGroupScale(t);if(!s||(i.stackCount??0)<1)return 0;let a=0;for(const o of n.values())o.visible&&o.grouping.groupIndex===i.groupIndex&&(a=Math.max(a,o.width??s.bandwidth));return a===0?0:a/2-e/2}getDatumOffset(t,e,i,n){const s=this.groups.get(t.type);if(!t.visible||!t.seriesGrouping||!s||e.get(t.internalId)?.[n]||i.get(t.internalId)?.[n])return 0;const r=new Set;for(const[d,g]of s)g.visible&&!e.get(d)?.[n]&&!i.get(d)?.[n]&&r.add(g.grouping.groupIndex);if(r.size===t.seriesGrouping?.groupCount)return 0;const a=this.groupScales.get(t.type),o=new Map,l=new Map;for(const[d,g]of s)d!==t.internalId&&g.visible&&(r.has(g.grouping.groupIndex)||(t.seriesGrouping.groupIndex<g.grouping.groupIndex?l.set(g.grouping.groupIndex,Math.max(g.width??a?.bandwidth??0,l.get(g.grouping.groupIndex)??0)):t.seriesGrouping.groupIndex>g.grouping.groupIndex&&o.set(g.grouping.groupIndex,Math.max(g.width??a?.bandwidth??0,o.get(g.grouping.groupIndex)??0))));let c=0;for(const[,d]of l)c+=d;for(const[,d]of o)c-=d;c/=2;const h=(a?.paddingInnerWidth??0)/2,u=(l.size-o.size)*h;return c+u}};function DR(t,e){const i=Lg(),n=new ms,s=new fx;s.setValue("activeItem",void 0),s.setValue("highlight",void 0),s.setValue("legendData",{}),s.setValue("legendVisible",!0);const r=new iI(n,t,e.agDocument,e.container,e.styleContainer,e.skipCss,e.domMode),a=r.addChild("canvas","scene-canvas",e.scene?.canvas.element),o=e.scene??new Rd({canvasElement:a,pixelRatio:e.agDocument.window.devicePixelRatio??1});o.setRoot(e.root),i.constant("eventsHub",n).constant("agDocument",e.agDocument).ref("chartService",t).ref("annotationRoot",t.annotationRoot).constant("fireEvent",e.fireEvent).constant("syncManager",e.syncManager).constant("chartState",s).constant("domManager",r).ref("scene",o),i.service("callbackCache",()=>new Cx).service("formatManager",()=>new xr).service("seriesStateManager",()=>new IR).service("stateManager",()=>new AE).service("seriesLabelLayoutManager",()=>new xR).service("interactionManager",()=>new NS).service("optionsGraphService",()=>new SR).service("chartTypeOriginator",()=>new DE(t)).service("widgets",l=>new vR(l.domManager,{withDragInterpretation:e.withDragInterpretation})).service("axisManager",l=>new oR(l.eventsHub,e.root)).service("highlightManager",l=>new gI(l)).service("layoutManager",l=>new B1(l.eventsHub)).service("localeManager",l=>new nR(l.eventsHub)).service("historyManager",l=>new CE(l)).service("collapsedManager",l=>new fR(l.eventsHub)).service("animationManager",l=>new pR(l.agDocument,l.interactionManager,e.updateMutex)).service("activeManager",l=>new gR(l)).service("proxyInteractionService",l=>new eR(l)).service("fontManager",l=>new lR(l)).service("tooltipManager",l=>new Pd(l.eventsHub,l.localeManager,l.domManager,t.tooltip)).service("dataService",l=>new Wm(l.eventsHub,t,l.animationManager));for(const l of ee.listModulesByType("plugin"))(!l.chartType||l.chartType===e.chartType)&&l.register?.(i);return i}var Fd=class extends Te{constructor(){super(...arguments),this.enabled=!0,this.range="tooltip",this.drawingMode="cutout"}};x([I],Fd.prototype,"enabled",2),x([I],Fd.prototype,"range",2),x([I],Fd.prototype,"drawingMode",2);function CR(t,e){if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0}function AR(t,e){if(t==null||e==null)return t===e;if(t.size!==e.size)return!1;for(const[i,n]of t){const s=e.get(i);if(s==null||!CR(n,s))return!1}return!0}function wR(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i+=1){const{type:n,idsMap:s,scopes:r,data:a,...o}=t[i],{type:l,idsMap:c,scopes:h,data:u,...d}=e[i];if(n!==l||r&&h&&!jn(r,h)||a&&u&&a!==u||!st(o,d)||!AR(s,c))return!1}return!0}function kR(t,e){const{props:i,...n}=t,{props:s,...r}=e;return st(n,r)&&wR(i,s)}function TR(t,e,i,n){return e!==t.dataSet?!1:jn(i,t.ids)&&kR(n,t.opts)}function yI(t){return t.filter(e=>e.type==="key").map(e=>e.property).join(";")}var Zm=class Sn{constructor(e,i,n){this.mode=e,this.suppressFieldDotNotation=i,this.eventsHub=n,this.debug=ue.create(!0,"data-model"),this.requested=[],this.status="setup"}async request(e,i,n){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");return new Promise((s,r)=>{this.requested.push({id:e,opts:n,dataSet:i,resolve:s,reject:r})})}execute(e){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");this.status="executed";const i=new Map;for(const o of this.requested)o.dataSet.hasPendingTransactions()&&i.set(o.dataSet,o.dataSet.getChangeDescription()),o.dataSet.commitPendingTransactions();this.debug("DataController.execute() - requested",this.requested);const n=this.validateRequests(this.requested);this.debug("DataController.execute() - validated",n);const s=this.mergeRequested(n);this.debug("DataController.execute() - merged",s),this.debug.check()&&(Hn().processedData=[]);const r=[];for(const{dataSet:o,ids:l,opts:c,resolves:h,rejects:u}of s){let d=function(v){return TR(v,o,l,c)};var a=d;const g=e?.find(d),p=(v,S)=>{if(this.debug.check()&&Hn("processedData").push(S),S==null){for(const M of u)M(new Error("AG Charts - no processed data generated"));return}r.push({opts:c,dataSet:o,dataLength:o.data.length,ids:l,dataModel:v,processedData:S});for(const M of h)M({dataModel:v,processedData:S})},f=()=>{try{const v=new Sm(c,this.mode,this.suppressFieldDotNotation,this.eventsHub),S=new Map(n.map(C=>[C.id,C.dataSet])),M=v.processData(S);return p(v,M),v}catch(v){for(const S of u)S(v)}};if(g==null){f();continue}const{dataModel:m,processedData:y}=g,b=i.get(o);if(y&&b&&m.isReprocessingSupported(y)){if(this.debug("DataController.execute() - reprocessing data",y,o),m.reprocessData(y,i),ue.check("data-model:reprocess-diff")){const v=new Sm(c,this.mode,this.suppressFieldDotNotation,this.eventsHub),S=new Map(n.map(w=>[w.id,w.dataSet])),M=v.processData(S),C=JSON.parse(JSON.stringify(y,Sn.jsonReplacer)),D=JSON.parse(JSON.stringify(M,Sn.jsonReplacer));delete C.time,delete C.optimizations,delete D.time,delete D.optimizations;const A=es(D,C);A?(j.log("\u26A0\uFE0F DATA-MODEL REPROCESS DIFF DETECTED \u26A0\uFE0F"),j.log("Difference between incremental update and full reprocess:"),j.log(""),j.log("BASELINE (full reprocess):"),j.log(JSON.stringify(D,null,2)),j.log(""),j.log("REPROCESSED (incremental update):"),j.log(JSON.stringify(C,null,2)),j.log(""),j.log("DIFF (what changed):"),j.log(JSON.stringify(A,null,2))):j.log("\u2705 Data-model reprocess matches baseline (no diff)")}p(m,y);continue}f()}return r}validateRequests(e){const i=[];for(const[n,s]of e.entries())n>0&&s.dataSet.data.length!==e[0].dataSet.data.length&&s.opts.groupByData===!1&&s.opts.groupByKeys===!1?s.reject(new Error("all series[].data arrays must be of the same length and have matching keys.")):i.push(s);return i}mergeRequested(e){const i=[];for(const n of e){const s=i.find(Sn.groupMatch(n));s?s.push(n):i.push([n])}return i.map(Sn.mergeRequests)}static groupMatch({dataSet:e,opts:i}){const{groupByData:n,groupByKeys:s=!1,groupByFn:r,props:a}=i,o=yI(a);return([l])=>(n===!1||l.dataSet===e)&&(l.opts.groupByKeys??!1)===s&&l.opts.groupByFn===r&&yI(l.opts.props)===o}static mergeRequests(e){const i={ids:[],rejects:[],resolves:[],dataSet:e[0].dataSet,opts:{...e[0].opts,props:[]}},n=new Map,s=new Map;let r=0;for(const a of e){const{id:o,dataSet:l,resolve:c,reject:h,opts:{props:u,...d}}=a;i.ids.push(o),i.rejects.push(h),i.resolves.push(c),i.dataSet??(i.dataSet=l),i.opts??(i.opts={...d,props:[]});for(const g of u){const p={...g,scopes:[o],data:l.data};Sn.createIdsMap(o,p);let f;Sn.crossScopeMergableTypes.has(p.type)?f=-1:s.has(l.data)?f=s.get(l.data):(f=r++,s.set(l.data,f));const m=`${p.type}-${f}-${p.groupId}`,y=n.get(m),b=y?.find(v=>Sn.deepEqual(v,p));if(y==null){i.opts.props.push(p),n.set(m,[p]);continue}else if(b==null){i.opts.props.push(p),y.push(p);continue}p.scopes!=null&&(b.scopes??(b.scopes=[]),b.scopes.push(...p.scopes)),(b.type==="key"||b.type==="value")&&p.idsMap?.size&&(b.idsMap??(b.idsMap=new Map),Sn.mergeIdsMap(p.idsMap,b.idsMap))}}return i}static mergeIdsMap(e,i){for(const[n,s]of e){const r=i.get(n);if(r==null)i.set(n,new Set(s));else for(const a of s)r.add(a)}}static createIdsMap(e,i){i.id!=null&&(i.idsMap??(i.idsMap=new Map),i.idsMap.has(e)?i.idsMap.get(e).add(i.id):i.idsMap.set(e,new Set([i.id])))}static deepEqual(e,i){if(e===i)return!0;if(e&&i&&typeof e=="object"&&typeof i=="object"){if(e.constructor!==i.constructor)return!1;let n,s;if(Array.isArray(e)){if(s=e.length,s!==i.length)return!1;for(n=s-1;n>=0;n--)if(!Sn.deepEqual(e[n],i[n]))return!1;return!0}const r=Object.keys(e);if(s=r.length,s!==Object.keys(i).length)return!1;for(n=s-1;n>=0;n--){const a=r[n];if(!Sn.skipKeys.has(a)&&(!Object.hasOwn(i,a)||!Sn.deepEqual(e[a],i[a])))return!1}return!0}return!1}static jsonReplacer(e,i){return i instanceof Map?{__type:"Map",value:Array.from(i.entries())}:i instanceof Set?{__type:"Set",value:Array.from(i)}:i}};Zm.crossScopeMergableTypes=new Set(["key","group-value-processor"]),Zm.skipKeys=new Set(["id","idsMap","type","scopes","data"]);var bI=Zm,Xm=class Gs{constructor(e){this.chart=e}subscribe(e=Gs.DEFAULT_GROUP){let i=this.get(e);return i||(i={members:new Set},Gs.chartsGroups.set(e,i)),i.members.add(this.chart),this}unsubscribe(e=Gs.DEFAULT_GROUP){const i=this.get(e);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(e=Gs.DEFAULT_GROUP){return this.get(e)}getGroupMembers(e=Gs.DEFAULT_GROUP){const i=this.get(e);return i?Array.from(i.members):[]}getGroupSiblings(e=Gs.DEFAULT_GROUP){return this.getGroupMembers(e).filter(i=>i!==this.chart)}getGroupSyncMode(e=Gs.DEFAULT_GROUP){return this.getGroupMembers(e).some(i=>i.series.length>1)?"multi-series":"single-series"}get(e){return Gs.chartsGroups.get(e)}};Xm.chartsGroups=new Map,Xm.DEFAULT_GROUP=Symbol("sync-group-default");var LR=Xm,Vd=class extends Te{constructor(){super(...arguments),this.enabled=!1,this.initialFocus="data-start"}};x([I],Vd.prototype,"enabled",2),x([I],Vd.prototype,"tabIndex",2),x([I],Vd.prototype,"initialFocus",2);var vI=["right","top","left","bottom"];function NR(t){return typeof t=="string"&&vI.includes(t)}function OR(t){const e=[],i=[],n=[...vI];for(const s of t)s instanceof Rc&&(NR(s.position)?i.push(s.position):e.push(s));for(const s of e){let r;do r=n.pop();while(r&&i.includes(r));if(r==null)break;s.position=r}}var xI=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo"];function ER(t,e,i){const n=new Map,s=u=>{if(u===void 0)return xI;if(n.has(u))return n.get(u);const d=ee.getSeriesModule(u)?.matchingKeys??xI;return n.set(u,d),d},r=(u,d,g)=>{const p=s(u),f=[u];for(const m of p)m in d&&d[m]!=null&&f.push(`${m}=${d[m]}`);return g?.seriesGrouping&&f.push(`seriesGrouping.groupId=${g?.seriesGrouping.groupId}`),f.join(";")},a=new Map;let o=0;for(const u of t){const d=r(u.type,u.properties,i?.[o]);a.has(d)||a.set(d,[]),a.get(d)?.push([u,o++])}const l=new Map;o=0;for(const u of e){const d=r(u.type,u,u);l.has(d)||l.set(d,[]),l.get(d)?.push([u,o++])}if(![...a.keys()].some(u=>l.has(u)))return{status:"no-overlap",oldKeys:a.keys(),newKeys:l.keys()};const h=[];for(const[u,d]of l.entries())for(const[g,p]of d){const f=a.get(u);if(f==null||f.length<1){h.push({opts:g,targetIdx:p,idx:p,status:"add"}),a.delete(u);continue}const[m,y]=f.shift(),b=i?.[y]??{},v=es(b,g??{}),{groupIndex:S,stackIndex:M}=v?.seriesGrouping??{};S!=null||M!=null?h.push({opts:g,series:m,diff:v,targetIdx:p,idx:y,status:"series-grouping"}):v?h.push({opts:g,series:m,diff:v,targetIdx:p,idx:y,status:"update"}):h.push({opts:g,series:m,targetIdx:p,idx:y,status:"no-op"}),f.length===0&&a.delete(u)}for(const u of a.values())for(const[d,g]of u)h.push({series:d,idx:g,targetIdx:-1,status:"remove"});return{status:"overlap",changes:h}}var RR=class extends sm{*legends(){for(const t of ee.listModulesByType("plugin"))(t.name==="legend"||t.name==="gradientLegend")&&(yield{legendType:t.name==="legend"?"category":"gradient",legend:this.getModule(t.name)})}selection(){return this.getModule("selection")}},qm="ag-charts-overlay",PR="ag-charts-dark-overlay",La=class extends Te{constructor(t,e){super(),this.className=t,this.defaultMessageId=e,this.enabled=!0}getText(t){return ce(this.text)?Ue(this.text):this.rendererAsText?this.rendererAsText:t.t(et(this.text)||this.defaultMessageId)}getElement(t,e,i,n){this.content?.remove(),this.rendererAsText=void 0,this.focusBox=n;const s={},r=this.renderer?dn(t,this.renderer,s):void 0,a=Sv(r);if(typeof a=="string"||Ja(a)){if(Ja(a))this.content=a;else{const o=ve("div");o.innerHTML=a;const{firstElementChild:l}=o;Ja(l)&&o.childElementCount===1?this.content=l:this.content=o}this.rendererAsText=this.content?.textContent?.trim()}else{const o=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(ce(this.text)){const l=ve("div");for(const c of this.text){const h=ve("span",{color:c.color,fontSize:`${c.fontSize}px`,fontFamily:c.fontFamily??"inherit",fontWeight:String(c.fontWeight),fontStyle:c.fontStyle});h.innerText=et(c.text),l.appendChild(h)}o.appendChild(l)}else o.innerText=this.getText(i);this.content=o,this.content.classList.add(this.className),e?.animate({from:0,to:1,id:"overlay",phase:"add",groupId:"opacity",onUpdate(l){o.style.opacity=String(l)},onStop(){o.style.opacity="1"}})}return this.content}removeElement(t=()=>this.content?.remove(),e){if(this.content){if(e){const{content:i}=this;e.animate({from:1,to:0,phase:"remove",id:"overlay",groupId:"opacity",onUpdate(n){i.style.opacity=String(n)},onStop(){t?.()}})}else t?.();this.content=void 0,this.focusBox=void 0}}};x([I],La.prototype,"enabled",2),x([I],La.prototype,"text",2),x([I],La.prototype,"renderer",2);var ol=class extends Te{constructor(){super(...arguments),this.darkTheme=!1,this.loading=new La("ag-charts-loading-overlay","overlayLoadingData"),this.noData=new La("ag-charts-no-data-overlay","overlayNoData"),this.noVisibleSeries=new La("ag-charts-no-visible-series","overlayNoVisibleSeries"),this.unsupportedBrowser=new La("ag-charts-unsupported-browser","overlayUnsupportedBrowser")}getFocusInfo(t){for(const e of[this.loading,this.noData,this.noVisibleSeries,this.unsupportedBrowser])if(e.focusBox!==void 0)return{text:e.getText(t),rect:e.focusBox}}destroy(){this.loading.removeElement(),this.noData.removeElement(),this.noVisibleSeries.removeElement(),this.unsupportedBrowser.removeElement()}};x([I],ol.prototype,"darkTheme",2),x([I],ol.prototype,"loading",2),x([I],ol.prototype,"noData",2),x([I],ol.prototype,"noVisibleSeries",2),x([I],ol.prototype,"unsupportedBrowser",2);function FR(t,e,i){const{animationDuration:n}=Ec.add,s=n*i,r=t.createElement("div",`${qm}--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`}),a=t.createElement("span",{width:"45px",height:"40px",backgroundImage:["linear-gradient(#0000 calc(1 * 100% / 6), #ccc 0 calc(3 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(2 * 100% / 6), #ccc 0 calc(4 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(3 * 100% / 6), #ccc 0 calc(5 * 100% / 6), #0000 0)"].join(""),backgroundSize:"10px 400%",backgroundRepeat:"no-repeat",animation:"ag-charts-loading-matrix 1s infinite linear"}),o=t.createElement("p",{marginTop:"1em"});o.innerText=e;const l=t.createElement("div",`${qm}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),c=t.createElement("style");return c.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(" "),r.replaceChildren(c,a,o,l),r}var Uc=class extends Te{constructor(t){super(),this.ctx=t,this.rectNode=new Tt,this.border=new bo(this.rectNode),this.cornerRadius=0,this.padding=0,this.cleanup=new nt,this.node=this.createNode(),this.node.append([this.rectNode]),this.rectNode.fill=void 0,this.cleanup.register(t.scene.attachNode(this.node),t.eventsHub.on("layout:complete",e=>this.onLayoutComplete(e)))}destroy(){this.cleanup.flush()}getPadding(){const{border:t,padding:e}=this,i=t.enabled?t.strokeWidth:0;if(typeof e=="number"){const n=e+i;return{top:n,right:n,bottom:n,left:n}}return{top:(e.top??0)+i,right:(e.right??0)+i,bottom:(e.bottom??0)+i,left:(e.left??0)+i}}createNode(){return new ne({name:"series-area-container",zIndex:4})}onLayoutComplete(t){const{x:e,y:i,width:n,height:s}=t.series.paddedRect;this.rectNode.x=e,this.rectNode.y=i,this.rectNode.width=n,this.rectNode.height=s}};x([I],Uc.prototype,"border",2),x([I],Uc.prototype,"clip",2),x([xt("rectNode","cornerRadius"),I],Uc.prototype,"cornerRadius",2),x([I],Uc.prototype,"padding",2);var VR=class{constructor(t){this.swapChain=t,this.focusVisibleStyle=!1,this.hasFocus=!1,this.div=ve("div"),this.svg=ut("svg"),this.outerPath=ut("path"),this.innerPath=ut("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",e=>this.onSwap(e))}clear(){}update(t,e,i){if(e!=null)if(t instanceof kt){const n=(r,a)=>{let{x:o,y:l}=Ze.toCanvasPoint(t,r,a);return o-=e.x??0,l-=e.y??0,{x:o,y:l}},s=t.svgPathData(n);this.outerPath.setAttribute("d",s),this.innerPath.setAttribute("d",s),this.show(this.svg)}else{let n;if(i){const s=Math.max(t.x-e.x,0),r=Math.max(t.y-e.y,0),a=Math.min(t.x+t.width-e.x,e.width),o=Math.min(t.y+t.height-e.y,e.height);n=new U(s,r,a-s,o-r)}else n=new U(t.x-e.x,t.y-e.y,t.width,t.height);Nh(this.div,n),this.show(this.div)}}onSwap(t){t!==this.element.parentElement&&(this.element.remove(),t.appendChild(this.element),this.overrideFocusVisible(this.focusVisible))}show(t){this.element.innerHTML="",this.element.append(t)}focus(t){this.focusVisible=t.focusVisible,this.hasFocus||(t.focusVisible!==void 0&&(this.hasFocus=!0),this.swapChain.focus(t))}overrideFocusVisible(t){this.focusVisible=t;const e={true:"1",false:"0",undefined:""};this.element.parentElement?.style.setProperty("opacity",e[`${t}`])}isFocusVisible(){return this.focusVisible??this.focusVisibleStyle}onFocus(){if(this.hasFocus)return this.isFocusVisible();this.overrideFocusVisible(void 0);const t=this.element.parentElement,e=this.element.ownerDocument.defaultView;return this.focusVisibleStyle=t!=null&&e.getComputedStyle(t).opacity==="1",this.hasFocus=!0,this.focusVisibleStyle}onBlur(){this.overrideFocusVisible(void 0),this.focusVisibleStyle=!1,this.hasFocus=!1}},_R=class{constructor(t,e,i,n){this.label1=t,this.label2=e,this.hasFocus=!1,this.skipDispatch=!1,this.listeners={blur:[],focus:[],swap:[]},this.onBlur=s=>(Ln(s.target,"pointer-events",void 0),!this.skipDispatch&&this.dispatch("blur",s)),this.onFocus=s=>(Ln(s.target,"pointer-events","auto"),!this.skipDispatch&&this.dispatch("focus",s)),Me(this.label1,"id",sc()),Me(this.label2,"id",sc()),Ln(this.label1,"display","none"),Ln(this.label2,"display","none"),this.label1.textContent=n,this.label2.textContent=n,this.activeAnnouncer=this.createAnnouncer(i),this.inactiveAnnouncer=this.createAnnouncer(i),Me(this.activeAnnouncer,"tabindex",0),this.label2.insertAdjacentElement("afterend",this.activeAnnouncer),this.label2.insertAdjacentElement("afterend",this.inactiveAnnouncer),this.swap(n)}createAnnouncer(t){const e=ve("div");return e.role=t,e.className="ag-charts-swapchain",e.addEventListener("blur",this.onBlur),e.addEventListener("focus",this.onFocus),e}destroy(){for(const t of[this.activeAnnouncer,this.inactiveAnnouncer])t.removeEventListener("blur",this.onBlur),t.removeEventListener("focus",this.onFocus),t.remove()}focus(t){this.focusOptions=t,this.activeAnnouncer.focus(t),this.focusOptions=void 0}update(t){this.skipDispatch=!0,this.swap(t),this.hasFocus&&this.activeAnnouncer.focus(this.focusOptions),this.skipDispatch=!1}addListener(t,e){this.listeners[t].push(e),t==="swap"&&e(this.activeAnnouncer)}dispatch(t,e){t==="focus"?this.hasFocus=!0:t==="blur"&&(this.hasFocus=!1);for(const i of this.listeners[t])i(e)}swap(t){const e=this.activeAnnouncer.tabIndex;this.label2.textContent=t,[this.inactiveAnnouncer,this.activeAnnouncer]=[this.activeAnnouncer,this.inactiveAnnouncer],[this.label1,this.label2]=[this.label2,this.label1],qr(this.inactiveAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!0,tabindex:void 0}),qr(this.activeAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!1,tabindex:e}),this.dispatch("swap",this.activeAnnouncer)}},BR={arrowdown:{bindings:[{code:"ArrowDown"}]},arrowleft:{bindings:[{code:"ArrowLeft"}]},arrowright:{bindings:[{code:"ArrowRight"}]},arrowup:{bindings:[{code:"ArrowUp"}]},home:{bindings:[{code:"Home"}]},end:{bindings:[{code:"End"}]},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},panxleft:{bindings:[{key:"PageUp"},{code:"PageUp"}],activatesFocusIndicator:!0},panxright:{bindings:[{key:"PageDown"},{code:"PageDown"}],activatesFocusIndicator:!0}};function zR(t,e){for(const i of e)if("code"in i){if(i.code===t.code)return!0}else if(i.key===t.key&&(i.shift===void 0||i.shift===t.shiftKey)&&(i.ctrlOrMeta===void 0||i.ctrlOrMeta===t.ctrlKey||i.ctrlOrMeta===t.metaKey))return!0;return!1}function GR(t){for(const[e,{activatesFocusIndicator:i=!0,bindings:n}]of vt(BR))if(zR(t,n))return{name:e,activatesFocusIndicator:i}}function jR(t,e){for(const i of t)if(Ze.toCanvas(i.node).intersectsWith(e))return!0;return!1}function HR(t){switch(t.sourceDetail){case"keyboard-page(1)":case"keyboard-page(-1)":return"viewport-start";case"keyboard-page(home)":return"data-start";case"keyboard-page(end)":return"data-end";default:return}}var SI=class extends Vm{constructor(t){super(),this.chart=t,this.id=Nn(this),this.series=[],this.announceMode="when-changed",this.highlight={pendingHoverEvent:void 0,appliedHoverEvent:void 0,stashedHoverEvent:void 0},this.tooltip={lastHover:void 0},this.activeState={lastActive:void 0,highlightInViewport:!0},this._device="pointer",this.focus={initialized:!1,sortedSeries:[],series:void 0,seriesIndex:0,datumIndex:0,datum:void 0,pendingViewportFocus:void 0},this.cachedTooltipContent=void 0,this.hoverScheduler=this.createHoverScheduler(),this.pickManager=new dE(t.ctx.activeManager,t.tooltip);const e=t.ctx.localeManager.t("ariaInitSeriesArea"),i=t.ctx.domManager.addChild("series-area","series-area-aria-label1"),n=t.ctx.domManager.addChild("series-area","series-area-aria-label2");this.swapChain=new _R(i,n,"img",e),this.swapChain.addListener("blur",o=>this.onBlur(o)),this.swapChain.addListener("focus",()=>this.onFocus()),t.ctx.domManager.mode==="normal"&&(this.focusIndicator=new VR(this.swapChain),this.focusIndicator.overrideFocusVisible(t.mode==="integrated"?!1:void 0));const{seriesDragInterpreter:s,seriesWidget:r,containerWidget:a}=t.ctx.widgets;r.setTabIndex(-1),this.cleanup.register(()=>t.ctx.domManager.removeChild("series-area","series-area-aria-label1"),()=>t.ctx.domManager.removeChild("series-area","series-area-aria-label2"),r.addListener("focus",()=>this.focusIndicator?.focus({preventScroll:!0})),r.addListener("mousemove",o=>this.onHover(o,r)),r.addListener("wheel",o=>this.onWheel(o)),r.addListener("mouseleave",o=>this.onLeave(o)),r.addListener("keydown",o=>this.onKeyDown(o)),r.addListener("contextmenu",(o,l)=>this.onContextMenu(o,l)),a.addListener("contextmenu",(o,l)=>this.onContextMenu(o,l)),a.addListener("click",(o,l)=>this.onClick(o,l)),a.addListener("dblclick",(o,l)=>this.onClick(o,l)),t.ctx.animationManager.addListener("animation-start",()=>this.onAnimationStart()),t.ctx.eventsHub.on("active:load-memento",o=>this.onActiveLoadMemento(o)),t.ctx.chartState.observe(o=>{o("activeItem")?.type==="legend"&&(this.clearStaleHighlightTooltip(),this.activeState.lastActive="legend")}),t.ctx.eventsHub.on("dom:resize",()=>this.onResize()),t.ctx.eventsHub.on("dom:container-change",()=>this.resetHoverScheduler()),t.ctx.eventsHub.on("highlight:change",o=>this.changeHighlightDatum(o)),t.ctx.eventsHub.on("highlight:selection-updated",o=>this.onHighlightSelectionUpdate(o)),t.ctx.eventsHub.on("layout:complete",o=>this.layoutComplete(o)),t.ctx.eventsHub.on("update:pre-scene-render",()=>this.preSceneRender()),t.ctx.eventsHub.on("update:complete",()=>this.updateComplete()),t.ctx.eventsHub.on("zoom:change-complete",o=>this.onZoomChangeComplete(o)),t.ctx.eventsHub.on("collapsed:change",()=>{this.focusIndicator?.isFocusVisible()&&(this.announceMode="always")}),t.ctx.eventsHub.on("zoom:pan-start",()=>this.clearAll()),t.ctx.eventsHub.on("legend:item-hover",o=>this.onLegendHover(o))),s&&this.cleanup.register(s.events.on("drag-move",o=>this.onDragMove(o,r)),s.events.on("click",o=>this.onClick(o,r)),s.events.on("dblclick",o=>this.onClick(o,r)))}get bbox(){return(this.seriesRect??U.zero).clone()}setHoverDevice(t){(t==="setState"||!this.isState(1))&&(this._device=t)}getHoverDevice(){return this._device}initFocus(t){if(!this.focus.initialized)switch(this.focus.initialized=!0,t){case"data-end":{this.focus.datumIndex=Number.MAX_VALUE;break}case"viewport-start":case"viewport-end":{this.focus.pendingViewportFocus=t;break}default:}}isState(t){return this.chart.ctx.interactionManager.isState(t)}isIgnoredTouch(t){return!(t.device!=="touch"||t.type==="click"||this.chart.ctx.chartService.touch.dragAction==="hover"||this.chart.ctx.chartService.touch.dragAction==="drag"&&this.isState(18))}dataChanged(){var t;this.cachedTooltipContent=void 0,this.highlight.appliedHoverEvent&&((t=this.highlight).stashedHoverEvent??(t.stashedHoverEvent=this.highlight.appliedHoverEvent),this.clearHighlight()),this.getHoverDevice()!=="setState"&&(this.chart.ctx.tooltipManager.removeTooltip(this.id),this.focusIndicator?.clear())}preSceneRender(){this.highlight.stashedHoverEvent!=null&&(this.highlight.pendingHoverEvent=this.tooltip.lastHover??this.highlight.stashedHoverEvent,this.highlight.stashedHoverEvent=void 0,this.handleHoverHighlight(!0)),this.tooltip.lastHover!=null&&this.handleHoverTooltip(this.tooltip.lastHover,!0),this.getHoverDevice()==="setState"&&this.refreshSetState()}updateComplete(){const{pendingViewportFocus:t}=this.focus;t&&this.focus.series!==void 0?(this.focus.pendingViewportFocus=void 0,this.pickViewportFocus(t)):this.isState(69)&&this.focusIndicator?.isFocusVisible()&&(this.announceMode!=="always"&&(this.announceMode="never"),this.refreshFocus())}update(t,e){this.chart.ctx.eventsHub.emit("chart:request-update",{type:t,opts:e})}seriesChanged(t){this.focus.sortedSeries=[...t].sort((e,i)=>{let n=e.properties.focusPriority??1/0,s=i.properties.focusPriority??1/0;return n===s&&([n,s]=[e.declarationOrder,i.declarationOrder]),n<s?-1:n>s?1:0}),this.series=t}layoutComplete(t){this.seriesRect=t.series.rect,this.hoverRect=t.series.rect,this.chart.ctx.widgets.seriesWidget.setBounds(t.series.rect),this.chart.ctx.domManager.mode==="normal"&&this.chart.ctx.widgets.chartWidget.setBounds(t.chart)}onAnimationStart(){this.getHoverDevice()!=="setState"&&this.activeState.lastActive!=="legend"&&this.clearAll()}onResize(){const t=this.chart.ctx.highlightManager.getActiveHighlight();this.clearAll(),this.pickManager.wasActivationPrevented()&&t!==void 0&&(this.setHoverDevice("setState"),this.activeState.lastActive={itemId:Dd(t),seriesId:t.series.id})}onZoomChangeComplete(t){this.clearAll(),this.focus.pendingViewportFocus=HR(t)}onContextMenu(t,e){const{sourceEvent:i}=t;if(i.currentTarget!=e.getElement())return;if(e!==this.chart.ctx.widgets.seriesWidget){if(this.isState(72)){const{currentX:c,currentY:h}=t;this.chart.ctx.contextMenuRegistry?.dispatchContext("always",{widgetEvent:t,canvasX:c,canvasY:h},void 0)}return}let n,s;if(this.focusIndicator?.isFocusVisible())n=this.chart.ctx.highlightManager.getActiveHighlight(),n&&this.seriesRect&&n.midPoint&&(s=Ze.toCanvasPoint(n.series.contentGroup,n.midPoint.x,n.midPoint.y));else if(this.isState(72)){const c=this.pickNodes({x:t.currentX,y:t.currentY},"context-menu");c&&(this.pickManager.maybeActivate(void 0,()=>{this.chart.ctx.highlightManager.updateHighlight(this.id)}),n=c.matches[0])}const r=n?.series;this.clearAll();const a=t.currentX+e.cssLeft(),o=t.currentY+e.cssTop(),{datumIndex:l}=n??{};r&&n&&l!=null?this.chart.ctx.contextMenuRegistry?.dispatchContext("series-node",{widgetEvent:t,canvasX:a,canvasY:o},{pickedSeries:r,pickedNode:{...n,datumIndex:l}},s):this.chart.ctx.contextMenuRegistry?.dispatchContext("series-area",{widgetEvent:t,canvasX:a,canvasY:o},void 0,s)}onLeave(t){!this.isState(82)||t.sourceEvent.relatedTarget?.className==="ag-charts-text-input__textarea"||this.maybeEnterInteractiveTooltip(t.sourceEvent)||(this.chart.ctx.domManager.updateCursor(this.id),this.getHoverDevice()!=="keyboard"&&this.clearAll(!0))}onWheel(t){this.isState(82)&&(this.focusIndicator?.overrideFocusVisible(!1),this.setHoverDevice("pointer"))}onDragMove(t,e){this.isState(82)&&(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(t,e))}onHover(t,e){this.isState(83)&&this.onHoverLikeEvent(t,e)}onHoverLikeEvent(t,e){if(this.isIgnoredTouch(t)||(t.device==="touch"&&this.chart.ctx.chartService.touch.dragAction==="hover"&&t.sourceEvent.preventDefault(),e!==this.chart.ctx.widgets.seriesWidget))return;this.tooltip.lastHover=t,this.setHoverDevice("pointer"),this.highlight.pendingHoverEvent=t,this.hoverScheduler.schedule();let i;if(this.isState(65)){const{currentX:s,currentY:r}=t;i=this.pickNodes({x:s,y:r},"event");const a=i?.matches,o=a?.[0];o?.series.properties.selection.enabled||o?.series.hasEventListener("seriesNodeClick")||o?.series.hasEventListener("seriesNodeDoubleClick")||a!=null&&a.length>1&&this.chart.tooltip.pagination?this.chart.ctx.domManager.updateCursor(this.id,"pointer"):this.chart.ctx.domManager.updateCursor(this.id)}const n=!!i?.matches.length;this.emitSeriesAreaHoverEvent(t,n)}onClick(t,e){if(t.device==="keyboard"||(e===this.chart.ctx.widgets.seriesWidget&&this.chart.ctx.animationManager.isActive()&&this.chart.ctx.animationManager.skipCurrentBatch(),t.device==="touch"&&e===this.chart.ctx.widgets.seriesWidget&&this.focusIndicator?.focus({preventScroll:!0,focusVisible:!1}),!this.isState(83)))return;if(e===this.chart.ctx.widgets.seriesWidget){if(!e.getElement().contains(t.sourceEvent.target))return}else if(t.sourceEvent.target!=e.getElement())return;this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(t,e);const i=e===this.chart.ctx.widgets.seriesWidget;if(this.isState(18)){i&&this.emitSeriesAreaClickEvent(t,!1);return}if(i){const s=this.checkSeriesNodeClick(t);if(s){this.emitSeriesAreaClickEvent(t,!0,s),this.update(7),t.sourceEvent.preventDefault();return}this.emitSeriesAreaClickEvent(t,!1)}const n={type:t.type==="click"?"click":"doubleClick",event:t.sourceEvent};this.chart.fireEvent(n)}emitSeriesAreaHoverEvent(t,e){const{canvasX:i,canvasY:n}=this.toCanvasCoordinates(t),s={canvasX:i,canvasY:n,consumed:e,sourceEvent:t.sourceEvent};this.chart.ctx.eventsHub.emit("series-area:hover",s)}emitSeriesAreaClickEvent(t,e,i){const{type:n,sourceEvent:s}=t,r={type:n,consumed:e,sourceEvent:s,clickedNode:i};this.chart.ctx.eventsHub.emit("series-area:click",r)}toCanvasCoordinates(t){return{canvasX:t.currentX+(this.hoverRect?.x??this.seriesRect?.x??0),canvasY:t.currentY+(this.hoverRect?.y??this.seriesRect?.y??0)}}onFocus(){if(!this.isState(69)||!this.focusIndicator)return;this.initFocus(this.chart.keyboard.initialFocus);const t=this.focusIndicator.onFocus();this.setHoverDevice(t?"keyboard":"pointer");const{pendingViewportFocus:e}=this.focus;this.refreshFocus()===4&&e&&(this.focus.pendingViewportFocus=void 0,this.pickViewportFocus(e))}onBlur(t){this.isState(69)&&(this.setHoverDevice("pointer"),!this.isState(1)&&!this.maybeEnterInteractiveTooltip(t)&&this.clearAll(!0),this.focusIndicator?.onBlur())}onKeyDown(t){if(!this.isState(87))return;const e=GR(t.sourceEvent);switch(e?.activatesFocusIndicator===!1&&this.focusIndicator?.overrideFocusVisible(this.getHoverDevice()==="keyboard"),e?.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:t});case"zoomout":return this.chart.ctx.eventsHub.emit("series:keynav-zoom",{delta:-1,widgetEvent:t});case"panxleft":return this.onPage(-1,t);case"panxright":return this.onPage(1,t);case"arrowup":return this.onArrow(-1,0,t);case"arrowdown":return this.onArrow(1,0,t);case"arrowleft":return this.onArrow(0,-1,t);case"arrowright":return this.onArrow(0,1,t);case"home":return this.onHome(t);case"end":return this.onEnd(t);case"submit":return this.onSubmit(t);case"delete":return;default:e?.name}}onPage(t,e){if(!this.chart.hasPgUpPgDownSupport()||!this.onNav(e))return;const i=this.focus.series?.axes.x?.options.reverse===!0;this.chart.ctx.eventsHub.emit("series:keynav-panx",{delta:t,reverse:i,widgetEvent:e})}onNav(t){return this.isState(69)?(this.setHoverDevice("keyboard"),this.focusIndicator?.overrideFocusVisible(!0),t.sourceEvent.preventDefault(),!0):!1}onArrow(t,e,i){this.onNav(i)&&(this.focus.seriesIndex+=t,this.focus.datumIndex+=e,this.handleFocusFromUserInput({datumIndexDelta:e,otherIndexDelta:t}))}onHome(t){if(this.chart.hasViewportSupport())return this.onPage("home",t);this.onNav(t)&&this.handleFocusFromUserInput({otherIndex:this.focus.seriesIndex,datumIndex:0})}onEnd(t){if(this.chart.hasViewportSupport())return this.onPage("end",t);if(!this.onNav(t))return;const e=this.focus.series?.data?.data.length;e!==void 0&&this.handleFocusFromUserInput({otherIndex:this.focus.seriesIndex,datumIndex:e-1})}onSubmit(t){if(!this.onNav(t))return;const{series:e,datum:i}=this.focus,n=t.sourceEvent;if(e!=null&&i!=null){if(e.fireNodeClickEvent(n,i)){const r={type:"click",device:"keyboard",sourceEvent:n};this.emitSeriesAreaClickEvent(r,!0,i),this.update(7)}}else this.chart.fireEvent({type:"click",event:n})}checkSeriesNodeClick(t){var e;const i=this.pickNodes({x:t.currentX,y:t.currentY},"event"),n=this.pickManager.onPickedNodesTooltip(i);if(i===void 0||n.active===void 0)return;const s=n.paginationState==null?i.distance:0;if(t.type==="click"){if(n.active.series.fireNodeClickEvent(t.sourceEvent,n.active)){const a=this.pickManager.nextCandidate();if(a.active!==void 0){const{active:o}=a,{canvasX:l,canvasY:c}=this.toCanvasCoordinates(t);(e=this.highlight).pendingHoverEvent??(e.pendingHoverEvent=this.highlight.appliedHoverEvent),this.handleHoverHighlight(!1,{active:o,defaultCb:()=>{this.showTooltip(o,l,c,a.paginationState)}})}}return n.active}if(t.type==="dblclick")return t.preventZoomDblClick=s===0,n.active.series.fireNodeDoubleClickEvent(t.sourceEvent,n.active),n.active}handleFocusFromUserInput(t){this.handleFocus(t),this.chart.ctx.eventsHub.emit("series:focus-change",null)}refreshFocus(){return this.handleFocus({datumIndexDelta:0,otherIndexDelta:0})}handleFocus(t){const e=this.chart.overlays.getFocusInfo(this.chart.ctx.localeManager);if(e==null){const i=this.handleSeriesFocus(t);return i===0?this.announceMode="when-changed":this.announceMode="always",i}else return this.focusIndicator?.update(e.rect,this.seriesRect,!1),this.swapChain.update(e.text),this.announceMode="always",0}handleSeriesFocus(t){return"datumIndexDelta"in t?this.handleSeriesFocusDeltas(t):this.handleSeriesFocusIndices(t)}makeUpdateFocusParamsFromDeltas(t){const{otherIndexDelta:e,datumIndexDelta:i}=t;if(this.chart.chartType==="standalone"){this.focus.series=this.focus.sortedSeries[0];const c=this.focus.datumIndex,h=this.focus.seriesIndex,u=this.focus.datumIndex-i,d=this.focus.seriesIndex-e;return{datumIndex:c,datumIndexDelta:i,oldDatumIndex:u,otherIndex:h,otherIndexDelta:e,oldOtherIndex:d}}const{focus:n}=this,s=n.sortedSeries.filter(c=>c.visible&&c.focusable);if(s.length===0)return 1;const r=n.datumIndex-i,a=n.seriesIndex-e;n.seriesIndex=te(0,n.seriesIndex,s.length-1),n.series=s[n.seriesIndex];const o=this.focus.datumIndex,l=this.focus.seriesIndex;return{datumIndex:o,datumIndexDelta:i,oldDatumIndex:r,otherIndex:l,otherIndexDelta:e,oldOtherIndex:a}}handleSeriesFocusDeltas(t){const e=this.makeUpdateFocusParamsFromDeltas(t);return e===1?1:this.pickFocus(e)}handleSeriesFocusIndices(t){const{datumIndex:e,otherIndex:i}=t,n=this.focus.datumIndex,s=this.focus.seriesIndex;return this.pickFocus({datumIndex:e,datumIndexDelta:e-n,oldDatumIndex:n,otherIndex:i,otherIndexDelta:i-s,oldOtherIndex:s})}pickFocus(t){const{datumIndex:e,datumIndexDelta:i,otherIndex:n,otherIndexDelta:s}=t,{focus:r,hoverRect:a,seriesRect:o}=this;if(r.series==null||a==null)return 1;const l={datumIndex:e,datumIndexDelta:i,otherIndex:n,otherIndexDelta:s,seriesRect:o},c=r.series.pickFocus(l);return c?this.updatePickedFocus(t,c):2}pickViewportFocus(t){const{focus:e,hoverRect:i}=this;if(e.series==null||i==null)return 1;const n=e.series.pickViewportFocus({where:t,hoverRect:i,otherIndex:e.seriesIndex});if(!n)return 2;const s={datumIndex:n.datumIndex,datumIndexDelta:0,oldDatumIndex:this.focus.datumIndex,otherIndex:n.otherIndex??this.focus.seriesIndex,otherIndexDelta:0,oldOtherIndex:this.focus.seriesIndex};return this.updatePickedFocus(s,n)}updatePickedFocus(t,e){const{datumIndexDelta:i,oldDatumIndex:n,otherIndexDelta:s,oldOtherIndex:r}=t,{focus:a,hoverRect:o}=this;if(a.series==null||o==null)return 1;if(a.pendingViewportFocus!==void 0)return 4;const{datum:l}=e;if(a.datum=l,a.datumIndex=e.datumIndex,e.otherIndex!=null&&(a.seriesIndex=e.otherIndex),this.focusIndicator?.isFocusVisible()){this.chart.ctx.animationManager.reset();const u=Tm(e),{x:d,y:g}=u.computeCenter();if(!o.containsPoint(d,g)){const C=a.series.mapFocusBBoxToPanTarget(o,u);if(this.chart.ctx.zoomManager?.panToBBox(o,C))return 3}const{x1:p,x2:f,y1:m,y2:y}=oa.from(u),b=o.containsPoint(p,m),v=o.containsPoint(f,m),S=o.containsPoint(p,y),M=o.containsPoint(f,y);if(!(b||v||S||M)){const C=oa.from(o);e.movedBounds=u.clone(),p<C.x1&&f<C.x1?(e.movedBounds.x=C.x1-2,e.movedBounds.width=4):p>C.x2&&f>C.x2&&(e.movedBounds.x=C.x2-2,e.movedBounds.width=4),m<C.y1&&y<C.y1?(e.movedBounds.y=C.y1-2,e.movedBounds.height=4):m>C.y2&&y>C.y2&&(e.movedBounds.y=C.y2-2,e.movedBounds.height=4)}}this.focusIndicator?.update(e.movedBounds??e.bounds,this.seriesRect,e.clipFocusBox);const c=this.getTooltipContent(l,"aria-label"),h=hE(a.series,o,e);if(h!=null&&this.getHoverDevice()==="keyboard"&&(this.clearCachedEvents(),!this.isState(1))){const u=Pd.makeTooltipMeta(h,a.series,l,e.movedBounds);this.pickManager.maybeActivate(l,({series:d})=>{this.chart.ctx.highlightManager.updateHighlight(this.id,l),this.isTooltipEnabled(d)&&this.chart.ctx.tooltipManager.updateTooltip(this.id,u,c)},{defaultCbArg:{series:a.series}})}return this.maybeAnnouncePickedFocus(i,n,s,r,e,c),0}maybeAnnouncePickedFocus(t,e,i,n,s,r){const{focus:a}=this;let o;this.announceMode==="when-changed"?t===0&&i===0||e!==s.datumIndex||n!==(s.otherIndex??a.seriesIndex)?o="always":o="never":o=this.announceMode,o==="always"&&this.swapChain.update(this.getDatumAriaText(s.datum,r))}getDatumAriaText(t,e){const i=e==null?"":X1(e);return this.chart.ctx.localeManager.t("ariaAnnounceHoverDatum",{datum:t.series.getDatumAriaText?.(t,i)??i})}clearHighlight(t=!1){this.pickManager.maybeActivate(void 0,()=>{this.highlight.pendingHoverEvent=void 0,this.highlight.appliedHoverEvent=void 0,this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,t)})}clearTooltip(t=!1){this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0,t),this.tooltip.lastHover=void 0}clearAll(t=!1){this.isState(1)||(this.pickManager.onClearUI(),this.clearHighlight(t),this.pickManager.wasActivationPrevented()||this.clearTooltip(t),this.focusIndicator?.clear())}clearStaleHighlightTooltip(){this.getHoverDevice()==="setState"&&(this.clearCachedEvents(),this.chart.ctx.highlightManager.updateHighlight(this.id,void 0),this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0))}clearUnpreventable(){this.activeState.lastActive=void 0,this.pickManager.onClearUI(),this.clearHighlight(!1),this.clearTooltip(!1)}clearCachedEvents(){this.tooltip.lastHover=void 0,this.highlight.appliedHoverEvent=void 0,this.highlight.pendingHoverEvent=void 0,this.highlight.stashedHoverEvent=void 0}createHoverScheduler(){return xE(this.chart.ctx.domManager.getDocument(),()=>{if(this.getHoverDevice()==="setState")return this.handleHoverFromState();if(!(!this.tooltip.lastHover&&!this.highlight.pendingHoverEvent)){if(this.chart.getUpdateType()<=7){this.hoverScheduler.schedule();return}this.highlight.pendingHoverEvent&&this.handleHoverHighlight(!1),this.tooltip.lastHover&&this.handleHoverTooltip(this.tooltip.lastHover,!1)}})}resetHoverScheduler(){this.hoverScheduler.cancel(),this.hoverScheduler=this.createHoverScheduler()}handleHoverFromState(){const{active:t,paginationState:e}=this.pickManager.onPickedNodesAPIDebounced();t!==void 0&&this.pickManager.maybeActivate(t,()=>{const i=Am(t.series,t,void 0);if(this.chart.tooltip.enabled){if(!t.series.visible)this.clearStaleHighlightTooltip();else if(i){const{canvasX:n,canvasY:s}=i,r=this.activeState.highlightInViewport;this.chart.ctx.highlightManager.updateHighlight(this.id,t,!1,r),r?this.showTooltip(t,n,s,e):this.clearTooltip()}}})}handleHoverHighlight(t,e){this.highlight.appliedHoverEvent=this.highlight.pendingHoverEvent,this.highlight.pendingHoverEvent=void 0;const i=this.highlight.appliedHoverEvent;if(!i||!this.isState(82))return;const{canvasX:n,canvasY:s}=this.toCanvasCoordinates(i);if(t?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(n,s)){this.clearHighlight();return}const{range:r}=this.chart.highlight,a=r==="tooltip"?"highlight-tooltip":"highlight",o=e?.active??this.pickManager.onPickedNodesHighlight(this.pickNodes({x:i.currentX,y:i.currentY},a));o===void 0?this.pickManager.maybeActivate(void 0,()=>{this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,!0),e?.defaultCb()}):this.pickManager.maybeActivate(o,()=>{this.chart.ctx.highlightManager.updateHighlight(this.id,o,!1),e?.defaultCb()})}handleHoverTooltip(t,e){if(!this.isState(82))return;const{canvasX:i,canvasY:n}=this.toCanvasCoordinates(t),s=t.sourceEvent.target;if(e?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(i,n)){this.getHoverDevice()=="pointer"&&this.clearTooltip();return}if(s&&this.chart.tooltip.interactive&&this.chart.ctx.domManager.isManagedChildDOMElement(s,"canvas-overlay",Ut))return;const r=this.pickNodes({x:t.currentX,y:t.currentY},"tooltip"),{active:a,paginationState:o}=this.pickManager.onPickedNodesTooltip(r);this.pickManager.wasActivationPrevented()||(a===void 0?this.getHoverDevice()=="pointer"&&this.clearTooltip(!0):this.showTooltip(a,i,n,o))}showTooltip(t,e,i,n){const s=this.getTooltipContent(t,"tooltip");if(s!=null&&s.length>0){const{series:a}=t,o=Pd.makeTooltipMeta({type:"pointermove",canvasX:e,canvasY:i},a,t,void 0);this.chart.ctx.tooltipManager.updateTooltip(this.id,o,s,n)}else this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0,!0)}maybeEnterInteractiveTooltip(t){return this.chart.tooltip.maybeEnterInteractiveTooltip(t,()=>{this.pickManager.maybeActivate(void 0,()=>{this.tooltip.lastHover=void 0,this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0,!0),this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,!0)})})}changeHighlightDatum(t){const e=t.previousHighlight?.series,i=t.currentHighlight?.series;e?.properties.cursor&&t.previousHighlight?.datum&&this.chart.ctx.domManager.updateCursor(e.id),i?.properties.cursor&&i.properties.cursor!=="default"&&t.currentHighlight?.datum&&this.chart.ctx.domManager.updateCursor(i.id,i.properties.cursor);const n=e?.isHighlightEnabled()??!1;if(t.highlightSuppressed&&!n)return;const s=t.highlightSuppressed!==!n;this.getHoverDevice()==="setState"||i==null||e==null||s?this.update(7,{clearCallbackCache:!0}):this.update(7,{seriesToUpdate:new Set([e,i].filter(Boolean)),clearCallbackCache:!0})}onHighlightSelectionUpdate(t){if(!this.isState(1)||!this.seriesRect){this.activeState.highlightInViewport=!0;return}if(t.highlightSelection.length===0)return;const e=jR(t.highlightSelection,this.seriesRect);this.activeState.highlightInViewport=e}pickNodes(t,e,i){const n=[...this.series].reverse(),s=e==="event"||e==="context-menu",r=e==="tooltip"||e==="highlight-tooltip",a=d=>{if(s)return d.properties.nodeClickRange;if(r)return d.properties.tooltip.range},{x:o,y:l}=t,c=new Set;for(const d of n)d.visible&&d.contentGroup.visible&&a(d)==="area"&&d.isPointInArea?.(o,l)&&c.add(d);const h=c.size>0;let u;for(const d of n){if(!d.visible||!d.contentGroup.visible||h&&!(a(d)==="area"&&c.has(d)))continue;const g=d.pickNodes(t,e,i);if(g==null||g.datums.length===0)continue;const{datums:p,distance:f}=g;if(g.datums.length!==0)if(f===0){u?.distance!==0&&(u={matches:[],distance:0});for(const m of p)u.matches.push(m)}else(u==null||u.distance>f)&&(u={matches:p,distance:f})}return u}isTooltipEnabled(t){return t.tooltipEnabled??this.chart.tooltip.enabled}getTooltipContent(t,e){const{series:i,datumIndex:n}=t;let s;if(e==="aria-label"||this.isTooltipEnabled(i)){const{cachedTooltipContent:r}=this;if(r?.series===i&&r.datumIndex===n)s=r.content;else{const a=this.chart.getTooltipContent(i,n,t,e);this.cachedTooltipContent={series:i,datumIndex:n,content:a},s=a}}else this.cachedTooltipContent=void 0;return s}onLegendHover(t){this.isState(82)&&(this.setHoverDevice("pointer"),this.clearCachedEvents(),this.chart.ctx.highlightManager.updateHighlight(this.id,void 0),this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0))}onActiveLoadMemento(t){switch(t.activeItem?.type){case void 0:case"legend":return this.onActiveClear();case"series-node":return this.onActiveDatum(t.activeItem,t);default:return t.activeItem?.type}}onActiveClear(){this.pickManager.onClearAPI(),this.setHoverDevice("setState"),this.activeState.lastActive=void 0,this.clearHighlight(),this.clearTooltip()}refreshSetState(){if(this.activeState.lastActive===void 0)this.pickManager.onClearUI(),this.clearHighlight(!1),this.clearTooltip(!1);else if(this.activeState.lastActive!=="legend"){const{seriesId:t,itemId:e}=this.activeState.lastActive,i=this.findPickedNodes(t,e);i===void 0?this.clearUnpreventable():i==="series-hidden"?this.isState(1)?this.clearStaleHighlightTooltip():this.pickManager.maybeActivate(void 0,()=>{this.activeState.lastActive=void 0,this.clearCachedEvents(),this.chart.ctx.highlightManager.updateHighlight(this.id,void 0),this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0)}):(this.pickManager.onPickedNodesAPI(i),this.hoverScheduler.schedule())}}onActiveDatum(t,e){const{seriesId:i,itemId:n}=t,s=this.findPickedNodes(i,n);if(s===void 0)e.reject(),this.onActiveClear();else{if(s!=="series-hidden"){const r=this.pickManager.onPickedNodesAPI(s);e.setDatum(r)}this.setHoverDevice("setState"),this.activeState.lastActive={seriesId:i,itemId:n},e.initialState?(this.chart.ctx.scene.applyPendingResize(),this.handleHoverFromState()):(this.clearCachedEvents(),this.hoverScheduler.schedule())}}findPickedNodes(t,e){const i=this.series.find(s=>s.id===t);if(i==null){j.warn(`Cannot find seriesId: "${t}"`);return}if(!i.visible)return"series-hidden";const n=i.findNodeDatum(e);if(n==null){j.warn(`Cannot find itemId: ${JSON.stringify(e)}`);return}return{matches:[n],distance:0}}};SI.className="SeriesAreaManager";var MI=30,$R=class{constructor(t){this.seriesRoot=t,this.groups=new Map,this.series=new Map,this.expectedSeriesCount=1,this.mode="normal"}setSeriesCount(t){this.expectedSeriesCount=t}getGroupIndex(t){const{internalId:e,seriesGrouping:i}=t;return i?.groupIndex??e}getGroupType(t,e){return e?"top":t.type}requestGroup(t){const{internalId:e,contentGroup:i}=t,n=t.bringToFront(),s=this.getGroupType(t,n),r=this.getGroupIndex(t),a=this.series.get(e);if(a!=null)throw new Error(`AG Charts - series already has an allocated layer: ${JSON.stringify(a)}`);this.series.size===0&&(this.mode=this.expectedSeriesCount>=MI?"aggressive-grouping":"normal");let o=this.groups.get(s);o==null&&(o=new Map,this.groups.set(s,o));const l=this.lookupIdx(r);let c=o.get(l);return c==null&&(c={type:s,id:l,seriesIds:[],group:this.seriesRoot.appendChild(new ne({name:`${t.contentGroup.name??s}-managed-layer`,zIndex:t.contentGroup.zIndex,renderToOffscreenCanvas:!1}))},o.set(l,c)),this.series.set(e,{layerState:c,seriesConfig:t,bringToFront:n}),c.seriesIds.push(e),c.group.appendChild(i),c.group}changeGroup(t){const{internalId:e,contentGroup:i}=t,n=t.bringToFront(),s=this.getGroupType(t,n),r=this.series.get(e),a=r?this.getGroupType(r.seriesConfig,r.bringToFront):void 0,o=this.getGroupIndex(t),l=this.lookupIdx(o),c=this.groups.get(s)?.get(l);if(!(a===s&&c?.seriesIds.includes(e)===!0))return this.series.has(e)&&this._releaseGroup({internalId:e,contentGroup:i,type:a}),this.requestGroup(t)}releaseGroup(t){const{internalId:e,contentGroup:i}=t,n=this.getGroupType(t,t.bringToFront());this._releaseGroup({internalId:e,contentGroup:i,type:n})}_releaseGroup(t){const{internalId:e,contentGroup:i,type:n}=t;if(!this.series.has(e))throw new Error(`AG Charts - series doesn't have an allocated layer: ${e}`);const s=this.series.get(e)?.layerState;s&&(s.seriesIds=s.seriesIds.filter(r=>r!==e),i.remove()),s?.seriesIds.length===0?(s.group.remove(),this.groups.get(s.type)?.delete(s.id),this.groups.get(n)?.delete(e)):s!=null&&s.seriesIds.length>0&&(s.group.zIndex=this.getLowestSeriesZIndex(s.seriesIds)),this.series.delete(e)}updateLayerCompositing(){for(const t of this.groups.values())for(const e of t.values()){const{group:i,seriesIds:n}=e;let s;n.length===0?s=!1:n.length>1?s=!0:s=this.series.get(n[0])?.seriesConfig.renderToOffscreenCanvas()===!0,i.renderToOffscreenCanvas=s,i.zIndex=this.getLowestSeriesZIndex(n)}}lookupIdx(t){return this.mode==="normal"?t:typeof t=="string"&&(t=Number(t.split("-").at(-1)),!Number.isFinite(t))?0:Math.floor(te(0,t/this.expectedSeriesCount,1)*MI)}destroy(){for(const t of this.groups.values())for(const e of t.values())e.group.remove();this.groups.clear(),this.series.clear()}getLowestSeriesZIndex(t){let e;for(const i of t){const s=this.series.get(i)?.seriesConfig.contentGroup.zIndex??1;if(e==null||s==null){e=s;continue}e=tS(e,s)<=0?e:s}return e??1}},II=class extends Te{constructor(){super(...arguments),this.dragAction="drag"}};x([I],II.prototype,"dragAction",2);var UR={min:0,max:1},WR=class{constructor(t,e,i,n,s){this.chart=t,this.eventsHub=e,this.chartState=i,this.dataService=n,this.animationManager=s,this.dirtyZoom=!1,this.dirtyDataSource=!1,this.lastAxisZooms=new Map,this.cleanup=new nt,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.eventsHub.on("update:complete",r=>this.onUpdateComplete(r)),this.eventsHub.on("zoom:change-complete",()=>this.onZoomChange()))}destroy(){this.cleanup.flush()}onDataLoad(){this.animationManager.skip(),this.eventsHub.emit("chart:request-update",{type:1})}onDataError(){this.eventsHub.emit("chart:request-update",{type:5})}onDataSourceChange(){this.dirtyDataSource=!0}onUpdateComplete(t){!t.apiUpdate&&!this.dirtyZoom&&!this.dirtyDataSource||t.wasShortcut||this.updateWindow(t)}onZoomChange(){this.dirtyZoom=!0}updateWindow(t){if(!this.dataService.isLazy())return;const e=this.chart.axes.find(({direction:s})=>s==="x");let i,n=!0;if(e){const s=bc(this.chartState.getValue("zoom"),e.direction)??UR;i=this.getAxisWindow(e,s),n=this.shouldRefresh(t,e,s)}this.dirtyZoom=!1,this.dirtyDataSource=!1,n&&this.dataService.load({windowStart:i?.start,windowEnd:i?.end})}shouldRefresh(t,e,i){if(t.apiUpdate||this.dirtyDataSource)return!0;if(!this.dirtyZoom)return!1;const n=this.lastAxisZooms.get(e.id);return n&&i.min===n.min&&i.max===n.max?!1:(this.lastAxisZooms.set(e.id,i),!0)}getAxisWindow(t,e){const i=this.getDomainPixelExtents(t);if(!i)return;const[n,s]=i;let r,a;return n<=s?(r=t.scale.invert(0,!0),a=t.scale.invert(n+(s-n)*e.max,!0)):(r=t.scale.invert(n-(n-s)*e.min,!0),a=t.scale.invert(0,!0)),{start:r,end:a}}getDomainPixelExtents(t){const[e,i]=t.scale.range;if(!(!Ee(e)||!Ee(i)))return[e,i]}},KR=/^((?!chrome|android).)*safari/i,YR=/Version\/(\d+(\.\d+)?)/,ZR=/Chrome/,XR=/Chrome\/(\d+)/,qR=/Edg/,JR=/OPR/;function QR(){const{userAgent:t}=Hn("navigator");if(KR.test(t)){const e=YR.exec(t);if(e==null)return!1;const i=Number.parseFloat(e[1]),n=Math.floor(i)>16;return n||j.warnOnce(`Unsupported Safari version: ${i}; ${t}`),!n}else if(ZR.test(t)&&!qR.test(t)&&!JR.test(t)){const e=XR.exec(t);if(e==null)return!1;const i=Number.parseInt(e[1],10),n=i>126;return n||j.warnOnce(`Unsupported Chrome version: ${i}; ${t}`),!n}return!1}var eP=new Set(["map-shape-background","map-line-background"]),tP=class{constructor(t,e,i,n,s,r,a){this.chartLike=t,this.overlays=e,this.eventsHub=i,this.dataService=n,this.localeManager=s,this.animationManager=r,this.domManager=a,this.cleanup=new nt,this.overlayState=void 0,this.overlayElem=this.domManager.addProxyChild("canvas-overlay","overlay"),this.overlayElem.setAttr("role","status"),this.overlayElem.setAttr("aria-atomic","false"),this.overlayElem.setAttr("aria-live","polite"),this.overlayElem.toggleClass(qm,!0),this.cleanup.register(this.eventsHub.on("layout:complete",o=>this.onLayoutComplete(o)))}destroy(){this.cleanup.flush(),this.domManager.removeChild("canvas-overlay","overlay")}onLayoutComplete({series:{rect:t}}){const e=this.dataService.isLoading(),i=this.chartLike.series.some(a=>a.hasData),n=this.chartLike.series.some(a=>a.visible&&!eP.has(a.type));this.overlayElem.toggleClass(PR,this.overlays.darkTheme),this.overlayElem.setProperty("left",`${t.x}px`),this.overlayElem.setProperty("top",`${t.y}px`),this.overlayElem.setProperty("width",`${t.width}px`),this.overlayElem.setProperty("height",`${t.height}px`);let s;if(e?s="loading":i?n?this.overlays.unsupportedBrowser.enabled&&QR()&&(s="unsupported-browser"):s="no-visible-series":s="no-data",s!==this.overlayState){const a=this.getOverlayFromState(this.overlayState);a&&this.hideOverlay(a),this.overlayState=s}const r=this.getOverlayFromState(this.overlayState);r&&this.showOverlay(r,t),this.overlayElem.setAttr("aria-hidden",String(this.overlayState==null))}getOverlayFromState(t){switch(t){case"loading":return this.overlays.loading;case"no-data":return this.overlays.noData;case"no-visible-series":return this.overlays.noVisibleSeries;case"unsupported-browser":return this.overlays.unsupportedBrowser}}showOverlay(t,e){if(!t.enabled)return;const i=t.getElement(this.chartLike,this.animationManager,this.localeManager,e);this.overlayElem.appendChild(i)}hideOverlay(t){t.removeElement(()=>{this.overlayElem.innerText="\xA0"},this.animationManager)}},Vn=ue.create(!0,"opts"),iP=new Set(["interval","autoRotate","autoRotateAngle","itemStyler","minSpacing","rotation"]),nP=new Set(["top","bottom"]),sP=new Set(["time","unit-time","ordinal-time"]);function rP(t,e){const i=e.context;i!==void 0?t.context=i:"context"in t&&delete t.context}var aP=new Set(["thickness","title","crosshair","depthOptions"]),oP=["step","values","minSpacing","maxSpacing"];function lP(t,e){const i={...e,...t??{}};for(const n of oP)i[n]=t?.[n];return i}function cP(t){const e=t,i={};for(const n of Object.keys(e))aP.has(n)||(i[n]=e[n]);return i}function hP(t){return!Array.isArray(t)||t.length===0?[{label:{enabled:!0}}]:t.map((e,i)=>i===0?e:ge({label:{enabled:!1}},e))}function uP(t){const e=t.axes;if(e==null)return t;const i=t.navigator?.miniChart?.label,n={};for(const a of Object.keys(i??{}))iP.has(a)||(n[a]=i[a]);const s=i?.interval,r={};for(const[a,o]of vt(e)){const l=nP.has(o.position??""),c=l&&o.type==="grouped-category",h=l?n:{},u=l?{enabled:!c,...c?{rotation:0}:{}}:{enabled:!1},d=l?{enabled:!1}:void 0,g=l&&sP.has(o.type??"")?{enabled:!1}:void 0,p=o.depthOptions,f=c?hP(p):void 0,y={...cP(o),label:ge(u,h,o.label),gridLine:ge({enabled:!1},o.gridLine),tick:ge({enabled:!1},o.tick),line:ge(d,o.line),interval:l?lP(s,o.interval):o.interval,title:{enabled:!1}};if(g!=null){const b=o.parentLevel;y.parentLevel=ge(g,b)}f!=null&&(y.depthOptions=f),r[a]=y}return{...t,axes:r}}var qe=class qA extends KM{constructor(e,i){var n;super(),this.id=Nn(this),this.seriesRoot=new $t({name:`${this.id}-series-root`,zIndex:7}),this.annotationRoot=new $t({name:`${this.id}-annotation-root`,zIndex:11}),this.selectionRoot=new $t({name:`${this.id}-selection-root`,zIndex:11}),this.titleGroup=new ne({name:"titles",zIndex:15,renderToOffscreenCanvas:!0,optimizeForInfrequentRedraws:!0}),this.debug=ue.create(!0,"chart"),this.extraDebugStats={},this.data=jc.empty(),this.loading=void 0,this._firstAutoSize=!0,this._autoSizeNotify=new _p,this._requiredRange=0,this._requiredRangeDirection="x",this.chartCaptions=new wd,this.padding=new ia(20),this.keyboard=new Vd,this.touch=new II,this.mode="standalone",this.withinStudio=void 0,this.styleNonce=void 0,this.formatter=void 0,this.suppressFieldDotNotation=!1,this.loadGoogleFonts=!1,this.dataIdKey=void 0,this.destroyed=!1,this.cleanup=new nt,this.chartAnimationPhase="initial",this.modulesManager=new RR,this.processors=[],this.queuedUserOptions=[],this.queuedChartOptions=[],this.firstApply=!0,this.syncStatus="init",this.fireEventWrapper=d=>super.fireEvent(d),this.apiUpdate=!1,this._pendingFactoryUpdatesCount=0,this._performUpdateSkipAnimations=!1,this._performUpdateNotify=new _p,this.performUpdateType=10,this.runningUpdateType=10,this.currentProcessingUpdateType=10,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new vE,this.clearCallbackCacheOnUpdate=!1,this.updateRequestors={},this.performUpdateTrigger=Fm(({count:d})=>{this.destroyed||this.updateMutex.acquire(this.tryPerformUpdate.bind(this,d)).catch(g=>j.errorOnce(g))}),this._performUpdateSplits={},this._previousSplit=0,this.axes=this.createChartAxes(),this.series=[],this._cachedData=void 0,this.onSeriesNodeClick=d=>{this.fireEvent(d)},this.onSeriesNodeDoubleClick=d=>{this.fireEvent(d)},this.onSeriesVisibilityChange=d=>{this.fireEvent(d)},this.seriesGroupingChanged=d=>{if(!(d instanceof Nm))return;const{series:g,seriesGrouping:p}=d;if(g.contentGroup.isRoot())return;const f=this.seriesLayerManager.changeGroup({internalId:g.internalId,type:g.type,contentGroup:g.contentGroup,bringToFront:()=>g.bringToFront(),renderToOffscreenCanvas:()=>g.renderToOffscreenCanvas(),seriesGrouping:p});f!=null&&g.attachSeries(f,this.seriesRoot,this.annotationRoot)},this.chartOptions=e;const s=i?.scene,r=i?.container??e.processedOptions.container??void 0,a=i?.styleContainer??e.specialOverrides.styleContainer,o=e.specialOverrides.skipCss;s&&(this._firstAutoSize=!1,this._lastAutoSize=[s.width,s.height,s.pixelRatio]);const l=new ne({name:"root"});l.visible=!1,l.append(this.seriesRoot),l.append(this.annotationRoot),l.append(this.selectionRoot),l.append(this.titleGroup),this.titleGroup.append(this.title.node),this.titleGroup.append(this.subtitle.node),this.titleGroup.append(this.footnote.node);const c=new Ax(e.specialOverrides.document,e.specialOverrides.window);this.tooltip=new Rn(c),this.seriesLayerManager=new $R(this.seriesRoot),this.mode=e.userOptions.mode??this.mode,this.styleNonce=e.processedOptions.styleNonce;const h=this.ctx=DR(this,{chartType:this.getChartType(),scene:s,root:l,container:r,styleContainer:a,skipCss:o,agDocument:c,domMode:e.optionMetadata.domMode,withDragInterpretation:e.optionMetadata.withDragInterpretation??!0,syncManager:new LR(this),fireEvent:d=>this.fireEvent(d),updateMutex:this.updateMutex});e.optionMetadata.presetType==="sparkline"&&(h.highlightManager.unhighlightDelay=0,h.tooltipManager.removeDelay=0),this.cleanup.register(h.eventsHub.on("dom:resize",()=>this.parentResize(h.domManager.containerSize)),h.eventsHub.on("font:load",()=>{this.title.node.markDirty(),this.subtitle.node.markDirty(),this.footnote.node.markDirty(),this.update(5)}),h.eventsHub.on("rtl:change",()=>{h.scene.setDirection(h.domManager.isRtl),this.update(5)}),h.eventsHub.on("chart:request-update",d=>this.update(d.type,d.opts)),h.scene.on("scene-changed",()=>this.update(9))),h.scene.setDirection(h.domManager.isRtl),this.overlays=new ol,(n=this.overlays.loading).renderer??(n.renderer=()=>FR(h.agDocument,this.overlays.loading.getText(h.localeManager),h.animationManager.defaultDuration)),this.processors=[new WR(this,h.eventsHub,h.chartState,h.dataService,h.animationManager),new tP(this,this.overlays,h.eventsHub,h.dataService,h.localeManager,h.animationManager,h.domManager)],this.highlight=new Fd,this.container=r;const u=this.getModuleContext();this.background=Hs.createBackground?.(u)??new nl(u),this.foreground=Hs.createForeground?.(u),this.seriesArea=new Uc(u),h.domManager.setDataBoolean("animating",!1),h.domManager.setDataNumber("animationTimeMs",0),this.seriesAreaManager=new SI(this.initSeriesAreaDependencies()),this.cleanup.register(h.layoutManager.registerElement(0,d=>{d.layoutBox.shrink(this.padding.toJson()),this.chartCaptions.positionCaptions(d)}),h.eventsHub.on("layout:complete",d=>this.chartCaptions.positionAbsoluteCaptions(d)),h.eventsHub.on("data:load",d=>{this.data=this.createDataSet(d.data)}),this.title.registerInteraction(u,"beforebegin"),this.subtitle.registerInteraction(u,"beforebegin"),this.footnote.registerInteraction(u,"afterend"),()=>this.title.destroy(),()=>this.subtitle.destroy(),()=>this.footnote.destroy(),this.ctx.agDocument.attachListener("pagehide",d=>{d.persisted||this.destroy()}),h.animationManager.addListener("animation-frame",()=>{this.update(9),h.domManager.setDataNumber("animationTimeMs",h.animationManager.getCumulativeAnimationTime())}),h.animationManager.addListener("animation-start",()=>h.domManager.setDataBoolean("animating",!0)),h.animationManager.addListener("animation-stop",()=>{h.domManager.setDataBoolean("animating",!1),h.domManager.setDataNumber("animationTimeMs",h.animationManager.getCumulativeAnimationTime())}),h.eventsHub.on("zoom:change-complete",()=>{const d=this.chartAnimationPhase==="initial";for(const g of this.series)g.animationState?.transition("updateData");if(d)for(const g of this.axes)g.resetAnimation(this.chartAnimationPhase);this.update(5,{forceNodeDataRefresh:!0,skipAnimations:!d})})),this.parentResize(h.domManager.containerSize)}static getInstance(e){return qA.chartsInstances.get(e)}get canvasElement(){return this.ctx.scene.canvas.element}download(e,i){this.ctx.scene.download(e,i)}getCanvasDataURL(e){return this.ctx.scene.getDataURL(e)}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}isDataTransactionSupported(){return!0}createDataSet(e){return jc.replaceWith(this.data,e,this.dataIdKey)}overrideFocusVisible(e){this.seriesAreaManager.focusIndicator?.overrideFocusVisible(e)}fireEvent(e){dn(this,this.fireEventWrapper,e)}hasListener(e){return this.hasEventListener(e)}callListener(e){this.fireEvent(e)}initSeriesAreaDependencies(){const{ctx:e,tooltip:i,highlight:n,keyboard:s,overlays:r,seriesRoot:a,mode:o}=this,l=this.getChartType(),c=()=>this.hasViewportSupport(),h=()=>this.hasPgUpPgDownSupport(),u=this.fireEvent.bind(this);return{hasViewportSupport:c,hasPgUpPgDownSupport:h,fireEvent:u,getUpdateType:()=>this.performUpdateType,getTooltipContent:(p,f,m,y)=>this.getTooltipContent(p,f,m,y),chartType:l,ctx:e,tooltip:i,highlight:n,keyboard:s,overlays:r,seriesRoot:a,mode:o}}getModuleContext(){return this.ctx}getTooltipContent(e,i,n,s){const a=s==="aria-label"||e.properties.tooltip.enabled!==!1?e.getTooltipContent(i,n):void 0,o=a==null?[]:[a];if(this.tooltip.mode!=="shared"||this.series.length===1)return o;const l=e.getCategoryValue(i);return l==null?o:this.series.flatMap(c=>{if(c===e)return o;if(!c.isEnabled()||c.properties.tooltip.enabled===!1)return[];const h=c.datumIndexForCategoryValue(l),u=h==null?void 0:c.getTooltipContent(h,void 0);return u==null?[]:[u]})}getCaptionText(){return[this.title,this.subtitle,this.footnote].filter(e=>e.enabled&&e.text).map(e=>e.text).join(". ")}getAriaLabel(){return this.ctx.localeManager.t("ariaAnnounceChart",{seriesCount:this.series.length})}refreshSeriesUserVisibility(e,i){for(let n=0;n<this.series.length;n++){const s=this.series[n],r=e.processedOptions.series?.[n];(i.identifiers.has(s.id)||i.indices.has(n))&&r!==void 0&&"visible"in r&&(r.visible=s.visible)}}getSelection(){return this.modulesManager.selection()?.getSelection()}setSelection(e){return this.modulesManager.selection()?.setSelection(e)}clearSelection(){return this.modulesManager.selection()?.clearSelection()}resetAnimations(){this.chartAnimationPhase="initial";for(const e of this.series)e.resetAnimation(this.chartAnimationPhase);for(const e of this.axes)e.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(e){if(this.destroyed)return;this.destroyed=!0;const i=e?.keepTransferableResources;let n;this.performUpdateType=10,this.cleanup.flush();for(const s of this.processors)s.destroy();return this.overlays.destroy(),this.modulesManager.destroy(),this.background.destroy(),this.foreground?.destroy(),this.seriesArea.destroy(),i?(this.ctx.scene.strip(),n={container:this.container,scene:this.ctx.scene}):(this.ctx.scene.destroy(),this.container=void 0),this.destroySeries(this.series),this.seriesLayerManager.destroy(),this.axes.destroy(),this.animationRect=void 0,this.ctx.destroy(),Object.freeze(this),n}requestFactoryUpdate(e){this.destroyed||(this._pendingFactoryUpdatesCount++,this.updateMutex.acquire(async()=>{if(!this.destroyed)try{await e(this)}finally{this.destroyed||this._pendingFactoryUpdatesCount--}}).catch(i=>j.errorOnce(i)))}clearCallbackCache(){this.ctx.callbackCache.invalidateCache();for(const e of this.series)e.resetDatumCallbackCache()}update(e=0,i){if(this.destroyed)return;const{forceNodeDataRefresh:n=!1,skipAnimations:s,seriesToUpdate:r=this.series,newAnimationBatch:a,apiUpdate:o=!1,clearCallbackCache:l=!1}=i??{};if(this.apiUpdate=o,this.ctx.widgets.seriesWidget.setDragTouchEnabled(this.touch.dragAction!=="none"),n)for(const c of this.series)c.markNodeDataDirty();for(const c of r)this.seriesToUpdate.add(c);if(s&&(this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0),a&&this.ctx.animationManager.isActive()&&(this._performUpdateSkipAnimations=!0),(e===0||l)&&(this.clearCallbackCacheOnUpdate=!0),this.debug.check()){let c=new Error("Stack trace for update tracking").stack??"<unknown>";c=c.replaceAll(/\([^)]*/g,""),this.updateRequestors[c]=e,this.currentProcessingUpdateType!==10&&this.currentProcessingUpdateType>=e&&this.debug.group(`Chart.update() - \u26A0\uFE0F received update for earlier update stage ${Tn[e]} \u26A0\uFE0F`,()=>{this.debug(`Current processing update type: ${Tn[this.currentProcessingUpdateType]}`),this.debug("Update from: ",c)})}e<this.performUpdateType&&(this.performUpdateType=e,this.ctx.domManager.setDataBoolean("updatePending",!0),this.performUpdateTrigger.schedule(i?.backOffMs))}updateSplits(e){const i=this._performUpdateSplits;i[e]??(i[e]=0),i[e]+=performance.now()-this._previousSplit,this._previousSplit=performance.now()}async tryPerformUpdate(e){try{const i=`${Tn[this.performUpdateType]} ${this.updateShortcutCount>0?"\u26A0\uFE0F redo #"+this.updateShortcutCount+" \u26A0\uFE0F ":""}`;await this.debug.group(`Chart.performUpdate() ${i}`,async()=>{await this.performUpdate(e)})}catch(i){j.error("update error",i,i.stack),this.runningUpdateType=10,this._performUpdateNotify.notify()}}async performUpdate(e){const{performUpdateType:i,extraDebugStats:n,_performUpdateSplits:s,ctx:r}=this,a=[...this.seriesToUpdate];switch(this.clearCallbackCacheOnUpdate&&(this.clearCallbackCacheOnUpdate=!1,this.clearCallbackCache()),this.performUpdateType=10,this.seriesToUpdate.clear(),this.runningUpdateType=i,this.currentProcessingUpdateType=i,r.chartState.flushChanges(),this.updateShortcutCount===0&&i<9&&(r.animationManager.startBatch(this._performUpdateSkipAnimations),r.animationManager.onBatchStop(()=>this.chartAnimationPhase="ready")),this.ctx.scene.updateDebugFlags(),this.debug("Chart.performUpdate() - start",Tn[i]),this._previousSplit=performance.now(),s.start??(s.start=this._previousSplit),r.domManager.setDeferring(!0),i){case 0:if(this.checkUpdateShortcut(0))break;this.ctx.eventsHub.emit("update:pre-dom",null),this.updateDOM();case 1:if(this.checkUpdateShortcut(1))break;this.updateData(),this.updateSplits("\u2B07\uFE0F");case 2:if(this.checkUpdateShortcut(2))break;if(await this.processData(),this.seriesAreaManager.dataChanged(),this.pendingLocaleText){const l=this.modulesManager.getModule("locale");l&&"localeText"in l&&(l.localeText=this.pendingLocaleText),this.pendingLocaleText=void 0}this.updateSplits("\u{1F4CA}");case 3:if(this.checkUpdateShortcut(3))break;await this.processDomains(),this.updateSplits("\u26F0\uFE0F");case 4:if(this.checkUpdateShortcut(4))break;this.processRanges(),this.updateSplits("\u{1F4D0}");case 5:if(await this.checkFirstAutoSize(),this.checkUpdateShortcut(5))break;r.chartState.flushChanges("legendData"),await this.processLayout(),this.updateSplits("\u2316");case 6:if(this.checkUpdateShortcut(6))break;this.preSeriesUpdate(),this.updateSplits("\u2753");case 7:{if(this.checkUpdateShortcut(7))break;this.seriesRoot.renderToOffscreenCanvas=this.highlight.drawingMode==="cutout",await this.updateSeries(a),this.updateAriaLabels(),this.seriesLayerManager.updateLayerCompositing(),this.updateSplits("\u{1F914}")}case 8:if(this.checkUpdateShortcut(8))break;r.eventsHub.emit("update:pre-scene-render",{apiUpdate:this.apiUpdate}),r.scene.updateBaseFont(),this.updateSplits("\u2196");case 9:if(this.checkUpdateShortcut(9))break;r.animationManager.endBatch(),n.updateShortcutCount=this.updateShortcutCount,r.scene.render({debugSplitTimes:s,extraDebugStats:n,seriesRect:this.seriesRect,debugColors:ue.check("scene:stats","scene:stats:verbose")?this.getDebugColors():void 0}),this.extraDebugStats={};for(const l of Object.keys(s))delete s[l];this.ctx.domManager.incrementDataCounter("sceneRenders");case 10:this.updateShortcutCount=0,this.updateRequestors={},this.currentProcessingUpdateType=10,this._performUpdateSkipAnimations=!1,r.animationManager.endBatch()}this.destroyed||(r.eventsHub.emit("update:complete",{apiUpdate:this.apiUpdate,wasShortcut:this.updateShortcutCount>0}),this.apiUpdate=!1,this.ctx.domManager.setDataBoolean("updatePending",!1),this.runningUpdateType=10,this.syncStatus="ready"),this._performUpdateNotify.notify(),r.domManager.setDeferring(!1);const o=performance.now();this.debug("Chart.performUpdate() - end",{chart:this,durationMs:Th(o-s.start),count:e,performUpdateType:Tn[i]})}updateThemeClassName(){const e="ag-charts-theme-",i=[`${e}default`,`${e}default-dark`];let n=i[0],s=!1,{theme:r}=this.chartOptions.processedOptions;for(;typeof r!="string"&&r!=null;)r=r.baseTheme;typeof r=="string"&&(n=r.replace("ag-",e),s=r.includes("-dark")),i.includes(n)||(n=s?i[1]:i[0]),this.ctx.domManager.setThemeClass(n)}updateDOM(){this.updateThemeClassName();const{enabled:e,tabIndex:i}=this.keyboard;this.ctx.domManager.setTabGuardIndex(e?i??0:-1),this.ctx.domManager.setThemeParameters(this.chartOptions.themeParameters)}updateAriaLabels(){this.ctx.domManager.updateCanvasLabel(this.getAriaLabel())}checkUpdateShortcut(e){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<=e?(this.debug("Chart.checkUpdateShortcut() - BLOCKED AT: ",Tn[e]," BY REQUEST FOR: ",Tn[this.performUpdateType]),this.updateShortcutCount++,!0):(this.debug("Chart.checkUpdateShortcut() - PROCEEDING TO: ",Tn[e]),this.currentProcessingUpdateType=e,!1)}async checkFirstAutoSize(){this.width!=null&&this.height!=null||this._lastAutoSize||await this._autoSizeNotify.waitForCompletion(500)||this.debug("Chart.checkFirstAutoSize() - timeout for first size update.")}createChartAxes(){return new Ad}onAxisChange(e,i){i==null&&e.length===0||this.ctx.axisManager.updateAxes(i??[],e)}onSeriesChange(e,i){const n=i?.filter(s=>!e.includes(s))??[];this.destroySeries(n),this.seriesLayerManager?.setSeriesCount(e.length);for(const s of e){if(i?.includes(s))continue;const r=this.seriesLayerManager.requestGroup(s);s.attachSeries(r,this.seriesRoot,this.annotationRoot),s.chart={},Object.defineProperty(s.chart,"mode",{get:()=>this.mode}),Object.defineProperty(s.chart,"isMiniChart",{get:()=>!1}),Object.defineProperty(s.chart,"flashOnUpdateEnabled",{get:()=>!!this.modulesManager.getModule("flashOnUpdate")?.enabled}),Object.defineProperty(s.chart,"seriesRect",{get:()=>this.seriesRect}),s.resetAnimation(this.chartAnimationPhase),this.addSeriesListeners(s)}this.seriesAreaManager?.seriesChanged(e)}destroySeries(e){if(e)for(const i of e)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(e){this.hasEventListener("seriesNodeClick")&&e.addEventListener("seriesNodeClick",this.onSeriesNodeClick),this.hasEventListener("seriesNodeDoubleClick")&&e.addEventListener("seriesNodeDoubleClick",this.onSeriesNodeDoubleClick),this.hasEventListener("seriesVisibilityChange")&&e.addEventListener("seriesVisibilityChange",this.onSeriesVisibilityChange),e.addEventListener("groupingChanged",this.seriesGroupingChanged)}assignSeriesToAxes(){for(const i of this.axes){let n=function(s){return s.axes[i.direction]===i};var e=n;i.boundSeries=this.series.filter(n)}}assignAxesToSeries(){for(const e of this.series)for(const i of e.directions){const n=e.getKeyAxis(i)??i,s=this.axes.findById(n);if(!s){j.warnOnce(`no matching axis for direction [${i}] and id [${n}]; check series and axes configuration.`);return}e.axes[i]=s}}parentResize(e){if(e==null||this.width!=null&&this.height!=null)return;let{width:i,height:n}=e;const{pixelRatio:s}=e;if(i=Math.floor(i),n=Math.floor(n),i===0&&n===0)return;const[r=0,a=0,o=1]=this._lastAutoSize??[];r===i&&a===n&&o===s||(this._lastAutoSize=[i,n,s],this.resize("SizeMonitor",{}))}resize(e,i){const{scene:n,animationManager:s}=this.ctx,{inWidth:r,inHeight:a,inMinWidth:o,inMinHeight:l,inOverrideDevicePixelRatio:c}=i;this.ctx.domManager.setSizeOptions(o??this.minWidth,l??this.minHeight,r??this.width,a??this.height);const h=r??this.width??this._lastAutoSize?.[0],u=a??this.height??this._lastAutoSize?.[1],d=c??this.overrideDevicePixelRatio??this._lastAutoSize?.[2];if(this.debug(`Chart.resize() from ${e}`,{width:h,height:u,pixelRatio:d,stack:new Error("Stack trace for resize tracking").stack}),!(h==null||u==null||!Ee(h)||!Ee(u))&&n.resize(h,u,d)){s.reset();let g=!0;(this.width==null||this.height==null)&&this._firstAutoSize&&(g=!1,this._firstAutoSize=!1);let p=5;for(const f of this.axes){const m=f.getUpdateTypeOnResize();m<p&&(p=m)}this.update(p,{forceNodeDataRefresh:!0,skipAnimations:g}),this._autoSizeNotify.notify()}}updateData(){this.ctx.eventsHub.emit("data:update",this.data)}async processData(){this.series.some(n=>n.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes());const e=new bI(this.mode,this.suppressFieldDotNotation,this.ctx.eventsHub),i=[];for(const n of this.series)i.push(n.processData(e)??Promise.resolve());for(const n of this.modulesManager.modules())n?.processData&&i.push(n.processData(e)??Promise.resolve());this._cachedData=e.execute(this._cachedData),this.updateSplits("\u{1F3ED}"),await Promise.all(i),this.updateLegends()}async processDomains(){for(const e of this.axes)e.processData();for(const e of this.series)e.updatedDomains()}processRanges(){var e;const i={},n={},s=new Map;this._requiredRangeDirection="x";for(const r of this.series)r.visible&&(i[e=r.type]??(i[e]=[]),r.getMinimumRangeSeries(i[r.type]),r.resolveKeyDirection("x")==="y"&&(this._requiredRangeDirection="y"),s.has(r.type)||s.set(r.type,r));for(const[r,a]of s)n[r]=a.getMinimumRangeChart(i[r]);Object.keys(n).length===0?this._requiredRange=0:this._requiredRange=Math.ceil(Math.max(...Object.values(n)));for(const r of this.axes)r.requiredRange=this._requiredRange}updateLegends(e){for(const i of ee.listModulesByType("plugin"))switch(i.name){case"legend":this.setCategoryLegendData(e);break;case"gradientLegend":const n=this.modulesManager.getModule("gradientLegend");n.data=this.series.filter(s=>s.properties.showInLegend).flatMap(s=>s.getLegendData("gradient"));break}}setCategoryLegendData(e){const{legendManager:i,stateManager:n}=this.ctx;if(e)for(const r of this.series){const a=e.find(o=>o.seriesId===r.id);r.onLegendInitialState("category",a)}const s=this.series.flatMap(r=>{const a=r.getLegendData("category");return i?.updateData(r.id,a),a});if(e&&i){n.setStateAndRestore(i,e);return}if(this.mode!=="integrated"){const r={},a=new Map(this.series.map(o=>[o.id,o]));for(const{seriesId:o,symbol:{marker:l},label:c}of s.filter(h=>!h.hideInLegend)){if(l.fill==null)continue;const h=a.get(o);if(!h?.hasData)continue;const u=h.type,d=r[u]??(r[u]=new Map);d.has(c.text)?d.get(c.text)!==l.fill&&j.warnOnce(`legend item '${Ue(c.text)}' has multiple fill colours, this may cause unexpected behaviour.`):d.set(c.text,l.fill)}}}async processLayout(){const e=this.animationRect,{width:i,height:n}=this.ctx.scene,s=this.ctx.layoutManager.createContext(i,n);await this.performLayout(s),e&&!this.animationRect?.equals(e)&&this.ctx.animationManager.skipCurrentBatch(),this.debug("Chart.performUpdate() - seriesRect",this.seriesRect)}getDebugColors(){const e=this.background.fill;if(e)try{const i=Oe.fromString(e),[n]=Oe.RGBtoOKLCH(i.r,i.g,i.b);return{background:e,foreground:n>.5?"black":"white"}}catch{return{background:e}}}preSeriesUpdate(){const{_requiredRange:e,seriesRect:i}=this;if(i==null)return;const n=this._requiredRangeDirection==="x"?i.width:i.height,s=e/n||0;this.ctx.eventsHub.emit("update:pre-series",{requiredRangeRatio:s,requiredRangeDirection:this._requiredRangeDirection,requiredRange:e})}async updateSeries(e){const{seriesRect:i}=this;function n(s){return s.update({seriesRect:i})}await Promise.all(e.map(n).filter(s=>s!=null)),this.ctx.seriesLabelLayoutManager.updateLabels(this.series.filter(s=>s.visible&&s.usesPlacedLabels),this.padding,this.seriesRect)}async waitForUpdate(e,i){const n=Hn("agChartsDebugTimeout");n==null?(e??(e=1e4),i??(i=!1)):(e=n,i??(i=!0));const s=performance.now();for(;(this._pendingFactoryUpdatesCount>0||this.performUpdateType!==10||this.runningUpdateType!==10||this.ctx.scene.waitingForUpdate()||this.data.hasPendingTransactions())&&!this.destroyed;){if(this._pendingFactoryUpdatesCount>0&&await this.updateMutex.waitForClearAcquireQueue(),(this.performUpdateType!==10||this.runningUpdateType!==10||this.data.hasPendingTransactions())&&await this._performUpdateNotify.waitForCompletion(),performance.now()-s>e){const r=`Chart.waitForUpdate() timeout of ${e} reached - first chart update taking too long.`;if(i)throw new Error(r);j.warnOnce(r)}yv()&&await Bp(),this.ctx.scene.waitingForUpdate()&&await Bp(50)}}filterMiniChartSeries(e){return e?.filter(i=>i.showInMiniChart!==!1)}applyOptions(e){e.seriesWithUserVisibility&&this.refreshSeriesUserVisibility(this.chartOptions,e.seriesWithUserVisibility);const i=5,n=this.firstApply?e.processedOptions:e.diffOptions(this.chartOptions);if(n==null||Object.keys(n).length===0){Vn("Chart.applyOptions() - no delta, forcing re-layout",n),this.update(i,{apiUpdate:!0,newAnimationBatch:!0});return}const s=this.firstApply?{}:this.chartOptions.processedOptions,r=e.processedOptions;Vn("Chart.applyOptions() - applying delta",n),this.ctx.chartState.setValue("options",e.processedOptions);const a=this.applyModules(),o=["type","data","series","listeners","preset","theme","legend","zoom","navigator.miniChart.series","navigator.miniChart.label","locale.localeText","axes","topology","nodes","initialState","styleContainer","formatter","displayNullData","enableRtl","selection"];"listeners"in n&&this.registerListeners(this,n.listeners),"enableRtl"in n&&this.ctx.domManager.setEnableRtl(n.enableRtl),Up(this,n,{skip:o});let l=!1,c="no-op";n.series!=null&&(c=this.applySeries(this,n.series,s?.series),l=!0),c==="replaced"&&this.resetAnimations(),this.applyAxes(this,r,s,c)&&(l=!0);const{userDeltaKeys:h}=e,u=h===void 0||h.has("data");let d=!1;if(n.data&&u){const b=n.data,v=e.userOptions.data,M=Array.isArray(b)&&b!==v?b.slice():b;this.data=this.createDataSet(M),d=!0}"dataIdKey"in n&&!(n.data&&u)&&this.data.dataIdKey!==this.dataIdKey&&(this.data=this.createDataSet(this.data.data),d=!0),c==="replaced"&&!d&&(this.data=this.createDataSet(this.data.data)),n.locale?.localeText&&(this.pendingLocaleText=n.locale?.localeText),this.chartOptions=e;const g=this.modulesManager.getModule("navigator");this.hasViewportSupport()||this.ctx.zoomManager?.updateZoom({source:"chart-update",sourceDetail:"internal-applyOptions"},{x:{min:0,max:1},y:{min:0,max:1}});const p=g?.miniChart,f=r.navigator?.miniChart?.series??r.series;p?.enabled===!0&&f!=null?this.applyMiniChartOptions(p,f,r,s):p?.enabled===!1&&(p.series=[],p.axes=[]),this.ctx.annotationManager?.setAnnotationStyles(e.annotationThemes),l||(l=this.shouldForceNodeDataRefresh(n,c));const y=l||a?0:i;if(this.maybeResetAnimations(c),this.shouldClearLegendData(r,s,c)&&this.ctx.legendManager?.clearData(),this.applyInitialState(r),this.ctx.formatManager.setFormatter(r.formatter),Vn("Chart.applyOptions() - update type",Tn[y],{seriesStatus:c,forceNodeDataRefresh:l}),e.optionsProcessingTime!==void 0){this._performUpdateSplits["\u2699\uFE0F"]=e.optionsProcessingTime;const b=performance.now()-e.optionsProcessingTime;this._performUpdateSplits.start=b}this.update(y,{apiUpdate:!0,forceNodeDataRefresh:l,newAnimationBatch:!0,clearCallbackCache:!0}),this.firstApply=!1}applyInitialState(e){const{activeManager:i,annotationManager:n,chartTypeOriginator:s,historyManager:r,stateManager:a,zoomManager:o}=this.ctx,{initialState:l}=e;if("annotations"in e&&e.annotations?.enabled&&l?.annotations!=null&&n){const c=l.annotations.map(h=>{const u=n.getAnnotationTypeStyles(h.type);return ge(h,u)});a.setState(n,c)}l?.chartType!=null&&a.setState(s,l.chartType),this.needsViewportSupport(e)&&l?.zoom!=null&&o&&a.setState(o,l.zoom),l?.active!=null&&a.setState(i,l.active),l?.collapsed!=null&&a.setState(this.ctx.collapsedManager,l.collapsed),l?.legend!=null&&this.updateLegends(l.legend),l!=null&&r.clear()}maybeResetAnimations(e){if(this.mode==="standalone")switch(e){case"series-grouping-change":case"replaced":this.resetAnimations();break;default:}}shouldForceNodeDataRefresh(e,i){const n=!!e.data||i==="data-change"||i==="replaced",s=["legend","gradientLegend"].some(a=>e[a]!=null),r=e.title!=null&&e.subtitle!=null||e.formatter!=null;return n||s||r}shouldClearLegendData(e,i,n){const s=n==="replaced"||n==="series-count-changed"||n==="series-grouping-change"||n==="updated"&&(e.series?.length!==i.series?.length||!e.series?.every((a,o)=>a.type===i.series?.[o].type)),r=i.legend!=null&&i.legend.enabled!==!1&&(e.legend==null||e.legend.enabled===!1);return s||r}applyMiniChartOptions(e,i,n,s){const r=s?.navigator?.miniChart?.series??s?.series,a=this.applySeries(e,this.filterMiniChartSeries(i),this.filterMiniChartSeries(r)),o=uP(n);this.applyAxes(e,o,s,a);const l=e.series;for(const h of l)h.properties.id=void 0;const c=e.axes;for(const h of c)h.nice=!1,h.interactionEnabled=!1}applyModules(){const{type:e}=this.constructor;let i=!1;for(const n of ee.listModulesByType("plugin")){const s=!n.chartType||n.chartType===e;if(s!==this.modulesManager.isEnabled(n.name)){if(s){n.register?.(this.getModuleContext());const r=n.create(this.getModuleContext());this.modulesManager.addModule(n.name,r),this[n.name]=r}else this.modulesManager.removeModule(n.name),delete this[n.name];i=!0}}return i}initSeriesDeclarationOrder(e){for(let i=0;i<e.length;i++)e[i].setSeriesIndex(i)}applySeries(e,i,n){if(!i)return"no-change";const s=ER(e.series,i,n);if(s.status==="no-overlap"){Vn(`Chart.applySeries() - creating new series instances, status: ${s.status}`,s);const u=i.map(d=>this.createSeries(d));return this.initSeriesDeclarationOrder(u),e.series=u,"replaced"}Vn("Chart.applySeries() - matchResult",s);const r=[];let a=!1,o=!1,l=!1,c=!1;const h=s.changes.toSorted((u,d)=>u.targetIdx-d.targetIdx);for(const u of h)switch(o||(o=u.status==="series-grouping"),a||(a=u.diff?.data!=null),l||(l=u.status!=="no-op"),c||(c=u.status==="add"||u.status==="remove"),u.status){case"add":{const d=this.createSeries(u.opts);r.push(d),Vn("Chart.applySeries() - created new series",d);break}case"remove":Vn(`Chart.applySeries() - removing series at previous idx ${u.idx}`,u.series);break;case"no-op":r.push(u.series),Vn(`Chart.applySeries() - no change to series at previous idx ${u.idx}`,u.series);break;case"series-grouping":case"update":default:{const{series:d,diff:g,idx:p}=u;Vn(`Chart.applySeries() - applying series diff previous idx ${p}`,g,d),this.applySeriesValues(d,g),d.markNodeDataDirty(),r.push(d)}}return this.initSeriesDeclarationOrder(r),Vn("Chart.applySeries() - final series instances",r),e.series=r,o?"series-grouping-change":c?"series-count-changed":a?"data-change":l?"updated":"no-op"}applyAxes(e,i,n,s){if(!("axes"in i)||!i.axes)return!1;const r=i.axes;if(!(s==="replaced")&&e.axes.matches(r)){for(const l of e.axes){const c=r[l.id];l.applyOptions(c),rP(l,c),this.applyAxisModules(l,c)}return!0}return Vn(`Chart.applyAxes() - creating new axes instances; seriesStatus: ${s}`),e.axes=this.createAxes(r),!0}createSeries(e){const n=ee.getSeriesModule(e.type).create(this.getModuleContext());return this.applySeriesOptionModules(n,e),this.applySeriesValues(n,e),n}applySeriesOptionModules(e,i){const n=e.createModuleContext(),s=e.getModuleMap();for(const r of ee.listModulesByType("series:plugin"))r.name in i&&(r.seriesTypes?.includes(e.type)??!0)&&s.addModule(r.name,r.create(n))}applySeriesValues(e,i){const n=e.getModuleMap(),{type:s,data:r,listeners:a,seriesGrouping:o,showInMiniChart:l,...c}=i;for(const h of ee.listModulesByType("series:plugin"))if(h.name in c){const u=n.getModule(h.name);if(u){const d=c[h.name];u.properties.set(d),delete c[h.name]}}c.visible!=null&&(e.visible=c.visible),e.properties.set(c),"data"in i&&e.setOptionsData(r==null?void 0:jc.wrap(r)),"listeners"in i&&(this.registerListeners(e,a),this.series.includes(e)&&this.addSeriesListeners(e)),"seriesGrouping"in i&&(o==null?e.seriesGrouping=void 0:e.seriesGrouping={...e.seriesGrouping,...o})}createAxes(e){const i=this.createChartAxes(),n=this.getModuleContext();for(const[s,r]of vt(e)){const a=ee.getAxisModule(r.type).create(n,s,r);this.applyAxisModules(a,r),i.push(a)}return OR(i),i}applyAxisModules(e,i){const n=e.createModuleContext(),s=e.getModuleMap();for(const r of ee.listModulesByType("axis:plugin")){const a=i[r.name],o=a!=null,l=s.isEnabled(r.name);if(!o){l&&s.removeModule(r.name);continue}l||(r.register?.(n),s.addModule(r.name,r.create(n))),s.getModule(r.name).applyOptions(a)}}registerListeners(e,i){if(e.clearEventListeners(),i&&typeof i=="object")for(const[n,s]of vt(i))s!=null&&e.addEventListener(n,s)}async applyTransaction(e){await this.updateMutex.acquire(()=>{this.data.addTransaction(e),this.update(1,{apiUpdate:!0,skipAnimations:!0})}),await this.waitForUpdate()}onSyncActiveClear(){this.seriesAreaManager.onActiveClear()}needsViewportSupport(e){return!!e.navigator?.enabled||!!e.zoom?.enabled||!!e.scrollbar?.enabled}hasViewportSupport(){return this.needsViewportSupport({navigator:this.modulesManager.getModule("navigator"),zoom:this.modulesManager.getModule("zoom"),scrollbar:this.modulesManager.getModule("scrollbar")})}hasPgUpPgDownSupport(){return!0}};qe.className="Chart",qe.chartsInstances=new WeakMap,x([ui({newValue(t){this.destroyed||(this.ctx.domManager.setContainer(t),qe.chartsInstances.set(t,this))},oldValue(t){qe.chartsInstances.delete(t)}})],qe.prototype,"container",2),x([ui({newValue(t){this.resize("width option",{inWidth:t})}})],qe.prototype,"width",2),x([ui({newValue(t){this.resize("height option",{inHeight:t})}})],qe.prototype,"height",2),x([ui({newValue(t){this.resize("minWidth option",{inMinWidth:t})}})],qe.prototype,"minWidth",2),x([ui({newValue(t){this.resize("minHeight option",{inMinHeight:t})}})],qe.prototype,"minHeight",2),x([ui({newValue(t){this.resize("overrideDevicePixelRatio option",{inOverrideDevicePixelRatio:t})}})],qe.prototype,"overrideDevicePixelRatio",2),x([I],qe.prototype,"padding",2),x([I],qe.prototype,"keyboard",2),x([I],qe.prototype,"touch",2),x([I],qe.prototype,"mode",2),x([I],qe.prototype,"withinStudio",2),x([I],qe.prototype,"styleNonce",2),x([hi("chartCaptions.title")],qe.prototype,"title",2),x([hi("chartCaptions.subtitle")],qe.prototype,"subtitle",2),x([hi("chartCaptions.footnote")],qe.prototype,"footnote",2),x([I],qe.prototype,"formatter",2),x([I],qe.prototype,"suppressFieldDotNotation",2),x([I],qe.prototype,"loadGoogleFonts",2),x([I],qe.prototype,"dataIdKey",2),x([ui({changeValue(t,e){this.onAxisChange(t,e)}})],qe.prototype,"axes",2),x([ui({changeValue(t,e){this.onSeriesChange(t,e)}})],qe.prototype,"series",2);var _d=qe;function Jm(t){const e=t.getModuleMap().getModule("crossLines");return e instanceof Kf?e:void 0}var dP=["top","right","bottom","left"],Wc=class JA extends _d{constructor(e,i){super(e,i),this.paired=!0,this.axes=this.createChartAxes(),this.lastUpdateClipRect=void 0,this.lastLayoutWidth=Number.NaN,this.lastLayoutHeight=Number.NaN}createChartAxes(){return new SE}onAxisChange(e,i){super.onAxisChange(e,i),this.syncAxisChanges(e,i),this.ctx!=null&&this.ctx.zoomManager?.setAxes(e)}destroySeries(e){super.destroySeries(e),this.lastLayoutWidth=Number.NaN,this.lastLayoutHeight=Number.NaN}getChartType(){return"cartesian"}setRootClipRects(e){const{seriesRoot:i,annotationRoot:n}=this;i.setClipRect(e),n.setClipRect(e)}async processData(){await super.processData(),this.syncStatus==="init"&&(this.syncStatus="domains-calculated"),this.ctx.eventsHub.emit("update:process-data",{series:{shouldFlipXY:this.shouldFlipXY()}})}async processDomains(){await super.processDomains();for(const e of this.axes){const i=await this.getSyncedDomain(e);i!=null&&e.setDomains({domain:i})}}performLayout(e){const{seriesRoot:i,annotationRoot:n}=this,{clipSeries:s,seriesRect:r,visible:a}=this.updateAxes(e);this.seriesRoot.visible=a,this.seriesRect=r,this.animationRect=e.layoutBox;const{x:o,y:l}=r;if(e.width!==this.lastLayoutWidth||e.height!==this.lastLayoutHeight)for(const p of[i,n])p.translationX=Math.floor(o),p.translationY=Math.floor(l);else{const{translationX:p,translationY:f}=i;Os(this.id,"seriesRect",this.ctx.animationManager,[i,n],{translationX:p,translationY:f},{translationX:Math.floor(o),translationY:Math.floor(l)},{phase:"update"})}this.lastLayoutWidth=e.width,this.lastLayoutHeight=e.height;const c=r.clone().grow(this.seriesArea.getPadding()),d=this.series.some(p=>p.alwaysClip)||(this.seriesArea.clip??!1)||s?c:void 0,{lastUpdateClipRect:g}=this;this.lastUpdateClipRect=d,this.ctx.animationManager.isActive()&&g!=null?this.ctx.animationManager.animate({id:this.id,groupId:"clip-rect",phase:"update",from:g,to:c,onUpdate:p=>this.setRootClipRects(p),onStop:()=>this.setRootClipRects(d),onComplete:()=>this.setRootClipRects(d)}):this.setRootClipRects(d),this.ctx.layoutManager.emitLayoutComplete(e,{axes:sx(this.axes.map(p=>[p.id,p.getLayoutState()])),series:{visible:a,rect:r,paddedRect:c},clipSeries:s,layoutBox:e.layoutBox}),XM(this.series)}updateAxes(e){const{layoutBox:i,scrollbars:n}=e,{clipSeries:s,seriesRect:r,overflows:a}=this.resolveAxesLayout(i,n);for(const o of this.axes)o.update(),Jm(o)?.setVisible(!a),this.clipAxis(o,r,i);return{clipSeries:s,seriesRect:r,visible:!a}}resolveAxesLayout(e,i){let n,s,r=0;const a=10,o=this.axes.filter(l=>l.options.crossAt?.value!=null);do if(s=n??this.getDefaultState(),n=this.updateAxesPass(new Map(s.axisAreaWidths),e.clone(),o,i),r++>a){j.warn("Max iterations reached. Unable to stabilize axes layout.");break}while(!this.isLayoutStable(n,s));return this.lastAreaWidths=n.axisAreaWidths,n}updateAxesPass(e,i,n,s){const r=new Map,a={};let o=!1,l=!1;const c=this.seriesArea.getPadding();for(const M of dP){const C=c[M]??0,D=this.axes.findLast(A=>A.position===M);D?D.seriesAreaPadding=C:i.shrink(C,M)}const h=(e.get("left")??0)+(e.get("right")??0),u=(e.get("top")??0)+(e.get("bottom")??0),d=this.buildCrossLinePadding(e),g=d.left+d.right,p=d.top+d.bottom;i.width<=h+g||i.height<=u+p?o=!0:i.shrink(d);const{scene:f}=this.ctx,m=i.clone().shrink(Object.fromEntries(e));for(const M of this.axes){const{position:C="left",direction:D}=M,A=D==="y";let w;this.sizeAxis(M,m,C);const{thickness:L,maxThicknessRatio:O}=M.options;L==null?w=Qm(A,f)*O:w=L;const R={sizeLimit:w-M.options.label.spacing,padding:this.padding,scrollbars:s},{primaryTickCount:_,bbox:E}=M.calculateLayout(M.nice?a[D]:void 0,R);a[D]??(a[D]=_),l||(l=M.dataDomain.clipped||M.visibleRange[0]>0||M.visibleRange[1]<1),M.options.thickness==null&&(w=Math.min(Qm(A,E)??0,w)),r.set(M.id,Math.ceil(w))}let y;n.length>0&&(y=this.calculateAxesCrossPositions(r,m,n));const b=Cl(this.axes,M=>M.position??"left"),v=new Map,S=new Map;for(const[M,C]of vt(b)){let D=Qm(M!=="left"&&M!=="right",f)%f.pixelRatio,A=0;for(const w of C??[]){S.set(w.id,D);const L=r.get(w.id)??0;A=Math.max(A,D+L),w.layoutConstraints.stacked&&(D+=L+JA.AxesPadding)}v.set(M,Math.ceil(A))}for(const[M,C]of vt(b))this.positionAxes({axes:C??[],position:M,axisWidths:r,axisOffsets:S,axisAreaWidths:v,axisBound:i,seriesRect:m});return y!=null&&this.applyAxisCrossing(m,y),{clipSeries:l,seriesRect:m,axisAreaWidths:v,overflows:o}}calculateAxesCrossPositions(e,i,n){const s=new Map;for(const r of n){const{crossPosition:a,visible:o}=this.calculateAxisCrossPosition(r);r.setAxisVisible(o),this.adjustAxisWidth(r,e,a,i,o),a!=null&&s.set(r.id,a)}return s}calculateAxisCrossPosition(e){const i=this.axes.perpendicular(e),{scale:{domain:n,bandwidth:s},range:r}=i,a=(s??0)/2,{crossAt:o}=e.options,l=i.scale.convert(o?.value,{clamp:!1})+a;return i.inRange(l)?{crossPosition:l,visible:!0}:o?.sticky===!1?{crossPosition:void 0,visible:!1}:{crossPosition:Number.isNaN(l)?r[n[0]]:go(l,r),visible:!0}}adjustAxisWidth(e,i,n,s,r){if(e.getModuleMap().getModule("crosshair")?.enabled||this.modulesManager.getModule("annotations")?.enabled===!0||this.ctx.annotationManager?.createMemento().some(u=>{switch(u.type){case"vertical-line":return e.direction==="x";case"horizontal-line":return e.direction==="y"}}))return;const c=i.get(e.id)??0,h=r?this.calculateAxisBleedingWidth(e,c,n,s):0;i.set(e.id,h)}calculateAxisBleedingWidth(e,i,n,s){if(n==null)return i;switch(e.position){case"left":case"top":return Math.max(0,i-n);case"right":return Math.max(0,n+i-s.width);case"bottom":return Math.max(0,n+i-s.height);default:return i}}applyAxisCrossing(e,i){for(const n of this.axes){const s=i.get(n.id);if(s==null){n.crossAxisTranslation.x=0,n.crossAxisTranslation.y=0;continue}const r=n.direction==="x";n.crossAxisTranslation.x=r?0:e.x+s-n.translation.x,n.crossAxisTranslation.y=r?e.y+s-n.translation.y:0}}buildCrossLinePadding(e){var i;const n={top:0,right:0,bottom:0,left:0};for(const s of this.axes){const{position:r}=s,a=Jm(s)?.getInstances();if(a)for(const o of a)o instanceof fi&&(o.position=r??"top",(i=o.label).parallel??(i.parallel=s.parallel)),o.calculatePadding?.(n)}for(const[s,r=0]of vt(n))n[s]=Math.max(r-(e.get(s)??0),0);return n}clampToOutsideSeriesRect(e,i,n,s){const r=n==="x"?e.x:e.y,a=n==="x"?e.width:e.height;return s===1?Math.min(i,r+a):Math.max(i,r)}async getSyncedDomain(e){const i=this.modulesManager.getModule("sync");if(i?.enabled)return await i.getSyncedDomain(e)}syncAxisChanges(e,i){const n=this.modulesManager.getModule("sync");if(!n?.enabled)return;const s=new Set(i??[]);for(const r of e)s.delete(r);for(const r of s)n.removeAxis(r)}sizeAxis(e,i,n){const s=e instanceof Es,r=n==="left"||n==="right",{width:a,height:o}=i,l=r?o:a;let c=0,h=l,{min:u,max:d}=e.getZoom();const{width:g,unit:p,align:f}=e.layoutConstraints;p==="px"?h=c+g:h=h*g/100;const m=h-c;if(f==="end")c=l-m,h=l;else if(f==="center"){const y=c+(l-c)/2;c=y-m/2,h=y+m/2}else f==="justify"&&(h=l);r&&(s?[c,h]=[h,c]:[u,d]=[1-d,1-u]),e.range=[c,h],e.visibleRange=[u,d],e.gridLength=r?a:o,e.lineRange=r?[o,0]:[0,a]}positionAxes(e){const{axes:i,axisBound:n,axisWidths:s,axisOffsets:r,axisAreaWidths:a,seriesRect:o,position:l}=e,c=a.get(l)??0;let h="x",u="y",d=1;(l==="top"||l==="bottom")&&(h="y",u="x");let g=n[h];(l==="right"||l==="bottom")&&(d=-1,g+=h==="x"?n.width:n.height);for(const p of i){const f=a.get(u==="x"?"left":"top")??0,m=s.get(p.id)??0,y=r.get(p.id)??0;p.gridPadding=c-y-m,p.translation[u]=n[u]+f,p.translation[h]=this.clampToOutsideSeriesRect(o,g+d*(y+m),h,d)}}shouldFlipXY(){return this.series.every(e=>e instanceof kr&&e.shouldFlipXY())}getDefaultState(){const e=new Map;if(this.lastAreaWidths)for(const{position:i="left"}of this.axes){const n=this.lastAreaWidths.get(i);n!=null&&e.set(i,n)}return{axisAreaWidths:e,clipSeries:!1,overflows:!1}}isLayoutStable(e,i){if(i.overflows!==e.overflows||i.clipSeries!==e.clipSeries)return!1;for(const n of e.axisAreaWidths.keys())if(!i.axisAreaWidths.has(n))return!1;for(const[n,s]of i.axisAreaWidths.entries()){const r=e.axisAreaWidths.get(n);if((s!=null||r!=null)&&s!==r)return!1}return!0}clipAxis(e,i,n){const s=Math.ceil(e.options.gridLine.width),r=Math.ceil(e.options.line.width);let{width:a,height:o}=i;switch(a+=e.direction==="x"?s:r,o+=e.direction==="y"?s:r,e.clipGrid(i.x,i.y,a,o),e.position){case"left":case"right":e.clipTickLines(n.x,i.y-s,n.width+s,i.height+s*2);break;case"top":case"bottom":e.clipTickLines(i.x-s,n.y,i.width+s*2,n.height+s);break}}};Wc.className="CartesianChart",Wc.type="cartesian",Wc.AxesPadding=15,x([ui({changeValue(t,e){this.onAxisChange(t,e)}})],Wc.prototype,"axes",2);var gP=Wc;function Qm(t,e){return t?e?.width:e?.height}var pP=new Set(["number","log","time"]),fP=t=>he(t)&&t.type!=null&&!pP.has(t.type),sn={type:"chart",name:"cartesian",version:Ye,options:cR,create(t,e){return new gP(t,e)},validate(t,e,i,n){const s=[];t?.series?.[0]?.type==="histogram"&&Object.values(t?.axes??{}).some(fP)&&(s.push(new bs("invalid","only continuous axis types when histogram series is used",t.axes,i,"axes")),t=Y(t,["axes"]));const r=zt(t,e,i,n);return r.invalid.push(...s),r}},Na={title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:sr.MEDIUM},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},wrapping:"always",truncate:!0}},ey={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"}}}},Oa={reverse:!1,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:11,color:{$ref:"textColor"},avoidCollisions:!0,cornerRadius:4,border:{enabled:!1,strokeWidth:1,stroke:{$foregroundOpacity:.08}},padding:{$if:[{$path:"./border/enabled"},{left:12,right:12,top:8,bottom:8},5]}},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:[]}]]}}},DI={type:"axis",name:"category",chartType:"cartesian",version:Ye,dependencies:[sn,Ts],options:Wo,themeTemplate:ge({groupPaddingInner:.1,maxThicknessRatio:.3,label:{autoRotate:!0,wrapping:"on-space"},gridLine:{enabled:!1},interval:{placement:"between"}},Na,Oa),create:(t,e,i)=>new Qo(t,e,new Sa,i)},mP=1e3,CI=class QA extends Sa{constructor(){super(...arguments),this.previousDomainJson=void 0,this.animatable=!0}static is(e){return e instanceof QA}set domain(e){if(e.length<=mP){const i=JSON.stringify(e);this.animatable=this.previousDomainJson===void 0||this.previousDomainJson===i,this.previousDomainJson=i}else this.animatable=this.previousDomainJson===void 0,this.previousDomainJson="";super.domain=e}get domain(){return super.domain}normalizeDomains(...e){const{domain:i}=super.normalizeDomains(...e);return{domain:i,animatable:!1}}findIndex(e){return super.findIndex(e)??this.getMatchIndex(e)}getMatchIndex(e){const i=JSON.stringify(e),n=this._domain.find(s=>JSON.stringify(s)===i);if(n!=null)return super.findIndex(n)}},yP=class ew{constructor(e="",i,n){this.label=e,this.parent=i,this.refId=n,this.position=0,this.subtreeLeft=Number.NaN,this.subtreeRight=Number.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.separatorDepth=0,this.leftmostLeaf=this,this.screen=0,this.depth=i?i.depth+1:0}insertTick(e,i){let n=this,s;for(let r=0;r<e.length;r++){const a=e[r],o=r!==e.length-1,{children:l}=n,c=l.find(h=>h.label===a);if(c&&o)n=c,s=c;else{const h=new ew(a,n,i);h.index=l.length,l.push(h),o&&(n=h),s=h}}return s}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((e,i)=>i!==this.index)??[]}};function bP(t){const e=t.reduce((s,r)=>Math.max(s,r.length),0),i=new yP,n=new Map;for(let s=0;s<t.length;s++){const r=t[s];for(;r.length<e;)r.push("");const a=i.insertTick(r,s);a!=null&&n.set(r,a)}return{root:i,tickNodes:n}}function vP(t,e,i){const n=e.index-t.index,s=i/n;e.change-=s,e.shift+=i,t.change+=s,e.prelim+=i,e.mod+=i}function xP(t,e,i){return e.getSiblings().includes(t.ancestor)?t.ancestor:i}function SP({children:t}){let e=0,i=0;for(let n=t.length-1;n>=0;n--){const s=t[n];s.prelim+=e,s.mod+=e,i+=s.change,e+=s.shift+i}}function MP(t,e){const i=t.getLeftSibling();if(i){let n=t,s=t,r=i,a=s.getLeftmostSibling(),o=s.mod,l=n.mod,c=r.mod,h=a.mod;for(;r.nextRight()&&s.nextLeft();){r=r.nextRight(),s=s.nextLeft(),a=a.nextLeft(),n=n.nextRight(),n.ancestor=t;const u=r.prelim+c-(s.prelim+o)+1;u>0&&(vP(xP(r,t,e),t,u),o+=u,l+=u),c+=r.mod,o+=s.mod,h+=a.mod,l+=n.mod}r.nextRight()&&!n.nextRight()?n.mod+=c-l:(s.nextLeft()&&!a.nextLeft()&&(a.mod+=o-h),e=t)}return e}function AI(t){const{children:e}=t;if(e.length){let[i]=e;for(const r of e)AI(r),i=MP(r,i);SP(t);const n=(e[0].prelim+e.at(-1).prelim)/2,s=t.getLeftSibling();s?(t.prelim=s.prelim+1,t.mod=t.prelim-n):t.prelim=n}else{const i=t.getLeftSibling();t.prelim=i?i.prelim+1:0}}function wI(t,e,i){t.position=t.prelim+e,t.separatorDepth=t.index===0?1+(t.parent?.separatorDepth??0):0,i.insertNode(t);for(const n of t.children)wI(n,e+t.mod,i)}function kI(t){const{children:e}=t;let i=0;for(const n of e)kI(n),n.children.length?i+=n.leafCount:i++;t.leafCount=i,e.length?(t.subtreeLeft=e[0].subtreeLeft,t.subtreeRight=e.at(-1).subtreeRight,t.position=(t.subtreeLeft+t.subtreeRight)/2,t.leftmostLeaf=e[0].leftmostLeaf):(t.subtreeLeft=t.position,t.subtreeRight=t.position)}function IP(t){const e=new DP,{root:i,tickNodes:n}=bP(t);return AI(i),wI(i,-i.prelim,e),kI(i),{layout:e,tickNodes:n}}var DP=class{constructor(){this.minPosition=1/0,this.maxPosition=-1/0,this.nodes=[],this.depth=0}insertNode(t){this.depth<t.depth&&(this.depth=t.depth),t.position<this.minPosition&&(this.minPosition=t.position),t.position>this.maxPosition&&(this.maxPosition=t.position),this.nodes.push(t)}scaling(t,e){let i=1;return t>0&&this.maxPosition!==this.minPosition&&(i=t/(this.maxPosition-this.minPosition)),e&&(i*=-1),i}resize(t,e,i,n){const s=Math.abs(t[1]-t[0])-e,r=this.scaling(s,t[0]>t[1]),a=i+n/2;let o=0;for(const l of this.nodes){const c=l.position*r;o>c&&(o=c),l.screen=c+a}for(const l of this.nodes)l.screen-=o}},Ea=5,Bd=class extends Qo{constructor(t,e,i){super(t,e,new CI,i),this.tickScale=new CI,this.computedLayout=void 0,this.tickTreeLayout=void 0,this.tickNodes=void 0,this.leafNodeToKey=void 0,this.ftdPositions=new Map,this.ftdCandidates=new Set,this.ftdKept=new Set,this.ftdByDepth=[],this.ftdStack=[],this.includeInvisibleDomains=!0,this.tickScale.paddingInner=1,this.tickScale.paddingOuter=0}getDepthOptionsMap(t){const e=[],i=this.options.depthOptions??[],n=this.options.label,s=this.horizontal?0:-90;for(let r=0;r<t;r++){const a=i[r]?.label;e.push(a?.enabled??n?.enabled??!0?{enabled:!0,spacing:a?.spacing??n?.spacing??5,wrapping:a?.wrapping??n?.wrapping,truncate:a?.truncate??n?.truncate,rotation:a?.rotation??(r?s:n?.rotation),avoidCollisions:a?.avoidCollisions??n?.avoidCollisions??!0}:{enabled:!1,spacing:0,rotation:0,avoidCollisions:!1})}return e}updateCategoryLabels(){this.computedLayout&&this.tickLabelGroupSelection.update(this.computedLayout.tickLabelLayout).each((t,e)=>{t.fill=e.color,t.text=e.text,t.textBaseline=e.textBaseline,t.textAlign=e.textAlign??"center",t.pointerEvents=e.textUntruncated==null?1:0,t.setFont(e),t.setBoxing(e)})}updateAxisLine(){if(!this.computedLayout)return;const{line:t}=this.options;this.lineNode.visible=t.enabled,this.lineNode.stroke=t.stroke,this.lineNode.strokeWidth=t.width}computeLayout(){this.updateDirection(),this.updateScale();const{step:t}=this.scale,{range:e,horizontal:i}=this,n=this.options.depthOptions??[],s=this.options.line,r=this.options.label,a=this.options.title,o=this.chartLayout?.scrollbars?.[this.id],l=this.getScrollbarThickness(o),c=this.getTickSpacing();if(this.lineNode.datum=i?{x1:e[0],x2:e[1],y1:0,y2:0}:{x1:0,x2:0,y1:e[0],y2:e[1]},this.lineNode.setProperties({stroke:s.stroke,strokeWidth:s.enabled?s.width:0}),this.tickTreeLayout?.resize(this.scale.range,this.scale.step,this.scale.inset,this.scale.bandwidth),!this.tickTreeLayout?.depth)return{bbox:U.zero,spacing:0,tickSizeAtDepth:[],tickLabelLayout:[]};const{depth:h,nodes:u}=this.tickTreeLayout,d=kc(this.mirrored),g=i?-d:d,p=[],f=new Map,m=new zo,y=this.getDepthOptionsMap(h),b=g*(y[0].spacing+l+c),v=this.tickFormatter(this.scale.domain,this.scale.domain,!1),S=new Map,M={};for(const[de,ae]of u.entries()){const oe=h-ae.depth;if(M[oe]??(M[oe]=0),!ae.children.length&&t<Ea||!y[oe]?.enabled||!rv(ae.screen,e))continue;let pe=(ae.leafCount||1)*t;if(pe<Ea)continue;const _t=v(ae.label,de-1);let oi=_t;const fe=this.getLabelStyles({value:ae.index,formattedValue:oi,depth:oe},n[oe]?.label);if(r?.avoidCollisions??!0){const me=y[oe].rotation;let Be=this.options.thickness;if(me!=null){const Ai=Pp(me,pe,Be);pe=Ai.width,Be=Ai.height}const xe={font:fe,textWrap:y[oe].wrapping,overflow:y[oe].truncate?"ellipsis":"hide",maxWidth:pe,maxHeight:Be};oi=Pu(oi,xe)||oi}const fs=oi!==_t&&Dv(oi)?Ue(_t):void 0;if(m.x=i?ae.screen:b,m.y=i?b:ae.screen,m.rotation=0,m.fill=fe.color,m.text=oi,m.textAlign="center",m.textBaseline=this.parallel?"top":"bottom",m.setFont(fe),m.setBoxing(fe),!m.getBBox())continue;S.set(de,{text:oi,styles:fe,truncatedText:fs}),f.set(de,m.getBBox()),m.rotation=Is(y[oe]?.rotation);const{width:vn,height:zn}=m.getBBox(),Qe=i?zn:vn;M[oe]<Qe&&(M[oe]=Qe)}const C=[0],D=[(M[0]??0)+(y[0]?.spacing??0)];let A=M[0]??0,w=y[0]?.spacing??0,L=0;for(let de=1;de<h;de++)L+=y[de]?.spacing??0,C[de]=A+L,A+=M[de]??0,w+=y[de]?.spacing??0,D[de]=A+w;const O=yf();for(const[de,ae]of u.entries()){if(de===0)continue;const oe=S.get(de);if(!oe)continue;const mt=!ae.children.length,pe=h-ae.depth;if(mt&&t<Ea)continue;const _t=Is(y[pe].rotation),oi=f.get(de);if(!oi)continue;const{width:fe,height:fs}=oi,vn=C[pe]??0;if(m.x=i?ae.screen:b,m.y=i?b:ae.screen,m.fill=oe.styles.color,m.text=oe.text,m.setFont(oe.styles),m.setBoxing(oe.styles),m.textAlign="center",m.textBaseline="middle",m.rotation=_t,i?(m.y+=(vn+Vp(fe/2,fs/2,_t))*g,m.rotationCenterX=ae.screen,m.rotationCenterY=m.y):(m.x+=vn*g+Vp((y[pe].spacing*g+fe)/2,this.mirrored?fe:0,_t)-fe/2,m.rotationCenterX=m.x,m.rotationCenterY=ae.screen),y[pe].avoidCollisions){const{width:me,height:Be}=m.getBBox(),xe=i?me:Be,Ai=mt?t:ae.leafCount*t;if(xe>Ai){f.delete(de);continue}}const zn=m.getPlainText(),Qe=m.getBoxingProperties();p.push({text:zn,textUntruncated:oe.truncatedText,visible:!0,tickId:O(zn),range:this.scale.range,border:Qe.border,color:m.fill,cornerRadius:Qe.cornerRadius,fill:Qe.fill,fontFamily:m.fontFamily,fontSize:m.fontSize,fontStyle:m.fontStyle,fontWeight:m.fontWeight,padding:Qe.padding,rotation:m.rotation,rotationCenterX:m.rotationCenterX,rotationCenterY:m.rotationCenterY,textAlign:m.textAlign,textBaseline:m.textBaseline,x:m.x,y:m.y}),f.set(de,Ze.toCanvas(m))}const _=(D[h-1]??0)+l+c,E=[this.lineNodeBBox(),U.merge(f.values()),new U(0,0,_*g,0)],F=U.merge(E),z=i?F.height:F.width,{spacing:K,scrollbarLayout:G}=this.applyScrollbarLayout(E,z,o);this.layout.labelThickness=z,this.layout.scrollbar=G,a.enabled&&E.push(this.titleBBox(this.scale.domain,K));const ie=U.merge(E);return this.notifyAxisPlugins("onAxisLayout"),{bbox:ie,spacing:K,tickSizeAtDepth:D,tickLabelLayout:p}}buildDepthsMap(t){const{tickNodes:e,tickScale:i,tickTreeLayout:n}=this;if(!n||!e)return new Map;const s=n.depth,r=new Map;for(const a of t){const o=e.get(a),l=o==null?s-1:Math.min(o.separatorDepth,s-1);r.set(a,l)}if(i.step<Ea&&t.length>1){const a=t.at(-1);if(a&&!e.has(a)){const o=t.at(-2),l=o?r.get(o):void 0;l!=null&&r.set(a,l)}}return r}filterTicksTopDown(t,e){const{tickScale:i,tickTreeLayout:n,tickNodes:s,leafNodeToKey:r}=this;if(!n||s==null||r==null)return{ticks:t,depthsMap:new Map};const a=i.range,o=i.step,l=i.inset,c=i.bandwidth,h=e?.[0]??0,u=e?.[1]??1,d=this.filterTickCache;if(d&&d.range0===a[0]&&d.range1===a[1]&&d.step===o&&d.inset===l&&d.bandwidth===c&&d.vr0===h&&d.vr1===u)return d.result;const g=E=>(this.filterTickCache={range0:a[0],range1:a[1],step:o,inset:l,bandwidth:c,vr0:h,vr1:u,result:E},E);if(i.step>=Ea)return g({ticks:t,depthsMap:this.buildDepthsMap(t)});const p=this.ftdPositions;p.clear();const f=this.ftdCandidates;f.clear();const m=this.ftdKept;m.clear();const y=this.ftdStack;y.length=0;const b=E=>(p.has(E)||p.set(E,i.convert(E)),p.get(E)),v=E=>{let F=0;for(const z of E)if(Number.isFinite(b(z))&&(F+=1,F>1))break;return F};let S=t;if(e!=null&&(e[0]!==0||e[1]!==1)){const E=i.domain,F=E.length;if(F>0){const z=Math.max(0,Math.floor(e[0]*F)-1),K=Math.min(F-1,Math.ceil(e[1]*F));if(t.length===0)S=E.slice(z,K+1);else{const G=E[z],ie=E[K],de=t[0],ae=t.at(-1),oe=G!=null&&G!==de,mt=ie!=null&&ie!==ae;if(oe||mt){const pe=oe?[G]:[];pe.push(...t),mt&&pe.push(ie),S=pe}}}}if(v(S)<=1)return g({ticks:S,positions:p,depthsMap:this.buildDepthsMap(S)});for(const E of S)f.add(E);for(const E of S){let z=s.get(E)?.parent;for(;z?.parent;){const K=r.get(z.leftmostLeaf);K!=null&&f.add(K),z=z.parent}}const M=Math.max(0,n.depth-1),C=E=>Math.min(M,n.depth-E.depth),D=n.nodes[0];if(!D?.children.length)return g({ticks:S,positions:p,depthsMap:this.buildDepthsMap(S)});const A=this.ftdByDepth;for(const E of A)E.positions.length=0,E.ticks.length=0;const w=(E,F)=>{const z=E.at(-1);return z!=null&&F-z<Ea},L=(E,F)=>{for(let z=F+1;z<=M;z++)if(w(A[z].positions,E))return!1;return!w(A[F].positions,E)},O=(E,F,z)=>{const K=A[z];K.positions.push(E),K.ticks.push(F)},R=(E,F)=>{if(F!==0)for(let z=0;z<F;z++){const K=A[z];for(;K.positions.length>0&&E-K.positions.at(-1)<Ea;)m.delete(K.ticks.at(-1)),K.positions.pop(),K.ticks.pop()}};for(let E=D.children.length-1;E>=0;E--){const F=D.children[E],z=r.get(F.leftmostLeaf);z!=null&&f.has(z)&&y.push(F)}for(;y.length;){const E=y.pop(),F=r.get(E.leftmostLeaf);if(F==null||!f.has(F))continue;const z=b(F);if(z==null||!Number.isFinite(z))continue;if(m.has(F)){for(let G=E.children.length-1;G>=0;G--)y.push(E.children[G]);continue}const K=C(E);if(L(z,K)){m.add(F),O(z,F,K),R(z,K);for(let G=E.children.length-1;G>=0;G--)y.push(E.children[G])}}for(const E of S){if(s.has(E))continue;const F=b(E);if(F==null||!Number.isFinite(F)||m.has(E))continue;const z=0;L(F,z)&&(m.add(E),O(F,E,z),R(F,z))}const _=S.filter(E=>m.has(E));return g({ticks:_,positions:p,depthsMap:this.buildDepthsMap(_)})}update(){if(!this.computedLayout)return;this.scale.animatable||this.moduleCtx.animationManager.skipCurrentBatch();const{tickScale:t,gridLength:e,visibleRange:i,tickTreeLayout:n}=this,{tick:s,gridLine:r}=this.options;if(!n)return;const{tickSizeAtDepth:a,spacing:o}=this.computedLayout,{depth:l}=n,c=this.chartLayout?.scrollbars?.[this.id],h=this.getScrollbarThickness(c),u=this.getTickSpacing(),{position:d,horizontal:g,gridPadding:p}=this,f=d==="bottom"||d==="right"?-1:1,m=p,y=f*e-p,b={nice:[!1,!1],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0};let{ticks:v}=t.ticks(b,void 0,i);const S=this.filterTicksTopDown(v,i);v=S.ticks;const{depthsMap:M}=S,C=A=>M.get(A)??l-1,D=v.map((A,w)=>({index:t.findIndex(A),tickId:Jt(w,...A),translation:Math.round(S.positions?.get(A)??t.convert(A))}));this.gridLineGroupSelection.update(r.enabled&&e?this.calculateGridLines(D,m,y):[]),this.gridFillGroupSelection.update(r.enabled&&e?this.calculateGridFills(D,m,y):[]),this.tickLineGroupSelection.update(s.enabled?v.map((A,w)=>{const{tickId:L,translation:O}=D[w],R=C(A),_=(this.options.depthOptions??[])[R]?.tick,E=a[R]??0,F=_?.stroke??s.stroke,z=_?.enabled===!1?0:_?.width??s.width,K=-f*E,G=-f*(h+u),[ie,de,ae,oe]=g?[O,G,O,G+K]:[G,O,G+K,O];return{tickId:L,offset:O,x1:ie,y1:de,x2:ae,y2:oe,stroke:F,strokeWidth:z,lineDash:void 0}}):[]),this.updatePosition(),this.updateCategoryLabels(),this.updateAxisLine(),this.updateGridLines(),this.updateGridFills(),this.updateTickLines(),this.updateTitle(this.scale.domain,o),this.notifyAxisPlugins("onAxisUpdate"),this.resetSelectionNodes()}calculateLayout(t,e){this.chartLayout=e;const{tickSizeAtDepth:i,tickLabelLayout:n,spacing:s,bbox:r}=this.computeLayout();return this.computedLayout={tickSizeAtDepth:i,tickLabelLayout:n,spacing:s},{bbox:r,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:t}=this,e=this.boundSeries.filter(l=>l.visible).flatMap(l=>Il(l.getDomain(t)));this.dataDomain={domain:dr(e)??this.filterDuplicateArrays(e),clipped:!1},this.isReversed()&&(this.dataDomain={...this.dataDomain,domain:this.dataDomain.domain.toReversed()});const i=this.dataDomain.domain.map(TI),{layout:n,tickNodes:s}=IP(i);this.tickTreeLayout=n,this.tickNodes=s,this.leafNodeToKey=new Map;for(const[l,c]of s)this.leafNodeToKey.set(c,l);this.filterTickCache=void 0,this.ftdByDepth=Array.from({length:Math.max(0,n.depth-1)+1},()=>({positions:[],ticks:[]}));const r=[];for(const l of this.tickTreeLayout.nodes)l.leafCount||l.refId==null||r.push(this.dataDomain.domain[l.refId]);const a=Vb(this.dataDomain.domain,r);this.scale.domain=a;const o=a.map(TI);o.push([""]),this.tickScale.domain=o}filterDuplicateArrays(t){const e=new Set;return t.filter(i=>{const n=ce(i)?JSON.stringify(i):i;return e.has(n)?!1:(e.add(n),!0)})}};Bd.className="GroupedCategoryAxis",Bd.type="grouped-category";function TI(t){return Dl(he(t)&&"value"in t?t.value:t)}var LI={type:"axis",name:"grouped-category",chartType:"cartesian",version:Ye,dependencies:[sn,Ts],options:Ko,themeTemplate:ge({tick:{enabled:!0,stroke:{$ref:"separationLinesColor"}},label:{spacing:10,rotation:270,wrapping:"on-space"},maxThicknessRatio:.5,paddingInner:.4,groupPaddingInner:.2},Na,Oa),create:(t,e,i)=>new Bd(t,e,i)},ll=class extends Es{getVisibleDomain(t){const[e,i]=t,[n,s]=this.visibleRange;if(t.length<2)return[e,i];const r=Math.min(e,i),a=Math.max(e,i);if(r>=0){const o=Math.log(e),c=Math.log(i)-o;return[Math.exp(o+n*c),Math.exp(o+s*c)]}if(a<=0){const o=-Math.log(-e),c=-Math.log(-i)-o;return[-Math.exp(-(o+n*c)),-Math.exp(-(o+s*c))]}return[Number.NaN,Number.NaN]}normaliseDataDomain(t){const{min:e,max:i,preferredMin:n,preferredMax:s}=this.options,{extent:r,clipped:a}=ku(t.domain,e,i,n,s,void 0,t.sortMetadata?.sortOrder);return r[0]<0&&r[1]>0||t.domain[0]<0&&t.domain[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:a}):r[0]===0||r[1]===0||t.domain[0]===0||t.domain[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:a}):{domain:r,clipped:a}}get base(){return this.optionsBase??this.scale.base}get optionsBase(){return this.options.base}constructor(t,e,i){super(t,e,new hm,i),this.syncScaleBase()}syncScaleBase(){const t=this.optionsBase;t!=null&&(this.scale.base=t)}updateScale(){this.syncScaleBase(),super.updateScale()}};ll.className="LogAxis",ll.type="log";var NI={type:"axis",name:"log",chartType:"cartesian",version:Ye,dependencies:[sn,Ts],options:Zo,themeTemplate:ge({base:10,maxThicknessRatio:.3,line:{enabled:!1}},Na,Oa),create:(t,e,i)=>new ll(t,e,i)},OI={type:"axis",name:"number",chartType:"cartesian",version:Ye,dependencies:[sn,Ts],options:Yo,themeTemplate:ge({maxThicknessRatio:.3,line:{enabled:!1}},Na,Oa),create:(t,e,i)=>new Es(t,e,void 0,i)},EI={type:"axis",name:"time",chartType:"cartesian",version:Ye,dependencies:[sn,Ts],options:Xo,themeTemplate:ge({maxThicknessRatio:.3,gridLine:{enabled:!1}},Na,ey,Oa),create:(t,e,i)=>new fd(t,e,i)},RI=class extends Qo{calculateGridLine({index:t,tickId:e,translation:i},n,s,r,a){const{horizontal:o,range:l}=this,c=this.options.gridLine;if(this.options.interval?.placement!=="between")return super.calculateGridLine({index:t,tickId:e,translation:i},n,s,r,a);const h=a[n-1],u=h?i-(i-h.translation)/2:l[0],[d,g,p,f]=o?[u,Math.max(s,r),u,Math.min(s,r)]:[Math.min(s,r),u,Math.max(s,r),u],{style:m}=c,{stroke:y,strokeWidth:b=0,lineDash:v}=m[t%m.length]??{};return{tickId:e,offset:u,x1:d,y1:g,x2:p,y2:f,stroke:y,strokeWidth:b,lineDash:v}}calculateGridFills(t,e,i){return this.options.interval?.placement!=="between"?super.calculateGridFills(t,e,i):t.map((n,s)=>this.calculateGridFill(n,s,n.index,e,i,t))}calculateGridFill({tickId:t,translation:e},i,n,s,r,a){const{horizontal:o,range:l}=this,c=this.options.gridLine;if(this.options.interval?.placement!=="between")return super.calculateGridFill({tickId:t,translation:e},i,n,s,r,a);const h=a[i-1],u=a[i+1],d=h?e-(e-h.translation)/2:l[0],g=u?e+(u.translation-e)/2:l[1],[p,f,m,y]=o?[d,Math.max(s,r),g,Math.min(s,r)]:[Math.min(s,r),d,Math.max(s,r),g],{fill:b,fillOpacity:v}=c.style[n%c.style.length]??{};return{tickId:t,x1:p,y1:f,x2:m,y2:y,fill:b,fillOpacity:v}}calculateTickLine({isPrimary:t,tickId:e,translation:i},n,s,r,a=0){const{horizontal:o,primaryTick:l,range:c}=this,h=this.options.tick;if(this.options.interval?.placement!=="between")return super.calculateTickLine({isPrimary:t,tickId:e,translation:i},n,s,r,a);const u=t&&l?.enabled?l:h,d=-s*this.getTickSize(u),g=r[n-1],p=g?i-(i-g.translation)/2:c[0],f=-s*(a+this.getTickSpacing(u)),[m,y,b,v]=o?[p,f,p,f+d]:[f,p,f+d,p],{stroke:S,width:M}=u;return{tickId:e,offset:p,x1:m,y1:y,x2:b,y2:v,stroke:S,strokeWidth:M,lineDash:void 0}}},ty=class extends RI{constructor(t,e,i){super(t,e,new Dr,i,!1),this.defaultTickMinSpacing=20,this.defaultUnit=void 0}get primaryLabel(){const t=this.options.parentLevel;return t?.enabled?t.label:void 0}get primaryTick(){const t=this.options.parentLevel;return t?.enabled?t.tick:void 0}getLabelFormat(){const t=this.options.label.format;return t}getPrimaryLabelFormat(){const t=this.primaryLabel?.format;return t}hasDefinedDomain(){const{min:t,max:e}=this.options;return t!=null&&e!=null&&t<e}isCategoryLike(){return!0}processData(){super.processData();let t;const{domain:e}=this.dataDomain;if(e.length===2&&e[0].valueOf()===e[1].valueOf())t=ju(e[0]);else{const{boundSeries:i,direction:n}=this,{min:s,max:r}=this.options;t=bM(i,n,s,r)}st(this.defaultUnit,t)||(this.defaultUnit=t)}updateScale(){super.updateScale(),this.scale.interval=this.options.unit??this.defaultUnit}normaliseDataDomain(t){const{min:e,max:i,preferredMin:n,preferredMax:s}=this.options,{extent:r,clipped:a}=Tu(t,e,i,n,s);return{domain:r,clipped:a}}tickFormatParams(t,e,i,n){n??(n=ff(e));const s=mf(t),r=Cs(n),a=mr(n),o=uc(n);return{type:"date",unit:r,step:a,epoch:o,truncateDate:s}}datumFormatParams(t,e,i,n,s){const r=this.options.unit??this.defaultUnit??"millisecond";n??(n=r);const{datum:a,seriesId:o,legendItemName:l,key:c,source:h,property:u,domain:d,boundSeries:g}=e,p=Cs(n),f=mr(n),m=uc(n);return{type:"date",value:Pi(r,t),datum:a,seriesId:o,legendItemName:l,key:c,source:h,property:u,domain:d,boundSeries:g,unit:p,step:f,epoch:m,style:s}}};ty.className="UnitTimeAxis",ty.type="unit-time";var PI={type:"axis",name:"unit-time",chartType:"cartesian",version:Ye,dependencies:[sn,Ts],options:qo,themeTemplate:ge({groupPaddingInner:.1,maxThicknessRatio:.3,label:{autoRotate:!1},gridLine:{enabled:!1},parentLevel:{enabled:!0},interval:{placement:"between"}},Na,ey,Oa),create:(t,e,i)=>new ty(t,e,i)},FI=[OI,NI,EI,DI,LI,PI];function zd(t,e,i,n,s){const r=(u,d,g,p)=>{i.animate({id:`${t}_${e}_${d.id}_${u}`,groupId:t,from:g?1:0,to:1,ease:vc,collapsable:g,onUpdate(f,m){m&&u!=="removed"||(d.path.clear(!0),p(f,d),d.checkPathDirty())},onStop(){u==="added"&&(d.path.clear(!0),p(1,d),d.checkPathDirty())},phase:Pn[u]})},a=new kt,o=u=>(a.resetPathDirty(),u(0,a),a.resetPathDirty(),u(1,a),a.checkPathDirty(),a.isPathDirty()),{addPhaseFn:l,updatePhaseFn:c,removePhaseFn:h}=s;for(const u of n)i.isSkipped()||(r("removed",u,!o(h),h),r("updated",u,!o(c),c)),r("added",u,!o(l),l)}function Ra(t,e,i,n,s,r,a=["series",`${t.declarationOrder}`,"label"]){if(t.visible&&n.itemStyler){const o=t.getHighlightStateString(r,s||e!=null&&r?.series===e.series&&r?.datumIndex===e.datumIndex,e?.datumIndex),l=typeof e?.datumIndex=="number"?e.datumIndex:e?.itemId,c={border:n.border,color:n.color,cornerRadius:n.cornerRadius,datum:e?.datum,enabled:n.enabled,fill:n.fill,fillOpacity:n.fillOpacity,fontFamily:n.fontFamily,fontSize:n.fontSize,fontStyle:n.fontStyle,fontWeight:n.fontWeight,itemId:l,itemType:e?.itemType,seriesId:t.id,padding:n.padding,highlightState:o},h=t.ctx.optionsGraphService.resolvePartial(a,t.cachedCallWithContext(n.itemStyler,{...i,...c}),{pick:!1})??{};return ge(h,c)}return n}function VI(t,e,i,n,s,r,a){if(t.visible&&n.enabled&&s){const o=Ra(t,e.datum,i,n,r,a);e.visible=!0,e.x=s.x,e.y=s.y,e.text=s.text,e.fill=o.color,e.setAlign(s),e.setFont(o),e.setBoxing(o)}else e.visible=!1}var CP={"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 _I({isUpward:t,isVertical:e,placement:i,spacing:n=0,rect:s}){let r=s.x+s.width/2,a=s.y+s.height/2,o="center",l="middle";if(i!=="inside-center"){const c=(t?1:-1)*(e?-1:1),{direction:h,textAlignment:u}=CP[i],d=(h+1)*.5;if(e){const g=t?s.y+s.height:s.y,p=s.height*c;a=g+p*d+n*u*c,l=u===c?"top":"bottom"}else{const g=t?s.x:s.x+s.width,p=s.width*c;r=g+p*d+n*u*c,o=u===c?"left":"right"}}return{x:r,y:a,textAlign:o,textBaseline:l}}var AP=class{constructor(t){this.minimumDelay=t?.minimumDelay??50,this.timeout=t?.timeout??100}schedule(t,e){this.cancel(),this.pending={computation:t,onComplete:e},this.minimumDelay>0?this.delayTimeoutId=setTimeout(()=>{this.delayTimeoutId=void 0,this.scheduleIdleCallback()},this.minimumDelay):this.scheduleIdleCallback()}demand(){if(this.pending)return this.cancelScheduled(),this.execute()}cancel(){this.cancelScheduled(),this.pending=void 0}isPending(){return this.pending!=null}scheduleIdleCallback(){const t=Math.max(0,this.timeout-this.minimumDelay);typeof requestIdleCallback=="function"?this.idleCallbackId=requestIdleCallback(this.execute.bind(this),{timeout:t}):this.idleCallbackId=setTimeout(()=>this.execute(),t)}cancelScheduled(){this.delayTimeoutId!=null&&(clearTimeout(this.delayTimeoutId),this.delayTimeoutId=void 0),this.idleCallbackId!=null&&(typeof cancelIdleCallback=="function"?cancelIdleCallback(this.idleCallbackId):clearTimeout(this.idleCallbackId),this.idleCallbackId=void 0)}execute(){const{pending:t}=this;if(!t)return;this.pending=void 0,this.delayTimeoutId=void 0,this.idleCallbackId=void 0;const e=t.computation();return t.onComplete(e),e}},Gd=class{constructor(){this._dataLength=0,this.executor=new AP,this.events=new ms}get filters(){return this._filters}aggregate(t){if(this.executor.cancel(),t.targetRange>1&&t.computePartial){const e=t.computePartial(this._filters);if(e){const{immediate:i,computeRemaining:n}=e;return n&&this.executor.schedule(n,s=>{this.mergeFilters(s),this.events.emit("filtersChanged",void 0)}),this._filters=i,this.events.emit("filtersChanged",void 0),i}}return this._filters=t.computeFull(this._filters),this.events.emit("filtersChanged",void 0),this._filters}ensureLevelForRange(t){!this._filters?.some(i=>i.maxRange>t)&&this.executor.isPending()&&this.executor.demand()}getFilterForRange(t){return this._filters?.find(e=>e.maxRange>t)}cancel(){this.executor.cancel()}markStale(t){const e=this._dataLength>0?t/this._dataLength:0,i=e>=2||e<=.5||this._dataLength===0;if(i)this._filters=void 0;else if(this._filters)for(const n of this._filters)n.stale=!0;this._dataLength=t,this.executor.cancel(),i&&this.events.emit("filtersChanged",void 0)}mergeFilters(t){if(!this._filters||t.length===0)return;const e=[...this._filters,...t];e.sort((i,n)=>i.maxRange-n.maxRange),this._filters=e}},wP=class{has(t,e){return this.processedData===t&&this.filter===e&&this.selectedReader!==void 0}set(t,e,i,n){this.processedData=t,this.filter=e,this.selectedReader=i,this.rangeReader=n}clear(){this.processedData=void 0,this.filter=void 0,this.selectedReader=void 0,this.rangeReader=void 0}};function iy(t,e,i,n,s){const r=i.getDomain(t,"xValue",s,n),a=s==="key"?i.resolveKeysById(t,"xValue",n):i.resolveColumnById(t,"xValue",n),o=s==="key"?!1:i.resolveColumnNeedsValueOf(t,"xValue",n),[l,c]=Zi(e.scale.type,r);return{xValues:a,d0:l,d1:c,xNeedsValueOf:o}}var BI=class{constructor(t){this.opts=t,this.selectionEpoch=0,this.populatedEpochs=new WeakMap,this.cache=new wP,t.aggregationManager.events.on("filtersChanged",()=>this.populateStaleFilters())}setActiveFilter(t,e){if(e===void 0){this.cache.clear();return}const i=e;if(this.cache.has(t,i))return;const n=this.opts.getDataModel(),s=this.opts.getXAxis();!n||!s||this.populateCache(i,n,t,s)}refresh(){this.selectionEpoch+=1;const t=this.opts.getSelection();this.sparseSelection=t?xx(t):void 0,this.populateStaleFilters()}populateStaleFilters(){const t=this.opts.aggregationManager.filters;if(!t||t.length===0){this.invalidateCache();return}const e=this.opts.getXAxis(),i=this.opts.getDataModel(),n=this.opts.getProcessedData();if(!e||!i||!n)return;const s=this.sparseSelection;if(s===void 0){for(const a of t)this.populatedEpochs.get(a)!==this.selectionEpoch&&(this.clearSelectedSlot(a),this.populatedEpochs.set(a,this.selectionEpoch));return}const r=iy(this.opts.series,e,i,n,this.opts.domainKey);for(const a of t)this.populatedEpochs.get(a)!==this.selectionEpoch&&(this.populateFilter(a,s,r),this.populatedEpochs.set(a,this.selectionEpoch))}isBucketSelected(t){return(this.cache.selectedReader??this.ensureReaders()?.selectedReader)?.(t)}getRangeReader(){return this.cache.rangeReader??this.ensureReaders()?.rangeReader}getIndexSet(t){}ensureReaders(){const t=this.opts.getXAxis(),e=this.opts.getProcessedData(),i=this.opts.getDataModel();if(!t||!e||!i)return;const[n,s]=t.scale.range,r=this.opts.aggregationManager.getFilterForRange(Math.abs(s-n));if(!r){this.cache.clear();return}return this.cache.has(e,r)?this.cache:this.populateCache(r,i,e,t)}invalidateCache(){this.cache.clear()}},ny=class extends BI{clearSelectedSlot(t){const{indexData:e,maxRange:i}=t;for(let n=0;n<i;n++)e[n*Mi+jt]=0}populateFilter(t,e,i){Sx(e,t.indexData,t.maxRange,i.xValues,i.d0,i.d1,i.xNeedsValueOf)}populateCache(t,e,i,n){const{xValues:s,d0:r,d1:a,xNeedsValueOf:o}=iy(this.opts.series,n,e,i,this.opts.domainKey),l=s.length,{indexData:c,maxRange:h}=t,u=this.opts.canonicalExtremaSlots;function d(p){const f=Jl(s,r,a,h,p,{xNeedsValueOf:o,xValuesLength:l});if(f<0||c[f+jt]!==1)return!1;if(u===void 0)return!0;for(let m=0;m<u.length;m++)if(c[f+u[m]]===p)return!0;return!1}function g(p){const f=Jl(s,r,a,h,p,{xNeedsValueOf:o,xValuesLength:l});if(!(f<0))return[c[f+ct],c[f+yt]]}return this.cache.set(i,t,d,g),this.cache}},zI=[ct,yt,wt,ht],GI=class extends BI{constructor(t){super(t),this.splitOpts=t}clearSelectedSlot(t){const{positiveIndexData:e,negativeIndexData:i,maxRange:n}=t;for(let s=0;s<n;s++){const r=s*Mi+jt;e[r]=0,i[r]=0}}populateFilter(t,e,i){const n=this.splitOpts.getDataModel(),s=this.splitOpts.getProcessedData(),r=this.splitOpts.getYColumnId(n,s),a=n.resolveColumnById(this.splitOpts.series,r,s),o=n.resolveColumnNeedsValueOf(this.splitOpts.series,r,s);Mx(e,t.positiveIndexData,t.negativeIndexData,t.maxRange,i.xValues,a,i.d0,i.d1,i.xNeedsValueOf,o)}populateCache(t,e,i,n){const{xValues:s,d0:r,d1:a,xNeedsValueOf:o}=iy(this.splitOpts.series,n,e,i,this.splitOpts.domainKey),l=this.splitOpts.getYColumnId(e,i),c=e.resolveColumnById(this.splitOpts.series,l,i),h=e.resolveColumnNeedsValueOf(this.splitOpts.series,l,i),u=s.length,{positiveIndexData:d,negativeIndexData:g,maxRange:p}=t,f=this.splitOpts.canonicalExtremaSlots;function m(b){const v=Jl(s,r,a,p,b,{xNeedsValueOf:o,xValuesLength:u});if(v<0)return!1;const S=c[b];if(S==null)return!1;const C=(h?S.valueOf():S)>=0?d:g;if(C[v+jt]!==1)return!1;if(f===void 0)return!0;for(let D=0;D<f.length;D++)if(C[v+f[D]]===b)return!0;return!1}function y(b){const v=Jl(s,r,a,p,b,{xNeedsValueOf:o,xValuesLength:u});if(v<0)return;let S;if(vp(d,v,b,zI)?S=d:vp(g,v,b,zI)&&(S=g),!!S)return[S[v+ct],S[v+yt]]}return this.cache.set(i,t,m,y),this.cache}},jI=class{constructor(t){this.opts=t}isBucketSelected(t){const e=this.opts.getIndexSetMap();if(e===void 0)return;const i=e.get(t);if(i===void 0)return;const n=this.opts.getSelection();if(n===void 0)return!1;for(let s=0;s<i.length;s++)if(n[i[s]]===1)return!0;return!1}getRangeReader(){}getIndexSet(t){return this.opts.getIndexSetMap()?.get(t)}refresh(){}setActiveFilter(){}};function gt({id:t},e,i,...n){for(const s of n)s.cleanup();Os(t,e,i,n,{opacity:0},{opacity:1},{phase:"trailing"})}function jd({id:t},e,i,...n){Os(t,e,i,n,{opacity:1},{opacity:0},{phase:"remove"})}function Pa(t){return{opacity:1}}var kP=10;function Hd(t,e,i,n,s,r,a){const o=t[r];if(o===void 0)return-1;const l=Number.isFinite(e)?un(o,e,i,a):fo(r,t.length),c=uu(l,s);return r===n[c+ct]||r===n[c+yt]||r===n[c+wt]||r===n[c+ht]?c:-1}function HI(t,e,i,n,s,r,a,o,l){let c=0,h=0,u=-1;for(let m=0;m<a;m++){const y=Hd(t,e,i,n,s,m,r);y!==-1&&(c++,y!==u&&(h++,u=y))}h++;const d=o?.length===c?o:new Uint32Array(c),g=l?.length===h?l:new Uint32Array(h);let p=0,f=0;u=-1;for(let m=0;m<a;m++){const y=Hd(t,e,i,n,s,m,r);y!==-1&&(y!==u&&(g[f++]=p,u=y),d[p++]=m)}return g[f]=c-1,{indices:d,metaIndices:g}}function sy(t,e,i,n){const s=e.length;if(s<xs)return;const[r,a]=t,{xNeedsValueOf:o,yNeedsValueOf:l,existingFilters:c}=n;let h=Ss(e,r,a,{xNeedsValueOf:o});const u=c?.find(y=>y.maxRange===h);let{indexData:d,valueData:g}=Ms(e,i,i,r,a,h,{xNeedsValueOf:o,yNeedsValueOf:l,reuseIndexData:u?.indexData,reuseValueData:u?.valueData}),{indices:p,metaIndices:f}=HI(e,r,a,d,h,o,s,u?.indices,u?.metaIndices);const m=[{maxRange:h,metaIndices:f,indices:p,indexData:d,valueData:g}];for(;p.length>kP&&h>or;){const y=h,b=Math.trunc(y/2),v=c?.find(_=>_.maxRange===b),S=Zr(d,g,y,{reuseIndexData:v?.indexData,reuseValueData:v?.valueData});h=S.maxRange,d=S.indexData,g=S.valueData;const M=p;let C=0,D=0,A=-1;for(const _ of M){const E=Hd(e,r,a,d,h,_,o);E!==-1&&(C++,E!==A&&(D++,A=E))}D++;const w=v?.indices?.length===C?v.indices:new Uint32Array(C),L=v?.metaIndices?.length===D?v.metaIndices:new Uint32Array(D);let O=0,R=0;A=-1;for(const _ of M){const E=Hd(e,r,a,d,h,_,o);E!==-1&&(E!==A&&(L[R++]=O,A=E),w[O++]=_)}L[R]=C-1,p=w,f=L,m.push({maxRange:h,metaIndices:f,indices:p,indexData:d,valueData:g})}return m.reverse(),m}function TP(t,e,i,n){const s=e.length;if(s<xs)return;const[r,a]=t,{xNeedsValueOf:o,yNeedsValueOf:l,targetRange:c,existingFilters:h}=n,u=Ss(e,r,a,{xNeedsValueOf:o}),d=Math.min(u,po(Math.max(c,or))),g=h?.find(S=>S.maxRange===d),{indexData:p,valueData:f}=Ms(e,i,i,r,a,d,{xNeedsValueOf:o,yNeedsValueOf:l,reuseIndexData:g?.indexData,reuseValueData:g?.valueData}),{indices:m,metaIndices:y}=HI(e,r,a,p,d,o,s,g?.indices,g?.metaIndices),b={maxRange:d,indices:m,metaIndices:y,indexData:p,valueData:f};function v(){return sy([r,a],e,i,{xNeedsValueOf:o,yNeedsValueOf:l,existingFilters:h})?.filter(M=>M.maxRange!==d)??[]}return{immediate:[b],computeRemaining:v}}function LP(t,e,i,n,s,r){const[a,o]=Zi(t,n);return sy([a,o],e,i,{xNeedsValueOf:s,yNeedsValueOf:r})}var NP=ac(LP);function OP(t,e,i,n,s,r){const a=e.resolveKeysById(s,"xValue",i),o=e.resolveColumnById(s,n,i),l=e.getDomain(s,"xValue","key",i),c=e.resolveColumnNeedsValueOf(s,"xValue",i),h=e.resolveColumnNeedsValueOf(s,n,i);if(r){const[u,d]=Zi(t,l);return sy([u,d],a,o,{xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:r})}return NP(t,a,o,l,c,h)}function EP(t,e,i,n,s,r,a){const o=e.resolveKeysById(s,"xValue",i),l=e.resolveColumnById(s,n,i),c=e.getDomain(s,"xValue","key",i),h=e.resolveColumnNeedsValueOf(s,"xValue",i),u=e.resolveColumnNeedsValueOf(s,n,i),[d,g]=Zi(t,c);return TP([d,g],o,l,{xNeedsValueOf:h,yNeedsValueOf:u,targetRange:r,existingFilters:a})}var os=class extends Cf{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};x([I,Z()],os.prototype,"enabled",2),x([I,Z()],os.prototype,"color",2),x([I,Z()],os.prototype,"xOffset",2),x([I,Z()],os.prototype,"yOffset",2),x([I,Z()],os.prototype,"blur",2);function RP(t,e){if(t!=null)return{enabled:t.enabled??!0,stroke:t.stroke??e?.stroke??"transparent",strokeWidth:t.strokeWidth??e?.strokeWidth??1,strokeOpacity:t.strokeOpacity??e?.strokeOpacity??1,lineDash:t.lineDash??e?.lineDash??[]}}var $I=class extends Te{constructor(){super(...arguments),this.enabled=!1}};x([I],$I.prototype,"enabled",2);var Fs=class extends Te{constructor(){super(...arguments),this.interaction=new $I,this.position=new va,this.range=void 0,this.class=void 0}formatTooltip(t,e,i){const n=this.renderer==null?void 0:dn(t,this.renderer,i);if(ot(n)||Li(n)||rn(n))return{type:"raw",rawHtmlString:et(n)};if(n!=null){const s=ge(n.symbol?.marker,e.symbol?.marker),r=n.symbol?.line??e.symbol?.line?ge(n.symbol?.line,e.symbol?.line):void 0,a=e.symbol||n.symbol?{marker:s,line:RP(r,s)}:void 0;return{type:"structured",...e,...n,symbol:a}}return{type:"structured",...e}}};x([I],Fs.prototype,"enabled",2),x([I],Fs.prototype,"showArrow",2),x([I],Fs.prototype,"renderer",2),x([I],Fs.prototype,"interaction",2),x([I],Fs.prototype,"position",2),x([I],Fs.prototype,"range",2),x([I],Fs.prototype,"class",2);function Fa(){return new Fs}var bt=class extends Fn{constructor(){super(...arguments),this.xName=void 0,this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new uo,this.shadow=new os,this.marker=new Ci,this.label=new Qi,this.tooltip=Fa(),this.connectMissingData=!1}};x([I],bt.prototype,"xKey",2),x([I],bt.prototype,"xName",2),x([I],bt.prototype,"yKey",2),x([I],bt.prototype,"yName",2),x([I],bt.prototype,"selectedKey",2),x([I],bt.prototype,"stackGroup",2),x([I],bt.prototype,"normalizedTo",2),x([I],bt.prototype,"fill",2),x([I],bt.prototype,"fillOpacity",2),x([I],bt.prototype,"stroke",2),x([I],bt.prototype,"strokeWidth",2),x([I],bt.prototype,"strokeOpacity",2),x([I],bt.prototype,"lineDash",2),x([I],bt.prototype,"lineDashOffset",2),x([I],bt.prototype,"interpolation",2),x([I],bt.prototype,"styler",2),x([I],bt.prototype,"shadow",2),x([I],bt.prototype,"marker",2),x([I],bt.prototype,"label",2),x([I],bt.prototype,"tooltip",2),x([I],bt.prototype,"connectMissingData",2);function Ot(t,e,i){return(e-t)*i+t}function UI(t,e){const{x0:i,y0:n,x1:s,y1:r}=t,o=(r-n)/(s-i)*(e-i)+n;return{leftCp1x:i,leftCp1y:n,leftCp2x:e,leftCp2y:o,stepX:e,stepY0:o,stepY1:o,rightCp1x:e,rightCp1y:o,rightCp2x:s,rightCp2y:r}}function PP(t,e){const{cp0x:i,cp0y:n,cp1x:s,cp1y:r,cp2x:a,cp2y:o,cp3x:l,cp3y:c}=t,h=Ku(i,s,a,l,e),[u,d]=fc(i,n,s,r,a,o,l,c,h),g=u[3].y;return{leftCp1x:u[1].x,leftCp1y:u[1].y,leftCp2x:u[2].x,leftCp2y:u[2].y,stepX:e,stepY0:g,stepY1:g,rightCp1x:d[1].x,rightCp1y:d[1].y,rightCp2x:d[2].x,rightCp2y:d[2].y}}function FP(t){const{x0:e,y0:i,x1:n,y1:s,stepX:r}=t;return{leftCp1x:(e+r)/2,leftCp1y:i,leftCp2x:(e+r)/2,leftCp2y:i,stepX:r,stepY0:i,stepY1:s,rightCp1x:(r+n)/2,rightCp1y:s,rightCp2x:(r+n)/2,rightCp2y:s}}function WI(t,e){return t.type==="linear"?UI(t,e):t.type==="cubic"?PP(t,e):t.type==="step"?FP(t):UI(t,e)}function KI(t,e,i,n,s,r,a){switch(e){case 0:a?t.moveTo(s,r):t.moveTo(i,n);break;case 1:a?t.lineTo(s,r):t.lineTo(i,n);break;case 2:break}}function YI(t,e,i,n,s,r){r?t.lineTo(e,i):t.lineTo(n,s)}function ZI(t,e,i,n,s,r,a,o,l,c){c?t.cubicCurveTo(r,a,n,s,e,i):t.cubicCurveTo(n,s,r,a,o,l)}function XI(t,e,i,n,s,r,a){a?(t.lineTo(r,s),t.lineTo(r,i),t.lineTo(e,i)):(t.lineTo(r,i),t.lineTo(r,s),t.lineTo(n,s))}function VP(t,e,i,n,s,r,a){if(a){for(let o=r.length-1;o>=0;o--){const{x:l,y:c}=r[o];t.lineTo(l,c)}t.lineTo(e,i)}else{for(const{x:o,y:l}of r)t.lineTo(o,l);t.lineTo(n,s)}}function Kc(t,e,i,n){const[s,r]=Di(e);switch(KI(t,i,s.x,s.y,r.x,r.y,n),e.type){case"linear":YI(t,e.x0,e.y0,e.x1,e.y1,n);break;case"cubic":ZI(t,e.cp0x,e.cp0y,e.cp1x,e.cp1y,e.cp2x,e.cp2y,e.cp3x,e.cp3y,n);break;case"step":XI(t,e.x0,e.y0,e.x1,e.y1,e.stepX,n);break;case"multi-line":VP(t,e.x0,e.y0,e.x1,e.y1,e.midPoints,n);break}}function qI(t,e,i){const[n,s]=Di(t),[r,a]=Di(e),o=Ot(n.x,r.x,i),l=Ot(n.y,r.y,i),c=Ot(s.x,a.x,i),h=Ot(s.y,a.y,i);return[{x:o,y:l},{x:c,y:h}]}function ry(t,e,i,n,s,r){const[{x:a,y:o},{x:l,y:c}]=qI(e,i,n);if(KI(t,s,a,o,l,c,r),e.type==="cubic"&&i.type==="cubic"){const h=Ot(e.cp1x,i.cp1x,n),u=Ot(e.cp1y,i.cp1y,n),d=Ot(e.cp2x,i.cp2x,n),g=Ot(e.cp2y,i.cp2y,n);ZI(t,a,o,h,u,d,g,l,c,r)}else if(e.type==="step"&&i.type==="step"){const h=Ot(e.stepX,i.stepX,n);XI(t,a,o,l,c,h,r)}else if(e.type==="linear"&&i.type==="linear")YI(t,a,o,l,c,r);else{let h;e.type==="step"?h=e.stepX:i.type==="step"?h=i.stepX:h=(a+l)/2;const u=WI(e,h),d=WI(i,h),g=Ot(u.leftCp1x,d.leftCp1x,n),p=Ot(u.leftCp1y,d.leftCp1y,n),f=Ot(u.leftCp2x,d.leftCp2x,n),m=Ot(u.leftCp2y,d.leftCp2y,n),y=Ot(u.stepX,d.stepX,n),b=Ot(u.stepY0,d.stepY0,n),v=Ot(u.stepY1,d.stepY1,n),S=Ot(u.rightCp1x,d.rightCp1x,n),M=Ot(u.rightCp1y,d.rightCp1y,n),C=Ot(u.rightCp2x,d.rightCp2x,n),D=Ot(u.rightCp2y,d.rightCp2y,n);r?(t.cubicCurveTo(C,D,S,M,y,v),t.lineTo(y,b),t.cubicCurveTo(f,m,g,p,a,o)):(t.cubicCurveTo(g,p,f,m,y,b),t.lineTo(y,v),t.cubicCurveTo(S,M,C,D,l,c))}}var JI=1e3,QI=(t=>(t[t.Zero=0]="Zero",t[t.Split=1]="Split",t))(QI||{});function _P(t,e){return t==null||e==null||typeof t!="object"||typeof e!="object"?!1:"id"in t&&"id"in e?t.id===e.id:t.toString()===e.toString()}function mi(t){return $u(t).valueOf()}function Qt(t,e){if(!e)return Number.NaN;if(t instanceof Date&&(t=t.getTime()),e.type==="continuous"&&typeof t=="number")return(t-e.domain[0])/(e.domain[1]-e.domain[0])*(e.range[1]-e.range[0])+e.range[0];if(e.type==="log"&&typeof t=="number")return e.convert(t);if(e.type!=="category")return Number.NaN;if(yr(e)){if(typeof t=="number"){const{firstBandTime:s,intervalMs:r,bandCount:a,inset:o,step:l}=e,c=Math.round((t-s)/r);if(c>=0&&c<a)return o+l*c}return Number.NaN}const i=mi(t);let n=e.domain.findIndex(s=>mi(s)===i);return n===-1&&(n=e.domain.findIndex(s=>_P(t,s))),n>=0?e.inset+e.step*n:Number.NaN}function eD({data:t},e){return t.map((i,n)=>({xValue0Index:e.indexOf(mi(i.xValue0)),xValue1Index:e.indexOf(mi(i.xValue1)),datumIndex:n}))}function tD(t){return Object.values(t.scales).every(e=>e.type==="category"?yr(e)?e.bandCount<JI:e.domain.length<JI:!0)}function BP(t,e){const i=e.scales.x,n=t.scales.x;if(i?.type!=="category"||n?.type!=="category"||yr(i)||yr(n))return!0;let s=-1/0;for(const r of i.domain){const a=Qt(r,n);if(Number.isFinite(a)){if(a<s)return!1;s=a}}return!0}function zP(t,e){let i=-1/0;for(const n of t){const s=Qt(n.value,e.scales.x);if(Number.isFinite(s)){if(s<i)return!1;i=s}}return!0}function GP(t,e){const i=new Map;for(const{xValue0:h,xValue1:u}of t.data){const d=mi(h),g=mi(u);i.set(d,h).set(g,u)}const n=Array.from(i,([h,u])=>({axisValue:h,value:u}));n.sort((h,u)=>Qt(h.value,t.scales.x)-Qt(u.value,t.scales.x));const s=[];for(const{xValue0:h,xValue1:u}of e.data){const d=mi(h),g=mi(u);i.has(d)||(i.set(d,h),s.push({axisValue:d,value:h})),i.has(g)||(i.set(g,u),s.push({axisValue:g,value:u}))}s.sort((h,u)=>Qt(h.value,e.scales.x)-Qt(u.value,e.scales.x));const r=n;let a=0;for(const h of s){for(let u=r.length-1;u>=a;u-=1){const d=Qt(h.value,e.scales.x),g=Qt(r[u].value,e.scales.x);if(d>g){a=u+1;break}}r.splice(a,0,h),a+=1}if(!zP(r,e))return;const o=r.map(h=>h.axisValue),l=eD(e,o),c=eD(t,o);return{axisValues:o,oldDataAxisIndices:l,newDataAxisIndices:c}}function iD(t,e,i,n,s){if(s.xValue1Index===s.xValue0Index+1)return t;const r=Di(t);let a,o;if(e.scales.x?.type==="category"){const l=(r[1].x-r[0].x)/(s.xValue1Index-s.xValue0Index);a=r[0].x+(n-s.xValue0Index)*l,o=a+l}else{const l=i[n],c=i[n+1];a=Qt(l,e.scales.x),o=Qt(c,e.scales.x)}return Mf(t,a,o)}function nD(t,e){const[i,n]=Di(t),s=Qt(0,e.scales.y);return Oo(t,{x:i.x,y:s},{x:n.x,y:s})}function sD(t){const[e,i]=Di(t);return Yu(t,{x:(e.x+i.x)/2,y:(e.y+i.y)/2})}function rD(t,e,i,n,s,r){let a,o;if(s.xValue0Index>=r.xValue1Index){const u=n.findLast(g=>g.xValue1Index<=r.xValue1Index)?.datumIndex,d=u==null?void 0:i.data[u];a=d?.xValue1,o=d?.yValue1}else if(s.xValue0Index<=r.xValue0Index){const u=n.find(g=>g.xValue0Index>=r.xValue0Index)?.datumIndex,d=u==null?void 0:i.data[u];a=d?.xValue0,o=d?.yValue0}if(a==null||o==null)switch(e){case 0:return nD(t,i);case 1:return sD(t)}const l=Qt(a,i.scales.x),c=Qt(o,i.scales.y),h={x:l,y:c};return Oo(t,h,h)}function ay(t,e){if(e==null)return;const i=mi(t.xValue0),n=mi(t.xValue1);return e.find(s=>mi(s.xValue0)===i&&mi(s.xValue1)===n)?.span}function aD(t,e,i,n,s,r,a){const o=t.data[n.datumIndex],l=o.span,c=ay(o,s);if(c==null){const h=rD(l,e,t,i,n,r);a.added.push({from:h,to:l})}else a.removed.push({from:c,to:c}),a.moved.push({from:c,to:l}),a.added.push({from:l,to:l})}function oD(t,e,i,n,s,r,a){const o=t.data[n.datumIndex],l=o.span,c=ay(o,s);if(c==null){const h=rD(l,e,t,i,n,r);a.removed.push({from:l,to:h})}else a.removed.push({from:l,to:l}),a.moved.push({from:l,to:c}),a.added.push({from:c,to:c})}function lD(t,e,i,n,s){const r=n.scales.x,a=e[s.xValue0Index],o=e[s.xValue1Index];let l,c;if(r?.type==="continuous"||r?.type==="log"?(l=i.data.findLast(y=>mi(y.xValue0)<=a),c=i.data.find(y=>mi(y.xValue1)>=o)):(l=i.data.find(y=>mi(y.xValue0)===a),c=i.data.find(y=>mi(y.xValue1)===o)),l==null||c==null)return;const[{x:h},{x:u}]=Di(t),d=Qt(l.xValue0,i.scales.x),g=Qt(l.yValue0,i.scales.y),p=Qt(c.xValue1,i.scales.x),f=Qt(c.yValue1,i.scales.y);let m=n.data[s.datumIndex].span;return m=Oo(m,{x:d,y:g},{x:p,y:f}),m=Mf(m,h,u),m}function jP(t,e,i,n,s,r,a,o,l){const c=s+1,h=a.find(v=>v.xValue0Index<=s&&v.xValue1Index>=c),u=r.find(v=>v.xValue0Index<=s&&v.xValue1Index>=c),d=e.zeroData,g=t.zeroData;if(h==null&&u!=null){aD(t,i,r,u,d,o,l);return}else if(h!=null&&u==null){oD(e,i,a,h,g,o,l);return}else if(h==null||u==null)return;let p;h.xValue0Index===u.xValue0Index&&h.xValue1Index===u.xValue1Index?p=0:h.xValue0Index<=u.xValue0Index&&h.xValue1Index>=u.xValue1Index?p=-1:h.xValue0Index>=u.xValue0Index&&h.xValue1Index<=u.xValue1Index?p=1:p=0;const f=e.data[h.datumIndex],m=iD(f.span,e,n,s,h),y=t.data[u.datumIndex],b=iD(y.span,t,n,s,u);if(p===1){const v=lD(m,n,e,t,u);v==null?oD(e,i,a,h,g,o,l):(l.removed.push({from:m,to:v}),l.moved.push({from:v,to:b}),l.added.push({from:b,to:b}))}else if(p===-1){const v=lD(b,n,t,e,h);v==null?aD(t,i,r,u,d,o,l):(l.removed.push({from:m,to:m}),l.moved.push({from:m,to:v}),l.added.push({from:v,to:b}))}else l.removed.push({from:m,to:m}),l.moved.push({from:m,to:b}),l.added.push({from:b,to:b})}function HP(t,e,i,n){const s={removed:[],moved:[],added:[]},{axisValues:r,oldDataAxisIndices:a,newDataAxisIndices:o}=t,l={xValue0Index:Math.max(a.at(0)?.xValue0Index??-1/0,o.at(0)?.xValue0Index??-1/0),xValue1Index:Math.min(a.at(-1)?.xValue1Index??1/0,o.at(-1)?.xValue1Index??1/0)};for(let c=0;c<r.length-1;c+=1)jP(e,i,n,r,c,o,a,l,s);return s}function $P(t,e){const i=[],n=[],s=[],r=Math.min(e.data.length,t.data.length);for(let a=0;a<r;a+=1){const o=e.data[a].span,l=t.data[a].span;i.push({from:o,to:o}),n.push({from:o,to:l}),s.push({from:l,to:l})}if(e.data.length>t.data.length&&t.data.length>0){const a=t.data.at(-1).span,[,o]=Di(a),l=Yu(a,o);for(let c=r;c<e.data.length;c+=1){const h=e.data[c].span;i.push({from:h,to:h}),n.push({from:h,to:l})}}if(t.data.length>e.data.length&&e.data.length>0){const a=e.data.at(-1).span,[,o]=Di(a),l=Yu(a,o);for(let c=r;c<t.data.length;c+=1){const h=t.data[c].span;n.push({from:l,to:h}),s.push({from:h,to:h})}}return{removed:i,moved:n,added:s}}function cD(t,e,i){const{span:n}=e;switch(i){case 0:return ay(e,t.zeroData)??nD(n,t);case 1:return sD(n)}}function UP(t,e,i){const n=[],s=[];for(const r of e.data){const a=r.span,o=cD(e,r,i);s.push({from:a,to:o})}for(const r of t.data){const a=r.span,o=cD(t,r,i);n.push({from:o,to:a})}return{removed:s,moved:[],added:n}}function Yc(t,e,i){if(!tD(t)||!tD(e)||!BP(t,e))return;const n=GP(t,e);return n==null?UP(t,e,i):n.axisValues.length===n.oldDataAxisIndices.length+n.newDataAxisIndices.length+2?$P(t,e):HP(n,t,e,i)}function Zc(t,e){const i=t.map(s=>s.point);let n=N0(i);switch(e.type){case"linear":break;case"smooth":n=E0(i,e.tension);break;case"step":n=O0(i,e.position);break}return n.map(function(r,a){return{span:r,xValue0:t[a].xDatum,yValue0:t[a].yDatum,xValue1:t[a+1].xDatum,yValue1:t[a+1].yDatum}})}function $d(t,e,i=.001){return Math.abs(t.x-e.x)<i&&Math.abs(t.y-e.y)<i}function oy({path:t},e){let i;for(const{span:n}of e){const[s,r]=Di(n),a=i!=null&&$d(i,s)?2:0;Kc(t,n,a,!1),i=r}}function Ud(t,e,i){let n;for(const s of i){const[r,a]=qI(s.from,s.to,t),o=n!=null&&$d(n,r)?2:0;ry(e.path,s.from,s.to,t,o,!1),n=a}}function hD(t,e,i,n=1){const s=(l,c)=>Ud(l,c,e.removed),r=(l,c)=>Ud(l,c,e.moved),a=(l,c)=>Ud(l,c,e.added),o=ly(t,i,n);return{status:t,path:{addPhaseFn:a,updatePhaseFn:r,removePhaseFn:s},pathProperties:o}}function ly(t,e,i=1){const n=e==="none"?"updated":t,s={fromFn(r,a){const o={phase:Pn[n]},l=r.previousDatum??a;return l!=null&&(o.segments=l),t==="removed"?o.finish={visible:!1}:t==="added"&&(o.start={visible:!0}),o},toFn(r,a){const o={phase:Pn[n]},l=a;return l!=null&&(o.segments=l),o}};return e==="fade"?{fromFn(r,a){const o=t==="added"?0:i,l=t==="removed"?r.previousDatum??a:a;return{...s.fromFn(r,a),opacity:o,segments:l}},toFn(r,a){const o=t==="removed"?0:i,l=t==="removed"?r.previousDatum??a:a;return{...s.toFn(r,a),opacity:o,segments:l}}}:s}function WP(t,e,i,n=1){const s=t.scales.x?.type==="category",r=e.scales.x?.type==="category";if(s!==r||!mc(t.scales.x)||!mc(e.scales.x)||t.strokeData==null||e.strokeData==null)return;let a="updated";e.visible&&!t.visible?a="removed":!e.visible&&t.visible&&(a="added");const o=Yc({scales:t.scales,data:t.strokeData.spans},{scales:e.scales,data:e.strokeData.spans},1);if(o==null)return;const l=hD(a,o,"fade",n),c=(i?.changed??!0)||!ca(t.scales.x,e.scales.x)||!ca(t.scales.y,e.scales.y)||a!=="updated";return{status:a,stroke:l,hasMotion:c}}function uD({path:t},{spans:e,phantomSpans:i}){let n=0,s={x:Number.NaN,y:Number.NaN},r={x:Number.NaN,y:Number.NaN};for(let a=0;a<e.length;a+=1){const{span:o}=e[a],{span:l}=i[a],{0:c,1:h}=Di(o),{0:u,1:d}=Di(l);if($d(s,c)&&$d(r,u))Kc(t,o,2,!1);else{for(let g=a-1;g>=n;g-=1)Kc(t,i[g].span,1,!0);t.closePath(),Kc(t,o,0,!1),n=a}s=h,r=d}for(let a=e.length-1;a>=n;a-=1)Kc(t,i[a].span,1,!0);t.closePath()}function cy(t,{path:e},i,n){for(let s=0;s<i.length;s+=1){const r=i[s],a=n[s];ry(e,r.from,r.to,t,0,!1),ry(e,a.from,a.to,t,1,!0),e.closePath()}}function dD(t,e,i,n){const s=(l,c)=>cy(l,c,e.removed,i.removed),r=(l,c)=>cy(l,c,e.moved,i.moved),a=(l,c)=>cy(l,c,e.added,i.added),o=ly(t,n);return{status:t,path:{addPhaseFn:a,updatePhaseFn:r,removePhaseFn:s},pathProperties:o}}function KP(t,e){const i=t.scales.x?.type==="category",n=e.scales.x?.type==="category";if(i!==n||!mc(t.scales.x)||!mc(e.scales.x))return;let s="updated";e.visible&&!t.visible?s="removed":!e.visible&&t.visible&&(s="added");const r=Yc({scales:t.scales,data:t.fillData.spans},{scales:e.scales,data:e.fillData.spans},0);if(r==null)return;const a=Yc({scales:t.scales,data:t.fillData.phantomSpans},{scales:e.scales,data:e.fillData.phantomSpans},0);if(a==null)return;const o=Yc({scales:t.scales,data:t.strokeData.spans,zeroData:t.fillData.phantomSpans},{scales:e.scales,data:e.strokeData.spans,zeroData:e.fillData.phantomSpans},0);if(o==null)return;const l="none",c=dD(s,r,a,l),h=hD(s,o,l);return{status:s,fill:c,stroke:h}}function Xc({id:t},e,i,n,...s){const r={...n,phase:n?.phase??(i?Pn[i]:"trailing")};Os(t,"markers",e,s,{opacity:0},{opacity:1},r);for(const a of s)a.cleanup()}function YP({id:t},e,...i){Os(t,"markers",e,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"});for(const n of i)n.cleanup()}function hy({id:t,nodeDataDependencies:e},i,n,...s){const r=e.seriesRectWidth;Mt(t,"markers",i,s,{fromFn:(l,c)=>{const h=c.midPoint?.x??r;let u=te(0,z0(h/r),1);return Number.isNaN(u)&&(u=0),{scalingX:0,scalingY:0,delay:n?.delay??u,duration:n?.duration??tm,phase:n?.phase??"initial",start:n?.start,finish:n?.finish}},toFn:()=>({scalingX:1,scalingY:1})})}function Wd(t){return{opacity:1,scalingX:1,scalingY:1}}function Kd(t){for(const e of t){const i=e.nodes();e.batchedUpdate(function(){for(const s of i){const r=s.datum;if(r?.point==null)continue;const{x:a,y:o}=r.point;!Number.isFinite(a)||!Number.isFinite(o)||s.resetAnimationProperties(a,o,s.size,1,1,1)}e.cleanup()})}}function qc(t,e){return{x:e.point?.x??Number.NaN,y:e.point?.y??Number.NaN,scalingCenterX:e.point?.x??Number.NaN,scalingCenterY:e.point?.y??Number.NaN}}function Yd(t,{datumIndex:e}){const i=t.getNodeData();if(i===void 0)return;const n=i[e],{point:s}=n??{};if(n==null||s==null)return;const r=t.getFormattedMarkerStyle(n),a=Lt.anchor(r.shape),o=s.focusSize??r.size,l=4+o,c=l/2,h=(a.x-.5)*o,u=(a.y-.5)*o,d=n.point.x-c-h,g=n.point.y-c-u;return Ze.toCanvas(t.contentGroup,new U(d,g,l,l))}function ZP(t,e,i,n){if(!(n.enabled??i.enabled))return!1;const r=1;return(e.step??Yr(e.range)/Math.max(1,t))>r}function uy(t,e,i,n,s,r=s,a=!1){const o=e?.crossFiltering===!0||ZP(i.input.count,n.x.scale,s,r);return t.selection.enabled&&!a?{needsNodeData:!0,hideWithSize0:!o}:{needsNodeData:o,hideWithSize0:!1}}function Zd(t,e,i,n){return n??(n={stroke:e.stroke,strokeOpacity:e.strokeOpacity,strokeWidth:e.strokeWidth}),Cm.reduce((s,r)=>(s[r]=t.getMarkerStyle(i,{},void 0,{highlightState:r},void 0,n),s),{})}function dy({id:t,visible:e,nodeDataDependencies:i},n,...s){const{seriesRectWidth:r,seriesRectHeight:a}=i;Os(t,"path_properties",n,s,{clipX:0},{clipX:r},{phase:"initial",start:{clip:!0,clipY:a,visible:e},finish:{clip:!1,visible:e}})}function gy({id:t},e,i,n="add",...s){Os(t,e,i,s,{opacity:0},{opacity:1},{phase:n})}function py(t){return e=>({visible:t.getVisible(),opacity:t.getOpacity(),clipScalingX:1,clip:!1})}function Xd({nodeDataDependencies:t},e){const i=n=>Number.isFinite(n)?n:0;e.clipX=i(t.seriesRectWidth),e.clipY=i(t.seriesRectHeight)}function gD(t){return t.isReversed()!==t.range[1]<t.range[0]}function qd(t,e,i,n,s,r=!0){if(e.scale.domain.length===0||i.scale.domain.length===0)return;const a=t.key==="x"?e:i,{scale:o,direction:l}=a,c=l==="x",h=o.bandwidth??0,u=r?((o.step??0)-h)/2:0,d=Math.max(n.x,s.width-(n.x+n.width)),g=Math.max(n.y,s.height-(n.y+n.height)),p=()=>gD(c?e:i)?c?n.width+d:n.height+g:c?-d:-g,f=()=>gD(c?e:i)?c?-d:-g:c?n.width+d:n.height+g;return(y=>{const b=[];let v=-1;for(let S=0;S<y.length;S++){const M=y[S];if(Rl(M))continue;const{start:C,stop:D,...A}=y[S],w=y[v]?.stop,L=y.slice(S+1).find(F=>F.start!=null)?.start;let O=o.convert(C??w)-u,R=o.convert(D??L)+2*u;const _=C!=null&&Number.isNaN(O),E=D!=null&&Number.isNaN(R);_||E||(Number.isNaN(O)&&(O=p()),Number.isNaN(R)&&(R=f()),D!=null&&(v=S),b.push({start:O,stop:R,...A}))}return b})(t.segments).map(({stop:y,start:b,...v})=>{const S=c?b:-d,M=c?-g:b,C=c?y+h:n.width+d,D=c?n.height+g:y+h;return{clipRect:{x0:S,y0:M,x1:C,y1:D},...v}})}var pD=new Set(["time","timestamp","date","datetime"]);function fy(t,e,i,{allowPrimitiveTypes:n=!0}={}){if(t!=="x"&&t!=="y"||!he(e))return;const s=fD(t,i);if(s==null||!(s in e))return;const r=e[s],a=mD(t,i),o=qP(r);if(o)return{type:o,position:a};const l=JP(s,r);if(l)return{type:l,position:a};if(n)return typeof r=="number"?{type:"number",position:a}:{type:"category",position:a}}function Jc(t,e,i){return fy(t,e,i,{allowPrimitiveTypes:!1})}function XP(t,e,i){if(t!=="x"||!he(e))return;const n=fD(t,i);if(n==null||!(n in e))return;const s=e[n],r=mD(t,i),a=QP(n,s);if(a)return{type:a,position:r};if(ot(s))return{type:"category",position:r}}function qP(t){if(ce(t)&&t.every(e=>ot(e)||e===null))return"grouped-category"}function JP(t,e){if(rn(e)||pD.has(t)&&Li(e))return"time"}function QP(t,e){if(rn(e)||pD.has(t)&&Li(e))return"ordinal-time"}function fD(t,e){if(t==="x"&&"xKey"in e)return e.xKey;if(t==="y"&&"yKey"in e)return e.yKey}function mD(t,e){return"direction"in e&&e.direction==="horizontal"?t==="x"?"left":"bottom":t==="x"?"bottom":"left"}var my=class bh extends kr{constructor(e){super({moduleCtx:e,propertyKeys:tl,propertyNames:il,categoryKey:"xValue",pathsPerSeries:["fill","stroke"],pathsZIndexSubOrderOffset:[0,1e3],datumSelectionGarbageCollection:!1,segmentedDataNodes:!1,pickModes:[2,0],animationResetFns:{path:py({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:Pa,datum:(i,n)=>({...Wd(i),...qc(i,n)})},clipFocusBox:!1}),this.properties=new bt,this.connectsToYAxis=!0,this.aggregationManager=new Gd,this.hideWithSize0=!1,this.backgroundGroup=new ne({name:`${this.id}-background`,zIndex:0}),this._isStacked=void 0,this.fillSpans=[],this.phantomSpans=[],this.strokeSpans=[]}get pickModeAxis(){return"main"}renderToOffscreenCanvas(){const e=(this.contextNodeData?.nodeData?.length??0)>0;return super.renderToOffscreenCanvas()||e&&this.getDrawingMode(!1)==="cutout"||this.contextNodeData!=null&&(this.contextNodeData.fillData.spans.length>Pm||this.contextNodeData.strokeData.spans.length>Pm)}attachSeries(e,i,n){super.attachSeries(e,i,n),e.appendChild(this.backgroundGroup)}detachSeries(e,i,n){super.detachSeries(e,i,n),this.backgroundGroup.remove()}attachPaths([e,i]){this.backgroundGroup.appendChild(e),this.contentGroup.appendChild(i),i.zIndex=-1}detachPaths([e,i]){e.remove(),i.remove()}isStacked(){return(this.seriesGrouping?.stackCount??1)>1}isNormalized(){return this.properties.normalizedTo!=null}setSeriesIndex(e){const n=this.isStacked()===this._isStacked;return this._isStacked=n,super.setSeriesIndex(e,n)}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:i,visible:n,seriesGrouping:{groupIndex:s=this.id,stackCount:r=1}={}}=this,{xKey:a,yKey:o,selectedKey:l,connectMissingData:c,normalizedTo:h}=this.properties,u=!this.ctx.animationManager.isSkipped(),d=this.axes.x?.scale,g=this.axes.y?.scale,{xScaleType:p,yScaleType:f}=this.getScaleInformation({xScale:d,yScale:g}),m=r>1||h!=null,y={value:`area-stack-${s}-yValue`,marker:`area-stack-${s}-yValues-marker`},b={invalidValue:null};(Kn(h)||c)&&r>1&&(b.invalidValue=0),n||(b.forceValue=0);const v=this.properties.allowNullKeys??!1,S=[Ar(a,p,{id:"xValue",allowNullKey:v}),Xe(o,f,{id:"yValueRaw",...b}),...l==null?[]:[Xe(l,"category",{id:"selectedRaw"})]];m&&S.push(...Aa(o,"normal",{id:"yValueCumulative",...b,groupId:y.marker},f)),Kn(h)&&S.push(Xe(o,f,{id:"yValue",...b,groupId:y.value}),vd(Object.values(y),h)),u&&S.push(zc());const{dataModel:M,processedData:C}=await this.requestDataModel(e,i,{props:S,groupByKeys:m,groupByData:!m});this.aggregateData(M,C),this.animationState.transition("updateData")}xCoordinateRange(e,i){const{marker:n}=this.properties,s=this.axes.x.scale.convert(e),r=n.enabled?.5*n.size*i:0;return[s-r,s+r]}yCoordinateRange(e,i){const{marker:n}=this.properties,s=this.axes.y.scale.convert(e[0]),r=n.enabled?.5*n.size*i:0;return[s-r,s+r]}yValueKey(){return this.isNormalized()?"yValue":"yValueRaw"}yCumulativeKey(e){return e.type==="grouped"?"yValueCumulative":this.yValueKey()}getSeriesDomain(e){const{dataModel:i,processedData:n,axes:s}=this;if(!i||!n)return{domain:[]};const r=s.y;if(e==="x"){const o=i.resolveProcessedDataDefById(this,"xValue"),l=i.getDomain(this,"xValue","key",n);return o?.def.type==="key"&&o.def.valueType==="category"?l:{domain:Bi(dr(l.domain))}}const a=this.domainForClippedRange("y",[this.yCumulativeKey(n)],"xValue");if(r instanceof Es&&!(r instanceof ll)){const o=Number.isFinite(a[1]-a[0])?[Math.min(a[0],0),Math.max(a[1],0)]:[];return{domain:Bi(o)}}else return{domain:Bi(a)}}getSeriesRange(e,i){const[n,s]=this.domainForVisibleRange("y",[this.yCumulativeKey(this.processedData)],"xValue",i);return[Math.min(n,0),Math.max(s,0)]}getZoomRangeFittingItems(e,i,n){return this.zoomFittingVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],e,i,n)}getVisibleItems(e,i,n){return this.countVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],e,i,n)}createBucketLookupFeature(){return new ny({series:this,getXAxis:()=>this.axes.x,getDataModel:()=>this.dataModel,getProcessedData:()=>this.processedData,aggregationManager:this.aggregationManager,domainKey:"key",getSelection:()=>this.data?.selections.get(this.id)?.getSelection(),canonicalExtremaSlots:[ht]})}aggregateData(e,i){if(this.aggregationManager.markStale(i.input.count),fn(i))return;const n=this.axes.x;if(n==null)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>EP(n.scale.type,e,i,this.yCumulativeKey(i),this,s,a),computeFull:a=>OP(n.scale.type,e,i,this.yCumulativeKey(i),this,a),targetRange:s});const r=this.aggregationManager.filters;r&&r.length>0&&js.record(`${this.type}:aggregation`,r.map(a=>a.maxRange))}estimateTargetRange(){const e=this.axes.x;if(e?.scale?.range){const[i,n]=e.scale.range;return Math.abs(n-i)}return this.ctx.scene?.canvas?.width??800}stackAggregatedData(e){const{indices:i,metaIndices:n}=e,{visible:s,axes:r,dataModel:a,processedData:o,seriesBelowStackContext:l}=this,c=r.x,h=r.y;if(!s)return this.phantomSpans=[],this.fillSpans=[],this.strokeSpans=[],l;if(c==null||h==null||a==null||o==null)return;const{scale:u}=c,{scale:d}=h,g=(u.bandwidth??0)/2,p=!this.isStacked()&&this.properties.connectMissingData,f=o.invalidData?.get(this.id),m=a.resolveKeysById(this,"xValue",o),y=a.resolveColumnById(this,this.yCumulativeKey(o),o);let[b,v]=Gc(1,n.length-1,c.range,A=>{const w=n[A],L=n[A+1],O=i[w],R=i[L],_=m[O],E=m[R],{0:F}=this.xCoordinateRange(_,0),{1:z}=this.xCoordinateRange(E,0);return[F,z]});b=Math.max(b-1,0),v=Math.min(v+1,n.length-1);let S=[];if(l?.fillSpans)S=l?.fillSpans;else for(let A=b;A<v;A+=1){const w=n[A],L=n[A+1],O=i[w],R=i[L],_=m[O],E=m[R],F={type:"linear",moveTo:!1,x0:u.convert(_)+g,y0:d.convert(0),x1:u.convert(E)+g,y1:d.convert(0)};S.push({span:F,xValue0:_,xValue1:E,yValue0:0,yValue1:0})}this.phantomSpans=S;const M=[],C=[];let D=0;for(let A=b;A<v;A+=1){const w=n[A],L=n[A+1],O=i[w],R=i[L],_=!p&&this.hasInvalidDatumsInRange(f,y,O,R),E=S[D++];if(_){M.push(E),C.push(E);continue}const F=[];for(let ae=w;ae<=L;ae++){const oe=i[ae];if(f?.[oe])continue;const mt=y[oe];if(!Number.isFinite(mt))continue;const pe=m[oe];F.push({point:{x:u.convert(pe)+g,y:d.convert(mt)},xDatum:pe,yDatum:mt})}if(F.length<2){M.push(E),C.push(E);continue}const z=F[0],K=F.at(-1),G=F.slice(1,-1).map(ae=>ae.point),de={span:{type:"multi-line",moveTo:!1,x0:z.point.x,y0:z.point.y,x1:K.point.x,y1:K.point.y,midPoints:G},xValue0:z.xDatum,xValue1:K.xDatum,yValue0:z.yDatum,yValue1:K.yDatum};M.push(de),C.push(de)}return this.fillSpans=M,this.strokeSpans=C,{stack:[],fillSpans:M,strokeSpans:C}}hasInvalidDatumsInRange(e,i,n,s){const r=Math.min(n,s),a=Math.max(n,s);for(let o=r;o<=a;o++){if(e?.[o])return!0;const l=i[o];if(!Number.isFinite(l))return!0}return!1}stackYValueData(){const{visible:e,axes:i,dataModel:n,processedData:s,seriesBelowStackContext:r,properties:a}=this,o=i.x,l=i.y;if(o==null||l==null||n==null||s==null)return;const{interpolation:c}=a,{scale:h}=o,{scale:u}=l,d=(h.bandwidth??0)/2;let g=n.resolveKeysById(this,"xValue",s),p=n.resolveColumnById(this,this.yValueKey(),s);const f=!this.isStacked()&&this.properties.connectMissingData,m=s.invalidKeys?.get(this.id),b=(f?s.invalidData?.get(this.id):void 0)??m;b!=null&&(g=g.filter((R,_)=>b[_]===!1),p=p.filter((R,_)=>b[_]===!1));let[v,S]=Gc(1,g.length,o.range,R=>this.xCoordinateRange(g[R],0));v=Math.max(v-2,0),S=Math.min(S+2,g.length);let M;if(r?.fillSpans)M=r?.fillSpans;else{const R=[];for(let _=v;_<S;_+=1){const E=g[_];R.push({point:{x:h.convert(E)+d,y:u.convert(0)},xDatum:E,yDatum:0})}M=Zc(R,{type:"linear"})}if(this.phantomSpans=M,!e)return this.fillSpans=M,this.strokeSpans=[],r;let C=r?.stack;if(C==null){C=[];for(let R=v;R<S-1;R+=1)C.push({leading:0,trailing:0,dataValid:!0,breakBefore:!1})}const D=C.slice();let A=!1;for(let R=0;R<D.length;R+=1){const _=v+R,E=v+R+1;let{leading:F,trailing:z,breakBefore:K}=C[R];const G=p[_],ie=p[E],de=!Number.isFinite(G),ae=!Number.isFinite(ie),oe=!de&&!ae;oe&&(F+=G,z+=ie),R!==0&&oe!==A&&(K=!0),A=oe,D[R]={leading:F,trailing:z,dataValid:oe,breakBefore:K}}const w=[],L=[],O=[];for(let R=0;R<D.length;R+=1){const{leading:_,dataValid:E,breakBefore:F}=D[R],z=v+R;if(F){if(O.length!==0){const K=D[R-1],G={point:{x:h.convert(g[z])+d,y:u.convert(K.trailing)},xDatum:g[z],yDatum:K.trailing};O.push(G);const ie=Zc(O,c);w.push(...ie),L.push(...ie)}O.length=0}if(E){const K={point:{x:h.convert(g[z])+d,y:u.convert(_)},xDatum:g[z],yDatum:_};O.push(K)}else w.push(M[R])}if(O.length!==0){const R=D.at(-1),_=v+D.length,E={point:{x:h.convert(g[_])+d,y:u.convert(R.trailing)},xDatum:g[_],yDatum:R.trailing};O.push(E);const F=Zc(O,c);w.push(...F),L.push(...F),O.length=0}return this.fillSpans=w,this.strokeSpans=L,{stack:D,fillSpans:w,strokeSpans:L}}createStackContext(){const e=this.axes.x;if(e==null)return;const{scale:i}=e,[n,s]=i.range,r=Math.abs(s-n);this.aggregationManager.ensureLevelForRange(r);const a=this.aggregationManager.getFilterForRange(r),{processedData:o}=this;return o&&this.ensureBucketLookupFeature()?.setActiveFilter(o,a),a?this.stackAggregatedData(a):this.stackYValueData()}createNodeDatumContext(e,i){const{dataModel:n,processedData:s}=this;if(!n||!s)return;const{xKey:r,xName:a,selectedKey:o,yKey:l,yName:c,legendItemName:h,marker:u,label:d,fill:g,stroke:p,normalizedTo:f}=this.properties,m=e.scale,y=i.scale,{isContinuousY:b}=this.getScaleInformation({xScale:m,yScale:y}),v=s.type==="grouped",[S,M]=m.range,C=Math.abs(M-S);this.aggregationManager.ensureLevelForRange(C);const D=this.aggregationManager.getFilterForRange(C);this.ensureBucketLookupFeature()?.setActiveFilter(s,D);const A=this.contextNodeData?.nodeData,w=A!=null&&this.canIncrementallyUpdateNodes(D!=null);return{xAxis:e,yAxis:i,rawData:s.dataSources.get(this.id)?.data??[],xValues:n.resolveKeysById(this,"xValue",s),yRawValues:n.resolveColumnById(this,"yValueRaw",s),yCumulativeValues:v?n.resolveColumnById(this,"yValueCumulative",s):n.resolveColumnById(this,"yValueRaw",s),selectedValues:o==null?void 0:n.resolveColumnById(this,"selectedRaw",s),invalidData:s.invalidData?.get(this.id),xScale:m,yScale:y,xOffset:(m.bandwidth??0)/2,yOffset:0,indices:D?.indices,isContinuousY:b,labelsEnabled:d.enabled,normalizedTo:f,canIncrementallyUpdate:w,animationEnabled:!this.ctx.animationManager.isSkipped(),xKey:r,yKey:l,xName:a,yName:c,legendItemName:h,markerSize:u.size,markerFill:u.fill??g,markerStroke:u.stroke??p,markerStrokeWidth:u.strokeWidth??this.properties.strokeWidth,yDomain:this.getSeriesDomain("y").domain,nodes:w?A:[],labelData:[],nodeIndex:0}}computeMarkerCoordinate(e,i){let n;(Kn(e.normalizedTo)?e.isContinuousY&&Hu(i.yDatum):!Number.isNaN(i.yDatum))&&(n=i.yCumulative),i.x=e.xScale.convert(i.xDatum)+e.xOffset,i.y=e.yScale.convert(n),Number.isFinite(i.x)||(i.validPoint=!1)}handleDatum(e,i,n){if(i.xDatum=e.xValues[n],!(i.xDatum===void 0&&!this.properties.allowNullKeys)){if(i.datum=e.rawData[n],i.yDatum=e.yRawValues[n],i.yCumulative=+e.yCumulativeValues[n],i.validPoint=Number.isFinite(i.yDatum)&&e.invalidData?.[n]!==!0,this.computeMarkerCoordinate(e,i),i.selected=e.selectedValues?.[n],i.validPoint){if(e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length){const r=e.nodes[e.nodeIndex];r.datum=i.datum,r.datumIndex=n,r.midPoint={x:i.x,y:i.y},r.cumulativeValue=i.yCumulative,r.yValue=i.yDatum,r.xValue=i.xDatum,r.point={x:i.x,y:i.y,size:e.markerSize},r.selected=i.selected}else e.nodes.push({series:this,datum:i.datum,datumIndex:n,midPoint:{x:i.x,y:i.y},cumulativeValue:i.yCumulative,yValue:i.yDatum,xValue:i.xDatum,yKey:e.yKey,xKey:e.xKey,point:{x:i.x,y:i.y,size:e.markerSize},fill:e.markerFill,stroke:e.markerStroke,strokeWidth:e.markerStrokeWidth,selected:i.selected});e.nodeIndex++}if(e.labelsEnabled&&i.validPoint){const s=this.getLabelText(i.yDatum,i.datum,e.yKey,"y",e.yDomain,this.properties.label,{value:i.yDatum,datum:i.datum,xKey:e.xKey,yKey:e.yKey,xName:e.xName,yName:e.yName,legendItemName:e.legendItemName});e.labelData.push({series:this,datum:i.datum,datumIndex:n,x:i.x,y:i.y,labelText:s})}}}populateNodeData(e){const i={datum:void 0,xDatum:void 0,yDatum:void 0,yCumulative:0,selected:void 0,x:0,y:0,validPoint:!1};let[n,s]=this.visibleRangeIndices("xValue",e.xAxis.range,e.indices);n=Math.max(n-2,0),s=Math.min(s+2,e.indices?.length??e.xValues.length),this.processedData.input.count<1e3&&(n=0,s=this.processedData.input.count);for(let r=n;r<s;r+=1){const a=e.indices?.[r]??r;this.handleDatum(e,i,a)}}initializeResult(e){const{visibleSameStackCount:i}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);return{itemId:e.yKey,fillData:{spans:this.fillSpans,phantomSpans:this.phantomSpans},strokeData:{spans:this.strokeSpans},labelData:e.labelData,nodeData:e.nodes,scales:this.calculateScaling(),visible:this.visible,stackVisible:i>0,crossFiltering:this.properties.selectedKey!=null,styles:Zd(this,this.properties,this.properties.marker),segments:void 0}}assembleResult(e,i){return i.segments=qd(this.properties.segmentation,e.xAxis,e.yAxis,this.chart.seriesRect,this.ctx.scene,!1),i}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(e){const{paths:[i,n],visible:s,animationEnabled:r}=e,a=this.contextNodeData?.segments,o=this.getHighlightStyle(),l=this.getSelectionStyle(),c=this.getStyle(void 0),h=ge(l,o,c),{strokeWidth:u,stroke:d,strokeOpacity:g,lineDash:p,lineDashOffset:f,fill:m,fillOpacity:y,opacity:b}=h;n.setProperties({segments:a,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:1,stroke:d,strokeWidth:u,strokeOpacity:g,lineDash:p,lineDashOffset:f,opacity:b,visible:s||r}),n.datum=a,i.setStyleProperties({fill:m,stroke:void 0,fillOpacity:y},this.getShapeFillBBox()),i.setProperties({segments:a,lineJoin:"round",pointerEvents:1,fillShadow:this.properties.shadow,opacity:b,visible:s||r}),i.datum=a,Xd(this,n),Xd(this,i)}updatePaths(e){this.updateAreaPaths(e.paths,e.contextData)}updateAreaPaths(e,i){for(const n of e)n.visible=i.visible;if(i.visible)this.updateFillPath(e,i),this.updateStrokePath(e,i);else for(const n of e)n.path.clear(),n.markDirty("AreaSeries")}updateFillPath(e,i){const[n]=e;n.path.clear(),uD(n,i.fillData),n.markDirty("AreaSeries")}updateStrokePath(e,i){const{spans:n}=i.strokeData,[,s]=e;s.path.clear(),oy(s,n),s.markDirty("AreaSeries")}updateDatumSelection(e){const{nodeData:i,datumSelection:n}=e,{contextNodeData:s,processedData:r,axes:a,properties:o}=this,{marker:l,styler:c}=o,h=c?this.getStyle(void 0).marker:void 0,u=uy(o,s,r,a,l,h,this.chart?.isMiniChart);this.hideWithSize0=u.hideWithSize0,l.isDirty()&&(n.clear(),n.cleanup());const d=u.needsNodeData?i:[];return fn(this.processedData)?n.update(d,void 0,g=>Jt(g.xValue)):n.update(d)}static computeNoStylerMarkerStyle(e,i,n,s,r){const a=e.getStyle(n);return e.getMarkerStyle(i.marker,r,void 0,{isHighlight:i.isHighlight,highlightState:n,selectionState:s,hideWithSize0:i.hideWithSize0},a.marker,{stroke:a.stroke,strokeWidth:a.strokeWidth,strokeOpacity:a.strokeOpacity})}static computeStylerStyle(e,i,n,s,r){return e.getStyle(n)}static applyStylerDatum(e,i,n,s,r,a){const{stroke:o,strokeWidth:l,strokeOpacity:c}=a,h=e.makeItemStylerParams(i.dataModel,i.processedData,n.datumIndex,a.marker);n.style=e.getMarkerStyle(i.marker,n,h,{isHighlight:i.isHighlight,highlightState:s,selectionState:r,hideWithSize0:i.hideWithSize0},a.marker,{stroke:o,strokeWidth:l,strokeOpacity:c})}updateDatumStyles(e){const{hideWithSize0:i}=this,{datumSelection:n,isHighlight:s}=e,{marker:r}=this.properties,{itemStyler:a}=r;if(a==null){this.runMarkerStylePass(n,s,{marker:r,hideWithSize0:i,isHighlight:s},void 0,!0,bh.computeNoStylerMarkerStyle,bh.assignCachedStyle);return}const o={marker:r,hideWithSize0:i,isHighlight:s,dataModel:this.dataModel,processedData:this.processedData};this.runMarkerStylePass(n,s,o,void 0,!0,bh.computeStylerStyle,bh.applyStylerDatum)}updateDatumNodes(e){const{contextNodeData:i}=this;if(!i)return;const{datumSelection:n,isHighlight:s}=e,r=this.getShapeFillBBox(),a=this.ctx.highlightManager.getActiveHighlight(),o=this.getDrawingMode(s,e.drawingMode);n.each((l,c)=>{const h=this.getHighlightState(a,s,c.datumIndex),u=c.style??i.styles[h];this.applyMarkerStyle(u,l,c.point,r,{selected:c.selected}),l.drawingMode=this.resolveMarkerDrawingModeForState(o,u)}),s||this.properties.marker.markClean()}updateLabelSelection(e){return e.labelSelection.update(this.isLabelEnabled()?e.labelData:[])}updateLabelNodes(e){const{isHighlight:i=!1}=e,n=this.ctx.highlightManager?.getActiveHighlight(),s=this.makeLabelFormatterParams();e.labelSelection.each((r,a)=>{const o=Ra(this,a,s,this.properties.label,i,n),{enabled:l,fontStyle:c,fontWeight:h,fontSize:u,fontFamily:d,color:g}=o;l&&a?.labelText?(r.fontStyle=c,r.fontWeight=h,r.fontSize=u,r.fontFamily=d,r.textAlign="center",r.textBaseline="bottom",r.text=a.labelText,r.x=a.x,r.y=a.y-10,r.fill=g,r.visible=!0,r.fillOpacity=this.getHighlightStyle(i,a.datumIndex).opacity??1,r.setBoxing(o)):r.visible=!1})}makeStylerParams(e,i){const{id:n}=this,{marker:s,fill:r,fillOpacity:a,lineDash:o,lineDashOffset:l,stroke:c,strokeOpacity:h,strokeWidth:u,xKey:d,yKey:g}=this.properties,p=wa(e??0),f=ka(i);return{marker:{fill:s.fill,fillOpacity:s.fillOpacity,size:s.size,shape:s.shape,stroke:s.stroke,strokeOpacity:s.strokeOpacity,strokeWidth:s.strokeWidth,lineDash:s.lineDash,lineDashOffset:s.lineDashOffset},highlightState:p,selectionState:f,fill:r,fillOpacity:a,lineDash:o,lineDashOffset:l,seriesId:n,stroke:c,strokeOpacity:h,strokeWidth:u,xKey:d,yKey:g}}makeItemStylerParams(e,i,n,s){const{xKey:r,yKey:a}=this.properties,o=e.resolveKeysById(this,"xValue",i)[n],l=e.resolveColumnById(this,"yValueRaw",i)[n],c=e.getDomain(this,"xValue","key",i).domain,h=e.getDomain(this,this.yCumulativeKey(i),"value",i).domain,u=this.filterItemStylerFillParams(s.fill)??s.fill;return{...Id(o,l,r,a,c,h),xValue:o,yValue:l,...s,fill:u}}makeLabelFormatterParams(){const{xKey:e,xName:i,yKey:n,yName:s,legendItemName:r}=this.properties;return{xKey:e,xName:i,yKey:n,yName:s,legendItemName:r}}getTooltipContent(e){const{id:i,dataModel:n,processedData:s,axes:r,properties:a}=this,{xKey:o,xName:l,yKey:c,yName:h,tooltip:u,legendItemName:d}=a,g=a.allowNullKeys??!1,p=r.x,f=r.y;if(!n||!s||!p||!f)return;const m=s.dataSources.get(this.id)?.data?.[e],y=n.resolveKeysById(this,"xValue",s)[e],b=n.resolveColumnById(this,"yValueRaw",s)[e];if(y===void 0&&!g)return;const v=this.getStyle(void 0),S=this.makeItemStylerParams(n,s,e,v.marker),M=this.getMarkerStyle(this.properties.marker,{datumIndex:e,datum:m},S,{isHighlight:!1},v.marker);return this.formatTooltipWithContext(u,{heading:this.getAxisValueText(p,"tooltip",y,m,o,d,g),symbol:this.legendItemSymbol(),data:[{label:h,fallbackLabel:c,value:this.getAxisValueText(f,"tooltip",b,m,c,d),missing:ba(b)}]},{seriesId:i,datum:m,title:h,xKey:o,xName:l,yKey:c,yName:h,...M,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:e,stroke:i,fillOpacity:n,strokeOpacity:s,strokeWidth:r,lineDash:a,marker:o}=this.getStyle(void 0),l=!o.enabled||o.fill==null,c=l?e:o.fill;return{marker:{...this.getMarkerStyle(this.properties.marker,{},void 0,{isHighlight:!1,checkForHighlight:!1},{size:o.size,shape:o.shape,fill:c,fillOpacity:l?n:o.fillOpacity,stroke:o.stroke}),enabled:o.enabled||r<=0},line:{enabled:!0,stroke:i,strokeOpacity:s,strokeWidth:r,lineDash:a}}}getLegendData(e){if(e!=="category")return[];const{id:i,ctx:{legendManager:n},visible:s}=this,{yKey:r,yName:a,legendItemName:o,showInLegend:l}=this.properties;return[{legendType:e,id:i,itemId:r,legendItemName:o,seriesId:i,enabled:s&&(n?.getItemEnabled({seriesId:i,itemId:r})??!0),label:{text:o??a??r},symbol:this.legendItemSymbol(),hideInLegend:!l}]}resetDatumAnimation(e){Kd([e.datumSelection])}animateEmptyUpdateReady(e){const{datumSelection:i,labelSelection:n,contextData:s,paths:r}=e,{animationManager:a}=this.ctx;this.updateAreaPaths(r,s),dy(this,a,...r),Wt([i],qc),hy(this,a,{...this.getAnimationDrawingModes(),phase:"initial"},i),gt(this,"labels",a,n)}animateReadyResize(e){const{contextData:i,paths:n}=e;this.updateAreaPaths(n,i),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:i}=this.ctx,{datumSelection:n,labelSelection:s,contextData:r,paths:a,previousContextData:o}=e,[l,c]=a;if(r.visible===!1&&o?.visible===!1||l==null&&c==null)return;this.resetDatumAnimation(e),this.resetLabelAnimation(e);const h=()=>{this.resetPathAnimation(e),this.updateAreaPaths(a,r)},u=()=>{i.skipCurrentBatch(),h()};if(r==null||o==null){h(),Xc(this,i,"added",this.getAnimationDrawingModes(),n),gy(this,"fill_path_properties",i,"add",l),gy(this,"stroke_path_properties",i,"add",c),gt(this,"labels",i,s);return}if(r.crossFiltering!==o.crossFiltering){u();return}const d=KP(r,o);if(d===void 0){u();return}else if(d.status==="no-op")return;Xc(this,i,void 0,this.getAnimationDrawingModes(),n),Mt(this.id,"fill_path_properties",i,[l],d.fill.pathProperties),zd(this.id,"fill_path_update",i,[l],d.fill.path),Mt(this.id,"stroke_path_properties",i,[c],d.stroke.pathProperties),zd(this.id,"stroke_path_update",i,[c],d.stroke.path),gt(this,"labels",i,s),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(a,r)})}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Lt}getStyle(e){const{styler:i,marker:n,fill:s,fillOpacity:r,lineDash:a,lineDashOffset:o,stroke:l,strokeOpacity:c,strokeWidth:h}=this.properties,{size:u,shape:d,fill:g="transparent",fillOpacity:p}=n;let f={};if(i){const m=this.getDataSelectionState(void 0),y=this.makeStylerParams(e,m),b=this.cachedCallWithContext(i,y)??{};f=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],b,{pick:!1})??{}}return f.marker??(f.marker={}),{fill:f.fill??s,fillOpacity:f.fillOpacity??r,lineDash:f.lineDash??a,lineDashOffset:f.lineDashOffset??o,stroke:f.stroke??l,strokeOpacity:f.strokeOpacity??c,strokeWidth:f.strokeWidth??h,marker:{enabled:f.marker.enabled??n.enabled,fill:f.marker.fill??g,fillOpacity:f.marker.fillOpacity??p,shape:f.marker.shape??d,size:f.marker.size??u,lineDash:f.marker.lineDash??n.lineDash??a,lineDashOffset:f.marker.lineDashOffset??n.lineDashOffset??o,stroke:f.marker.stroke??n.stroke??l,strokeOpacity:f.marker.strokeOpacity??n.strokeOpacity??c,strokeWidth:f.marker.strokeWidth??n.strokeWidth??h}}}getFormattedMarkerStyle(e){const i=this.getStyle(void 0),n=this.makeItemStylerParams(this.dataModel,this.processedData,e.datumIndex,i.marker);return this.getMarkerStyle(this.properties.marker,e,n,{isHighlight:!0},void 0,i)}isPointInArea(e,i){let n;for(const s of this.backgroundGroup.children())if(s instanceof kt){n=s;break}return n?.getBBox().containsPoint(e,i)?n.isPointInPath(e,i):!1}computeFocusBounds(e){return Yd(this,e)}hasItemStylers(){return this.properties.selection.enabled||this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};my.className="AreaSeries",my.type="area";var eF=my,tF={series:{nodeClickRange:{$if:[{$path:"/selection/enabled"},10,"nearest"]},fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",rr],["image",vs],["pattern",Ki]]},stroke:{$palette:"stroke"},fillOpacity:.8,strokeOpacity:1,strokeWidth:{$isUserOption:["./stroke",2,0]},lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:Xr,xOffset:3,yOffset:3,blur:5},interpolation:{type:"linear"},marker:{enabled:!1,shape:"circle",size:7,strokeWidth:{$isUserOption:["./stroke",1,0]},fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Zl],["pattern",Ki]]},stroke:{$palette:"stroke"}},label:{...Jn,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:dp,selection:ar,segmentation:lu}},yD={type:"series",name:"area",chartType:"cartesian",stackable:!0,version:Ye,dependencies:[sn],options:Tf,predictAxis:Jc,defaultAxes:{y:{type:"number",position:"left"},x:{type:"category",position:"bottom"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:tF,create:t=>new eF(t)},iF=.001,yy=class extends Tt{constructor(){super(...arguments),this.direction="x",this.featherRatio=0}setStaticProperties(t,e,i,n,s,r,a,o,l,c){this.__direction=l??"x",this.__featherRatio=c??0,super.setStaticProperties(t,e,i,n,s,r,a,o)}get feathered(){return Math.abs(this.featherRatio)>iF}isPointInPath(t,e){return this.feathered?this.getBBox().containsPoint(t,e):super.isPointInPath(t,e)}updatePath(){if(!this.feathered){super.updatePath();return}const{path:t,borderPath:e,__direction:i,__featherRatio:n,__x:s,__y:r,__width:a,__height:o}=this;if(t.clear(),e.clear(),i==="x"){const l=Math.abs(n)*a;n>0?(t.moveTo(s,r),t.lineTo(s+a-l,r),t.lineTo(s+a,r+o/2),t.lineTo(s+a-l,r+o),t.lineTo(s,r+o),t.closePath()):(t.moveTo(s+l,r),t.lineTo(s+a,r),t.lineTo(s+a,r+o),t.lineTo(s+l,r+o),t.lineTo(s,r+o/2),t.closePath())}else{const l=Math.abs(n)*o;n>0?(t.moveTo(s,r+l),t.lineTo(s+a/2,r),t.lineTo(s+a,r+l),t.lineTo(s+a,r+o),t.lineTo(s,r+o),t.closePath()):(t.moveTo(s,r),t.lineTo(s+a,r),t.lineTo(s+a,r+o-l),t.lineTo(s+a/2,r+o),t.lineTo(s,r+o-l),t.closePath())}}renderStroke(t){if(!this.feathered){super.renderStroke(t);return}const{__stroke:e,__strokeWidth:i,__lineDash:n,__lineDashOffset:s,__lineCap:r,__lineJoin:a,path:o}=this;if(e&&i){const{globalAlpha:l}=t;this.applyStrokeAndAlpha(t),t.lineWidth=i,n&&t.setLineDash(n),s&&(t.lineDashOffset=s),r&&(t.lineCap=r),a&&(t.lineJoin=a),t.stroke(o.getPath2D()),t.globalAlpha=l}}};x([We()],yy.prototype,"direction",2),x([We()],yy.prototype,"featherRatio",2);function Jd(t,e){for(const i of e){const n=i.datum;n===void 0?j.error("undefined datum"):t.addValue(i,n)}}function Qd(t,e){const{x:i,y:n}=e,{nearest:s,distanceSquared:r}=t.getQuadTree().find(i,n);if(s!==void 0)return{datum:s.value,distance:Math.sqrt(r)}}var Qc=class extends Fn{constructor(){super(...arguments),this.direction="vertical",this.width=void 0,this.widthRatio=void 0}};x([I],Qc.prototype,"direction",2),x([I],Qc.prototype,"width",2),x([I],Qc.prototype,"widthRatio",2);var bD=class extends kr{constructor(){super(...arguments),this.smallestDataInterval=void 0,this.largestDataInterval=void 0}padBandExtent(t,e){const i=typeof e=="boolean"?1:.5,n=Ee(this.smallestDataInterval)?this.smallestDataInterval*i:0,s=dr(t)??[Number.NaN,Number.NaN];return typeof e=="boolean"?s[e?0:1]-=(e?1:-1)*n:(s[0]-=n,s[1]+=n),Bi(s)}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 t=this.getBarDirection();return this.axes[t]}getCategoryAxis(){const t=this.getCategoryDirection();return this.axes[t]}getMinimumRangeSeries(t){const{width:e}=this.properties;if(e==null||!this.getCategoryAxis())return;const{index:n}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);t[n]=Math.max(t[n]??0,e)}getMinimumRangeChart(t){if(t.length===0)return 0;const e=this.getCategoryAxis();if(!(e instanceof Bd||e instanceof Qo))return 0;const i=this.data?.netSize()??0;if(i===0)return 0;const n=this.getBandScalePadding(),{paddingInner:s=n.inner,paddingOuter:r=n.outer,groupPaddingInner:a}=e.options,o=t.reduce((d,g)=>d+g,0),l=o/t.length,{visibleGroupCount:c}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this),h=o+a*l*(c-1),u=(i-s+r*2)/(1-s);return h*u}validateCreateNodeDataPreconditions(){const t=this.getCategoryAxis(),e=this.getValueAxis();if(!(!t||!e||!this.dataModel||!this.processedData))return{xAxis:t,yAxis:e}}getBandwidth(t,e){return Ve.is(t.scale)?t.scale.calcBandwidth(this.smallestDataInterval,e):t.scale.bandwidth??0}xCoordinateRange(t){const e=this.axes[this.getCategoryDirection()],i=e.scale,n=this.getBandwidth(e,0),s=Ve.is(i)?n*-.5:0,r=i.convert(t)+s;return[r,r+n]}yCoordinateRange(t){const i=this.axes[this.getBarDirection()].scale,n=t.map(s=>i.convert(s));if(n.length===1){const s=i.convert(0);return[Math.min(n[0],s),Math.max(n[0],s)]}return At(n)}getBarDimensions(){const t=this.getCategoryAxis(),e=this.getBandwidth(t);this.ctx.seriesStateManager.updateGroupScale(this,e,t);const i=this.getBarWidth(),n=this.getBarOffset(i);let s=this.getGroupOffset();if(this.ctx.domManager.isRtl&&this.seriesGrouping!=null){const r=this.ctx.seriesStateManager.getGroupBandWidth(this);s=e-s-r}return{groupOffset:s,barOffset:n,barWidth:i}}getGroupOffset(){return this.ctx.seriesStateManager.getGroupOffset(this)}getBarOffset(t){const e=this.ctx.seriesStateManager.getGroupScale(this),i=this.getCategoryAxis();let n=0;Ve.is(i.scale)?n=-t/2:this.seriesGrouping==null&&e?n=(this.getGroupScaleRangeWidth(e)-t)/2:e&&this.properties.widthRatio!=null&&(n=(e.bandwidth-t)/2);const s=this.ctx.seriesStateManager.getStackOffset(this,t);return n+s}getBarWidth(){const{seriesGrouping:t}=this,{width:e}=this.properties;let{widthRatio:i}=this.properties;const n=this.ctx.seriesStateManager.getGroupScale(this),s=n?.bandwidth??0;if(t==null&&(i??(i=1)),i!=null){let r=e;return t==null&&r==null&&n&&(r=this.getGroupScaleRangeWidth(n)),r==null&&s<1&&n?n.rawBandwidth:(r??s)*i}return e??(s<1&&n?n.rawBandwidth:s)}getGroupScaleRangeWidth(t){let e=t.range[1]-t.range[0];return t.round&&e>0&&(e=Math.floor(e)),e}getDatumOffset(t){const e=this.getCategoryAxis();if(!this.processedData?.invalidData||!this.processedData?.missingData||!(e instanceof Qo&&e.options.skipNullBars))return 0;const i=this.ctx.seriesStateManager.getDatumOffset(this,this.processedData.invalidData,this.processedData.missingData,t);return this.ctx.domManager.isRtl?-i:i}resolveKeyDirection(t){return this.getBarDirection()==="x"?t==="x"?"y":"x":t}initQuadTree(t){Jd(t,this.datumNodesIter())}pickNodeClosestDatum(t){return Qd(this,t)}};function by(t,e,i,n,s){if(e.length<xs)return;const[r,a]=t,{smallestKeyInterval:o,xNeedsValueOf:l,yNeedsValueOf:c,existingFilters:h}=s;let u=Ss(e,r,a,{smallestKeyInterval:o,xNeedsValueOf:l});const d=h?.find(S=>S.maxRange===u);let{indexData:g,valueData:p,negativeIndexData:f,negativeValueData:m}=Ms(e,n,i??n,r,a,u,{split:!0,xNeedsValueOf:l,yNeedsValueOf:c,reuseIndexData:d?.positiveIndexData,reuseValueData:d?.positiveValueData,reuseNegativeIndexData:d?.negativeIndexData,reuseNegativeValueData:d?.negativeValueData});if(!f||!m)throw new Error("Negative aggregation data missing in split mode");let y=Qn(u,g,d?.positiveIndices),b=Qn(u,f,d?.negativeIndices);const v=[{maxRange:u,positiveIndices:y,positiveIndexData:g,positiveValueData:p,negativeIndices:b,negativeIndexData:f,negativeValueData:m}];for(;u>64;){const S=u,M=Math.trunc(S/2),C=h?.find(w=>w.maxRange===M),D=Zr(g,p,S,{reuseIndexData:C?.positiveIndexData,reuseValueData:C?.positiveValueData}),A=Zr(f,m,S,{reuseIndexData:C?.negativeIndexData,reuseValueData:C?.negativeValueData});u=D.maxRange,g=D.indexData,p=D.valueData,y=D.midpointData??Qn(u,g,C?.positiveIndices),f=A.indexData,m=A.valueData,b=A.midpointData??Qn(u,f,C?.negativeIndices),v.push({maxRange:u,positiveIndices:y,positiveIndexData:g,positiveValueData:p,negativeIndices:b,negativeIndexData:f,negativeValueData:m})}return v.reverse(),v}function nF(t,e,i,n,s){if(e.length<xs)return;const[r,a]=t,{smallestKeyInterval:o,xNeedsValueOf:l,yNeedsValueOf:c,targetRange:h,existingFilters:u}=s,d=Ss(e,r,a,{smallestKeyInterval:o,xNeedsValueOf:l}),g=Math.min(d,po(Math.max(h,or))),p=u?.find(M=>M.maxRange===g),{indexData:f,valueData:m,negativeIndexData:y,negativeValueData:b}=Ms(e,n,i??n,r,a,g,{split:!0,xNeedsValueOf:l,yNeedsValueOf:c,reuseIndexData:p?.positiveIndexData,reuseValueData:p?.positiveValueData,reuseNegativeIndexData:p?.negativeIndexData,reuseNegativeValueData:p?.negativeValueData});if(!y||!b)throw new Error("Negative aggregation data missing in split mode");const v={maxRange:g,positiveIndices:Qn(g,f,p?.positiveIndices),positiveIndexData:f,positiveValueData:m,negativeIndices:Qn(g,y,p?.negativeIndices),negativeIndexData:y,negativeValueData:b};function S(){return by([r,a],e,i,n,{smallestKeyInterval:o,xNeedsValueOf:l,yNeedsValueOf:c,existingFilters:u})?.filter(C=>C.maxRange!==g)??[]}return{immediate:[v],computeRemaining:S}}function sF(t,e,i,n,s,r,a,o){const[l,c]=Zi(t,s);return by([l,c],e,i,n,{smallestKeyInterval:r,xNeedsValueOf:a,yNeedsValueOf:o})}var rF=ac(sF);function aF(t,e,i,n,s){const r=e.resolveKeysById(n,"xValue",i),a=e.hasColumnById(n,"yValue-start"),o=a?e.resolveColumnById(n,"yValue-start",i):void 0,l=a?e.resolveColumnById(n,"yValue-end",i):e.resolveColumnById(n,"yValue-raw",i),c=e.getDomain(n,"xValue","key",i),h=e.resolveColumnNeedsValueOf(n,"xValue",i),u=e.resolveColumnNeedsValueOf(n,a?"yValue-end":"yValue-raw",i);if(s){const[d,g]=Zi(t,c);return by([d,g],r,o,l,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:h,yNeedsValueOf:u,existingFilters:s})}return rF(t,r,o,l,c,i.reduced?.smallestKeyInterval,h,u)}function oF(t,e,i,n,s,r){const a=e.resolveKeysById(n,"xValue",i),o=e.hasColumnById(n,"yValue-start"),l=o?e.resolveColumnById(n,"yValue-start",i):void 0,c=o?e.resolveColumnById(n,"yValue-end",i):e.resolveColumnById(n,"yValue-raw",i),h=e.getDomain(n,"xValue","key",i),u=e.resolveColumnNeedsValueOf(n,"xValue",i),d=e.resolveColumnNeedsValueOf(n,o?"yValue-end":"yValue-raw",i),[g,p]=Zi(t,h);return nF([g,p],a,l,c,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:u,yNeedsValueOf:d,targetRange:s,existingFilters:r})}var vy=class extends Qi{constructor(){super(...arguments),this.placement="inside-center",this.spacing=0}};x([I],vy.prototype,"placement",2),x([I],vy.prototype,"spacing",2);var rt=class extends Qc{constructor(){super(...arguments),this.fill="#c16068",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 os,this.label=new vy,this.tooltip=Fa(),this.sparklineMode=!1}};x([I],rt.prototype,"xKey",2),x([I],rt.prototype,"xName",2),x([I],rt.prototype,"yKey",2),x([I],rt.prototype,"yName",2),x([I],rt.prototype,"yFilterKey",2),x([I],rt.prototype,"stackGroup",2),x([I],rt.prototype,"normalizedTo",2),x([I],rt.prototype,"fill",2),x([I],rt.prototype,"fillOpacity",2),x([I],rt.prototype,"stroke",2),x([I],rt.prototype,"strokeWidth",2),x([I],rt.prototype,"strokeOpacity",2),x([I],rt.prototype,"lineDash",2),x([I],rt.prototype,"lineDashOffset",2),x([I],rt.prototype,"cornerRadius",2),x([I],rt.prototype,"crisp",2),x([I],rt.prototype,"styler",2),x([I],rt.prototype,"itemStyler",2),x([I],rt.prototype,"simpleItemStyler",2),x([I],rt.prototype,"shadow",2),x([I],rt.prototype,"label",2),x([I],rt.prototype,"tooltip",2),x([I],rt.prototype,"sparklineMode",2);function vD(t,e,i,n){if(e!=null){const[s,r]=e;if(s!==0||r!==1)return!1}if(Ve.is(t)){const s=t.calcBandwidth(n)-t.calcBandwidth(i);if(s>0&&s<1)return!1}if(En.is(t)){const{bandwidth:s,step:r}=t;if(s>0&&s<1)return!1;const a=r-s;if(a>0&&a<1)return!1}return!0}var xy=t=>to(t.yValue??0);function eh(t,e,i){const{startingX:n,startingY:s}=cF(t,e);return{isVertical:t,calculate:(a,o)=>{let l=t?a.x:n,c=t?s:a.y,h=t?a.width:0,u=t?0:a.height;const{opacity:d=1}=a;o&&(Number.isNaN(l)||Number.isNaN(c))&&({x:l,y:c}=o,h=t?o.width:0,u=t?0:o.height,t&&!xy(o)?c+=o.height:!t&&xy(o)&&(l+=o.width));let g;return a.clipBBox==null?g=void 0:xy(a)?g=t?new U(l,c-u,h,u):new U(l-h,c,h,u):g=new U(l,c,h,u),{x:l,y:c,width:h,height:u,clipBBox:g,opacity:d}},mode:i}}function lF(t,e){return{isVertical:t,calculate:(i,n)=>{let s=t?i.x:i.x+i.width/2,r=t?i.y+i.height/2:i.y,a=t?i.width:0,o=t?0:i.height;return n&&(Number.isNaN(s)||Number.isNaN(r))&&(s=t?n.x:n.x+n.width/2,r=t?n.y+n.height/2:n.y,a=t?n.width:0,o=t?0:n.height),{x:s,y:r,width:a,height:o,clipBBox:i.clipBBox,opacity:i.opacity??1}},mode:e}}function th(t,e){const i=a=>a==null||Number.isNaN(a.x)||Number.isNaN(a.y);return{toFn:(a,o,l)=>l==="removed"&&a.datum==null&&t.mode==="fade"?{...ih(a,o),opacity:0}:l==="removed"||i(a.unsafeDatum)?t.calculate(a.unsafeDatum,a.unsafePreviousDatum):{x:o.x,y:o.y,width:o.width,height:o.height,clipBBox:o.clipBBox,opacity:o.opacity??1},fromFn:(a,o,l)=>{l==="updated"&&i(a.unsafeDatum)?l="removed":l==="updated"&&i(a.unsafePreviousDatum)&&(l="added");let c;l==="unknown"||l==="added"?(a.previousDatum==null&&t.mode==="fade"?c={...ih(a,o),opacity:0}:c=t.calculate(a.unsafeDatum,a.unsafePreviousDatum),l==="unknown"&&(l=e)):c={x:a.x,y:a.y,width:a.width,height:a.height,clipBBox:a.clipBBox,opacity:a.opacity??1};const h=Pn[l];return{...c,phase:h}},applyFn:(a,o,l)=>{a.resetAnimationProperties(o.x,o.y,o.width,o.height,o.opacity??1,o.clipBBox),a.crisp=l==="end"&&(a.datum?.crisp??!1)}}}function cF(t,e){const i=e[t?"y":"x"];let n=1/0,s=0;return i?(t?s=i.scale.convert(Ve.is(i.scale)?0:Math.max(...i.range)):n=i.scale.convert(Ve.is(i.scale)?0:Math.min(...i.range)),{startingX:n,startingY:s}):{startingX:n,startingY:s}}function ih(t,{x:e,y:i,width:n,height:s,clipBBox:r,opacity:a=1}){return{x:e,y:i,width:n,height:s,clipBBox:r,opacity:a,crisp:t.datum?.crisp??!1}}function eg(t){for(const e of t){const i=e.nodes();e.batchedUpdate(function(){for(const s of i){const r=s.datum;r!=null&&(s.resetAnimationProperties(r.x,r.y,r.width,r.height,r.opacity??1,r.clipBBox),s.crisp=r.crisp??!1)}e.cleanup()})}}function Sy(t,e){if(e===void 0)return;const{x:i,y:n,width:s,height:r}=e;return Ze.toCanvas(t.contentGroup,new U(i,n,s,r))}function xD(t,e,i,n,s,r,a){let o=r?.reduced?.diff?.[t];if(o?.changed)return o;if(!a)return{changed:!1,added:new Set,updated:new Set,removed:new Set,moved:new Set};const l=hF(n,s);return o==null&&r?.reduced?.diff!=null?(o={changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set},l?o.updated=new Set(Array.from(e,({datum:c})=>i(c))):o.added=new Set(Array.from(e,({datum:c})=>i(c)))):l&&(o={changed:!0,added:new Set,updated:new Set(Array.from(e,({datum:c})=>i(c))),removed:new Set,moved:new Set}),o}function SD(t){return typeof t=="object"&&t!==null&&"groupScale"in t}function hF(t,e){if(!e)return!1;const i=t.scales,n=e.scales;if(!ca(i.x,n.x)||!ca(i.y,n.y))return!0;if(!SD(t)||!SD(e))return!1;const s=t.groupScale,r=e.groupScale;return!ca(s,r)}var My=class extends bD{constructor(t){super({moduleCtx:t,propertyKeys:tl,propertyNames:il,categoryKey:"xValue",pickModes:[2,1,0],pathsPerSeries:[],datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:ih,label:Pa}}),this.properties=new rt,this.connectsToYAxis=!0,this.aggregationManager=new Gd,this.phantomGroup=this.contentGroup.appendChild(new ne({name:"phantom",zIndex:-1})),this.phantomSelection=St.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.phantomHighlightGroup=this.highlightGroup.appendChild(new ne({name:`${this.internalId}-highlight-node`})),this.phantomHighlightSelection=St.select(this.phantomHighlightGroup,()=>this.nodeFactory(),!1),this.phantomGroup.opacity=.2,this.phantomHighlightGroup.opacity=.2}get pickModeAxis(){return this.properties.sparklineMode?"main":void 0}async processData(t){if(!this.data)return;const{xKey:e,yKey:i,yFilterKey:n,normalizedTo:s}=this.properties,{seriesGrouping:{groupIndex:r=this.id}={},data:a}=this,l=(this.seriesGrouping?.stackCount??0)>1||s!=null,c=l,h=!this.ctx.animationManager.isSkipped(),u=this.getCategoryAxis()?.scale,d=this.getValueAxis()?.scale,{isContinuousX:g,xScaleType:p,yScaleType:f}=this.getScaleInformation({xScale:u,yScale:d}),m=this.visible?{}:{forceValue:0},y=this.properties.allowNullKeys??!1,b=[Ar(e,p,{id:"xValue",allowNullKey:y}),Xe(i,f,{id:"yValue-raw",invalidValue:null,...m})],v=[];if(l){const C=`bar-stack-${r}-yValues`,D=`${C}-trailing`;v.push(C,D),b.push(...Aa(i,"normal",{id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:C,separateNegative:!0,...m},f),...Aa(i,"trailing",{id:"yValue-start",invalidValue:null,missingValue:0,groupId:D,separateNegative:!0,...m},f))}if(n!=null&&(b.push(Xe(n,f,{id:"yFilterValue-raw",invalidValue:null,...m})),l)){const C=`bar-stack-${r}-yFilterValues`,D=`${C}-trailing`;v.push(C,D),b.push(...Aa(n,"normal",{id:"yFilterValue-end",rangeId:"yFilterValue-range",invalidValue:null,missingValue:0,groupId:C,separateNegative:!0,...m},f),...Aa(n,"trailing",{id:"yFilterValue-start",invalidValue:null,missingValue:0,groupId:D,separateNegative:!0,...m},f),XO(this.id,"yValue-raw","yFilterValue-raw"))}g&&b.push(VM,_M),Ee(s)&&b.push(vd(v,Math.abs(s))),this.needsDataModelDiff()&&this.processedData&&b.push(Sd(this.id,this.processedData)),(h||!c)&&b.push(zc());const{dataModel:S,processedData:M}=await this.requestDataModel(t,a,{props:b,groupByKeys:c,groupByData:!c});this.aggregateData(S,M),this.smallestDataInterval=M.reduced?.smallestKeyInterval,this.largestDataInterval=M.reduced?.largestKeyInterval,this.animationState.transition("updateData")}yCumulativeKey(t){return t.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw"}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(i==null||e==null)return{domain:[]};if(t===this.getCategoryDirection()){const r=i.resolveProcessedDataDefById(this,"xValue"),a=i.getDomain(this,"xValue","key",e);return r?.def.type==="key"&&r.def.valueType==="category"?a:{domain:this.padBandExtent(a.domain)}}let n;if(e.reduced?.filteredValueExceedUnfiltered===!0)n=this.domainForClippedRange(t,["yFilterValue-end"],"xValue");else{const r=this.yCumulativeKey(i);n=this.domainForClippedRange(t,[r],"xValue");const a=i.hasColumnById(this,"yFilterValue-raw")?i.getDomain(this,"yFilterValue-raw","value",e).domain:void 0;a!=null&&(n=[Math.min(n[0],a[0]),Math.max(n[1],a[1])])}const s=this.getValueAxis();if(s instanceof Es&&!(s instanceof ll)){const r=Number.isFinite(n[1]-n[0])?[Math.min(0,n[0]),Math.max(0,n[1])]:[];return{domain:Bi(r)}}else return{domain:Bi(n)}}getSeriesRange(t,e){if((this.properties.direction==="horizontal"?"x":"y")!==t)return[];const n=this.yCumulativeKey(this.dataModel),[s,r]=this.domainForVisibleRange("y",[n],"xValue",e);return[Math.min(s,0),Math.max(r,0)]}getZoomRangeFittingItems(t,e,i){const n=this.yCumulativeKey(this.dataModel);return this.zoomFittingVisibleItems("xValue",[n],t,e,i)}getVisibleItems(t,e,i){const n=this.yCumulativeKey(this.dataModel);return this.countVisibleItems("xValue",[n],t,e,i)}createBucketLookupFeature(){return new GI({series:this,getXAxis:()=>this.axes.x,getDataModel:()=>this.dataModel,getProcessedData:()=>this.processedData,aggregationManager:this.aggregationManager,domainKey:"key",getSelection:()=>this.data?.selections.get(this.id)?.getSelection(),getYColumnId:t=>this.yCumulativeKey(t),canonicalExtremaSlots:[ht]})}aggregateData(t,e){if(this.aggregationManager.markStale(e.input.count),fn(e))return;const i=this.axes.x;if(i==null)return;const n=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:r=>oF(i.scale.type,t,e,this,n,r),computeFull:r=>aF(i.scale.type,t,e,this,r),targetRange:n});const s=this.aggregationManager.filters;s&&s.length>0&&js.record(`${this.type}:aggregation`,s.map(r=>r.maxRange))}estimateTargetRange(){const t=this.axes.x;if(t?.scale?.range){const[e,i]=t.scale.range;return Math.abs(i-e)}return this.ctx.scene?.canvas?.width??800}createNodeDatumContext(t,e){const{dataModel:i,processedData:n}=this;if(!i||!n)return;const s=n.dataSources?.get(this.id);if(s==null)return;const r=t.scale,a=e.scale,o=Math.abs(r.range[1]-r.range[0]);this.aggregationManager.ensureLevelForRange(o);const l=this.aggregationManager.getFilterForRange(o);this.ensureBucketLookupFeature()?.setActiveFilter(n,l);const c=n.reduced?.filteredValueExceedUnfiltered??!1,h=i.hasColumnById(this,"yValue-start"),{label:u}=this.properties,d=this.canIncrementallyUpdateNodes(l!=null),{groupOffset:g,barOffset:p,barWidth:f}=this.getBarDimensions();let m,y,b;if(c)m=i.resolveColumnById(this,"yFilterValue-start",n),y=i.resolveColumnById(this,"yFilterValue-end",n),b=void 0;else{const v=i.hasColumnById(this,"yFilterValue-raw");m=h?i.resolveColumnById(this,"yValue-start",n):void 0,y=h?i.resolveColumnById(this,"yValue-end",n):void 0,b=v?i.resolveColumnById(this,"yFilterValue-raw",n):void 0}return{dataSource:s,rawData:s.data,xValues:i.resolveKeysById(this,"xValue",n),yRawValues:i.resolveColumnById(this,"yValue-raw",n),yStartValues:m,yEndValues:y,yFilterValues:b,xScale:r,yScale:a,xAxis:t,yAxis:e,groupOffset:g,barOffset:p,barWidth:f,range:o,yReversed:e.isReversed(),bboxBottom:a.convert(0),labelSpacing:u.spacing+(typeof u.padding=="number"?u.padding:0),crisp:l==null&&(this.properties.crisp??vD(t?.scale,t?.visibleRange,this.smallestDataInterval,this.largestDataInterval)),isStacked:h,filteredValueExceedUnfiltered:c,animationEnabled:!this.ctx.animationManager.isSkipped(),dataAggregationFilter:l,canIncrementallyUpdate:d,phantomNodes:d?this.contextNodeData.phantomNodeData??[]:[],nodes:d?this.contextNodeData.nodeData:[],labels:d?this.contextNodeData.labelData:[],nodeIndex:0,phantomIndex:0,barAlongX:this.getBarDirection()==="x",shouldFlipXY:this.shouldFlipXY(),xKey:this.properties.xKey,yKey:this.properties.yKey,xName:this.properties.xName,yName:this.properties.yName,legendItemName:this.properties.legendItemName,label:u,yDomain:this.getSeriesDomain("y").domain}}computeXPosition(t,e){const i=t.xScale.convert(t.xValues[e]);return Number.isFinite(i)?i+t.groupOffset+t.barOffset+this.getDatumOffset(e):Number.NaN}prepareNodeDatumState(t,e,i,n,s){if(!Number.isFinite(s))return;const r=t.xValues[i];if(r===void 0&&!this.properties.allowNullKeys)return;const a=t.dataSource?.data[i],o=t.yRawValues[i],l=t.yFilterValues==null?void 0:Number(t.yFilterValues[i]);if(l!=null&&!Number.isFinite(l))return;const c=t.label.enabled&&o!=null?this.getLabelText(l??o,a,t.yKey,"y",t.yDomain,t.label,{datum:a,value:l??o,xKey:t.xKey,yKey:t.yKey,xName:t.xName,yName:t.yName,legendItemName:t.legendItemName}):void 0,h=o>=0&&!Object.is(o,-0);return e.datum=a,e.xValue=r,e.yRawValue=o,e.yFilterValue=l,e.labelText=c,e.inset=l!=null&&l>o,e.isPositive=h,e.precomputedBottomY=l==null?void 0:t.yScale.convert(n),e.precomputedIsUpward=l==null?void 0:h!==t.yReversed,e}createSkeletonNodeDatum(t,e,i){const n=e.nodeDatumScratch;return{series:this,datum:n.datum,datumIndex:e.datumIndex,cumulativeValue:0,phantom:i,xValue:n.xValue??"",yValue:0,yKey:t.yKey,xKey:t.xKey,capDefaults:{lengthRatioMultiplier:0,lengthMax:0},x:0,y:0,width:0,height:0,midPoint:{x:0,y:0},opacity:e.opacity,featherRatio:e.featherRatio,topLeftCornerRadius:!1,topRightCornerRadius:!1,bottomRightCornerRadius:!1,bottomLeftCornerRadius:!1,clipBBox:void 0,crisp:t.crisp,label:void 0,missing:!1,focusable:!i}}createNodeDatum(t,e){const i=this.prepareNodeDatumState(t,e.nodeDatumScratch,e.datumIndex,e.yStart,e.yEnd);if(!i)return{nodeData:void 0,phantomNodeData:void 0};const n=this.createSkeletonNodeDatum(t,e,!1);this.updateNodeDatum(t,n,e,i);let s;return i.yFilterValue!=null&&(s=this.createSkeletonNodeDatum(t,e,!0),this.updateNodeDatum(t,s,e)),{nodeData:n,phantomNodeData:s}}updateNodeDatum(t,e,i,n){if(n??(n=this.prepareNodeDatumState(t,i.nodeDatumScratch,i.datumIndex,i.yStart,i.yEnd)),!n)return;const s=e,r=e.phantom,a=i.yStart,o=r?n.yFilterValue:n.yFilterValue??n.yRawValue,l=r?n.yFilterValue:n.yFilterValue??i.yEnd,c=r?void 0:n.labelText;let h;r||n.yFilterValue==null?h=i.yEnd:h=i.yStart+n.yFilterValue;let u;r?u=i.yRange:u=Math.max(i.yStart+(n.yFilterValue??-1/0),i.yRange);let d;r?d=void 0:n.inset?d=.6:d=void 0;const g=n.precomputedIsUpward??n.isPositive!==t.yReversed,p=t.yScale.convert(h),f=n.precomputedBottomY??t.yScale.convert(a),m=t.yScale.convert(u),y=i.width*.5*(1-(d??1)),b=t.barAlongX?Math.min(p,f):i.x+y,v=t.barAlongX?i.x+y:Math.min(p,f),S=t.barAlongX?Math.abs(f-p):i.width*(d??1),M=t.barAlongX?i.width*(d??1):Math.abs(f-p),C=t.barAlongX?Math.min(t.bboxBottom,m):i.x+y,D=t.barAlongX?i.x+y:Math.min(t.bboxBottom,m),A=t.barAlongX?Math.abs(t.bboxBottom-m):i.width*(d??1),w=t.barAlongX?i.width*(d??1):Math.abs(t.bboxBottom-m);s.datum=n.datum,s.datumIndex=i.datumIndex,s.cumulativeValue=l,s.xValue=n.xValue,s.yValue=o,s.x=C,s.y=D,s.width=A,s.height=w;const L=s.midPoint;L.x=b+S/2,L.y=v+M/2;const O=t.shouldFlipXY?M:S;s.capDefaults.lengthRatioMultiplier=O,s.capDefaults.lengthMax=O,s.opacity=i.opacity,s.featherRatio=i.featherRatio,s.topLeftCornerRadius=t.barAlongX!==g,s.topRightCornerRadius=g,s.bottomRightCornerRadius=t.barAlongX===g,s.bottomLeftCornerRadius=!g;const R=s.clipBBox;if(R?(R.x=b,R.y=v,R.width=S,R.height=M):s.clipBBox=new U(b,v,S,M),s.crisp=t.crisp,c==null)s.label=void 0;else{const _=_I({isUpward:g,isVertical:!t.barAlongX,placement:t.label.placement,spacing:t.labelSpacing,rect:{x:b,y:v,width:S,height:M}}),E=s.label;E?(E.text=c,E.x=_.x,E.y=_.y,E.textAlign=_.textAlign,E.textBaseline=_.textBaseline):s.label={text:c,..._}}s.missing=ba(o)}createNodeDataWithAggregation(t,e,i){const n=t.yReversed?-1:1;for(let s=0;s<2;s+=1){const r=s===0,a=r?t.dataAggregationFilter.positiveIndices:t.dataAggregationFilter.negativeIndices,o=r?t.dataAggregationFilter.positiveIndexData:t.dataAggregationFilter.negativeIndexData,l=r?wt:ht,c=r?ht:wt,h=this.visibleRangeIndices("xValue",t.xAxis.range,a),u=h[0],d=h[1];for(let g=u;g<d;g+=1){const p=g*Mi,f=o[p+ct],m=o[p+yt],y=o[p+l],b=o[p+c];if(f===ql||t.xValues[b]==null||t.xValues[y]==null)continue;const v=e(Math.trunc((f+m)/2)),S=Math.abs(e(m)-e(f))+t.barWidth;if(v-S<0||v>t.range)continue;const M=Math.abs(m-f)+1,C=En.is(t.xScale)?Math.min(t.xScale.bandwidth*Math.max(M-1,1)/(t.xScale.step*M),1):1;if(i.datumIndex=b,i.x=v,i.width=S,i.opacity=C,t.isStacked)i.yStart=Number(t.yStartValues[y]),i.yEnd=Number(t.yEndValues[b]),i.featherRatio=0;else{const D=Number(t.yRawValues[b]),A=Number(t.yRawValues[y]);i.yStart=0,i.yEnd=D,i.featherRatio=(r?1:-1)*n*(1-A/D)}i.yRange=i.yEnd,this.upsertNodeDatum(t,i)}}}createNodeDataGrouped(t,e,i){const n=this.processedData,s=n.invalidData?.get(this.id),r=t.barWidth;let a;t.filteredValueExceedUnfiltered?a=this.dataModel.resolveProcessedDataIndexById(this,"yFilterValue-range"):t.isStacked?a=this.dataModel.resolveProcessedDataIndexById(this,"yValue-range"):a=-1;const o=n.columnScopes.findIndex(d=>d.has(this.id)),l=n.groups,c=Gc(1,l.length,t.xAxis.range,d=>{const p=l[d].keys[0];return this.xCoordinateRange(p)}),h=c[0],u=c[1];for(let d=h;d<u;d+=1){const g=l[d],p=g.aggregation,f=g.datumIndices[o];if(f!=null)for(const m of f){const y=d+m,b=e(y);if(s?.[y]===!0)continue;const v=t.yRawValues[y];if(v==null)continue;const S=v>=0&&!Object.is(v,-0),M=t.isStacked?Number(t.yStartValues?.[y]):0,C=t.isStacked?Number(t.yEndValues?.[y]):v;let D=C;t.isStacked&&(D=p[a][S?1:0]),i.datumIndex=y,i.x=b,i.width=r,i.yStart=M,i.yEnd=C,i.yRange=D,i.featherRatio=0,i.opacity=1,this.upsertNodeDatum(t,i)}}}createNodeDataSimple(t,e,i){const n=this.processedData.invalidData?.get(this.id),s=t.barWidth,r=this.visibleRangeIndices("xValue",t.xAxis.range);let a=r[0],o=r[1];this.processedData.input.count<1e3&&(a=0,o=this.processedData.input.count);for(let l=a;l<o;l+=1){if(n?.[l]===!0)continue;const c=t.yRawValues[l];if(c==null)continue;const h=e(l),u=Number(c);i.datumIndex=l,i.x=h,i.width=s,i.yStart=0,i.yEnd=u,i.yRange=u,i.featherRatio=0,i.opacity=1,this.upsertNodeDatum(t,i)}}upsertNodeDatum(t,e){const i=t.canIncrementallyUpdate&&t.nodeIndex<t.nodes.length,n=t.yFilterValues!=null,s=n&&t.canIncrementallyUpdate&&t.phantomIndex<t.phantomNodes.length;let r,a;if(i)r=t.nodes[t.nodeIndex],this.updateNodeDatum(t,r,e),t.nodeIndex>=t.labels.length&&t.labels.push(r);else{const o=this.createNodeDatum(t,e);o.nodeData&&(t.nodes.push(o.nodeData),t.labels.push(o.nodeData)),a=o.phantomNodeData}if(t.nodeIndex++,!n)return{nodeData:t.nodes[t.nodeIndex]};if(s)a=t.phantomNodes[t.phantomIndex],this.updateNodeDatum(t,a,e);else if(a)t.phantomNodes.push(a);else{const o=this.createNodeDatum(t,e);o.phantomNodeData&&t.phantomNodes.push(o.phantomNodeData)}return t.phantomIndex++,{nodeData:r,phantomNodeData:a}}populateNodeData(t){const e=n=>this.computeXPosition(t,n),i={nodeDatumScratch:{datum:void 0,xValue:void 0,yRawValue:0,yFilterValue:void 0,labelText:void 0,inset:!1,isPositive:!1,precomputedBottomY:void 0,precomputedIsUpward:void 0},datumIndex:0,x:0,width:0,yStart:0,yEnd:0,yRange:0,featherRatio:0,opacity:1};t.dataAggregationFilter!=null?this.createNodeDataWithAggregation(t,e,i):this.processedData.type==="grouped"?this.createNodeDataGrouped(t,e,i):this.createNodeDataSimple(t,e,i)}initializeResult(t){return{itemId:this.properties.yKey,nodeData:t.nodes,phantomNodeData:t.phantomNodes,labelData:t.labels,scales:this.calculateScaling(),visible:this.visible||t.animationEnabled,groupScale:this.getScaling(this.ctx.seriesStateManager.getGroupScale(this)),styles:wm(this.getItemStyle.bind(this)),segments:void 0}}finalizeNodeData(t){t.canIncrementallyUpdate&&(this.trimIncrementalNodeArray(t.nodes,t.nodeIndex),this.trimIncrementalNodeArray(t.phantomNodes,t.phantomIndex),this.trimIncrementalNodeArray(t.labels,t.nodes.length))}assembleResult(t,e){return e.segments=qd(this.properties.segmentation,t.xAxis,t.yAxis,this.chart.seriesRect,this.ctx.scene),e}nodeFactory(){return new yy}updateSeriesSelections(){super.updateSeriesSelections(),this.phantomSelection=this.updateDatumSelection({nodeData:this.contextNodeData?.phantomNodeData??[],datumSelection:this.phantomSelection})}updateHighlightSelectionItem(t){const e=super.updateHighlightSelectionItem(t),i=this.ctx.highlightManager?.getActiveHighlight(),s=this.isSeriesHighlighted(i)&&i?.datum?i:void 0;return this.phantomHighlightSelection=this.updateDatumSelection({nodeData:s?this.getHighlightData(this.contextNodeData?.phantomNodeData??[],s)??[]:[],datumSelection:this.phantomHighlightSelection}),e}updateNodes(t,e){super.updateNodes(t,e),this.updateDatumNodes({datumSelection:this.phantomSelection,isHighlight:!1,drawingMode:"overlay"}),this.updateDatumNodes({datumSelection:this.phantomHighlightSelection,isHighlight:!0,drawingMode:"overlay"})}getHighlightData(t,e){const i=t.find(n=>n.datum===e.datum);return i==null?void 0:[{...i}]}updateDatumSelection(t){return fn(this.processedData)?t.datumSelection.update(t.nodeData,void 0,this.getDatumId.bind(this)):t.datumSelection.update(t.nodeData)}makeStylerParams(t,e){const{id:i}=this,{cornerRadius:n,fill:s,fillOpacity:r,lineDash:a,lineDashOffset:o,stackGroup:l,stroke:c,strokeOpacity:h,strokeWidth:u,xKey:d,yKey:g}=this.properties,p=wa(t??0),f=ka(e);return{cornerRadius:n,fill:s,fillOpacity:r,highlightState:p,selectionState:f,lineDash:a,lineDashOffset:o,seriesId:i,stackGroup:l,stroke:c,strokeOpacity:h,strokeWidth:u,xKey:d,yKey:g}}makeItemStylerParams(t,e,i,n,s,r){const{id:a}=this,{xKey:o,yKey:l,stackGroup:c}=this.properties,h=e.dataSources.get(a)?.data?.[i],u=t.resolveColumnById(this,"yValue-raw",e)[i],d=t.getDomain(this,"xValue","key",e).domain,g=t.getDomain(this,this.yCumulativeKey(t),"value",e).domain,p=this.ctx.highlightManager?.getActiveHighlight(),f=this.getHighlightStateString(p,s,i),m=this.getSelectionStateString(i),y=this.filterItemStylerFillParams(r.fill)??r.fill;return{seriesId:a,...Id(n,u,o,l,d,g),datum:h,xValue:n,yValue:u,stackGroup:c,highlightState:f,selectionState:m,...r,fill:y}}getStyle(t,e,i){const{cornerRadius:n,fill:s,fillOpacity:r,lineDash:a,lineDashOffset:o,stroke:l,strokeOpacity:c,strokeWidth:h,styler:u}=this.properties;let d={};if(!t&&u){const g=this.makeStylerParams(e,i);d=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(u,g)??{},{pick:!1})??{}}return{cornerRadius:d.cornerRadius??n,fill:d.fill??s,fillOpacity:d.fillOpacity??r,lineDash:d.lineDash??a,lineDashOffset:d.lineDashOffset??o,opacity:1,stroke:d.stroke??l,strokeOpacity:d.strokeOpacity??c,strokeWidth:d.strokeWidth??h}}getItemStyle(t,e,i,n){const{properties:s,dataModel:r,processedData:a}=this,{itemStyler:o,simpleItemStyler:l}=s,c=this.getHighlightStyle(e,t,i),h=this.getSelectionStyle(t,n);if(l&&a!=null&&t!=null){const d=a.dataSources.get(this.id)?.data?.[t],g=l(d);return ge(g,h,c,this.getStyle(!1,i,n))}let u=ge(c,h,this.getStyle(t===void 0,i,n));if(o&&r!=null&&a!=null&&t!=null){const d=r.resolveKeysById(this,"xValue",a)[t],g=this.cachedDatumCallback(Jt(this.getDatumId({xValue:d,phantom:!1}),e?"highlight":"node"),()=>{const p=this.makeItemStylerParams(r,a,t,d,e,u);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(o,p))});g&&(u=ge(g,u))}return u}updateDatumStyles(t){const e=this.ctx.highlightManager.getActiveHighlight(),i=this;function n(s,r){if(!t.datumSelection.isGarbage(s)){const a=i.getHighlightState(e,t.isHighlight,r.datumIndex),o=i.getDataSelectionState(r.datumIndex);r.style=i.getItemStyle(r.datumIndex,t.isHighlight,a,o)}}t.datumSelection.each(n)}updateDatumNodes(t){const{contextNodeData:e}=this;if(!e)return;const i=this.ctx.highlightManager.getActiveHighlight(),{shadow:n}=this.properties,s=this.getCategoryDirection()==="x",r=this.getShapeFillBBox(),a=this.getBarDirection(),{drawingMode:o,isHighlight:l}=t,c=this,h=e.styles;function u(d,g){const p=g.style??h[c.getHighlightState(i,l,g.datumIndex)];d.setStyleProperties(p,r);const f=p.cornerRadius??0,m=s?(g.clipBBox?.width??g.width)>0:(g.clipBBox?.height??g.height)>0;d.setStaticProperties(o,g.topLeftCornerRadius?f:0,g.topRightCornerRadius?f:0,g.bottomRightCornerRadius?f:0,g.bottomLeftCornerRadius?f:0,m,g.crisp,n,a,g.featherRatio)}t.datumSelection.each(u)}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e,i=>{i.pointerEvents=1})}updateLabelNodes(t){const{isHighlight:e=!1}=t,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},n=this.ctx.highlightManager?.getActiveHighlight();t.labelSelection.each((s,r)=>{s.fillOpacity=this.getHighlightStyle(e,r?.datumIndex).opacity??1,VI(this,s,i,this.properties.label,r.label,e,n)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:n,properties:s}=this,{xKey:r,xName:a,yKey:o,yName:l,legendItemName:c,stackGroup:h,tooltip:u}=s,d=s.allowNullKeys??!1,g=this.getCategoryAxis(),p=this.getValueAxis();if(!i||!n||!g||!p)return;const f=n.dataSources.get(this.id)?.data?.[t],m=i.resolveKeysById(this,"xValue",n)[t],y=i.resolveColumnById(this,"yValue-raw",n)[t];if(m===void 0&&!d)return;const b=this.getItemStyle(t,!1,void 0,void 0);return this.formatTooltipWithContext(u,{heading:this.getAxisValueText(g,"tooltip",m,f,r,c,d),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:o,value:this.getAxisValueText(p,"tooltip",y,f,o,c),missing:ba(y)}]},{seriesId:e,datum:f,title:l,xKey:r,xName:a,yKey:o,yName:l,legendItemName:c,stackGroup:h,...b,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:t,stroke:e,strokeWidth:i,fillOpacity:n,strokeOpacity:s,lineDash:r,lineDashOffset:a}=this.getStyle(!1,0,void 0);return{marker:{fill:t??"rgba(0, 0, 0, 0)",stroke:e??"rgba(0, 0, 0, 0)",fillOpacity:n,strokeOpacity:s,strokeWidth:i,lineDash:r,lineDashOffset:a}}}getLegendData(t){const{showInLegend:e}=this.properties;if(t!=="category")return[];const{id:i,ctx:{legendManager:n},visible:s}=this,{yKey:r,yName:a,legendItemName:o}=this.properties;return[{legendType:"category",id:i,itemId:r,seriesId:i,enabled:s&&(n?.getItemEnabled({seriesId:i,itemId:r})??!0),label:{text:o??a??r},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!e}]}resetDatumAnimation(t){eg([t.datumSelection,this.phantomSelection])}animateReadyHighlight(t){eg([t,this.phantomHighlightSelection])}animateEmptyUpdateReady({datumSelection:t,labelSelection:e,annotationSelections:i}){const{phantomSelection:n}=this,s=th(eh(this.isVertical(),this.axes,"normal"),"unknown");Mt(this.id,"nodes",this.ctx.animationManager,[t,n],s),gt(this,"labels",this.ctx.animationManager,e),gt(this,"annotations",this.ctx.animationManager,...i)}animateWaitingUpdateReady(t){const{phantomSelection:e}=this,{datumSelection:i,labelSelection:n,annotationSelections:s,contextData:r,previousContextData:a}=t;this.ctx.animationManager.stopByAnimationGroupId(this.id);const o=xD(this.id,i,this.getDatumId.bind(this),t.contextData,a,this.processedData,this.processedDataUpdated),l=a==null?"fade":"normal",c=th(eh(this.isVertical(),this.axes,l),"added");Mt(this.id,"nodes",this.ctx.animationManager,[i,e],c,h=>this.getDatumId(h.unsafeDatum),o),(!o||o?.changed||!ca(r.groupScale,a?.groupScale))&&(gt(this,"labels",this.ctx.animationManager,n),gt(this,"annotations",this.ctx.animationManager,...s))}getDatumId(t){return Jt(t.xValue,t.phantom)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){const e=this.contextNodeData?.nodeData[t].clipBBox;return Sy(this,e)}hasItemStylers(){return this.properties.selection.enabled||this.properties.styler!=null||this.properties.itemStyler!=null||this.properties.simpleItemStyler!=null||this.properties.label.itemStyler!=null}};My.className="BarSeries",My.type="bar";var uF={series:{direction:"vertical",fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",rr],["image",vs],["pattern",Ki]]},stroke:{$palette:"stroke"},fillOpacity:1,strokeWidth:{$isUserOption:["./stroke",2,0]},lineDash:[0],lineDashOffset:0,label:{...Jn,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:Xr,xOffset:3,yOffset:3,blur:5},highlight:Xl,selection:ar,segmentation:lu}},MD={type:"series",name:"bar",chartType:"cartesian",stackable:!0,groupable:!0,version:Ye,dependencies:[sn],options:Po,predictAxis:Jc,defaultAxes:dx,axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},axisKeysFlipped:{x:"yKeyAxis",y:"xKeyAxis"},themeTemplate:uF,create:t=>new My(t)},at={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},Vs={BLUE:"#2b5c95",ORANGE:"#cc6f10",GREEN:"#1e652e",CYAN:"#18859e",YELLOW:"#a69400",VIOLET:"#603c88",GRAY:"#575757",MAGENTA:"#7d2f6d",BROWN:"#4f3508",RED:"#a82529"};function Iy(t,e,i,n){if(i.length<2||e.fills.length===0&&n.length===0)return;const s=[i[0],i.at(-1)],r=e.domain??s;if(e.fills.length>0||e.mode==="discrete"){const a=e.fills.length>0?e.fills:n.map(c=>({color:c})),{domain:o,range:l}=cv(a,r,e.mode);t.mode=e.mode,t.domain=o,t.range=l}else t.mode="continuous",t.domain=s,t.range=n;t.displayDomain=r,t.update()}function dF(t,e){const{domain:i,range:n,mode:s,displayDomain:r}=t;if(n.length===0)return;const[a,o]=r??[i[0],i.at(-1)],l=o-a||1,c=[];for(let h=0;h<n.length;h++){const u=e[h]?.name;if(u==null)continue;const g=((s==="discrete"?(i[h]+i[h+1])/2:i[h])-a)/l;g<0||g>1||c.push({position:g,label:u})}return c.length>0?c:void 0}function gF(t,e,i){if(t.length===0)return t;const n=t[0],s=t.at(-1);if(n.stop>=0&&s.stop<=1)return t;const r=[{stop:0,color:e}];for(const a of t)a.stop>0&&a.stop<1&&r.push(a);return r.push({stop:1,color:i}),r}function Dy(t,e,i,n,s){const{domain:r,displayDomain:a,mode:o}=t,l=a??[r[0],r.at(-1)],c=hv(t),h=o==="continuous"?gF(c,t.convert(l[0]),t.convert(l[1])):c;return{legendType:"gradient",enabled:n,seriesId:i,series:s,colorStops:h,axisDomain:l,namedLabels:dF(t,e)}}function Cy(t){return{formatManager:t.ctx.formatManager,formatInContext:t.callWithContext.bind(t),key:"colorKey"in t.properties?t.properties.colorKey:void 0,legendItemName:"legendItemName"in t.properties?t.properties.legendItemName:void 0,boundSeries:t.getFormatterContext("color")}}function pF(t,e,{formatManager:i,formatInContext:n,key:s,legendItemName:r,boundSeries:a}){const{domain:o}=t;return(l,c)=>{const h={type:"number",value:l,datum:void 0,seriesId:e,legendItemName:r,key:s,source:"gradient-legend",property:"color",domain:o,boundSeries:a,fractionDigits:c,visibleDomain:void 0};return i.format(n,h)??i.defaultFormat(h)}}function Ay(t,e,i,n,s,r="square"){const{domain:a,range:o}=t;if(o.length===0)return[];const l=pF(t,i,s);return o.map((c,h)=>{const u=a[h],d=a[h+1],g=e[h]?.name;return{legendType:"category",id:i,itemId:h,seriesId:i,enabled:n,symbol:{marker:{shape:r,fill:c,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1}},label:{text:g??Og(u,d,h,o.length,l)},isFixed:!0,hideToggleOtherSeries:!0,suppressHighlight:!0}})}var tg=3,fF=5,ID=.05;function mF(t,e,i){const{xValues:n,yValues:s,xDomain:r,yDomain:a,xNeedsValueOf:o,yNeedsValueOf:l}=t,{x0:c,y0:h,x1:u,y1:d}=i;let g=0,p=1/0;const f=(c+u)/2,m=(h+d)/2;for(const y of e){const b=n[y],v=s[y];if(b==null||v==null)continue;const S=un(b,r.min,r.max,o),M=un(v,a.min,a.max,l),C=(S-f)**2+(M-m)**2;C<p&&(p=C,g=y)}return g}function yF(t,e,i){const{xValues:n,yValues:s,xDomain:r,yDomain:a,xNeedsValueOf:o,yNeedsValueOf:l}=t,{x0:c,y0:h,x1:u,y1:d}=i;let g=0;for(const p of e){const f=n[p],m=s[p];if(f==null||m==null)continue;const y=un(f,r.min,r.max,o),b=un(m,a.min,a.max,l);y>=c&&y<=u&&b>=h&&b<=d&&(g+=1)}return g}function bF(t,e,i){const{xValues:n,yValues:s,xDomain:r,yDomain:a,xNeedsValueOf:o,yNeedsValueOf:l}=t,{x0:c,y0:h,x1:u,y1:d}=i,g=[{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:[]}],p=(c+u)/2,f=(h+d)/2;for(const y of e){const b=n[y],v=s[y];if(b==null||v==null)continue;const S=un(b,r.min,r.max,o),M=un(v,a.min,a.max,l),C=(S>p?1:0)+(M>f?2:0),D=g[C];D.indices.push(y),D.x0=Math.min(D.x0,S),D.y0=Math.min(D.y0,M),D.x1=Math.max(D.x1,S),D.y1=Math.max(D.y1,M)}const m=[];for(const y of g){const{indices:b,x0:v,x1:S,y0:M,y1:C}=y;if(b.length===0)continue;const D=wy(t,b,{x0:v,y0:M,x1:S,y1:C});m.push(D)}return m}function wy(t,e,i){const{x0:n,y0:s,x1:r,y1:a}=i;let l=e.length<fF&&r-n<ID&&a-s<ID||n===r&&s===a?null:bF(t,e,i);if(l?.length===1)return l[0];l?.length===0&&(l=null);const c=Math.hypot(r-n,a-s),h=mF(t,e,i);return{scale:c,x0:n,y0:s,x1:r,y1:a,indices:e,primaryDatumIndex:h,children:l}}function vF(t,e,i,n,s,r,a){const[o,l]=t,[c,h]=e,[u,d]=r,{xNeedsValueOf:g,yNeedsValueOf:p}=a,f={xValues:i,yValues:n,xDomain:{min:o,max:l},yDomain:{min:c,max:h},xNeedsValueOf:g,yNeedsValueOf:p},m=[];if(s!=null&&d>u){const y=Array.from({length:tg},()=>[]);for(let b=0;b<s.length;b+=1){const S=(s[b]-u)/(d-u),M=Math.trunc(S*tg);M>=0&&M<tg&&y[M].push(b)}for(let b=0;b<y.length;b+=1){const v=y[b],S=wy(f,v,{x0:0,y0:0,x1:1,y1:1});if(S!=null){const M=b/tg;m.push({sizeRatio:M,node:S})}}}else{const y=i.map((v,S)=>S),b=wy(f,y,{x0:0,y0:0,x1:1,y1:1});b!=null&&m.push({sizeRatio:0,node:b})}return m.length>0?{xValues:i,yValues:n,xd0:o,xd1:l,yd0:c,yd1:h,filters:m,xNeedsValueOf:g,yNeedsValueOf:p}:void 0}function xF(t,e,i,n,s,r,a,o,l,c){const[h,u]=Zi(t,r),[d,g]=Zi(e,a);return vF([h,u],[d,g],i,n,s,[o[0],o[1]],{xNeedsValueOf:l,yNeedsValueOf:c})}function SF(t,e,i,n,s,r,a){const o=i.resolveColumnById(a,"xValue",n),l=i.resolveColumnById(a,"yValue",n),c=r?i.resolveColumnById(a,"sizeValue",n):void 0,h=i.getDomain(a,"xValue","value",n),u=i.getDomain(a,"yValue","value",n),d=r?s.domain:[0,0],g=i.resolveColumnNeedsValueOf(a,"xValue",n),p=i.resolveColumnNeedsValueOf(a,"yValue",n);return xF(t,e,o,l,c,h,u,d,g,p)}function DD(t,e,i,n,s,r){const{xRange:a,yRange:o,xVisibleRange:[l,c],yVisibleRange:[h,u],minSize:d,maxSize:g}=i,{xValues:p,yValues:f,xd0:m,xd1:y,yd0:b,yd1:v,xNeedsValueOf:S,yNeedsValueOf:M}=e,C=1/Math.min(a/(c-l),o/(u-h)),D={xValues:p,yValues:f,xDomain:{min:m,max:y},yDomain:{min:b,max:v},xNeedsValueOf:S,yNeedsValueOf:M};for(const{sizeRatio:A,node:w}of e.filters){const L=.5*(d+A*(g-d)),O=L*C,R=t*O,_=l-L/a,E=c+L/a,F=h-L/o,z=u+L/o,K=[w];for(;K.length>0;){const G=K.pop();if(!(G.x1<_||G.x0>E||G.y1<F||G.y0>z))if(t!==1&&G.scale<=R)n!=null&&(n.count+=1),s?.push({datumIndex:G.primaryDatumIndex,count:G.indices.length,area:(G.x1-G.x0)*(G.y1-G.y0),dilation:te(1,G.scale/O,t),indices:G.indices});else if(G.children==null){const{indices:ie}=G;if(n!=null){const ae=G.x0>=l&&G.x1<=c&&G.y0>=h&&G.y1<=u?ie.length:yF(D,ie,{x0:l,y0:h,x1:c,y1:u});n.count+=ae}r?.push(...ie)}else K.push(...G.children)}}}function ig(t,e,i){const n={count:0};return DD(t,e,i,n,void 0,void 0),n.count}var MF=100,IF=12;function DF(t,e,i){if(ig(1,t,e)<=i)return 1;let n=1,s=2;for(;ig(s,t,e)>i&&s<MF;)n*=2,s*=2;for(let r=0;r<IF;r+=1){const a=(s+n)/2;ig(a,t,e)>i?n=a:s=a}return(n+s)/2}function CF(t,e,i){const n=[],s=[];return DD(t,e,i,void 0,n,s),{groupedAggregation:n,singleDatumIndices:s}}var ky=class extends Ci{constructor(){super(...arguments),this.maxSize=30}};x([I,Z()],ky.prototype,"maxSize",2),x([I,wf()],ky.prototype,"domain",2);var CD=class extends Qi{constructor(){super(...arguments),this.placement="top"}};x([I],CD.prototype,"placement",2);var Pe=class extends Fn{constructor(){super(...arguments),this.colorScale=new da,this.colorRange=["black","black"],this.label=new CD,this.tooltip=Fa(),this.maxRenderedItems=1/0,this.marker=new ky}};x([I],Pe.prototype,"xKey",2),x([I],Pe.prototype,"yKey",2),x([I],Pe.prototype,"sizeKey",2),x([I],Pe.prototype,"labelKey",2),x([I],Pe.prototype,"colorKey",2),x([I],Pe.prototype,"selectedKey",2),x([I],Pe.prototype,"xName",2),x([I],Pe.prototype,"yName",2),x([I],Pe.prototype,"sizeName",2),x([I],Pe.prototype,"labelName",2),x([I],Pe.prototype,"colorName",2),x([I],Pe.prototype,"colorScale",2),x([I],Pe.prototype,"colorRange",2),x([I],Pe.prototype,"title",2),x([hi("marker.shape")],Pe.prototype,"shape",2),x([hi("marker.size")],Pe.prototype,"size",2),x([hi("marker.maxSize")],Pe.prototype,"maxSize",2),x([hi("marker.domain")],Pe.prototype,"domain",2),x([hi("marker.fill")],Pe.prototype,"fill",2),x([hi("marker.fillOpacity")],Pe.prototype,"fillOpacity",2),x([hi("marker.stroke")],Pe.prototype,"stroke",2),x([hi("marker.strokeWidth")],Pe.prototype,"strokeWidth",2),x([hi("marker.strokeOpacity")],Pe.prototype,"strokeOpacity",2),x([hi("marker.lineDash")],Pe.prototype,"lineDash",2),x([hi("marker.lineDashOffset")],Pe.prototype,"lineDashOffset",2),x([hi("marker.itemStyler")],Pe.prototype,"itemStyler",2),x([I],Pe.prototype,"styler",2),x([I],Pe.prototype,"label",2),x([I],Pe.prototype,"tooltip",2),x([I],Pe.prototype,"maxRenderedItems",2);function Ty(t,e,i,n){const s=t.canIncrementallyUpdate&&t.nodeIndex<t.nodes.length;let r;return s?(r=t.nodes[t.nodeIndex],n(t,r,e)):(r=i(t,e),r!=null&&t.nodes.push(r)),t.nodeIndex++,r}var AF=class extends Rm{constructor(t,e,i,n,s){super(t,e,i,n,s),this.sizeKey=n.properties.sizeKey,this.colorKey=n.properties.colorKey}},Ly=class vh extends kr{constructor(e){super({moduleCtx:e,propertyKeys:{...tl,label:["labelKey"],size:["sizeKey"],color:["colorKey"]},propertyNames:{...il,label:["labelName"],size:["sizeName"],color:["colorName"]},categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],datumSelectionGarbageCollection:!1,animationResetFns:{label:Pa,datum:Wd},usesPlacedLabels:!0,clipFocusBox:!1}),this.NodeEvent=AF,this.properties=new Pe,this.dataAggregation=void 0,this.aggregateIndexSet=void 0,this.sizeScale=new Ma,this.colorScale=new br,this.colorScaleValid=!1,this.placedLabelData=[]}get pickModeAxis(){return"main-category"}get type(){return super.type}async processData(e){if(this.data==null||!this.visible)return;const i=this.axes.x?.scale,n=this.axes.y?.scale,{xScaleType:s,yScaleType:r}=this.getScaleInformation({xScale:i,yScale:n}),a=this.sizeScale.type,o=this.colorScale.type,{xKey:l,yKey:c,sizeKey:h,selectedKey:u,labelKey:d,colorKey:g,marker:p}=this.properties,f=this.properties.allowNullKeys??!1,{dataModel:m,processedData:y}=await this.requestDataModel(e,this.data,{props:[Xe(l,s,{id:"xValue",allowNullKey:f}),Xe(c,r,{id:"yValue",allowNullKey:f}),...u==null?[]:[Xe(u,"category",{id:"selectedValue"})],...h?[Xe(h,a,{id:"sizeValue"})]:[],...d?[Xe(d,"category",{id:"labelValue"})]:[],...g?[Xe(g,o,{id:"colorValue",invalidValue:void 0})]:[]]}),b=h?m.resolveProcessedDataIndexById(this,"sizeValue"):void 0,v=p.domain?[p.domain[0],p.domain[1]]:void 0;if(this.sizeScale.domain=v??(b==null?void 0:y.domain.values[b])??[],this.colorScaleValid=!1,g){const S=m.resolveProcessedDataIndexById(this,"colorValue"),M=y.domain.values[S].filter(D=>D!=null),C=dr(M);C!=null&&(Iy(this.colorScale,this.properties.colorScale,C,this.properties.colorRange),this.colorScaleValid=!0)}this.dataAggregation=this.aggregateData(m,y),this.animationState.transition("updateData")}isColorScaleValid(){return this.colorScaleValid}xCoordinateRange(e,i,n){const{properties:s,sizeScale:r}=this,{size:a,sizeKey:o}=s,l=this.axes.x.scale.convert(e),c=o==null?void 0:this.dataModel.resolveColumnById(this,"sizeValue",this.processedData),u=.5*(c==null?a:r.convert(c[n]))*i;return[l-u,l+u]}yCoordinateRange(e,i,n){const{properties:s,sizeScale:r}=this,{size:a,sizeKey:o}=s,l=this.axes.y.scale.convert(e[0]),c=o==null?void 0:this.dataModel.resolveColumnById(this,"sizeValue",this.processedData),u=.5*(c==null?a:r.convert(c[n]))*i;return[l-u,l+u]}getSeriesDomain(e){const{dataModel:i,processedData:n}=this;if(!n||!i)return{domain:[]};const s={x:"xValue",y:"yValue"},r=s[e],a=i.resolveProcessedDataDefById(this,r),o=i.getDomain(this,r,"value",n);if(a?.def.type==="value"&&a?.def.valueType==="category")return{domain:o.domain};const c=s[e==="x"?"y":"x"],h=this.domainForClippedRange(e,[r],c);return{domain:Bi(dr(h))}}getSeriesRange(e,i){return this.domainForVisibleRange("y",["yValue"],"xValue",i)}getVisibleItems(e,i,n){const{dataAggregation:s,axes:r}=this,a=r.x,o=r.y;if(s==null||a==null||o==null)return this.countVisibleItems("xValue",["yValue"],e,i,n);const l=this.aggregationOptions(a,o,e,i??[0,1]);return ig(0,s,l)}createBucketLookupFeature(){return new jI({getIndexSetMap:()=>this.aggregateIndexSet,getSelection:()=>this.data?.selections.get(this.id)?.getSelection()})}aggregateData(e,i){if(i.type==="grouped"||i.input.count-this.invalidDataCount()-this.missingDataCount()<=this.properties.maxRenderedItems)return;const s=this.axes.x,r=this.axes.y;if(s==null||r==null)return;const a=s.scale,o=r.scale;if(!(!Ve.is(a)||!Ve.is(o)))return SF(a.type,o.type,e,i,this.sizeScale,this.properties.sizeKey!=null,this)}aggregationOptions(e,i,n=e.visibleRange,s=i.visibleRange){const{processedData:r,dataModel:a}=this,{sizeKey:o}=this.properties,[l,c]=this.getSizeRange(),h=Math.abs(e.range[1]-e.range[0]),u=Math.abs(i.range[1]-i.range[0]),d=Math.max(l,1),g=o?Math.max(c,1):d,p=e.scale,f=i.scale;return r!=null&&a!=null&&(Ve.is(p)&&(n=Vu(n,p.domain.map(Xt),a.getDomain(this,"xValue","value",r).domain.map(Xt))),Ve.is(f)&&(s=Vu(s,f.domain.map(Xt),a.getDomain(this,"yValue","value",r).domain.map(Xt)))),{xRange:h,yRange:u,minSize:d,maxSize:g,xVisibleRange:n,yVisibleRange:s}}createNodeDatumContext(e,i){const{dataModel:n,processedData:s,sizeScale:r,visible:a}=this;if(!n||!s)return;const o=s.dataSources.get(this.id)?.data;if(o==null)return;const{xKey:l,yKey:c,sizeKey:h,selectedKey:u,labelKey:d,colorKey:g,xName:p,yName:f,sizeName:m,labelName:y,colorName:b,label:v,legendItemName:S,marker:M}=this.properties,C=e.scale,D=i.scale,A=s.changeDescription!=null&&this.contextNodeData?.nodeData!=null;let w;d?w=[]:h?w=n.getDomain(this,"sizeValue","value",s).domain:w=[];const L=n.resolveColumnById(this,"xValue",s);return{xAxis:e,yAxis:i,rawData:o,xValues:L,xDataValues:L,yDataValues:n.resolveColumnById(this,"yValue",s),sizeDataValues:h==null?void 0:n.resolveColumnById(this,"sizeValue",s),labelDataValues:d==null?void 0:n.resolveColumnById(this,"labelValue",s),selectedDataValues:u==null?void 0:n.resolveColumnById(this,"selectedValue",s),colorDataValues:g==null?void 0:n.resolveColumnById(this,"colorValue",s),xScale:C,yScale:D,sizeScale:r,xOffset:(C.bandwidth??0)/2,yOffset:(D.bandwidth??0)/2,xKey:l,yKey:c,sizeKey:h,labelKey:d,colorKey:g,xName:p,yName:f,sizeName:m,labelName:y,colorName:b,legendItemName:S,labelsEnabled:v.enabled,labelPlacement:v.placement,labelAnchor:Lt.anchor(M.shape),labelTextDomain:w,labelPadding:jo(v),labelTextMeasurer:di(v),label:v,animationEnabled:!this.ctx.animationManager.isSkipped(),visible:a,canIncrementallyUpdate:A,nodes:A?this.contextNodeData.nodeData:[],nodeIndex:0}}populateNodeData(e){this.sizeScale.range=this.getSizeRange();const i={datum:void 0,xDatum:void 0,yDatum:void 0,sizeValue:void 0,colorValue:void 0,x:0,y:0,selected:void 0,nodeLabel:{text:"",width:0,height:0},markerSize:0,count:1,dilation:1,area:0};this.aggregateIndexSet=void 0;const{dataAggregation:n}=this;n==null?this.createNodeDataSimple(e,i):this.createNodeDataWithAggregation(e,i,e.xAxis,e.yAxis,n)}initializeResult(e){const{marker:i}=this.properties;return{itemId:e.yKey,nodeData:e.nodes,labelData:e.labelsEnabled?e.nodes:[],scales:this.calculateScaling(),visible:this.visible||e.animationEnabled,styles:Zd(this,this.properties,i)}}upsertBubbleNodeDatum(e,i,n){this.prepareNodeDatumState(e,i,n)&&Ty(e,{scratch:i,datumIndex:n},(s,r)=>{const a=this.createSkeletonNodeDatum(s,r.scratch,r.datumIndex);return this.updateNodeDatum(s,a,r.scratch,r.datumIndex),a},(s,r,a)=>this.updateNodeDatum(s,r,a.scratch,a.datumIndex))}createNodeDataSimple(e,i){const n=e.rawData.length;for(let s=0;s<n;s++)i.count=1,i.dilation=1,i.area=0,this.upsertBubbleNodeDatum(e,i,s)}createNodeDataWithAggregation(e,i,n,s,r){const{maxRenderedItems:a}=this.properties,o=this.aggregationOptions(n,s),l=DF(r,o,a),{groupedAggregation:c,singleDatumIndices:h}=CF(l,r,o),u=new Map;for(const{datumIndex:d,count:g,dilation:p,area:f,indices:m}of c)i.count=g,i.dilation=p,i.area=f,u.set(d,m),this.upsertBubbleNodeDatum(e,i,d);this.aggregateIndexSet=u.size>0?u:void 0;for(const d of h)i.count=1,i.dilation=1,i.area=0,this.upsertBubbleNodeDatum(e,i,d)}prepareNodeDatumState(e,i,n){const s=e.rawData[n],r=e.xDataValues[n],a=e.yDataValues[n],o=this.properties.allowNullKeys??!1;if((r===void 0||a===void 0)&&!o)return;const l=e.sizeDataValues?.[n],c=e.xScale.convert(r)+e.xOffset,h=e.yScale.convert(a)+e.yOffset;if(!Number.isFinite(c)||!Number.isFinite(h))return;const u=e.selectedDataValues?.[n];let d;e.labelsEnabled?d=this.computeLabel(e,s,a,l,n):d={text:"",width:0,height:0};const g=l==null?e.sizeScale.range[0]:e.sizeScale.convert(l),p=e.colorDataValues?.[n];return i.datum=s,i.xDatum=r,i.yDatum=a,i.sizeValue=l,i.colorValue=p,i.x=c,i.y=h,i.selected=u,i.nodeLabel=d,i.markerSize=g,i}computeLabel(e,i,n,s,r){let a,o,l;e.labelKey&&e.labelDataValues?(a=e.labelDataValues[r],o=e.labelKey,l="label"):e.sizeKey?(a=s,o=e.sizeKey,l="size"):(a=n,o=e.yKey,l="y");const c=this.getLabelText(a,i,o,l,e.labelTextDomain,e.label,{value:a,datum:i,xKey:e.xKey,yKey:e.yKey,sizeKey:e.sizeKey,labelKey:e.labelKey,xName:e.xName,yName:e.yName,sizeName:e.sizeName,labelName:e.labelName,colorKey:e.colorKey,colorName:e.colorName,legendItemName:e.legendItemName});let{width:h,height:u}=ce(c)?Ds(c,e.label):e.labelTextMeasurer.measureLines(String(c));return h+=e.labelPadding.left+e.labelPadding.right,u+=e.labelPadding.bottom+e.labelPadding.top,{text:c,width:h,height:u}}createSkeletonNodeDatum(e,i,n){return{series:this,yKey:e.yKey,xKey:e.xKey,datum:void 0,datumIndex:0,xValue:void 0,yValue:void 0,sizeValue:void 0,colorValue:void 0,capDefaults:{lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},point:{x:0,y:0,size:0},midPoint:{x:0,y:0},label:{text:"",width:0,height:0},anchor:e.labelAnchor,placement:e.labelPlacement,count:1,dilation:1,area:0,selected:void 0}}updateNodeDatum(e,i,n,s){const r=i,{x:a,y:o,markerSize:l,dilation:c}=n;r.datum=n.datum,r.datumIndex=s,r.xValue=n.xDatum,r.yValue=n.yDatum,r.sizeValue=n.sizeValue,r.colorValue=n.colorValue,r.selected=n.selected,r.count=n.count,r.dilation=n.dilation,r.area=n.area,r.label=n.nodeLabel,r.anchor=e.labelAnchor,r.placement=e.labelPlacement;const h=r.point;h.x=a,h.y=o,h.size=Math.sqrt(c)*l;const u=r.midPoint;u.x=a,u.y=o}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}updateDatumSelection(e){const{nodeData:i,datumSelection:n}=e;if(this.properties.marker.isDirty()&&(n.clear(),n.cleanup()),!fn(this.processedData))return n.update(i);const{sizeKey:s}=this.properties;let r;return s&&(r=a=>Jt(a.xValue,a.yValue,a.sizeValue,Ue(a.label.text))),n.update(i,void 0,r)}static computeNoStylerMarkerTemplate(e,i,n,s,r){const a=e.getStyle(n);return e.getMarkerStyle(i.marker,r,i.params,{isHighlight:i.isHighlight,highlightState:n,selectionState:s,resolveMarkerSubPath:[]},{...a,size:r.point.size})}static applyNoStylerTemplate(e,i,n,s,r,a){n.style=a.size===n.point.size?a:{...a,size:n.point.size}}static computePerDatumStylerStyle(e,i,n,s,r){return e.getStyle(n)}static applyPerDatumStyle(e,i,n,s,r,a){i.colorScaleValid&&n.colorValue!=null?a.fill=e.colorScale.convert(n.colorValue):i.colorKey!=null&&n.colorValue==null&&e.properties.colorScale.missingDataFill!=null&&(a.fill=e.properties.colorScale.missingDataFill),n.style=e.getMarkerStyle(i.marker,n,i.params,{isHighlight:i.isHighlight,highlightState:s,selectionState:r,resolveMarkerSubPath:[]},{...a,size:n.point.size})}updateDatumStyles(e){const{datumSelection:i,isHighlight:n}=e,{xKey:s,yKey:r,sizeKey:a,labelKey:o,colorKey:l,marker:c}=this.properties,h=this.isColorScaleValid(),u={xKey:s,yKey:r,sizeKey:a,labelKey:o,colorKey:l};if(c.itemStyler==null&&!h){this.runMarkerStylePass(i,n,{marker:c,params:u,isHighlight:n},void 0,!0,vh.computeNoStylerMarkerTemplate,vh.applyNoStylerTemplate);return}this.runMarkerStylePass(i,n,{marker:c,params:u,isHighlight:n,colorScaleValid:h,colorKey:l},void 0,l==null,vh.computePerDatumStylerStyle,vh.applyPerDatumStyle)}updateDatumNodes(e){const{contextNodeData:i}=this;if(!i)return;const{datumSelection:n,isHighlight:s,drawingMode:r}=e;this.sizeScale.range=this.getSizeRange();const a=this.getShapeFillBBox(),o=this.dataAggregation!=null,l=this.ctx.highlightManager.getActiveHighlight();n.each((c,h,u)=>{const{point:{size:d},count:g,area:p,dilation:f}=h,m=this.getHighlightState(l,s,h.datumIndex),y=h.style==null?{...i.styles[m],size:d}:{...h.style};if(f>1){const b=y.fillOpacity??0,v=.269669+683e-6*g+-37.534348*p+.004449*g*p+-0*g**2+44.428603*p**2;y.fillOpacity=te(b/f,b/.1*v,1)}this.applyMarkerStyle(y,c,h.point,a,{selected:h.selected}),c.drawingMode=this.resolveMarkerDrawingModeForState(r,y),c.zIndex=o?[-g,u]:0}),s||this.properties.marker.markClean()}updatePlacedLabelData(e){this.placedLabelData=e,this.labelSelection.update(e.map(i=>({...i.datum,point:{x:i.x,y:i.y,size:i.datum.point.size}})),i=>{i.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.updateHighlightLabelSelection()}updateHighlightLabelSelection(){const e=this.ctx.highlightManager?.getActiveHighlight(),i=this.isSeriesHighlighted(e)&&e?.datum?e:void 0,n=i==null?[]:this.placedLabelData.filter(s=>s.datum.datumIndex===i.datumIndex).map(s=>({...s.datum,point:{x:s.x,y:s.y,size:s.datum.point.size}}));this.highlightLabelSelection=this.updateLabelSelection({labelData:n,labelSelection:this.highlightLabelSelection})??this.highlightLabelSelection,this.highlightLabelGroup.visible=n.length>0,this.highlightLabelGroup.batchedUpdate(()=>{this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})})}updateLabelNodes(e){const{isHighlight:i=!1}=e,n=this.ctx.highlightManager?.getActiveHighlight(),s=this.makeLabelFormatterParams();e.labelSelection.each((r,a)=>{const o=Ra(this,a,s,this.properties.label,i,n);r.text=a.label.text,r.fill=o.color,r.x=a.point?.x??0,r.y=a.point?.y??0,r.fontStyle=o.fontStyle,r.fontWeight=o.fontWeight,r.fontSize=o.fontSize,r.fontFamily=o.fontFamily,r.textBaseline="top",r.fillOpacity=this.getHighlightStyle(i,a.datumIndex).opacity??1,r.setBoxing(o)})}updateLabelSelection(e){const{labelData:i,labelSelection:n}=e;return n.update(i,s=>{s.pointerEvents=1})}makeStylerParams(e,i){const{id:n,properties:{size:s,maxSize:r,shape:a,fill:o,fillOpacity:l,lineDash:c,lineDashOffset:h,stroke:u,strokeOpacity:d,strokeWidth:g,xKey:p,yKey:f,sizeKey:m,labelKey:y,colorKey:b}}=this,v=wa(e??0),S=ka(i);return this.type==="bubble"?{highlightState:v,selectionState:S,size:s,maxSize:r,shape:a,fill:o,fillOpacity:l,lineDash:c,lineDashOffset:h,seriesId:n,sizeKey:m,stroke:u,strokeOpacity:d,strokeWidth:g,xKey:p,yKey:f,labelKey:y,colorKey:b}:this.type==="scatter"?{highlightState:v,selectionState:S,size:s,shape:a,fill:o,fillOpacity:l,lineDash:c,lineDashOffset:h,seriesId:n,stroke:u,strokeOpacity:d,strokeWidth:g,xKey:p,yKey:f,labelKey:y,colorKey:b}:this.type}makeLabelFormatterParams(){const{xKey:e,xName:i,yKey:n,yName:s,sizeKey:r,sizeName:a,labelKey:o,labelName:l,colorKey:c,colorName:h,legendItemName:u}=this.properties;return{xKey:e,xName:i,yKey:n,yName:s,sizeKey:r,sizeName:a,labelKey:o,labelName:l,colorKey:c,colorName:h,legendItemName:u}}getTooltipContent(e){const{id:i,dataModel:n,processedData:s,axes:r,properties:a,ctx:o,colorScale:l}=this,{formatManager:c}=o,{xKey:h,xName:u,yKey:d,yName:g,sizeKey:p,sizeName:f,labelKey:m,labelName:y,colorKey:b,colorName:v,title:S,tooltip:M,marker:C,legendItemName:D}=a,A=r.x,w=r.y;if(!n||!s||!A||!w)return;const L=s.dataSources.get(this.id)?.data?.[e],O=n.resolveColumnById(this,"xValue",s)[e],R=n.resolveColumnById(this,"yValue",s)[e],_=this.properties.allowNullKeys??!1;if(O===void 0&&!_)return;const E=[];if(this.isLabelEnabled()&&m!=null){const G=n.resolveColumnById(this,"labelValue",s)[e],ie=c.format(this.callWithContext.bind(this),{type:"category",value:G,datum:L,seriesId:i,legendItemName:D,key:m,source:"tooltip",property:"label",domain:[],boundSeries:this.getFormatterContext("label")});E.push({label:y,fallbackLabel:m,value:ie??Qr(G)})}E.push({label:u,fallbackLabel:h,value:this.getAxisValueText(A,"tooltip",O,L,h,D,_),missing:ba(O,_)},{label:g,fallbackLabel:d,value:this.getAxisValueText(w,"tooltip",R,L,d,D,_),missing:ba(R,_)});const F=(G,ie,de,ae)=>{const oe=n.resolveColumnById(this,G,s)[e];if(oe==null)return;const mt=n.getDomain(this,G,"value",s).domain,pe=c.format(this.callWithContext.bind(this),{type:"number",value:oe,datum:L,seriesId:i,legendItemName:D,key:ie,source:"tooltip",property:ae,boundSeries:this.getFormatterContext(ae),domain:mt,fractionDigits:void 0,visibleDomain:void 0});return E.push({label:de,fallbackLabel:ie,value:pe??Qr(oe)}),oe};p!=null&&F("sizeValue",p,f,"size");let z;if(b!=null&&this.isColorScaleValid()){const G=F("colorValue",b,v,"color");if(G!=null){z=l.convert(G);const ie=uv(l,a.colorScale.fills,G,Qr);ie!=null&&(E.at(-1).value=ie)}else a.colorScale.missingDataFill!=null&&(z=a.colorScale.missingDataFill)}const K=this.getMarkerStyle(C,{datum:L,datumIndex:e},{xKey:h,yKey:d,sizeKey:p,labelKey:m,colorKey:b},{resolveMarkerSubPath:[]});return z!=null&&(K.fill=z),this.formatTooltipWithContext(M,{title:S,symbol:this.legendItemSymbol(K),data:E},{seriesId:i,datum:L,title:d,xKey:h,xName:u,yKey:d,yName:g,sizeKey:p,sizeName:f,labelKey:m,labelName:y,colorKey:b,colorName:v,legendItemName:D,...K,...this.getModuleTooltipParams()})}legendItemSymbol(e){const i=this.getStyle(void 0),n=this.getMarkerStyle(this.properties.marker,{},void 0,{isHighlight:!1,checkForHighlight:!1,resolveMarkerSubPath:[]},i);return{marker:e?{...n,...e}:n}}getLegendData(e){if(this.isColorScaleValid()&&this.dataModel){const{colorScale:h}=this.properties;return e==="category"&&h.mode==="discrete"&&h.fills.length>0?Ay(this.colorScale,h.fills,this.id,this.visible,Cy(this),this.properties.shape):e==="gradient"&&h.mode!=="discrete"?[{...Dy(this.colorScale,h.fills,this.id,this.visible,this.getFormatterContext("color")),showSeparately:!0}]:[]}if(e!=="category")return[];const{id:i,ctx:{legendManager:n},visible:s}=this,{yKey:r,yName:a,legendItemName:o,title:l,showInLegend:c}=this.properties;return[{legendType:"category",id:i,itemId:r,seriesId:i,enabled:s&&(n?.getItemEnabled({seriesId:i,itemId:r})??!0),label:{text:o??l??a??r},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!c}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:i}){YP(this,this.ctx.animationManager,e),gt(this,"labels",this.ctx.animationManager,i)}resetDatumAnimation(e){Kd([e.datumSelection])}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Lt}getStyle(e){const{properties:i}=this;let n={};if(i.styler){const s=this.getDataSelectionState(void 0),r=this.makeStylerParams(e,s),a=this.cachedCallWithContext(i.styler,r)??{};n=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],a,{pick:!1})??{}}return{fill:n.fill??i.fill,fillOpacity:n.fillOpacity??i.fillOpacity,lineDash:n.lineDash??i.lineDash,lineDashOffset:n.lineDashOffset??i.lineDashOffset,shape:n.shape??i.shape,size:n.size??i.size,maxSize:n.maxSize??i.maxSize,stroke:n.stroke??i.stroke,strokeOpacity:n.strokeOpacity??i.strokeOpacity,strokeWidth:n.strokeWidth??i.strokeWidth}}getSizeRange(){const{size:e,maxSize:i}=this.getStyle(void 0);return[e,i]}getFormattedMarkerStyle(e){const{xKey:i,yKey:n,sizeKey:s,labelKey:r,colorKey:a,marker:o}=this.properties;return this.getMarkerStyle(o,e,{xKey:i,yKey:n,sizeKey:s,labelKey:r,colorKey:a},{resolveMarkerSubPath:[]})}computeFocusBounds(e){return Yd(this,e)}hasItemStylers(){const{selection:e,styler:i,itemStyler:n,marker:s,label:r}=this.properties;return e.enabled||!!(i??n??s.itemStyler??r.itemStyler)||this.isColorScaleValid()}initQuadTree(e){Jd(e,this.datumNodesIter())}pickNodeDataClosestDatum(e){return Qd(this,e)}};Ly.className="BubbleSeries",Ly.type="bubble";var AD=Ly,Ny={title:N,domain:Q(P),maxSize:k,showInMiniChart:T,label:{placement:V("top","right","bottom","left"),...Fe},tooltip:Ae,styler:De({...kn,maxSize:k}),maxRenderedItems:P,...Se,...Y(kn,["enabled"]),highlight:lt(je,je),colorScale:In(Zs)},Oy={...Ny,...wn,type:X(Ge("bubble")),xKey:X(N),yKey:X(N),sizeKey:X(N),labelKey:N,colorKey:In(N),xName:N,yName:N,sizeName:N,labelName:N,colorName:In(N),legendItemName:N,xKeyAxis:N,yKeyAxis:N,highlight:lt(je,je)};Oy.selectedKey=J(N),Ny.colorRange=In(J(Q(H))),Oy.colorRange=In(J(Q(H)));var wD={$if:[{$isPackageType:"enterprise"},{fills:[{color:at.ORANGE},{color:at.YELLOW},{color:at.GREEN}]},void 0]},kD={$if:[{$isPackageType:"enterprise"},{$palette:"divergingColors"},void 0]},TD={enabled:{$some:[{$and:[{$path:"/series/$index/colorKey"},{$path:"/series/$index/colorScale/fills/0"},{$not:{$eq:[{$path:"/series/$index/colorScale/mode"},"discrete"]}}]},{$path:"/series"}]}},LD={series:{shape:"circle",size:7,maxSize:30,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Zl],["image",vs],["pattern",Ki]]},stroke:{$palette:"stroke"},fillOpacity:.8,maxRenderedItems:2e3,label:{...Jn,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","nearest"]},"area"]},"nearest",{$path:["/tooltip/range","nearest"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:Xl,selection:ar,colorScale:wD},gradientLegend:TD};LD.series.colorRange=kD;var ND={type:"series",name:"bubble",chartType:"cartesian",version:Ye,dependencies:[sn],options:Oy,predictAxis:fy,defaultAxes:{x:{type:"number",position:"bottom"},y:{type:"number",position:"left"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:LD,create:t=>new AD(t)},Et=class extends Fn{constructor(){super(...arguments),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 os,this.label=new Qi,this.tooltip=Fa()}getStyle(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:r,lineDashOffset:a,cornerRadius:o}=this;return{fill:t,fillOpacity:e,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:r,lineDashOffset:a,cornerRadius:o,opacity:1}}};x([I],Et.prototype,"xKey",2),x([I],Et.prototype,"yKey",2),x([I],Et.prototype,"xName",2),x([I],Et.prototype,"yName",2),x([I],Et.prototype,"fill",2),x([I],Et.prototype,"fillOpacity",2),x([I],Et.prototype,"stroke",2),x([I],Et.prototype,"strokeWidth",2),x([I],Et.prototype,"strokeOpacity",2),x([I],Et.prototype,"lineDash",2),x([I],Et.prototype,"lineDashOffset",2),x([I],Et.prototype,"cornerRadius",2),x([I],Et.prototype,"areaPlot",2),x([I],Et.prototype,"bins",2),x([I],Et.prototype,"aggregation",2),x([I],Et.prototype,"binCount",2),x([I],Et.prototype,"shadow",2),x([I],Et.prototype,"label",2),x([I],Et.prototype,"tooltip",2);var OD=10,Ey=class extends kr{constructor(t){super({moduleCtx:t,propertyKeys:tl,propertyNames:il,categoryKey:void 0,pickModes:[1,0],datumSelectionGarbageCollection:!0,animationAlwaysPopulateNodeData:!0,alwaysClip:!0,animationResetFns:{datum:ih,label:Pa}}),this.properties=new Et,this.calculatedBins=[]}get hasData(){return this.calculatedBins.length>0}deriveBins(t){const e=ko(t[0],t[1],OD).ticks,i=To(t[0],t[1],OD),[n]=e,s=r=>[r,r+i];return[[n-i,n],...e.map(s)]}calculateNiceBins(t,e){const i=Math.floor(t[0]),n=t[1],s=e||1,{start:r,binSize:a}=this.calculateNiceStart(i,n,s);return this.getBins(r,n,a,s)}getBins(t,e,i,n){const s=[],r=this.calculatePrecision(i);for(let a=0;a<n;a++){const o=Math.round((t+a*i)*r)/r;let l=Math.round((t+(a+1)*i)*r)/r;a===n-1&&(l=Math.max(l,e)),s[a]=[o,l]}return s}calculatePrecision(t){let e=10;if(Number.isFinite(t)&&t>0)for(;t<1;)e*=10,t*=10;return e}calculateNiceStart(t,e,i){const n=Math.abs(e-t)/i,s=Math.floor(Math.log10(n)),r=Math.pow(10,s);return{start:Math.floor(t/r)*r,binSize:n}}async processData(t){const{visible:e}=this,{xKey:i,yKey:n,areaPlot:s,aggregation:r}=this.properties,a=this.axes.x?.scale,o=this.axes.y?.scale,{xScaleType:l,yScaleType:c}=this.getScaleInformation({yScale:o,xScale:a}),h=e?{}:{forceValue:0},u=[Ar(i,l),UO];if(n){let b=IM("groupAgg",{visible:e});r==="count"||(r==="sum"?b=lO("groupAgg",{visible:e}):r==="mean"&&(b=hO("groupAgg",{visible:e}))),s&&(b=DM("groupAgg",b)),u.push(Xe(n,c,{invalidValue:void 0,...h}),b)}else{u.push(GO("count"));let b=IM("groupAgg",{visible:e});s&&(b=DM("groupAgg",b)),u.push(b)}let d=[];const g=b=>{const v=Bi(b.domain.keys[0]);if(v.length===0)return b.domain.groups=[],()=>[];const S=Li(this.properties.binCount)?this.calculateNiceBins(v,this.properties.binCount):this.properties.bins??this.deriveBins(v),M=S.length;return d=[...S],C=>{let D=C[0];if(rn(D)&&(D=D.getTime()),!Li(D))return[];for(let A=0;A<M;A++){const w=S[A];if(D>=w[0]&&D<w[1]||A===M-1&&D<=w[1])return w}return[]}},{dataModel:p,processedData:f}=await this.requestDataModel(t,this.data,{props:u,groupByFn:g}),m=f,y=new Map;for(const[b,v]of m.groups.entries()){const S=v.keys;y.set(Jt(...S),{group:v,groupIndex:b})}this.calculatedBins=d.map(b=>{const v=y.get(Jt(...b));if(v){const{group:S,groupIndex:M}=v,[[C,D]=[0,0]]=S.aggregation,A=[...p.forEachDatum(this,m,S,M)],w=this.frequency(S),L=C+D;return{domain:b,datum:A,groupIndex:M,frequency:w,total:L}}else return{domain:b,datum:[],groupIndex:-1,frequency:0,total:0}}),this.animationState.transition("updateData")}xCoordinateRange(){return[Number.NaN,Number.NaN]}yCoordinateRange(){return[Number.NaN,Number.NaN]}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!e||!i||!this.calculatedBins.length)return{domain:[]};const n=i.getDomain(this,"groupAgg","aggregate",e).domain,s=this.calculatedBins[0].domain[0],r=this.calculatedBins[(this.calculatedBins?.length??0)-1].domain[1];return t==="x"?{domain:Bi([s,r])}:{domain:Bi(n)}}getSeriesRange(t,[e,i]){const{dataModel:n,processedData:s}=this;if(!n||s?.type!=="grouped")return[Number.NaN,Number.NaN];const r=this.axes.x.scale,a=0;let o=-1/0;for(const{keys:l,aggregation:c}of s.groups){const[[h,u]=[0,0]]=c,[d,g]=l,[p,f]=At([r.convert(d),r.convert(g)]);if(f>=e&&p<=i){const m=h+u;o=Math.max(o,m)}}return a>o?[Number.NaN,Number.NaN]:[a,o]}frequency(t){return t.datumIndices.reduce((e,i)=>e+i.length,0)}createNodeDatumContext(t,e){const{xKey:i,yKey:n,xName:s,yName:r,label:a}=this.properties,{contextNodeData:o,processedData:l}=this,c=o?.nodeData!=null&&l?.changeDescription!=null;return{xAxis:t,yAxis:e,xScale:t.scale,yScale:e.scale,yAxisReversed:e.isReversed(),rawData:[],xValues:[],xKey:i,yKey:n,xName:s,yName:r,label:a,animationEnabled:!this.ctx.animationManager.isSkipped(),canIncrementallyUpdate:c,nodes:c?o.nodeData:[],nodeIndex:0}}createLabelData(t,e,i,n,s,r){const{label:a,yKey:o,xKey:l,xName:c,yName:h}=t,{total:u,datum:d}=e;if(!(!a.enabled||u===0))return{x:i+s/2,y:n+r/2,text:this.getLabelText(u,d,o,"y",[],a,{value:u,datum:d,xKey:l,yKey:o,xName:c,yName:h})}}createSkeletonNodeDatum(t,e){const{xKey:i,yKey:n}=t,{domain:s,datum:r,groupIndex:a,frequency:o,total:l}=e;return{series:this,datumIndex:a,datum:r,aggregatedValue:l,frequency:o,domain:s,yKey:n,xKey:i,x:0,y:0,xValue:0,yValue:0,width:0,height:0,midPoint:{x:0,y:0},topLeftCornerRadius:!1,topRightCornerRadius:!1,bottomRightCornerRadius:!1,bottomLeftCornerRadius:!1,label:void 0,crisp:!0}}updateNodeDatum(t,e,i){const{xScale:n,yScale:s,yAxisReversed:r}=t,{domain:a,datum:o,groupIndex:l,frequency:c,total:h}=i,u=e,[d,g]=a,p=n.convert(d),f=n.convert(g),m=s.convert(0),y=s.convert(h),b=Math.abs(f-p),v=Math.abs(y-m),S=Math.min(p,f),M=Math.min(m,y);u.datumIndex=l,u.datum=o,u.aggregatedValue=h,u.frequency=c,u.domain=a,u.x=S,u.y=M,u.xValue=p,u.yValue=y,u.width=b,u.height=v,u.midPoint?(u.midPoint.x=S+b/2,u.midPoint.y=M+v/2):u.midPoint={x:S+b/2,y:M+v/2},u.topLeftCornerRadius=!r,u.topRightCornerRadius=!r,u.bottomRightCornerRadius=r,u.bottomLeftCornerRadius=r,u.label=this.createLabelData(t,i,S,M,b,v)}createNodeDatum(t,e){const i=this.createSkeletonNodeDatum(t,e);return this.updateNodeDatum(t,i,e),i}populateNodeData(t){const{processedData:e}=this;if(e?.type==="grouped")for(const i of this.calculatedBins)Ty(t,i,(n,s)=>this.createNodeDatum(n,s),(n,s,r)=>this.updateNodeDatum(n,s,r))}initializeResult(t){return{itemId:this.properties.yKey??this.id,nodeData:t.nodes,labelData:t.nodes,scales:this.calculateScaling(),animationValid:!0,visible:this.visible||t.animationEnabled,styles:wm(this.getItemStyle.bind(this))}}finalizeNodeData(t){super.finalizeNodeData(t),t.nodes.sort((e,i)=>e.x-i.x)}nodeFactory(){return new Tt}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t;return fn(this.processedData)?i.update(e,void 0,n=>Jt(...n.domain)):i.update(e)}getItemStyle(t,e,i){const{properties:n}=this,s=this.getHighlightStyle(e,t,i);return ge(s,n.getStyle())}updateDatumStyles(t){const{datumSelection:e,isHighlight:i}=t;e.each((n,s)=>{e.isGarbage(n)||(s.style=this.getItemStyle(s.datumIndex,i))})}updateDatumNodes(t){const{contextNodeData:e}=this;if(!e)return;const i=this.ctx.highlightManager.getActiveHighlight(),{shadow:n}=this.properties,s=this.getShapeFillBBox();t.datumSelection.each((r,a)=>{const o=a.style??e.styles[this.getHighlightState(i,t.isHighlight,a.datumIndex)],{cornerRadius:l=0}=o,{topLeftCornerRadius:c,topRightCornerRadius:h,bottomRightCornerRadius:u,bottomLeftCornerRadius:d}=a;r.setStyleProperties(o,s),r.topLeftCornerRadius=c?l:0,r.topRightCornerRadius=h?l:0,r.bottomRightCornerRadius=u?l:0,r.bottomLeftCornerRadius=d?l:0,r.crisp=a.crisp,r.fillShadow=n})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e,n=>{n.pointerEvents=1,n.textAlign="center",n.textBaseline="middle"})}updateLabelNodes(t){const e=this.isLabelEnabled(),{isHighlight:i=!1}=t,n=this.ctx.highlightManager?.getActiveHighlight();t.labelSelection.each((s,r)=>{const a=Ra(this,r,this.properties,this.properties.label,i,n),{enabled:o,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:u,color:d}=a;o&&e&&r?.label?(s.text=r.label.text,s.x=r.label.x,s.y=r.label.y,s.fontStyle=l,s.fontWeight=c,s.fontFamily=u,s.fontSize=h,s.fill=d,s.visible=!0,s.fillOpacity=this.getHighlightStyle(i,r.datumIndex).opacity??1,s.setBoxing(a)):s.visible=!1})}initQuadTree(t){const{value:e}=this.contentGroup.children().next();e instanceof ne&&Jd(t,e.children())}pickNodeClosestDatum(t){return Qd(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:n,axes:s,properties:r,ctx:{localeManager:a}}=this,{xKey:o,xName:l,yKey:c,yName:h,tooltip:u,legendItemName:d}=r,g=s.x,p=s.y;if(!i||n?.type!=="grouped"||!g||!p)return;const f=n.groups[t],{aggregation:m,keys:y}=f,[[b,v]=[0,0]]=m,S=this.frequency(f),M=y,[C,D]=M,A=b+v,w={data:[...i.forEachDatum(this,n,f,t)],aggregatedValue:A,frequency:S,domain:M},L=[{label:l,fallbackLabel:o,value:`${this.getAxisValueText(g,"tooltip",C,w,o,d)} - ${this.getAxisValueText(g,"tooltip",D,w,o,d)}`},{label:a.t("seriesHistogramTooltipFrequency"),value:this.getAxisValueText(p,"tooltip",S,w,c,d)}];if(c!=null){let O;switch(r.aggregation){case"sum":O=a.t("seriesHistogramTooltipSum",{yName:h??c});break;case"mean":O=a.t("seriesHistogramTooltipMean",{yName:h??c});break;case"count":O=a.t("seriesHistogramTooltipCount",{yName:h??c});break}L.push({label:O,value:this.getAxisValueText(p,"tooltip",A,w,c,d)})}return this.formatTooltipWithContext(u,{symbol:this.legendItemSymbol(),data:L},{seriesId:e,datum:w,title:h,xKey:o,xName:l,yKey:c,yName:h,xRange:[C,D],frequency:S,...this.getItemStyle(t,!1)})}legendItemSymbol(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:n,strokeOpacity:s,lineDash:r,lineDashOffset:a}=this.properties;return{marker:{fill:He(t)??"rgba(0, 0, 0, 0)",stroke:i??"rgba(0, 0, 0, 0)",fillOpacity:e,strokeOpacity:s,strokeWidth:n,lineDash:r,lineDashOffset:a}}}getLegendData(t){if(t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:n}=this,{xKey:s,yName:r,showInLegend:a}=this.properties;return[{legendType:"category",id:e,itemId:s,seriesId:e,enabled:n&&(i?.getItemEnabled({seriesId:e,itemId:s})??!0),label:{text:r??s??"Frequency"},symbol:this.legendItemSymbol(),hideInLegend:!a}]}resetDatumAnimation(t){eg([t.datumSelection])}animateEmptyUpdateReady({datumSelection:t,labelSelection:e}){const i=th(eh(!0,this.axes,"normal"),"unknown");Mt(this.id,"datums",this.ctx.animationManager,[t],i),gt(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(t){const e=th(eh(!0,this.axes,"normal"),"added"),i={changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set};Mt(this.id,"datums",this.ctx.animationManager,[t.datumSelection],e,n=>Jt(...n.unsafeDatum.domain),i),i?.changed&&gt(this,"labels",this.ctx.animationManager,t.labelSelection)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){return Sy(this,this.contextNodeData?.nodeData[t])}hasItemStylers(){return this.properties.selection.enabled||this.properties.label.itemStyler!=null}};Ey.className="HistogramSeries",Ey.type="histogram";var ED={showInMiniChart:T,cornerRadius:k,label:Fe,tooltip:Ae,shadow:qn,...Se,...$,...B,...W,highlight:lt(je,je),areaPlot:T,aggregation:V("count","sum","mean"),bins:Q(Q(P)),binCount:k},wF={...wn,...ED,type:X(Ge("histogram")),xKey:X(N),yKey:N,xKeyAxis:N,yKeyAxis:N,xName:N,yName:N},kF={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",rr],["image",vs],["pattern",Ki]]},stroke:{$palette:"stroke"},strokeWidth:1,fillOpacity:1,strokeOpacity:1,lineDash:[0],lineDashOffset:0,label:{...Jn,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},shadow:{enabled:!1,color:Xr,xOffset:3,yOffset:3,blur:5},highlight:Xl}},RD={type:"series",name:"histogram",chartType:"cartesian",version:Ye,dependencies:[sn],options:wF,predictAxis:Jc,defaultAxes:{x:{type:"number",position:"bottom"},y:{type:"number",position:"left"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:kF,create:t=>new Ey(t)},TF=10;function ng(t,e,i,n,s,r,a,o){const l=t[r];if(l===void 0)return!1;const c=Number.isFinite(e)?un(l,e,i,a):fo(r,o),h=uu(c,s);return r===n[h+ct]||r===n[h+yt]||r===n[h+wt]||r===n[h+ht]}function PD(t,e,i,n,s,r,a,o){let l=0;for(let u=0;u<a;u++)ng(t,e,i,n,s,u,r,a)&&l++;const c=o?.length===l?o:new Uint32Array(l);let h=0;for(let u=0;u<a;u++)ng(t,e,i,n,s,u,r,a)&&(c[h++]=u);return c}function LF(t,e,i,n,s,r,a,o,l){let c=0;for(const d of t)ng(e,i,n,s,r,d,a,o)&&c++;const h=l?.length===c?l:new Uint32Array(c);let u=0;for(const d of t)ng(e,i,n,s,r,d,a,o)&&(h[u++]=d);return h}function Ry(t,e,i,n){const s=e.length;if(s<xs)return;const[r,a]=t,{xNeedsValueOf:o,yNeedsValueOf:l,existingFilters:c}=n;let h=Ss(e,r,a,{xNeedsValueOf:o});const u=c?.find(m=>m.maxRange===h);let{indexData:d,valueData:g}=Ms(e,i,i,r,a,h,{xNeedsValueOf:o,yNeedsValueOf:l,reuseIndexData:u?.indexData,reuseValueData:u?.valueData}),p=PD(e,r,a,d,h,o,s,u?.indices);const f=[{maxRange:h,indices:p,indexData:d,valueData:g}];for(;p.length>TF&&h>64;){const m=h,y=Math.trunc(m/2),b=c?.find(S=>S.maxRange===y),v=Zr(d,g,m,{reuseIndexData:b?.indexData,reuseValueData:b?.valueData});h=v.maxRange,d=v.indexData,g=v.valueData,p=LF(p,e,r,a,d,h,o,s,b?.indices),f.push({maxRange:h,indices:p,indexData:d,valueData:g})}return f.reverse(),f}function NF(t,e,i,n){const s=e.length;if(s<xs)return;const[r,a]=t,{xNeedsValueOf:o,yNeedsValueOf:l,targetRange:c,existingFilters:h}=n,u=Ss(e,r,a,{xNeedsValueOf:o}),d=Math.min(u,po(Math.max(c,or))),g=h?.find(v=>v.maxRange===d),{indexData:p,valueData:f}=Ms(e,i,i,r,a,d,{xNeedsValueOf:o,yNeedsValueOf:l,reuseIndexData:g?.indexData,reuseValueData:g?.valueData}),m=PD(e,r,a,p,d,o,s,g?.indices),y={maxRange:d,indices:m,indexData:p,valueData:f};function b(){return Ry([r,a],e,i,{xNeedsValueOf:o,yNeedsValueOf:l,existingFilters:h})?.filter(S=>S.maxRange!==d)??[]}return{immediate:[y],computeRemaining:b}}function OF(t,e,i,n,s,r){const[a,o]=Zi(t,n);return Ry([a,o],e,i,{xNeedsValueOf:s,yNeedsValueOf:r})}var EF=ac(OF);function RF(t,e,i,n,s,r){const a=e.resolveColumnById(s,"xValue",i),o=e.resolveColumnById(s,n,i),l=e.getDomain(s,"xValue","value",i),c=e.resolveColumnNeedsValueOf(s,"xValue",i),h=e.resolveColumnNeedsValueOf(s,n,i);if(r){const[u,d]=Zi(t,l);return Ry([u,d],a,o,{xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:r})}return EF(t,a,o,l,c,h)}function PF(t,e,i,n,s,r,a){const o=e.resolveColumnById(s,"xValue",i),l=e.resolveColumnById(s,n,i),c=e.getDomain(s,"xValue","value",i),h=e.resolveColumnNeedsValueOf(s,"xValue",i),u=e.resolveColumnNeedsValueOf(s,n,i),[d,g]=Zi(t,c);return NF([d,g],o,l,{xNeedsValueOf:h,yNeedsValueOf:u,targetRange:r,existingFilters:a})}var It=class extends Fn{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new uo,this.marker=new Ci,this.label=new Qi,this.tooltip=Fa(),this.connectMissingData=!1,this.sparklineMode=!1}};x([I],It.prototype,"xKey",2),x([I],It.prototype,"yKey",2),x([I],It.prototype,"xName",2),x([I],It.prototype,"yName",2),x([I],It.prototype,"selectedKey",2),x([I],It.prototype,"stackGroup",2),x([I],It.prototype,"normalizedTo",2),x([I],It.prototype,"title",2),x([I],It.prototype,"stroke",2),x([I],It.prototype,"strokeWidth",2),x([I],It.prototype,"strokeOpacity",2),x([I],It.prototype,"lineDash",2),x([I],It.prototype,"lineDashOffset",2),x([I],It.prototype,"interpolation",2),x([I],It.prototype,"styler",2),x([I],It.prototype,"marker",2),x([I],It.prototype,"label",2),x([I],It.prototype,"tooltip",2),x([I],It.prototype,"connectMissingData",2),x([I],It.prototype,"sparklineMode",2);var Py=class xh extends kr{constructor(e){super({moduleCtx:e,propertyKeys:tl,propertyNames:il,categoryKey:"xValue",pickModes:[2,1,0],datumSelectionGarbageCollection:!1,segmentedDataNodes:!1,animationResetFns:{path:py({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:Pa,datum:(i,n)=>({...Wd(i),...qc(i,n)})},clipFocusBox:!1}),this.properties=new It,this.aggregationManager=new Gd,this.hideWithSize0=!1}get pickModeAxis(){return this.properties.sparklineMode?"main":"main-category"}isNormalized(){return this.properties.normalizedTo!=null}renderToOffscreenCanvas(){return(this.contextNodeData?.nodeData?.length??0)>0&&this.getDrawingMode(!1)==="cutout"||super.renderToOffscreenCanvas()}async processData(e){if(this.data==null)return;const{data:i,visible:n,seriesGrouping:{groupIndex:s=this.id,stackCount:r=0}={}}=this,{xKey:a,yKey:o,selectedKey:l,connectMissingData:c,normalizedTo:h}=this.properties,u=this.axes.x?.scale,d=this.axes.y?.scale,{isContinuousX:g,xScaleType:p,yScaleType:f}=this.getScaleInformation({xScale:u,yScale:d}),m=r>1||h!=null,y={invalidValue:null};c&&m&&(y.invalidValue=0),m&&!n&&(y.forceValue=0);const b={value:`area-stack-${s}-yValue`,marker:`area-stack-${s}-yValues-marker`},v=[],S=this.properties.allowNullKeys??!1;(!g||m)&&v.push(Ar(a,p,{id:"xKey",allowNullKey:S})),v.push(Xe(a,p,{id:"xValue",allowNullKey:S}),Xe(o,f,{id:"yValueRaw",...y,invalidValue:void 0})),l!=null&&v.push(Xe(l,"category",{id:"selectedRaw"})),m&&v.push(...Aa(o,"normal",{id:"yValueCumulative",...y,groupId:b.marker},f)),Kn(h)&&v.push(Xe(o,f,{id:"yValue",...y,groupId:b.value}),vd(Object.values(b),h)),this.needsDataModelDiff()&&(v.push(zc(g?["xValue"]:void 0)),this.processedData&&v.push(Sd(this.id,this.processedData)));const{dataModel:M,processedData:C}=await this.requestDataModel(e,i,{props:v,groupByKeys:m,groupByData:!m});this.aggregateData(M,C),this.animationState.transition("updateData")}yValueKey(){return this.isNormalized()?"yValue":"yValueRaw"}yCumulativeKey(e){return e.type==="grouped"?"yValueCumulative":this.yValueKey()}xCoordinateRange(e,i){const{marker:n}=this.properties,s=this.axes.x.scale.convert(e),r=n.enabled?.5*n.size*i:0;return[s-r,s+r]}yCoordinateRange(e,i){const{marker:n}=this.properties,s=this.axes.y.scale.convert(e[0]),r=n.enabled?.5*n.size*i:0;return[s-r,s+r]}getSeriesDomain(e){const{dataModel:i,processedData:n,axes:s}=this;if(!i||!n)return{domain:[]};const r=s.y;if(e==="x"){const o=i.resolveProcessedDataDefById(this,"xValue"),l=i.getDomain(this,"xValue","value",n);if(o?.def.type==="value"&&o.def.valueType==="category"){const c=i.getKeySortMetadata(this,"xValue",n);return{domain:l.domain,sortMetadata:c}}return{domain:Bi(dr(l.domain))}}const a=this.domainForClippedRange("y",[this.yCumulativeKey(n)],"xValue");if(this.isNormalized()&&r instanceof Es&&!(r instanceof ll)){const o=Number.isFinite(a[1]-a[0])?[Math.min(a[0],0),Math.max(a[1],0)]:[];return{domain:Bi(o)}}else return{domain:Bi(a)}}getSeriesRange(e,i){return this.domainForVisibleRange("y",[this.yCumulativeKey(this.processedData)],"xValue",i)}getZoomRangeFittingItems(e,i,n){return this.zoomFittingVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],e,i,n)}getVisibleItems(e,i,n){return this.countVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],e,i,n)}aggregateData(e,i){if(this.aggregationManager.markStale(i.input.count),i.type!=="ungrouped"||fn(i))return;const n=this.axes.x;if(n==null)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>PF(n.scale.type,e,i,this.yCumulativeKey(i),this,s,a),computeFull:a=>RF(n.scale.type,e,i,this.yCumulativeKey(i),this,a),targetRange:s});const r=this.aggregationManager.filters;r&&r.length>0&&js.record(`${this.type}:aggregation`,r.map(a=>a.maxRange))}createBucketLookupFeature(){return new ny({series:this,getXAxis:()=>this.axes.x,getDataModel:()=>this.dataModel,getProcessedData:()=>this.processedData,aggregationManager:this.aggregationManager,domainKey:"value",getSelection:()=>this.data?.selections.get(this.id)?.getSelection(),canonicalExtremaSlots:[ht]})}estimateTargetRange(){const e=this.axes.x;if(e?.scale?.range){const[i,n]=e.scale.range;return Math.abs(n-i)}return this.ctx.scene?.canvas?.width??800}createNodeDatumContext(e,i){const{dataModel:n,processedData:s}=this;if(!n||!s)return;const r=e.scale,a=i.scale,o=s.dataSources.get(this.id)?.data??[],[l,c]=r.range,h=Math.abs(c-l);this.aggregationManager.ensureLevelForRange(h);const u=this.aggregationManager.getFilterForRange(h);this.ensureBucketLookupFeature()?.setActiveFilter(s,u);const d=this.canIncrementallyUpdateNodes(u!=null);return{xAxis:e,yAxis:i,rawData:o,xValues:n.resolveColumnById(this,"xValue",s),yRawValues:n.resolveColumnById(this,"yValueRaw",s),yCumulativeValues:n.resolveColumnById(this,this.yCumulativeKey(s),s),selectionValues:this.properties.selectedKey?n.resolveColumnById(this,"selectedRaw",s):void 0,xScale:r,yScale:a,xOffset:(r.bandwidth??0)/2,yOffset:(a.bandwidth??0)/2,size:this.properties.marker.enabled?this.properties.marker.size:0,yDomain:this.getSeriesDomain("y").domain,labelsEnabled:this.properties.label.enabled,animationEnabled:!this.ctx.animationManager.isSkipped(),canIncrementallyUpdate:d,dataAggregationFilter:u,range:h,xKey:this.properties.xKey,yKey:this.properties.yKey,xName:this.properties.xName,yName:this.properties.yName,legendItemName:this.properties.legendItemName,connectMissingData:this.properties.connectMissingData,capDefaults:{lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},nodes:d?this.contextNodeData.nodeData:[],spanPoints:[],nodeIndex:0}}handleDatum(e,i,n){if(i.datum=e.rawData[n],i.xDatum=e.xValues[n],i.yDatum=e.yRawValues[n],i.yCumulative=e.yCumulativeValues[n],i.selected=e.selectionValues?.[n],i.x=e.xScale.convert(i.xDatum)+e.xOffset,i.y=e.yScale.convert(i.yCumulative)+e.yOffset,!!Number.isFinite(i.x)){if(i.yDatum!=null){const s=e.labelsEnabled?this.getLabelText(i.yDatum,i.datum,e.yKey,"y",e.yDomain,this.properties.label,{value:i.yDatum,datum:i.datum,xKey:e.xKey,yKey:e.yKey,xName:e.xName,yName:e.yName,legendItemName:e.legendItemName}):void 0;if(e.canIncrementallyUpdate&&e.nodeIndex<e.nodes.length){const a=e.nodes[e.nodeIndex];a.datum=i.datum,a.datumIndex=n,a.point={x:i.x,y:i.y,size:e.size},a.midPoint={x:i.x,y:i.y},a.cumulativeValue=i.yCumulative,a.yValue=i.yDatum,a.xValue=i.xDatum,a.labelText=s,a.selected=i.selected}else e.nodes.push({series:this,datum:i.datum,datumIndex:n,yKey:e.yKey,xKey:e.xKey,point:{x:i.x,y:i.y,size:e.size},midPoint:{x:i.x,y:i.y},cumulativeValue:i.yCumulative,yValue:i.yDatum,xValue:i.xDatum,capDefaults:e.capDefaults,labelText:s,selected:i.selected});e.nodeIndex++}this.updateSpanPoints(e,i)}}updateSpanPoints(e,i){const n=e.spanPoints.at(-1);if(i.yDatum!=null){const s={point:{x:i.x,y:i.y},xDatum:i.xDatum,yDatum:i.yCumulative};Array.isArray(n)?n.push(s):n==null?e.spanPoints.push([s]):(n.skip+=1,e.spanPoints.push([s]))}else e.connectMissingData||(Array.isArray(n)||n==null?e.spanPoints.push({skip:0}):n.skip+=1)}populateNodeData(e){const i={datum:void 0,xDatum:void 0,yDatum:void 0,yCumulative:0,selected:void 0,x:0,y:0},n=e.dataAggregationFilter?.indices;let[s,r]=this.visibleRangeIndices("xValue",e.xAxis.range,n);s=Math.max(s-1,0),r=Math.min(r+1,n?.length??e.xValues.length),this.processedData.input.count<1e3&&(s=0,r=this.processedData.input.count);for(let a=s;a<r;a+=1)this.handleDatum(e,i,n?.[a]??a)}initializeResult(e){return{itemId:e.yKey,nodeData:e.nodes,labelData:e.nodes,strokeData:{itemId:e.yKey,spans:[]},scales:this.calculateScaling(),visible:this.visible,crossFiltering:!1,styles:Zd(this,this.properties,this.properties.marker),segments:void 0}}assembleResult(e,i){const n=e.spanPoints.flatMap(s=>Array.isArray(s)?Zc(s,this.properties.interpolation):[]);return i.strokeData={itemId:e.yKey,spans:n},i.crossFiltering=this.properties.selectedKey!=null,i.segments=qd(this.properties.segmentation,e.xAxis,e.yAxis,this.chart.seriesRect,this.ctx.scene,!1),i}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(e){const{paths:[i],visible:n,animationEnabled:s}=e,r=this.getHighlightStyle(),a=this.getSelectionStyle(),o=this.getStyle(void 0),l=ge(a,r,o),{strokeWidth:c,stroke:h,strokeOpacity:u,lineDash:d,lineDashOffset:g,opacity:p}=l,f=this.contextNodeData?.segments;i.setProperties({segments:f,fill:void 0,lineJoin:"round",pointerEvents:1,opacity:p,stroke:h,strokeWidth:c,strokeOpacity:u,lineDash:d,lineDashOffset:g}),i.datum=f,s||(i.visible=n),Xd(this,i)}updateDatumSelection(e){let{nodeData:i}=e;const{datumSelection:n}=e,{contextNodeData:s,processedData:r,axes:a,properties:o}=this,{marker:l}=o,c=uy(o,s,r,a,l,l,this.chart?.isMiniChart);return this.hideWithSize0=c.hideWithSize0,i=c.needsNodeData?i:[],l.isDirty()&&(n.clear(),n.cleanup()),fn(this.processedData)?n.update(i,void 0,h=>Jt(h.xValue)):n.update(i)}static computeNoStylerMarkerStyle(e,i,n,s,r){const a=e.getStyle(n);return e.getMarkerStyle(i.marker,r,void 0,{isHighlight:i.isHighlight,highlightState:n,selectionState:s,hideWithSize0:i.hideWithSize0},a.marker,{stroke:a.stroke,strokeWidth:a.strokeWidth,strokeOpacity:a.strokeOpacity})}static computeStylerStyle(e,i,n,s,r){return e.getStyle(n)}static applyStylerDatum(e,i,n,s,r,a){const{stroke:o,strokeWidth:l,strokeOpacity:c}=a,h=a.marker,u=i.xColumn[n.datumIndex],d=i.yColumn[n.datumIndex],g=e.filterItemStylerFillParams(h.fill)??h.fill,p={...Id(u,d,i.xKey,i.yKey,i.xDomain,i.yDomain),xValue:u,yValue:d,...h,fill:g};n.style=e.getMarkerStyle(i.marker,n,p,{isHighlight:i.isHighlight,highlightState:s,selectionState:r,hideWithSize0:i.hideWithSize0},h,{stroke:o,strokeWidth:l,strokeOpacity:c})}updateDatumStyles(e){const{hideWithSize0:i}=this,{datumSelection:n,isHighlight:s}=e,{marker:r}=this.properties,{itemStyler:a}=r;if(a==null){this.runMarkerStylePass(n,s,{marker:r,hideWithSize0:i,isHighlight:s},void 0,!0,xh.computeNoStylerMarkerStyle,xh.assignCachedStyle);return}const o=this.dataModel,l=this.processedData,{xKey:c,yKey:h}=this.properties,u={marker:r,hideWithSize0:i,isHighlight:s,xColumn:o.resolveColumnById(this,"xValue",l),yColumn:o.resolveColumnById(this,"yValueRaw",l),xDomain:o.getDomain(this,"xValue","key",l).domain,yDomain:o.getDomain(this,this.yCumulativeKey(l),"value",l).domain,xKey:c,yKey:h};this.runMarkerStylePass(n,s,u,void 0,!0,xh.computeStylerStyle,xh.applyStylerDatum)}updateDatumNodes(e){const{contextNodeData:i}=this;if(!i)return;const{datumSelection:n,isHighlight:s}=e,r=this.ctx.animationManager.isSkipped(),a=this.getShapeFillBBox(),o=this.ctx.highlightManager.getActiveHighlight(),l=this.getDrawingMode(s,e.drawingMode),c=this;n.each(function(u,d){const g=d.style??i.styles[c.getHighlightState(o,s,d.datumIndex)];c.applyMarkerStyle(g,u,d.point,a,{applyTranslation:r,selected:d.selected}),u.drawingMode=c.resolveMarkerDrawingModeForState(l,g)}),s||this.properties.marker.markClean()}updateLabelSelection(e){return e.labelSelection.update(this.isLabelEnabled()?e.labelData:[])}updateLabelNodes(e){const{isHighlight:i=!1}=e,n=this.ctx.highlightManager?.getActiveHighlight(),s=this.makeLabelFormatterParams();e.labelSelection.each((r,a)=>{const o=Ra(this,a,s,this.properties.label,i,n),{enabled:l,fontStyle:c,fontWeight:h,fontSize:u,fontFamily:d,color:g}=o;l&&a?.labelText?(r.fontStyle=c,r.fontWeight=h,r.fontSize=u,r.fontFamily=d,r.textAlign="center",r.textBaseline="bottom",r.text=a.labelText,r.x=a.point.x,r.y=a.point.y-10,r.fill=g,r.visible=!0,r.fillOpacity=this.getHighlightStyle(i,a.datumIndex).opacity??1,r.setBoxing(o)):r.visible=!1})}makeStylerParams(e,i){const{id:n}=this,{marker:s,lineDash:r,lineDashOffset:a,stroke:o,strokeOpacity:l,strokeWidth:c,xKey:h,yKey:u}=this.properties,d=wa(e??0),g=ka(i);return{marker:{fill:s.fill,fillOpacity:s.fillOpacity,size:s.size,shape:s.shape,stroke:s.stroke,strokeOpacity:s.strokeOpacity,strokeWidth:s.strokeWidth,lineDash:s.lineDash,lineDashOffset:s.lineDashOffset},highlightState:d,selectionState:g,lineDash:r,lineDashOffset:a,seriesId:n,stroke:o,strokeOpacity:l,strokeWidth:c,xKey:h,yKey:u}}makeItemStylerParams(e,i,n,s){const{xKey:r,yKey:a}=this.properties,o=e.resolveColumnById(this,"xValue",i)[n],l=e.resolveColumnById(this,"yValueRaw",i)[n],c=e.getDomain(this,"xValue","key",i).domain,h=e.getDomain(this,this.yCumulativeKey(i),"value",i).domain,u=this.filterItemStylerFillParams(s.fill)??s.fill;return{...Id(o,l,r,a,c,h),xValue:o,yValue:l,...s,fill:u}}makeLabelFormatterParams(){const{xKey:e,xName:i,yKey:n,yName:s,legendItemName:r}=this.properties;return{xKey:e,xName:i,yKey:n,yName:s,legendItemName:r}}getTooltipContent(e){const{id:i,dataModel:n,processedData:s,axes:r,properties:a}=this,{xKey:o,xName:l,yKey:c,yName:h,tooltip:u,legendItemName:d}=a,g=a.allowNullKeys??!1,p=r.x,f=r.y;if(!n||!s||!p||!f)return;const m=s.dataSources.get(this.id)?.data?.[e],y=n.resolveColumnById(this,"xValue",s)[e],b=n.resolveColumnById(this,"yValueRaw",s)[e];if(y===void 0&&!g)return;const v=this.getStyle(void 0),S=this.makeItemStylerParams(n,s,e,v.marker),M=this.getMarkerStyle(this.properties.marker,{datumIndex:e,datum:m},S,{isHighlight:!1},v.marker);return this.formatTooltipWithContext(u,{heading:this.getAxisValueText(p,"tooltip",y,m,o,d,g),symbol:this.legendItemSymbol(),data:[{label:h,fallbackLabel:c,value:this.getAxisValueText(f,"tooltip",b,m,c,d),missing:ba(b)}]},{seriesId:i,datum:m,title:h,xKey:o,xName:l,yKey:c,yName:h,...M,...this.getModuleTooltipParams()})}legendItemSymbol(){const{stroke:e,strokeOpacity:i,strokeWidth:n,lineDash:s,marker:r}=this.getStyle(void 0);return{marker:{...this.getMarkerStyle(this.properties.marker,{},void 0,{isHighlight:!1,checkForHighlight:!1},{size:r.size,shape:r.shape,fill:r.fill,fillOpacity:r.fillOpacity,stroke:r.stroke,strokeOpacity:r.strokeOpacity,strokeWidth:r.strokeWidth,lineDash:r.lineDash,lineDashOffset:r.lineDashOffset}),enabled:this.properties.marker.enabled},line:{enabled:!0,stroke:e,strokeOpacity:i,strokeWidth:n,lineDash:s}}}getLegendData(e){if(e!=="category")return[];const{id:i,ctx:{legendManager:n},visible:s}=this,{yKey:r,yName:a,title:o,legendItemName:l,showInLegend:c}=this.properties;return[{legendType:e,id:i,itemId:r,legendItemName:l,seriesId:i,enabled:s&&(n?.getItemEnabled({seriesId:i,itemId:r})??!0),label:{text:l??o??a??r},symbol:this.legendItemSymbol(),hideInLegend:!c}]}updatePaths(e){this.updateLinePaths(e.paths,e.contextData)}updateLinePaths(e,i){const n=i.strokeData.spans,[s]=e;s.path.clear(),oy(s,n),s.markDirty("LineSeries")}resetDatumAnimation(e){Kd([e.datumSelection])}animateEmptyUpdateReady(e){const{datumSelection:i,labelSelection:n,annotationSelections:s,contextData:r,paths:a}=e,{animationManager:o}=this.ctx;this.updateLinePaths(a,r),dy(this,o,...a),Wt([i],qc),hy(this,o,{...this.getAnimationDrawingModes(),phase:"initial"},i),gt(this,"labels",o,n),gt(this,"annotations",o,...s)}animateReadyResize(e){const{contextData:i,paths:n}=e;this.updateLinePaths(n,i),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:i}=this.ctx,{datumSelection:n,labelSelection:s,annotationSelections:r,contextData:a,paths:o,previousContextData:l}=e,[c]=o;if(a.visible===!1&&l?.visible===!1)return;this.resetDatumAnimation(e),this.resetLabelAnimation(e);const h=()=>{this.resetPathAnimation(e),this.updateLinePaths(o,a)},u=()=>{i.skipCurrentBatch(),h()};if(a==null||l==null){h(),Xc(this,i,"added",this.getAnimationDrawingModes(),n),Os(this.id,"path_properties",i,[c],{opacity:0},{opacity:this.getOpacity()},{phase:"add"}),gt(this,"labels",i,s),gt(this,"annotations",i,...r);return}if(a.crossFiltering!==l.crossFiltering){u();return}const d=WP(a,l,this.processedData?.reduced?.diff?.[this.id],this.getOpacity());if(d===void 0){u();return}else if(d.status==="no-op")return;Mt(this.id,"path_properties",i,[c],d.stroke.pathProperties),d.status==="added"?this.updateLinePaths(o,a):d.status==="removed"?this.updateLinePaths(o,l):zd(this.id,"path_update",i,[c],d.stroke.path),d.hasMotion&&(Xc(this,i,void 0,this.getAnimationDrawingModes(),n),gt(this,"labels",i,s),gt(this,"annotations",i,...r)),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateLinePaths(o,a)})}isLabelEnabled(){return this.properties.label.enabled}getBandScalePadding(){return{inner:1,outer:.1}}nodeFactory(){return new Lt}getStyle(e){const{styler:i,marker:n,lineDash:s,lineDashOffset:r,stroke:a,strokeOpacity:o,strokeWidth:l}=this.properties,{size:c,shape:h,fill:u="transparent",fillOpacity:d}=n;let g={};if(i){const p=this.getDataSelectionState(void 0),f=this.makeStylerParams(e,p),m=this.cachedCallWithContext(i,f)??{};g=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],m,{pick:!1})??{}}return g.marker??(g.marker={}),{lineDash:g.lineDash??s,lineDashOffset:g.lineDashOffset??r,stroke:g.stroke??a,strokeOpacity:g.strokeOpacity??o,strokeWidth:g.strokeWidth??l,marker:{fill:g.marker.fill??u,fillOpacity:g.marker.fillOpacity??d,shape:g.marker.shape??h,size:g.marker.size??c,lineDash:g.marker.lineDash??n.lineDash??s,lineDashOffset:g.marker.lineDashOffset??n.lineDashOffset??r,stroke:g.marker.stroke??n.stroke??a,strokeOpacity:g.marker.strokeOpacity??n.strokeOpacity??o,strokeWidth:g.marker.strokeWidth??n.strokeWidth??l}}}getFormattedMarkerStyle(e){const i=this.getStyle(void 0),n=this.makeItemStylerParams(this.dataModel,this.processedData,e.datumIndex,i.marker);return this.getMarkerStyle(this.properties.marker,e,n,{isHighlight:!0},void 0,i)}computeFocusBounds(e){return Yd(this,e)}hasItemStylers(){return this.properties.selection.enabled||this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};Py.className="LineSeries",Py.type="line";var FF=Py,VF={series:{stroke:lp,strokeWidth:2,strokeOpacity:1,lineDash:[0],lineDashOffset:0,interpolation:{type:"linear"},marker:{shape:"circle",size:7,strokeWidth:{$isUserOption:["./stroke",1,0]},fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Zl],["image",vs],["pattern",Ki]]},stroke:{$palette:"stroke"}},label:{...Jn,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","nearest"]},"area"]},"nearest",{$path:["/tooltip/range","nearest"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:dp,selection:ar,segmentation:lu}},FD={type:"series",name:"line",chartType:"cartesian",stackable:!0,version:Ye,dependencies:[sn],options:Sc,predictAxis:Jc,defaultAxes:{y:{type:"number",position:"left"},x:{type:"category",position:"bottom"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:VF,create:t=>new FF(t)},Fy=class extends AD{};Fy.className="ScatterSeries",Fy.type="scatter";var Vy={title:N,showInMiniChart:T,label:{placement:V("top","right","bottom","left"),...Fe},tooltip:Ae,errorBar:Wl,styler:De(kn),maxRenderedItems:P,...Se,...Y(kn,["enabled"]),highlight:lt(je,je),colorScale:In(Zs)},_y={...Vy,...wn,type:X(Ge("scatter")),xKey:X(N),yKey:X(N),labelKey:N,colorKey:In(N),xName:N,yName:N,labelName:N,colorName:In(N),legendItemName:N,xKeyAxis:N,yKeyAxis:N,errorBar:Zh,highlight:lt(je,je)};_y.selectedKey=J(N),Vy.colorRange=In(J(Q(H))),_y.colorRange=In(J(Q(H)));var VD={series:{shape:"circle",size:7,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Zl],["image",vs],["pattern",Ki]]},stroke:{$palette:"stroke"},fillOpacity:.8,maxRenderedItems:2e3,label:{...Jn,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","nearest"]},"area"]},"nearest",{$path:["/tooltip/range","nearest"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:Xl,selection:ar,colorScale:wD},gradientLegend:TD};VD.series.colorRange=kD;var _D={type:"series",name:"scatter",chartType:"cartesian",version:Ye,dependencies:[sn],options:_y,predictAxis:fy,defaultAxes:{x:{type:"number",position:"bottom"},y:{type:"number",position:"left"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:VD,create:t=>new Fy(t)},BD=[yD,MD,ND,RD,FD,_D],zD=[FI,BD,Ts,Xf,Jf].flat(),GD={angle:["angleKey"],radius:["radiusKey"]},jD={angle:["angleName"],radius:["radiusName"]},By=class extends Em{constructor({categoryKey:t,pickModes:e=[1,0],canHaveAxes:i=!1,animationResetFns:n,...s}){super({...s,categoryKey:t,pickModes:e,canHaveAxes:i}),this.directions=["angle","radius"],this.itemGroup=this.contentGroup.appendChild(new ne({name:"items"})),this.nodeData=[],this.itemSelection=St.selectNoInference(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=St.select(this.labelGroup,()=>this.labelFactory(),!1),this.highlightSelection=St.selectNoInference(this.highlightNodeGroup,()=>this.nodeFactory()),this.highlightLabelSelection=St.select(this.highlightLabelGroup,()=>this.labelFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.maxChartMarkerSize=0,this.animationResetFns=n,this.animationState=new oc("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()),this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",r=>this.onLegendItemClick(r)),this.ctx.eventsHub.on("legend:item-double-click",r=>this.onLegendItemDoubleClick(r)))}getItemNodes(){return[...this.itemGroup.children()]}getNodeData(){return this.nodeData}getKeyAxis(t){if(t==="angle")return this.properties.angleKeyAxis;if(t==="radius")return this.properties.radiusKeyAxis}setZIndex(t){super.setZIndex(t),this.contentGroup.zIndex=[t,1],this.highlightGroup.zIndex=[t,2],this.labelGroup.zIndex=[t,3]}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}labelFactory(){const t=new _i;return t.pointerEvents=1,t}getInnerRadius(){return 0}computeLabelsBBox(t,e){return null}getShapeFillBBox(){const t=this.radius;return{series:new U(-t,-t,t*2,t*2),axis:new U(-t,-t,t*2,t*2)}}resetAllAnimation(){const{item:t,label:e}=this.animationResetFns??{};this.ctx.animationManager.stopByAnimationGroupId(this.id),t&&Wt([this.itemSelection,this.highlightSelection],t),e&&Wt([this.labelSelection,this.highlightLabelSelection],e),this.itemSelection.cleanup(),this.labelSelection.cleanup(),this.highlightSelection.cleanup(),this.highlightLabelSelection.cleanup()}animateEmptyUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateWaitingUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateReadyHighlight(t){const{item:e,label:i}=this.animationResetFns??{};e&&Wt([this.highlightSelection],e),i&&Wt([this.highlightLabelSelection],i)}animateReadyHighlightMarkers(t){}animateReadyResize(t){this.resetAllAnimation()}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}computeFocusBounds(t){const e=this.getNodeData()?.[t.datumIndex];if(e!==void 0)return this.itemSelection.select(i=>i instanceof kt&&i.datum===e)[0]}getSeriesRange(){return[Number.NaN,Number.NaN]}isSeriesHighlighted(t,e){if(!this.properties.highlight.enabled)return!1;const{series:i,legendItemName:n,datumIndex:s}=t??{},r=typeof s=="number"?e?.[s]:void 0;return i===this||r!=null&&r===n}},zy=class extends _d{constructor(t,e){super(t,e),this.axes=this.createChartAxes(),this.padding=new ia(40),this.ctx.axisManager.axisGroup.zIndex=8}createChartAxes(){return new ME}getChartType(){return"polar"}isDataTransactionSupported(){return!this.series.some(t=>t.type==="pie"||t.type==="donut")}async performLayout(t){const e=t.layoutBox.clone().shrink(this.seriesArea.getPadding());this.seriesRect=e,this.animationRect=e,this.seriesRoot.translationX=e.x,this.seriesRoot.translationY=e.y,await this.computeCircle(e);for(const n of this.axes)n.update();let i=0;for(const n of this.series)i=Math.max(i,n.properties.marker?.size??0);for(const n of this.series.filter(HD))n.maxChartMarkerSize=i;this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:!0,rect:e,paddedRect:t.layoutBox},layoutBox:t.layoutBox})}updateAxes(t,e,i,n){if(this.axes.length===0)return;const s=this.axes.angle,r=this.axes.radius,a=s.scale,o=r.innerRadiusRatio;s.innerRadiusRatio=o,s.computeRange(),s.gridLength=n,r.gridAngles=a.ticks({nice:[s.nice,s.nice],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(l=>a.convert(l)),r.gridRange=s.range,r.range=[n,n*o];for(const l of[s,r])l.translation.x=t.x+e,l.translation.y=t.y+i,l.calculateLayout()}async computeCircle(t){const e=this.series.filter(HD),i=(l,c,h)=>{this.updateAxes(t,l,c,h);for(const d of e)d.centerX=l,d.centerY=c,d.radius=h;const u=e.filter(d=>d.type==="donut"||d.type==="pie");if(u.length>1){const d=u.map(g=>{const p=g.getInnerRadius();return{series:g,innerRadius:p}}).sort((g,p)=>g.innerRadius-p.innerRadius);d.at(-1).series.surroundingRadius=void 0;for(let g=0;g<d.length-1;g++)d[g].series.surroundingRadius=d[g+1].innerRadius}},n=t.width/2,s=t.height/2,r=Math.max(0,Math.min(t.width,t.height)/2);let a=r;i(n,s,a);const o=async({hideWhenNecessary:l=!1}={})=>{const c=[];for(const d of Ur(this.axes,e)){const g=await d.computeLabelsBBox({hideWhenNecessary:l},t);g&&c.push(g)}if(c.length===0){i(n,s,r);return}const h=U.merge(c),u=this.refineCircle(h,a,t);i(u.centerX,u.centerY,u.radius),a=u.radius};await o(),await o(),await o(),await o({hideWhenNecessary:!0}),await o({hideWhenNecessary:!0});for(const l of Ur(this.axes,e))await l.computeLabelsBBox({hideWhenNecessary:!0},t);return{radius:a,centerX:n,centerY:s}}refineCircle(t,e,i){const s=-e,r=-e,a=e,o=e;let l=Math.max(0,s-t.x),c=Math.max(0,r-t.y),h=Math.max(0,t.x+t.width-a),u=Math.max(0,t.y+t.height-o);l=h=Math.max(l,h),c=u=Math.max(c,u);const d=i.width-l-h,g=i.height-c-u;let p=Math.min(d,g)/2;const f=.5*i.width/2,m=.5*i.height/2,y=Math.min(f,m);if(p<y){p=y;const S=l+h,M=c+u;if(2*p+M>i.height){const C=i.height-2*p;Math.min(c,u)*2>C?(c=C/2,u=C/2):c>u?c=C-u:u=C-c}if(2*p+S>i.width){const C=i.width-2*p;Math.min(l,h)*2>C?(l=C/2,h=C/2):l>h?l=C-h:h=C-l}}const b=l+2*p+h,v=c+2*p+u;return{centerX:(i.width-b)/2+l+p,centerY:(i.height-v)/2+c+p,radius:p}}};zy.className="PolarChart",zy.type="polar";function HD(t){return t instanceof By}var sg={type:"chart",name:"polar",version:Ye,options:hR,create(t,e){return new zy(t,e)},validate(t,e,i,n){const s=[],r=t?.series?.[0]?.type;(r==="pie"||r==="donut")&&t?.axes&&(s.push(new Fh([],t.axes,i,"axes")),t=Y(t,["axes"]));const a=zt(t,e,i,n);return a.invalid.push(...s),a}},$D=class Nb{constructor(e,i,n,s){this.startAngle=e,this.endAngle=i,this.innerRadius=n,this.outerRadius=s}clone(){const{startAngle:e,endAngle:i,innerRadius:n,outerRadius:s}=this;return new Nb(e,i,n,s)}equals(e){return this.startAngle===e.startAngle&&this.endAngle===e.endAngle&&this.innerRadius===e.innerRadius&&this.outerRadius===e.outerRadius}[td](e,i){return new Nb(this.startAngle*(1-i)+e.startAngle*i,this.endAngle*(1-i)+e.endAngle*i,this.innerRadius*(1-i)+e.innerRadius*i,this.outerRadius*(1-i)+e.outerRadius*i)}};function UD({startAngle:t,endAngle:e,innerRadius:i,outerRadius:n}){let s=1/0,r=1/0,a=-1/0,o=-1/0;const l=(c,h)=>{s=Math.min(c,s),r=Math.min(h,r),a=Math.max(c,a),o=Math.max(h,o)};return l(i*Math.cos(t),i*Math.sin(t)),l(i*Math.cos(e),i*Math.sin(e)),l(n*Math.cos(t),n*Math.sin(t)),l(n*Math.cos(e),n*Math.sin(e)),hr(0,t,e)&&l(n,0),hr(Math.PI*.5,t,e)&&l(0,n),hr(Math.PI,t,e)&&l(-n,0),hr(Math.PI*1.5,t,e)&&l(0,-n),new U(s,r,a-s,o-r)}function Gy(t,e,i){const n=Math.sqrt(Math.pow(t,2)+Math.pow(e,2)),{innerRadius:s,outerRadius:r}=i;if(i.startAngle===i.endAngle||n<Math.min(s,r)||n>Math.max(s,r))return!1;const a=Iu(i.startAngle),o=Iu(i.endAngle),l=Math.atan2(e,t);return a<o?l<=o&&l>=a:l<=o&&l>=-Math.PI||l>=a&&l<=Math.PI}function _F(t,e,i,n,s,r,a,o,l,c){if(Number.isNaN(t)||Number.isNaN(e))return 0;r&&([s,n]=[n,s]);const h=(c-o)/(l-a),u=o-h*a,d=Math.pow(h,2)+1,g=2*(h*(u-e)-t),p=Math.pow(t,2)+Math.pow(u-e,2)-Math.pow(i,2),f=Math.pow(g,2)-4*d*p;if(f<0)return 0;const m=(-g+Math.sqrt(f))/2/d,y=(-g-Math.sqrt(f))/2/d;let b=0;for(const v of[m,y]){if(!(v>=Math.min(a,l)&&v<=Math.max(a,l)))continue;const M=h*v+u,C=v-t,D=M-e,A=Math.atan2(D,C);hr(A,n,s)&&b++}return b}function WD(t,e){const{startAngle:i,endAngle:n,innerRadius:s,outerRadius:r}=e,a={x:r*Math.cos(i),y:r*Math.sin(i)},o={x:r*Math.cos(n),y:r*Math.sin(n)},l=s===0?{x:0,y:0}:{x:s*Math.cos(i),y:s*Math.sin(i)},c=s===0?{x:0,y:0}:{x:s*Math.cos(n),y:s*Math.sin(n)};return Ac(t.start.x,t.start.y,t.end.x,t.end.y,a.x,a.y,l.x,l.y)||Ac(t.start.x,t.start.y,t.end.x,t.end.y,o.x,o.y,c.x,c.y)||_F(0,0,r,i,n,!0,t.start.x,t.start.y,t.end.x,t.end.y)}function BF(t,e){const i={x:t.x,y:t.y},n={x:t.x+t.width,y:t.y},s={x:t.x,y:t.y+t.height},r={x:t.x+t.width,y:t.y+t.height};return WD({start:i,end:n},e)||WD({start:s,end:r},e)}function KD(t,e,i,n){if(i===0&&n===0)return 0;if(Math.asin(Math.abs(1*i)/(t+1*i))+Math.asin(Math.abs(1*n)/(t+1*n))-e<0)return 1;let r=0,a=1;for(let o=0;o<8;o+=1){const l=(r+a)/2;Math.asin(Math.abs(l*i)/(t+l*i))+Math.asin(Math.abs(l*n)/(t+l*n))-e<0?r=l:a=l}return r}var zF=1e-6;function Nr(t,e){return Du(t,e)<zF?e:Ii(t-e)+e}function rg(t,e,i=0){const s=Math.abs(e-t)>=2*Math.PI?2*Math.PI:Ii(e-t);return t=Nr(t,i),e=t+s,{startAngle:t,endAngle:e}}function ag(t,e,i,n,s,r){const a=Math.sin(r),o=Math.cos(r),l=t**2+e**2-i**2;let c,h,u,d;if(o>.5){const v=a/o,S=1+v**2,M=-2*(t+e*v),C=M**2-4*S*l;if(C<0)return;const D=(-M+Math.sqrt(C))/(2*S),A=(-M-Math.sqrt(C))/(2*S);c=D,h=D*v,u=A,d=A*v}else{const v=o/a,S=1+v**2,M=-2*(e+t*v),C=M**2-4*S*l;if(C<0)return;const D=(-M+Math.sqrt(C))/(2*S),A=(-M-Math.sqrt(C))/(2*S);c=D*v,h=D,u=A*v,d=A}const g=o,p=a,f=c*g+h*p,m=u*g+d*p,y=f>0?Nr(Math.atan2(h-e,c-t),n):Number.NaN,b=m>0?Nr(Math.atan2(d-e,u-t),n):Number.NaN;if(y>=n&&y<=s)return y;if(b>=n&&b<=s)return b}function og(t,e,i,n,s,r){const a=Math.hypot(t,e),o=(a**2-i**2+r**2)/(2*a),l=a-o,c=Math.atan2(e,t),h=Math.acos(-l/i),u=Nr(c+h,n),d=Nr(c-h,n);if(u>=n&&u<=s)return u;if(d>=n&&d<=s)return d}var jy=class{constructor(t,e,i,n,s){this.cx=t,this.cy=e,this.r=i,this.a0=n,this.a1=s,this.a0>=this.a1&&(this.a0=Number.NaN,this.a1=Number.NaN)}isValid(){return Number.isFinite(this.a0)&&Number.isFinite(this.a1)}pointAt(t){return{x:this.cx+this.r*Math.cos(t),y:this.cy+this.r*Math.sin(t)}}clipStart(t){t==null||!this.isValid()||t<this.a0||(this.a0=t,(Number.isNaN(t)||this.a0>=this.a1)&&(this.a0=Number.NaN,this.a1=Number.NaN))}clipEnd(t){t==null||!this.isValid()||t>this.a1||(this.a1=t,(Number.isNaN(t)||this.a0>=this.a1)&&(this.a0=Number.NaN,this.a1=Number.NaN))}},ei=class extends kt{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(t){this.concentricEdgeInset=t,this.radialEdgeInset=t}set cornerRadius(t){this.startOuterCornerRadius=t,this.endOuterCornerRadius=t,this.startInnerCornerRadius=t,this.endInnerCornerRadius=t}computeBBox(){return UD(this).translate(this.centerX,this.centerY)}normalizedRadii(){const{concentricEdgeInset:t}=this;let{innerRadius:e,outerRadius:i}=this;return e=e>0?e+t:0,i=Math.max(i-t,0),{innerRadius:e,outerRadius:i}}normalizedClipSector(){const{clipSector:t}=this;if(t==null)return;const{startAngle:e,endAngle:i}=rg(this.startAngle,this.endAngle),{innerRadius:n,outerRadius:s}=this.normalizedRadii(),r=rg(t.startAngle,t.endAngle,e);return new $D(Math.max(e,r.startAngle),Math.min(i,r.endAngle),Math.max(n,t.innerRadius),Math.min(s,t.outerRadius))}getAngleOffset(t){return t>0?this.radialEdgeInset/t:0}arc(t,e,i,n,s,r,a,o){if(t<=0)return;const{startAngle:l,endAngle:c}=rg(this.startAngle,this.endAngle),{innerRadius:h,outerRadius:u}=this.normalizedRadii(),d=this.normalizedClipSector();if(o&&h<=0)return;const g=o?this.getAngleOffset(h+t):this.getAngleOffset(u-t),p=a?l+g+e:c-g-e,f=o?h+t:u-t,m=f*Math.cos(p),y=f*Math.sin(p);if(d!=null&&(!a&&!(p>=l-1e-6&&p<=d.endAngle-1e-6)||a&&!(p>=d.startAngle+1e-6&&p<=c-1e-6)||o&&f<d.innerRadius-1e-6||!o&&f>d.outerRadius+1e-6))return;const b=new jy(m,y,t,i,n);if(d!=null){o?(b.clipStart(ag(m,y,t,i,n,d.endAngle)),b.clipEnd(ag(m,y,t,i,n,d.startAngle))):(b.clipStart(ag(m,y,t,i,n,d.startAngle)),b.clipEnd(ag(m,y,t,i,n,d.endAngle)));let D,A;if(a?(D=og(m,y,t,i,n,d.innerRadius),A=og(m,y,t,i,n,d.outerRadius)):(D=og(m,y,t,i,n,d.outerRadius),A=og(m,y,t,i,n,d.innerRadius)),b.clipStart(D),b.clipEnd(A),D!=null){const{x:w,y:L}=b.pointAt(D),O=Nr(Math.atan2(L,w),l);a?r?.clipStart(O):s.clipEnd(O)}if(A!=null){const{x:w,y:L}=b.pointAt(A),O=Nr(Math.atan2(L,w),l);a?s.clipStart(O):r?.clipEnd(O)}}if(d!=null){const{x:D,y:A}=b.pointAt((b.a0+b.a1)/2);if(!Gy(D,A,d))return}const{x:v,y:S}=b.pointAt(a===o?b.a0:b.a1),M=Nr(Math.atan2(S,v),l),C=o?r:s;return a?C?.clipStart(M):C?.clipEnd(M),b}updatePath(){const{path:e,centerX:i,centerY:n,concentricEdgeInset:s,radialEdgeInset:r}=this;let{startOuterCornerRadius:a,endOuterCornerRadius:o,startInnerCornerRadius:l,endInnerCornerRadius:c}=this;const{startAngle:h,endAngle:u}=rg(this.startAngle,this.endAngle),{innerRadius:d,outerRadius:g}=this.normalizedRadii(),p=this.normalizedClipSector(),f=u-h,m=f>=2*Math.PI-1e-6;e.clear();const y=this.getAngleOffset(d),b=f-2*y,v=g-d,S=d>0&&b>0?2*d*Math.sin(b/2):0,M=g>0&&b>0?2*g*Math.sin(b/2):0;if(a=Math.floor(Math.max(0,Math.min(a,M/2,v/2))),o=Math.floor(Math.max(0,Math.min(o,M/2,v/2))),l=Math.floor(Math.max(0,Math.min(l,S/2,v/2))),c=Math.floor(Math.max(0,Math.min(c,S/2,v/2))),d===0&&g===0||d>g||S<0||M<=0)return;if((p?.startAngle??h)===(p?.endAngle??u))return;if(m&&this.clipSector==null&&a===0&&o===0&&l===0&&c===0){e.moveTo(i+g*Math.cos(h),n+g*Math.sin(h)),e.arc(i,n,g,h,u),d>s&&(e.moveTo(i+d*Math.cos(u),n+d*Math.sin(u)),e.arc(i,n,d,u,h,!0)),e.closePath();return}else if(this.clipSector==null&&Math.abs(d-g)<1e-6){e.arc(i,n,g,h,u,!1),e.arc(i,n,g,u,h,!0),e.closePath();return}const D=this.getAngleOffset(g);if(f<2*D)return;const w=(p?.innerRadius??d)>s,L=d<s||f<2*y,O=Math.max(a,l,o,c),R=O>0?Math.min(v/O,1):1;a*=R,o*=R,l*=R,c*=R;const _=KD(g,f-2*D,-a,-o);if(a*=_,o*=_,!L&&w){const me=KD(d,f-2*y,l,c);l*=me,c*=me}else l=0,c=0;const E=Math.max(a+l,o+c),F=E>0?Math.min(v/E,1):1;a*=F,o*=F,l*=F,c*=F;let z=0,K=0;const G=a/(g-a),ie=o/(g-o);if(G>=0&&G<1-1e-6)z=Math.asin(G);else{z=f/2;const me=g/(1/Math.sin(z)+1);a=Math.min(me,a)}if(ie>=0&&ie<1-1e-6)K=Math.asin(ie);else{K=f/2;const me=g/(1/Math.sin(K)+1);o=Math.min(me,o)}const de=Math.asin(l/(d+l)),ae=Math.asin(c/(d+c)),oe=p?.outerRadius??g,mt=this.getAngleOffset(oe),pe=new jy(0,0,oe,h+mt,u-mt),_t=p?.innerRadius??d,oi=this.getAngleOffset(_t),fe=w?new jy(0,0,_t,h+oi,u-oi):void 0;p!=null&&(pe.clipStart(p.startAngle),pe.clipEnd(p.endAngle),fe?.clipStart(p.startAngle),fe?.clipEnd(p.endAngle));const fs=this.arc(a,z,h-Math.PI*.5,h+z,pe,fe,!0,!1),vn=this.arc(o,K,u-K,u+Math.PI*.5,pe,fe,!1,!1),zn=this.arc(c,ae,u+Math.PI*.5,u+Math.PI-ae,pe,fe,!1,!0),Qe=this.arc(l,de,h+Math.PI+de,h+Math.PI*1.5,pe,fe,!0,!0);if(!(L&&w)){if(L){const me=f<Math.PI*.5?r*(1+Math.cos(f))/Math.sin(f):Number.NaN;let Be;me>0&&me<g?Be=Math.max(Math.hypot(r,me),d):Be=r,Be=Math.max(Be,d);const xe=h+f*.5;e.moveTo(i+Be*Math.cos(xe),n+Be*Math.sin(xe))}else if(!(Qe?.isValid()===!0||fe?.isValid()===!0)){const me=h+f/2,Be=d*Math.cos(me),xe=d*Math.sin(me);e.moveTo(i+Be,n+xe)}}if(fs?.isValid()===!0){const{cx:me,cy:Be,r:xe,a0:Ai,a1:xn}=fs;e.arc(i+me,n+Be,xe,Ai,xn)}if(pe.isValid()){const{r:me,a0:Be,a1:xe}=pe;e.arc(i,n,me,Be,xe)}if(vn?.isValid()===!0){const{cx:me,cy:Be,r:xe,a0:Ai,a1:xn}=vn;e.arc(i+me,n+Be,xe,Ai,xn)}if(!L){if(zn?.isValid()===!0){const{cx:me,cy:Be,r:xe,a0:Ai,a1:xn}=zn;e.arc(i+me,n+Be,xe,Ai,xn)}if(fe?.isValid()===!0){const{r:me,a0:Be,a1:xe}=fe;e.arc(i,n,me,xe,Be,!0)}if(Qe?.isValid()===!0){const{cx:me,cy:Be,r:xe,a0:Ai,a1:xn}=Qe;e.arc(i+me,n+Be,xe,Ai,xn)}}e.closePath()}isPointInPath(t,e){const{startAngle:i,endAngle:n,innerRadius:s,outerRadius:r}=this.clipSector??this;return Gy(t-this.centerX,e-this.centerY,{startAngle:i,endAngle:n,innerRadius:Math.min(s,r),outerRadius:Math.max(s,r)})}};ei.className="Sector",x([Z()],ei.prototype,"centerX",2),x([Z()],ei.prototype,"centerY",2),x([Z()],ei.prototype,"innerRadius",2),x([Z()],ei.prototype,"outerRadius",2),x([Z()],ei.prototype,"startAngle",2),x([Z()],ei.prototype,"endAngle",2),x([ha({equals:(t,e)=>t.equals(e)})],ei.prototype,"clipSector",2),x([Z()],ei.prototype,"concentricEdgeInset",2),x([Z()],ei.prototype,"radialEdgeInset",2),x([Z()],ei.prototype,"startOuterCornerRadius",2),x([Z()],ei.prototype,"endOuterCornerRadius",2),x([Z()],ei.prototype,"startInnerCornerRadius",2),x([Z()],ei.prototype,"endInnerCornerRadius",2);var YD=class extends tt{constructor(){super(...arguments),this.showInLegend=!1}};x([I],YD.prototype,"showInLegend",2);var Hy=class extends Qi{constructor(){super(...arguments),this.spacing=2}set(t,e){return super.set(t)}};x([I],Hy.prototype,"text",2),x([I],Hy.prototype,"spacing",2);var $y=class extends Te{constructor(){super(...arguments),this.fill="transparent",this.fillOpacity=1}};x([I],$y.prototype,"fill",2),x([I],$y.prototype,"fillOpacity",2);var cl=class extends Qi{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};x([I],cl.prototype,"offset",2),x([I],cl.prototype,"minAngle",2),x([I],cl.prototype,"minSpacing",2),x([I],cl.prototype,"maxCollisionOffset",2),x([I],cl.prototype,"avoidCollisions",2);var Uy=class extends Qi{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};x([I],Uy.prototype,"positionOffset",2),x([I],Uy.prototype,"positionRatio",2);var nh=class extends Te{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};x([I],nh.prototype,"colors",2),x([I],nh.prototype,"length",2),x([I],nh.prototype,"strokeWidth",2),x([I],nh.prototype,"itemStyler",2);var be=class extends mn{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(at),this.strokes=Object.values(Vs),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 co(Hy),this.title=new YD,this.innerCircle=new $y,this.shadow=new os,this.calloutLabel=new cl,this.sectorLabel=new Uy,this.calloutLine=new nh,this.tooltip=Fa()}};x([I],be.prototype,"angleKey",2),x([I],be.prototype,"angleName",2),x([I],be.prototype,"angleFilterKey",2),x([I],be.prototype,"radiusKey",2),x([I],be.prototype,"radiusName",2),x([I],be.prototype,"radiusMin",2),x([I],be.prototype,"radiusMax",2),x([I],be.prototype,"calloutLabelKey",2),x([I],be.prototype,"calloutLabelName",2),x([I],be.prototype,"sectorLabelKey",2),x([I],be.prototype,"sectorLabelName",2),x([I],be.prototype,"legendItemKey",2),x([I],be.prototype,"defaultColorRange",2),x([I],be.prototype,"defaultPatternFills",2),x([I],be.prototype,"fills",2),x([I],be.prototype,"strokes",2),x([I],be.prototype,"fillOpacity",2),x([I],be.prototype,"strokeOpacity",2),x([I],be.prototype,"lineDash",2),x([I],be.prototype,"lineDashOffset",2),x([I],be.prototype,"cornerRadius",2),x([I],be.prototype,"itemStyler",2),x([I],be.prototype,"rotation",2),x([I],be.prototype,"outerRadiusOffset",2),x([I],be.prototype,"outerRadiusRatio",2),x([I],be.prototype,"innerRadiusOffset",2),x([I],be.prototype,"innerRadiusRatio",2),x([I],be.prototype,"strokeWidth",2),x([I],be.prototype,"sectorSpacing",2),x([I],be.prototype,"hideZeroValueSectorsInLegend",2),x([I],be.prototype,"innerLabels",2),x([I],be.prototype,"title",2),x([I],be.prototype,"innerCircle",2),x([I],be.prototype,"shadow",2),x([I],be.prototype,"calloutLabel",2),x([I],be.prototype,"sectorLabel",2),x([I],be.prototype,"calloutLine",2),x([I],be.prototype,"tooltip",2);function Wy(t,e,i,n){const s=[i.convert(0),i.convert(1)],r=[n.convert(0),n.convert(1)],a=Math.PI/-2+Zt(e),o=t?"initial":"update",l=({radius:p})=>({innerRadius:s[0],outerRadius:s[0]+(s[1]-s[0])*p}),c=({radius:p})=>({innerRadius:r[0],outerRadius:r[0]+(r[1]-r[0])*p});return{nodes:{toFn:(p,f,m,{prevLive:y})=>{let{startAngle:b,endAngle:v,innerRadius:S,outerRadius:M}=f;const{stroke:C,fill:D}=f.sectorFormat;if(m==="removed"&&y?(b=y.unsafeDatum?.endAngle,v=y.unsafeDatum?.endAngle):m==="removed"&&!y&&(b=a,v=a),m==="removed"){const w=l(f);S=w.innerRadius,M=w.outerRadius}return{startAngle:b,endAngle:v,outerRadius:M,innerRadius:S,stroke:C,...typeof D=="string"?{fill:D}:{}}},fromFn:(p,f,m,{prevFromProps:y})=>{let{startAngle:b,endAngle:v,innerRadius:S,outerRadius:M}=p,{fill:C,stroke:D}=f.sectorFormat;if(m==="updated"&&p.previousDatum==null&&(m="added"),m==="unknown"||m==="added"&&!y?(b=a,v=a,S=f.innerRadius,M=f.outerRadius):m==="added"&&y&&(b=y.endAngle??a,v=y.endAngle??a,S=y.innerRadius??f.innerRadius,M=y.outerRadius??f.outerRadius),m==="added"&&!t){const w=c(f);S=w.innerRadius,M=w.outerRadius}return m==="updated"&&(C=p.fill??C,D=(typeof p.stroke=="string"?p.stroke:void 0)??D),{startAngle:b,endAngle:v,innerRadius:S,outerRadius:M,stroke:D,phase:o,...typeof C=="string"?{fill:C}:{}}}},innerCircle:{fromFn:(p,f)=>({size:p.unsafePreviousDatum?.radius??p.size??0,phase:o}),toFn:(p,f)=>({size:f.radius??0})}}}function GF(t,e){return{startAngle:e.startAngle,endAngle:e.endAngle,innerRadius:e.innerRadius,outerRadius:e.outerRadius,stroke:e.sectorFormat.stroke}}function jF(t,e){const i=e.y-t.centerY,n=e.x-t.centerX,s=Math.atan2(i,n),r=t.getItemNodes();for(const a of r)if(a.datum.missing!==!0&&hr(s,a.startAngle,a.endAngle)){const o=Math.hypot(n,i);let l=0;return o<a.innerRadius?l=a.innerRadius-o:o>a.outerRadius&&(l=o-a.outerRadius),{datum:a.datum,distance:l}}}var HF=class extends Cd{constructor(t,e,i,n,s){super(t,e,i,n,s),this.angleKey=n.properties.angleKey,this.radiusKey=n.properties.radiusKey,this.calloutLabelKey=n.properties.calloutLabelKey,this.sectorLabelKey=n.properties.sectorLabelKey}},lg=class extends By{constructor(t){super({moduleCtx:t,categoryKey:void 0,propertyKeys:{...GD,sectorLabel:["sectorLabelKey"],calloutLabel:["calloutLabelKey"]},propertyNames:{...jD,sectorLabel:["sectorLabelName"],calloutLabel:["calloutLabelName"]},pickModes:[1,0],animationResetFns:{item:GF,label:Pa}}),this.properties=new be,this.phantomNodeData=void 0,this.backgroundGroup=new $t({name:`${this.id}-background`,zIndex:0}),this.noVisibleData=!1,this.previousRadiusScale=new Ma,this.radiusScale=new Ma,this.phantomGroup=this.contentGroup.appendChild(new ne({name:"phantom",zIndex:-1})),this.phantomSelection=St.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.phantomHighlightGroup=this.highlightGroup.appendChild(new ne({name:"phantom",zIndex:-1})),this.phantomHighlightSelection=St.select(this.phantomHighlightGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new ne({name:"pieCalloutLabels"})),this.calloutLabelSelection=St.select(this.calloutLabelGroup,ne),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new ne({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new Lt({shape:"circle"})),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new Lt({shape:"circle"})),this.innerLabelsGroup=this.contentGroup.appendChild(new ne({name:"innerLabels"})),this.innerCircleGroup=this.backgroundGroup.appendChild(new ne({name:`${this.id}-innerCircle`})),this.innerLabelsSelection=St.select(this.innerLabelsGroup,_i),this.innerCircleSelection=St.select(this.innerCircleGroup,()=>new Lt({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=HF,this.angleScale=new Ma,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2),this.phantomGroup.opacity=.2,this.phantomHighlightGroup.opacity=.2,this.innerLabelsGroup.pointerEvents=1}get calloutNodeData(){return this.phantomNodeData??this.nodeData}attachSeries(t,e,i){super.attachSeries(t,e,i),t?.appendChild(this.backgroundGroup)}detachSeries(t,e,i){super.detachSeries(t,e,i),this.backgroundGroup.remove()}setZIndex(t){super.setZIndex(t),this.backgroundGroup.zIndex=[0,t]}nodeFactory(){const t=new ei;return t.miterLimit=1e9,t}getSeriesDomain(t){return t==="angle"?{domain:this.angleScale.domain}:{domain:this.radiusScale.domain}}async processData(t){if(this.data==null)return;const{visible:e,id:i,ctx:{legendManager:n}}=this,{angleKey:s,angleFilterKey:r,radiusKey:a,calloutLabelKey:o,sectorLabelKey:l,legendItemKey:c}=this.properties,h=()=>(y,b)=>e&&(n?.getItemEnabled({seriesId:i,itemId:b})??!0)?y:0,u=!this.ctx.animationManager.isSkipped(),d=this.properties.allowNullKeys??!1,g=[],p=[];c?g.push(Ar(c,"category",{id:"legendItemKey",allowNullKey:d})):o?g.push(Ar(o,"category",{id:"calloutLabelKey",allowNullKey:d})):l&&g.push(Ar(l,"category",{id:"sectorLabelKey",allowNullKey:d}));const f=this.radiusScale.type,m=this.angleScale.type;a&&p.push(HO(a,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,missingValue:this.properties.radiusMax??1,processor:h}),Xe(a,f,{id:"radiusRaw",processor:h}),Im("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),o&&p.push(Xe(o,"category",{id:"calloutLabelValue",allowNullKey:d})),l&&p.push(Xe(l,"category",{id:"sectorLabelValue",allowNullKey:d})),c&&p.push(Xe(c,"category",{id:"legendItemValue",allowNullKey:d})),r&&p.push(Mm(r,m,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:h}),Xe(r,m,{id:"angleFilterRaw"}),Im("angleFilterValue",[0,1],0,0)),u&&this.processedData?.reduced?.animationValidation?.uniqueKeys&&g.length>0&&p.push(Sd(this.id,this.processedData)),p.push(zc()),await this.requestDataModel(t,this.data,{props:[...g,Mm(s,m,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:h}),Xe(s,m,{id:"angleRaw"}),Im("angleValue",[0,1],0,0),...p]});for(const y of this.processedData?.defs?.values??[]){const{id:b,missing:v,property:S}=y,M=AM(this,v);b!=="angleRaw"&&M>0&&j.warnOnce(`no value was found for the key '${String(S)}' on ${M} data element${M>1?"s":""}`)}this.animationState.transition("updateData")}maybeRefreshNodeData(){if(!this.nodeDataRefresh)return;const{nodeData:t=[],phantomNodeData:e}=this.createNodeData()??{};this.nodeData=t,this.phantomNodeData=e,t.length>0&&js.record(`${this.type}:nodeData`,t.length),this.nodeDataRefresh=!1}getProcessedDataValues(t,e){const i=t.resolveColumnById(this,"angleValue",e),n=t.resolveColumnById(this,"angleRaw",e),s=this.properties.angleFilterKey==null?void 0:t.resolveColumnById(this,"angleFilterValue",e),r=this.properties.angleFilterKey==null?void 0:t.resolveColumnById(this,"angleFilterRaw",e),a=this.properties.radiusKey?t.resolveColumnById(this,"radiusValue",e):void 0,o=this.properties.radiusKey?t.resolveColumnById(this,"radiusRaw",e):void 0,l=this.properties.calloutLabelKey?t.resolveColumnById(this,"calloutLabelValue",e):void 0,c=this.properties.sectorLabelKey?t.resolveColumnById(this,"sectorLabelValue",e):void 0,h=this.properties.legendItemKey?t.resolveColumnById(this,"legendItemValue",e):void 0;return{angleValues:i,angleRawValues:n,angleFilterValues:s,angleFilterRawValues:r,radiusValues:a,radiusRawValues:o,calloutLabelValues:l,sectorLabelValues:c,legendItemValues:h}}createNodeData(){const{id:t,processedData:e,dataModel:i,angleScale:n,ctx:{legendManager:s},visible:r}=this,{rotation:a,innerRadiusRatio:o}=this.properties;if(!i||e?.type!=="ungrouped")return;const l=this.getProcessedDataValues(i,e),{angleValues:c,angleRawValues:h,angleFilterValues:u,angleFilterRawValues:d,radiusValues:g,radiusRawValues:p,legendItemValues:f}=l,m=d?.some((D,A)=>D>h[A])??!1;let y=0,b=0;const v=[],S=d==null?void 0:[],M=e.dataSources.get(this.id)?.data??[],C=e.invalidData?.get(this.id);for(const[D,A]of M.entries()){if(C?.[D]===!0)continue;const w=m?u[D]:c[D],L=d!=null&&!m?Math.sqrt(d[D]/h[D]):1,O=n.convert(y)+Zt(a);y=w,b+=w;const R=n.convert(y)+Zt(a),_=Math.abs(R-O),E=O+_/2,F=h[D],K=(g?.[D]??1)*L,G=p?.[D],ie=f?.[D],de=this.getLabels(D,A,E,_,l),ae=this.getItemStyle({datum:A,datumIndex:D},!1),oe={series:this,datum:A,datumIndex:D,angleValue:F,midAngle:E,midCos:Math.cos(E),midSin:Math.sin(E),startAngle:O,endAngle:R,radius:K,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(K),0),sectorFormat:ae,radiusValue:G,legendItemValue:ie,enabled:r&&(s?.getItemEnabled({seriesId:t,itemId:D})??!0),focusable:!0,...de};v.push(oe),S?.push({...oe,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0),focusable:!1})}return this.zerosumOuterRing.visible=b===0,this.zerosumInnerRing.visible=b===0&&o!=null&&o!==1&&o>0,{itemId:t,nodeData:v,labelData:v,phantomNodeData:S}}getLabelContent(t,e,i){const{id:n,ctx:s,properties:r}=this,{formatManager:a}=s,{calloutLabel:o,sectorLabel:l,calloutLabelKey:c,sectorLabelKey:h,legendItemKey:u}=r,d=r.allowNullKeys??!1,g=i.calloutLabelValues?.[t],p=i.sectorLabelValues?.[t],f=i.legendItemValues?.[t],m={datum:e,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},y={callout:void 0,sector:void 0,legendItem:void 0};if(c&&(y.callout=this.getLabelText(g,e,c,"calloutLabel",[],o,{...m,value:g},d)),h&&(y.sector=this.getLabelText(p,e,h,"sectorLabel",[],l,{...m,value:p},d)),u!=null&&(f!=null||d)){const b=f??"";y.legendItem=a.format(this.callWithContext.bind(this),{type:"category",value:d?f:b,datum:e,seriesId:n,legendItemName:void 0,key:u,source:"legend-label",property:"legendItem",domain:[],boundSeries:this.getFormatterContext("legendItem")})??b}return y}getLabels(t,e,i,n,s){const{properties:r}=this,{calloutLabel:a,sectorLabel:o,legendItemKey:l}=r,c=this.getLabelContent(t,e,s),h={};return a.enabled&&c.callout&&n>=Zt(a.minAngle)&&(h.calloutLabel={...this.getTextAlignment(i),text:c.callout,hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),o.enabled&&c.sector&&(h.sectorLabel={text:c.sector}),l&&c.legendItem&&(h.legendItem={key:l,text:c.legendItem}),h}getTextAlignment(t){const e=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"top"},{textAlign:"right",textBaseline:"middle"}],i=Iu(t),n=-.75*Math.PI,s=i-n,r=Math.floor(s/(Math.PI/2)),a=ov(r,e.length);return e[a]}getFillParams(t,e,i){if(!(!qi(t)||t.bounds==="item"))return{centerX:0,centerY:0,innerRadius:e,outerRadius:i}}getItemStyle({datum:t,datumIndex:e},i,n,s){const{fills:r,strokes:a,itemStyler:o}=this.properties,l=this.getHighlightStyle(i,e,n,s),c=this.getSelectionStyle(e),h={fill:r[e],stroke:a[e]},{fill:u,fillOpacity:d,stroke:g,strokeWidth:p,strokeOpacity:f,lineDash:m,lineDashOffset:y,cornerRadius:b,opacity:v}=ge(c,l,h,this.properties);let S;return o&&(S=this.cachedDatumCallback(this.getDatumId(e)+(i?"-highlight":"-hide"),()=>{const M=this.makeItemStylerParams(t,e,i,{fill:u,fillOpacity:d,stroke:g,strokeWidth:p,strokeOpacity:f,lineDash:m,lineDashOffset:y,cornerRadius:b});return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(o,M),{proxyPaths:{fill:["fills",`${e}`],stroke:["strokes",`${e}`]}})})),{fill:S?.fill??u,fillOpacity:S?.fillOpacity??d,stroke:S?.stroke??g,strokeWidth:S?.strokeWidth??p,strokeOpacity:S?.strokeOpacity??f,lineDash:S?.lineDash??m,lineDashOffset:S?.lineDashOffset??y,cornerRadius:S?.cornerRadius??b,opacity:v}}makeItemStylerParams(t,e,i,n){const{angleKey:s,radiusKey:r,calloutLabelKey:a,sectorLabelKey:o,legendItemKey:l}=this.properties,c=this.filterItemStylerFillParams(n.fill)??n.fill;return{datum:t,angleKey:s,radiusKey:r,calloutLabelKey:a,sectorLabelKey:o,legendItemKey:l,...n,fill:c,highlightState:this.getHighlightStateString(this.ctx.highlightManager?.getActiveHighlight(),i,e),selectionState:this.getSelectionStateString(e),seriesId:this.id}}getCalloutLineStyle(t,e){const{properties:i}=this;let n={};if(i.calloutLine.itemStyler){const s=this.getHighlightStateString(this.ctx.highlightManager?.getActiveHighlight(),e,t.datumIndex),r=this.getSelectionStateString(t.datumIndex),a={angleKey:i.angleKey,angleName:i.angleName??i.angleKey,calloutLabelKey:i.calloutLabelKey,calloutLabelName:i.calloutLabelName??i.calloutLabelKey,datum:t.datum,highlightState:s,selectionState:r,legendItemKey:i.legendItemKey,radiusKey:i.radiusKey,radiusName:i.radiusName??i.radiusKey,sectorLabelKey:i.sectorLabelKey,sectorLabelName:i.sectorLabelName??i.sectorLabelKey,seriesId:this.id};n=this.cachedCallWithContext(i.calloutLine.itemStyler,a)??{}}return{length:n.length??i.calloutLine.length,strokeWidth:n.strokeWidth??i.calloutLine.strokeWidth,color:n.color,colors:i.calloutLine.colors}}getInnerRadius(){const{radius:t}=this,{innerRadiusRatio:e=1,innerRadiusOffset:i=0}=this.properties,n=t*e+i;return n===t||n<0?0:n}getOuterRadius(){const{outerRadiusRatio:t,outerRadiusOffset:e}=this.properties;return Math.max(this.radius*t+e,0)}updateRadiusScale(t){const e=[this.getInnerRadius(),this.getOuterRadius()];this.radiusScale.range=e,t&&(this.previousRadiusScale.range=e);const i=n=>({...n,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(n.radius),0)});this.nodeData=this.nodeData.map(i),this.phantomNodeData=this.phantomNodeData?.map(i)}getTitleTranslationY(){const t=Math.max(0,this.radiusScale.range[1]);if(t===0)return Number.NaN;const i=2+(this.properties.title?.spacing??0),n=Math.max(0,-t);return-t-i-n}update({seriesRect:t}){const{title:e}=this.properties,i={seriesRectWidth:t?.width,seriesRectHeight:t?.height},n=es(this.nodeDataDependencies,i)!=null;if(n&&(this._nodeDataDependencies=i),this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(n),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),e){const s=this.getTitleTranslationY();e.node.y=Number.isFinite(s)?s:0;const r=e.node.getBBox();e.node.visible=e.enabled&&Number.isFinite(s)&&!this.bboxIntersectsSurroundingSeries(r)}for(const s of[this.zerosumInnerRing,this.zerosumOuterRing])s.fillOpacity=0,s.stroke=this.properties.calloutLabel.color,s.strokeWidth=1,s.strokeOpacity=1;this.updateNodeMidPoint(),this.updateSelections(),this.updateNodes(t)}updateTitleNodes(){const{oldTitle:t}=this,{title:e}=this.properties;t!==e&&(t&&t.node.remove(),e&&(e.node.textBaseline="bottom",this.labelGroup?.appendChild(e.node)),this.oldTitle=e)}updateNodeMidPoint(){const t=e=>{const i=e.innerRadius+(e.outerRadius-e.innerRadius)/2;e.midPoint={x:e.midCos*Math.max(0,i),y:e.midSin*Math.max(0,i)}};for(const e of this.nodeData)t(e);if(this.phantomNodeData)for(const e of this.phantomNodeData)t(e)}updateSelections(){this.updateGroupSelection(),this.updateInnerCircleSelection()}updateGroupSelection(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,phantomHighlightSelection:n,calloutLabelSelection:s,labelSelection:r,highlightLabelSelection:a,innerLabelsSelection:o}=this,l=this.nodeData.map(u=>({...u,sectorFormat:{...u.sectorFormat}})),c=this.phantomNodeData?.map(u=>({...u,sectorFormat:{...u.sectorFormat}})),h=(u,d)=>{u.update(d,void 0,g=>this.getDatumId(g.datumIndex)),this.ctx.animationManager.isSkipped()&&u.cleanup()};h(t,this.nodeData),h(e,l),h(i,this.phantomNodeData??[]),h(n,c??[]),s.update(this.calloutNodeData,u=>{const d=new en;d.tag=0,d.pointerEvents=1,u.appendChild(d);const g=new _i;g.tag=1,g.pointerEvents=1,u.appendChild(g)}),r.update(this.nodeData),a.update(l),o.update(this.properties.innerLabels,u=>{u.pointerEvents=1})}updateInnerCircleSelection(){const{innerCircle:t}=this.properties;let e=0;const i=this.getInnerRadius();if(i>0){const s=Math.min(i,this.getOuterRadius()),r=1;e=Math.ceil(s*2+r)}const n=t?[{radius:e}]:[];this.innerCircleSelection.update(n)}updateNodes(t){const e=this.ctx.highlightManager.getActiveHighlight(),{visible:i,dataModel:n,processedData:s}=this;if(this.backgroundGroup.visible=i,this.contentGroup.visible=i,!n||!s)return;const{legendItemValues:r}=this.getProcessedDataValues(n,s),a=this.isSeriesHighlighted(e,r),o=this.ctx.chartService.highlight?.drawingMode??"overlay";this.highlightGroup.visible=i&&a,this.labelGroup.visible=i,this.innerCircleSelection.each((g,{radius:p})=>{g.setProperties({fill:this.properties.innerCircle?.fill,opacity:this.properties.innerCircle?.fillOpacity,size:p})});const l=this.radiusScale.range[0],c=this.radiusScale.range[1],h=this.getShapeFillBBox(),u=this.ctx.animationManager.isSkipped(),d=(g,p,f,m,y)=>{const b=this.getItemStyle(p,m,void 0,r);p.sectorFormat.fill=b.fill,p.sectorFormat.stroke=b.stroke,u&&(g.startAngle=p.startAngle,g.endAngle=p.endAngle,g.innerRadius=p.innerRadius,g.outerRadius=p.outerRadius),(m||u)&&(g.fill=b.fill,g.stroke=b.stroke);const v=this.getFillParams(b.fill,l,c);g.setStyleProperties(b,h,v),g.drawingMode=y,g.cornerRadius=b.cornerRadius,g.fillShadow=this.properties.shadow;const S=Math.max((this.properties.sectorSpacing+(b.stroke==null?0:b.strokeWidth))/2,0);g.inset=S,g.lineJoin=this.properties.sectorSpacing>=0||S>0?"miter":"round";const M=this.data?.selections?.get(this.id)?.isSelected(p.datumIndex)??!1,C=this.properties.selection.selectedOffset;if(M&&C>0){const D=(g.endAngle+g.startAngle)/2;g.centerX=C*Math.cos(D),g.centerY=C*Math.sin(D)}else g.centerX=0,g.centerY=0};this.itemSelection.each((g,p,f)=>d(g,p,f,!1,"overlay")),this.phantomSelection.each((g,p,f)=>d(g,p,f,!1,"overlay")),this.highlightSelection.each((g,p,f)=>{d(g,p,f,!0,o),g.visible=p.datumIndex===e?.datumIndex}),this.phantomHighlightSelection.each((g,p,f)=>{d(g,p,f,!0,o),g.visible=p.datumIndex===e?.datumIndex}),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(t),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{strokes:t}=this.properties,{offset:e}=this.properties.calloutLabel,i=this.ctx.highlightManager?.getActiveHighlight(),n=this.isSeriesHighlighted(i);for(const s of this.calloutLabelSelection.selectByTag(0)){const r=s.unsafeClosestDatum(),a=n&&this.isItemHighlighted(i,r.datumIndex)===!0,{length:o,strokeWidth:l,color:c,colors:h}=this.getCalloutLineStyle(r,!1),u=l,d=x0(h)?h:t,{calloutLabel:g,outerRadius:p,datumIndex:f}=r;if(g?.text&&!g.hidden&&p!==0){s.visible=!0,s.strokeWidth=u,s.stroke=c??d[f%d.length],s.strokeOpacity=this.getHighlightStyle(a,r.datumIndex).opacity??1,s.fill=void 0;const m=r.midCos*p,y=r.midSin*p;let b=r.midCos*(p+o),v=r.midSin*(p+o);if((g.collisionTextAlign??g.collisionOffsetY!==0)&&g.box!=null){const M=g.box;let C=b,D=v;b<M.x?C=M.x:b>M.x+M.width&&(C=M.x+M.width),v<M.y?D=M.y:v>M.y+M.height&&(D=M.y+M.height);const A=C-b,w=D-v,L=Math.sqrt(Math.pow(A,2)+Math.pow(w,2)),O=L-e;O>0&&(b=b+A*O/L,v=v+w*O/L)}s.x1=m,s.y1=y,s.x2=b,s.y2=v}else s.visible=!1}}getLabelOverflow(t,e){const i=-this.centerX,n=i+e.width,s=-this.centerY,r=s+e.height,a=1;let o=t.width;t.x+a<i?o=(t.x+t.width-i)/t.width:t.x+t.width-a>n&&(o=(n-t.x)/t.width);const l=t.y+a<s||t.y+t.height-a>r,c=this.bboxIntersectsSurroundingSeries(t);return{maxWidth:o,hasVerticalOverflow:l,hasSurroundingSeriesOverflow:c}}bboxIntersectsSurroundingSeries(t){const{surroundingRadius:e}=this;if(e==null)return!1;const i=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],n=e**2;return i.some(s=>s.x**2+s.y**2>n)}computeCalloutLabelCollisionOffsets(){const{radiusScale:t}=this,{calloutLabel:e}=this.properties,{offset:i,minSpacing:n}=e,s=t.convert(0),r=m=>!m.calloutLabel||m.outerRadius===0,a=this.calloutNodeData,o=a.filter(m=>!r(m));for(const m of o){const y=m.calloutLabel;y!=null&&(y.hidden=!1,y.collisionTextAlign=void 0,y.collisionOffsetY=0)}if(o.length<=1)return;const l=o.filter(m=>m.midCos<0).sort((m,y)=>m.midSin-y.midSin),c=o.filter(m=>m.midCos>=0).sort((m,y)=>m.midSin-y.midSin),h=o.filter(m=>m.midSin<0&&m.calloutLabel?.textAlign==="center").sort((m,y)=>m.midCos-y.midCos),u=o.filter(m=>m.midSin>=0&&m.calloutLabel?.textAlign==="center").sort((m,y)=>m.midCos-y.midCos),d=m=>{const y=m.calloutLabel;if(y==null)return U.zero.clone();const b=this.getLabelStyle(m,e,"calloutLabel"),v=jo(b),S=this.getCalloutLineStyle(m,!1).length,M=m.outerRadius+S+i,C=m.midCos*M,D=m.midSin*M+y.collisionOffsetY,A=y.collisionTextAlign??y.textAlign,w=y.textBaseline;return _i.measureBBox(y.text,C,D,{font:this.properties.calloutLabel,textAlign:A,textBaseline:w}).grow(v)},g=(m,y,b)=>{const v=d(m).grow(n/2),S=d(y).grow(n/2);v.x<S.x+S.width&&v.x+v.width>S.x&&(b==="to-top"?v.y<S.y+S.height:v.y+v.height>S.y)&&(y.calloutLabel.collisionOffsetY=b==="to-top"?v.y-S.y-S.height:v.y+v.height-S.y)},p=m=>{const y=m.slice().sort((v,S)=>Math.abs(v.midSin)-Math.abs(S.midSin))[0],b=m.indexOf(y);for(let v=b-1;v>=0;v--){const S=m[v+1],M=m[v];g(S,M,"to-top")}for(let v=b+1;v<m.length;v++){const S=m[v-1],M=m[v];g(S,M,"to-bottom")}},f=m=>{const y=o.some(D=>D.calloutLabel.collisionOffsetY!==0),b=m.map(D=>d(D)),v=b.map(D=>D.clone().grow(n/2));let S=!1;for(let D=0;D<v.length&&!S;D++){const A=v[D];for(let w=D+1;w<m.length;w++){const L=v[w];if(A.collidesBBox(L)){S=!0;break}}}const M=a.map(D=>{const{startAngle:A,endAngle:w,outerRadius:L}=D;return{startAngle:A,endAngle:w,innerRadius:s,outerRadius:L}}),C=b.some(D=>M.some(A=>BF(D,A)));if(!(!S&&!y&&!C))for(const D of m){if(D.calloutLabel.textAlign!=="center")continue;const A=D.calloutLabel;D.midCos<0?A.collisionTextAlign="right":D.midCos>0?A.collisionTextAlign="left":A.collisionTextAlign="center"}};p(l),p(c),f(h),f(u)}getLabelStyle(t,e,i,n=!1){const s=this.ctx.highlightManager?.getActiveHighlight();return Ra(this,t,this.properties,e,n,s,["series",`${this.declarationOrder}`,i])}updateCalloutLabelNodes(t){const{radiusScale:e}=this,{calloutLabel:i}=this.properties,n=new _i,s=this.ctx.highlightManager?.getActiveHighlight(),r=this.isSeriesHighlighted(s);for(const a of this.calloutLabelSelection.selectByTag(1)){const o=a.unsafeClosestDatum(),l=o.calloutLabel,c=e.convert(o.radius),h=Math.max(0,c);if(!l?.text||h===0||l.hidden){a.visible=!1;continue}const u=r&&this.isItemHighlighted(s,o.datumIndex)===!0,d=this.getLabelStyle(o,i,"calloutLabel",u),g=this.getCalloutLineStyle(o,!1).length,p=h+g+i.offset,f=o.midCos*p,m=o.midSin*p+l.collisionOffsetY,y={textAlign:l.collisionTextAlign??l.textAlign,textBaseline:l.textBaseline};n.text=l.text,n.x=f,n.y=m,n.setFont(d),n.setAlign(y),n.setBoxing(d);const b=n.getBBox();let v=l.text,S=!0;if(i.avoidCollisions){const{maxWidth:M,hasVerticalOverflow:C}=this.getLabelOverflow(b,t);if(b.width>M){const D={font:this.properties.calloutLabel,textWrap:"on-space",overflow:"hide",maxWidth:M};v=Pu(l.text,D)}S=!C}a.text=v,a.x=f,a.y=m,a.setFont(d),a.setAlign(y),a.setBoxing(d),a.fill=d.color,a.fillOpacity=this.getHighlightStyle(u,o.datumIndex).opacity??1,a.visible=S}}computeLabelsBBox(t,e){const{calloutLabel:i}=this.properties,{offset:n,maxCollisionOffset:s,minSpacing:r}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const a=[],o=new _i;let l;const{title:c}=this.properties;if(c?.text&&c.enabled){const h=this.getTitleTranslationY();Number.isFinite(h)&&(o.text=c.text,o.x=0,o.y=h,o.setFont(c),o.setAlign({textBaseline:"bottom",textAlign:"center"}),l=o.getBBox(),a.push(l))}for(const h of this.calloutNodeData){const u=h.calloutLabel;if(!u||h.outerRadius===0)continue;const d=this.getLabelStyle(h,i,"calloutLabel"),g=this.getCalloutLineStyle(h,!1).length,p=h.outerRadius+g+n,f=h.midCos*p,m=h.midSin*p+u.collisionOffsetY;o.text=u.text,o.x=f,o.y=m,o.setFont(d),o.setAlign({textAlign:u.collisionTextAlign??u.textAlign,textBaseline:u.textBaseline}),o.setBoxing(d);const y=o.getBBox();if(u.box=y,Math.abs(u.collisionOffsetY)>s){u.hidden=!0;continue}if(l){const b=-this.centerY,v=new U(l.x-r,b,l.width+2*r,l.y+l.height+r-b);if(y.collidesBBox(v)){u.hidden=!0;continue}}if(t.hideWhenNecessary){const{maxWidth:b,hasVerticalOverflow:v,hasSurroundingSeriesOverflow:S}=this.getLabelOverflow(y,e),M=y.width>b;if(v||M||S){u.hidden=!0;continue}}u.hidden=!1,a.push(y)}return a.length===0?null:U.merge(a)}updateSectorLabelNodes(){const{properties:t}=this,{positionOffset:e,positionRatio:i}=this.properties.sectorLabel,n=this.ctx.highlightManager?.getActiveHighlight(),s=this.isSeriesHighlighted(n),r=this.radiusScale.convert(0),a=r<=0&&this.ctx.legendManager?.getData(this.id)?.filter(c=>c.enabled).length===1,o={textAlign:"center",textBaseline:"middle"},l=c=>c.each((h,u)=>{const{outerRadius:d,startAngle:g,endAngle:p}=u,f=s&&this.isItemHighlighted(n,u.datumIndex)===!0;let m=!1;if(u.sectorLabel&&d!==0){const y=this.getLabelStyle(u,t.sectorLabel,"sectorLabel",f),b=r*(1-i)+d*i+e;h.fill=y.color,h.fillOpacity=this.getHighlightStyle(f,u.datumIndex).opacity??1,h.text=u.sectorLabel.text,a?(h.x=0,h.y=0):(h.x=u.midCos*b,h.y=u.midSin*b),h.setFont(y),h.setAlign(o),h.setBoxing(y);const v=h.getBBox(),S=[[v.x,v.y],[v.x+v.width,v.y],[v.x+v.width,v.y+v.height],[v.x,v.y+v.height]],M={startAngle:g,endAngle:p,innerRadius:r,outerRadius:d};S.every(([C,D])=>Gy(C,D,M))&&(m=!0)}h.visible=m});l(this.labelSelection),l(this.highlightLabelSelection)}updateInnerLabelNodes(){const t=[],e=[];this.innerLabelsSelection.each((h,u)=>{const{fontStyle:d,fontWeight:g,fontSize:p,fontFamily:f,color:m}=u;h.fontStyle=d,h.fontWeight=g,h.fontSize=p,h.fontFamily=f,h.text=u.text,h.x=0,h.y=0,h.fill=m,h.textAlign="center",t.push(h.getBBox()),e.push(u.spacing)});const i=h=>h===0?0:e[h],n=h=>h===e.length-1?0:e[h],s=t.reduce((h,u)=>Math.max(h,u.width),0),r=t.reduce((h,u,d)=>h+u.height+i(d)+n(d),0),a=this.getInnerRadius(),l=Math.sqrt(Math.pow(s/2,2)+Math.pow(r/2,2))<=(a>0?a:this.getOuterRadius()),c=[];for(let h=0,u=-r/2;h<t.length;h++){const g=t[h].height+u+i(h);c.push(g),u=g+n(h)}this.innerLabelsSelection.each((h,u,d)=>{h.visible=l,Array.isArray(h.text)?h.y=c[d]-t[d].height:h.y=c[d]})}updateZerosumRings(){this.zerosumOuterRing.size=this.getOuterRadius()*2,this.zerosumInnerRing.size=this.getInnerRadius()*2}pickNodeClosestDatum(t){return jF(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:n,properties:s,ctx:{formatManager:r}}=this,{legendItemKey:a,calloutLabelKey:o,calloutLabelName:l,sectorLabelKey:c,sectorLabelName:h,angleKey:u,angleName:d,radiusKey:g,radiusName:p,tooltip:f}=s,m=this.properties.title.node.getPlainText();if(!i||!n)return;const y=n.dataSources.get(this.id)?.data?.[t],b=this.getProcessedDataValues(i,n),{angleRawValues:v}=b,S=v[t],M=this.getLabelContent(t,y,b),C=M.legendItem??M.callout??M.sector??d,D=Il(i.getDomain(this,"angleRaw","value",n)),A=r.format(this.callWithContext.bind(this),{type:"number",value:S,datum:y,seriesId:e,legendItemName:void 0,key:u,source:"tooltip",property:"angle",domain:D,boundSeries:this.getFormatterContext("angle"),fractionDigits:void 0,visibleDomain:void 0})??Qr(S,3);return this.formatTooltipWithContext(f,{title:m,symbol:this.legendItemSymbol(t),data:[{label:Ue(C),fallbackLabel:u,value:A}]},{seriesId:e,datum:y,title:d,legendItemKey:a,calloutLabelKey:o,calloutLabelName:l,sectorLabelKey:c,sectorLabelName:h,angleKey:u,angleName:d,radiusKey:g,radiusName:p,...this.getItemStyle({datum:y,datumIndex:t},!1)})}legendItemSymbol(t){const e=this.processedData?.dataSources.get(this.id)?.data?.[t],i=this.getItemStyle({datum:e,datumIndex:t},!1),{fillOpacity:n,strokeOpacity:s,strokeWidth:r,lineDash:a,lineDashOffset:o}=this.properties;let{fill:l}=i;const{stroke:c}=i;return qi(l)&&(l={...l,gradient:"linear",rotation:0,reverse:!1}),{marker:{fill:l,stroke:c,fillOpacity:n,strokeOpacity:s,strokeWidth:r,lineDash:a,lineDashOffset:o}}}getLegendData(t){const{visible:e,processedData:i,dataModel:n,id:s,ctx:{legendManager:r}}=this;if(!n||!i||t!=="category")return[];const{angleKey:a,calloutLabelKey:o,sectorLabelKey:l,legendItemKey:c,showInLegend:h}=this.properties;if(!c&&(!o||o===a)&&(!l||l===a))return[];const u=this.getProcessedDataValues(n,i),{angleRawValues:d}=u,g=this.properties.title?.showInLegend&&this.properties.title.text,p=[],f=this.properties.hideZeroValueSectorsInLegend,m=i.dataSources.get(this.id)?.data,y=i.invalidData?.get(this.id);for(let b=0;b<i.input.count;b++){const v=m?.[b],S=d[b];if(y?.[b]===!0||f&&S===0)continue;const M=[];g&&M.push(g);const C=this.getLabelContent(b,v,u);c&&C.legendItem!==void 0?M.push(C.legendItem):o&&o!==a&&C.callout!==void 0?M.push(C.callout):l&&l!==a&&C.sector!==void 0&&M.push(C.sector),M.length!==0&&p.push({legendType:"category",id:s,datum:v,itemId:b,seriesId:s,hideToggleOtherSeries:!0,enabled:e&&(r?.getItemEnabled({seriesId:s,itemId:b})??!0),label:{text:M.map(D=>Ue(D)).join(" - ")},symbol:this.legendItemSymbol(b),legendItemName:c==null?void 0:v[c],hideInLegend:!h})}return p}setLegendState(t){const{id:e,ctx:{legendManager:i,eventsHub:n}}=this;for(const[s,r]of t.entries())i?.toggleItem(r,e,s);n.emit("chart:request-update",{type:7})}animateEmptyUpdateReady(t){const{animationManager:e}=this.ctx,i=Wy(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);Mt(this.id,"nodes",e,[this.itemSelection,this.highlightSelection,this.phantomSelection,this.phantomHighlightSelection],i.nodes,n=>this.getDatumId(n.unsafeDatum.datumIndex)),Mt(this.id,"innerCircle",e,[this.innerCircleSelection],i.innerCircle),gt(this,"callout",e,this.calloutLabelSelection),gt(this,"sector",e,this.labelSelection,this.highlightLabelSelection),gt(this,"inner",e,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,phantomHighlightSelection:n,processedData:s,radiusScale:r,previousRadiusScale:a}=this,{animationManager:o}=this.ctx,l=s?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const c=(l?.moved.size??0)===0,h=(s?.defs.keys.length??0)>0,u=s?.reduced?.animationValidation?.uniqueKeys??!0;(!c||!h||!u)&&this.ctx.animationManager.skipCurrentBatch();const d=!this.nodeData.some(p=>p.enabled),g=Wy(!1,this.properties.rotation,r,a);Mt(this.id,"nodes",o,[t,e,i,n],g.nodes,p=>this.getDatumId(p.unsafeDatum.datumIndex),l),Mt(this.id,"innerCircle",o,[this.innerCircleSelection],g.innerCircle),gt(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),gt(this,"sector",this.ctx.animationManager,this.labelSelection,this.highlightLabelSelection),this.noVisibleData!==d&&(this.noVisibleData=d,gt(this,"inner",this.ctx.animationManager,this.innerLabelsSelection)),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,phantomHighlightSelection:n,radiusScale:s,previousRadiusScale:r}=this,{animationManager:a}=this.ctx,o=Wy(!1,this.properties.rotation,s,r);Mt(this.id,"nodes",a,[t,e,i,n],o.nodes,l=>this.getDatumId(l.unsafeDatum.datumIndex)),Mt(this.id,"innerCircle",a,[this.innerCircleSelection],o.innerCircle),jd(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),jd(this,"sector",this.ctx.animationManager,this.labelSelection,this.highlightLabelSelection),jd(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(t){const{dataModel:e,processedData:i}=this;if(!e||!i)return`${t}`;const{calloutLabelKey:n,sectorLabelKey:s,legendItemKey:r}=this.properties;if(!i.reduced?.animationValidation?.uniqueKeys)return`${t}`;if(r){const a=e.resolveKeysById(this,"legendItemKey",i);return Jt(a[t])}else if(n){const a=e.resolveKeysById(this,"calloutLabelKey",i);return Jt(a[t])}else if(s){const a=e.resolveKeysById(this,"sectorLabelKey",i);return Jt(a[t])}return`${t}`}hasItemStylers(){return!(!this.properties.selection.enabled&&this.properties.itemStyler==null&&this.properties.calloutLabel.itemStyler==null&&this.properties.sectorLabel.itemStyler==null&&this.properties.innerLabels.every(t=>t.itemStyler==null))}};lg.className="DonutSeries",lg.type="donut";var ZD=lt(je,je),Ky={...Yg(je)};Ky.selectedOffset=J(P);var Yy={...Se,radiusMin:k,radiusMax:k,rotation:P,outerRadiusOffset:P,outerRadiusRatio:q,hideZeroValueSectorsInLegend:T,sectorSpacing:k,cornerRadius:k,itemStyler:De({...$,...B,...W,cornerRadius:k}),title:{enabled:T,text:N,showInLegend:T,spacing:k,...Ce},calloutLabel:{enabled:T,offset:P,minAngle:k,avoidCollisions:T,formatter:ci(cn),format:N,itemStyler:De({enabled:T,...ln,...Ce}),...ln,...Ce},sectorLabel:{enabled:T,positionOffset:P,positionRatio:q,formatter:ci(cn),format:N,itemStyler:De({enabled:T,...ln,...Ce}),...ln,...Ce},calloutLine:{colors:Q(H),length:k,strokeWidth:k,itemStyler:De({color:H,length:k,strokeWidth:k})},fills:Q(Ni),strokes:Q(H),tooltip:Ae,shadow:qn,highlight:ZD,selection:Ky,...W,...Y($,["fill"]),...Y(B,["stroke"])},ls={...Yy,...wn,type:X(Ge("pie")),angleKey:X(N),radiusKey:N,calloutLabelKey:N,sectorLabelKey:N,legendItemKey:N,angleName:N,radiusName:N,calloutLabelName:N,sectorLabelName:N,highlight:ZD,selection:Ky};ls.angleFilterKey=J(N),ls.defaultColorRange=J(Q(Q(H))),ls.defaultPatternFills=J(Q(H)),ls.title._enabledFromTheme=J(T),ls.calloutLabel._enabledFromTheme=J(T),ls.sectorLabel._enabledFromTheme=J(T),ls.angleKeyAxis=J(N),ls.radiusKeyAxis=J(N);var XD={...Yy,innerRadiusOffset:P,innerRadiusRatio:q,innerCircle:{fill:N,fillOpacity:q},innerLabels:{spacing:k,...Ce,...ln}},qD={...XD,...ls,type:X(Ge("donut")),innerLabels:Pt({text:X(N),spacing:k,...Ce,...ln},"inner label options array")};qD.angleFilterKey=J(N);var Zy={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:sr.LARGE},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{...Jn,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{...Jn,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:{$applyCycle:[{$cacheMax:{$size:{$path:["./data",{$path:"/data"}]}}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",gx],["pattern",Ki],["image",vs]]}]},strokes:{$applyCycle:[{$cacheMax:{$size:{$path:["./data",{$path:"/data"}]}}},{$palette:"strokes"}]},fillOpacity:1,strokeOpacity:1,strokeWidth:{$isUserOption:["./strokes/0",2,0]},lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,shadow:{enabled:!1,color:Xr,xOffset:3,yOffset:3,blur:5},highlight:gp,selection:ar},legend:{enabled:!0}},$F={...Zy,series:{...Zy.series,innerRadiusRatio:{$if:[{$eq:[{$path:["./innerRadiusOffset",void 0]},void 0]},.7,void 0]},innerLabels:{$apply:{...Jn,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:2}},highlight:gp,selection:ar}},JD={type:"series",name:"donut",chartType:"polar",version:Ye,dependencies:[sg],options:qD,themeTemplate:$F,create:t=>new lg(t)},Xy=class extends lg{};Xy.className="PieSeries",Xy.type="pie";var QD={type:"series",name:"pie",chartType:"polar",version:Ye,dependencies:[sg],options:ls,themeTemplate:Zy,create:t=>new Xy(t)},eC=[sg,JD,QD,Ts,Xf,Jf],qy=[zD,eC,X0].flat();function tC(t,e,i,n){return{unit:t,step:e,epoch:i,utc:n,every(s){return tC(this.unit,(this.step??1)*s,this.epoch,this.utc)}}}var iC={};function Dt(t,e=1,i,n=!1){j.warnOnce("time import is deprecated, use object notation instead");const s=`${t}:${e}:${i?.getTime()??0}:${n}`;let r=iC[s];return r==null&&(r=tC(t,e,i,n),iC[s]=r),r}var UF={get millisecond(){return Dt("millisecond")},get second(){return Dt("second")},get minute(){return Dt("minute")},get hour(){return Dt("hour")},get day(){return Dt("day")},get monday(){return Dt("day",7,new Date(1970,0,5))},get tuesday(){return Dt("day",7,new Date(1970,0,6))},get wednesday(){return Dt("day",7,new Date(1970,0,7))},get thursday(){return Dt("day",7,new Date(1970,0,1))},get friday(){return Dt("day",7,new Date(1970,0,2))},get saturday(){return Dt("day",7,new Date(1970,0,3))},get sunday(){return Dt("day",7,new Date(1970,0,4))},get month(){return Dt("month")},get year(){return Dt("year")},get utcMillisecond(){return Dt("millisecond",1,void 0,!0)},get utcSecond(){return Dt("second",1,void 0,!0)},get utcMinute(){return Dt("minute",1,void 0,!0)},get utcHour(){return Dt("hour",1,void 0,!0)},get utcDay(){return Dt("day",1,void 0,!0)},get utcMonth(){return Dt("month",1,void 0,!0)},get utcYear(){return Dt("year",1,void 0,!0)}},Or=new Map([{type:"chart",name:"cartesian",moduleId:"CartesianChartModule"},{type:"chart",name:"standalone",moduleId:"StandaloneChartModule",enterprise:!0},{type:"chart",name:"polar",moduleId:"PolarChartModule"},{type:"chart",name:"topology",moduleId:"TopologyChartModule",enterprise:!0},{type:"axis",name:"number",chartType:"cartesian",moduleId:"NumberAxisModule"},{type:"axis",name:"log",chartType:"cartesian",moduleId:"LogAxisModule"},{type:"axis",name:"time",chartType:"cartesian",moduleId:"TimeAxisModule"},{type:"axis",name:"unit-time",chartType:"cartesian",moduleId:"UnitTimeAxisModule"},{type:"axis",name:"category",chartType:"cartesian",moduleId:"CategoryAxisModule"},{type:"axis",name:"grouped-category",chartType:"cartesian",moduleId:"GroupedCategoryAxisModule"},{type:"axis",name:"ordinal-time",chartType:"cartesian",enterprise:!0,moduleId:"OrdinalTimeAxisModule"},{type:"axis",name:"angle-category",chartType:"polar",enterprise:!0,moduleId:"AngleCategoryAxisModule"},{type:"axis",name:"angle-number",chartType:"polar",enterprise:!0,moduleId:"AngleNumberAxisModule"},{type:"axis",name:"radius-category",chartType:"polar",enterprise:!0,moduleId:"RadiusCategoryAxisModule"},{type:"axis",name:"radius-number",chartType:"polar",enterprise:!0,moduleId:"RadiusNumberAxisModule"},{type:"series",name:"bar",chartType:"cartesian",moduleId:"BarSeriesModule"},{type:"series",name:"scatter",chartType:"cartesian",moduleId:"ScatterSeriesModule"},{type:"series",name:"bubble",chartType:"cartesian",moduleId:"BubbleSeriesModule"},{type:"series",name:"line",chartType:"cartesian",moduleId:"LineSeriesModule"},{type:"series",name:"area",chartType:"cartesian",moduleId:"AreaSeriesModule"},{type:"series",name:"pie",chartType:"polar",moduleId:"PieSeriesModule"},{type:"series",name:"donut",chartType:"polar",moduleId:"DonutSeriesModule"},{type:"series",name:"box-plot",chartType:"cartesian",enterprise:!0,moduleId:"BoxPlotSeriesModule"},{type:"series",name:"candlestick",chartType:"cartesian",enterprise:!0,moduleId:"CandlestickSeriesModule"},{type:"series",name:"cone-funnel",chartType:"cartesian",enterprise:!0,moduleId:"ConeFunnelSeriesModule"},{type:"series",name:"funnel",chartType:"cartesian",enterprise:!0,moduleId:"FunnelSeriesModule"},{type:"series",name:"ohlc",chartType:"cartesian",enterprise:!0,moduleId:"OhlcSeriesModule"},{type:"series",name:"heatmap",chartType:"cartesian",enterprise:!0,moduleId:"HeatmapSeriesModule"},{type:"series",name:"histogram",chartType:"cartesian",moduleId:"HistogramSeriesModule"},{type:"series",name:"range-area",chartType:"cartesian",enterprise:!0,moduleId:"RangeAreaSeriesModule"},{type:"series",name:"range-bar",chartType:"cartesian",enterprise:!0,moduleId:"RangeBarSeriesModule"},{type:"series",name:"waterfall",chartType:"cartesian",enterprise:!0,moduleId:"WaterfallSeriesModule"},{type:"series",name:"nightingale",chartType:"polar",enterprise:!0,moduleId:"NightingaleSeriesModule"},{type:"series",name:"radar-area",chartType:"polar",enterprise:!0,moduleId:"RadarAreaSeriesModule"},{type:"series",name:"radar-line",chartType:"polar",enterprise:!0,moduleId:"RadarLineSeriesModule"},{type:"series",name:"radial-bar",chartType:"polar",enterprise:!0,moduleId:"RadialBarSeriesModule"},{type:"series",name:"radial-column",chartType:"polar",enterprise:!0,moduleId:"RadialColumnSeriesModule"},{type:"series",name:"map-shape",chartType:"topology",enterprise:!0,moduleId:"MapShapeSeriesModule"},{type:"series",name:"map-line",chartType:"topology",enterprise:!0,moduleId:"MapLineSeriesModule"},{type:"series",name:"map-marker",chartType:"topology",enterprise:!0,moduleId:"MapMarkerSeriesModule"},{type:"series",name:"map-shape-background",chartType:"topology",enterprise:!0,moduleId:"MapShapeBackgroundSeriesModule"},{type:"series",name:"map-line-background",chartType:"topology",enterprise:!0,moduleId:"MapLineBackgroundSeriesModule"},{type:"series",name:"pyramid",chartType:"standalone",enterprise:!0,moduleId:"PyramidSeriesModule"},{type:"series",name:"linear-gauge",chartType:"standalone",enterprise:!0,moduleId:"LinearGaugeModule"},{type:"series",name:"radial-gauge",chartType:"standalone",enterprise:!0,moduleId:"RadialGaugeModule"},{type:"series",name:"sunburst",chartType:"standalone",enterprise:!0,moduleId:"SunburstSeriesModule"},{type:"series",name:"treemap",chartType:"standalone",enterprise:!0,moduleId:"TreemapSeriesModule"},{type:"series",name:"chord",chartType:"standalone",enterprise:!0,moduleId:"ChordSeriesModule"},{type:"series",name:"sankey",chartType:"standalone",enterprise:!0,moduleId:"SankeySeriesModule"},{type:"series",name:"organization",chartType:"standalone",enterprise:!0,moduleId:"OrganizationSeriesModule"},{type:"plugin",name:"animation",enterprise:!0,moduleId:"AnimationModule"},{type:"plugin",name:"annotations",chartType:"cartesian",enterprise:!0,moduleId:"AnnotationsModule"},{type:"plugin",name:"legend",moduleId:"LegendModule"},{type:"plugin",name:"locale",moduleId:"LocaleModule"},{type:"plugin",name:"chartToolbar",chartType:"cartesian",enterprise:!0,moduleId:"ChartToolbarModule"},{type:"plugin",name:"contextMenu",enterprise:!0,moduleId:"ContextMenuModule"},{type:"plugin",name:"statusBar",chartType:"cartesian",enterprise:!0,moduleId:"StatusBarModule"},{type:"plugin",name:"dataSource",enterprise:!0,moduleId:"DataSourceModule"},{type:"plugin",name:"sync",chartType:"cartesian",enterprise:!0,moduleId:"SyncModule"},{type:"plugin",name:"ranges",chartType:"cartesian",enterprise:!0,moduleId:"RangesModule"},{type:"plugin",name:"zoom",enterprise:!0,moduleId:"ZoomModule"},{type:"plugin",name:"flashOnUpdate",enterprise:!0,moduleId:"FlashOnUpdateModule"},{type:"plugin",name:"gradientLegend",enterprise:!0,moduleId:"GradientLegendModule"},{type:"plugin",name:"navigator",chartType:"cartesian",enterprise:!0,moduleId:"NavigatorModule"},{type:"plugin",name:"scrollbar",chartType:"cartesian",enterprise:!0,moduleId:"ScrollbarModule"},{type:"plugin",name:"selection",enterprise:!0,moduleId:"SelectionModule"},{type:"axis:plugin",name:"crossLines",moduleId:"CrossLinesModule"},{type:"axis:plugin",name:"crosshair",chartType:"cartesian",enterprise:!0,moduleId:"CrosshairModule"},{type:"axis:plugin",name:"bandHighlight",chartType:"cartesian",enterprise:!0,moduleId:"BandHighlightModule"},{type:"series:plugin",name:"errorBar",chartType:"cartesian",enterprise:!0,moduleId:"ErrorBarsModule"},{type:"preset",name:"gauge-preset",chartType:"standalone",enterprise:!0,moduleId:"GaugePresetModule"},{type:"preset",name:"price-volume",chartType:"cartesian",enterprise:!0,moduleId:"PriceVolumePresetModule"},{type:"preset",name:"sparkline",moduleId:"SparklinePresetModule"}].map(t=>[t.name,t]));function WF(t){const e=Or.get(t);return e?.type==="series"?e.chartType:void 0}function nC(t){return t?.up||t?.down||t?.neutral?"user-full":t?.fills||t?.strokes?"user-indexed":"inbuilt"}var Jy="white",KF={"radial-gauge":!0,"linear-gauge":!0};function hl(t){return{$some:[{$and:[{$or:[{$isSeriesType:"line"},{$isSeriesType:"scatter"},{$isSeriesType:"area"},{$isSeriesType:"radar"},{$isSeriesType:"rangeArea"}]},{$isUserOption:[`/series/$index/${t}`,{$lessThan:[{$path:`/series/$index/${t}`},1]},!1]}]},{$path:"/series"}]}}function YF(t){return KF[t]===!0}var _n=class Sh{static getDefaultColors(){return{fills:at,fillsFallback:Object.values(at),strokes:Vs,sequentialColors:Yi(at),divergingColors:[at.ORANGE,at.YELLOW,at.GREEN],hierarchyColors:["#fff","#e0e5ea","#c1ccd5","#a3b4c1","#859cad"],secondSequentialColors:Oe.interpolate([Oe.fromHexString(at.BLUE),Oe.fromHexString("#cbdef5")],8).map(e=>e.toString()),secondDivergingColors:[at.GREEN,at.YELLOW,at.RED],secondHierarchyColors:["#fff","#c5cbd1","#a4b1bd","#8498a9","#648096"],up:{fill:at.GREEN,stroke:Vs.GREEN},down:{fill:at.RED,stroke:Vs.RED},neutral:{fill:at.GRAY,stroke:Vs.GRAY},altUp:{fill:at.BLUE,stroke:Vs.BLUE},altDown:{fill:at.ORANGE,stroke:Vs.ORANGE},altNeutral:{fill:at.GRAY,stroke:Vs.GRAY}}}static getDefaultPublicParameters(){return{accentColor:"#2196f3",axisColor:{$foregroundBackgroundMix:.325},backgroundColor:Jy,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:nr,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"},separationLinesColor:{$foregroundBackgroundMix:.17}}}static getPrivateParameters(){return{focusColor:{$mix:[{$ref:"backgroundColor"},{$ref:"accentColor"},.12]}}}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:[{$path:"./border/enabled"},5,0]}},keyboard:{enabled:!0},title:{enabled:!1,text:"Title",spacing:{$if:[{$path:"../subtitle/enabled"},10,20]},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:sr.LARGEST},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},wrapping:"hyphenate",layoutStyle:lr,textAlign:cr},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:sr.MEDIUM},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:lr,textAlign:cr},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:{$rem:sr.MEDIUM},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:lr,textAlign:cr},highlight:{enabled:!0,drawingMode:{$if:[{$or:[hl("highlight/highlightedItem/opacity"),hl("highlight/unhighlightedItem/opacity"),hl("highlight/highlightedSeries/opacity"),hl("highlight/unhighlightedSeries/opacity"),hl("fillOpacity"),hl("marker/fillOpacity")]},"overlap","cutout"]}},tooltip:{enabled:!0,darkTheme:mo,delay:0,pagination:!1,mode:{$if:[{$or:[{$and:[{$isChartType:"cartesian"},{$not:{$hasSeriesType:"bubble"}},{$not:{$hasSeriesType:"scatter"}},{$greaterThan:[{$size:{$path:"/series"}},1]},{$lessThan:[{$size:{$path:"/series"}},4]}]},{$and:[{$isChartType:"polar"},{$greaterThan:[{$size:{$path:"/series"}},1]},{$lessThan:[{$size:{$path:"/series"}},4]}]}]},"shared","single"]}},overlays:{darkTheme:mo},listeners:{},series:{tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","exact"]},"area"]},"exact",{$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]},offset:{$path:["/tooltip/position/offset",{$if:[{$eq:[{$path:"./anchorTo"},"chart"]},0,8]}]}}}}}}constructor(e={}){const{overrides:i,palette:n,params:s}=He(e),r=this.createChartConfigPerChartType(this.getDefaults()),a={};i&&this.processOverrides(a,i);const{fills:o,strokes:l,sequentialColors:c,...h}=this.getDefaultColors();this.palette=hn(ge(n,{fills:Object.values(o),strokes:Object.values(l),sequentialColors:Object.values(c),...h})),this.paletteType=nC(n),this.params=ge(s,this.getThemeParameters()),this.config=hn(He(r)),this.overrides=hn(i),this.presets=hn(a)}processOverrides(e,i){for(const n of ee.listModulesByType("series")){const s=n.name,r=i[s];YF(s)&&(e[s]=r,delete i[s])}}createChartConfigPerChartType(e){var i;for(const n of ee.listModulesByType("chart"))for(const s of ee.listModulesByType("series"))s.chartType===n.name&&(e[i=s.name]??(e[i]=n.themeTemplate));return e}getDefaults(){const e=(s,r)=>{const a={},o=ge({axes:{}},...Array.from(ee.listModulesByType("plugin"),l=>({[l.name]:l.themeTemplate})),ee.getChartModule(s)?.themeTemplate,this.getChartDefaults());for(const l of r){a[l]=ge(XF(l),a[l]??o);const{axes:c}=a[l];for(const h of ee.listModulesByType("axis"))c[h.name]=ge(c[h.name],!h.chartType||h.chartType===s?ZF(h.name):null);(l==="map-shape-background"||l==="map-line-background")&&delete a[l].series.tooltip}return a},i=[...ee.listModulesByType("series")],n=Cl(i,s=>s.chartType||"unknown");return ge(...Object.keys(n).map(s=>e(s,n[s]?.map(r=>r.name)??[])))}static applyTemplateTheme(e,i,n){if(ce(e))for(let s=0;s<e.length;s++){const r=e[s];typeof r=="symbol"&&n?.has(r)&&(e[s]=n.get(r))}else for(const s of Object.keys(e)){const r=e[s];typeof r=="symbol"&&n?.has(r)&&(e[s]=n.get(r))}}templateTheme(e,i=!0){const n=i?He(e):e,s=this.getTemplateParameters();return gr(n,Sh.applyTemplateTheme,void 0,void 0,s),n}getDefaultColors(){return Sh.getDefaultColors()}getThemeParameters(){return{...Sh.getDefaultPublicParameters(),...Sh.getPrivateParameters()}}getTemplateParameters(){const e=new Map;e.set(mo,!1),e.set(Xr,"#00000080"),e.set(gu,"#aaa"),e.set(lr,"block"),e.set(cr,"center"),e.set(Op,["#797b86","#e24c4a","#f49d2d","#65ab58","#409682","#4db9d2","#5090dc","#3068f9","#e24c4a","#913aac","#d93e64"]),e.set(du,Jy),e.set(Ei,at.BLUE),e.set(Ri,at.BLUE),e.set(pu,at.BLUE),e.set(fu,Jy),e.set(mu,"#fafafa"),e.set(yu,"#ddd"),e.set(bu,"#000"),e.set(vu,"#181d1f"),e.set(Ep,"#e35c5c"),e.set(Rp,"#e35c5c"),e.set(xu,"#fafafa"),e.set(Su,"#ddd"),e.set(Mu,"#000"),e.set(Ql,"top");const i=this.getDefaultColors();return e.set(xp,this.palette.up?.stroke??i.up.stroke),e.set(Mp,this.palette.up?.fill??i.up.fill),e.set(Sp,this.palette.down?.stroke??i.down.stroke),e.set(Ip,this.palette.down?.fill??i.down.fill),e.set(Dp,this.palette.neutral?.stroke??i.neutral.stroke),e.set(Cp,this.palette.neutral?.fill??i.neutral.fill),e.set(Ap,this.palette.altUp?.stroke??i.up.stroke),e.set(kp,this.palette.altUp?.fill??i.up.fill),e.set(wp,this.palette.altDown?.stroke??i.down.stroke),e.set(Tp,this.palette.altDown?.fill??i.down.fill),e.set(Lp,this.palette.altNeutral?.fill??i.altNeutral.fill),e.set(Np,this.palette.altNeutral?.stroke??i.altNeutral.stroke),e}};function ZF(t){let e=ee.getAxisModule(t)?.themeTemplate??{};for(const i of ee.listModulesByType("axis:plugin"))(i.axisTypes?.includes(t)??!0)&&(e=ge({[i.name]:i.themeTemplate},e));return e}function XF(t){let e=ee.getSeriesModule(t)?.themeTemplate??{};for(const i of ee.listModulesByType("series:plugin"))(i.seriesTypes?.includes(t)??!0)&&(e=ge({series:{[i.name]:i.themeTemplate}},e));return e}var qF=new Set(["foreground"]);function sC(t){const e=new Map;for(const[h,{type:u}]of Or)ee.hasModule(h)||(e.has(u)?e.get(u).add(h):e.set(u,new Set([h])));if(e.size===0)return t;function i(h){const u=e.get("plugin");if(!(!he(h)||!u))for(const d of u)d in h&&h[d].enabled!==!0&&delete h[d]}function n(h){const u=e.get("series:plugin");if(!(!he(h)||!u))for(const d of u)d in h&&delete h[d]}function s(h){const u=e.get("axis:plugin");if(!(!he(h)||!u))for(const d of u)d in h&&h[d].enabled!==!0&&delete h[d]}function r(h){if(he(h))for(const u of Object.keys(h)){if(e.get("axis")?.has(u)){delete h[u];continue}s(h[u])}}function a(h){he(h)&&(r(h.axes),i(h),n(h.series))}const o=He(t.config),l=He(t.overrides),c=He(t.presets);for(const h of Object.keys(o)){if(e.get("series")?.has(h)){delete o[h];continue}a(o[h])}if(he(l)){const h=l;he(h.common)&&(r(h.common.axes),i(h.common));for(const u of Object.keys(h))if(u!=="common"){if(e.get("series")?.has(u)){delete h[u];continue}a(h[u])}}if(he(c)){const h=c;for(const u of Object.keys(h)){if(e.get("preset")?.has(u)||e.get("series")?.has(u)){delete h[u];continue}i(h[u]),r(h[u]?.axes)}}return Object.create(t,{config:{value:hn(o),enumerable:!0},overrides:{value:he(l)?hn(l):l,enumerable:!0},presets:{value:he(c)?hn(c):c,enumerable:!0}})}function JF(t,e,i){const n=Dg(iV(t,e).concat(i));if(!n.length)return;const s=ee.isIntegrated()?"https://www.ag-grid.com/data-grid/integrated-charts-installation/":"https://www.ag-grid.com/charts/r/module-registry/",r=Cl(n,a=>a.enterprise?"enterprise":"community");if(n.length){const a=ee.isEnterprise()||r.enterprise?.length?"enterprise":"community";j.errorOnce(["required modules are not registered. Check if you have registered the modules:","",ee.isUmd()?"Install and register 'ag-charts-enterprise' before creating the chart.":tV(n.map(QF),a),"",`See ${s} for more details.`].join(`
`))}}function QF(t){return t.moduleId??t.name}function rC(t){return`    ${t},`}function eV(t,e){return t.length?`import {
${t.map(rC).join(`
`)}
} from 'ag-charts-${e}';`:null}function tV(t,e){const i=eV(["ModuleRegistry"].concat(t),e),n=t.map(rC).join(`
`);return`${i}

ModuleRegistry.registerModules([
${n}
]);`}function iV(t,e){const i=new Map,n="axes"in e&&he(e.axes)?e.axes:{},s=new Set(Object.values(n).map(o=>o?.type).filter(Kn)),r=new Set(e.series?.map(o=>o.type).filter(Kn));function a(o){i.set(o.name,o)}for(const o of Or.values())if(!ee.hasModule(o.name)&&!qF.has(o.name)&&!(t&&o.chartType&&t!==o.chartType))switch(o.type){case"chart":break;case"axis":if(s.has(o.name)){for(const h of Object.keys(n))n?.[h].type===o.name&&delete n[h];a(o)}break;case"series":r.has(o.name)&&(e.series=e.series.filter(h=>h.type!==o.name),a(o));break;case"plugin":const l=o.name,c=e[l];he(c)&&(c.enabled!==!1&&a(o),delete e[l]);break;case"axis:plugin":for(const h of Object.values(n)){const u=o.name;h?.[u]&&(h[u].enabled!==!1&&a(o),delete h[u])}break;case"series:plugin":for(const h of e.series??[])h[o.name]&&(delete h[o.name],a(o));break}for(const o of r){const l=Or.get(o);l?.type==="series"&&!ee.hasModule(l.name)&&!i.has(l.name)&&(e.series=e.series.filter(c=>c.type!==l.name),a(l))}return Array.from(i.values())}function aC(t,e){const i="axes"in e&&he(e.axes),n="series"in e&&ce(e.series),s=a=>t==null||!a.chartType||a.chartType===t,r=[];for(const a of ee.listModules())if(ee.isModuleType("plugin",a))s(a)||(delete e[a.name],r.push(a.name));else if(ee.isModuleType("axis:plugin",a)){if(i&&!s(a)){for(const o of Object.values(e.axes))delete o[a.name];r.push(a.name)}}else if(ee.isModuleType("series:plugin",a)&&n&&!s(a)){for(const o of e.series)delete o[a.name];r.push(a.name)}return r}var Qy="#192232",ti={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},Va={BLUE:"#74a8e6",ORANGE:"#ffbe70",GREEN:"#6cb176",CYAN:"#75d4ef",YELLOW:"#f6e559",VIOLET:"#aa86d8",GRAY:"#a1a1a1",MAGENTA:"#ce7ab9",BROWN:"#997b52",RED:"#ff7872"},ul=class extends _n{getDefaultColors(){return{fills:ti,fillsFallback:Object.values(ti),strokes:Va,sequentialColors:Yi(ti),divergingColors:[ti.ORANGE,ti.YELLOW,ti.GREEN],hierarchyColors:["#192834","#253746","#324859","#3f596c","#4d6a80"],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[ti.GREEN,ti.YELLOW,ti.RED],secondHierarchyColors:["#192834","#3b5164","#496275","#577287","#668399"],up:{fill:ti.GREEN,stroke:Va.GREEN},down:{fill:ti.RED,stroke:Va.RED},neutral:{fill:ti.GRAY,stroke:Va.GRAY},altUp:{fill:ti.BLUE,stroke:Va.BLUE},altDown:{fill:ti.ORANGE,stroke:Va.ORANGE},altNeutral:{fill:ti.GRAY,stroke:Va.GRAY}}}getThemeParameters(){return{...super.getThemeParameters(),axisColor:{$foregroundBackgroundMix:.737},backgroundColor:Qy,borderColor:{$foregroundBackgroundMix:.216},chromeBackgroundColor:{$foregroundBackgroundMix:.07},focusColor:{$mix:[{$ref:"backgroundColor"},{$ref:"accentColor"},.22]},foregroundColor:"#fff",gridLineColor:{$foregroundBackgroundMix:.257},popupShadow:"0 0 16px rgba(0, 0, 0, 0.33)",subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"chartBackgroundColor"},.57]},separationLinesColor:{$foregroundBackgroundMix:.44},crosshairLabelBackgroundColor:{$foregroundBackgroundMix:.65}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(mo,!0),t.set(du,Qy),t.set(Ei,ti.BLUE),t.set(pu,"#fff"),t.set(Ri,ti.BLUE),t.set(fu,Qy),t.set(mu,"#28313e"),t.set(yu,"#4b525d"),t.set(bu,"#fff"),t.set(vu,"#fff"),t.set(xu,"#28313e"),t.set(Su,"#4b525d"),t.set(Mu,"#fff"),t}constructor(t){super(t)}},zi={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},_a={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},nV=class extends ul{getDefaultColors(){return{...super.getDefaultColors(),fills:{...zi},fillsFallback:Object.values({...zi}),strokes:{..._a},sequentialColors:Yi(zi),divergingColors:[zi.GREEN,zi.BLUE,zi.RED],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],up:{fill:zi.GREEN,stroke:_a.GREEN},down:{fill:zi.RED,stroke:_a.RED},neutral:{fill:zi.BLUE,stroke:_a.BLUE},altUp:{fill:zi.GREEN,stroke:_a.GREEN},altDown:{fill:zi.RED,stroke:_a.RED},altNeutral:{fill:zi.GRAY,stroke:_a.GRAY}}}getThemeParameters(){return{...super.getThemeParameters(),chartPadding:0,gridLineColor:{$foregroundBackgroundMix:.12}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Ei,zi.BLUE),t.set(Ri,zi.BLUE),t.set(lr,"overlay"),t.set(cr,"left"),t.set(Ql,"bottom"),t}},Gi={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},Ba={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},sV=class extends _n{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Gi},fillsFallback:Object.values({...Gi}),strokes:{...Ba},sequentialColors:Yi(Gi),divergingColors:[Gi.GREEN,Gi.BLUE,Gi.RED],up:{fill:Gi.GREEN,stroke:Ba.GREEN},down:{fill:Gi.RED,stroke:Ba.RED},neutral:{fill:Gi.BLUE,stroke:Ba.BLUE},altUp:{fill:Gi.GREEN,stroke:Ba.GREEN},altDown:{fill:Gi.RED,stroke:Ba.RED},altNeutral:{fill:Gi.GRAY,stroke:Ba.GRAY}}}getThemeParameters(){return{...super.getThemeParameters(),chartPadding:0,gridLineColor:{$foregroundBackgroundMix:.06}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Ei,Gi.BLUE),t.set(Ri,Gi.BLUE),t.set(lr,"overlay"),t.set(cr,"left"),t.set(Ql,"bottom"),t}},ii={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},za={BLUE:"#90CAF9",ORANGE:"#FFCC80",GREEN:"#A5D6A7",CYAN:"#80DEEA",YELLOW:"#FFF9C4",VIOLET:"#B39DDB",GRAY:"#E0E0E0",MAGENTA:"#F48FB1",BROWN:"#A1887F",RED:"#EF9A9A"},rV=class extends ul{getDefaultColors(){return{...super.getDefaultColors(),fills:ii,fillsFallback:Object.values(ii),strokes:za,sequentialColors:Yi(ii),divergingColors:[ii.ORANGE,ii.YELLOW,ii.GREEN],secondSequentialColors:["#2196f3","#208FEC","#1E88E5","#1C7FDC","#1976d2","#176EC9","#1565c0"],secondDivergingColors:[ii.GREEN,ii.YELLOW,ii.RED],up:{fill:ii.GREEN,stroke:za.GREEN},down:{fill:ii.RED,stroke:za.RED},neutral:{fill:ii.GRAY,stroke:za.GRAY},altUp:{fill:ii.BLUE,stroke:za.BLUE},altDown:{fill:ii.RED,stroke:za.RED},altNeutral:{fill:ii.GRAY,stroke:za.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Ei,ii.BLUE),t.set(Ri,ii.BLUE),t}},ni={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Ga={BLUE:"#1565C0",ORANGE:"#E65100",GREEN:"#2E7D32",CYAN:"#00838F",YELLOW:"#F9A825",VIOLET:"#4527A0",GRAY:"#616161",MAGENTA:"#C2185B",BROWN:"#4E342E",RED:"#B71C1C"},aV=class extends _n{getDefaultColors(){return{...super.getDefaultColors(),fills:ni,fillsFallback:Object.values(ni),strokes:Ga,sequentialColors:Yi(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:Ga.GREEN},down:{fill:ni.RED,stroke:Ga.RED},neutral:{fill:ni.GRAY,stroke:Ga.GRAY},altUp:{fill:ni.BLUE,stroke:Ga.BLUE},altDown:{fill:ni.RED,stroke:Ga.RED},altNeutral:{fill:ni.GRAY,stroke:Ga.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Ei,ni.BLUE),t.set(Ri,ni.BLUE),t}},pt={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},ja={BLUE:"#6698ff",PURPLE:"#c0a3ff",MAGENTA:"#fc8dfc",PINK:"#ff82b1",RED:"#ff9b70",ORANGE:"#ffcf4e",YELLOW:"#ffff58",GREEN:"#58dd70",CYAN:"#51e2c9",MODERATE_BLUE:"#4fd7ff",GRAY:"#eeeeee"},oV=class extends ul{getDefaultColors(){return{fills:pt,fillsFallback:Object.values(pt),strokes:ja,sequentialColors:Yi(pt),divergingColors:[pt.BLUE,pt.RED],hierarchyColors:[],secondSequentialColors:[pt.BLUE,pt.PURPLE,pt.MAGENTA,pt.PINK,pt.RED,pt.ORANGE,pt.YELLOW,pt.GREEN],secondDivergingColors:[pt.BLUE,pt.RED],secondHierarchyColors:[],up:{fill:pt.GREEN,stroke:ja.GREEN},down:{fill:pt.RED,stroke:ja.RED},neutral:{fill:pt.GRAY,stroke:ja.GRAY},altUp:{fill:pt.BLUE,stroke:ja.BLUE},altDown:{fill:pt.RED,stroke:ja.RED},altNeutral:{fill:pt.GRAY,stroke:ja.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Ei,pt.BLUE),t.set(Ri,pt.BLUE),t}},ft={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},Ha={BLUE:"#2346c9",PURPLE:"#7653d4",MAGENTA:"#a73da9",PINK:"#c32d66",RED:"#c84b1c",ORANGE:"#c87f00",YELLOW:"#c1b900",GREEN:"#008c1c",CYAN:"#00927c",MODERATE_BLUE:"#0087bb",GRAY:"#888888"},lV=class extends _n{getDefaultColors(){return{...super.getDefaultColors(),fills:ft,fillsFallback:Object.values(ft),strokes:Ha,sequentialColors:Yi(ft),divergingColors:[ft.BLUE,ft.RED],hierarchyColors:[],secondSequentialColors:[ft.BLUE,ft.PURPLE,ft.MAGENTA,ft.PINK,ft.RED,ft.ORANGE,ft.YELLOW,ft.GREEN],secondDivergingColors:[ft.BLUE,ft.RED],secondHierarchyColors:[],up:{fill:ft.GREEN,stroke:Ha.GREEN},down:{fill:ft.RED,stroke:Ha.RED},neutral:{fill:ft.GRAY,stroke:Ha.GRAY},altUp:{fill:ft.BLUE,stroke:Ha.BLUE},altDown:{fill:ft.RED,stroke:Ha.RED},altNeutral:{fill:ft.GRAY,stroke:Ha.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Ei,ft.BLUE),t.set(Ri,ft.BLUE),t}},Rt={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"},Er={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"},cV=class extends ul{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Rt,RED:Rt.ORANGE},fillsFallback:Object.values({...Rt,RED:Rt.ORANGE}),strokes:{...Er,RED:Er.ORANGE},sequentialColors:Yi({...Rt,RED:Rt.ORANGE}),divergingColors:[Rt.ORANGE,Rt.YELLOW,Rt.GREEN],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[Rt.GREEN,Rt.YELLOW,Rt.ORANGE],up:{fill:Rt.GREEN,stroke:Er.GREEN},down:{fill:Rt.ORANGE,stroke:Er.ORANGE},neutral:{fill:Rt.GRAY,stroke:Er.GRAY},altUp:{fill:Rt.BLUE,stroke:Er.BLUE},altDown:{fill:Rt.ORANGE,stroke:Er.ORANGE},altNeutral:{fill:Rt.GRAY,stroke:Er.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Ei,Rt.BLUE),t.set(Ri,Rt.BLUE),t}},Vt={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"},_s={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"},hV=class extends _n{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Vt,RED:Vt.ORANGE},fillsFallback:Object.values({...Vt,RED:Vt.ORANGE}),strokes:{..._s,RED:_s.ORANGE},sequentialColors:Yi({...Vt,RED:Vt.ORANGE}),divergingColors:[Vt.ORANGE,Vt.YELLOW,Vt.GREEN],secondSequentialColors:["#5090dc","#629be0","#73a6e3","#85b1e7","#96bcea","#a8c8ee","#b9d3f1","#cbdef5"],secondDivergingColors:[Vt.GREEN,Vt.YELLOW,Vt.ORANGE],secondHierarchyColors:[],up:{fill:Vt.GREEN,stroke:_s.GREEN},down:{fill:Vt.ORANGE,stroke:_s.ORANGE},neutral:{fill:_s.GRAY,stroke:_s.GRAY},altUp:{fill:Vt.BLUE,stroke:_s.BLUE},altDown:{fill:Vt.ORANGE,stroke:_s.ORANGE},altNeutral:{fill:Vt.GRAY,stroke:_s.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Ei,Vt.BLUE),t.set(Ri,Vt.BLUE),t}},dl={...Mr,type:Ge("ordinal-time"),paddingInner:q,paddingOuter:q,groupPaddingInner:q,label:hd,parentLevel:Qf,interval:YS,crosshair:xa(!0,!0),bandHighlight:ud,bandAlignment:V("justify","start","center","end"),skipNullBars:T},eb={...Uo,...Nc(P),type:Ge("angle-number"),crossLines:Pt(Ns),startAngle:P,endAngle:P,label:{...Sr,orientation:V("fixed","parallel","perpendicular"),format:An}};eb.shape=V("polygon","circle");var tb={...Uo,type:Ge("angle-category"),shape:V("polygon","circle"),crossLines:Pt(Ns),startAngle:P,endAngle:P,paddingInner:q,groupPaddingInner:q,label:{...Sr,orientation:V("fixed","parallel","perpendicular")}};tb.innerRadiusRatio=q;var oC={...Uo,...Nc(P),type:Ge("radius-number"),shape:V("polygon","circle"),positionAngle:P,innerRadiusRatio:q,title:em,crossLines:Pt({...Ns,label:{...$o,positionAngle:P}},"cross-line options"),label:{...Sr,format:An}},ib={...Uo,type:Ge("radius-category"),positionAngle:P,innerRadiusRatio:q,paddingInner:q,paddingOuter:q,groupPaddingInner:q,label:Sr,title:em,crossLines:Pt({...Ns,label:{...$o,positionAngle:P}},"cross-line options")};ib.shape=V("polygon","circle");var gl={lineStyle:V("solid","dashed","dotted"),...W},$a={...$,...B,...W},sh={visible:T,locked:T,readOnly:T,handle:$a,...Ce},cg={position:V("top","center","bottom"),alignment:V("left","center","right"),...Ce},lC={position:V("top","inside","bottom"),alignment:V("left","center","right"),...Ce},uV={enabled:T,cornerRadius:k,...Ce,...$,...B,...W},dV={visible:T,...gl,...B},cC={divider:B,...$,...B,...Ce},hC={handle:$a,statistics:cC,...gl,...$,...B},hg={visible:T,locked:T,readOnly:T,extendStart:T,extendEnd:T,handle:$a,text:cg,...gl,...B},nb={visible:T,locked:T,readOnly:T,axisLabel:uV,handle:$a,text:cg,...gl,...B},uC={visible:T,locked:T,readOnly:T,extendStart:T,extendEnd:T,handle:$a,text:lC,background:$,...gl,...B},dC={...uC},gC={...uC,middle:dV},sb={label:Ce,showFill:T,isMultiColor:T,strokes:Q(H),rangeStroke:H,bands:V(4,6,10),...hg},pC={...$,...B,...sh},fC={...$,...B,...sh},mC={...$,...B,...sh,background:{...$,...B}},rb={visible:T,locked:T,readOnly:T,handle:$a,...$},ug={visible:T,locked:T,readOnly:T,extendStart:T,extendEnd:T,handle:$a,text:cg,background:$,statistics:cC,...gl,...B},yC={visible:T,up:hC,down:hC},pl={enabled:T,axesButtons:{enabled:T,axes:V("x","y","xy")},toolbar:{enabled:T,padding:k,buttons:Pt({...oo,value:V("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:T,buttons:Q(se(ze({...oo,value:X(V("line-stroke-width","line-style-type","line-color","fill-color","text-color","text-size","delete","settings"))}),ze({...oo,value:X(V("lock")),checkedOverrides:oo})))}};pl.data=J(Yn),pl.xKey=J(N),pl.volumeKey=J(N),pl.snap=J(T);var cs={...$,...B,opacity:q},bC={...$,...B,...W,cornerRadius:k,whisker:{...B,...W},cap:{lengthRatio:q}},vC={...bC,opacity:q},xC=De({...$,...B,...W,cornerRadius:k,whisker:{...B,...W},cap:{lengthRatio:q}}),SC={direction:V("horizontal","vertical"),showInMiniChart:T,styler:xC,itemStyler:xC,tooltip:Ae,...Se,...bC,highlight:lt(vC,vC),segmentation:ao,width:Zn,widthRatio:q},ab={cornerRadius:k,wick:{...B,...W},...$,...B,...W},MC={...ab,opacity:q},IC={item:{up:ab,down:ab},itemStyler:De({...$,...B,...W,cornerRadius:k,wick:{...B,...W}}),showInMiniChart:T,tooltip:Ae,...Se,highlight:lt(MC,MC)},DC={fills:Q(Ni),strokes:Q(H),label:{spacing:k,maxWidth:k,...Fe},link:{tension:q,itemStyler:De({...$,...B,...W,tension:q}),...$,...B,...W},node:{width:k,spacing:k,itemStyler:De({...$,...B,...W}),...$,...B,...W},tooltip:Ae,...Se},CC={direction:V("horizontal","vertical"),fills:Q(Ni),strokes:Q(H),label:{spacing:k,placement:V("before","middle","after"),...Fe},stageLabel:{placement:V("before","after"),format:An,...Sr},tooltip:Ae,...Y(Se,["showInLegend"]),...Y($,["fill"]),...Y(B,["stroke"]),...W,highlight:Kg(Xs)},AC={direction:V("horizontal","vertical"),fills:Q(Ni),strokes:Q(H),itemStyler:De({...$,...B,...W}),spacingRatio:q,crisp:T,dropOff:{enabled:T,...$,...B,...W},stageLabel:{placement:V("before","after"),format:An,...Sr},label:Fe,tooltip:Ae,shadow:qn,...Y(Se,["showInLegend"]),...Y($,["fill"]),...Y(B,["stroke"]),...W},wC={title:N,textAlign:V("left","center","right"),verticalAlign:V("top","middle","bottom"),itemPadding:k,itemStyler:De({...$,...B}),showInMiniChart:T,label:Qs,tooltip:Ae,...Se,...B},kC={showInMiniChart:T,itemStyler:De({...B,...W}),item:{up:{...B,...W},down:{...B,...W}},tooltip:Ae,...Se,highlight:lt(Xs,Xs)},TC={colorScale:Zs,maxStrokeWidth:k,itemStyler:De({...B,...W}),sizeDomain:Q(k),label:Fe,tooltip:Ae,...Se,...B,...W,highlight:lt(Xs,Xs)},LC={...B,...W},NC={colorRange:zl(Q(H),"Use `colorScale.fills` instead."),colorScale:Zs,maxSize:k,sizeDomain:Q(k),label:{placement:V("top","bottom","left","right"),...Fe},tooltip:Ae,...Se,...Y(kn,["enabled"]),highlight:lt(je,je)},OC={colorRange:zl(Q(H),"Use `colorScale.fills` instead."),colorScale:Zs,padding:k,itemStyler:De({...$,...B,...W}),label:Qs,tooltip:Ae,...Se,...$,...B,...W,highlight:lt(je,je)},EC={...Se,...$,...B,...W},fl=De({...$,...B,...W,cornerRadius:k}),RC={cornerRadius:k,styler:fl,itemStyler:fl,label:Fe,tooltip:Ae,...Se,...$,...B,...W,highlight:lt(Dn,Dn)},PC={...Se,innerSpacing:le,outerSpacing:le,verticalSpacing:le,expander:le,link:le,node:le,tooltip:Ae},FC={direction:V("horizontal","vertical"),aspectRatio:k,spacing:k,reverse:T,itemStyler:De({...$,...B,...W}),fills:Q(Ni),strokes:Q(H),label:Fe,stageLabel:{spacing:k,placement:V("before","after"),...Fe},tooltip:Ae,shadow:qn,...Se,...Y($,["fill"]),...Y(B,["stroke"]),...W},VC={connectMissingData:T,marker:kn,styler:De({marker:Js,...$,...B,...W}),label:Fe,tooltip:Ae,...Se,...$,...B,...W,highlight:lt(je,je)},_C={connectMissingData:T,marker:kn,styler:De({marker:Js,...B,...W}),label:Fe,tooltip:Ae,...Se,...B,...W,highlight:lt(je,Xs)},BC={cornerRadius:k,styler:fl,itemStyler:fl,label:Fe,tooltip:Ae,...Se,...$,...B,...W,highlight:lt(Dn,Dn)},zC={cornerRadius:k,columnWidthRatio:q,maxColumnWidthRatio:q,styler:fl,itemStyler:fl,label:Fe,tooltip:Ae,...Se,...$,...B,...W,highlight:lt(Dn,Dn)},gV={marker:kn,...B,...W},GC={marker:{enabled:T,...Js},...B,...W},jC={marker:Js,...B,...W},HC={showInMiniChart:T,connectMissingData:T,interpolation:Xh,label:{...Fe,placement:V("inside","outside"),spacing:k},tooltip:Ae,shadow:qn,...Se,...$,...gV,item:{low:{...GC},high:{...GC}},styler:De({...$,item:{low:{...jC},high:{...jC}}}),highlight:lt(je,je),segmentation:ao,invertedStyle:{enabled:T,...$}},$C=De({...$,...B,...W,cornerRadius:k}),UC={direction:V("horizontal","vertical"),grouped:T,showInMiniChart:T,cornerRadius:k,styler:$C,itemStyler:$C,label:{...Fe,placement:V("inside","outside"),spacing:k},tooltip:Ae,shadow:qn,...Se,...$,...B,...W,highlight:lt(Dn,Dn),segmentation:ao,width:Zn,widthRatio:q},WC={fills:Q(Ni),strokes:Q(H),label:{...Fe,spacing:k,placement:V("left","right","center"),edgePlacement:V("inside","outside")},link:{itemStyler:De({...$,...B,...W}),...$,...B,...W},node:{width:k,spacing:k,minSpacing:Ie(k,Ov("spacing")),alignment:V("left","center","right","justify"),verticalAlignment:V("top","bottom","center"),sort:V("data","ascending","descending","auto"),itemStyler:De({...$,...B,...W}),...$,...B,...W},tooltip:Ae,...Se},KC={fills:Q(Ni),strokes:Q(H),colorRange:zl(Q(H),"Use `colorScale.fills` instead."),colorScale:Zs,sectorSpacing:k,cornerRadius:k,padding:k,itemStyler:De({...$,...B}),label:{spacing:k,...Qs},secondaryLabel:Qs,tooltip:Ae,...Y(Se,["highlight","showInLegend"]),...Y($,["fill"]),...Y(B,["stroke"]),highlight:{highlightedItem:cs,highlightedBranch:cs,unhighlightedItem:cs,unhighlightedBranch:cs}},YC={fills:Q(Ni),strokes:Q(H),colorRange:zl(Q(H),"Use `colorScale.fills` instead."),colorScale:Zs,itemStyler:De({...$,...B}),group:{gap:k,padding:k,cornerRadius:k,textAlign:V("left","center","right"),interactive:T,highlight:{highlightedItem:cs,unhighlightedItem:cs},label:{...Fe,spacing:k},...$,...B},tile:{gap:k,padding:k,cornerRadius:k,textAlign:V("left","center","right"),verticalAlign:V("top","middle","bottom"),label:{...Fe,spacing:k,lineHeight:k,minimumFontSize:k,wrapping:Hr,overflowStrategy:$h},secondaryLabel:{...Fe,lineHeight:k,minimumFontSize:k,wrapping:Hr,overflowStrategy:$h},highlight:{highlightedItem:cs,highlightedBranch:cs,unhighlightedItem:cs,unhighlightedBranch:cs},...$,...B},tooltip:Ae,...Y(Se,["highlight","showInLegend"])},ob={name:N,cornerRadius:k,itemStyler:De({...$,...B,...W,cornerRadius:k}),label:{...Fe,placement:V("inside-start","inside-center","inside-end","outside-start","outside-end"),spacing:k},tooltip:Ae,shadow:qn,...$,...B,...W},ZC={direction:V("horizontal","vertical"),showInMiniChart:T,item:{positive:ob,negative:ob,total:ob},line:{enabled:T,...B,...W},tooltip:Ae,width:Zn,widthRatio:q,...Se},dg=ze({__type:X(Ge("date")),value:se(N,P)},"a serializable date object"),XC={width:k,height:k,grip:T,fill:H,stroke:H,strokeWidth:k,cornerRadius:k},we={enabled:T,height:k,spacing:k,cornerRadius:P,mask:{fill:H,fillOpacity:q,stroke:H,strokeWidth:k},minHandle:XC,maxHandle:XC,miniChart:{enabled:T,padding:{top:k,bottom:k},label:{enabled:T,avoidCollisions:T,spacing:k,format:An,formatter:ci(cn),interval:{minSpacing:k,maxSpacing:k,values:Yn,step:P},...Ce},series:le}},lb={...$,...B,...W,cornerRadius:k,opacity:q},qC={...lb,minSize:k,hoverStyle:{fill:$.fill,stroke:B.stroke}},JC={enabled:T,thickness:k,spacing:k,tickSpacing:k,visible:V("auto","always","never"),placement:V("outer","inner"),track:lb,thumb:qC},pV={...JC,position:V("top","bottom")},fV={...JC,position:V("left","right")},yi={enabled:T,enableAxisScrolling:T,enableSeriesAreaScrolling:T,thickness:k,spacing:k,tickSpacing:k,visible:V("auto","always","never"),placement:V("outer","inner"),track:lb,thumb:qC,horizontal:pV,vertical:fV},Ua=Y($S,["type","value","range"]),bi={number:{...Y(Yo,["type","crossLines"]),top:Y(Yo,["type","crossLines","position"]),right:Y(Yo,["type","crossLines","position"]),bottom:Y(Yo,["type","crossLines","position"]),left:Y(Yo,["type","crossLines","position"]),crossLines:Ua},log:{...Y(Zo,["type","crossLines"]),top:Y(Zo,["type","crossLines","position"]),right:Y(Zo,["type","crossLines","position"]),bottom:Y(Zo,["type","crossLines","position"]),left:Y(Zo,["type","crossLines","position"]),crossLines:Ua},category:{...Y(Wo,["type","crossLines"]),top:Y(Wo,["type","crossLines","position"]),right:Y(Wo,["type","crossLines","position"]),bottom:Y(Wo,["type","crossLines","position"]),left:Y(Wo,["type","crossLines","position"]),crossLines:Ua},time:{...Y(Xo,["type","crossLines"]),top:Y(Xo,["type","crossLines","position"]),right:Y(Xo,["type","crossLines","position"]),bottom:Y(Xo,["type","crossLines","position"]),left:Y(Xo,["type","crossLines","position"]),crossLines:Ua},"unit-time":{...Y(qo,["type","crossLines"]),top:Y(qo,["type","crossLines","position"]),right:Y(qo,["type","crossLines","position"]),bottom:Y(qo,["type","crossLines","position"]),left:Y(qo,["type","crossLines","position"]),crossLines:Ua},"grouped-category":{...Y(Ko,["type"]),top:Y(Ko,["type","position"]),right:Y(Ko,["type","position"]),bottom:Y(Ko,["type","position"]),left:Y(Ko,["type","position"]),crossLines:Ua},"ordinal-time":{...Y(dl,["type","crossLines"]),top:Y(dl,["type","crossLines","position"]),right:Y(dl,["type","crossLines","position"]),bottom:Y(dl,["type","crossLines","position"]),left:Y(dl,["type","crossLines","position"]),crossLines:Ua}},ml={"angle-category":{...Y(tb,["type","crossLines"]),crossLines:Y(Ns,["type"])},"angle-number":{...Y(eb,["type","crossLines"]),crossLines:Y(Ns,["type"])},"radius-category":{...Y(ib,["type","crossLines"]),crossLines:{...Y(Ns,["type"]),label:{...$o,positionAngle:P}}},"radius-number":{...Y(oC,["type","crossLines"]),crossLines:{...Y(Ns,["type"]),label:{...$o,positionAngle:P}}}},Le={visible:J(T)},mV={common:{...re,navigator:we,scrollbar:yi,axes:{...bi,...ml},annotations:{...pl,line:hg,"horizontal-line":nb,"vertical-line":nb,"disjoint-channel":dC,"parallel-channel":gC,"fibonacci-retracement":sb,"fibonacci-retracement-trend-based":sb,callout:pC,comment:fC,note:mC,text:sh,arrow:hg,"arrow-up":rb,"arrow-down":rb,"date-range":ug,"price-range":ug,"date-price-range":ug,"quick-date-price-range":yC},chartToolbar:{enabled:T},initialState:{legend:Pt({visible:T,seriesId:N,itemId:N,legendItemName:N},"legend state array"),zoom:{rangeX:{start:se(P,dg),end:se(P,dg)},rangeY:{start:se(P,dg),end:se(P,dg)},ratioX:{start:q,end:q},ratioY:{start:q,end:q},autoScaledAxes:Q(Ge("y"))}}},line:{...re,axes:bi,series:Nf,navigator:we,scrollbar:yi,...Le},scatter:{...re,axes:bi,series:Vy,navigator:we,scrollbar:yi,...Le,paired:J(T)},bubble:{...re,axes:bi,series:Ny,navigator:we,scrollbar:yi,...Le},area:{...re,axes:bi,series:H0,navigator:we,scrollbar:yi,...Le},bar:{...re,axes:bi,series:Lf,navigator:we,scrollbar:yi,...Le},"box-plot":{...re,axes:bi,series:SC,navigator:we,scrollbar:yi,...Le},candlestick:{...re,axes:bi,series:IC,navigator:we,scrollbar:yi,...Le},"cone-funnel":{...re,axes:bi,series:CC,navigator:we,scrollbar:yi,...Le},funnel:{...re,axes:bi,series:AC,navigator:we,scrollbar:yi,...Le},ohlc:{...re,axes:bi,series:kC,navigator:we,scrollbar:yi,...Le},histogram:{...re,axes:Y(bi,["category","grouped-category","unit-time","ordinal-time"]),series:ED,navigator:we,scrollbar:yi,...Le},heatmap:{...re,axes:bi,series:wC,navigator:we,scrollbar:yi,...Le},waterfall:{...re,axes:bi,series:ZC,navigator:we,scrollbar:yi,...Le},"range-bar":{...re,axes:bi,series:UC,navigator:we,scrollbar:yi,...Le},"range-area":{...re,axes:bi,series:HC,navigator:we,scrollbar:yi,...Le},donut:{...re,series:XD,navigator:we,...Le},pie:{...re,series:Yy,navigator:we,...Le},"radar-line":{...re,axes:ml,series:_C,navigator:we,...Le},"radar-area":{...re,axes:ml,series:VC,navigator:we,...Le},"radial-bar":{...re,axes:ml,series:BC,navigator:we,...Le},"radial-column":{...re,axes:ml,series:zC,navigator:we,...Le},nightingale:{...re,axes:ml,series:RC,navigator:we,...Le},sunburst:{...re,series:KC,navigator:we,...Le},treemap:{...re,series:YC,navigator:we,...Le},"map-shape":{...re,series:OC,navigator:we,...Le},"map-line":{...re,series:TC,navigator:we,...Le},"map-marker":{...re,series:NC,navigator:we,...Le},"map-shape-background":{...re,series:EC,navigator:we,...Le},"map-line-background":{...re,series:LC,navigator:we,...Le},sankey:{...re,series:WC,navigator:we,...Le},chord:{...re,series:DC,navigator:we,...Le},organization:{...re,series:PC,navigator:we,...Le},pyramid:{...re,series:FC,navigator:we,...Le},"radial-gauge":{...re,...ru,targets:Y(nu,["value"]),tooltip:{...ru.tooltip,...re.tooltip}},"linear-gauge":{...re,...su,targets:Y(iu,["value"]),tooltip:{...su.tooltip,...re.tooltip}}};function gg(t,e){const i={};for(const n of Reflect.ownKeys(t))i[n]=e(t[n],n,t);return i}var yV=gg(mV,function t(e,i){if(Pl(i))return e;if(an(e))return se(e,jl,Pl);if(he(e))return se(ze(_l in e?gg(e,n=>he(n)?gg(n,t):n):gg(e,t)),jl,Pl);throw new Error(`Invalid theme override value: ${String(e)}`)}),si={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Wa={BLUE:"#67b7ff",ORANGE:"#ffc24d",GREEN:"#5cc86f",CYAN:"#54ebff",VIOLET:"#fff653",YELLOW:"#c18aff",GRAY:"#aeaeae",MAGENTA:"#f078d4",BROWN:"#ba8438",RED:"#ff726e"},bV=class extends ul{getDefaultColors(){return{fills:si,fillsFallback:Object.values(si),strokes:Wa,sequentialColors:Yi(si),divergingColors:[si.ORANGE,si.YELLOW,si.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#0076e6","#0069cc","#005cb3","#004f99","#004280","#003466","#00274c"],secondDivergingColors:[si.GREEN,si.YELLOW,si.RED],secondHierarchyColors:[],up:{fill:si.GREEN,stroke:Wa.GREEN},down:{fill:si.RED,stroke:Wa.RED},neutral:{fill:si.GRAY,stroke:Wa.GRAY},altUp:{fill:si.BLUE,stroke:Wa.BLUE},altDown:{fill:si.ORANGE,stroke:Wa.ORANGE},altNeutral:{fill:si.GRAY,stroke:Wa.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Ei,si.BLUE),t.set(Ri,si.BLUE),t}},ri={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Ka={BLUE:"#0f68c0",ORANGE:"#d47100",GREEN:"#007922",CYAN:"#009ac2",VIOLET:"#bca400",YELLOW:"#753cac",GRAY:"#646464",MAGENTA:"#9b2685",BROWN:"#6c3b00",RED:"#cb0021"},vV=class extends _n{getDefaultColors(){return{...super.getDefaultColors(),fills:ri,fillsFallback:Object.values(ri),strokes:Ka,sequentialColors:Yi(ri),divergingColors:[ri.ORANGE,ri.YELLOW,ri.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#1a8fff","#339cff","#4da8ff","#66b5ff","#80c1ff","#99cdff","#b3daff"],secondDivergingColors:[ri.GREEN,ri.YELLOW,ri.RED],secondHierarchyColors:[],up:{fill:ri.GREEN,stroke:Ka.GREEN},down:{fill:ri.RED,stroke:Ka.RED},neutral:{fill:ri.GRAY,stroke:Ka.GRAY},altUp:{fill:ri.BLUE,stroke:Ka.BLUE},altDown:{fill:ri.ORANGE,stroke:Ka.ORANGE},altNeutral:{fill:ri.GRAY,stroke:Ka.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Ei,ri.BLUE),t.set(Ri,ri.BLUE),t}};function yn(t){let e,i=-1;return()=>(i=ee.ifRegistryChanged(i,()=>{e=t()}),e)}var cb=yn(()=>new _n),hb={"ag-default-dark":yn(()=>new ul),"ag-sheets-dark":yn(()=>new cV),"ag-polychroma-dark":yn(()=>new oV),"ag-vivid-dark":yn(()=>new bV),"ag-material-dark":yn(()=>new rV),"ag-financial-dark":yn(()=>new nV),"ag-default":cb,"ag-sheets":yn(()=>new hV),"ag-polychroma":yn(()=>new lV),"ag-vivid":yn(()=>new vV),"ag-material":yn(()=>new aV),"ag-financial":yn(()=>new sV)},ub=new Map,QC=-1,eA=ue.create(!0,"perf"),pg=t=>{QC=ee.ifRegistryChanged(QC,()=>{ub.clear()});let e=ub.get(t);return e==null?(eA("[CACHE] ChartTheme","miss",db.name,[t]),e=db(t),ub.set(t,e)):eA("[CACHE] ChartTheme","hit",db.name,[t]),e};function db(t){if(t instanceof _n)return t;if(!IV(t))return cb();if(t==null||typeof t=="string"){const s=hb[t??"ag-default"];if(s)return s();throw new Error(`Cannot find theme \`${t}\`.`)}const{cleared:e,invalid:i}=zt(xV(t),SV,"theme");for(const s of i)j.warnOnce(String(s));const n=e?.baseTheme?pg(e.baseTheme):cb();return e?new n.constructor(e):n}function xV(t){if(!he(t)||!he(t.baseTheme))return t;let e=t,i,n;const s=[];for(;typeof e=="object";)i??(i=e.palette),n??(n=e.params),e.overrides&&s.push(e.overrides),e=e.baseTheme;return{baseTheme:e,overrides:ge(...s),params:n,palette:i}}var SV={baseTheme:se(N,Ks),overrides:yV,params:{accentColor:H,axisColor:H,backgroundColor:H,borderColor:H,borderRadius:P,chartBackgroundColor:H,chartPadding:P,focusShadow:N,foregroundColor:H,fontFamily:Hh,fontSize:P,fontWeight:Hl,gridLineColor:H,popupShadow:N,subtleTextColor:H,textColor:H,separationLinesColor:H,chromeBackgroundColor:H,chromeFontFamily:Hh,chromeFontSize:P,chromeFontWeight:Hl,chromeSubtleTextColor:H,chromeTextColor:H,buttonBackgroundColor:H,buttonBorder:T,buttonFontWeight:Hl,buttonTextColor:H,inputBackgroundColor:H,inputBorder:T,inputTextColor:H,menuBackgroundColor:H,menuBorder:T,menuTextColor:H,panelBackgroundColor:H,panelSubtleTextColor:H,tooltipBackgroundColor:H,tooltipBorder:T,tooltipTextColor:H,tooltipSubtleTextColor:H,crosshairLabelBackgroundColor:H,crosshairLabelTextColor:H},palette:{fills:Q(Ni),strokes:Q(H),up:{fill:se(H,jh),stroke:H},down:{fill:se(H,jh),stroke:H},neutral:{fill:se(H,jh),stroke:H}}},MV=V("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 IV(t){const{invalid:e}=zt({theme:t},{theme:se(MV,Ks)});for(const i of e)j.warnOnce(String(i));return e.length===0}function fg(t){const e=t.series?.[0]?.type??"line";return ee.getSeriesModule(e)?.chartType??WF(e)??"unknown"}var it="path",bn="pathArray",Je="default",ji="override",ai="user",Rr="userPartial",hs="operation",us="operationValue",yl="dependency",gb="autoEnable",tA="autoEnableValue",iA="prune",nA="childrenSource";function pb(t){return Li(t)&&t>=0&&t<=1}function rh(t,e){let i=t;for(const n of e){if(!(typeof n=="string"&&i!=null&&(typeof i=="object"||Array.isArray(i))&&n in i))return!1;i=i[n]}return!0}function Kt(t,e){let i=t;for(const n of e){if(!(typeof n=="string"&&i!=null&&(typeof i=="object"||Array.isArray(i))&&n in i))return;i=i[n]}return i}function bl(t,e,i){const n=e.length;if(n===0)return;let s=t;const r=n-1,a=e[r];for(let o=0;o<r;o++){const l=e[o],c=e[o+1];let h=s[l];(h==null||!El(h))&&(h=Number.isNaN(Number(c))?{}:[],s[l]=h),s=h}s[a]=i}var DV=/^\d+$/;function CV(t,e=0){let i=0;for(let n=t.length-1;n>=0;n--){const s=t[n];if(DV.test(s)&&(i++,i>e))return n}return-1}function vl(t,e=0){const i=CV(t,e);return Number(t[i])}function Ya(t,e,i){const n=e.split("/");let s=[...t];e.startsWith("/")&&(s=[],n.shift());let r=!1;for(const a of n){if(a==="..")s.pop(),r||s.pop();else if(a===".")s.pop();else if(a==="$index"){const o=vl(t);if(Number.isNaN(o))return ds;s.push(`${o}`)}else if(a==="$prevIndex"){const o=vl(t);if(Number.isNaN(o)||Number(o)<=0)return ds;s.push(`${Number(o)-1}`)}else if(a.startsWith("$")){const o=i?.[a.slice(1)];if(o==null)return ds;s.push(o)}else a.length!==0&&s.push(a);r=a===".."}return s}var ds=Symbol("unresolvable-path"),Hi=Symbol("resolved-to-branch");function ah(t,e){if(t==null||typeof t!="object"||Array.isArray(t)||(e??(e=Object.keys(t)),e.length===0))return;const i=e[0];if(oA.has(i))return{operation:i,values:Array.isArray(t[i])?t[i]:[t[i]]}}function AV(t,e,i){const n=ah(t.getVertexValue(i));switch(n?.operation){case"$path":{const[s]=n.values,r=t.getPathArray(e),a=Ya(r,s);return a===ds?void 0:t.findVertexAtPath(a)}case"$value":return e}}var wV={$cacheMax:kV};function kV(t,e,i){const[n]=i,s=t.getPathArray(e),r=t.getCachedValue(s,"$cacheMax"),a=t.resolveVertexValue(e,n);if(typeof a!="number")return r;if(typeof r!="number")return t.setCachedValue(s,"$cacheMax",a),a;const o=Math.max(r,a);return t.setCachedValue(s,"$cacheMax",o),o}var TV={$hasSeriesType:{dependencies:fb,resolve:NV},$isChartType:{dependencies:fb,resolve:EV},$isPackageType:LV,$isSeriesType:{dependencies:fb,resolve:OV}};function LV(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n),r=ee.isEnterprise();return s==="enterprise"?r:s==="community"?!r:!1}function fb(t,e,i){const n=t.findVertexAtPath(["series","0","type"]);n&&t.addEdge(e,n,yl)}function NV(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n),r=t.getResolvedPath(["series"]);if(!Array.isArray(r))return!1;for(const a of r)if(a.type===s)return!0;return!1}function OV(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n);return t.getResolvedPath(["series","0","type"])===s}function EV(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n),r=t.getResolvedPath(["series","0","type"]);if(typeof r!="string")return!1;const a=ee.getSeriesModule(r);if(a==null)return!1;switch(s){case"cartesian":return a.chartType==="cartesian";case"polar":return a.chartType==="polar";case"standalone":return a.chartType==="standalone"}return!1}var RV={$foregroundBackgroundMix:PV,$foregroundOpacity:FV,$interpolate:VV,$isGradient:_V,$isImage:BV,$isPattern:zV,$mix:GV};function PV(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n),r=t.getParamValue("foregroundColor"),a=t.getParamValue("backgroundColor");if(typeof r=="string"&&typeof a=="string"&&pb(s))return Oe.mix(Oe.fromString(r),Oe.fromString(a),1-s).toString();ue.inDevelopmentMode(()=>j.warnOnce(`\`$foregroundBackgroundMix\` json operation failed on [${String(s)}}}] at [${t.getPathArray(e).join(".")}], expecting a number between 0 and 1.`))}function FV(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n),r=t.getParamValue("foregroundColor");if(typeof r=="string"&&pb(s)){const a=Oe.fromString(r);return new Oe(a.r,a.g,a.b,s).toString()}ue.inDevelopmentMode(()=>j.warnOnce(`\`$foregroundOpacity\` json operation failed on [${String(s)}}}] at [${t.getPathArray(e).join(".")}], expecting a number between 0 and 1.`))}function VV(t,e,i){const[n,s]=i,r=t.resolveVertexValue(e,n),a=t.resolveVertexValue(e,s);if(!(!ce(r)||!Li(a)))return Oe.interpolate(r.map(o=>Oe.fromString(o)),a).map(o=>o.toString())}function _V(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n);return qi(s)}function BV(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n);return la(s)}function zV(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n);return As(s)}function GV(t,e,i){const[n,s,r]=i,a=t.resolveVertexValue(e,n),o=t.resolveVertexValue(e,s),l=t.resolveVertexValue(e,r),c=t.getPathArray(e),h=`\`$mix\` json operation failed on [${String(a)}, ${String(o)}, ${String(l)}] at [${c.join(".")}], expecting`,u=`${h} two colors and a number between 0 and 1.`;if(typeof o!="string"||!pb(l)){ue.inDevelopmentMode(()=>j.warnOnce(u));return}if(typeof a=="string")try{return Oe.mix(Oe.fromString(a),Oe.fromString(o),l).toString()}catch{ue.inDevelopmentMode(()=>j.warnOnce(u));return}if(!qi(a)){ue.inDevelopmentMode(()=>j.warnOnce(u));return}let d=a.colorStops;try{d=d?.map(g=>{let p;return typeof g.color=="string"&&(p=Oe.mix(Oe.fromString(g.color),Oe.fromString(o),l).toString()),{...g,color:p}})}catch{ue.inDevelopmentMode(()=>j.warnOnce(`${h} a gradient, a color and a number between 0 and 1.`));return}return{...a,colorStops:d}}var jV={$rem:HV};function HV(t,e,i){const[n,s]=i,r=t.getVertexValue(n),a=s?t.getVertexValue(s):"fontSize",o=t.getParamValue(a);if(typeof o=="number"&&typeof r=="number")return Math.round(r*o);ue.inDevelopmentMode(()=>j.warnOnce(`\`$rem\` json operation failed on [${String(r)}] at [${t.getPathArray(e).join(".")}], expecting a number.`))}var $V={$and:UV,$eq:WV,$every:KV,$greaterThan:YV,$if:ZV,$lessThan:XV,$not:qV,$or:JV,$some:QV,$switch:e2};function UV(t,e,i){for(const n of i){const s=t.resolveVertexValue(e,n);if(i.length===1&&Array.isArray(s))return s.every(r=>!!r);if(!s)return!1}return!0}function WV(t,e,i){let n,s=!0;for(const r of i){const a=t.resolveVertexValue(e,r);if(s)n=a,s=!1;else if(a!==n)return!1}return!0}function KV(t,e,i){const[n,s]=i,r=t.getVertexValue(n),a=t.resolveVertexValue(e,s);if(!Array.isArray(a))return;let o=0;for(const l of a){if(!t.graftAndResolveOrphanValue(e,`${o}`,r,l))return!1;o++}return!0}function YV(t,e,i){const[n,s]=i;return t.resolveVertexValue(e,n)>t.resolveVertexValue(e,s)}function ZV(t,e,i){const[n,s,r]=i,o=t.resolveVertexValue(e,n)?s:r,l=t.neighboursWithEdgeValue(o,it);if(l)for(const c of l)t.addEdge(e,c,it);return t.resolveVertexValue(e,o)}function XV(t,e,i){const[n,s]=i;return t.resolveVertexValue(e,n)<t.resolveVertexValue(e,s)}function qV(t,e,i){const[n]=i;if(n)return!t.resolveVertexValue(e,n)}function JV(t,e,i){for(const n of i){const s=t.resolveVertexValue(e,n);if(i.length===1&&Array.isArray(s))return s.some(r=>!!r);if(s)return!0}return!1}function QV(t,e,i){const[n,s]=i,r=t.getVertexValue(n),a=t.resolveVertexValue(e,s);if(!Array.isArray(a))return;let o=0;for(const l of a){if(t.graftAndResolveOrphanValue(e,`${o}`,r,l))return!0;o++}return!1}function e2(t,e,i){const[n,s,...r]=i,a=t.resolveVertexValue(e,n);for(const o of r){const l=t.getVertexValue(o);if(!Array.isArray(l))continue;const[c,h]=l;if(a===c||Array.isArray(c)&&c.includes(a))return h}return t.resolveVertexValue(e,s)}var t2={$circular:i2,$isUserOption:n2,$palette:s2,$mapPalette:r2,$path:{dependencies:aA,resolve:a2},$pathString:{dependencies:aA,resolve:o2},$ref:l2};function i2(t,e,i){const[n]=i;t.setResolveFresh(!0);const s=t.resolveVertexValue(e,n);return t.setResolveFresh(!1),s}function n2(t,e,i){const[n,s,r]=i,a=t.neighboursWithEdgeValue(n,it);if(a)for(const o of a){const l=t.findNeighbour(o,Je);if(l&&sA(t,e,l))return t.resolveVertexValue(e,s)}else if(sA(t,e,n))return t.resolveVertexValue(e,s);return t.resolveVertexValue(e,r)}function sA(t,e,i){const n=t.resolveVertexValue(e,i);if(!ot(n))throw new Error(`\`$isUserOption\` json operation failed on [${String(n)}], expecting a string.`);const s=t.getPathArray(e),r=Ya(s,n);return r===ds?!1:t.hasUserOption(r)}var rA=new Set(["fill","fillFallback","stroke","gradient","range2"]);function s2(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n);if(!ot(s))return;if(rA.has(s)){const a=t.getPathArray(e),o=vl(a);if(Number.isNaN(o))return;switch(s){case"fill":return Mn(t.palette.fills,1,o)[0];case"fillFallback":return Mn(t.palette.fillsFallback,1,o)[0];case"stroke":return Mn(t.palette.strokes,1,o)[0];case"gradient":return Mn(t.palette.sequentialColors,1,o)[0];case"range2":return Mn(t.palette.fills,2,o)}return}if(s==="gradients")return t.palette.sequentialColors;if(s==="type")return t.paletteType;const r=Kt(t.palette,s.split("."));return Array.isArray(r)?[...r]:typeof r=="object"?{...r}:r}function r2(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n);if(!ot(s))return;if(rA.has(s)){const a=t.getPathArray(e);let o=vl(a),l=0;const c=["series","0","type"];for(let h=0;h<o;h++){c[1]=`${h}`;const u=t.getResolvedPath(c);(u==="map-shape-background"||u==="map-line-background")&&l++}if(o-=l,Number.isNaN(o))return;switch(s){case"fill":return Mn(t.palette.fills,1,o)[0];case"fillFallback":return Mn(t.palette.fillsFallback,1,o)[0];case"stroke":return Mn(t.palette.strokes,1,o)[0];case"gradient":return Mn(t.palette.sequentialColors,1,o)[0];case"range2":return Mn(t.palette.fills,2,o)}return}if(s==="gradients")return t.palette.sequentialColors;if(s==="type")return t.paletteType;const r=Kt(t.palette,s.split("."));return Array.isArray(r)?[...r]:typeof r=="object"?{...r}:r}function aA(t,e,i){const[n]=i,s=t.getVertexValue(n);if(ot(s)){const r=t.getPathArray(e),a=Ya(r,s);if(a===ds)return;const o=t.findVertexAtPath(a);o&&t.addEdge(e,o,yl)}}function a2(t,e,i){const n=i.length>1,s=i.length>2,[r,a,o]=i,l=t.resolveVertexValue(e,r),c=s?t.resolveVertexValue(e,o):null;if(!ot(l))throw new Error(`\`$path\` json operation failed on [${String(l)}], expecting a string.`);const h=t.getPathArray(e),u=Ya(h,l);if(u===ds)return;const d=c?Kt(c,u):t.getResolvedPath(u);if(d!=null)return d;if(n)return t.resolveVertexValue(e,a)}function o2(t,e,i){const[n,s]=i,r=t.resolveVertexValue(e,n);if(!ot(r))throw new Error(`\`$path\` json operation failed on [${String(r)}], expecting a string.`);let a;s&&(a=t.graftAndResolveOrphan(e,s));const o=t.getPathArray(e),l=Ya(o,r,a);if(l===ds)throw new Error(`Unresolvable path [${r}] at [${o.join(".")}]`);return l}function l2(t,e,i){const[n]=i,s=t.getVertexValue(n);return t.getParamValue(s)}var c2={$apply:h2,$applyCycle:u2,$applySwitch:d2,$applyTheme:g2,$clone:p2,$findFirstSiblingNotOperation:f2,$map:m2,$merge:y2,$omit:b2,$size:v2,$shallow:S2,$shallowSimple:x2,$value:M2};function h2(t,e,i){const[n,s,r,a]=i,o=t.getVertexValue(n);if(!ke(o))return;const l=s?t.getVertexValue(s):void 0,c=t.neighboursWithEdgeValue(e,it),h=c&&c.length>0;if(!h&&l==null)return Hi;const u=r?t.resolveVertexValue(e,r):void 0,d=a?t.resolveVertexValue(e,a):void 0;if(!h&&l!=null)if(ah(l)){const g=t.resolveVertexValue(e,s);ke(g)&&t.graftObject(e,g,[u,d])}else t.graftObject(e,l,[u,d]);if(!h)return Hi;for(const g of c){const p=t.neighboursWithEdgeValue(g,it);if(!p||p.length===0){const f=t.addVertex({});t.addEdge(g,f,Je)}else t.graftObject(g,o,[u,d])}return Hi}function u2(t,e,i){const[n,s,r]=i,a=t.resolveVertexValue(e,n);if(typeof a!="number")return;const o=t.getPathArray(e),l=t.dangerouslyGetUserOption(o),c=t.hasThemeOverride(o),h=l==null?void 0:ai,u=l??t.resolveVertexValue(e,s);if(!Array.isArray(u))return;const d=r?t.getVertexValue(r):void 0;for(let g=0;g<a;g++){const p=u[g%u.length];p!=null&&((l||!c)&&t.graftValue(e,`${g}`,p,void 0,h),d&&t.graftValue(e,`${g}`,d,p,h))}return Hi}function d2(t,e,i){const[n,s,...r]=i,a=t.resolveVertexValue(e,n);for(const o of r){const l=t.getVertexValue(o);if(!Array.isArray(l))continue;const[c,h]=l;if(a===c||Array.isArray(c)&&c.includes(a))return t.graftObject(e,h,[],Je),Hi}return t.resolveVertexValue(e,s)}function g2(t,e,i){const[n,s,r]=i;let a=t.getVertexValue(n);if(typeof a=="string"&&(a=[a]),!Array.isArray(a))return;const o=t.neighboursWithEdgeValue(e,it),l=r?t.getVertexValue(r):[],c=Array.isArray(l)?new Set(l):new Set;if(!o)return Hi;for(const h of o){const u=t.graftAndResolveOrphan(h,s);for(const d of a){const g=Ya([],d,u);g!==ds&&t.graftConfig(h,g,c)}}return Hi}function p2(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n);if(ke(s))return t.graftObject(e,s,void 0,ai),Hi}function f2(t,e,i){const[n]=i,s=t.getPathArray(e),r=Ya(s,"..");if(r===ds)return;const a=t.findVertexAtPath(r);if(!a)return t.resolveVertexValue(e,n);const o=t.neighboursWithEdgeValue(a,it);if(o)for(const l of o){const c=t.getPathArray(l);if(c[r.length]===s[r.length])continue;const h=c.concat(s.slice(r.length+1)),u=t.findVertexAtPath(h);if(!u)continue;const d=t.findNeighbourValue(u,ai);if(d!=null)return d;const g=t.findNeighbourValue(u,ji);if(g!=null)return g}return t.resolveVertexValue(e,n)}function m2(t,e,i){const[n,s]=i,r=t.getVertexValue(n),a=t.resolveVertexValue(e,s);if(!Array.isArray(a))return;const o=t.neighboursWithEdgeValue(e,it);if(o&&o.length>0)return;let l=0;for(const c of a)t.graftValue(e,`${l}`,r,c),l++;return Hi}function y2(t,e,i){for(const n of i){const s=t.resolveVertexValue(e,n);ke(s)&&t.graftObject(e,s)}return Hi}function b2(t,e,i){const[n,s]=i;let r=t.getVertexValue(n);if(!Array.isArray(r)){const o=AV(t,e,s);if(!o)return;r=t.resolveVertexValue(o,n)}const a=t.resolveVertexValue(e,s);if(!(!Array.isArray(r)||!ke(a)))return Y(a,r)}function v2(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n);return El(s)?"length"in s?s.length:Object.keys(s).length:0}function x2(t,e,i){const n=[];for(const s of i)n.push(t.getVertexValue(s));return n}function S2(t,e,i){const n=t.getPathArray(e),s=t.hasUserOption(n);if(!s&&i.length===1)return t.resolveVertexValue(e,i[0]);const r=[];for(const a of i)r.push(t.getVertexValue(a));return s?(t.prune(e,[ji,Je]),Hi):(t.graftObject(e,r),Hi)}function M2(t,e,i){const[n]=i,s=t.getVertexValue(n),r=t.getPathArray(e);if(s==="$index")return vl(r);if(s==="$parentIndex")return vl(r,1);if(s==="$1")return t.resolveValue$1(r)}var I2={$isEven:D2};function D2(t,e,i){const[n]=i,s=t.resolveVertexValue(e,n);return Number.isNaN(Number(s))?!1:Number(s)%2===0}var oh={...wV,...TV,...RV,...jV,...t2,...$V,...I2,...c2},oA=new Set(Object.keys(oh));function lh(t){return oA.has(t)}var $e=ue.create("opts","options-graph"),C2=Eu(A2);function A2(t,e){return $e.group("OptionsGraph.constructor()",()=>{const i=new lA(t.config,e,t.params,t.palette,t.overrides,t.getTemplateParameters());return{resolve(){return i.resolve()},resolveParams(){return i.resolveParams()},resolveAnnotationThemes(){return i.resolveAnnotationThemes()},resolvePartial(n,s,r){return i.resolvePartial(n,s,r)},clearSafe(){return i.clearSafe()}}})}var Pr=class Yt extends zx{constructor(e={},i={},n=void 0,s={},r=void 0,a=new Map){super({cachedNeighboursEdge:it,processedEdge:hs,singleValueEdges:new Set([Rr,ai])}),this.config=e,this.userOptions=i,this.palette=s,this.overrides=r,this.internalParams=a,this.edgePriority=[...Yt.EDGE_PRIORITY],this.graftEdge=Yt.GRAFT_EDGE,this.resolvedParams={},this.resolvedAnnotations={},this.value$1=new Map,this.cachedPathVertices=new Map,this.hasUnsafeClearKeys=!1,this.rollbackVertices=[],this.rollbackEdgesFrom=[],this.rollbackEdgesTo=[],this.rollbackEdgesValue=[],this.isRollingBack=!1,this.resolvedRootAncestorsPaths=new Set,this.resolveFresh=!1,this.EMPTY_PATH_ARRAY_VERTEX=this.addVertex([]),this.root=this.addVertex("root"),this.params=this.addVertex("params"),this.annotations=this.addVertex("annotations"),this.paletteType=he(i?.theme)?nC(i.theme?.palette):"inbuilt";const o=i.series?.[0]?.type??"line";$e("build user"),this.buildGraphFromObject(this.root,ai,Y(i,["theme"])),$e("build defaults"),this.buildGraphFromObject(this.root,Je,Y(e[o],Yt.COMPLEX_KEYS));const l=r?Y(r[o],Yt.COMPLEX_KEYS):{};Object.keys(l).length>0&&($e("build series overrides"),this.buildGraphFromObject(this.root,ji,l));const c=r?Y(r.common,Yt.COMPLEX_KEYS):{};Object.keys(c).length>0&&($e("build common overrides"),this.buildGraphFromObject(this.root,ji,ee.getSeriesModule(o)?.chartType==="cartesian"?c:Y(c,["zoom","navigator"]))),n&&($e("build params"),this.buildGraphFromObject(this.params,Je,n));const h=this.findNeighbourWithValue(this.root,"axes",it),u=this.findNeighbourWithValue(this.root,"series",it);h&&($e("build axes"),this.buildGraphFromObject(h,Je,{$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"]]})),u&&($e("build series"),this.buildGraphFromObject(u,Je,{$applyTheme:["/$seriesType/series",{seriesType:{$path:["./type","line"]}}]}));const d=Y(e[o]?.annotations??{},Yt.ANNOTATIONS_OPTIONS_KEYS);Object.keys(d).length>0&&($e("build annotations type config"),this.buildGraphFromObject(this.annotations,Je,d));const g=Y(r?.common?.annotations??{},Yt.ANNOTATIONS_OPTIONS_KEYS);Object.keys(g).length>0&&($e("build annotations type overrides"),this.buildGraphFromObject(this.annotations,ji,g));const p=eu(e[o]?.annotations??{},Yt.ANNOTATIONS_OPTIONS_KEYS);Object.keys(p).length>0&&($e("build annotations config"),this.buildGraphFromObject(this.root,Je,{annotations:p}));const f=eu(r?.common?.annotations??{},Yt.ANNOTATIONS_OPTIONS_KEYS);Object.keys(f).length>0&&($e("build annotations overrides"),this.buildGraphFromObject(this.root,ji,{annotations:f})),this.buildDependencyGraph()}static clearValueCache(){Yt.valueCache.clear()}clear(){$e.group("OptionsGraph.clear()",()=>{super.clear(),this.cachedPathVertices.clear(),this.root=void 0,this.params=void 0,this.annotations=void 0,$e("cleared")})}clearSafe(){this.hasUnsafeClearKeys||this.clear()}resolve(){return $e.group("OptionsGraph.resolve()",()=>(this.resolved={},this.resolvedParams={},this.resolvedAnnotations={},$e("resolve params"),this.resolveVertex(this.params,this.resolvedParams),$e("resolve annotations"),this.resolveVertex(this.annotations,this.resolvedAnnotations),$e("resolve root"),this.resolveVertex(this.root),$e("resolved root",this.resolved),$e("vertex count",this.getVertexCount()),$e("edge count",this.getEdgeCount()),this.resolved))}resolveParams(){return this.resolvedParams}resolveAnnotationThemes(){return this.resolvedAnnotations}addVertex(e){const i=super.addVertex(e);return this.isRollingBack&&this.rollbackVertices.push(i),i}addEdge(e,i,n){const s=(this.neighboursWithEdgeValue(e,n)?.indexOf(i)??-1)!==-1;this.isRollingBack&&!s&&(this.rollbackEdgesFrom.push(e),this.rollbackEdgesTo.push(i),this.rollbackEdgesValue.push(n)),super.addEdge(e,i,n)}resolvePartial(e,i,n){if(!i||!this.root)return;const{permissivePath:s,proxyPaths:r}=n??{},a=Object.keys(i);if($e.check()&&console.groupCollapsed(`OptionsGraph.resolvePartial() - ${e.join(".")} [${a}]`),a.length===0)return{};const o=this.findVertexAtPath(e);if(!o){if(s)return;throw new Error(`Could not find vertex in OptionsGraph at path [${e.join(".")}].`)}const l=this.findNeighbour(o,bn);if(this.userPartialOptions={},bl(this.userPartialOptions,e,i),r)for(const g of Object.keys(r)){const p=r[g],f=Kt(i,[g]);f!=null&&(bl(i,p,f),bl(this.userPartialOptions,[...e,...p],f),delete i[g],delete this.userPartialOptions[g])}this.graftEdge=Rr,this.edgePriority=[Rr,...Yt.EDGE_PRIORITY],this.snapshot(),this.buildGraphFromObject(o,Rr,i,l);for(const g of a){const p=r?.[g]?this.findVertexAtPath([...e,...r[g]]):this.findNeighbourWithValue(o,g,it);p&&this.refreshPendingProcessingEdges(p)}this.buildDependencyGraph();const c={};if(this.resolveVertex(o,c),this.rollback(),this.graftEdge=Yt.GRAFT_EDGE,this.edgePriority=Yt.EDGE_PRIORITY,this.userPartialOptions=void 0,r)for(const g of Object.keys(r)){const p=r[g],f=Kt(c,[...e,...p]);bl(c,[...e,g],f)}const h=Kt(c,e),d=n?.pick??!0?eu(Kt(c,e),a):h;return $e("vertex count",this.getVertexCount()),$e("edge count",this.getEdgeCount()),$e("resolved partial",d),$e.check()&&console.groupEnd(),d}findVertexAtPath(e){const i=e.join(".");if(this.cachedPathVertices.has(i))return this.cachedPathVertices.get(i);const n=this.findVertexAlongEdge(this.root,e,it);if(n)return this.cachedPathVertices.set(i,n),n}hasUserOption(e){if(rh(this.userOptions,e))return!0;const n=this.findVertexAtPath(e);if(n){if(this.findNeighbour(n,ai)!=null||this.findNeighbour(n,Rr)!=null)return!0;const s=this.findNeighbourValue(n,nA);return s===ai||s===Rr}return!1}dangerouslyGetUserOption(e){if(this.userPartialOptions){const i=Kt(this.userPartialOptions,e);if(i!=null)return i}return Kt(this.userOptions,e)}hasThemeOverride(e){if(this.overrides==null)return!1;if(e[0]==="axes"&&e.length>1){const i=this.getResolvedPath(["axes",e[1],"type"]);if(rh(this.overrides,["common","axes",i,...e.slice(2)]))return!0;const n=this.getResolvedPath(["series","0","type"]);return rh(this.overrides,[n,"axes",i,...e.slice(2)])}if(e[0]==="series"&&e.length>1){const i=this.getResolvedPath(["series",e[1],"type"]);return rh(this.overrides,[i,"series",...e.slice(2)])}return rh(this.overrides,e)}getParamValue(e){if(this.resolvedParams[e]!=null)return this.resolvedParams[e];const i=this.findVertexAlongEdge(this.params,[e],it);if(!i)return;const n=this.findNeighbour(i,Je);if(!n)return;const s=this.resolveVertexValue(i,n);return this.resolvedParams[e]=s,s}getPathArray(e){return this.findNeighbourValue(e,bn)??[]}getResolvedPath(e){return Kt(this.resolved,e)}getCachedValue(e,i){const n=[...e,i].join(".");return Yt.valueCache.get(n)}setCachedValue(e,i,n){const s=[...e,i].join(".");Yt.valueCache.set(s,n)}setResolveFresh(e){this.resolveFresh=e}prune(e,i){this.addEdge(e,this.addVertex(i),iA)}resolveVertexValue(e,i){this.resolveVertexDependencies(i);const n=this.findNeighbourValue(i,hs);if(n&&lh(n)){const r=this.neighboursWithEdgeValue(i,us),a=oh[n],l=(typeof a=="function"?a:a.resolve)?.(this,e,r??[]);return l===Hi?void 0:l}let s=this.getVertexValue(i);if(Array.isArray(s)){const r={};this.resolveVertexChildren(i,r),s=Kt(r,this.getPathArray(e))}return this.resolveValueOrSymbol(s)}resolveValue$1(e){for(let i=e.length;i>=0;i--){const n=e.slice(0,i).join("."),s=this.value$1.get(n);if(s!=null)return s}}graftConfig(e,i,n){const s=Kt(this.config,i),r=this.findNeighbour(e,bn);if(he(s)&&this.buildGraphFromObject(e,Je,s,r,void 0,n),this.overrides){const a=Kt(this.overrides,i);he(a)&&this.buildGraphFromObject(e,ji,a,r,void 0,n);const o=Kt(this.overrides,["common",...i.slice(1)]);he(o)&&this.buildGraphFromObject(e,ji,o,r,void 0,n)}this.buildDependencyGraph()}graftObject(e,i,n,s=this.graftEdge){const r=this.findNeighbour(e,bn);if(this.buildGraphFromObject(e,s,i,r),this.overrides&&n)for(const a of n){if(a==null)continue;const o=Kt(this.overrides,a);o&&this.buildGraphFromObject(e,ji,o,r)}this.buildDependencyGraph()}graftValue(e,i,n,s,r=this.graftEdge){const a=[...this.getPathArray(e),i],o=this.findVertexAtPath(a)??this.addVertex(i);this.value$1.set(a.join("."),s),this.buildGraphFromValue(e,o,r,a,n),this.buildDependencyGraph()}graftAndResolveOrphan(e,i){const n={},s=this.addVertex(n),r=this.getPathArray(e);return this.graftAndResolveChildren(i,s,r,[]),this.resolveVertex(s,n),Kt(n,r)}graftAndResolveOrphanValue(e,i,n,s,r=this.graftEdge){const a={},o=this.addVertex(a),c=[...this.getPathArray(e),i],h=this.findVertexAtPath(c)??this.addVertex(i);return this.value$1.set(c.join("."),s),this.buildGraphFromValue(o,h,r,c,n),this.resolveVertex(o,a),Kt(a,c)}buildGraphFromObject(e,i,n,s,r=Yt.SHALLOW_KEYS,a){const o=Object.keys(n),l=ah(n,o);if(l){const p=this.addVertex(n);this.addEdge(e,p,i),this.buildGraphFromOperation(p,i,l,s);return}if(o.length===0){this.addEdge(e,this.addVertex(Array.isArray(n)?[]:{}),i),this.buildGraphAutoEnable(e,i,n,void 0);return}const c=this.getVertexChildrenByKey(e),h=s?this.getVertexValue(s):[];let u;Array.isArray(n)&&this.addEdge(e,this.addVertex(i),nA);const d=[...h],g=h.length;for(const p of o){if(a?.has(p))continue;const f=c?.get(p)??this.addVertex(p);d[g]=p,r?.has(p)?this.buildShallowGraphFromValue(e,f,i,d,n[p]):this.buildGraphFromValue(e,f,i,d,n[p],r),p==="enabled"&&(u=f)}this.buildGraphAutoEnable(e,i,n,u)}buildGraphAutoEnable(e,i,n,s){if(i===Je&&!s||i===ai&&s||i!==Je&&i!==ai&&i!==Rr&&i!==ji)return;let r=this.findNeighbour(e,gb);r||(r=this.addVertex(gb),this.addEdge(e,r,gb)),s&&this.addEdge(s,r,tA);const{enabled:a,_enabledFromTheme:o}=n;this.addEdge(r,this.addVertex({enabled:a,_enabledFromTheme:o,keys:Object.keys(n).length}),i)}getVertexChildrenByKey(e){const i=this.neighboursWithEdgeValue(e,it);if(!i)return;const n=new Map;for(const s of i)n.set(this.getVertexValue(s),s);return n}buildGraphFromValue(e,i,n,s,r,a){this.addEdge(e,i,it);let o=this.findNeighbour(i,bn);o||(o=this.addVertex([...s]),this.addEdge(i,o,bn));const l=ah(r);if(l){const c=this.addVertex(r);this.addEdge(i,c,n),this.addEdge(c,o,bn),this.buildGraphFromOperation(c,n,l,o)}else if(El(r))this.buildGraphFromObject(i,n,r,o,a);else{const c=this.findNeighbour(i,n);if(c&&this.getVertexValue(c)===r)return;const h=this.addVertex(r);this.addEdge(i,h,n)}}buildShallowGraphFromValue(e,i,n,s,r){this.addEdge(e,i,it);let a=this.findNeighbour(i,bn);a||(a=this.addVertex([...s]),this.addEdge(i,a,bn));const o=this.addVertex(r);this.addEdge(i,o,n)}buildGraphFromOperation(e,i,n,s){const r=this.addVertex(n.operation);this.addEdge(e,r,hs);for(const a of n.values)this.buildGraphFromOperationValue(e,a,i,s)}buildGraphFromOperationValue(e,i,n,s=this.EMPTY_PATH_ARRAY_VERTEX){const r=this.addVertex(i);this.addEdge(e,s,bn),this.addEdge(e,r,us);const a=ah(i);a?this.buildGraphFromOperation(r,n,a,s):El(i)&&this.buildGraphFromObject(r,n,i,s)}buildDependencyGraph(){for(let e=0;e<this.pendingProcessingEdgesFrom.length;e++){const i=this.pendingProcessingEdgesFrom[e],n=this.pendingProcessingEdgesTo[e],s=this.getVertexValue(n);if(!lh(s))continue;const r=this.neighboursWithEdgeValue(i,us),a=oh[s];(typeof a=="function"?void 0:a.dependencies)?.(this,i,r??[])}this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[]}refreshPendingProcessingEdges(e){const n=this.findNeighbour(e,Je)??e,s=this.findNeighbour(n,hs);if(s){this.pendingProcessingEdgesFrom.push(n),this.pendingProcessingEdgesTo.push(s);const a=this.neighboursWithEdgeValue(n,us);if(a)for(const o of a)this.refreshPendingProcessingEdges(o)}const r=this.neighboursWithEdgeValue(e,it);if(r)for(const a of r)this.refreshPendingProcessingEdges(a)}resolveVertex(e,i=this.resolved,n){const s=this.getPathArray(e),r=s[0];if(s.length===1&&this.resolvedRootAncestorsPaths.add(r),!this.resolveFresh&&s.length>1&&!this.resolvedRootAncestorsPaths.has(r)){const a=this.findVertexAtPath([r]);if(a){this.resolveVertex(a,i,n);return}}if(!this.resolveFresh&&this.userPartialOptions==null&&i===this.resolved&&s.length>0){const a=Kt(i,s);if(a!=null&&!ke(a))return}this.resolveVertexInEdgePriority(e,i,s,n),this.resolveVertexAutoEnable(e,i,s),this.resolveVertexChildren(e,i,n)}resolveVertexInEdgePriority(e,i,n,s){const r=this.neighboursWithEdgeValue(e,it),[a]=this.edgePriority;for(const o of this.edgePriority){const l=this.findNeighbour(e,o);if(l==null)continue;const c=this.resolveVertexValueInternal(e,l);if(!(c==null&&o!==a)&&!(r&&r.length>0&&o!==a)&&!(Array.isArray(s)&&s.includes(o))){if(this.hasUnsafeClearKeys||(this.hasUnsafeClearKeys=c!=null&&Yt.UNSAFE_CLEAR_KEYS.has(n.at(-1))),n.length===0){if(c==null)continue;this.resolved=c}else bl(i,n,c);break}}}resolveVertexValueInternal(e,i){this.resolveVertexDependencies(i);const n=this.findNeighbourValue(i,hs);if(n&&lh(n)){const s=this.neighboursWithEdgeValue(i,us),r=oh[n],o=(typeof r=="function"?r:r.resolve)?.(this,e,s??[]);return o===Hi?void 0:o}return this.resolveValueOrSymbol(this.getVertexValue(i))}resolveVertexAutoEnable(e,i,n){const s=this.neighboursWithEdgeValue(e,tA)?.[0];if(!s)return;const r=this.findVertexAtPath(n),a=this.findNeighbourValue(s,Je),o=this.findNeighbourValue(s,ji),l=this.findNeighbourValue(s,ai),h=r&&this.findNeighbour(r,ai)!=null?void 0:this.findNeighbourValue(s,Rr);if(h?.enabled===!1)return;(l!=null&&l.enabled==null||h!=null&&h.enabled==null)&&!a?._enabledFromTheme&&!o?._enabledFromTheme&&bl(i,n,!0)}resolveVertexChildren(e,i,n){const s=this.neighboursWithEdgeValue(e,it);if(s){n??(n=this.findNeighbourValue(e,iA));for(const r of s){const a=this.getVertexValue(r);s.length>1&&lh(a)||a!=="_enabledFromTheme"&&this.resolveVertex(r,i,n)}}}resolveVertexDependencies(e){const i=this.neighboursWithEdgeValue(e,yl);if(i)for(const n of i)this.resolveVertex(n)}graftAndResolveChildren(e,i,n,s){const r=this.neighboursWithEdgeValue(e,it);if(r)for(const a of r){const o=this.getVertexValue(a),l=[...n,o],c=[...s,o],h=this.addVertex(o),u=this.findNeighbourValue(a,Je);this.addEdge(i,h,it);const d=this.addVertex(l);if(this.addEdge(h,d,bn),he(u)){this.buildGraphFromObject(h,Je,u,d);const g=this.findNeighbour(h,Je);this.addEdge(g,this.addVertex(l),bn);const p=this.findNeighbourValue(g,hs);if(lh(p)){const f=this.neighboursWithEdgeValue(g,us),m=oh[p];(typeof m=="function"?void 0:m.dependencies)?.(this,g,f??[])}}this.graftAndResolveChildren(a,h,l,c)}}resolveValueOrSymbol(e){return typeof e=="symbol"&&this.internalParams?.has(e)?this.internalParams.get(e):e}snapshot(){$e("snapshot"),this.isRollingBack=!0}rollback(){$e(`rollback ${this.rollbackEdgesFrom.length} edges and ${this.rollbackVertices.length} vertices`);for(let e=0;e<this.rollbackEdgesFrom.length;e++){const i=this.rollbackEdgesFrom[e],n=this.rollbackEdgesTo[e],s=this.rollbackEdgesValue[e];this.removeEdge(i,n,s)}for(const e of this.rollbackVertices)this.removeVertex(e);this.cachedPathVertices.clear(),this.rollbackVertices=[],this.rollbackEdgesFrom=[],this.rollbackEdgesTo=[],this.rollbackEdgesValue=[],this.isRollingBack=!1}diagram(e,i=2){this.diagramKeys=new Map,this.diagramEdges=new Map;const n=this.findVertexAtPath(e),s=["---","config:","  layout: elk","  look: neo","  theme: redux","---","flowchart TB"];n&&this.diagramVertex(s,n,1,i),s.push("classDef UO fill: #e8f5e8, stroke: #4caf50"),s.push("classDef DE fill: #e3f2fd, stroke: #2196f3"),s.push("classDef DEP fill: #ffe0fd, stroke: #ff00f2"),s.push("classDef OP fill: #fff3e0, stroke: #ff9800"),s.push("classDef OPV fill: #fff3e0, stroke: #ff9800, stroke-width: 1px"),s.push("classDef OV fill: #e8f5ee, stroke: #4caf87"),console.log(s.join(`
`))}diagramKey(e){let i=this.diagramKeys.get(e);return i||(i=`${this.diagramKeys.size}`,this.diagramKeys.set(e,i)),i}diagramLabel(e,i,n){let s=this.diagramKeys.get(e);if(s)return s;s=this.diagramKey(e);const r={[ai]:"UO",[Je]:"DE",[yl]:"DEP",[hs]:"OP",[us]:"OPV",[ji]:"OV"};let a=n?r[n]??void 0:void 0;return a=a?`:::${a}`:"",typeof i.value=="symbol"?`${s}[/"[symbol]"\\]${a}`:Array.isArray(i.value)?`${s}[/"[array]"\\]${a}`:typeof i.value=="object"?`${s}[/"[object]"\\]${a}`:n===Je||n===ai||n===ji?`${s}("${i.value}")${a}`:`${s}["${i.value}"]${a}`}diagramVertex(e,i,n,s){const r=this.getPathArray(i),a=r.length>0?r.join("."):"root";this.diagramNeighbours(e,a,i,n+1,s);let o=this.diagramKeys.get(a);o||(o=this.diagramKey(a),e.push(`	${o}["${i.value}"]`))}diagramNeighbours(e,i,n,s,r){for(const g of this.neighboursWithEdgeValue(n,it)??[]){const p=this.getPathArray(g),f=p.length>0?p.join("."):"root";s<r&&this.diagramVertex(e,g,s+1,r),this.diagramChild(e,it,i,n,f,n)}const a=this.neighboursWithEdgeValue(n,ai)??[];let o=0;for(const g of a)this.diagramChild(e,ai,i,n,`${i}.${ai}.${o}`,g),o++;const l=this.neighboursWithEdgeValue(n,Je)??[];o=0;for(const g of l)this.diagramChildWithNeighbours(e,Je,i,n,`${i}.${Je}.${o}`,g,s+1,r),o++;const c=this.neighboursWithEdgeValue(n,hs)??[];o=0;const[h]=c;h&&(this.diagramChildWithNeighbours(e,hs,i,n,`${i}.${hs}.${o}`,h,s+1,r),o++);const u=this.neighboursWithEdgeValue(n,us)??[];o=0;for(const g of u)this.diagramChildWithNeighbours(e,us,i,n,`${i}.${us}.${o}`,g,s+1,r),o++;const d=this.neighboursWithEdgeValue(n,yl)??[];o=0;for(const g of d)this.diagramChildWithNeighbours(e,yl,i,n,this.getPathArray(g).join("."),g,s+1,r),o++}diagramChild(e,i,n,s,r,a){let o=this.diagramEdges.get(n);if(o?.has(r))return;o||(o=new Set,this.diagramEdges.set(n,o)),o.add(r);const l=i===it?"":`|${i}|`;e.push(`	${this.diagramLabel(n,s)} -->${l} ${this.diagramLabel(r,a,i)}`)}diagramChildWithNeighbours(e,i,n,s,r,a,o,l){this.diagramChild(e,i,n,s,r,a),this.diagramNeighbours(e,r,a,o+1,l)}};Pr.EDGE_PRIORITY=[ai,ji,Je],Pr.GRAFT_EDGE=Je,Pr.SHALLOW_KEYS=new Set(["context","data","topology"]),Pr.COMPLEX_KEYS=["annotations","axes","series"],Pr.ANNOTATIONS_OPTIONS_KEYS=["axesButtons","data","enabled","optionsToolbar","snap","toolbar","xKey","volumeKey"],Pr.UNSAFE_CLEAR_KEYS=new Set(["itemStyler","styler"]),Pr.valueCache=new Map;var lA=Pr,cA=t=>`'${t}'`,mb="__AXIS_ID_",Za={top:"x",bottom:"x",left:"y",right:"y"},Xa=class Bt{constructor(e,i,n,s,r,a,o=!1,l){this.themeParameters={},this.optionMetadata=r??{},this.processedOverrides=n??{};let c=null;e instanceof Bt?(c=e,this.specialOverrides=c.specialOverrides,a&&(this.userDeltaKeys=new Set(Object.keys(a))),a??(a=es(c.userOptions,i,Bt.JSON_DIFF_OPTS)),this.userOptions=He(Yl(a,c.userOptions),{...Bt.OPTIONS_CLONE_OPTS_SLOW,seen:[]})):(this.userOptions=He(e??i,{...Bt.OPTIONS_CLONE_OPTS_SLOW,seen:[]}),this.specialOverrides=this.specialOverridesDefaults({...s})),this.findSeriesWithUserVisiblity(i,a),o&&this.removeLeftoverSymbols(this.userOptions);const h=e instanceof Bt&&a?.data!==void 0&&a?.data?.length!==e.userOptions.data?.length;let u,d,g,p,f,m,y;if(!o&&this.seriesWithUserVisibility==null&&a!==void 0&&Bt.isFastPathDelta(a)&&c!=null&&!h?({activeTheme:u,processedOptions:d,fastDelta:g}=this.fastSetup(a,c),p=c.themeParameters,f=c.annotationThemes):(Bt.perfDebug("ChartOptions.slowSetup()"),{activeTheme:u,processedOptions:d,themeParameters:p,annotationThemes:f,googleFonts:m,optionsGraph:y}=this.slowSetup(n,a,o)),this.activeTheme=u,this.processedOptions=d,this.fastDelta=g??void 0,this.themeParameters=p,this.annotationThemes=f,this.googleFonts=m,this.optionsGraph=y,l!==void 0&&typeof l=="number"&&!Number.isNaN(l)){const b=performance.now();this.optionsProcessingTime=b-l}ue.inDevelopmentMode(()=>hn(this))}static isFastPathDelta(e){for(const i of Object.keys(e??{}))if(!this.FAST_PATH_OPTIONS.has(i))return Bt.perfDebug("ChartOptions.isFastPathDelta() - slow path required due to presence of: ",i),!1;return Bt.perfDebug("ChartOptions.isFastPathDelta() - fast path possible."),!0}findSeriesWithUserVisiblity(e,i){for(const n of[e,i]){const s=n?.series;if(Array.isArray(s))for(let r=0;r<s.length;r++){const a=s[r];"visible"in a&&(this.seriesWithUserVisibility??(this.seriesWithUserVisibility={identifiers:new Set,indices:new Set}),a.id?this.seriesWithUserVisibility.identifiers.add(a.id):this.seriesWithUserVisibility.indices.add(r))}}}fastSetup(e,i){const{activeTheme:n,processedOptions:s}=i,{presetType:r}=this.optionMetadata;if(r!=null&&e?.data!=null){const o=ee.getPresetModule(r);if(o?.processData){const{series:l,data:c}=o.processData(e.data);e=ge({series:l,data:c},e)}}this.fastSeriesSetup(e,s);const a=ge(e,s);return Bt.debug("ChartOptions.fastSetup() - processed options",a),{activeTheme:n,processedOptions:a,fastDelta:e}}fastSeriesSetup(e,i){e?.series&&(e.series?.every((n,s)=>jx(n,i.series?.[s]??{}))?delete e.series:e.series=e.series.map((n,s)=>Yl(n,i.series?.[s]??{})))}slowSetup(e,i,n=!1){let s=He(this.userOptions,Bt.OPTIONS_CLONE_OPTS_FAST);i&&(s=ge(i,s),n&&this.removeLeftoverSymbols(s));let r=sC(pg(s.theme));const{presetType:a}=this.optionMetadata;if(a!=null){const m=ee.getPresetModule(a);if(m){const{validate:y=zt}=m,b=s,v=s.type,S=v==null?void 0:r.presets[v],{cleared:M,invalid:C}=y(b,m.options,"");for(const D of C)j.warn(D);jr(C,"")?s={}:(Bt.debug(">>> AgCharts.createOrUpdate() - applying preset",M),s=m.create(M,S,()=>this.activeTheme),r=sC(pg(s.theme)))}}this.soloSeriesIntegrity(s),a!=null&&r.templateTheme(s,!1),aC(void 0,s);const o=this.validateSeriesOptions(s),l=fg(s);if(this.chartDef=ee.getChartModule(l),!this.chartDef.placeholder){const{validate:m=zt}=this.chartDef,{cleared:y,invalid:b}=m(s,this.chartDef.options,"");for(const v of b)j.warn(v);s=y}this.validateAxesOptions(s),this.removeDisabledOptions(s);let c=this.processFonts(r.params);c=this.processFonts(s,c),this.processSeriesOptions(s);const h=this.processAxesOptions(s,l),u=C2(r,s),d=u.resolve(),g=u.resolveParams(),p=u.resolveAnnotationThemes();u.clearSafe();const f=ge(e,d);return aC(this.chartDef.name,f),JF(this.chartDef.name,f,o),this.validateSeriesOptions(f,{silentAdvisories:!0}),this.validateAxesOptions(f,h,{silentAdvisories:!0}),this.validatePluginOptions(f,{silentAdvisories:!0}),this.processMiniChartSeriesOptions(f),f.loadGoogleFonts||c.clear(),Bt.debug(()=>["ChartOptions.slowSetup() - processed options",He(f)]),{activeTheme:r,processedOptions:f,themeParameters:g,annotationThemes:p,googleFonts:c,optionsGraph:u}}validatePluginOptions(e,i={}){for(const n of ee.listModulesByType("plugin")){const s=n.name;if(s in e&&n.options!=null&&(!n.chartType||n.chartType===this.chartDef?.name)){const{cleared:r,invalid:a}=zt(e[s],n.options,n.name,i);for(const o of a)j.warn(o);e[s]=r}}}validateSeriesOptions(e,i={}){const n=this.chartDef?.name,s=[],r=e.series?.length??0,a=[];let o;for(let l=0;l<r;l++){const c=`series[${l}]`,h=e.series[l],u=ee.getSeriesModule(h.type);if(u==null){const f=ee.isEnterprise();o??(o=Ws(Array.from(Or.values()).filter(y=>y.type==="series"&&(f||!y.enterprise)&&(!n||y.chartType===n)).map(y=>y.name),"or",cA));const m=Or.get(h.type);if(h.type!=null&&m?.type==="series"){a.push(m);continue}j.warn(h.type==null?`Option \`${c}.type\` is required and has not been provided; expecting ${o}, ignoring.`:`Unknown type \`${h.type}\` at \`${c}.type\`; expecting ${o}, ignoring.`);continue}else if(n&&u.chartType!==n){j.warn(`Series type \`${u.name}\` at \`${c}.type\` is not supported by chart type \`${n}\`, ignoring.`);continue}if(u.options==null){s.push(h);continue}const{validate:d=zt}=u,{cleared:g,invalid:p}=d(h,u.options,c,i);for(const f of p)j.warn(f);jr(p,c)||s.push(g)}return e.series=s,a}validateAxesOptions(e,i,n={}){if(!("axes"in e)||!e.axes)return;const s=this.chartDef?.name,r={};let a;for(const[o,l]of vt(e.axes)){if(!l)continue;if(l.type==null){r[o]=l;continue}const c=`axes.${i?.get(o)??o}`,h=ee.getAxisModule(l.type);if(h==null){const p=ee.isEnterprise();a??(a=Ws(Array.from(Or.values()).filter(m=>m.type==="axis"&&(p||!m.enterprise)&&m.chartType===s).map(m=>m.name),"or",cA)),Or.get(l.type)?.type!=="axis"&&j.warn(`Unknown type \`${l.type}\` at \`${c}.type\`; expecting one of ${a}, ignoring.`);continue}else if(h.chartType!==s){j.warn(`Axis type \`${h.name}\` at  \`${c}.type\` is not supported by chart type \`${s}\`, ignoring.`);break}const{validate:u=zt}=h,{cleared:d,invalid:g}=u(l,h.options,c,n);for(const p of g)j.warn(p);jr(g,c)||(r[o]=d)}e.axes=r}diffOptions(e){return this===e?{}:e==null?this.processedOptions:this.fastDelta??es(e.processedOptions,this.processedOptions,Bt.JSON_DIFF_OPTS)}optionsType(e){return e.series?.[0]?.type??"line"}processSeriesOptions(e){const i=e.displayNullData,n=e.series?.map(s=>{const a=!!ee.getSeriesModule(s.type)?.options?.visible,o={};return a&&(o.visible=!0),i!==void 0&&s.allowNullKeys===void 0&&(o.allowNullKeys=i),ge(this.getSeriesGroupingOptions(s),s,o)});e.series=this.setSeriesGroupingOptions(n??[])}processAxesOptions(e,i){const n=i==="polar"?["angle","radius"]:["x","y"],s="axes"in e&&Object.keys(e.axes??{}).length>0,r=this.countNonDefaultSeriesAxisKeys(e,n),a=r>0,o=a&&r<(e?.series?.length??0),l=e.series?.[0],c=this.optionsType(e),h=this.predictAxes(c,n,l,e.data)??this.cloneDefaultAxes(c),u=he(l)&&"direction"in l&&l.direction==="horizontal"&&ee.getSeriesModule(l.type)?.axisKeysFlipped!=null;if(!s&&!a&&!u){e.axes=h;return}const d="axes"in e?new Set(Object.keys(e.axes??{})):new Set,g=this.getPrimaryAxisKeys(e,n,d,a),p=this.getRemappedAxisKeys(d,g,n,o),f={},m=new Map;for(const[y,b]of p)f[b]="axes"in e?ea(e.axes?.[y]):void 0,m.set(b,y);return this.remapSeriesAxisKeys(e,n,f,p,h,o),this.predictAxesMissingTypesAndPositions(e,n,f,h),this.alternateSecondaryAxisPositions(e,f,m),e.axes=f,m}getSeriesDirectionAxisKey(e,i){const n=ee.getSeriesModule(e.type);return n?"direction"in e&&e.direction==="horizontal"&&n.axisKeysFlipped?n.axisKeysFlipped[i]:n.axisKeys?.[i]:void 0}countNonDefaultSeriesAxisKeys(e,i){let n=0;for(const s of e.series??[])for(const r of i){const a=this.getSeriesDirectionAxisKey(s,r);!a||!Fl(a,s)||s[a]!==r&&n++}return n}getPrimaryAxisKeys(e,i,n,s){const r=new Map;for(const a of i){let o=!1;if("axes"in e&&e.axes&&!(a in e.axes&&he(e.axes[a])&&!("position"in e.axes[a]))){for(const[l,c]of vt(e.axes))if("position"in c&&c.position&&a===Za[c.position]){r.set(a,l),o=!0;break}}if(!o&&s)for(const l of e.series??[]){const c=this.getSeriesDirectionAxisKey(l,a);if(!c)continue;const h=l[c];if(!n.has(h)){if(!h){r.set(a,a);break}r.set(a,h);break}}}if(n.size===0||!("axes"in e)||!e.axes)return r;if(r.size===0)for(const a of i)a in e.axes&&r.set(a,a);if(r.size===0){for(const a of i)for(const[o,l]of vt(e.axes))if(l.type?.startsWith(a)){r.set(a,o);break}}if(r.size===0&&(e.series?.length??0)>0)for(const a of i)for(const o of e.series){const l=this.getSeriesDirectionAxisKey(o,a);if(!l)continue;const c=o[l];if(n.has(c)){r.set(a,c);break}}if(r.size<2){const a=new Set(r.values());for(const[o,l]of vt(e.axes))if(!(a.has(o)||"position"in l)){for(const c of i)if(!r.has(c)){r.set(c,o),a.add(o);break}if(r.size===2)break}}return r}getRemappedAxisKeys(e,i,n,s){const r=new Map;for(const[a,o]of i)r.set(o,a);for(const a of e)r.has(a)||r.set(a,`${mb}${r.size}`);if(s)for(const a of n)r.has(a)||r.set(a,`${mb}${r.size}`);return r}remapSeriesAxisKeys(e,i,n,s,r,a){for(const o of e.series??[])for(const l of i){const c=this.getSeriesDirectionAxisKey(o,l);if(!c)continue;n[l]??(n[l]=ea(r[l]));let h=l;if(c in o){const u=o[c];s.has(u)?h=s.get(u):(h=`${mb}${s.size}`,s.set(u,h),n[h]=ea(r[l]))}else s.has(l)&&a&&(h=s.get(l),n[h]??(n[h]=ea(r[l])));o[c]=h}}predictAxes(e,i,n,s){if(!n)return;const r=n?.data??s;if(!r?.length)return;const a=ee.getSeriesModule(e)?.predictAxis;if(!a)return;const o=new Map,l=zb(0,r.length-1,5);for(const c of l){const h=r[c];for(const u of i){const d=a(u,h,n);if(!o.has(u)){o.set(u,d);continue}const g=o.get(u);if(!(!d&&!g)){if(!d||!g)return;for(const p of Object.keys(g))if(g[p]!==d[p])return}}}for(const[c,h]of o)h||o.delete(c);if(o.size!==0){if(o.size===1){const[c]=o.values(),h=this.cloneDefaultAxes(e);return"position"in c?tp(h,u=>"position"in u&&u.position===c.position?c:u):void 0}return Object.fromEntries(o)}}cloneDefaultAxes(e){const i=ee.getSeriesModule(e);return i?.defaultAxes?He(i.defaultAxes):{}}predictAxesMissingTypesAndPositions(e,i,n,s){for(const[r,a]of vt(n)){if(!ke(a)||"type"in a&&"position"in a)continue;if(r in s){a.type??(a.type=s[r].type),a.position??(a.position=s[r].position);continue}this.predictAxisMissingTypeFromPosition(a,s)||(this.predictAxisMissingTypeAndPositionFromSeries(e,i,r,a,s),"type"in a||delete n[r])}}predictAxisMissingTypeFromPosition(e,i){if(!("position"in e)||!Fl(e.position,Za))return!1;for(const n of Object.values(i))if(Fl(n.position,Za)&&Za[e.position]===Za[n.position])return e.type=n.type,!0;for(const[n,s]of vt(Za))if(e.position!==n&&s===Za[e.position])return e.type=i[s].type,!0;return!1}predictAxisMissingTypeAndPositionFromSeries(e,i,n,s,r){for(const a of e.series??[])for(const o of i){const l=this.getSeriesDirectionAxisKey(a,o);if(!(!l||!Fl(l,a))&&a[l]===n)return s.type??(s.type=r[o].type),s.position??(s.position=r[o].position),o==="y"}return!1}alternateSecondaryAxisPositions(e,i,n){let s=0,r=0;for(const[a,o]of vt(i)){if(!ke(o)||!("position"in o))continue;const l=n.get(a),c="axes"in e&&e.axes&&l&&l in e.axes?e.axes[l]:void 0,h=c&&"position"in c?c.position:void 0;if(o.position==="top"||o.position==="bottom"?(s+=1,s===2&&h==null&&(o.position="top")):(o.position==="left"||o.position==="right")&&(r+=1,r===2&&h==null&&(o.position="right")),s>1&&r>1)break}}processMiniChartSeriesOptions(e){const i=e.navigator?.miniChart?.series;i!=null&&(e.navigator.miniChart.series=this.setSeriesGroupingOptions(i))}getSeriesGroupingOptions(e){const{groupable:i,stackable:n,stackedByDefault:s=!1}=ee.getSeriesModule(e.type);e.grouped&&!i&&j.warnOnce(`unsupported grouping of series type "${e.type}".`),(e.stacked||e.stackGroup)&&!n&&j.warnOnce(`unsupported stacking of series type "${e.type}".`);let{grouped:r,stacked:a}=e;return a??(a=(s||e.stackGroup!=null)&&!(i&&r)),r??(r=!0),{stacked:n&&a,grouped:i&&r&&!(n&&a)}}setSeriesGroupingOptions(e){const i=this.getSeriesGrouping(e);Bt.debug("ChartOptions.setSeriesGroupingOptions() - series grouping: ",i);const n={},s=i.reduce((r,a)=>{var o;return a.groupType==="default"||(r[o=a.seriesType]??(r[o]=0),r[a.seriesType]+=a.groupType==="stack"?1:a.series.length),r},{});return i.flatMap(r=>{var a;switch(n[a=r.seriesType]??(n[a]=0),r.groupType){case"stack":{const o=n[r.seriesType]++;return r.series.map((l,c)=>Object.assign(l,{seriesGrouping:{groupId:r.groupId,groupIndex:o,groupCount:s[r.seriesType],stackIndex:c,stackCount:r.series.length}}))}case"group":return r.series.map(o=>Object.assign(o,{seriesGrouping:{groupId:r.groupId,groupIndex:n[r.seriesType]++,groupCount:s[r.seriesType],stackIndex:0,stackCount:0}}))}return r.series}).map(({stacked:r,grouped:a,...o})=>o)}getSeriesGroupId(e){return[e.type,e.xKey,e.stacked?e.stackGroup??"stacked":"grouped"].filter(Boolean).join("-")}getSeriesGrouping(e){const i=new Map;return e.reduce((n,s)=>{const r=s.type;if(!s.stacked&&!s.grouped)n.push({groupType:"default",seriesType:r,series:[s],groupId:"__default__"});else{const a=this.getSeriesGroupId(s);if(!i.has(a)){const l={groupType:s.stacked?"stack":"group",seriesType:r,series:[],groupId:a};i.set(a,l),n.push(l)}i.get(a).series.push(s)}return n},[])}soloSeriesIntegrity(e){if(!ce(e.series))return;const i=s=>ee.getSeriesModule(s)?.solo??!1,n=e.series;if(n&&n.length>1&&n.some(s=>i(s.type))){const s=this.optionsType(e);if(i(s))j.warn(`series[0] of type '${s}' is incompatible with other series types. Only processing series[0]`),e.series=n.slice(0,1);else{const{solo:r,nonSolo:a}=Cl(n,l=>i(l.type)?"solo":"nonSolo"),o=Dg(r.map(l=>l.type)).join(", ");j.warn(`Unable to mix these series types with the lead series type: ${o}`),e.series=a}}}static processFontOptions(e,i,n,s=new Set){if(typeof e=="object"&&"fontFamily"in e)if(Array.isArray(e.fontFamily)){const r=[];for(const a of e.fontFamily)typeof a=="object"&&"googleFont"in a?(r.push(a.googleFont),s?.add(a.googleFont)):r.push(a);e.fontFamily=r.join(", ")}else typeof e.fontFamily=="object"&&"googleFont"in e.fontFamily&&(e.fontFamily=e.fontFamily.googleFont,s?.add(e.fontFamily));return s}processFonts(e,i=new Set){return gr(e,Bt.processFontOptions,new Set(["data","theme"]),void 0,void 0,i)}static removeDisabledOptionJson(e){if("enabled"in e&&e.enabled===!1)for(const i of Object.keys(e))i!=="enabled"&&delete e[i]}removeDisabledOptions(e){gr(e,Bt.removeDisabledOptionJson,new Set(["data","theme","contextMenu","ranges"]))}static removeLeftoverSymbolsJson(e){if(!(!e||!he(e)))for(const i of Object.keys(e)){const n=e[i];Pl(n)&&delete e[i]}}removeLeftoverSymbols(e){gr(e,Bt.removeLeftoverSymbolsJson,new Set(["data"]))}specialOverridesDefaults(e){if(e.window==null?e.window=Hn():jb(e.window),e.document==null?e.document=Gr():Gb(e.document),e.window==null)throw new Error("AG Charts - unable to resolve global window");if(e.document==null)throw new Error("AG Charts - unable to resolve global document");return e}};Xa.OPTIONS_CLONE_OPTS_SLOW={shallow:new Set(["data","container"]),assign:new Set(["context","theme"])},Xa.OPTIONS_CLONE_OPTS_FAST={shallow:new Set(["container"]),assign:new Set(["data","context","theme"])},Xa.JSON_DIFF_OPTS=new Set(["data","localeText"]),Xa.perfDebug=ue.create(!0,"perf"),Xa.FAST_PATH_OPTIONS=new Set(["data","width","height","container"]),Xa.debug=ue.create(!0,"opts");var ch=Xa,mg=ue.create(!0,"opts"),Fr="AG Charts - Chart was destroyed, cannot perform request.",hh=class{constructor(e,i,n){this.factoryApi=i,this.licenseManager=n,this.chart=e}async update(e){if(!this.chart)throw new Error(Fr);return mg.group("AgChartInstance.update()",async()=>{const i=ue.check("scene:stats","scene:stats:verbose")?performance.now():void 0;this.factoryApi.update(e,this,void 0,i),await this.chart?.waitForUpdate()})}async updateDelta(e){if(!this.chart)throw new Error(Fr);return mg.group("AgChartInstance.updateDelta()",async()=>{const i=ue.check("scene:stats","scene:stats:verbose")?performance.now():void 0;this.factoryApi.updateUserDelta(this,e,i),await this.chart?.waitForUpdate()})}getOptions(){if(!this.chart)throw new Error(Fr);const e=He(this.chart.getOptions(),ch.OPTIONS_CLONE_OPTS_FAST);for(const i of Object.keys(e))i.startsWith("_")&&delete e[i];return e}waitForUpdate(){if(!this.chart)throw new Error(Fr);return this.chart.waitForUpdate()}applyTransaction(e){const{chart:i}=this;if(!i)throw new Error(Fr);if(e==null||typeof e!="object")throw new Error("AG Charts - applyTransaction expects a transaction object.");const{add:n,addIndex:s,remove:r,update:a}=e;if(n!=null&&!Array.isArray(n))throw new Error('AG Charts - transaction "add" must be an array.');if(s!=null){if(typeof s!="number"||!Number.isSafeInteger(s)||s<0)throw new Error('AG Charts - transaction "addIndex" must be a safe non-negative integer (0 to 9007199254740991).');if(n==null||n.length===0)throw new Error('AG Charts - transaction "addIndex" requires a non-empty "add" array.')}if(r!=null&&!Array.isArray(r))throw new Error('AG Charts - transaction "remove" must be an array.');if(a!=null&&!Array.isArray(a))throw new Error('AG Charts - transaction "update" must be an array.');return mg.group("AgChartInstance.applyTransaction()",async()=>{if(!i.isDataTransactionSupported()){const o=i.data.deepClone();return o.addTransaction(e),o.commitPendingTransactions(),this.updateDelta({data:o.data})}return mg("transaction",e),this.chart?.applyTransaction(e)})}async download(e){if(!this.chart)throw new Error(Fr);const i=await this.prepareResizedChart(this,this.chart,e);try{i.chart?.download(e?.fileName,e?.fileFormat)}finally{i.destroy()}}async __toSVG(e){if(!this.chart)throw new Error(Fr);const i=await this.prepareResizedChart(this,this.chart,{width:600,height:300,...e});try{return i?.chart?.toSVG()}finally{i?.destroy()}}async getImageDataURL(e){if(!this.chart)throw new Error(Fr);const i=await this.prepareResizedChart(this,this.chart,e);try{return i.chart.getCanvasDataURL(e?.fileFormat)}finally{i.destroy()}}getState(){return this.factoryApi.caretaker.save(...this.getEnabledOriginators())}async setState(e){if(!this.chart)return;const{interactionManager:i,legendManager:n,zoomManager:s}=this.chart.ctx,r=this.getEnabledOriginators(),a=new Set(r);i.isState(2)||(n&&s&&a.has(n)&&a.has(s)?(a.delete(s),await this.setStateOriginators(e,Array.from(a)),await this.setStateOriginators(e,[s])):await this.setStateOriginators(e,r))}getSelection(){return this.chart?.getSelection()??[]}setSelection(e){return this.chart?.setSelection(e)}clearSelection(){return this.chart?.clearSelection()}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(e,i,n={}){const s=n.width??i.width??i.ctx.scene.canvas.width,r=n.height??i.height??i.ctx.scene.canvas.height,a=e.getState(),o=i.chartOptions.specialOverrides.document??Gr(),l={...i.chartOptions.processedOverrides,container:o.createElement("div"),width:s,height:r};n.width!=null&&n.height!=null&&(l.overrideDevicePixelRatio=1);const c=i.getOptions();if(ee.isEnterprise()){l.animation={enabled:!1};const m=this.licenseManager?.getWatermarkForegroundConfigForBrowser();m&&(l.foreground=m)}const h={...i.chartOptions.specialOverrides},u={...i.chartOptions.optionMetadata},d=await this.chart?.ctx.dataService.getData(),g=this.factoryApi.create(c,l,h,u,d);a.legend&&this.syncLegend(i,g,a),g.chart?.update(0,{forceNodeDataRefresh:!0}),await g.waitForUpdate(),await g.setState(a);const p={source:"chart-update",sourceDetail:"internal-prepareResizedChart"};g.chart?.ctx.zoomManager?.updateZoom(p,i.ctx.chartState.getValue("zoom")),g.chart?.update(0,{forceNodeDataRefresh:!0}),await g.waitForUpdate();const f=[];for(const m of i.modulesManager.legends())f.push(m.legend.pagination?.currentPage??0);for(const m of g.chart.modulesManager.legends()){const y=f.shift()??0;m.legend.pagination&&m.legend.pagination.setPage(y)}return g.chart?.update(0,{forceNodeDataRefresh:!0}),await g.waitForUpdate(),g}syncLegend(e,i,n){const s=new Map;for(const[r,a]of e.series.entries()){const o=i.chart?.series[r];o&&s.set(a.id,o.id)}n.legend=n.legend?.map(r=>({...r,seriesId:s.get(r.seriesId??"")??r.seriesId}))}getEnabledOriginators(){if(!this.chart)return[];const{chartOptions:{processedOptions:e,optionMetadata:i},ctx:{annotationManager:n,chartTypeOriginator:s,zoomManager:r,legendManager:a},modulesManager:o}=this.chart,l=[];return"annotations"in e&&e.annotations?.enabled&&n&&l.push(n),i.presetType==="price-volume"&&l.push(s),(e.navigator?.enabled||e.zoom?.enabled)&&r&&l.push(r),o.isEnabled("legend")&&e.legend?.enabled!==!1&&a&&l.push(a),l.push(this.chart.ctx.activeManager),l.push(this.chart.ctx.collapsedManager),l}async setStateOriginators(e,i){this.factoryApi.caretaker.restore(e,...i),this.chart?.ctx.eventsHub.emit("chart:request-update",{type:2,opts:{forceNodeDataRefresh:!0}}),await this.chart?.waitForUpdate()}};hh.chartInstances=new WeakMap,x([ui({oldValue(t){t.destroyed||(t.publicApi=void 0),hh.chartInstances.delete(t)},newValue(t){t&&(t.publicApi=this,hh.chartInstances.set(t,this))}})],hh.prototype,"chart",2);var hA=hh,w2=1e3,yb=class zr{constructor(e,i,n,s,r,a=w2){this.name=e,this.buildItem=i,this.releaseItem=n,this.destroyItem=s,this.maxPoolSize=r,this.cleanupTimeMs=a,this.freePool=[],this.busyPool=new Set}static getPool(e,i,n,s,r){return this.pools.has(e)||this.pools.set(e,new zr(e,i,n,s,r)),this.pools.get(e)}isFull(){return this.freePool.length+this.busyPool.size>=this.maxPoolSize}hasFree(){return this.freePool.length>0}obtain(e){if(!this.hasFree()&&this.isFull())throw new Error("AG Charts - pool exhausted");let i=this.freePool.pop();return i==null?(i=this.buildItem(e),zr.debug(()=>[`Pool[name=${this.name}]: Created instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i])):zr.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 e=this.freePool.pop();if(e==null)throw new Error("AG Charts - pool has no free instances");return zr.debug(()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,e]),this.busyPool.add(e),{item:e,release:()=>this.release(e)}}release(e){if(!this.busyPool.has(e))throw new Error("AG Charts - cannot free item from pool which is not tracked as busy.");zr.debug(()=>[`Pool[name=${this.name}]: Releasing instance (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,e]),this.releaseItem(e),this.busyPool.delete(e),this.freePool.push(e),zr.debug(()=>[`Pool[name=${this.name}]: Returned instance to free pool (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,e]);const i=Date.now(),n=i+this.cleanupTimeMs*.5;this.cleanPoolTimer&&(this.cleanPoolDue??1/0)<n&&(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 e=this.freePool.splice(0);for(const i of e)this.destroyItem(i);zr.debug(()=>[`Pool[name=${this.name}]: Cleaned pool of ${e.length} items (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`])}destroy(){this.cleanPool();for(const e of this.busyPool.values())this.destroyItem(e);this.busyPool.clear()}};yb.pools=new Map,yb.debug=ue.create(!0,"pool");var k2=yb,Bs=ue.create(!0,"opts"),Vr=class{static licenseCheck(t){if(t.withinStudio)return;let e=this.licenseManager;return this.licenseChecked||(e=Hs.licenseManager?.(t),this.licenseManager=e,e?.validateLicense(),this.licenseChecked=!0),e}static getLicenseDetails(t){return Hs.licenseManager?.({}).getLicenseDetails(t)}static getInstance(t){return uA.getInstance(t)}static create(t,e){const i=ue.check("scene:stats","scene:stats:verbose")?performance.now():void 0;return Bs.group("AgCharts.create()",()=>{t=ue.inDevelopmentMode(()=>hn(He(t)))??t,this.licenseCheck(t);const n=this.licenseCheck(t),s=uA.createOrUpdate({userOptions:t,licenseManager:n,optionsMetadata:e,apiStartTime:i});return n?.isDisplayWatermark()&&Hs.injectWatermark?.(s.chart.ctx.domManager,n.getWatermarkMessage()),s})}static createFinancialChart(t){return Bs.group("AgCharts.createFinancialChart()",()=>this.create(t,{presetType:"price-volume"}))}static createGauge(t){return Bs.group("AgCharts.createGauge()",()=>this.create(t,{presetType:"gauge-preset"}))}static __createSparkline(t){return Bs.group("AgCharts.__createSparkline()",()=>{const{pool:e,...i}=t;return this.create(i,{presetType:"sparkline",pool:e??!0,domMode:"minimal",withDragInterpretation:!1})})}};Vr.licenseChecked=!1;var gs=class Mh{static getInstance(e){const i=_d.getInstance(e);return i?hA.chartInstances.get(i):void 0}static createOrUpdate(e){let{proxy:i}=e;const{userOptions:n,licenseManager:s,processedOverrides:r=i?.chart?.chartOptions.processedOverrides??{},specialOverrides:a=i?.chart?.chartOptions.specialOverrides??{},optionsMetadata:o=i?.chart?.chartOptions.optionMetadata??{},deltaOptions:l,data:c,stripSymbols:h=!1,apiStartTime:u}=e,d=Hs.styles==null?[]:[["ag-charts-enterprise",Hs.styles]];if(ee.listModules().next().done)throw new Error(["AG Charts - No modules have been registered.","","Call ModuleRegistry.registerModules(...) with the modules you need before using AgCharts.create().","","See https://www.ag-grid.com/charts/r/module-registry/ for more details."].join(`
`));Bs(()=>[">>> AgCharts.createOrUpdate() user options",He(n)]);const{presetType:g}=o;let p=n;Vr.optionsMutationFn&&p&&(p=Vr.optionsMutationFn(He(p,ch.OPTIONS_CLONE_OPTS_FAST),g),Bs(()=>[">>> AgCharts.createOrUpdate() MUTATED user options",He(p)]));const f=this.getPool(o);let m=!1,y,b=i?.chart;b==null&&f?.hasFree()&&(y=f.obtainFree(),b=y.item);const{document:v,window:S,styleContainer:M,skipCss:C,...D}=p??{},A=b?.getChartOptions(),w=new ch(A,D,r,{...a,document:v,window:S,styleContainer:M,skipCss:C},o,l,h,u);(b==null||fg(w.processedOptions)!==fg(b.chartOptions.processedOptions))&&(y?.release(),y=this.getPool(w.optionMetadata)?.obtain(w),y?b=y.item:(m=!0,b=Mh.createChartInstance(w,b))),w.optionsGraph&&b.ctx.optionsGraphService.updateCallback((L,O,R)=>w.optionsGraph?.resolvePartial(L,O,R));for(const[L,O]of d)b.ctx.domManager.addStyles(L,O);return b.ctx.fontManager.updateFonts(w.googleFonts),c!=null&&b.ctx.dataService.restoreData(c),"loading"in w.processedOptions&&b.ctx.dataService.setForcedLoading(w.processedOptions.loading),i==null?(i=new hA(b,Mh.callbackApi,s),i.releaseChart=y?.release):(y||m)&&(i.releaseChart?.(),i.chart=b,i.releaseChart=y?.release),Bs.check()&&typeof globalThis.window<"u"&&(globalThis.agChartInstances??(globalThis.agChartInstances={}),globalThis.agChartInstances[b.id]=b),b.queuedUserOptions.push(w.userOptions),b.queuedChartOptions.push(w),b.requestFactoryUpdate(L=>{Bs.group(">>>> Chart.applyOptions()",()=>{L.applyOptions(w);const O=L.queuedUserOptions.indexOf(w.userOptions)+1;L.queuedUserOptions.splice(0,O),L.queuedChartOptions.splice(0,O)})}),i}static updateUserDelta(e,i,n){i=He(i,ch.OPTIONS_CLONE_OPTS_FAST);const s=gr(i,Mh.markRemovedProperties,new Set(["data"]),void 0,void 0,!1);Bs(()=>[">>> AgCharts.updateUserDelta() user delta",He(i)]),Mh.createOrUpdate({proxy:e,deltaOptions:i,stripSymbols:s,apiStartTime:n})}static createChartInstance(e,i){const n=i?.destroy({keepTransferableResources:!0}),s=fg(e.processedOptions);return ee.getChartModule(s).create(e,n)}static getPool(e){if(e.pool===!0)return k2.getPool(e.presetType??"default",this.createChartInstance,this.detachAndClear,this.destroy,1/0)}};gs.caretaker=new pp(Ye),gs.callbackApi={caretaker:gs.caretaker,create(t,e,i,n,s){return gs.createOrUpdate({userOptions:t,processedOverrides:e,specialOverrides:i,optionsMetadata:n,data:s})},update(t,e,i,n){return gs.createOrUpdate({userOptions:t,proxy:e,specialOverrides:i,apiStartTime:n})},updateUserDelta(t,e,i){return gs.updateUserDelta(t,e,i)}},gs.markRemovedProperties=(t,e,i,n)=>{let s=n??!1;if(typeof t!="object"||t==null)return s;for(const r of ir(t))t[r]===void 0&&(Object.assign(t,{[r]:Symbol("UNSET")}),s||(s=!0));return s},gs.detachAndClear=t=>t.detachAndClear(),gs.destroy=t=>t.destroy();var uA=gs,dA={};wi(dA,{APPROXIMATE_THRESHOLD:()=>k1,AbstractBarSeries:()=>bD,AbstractBarSeriesProperties:()=>Qc,AggregationManager:()=>Gd,AnchoredPopover:()=>TA,AnnotationManager:()=>T2,ApproximateOrdinalTimeScale:()=>J2,Arc:()=>ps,Axis:()=>am,AxisGroupZIndexMap:()=>tM,BBox:()=>U,Background:()=>nl,BandScale:()=>En,BaseToolbar:()=>Ib,BucketLookupManager:()=>ny,Caption:()=>tt,CartesianAxis:()=>Rc,CartesianCrossLine:()=>fi,CartesianSeries:()=>kr,CartesianSeriesNodeEvent:()=>Rm,CartesianSeriesProperties:()=>Fn,CategoryAxis:()=>Qo,CategoryScale:()=>Sa,Chart:()=>_d,ChartAxes:()=>Ad,ChartOptions:()=>ch,CollapseMode:()=>QI,ColorScale:()=>br,ColorScaleProperties:()=>da,ContextMenuRegistry:()=>E2,ContinuousScale:()=>Ve,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>tl,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>il,DEFAULT_POLAR_DIRECTION_KEYS:()=>GD,DEFAULT_POLAR_DIRECTION_NAMES:()=>jD,DOMElementProxy:()=>Td,DOMManager:()=>iI,DataController:()=>bI,DataModel:()=>Sm,DataModelSeries:()=>Em,DataSet:()=>jc,DataSetSelection:()=>WM,DiscreteTimeAxis:()=>RI,DraggablePopover:()=>LA,DropShadow:()=>os,ExtendedPath2D:()=>Fo,FillGradientDefaults:()=>wr,FillImageDefaults:()=>Ps,FillPatternDefaults:()=>Nt,FloatingToolbar:()=>a_,FormatManager:()=>xr,Group:()=>ne,GroupWidget:()=>aI,HierarchyHighlightState:()=>xA,HierarchyNode:()=>$2,HierarchySeries:()=>U2,HierarchySeriesProperties:()=>zs,HighlightManager:()=>gI,HighlightProperties:()=>Rs,HighlightState:()=>zM,Image:()=>xl,IndexSetBucketLookupManager:()=>jI,InteractionManager:()=>NS,InteractionState:()=>LS,LARGEST_KEY_INTERVAL:()=>_M,Label:()=>Qi,LabelStyle:()=>Ji,LayoutElement:()=>Yf,Line:()=>en,LinearScale:()=>Ma,LogScale:()=>hm,Marker:()=>Lt,Menu:()=>Q2,MercatorScale:()=>W2,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Pn,NativeWidget:()=>rl,NiceMode:()=>QS,Node:()=>ws,OrdinalTimeScale:()=>Ir,PHASE_METADATA:()=>Ec,PanToBBoxScalingModeEnum:()=>gA,Path:()=>kt,PointerEvents:()=>iS,PolarAxis:()=>K2,PolarSeries:()=>By,QuadtreeNearest:()=>mM,RadialColumnShape:()=>Bn,Range:()=>is,Rect:()=>Tt,Rotatable:()=>fa,RotatableSvgPath:()=>q2,RotatableText:()=>xS,SMALLEST_KEY_INTERVAL:()=>VM,Scalable:()=>nd,ScalableGroup:()=>a1,Scene:()=>Rd,Sector:()=>ei,SectorBox:()=>$D,SegmentedPath:()=>um,Selection:()=>St,SelectionState:()=>GM,Series:()=>Hc,SeriesLabelProperties:()=>Ct,SeriesMarker:()=>Ci,SeriesNodeEvent:()=>Cd,SeriesNodePickMode:()=>YM,SeriesProperties:()=>mn,SeriesTooltip:()=>Fs,Shape:()=>ga,SliderWidget:()=>$m,SplitBucketLookupManager:()=>GI,StopProperties:()=>Cc,SvgPath:()=>MA,Text:()=>_i,TimeScale:()=>Jo,Toolbar:()=>s_,ToolbarButtonWidget:()=>OA,ToolbarWidget:()=>Ed,TooltipManager:()=>Pd,Transformable:()=>Ze,TransformableGroup:()=>_o,TransformableText:()=>zo,Translatable:()=>Vo,TranslatableGroup:()=>$t,TranslatableSvgPath:()=>IA,UnitTimeScale:()=>Dr,ZoomManager:()=>H2,accumulativeValueProperty:()=>Mm,addHitTestersToQuadtree:()=>Jd,adjustLabelPlacement:()=>_I,angleCategoryAxisOptionsDefs:()=>tb,angleNumberAxisOptionsDefs:()=>eb,animationValidation:()=>zc,annotationCalloutStylesDefs:()=>pC,annotationChannelTextDefs:()=>lC,annotationCommentStylesDefs:()=>fC,annotationCrossLineStyleDefs:()=>nb,annotationDisjointChannelStyleDefs:()=>dC,annotationFibonacciStylesDefs:()=>sb,annotationLineStyleDefs:()=>hg,annotationLineTextDefs:()=>cg,annotationMeasurerStylesDefs:()=>ug,annotationNoteStylesDefs:()=>mC,annotationOptionsDef:()=>pl,annotationParallelChannelStyleDefs:()=>gC,annotationQuickMeasurerStylesDefs:()=>yC,annotationShapeStylesDefs:()=>rb,annotationTextStylesDef:()=>sh,boxPlotSeriesThemeableOptionsDef:()=>SC,buildColorCategoryLegendData:()=>Ay,buildGradientLegendDatum:()=>Dy,buildResetPathFn:()=>py,calculateDataDiff:()=>xD,calculateLabelTranslation:()=>X2,calculateSegments:()=>qd,candlestickSeriesThemeableOptionsDef:()=>IC,cartesianMarkerDrawMode:()=>uy,checkCrisp:()=>vD,chordSeriesThemeableOptionsDef:()=>DC,clippedRoundRect:()=>od,collapsedStartingBarPosition:()=>eh,colorScaleLegendFormatterContext:()=>Cy,commonAxisThemeTemplate:()=>Oa,computeBarFocusBounds:()=>Sy,computeMarkerFocusBounds:()=>Yd,coneFunnelSeriesThemeableOptionsDef:()=>CC,configureColorScale:()=>Iy,createAxisLabelFormatterCache:()=>TS,createDatumId:()=>Jt,createDynamicContext:()=>Lg,diff:()=>Sd,drawCorner:()=>wc,drawMarkerUnitPolygon:()=>Tc,findNodeDatumInArray:()=>UM,findQuadtreeMatch:()=>Qd,fixNumericExtent:()=>Bi,formatAxisLabelValue:()=>Wf,fromToMotion:()=>Mt,funnelSeriesThemeableOptionsDef:()=>AC,generateTicks:()=>dM,getAxisLabelSideFlag:()=>kc,getColorStops:()=>rS,getCrossLineValue:()=>wS,getCrossLinesPlugin:()=>Jm,getItemId:()=>Dd,getItemStyles:()=>wm,getItemStylesPerItemId:()=>aE,getLabelStyles:()=>Ra,getMarkerStyles:()=>Zd,getMissCount:()=>AM,getRadialColumnWidth:()=>DA,getShapeFill:()=>ES,getShapeStyle:()=>Zf,groupAccumulativeValueProperty:()=>Aa,hasDimmedOpacity:()=>km,heatmapSeriesThemeableOptionsDef:()=>wC,initialStatePickedOptionsDef:()=>cI,interpolatePoints:()=>Zc,isTooltipValueMissing:()=>ba,isUnselected:()=>jM,keyProperty:()=>Ar,makeSeriesTooltip:()=>Fa,mapLineBackgroundSeriesThemeableOptionsDef:()=>LC,mapLineSeriesThemeableOptionsDef:()=>TC,mapMarkerSeriesThemeableOptionsDef:()=>NC,mapShapeBackgroundSeriesThemeableOptionsDef:()=>EC,mapShapeSeriesThemeableOptionsDef:()=>OC,markerFadeInAnimation:()=>Xc,markerSwipeScaleInAnimation:()=>hy,midpointStartingBarPosition:()=>lF,minimumTimeAxisDatumGranularity:()=>yM,motion:()=>l_,nightingaleSeriesThemeableOptionsDef:()=>RC,normaliseGroupTo:()=>vd,ohlcSeriesThemeableOptionsDef:()=>kC,ordinalTimeAxisOptionsDefs:()=>dl,organizationSeriesThemeableOptionsDef:()=>PC,pairUpSpans:()=>Yc,parentLevelAxisThemeTemplate:()=>ey,pathFadeInAnimation:()=>gy,pathMotion:()=>zd,pathSwipeInAnimation:()=>dy,plotAreaPathFill:()=>uD,plotInterpolatedLinePathStroke:()=>Ud,plotLinePathStroke:()=>oy,predictCartesianFinancialAxis:()=>XP,predictCartesianNonPrimitiveAxis:()=>Jc,prepareAreaFillAnimationFns:()=>dD,prepareBarAnimationFunctions:()=>th,prepareLinePathPropertyAnimation:()=>ly,processedDataIsAnimatable:()=>fn,pyramidSeriesThemeableOptionsDef:()=>FC,radarAreaSeriesThemeableOptionsDef:()=>VC,radarLineSeriesThemeableOptionsDef:()=>_C,radialBarSeriesThemeableOptionsDef:()=>BC,radialColumnSeriesThemeableOptionsDef:()=>zC,radiusCategoryAxisOptionsDefs:()=>ib,radiusNumberAxisOptionsDefs:()=>oC,rangeAreaSeriesThemeableOptionsDef:()=>HC,rangeBarSeriesThemeableOptionsDef:()=>UC,resetAxisLabelSelectionFn:()=>gd,resetBarSelectionsDirect:()=>eg,resetBarSelectionsFn:()=>ih,resetLabelFn:()=>Pa,resetMarkerFn:()=>Wd,resetMarkerPositionFn:()=>qc,resetMarkerSelectionsDirect:()=>Kd,resetMotion:()=>Wt,sankeySeriesThemeableOptionsDef:()=>WC,sectorBox:()=>UD,seriesLabelFadeInAnimation:()=>gt,seriesLabelFadeOutAnimation:()=>jd,stackCartesianSeries:()=>XM,standaloneChartOptionsDefs:()=>dR,sunburstSeriesThemeableOptionsDef:()=>KC,titleAxisThemeTemplate:()=>Na,toHierarchyHighlightString:()=>uh,toHighlightString:()=>wa,toSelectionString:()=>ka,topologyChartOptionsDefs:()=>uR,trailingAccumulatedValueProperty:()=>$O,treemapSeriesThemeableOptionsDef:()=>YC,updateClipPath:()=>Xd,updateLabelNode:()=>VI,upsertNodeDatum:()=>Ty,userInteraction:()=>j2,validateCrossLineValue:()=>kS,valueProperty:()=>Xe,visibleRangeIndices:()=>Gc,waterfallSeriesThemeableOptionsDef:()=>ZC});var T2=class{constructor(t){this.ctx=t,this.mementoOriginatorKey="annotations",this.annotations=[]}createMemento(){return this.annotations}guardMemento(t){return t==null||ce(t)}restoreMemento(t,e,i){this.annotations=this.cleanData(i??[]).map(n=>{const s=this.getAnnotationTypeStyles(n.type);return ge(n,s)}),this.ctx.eventsHub.emit("annotations:restore",{annotations:this.annotations})}updateData(t){this.annotations=this.cleanData(t??[])}fireChangedEvent(){this.ctx.fireEvent({type:"annotations",annotations:He([...this.annotations])})}attachNode(t){return this.ctx.annotationRoot.append(t),()=>(t.remove(),this)}setAnnotationStyles(t){this.styles=t}getAnnotationTypeStyles(t){return this.styles?.[t]}cleanData(t){for(const e of t)"textAlign"in e&&delete e.textAlign;return t}},L2=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}}},N2=class{constructor(){this.defaults=["download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series"]}},O2=class{constructor(){this.items=new L2,this.lists=new N2}},E2=class{constructor(t){this.ctx=t,this.builtins=new O2,this.hiddenActions=new Set,this.toggle("zoom-to-cursor","hide"),this.toggle("pan-to-cursor","hide"),this.toggle("reset-zoom","hide")}static check(t,e){return e.showOn==t}static checkCallback(t,e,i){return t===e}dispatchContext(t,e,i,n){const{widgetEvent:s}=e;if(s.sourceEvent.defaultPrevented)return;const r=n?.x??e.canvasX,a=n?.y??e.canvasY,o={showOn:t,x:r,y:a,context:i,widgetEvent:s};this.ctx.eventsHub.emit("context-menu:setup",o),this.ctx.eventsHub.emit("context-menu:complete",o)}isVisible(t){return!this.hiddenActions.has(t)}toggle(t,e){switch(e??(e=this.isVisible(t)?"hide":"show"),e){case"show":this.hiddenActions.delete(t);break;case"hide":this.hiddenActions.add(t);break}}},gA=(t=>(t[t.None=0]="None",t[t.WhenViewportTooSmallScaleXYProportionally=1]="WhenViewportTooSmallScaleXYProportionally",t[t.WhenViewportTooSmallScaleXYDisproportionally=2]="WhenViewportTooSmallScaleXYDisproportionally",t))(gA||{});function _r(t,e,i,n,s){return e+(n-e)*((s-t)/(i-t))}function pA(t,e,i,n,s){return t+(s-e)*((i-t)/(n-e))}function fA(t,e,i){return[pA(t,i.min,e,i.max,0),pA(t,i.min,e,i.max,1)]}function R2(t,e,i){const[n,s]=fA(t.x1,t.x2,e),[r,a]=fA(t.y1,t.y2,i);return{x1:n,x2:s,y1:r,y2:a}}function mA(t,e){const i=e.width>t.width,n=e.height>t.height;return{x:i,y:n}}function yA(t,e,i,n,s,r){if(i<=s&&r<=n)return i;const a=s-i,o=r-n,l=Math.abs(a)<Math.abs(o)?a:o;return te(t,i+l,e)}function P2(t,e,i,n){const s=R2(t,i,n);return{x:yA(s.x1,s.x2,t.x1,t.x2,e.x1,e.x2),y:yA(s.y1,s.y2,t.y1,t.y2,e.y1,e.y2)}}function F2(t,e,i,n){switch(t){case 0:return V2(e,i,n);case 1:return B2(e,i,n);case 2:return _2(e,i,n);default:return t}}function yg(t,e,i,n){const{x:s={min:0,max:1},y:r={min:0,max:1}}=i,a=oa.from(n),o=oa.from(e),l=P2(o,a,s,r),c={x:t.x?{min:_r(o.x1,s.min,o.x2,s.max,o.x1),max:_r(o.x1,s.min,o.x2,s.max,o.x2)}:{min:_r(o.x1,s.min,o.x2,s.max,l.x),max:_r(o.x1,s.min,o.x2,s.max,l.x+e.width)},y:t.y?{min:_r(o.y1,r.min,o.y2,r.max,o.y1),max:_r(o.y1,r.min,o.y2,r.max,o.y2)}:{min:_r(o.y1,r.min,o.y2,r.max,l.y),max:_r(o.y1,r.min,o.y2,r.max,l.y+e.height)}},h=c.x.max-c.x.min,u=c.y.max-c.y.min;return c.x.min=te(0,c.x.min,1-h),c.x.max=c.x.min+h,c.y.min=te(0,c.y.min,1-u),c.y.max=c.y.min+u,c}function V2(t,e,i){return yg({x:!1,y:!1},t,e,i)}function _2(t,e,i){const n=mA(t,i);return yg(n,t,e,i)}function B2(t,e,i){const n=mA(t,i);if(!n.x&&!n.y)return yg(n,t,e,i);const s=i.width/t.width,r=i.height/t.height,a=Math.max(s,r),o=oa.from(i),l=(o.x1+o.x2)/2,c=(o.y1+o.y2)/2,h=t.width*a,u=t.height*a,d={x:l-h/2,y:c-u/2,width:h,height:u};return yg({x:!1,y:!1},d,e,i)}var bA=t=>ye((e,{options:i})=>!Ve.is(t?.scale)&&!ks.is(t?.scale)||e==null||i.end==null?!0:e<i.end,"to be less than end");function z2(t){for(const e of ir(t)){const i=t[e];if(!i)continue;const{min:n,max:s}=i;(n<0||s>1)&&(j.warnOnce(`Attempted to update axis (${e}) zoom to an invalid ratio of [{ min: ${n}, max: ${s} }], expecting a ratio of 0 to 1. Ignoring.`),delete t[e])}}function G2(t,e){const i={};for(const{id:n,direction:s}of t){const{min:r,max:a}=e[n]??{min:0,max:1};i[n]={min:r,max:a,direction:s}}return i}function vA(t,e){const i=ir(t),n=ir(e);if(i.length!==n.length)return!1;for(const s of i)if(!n.includes(s))return!1;for(const s of i){const r=t[s],a=e[s];if(r!==a&&(r==null||a==null||r.direction!==a.direction||r.min!==a.min||r.max!==a.max))return!1}return!0}function j2(t){return{source:"user-interaction",sourceDetail:t}}var H2=class extends Vm{constructor(t){super(),this.ctx=t,this.mementoOriginatorKey="zoom",this.axes=[],this.allAxes=[],this.didLayoutAxes=!1,this.restoreRequiredRangeIterations=0,this.independentAxes=!1,this.navigatorModule=!1,this.zoomModule=!1,this.debug=ue.create(!0,"zoom"),this.panToBBoxScalingMode=2,this.pendingMemento=void 0,this.cleanup.register(t.eventsHub.on("zoom:change-request",e=>{this.constrainZoomToRequiredWidth(e)}),t.eventsHub.on("update:pre-series",({requiredRangeRatio:e,requiredRangeDirection:i,requiredRange:n})=>{this.didLayoutAxes=!0;const{pendingMemento:s}=this;s?this.restoreMemento(s.version,s.mementoVersion,s.memento):this.restoreRequiredRange(e,i,n),this.updateZoom({source:"chart-update",sourceDetail:"unspecified"})}),t.eventsHub.on("update:complete",({wasShortcut:e})=>{if(!e&&this.pendingZoomEventSource){const i=this.pendingZoomEventSource;this.ctx.fireEvent({type:"zoom",source:i,...this.getMementoRanges()}),this.pendingZoomEventSource=void 0}}))}get state(){const t=this.ctx.chartState.getValue("zoom"),e={};for(const i of this.allAxes){const n=this.axes.find(a=>a.id===i.id);let s,r;if(n)({min:s,max:r}=n.getZoom());else{const a=bc(t,i.direction);s=a?.min??0,r=a?.max??1}e[i.id]={min:s,max:r,direction:i.direction}}return e}set state(t){const e=new Set;for(const r of this.axes){const a=t[r.id];e.add(r.id),a&&r.setZoom({min:a.min,max:a.max})}const i=this.allAxes.filter(r=>!e.has(r.id));if(i.length===0)return;const n={};for(const r of i){const a=t[r.id];a&&(n[r.id]=a)}const s=ts(n);s!=null&&this.ctx.chartState.setValue("zoom",s)}toCoreZoomState(t){const e={};let i;const{state:n}=this;if(this.independentAxes){const s=this.getPrimaryAxisId("x"),r=this.getPrimaryAxisId("y");i=[],s&&i.push(s),r&&i.push(r)}else i=ir(n);for(const s of i){const{direction:r}=n[s]??{};if(r!=null){const a=t[r];if(a){const{min:o,max:l}=a;e[s]={min:o,max:l,direction:r}}}}return e}createMemento(){return this.getMementoRanges()}guardMemento(t,e){if(t==null)return!0;if(!he(t))return!1;const i=this.getPrimaryAxis("x"),n=this.getPrimaryAxis("y"),s={rangeX:{start:bA(i),end:le},rangeY:{start:bA(n),end:le},ratioX:{start:le,end:le},ratioY:{start:le,end:le},autoScaledAxes:le},{invalid:r}=zt(t,s);return r.length>0?(e.push(...r.map(String)),!1):!0}restoreMemento(t,e,i){if(!this.axes||!this.didLayoutAxes){this.pendingMemento={version:t,mementoVersion:e,memento:i};return}this.pendingMemento=void 0;const n=yc(ts(this.state));i?.rangeX?n.x=this.rangeToRatioDirection("x",i.rangeX)??{min:0,max:1}:i?.ratioX?n.x={min:i.ratioX.start??0,max:i.ratioX.end??1}:n.x={min:0,max:1};const{navigatorModule:s,zoomModule:r}=this;this.ctx.eventsHub.emit("zoom:load-memento",{zoom:n,memento:i,navigatorModule:s,zoomModule:r});const a=this.toCoreZoomState(n);this.writeInitialZoom(ts(a)),this.updateChanges({source:"state-change",sourceDetail:"internal-restoreMemento",changes:a,isReset:!1})}writeInitialZoom(t){const e=this.ctx.chartState.getValue("initialZoom");st(e,t)||this.ctx.chartState.setValue("initialZoom",t)}findAxis(t){for(const e of this.axes)if(e.id===t)return e}getAxes(){return this.axes}setAxes(t){const e=this.state,i=new Map;for(const o of this.axes)i.set(o.id,o.type);const{axes:n,allAxes:s}=this;n.length=0,s.length=0;for(const o of t)s.push({id:o.id,direction:o.direction}),"range"in o&&n.push(o);const r={...e};for(const o of n){const l=i.get(o.id);l!==void 0&&l!==o.type&&delete r[o.id]}const a=G2(t,r);this.state=a,this.updateChanges({source:"chart-update",sourceDetail:"internal-setAxes",changes:a,isReset:!1})}setIndependentAxes(t=!0){this.independentAxes=t}setNavigatorEnabled(t=!0){this.navigatorModule=t}setZoomModuleEnabled(t=!0){this.zoomModule=t}isNavigatorEnabled(){return this.navigatorModule}isZoomEnabled(){return this.zoomModule}updateZoom({source:t,sourceDetail:e},i){const n=this.toCoreZoomState(i??{});return this.updateChanges({source:t,sourceDetail:e,changes:n,isReset:!1})}computeChangedAxesIds(t){const e=[],i=this.state;for(const n of ir(t)){const s=t[n]??{min:0,max:1},r=i[n];(r==null||r.min!==s.min||r.max!==s.max)&&e.push(n)}return e}updateChanges(t){const{source:e,sourceDetail:i,isReset:n,changes:s}=t;z2(s);const r=this.computeChangedAxesIds(s),a=He(this.state),o=He(this.state);for(const l of r){const c=o[l];c!=null&&(c.min=s[l]?.min??0,c.max=s[l]?.max??1)}return this.state=o,this.dispatch(e,i,r,n,a)}resetZoom({source:t,sourceDetail:e}){const i=this.ctx.chartState.getValue("initialZoom"),n={};for(const s of this.allAxes){const r=bc(i,s.direction);n[s.id]=r?{min:r.min,max:r.max}:{min:0,max:1}}this.updateChanges({source:t,sourceDetail:e,changes:n,isReset:!0})}resetAxisZoom({source:t,sourceDetail:e},i){const n=this.allAxes.find(o=>o.id===i);if(!n)return;const s=this.ctx.chartState.getValue("initialZoom"),r=bc(s,n.direction),a=r?{min:r.min,max:r.max}:{min:0,max:1};this.updateChanges({source:t,sourceDetail:e,changes:{[i]:a},isReset:!0})}panToBBox(t,e){if(!this.isZoomEnabled()&&!this.isNavigatorEnabled())return!1;const i=ts(this.state);if(i===void 0||!i.x&&!i.y)return!1;const{panToBBoxScalingMode:n}=this;if(!(t.width>0&&t.height>0&&(n!==0||Math.abs(e.width)<=Math.abs(t.width)&&Math.abs(e.height)<=Math.abs(t.height))))return j.warnOnce("cannot pan to target BBox - chart too small?"),!1;const r=F2(n,t,i,e),a=this.toCoreZoomState(r);return this.updateChanges({source:"user-interaction",sourceDetail:"internal-panToBBox",changes:a,isReset:!1})}fireZoomPanStartEvent(t){this.ctx.eventsHub.emit("zoom:pan-start",{callerId:t})}updateWith({source:t,sourceDetail:e},i,n){const s=this.getPrimaryAxis(i);if(!s)return;const r=s.scale.getDomainMinMax();if(!r)return;const[a,o]=s.visibleRange,l=this.getRange(s.id,{min:a,max:o});if(!l)return;const[c,h]=r,{start:u,end:d}=l,g=n(c,h,u,d,t);if(!this.isValidUpdateWithResult(g)){this.resetZoom({source:t,sourceDetail:e});return}const[p,f]=g,m=this.rangeToRatioAxis(s,{start:p,end:f});m&&this.updateChanges({source:t,sourceDetail:e,changes:{[i]:m},isReset:!1})}isValidUpdateWith(t,e,i){const n=this.getPrimaryAxis(t);if(!n)return!0;const s=n.scale.getDomainMinMax();if(!s)return!0;const[r,a]=n.visibleRange,o=this.getRange(n.id,{min:r,max:a});if(!o)return!0;const[l,c]=s,{start:h,end:u}=o,d=e(l,c,h,u,i);if(!this.isValidUpdateWithResult(d))return!0;const[g,p]=d;let f=!0;return g!=null&&f&&(f=g>=l),p!=null&&f&&(f=p<=c),g!=null&&p!=null&&f&&(f=g<=p),f}getAxisZooms(){return this.state}getAxisZoom(t){return this.state[t]??{min:0,max:1}}getPrimaryAxisId(t){return this.getPrimaryAxis(t)?.id}getBoundSeries(){const t=this.getPrimaryAxis("x"),e=this.getPrimaryAxis("y");let i;if(this.independentAxes){const n=new Set(t?.boundSeries??[]),s=new Set(e?.boundSeries??[]);i=new Set;for(const r of n)s.has(r)&&i.add(r)}else i=new Set([...t?.boundSeries??[],...e?.boundSeries??[]]);return i}constrainZoomToItemCount(t,e,i){let n=[t.x.min,t.x.max],s=i?void 0:[t.y.min,t.y.max];for(const o of this.getBoundSeries()){const l=o.getZoomRangeFittingItems(n,s,e);l!=null&&(n=l.x,s=l.y)}const r={min:n[0],max:n[1]},a=s?{min:s[0],max:s[1]}:void 0;return yc({x:r,y:a})}isVisibleItemsCountAtLeast(t,e,i){const n=this.getBoundSeries(),s=[t.x.min,t.x.max],r=!i.includeYVisibleRange&&i.autoScaleYAxis?void 0:[t.y.min,t.y.max];let a=0;for(const o of n){const l=e-(a??0),c=o.getVisibleItems(s,r,l);if(a+=c,a>=e)return!0}return n.size===0}getMementoRanges(){const t=yc(ts(this.state)),e={rangeX:this.getRangeDirection("x",t.x),rangeY:this.getRangeDirection("y",t.y),ratioX:{start:t.x.min,end:t.x.max},ratioY:{start:t.y.min,end:t.y.max},autoScaledAxes:void 0};return this.ctx.eventsHub.emit("zoom:save-memento",{memento:e}),e}restoreRequiredRange(t,e,i){const{lastRestoredRequiredRange:n,lastRestoredRequiredRangeDirection:s}=this;this.lastRequiredRange!==i&&(this.lastRequiredRange=i,this.restoreRequiredRangeIterations=0),this.restoreRequiredRangeIterations+=1;const r=e!=="x"&&e!=="y",a=s===e&&n===t,o=t===0&&(n==null||n===0);if(r||a||o||this.restoreRequiredRangeIterations>1){this.restoreRequiredRangeIterations=0;return}const l=this.getPrimaryAxisId(e);if(!l)return;const c=this.state[l]??{min:0,max:1},h=Math.min(1,1/t);let u=0,d=1;e==="x"?(u=te(0,1-h,c.min),d=te(0,u+h,1)):(d=Math.min(1,c.max),u=d-h,u<0&&(d-=u,u=0),u=te(0,u,1),d=te(0,d,1)),this.lastRestoredRequiredRange=t,this.lastRestoredRequiredRangeDirection=e;const g={[e]:{min:u,max:d}},p=this.toCoreZoomState(g);this.writeInitialZoom(ts(p)),this.updateChanges({source:"state-change",sourceDetail:"internal-requiredWidth",changes:p,isReset:!1})}constrainZoomToRequiredWidth(t){if(this.lastRestoredRequiredRange==null||this.lastRestoredRequiredRangeDirection==null)return;const e=this.getPrimaryAxisId(this.lastRestoredRequiredRangeDirection);if(!e)return;const i=t.state[e],n=t.oldState[e];if(!i||!n)return;const s=i.max-i.min,r=1/this.lastRestoredRequiredRange;Math.abs(s-r)<1e-12||s<=r||t.constrainChanges({[e]:{direction:this.lastRestoredRequiredRangeDirection,min:n.min,max:n.min+r}})}dispatch(t,e,i,n,s){const{x:r,y:a}=ts(this.state)??{},o=this.state;let l;const c=this.debug,h=this,u={source:t,sourceDetail:e,isReset:n,changedAxes:i,state:o,oldState:s,x:r,y:a,stateAsDefinedZoom(){return yc(ts(u.state))},constrainZoom(p){this.constrainChanges(h.toCoreZoomState(p))},constrainChanges(p){c.check()&&c("ZoomManager.constrainChanges()",o,"->",p,new Error().stack),l??(l=He(o));for(const f of ir(p)){const m=p[f],y=l[f];m&&y&&(y.min=m.min,y.max=m.max)}u.state=l}};this.ctx.eventsHub.emit("zoom:change-request",u),l&&!vA(o,l)&&(this.state=l);const d=ts(this.state);st(this.ctx.chartState.getValue("zoom"),d)||this.ctx.chartState.setValue("zoom",d);const g=!vA(s,this.state);return g&&(this.ctx.eventsHub.emit("zoom:change-complete",{source:t,sourceDetail:e,x:d?.x}),this.pendingZoomEventSource=t),g}getRange(t,e){return this.getRangeAxis(this.findAxis(t),e)}getRangeDirection(t,e){return this.getRangeAxis(this.getPrimaryAxis(t),e)}getRangeAxis(t,e){if(!t)return;const i=this.getDomainPixelExtents(t);if(!i)return;const[n,s]=i;let r,a;return n<=s?(r=t.scale.invert(0,!0),a=t.scale.invert(n+(s-n)*e.max,!0)):(r=t.scale.invert(n-(n-s)*e.min,!0),a=t.scale.invert(0,!0)),{start:r,end:a}}rangeToRatio(t,e){return this.rangeToRatioAxis(this.findAxis(t),e)}rangeToRatioDirection(t,e){return this.rangeToRatioAxis(this.getPrimaryAxis(t),e)}rangeToRatioAxis(t,e){if(!t)return;const i=this.getDomainPixelExtents(t);if(!i)return;const[n,s]=i,{scale:r}=t,{start:a,end:o}=e,[l=0,c=1]=MS(a,o);let h=a==null?n:r.convert(a,{alignment:l,alignmentExclusive:!0}),u=o==null?s:r.convert(o,{alignment:c,alignmentExclusive:!0})+(r.bandwidth??0);if(!Ee(h)||!Ee(u))return;const[d,g]=[Math.min(n,s),Math.max(n,s)];h=te(d,h,g),u=te(d,u,g);const p=s-n;if(p===0)return;const f=Math.abs((h-n)/p),m=Math.abs((u-n)/p);if(!(f>=m))return{min:f,max:m}}getPrimaryAxis(t){return this.axes?.find(e=>e.direction===t)}getDomainPixelExtents(t){const[e,i]=t.scale.range;if(!(!Ee(e)||!Ee(i)))return[e,i]}isValidUpdateWithResult(t){return t==null||!Array.isArray(t)||t.length<1?!1:t.every(e=>e==null||typeof e=="number"||Ol(e))}},xA=(t=>(t[t.None=0]="None",t[t.Item=1]="Item",t[t.OtherItem=2]="OtherItem",t[t.Branch=3]="Branch",t[t.OtherBranch=4]="OtherBranch",t))(xA||{});function uh(t){const e=i=>i;switch(t){case 1:return"highlighted-item";case 2:return"unhighlighted-item";case 3:return"highlighted-branch";case 4:return"unhighlighted-branch";case 0:return"none";default:return e(t)}}var zs=class extends mn{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(at),this.strokes=Object.values(Vs),this.colorScale=new da}};x([I],zs.prototype,"childrenKey",2),x([I],zs.prototype,"sizeKey",2),x([I],zs.prototype,"colorKey",2),x([I],zs.prototype,"colorName",2),x([I],zs.prototype,"fills",2),x([I],zs.prototype,"strokes",2),x([I],zs.prototype,"colorRange",2),x([I],zs.prototype,"colorScale",2);var SA=class Ig{constructor(e,i,n,s,r,a,o,l,c,h,u){this.series=e,this.itemId=i,this.datumIndex=n,this.datum=s,this.sizeValue=r,this.colorValue=a,this.sumSize=o,this.depth=l,this.parent=c,this.children=h,this.style=u,this.midPoint={x:0,y:0}}get hasChildren(){return this.children.length>0}walk(e,i=Ig.Walk.PreOrder){i===Ig.Walk.PreOrder&&e(this);for(const n of this.children)n.walk(e,i);i===Ig.Walk.PostOrder&&e(this)}find(e){if(e(this))return this;for(const i of this.children){const n=i.find(e);if(n!=null)return n}}*[Symbol.iterator](){yield this;for(const e of this.children)yield*e}};SA.Walk={PreOrder:0,PostOrder:1};var $2=SA,U2=class extends Hc{constructor(t){super({moduleCtx:t,pickModes:[1,0]}),this.colorDomain=[0,0],this.maxDepth=0,this.colorScale=new br,this.animationState=new oc("empty",{empty:{update:{target:"ready",action:e=>this.animateEmptyUpdateReady(e)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:e=>this.animateReadyHighlight(e),resize:e=>this.animateReadyResize(e),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:e=>this.animateWaitingUpdateReady(e)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:e=>this.animateClearingUpdateEmpty(e)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}processData(){this.data?.commitPendingTransactions();const{NodeClass:t}=this,{childrenKey:e,sizeKey:i,colorKey:n,colorRange:s}=this.properties;let r=0,a=1/0,o=-1/0;const l=(g,p,f)=>{const m=f.depth==null?0:f.depth+1,y=e==null?void 0:g[e],b=y==null||y.length===0;let v=i==null?void 0:g[i];Number.isFinite(v)?v=Math.max(v,0):v=b?1:0;const S=v;r=Math.max(r,m);const M=n==null?void 0:g[n];typeof M=="number"&&(a=Math.min(a,M),o=Math.max(o,M));const C=this.getItemStyle({datumIndex:p,datum:g,depth:m,colorValue:M},b,!1);return c(new t(this,Jt(p.join(";")),p,g,v,M,S,m,f,[],C),y)},c=(g,p)=>{const{datumIndex:f}=g;if(p)for(const[m,y]of p.entries()){const b=l(y,f.concat(m),g);g.children.push(b),g.sumSize+=b.sumSize}return g},h=c(new t(this,"root",[],void 0,0,void 0,0,void 0,void 0,[],{}),this.data?.data),u=[a,o],d=a<o?[a,o]:[0,1];Iy(this.colorScale,this.properties.colorScale,d,s??["black"]),this.rootNode=h,this.maxDepth=r,this.colorDomain=u}update({seriesRect:t}){this.updateSelections(),this.updateNodes();const e=this.getAnimationData();this.checkResize(t)&&this.animationState.transition("resize",e),this.animationState.transition("update",e)}resetAllAnimation(t){this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateWaitingUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateReadyHighlight(t){}animateReadyResize(t){this.resetAllAnimation(t)}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}getAnimationData(){return{}}isProcessedDataAnimatable(){return!0}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}findNodeDatum(t){return this.rootNode?.find(e=>e.itemId===t)}dataCount(){return Number.NaN}getSeriesDomain(){return{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}getLegendData(t){const{colorKey:e,colorRange:i,colorScale:n}=this.properties,s=n.fills.length>0,{id:r,ctx:{legendManager:a},visible:o}=this;if(e==null||i==null&&!s)return[];const l=o&&(a?.getItemEnabled({seriesId:r})??!0);return t==="category"&&n.mode==="discrete"&&s?Ay(this.colorScale,n.fills,r,l,Cy(this)):t==="gradient"?[Dy(this.colorScale,n.fills,r,l,this.getFormatterContext("color"))]:[]}getDatumIdFromData(t){return t.datumIndex.join(":")}getDatumId(t){return this.getDatumIdFromData(t)}removeMeIndexPathForIndex(t){return this.datumSelection.at(t+1)?.datum.datumIndex??[]}removeMeIndexForIndexPath(t){for(const{index:e,datum:i}of this.datumSelection)if(jn(i.datumIndex,t))return e-1;return 0}pickFocus(t){if(!this.rootNode?.children.length)return;const e=te(0,t.datumIndex-t.datumIndexDelta,this.datumSelection.length-1),{datumIndexDelta:i,otherIndexDelta:n}=t;let s=this.removeMeIndexPathForIndex(e);const r=s.reduce((l,c)=>l.children[c],this.rootNode);if(n>0&&r.hasChildren)s=[...s,0];else if(n<0&&s.length>1)s=s.slice(0,-1);else if(n===0&&i!==0){const l=r.parent.children.length-1;s=s.slice(),s[s.length-1]=te(0,s.at(-1)+i,l)}const a=s.reduce((l,c)=>l.children[c],this.rootNode),o=this.computeFocusBounds(this.datumSelection.at(e+1));if(o!=null)return{datum:a,datumIndex:this.removeMeIndexForIndexPath(s),otherIndex:a.depth,bounds:o,clipFocusBox:!0}}getDatumAriaText(t,e){if(!(t instanceof this.NodeClass)){j.error(`datum is not HierarchyNode: ${JSON.stringify(t)}`);return}return this.ctx.localeManager.t("ariaAnnounceHierarchyDatum",{level:(t.depth??-1)+1,count:t.children.length,description:e})}getCategoryValue(t){}datumIndexForCategoryValue(t){}getActiveHighlightNode(){if(!this.properties.highlight.enabled)return;const t=this.ctx.highlightManager?.getActiveHighlight();if(t?.series===this)return t}getHierarchyHighlightState(t,e,i){if(t)return 1;if(e==null)return 0;const n=i.datumIndex?.[0],s=e.datumIndex?.[0];return n==null||s==null?0:n===s?3:4}getHierarchyHighlightStyles(t,e){switch(t){case 1:return ge(e.highlightedItem,e.highlightedBranch);case 3:return ge(e.unhighlightedItem,e.highlightedBranch);case 4:return e.unhighlightedBranch;default:return}}getHighlightStateString(t,e,i,n){if(!this.properties.highlight.enabled||i==null)return uh(0);const s=i.reduce((o,l)=>o?.children[l],this.rootNode),r=this.getActiveHighlightNode();if(s==null)return uh(0);const a=this.getHierarchyHighlightState(e??!1,r,s);return uh(a)}},bg=Math.PI/180,bb=t=>t*bg,vb=t=>-Math.log(Math.tan(Math.PI*.25+t*bg*.5)),xb=t=>t/bg,Sb=t=>(Math.atan(Math.exp(-t))-Math.PI*.25)/(bg*.5),W2=class Ob extends Qu{constructor(e,i){super(),this.domain=e,this.range=i,this.type="mercator",this.defaultTickCount=0,this.bounds=Ob.bounds(e)}static bounds(e){const[[i,n],[s,r]]=e,a=bb(i),o=vb(n),l=bb(s),c=vb(r);return new U(Math.min(a,l),Math.min(o,c),Math.abs(l-a),Math.abs(c-o))}static fixedScale(){return new Ob([[xb(0),Sb(0)],[xb(1),Sb(1)]],[[0,0],[1,1]])}toDomain(){}normalizeDomains(...e){let i=-1/0,n=1/0,s=-1/0,r=1/0;for(const a of e){const o=a.domain;for(const[l,c]of o)i=Math.min(l,i),n=Math.max(l,n),s=Math.min(c,s),r=Math.max(c,r)}return{domain:[[i,s],[n,r]],animatable:!0}}convert([e,i]){const[[n,s],[r,a]]=this.range,o=(r-n)/this.bounds.width,l=(a-s)/this.bounds.height;return[(bb(e)-this.bounds.x)*o+n,(vb(i)-this.bounds.y)*l+s]}invert([e,i]){const[[n,s],[r,a]]=this.range,o=(r-n)/this.bounds.width,l=(a-s)/this.bounds.height;return[xb((e-n)/o+this.bounds.x),Sb((i-s)/l+this.bounds.y)]}getDomainMinMax(){return ed(this.domain)}},Ct=class extends Te{constructor(){super(...arguments),this.enabled=!0,this.border=new Go,this.wrapping="never",this.truncate=!1,this.spacing=5,this.avoidCollisions=!0,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}}formatValue(t,e,i,n){const{formatter:s,format:r}=this,{type:a,value:o,domain:l,boundSeries:c}=e,h=e.type==="number"?e.fractionDigits:void 0,u=e.type==="date"?e.unit:void 0;let d;if(s!=null){const g=e.type==="date"?e.step:void 0,p=e.type==="number"?e.visibleDomain:void 0;d=t(s,{type:a,value:o,index:i,domain:l,fractionDigits:h,unit:u,step:g,boundSeries:c,visibleDomain:p})}if(r!=null&&d==null){const{specifier:g,dateStyle:p="long",truncateDate:f}=n??{},m=`${p}:${f??"none"}`;let y=this._formatters[m];const b=xr.mergeSpecifiers(g,r);(y?.type!==a||y?.unit!==u||!st(y?.mergedFormat,b))&&(y={type:a,mergedFormat:b,unit:u,formatter:xr.getFormatter(a,b,u,p,{truncateDate:f})},this._formatters[m]=y),d=y.formatter?.(o,h)}return d==null||ce(d)?d:String(d)}};x([I],Ct.prototype,"enabled",2),x([I],Ct.prototype,"border",2),x([I],Ct.prototype,"cornerRadius",2),x([I],Ct.prototype,"fill",2),x([I],Ct.prototype,"fillOpacity",2),x([I],Ct.prototype,"fontStyle",2),x([I],Ct.prototype,"fontWeight",2),x([I],Ct.prototype,"fontSize",2),x([I],Ct.prototype,"fontFamily",2),x([I],Ct.prototype,"wrapping",2),x([I],Ct.prototype,"truncate",2),x([I],Ct.prototype,"spacing",2),x([I],Ct.prototype,"minSpacing",2),x([I],Ct.prototype,"color",2),x([I],Ct.prototype,"rotation",2),x([I],Ct.prototype,"avoidCollisions",2),x([I],Ct.prototype,"padding",2),x([I],Ct.prototype,"itemStyler",2),x([I],Ct.prototype,"formatter",2),x([I],Ct.prototype,"format",2);var K2=class extends am{constructor(){super(...arguments),this.defaultTickMinSpacing=20}get shape(){return this.options.shape}get innerRadiusRatio(){return this._innerRadiusRatio??this.options.innerRadiusRatio??0}set innerRadiusRatio(t){this._innerRadiusRatio=t}update(){super.update(),this.tickLineGroup.visible=this.options.tick.enabled,this.tickLabelGroup.visible=this.options.label.enabled}createAxisContext(){const t=super.createAxisContext();return t.getPolarLayout=()=>this.computePolarLayout(),t}updatePosition(){super.updatePosition();const t=Math.floor(this.translation.x),e=Math.floor(this.translation.y);this.tickLineGroup.translationX=t,this.tickLineGroup.translationY=e,this.tickLabelGroup.translationX=t,this.tickLabelGroup.translationY=e,this.tickLabelGroupSelection.each(gd())}computeLabelsBBox(t,e){return null}computeRange(){}getAxisLinePoints(){}},Y2={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}},Z2={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 X2({yDirection:t,padding:e=0,position:i="top",bbox:n}){const s=t?Y2:Z2,{xTranslationDirection:r,yTranslationDirection:a}=s[i],o=r*(e+n.width/2),l=a*(e+n.height/2);return{xTranslation:o,yTranslation:l}}var MA=class extends kt{constructor(t=""){super(),this._d="",this.d=t}get d(){return this._d}set d(t){t!==this._d&&(this._d=t,this.path.clear(),this.path.appendSvg(t),this.checkPathDirty())}},IA=class extends Vo(MA){isPointInPath(t,e){return super.isPointInPath(t-this.translationX,e-this.translationY)}},q2=class extends fa(IA){},J2=class tw extends Ir{static is(e){return e instanceof tw}setSourceScale(e){this._sourceScale=e;const i=s=>{Object.defineProperty(this,s,{get:()=>e[s],set:r=>{e[s]=r},configurable:!0})};i("domain"),i("range"),i("paddingInner"),i("paddingOuter"),i("round");const n=s=>{Object.defineProperty(this,s,{get:()=>e[s],configurable:!0})};n("bandwidth"),n("step"),n("inset"),n("rawBandwidth")}get bands(){return this._sourceScale?.bands??super.bands}refresh(){this._sourceScale?.refresh?.()}ordinalRange(e){return this._sourceScale?this._sourceScale.ordinalRange(e):super.ordinalRange(e)}convert(e,i){this.refresh();const n=this.findIndex(e,i?.alignment);return n==null||n<0||n>=this.bands.length?Number.NaN:this.ordinalRange(n)}findIndex(e,i=0){if(e==null)return;const{bands:n,reversed:s}=this,r=n.length;if(r===0)return;if(r===1)return 0;const a=n[0],o=n[r-1];if(a==null||o==null)return this._sourceScale?.findIndex(e,i);const l=e.valueOf(),c=a.valueOf(),h=o.valueOf(),u=(l-c)/(h-c),d=s?(1-u)*(r-1):u*(r-1);return i===0?Math.max(0,Math.min(r-1,Math.floor(d))):Math.max(0,Math.min(r-1,Math.ceil(d)))}},xl=class extends ws{constructor(t){super(),this.sourceImage=t,this.x=0,this.y=0,this.width=0,this.height=0,this.opacity=1}render(t){const{ctx:e}=t,i=this.sourceImage;i&&(e.globalAlpha=this.opacity,e.drawImage(i,0,0,i.width,i.height,this.x,this.y,this.width,this.height)),super.render(t)}};x([Z()],xl.prototype,"x",2),x([Z()],xl.prototype,"y",2),x([Z()],xl.prototype,"width",2),x([Z()],xl.prototype,"height",2),x([Z()],xl.prototype,"opacity",2);var ps=class extends kt{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 Ti(Ii(this.startAngle),Ii(this.endAngle))}updatePath(){const t=this.path;t.clear(),t.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),this.type===1?t.closePath():this.type===2&&!this.fullPie&&(t.lineTo(this.centerX,this.centerY),t.closePath())}computeBBox(){return new U(this.centerX-this.radius,this.centerY-this.radius,this.radius*2,this.radius*2)}isPointInPath(t,e){const i=this.getBBox();return this.type!==0&&i.containsPoint(t,e)&&this.path.isPointInPath(t,e)}};ps.className="Arc",x([Z()],ps.prototype,"centerX",2),x([Z()],ps.prototype,"centerY",2),x([Z()],ps.prototype,"radius",2),x([Z()],ps.prototype,"startAngle",2),x([Z()],ps.prototype,"endAngle",2),x([Z()],ps.prototype,"counterClockwise",2),x([Z()],ps.prototype,"type",2);function vg(t,e,i){const n=Math.hypot(t,e),r=Math.atan2(e,t)+i;return{x:Math.cos(r)*n,y:Math.sin(r)*n}}var Bn=class extends kt{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}set cornerRadius(t){}computeBBox(){const{columnWidth:t}=this,[e,i]=this.normalizeRadii(this.innerRadius,this.outerRadius),n=this.getRotation(),s=-t/2,r=t/2,a=-i,o=-e;let l=1/0,c=1/0,h=-1/0,u=-1/0;for(let d=0;d<4;d+=1){const{x:g,y:p}=vg(d%2===0?s:r,d<2?a:o,n);l=Math.min(g,l),c=Math.min(p,c),h=Math.max(g,h),u=Math.max(p,u)}return new U(l,c,h-l,u-c)}getRotation(){const{startAngle:t,endAngle:e}=this,i=Du(t,e);return Ii(t+i/2+Math.PI/2)}normalizeRadii(t,e){return t>e?[e,t]:[t,e]}updatePath(){const{isBeveled:t}=this;t?this.updateBeveledPath():this.updateRectangularPath(),this.checkPathDirty()}updateRectangularPath(){const{columnWidth:t,path:e}=this,[i,n]=this.normalizeRadii(this.innerRadius,this.outerRadius),s=-t/2,r=t/2,a=-n,o=-i,l=this.getRotation(),c=[[s,o],[s,a],[r,a],[r,o]].map(([h,u])=>vg(h,u,l));e.clear(!0),e.moveTo(c[0].x,c[0].y),e.lineTo(c[1].x,c[1].y),e.lineTo(c[2].x,c[2].y),e.lineTo(c[3].x,c[3].y),e.closePath()}calculateCircleIntersection(t,e){const i=t*t;if(e<i)return null;const n=-Math.sqrt(e-i),s=Math.atan2(n,t);return{y:n,angle:s}}calculateBothIntersections(t,e,i){const n=i*i,s=this.calculateCircleIntersection(t,n),r=this.calculateCircleIntersection(e,n);return!s||!r?null:{left:s,right:r}}calculateAxisOuterIntersections(t,e,i){const n=i*i,s=this.calculateCircleIntersection(t,n),r=this.calculateCircleIntersection(e,n);return!s||!r?null:{left:s,right:r,radiusSquared:n}}moveToRotated(t,e,i){const n=vg(t,e,i);this.path.moveTo(n.x,n.y)}lineToRotated(t,e,i){const n=vg(t,e,i);this.path.lineTo(n.x,n.y)}renderTopWithCornerClipping(t,e,i){const{path:n}=this,{right:s,top:r,rotation:a}=i,o=r*r,l=e.radiusSquared-o;if(l<=0)this.lineToRotated(s,e.right.y,a),n.arc(0,0,t,a+e.right.angle,a+e.left.angle,!0);else{const c=Math.sqrt(l),h=Math.atan2(r,c),u=Math.atan2(r,-c);this.lineToRotated(s,e.right.y,a),n.arc(0,0,t,a+e.right.angle,a+h,!0),this.lineToRotated(-c,r,a),n.arc(0,0,t,a+u,a+e.left.angle,!0)}}updateBeveledPath(){const{columnWidth:t,path:e,axisInnerRadius:i,axisOuterRadius:n}=this,[s,r]=this.normalizeRadii(this.innerRadius,this.outerRadius),a=-t/2,o=t/2,l=-r,c=-s,h=this.getRotation(),u=Ti(s,i),d=Ti(r,n),g=Math.hypot(a,l)>n||Math.hypot(o,l)>n;if(!u&&!d&&!g){this.updateRectangularPath();return}const p=u?this.calculateBothIntersections(a,o,s):null,f=d?this.calculateBothIntersections(a,o,r):null,m=g?this.calculateAxisOuterIntersections(a,o,n):null;if(u&&!p||d&&!f||g&&!m){this.updateRectangularPath();return}e.clear(!0);const y={left:a,right:o,top:l,bottom:c,rotation:h};p?this.moveToRotated(a,p.left.y,h):this.moveToRotated(a,c,h),p?e.arc(0,0,s,h+p.left.angle,h+p.right.angle,!1):this.lineToRotated(o,c,h),f?(this.lineToRotated(o,f.right.y,h),e.arc(0,0,r,h+f.right.angle,h+f.left.angle,!0)):m?this.renderTopWithCornerClipping(n,m,y):(this.lineToRotated(o,l,h),this.lineToRotated(a,l,h)),e.closePath()}};Bn.className="RadialColumnShape",x([Z()],Bn.prototype,"isBeveled",2),x([Z()],Bn.prototype,"columnWidth",2),x([Z()],Bn.prototype,"startAngle",2),x([Z()],Bn.prototype,"endAngle",2),x([Z()],Bn.prototype,"outerRadius",2),x([Z()],Bn.prototype,"innerRadius",2),x([Z()],Bn.prototype,"axisInnerRadius",2),x([Z()],Bn.prototype,"axisOuterRadius",2);function DA(t,e,i,n,s){const r=Du(t,e),a=r*(1-n)/2;if(t+=a,e-=a,r<.001)return 2*i*s;if(r>=2*Math.PI){const g=t+r/2;t=g-Math.PI,e=g+Math.PI}const o=i*Math.cos(t),l=i*Math.sin(t),c=i*Math.cos(e),h=i*Math.sin(e),u=Math.floor(Math.hypot(o-c,l-h)),d=2*i*s;return Math.max(1,Math.min(d,u))}var Mb=class extends Gm{constructor(){super(ve("div"),"menuitem")}},CA=class extends Gm{constructor(){super(ve("div"),"menuitemradio")}setChecked(t){Me(this.elem,"aria-checked",t)}},AA=class iw extends jm{constructor(e="vertical"){super(e,"menu"),this.handleMouseEnter=(i,n)=>{n.hasPopup()||this.expandSubMenu(i,void 0)},this.handleMouseMove=(i,n)=>{n.focus({preventScroll:!0})}}destructor(){this.collapse({mode:"2"})}addSeparator(){const e=this.elem.ownerDocument.createElement("div");return Me(e,"role","separator"),this.elem.appendChild(e),e}toggleChildEnabledByIndex(e,i){this.children.at(e)?.setEnabled(i)}onChildAdded(e){super.onChildAdded(e),e.addListener("mouseenter",this.handleMouseEnter),e.addListener("mousemove",this.handleMouseMove)}onChildRemoved(e){super.onChildRemoved(e),e.removeListener("mouseenter",this.handleMouseEnter),e.removeListener("mousemove",this.handleMouseMove)}addSubMenu(){const e=new Mb,i=new iw(this.orientation);i.id=sc();const n=()=>{this.collapseExpandedSubMenu(i),e.expandControlled()},s=r=>{const a=no(this.elem)?"ArrowLeft":"ArrowRight";ta(r.sourceEvent)&&r.sourceEvent.code===a&&(this.collapseExpandedSubMenu(i),e.expandControlled())};return e.setControlled(i),e.setAriaHasPopup("menu"),e.addListener("click",n),e.addListener("mouseenter",n),e.addListener("keydown",s),this.addChild(e),{subMenuButton:e,subMenu:i}}expandSubMenu(e,i){const{expansionScope:n}=this;n&&(this.collapseExpandedSubMenu(i),i?.expand(e))}collapseExpandedSubMenu(e){const{expansionScope:i}=this;i&&(i.expandedSubMenu?.collapse({mode:"4"}),i.expandedSubMenu=e)}getCloseKeys(){return no(this.elem)?["Escape","ArrowRight"]:["Escape","ArrowLeft"]}expand(e){if(this.expansionScope!=null)return;this.expansionScope={lastFocus:Zp(e.sourceEvent),expandedSubMenu:void 0,abort:()=>this.collapse({mode:"1"}),close:()=>this.collapse({mode:"0"}),removers:new nt};const i=this.expansionScope,n=this.children.map(s=>s.getElement());Me(i.lastFocus,"aria-expanded",!0),i.removers.register(Hx(this.elem,i.abort),$x(this.elem,i.abort),...this.children.map(s=>Kp(s.getElement(),i.close,()=>this.getCloseKeys())),e?.overrideFocusVisible&&Wx(this.elem,n,e.overrideFocusVisible)),this.internalListener?.dispatch("expand-widget",this,{type:"expand-widget"}),this.children[0]?.focus({preventScroll:!0})}collapse(e){const{mode:i="0"}=e??{};if(this.expansionScope===void 0)return;const{lastFocus:n,removers:s,expandedSubMenu:r}=this.expansionScope;this.expansionScope=void 0,r?.collapse({mode:"3"}),Me(n,"aria-expanded",!1),i==="0"&&n?.focus({preventScroll:!0}),s.flush(),this.internalListener?.dispatch("collapse-widget",this,{type:"collapse-widget",mode:i})}},wA="canvas-overlay",kA=class extends kl{constructor(t,e,i){super(),this.ctx=t,this.hideFns=[],this.setOwnedWidget=(()=>{let n;return s=>{n?.destroy(),n=s}})(),this.moduleId=`popover-${e}`,i?.detached?this.element=ve("div"):this.element=t.domManager.addChild(wA,this.moduleId),this.element.setAttribute("role","presentation"),this.hideFns.push(()=>this.setOwnedWidget(void 0)),this.cleanup.register(()=>t.domManager.removeChild(wA,this.moduleId))}attachTo(t){this.element.parentElement||t.element.append(this.element)}hide(t){const{lastFocus:e=this.lastFocus}=t??{};if(this.element.children.length!==0){for(const i of this.hideFns)i();e?.focus(),this.lastFocus=void 0}}removeChildren(){this.element.replaceChildren()}initPopoverElement(t,e){if(!this.element.parentElement)throw new Error("Can not show popover that has not been attached to a parent.");return t??(t=ve("div","ag-charts-popover")),t.classList.toggle("ag-charts-popover",!0),e.ariaLabel!=null&&t.setAttribute("aria-label",e.ariaLabel),e.class!=null&&t.classList.add(e.class),e.minWidth!=null&&(t.style.minWidth=`${e.minWidth}px`),this.element.replaceChildren(t),t}showWidget(t,e,i){this.setOwnedWidget(e),this.initPopoverElement(e.getElement(),i),e.addListener("collapse-widget",()=>{this.hide(),t.setControlled(void 0),this.setOwnedWidget(void 0)}),t.setControlled(e),t.expandControlled(),i.onHide&&this.hideFns.push(i.onHide)}showWithChildren(t,e){const i=this.initPopoverElement(void 0,e);if(i.replaceChildren(...t),this.hideFns.push(()=>this.removeChildren()),e.onHide&&this.hideFns.push(e.onHide),e.initialFocus&&e.sourceEvent){const n=Zp(e.sourceEvent);n!==void 0&&(this.lastFocus=n,this.initialFocus=e.initialFocus)}return i}getPopoverElement(){return this.element.firstElementChild}updatePosition(t){const e=this.getPopoverElement();e&&(e.style.setProperty("right","unset"),e.style.setProperty("bottom","unset"),t.x!=null&&e.style.setProperty("left",`${t.x}px`),t.y!=null&&e.style.setProperty("top",`${t.y}px`),this.initialFocus?.focus(),this.initialFocus=void 0)}},TA=class extends kA{setAnchor(t,e){this.anchor=t,this.fallbackAnchor=e,this.updatePosition(t),this.repositionWithinBounds()}updateAnchor(t){const e=t.anchor??this.anchor,i=t.fallbackAnchor??this.fallbackAnchor;e&&this.setAnchor(e,i)}showWidget(t,e,i){super.showWidget(t,e,i),this.updateAfterShow(i)}showWithChildren(t,e){const i=super.showWithChildren(t,e);return this.updateAfterShow(e),i}repositionWithinBounds(){const{anchor:t,ctx:e,fallbackAnchor:i}=this,n=this.getPopoverElement();if(!t||!n)return;const s=e.domManager.getBoundingClientRect(),{offsetWidth:r,offsetHeight:a}=n,{isRtl:o}=e.domManager,l=o?t.x-r:t.x;let c=te(0,l,s.width-r),h=te(0,t.y,s.height-a);if(c!==l&&i?.x!=null){const u=o?i.x:i.x-r;c=te(0,u,s.width-r)}h!==t.y&&i?.y!=null&&(h=te(0,i.y-a,s.height-a)),this.updatePosition({x:c,y:h})}updateAfterShow(t){this.updateAnchor(t),this.ctx.agDocument.requestAnimationFrame(()=>{this.repositionWithinBounds()})}},Q2=class extends TA{show(t,e){const i=new AA("vertical");for(const n of e.items)i.addChild(this.createRow(e,n,i));i.addClass("ag-charts-menu"),this.showWidget(t,i,e)}allocRow(t,e){if(t.menuItemRole==null||t.menuItemRole==="menuitem")return new Mb;{t.menuItemRole;const i=new CA;return i.setChecked(t.value===e.value),i}}createRow(t,e,i){const n=e.value===t.value,s=this.allocRow(t,e);if(e.enabled!=null&&s.setEnabled(e.enabled),s.addClass("ag-charts-menu__row"),s.toggleClass("ag-charts-menu__row--active",n),typeof e.value=="string"&&(s.getElement().dataset.popoverId=e.value),e.icon!=null){const a=ve("span",`ag-charts-menu__icon ${Nl(e.icon)}`);s.getElement().appendChild(a)}const r=e.strokeWidth!=null;if(r&&(s.toggleClass("ag-charts-menu__row--stroke-width-visible",r),s.setCSSVariable("--strokeWidth",r?`${e.strokeWidth}px`:null)),e.label!=null){const a=ve("span","ag-charts-menu__label");a.textContent=this.ctx.localeManager.t(e.label),s.getElement().appendChild(a)}return"altText"in e&&s.setAriaLabel(this.ctx.localeManager.t(e.altText)),s.addListener("click",({sourceEvent:a})=>{t.onPress?.(e),a.preventDefault(),a.stopPropagation(),i.collapse()}),s}},LA=class extends kA{constructor(){super(...arguments),this.dragged=!1}setDragHandle(t){t.addListener("drag-start",e=>{t.addClass(this.dragHandleDraggingClass),this.onDragStart(e)}),t.addListener("drag-move",this.onDragMove.bind(this)),t.addListener("drag-end",()=>{t.removeClass(this.dragHandleDraggingClass),this.onDragEnd.bind(this)})}onDragStart(t){const e=this.getPopoverElement();e&&(t.sourceEvent.preventDefault(),this.dragged=!0,this.dragStartState={client:aa.from(t.clientX,t.clientY),position:aa.from(Number(e.style.getPropertyValue("left").replace("px","")),Number(e.style.getPropertyValue("top").replace("px","")))})}onDragMove(t){const{dragStartState:e}=this,i=this.getPopoverElement();if(!e||!i)return;const n=aa.sub(aa.from(t.clientX,t.clientY),e.client),s=aa.add(e.position,n),r=this.ctx.domManager.getBoundingClientRect(),a={};s.x>=0&&s.x+i.offsetWidth<=r.width&&(a.x=s.x),s.y>=0&&s.y+i.offsetHeight<=r.height&&(a.y=s.y),this.updatePosition(a)}onDragEnd(){this.dragStartState=void 0}},e_={"disjoint-channel":"false","fibonacci-menu":"menu","fibonacci-retracement":"false","fibonacci-retracement-trend-based":"false","fill-color":"dialog","horizontal-line":"false","line-color":"dialog","line-menu":"menu","line-stroke-width":"menu","line-style-type":"menu","measurer-menu":"menu","pan-end":"false","pan-left":"false","pan-right":"false","pan-start":"false","parallel-channel":"false","shape-menu":"menu","text-color":"dialog","text-menu":"menu","text-size":"menu","vertical-line":"false","zoom-in":"false","zoom-out":"false",callout:"false",clear:"false",comment:"false",delete:"false",line:"false",lock:"false",menu:"menu",note:"false",reset:"false",settings:"dialog",text:"false",millisecond:"false",second:"false",minute:"false",hour:"false",day:"false",month:"false",year:"false"};function t_(t){return typeof t!="string"?"false":e_[t]}function i_(t){return ta(t.sourceEvent)&&t.sourceEvent.code==="ArrowLeft"}function n_(t){return ta(t.sourceEvent)&&t.sourceEvent.code==="ArrowRight"}function NA(t){return!1}var OA=class extends Od{constructor(t,e){super(),this.localeManager=t,this.arrowKeyPredicate=NA,e&&this.addKeyboardClickBinding(i=>this.arrowKeyPredicate(i))}update(t,e){const{localeManager:i}=this;if(t.tooltip){const r=i.t(t.tooltip);r!==this.lastTooltip&&(this.elem.title=r,this.lastTooltip=r)}let n="";if(t.icon!=null&&t.iconPosition!=="after"&&(n=`<span class="${Nl(t.icon)} ag-charts-toolbar__icon"></span>`),t.label!=null){const r=i.t(t.label);n=`${n}<span class="ag-charts-toolbar__label">${r}</span>`}t.icon!=null&&t.iconPosition==="after"&&(n=`${n}<span class="${Nl(t.icon)} ag-charts-toolbar__icon"></span>`);const s=t_(t.value);s=="false"?(this.setAriaHasPopup(void 0),this.setAriaExpanded(void 0),this.arrowKeyPredicate=NA):(this.setAriaHasPopup(s),this.setAriaExpanded(!1),this.arrowKeyPredicate=e.isRtl?i_:n_),n!==this.lastInnerHTML&&(this.elem.innerHTML=n,this.lastInnerHTML=n)}setChecked(t){Me(this.elem,"aria-checked",t)}},EA="ag-charts-toolbar__button--active",Ib=class extends Ed{constructor({eventsHub:t,localeManager:e,domManager:i},n,s){super(s),this.ariaLabelId=n,this.horizontalSpacing=10,this.verticalSpacing=10,this.events=new SS,this.hasPrefix=!1,this.buttonWidgets=[],this.updateAriaLabel=()=>this.setAriaLabel(this.localeManager.t(this.ariaLabelId)),this.eventsHub=t,this.localeManager=e,this.domManager=i,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(t){this.ariaLabelId=t,this.updateAriaLabel()}addToolbarListener(t,e){return this.events.addListener(t,e)}clearButtons(){this.expanded?.collapse({mode:"2"});for(const t of this.buttonWidgets)t.destroy();this.buttonWidgets.splice(0)}getInteractionOptions(){const{isRtl:t}=this.domManager;return{isRtl:t}}updateButtons(t){const{buttonWidgets:e}=this;for(const[i,n]of t.entries())(this.buttonWidgets.at(i)??this.createButton(i,n)).update(n,this.getInteractionOptions());for(let i=t.length;i<e.length;i++)this.buttonWidgets.at(i)?.destroy();this.buttonWidgets.splice(t.length),this.refreshButtonClasses()}updateButtonByIndex(t,e){this.buttonWidgets.at(t)?.update(e,this.getInteractionOptions())}clearActiveButton(){for(const t of this.buttonWidgets)t.toggleClass(EA,!1)}toggleActiveButtonByIndex(t){if(t!==-1)for(const[e,i]of this.buttonWidgets.entries())i.toggleClass(EA,t!=null&&t===e)}toggleButtonEnabledByIndex(t,e){t!==-1&&this.buttonWidgets.at(t)?.setEnabled(e)}toggleSwitchCheckedByIndex(t,e){t!==-1&&this.buttonWidgets.at(t)?.setChecked(e)}getButtonBounds(){return this.buttonWidgets.map(t=>this.getButtonWidgetBounds(t))}getButtonWidget(t){return this.buttonWidgets.at(t)}setButtonHiddenByIndex(t,e){this.buttonWidgets.at(t)?.setHidden(e)}getButtonWidgetBounds(t){const e=this.getBounds(),i=t.getBounds(),n=t.getBoundingClientRect(),s=n.x-Math.floor(n.x),r=n.y-Math.floor(n.y);return new U(i.x+e.x+s,i.y+e.y+r,n.width,n.height)}refreshButtonClasses(){const{buttonWidgets:t,hasPrefix:e}=this;let i,n,s;for(const[r,a]of t.entries())i=!e&&r===0||s!=a.section,n=r===t.length-1||a.section!=t.at(r+1)?.section,a.toggleClass("ag-charts-toolbar__button--first",i),a.toggleClass("ag-charts-toolbar__button--last",n),a.toggleClass("ag-charts-toolbar__button--group-first",r>0&&i),s=a.section}createButton(t,e){const i=this.createButtonWidget();return i.addClass("ag-charts-toolbar__button"),i.addListener("click",n=>{const s={index:t,...e instanceof Te?e.toJson():e},r=this.getButtonWidgetBounds(i),a={event:n,button:s,buttonBounds:r,buttonWidget:i};this.events.dispatch("button-pressed",a)}),i.addListener("focus",()=>{const n={button:{index:t}};this.events.dispatch("button-focused",n)}),i.addListener("expand-controlled-widget",n=>{this.expanded?.collapse({mode:"4"}),this.expanded=n.controlled;const s=this.expanded.addListener("collapse-widget",()=>{this.expanded=void 0,s()})}),e.section&&(i.section=e.section),this.buttonWidgets.push(i),this.addChild(i),i}},s_=class extends Ib{createButtonWidget(){return new OA(this.localeManager,!0)}},r_=class extends LA{constructor(t,e,i){super(t,e),this.onPopoverMoved=i,this.dragHandleDraggingClass="ag-charts-floating-toolbar__drag-handle--dragging"}show(t,e={}){this.showWithChildren(t,{...e,class:"ag-charts-floating-toolbar"})}hide(){this.dragged=!1,super.hide()}getBounds(){const t=this.getPopoverElement();return new U(t?.offsetLeft??0,t?.offsetTop??0,t?.offsetWidth??0,t?.offsetHeight??0)}hasBeenDragged(){return this.dragged}setAnchor(t,e,i){const n=this.getPopoverElement();if(!n)return;const s=t.position??"above",{offsetWidth:r,offsetHeight:a}=n;let o=t.y-a-i,l=t.x-r/2;s==="below"?o=t.y+i:s==="right"?(o=t.y-a/2,l=t.x+e):s==="above-left"&&(l=t.x),this.updatePosition({x:l,y:o})}ignorePointerEvents(){const t=this.getPopoverElement();t&&(t.style.pointerEvents="none")}capturePointerEvents(){const t=this.getPopoverElement();t&&(t.style.pointerEvents="unset")}updatePosition(t){const e=this.getBounds(),i=this.ctx.domManager.getBoundingClientRect();t.x=Math.floor(te(0,t.x,i.width-e.width)),t.y=Math.floor(te(0,t.y,i.height-e.height)),super.updatePosition(t),this.onPopoverMoved()}},a_=class extends Ib{constructor(t,e,i){super(t,e,"horizontal"),this.hasPrefix=!0,this.popover=new r_(t,i,this.onPopoverMoved.bind(this)),this.dragHandle=new o_(t.localeManager.t("toolbarAnnotationsDragHandle")),this.popover.setDragHandle(this.dragHandle)}destroy(){super.destroy(),this.popover.destroy()}show(t={}){this.popover.show([this.dragHandle.getElement(),this.getElement()],t)}hide(){this.popover.hide()}setAnchor(t){this.popover.setAnchor(t,this.horizontalSpacing,this.verticalSpacing)}hasBeenDragged(){return this.popover.hasBeenDragged()}ignorePointerEvents(){this.popover.ignorePointerEvents()}capturePointerEvents(){this.popover.capturePointerEvents()}onPopoverMoved(){const t=this.popover.getBounds();if(this.popoverBounds?.equals(t))return;this.popoverBounds=t.clone();const e=this.getButtonBounds();this.events.dispatch("toolbar-moved",{popoverBounds:t,buttonBounds:e})}getButtonWidgetBounds(t){const e=this.popover.getBounds(),i=super.getButtonWidgetBounds(t),n=this.dragHandle.getBounds();return new U(i.x+e.x-n.width,i.y+e.y,i.width,i.height)}},o_=class extends rl{constructor(t){super(ve("div","ag-charts-floating-toolbar__drag-handle"));const e=new rl(ve("span",`${Nl("drag-handle")} ag-charts-toolbar__icon`));e.setAriaHidden(!0),this.addChild(e),this.elem.title=t}},l_={...XS,...JS},RA={};wi(RA,{ButtonWidget:()=>Od,MenuItemRadioWidget:()=>CA,MenuItemWidget:()=>Mb,MenuWidget:()=>AA,NativeWidget:()=>rl,SliderWidget:()=>$m,ToolbarWidget:()=>Ed,Widget:()=>Lr,WidgetEventUtil:()=>Tr});var Db={};wi(Db,{Arc:()=>ps,BBox:()=>U,Caption:()=>tt,CategoryScale:()=>Sa,Group:()=>ne,Line:()=>en,LinearScale:()=>Ma,Marker:()=>Lt,Path:()=>kt,RadialColumnShape:()=>Bn,Rect:()=>Tt,Scene:()=>Rd,Sector:()=>ei,Shape:()=>ga,TranslatableGroup:()=>$t,getRadialColumnWidth:()=>DA,toRadians:()=>Zt});var Cb={};wi(Cb,{AGGREGATION_INDEX_SELECTED:()=>jt,AGGREGATION_INDEX_UNSET:()=>ql,AGGREGATION_INDEX_X_MAX:()=>yt,AGGREGATION_INDEX_X_MIN:()=>ct,AGGREGATION_INDEX_Y_MAX:()=>ht,AGGREGATION_INDEX_Y_MIN:()=>wt,AGGREGATION_MAX_POINTS:()=>Ok,AGGREGATION_MIN_RANGE:()=>or,AGGREGATION_SPAN:()=>Mi,AGGREGATION_THRESHOLD:()=>xs,AbstractModuleInstance:()=>kl,ActionOnSet:()=>ui,AgDocument:()=>Ax,AsyncAwaitQueue:()=>_p,BASE_FONT_SIZE:()=>nr,BREAK_TRANSFORM_CHAIN:()=>qh,BaseProperties:()=>Te,Border:()=>bo,CANVAS_HEIGHT:()=>Xk,CANVAS_TO_BUFFER_DEFAULTS:()=>qk,CANVAS_WIDTH:()=>Zk,CARTESIAN_AXIS_TYPE:()=>lx,CARTESIAN_POSITION:()=>ox,CallbackCache:()=>Cx,ChangeDetectableProperties:()=>Cf,ChartAxisDirection:()=>fp,ChartTheme:()=>_n,ChartUpdateType:()=>Tn,CleanupRegistry:()=>nt,Color:()=>Oe,ConfiguredCanvasMixin:()=>Jk,DEFAULT_ANNOTATION_HANDLE_FILL:()=>fu,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>bu,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>vu,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>Ep,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>Rp,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>mu,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>yu,DEFAULT_CAPTION_ALIGNMENT:()=>cr,DEFAULT_CAPTION_LAYOUT_STYLE:()=>lr,DEFAULT_FIBONACCI_STROKES:()=>Op,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>Ri,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>Ei,DEFAULT_POLAR_SERIES_STROKE:()=>du,DEFAULT_SHADOW_COLOUR:()=>Xr,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>gu,DEFAULT_TEXTBOX_COLOR:()=>Mu,DEFAULT_TEXTBOX_FILL:()=>xu,DEFAULT_TEXTBOX_STROKE:()=>Su,DEFAULT_TEXT_ANNOTATION_COLOR:()=>pu,DEFAULT_TOOLBAR_POSITION:()=>Ql,DIRECTION_SWAP_AXES:()=>dx,Debug:()=>ue,DebugMetrics:()=>js,DeclaredSceneChangeDetection:()=>We,DeclaredSceneObjectChangeDetection:()=>xc,Deprecated:()=>iT,DeprecatedAndRenamedTo:()=>nT,EllipsisChar:()=>io,ErrorType:()=>Lv,EventEmitter:()=>ms,FILL_GRADIENT_BLANK_DEFAULTS:()=>cp,FILL_GRADIENT_CONIC_SERIES_DEFAULTS:()=>wk,FILL_GRADIENT_LINEAR_DEFAULTS:()=>rr,FILL_GRADIENT_LINEAR_HIERARCHY_DEFAULTS:()=>Ik,FILL_GRADIENT_LINEAR_KEYED_DEFAULTS:()=>Ck,FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS:()=>Dk,FILL_GRADIENT_RADIAL_DEFAULTS:()=>ou,FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS:()=>Zl,FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS:()=>gx,FILL_GRADIENT_RADIAL_SERIES_DEFAULTS:()=>Ak,FILL_IMAGE_BLANK_DEFAULTS:()=>up,FILL_IMAGE_DEFAULTS:()=>vs,FILL_PATTERN_BLANK_DEFAULTS:()=>hp,FILL_PATTERN_DEFAULTS:()=>Ki,FILL_PATTERN_HIERARCHY_DEFAULTS:()=>Tk,FILL_PATTERN_KEYED_DEFAULTS:()=>Lk,FILL_PATTERN_SINGLE_DEFAULTS:()=>kk,FONT_SIZE:()=>ax,FONT_SIZE_RATIO:()=>sr,Graph:()=>zx,IS_DARK_THEME:()=>mo,InterpolationProperties:()=>uo,LABEL_BOXING_DEFAULTS:()=>Jn,LEGEND_CONTAINER_THEME:()=>px,LRUCache:()=>Dh,LineSplitter:()=>$s,Logger:()=>j,MARKER_SERIES_HIGHLIGHT_STYLE:()=>dp,MULTI_SERIES_HIGHLIGHT_STYLE:()=>Xl,MementoCaretaker:()=>pp,ModuleRegistry:()=>ee,ModuleType:()=>Pb,ObserveChanges:()=>yo,PALETTE_ALT_DOWN_FILL:()=>Tp,PALETTE_ALT_DOWN_STROKE:()=>wp,PALETTE_ALT_NEUTRAL_FILL:()=>Lp,PALETTE_ALT_NEUTRAL_STROKE:()=>Np,PALETTE_ALT_UP_FILL:()=>kp,PALETTE_ALT_UP_STROKE:()=>Ap,PALETTE_DOWN_FILL:()=>Ip,PALETTE_DOWN_STROKE:()=>Sp,PALETTE_NEUTRAL_FILL:()=>Cp,PALETTE_NEUTRAL_STROKE:()=>Dp,PALETTE_UP_FILL:()=>Mp,PALETTE_UP_STROKE:()=>xp,PART_WHOLE_HIGHLIGHT_STYLE:()=>gp,POLAR_AXIS_SHAPE:()=>hx,POLAR_AXIS_TYPE:()=>cx,Padding:()=>ia,ParallelStateMachine:()=>vT,PolarZIndexMap:()=>vx,PropertiesArray:()=>co,Property:()=>I,ProxyOnWrite:()=>Uk,ProxyProperty:()=>hi,ProxyPropertyOnWrite:()=>xt,ReactiveState:()=>fx,SAFE_FILLS_OPERATION:()=>Sk,SAFE_FILL_OPERATION:()=>xk,SAFE_RANGE2_OPERATION:()=>Mk,SAFE_STROKE_FILL_OPERATION:()=>lp,SEGMENTATION_DEFAULTS:()=>lu,SERIES_SELECTION_THEME:()=>ar,SINGLE_SERIES_HIGHLIGHT_STYLE:()=>Nk,SKIP_JS_BUILTINS:()=>np,ScaleAlignment:()=>Fb,SceneArrayChangeDetection:()=>wf,SceneChangeDetection:()=>Z,SceneObjectChangeDetection:()=>ha,SceneRefChangeDetection:()=>qu,SeriesContentZIndexMap:()=>bx,SeriesZIndexMap:()=>yx,SimpleCache:()=>eT,SpanJoin:()=>L0,StateMachine:()=>oc,StateMachineProperty:()=>bT,TRIPLE_EQ:()=>Ro,TextMeasurer:()=>nf,TickIntervals:()=>zu,TrimCharsRegex:()=>pv,TrimEdgeGuard:()=>Tl,UNIT_MAX:()=>Df,UNIT_MIN:()=>If,UnknownError:()=>Fh,ValidationError:()=>bs,Vec2:()=>aa,Vec4:()=>oa,Vertex:()=>Gx,WeakCache:()=>Nx,ZIndexMap:()=>mx,addEscapeEventListener:()=>Kp,addFakeTransformToInstanceProperty:()=>I,addMouseCloseListener:()=>Hx,addObserverToInstanceProperty:()=>Qg,addOverrideFocusVisibleEventListener:()=>Wx,addTouchCloseListener:()=>$x,addTransformToInstanceProperty:()=>er,aggregationBucketForDatum:()=>Jl,aggregationDatumMatchesIndex:()=>vp,aggregationDomain:()=>Zi,aggregationIndexForXRatio:()=>uu,aggregationRangeFittingPoints:()=>Ss,aggregationXRatioForDatumIndex:()=>fo,aggregationXRatioForXValue:()=>un,and:()=>Ie,angleBetween:()=>Du,angularPadding:()=>Vp,appendEllipsis:()=>Vg,applySkiaPatches:()=>Qk,arcDistanceSquared:()=>sT,areScalingEqual:()=>ca,array:()=>Yn,arrayLength:()=>Ys,arrayOf:()=>Q,arrayOfDefs:()=>Pt,arraysEqual:()=>jn,assignIfNotStrictlyEqual:()=>bk,attachDescription:()=>ye,attachListener:()=>_e,autoSizedLabelOptionsDefs:()=>Qs,barHighlightOptionsDef:()=>Dn,bezier2DDistance:()=>I0,bezier2DExtrema:()=>M0,boolean:()=>T,borderOptionsDef:()=>$r,boxCollides:()=>Cu,boxContains:()=>tc,boxEmpty:()=>Wk,boxesEqual:()=>Au,buildDateFormatter:()=>Eo,cachedTextMeasurer:()=>di,calcLineHeight:()=>Fg,calculatePlacement:()=>qx,callWithContext:()=>dn,callback:()=>Re,callbackDefs:()=>De,callbackOf:()=>ci,ceilTo:()=>Lw,checkDatum:()=>y0,circularSliceArray:()=>Mn,clamp:()=>te,clampArray:()=>go,clipLines:()=>i0,clipSpanX:()=>Mf,coerceTextValue:()=>Sv,collapseSpanToPoint:()=>Yu,collectAggregationLevels:()=>Fk,collectSparseSelection:()=>xx,color:()=>H,colorScaleOptionsDef:()=>Zs,colorStopsOrderValidator:()=>zh,colorUnion:()=>Ni,commonChartOptionsDefs:()=>re,commonSeriesOptionsDefs:()=>wn,commonSeriesThemeableOptionsDefs:()=>Se,compactAggregationIndices:()=>Zr,compareDates:()=>zp,computeColorBins:()=>cv,computeExtremesAggregation:()=>Ix,computeExtremesAggregationPartial:()=>Vk,constant:()=>Ge,contextMenuItemsArray:()=>qv,countFractionDigits:()=>Lh,countLines:()=>Av,createAggregationIndices:()=>Ms,createButton:()=>fL,createCanvasContext:()=>Tx,createCheckbox:()=>mL,createDeprecationWarning:()=>Hp,createDynamicContext:()=>Lg,createElement:()=>ve,createElementId:()=>sc,createIcon:()=>_0,createId:()=>Nn,createIdsGenerator:()=>yf,createNumberFormatter:()=>Ug,createSelect:()=>yL,createSvgElement:()=>ut,createTextArea:()=>bL,createTicks:()=>ko,date:()=>Gt,dateToNumber:()=>Xt,dateTruncationForDomain:()=>mf,datesSortOrder:()=>jp,debounce:()=>Yw,decodeIntervalValue:()=>o0,deepClone:()=>He,deepFreeze:()=>hn,defaultEpoch:()=>gf,defined:()=>le,definedZoomState:()=>yc,deprecated:()=>zl,deriveNormalizedStops:()=>hv,diffArrays:()=>Ox,discreteColorStops:()=>Eg,distribute:()=>zb,downloadUrl:()=>Qx,dropFirstWhile:()=>_b,dropLastWhile:()=>Bb,durationDay:()=>ra,durationHour:()=>sa,durationMinute:()=>pr,durationMonth:()=>of,durationSecond:()=>Mo,durationWeek:()=>n0,durationYear:()=>lc,easeIn:()=>vL,easeInOut:()=>xL,easeInOutQuad:()=>IL,easeInQuad:()=>SL,easeOut:()=>vc,easeOutQuad:()=>ML,encodedToTimestamp:()=>fr,enterprise:()=>In,enterpriseRegistry:()=>Hs,entries:()=>vt,errorBarOptionsDefs:()=>Zh,errorBarThemeableOptionsDefs:()=>Wl,estimateTickCount:()=>f0,evaluateBezier:()=>No,every:()=>nx,expandLegendPosition:()=>hu,extent:()=>dr,extractDecoratedProperties:()=>tx,extractDomain:()=>Il,fillCssOptionsDef:()=>Wi,fillGradientDefaults:()=>zv,fillImageDefaults:()=>jv,fillOptionsDef:()=>$,fillPatternDefaults:()=>Gv,findDiscreteColorBinLabel:()=>uv,findMaxIndex:()=>vo,findMaxValue:()=>Kk,findMinIndex:()=>xo,findMinMax:()=>At,findMinValue:()=>Yk,findRangeExtent:()=>Yr,first:()=>Oi,flush:()=>ev,focusCursorAtEnd:()=>Gw,fontFamilyFull:()=>Hh,fontOptionsDef:()=>Ce,fontWeight:()=>Hl,formatColorBinLabel:()=>Og,formatColorScaleBinLabel:()=>lv,formatNumber:()=>Px,formatObjectValidator:()=>Jv,formatPercent:()=>Ex,formatValue:()=>Qr,fromPairs:()=>sx,generateUUID:()=>Ou,geoJson:()=>Bx,getAngleRatioRadians:()=>wx,getAttribute:()=>Jr,getChartTheme:()=>pg,getDOMMatrix:()=>Cg,getDocument:()=>Gr,getElementBBox:()=>mv,getIconClassNames:()=>Nl,getImage:()=>Hb,getLastFocus:()=>Zp,getMaxInnerRectSize:()=>Pp,getMidpointsForIndices:()=>Qn,getMinOuterRectSize:()=>Bk,getOffscreenCanvas:()=>Ch,getPath:()=>ip,getPath2D:()=>Al,getPrevNextKeys:()=>nc,getResizeObserver:()=>$b,getSequentialColors:()=>Yi,getTickTimeInterval:()=>gc,getWindow:()=>Hn,googleFont:()=>Zg,gradientColorStops:()=>Gh,gradientStrict:()=>jh,graphemeSegments:()=>ys,greaterThan:()=>Si,groupBy:()=>Cl,guardTextEdges:()=>Mv,hasNoModifiers:()=>ta,hasRequiredInPath:()=>jr,highlightOptionsDef:()=>Kg,htmlElement:()=>jg,inRange:()=>rv,initRovingTabIndex:()=>gT,insertListItemsSorted:()=>Xx,instanceOf:()=>Qw,interpolationOptionsDefs:()=>Xh,intervalAgo:()=>AT,intervalCeil:()=>s0,intervalEpoch:()=>uc,intervalExtent:()=>cf,intervalFloor:()=>Pi,intervalHierarchy:()=>dc,intervalMilliseconds:()=>Fi,intervalNext:()=>lf,intervalPrevious:()=>r0,intervalRange:()=>On,intervalRangeCount:()=>hf,intervalRangeNumeric:()=>a0,intervalRangeStartIndex:()=>l0,intervalStep:()=>mr,intervalUnit:()=>Cs,inverseEaseOut:()=>z0,isArray:()=>ce,isBetweenAngles:()=>hr,isBoolean:()=>bv,isButtonClickEvent:()=>Yp,isColor:()=>xv,isContinuous:()=>Hu,isDate:()=>rn,isDecoratedObject:()=>Qh,isDefined:()=>Kn,isDenseInterval:()=>Lo,isDirectionRtl:()=>no,isDocumentFragment:()=>Wb,isElement:()=>Ag,isEmptyObject:()=>Rl,isEnumKey:()=>Hw,isEnumValue:()=>$w,isFiniteNumber:()=>Ee,isFunction:()=>an,isGradientFill:()=>qi,isGradientFillArray:()=>rL,isGradientOrPatternFill:()=>aL,isHTMLElement:()=>Ja,isHtmlElement:()=>Rg,isImageFill:()=>la,isInputPending:()=>yv,isInteger:()=>av,isKeyOf:()=>Fl,isNegative:()=>to,isNode:()=>Ah,isNumber:()=>Li,isNumberEqual:()=>Ti,isNumberObject:()=>m0,isObject:()=>he,isObjectLike:()=>El,isObjectWithProperty:()=>rx,isObjectWithStringProperty:()=>vk,isPatternFill:()=>As,isPlainObject:()=>ke,isPointLabelDatum:()=>C0,isProperties:()=>ho,isRegExp:()=>vv,isScaleValid:()=>mc,isSegmentTruncated:()=>Eh,isString:()=>ot,isStringFillArray:()=>x0,isStringObject:()=>bf,isSymbol:()=>Pl,isTextTruncated:()=>Us,isTimeInterval:()=>wT,isTimeIntervalUnit:()=>kT,isTruncated:()=>Dv,isUnitTimeCategoryScaling:()=>yr,isValidDate:()=>Ol,isValidNumberFormat:()=>Fv,iterate:()=>Ur,joinFormatted:()=>Ws,jsonApply:()=>Up,jsonDiff:()=>es,jsonPropertyCompare:()=>jx,jsonWalk:()=>gr,kebabCase:()=>kv,labelBoxOptionsDef:()=>ln,legendPositionValidator:()=>Uh,lessThan:()=>xi,lessThanOrEqual:()=>Ov,levenshteinDistance:()=>wv,lineDashOptionsDef:()=>W,lineDistanceSquared:()=>wu,lineHighlightOptionsDef:()=>Xs,lineSegmentOptions:()=>Wv,lineSegmentation:()=>Kv,linear:()=>B0,linearGaugeSeriesOptionsDef:()=>Wr,linearGaugeSeriesThemeableOptionsDef:()=>su,linearGaugeTargetOptionsDef:()=>iu,linearPoints:()=>N0,listDecoratedProperties:()=>tr,lowestGranularityForInterval:()=>pc,lowestGranularityUnitForTicks:()=>ff,lowestGranularityUnitForValue:()=>ju,makeAccessibleClickListener:()=>pT,mapValues:()=>tp,markerOptionsDefs:()=>kn,markerStyleOptionsDefs:()=>Js,measureTextSegments:()=>Ds,memo:()=>So,merge:()=>Yl,mergeArrayDefaults:()=>yk,mergeDefaults:()=>ge,modulus:()=>ov,multiSeriesHighlightOptionsDef:()=>lt,nearestSquared:()=>Ru,nearestSquaredInContainer:()=>yT,nextPowerOf2:()=>po,niceTicksDomain:()=>pf,normalisedExtentWithMetadata:()=>ku,normalisedTimeExtentWithMetadata:()=>Tu,normalizeAngle180:()=>Iu,normalizeAngle360:()=>Ii,normalizeAngle360FromDegrees:()=>Is,normalizeAngle360Inclusive:()=>zk,number:()=>P,numberFormatValidator:()=>An,numberMin:()=>$g,numberRange:()=>Nv,object:()=>Ks,objectsEqual:()=>st,objectsEqualWith:()=>ep,optionsDefs:()=>ze,or:()=>se,overflowStrategy:()=>$h,padding:()=>Xn,paddingOptions:()=>Yv,parseColor:()=>fv,parseNumberFormat:()=>_h,partialAssign:()=>rp,pause:()=>Bp,pick:()=>eu,pickDirectionZoom:()=>bc,placeLabels:()=>A0,populateBucketSelectedFromSparse:()=>Sx,populateBucketSelectedFromSparseSplit:()=>Mx,positiveNumber:()=>k,positiveNumberNonZero:()=>Zn,preserveArabicJoining:()=>_g,previousPowerOf2:()=>mp,radialGaugeSeriesOptionsDef:()=>au,radialGaugeSeriesThemeableOptionsDef:()=>ru,radialGaugeTargetOptionsDef:()=>nu,range:()=>Gu,rangeValidator:()=>Kh,ratio:()=>q,readIntegratedWrappedValue:()=>vf,record:()=>Qb,required:()=>X,rescaleSpan:()=>Oo,rescaleVisibleRange:()=>Vu,resetIds:()=>fT,resolveOperation:()=>u_,resolveStopPositions:()=>Ng,rotatePoint:()=>Fp,roundTo:()=>Th,safeCall:()=>zg,selectionContainmentValidator:()=>$v,selectionOptionsDef:()=>Yg,seriesLabelOptionsDefs:()=>Fe,seriesTooltipRangeValidator:()=>Zv,setAttribute:()=>Me,setAttributes:()=>qr,setDocument:()=>Gb,setElementBBox:()=>Nh,setElementStyle:()=>Ln,setElementStyles:()=>kx,setPath:()=>sp,setWindow:()=>jb,shadowOptionsDefs:()=>qn,shallowClone:()=>ea,shapeHighlightOptionsDef:()=>je,shapeSegmentOptions:()=>Uv,shapeSegmentation:()=>ao,shapeSelectionOptionsDef:()=>Hv,shapeValidator:()=>qs,simpleMemorize:()=>Eu,simpleMemorize2:()=>ac,smoothPoints:()=>E0,solveBezier:()=>Ku,sortAndUniqueDates:()=>Gp,sortBasedOnArray:()=>Vb,spanRange:()=>Di,splitBezier2D:()=>fc,stepPoints:()=>O0,stopPageScrolling:()=>Yx,strictObjectKeys:()=>ir,strictUnion:()=>Vh,string:()=>N,stringLength:()=>Hg,stringifyValue:()=>Vl,strokeOptionsDef:()=>B,textAlign:()=>gk,textOrSegments:()=>cn,textWrap:()=>Hr,themeNames:()=>h_,themeOperator:()=>jl,themeSymbols:()=>c_,themes:()=>hb,throttle:()=>Bg,tickFormat:()=>LT,tickStep:()=>To,timeInterval:()=>Ul,timeIntervalUnit:()=>lo,toArray:()=>Dl,toDegrees:()=>Gk,toFontString:()=>Pg,toIterable:()=>ix,toPlainText:()=>Ue,toRadians:()=>Zt,toTextString:()=>et,toTimeInterval:()=>df,toZoomState:()=>ts,toolbarButtonOptionsDefs:()=>oo,tooltipOptionsDefs:()=>Ae,tooltipOptionsDefsWithArea:()=>ex,transformIntegratedCategoryValue:()=>$u,truncateLine:()=>na,typeUnion:()=>Gl,undocumented:()=>J,unguardTextEdges:()=>Iv,union:()=>V,unionSymbol:()=>_l,unique:()=>Dg,validate:()=>zt,withTimeout:()=>jk,without:()=>Y,wrapLines:()=>rf,wrapText:()=>t0,wrapTextOrSegments:()=>Pu,wrapTextSegments:()=>af});var c_={DEFAULT_ANNOTATION_HANDLE_FILL:fu,DEFAULT_ANNOTATION_STATISTICS_COLOR:bu,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:vu,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:Ep,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:Rp,DEFAULT_ANNOTATION_STATISTICS_FILL:mu,DEFAULT_ANNOTATION_STATISTICS_STROKE:yu,DEFAULT_CAPTION_ALIGNMENT:cr,DEFAULT_CAPTION_LAYOUT_STYLE:lr,DEFAULT_FIBONACCI_STROKES:Op,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:Ri,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:Ei,DEFAULT_POLAR_SERIES_STROKE:du,DEFAULT_SHADOW_COLOUR:Xr,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:gu,DEFAULT_TEXTBOX_COLOR:Mu,DEFAULT_TEXTBOX_FILL:xu,DEFAULT_TEXTBOX_STROKE:Su,DEFAULT_TEXT_ANNOTATION_COLOR:pu,DEFAULT_TOOLBAR_POSITION:Ql,IS_DARK_THEME:mo,PALETTE_ALT_DOWN_FILL:Tp,PALETTE_ALT_DOWN_STROKE:wp,PALETTE_ALT_NEUTRAL_FILL:Lp,PALETTE_ALT_NEUTRAL_STROKE:Np,PALETTE_ALT_UP_FILL:kp,PALETTE_ALT_UP_STROKE:Ap,PALETTE_DOWN_FILL:Ip,PALETTE_DOWN_STROKE:Sp,PALETTE_NEUTRAL_FILL:Cp,PALETTE_NEUTRAL_STROKE:Dp,PALETTE_UP_FILL:Mp,PALETTE_UP_STROKE:xp},h_=Object.keys(hb);function u_(t){const e=_n.getDefaultPublicParameters(),i=_n.getDefaultColors();return new lA({line:{operation:t}},{series:[{type:"line"}]},e,i).resolve().operation}var Ab={};wi(Ab,{Color:()=>Oe,interpolateColor:()=>qS});var d_={VERSION:Ye,_Scene:Db,_Theme:Cb,_Util:Ab,create:Vr.create.bind(Vr),createSparkline:Vr.__createSparkline.bind(Vr),setup:()=>{ee.setRegistryMode(ee.RegistryMode.Integrated),ee.registerModules(qy)},isEnterprise:!1};if(ee.registerModules(qy),typeof Gn.exports=="object"&&typeof Ml=="object"){var g_=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Object.getOwnPropertyNames(e))!Object.prototype.hasOwnProperty.call(t,s)&&s!==i&&Object.defineProperty(t,s,{get:()=>e[s],enumerable:!(n=Object.getOwnPropertyDescriptor(e,s))||n.enumerable});return t};Gn.exports=g_(Gn.exports,Ml)}return Gn.exports});