ag-charts-core
Version:
Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue
8 lines (5 loc) • 126 kB
JavaScript
var Fi=Object.defineProperty,ha=Object.getOwnPropertyDescriptor,te=(t,e)=>{for(var n in e)Fi(t,n,{get:e[n],enumerable:!0})},Q=(t,e,n,r)=>{for(var i=r>1?void 0:r?ha(e,n):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(r?s(e,n,i):s(i))||i);return r&&i&&Fi(e,n,i),i},on={};te(on,{Time:()=>Ca,check:()=>re,create:()=>Da,inDevelopmentMode:()=>ka});function ir(t){return t===void 0?[]:Array.isArray(t)?t:[t]}function da(t){return Array.from(new Set(t))}function ga(t,e){return t.reduce((n,r)=>{const i=e(r);return n[i]??(n[i]=[]),n[i].push(r),n},{})}function ee(t,e){if(t==null||e==null||t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(Array.isArray(t[n])&&Array.isArray(e[n])){if(!ee(t[n],e[n]))return!1}else if(t[n]!==e[n])return!1;return!0}function ya(t,e,n=0){if(t.length===0)return[];const r=[];for(let i=0;i<e;i++)r.push(t.at((i+n)%t.length));return r}function pa(t,e){const n=new Map;for(const[r,i]of e.entries())n.set(i,r);return t.sort((r,i)=>{const o=n.get(r)??1/0,s=n.get(i)??1/0;return o-s})}function ma(t,e){let n=0;for(;n<t.length&&e(t[n]);)n+=1;const r=n;r!==0&&t.splice(0,r)}function ba(t,e){let n=t.length-1;for(;n>=0&&e(t[n]);)n-=1;const r=t.length-1-n;r!==0&&t.splice(t.length-r,r)}function va(t,e,n){const r=[t],i=Math.round((e-t)/(n-1));if(i>0)for(let o=t+i;o<e&&!(r.push(o)>=n-1);o+=i);return r.push(e),r}var pt={};typeof globalThis.window<"u"&&(pt.window=globalThis.window),typeof document<"u"?pt.document=document:typeof globalThis.global<"u"&&(pt.document=globalThis.document);function Se(t){return t?pt.document?.[t]:pt.document}function Lt(t){return t?pt.window?.[t]:pt.window}function xa(t){pt.document=t}function wa(t){pt.window=t}function Ot(t,e,n){const r=Se().createElement(t);if(typeof e=="object"&&(n=e,e=void 0),e)for(const i of e.split(" "))r.classList.add(i);return n&&Object.assign(r.style,n),r}function Ma(t){return Se().createElementNS("http://www.w3.org/2000/svg",t)}function Oa(t,e){const n=Se("body"),r=Ot("a",{display:"none"});r.href=t,r.download=e,n.appendChild(r),r.click(),setTimeout(()=>r.remove())}function ut(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}var Fe;function Di(t){if(Fe==null){const n=Lt("Option");Fe=new n().style}Fe.color=t;const e=Fe.color||null;return Fe.color="",e}var W={};te(W,{error:()=>Ci,errorOnce:()=>Ea,log:()=>sn,logGroup:()=>Li,reset:()=>Ta,table:()=>Aa,warn:()=>ki,warnOnce:()=>ne});var or=new Set;function sn(...t){console.log(...t)}function ki(t,...e){console.warn(`AG Charts - ${t}`,...e)}function Ci(t,...e){typeof t=="object"?console.error("AG Charts error",t,...e):console.error(`AG Charts - ${t}`,...e)}function Aa(...t){console.table(...t)}function Ni(t,e,n){let r;t instanceof Error?r=t.message:typeof t=="string"?r=t:typeof t=="object"?r=JSON.stringify(t):r=String(t);const i=`${e}: ${r}`;or.has(i)||(n(t),or.add(i))}function ne(t,...e){Ni(t,"Logger.warn",n=>ki(n,...e))}function Ea(t,...e){Ni(t,"Logger.error",n=>Ci(n,...e))}function Ta(){or.clear()}function Li(t,e){console.groupCollapsed(t);try{return e()}finally{console.groupEnd()}}var Sa=2e3,Ri=Date.now();function Fa(){const t=Date.now()-Ri;if(t>Sa){const e=(Math.floor(t/100)/10).toFixed(1);sn(`**** ${e}s since last log message ****`)}Ri=Date.now()}function Da(...t){return Object.assign((...n)=>{re(...t)&&(typeof n[0]=="function"&&(n=ir(n[0]())),Fa(),sn(...n))},{check:()=>re(...t),group:(n,r)=>re(...t)?Li(n,r):r()})}function re(...t){return t.length===0&&t.push(!0),ir(Lt("agChartsDebug")).some(n=>t.includes(n))}function ka(t){if(re("dev"))return t()}function Ca(t,e={}){const{logResult:n=!0,logStack:r=!1,logArgs:i=!1,logData:o}=e;return function(s,a,c){const l=c.value;c.value=function(...u){const f=performance.now(),h=l.apply(this,u),g={duration:performance.now()-f};return n&&(g.result=h),i&&(g.args=u),r&&(g.stack=new Error("Stack trace for timing debug").stack),o&&(g.logData=o(this)),sn(t,g),h}}}var Ii={};te(Ii,{flush:()=>La,record:()=>Na});var sr=new Map;function Na(t,e){re("scene:stats:verbose")&&sr.set(t,e)}function La(){const t=Object.fromEntries(sr);return sr.clear(),t}var Ra={},_i={};te(_i,{RegistryMode:()=>$i,getAxisModule:()=>ja,getChartModule:()=>Ga,getPresetModule:()=>Ha,getSeriesModule:()=>Ua,hasModule:()=>Pa,isEnterprise:()=>Va,isIntegrated:()=>za,isModuleType:()=>ie,isUmd:()=>qa,listModules:()=>$a,listModulesByType:()=>Ba,register:()=>ar,registerModules:()=>Ia,reset:()=>_a,setRegistryMode:()=>Wa});var Pi=(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))(Pi||{}),$i=(t=>(t.Enterprise="enterprise",t.Integrated="integrated",t.UMD="umd",t))($i||{}),De=new Set,gt=new Map;function Bi(t){if(gt.set(t.name,t),t.dependencies)for(const e of t.dependencies)ar(e)}function ar(t){const e=gt.get(t.name);if(!e){Bi(t);return}if(e.version===t.version){!e.enterprise&&t.enterprise&&Bi(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 Ia(t){for(const e of t.flat())ar(e)}function _a(){De.clear(),gt.clear()}function Pa(t){return gt.has(t)}function*$a(){for(const t of gt.values())yield t}function*Ba(t){for(const e of gt.values())ie(t,e)&&(yield e)}function ja(t){const e=gt.get(t);if(ie("axis",e))return e}function Ga(t){const e=gt.get(t);if(ie("chart",e))return e;throw new Error("AG Charts - Unknown chart type; Check options are correctly structured and series types are specified")}function Ha(t){const e=gt.get(t);if(ie("preset",e))return e}function Ua(t){const e=gt.get(t);if(ie("series",e))return e}function Wa(t){De.add(t)}function Va(){return De.has("enterprise")}function za(){return De.has("integrated")}function qa(){return De.has("umd")}function ie(t,e){return e?.type===t}var cr=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)}},Ka=class{constructor(){this.cleanup=new cr}destroy(){this.cleanup.flush()}};function Ya(t){return t.domain}var ji=(t=>(t[t.Leading=0]="Leading",t[t.Trailing=1]="Trailing",t[t.Interpolate=2]="Interpolate",t))(ji||{}),Xa=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 n=this.events.get(t);n&&(n.delete(e),n.size===0&&this.events.delete(t))}emit(t,e){const n=this.events.get(t);if(n)for(const r of n)r(e)}clear(t){t?this.events.delete(t):this.events.clear()}},lr=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()}};function et(t,e,n){return Math.min(n,Math.max(t,e))}function Ja(t,e,n=1e-10){return t>=e[0]-n&&t<=e[1]+n}function ur(t,e,n=1e-10){return t===e||Math.abs(t-e)<n}function Qa(t){return Math.sign(t)===-1||Object.is(t,-0)}function Za(t){return t%1===0}function fr(t,e=2){const n=10**e;return Math.round(t*n)/n}function tc(t,e){return Math.floor(t%e+(t<0?Math.abs(e):0))}function Gi(t){if(Math.floor(t)===t)return 0;let e=String(t),n=0;if(t<1e-6||t>=1e21){let i;[e,i]=e.split("e"),i!=null&&(n=Number(i))}const r=e.split(".")[1]?.length??0;return Math.max(r-n,0)}function an(t){return t!=null}function N(t){return Array.isArray(t)}function Hi(t){return typeof t=="boolean"}function oe(t){return t instanceof Date}function cn(t){return oe(t)&&!Number.isNaN(Number(t))}function Ui(t){return t instanceof RegExp}function mt(t){return typeof t=="function"}function Z(t){return typeof t=="object"&&t!==null&&!N(t)}function ec(t){return N(t)||V(t)}function V(t){return typeof t=="object"&&t!==null&&t.constructor?.name==="Object"}function nc(t){if(typeof t!="object"||t===null)return!1;for(const e in t)return!1;return!0}function bt(t){return typeof t=="string"}function ke(t){return typeof t=="number"}function ft(t){return Number.isFinite(t)}function Wi(t){return typeof globalThis.window<"u"&&t instanceof HTMLElement}function rc(t,e){return bt(e)&&Object.keys(t).includes(e)}function ic(t,e){return Object.values(t).includes(e)}function oc(t){return typeof t=="symbol"}function Vi(t){return bt(t)&&(t==="none"||Di(t)!=null)}function sc(t,e){return t in e}var zi=/^(?:(.)?([<>=^]))?([+\-( ])?([$€£¥₣₹#])?(0)?(\d+)?(,)?(?:\.(\d+))?(~)?([%a-z])?$/i,qi=/^((?:[^#]|#[^{])*)#{([^}]+)}(.*)$/;function Ki(t){if(!bt(t))return!1;const e=qi.exec(t);return zi.test(e?e[2]:t)}function hr(t){let e,n;const r=qi.exec(t);r&&([,e,t,n]=r);const i=zi.exec(t);if(!i){W.warnOnce(`The number formatter is invalid: ${t}`);return}const[,o,s,a,c,l,u,f,h,d,g]=i;return{fill:o,align:s,sign:a,symbol:c,zero:l,width:Number.parseInt(u),comma:f,precision:Number.parseInt(h),trim:!!d,type:g,prefix:e,suffix:n}}function Yi(t){const e=typeof t=="string"?hr(t):t;if(e==null)return;const{fill:n,align:r,sign:i="-",symbol:o,zero:s,width:a,comma:c,type:l,prefix:u="",suffix:f="",precision:h}=e;let{trim:d}=e;const g=h==null||Number.isNaN(h);let p;if(!l)p=st.g,d=!0;else if(l in st&&l in se)p=g?se[l]:st[l];else if(l in st)p=st[l];else if(l in se)p=se[l];else throw new Error(`The number formatter type is invalid: ${l}`);const b=l?6:12;let v;g||(v=h);let w=r,O=n;return s&&(O??(O="0"),w??(w="=")),(k,Y)=>{let _;v!=null?_=v:l==="f"||l==="%"?_=Y??b:l?_=b:_=Y??b;let T=p(k,_);d&&(T=lc(T)),c&&(T=uc(T,c));const H=gc(o,l),wt=H?.length??0;H&&(T=`${H}${T}`),l==="s"&&(T=`${T}${fc(k)}`),(l==="%"||l==="p")&&(T=`${T}%`);const{value:Ct,prefixLength:Mt}=hc(k,T,i),Nt=Mt+wt;let it=Ct;return a!=null&&!Number.isNaN(a)&&(it=dc(it,a,O??" ",w,Nt)),it=`${u}${it}${f}`,it}}var se={b:t=>ln(t).toString(2),c:t=>String.fromCodePoint(t),d:t=>Math.round(Math.abs(t)).toFixed(0),o:t=>ln(t).toString(8),x:t=>ln(t).toString(16),X:t=>se.x(t).toUpperCase(),n:t=>se.d(t),"%":t=>`${ln(t*100).toFixed(0)}`},st={e:(t,e)=>Math.abs(t).toExponential(e),E:(t,e)=>st.e(t,e).toUpperCase(),f:(t,e)=>Math.abs(t).toFixed(e),F:(t,e)=>st.f(t,e).toUpperCase(),g:(t,e)=>{if(t===0)return"0";const n=Math.abs(t),r=Math.floor(Math.log10(n));return r>=-4&&r<e?n.toFixed(e-1-r):n.toExponential(e-1)},G:(t,e)=>st.g(t,e).toUpperCase(),n:(t,e)=>st.g(t,e),p:(t,e)=>st.r(t*100,e),r:(t,e)=>{if(t===0)return"0";const n=Math.abs(t),i=Math.floor(Math.log10(n))-(e-1);if(i<=0)return n.toFixed(-i);const o=10**i;return(Math.round(n/o)*o).toFixed()},s:(t,e)=>{const n=Qi(t);return st.r(t/10**n,e)},"%":(t,e)=>st.f(t*100,e)},Xi=-24,Ji=24,ac={[Xi]:"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",[Ji]:"Y"},cc="\u2212";function ln(t){return Math.floor(Math.abs(t))}function lc(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 uc(t,e){let n=t.indexOf(".");n<0&&(n=t.length);const r=t.substring(0,n).split(""),i=t.substring(n);for(let o=r.length-3;o>0;o-=3)r.splice(o,0,e);return`${r.join("")}${i}`}function fc(t){return ac[Qi(t)]}function Qi(t){return et(Xi,t?Math.floor(Math.log10(Math.abs(t))/3)*3:0,Ji)}function hc(t,e,n=""){if(n==="(")return t>=0?{value:e,prefixLength:0}:{value:`(${e})`,prefixLength:1};let r="";return t<0?r=cc:n==="+"?r="+":n===" "&&(r=" "),{value:`${r}${e}`,prefixLength:r.length}}function dc(t,e,n=" ",r=">",i=0){const o=e-t.length;if(o<=0)return t;const s=n.repeat(o);if(r==="="){const a=Math.min(Math.max(i,0),t.length),c=t.slice(0,a),l=t.slice(a);return`${c}${s}${l}`}if(r===">"||!r)return s+t;if(r==="<")return`${t}${s}`;if(r==="^"){const a=Math.ceil(o/2),c=Math.floor(o/2);return`${n.repeat(a)}${t}${n.repeat(c)}`}return s+t}function gc(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 un={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 dr(t,e=new Date(t.getFullYear(),0,1)){const n=t.getTimezoneOffset()-e.getTimezoneOffset(),r=t.getTime()-e.getTime()+n*6e4,i=36e5*24;return Math.floor(r/i)}function Zi(t,e){const r=new Date(t.getFullYear(),0,1).getDay(),i=(e-r+7)%7,o=new Date(t.getFullYear(),0,i+1);return o<=t?Math.floor(dr(t,o)/7)+1:0}var yc=0,to=1,eo=4;function no(t,e=t.getFullYear()){const r=new Date(e,0,1).getDay(),i=(eo-r+7)%7,o=new Date(e,0,i-(eo-to)+1);return o<=t?Math.floor(dr(t,o)/7)+1:no(t,e-1)}function pc(t){const e=t.getTimezoneOffset(),n=Math.abs(e);return`${e>0?"-":"+"}${z(Math.floor(n/60),2,"0")}${z(Math.floor(n%60),2,"0")}`}var mc={a:t=>un.shortDays[t.getDay()],A:t=>un.days[t.getDay()],b:t=>un.shortMonths[t.getMonth()],B:t=>un.months[t.getMonth()],c:"%x, %X",d:(t,e)=>z(t.getDate(),2,e??"0"),e:"%_d",f:(t,e)=>z(t.getMilliseconds()*1e3,6,e??"0"),H:(t,e)=>z(t.getHours(),2,e??"0"),I:(t,e)=>{const n=t.getHours()%12;return n===0?"12":z(n,2,e??"0")},j:(t,e)=>z(dr(t)+1,3,e??"0"),m:(t,e)=>z(t.getMonth()+1,2,e??"0"),M:(t,e)=>z(t.getMinutes(),2,e??"0"),L:(t,e)=>z(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)=>z(t.getSeconds(),2,e??"0"),u:t=>{let e=t.getDay();return e<1&&(e+=7),String(e%7)},U:(t,e)=>z(Zi(t,yc),2,e??"0"),V:(t,e)=>z(no(t),2,e??"0"),w:(t,e)=>z(t.getDay(),2,e??"0"),W:(t,e)=>z(Zi(t,to),2,e??"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(t,e)=>z(t.getFullYear()%100,2,e??"0"),Y:(t,e)=>z(t.getFullYear(),4,e??"0"),Z:t=>pc(t),"%":()=>"%"},bc={_:" ",0:"0","-":""};function z(t,e,n){const r=String(Math.floor(t));return r.length>=e?r:`${n.repeat(e-r.length)}${r}`}function ro(t){const e=[];for(;t.length>0;){let n=t.indexOf("%");if(n!==0){const a=n>0?t.substring(0,n):t;e.push(a)}if(n<0)break;const r=t[n+1],i=bc[r];i!=null&&n++;const o=t[n+1],s=mc[o];if(typeof s=="function")e.push([s,i]);else if(typeof s=="string"){const a=ro(s);e.push([a,i])}else e.push(`${i??""}${o}`);t=t.substring(n+2)}return n=>{const r=typeof n=="number"?new Date(n):n;return e.map(i=>typeof i=="string"?i:i[0](r,i[1])).join("")}}function vc(t,e=0,n){const{leading:r=!1,trailing:i=!0,maxWait:o=1/0}=n??{};let s,a;if(o<e)throw new Error("Value of maxWait cannot be lower than waitMs.");function c(...l){if(r&&!a){a=Date.now(),s=setTimeout(()=>a=null,e),t(...l);return}let u=e;if(o!==1/0&&a){const f=Date.now()-a;e>o-f&&(u=o-f)}clearTimeout(s),a??(a=Date.now()),s=setTimeout(()=>{a=null,i&&t(...l)},u)}return Object.assign(c,{cancel(){clearTimeout(s),a=null}})}function xc(t,e,n){const{leading:r=!0,trailing:i=!0}=n??{};let o,s,a=!1;function c(){i&&s?(o=setTimeout(c,e),t(...s)):a=!1,s=null}function l(...u){a?s=u:(a=!0,o=setTimeout(c,e),r?t(...u):s=u)}return Object.assign(l,{cancel(){clearTimeout(o),a=!1,s=null}})}function gr(t,e,n=""){try{return t(...e)}catch(r){const i=n?` \`${n}\``:"";ne(`Uncaught exception in user callback${i}`,r)}}var Ce="\u2026",fn=/\r?\n/g,Ne="\u200B";function io({fontSize:t,fontStyle:e,fontWeight:n,fontFamily:r}){let i="";return e&&e!=="normal"&&(i+=`${e} `),n&&n!=="normal"&&n!==400&&(i+=`${n} `),i+=`${t}px`,i+=` ${r}`,i}function wc(t,e=1.15){return Math.round(t*e)}function ae(t){return String(t??"")}var Mc=/[\s.,;:-]{1,5}$/;function yr(t){return t.replace(Mc,"")+Ce}function oo(t){return Ne+t+Ne}function so(t){return t.replaceAll(Ne,"")}function Oc(t){return N(t)?ao(t.at(-1)):Le(ae(t))}function Le(t){return t.endsWith(Ce)}function ao(t){return ae(t?.text).endsWith(Ce)}function ce(t,e="and",n=String,r=1/0){if(t.length===0)return"";if(t.length===1)return n(t[0]);t=t.map(n);const i=t.pop();if(t.length>=r){const o=t.length-(r-1);return`${t.slice(0,r-1).join(", ")}, and ${o} more ${e} ${i}`}return`${t.join(", ")} ${e} ${i}`}function Re(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 n=JSON.stringify(t)??typeof t;return n.length>e?`${n.slice(0,e)}... (+${n.length-e} characters)`:n}function Ac(t){let e=1;for(let n=0;n<t.length;n++)t.codePointAt(n)===10&&e++;return e}function co(t,e){if(t===e)return 0;const[n,r]=t.length<e.length?[t,e]:[e,t],i=n.length,o=r.length;let s=new Array(i+1).fill(0).map((c,l)=>l),a=new Array(i+1);for(let c=1;c<=o;c++){a[0]=c;for(let l=1;l<=i;l++){const u=r[c-1]===n[l-1]?0:1;a[l]=Math.min(s[l]+1,a[l-1]+1,s[l-1]+u)}[s,a]=[a,s]}return s[i]}function Ec(t){return t.replaceAll(Tc,(e,n)=>(n>0?"-":"")+e.toLowerCase())}var Tc=/[A-Z]+(?![a-z])|[A-Z]/g;function Sc(t,e=""){return t==null?e:N(t)?t.map(n=>ae(n.text)).join(""):bt(t)?t:String(t)}var at=Symbol("description"),lo=Symbol("required"),hn=Symbol("marked"),dn=Symbol("undocumented"),gn=Symbol("union"),Fc=[["placement","position"],["padding","spacing","gap"],["color","fill","stroke"],["whisker","wick"],["nodeClick","seriesNodeClick"],["nodeDoubleClick","seriesNodeDoubleClick"],["src","url"]].reduce((t,e)=>{for(const n of e)t.set(n.toLowerCase(),new Set(e.filter(r=>r!==n)));return t},new Map),uo=(t=>(t.Invalid="invalid",t.Required="required",t.Unknown="unknown",t))(uo||{});function Ie(t,e){return ft(e)?`${t}[${e}]`:t?`${t}.${e}`:e}var Rt=class{constructor(t,e,n,r,i){this.type=t,this.description=e,this.value=n,this.path=r,this.key=i}setUnionType(t,e){if(this.path.startsWith(e)){const n=this.path.slice(e.length);this.altPath=`${e}[type=${t}]${n}`}}getPrefix(){const{altPath:t=this.path,key:e}=this;return!t&&!e?"Value":`Option \`${e?Ie(t,e):t}\``}toString(){const{description:t="unknown",type:e,value:n}=this;return e==="required"&&n==null?`${this.getPrefix()} is required and has not been provided; expecting ${t}, ignoring.`:`${this.getPrefix()} cannot be set to \`${Re(n,50)}\`; expecting ${t}, ignoring.`}},pr=class extends Rt{constructor(t,e,n,r){super("unknown",void 0,e,n,r),this.suggestions=t,this.key=r}getPrefix(){return`Unknown option \`${Ie(this.altPath??this.path,this.key)}\``}getPostfix(){const t=ce(Dc(this.key,this.suggestions),"or",e=>`\`${e}\``);return t?`; Did you mean ${t}? Ignoring.`:", ignoring."}toString(){return`${this.getPrefix()}${this.getPostfix()}`}};function It(t,e,n=""){if(!Z(t))return{cleared:null,invalid:[new Rt("required","an object",t,n)]};const r={},i=[],o=new Set(Object.keys(t)),s=[];if(gn in e){const a=Object.keys(e),c=e[gn];if(t.type!=null&&a.includes(t.type)||t.type==null&&c!=null){const{type:l=c,...u}=t,f=It(u,e[l],n);Object.assign(r,{type:l},f.cleared);for(const h of f.invalid)h.setUnionType(l,n);i.push(...f.invalid)}else{const l=ce(a,"or",u=>`'${u}'`);i.push(new Rt("required",`a keyword such as ${l}`,t.type,n,"type"))}return{cleared:r,invalid:i}}for(const a of Object.keys(e)){const c=e[a],l=c[lo],u=t[a];if(o.delete(a),u===void 0&&(c[dn]||s.push(a),!l))continue;const f=Ie(n,a);if(mt(c)){const d=c(u,{options:t,path:f});if(typeof d=="object"){if(i.push(...d.invalid),d.valid){r[a]=d.cleared;continue}else if(bn(d.invalid,f))continue}else if(d){r[a]=u;continue}i.push(new Rt(l?"required":"invalid",c[at],u,n,a))}else{const h=It(u,c,f);h.cleared!=null&&(r[a]=h.cleared),i.push(...h.invalid)}}for(const a of o){const c=t[a];c!==void 0&&i.push(new pr(s,c,n,a))}return{cleared:r,invalid:i}}function Dc(t,e,n=2){const r=t.toLowerCase(),i=Fc.get(r);return e.filter(o=>{const s=o.toLowerCase();return i?.has(o)===!0||s.includes(r)||co(r,s)<=n})}function S(t,e){if(mt(t)){let r=function(i,o){return t(i,o)};var n=r;return r[at]=e,r}else return{...t,[at]:e}}function A(t){return Object.assign(mt(t)?(e,n)=>t(e,n):q(t),{[lo]:!0,[at]:t[at]})}function D(t){return Object.assign(mt(t)?(e,n)=>t(e,n):q(t),{[dn]:!0,[at]:t[at]})}var q=(t,e="an object",n=!1)=>S((r,i)=>{const o=It(r,t,i.path),s=!bn(o.invalid,i.path);return{valid:s,cleared:s||!n?o.cleared:null,invalid:o.invalid}},e),mr=(t,e,n)=>({...t,[at]:e,[gn]:n}),ht=(...t)=>S((e,n)=>{const r=[];for(const i of t){const o=i(e,n);if(typeof o=="object"){if(r.push(...o.invalid),!o.valid)return{valid:!1,cleared:e,invalid:r};e=o.cleared}else if(!o)return!1}return{valid:!0,cleared:e,invalid:r}},ce(t.filter(e=>!e[dn]).map(e=>e[at]).filter(an),"and")),j=(...t)=>S((e,n)=>{for(const r of t){const i=r(e,n);if(typeof i=="object"?i.valid:i)return i}return!1},ce(t.filter(e=>!e[dn]).map(e=>e[at]).filter(an),"or")),le=t=>ft(t)||cn(t),kc=t=>oe(t)||(ft(t)||bt(t))&&cn(new Date(t)),br=S(N,"an array"),x=S(Hi,"a boolean"),$=S(mt,"a function"),L=S(Vi,"a color string"),_e=S(kc,"a date"),ct=S(an,"a defined value"),m=S(ft,"a number"),fo=S(Z,"an object"),E=S(bt,"a string"),ho=S(t=>typeof HTMLElement>"u"||t instanceof HTMLElement,"an html element"),Pe=(t,e=1/0)=>{let n;return e===1/0?n=`an array of at least ${t} items`:t===e?n=`an array of exactly ${t} items`:t===0?n=`an array of no more than ${e} items`:n=`an array of at least ${t} and no more than ${e} items`,S(r=>N(r)&&r.length>=t&&r.length<=e,n)},vr=(t,e=1/0)=>{let n;return e===1/0?n=`a string of at least ${t} characters`:t===e?n=`an string of exactly ${t} characters`:t===0?n=`an string of no more than ${e} characters`:n=`an string of at least ${t} and no more than ${e} characters`,S(r=>bt(r)&&r.length>=t&&r.length<=e,n)},xr=(t,e=!0)=>S(n=>ft(n)&&(n>t||e&&n===t),`a number greater than ${e?"or equal to ":""}${t}`),go=(t,e)=>S(n=>ft(n)&&n>=t&&n<=e,`a number between ${t} and ${e} inclusive`),y=xr(0),Cc=xr(0,!1),C=go(0,1),yn=t=>S((e,{options:n})=>!le(e)||!le(n[t])||e<n[t],`the value to be less than \`${t}\``),Nc=t=>S((e,{options:n})=>!le(e)||!le(n[t])||e<=n[t],`the value to be less than or equal to \`${t}\``),pn=t=>S((e,{options:n})=>!le(e)||!le(n[t])||e>n[t],`the value to be greater than \`${t}\``);function M(...t){Z(t[0])&&(t=Object.values(t[0]));const e=ce(t,"or",n=>`'${n}'`);return S(n=>t.includes(n),`a keyword such as ${e}`)}function Lc(){return M}var _t=t=>S(e=>t===e,`the value ${JSON.stringify(t)}`),Rc=(t,e)=>S(n=>n instanceof t,e??`an instance of ${t.name}`),J=(t,e,n=!0)=>S((r,i)=>{if(!N(r))return!1;let o=n;const s=[],a=[],c=l=>{o=n?o&&l:o||l};if(r.length===0)return{valid:!0,cleared:s,invalid:a};for(let l=0;l<r.length;l++){const u=r[l],f=t(u,{options:u,path:`${i.path}[${l}]`});typeof f=="object"?(c(f.valid),a.push(...f.invalid),f.cleared!=null&&s.push(f.cleared)):(c(f),f&&s.push(u))}return{valid:o,cleared:o||!n?s:null,invalid:a}},e??`${t[at]} array`),At=(t,e="an object array")=>S((n,r)=>{if(!N(n))return!1;const i=[],o=[];for(let s=0;s<n.length;s++){const a=`${r.path}[${s}]`,c=It(n[s],t,a);bn(c.invalid,a)||i.push(c.cleared),o.push(...c.invalid)}return{valid:!0,cleared:i,invalid:o}},e),Pt=(t,e)=>S((n,r)=>{if(!mt(n))return!1;if(hn in n)return!0;const i=e??t[at];return{valid:!0,cleared:Object.assign((...s)=>{const a=gr(n,s);if(a==null)return;const c=t(a,{options:a,path:""});if(typeof c=="object"){if(yo(c,r,i,a),c.valid)return c.cleared}else{if(c)return a;ne(`Callback \`${r.path}\` returned an invalid value \`${Re(a,50)}\`; expecting ${i}, ignoring.`)}},{[hn]:!0}),invalid:[]}},"a function"),mn=(t,e="an object")=>S((n,r)=>{if(!mt(n))return!1;if(hn in n)return!0;const i=e;return{valid:!0,cleared:Object.assign((...s)=>{const a=gr(n,s,r.path);if(a==null)return;const c=It(a,t);return yo(c,r,i,a),c.cleared},{[hn]:!0}),invalid:[]}},"a function");function bn(t,e){return t.some(n=>n.type==="required"&&n.path===e)}function yo(t,e,n,r){if(t.invalid.length!==0){if(N(r)){const i=n??t.invalid[0]?.description??"a valid value";return ne(`Callback \`${e.path}\` returned an invalid value \`${Re(r,50)}\`; expecting ${i}, ignoring.`)}for(const i of t.invalid){if(i instanceof pr)return ne(`Callback \`${e.path}\` returned an unknown property \`${Ie(i.path,i.key)}\`${i.getPostfix()}`);const o=Re(i.value,50);ne(i.key?`Callback \`${e.path}\` returned an invalid property \`${Ie(i.path,i.key)}\`: \`${o}\`; expecting ${i.description}, ignoring.`:`Callback \`${e.path}\` returned an invalid value \`${o}\`; expecting ${n??i.description}, ignoring.`)}}}var po=t=>{if(!Z(t))return!1;const e=Object.keys(t);return e.length===1&&e[0].startsWith("$")},Ic=q({color:L,stop:C},""),wr=S(t=>{let e=-1/0;for(const n of t)if(n?.stop!=null){if(n.stop<e)return!1;e=n.stop}return!0},"color stops to be defined in ascending order"),vn=ht(Pe(2),J(Ic),wr),Mr=M("axis","item","series"),_c=q({type:A(_t("gradient")),colorStops:A(vn),rotation:m,gradient:D(M("linear","radial","conic")),bounds:D(Mr),reverse:D(x),colorSpace:D(M("rgb","oklch"))},"a gradient object with color stops"),R={stroke:L,strokeWidth:y,strokeOpacity:C},mo=q({type:A(_t("gradient")),gradient:A(M("linear","radial","conic")),bounds:A(Mr),colorStops:A(j(vn,ht(Pe(2),J(L)))),rotation:A(m),reverse:A(x),colorSpace:A(M("rgb","oklch"))}),bo=q({type:A(_t("pattern")),pattern:A(M("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses")),path:vr(2),width:A(y),height:A(y),fill:A(L),fillOpacity:A(C),backgroundFill:A(L),backgroundFillOpacity:A(C),padding:A(y),rotation:A(m),scale:A(y),stroke:A(L),strokeWidth:A(y),strokeOpacity:A(C)}),vo=q({type:A(_t("image")),url:E,width:y,height:y,rotation:A(m),backgroundFill:A(L),backgroundFillOpacity:C,fit:A(M("stretch","contain","cover")),repeat:A(M("repeat","repeat-x","repeat-y","no-repeat"))}),Pc=mr({gradient:{colorStops:vn,rotation:m,gradient:D(M("linear","radial","conic")),bounds:D(Mr),reverse:D(x),colorSpace:D(M("rgb","oklch"))},pattern:{pattern:M("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses"),path:vr(2),width:y,height:y,rotation:m,scale:y,fill:L,fillOpacity:C,backgroundFill:L,backgroundFillOpacity:C,...R,padding:D(y)},image:{url:A(E),backgroundFill:L,backgroundFillOpacity:C,width:y,height:y,fit:M("stretch","contain","cover","none"),repeat:M("repeat","repeat-x","repeat-y","no-repeat"),rotation:m}},"a color object"),xn=j(L,q(Pc,"a color object")),B={fill:xn,fillOpacity:C};B.fillGradientDefaults=D(mo),B.fillPatternDefaults=D(bo),B.fillImageDefaults=D(vo);var G={lineDash:J(y),lineDashOffset:m},$c={...B,...R,...G,opacity:C,cornerRadius:y},Bc={...R,...G,opacity:C},xo={...B,...R,...G,opacity:C};function wo(t){return{enabled:x,range:M("tooltip","node"),highlightedItem:t,unhighlightedItem:t}}function jc(t,e){return{enabled:x,range:M("tooltip","node"),highlightedItem:t,unhighlightedItem:t,highlightedSeries:e,unhighlightedSeries:e,bringToFront:x}}var Mo={start:ct,stop:ct,...R,...B,...G},Oo={start:ct,stop:ct,...R,...G},Gc=q({enabled:x,key:A(M("x","y")),segments:At(Mo,"path segments array")},"a segmentation object",!0),Hc=q({enabled:x,key:A(M("x","y")),segments:At(Oo,"path segments array")},"a segmentation object",!0),Or=q({googleFont:E},"google font"),Ao=j(E,po,Or,J(j(E,Or))),yt={color:L,fontFamily:Ao,fontSize:y,fontStyle:M("normal","italic","oblique"),fontWeight:j(y,M("normal","bold","bolder","lighter"))},Eo=q({top:m,right:m,bottom:m,left:m},"padding object"),$e=j(m,Eo),Be={enabled:x,stroke:L,strokeWidth:y,strokeOpacity:C},Ar={border:{...Be},cornerRadius:m,padding:$e,...B},Uc=void 0,Wc=void 0;Wc=Uc;var Vc=void 0,zc=void 0;zc=Vc;var qc=void 0,Kc=void 0;Kc=qc;var Yc=void 0,Xc=void 0;Xc=Yc;var Er=["top","top-right","top-left","bottom","bottom-right","bottom-left","right","right-top","right-bottom","left","left-top","left-bottom"],Jc={floating:x,placement:M(...Er),xOffset:m,yOffset:m},Tr=S((t,e)=>{let n;if(typeof t=="string")Er.includes(t)?n=!0:(n={valid:!1,invalid:[],cleared:null},n.invalid.push(new Rt("invalid",`a legend placement string: ["${Er.join('", "')}"]`,t,e.path)));else{const{cleared:r,invalid:i}=It(t,Jc);n={valid:i.length===0,cleared:r,invalid:i}}return n},"a legend position object or placement string"),ue=j(M("circle","cross","diamond","heart","plus","pin","square","star","triangle"),$),To=M("never","always","hyphenate","on-space"),wn=M("top","right","bottom","left","top-right","bottom-right","bottom-left","top-left","center"),Mn=j(y,M("exact","nearest")),fe=j(E,m,_e,At({text:A(E),...yt},"text segments array")),On={enabled:x,text:fe,textAlign:M("left","center","right"),wrapping:M("never","always","hyphenate","on-space"),spacing:y,maxWidth:y,maxHeight:y,...yt};On.padding=D(y);var An={enabled:x,text:fe,renderer:Pt(j(E,ho))},Sr=["defaults","download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series","separator"],So={type:M("action","separator"),showOn:M("always","series-area","series-node","legend-item"),label:A(E),enabled:x,action:$,items:(t,e)=>Fo(t,e)};So.iconUrl=D(E);var Qc=q(So),Zc=S((t,e)=>{let n;return typeof t=="string"?Sr.includes(t)?n=!0:(n={valid:!1,invalid:[],cleared:null},n.invalid.push(new Rt("invalid",`a context menu item string alias: ["${Sr.join('", "')}"]`,t,e.path))):n=Qc(t,e),n},`a context menu item object or string alias: [${Sr.join(", ")}]`),Fo=J(Zc,"a menu items array",!1),Do={label:E,ariaLabel:E,tooltip:E,icon:M("align-center","align-left","align-right","arrow-drawing","arrow-down-drawing","arrow-up-drawing","callout-annotation","candlestick-series","close","comment-annotation","date-range-drawing","date-price-range-drawing","delete","disjoint-channel-drawing","drag-handle","fill-color","line-style-solid","line-style-dashed","line-style-dotted","high-low-series","hlc-series","hollow-candlestick-series","horizontal-line-drawing","line-color","line-series","line-with-markers-series","locked","measurer-drawing","note-annotation","ohlc-series","pan-end","pan-left","pan-right","pan-start","parallel-channel-drawing","position-bottom","position-center","position-top","price-label-annotation","price-range-drawing","reset","settings","step-line-series","text-annotation","trend-line-drawing","fibonacci-retracement-drawing","fibonacci-retracement-trend-based-drawing","unlocked","vertical-line-drawing","zoom-in","zoom-out")},dt=j(E,Pt(fe)),ko=q({x:dt,y:dt,angle:dt,radius:dt,size:dt,color:dt,label:dt,secondaryLabel:dt,sectorLabel:dt,calloutLabel:dt,legendItem:dt}),je=S(Ki,"a valid number format string"),vt={width:y,height:y,minWidth:y,minHeight:y,suppressFieldDotNotation:x,title:On,subtitle:On,footnote:On,padding:{top:y,right:y,bottom:y,left:y},seriesArea:{border:Be,clip:x,cornerRadius:m,padding:$e},legend:{enabled:x,position:Tr,orientation:M("horizontal","vertical"),maxWidth:y,maxHeight:y,spacing:y,border:Be,cornerRadius:m,padding:$e,fill:xn,fillOpacity:C,preventHidingAll:x,reverseOrder:x,toggleSeries:x,item:{marker:{size:y,shape:ue,padding:y,strokeWidth:y},line:{length:y,strokeWidth:y},label:{maxLength:y,formatter:$,...yt},maxWidth:y,paddingX:y,paddingY:y,showSeriesStroke:x},pagination:{marker:{size:y,shape:ue,padding:y},activeStyle:{...B,...R},inactiveStyle:{...B,...R},highlightStyle:{...B,...R},label:yt},listeners:{legendItemClick:$,legendItemDoubleClick:$}},gradientLegend:{enabled:x,position:Tr,spacing:y,reverseOrder:x,border:Be,cornerRadius:m,padding:$e,fill:xn,fillOpacity:C,gradient:{preferredLength:y,thickness:y},scale:{label:{...yt,minSpacing:y,format:je,formatter:$},padding:y,interval:{step:m,values:br,minSpacing:ht(y,yn("maxSpacing")),maxSpacing:ht(y,pn("minSpacing"))}}},listeners:{seriesNodeClick:$,seriesNodeDoubleClick:$,seriesVisibilityChange:$,click:$,doubleClick:$,annotations:$,zoom:$},loadGoogleFonts:x,highlight:{drawingMode:M("overlay","cutout"),range:M("tooltip","node")},overlays:{loading:An,noData:An,noVisibleSeries:An,unsupportedBrowser:An},tooltip:{enabled:x,showArrow:x,pagination:x,delay:y,range:Mn,wrapping:To,mode:M("single","shared","compact"),position:{anchorTo:M("pointer","node","chart"),placement:j(wn,J(wn)),xOffset:m,yOffset:m}},animation:ct,contextMenu:ct,context:()=>!0,dataSource:{getData:$},keyboard:{enabled:x,tabIndex:m},touch:{dragAction:M("none","drag","hover")},ranges:{enabled:x,buttons:At({...Do,value:j(m,ht(J(j(m,_e)),Pe(2,2)),$)},"range button options array")},locale:{localeText:fo,getLocaleText:Pt(E)},background:{visible:x,fill:L,image:{url:A(E),top:m,right:m,bottom:m,left:m,width:y,height:y,opacity:C}},styleNonce:E,sync:ct,zoom:ct,formatter:j(Pt(fe),ko)};vt.flashOnUpdate=D(ct),vt.dataSource.requestThrottle=D(y),vt.dataSource.updateThrottle=D(y),vt.dataSource.updateDuringInteraction=D(x),vt.statusBar=D(ct),vt.foreground=D({visible:x,text:E,image:{url:E,top:m,right:m,bottom:m,left:m,width:y,height:y,opacity:C},...B}),vt.overrideDevicePixelRatio=D(m),vt.sync.domainMode=D(M("direction","position","key"));var En={cursor:E,context:()=>!0,showInLegend:x,nodeClickRange:Mn,listeners:{seriesNodeClick:$,seriesNodeDoubleClick:$},highlight:wo(xo)},Tn={...En,id:E,visible:x,context:()=>!0,data:br};Tn.seriesGrouping=D(ct);var Co={shape:ue,size:y,...B,...R,...G},tl={enabled:x,itemStyler:mn({...B,...R,...G,shape:ue,size:y}),...Co},Ge={enabled:x,formatter:Pt(fe),format:je,itemStyler:mn({enabled:x,...Ar,...yt}),...Ar,...yt},Sn={...Ge,lineHeight:y,minimumFontSize:y,wrapping:To,overflowStrategy:M("ellipsis","hide")},No={visible:x,cap:{visible:x,length:y,lengthRatio:C,...R,...G},...R,...G},el={...No,xLowerKey:E,xUpperKey:E,yLowerKey:E,yUpperKey:E,xLowerName:E,xUpperName:E,yLowerName:E,yUpperName:E,itemStyler:mn({visible:x,...R,...G,cap:{visible:x,length:y,lengthRatio:C,...R,...G}})},Fr={enabled:x,showArrow:x,range:Mn,renderer:Pt(j(E,m,_e,q({heading:E,title:E,symbol:{marker:{enabled:x,shape:ue,...B,stroke:L,strokeOpacity:C,strokeWidth:y,...G},line:{enabled:x,stroke:L,strokeWidth:y,strokeOpacity:C,...G}},data:At({label:A(E),value:A(j(E,m,_e))})},"tooltip renderer result object"))),position:{anchorTo:M("node","pointer","chart"),placement:j(wn,J(wn)),xOffset:m,yOffset:m},interaction:{enabled:x}},nl={enabled:x,xOffset:m,yOffset:m,blur:y,color:L},rl=mr({linear:{},smooth:{tension:C},step:{position:M("start","middle","end")}},"interpolation line options"),Fn=Symbol("BREAK"),He="__decorator_config",Dn="__decorator_accessors";function K(t,e){Dr(t,e).optional=!0}function Dr(t,e){if(Object.getOwnPropertyDescriptor(t,He)==null&&Object.defineProperty(t,He,{value:{}}),Object.getOwnPropertyDescriptor(t,Dn)==null){const u=Object.getPrototypeOf(t)?.[Dn]?.slice()??[];Object.defineProperty(t,Dn,{value:u})}const n=t[He],r=e.toString();if(n[r]!=null)return n[r];n[r]={setters:[],getters:[],observers:[]};const i=Object.getOwnPropertyDescriptor(t,e);let o=i?.get,s=i?.set;if(o==null||s==null){const l=t[Dn];let u=l.indexOf(e);u===-1&&(u=l.push(e)-1),o??(o=function(){let f=this.__accessors;return f==null&&(f=l.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:f})),f[u]}),s??(s=function(f){let h=this.__accessors;h==null&&(h=l.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:h})),h[u]=f})}return Object.defineProperty(t,e,{set:function(l){const{setters:u,observers:f}=n[r];let h;u.some(d=>d.length>2)&&(h=o.call(this));for(const d of u)if(l=d(this,e,l,h),l===Fn)return;s.call(this,l);for(const d of f)d(this,l,h)},get:function(){let l=o.call(this);for(const u of n[r].getters)if(l=u(this,e,l),l===Fn)return;return l},enumerable:!0,configurable:!1}),n[r]}function Et(t,e,n){return(r,i)=>{const o=Dr(r,i);o.setters.push(t),e&&o.getters.unshift(e),n&&Object.assign(o,n)}}function kr(t){return(e,n)=>{Dr(e,n).observers.push(t)}}function kn(t){return t!==void 0&&He in t}function Tt(t){const e=new Set;for(;kn(t);)e.add(t?.[He]),t=Object.getPrototypeOf(t);return Array.from(e).flatMap(n=>Object.keys(n))}function Lo(t){return Tt(t).reduce((e,n)=>(e[String(n)]=t[n]??null,e),{})}function*il(...t){for(const e of t)e!=null&&(e[Symbol.iterator]?yield*e:yield e)}function ol(t){return t!=null&&typeof t=="object"&&Symbol.iterator in t?t:[t]}function sl(t){for(const e of t)return e;throw new Error("AG Charts - no first() value found")}function*Ue(t){const e=[void 0,void 0];for(const n of Object.keys(t))e[0]=n,e[1]=t[n],yield e}function al(t){return Object.keys(t)}function Cr(t,e){return Array.isArray(t)?!Array.isArray(e)||t.length!==e.length?!1:t.every((n,r)=>Cr(n,e[r])):V(t)?V(e)?Ro(t,e,Cr):!1:t===e}function Ro(t,e,n){if(Object.is(t,e))return!0;for(const r of Object.keys(e))if(!(r in t))return!1;for(const r of Object.keys(t))if(!(r in e)||!n(t[r],e[r]))return!1;return!0}function Nr(...t){const e={};for(const n of t){if(!Z(n))continue;const r=kn(n)?Tt(n):Object.keys(n);for(const i of r)V(e[i])&&V(n[i])?e[i]=Nr(e[i],n[i]):e[i]??(e[i]=n[i])}return e}function Lr(...t){const e={};for(const n of t){if(!Z(n))continue;const r=kn(n)?Tt(n):Object.keys(n);for(const i of r)V(e[i])&&V(n[i])?e[i]=Lr(e[i],n[i]):i in e||(e[i]??(e[i]=n[i]))}return e}function cl(t,...e){return e&&N(t)?t.map(n=>Nr(n,...e)):t}function ll(t,e){const n={};for(const[r,i]of Ue(t))n[r]=e(i,r,t);return n}function We(t,e){const n={...t};for(const r of e)delete n[r];return n}function ul(t,e){if(t==null)return;const n={};for(const r of e)Object.hasOwn(t,r)&&(n[r]=t[r]);return n}function fl(t,e){if(t==null)return!0;for(const[n,r]of Ue(t))if(!e(n,r))return!1;return!0}function hl(t){const e={};if(t==null)return e;for(const[n,r]of t)e[n]=r;return e}function Rr(t,e){return(N(e)?e:e.split(".")).reduce((r,i)=>r[i],t)}var Ir=new Set(["__proto__","constructor","prototype"]);function _r(t,e,n){const r=N(e)?e.slice():e.split("."),i=r.pop();if(r.some(s=>Ir.has(s)))return;const o=r.reduce((s,a)=>s[a],t);return o[i]=n,o[i]}function dl(t,e,n){if(n===void 0)return e;for(const r of t){const i=n[r];i!==void 0&&(e[r]=i)}return e}function gl(t,e,n){const r=n??Object.keys(e);for(let i=0,o=r.length;i<o;i++){const s=r[i],a=e[s];t[s]!==a&&(t[s]=a)}return t}function Io(t){if(t==null||typeof t!="object"||!V(t))return t;Object.freeze(t);for(const e of Object.getOwnPropertyNames(t)){const n=t[e];n!==null&&(typeof n=="object"||typeof n=="function")&&!Object.isFrozen(n)&&Io(n)}return t}function _o(t,e){return V(t)&&e in t}function yl(t,e){return _o(t,e)&&typeof t[e]=="string"}var Cn={fills:ht(Pe(2),J(q({color:L,stop:m},"")),wr),fillMode:M("continuous","discrete")},Pr={value:A(m),text:E,shape:j(M("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),$),placement:M("before","after","middle"),spacing:y,size:y,rotation:m,...B,...R,...G},$r={value:A(m),text:E,shape:j(M("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),$),placement:M("inside","outside","middle"),spacing:y,size:y,rotation:m,label:{...Ge,spacing:y},...B,...R,...G},Po={...We(En,["listeners"]),direction:M("horizontal","vertical"),cornerMode:M("container","item"),cornerRadius:y,thickness:y,segmentation:{enabled:x,spacing:y,interval:{values:J(m),step:m,count:m}},bar:{enabled:x,thickness:y,thicknessRatio:C,...Cn,...B,...R,...G},label:{...Sn,text:E,spacing:y,avoidCollisions:x,placement:M("inside-start","outside-start","inside-end","outside-end","inside-center","bar-inside","bar-inside-end","bar-outside-end","bar-end")},tooltip:Fr},$t={...We(Tn,["listeners"]),...Po,type:A(_t("linear-gauge")),value:A(m),scale:{min:ht(m,yn("max")),max:ht(m,pn("min")),label:{enabled:x,formatter:$,rotation:m,spacing:y,minSpacing:y,placement:M("before","after"),avoidCollisions:x,format:je,...yt},interval:{values:J(m),step:m},...Cn,...B,...R,...G},targets:At(Pr,"target options array")};$t.margin=D(m),$t.defaultColorRange=D(J(L)),$t.defaultTarget=D({...Pr,value:m,label:{...Ge,spacing:m}}),$t.defaultScale=D($t.scale),$t.scale.defaultFill=D(L);var $o={...We(En,["listeners"]),outerRadius:y,innerRadius:y,outerRadiusRatio:C,innerRadiusRatio:C,startAngle:m,endAngle:m,spacing:y,cornerMode:M("container","item"),cornerRadius:y,scale:{min:ht(m,yn("max")),max:ht(m,pn("min")),label:{enabled:x,formatter:$,rotation:m,spacing:y,minSpacing:y,avoidCollisions:x,format:je,...yt},interval:{values:J(m),step:m},...Cn,...B,...R,...G},segmentation:{enabled:x,spacing:y,interval:{values:J(m),step:m,count:m}},bar:{enabled:x,...Cn,...B,...R,...G},needle:{enabled:x,spacing:y,radiusRatio:C,...B,...R,...G},label:{text:E,spacing:y,...Sn},secondaryLabel:{text:E,...Sn},tooltip:Fr},Nn={...We(Tn,["listeners"]),...$o,type:A(_t("radial-gauge")),value:A(m),targets:At($r,"target options array")};Nn.defaultColorRange=D(J(L)),Nn.defaultTarget=D({...$r,value:m,label:{...Ge,spacing:m}}),Nn.scale.defaultFill=D(L);var pl=class Ei{constructor(e){this.version=e.split("-")[0]}save(...e){const n={version:this.version};for(const r of Object.values(e))n[r.mementoOriginatorKey]=this.encode(r,r.createMemento());return n}restore(e,...n){if(typeof e!="object"){W.warnOnce(`Could not restore data of type [${typeof e}], expecting an object, ignoring.`);return}if(e==null){W.warnOnce("Could not restore data of type [null], expecting an object, ignoring.");return}if(!("version"in e)||typeof e.version!="string"){W.warnOnce("Could not restore data, missing [version] string in object, ignoring.");return}for(const r of n){const i=this.decode(r,e[r.mementoOriginatorKey]),o=[];if(!r.guardMemento(i,o)){const s=o.length>0?`
${o.join(`
`)}
`:"";W.warnOnce(`Could not restore [${r.mementoOriginatorKey}] data, value was invalid, ignoring.${s}`,i);return}r.restoreMemento(this.version,e.version,i)}}encode(e,n){try{return JSON.parse(JSON.stringify(n,Ei.encodeTypes))}catch(r){throw new Error(`Failed to encode [${e.mementoOriginatorKey}] value [${r}].`,{cause:r})}}decode(e,n){if(n==null)return n;try{return JSON.parse(JSON.stringify(n),Ei.decodeTypes)}catch(r){throw new Error(`Failed to decode [${e.mementoOriginatorKey}] value [${r}].`,{cause:r})}}static encodeTypes(e,n){return oe(this[e])?{__type:"date",value:this[e].toISOString()}:n}static decodeTypes(e,n){return Z(this[e])&&"__type"in this[e]&&this[e].__type==="date"?new Date(this[e].value):n}},Bo=(t=>(t.X="x",t.Y="y",t.Angle="angle",t.Radius="radius",t))(Bo||{}),jo=(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.PERFORM_LAYOUT=4]="PERFORM_LAYOUT",t[t.SERIES_UPDATE=5]="SERIES_UPDATE",t[t.PRE_SCENE_RENDER=6]="PRE_SCENE_RENDER",t[t.SCENE_RENDER=7]="SCENE_RENDER",t[t.NONE=8]="NONE",t))(jo||{});function ml(t){const{placement:e="bottom",floating:n=!1,xOffset:r=0,yOffset:i=0}=typeof t=="string"?{placement:t,floating:!1}:t;return{placement:e,floating:n,xOffset:r,yOffset:i}}function bl(t,e){const[n,r]=Ln(e);return et(n,t,r)}function Ln(t){if(t.length===0)return[];const e=[1/0,-1/0];for(const n of t)n<e[0]&&(e[0]=n),n>e[1]&&(e[1]=n);return e}function vl(t){const[e,n]=Ln(t);return n-e}function Br(t){return t=Math.trunc(t),t<=0?1:t===1?2:1<<32-Math.clz32(t-1)}function xl(t){return t=Math.trunc(t),t<=0?0:t===1?1:1<<31-Math.clz32(t)}var xt=0,St=1,Bt=2,jt=3,Gt=4,jr=1e3,wl=10,Rn=64,In=4294967295,Ml=3,Ol=20,Gr=100;function Hr(t,e,n,r,i,o,s,a){let c=0;for(;c<Gr&&t[r]==null&&r<i;)r+=1,c+=1;for(;c<Gr&&t[i]==null&&i>r;)i-=1,c+=1;if(c>=Gr||r>=i)return o;const l=Number.isFinite(e)?Pn(t[i],e,n,a)-Pn(t[r],e,n,a):_n(i,t.length)-_n(r,t.length);if(l===0||!Number.isFinite(l))return o;const u=Math.abs(l)/(i-r);let f;if(s<Ml?f=!0:s>Ol?f=!1:f=u<=o,o=Math.min(o,u),!f)return o;const h=Math.floor((r+i)/2),d=Hr(t,e,n,r,h,o,s+1,a),g=Hr(t,e,n,h+1,i,o,s+1,a);return Math.min(d,g,o)}function Al(t,e,n,r){return Hr(t,e,n,0,t.length-1,1/(t.length-1),0,r)}function Ur(t,e,n,r){if(Number.isFinite(e)){const i=r?.smallestKeyInterval,o=r?.xNeedsValueOf??!0,s=i==null?Al(t,e,n,o):i/(n-e);return Br(Math.trunc(1/s))>>3}else{let i=Math.ceil(Math.log2(t.length))-1;return i=Math.min(Math.max(i,0),24),Math.trunc(2**i)}}function El(t,e){const{domain:n,sortMetadata:r}=e;switch(t){case"category":return[Number.NaN,Number.NaN];case"number":case"time":case"ordinal-time":case"unit-time":{if(n.length===0)return[1/0,-1/0];if(r?.sortOrder===1)return[Number(n[0]),Number(n.at(-1))];if(r?.sortOrder===-1)return[Number(n.at(-1)),Number(n[0])];let i=1/0,o=-1/0;for(const s of n){const a=Number(s);i=Math.min(i,a),o=Math.max(o,a)}return[i,o]}case"color":case"log":case"mercator":return[0,0]}}function _n(t,e){return t/e}function Pn(t,e,n,r){return r?(t.valueOf()-e)/(n-e):(t-e)/(n-e)}function Go(t,e){return Math.trunc(Math.min(Math.floor(t*e),e-1)*Gt)}function Tl(t,e,n,r,i,{xNeedsValueOf:o=!0,xValuesLength:s}={}){const a=t[i];if(a==null)return-1;const c=s??t.length,l=Number.isFinite(e)?Pn(a,e,n,o):_n(i,c);return Go(l,r)}function Sl(t,e,n,r){for(const i of r)if(n===t[e+i])return!0;return!1}function Wr(t,e,n,r,i,o,{positive:s,split:a=!1,xNeedsValueOf:c=!0,yNeedsValueOf:l=!0,reuseIndexData:u,reuseValueData:f,reuseNegativeIndexData:h,reuseNegativeValueData:d}={}){const g=Number.NaN,p=o*Gt,b=u?.length===p?u:new Uint32Array(p),v=f?.length===p?f:new Float64Array(p);let w,O;a&&(h&&h.length===p?w=h:w=new Uint32Array(p),d&&d.length===p?O=d:O=new Float64Array(p));const k=Number.isFinite(r)&&Number.isFinite(i),Y=t.length;k&&(v.fill(g),b.fill(In),a&&(O.fill(g),w.fill(In)));const _=k?o/(i-r):o*(1/Y);let T=-1,H=-1,wt=g,Ct=-1,Mt=g,Nt=-1,it=g,we=-1,Kt=g,U=-1,Yt=-1,Xt=g,Me=-1,Jt=g,Oe=-1,Qt=g,Ae=-1,Zt=g;const ua=t.length,fa=e===n;for(let P=0;P<ua;P++){const nr=t[P];if(nr==null)continue;const nn=e[P],rr=fa?nn:n[P];let tt,ot;l?(tt=nn==null?g:nn.valueOf(),ot=rr==null?g:rr.valueOf()):(tt=nn??g,ot=rr??g);let Ti=!0;if(a)Ti=tt>=0;else if(s!=null&&tt>=0!==s)continue;let X;k?c?X=(nr.valueOf()-r)*_:X=(nr-r)*_:X=P*_;const Si=Math.floor(X),rn=(Si<o?Si:o-1)<<2;if(Ti){rn!==T&&(T!==-1&&(b[T]=H,b[T+1]=Ct,b[T+2]=Nt,b[T+3]=we,v[T]=wt,v[T+1]=Mt,v[T+2]=it,v[T+3]=Kt),T=rn,H=-1,wt=g,Ct=-1,Mt=g,Nt=-1,it=g,we=-1,Kt=g);const Ee=ot===ot,Te=tt===tt;H===-1?(H=P,wt=X,Ct=P,Mt=X,Ee&&(Nt=P,it=ot),Te&&(we=P,Kt=tt)):(X<wt&&(H=P,wt=X),X>Mt&&(Ct=P,Mt=X),Ee&&ot<it&&(Nt=P,it=ot),Te&&tt>Kt&&(we=P,Kt=tt))}else{rn!==U&&(U!==-1&&(w[U]=Yt,w[U+1]=Me,w[U+2]=Oe,w[U+3]=Ae,O[U]=Xt,O[U+1]=Jt,O[U+2]=Qt,O[U+3]=Zt),U=rn,Yt=-1,Xt=g,Me=-1,Jt=g,Oe=-1,Qt=g,Ae=-1,Zt=g);const Ee=ot===ot,Te=tt===tt;Yt===-1?(Yt=P,Xt=X,Me=P,Jt=X,Ee&&(Oe=P,Qt=ot),Te&&(Ae=P,Zt=tt)):(X<Xt&&(Yt=P,Xt=X),X>Jt&&(Me=P,Jt=X),Ee&&ot<Qt&&(Oe=P,Qt=ot),Te&&tt>Zt&&(Ae=P,Zt=tt))}}return T!==-1&&(b[T]=H,b[T+1]=Ct,b[T+2]=Nt,b[T+3]=we,v[T]=wt,v[T+1]=Mt,v[T+2]=it,v[T+3]=Kt),a&&U!==-1&&(w[U]=Yt,w[U+1]=Me,w[U+2]=Oe,w[U+3]=Ae,O[U]=Xt,O[U+1]=Jt,O[U+2]=Qt,O[U+3]=Zt),{indexData:b,valueData:v,negativeIndexData:w,negativeValueData:O}}function Vr(t,e,n,{inPlace:r=!1,midpointData:i,reuseIndexData:o,reuseValueData:s}={}){const a=Math.trunc(n/2),c=a*Gt;let l;r?l=t:o&&o.length===c?l=o:l=new Uint32Array(c);let u;r?u=e:s&&s.length===c?u=s:u=new Float64Array(c);const f=i??new Uint32Array(a);for(let h=0;h<a;h+=1){const d=Math.trunc(h*Gt),g=Math.trunc(d*2),p=Math.trunc(g+Gt),b=t[p+xt]===In,v=b||e[g+xt]<e[p+xt]?g:p,w=t[v+xt];l[d+xt]=w,u[d+xt]=e[v+xt];const O=b||e[g+St]>e[p+St]?g:p,k=t[O+St];l[d+St]=k,u[d+St]=e[O+St],f[h]=w+k>>1;const Y=b||e[g+Bt]<e[p+Bt]?g:p;l[d+Bt]=t[Y+Bt],u[d+Bt]=e[Y+Bt];const _=b||e[g+jt]>e[p+jt]?g:p;l[d+jt]=t[_+jt],u[d+jt]=e[_+jt]}return{maxRange:a,indexData:l,valueData:u,midpointData:f}}function $n(t,e,n,r=xt,i=St,o=-1){const s=n&&n.length===t?n:new Uint32Array(t);for(let a=0,c=0;a<t;a+=1,c+=Gt){const l=e[c+r],u=e[c+i];s[a]=l===o?o:l+u>>1}return s}function Fl(t,{collectLevel:e,shouldContinue:n,minRange:r=Rn,compactInPlace:i=!1}){let o=t,s=e(o);const a=[s];for(;o.maxRange>r&&n(s,o);){const c=Vr(o.indexData,o.valueData,o.maxRange,{inPlace:i});o={maxRange:c.maxRange,indexData:c.indexData,valueData:c.valueData,midpointData:c.midpointData},s=e(o),a.push(s)}return a.reverse(),a}function Ho(t,e,n,r,i){if(e.length<jr)return;const[o,s]=t,{smallestKeyInterval:a,xNeedsValueOf:c,yNeedsValueOf:l,existingFilters:u}=i;let f=Ur(e,o,s,{smallestKeyInterval:a,xNeedsValueOf:c});const h=u?.find(v=>v.maxRange===f);let{indexData:d,valueData:g}=Wr(e,n,r,o,s,f,{xNeedsValueOf:c,yNeedsValueOf:l,reuseIndexData:h?.indexData,reuseValueData:h?.valueData}),p=$n(f,d,h?.midpointIndices);const b=[{maxRange:f,indexData:d,valueData:g,midpointIndices:p}];for(;f>Rn;){const v=f,w=Math.trunc(v/2),O=u?.find(Y=>Y.maxRange===w),k=Vr(d,g,v,{reuseIndexData:O?.indexData,reuseValueData:O?.valueData});f=k.maxRange,d=k.indexData,g=k.valueData,p=k.midpointData??$n(f,d,O?.midpointIndices),b.push({maxRange:f,indexData:d,valueData:g,midpointIndices:p})}return b.reverse(),b}function Dl(t,e,n,r,i){if(e.length<jr)return;const[o,s]=t,{smallestKeyInterval:a,targetRange:c,xNeedsValueOf:l,yNeedsValueOf:u,existingFilters:f}=i,h=Ur(e,o,s,{smallestKeyInterval:a,xNeedsValueOf:l}),d=Math.min(h,Br(Math.max(c,Rn))),g=f?.find(k=>k.maxRange===d),{indexData:p,valueData:b}=Wr(e,n,r,o,s,d,{xNeedsValueOf:l,yNeedsValueOf:u,reuseIndexData:g?.indexData,reuseValueData:g?.valueData}),v=$n(d,p,g?.midpointIndices),w={maxRange:d,indexData:p,valueData:b,midpointIndices:v};function O(){return Ho([o,s],e,n,r,{smallestKeyInterval:a,xNeedsValueOf:l,yNeedsValueOf:u,existingFilters:f})?.filter(Y=>Y.maxRange!==d)??[]}return{immediate:[w],computeRemaining:O}}var Ht=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 W.warn(`unable to set ${e} - expecting a properties object`),this;const n=new Set(Object.keys(t));for(const r of Tt(this))if(n.has(r)){const i=t[r],o=this;if(he(o[r]))if(o[r]instanceof zr){const s=o[r].reset(i);s==null?W.warn(`unable to set [${String(r)}] - expecting a properties array`):o[r]=s}else o[r].set(i);else V(i)?o[r]=Lr(i,o[r]??{}):o[r]=i;n.delete(r)}this.handleUnknownProperties(n,t);for(const r of n)W.warn(`unable to set [${String(r)}] in ${e} - property is unknown`);return this}clear(){for(const t of Tt(this)){const e=this[t];he(e)?e.clear():this[t]=void 0}return this}toJson(){return Tt(this).reduce((t,e)=>{const n=this[e];return t[String(e)]=he(n)?n.