diff --git a/index.html b/index.html
index a9971e9..19b1475 100644
--- a/index.html
+++ b/index.html
@@ -1 +1 @@
-
app
\ No newline at end of file
+app
\ No newline at end of file
diff --git a/js/app.7162240ea91aa3efee21.bundle.js b/js/app.7162240ea91aa3efee21.bundle.js
new file mode 100644
index 0000000..fab6f95
--- /dev/null
+++ b/js/app.7162240ea91aa3efee21.bundle.js
@@ -0,0 +1 @@
+(self.webpackChunk=self.webpackChunk||[]).push([[524],{44:(e,t,n)=>{const a=n(377),{lightningChart:s,PalettedFill:r,LUT:i,emptyLine:o,AxisScrollStrategies:c,AxisTickStrategies:l,regularColorSteps:d,Themes:u}=a,h=new(window.AudioContext||window.webkitAudioContext),m=4096,y=2048,p=s({resourcesBaseUrl:new URL(document.head.baseURI).origin+new URL(document.head.baseURI).pathname+"resources/"}),g=(e,t,n)=>{const a=Array.from(e),s=Array.from(Array(t)).map((()=>Array.from(Array(n))));for(let e=0;e{const m=e.getTheme(),y={x:0,y:0},p={x:l,y:Math.ceil(s/2)},g=e.addAxisY({iStack:1-t}).setMargins(t<1?15:0,t>0?15:0),f=e.addHeatmapGridSeries({yAxis:g,columns:a,rows:Math.ceil(n/2),dataOrder:"rows",heatmapDataType:"intensity"}).setStart(y).setEnd(p).setFillStyle(new r({lut:new i({steps:d(0,255,m.examples.spectrogramColorPalette,{formatLabels:e=>{return`${Math.round((t=e,u+t/255*(h-u)))}`;var t}}),units:"dB",interpolate:!0})})).setWireframeStyle(o);return g.setInterval({start:y.y,end:p.y,stopAxisAfter:!1}).setTitle(`Channel ${t+1}`).setUnits("Hz").setScrollStrategy(c.fitting),{series:f,yAxis:g}};(async()=>{document.querySelectorAll(".loading").forEach((e=>{e.parentElement.removeChild(e)}));const e=async()=>{const e=await(async e=>{const t=await fetch(e),n=await t.arrayBuffer();return await h.decodeAudioData(n)})(new URL(document.head.baseURI).origin+new URL(document.head.baseURI).pathname+"examples/assets/0802/Truck_driving_by-Jason_Baker-2112866529_edit.wav");(async e=>{const t=p.ChartXY({theme:u[new URLSearchParams(window.location.search).get("theme")||"darkGold"]||void 0}).setTitle("Spectrogram chart 2 channels").setCursorMode("show-nearest");t.getDefaultAxisX().setTickStrategy(l.Numeric).setScrollStrategy(c.fitting).setTitle("Duration").setUnits("s"),t.getDefaultAxisY().dispose();for(let n=0;n{const t=new OfflineAudioContext(e.numberOfChannels,e.length,e.sampleRate),n=t.createBufferSource();n.buffer=e,n.channelCount=e.numberOfChannels;const a=t.createChannelSplitter(n.channelCount),s=t.createAnalyser();s.fftSize=m,s.smoothingTimeConstant=.1;const r=[],i=[],o=[];for(let s=0;s{for(let e=0;e{h.resume()},t.appendChild(n);const a=document.querySelector(".chart");let s;a||(s=document.createElement("div"),s.classList.add("inner"),document.body.appendChild(s));const r=a||s;r.appendChild(t),h.onstatechange=()=>{"running"===h.state&&(e(),h.onstatechange=void 0,r.removeChild(t))}}else e()})()}},e=>{e.O(0,[502],(()=>e(e.s=44))),e.O()}]);
\ No newline at end of file
diff --git a/js/app.f5254b40ccb1d4d34a60.bundle.js b/js/app.f5254b40ccb1d4d34a60.bundle.js
deleted file mode 100644
index 74c717a..0000000
--- a/js/app.f5254b40ccb1d4d34a60.bundle.js
+++ /dev/null
@@ -1 +0,0 @@
-(self.webpackChunk=self.webpackChunk||[]).push([[524],{44:(e,t,n)=>{const a=n(89),{lightningChart:s,PalettedFill:r,LUT:o,emptyLine:i,AxisScrollStrategies:c,AxisTickStrategies:l,regularColorSteps:d,Themes:u}=a,m=new(window.AudioContext||window.webkitAudioContext),h=4096,y=2048,p=s({resourcesBaseUrl:new URL(document.head.baseURI).origin+new URL(document.head.baseURI).pathname+"resources/"}),g=(e,t,n)=>{const a=Array.from(e),s=Array.from(Array(t)).map((()=>Array.from(Array(n))));for(let e=0;e{const h=e.getTheme(),y=e=>u+e/255*(m-u),p={x:0,y:0},g={x:l,y:Math.ceil(s/2)},f=e.addAxisY({iStack:1-t}).setMargins(t<1?15:0,t>0?15:0),w=e.addHeatmapGridSeries({yAxis:f,columns:a,rows:Math.ceil(n/2),start:p,end:g,dataOrder:"rows",heatmapDataType:"intensity"}).setFillStyle(new r({lut:new o({steps:d(0,255,h.examples.spectrogramColorPalette,{formatLabels:e=>`${Math.round(y(e))}`}),units:"dB",interpolate:!0})})).setWireframeStyle(i).setCursorResultTableFormatter(((e,t,n)=>e.addRow(t.getName()).addRow("X:","",t.axisX.formatValue(n.x)).addRow("Y:","",t.axisY.formatValue(n.y)).addRow("",y(n.intensity).toFixed(1)+" dB")));return f.setInterval({start:p.y,end:g.y,stopAxisAfter:!1}).setTitle(`Channel ${t+1} (Hz)`).setScrollStrategy(c.fitting),{series:w,yAxis:f}};(async()=>{document.querySelectorAll(".loading").forEach((e=>{e.parentElement.removeChild(e)}));const e=async()=>{const e=await(async e=>{const t=await fetch(e),n=await t.arrayBuffer();return await m.decodeAudioData(n)})(new URL(document.head.baseURI).origin+new URL(document.head.baseURI).pathname+"examples/assets/0802/Truck_driving_by-Jason_Baker-2112866529_edit.wav");(async e=>{const t=p.ChartXY({theme:u[new URLSearchParams(window.location.search).get("theme")||"darkGold"]||void 0}).setTitle("Spectrogram chart 2 channels");t.getDefaultAxisX().setTickStrategy(l.Numeric).setScrollStrategy(c.fitting).setTitle("Duration (s)"),t.getDefaultAxisY().dispose();for(let n=0;n{const t=new OfflineAudioContext(e.numberOfChannels,e.length,e.sampleRate),n=t.createBufferSource();n.buffer=e,n.channelCount=e.numberOfChannels;const a=t.createChannelSplitter(n.channelCount),s=t.createAnalyser();s.fftSize=h,s.smoothingTimeConstant=.1;const r=[],o=[],i=[];for(let s=0;s{for(let e=0;e{m.resume()},t.appendChild(n);const a=document.querySelector(".chart");let s;a||(s=document.createElement("div"),s.classList.add("inner"),document.body.appendChild(s));const r=a||s;r.appendChild(t),m.onstatechange=()=>{"running"===m.state&&(e(),m.onstatechange=void 0,r.removeChild(t))}}else e()})()}},e=>{e.O(0,[502],(()=>(44,e(e.s=44)))),e.O()}]);
\ No newline at end of file
diff --git a/js/vendor.480392df39608d990ad3.bundle.js b/js/vendor.480392df39608d990ad3.bundle.js
deleted file mode 100644
index bca0987..0000000
--- a/js/vendor.480392df39608d990ad3.bundle.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! For license information please see vendor.480392df39608d990ad3.bundle.js.LICENSE.txt */
-"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[502],{613:(t,e,i)=>{i.r(e),i.d(e,{EventError:()=>o,Eventer:()=>u,Token:()=>h});var s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},s(t,e)};function r(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],s=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&s>=t.length&&(t=void 0),{value:t&&t[s++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function n(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var s,r,n=i.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(s=n.next()).done;)o.push(s.value)}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return o}var o=function(t){function e(i){var s,r="EventError: "+i+"}";return s=t.call(this,r)||this,Object.setPrototypeOf(s,e.prototype),s}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e}(Error),h=function(t,e){return{token:t+"-"+e,ownerIndex:t,id:e}},a=0,l=function(t,e){return new o("Event listener with "+t.token+" id does not exist at Eventer with "+e+" id.")},u=function(){function t(){this.id=++a,this.lastEventIndex=0,this.topics=new Map}return t.prototype.on=function(t,e,i){var s=this.topics.get(t),r=i||h(this.id,++this.lastEventIndex);return s?s.set(r,e):this.topics.set(t,new Map([[r,e]])),r},t.prototype.has=function(t,e){var i,s;if(e)return(u=this.topics.get(e))?(c=u.get(t))||l(t,this.id):new o("Eventer with "+t.ownerIndex+" does not have "+e+".");try{for(var h=r(this.topics),a=h.next();!a.done;a=h.next()){var u,c,d=n(a.value,2);if(d[0],c=(u=d[1]).get(t))return c}}catch(t){i={error:t}}finally{try{a&&!a.done&&(s=h.return)&&s.call(h)}finally{if(i)throw i.error}}return l(t,this.id)},t.prototype.off=function(t,e){var i,s;if(e)return!(!(a=this.topics.get(e))||!a.delete(t));try{for(var o=r(this.topics),h=o.next();!h.done;h=o.next()){var a,l=n(h.value,2);if(l[0],(a=l[1]).delete(t))return!0}}catch(t){i={error:t}}finally{try{h&&!h.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}return!1},t.prototype.allOff=function(){return this.topics.clear(),this},t.prototype.topicOff=function(t){return this.topics.delete(t)},t.prototype.emit=function(t){for(var e=[],i=1;i{function e(t,e,s){s=s||2;var n,o,h,a,c,d,g,m=e&&e.length,y=m?e[0]*s:t.length,p=i(t,0,y,s,!0),x=[];if(!p||p.next===p.prev)return x;if(m&&(p=function(t,e,s,r){var n,o,h,a=[];for(n=0,o=e.length;n80*s){n=h=t[0],o=a=t[1];for(var S=s;Sh&&(h=c),d>a&&(a=d);g=0!==(g=Math.max(h-n,a-o))?32767/g:0}return r(p,x,s,n,o,g,0),x}function i(t,e,i,s,r){var n,o;if(r===w(t,e,i,s)>0)for(n=e;n=e;n-=s)o=M(n,t[n],t[n+1],o);return o&&p(o,o.next)&&(E(o),o=o.next),o}function s(t,e){if(!t)return t;e||(e=t);var i,s=t;do{if(i=!1,s.steiner||!p(s,s.next)&&0!==y(s.prev,s,s.next))s=s.next;else{if(E(s),(s=e=s.prev)===s.next)break;i=!0}}while(i||s!==e);return e}function r(t,e,i,l,u,c,f){if(t){!f&&c&&function(t,e,i,s){var r=t;do{0===r.z&&(r.z=d(r.x,r.y,e,i,s)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,s,r,n,o,h,a,l=1;do{for(i=t,t=null,n=null,o=0;i;){for(o++,s=i,h=0,e=0;e0||a>0&&s;)0!==h&&(0===a||!s||i.z<=s.z)?(r=i,i=i.nextZ,h--):(r=s,s=s.nextZ,a--),n?n.nextZ=r:t=r,r.prevZ=n,n=r;i=s}n.nextZ=null,l*=2}while(o>1)}(r)}(t,l,u,c);for(var g,m,y=t;t.prev!==t.next;)if(g=t.prev,m=t.next,c?o(t,l,u,c):n(t))e.push(g.i/i|0),e.push(t.i/i|0),e.push(m.i/i|0),E(t),t=m.next,y=m.next;else if((t=m)===y){f?1===f?r(t=h(s(t),e,i),e,i,l,u,c,2):2===f&&a(t,e,i,l,u,c):r(s(t),e,i,l,u,c,1);break}}}function n(t){var e=t.prev,i=t,s=t.next;if(y(e,i,s)>=0)return!1;for(var r=e.x,n=i.x,o=s.x,h=e.y,a=i.y,l=s.y,u=rn?r>o?r:o:n>o?n:o,f=h>a?h>l?h:l:a>l?a:l,m=s.next;m!==e;){if(m.x>=u&&m.x<=d&&m.y>=c&&m.y<=f&&g(r,h,n,a,o,l,m.x,m.y)&&y(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function o(t,e,i,s){var r=t.prev,n=t,o=t.next;if(y(r,n,o)>=0)return!1;for(var h=r.x,a=n.x,l=o.x,u=r.y,c=n.y,f=o.y,m=ha?h>l?h:l:a>l?a:l,S=u>c?u>f?u:f:c>f?c:f,A=d(m,p,e,i,s),v=d(x,S,e,i,s),b=t.prevZ,M=t.nextZ;b&&b.z>=A&&M&&M.z<=v;){if(b.x>=m&&b.x<=x&&b.y>=p&&b.y<=S&&b!==r&&b!==o&&g(h,u,a,c,l,f,b.x,b.y)&&y(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,M.x>=m&&M.x<=x&&M.y>=p&&M.y<=S&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&y(M.prev,M,M.next)>=0)return!1;M=M.nextZ}for(;b&&b.z>=A;){if(b.x>=m&&b.x<=x&&b.y>=p&&b.y<=S&&b!==r&&b!==o&&g(h,u,a,c,l,f,b.x,b.y)&&y(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;M&&M.z<=v;){if(M.x>=m&&M.x<=x&&M.y>=p&&M.y<=S&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&y(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function h(t,e,i){var r=t;do{var n=r.prev,o=r.next.next;!p(n,o)&&x(n,r,r.next,o)&&v(n,o)&&v(o,n)&&(e.push(n.i/i|0),e.push(r.i/i|0),e.push(o.i/i|0),E(r),E(r.next),r=t=o),r=r.next}while(r!==t);return s(r)}function a(t,e,i,n,o,h){var a=t;do{for(var l=a.next.next;l!==a.prev;){if(a.i!==l.i&&m(a,l)){var u=b(a,l);return a=s(a,a.next),u=s(u,u.next),r(a,e,i,n,o,h,0),void r(u,e,i,n,o,h,0)}l=l.next}a=a.next}while(a!==t)}function l(t,e){return t.x-e.x}function u(t,e){var i=function(t,e){var i,s=e,r=t.x,n=t.y,o=-1/0;do{if(n<=s.y&&n>=s.next.y&&s.next.y!==s.y){var h=s.x+(n-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(h<=r&&h>o&&(o=h,i=s.x=s.x&&s.x>=u&&r!==s.x&&g(ni.x||s.x===i.x&&c(i,s)))&&(i=s,f=a)),s=s.next}while(s!==l);return i}(t,e);if(!i)return e;var r=b(i,t);return s(r,r.next),s(i,i.next)}function c(t,e){return y(t.prev,t,e.prev)<0&&y(e.next,t,t.next)<0}function d(t,e,i,s,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{(e.x=(t-o)*(n-h)&&(t-o)*(s-h)>=(i-o)*(e-h)&&(i-o)*(n-h)>=(r-o)*(s-h)}function m(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(v(t,e)&&v(e,t)&&function(t,e){var i=t,s=!1,r=(t.x+e.x)/2,n=(t.y+e.y)/2;do{i.y>n!=i.next.y>n&&i.next.y!==i.y&&r<(i.next.x-i.x)*(n-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}(t,e)&&(y(t.prev,t,e.prev)||y(t,e.prev,e))||p(t,e)&&y(t.prev,t,t.next)>0&&y(e.prev,e,e.next)>0)}function y(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function p(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,s){var r=A(y(t,e,i)),n=A(y(t,e,s)),o=A(y(i,s,t)),h=A(y(i,s,e));return r!==n&&o!==h||!(0!==r||!S(t,i,e))||!(0!==n||!S(t,s,e))||!(0!==o||!S(i,t,s))||!(0!==h||!S(i,e,s))}function S(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function A(t){return t>0?1:t<0?-1:0}function v(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function b(t,e){var i=new T(t.i,t.x,t.y),s=new T(e.i,e.x,e.y),r=t.next,n=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,s.next=i,i.prev=s,n.next=s,s.prev=n,s}function M(t,e,i,s){var r=new T(t,e,i);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function E(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function T(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function w(t,e,i,s){for(var r=0,n=e,o=i-s;n0&&(s+=t[r-1].length,i.holes.push(s))}return i}},568:(t,e,i)=>{i.r(e),i.d(e,{Collection:()=>T,Iterable:()=>ks,List:()=>ai,Map:()=>ze,OrderedMap:()=>bi,OrderedSet:()=>ls,PairSorting:()=>gs,Range:()=>Wi,Record:()=>ms,Repeat:()=>bs,Seq:()=>J,Set:()=>Ni,Stack:()=>Ci,default:()=>Cs,fromJS:()=>Ms,get:()=>ae,getIn:()=>ji,has:()=>he,hasIn:()=>Zi,hash:()=>pt,is:()=>ft,isAssociative:()=>E,isCollection:()=>S,isImmutable:()=>L,isIndexed:()=>M,isKeyed:()=>v,isList:()=>hi,isMap:()=>ut,isOrdered:()=>_,isOrderedMap:()=>ct,isOrderedSet:()=>_i,isPlainObject:()=>re,isRecord:()=>D,isSeq:()=>I,isSet:()=>Vi,isStack:()=>ki,isValueObject:()=>dt,merge:()=>Ee,mergeDeep:()=>we,mergeDeepWith:()=>ke,mergeWith:()=>Te,remove:()=>ue,removeIn:()=>ye,set:()=>ce,setIn:()=>ge,update:()=>xe,updateIn:()=>de,version:()=>ws});var s="delete",r=5,n=1<>>0;if(""+i!==e||4294967295===i)return NaN;e=i}return e<0?u(t)+e:e}function d(){return!0}function f(t,e,i){return(0===t&&!p(t)||void 0!==i&&t<=-i)&&(void 0===e||void 0!==i&&e>=i)}function g(t,e){return y(t,e,0)}function m(t,e){return y(t,e,e)}function y(t,e,i){return void 0===t?i:p(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function p(t){return t<0||0===t&&1/t==-1/0}var x="@@__IMMUTABLE_ITERABLE__@@";function S(t){return Boolean(t&&t[x])}var A="@@__IMMUTABLE_KEYED__@@";function v(t){return Boolean(t&&t[A])}var b="@@__IMMUTABLE_INDEXED__@@";function M(t){return Boolean(t&&t[b])}function E(t){return v(t)||M(t)}var T=function(t){return S(t)?t:J(t)},w=function(t){function e(t){return v(t)?t:q(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(T),k=function(t){function e(t){return M(t)?t:Q(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(T),C=function(t){function e(t){return S(t)&&!E(t)?t:tt(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(T);T.Keyed=w,T.Indexed=k,T.Set=C;var R="@@__IMMUTABLE_SEQ__@@";function I(t){return Boolean(t&&t[R])}var F="@@__IMMUTABLE_RECORD__@@";function D(t){return Boolean(t&&t[F])}function L(t){return S(t)||D(t)}var V="@@__IMMUTABLE_ORDERED__@@";function _(t){return Boolean(t&&t[V])}var P=0,B=1,z=2,N="function"==typeof Symbol&&Symbol.iterator,U="@@iterator",O=N||U,G=function(t){this.next=t};function Y(t,e,i,s){var r=0===t?e:1===t?i:[e,i];return s?s.value=r:s={value:r,done:!1},s}function H(){return{value:void 0,done:!0}}function X(t){return!!Array.isArray(t)||!!$(t)}function W(t){return t&&"function"==typeof t.next}function j(t){var e=$(t);return e&&e.call(t)}function $(t){var e=t&&(N&&t[N]||t[U]);if("function"==typeof e)return e}G.prototype.toString=function(){return"[Iterator]"},G.KEYS=P,G.VALUES=B,G.ENTRIES=z,G.prototype.inspect=G.prototype.toSource=function(){return this.toString()},G.prototype[O]=function(){return this};var Z=Object.prototype.hasOwnProperty;function K(t){return!(!Array.isArray(t)&&"string"!=typeof t)||t&&"object"==typeof t&&Number.isInteger(t.length)&&t.length>=0&&(0===t.length?1===Object.keys(t).length:t.hasOwnProperty(t.length-1))}var J=function(t){function e(t){return null==t?nt():L(t)?t.toSeq():function(t){var e,i,s=at(t);if(s)return(i=$(e=t))&&i===e.entries?s.fromEntrySeq():function(t){var e=$(t);return e&&e===t.keys}(t)?s.toSetSeq():s;if("object"==typeof t)return new it(t);throw new TypeError("Expected Array or collection object of values, or keyed object: "+t)}(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq {","}")},e.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},e.prototype.__iterate=function(t,e){var i=this._cache;if(i){for(var s=i.length,r=0;r!==s;){var n=i[e?s-++r:r++];if(!1===t(n[1],n[0],this))break}return r}return this.__iterateUncached(t,e)},e.prototype.__iterator=function(t,e){var i=this._cache;if(i){var s=i.length,r=0;return new G((function(){if(r===s)return{value:void 0,done:!0};var n=i[e?s-++r:r++];return Y(t,n[0],n[1])}))}return this.__iteratorUncached(t,e)},e}(T),q=function(t){function e(t){return null==t?nt().toKeyedSeq():S(t)?v(t)?t.toSeq():t.fromEntrySeq():D(t)?t.toSeq():ot(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toKeyedSeq=function(){return this},e}(J),Q=function(t){function e(t){return null==t?nt():S(t)?v(t)?t.entrySeq():t.toIndexedSeq():D(t)?t.toSeq().entrySeq():ht(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toIndexedSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq [","]")},e}(J),tt=function(t){function e(t){return(S(t)&&!E(t)?t:Q(t)).toSetSeq()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toSetSeq=function(){return this},e}(J);J.isSeq=I,J.Keyed=q,J.Set=tt,J.Indexed=Q,J.prototype[R]=!0;var et=function(t){function e(t){this._array=t,this.size=t.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return this.has(t)?this._array[c(this,t)]:e},e.prototype.__iterate=function(t,e){for(var i=this._array,s=i.length,r=0;r!==s;){var n=e?s-++r:r++;if(!1===t(i[n],n,this))break}return r},e.prototype.__iterator=function(t,e){var i=this._array,s=i.length,r=0;return new G((function(){if(r===s)return{value:void 0,done:!0};var n=e?s-++r:r++;return Y(t,n,i[n])}))},e}(Q),it=function(t){function e(t){var e=Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]);this._object=t,this._keys=e,this.size=e.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},e.prototype.has=function(t){return Z.call(this._object,t)},e.prototype.__iterate=function(t,e){for(var i=this._object,s=this._keys,r=s.length,n=0;n!==r;){var o=s[e?r-++n:n++];if(!1===t(i[o],o,this))break}return n},e.prototype.__iterator=function(t,e){var i=this._object,s=this._keys,r=s.length,n=0;return new G((function(){if(n===r)return{value:void 0,done:!0};var o=s[e?r-++n:n++];return Y(t,o,i[o])}))},e}(q);it.prototype[V]=!0;var st,rt=function(t){function e(t){this._collection=t,this.size=t.length||t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var i=j(this._collection),s=0;if(W(i))for(var r;!(r=i.next()).done&&!1!==t(r.value,s++,this););return s},e.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var i=j(this._collection);if(!W(i))return new G(H);var s=0;return new G((function(){var e=i.next();return e.done?e:Y(t,s++,e.value)}))},e}(Q);function nt(){return st||(st=new et([]))}function ot(t){var e=at(t);if(e)return e.fromEntrySeq();if("object"==typeof t)return new it(t);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+t)}function ht(t){var e=at(t);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+t)}function at(t){return K(t)?new et(t):X(t)?new rt(t):void 0}var lt="@@__IMMUTABLE_MAP__@@";function ut(t){return Boolean(t&&t[lt])}function ct(t){return ut(t)&&_(t)}function dt(t){return Boolean(t&&"function"==typeof t.equals&&"function"==typeof t.hashCode)}function ft(t,e){if(t===e||t!=t&&e!=e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if((t=t.valueOf())===(e=e.valueOf())||t!=t&&e!=e)return!0;if(!t||!e)return!1}return!!(dt(t)&&dt(e)&&t.equals(e))}var gt="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){var i=65535&(t|=0),s=65535&(e|=0);return i*s+((t>>>16)*s+i*(e>>>16)<<16>>>0)|0};function mt(t){return t>>>1&1073741824|3221225471&t}var yt=Object.prototype.valueOf;function pt(t){if(null==t)return xt(t);if("function"==typeof t.hashCode)return mt(t.hashCode(t));var e,i,s,r=(e=t).valueOf!==yt&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==r)return xt(r);switch(typeof r){case"boolean":return r?1108378657:1108378656;case"number":return function(t){if(t!=t||t===1/0)return 0;var e=0|t;for(e!==t&&(e^=4294967295*t);t>4294967295;)e^=t/=4294967295;return mt(e)}(r);case"string":return r.length>Ct?(void 0===(s=Ft[i=r])&&(s=St(i),It===Rt&&(It=0,Ft={}),It++,Ft[i]=s),s):St(r);case"object":case"function":return function(t){var e;if(Et&&void 0!==(e=Mt.get(t)))return e;if(void 0!==(e=t[kt]))return e;if(!vt){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[kt]))return e;if(void 0!==(e=function(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}(t)))return e}if(e=bt(),Et)Mt.set(t,e);else{if(void 0!==At&&!1===At(t))throw new Error("Non-extensible objects are not allowed as keys.");if(vt)Object.defineProperty(t,kt,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[kt]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[kt]=e}}return e}(r);case"symbol":return function(t){var e=Tt[t];return void 0!==e||(e=bt(),Tt[t]=e),e}(r);default:if("function"==typeof r.toString)return St(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function xt(t){return null===t?1108378658:1108378659}function St(t){for(var e=0,i=0;i=0&&(l.get=function(e,i){return(e=c(this,e))>=0&&eh)return{value:void 0,done:!0};var t=r.next();return s||e===B||t.done?t:Y(e,a-1,e===P?void 0:t.value[1],t)}))},l}function Ot(t,e,i,s){var r=Kt(t);return r.__iterateUncached=function(r,n){var o=this;if(n)return this.cacheResult().__iterate(r,n);var h=!0,a=0;return t.__iterate((function(t,n,l){if(!h||!(h=e.call(i,t,n,l)))return a++,r(t,s?n:a-1,o)})),a},r.__iteratorUncached=function(r,n){var o=this;if(n)return this.cacheResult().__iterator(r,n);var h=t.__iterator(z,n),a=!0,l=0;return new G((function(){var t,n,u;do{if((t=h.next()).done)return s||r===B?t:Y(r,l++,r===P?void 0:t.value[1],t);var c=t.value;n=c[0],u=c[1],a&&(a=e.call(i,u,n,o))}while(a);return r===z?t:Y(r,n,u,t)}))},r}function Gt(t,e,i){var s=Kt(t);return s.__iterateUncached=function(r,n){if(n)return this.cacheResult().__iterate(r,n);var o=0,h=!1;return function t(a,l){a.__iterate((function(n,a){return(!e||l0}function Wt(t,e,i,s){var r=Kt(t),n=new et(i).map((function(t){return t.size}));return r.size=s?n.max():n.min(),r.__iterate=function(t,e){for(var i,s=this.__iterator(B,e),r=0;!(i=s.next()).done&&!1!==t(i.value,r++,this););return r},r.__iteratorUncached=function(t,r){var n=i.map((function(t){return t=T(t),j(r?t.reverse():t)})),o=0,h=!1;return new G((function(){var i;return h||(i=n.map((function(t){return t.next()})),h=s?i.every((function(t){return t.done})):i.some((function(t){return t.done}))),h?{value:void 0,done:!0}:Y(t,o++,e.apply(null,i.map((function(t){return t.value}))))}))},r}function jt(t,e){return t===e?t:I(t)?e:t.constructor(e)}function $t(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Zt(t){return v(t)?w:M(t)?k:C}function Kt(t){return Object.create((v(t)?q:M(t)?Q:tt).prototype)}function Jt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):J.prototype.cacheResult.call(this)}function qt(t,e){return void 0===t&&void 0===e?0:void 0===t?1:void 0===e?-1:t>e?1:t0;)e[i]=arguments[i+1];if("function"!=typeof t)throw new TypeError("Invalid merger function: "+t);return Me(this,e,t)}function Me(t,e,i){for(var s=[],r=0;r0;)e[i]=arguments[i+1];return Re(t,e)}function Te(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return Re(e,i,t)}function we(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return Ce(t,e)}function ke(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return Ce(e,i,t)}function Ce(t,e,i){return Re(t,e,function(t){return function e(i,s,r){return ne(i)&&ne(s)&&(n=s,o=J(i),h=J(n),M(o)===M(h)&&v(o)===v(h))?Re(i,[s],e):t?t(i,s,r):s;var n,o,h}}(i))}function Re(t,e,i){if(!ne(t))throw new TypeError("Cannot merge into non-data-structure value: "+t);if(L(t))return"function"==typeof i&&t.mergeWith?t.mergeWith.apply(t,[i].concat(e)):t.merge?t.merge.apply(t,e):t.concat.apply(t,e);for(var s=Array.isArray(t),r=t,n=s?k:w,o=s?function(e){r===t&&(r=le(r)),r.push(e)}:function(e,s){var n=Z.call(r,s),o=n&&i?i(r[s],e,s):e;n&&o===r[s]||(r===t&&(r=le(r)),r[s]=o)},h=0;h0;)e[i]=arguments[i+1];return Ce(this,e,t)}function De(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,Ke(),(function(t){return Re(t,e)}))}function Le(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,Ke(),(function(t){return Ce(t,e)}))}function Ve(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}function _e(){return this.__ownerID?this:this.__ensureOwner(new l)}function Pe(){return this.__ensureOwner()}function Be(){return this.__altered}var ze=function(t){function e(e){return null==e?Ke():ut(e)&&!_(e)?e:Ke().withMutations((function(i){var s=t(e);ee(s.size),s.forEach((function(t,e){return i.set(e,t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Ke().withMutations((function(e){for(var i=0;i=t.length)throw new Error("Missing value for key: "+t[i]);e.set(t[i],t[i+1])}}))},e.prototype.toString=function(){return this.__toString("Map {","}")},e.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},e.prototype.set=function(t,e){return Je(this,t,e)},e.prototype.remove=function(t){return Je(this,t,h)},e.prototype.deleteAll=function(t){var e=T(t);return 0===e.size?this:this.withMutations((function(t){e.forEach((function(e){return t.remove(e)}))}))},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Ke()},e.prototype.sort=function(t){return bi(Yt(this,t))},e.prototype.sortBy=function(t,e){return bi(Yt(this,e,t))},e.prototype.map=function(t,e){var i=this;return this.withMutations((function(s){s.forEach((function(r,n){s.set(n,t.call(e,r,n,i))}))}))},e.prototype.__iterator=function(t,e){return new We(this,t,e)},e.prototype.__iterate=function(t,e){var i=this,s=0;return this._root&&this._root.iterate((function(e){return s++,t(e[1],e[0],i)}),e),s},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ze(this.size,this._root,t,this.__hash):0===this.size?Ke():(this.__ownerID=t,this.__altered=!1,this)},e}(w);ze.isMap=ut;var Ne=ze.prototype;Ne[lt]=!0,Ne[s]=Ne.remove,Ne.removeAll=Ne.deleteAll,Ne.setIn=me,Ne.removeIn=Ne.deleteIn=pe,Ne.update=Se,Ne.updateIn=Ae,Ne.merge=Ne.concat=ve,Ne.mergeWith=be,Ne.mergeDeep=Ie,Ne.mergeDeepWith=Fe,Ne.mergeIn=De,Ne.mergeDeepIn=Le,Ne.withMutations=Ve,Ne.wasAltered=Be,Ne.asImmutable=Pe,Ne["@@transducer/init"]=Ne.asMutable=_e,Ne["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Ne["@@transducer/result"]=function(t){return t.asImmutable()};var Ue=function(t,e){this.ownerID=t,this.entries=e};Ue.prototype.get=function(t,e,i,s){for(var r=this.entries,n=0,o=r.length;n=si)return function(t,e,i,s){t||(t=new l);for(var r=new He(t,pt(i),[i,s]),n=0;n>>t)&o),h=this.bitmap;return h&n?this.nodes[ei(h&n-1)].get(t+r,e,i,s):s},Oe.prototype.update=function(t,e,i,s,a,l,u){void 0===i&&(i=pt(s));var c=(0===e?i:i>>>e)&o,d=1<=ri)return function(t,e,i,s,r){for(var o=0,h=new Array(n),a=0;0!==i;a++,i>>>=1)h[a]=1&i?e[o++]:void 0;return h[s]=r,new Ge(t,o+1,h)}(t,y,f,c,x);if(g&&!x&&2===y.length&&Qe(y[1^m]))return y[1^m];if(g&&x&&1===y.length&&Qe(x))return x;var S=t&&t===this.ownerID,A=g?x?f:f^d:f|d,v=g?x?ii(y,m,x,S):function(t,e,i){var s=t.length-1;if(i&&e===s)return t.pop(),t;for(var r=new Array(s),n=0,o=0;o>>t)&o,h=this.nodes[n];return h?h.get(t+r,e,i,s):s},Ge.prototype.update=function(t,e,i,s,n,a,l){void 0===i&&(i=pt(s));var u=(0===e?i:i>>>e)&o,c=n===h,d=this.nodes,f=d[u];if(c&&!f)return this;var g=qe(f,t,e+r,i,s,n,a,l);if(g===f)return this;var m=this.count;if(f){if(!g&&--m>>i)&o,l=(0===i?s:s>>>i)&o,u=a===l?[ti(t,e,i+r,s,n)]:(h=new He(e,s,n),a>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,127&(t+=t>>8)+(t>>16)}function ii(t,e,i,s){var r=s?t:Qt(t);return r[e]=i,r}var si=n/4,ri=n/2,ni=n/4,oi="@@__IMMUTABLE_LIST__@@";function hi(t){return Boolean(t&&t[oi])}var ai=function(t){function e(e){var i=mi();if(null==e)return i;if(hi(e))return e;var s=t(e),o=s.size;return 0===o?i:(ee(o),o>0&&o=0&&t=t.size||e<0)return t.withMutations((function(t){e<0?Si(t,e).set(0,i):Si(t,0,e+1).set(e,i)}));e+=t._origin;var s=t._tail,r=t._root,n={value:!1};return e>=Ai(t._capacity)?s=yi(s,t.__ownerID,0,e,i,n):r=yi(r,t.__ownerID,t._level,e,i,n),n.value?t.__ownerID?(t._root=r,t._tail=s,t.__hash=void 0,t.__altered=!0,t):gi(t._origin,t._capacity,t._level,r,s):t}(this,t,e)},e.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},e.prototype.insert=function(t,e){return this.splice(t,0,e)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=r,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):mi()},e.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations((function(i){Si(i,0,e+t.length);for(var s=0;s>>e&o;if(s>=this.array.length)return new ui([],t);var n,h=0===s;if(e>0){var a=this.array[s];if((n=a&&a.removeBefore(t,e-r,i))===a&&h)return this}if(h&&!n)return this;var l=pi(this,t);if(!h)for(var u=0;u>>e&o;if(n>=this.array.length)return this;if(e>0){var h=this.array[n];if((s=h&&h.removeAfter(t,e-r,i))===h&&n===this.array.length-1)return this}var a=pi(this,t);return a.array.splice(n+1),s&&(a.array[n]=s),a};var ci,di={};function fi(t,e){var i=t._origin,s=t._capacity,o=Ai(s),h=t._tail;return function t(a,l,u){return 0===l?function(t,r){var a=r===o?h&&h.array:t&&t.array,l=r>i?0:i-r,u=s-r;return u>n&&(u=n),function(){if(l===u)return di;var t=e?--u:l++;return a&&a[t]}}(a,u):function(o,h,a){var l,u=o&&o.array,c=a>i?0:i-a>>h,d=1+(s-a>>h);return d>n&&(d=n),function(){for(;;){if(l){var i=l();if(i!==di)return i;l=null}if(c===d)return di;var s=e?--d:c++;l=t(u&&u[s],h-r,a+(s<>>i&o,c=t&&u0){var d=t&&t.array[u],f=yi(d,e,i-r,s,n,h);return f===d?t:((l=pi(t,e)).array[u]=f,l)}return c&&t.array[u]===n?t:(h&&a(h),l=pi(t,e),void 0===n&&u===l.array.length-1?l.array.pop():l.array[u]=n,l)}function pi(t,e){return e&&t&&e===t.ownerID?t:new ui(t?t.array.slice():[],e)}function xi(t,e){if(e>=Ai(t._capacity))return t._tail;if(e<1<0;)i=i.array[e>>>s&o],s-=r;return i}}function Si(t,e,i){void 0!==e&&(e|=0),void 0!==i&&(i|=0);var s=t.__ownerID||new l,n=t._origin,h=t._capacity,a=n+e,u=void 0===i?h:i<0?h+i:n+i;if(a===n&&u===h)return t;if(a>=u)return t.clear();for(var c=t._level,d=t._root,f=0;a+f<0;)d=new ui(d&&d.array.length?[void 0,d]:[],s),f+=1<<(c+=r);f&&(a+=f,n+=f,u+=f,h+=f);for(var g=Ai(h),m=Ai(u);m>=1<g?new ui([],s):y;if(y&&m>g&&ar;S-=r){var A=g>>>S&o;x=x.array[A]=pi(x.array[A],s)}x.array[g>>>r&o]=y}if(u=m)a-=m,u-=m,c=r,d=null,p=p&&p.removeBefore(s,0,a);else if(a>n||m>>c&o;if(v!==m>>>c&o)break;v&&(f+=(1<n&&(d=d.removeBefore(s,c,a-f)),d&&m>>r<=n&&a.size>=2*o.size?(s=(r=a.filter((function(t,e){return void 0!==t&&l!==e}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.__ownerID&&(s.__ownerID=r.__ownerID=t.__ownerID)):(s=o.remove(e),r=l===a.size-1?a.pop():a.set(l,void 0))}else if(u){if(i===a.get(l)[1])return t;s=o,r=a.set(l,[e,i])}else s=o.set(e,a.size),r=a.set(a.size,[e,i]);return t.__ownerID?(t.size=s.size,t._map=s,t._list=r,t.__hash=void 0,t.__altered=!0,t):Mi(s,r)}bi.isOrderedMap=ct,bi.prototype[V]=!0,bi.prototype[s]=bi.prototype.remove;var wi="@@__IMMUTABLE_STACK__@@";function ki(t){return Boolean(t&&t[wi])}var Ci=function(t){function e(t){return null==t?Di():ki(t)?t:Di().pushAll(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("Stack [","]")},e.prototype.get=function(t,e){var i=this._head;for(t=c(this,t);i&&t--;)i=i.next;return i?i.value:e},e.prototype.peek=function(){return this._head&&this._head.value},e.prototype.push=function(){var t=arguments;if(0===arguments.length)return this;for(var e=this.size+arguments.length,i=this._head,s=arguments.length-1;s>=0;s--)i={value:t[s],next:i};return this.__ownerID?(this.size=e,this._head=i,this.__hash=void 0,this.__altered=!0,this):Fi(e,i)},e.prototype.pushAll=function(e){if(0===(e=t(e)).size)return this;if(0===this.size&&ki(e))return e;ee(e.size);var i=this.size,s=this._head;return e.__iterate((function(t){i++,s={value:t,next:s}}),!0),this.__ownerID?(this.size=i,this._head=s,this.__hash=void 0,this.__altered=!0,this):Fi(i,s)},e.prototype.pop=function(){return this.slice(1)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Di()},e.prototype.slice=function(e,i){if(f(e,i,this.size))return this;var s=g(e,this.size);if(m(i,this.size)!==this.size)return t.prototype.slice.call(this,e,i);for(var r=this.size-s,n=this._head;s--;)n=n.next;return this.__ownerID?(this.size=r,this._head=n,this.__hash=void 0,this.__altered=!0,this):Fi(r,n)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Fi(this.size,this._head,t,this.__hash):0===this.size?Di():(this.__ownerID=t,this.__altered=!1,this)},e.prototype.__iterate=function(t,e){var i=this;if(e)return new et(this.toArray()).__iterate((function(e,s){return t(e,s,i)}),e);for(var s=0,r=this._head;r&&!1!==t(r.value,s++,this);)r=r.next;return s},e.prototype.__iterator=function(t,e){if(e)return new et(this.toArray()).__iterator(t,e);var i=0,s=this._head;return new G((function(){if(s){var e=s.value;return s=s.next,Y(t,i++,e)}return{value:void 0,done:!0}}))},e}(k);Ci.isStack=ki;var Ri,Ii=Ci.prototype;function Fi(t,e,i,s){var r=Object.create(Ii);return r.size=t,r._head=e,r.__ownerID=i,r.__hash=s,r.__altered=!1,r}function Di(){return Ri||(Ri=Fi(0))}Ii[wi]=!0,Ii.shift=Ii.pop,Ii.unshift=Ii.push,Ii.unshiftAll=Ii.pushAll,Ii.withMutations=Ve,Ii.wasAltered=Be,Ii.asImmutable=Pe,Ii["@@transducer/init"]=Ii.asMutable=_e,Ii["@@transducer/step"]=function(t,e){return t.unshift(e)},Ii["@@transducer/result"]=function(t){return t.asImmutable()};var Li="@@__IMMUTABLE_SET__@@";function Vi(t){return Boolean(t&&t[Li])}function _i(t){return Vi(t)&&_(t)}function Pi(t,e){if(t===e)return!0;if(!S(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||v(t)!==v(e)||M(t)!==M(e)||_(t)!==_(e))return!1;if(0===t.size&&0===e.size)return!0;var i=!E(t);if(_(t)){var s=t.entries();return e.every((function(t,e){var r=s.next().value;return r&&ft(r[1],t)&&(i||ft(r[0],e))}))&&s.next().done}var r=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{r=!0;var n=t;t=e,e=n}var o=!0,a=e.__iterate((function(e,s){if(i?!t.has(e):r?!ft(e,t.get(s,h)):!ft(t.get(s,h),e))return o=!1,!1}));return o&&t.size===a}function Bi(t,e){var i=function(i){t.prototype[i]=e[i]};return Object.keys(e).forEach(i),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(i),t}function zi(t){if(!t||"object"!=typeof t)return t;if(!S(t)){if(!ne(t))return t;t=J(t)}if(v(t)){var e={};return t.__iterate((function(t,i){e[i]=zi(t)})),e}var i=[];return t.__iterate((function(t){i.push(zi(t))})),i}var Ni=function(t){function e(e){return null==e?Hi():Vi(e)&&!_(e)?e:Hi().withMutations((function(i){var s=t(e);ee(s.size),s.forEach((function(t){return i.add(t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(w(t).keySeq())},e.intersect=function(t){return(t=T(t).toArray()).length?Oi.intersect.apply(e(t.pop()),t):Hi()},e.union=function(t){return(t=T(t).toArray()).length?Oi.union.apply(e(t.pop()),t):Hi()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return Gi(this,this._map.set(t,t))},e.prototype.remove=function(t){return Gi(this,this._map.remove(t))},e.prototype.clear=function(){return Gi(this,this._map.clear())},e.prototype.map=function(t,e){var i=this,s=!1,r=Gi(this,this._map.mapEntries((function(r){var n=r[1],o=t.call(e,n,n,i);return o!==n&&(s=!0),[o,o]}),e));return s?r:this},e.prototype.union=function(){for(var e=[],i=arguments.length;i--;)e[i]=arguments[i];return 0===(e=e.filter((function(t){return 0!==t.size}))).length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations((function(i){for(var s=0;s=0&&e=0&&i>>-15,461845907),e=gt(e<<13|e>>>-13,5),e=gt((e=e+3864292196^t)^e>>>16,2246822507),e=mt((e=gt(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(i?e?function(t,e){s=31*s+as(pt(t),pt(e))|0}:function(t,e){s=s+as(pt(t),pt(e))|0}:e?function(t){s=31*s+pt(t)|0}:function(t){s=s+pt(t)|0}),s)}(this))}});var Ji=T.prototype;Ji[x]=!0,Ji[O]=Ji.values,Ji.toJSON=Ji.toArray,Ji.__toStringMapper=oe,Ji.inspect=Ji.toSource=function(){return this.toString()},Ji.chain=Ji.flatMap,Ji.contains=Ji.includes,Bi(w,{flip:function(){return jt(this,Pt(this))},mapEntries:function(t,e){var i=this,s=0;return jt(this,this.toSeq().map((function(r,n){return t.call(e,[n,r],s++,i)})).fromEntrySeq())},mapKeys:function(t,e){var i=this;return jt(this,this.toSeq().flip().map((function(s,r){return t.call(e,s,r,i)})).flip())}});var qi=w.prototype;qi[A]=!0,qi[O]=Ji.entries,qi.toJSON=Ki,qi.__toStringMapper=function(t,e){return oe(e)+": "+oe(t)},Bi(k,{toKeyedSeq:function(){return new Dt(this,!1)},filter:function(t,e){return jt(this,Nt(this,t,e,!1))},findIndex:function(t,e){var i=this.findEntry(t,e);return i?i[0]:-1},indexOf:function(t){var e=this.keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return jt(this,zt(this,!1))},slice:function(t,e){return jt(this,Ut(this,t,e,!1))},splice:function(t,e){var i=arguments.length;if(e=Math.max(e||0,0),0===i||2===i&&!e)return this;t=g(t,t<0?this.count():this.size);var s=this.slice(0,t);return jt(this,1===i?s:s.concat(Qt(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var i=this.findLastEntry(t,e);return i?i[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return jt(this,Gt(this,t,!1))},get:function(t,e){return(t=c(this,t))<0||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find((function(e,i){return i===t}),void 0,e)},has:function(t){return(t=c(this,t))>=0&&(void 0!==this.size?this.size===1/0||te?-1:0}function as(t,e){return t^e+2654435769+(t<<6)+(t>>2)}ts.has=Ji.includes,ts.contains=ts.includes,ts.keys=ts.values,Bi(q,qi),Bi(Q,Qi),Bi(tt,ts);var ls=function(t){function e(t){return null==t?fs():_i(t)?t:fs().withMutations((function(e){var i=C(t);ee(i.size),i.forEach((function(t){return e.add(t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(w(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Ni);ls.isOrderedSet=_i;var us,cs=ls.prototype;function ds(t,e){var i=Object.create(cs);return i.size=t?t.size:0,i._map=t,i.__ownerID=e,i}function fs(){return us||(us=ds(Ei()))}cs[V]=!0,cs.zip=Qi.zip,cs.zipWith=Qi.zipWith,cs.zipAll=Qi.zipAll,cs.__empty=fs,cs.__make=ds;var gs={LeftThenRight:-1,RightThenLeft:1},ms=function(t,e){var i;!function(t){if(D(t))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(L(t))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===t||"object"!=typeof t)throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(t);var s=function(n){var o=this;if(n instanceof s)return n;if(!(this instanceof s))return new s(n);if(!i){i=!0;var h=Object.keys(t),a=r._indices={};r._name=e,r._keys=h,r._defaultValues=t;for(var l=0;l2?[]:void 0,{"":t})}function Es(t,e,i,s,r,n){if("string"!=typeof i&&!L(i)&&(K(i)||X(i)||re(i))){if(~t.indexOf(i))throw new TypeError("Cannot convert circular structure to Immutable");t.push(i),r&&""!==s&&r.push(s);var o=e.call(n,s,J(i).map((function(s,n){return Es(t,e,s,n,r,i)})),r&&r.slice());return t.pop(),r&&r.pop(),o}return i}function Ts(t,e){return M(e)?e.toList():v(e)?e.toMap():e.toSet()}var ws="4.3.5",ks=T;const Cs={version:ws,Collection:T,Iterable:T,Seq:J,Map:ze,OrderedMap:bi,List:ai,Stack:Ci,Set:Ni,OrderedSet:ls,PairSorting:gs,Record:ms,Range:Wi,Repeat:bs,is:ft,fromJS:Ms,hash:pt,isImmutable:L,isCollection:S,isKeyed:v,isIndexed:M,isAssociative:E,isOrdered:_,isValueObject:dt,isPlainObject:re,isSeq:I,isList:hi,isMap:ut,isOrderedMap:ct,isStack:ki,isSet:Vi,isOrderedSet:_i,isRecord:D,get:ae,getIn:ji,has:he,hasIn:Zi,merge:Ee,mergeDeep:we,mergeWith:Te,mergeDeepWith:ke,remove:ue,removeIn:ye,set:ce,setIn:ge,update:xe,updateIn:de}},89:(t,e,i)=>{Object.defineProperty(e,"i",{value:!0});var s=i(568),r=i(613),n=i(570),o=function(t){if(t&&t.i)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(i){if("default"!==i){var s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:function(){return t[i]}})}})),e.default=t,Object.freeze(e)}(s),h=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(n);class a{constructor(){this.o=!0}u(){return this.o}}class l extends a{constructor(t,e){super(),this.S=t,this.o=e}M(t){return t!==this.S&&(this.S=t,this.o=!0),this}_(){return this.S}u(){return super.u()}}const u=(t,e)=>({x:t,y:e}),c=(t,e)=>({x:t,y:e}),d=(t,e,i)=>({position:t,high:e,low:i}),f=(t,e,i)=>({x:t,y:e,z:i}),g=t=>{const e=Array(0),i=Array(0);return t.length>0&&t.forEach((t=>{e.push(u(t.position,t.high)),i.push(u(t.position,t.low))})),[e,i]},m=(t,e)=>({min:t,max:e}),y=(t,e,i,s)=>({x:Math.ceil(t),y:Math.ceil(e),width:Math.ceil(i),height:Math.ceil(s)}),p=(t,e=!0)=>new l(t,e),x=(t=0,e=0,i=0,s=0)=>({left:t,top:e,right:i,bottom:s}),S=x,A=(t,e)=>({left:void 0!==e.left?e.left:t.left,top:void 0!==e.top?e.top:t.top,right:void 0!==e.right?e.right:t.right,bottom:void 0!==e.bottom?e.bottom:t.bottom}),v=s.Record({type:"color",r:1,g:1,b:1,a:1});class b extends v{constructor(t){super(t)}toUint32(){return void 0!==this.C||(this.C=F(this.getR(),this.getG(),this.getB(),this.getA())),this.C}toString(){return`color:${this.r},${this.g},${this.b},${this.a}`}setA(t){return this.set("a",t/255)}setR(t){return this.set("r",t/255)}setG(t){return this.set("g",t/255)}setB(t){return this.set("b",t/255)}getA(){return 255*this.get("a")}getR(){return 255*this.get("r")}getG(){return 255*this.get("g")}getB(){return 255*this.get("b")}getHighlight(){return this.T||(this.T=new b({r:this.r+.45*(1-this.r),g:this.g+.45*(1-this.g),b:this.b+.45*(1-this.b),a:this.a<1?this.a+.45*(1-this.a):1})),this.T}getLighter(){return this.F||(this.F=new b({r:this.r+.4*(1-this.r),g:this.g+.4*(1-this.g),b:this.b+.4*(1-this.b),a:this.a})),this.F}getDarker(){return this.I||(this.I=new b({r:this.r-.4*(1-this.r),g:this.g-.4*(1-this.g),b:this.b-.4*(1-this.b),a:this.a})),this.I}toRGBAString(){return`rgba( ${255*this.r}, ${255*this.g}, ${255*this.b}, ${255*this.a} )`}}const M=t=>!(!t||"object"!=typeof t||!("type"in t)||"color"!==t.type),E=(t,e,i,s=255)=>new b({r:t/255,g:e/255,b:i/255,a:s/255}),T=t=>{const e=t.startsWith("#")?t.substring(1):t.startsWith("0x")?t.substr(2):t;switch(e.length){case 8:return new b({r:Number(`0x${e.substring(0,2)}`)/255,g:Number(`0x${e.substring(2,4)}`)/255,b:Number(`0x${e.substring(4,6)}`)/255,a:Number(`0x${e.substring(6,8)}`)/255});case 6:return new b({r:Number(`0x${e.substring(0,2)}`)/255,g:Number(`0x${e.substring(2,4)}`)/255,b:Number(`0x${e.substring(4,6)}`)/255});case 4:return new b({r:Number(`0x${e.charAt(0)}${e.charAt(0)}`)/255,g:Number(`0x${e.charAt(1)}${e.charAt(1)}`)/255,b:Number(`0x${e.charAt(2)}${e.charAt(2)}`)/255,a:Number(`0x${e.charAt(3)}${e.charAt(3)}`)/255});case 3:return new b({r:Number(`0x${e.charAt(0)}${e.charAt(0)}`)/255,g:Number(`0x${e.charAt(1)}${e.charAt(1)}`)/255,b:Number(`0x${e.charAt(2)}${e.charAt(2)}`)/255});default:throw new Error(`ColorHEX parsing error | input: ${t}`)}},w=(t,e=1,i=1)=>{let s,r,n;t/=360;const o=Math.floor(6*t),h=6*t-o,a=i*(1-e),l=i*(1-h*e),u=i*(1-(1-h)*e);switch(o%6){case 0:s=i,r=u,n=a;break;case 1:s=l,r=i,n=a;break;case 2:s=a,r=i,n=u;break;case 3:s=a,r=l,n=i;break;case 4:s=u,r=a,n=i;break;default:s=i,r=a,n=l}return new b({r:s,g:r,b:n})},k=t=>E(255&t,255&(t>>=8),255&(t>>=8),255&(t>>=8)),C={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",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#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",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",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",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:"#d87093",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",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},R=new b({}),I=E(0,0,0,0),F=(t,e,i,s=255)=>(s<<24|i<<16|e<<8|t)>>>0,D=(t,e)=>t.value-e.value,L=s.Record({type:"lut",steps:[],title:"",units:"",interpolate:!0,color:E(0,0,0,255),length:0,min:0,max:0,subranges:[],isValid:!1,percentageValues:!1}),V=t=>{const{steps:e}=t,i=e.length;e.sort(D);const[s,r]=i>0?[e[0].value,e[i-1].value]:[0,0],n=i>0?i-1:0,o=Array(n);for(let t=0;t0&&s!==r}};class _ extends L{constructor(t){super(((t,e)=>({steps:t.steps,title:t.title,units:t.units,interpolate:t.interpolate,percentageValues:t.percentageValues,color:t.color,length:e.length,min:e.min,max:e.max,subranges:e.subranges,isValid:e.isValid}))(t,V(t)))}toString(){return`LUT:interpolate=${this.interpolate},steps=${this.steps.length},percentage=${this.percentageValues}`}setSteps(t){return this.merge(V({...this,steps:t}))}getSteps(){return this.get("steps")}setTitle(t){return this.set("title",t)}getTitle(){return this.get("title")}setUnits(t){return this.set("units",t)}getUnits(){return this.get("units")}setInterpolation(t){return this.set("interpolate",t)}getInterpolation(){return this.get("interpolate")}setFallbackColor(t){return this.set("color",t)}getFallbackColor(){return this.get("color")}setPercentageValues(t){return this.set("percentageValues",t)}getPercentageValues(){return this.get("percentageValues")}getColors(t){if(Array.isArray(t)){if(Array.isArray(t[0])){const e=t,i=e.length,s=e[0].length,r=[...Array(i)].map((()=>Array(s)));for(let t=0;t=a&&t<=l){if(a===l)return i.color;const e=(t-i.value)/(h.value-i.value);return s=i.color,r=h.color,n=e,new b({r:s.r+(r.r-s.r)*n,g:s.g+(r.g-s.g)*n,b:s.b+(r.b-s.b)*n,a:s.a+(r.a-s.a)*n})}}return t=0;s-=1)if(t>=e[s].value)return e[s].color;return e[0].color}}const P=s.Record({type:"fillstyle",fillType:"empty"});class B extends P{toString(){return"emptyFill"}}const z=new B,N=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"empty"===t.fillType),U=s.Record({type:"fillstyle",fillType:"solid",color:E(255,255,255)});class O extends U{}class G extends O{constructor(t){super({...t,fillType:"solid"})}toString(){return`solidFill:${this.color.toString()}`}setColor(t){return M(t)?this.set("color",t):this.set("color",t(this.get("color")))}getColor(){return this.get("color")}setA(t){return this.setColor(this.getColor().setA(t))}setR(t){return this.setColor(this.getColor().setR(t))}setG(t){return this.setColor(this.getColor().setG(t))}setB(t){return this.setColor(this.getColor().setB(t))}}const Y=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"solid"===t.fillType);class H extends O{constructor(t){super({...t,fillType:"individual"})}toString(){return`individualPointFill:${this.color.toString()}`}setFallbackColor(t){return M(t)?this.set("color",t):this.set("color",t(this.get("color")))}getFallbackColor(){return this.get("color")}}const X=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"individual"===t.fillType),W=s.Record({type:"fillstyle",fillType:"palette",lut:new _({steps:[]}),lookUpProperty:"value"}),j=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"palette"===t.fillType),$={linear:(t,e,i)=>{const s=e-t;return r=>rs=>ss=>ss=>s{const e=ee(t);return(i,s,r)=>{const n=e(i),o=e(s);return e=>e(this.delta===this.duration||this.D)&&0===this.nextAnimations.length,this.values=t,this.action=e,this.duration=i,this.easing=s,this.R=n,this.eases=t.map((([t,e])=>s(t,e,i)))}V(){this.L.emit("start")}start(){return this.R.includes(this)||this.R.push(this),this}addNextAnimations(t){return t instanceof Array?t.forEach((t=>this.nextAnimations.push(t))):this.nextAnimations.push(t),this}NextAnimation(t,e,i=this.duration,s=this.easing){const r=new Z(t,e,i,s,this.R);return this.nextAnimations.push(r),r}onAnimationStart(t,e){return this.L.on("start",t,e)}onAnimationEnd(t,e){return this.L.on("end",t,e)}onEveryAnimationEnd(t,e){return this.L.on("everyEnd",t,e)}onAllAnimationEnd(t,e){return this.L.on("allEnd",t,e)}allOffAnimationEnd(){return this.L.topicOff("end"),this}allOffEveryAnimationEnd(){return this.L.topicOff("everyEnd"),this}allOffAllAnimationEnd(){return this.L.topicOff("allEnd"),this}offAnimationEnd(t){return this.L.off(t,"end")}offEveryAnimationEnd(t){return this.L.off(t,"everyEnd")}offAllAnimationEnd(t){return this.L.off(t,"allEnd")}finish(t=!0){if(this.D=!0,this.R.splice(this.R.indexOf(this),1),this.nextAnimations.length>0){const e=this.nextAnimations[0];return t&&(this.L.listeners("allEnd").forEach(((t,i)=>e.onAllAnimationEnd(t,i))),this.L.listeners("everyEnd").forEach(((t,i)=>e.onEveryAnimationEnd(t,i)))),e.addNextAnimations(this.nextAnimations.slice(1)),e.start(),t&&(this.L.emit("end",e),this.L.emit("everyEnd",e)),e}t&&(this.L.emit("end",void 0),this.L.emit("everyEnd",void 0),this.L.emit("allEnd"))}finishAll(t=!0){let e=this;for(;e;)e=e.finish(t)}getFinalValues(){return this.nextAnimations.length>0?this.nextAnimations[this.nextAnimations.length-1].values.map(Tt):this.values.map(Tt)}getTimeUntilFinish(){let t=this.duration-this.delta;for(let e=0;e{e>60&&console.log("Note: Animator FPS is usually capped at 60 by the browser!");const i=[];let s,r,n=0;const o=()=>{s=void 0;const h=Date.now();r=r||h,n=h-r,n/1e3>=1/e&&(r=Date.now()-n%(1e3/e),i.forEach((t=>{0===t.delta&&t.V(),t.delta+=n-n%(1e3/e),t.delta>t.duration&&(t.delta=t.duration),t.action(t.eases.map((e=>e(t.delta)))),t.delta===t.duration&&t.finish()})),t()),i.length>0?s=bt.requestAnimationFrame(o):(s=void 0,r=void 0)};return(t=1e3,e=$.linear)=>(r,n,h=t)=>{const a=new Z(r,n,h,e,i).start();return s||(s=bt.requestAnimationFrame(o)),a}};var J,q;e.GradientShape=void 0,(J=e.GradientShape||(e.GradientShape={})).circle="circle",J.ellipse="ellipse",e.GradientExtent=void 0,(q=e.GradientExtent||(e.GradientExtent={})).closestSide="closest-side",q.closestCorner="closest-corner",q.farthestSide="farthest-side",q.farthestCorner="farthest-corner";const Q=s.Record({type:"fillstyle",fillType:"radial-gradient",stops:[{color:T("#f00"),offset:0},{color:T("#0f0"),offset:1}],position:u(.5,.5),shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner});class tt extends Q{constructor(t){if(super(t),null===t||t&&null===t.stops||t&&t.stops&&!Array.isArray(t.stops)||t&&t.stops&&Array.isArray(t.stops)&&t.stops.length<2)throw new Error("RadialGradientFill requires minimum two color stops to be defined.")}toString(){return`radialGradientFill:${this.shape},${this.extent},${this.position.x},${this.position.y},${this.stops.map((t=>`${t.offset},${t.color.toString()}`)).join(",")}`}setColorStops(t){if(t.length<2)throw new Error("Minimum of two color stops required");return this.set("stops",t)}getColorStops(){return this.get("stops")}setPosition(t){return this.set("position",t)}getPosition(){return this.get("position")}setShape(t){return this.set("shape",t)}getShape(){return this.get("shape")}setExtent(t){return this.set("extent",t)}getExtent(){return this.get("extent")}}const et=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"radial-gradient"===t.fillType),it=s.Record({type:"fillstyle",fillType:"linear-gradient",stops:[{color:T("#f00"),offset:0},{color:T("#0f0"),offset:1}],angle:0});class st extends it{constructor(t){if(super(t),null===t||t&&null===t.stops||t&&t.stops&&!Array.isArray(t.stops)||t&&t.stops&&Array.isArray(t.stops)&&t.stops.length<2)throw new Error("LinearGradientFill requires minimum two color stops to be defined.")}toString(){return`linearGradientFill:${this.angle},${this.stops.map((t=>`${t.offset},${t.color.toString()}`)).join(",")}`}setColorStops(t){if(t.length<2)throw new Error("Minimum of two color stops required");const e=t.sort(((t,e)=>t.offset-e.offset));return this.set("stops",e)}getColorStops(){return this.get("stops")}setAngle(t,e){return this.set("angle",e?mi(t):t)}getAngle(t){return t?gi(this.get("angle")):this.get("angle")}}const rt=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"linear-gradient"===t.fillType),nt=s.Record({type:"linestyle",lineType:"empty"}),ot=new class extends nt{constructor(){super(...arguments),this.thickness=0}setThickness(t){return this}getThickness(){return 0}O(){return 0}setFillStyle(t){return this}getFillStyle(){return z}},ht=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"empty"!==t.lineType);class at{constructor(t,e,i,s){this.cellIndex=t,this.cellSpan=e,this.cellsAmount=i,this.observedAmount=s,this.x=new lt,this.y=new lt,this.z=new lt,this.L=new r.Eventer;const n={...t},o={...e};if(s){const t=t=>{this.cellsAmount.x=t.reduce(Ge,0),this.cellIndex.x=t.reduce(((t,e,i)=>i>=n.x?t:t+e),0),this.cellSpan.x=t.reduce(((t,e,i)=>i>=n.x&&i{this.cellsAmount.y=t.reduce(Ge,0),this.cellIndex.y=t.reduce(((t,e,i)=>i>=n.y?t:t+e),0),this.cellSpan.y=t.reduce(((t,e,i)=>i>=n.y&&i{s.x.W(e),s.y.W(r)}}}U(){return this.G&&(this.G(),this.G=void 0),this}Y(t){return this.L.on("cell-resize",t)}H(t){return this.L.off(t,"cell-resize")}}class lt extends a{constructor(){super(...arguments),this.$=0,this.X=10,this.j=1}Z(){return this.o=!1,this}J(){return this.o=!0,this}getInnerStart(){return this.$}getInnerEnd(){return this.X}getInnerInterval(){return Math.abs(this.getInnerEnd()-this.getInnerStart())}K(t,e){return this.$=t,this.X=e,this.q(),this}tt(t){return this.j=t,this.q(),this}it(t){return t/this.j}q(){const t=this.it(this.X-this.$),e=this.j;void 0!==this.st&&!1!==Ct(t,this.st)||(this.o=!0,this.et=e,this.st=t)}ht(){return this.st}rt(){return this.et}nt(){return this.Xnew t.scale1DConstructor(0,1,1,void 0),d2:t=>(new t.scaleXYConstructor).ut({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0),d3:()=>new at({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0)},ct=(t,e,i)=>e===i?t:i.ct(e.dt(t)),dt=(t,e,i)=>{if(e===i)return t;const s=e instanceof Vi?e.x:e.x instanceof Vi?e.x.x:e.x.ft,r=e instanceof Vi?e.y:e.y instanceof Vi?e.y.y:e.y.ft,n=i instanceof Vi?i.x:i.x instanceof Vi?i.x.x:i.x.ft,o=i instanceof Vi?i.y:i.y instanceof Vi?i.y.y:i.y.ft;return{...t,x:ct(t.x,s,n),y:ct(t.y,r,o)}},ft=(t,e,i)=>{if("axes"===e.id&&"world"===i.id)return e.chart.yt.At(t);if("world"===e.id&&"axes"===i.id)return e.chart.yt.St(t);if(e.id===i.id)return t;throw new Error("LC JS translatePoint3D misusage | originCoordinateSystem and targetCoordinateSystem arguments must be either Chart3D.coordsWorld or Chart3D.coordsAxis")},gt=(...t)=>{if(0===t.length)return{remove:kt};let e=!1;const i=t.map((i=>i.onIntervalChange(((s,r,n)=>((i,s,r)=>{e||(e=!0,t.filter((t=>t!==i)).forEach((t=>t.vt(s,r,!1,i.getStopped(),"synchronizedAxis"))),e=!1)})(i,r,n)))));let s=!1;const r=t.map((e=>e.onStoppedStateChanged(((i,r)=>((e,i)=>{s||(s=!0,t.filter((t=>t!==e)).forEach((t=>t.setStopped(i))),s=!1)})(e,r)))));return{remove:()=>{t.forEach(((t,e)=>{t.offIntervalChange(i[e]),t.offStoppedStateChanged(r[e])}))}}};class mt extends Error{constructor(t,e){super(`ChartError: ${t} ${e?`in ${e.constructor.name}`:""}`),Object.setPrototypeOf(this,mt.prototype)}}class yt extends Error{constructor(t,e,i=!1){const s=`EngineError: ${t} ${e?`in ${e.constructor.name}`:""}`;super(s),i&&bt.alert(s),Object.setPrototypeOf(this,yt.prototype)}}class pt extends yt{constructor(t){super(t),Object.setPrototypeOf(this,pt.prototype)}}var xt,St,At,vt;e.UISpace=void 0,(xt=e.UISpace||(e.UISpace={}))[xt.Content=0]="Content",xt[xt.PaddedContent=1]="PaddedContent",xt[xt.PaddedBackground=2]="PaddedBackground",xt[xt.Everything=3]="Everything",e.UIVisibilityModes=void 0,(St=e.UIVisibilityModes||(e.UIVisibilityModes={}))[St.never=0]="never",St[St.always=1]="always",St[St.whenHovered=2]="whenHovered",St[St.whenDragged=3]="whenDragged",St[St.whenNotDragged=4]="whenNotDragged",St[St.whenHoveredOrDragged=5]="whenHoveredOrDragged",e.UIDraggingModes=void 0,(At=e.UIDraggingModes||(e.UIDraggingModes={}))[At.notDraggable=0]="notDraggable",At[At.draggable=1]="draggable",At[At.onlyHorizontal=2]="onlyHorizontal",At[At.onlyVertical=3]="onlyVertical",e.UIDirections=void 0,(vt=e.UIDirections||(e.UIDirections={}))[vt.Up=0]="Up",vt[vt.Right=1]="Right",vt[vt.Down=2]="Down",vt[vt.Left=3]="Left";const bt="undefined"!=typeof window?window:void 0!==i.g&&i.g._lcjs?i.g._lcjs:{},Mt=(t,e)=>t.x===e.x&&t.y===e.y,Et=t=>t!==Le&&t!==Ve&&!Number.isNaN(t)&&Number.isFinite(t)&&t!==1/0&&t!==-1/0,Tt=t=>t[1],wt=t=>t.dispose(),kt=()=>{},Ct=(t,e)=>t===e,Rt=(t,e,i)=>i>e?Math.min(Math.max(t,e),i):Math.min(Math.max(t,i),e),It=t=>Array.prototype.concat.apply([],t),Ft=(t,e)=>void 0!==t?t:e,Dt=t=>t.xt(),Lt=t=>t.bt(),Vt=t=>t.Mt(),_t=t=>t._t(),Pt=t=>t.min.x,Bt=t=>t.max.x,zt=t=>t.min.y,Nt=t=>t.max.y,Ut=(t,e,i,s,r)=>{if(t.length>0){let n=r?s(r):void 0;for(let s=0;st.position===e.position&&t.high===e.high&&t.low===e.low,Gt=u(0,1),Yt=u(1,0),Ht=u(0,-1),Xt=u(-1,0),Wt=u(0,0),jt=t=>{switch(t){case e.UIDirections.Up:return Gt;case e.UIDirections.Right:return Yt;case e.UIDirections.Down:return Ht;case e.UIDirections.Left:return Xt;default:return Wt}},$t=t=>t===e.UIDirections.Left||t===e.UIDirections.Right,Zt=t=>{t.stopPropagation(),t.preventDefault()},Kt=(t,e)=>{if(!e)return t;const i=t.length,s=new Float32Array(2*i);let r=0;for(let e=0;e{if(!e){const e=t.length,i=new Float32Array(2*e);let s=0;for(let r=0;r{const e=t.length,i=new Float32Array(3*e);let s=0;for(let r=0;re=>{const i=t.indexOf(e);i>=0&&t.splice(i,1)},te=t=>{let e=t.length;for(let i=0;i{const e=Math.log(t);return t=>Math.log(t)/e},ie=ee(Math.E),se=(t,e)=>{const i=e[t];return i?i():void 0},re=(t,e)=>{let i;if(e)i=e;else{const e={x:0,y:0};for(let i=0;iyi(hi(t,i))-yi(hi(e,i))))},ne=(t,e,i)=>{if(0===t.length)return!1===i.canReturnB?e.slice():e;const s=e.length;if(s<1e5)return t.push.apply(t,e),t;for(let i=0;ii<0?t:i>1?e:E(t.getR()+i*(e.getR()-t.getR()),t.getG()+i*(e.getG()-t.getG()),t.getB()+i*(e.getB()-t.getB()),t.getA()+i*(e.getA()-t.getA())),he=t=>255===t.getA()?t:t.setA(255),ae=(()=>{const t=E(0,0,0);return i=>(i=he(i),new tt({shape:e.GradientShape.circle,extent:e.GradientExtent.farthestCorner,position:{x:.2,y:.8},stops:[{offset:0,color:i},{offset:1,color:oe(i,t,.5)}]}))})(),le=(()=>{const t=t=>{var e;if(t){if(Y(t)){if(0===t.getColor().getA())return;return t.getColor()}if(et(t)||rt(t)){const i=t.getColorStops();return 3===i.length?i[1].color:null===(e=i[0])||void 0===e?void 0:e.color}j(t)}};return(e,i,s,r)=>{const n=[];if(r.fill&&n.push(r.fill),r.fill2&&n.push(r.fill2),r.stroke){const t=r.stroke.getFillStyle();t!==z&&n.push(t)}if(r.point3D){const t=r.point3D;n.push(t.getFillStyle())}let o;if(r.behavior&&!0===r.behavior.colorStep){const[e,s]=n.reduce(((e,i)=>{if(e[0]&&e[1])return e;const s=t(i);return s&&(void 0===e[0]?e[0]=s:e[1]=s),e}),[void 0,void 0]);o=e&&s?(h=e)===(a=s)||h.getR()===a.getR()&&h.getG()===a.getG()&&h.getB()===a.getB()?ae(h):(h=he(h),a=he(a),new st({angle:0,stops:[{offset:0,color:a},{offset:.5,color:a},{offset:.5,color:h},{offset:1,color:h}]})):i.uiButtonFillStyle}else{const e=n.reduce(((e,i)=>e||t(i)),void 0);o=e?s?new G({color:e}):ae(e):i.uiButtonFillStyle}var h,a;e.setButtonOnFillStyle(o)}})(),ue=t=>{const e=t;if(j(e))return{lut:e.getPalette(),lookUpProperty:e.getLookUpProperty()}},ce=t=>{let e=0;return()=>(e+=1,`${t}-${e}`)},de=(t,e)=>{let i="string"==typeof t?t:String(t);const s=i.indexOf(".");let r=s>=0?s:i.length;for(;r"function"==typeof t?t(e):t,ge=t=>t.ctrlKey?Math.sign(t.deltaY)*Math.min(.05*Math.abs(t.deltaY),1):Math.sign(t.deltaY),me=(t,e)=>e(),ye=()=>new Error("LightningChart JS encountered an unexpected error.\nPlease report this issue to https://lightningchart.com/js-charts/docs/contact");new G({color:E(255,255,255,1)});const pe=t=>t===_e||t.min.x===_e.min.x&&t.max.x===_e.max.x&&t.min.y===_e.min.y&&t.max.y===_e.max.y,xe=t=>Array.from(new Set(t)),Se=t=>t.filter((t=>void 0!==t)),Ae=t=>"boolean"==typeof t?t?1:0:t>1?1:t<0?0:t,ve=(t,e,i)=>{e.length<=0||(t.setText(i.label).setOn(e[0].getVisible()),i.style&&t.setButtonOnFillStyle(i.style),i.toggleVisibilityOnClick&&t.onSwitch(((t,i)=>e.forEach((t=>t.setVisible(i))))),t.onMouseEnter((()=>e.forEach((t=>t.setHighlight(!0))))),t.onMouseLeave((()=>e.forEach((t=>t.setHighlight(!1))))),e.forEach((e=>e.onMouseEnter((()=>t.setHighlight(!0))))),e.forEach((e=>e.onMouseLeave((()=>t.setHighlight(!1))))),e.forEach((e=>e.onTouchStart((()=>t.setHighlight(!0))))),e.forEach((e=>e.onTouchEnd((()=>t.setHighlight(!1))))))},be=(t,e)=>{throw new Error(e)},Me=()=>{const t=K((()=>{}));let e;return(i,s,r,n)=>{const o=null==n?void 0:n.onStart,h=null==n?void 0:n.onCompleted,a=(null==n?void 0:n.easing)||$.ease,l=(null==n?void 0:n.durationMs)||1e3;let u;if(e)if(0===e.nextAnimations.length){const t=e.NextAnimation([[i,s]],(([i])=>{e=t,r(i)}),l,a);u=t}else{i=e.nextAnimations.pop().values[0][0];const t=e.NextAnimation([[i,s]],(([i])=>{e=t,r(i)}),l,a);u=t}else u=t(l,a)([[i,s]],(([t])=>{r(t)})),e=u;u.onAnimationEnd((()=>{e=void 0})),o&&u.onAnimationStart(o),h&&u.onAnimationEnd(h)}},Ee=t=>{let e;return()=>e||(e=t(),e)},Te=t=>{if(t===ot)return 0;const e=t.getThickness();return e<0?1:1*e},we=(t,e,i,s)=>{const r=`LightningChart JS Resources not found.\nresourcesBaseUrl: "${t}"\ninitiator: ${i}\nresource url: ${e}\nFor more information, please see https://lightningchart.com/js-charts/docs/troubleshooting/error-resources-not-found/`;if(s.shouldCrash)throw bt.alert(r),new Error(r);bt.console.warn(r)},ke=(t,e,i,s=0)=>{if(t{const t=new Map;return{wt:e=>(e.setMouseEnterEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Ct(e,i,s)})),e.setMouseLeaveEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.kt(e,i,s)})),e.setMouseClickEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Tt(e,i,s)})),e.setMouseDoubleClickEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Ft(e,i,s)})),e.setMouseDownEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.It(e,i,s)})),e.setMouseUpEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Pt(e,i,s)})),e.setMouseMoveEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Dt(e,i,s)})),e.setMouseDragEventHandler(((e,i,s,r,n,o)=>{const h=o&&t.get(o);h&&h.Bt(e,i,s,r,n,o)})),e.setMouseDragStartEventHandler(((e,i,s,r)=>{const n=r&&t.get(r);n&&n.Lt(e,i,s,r)})),e.setMouseDragStopEventHandler(((e,i,s,r,n)=>{const o=n&&t.get(n);o&&o.Rt(e,i,s,r,n)})),e.setMouseWheelEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Et(e,i,s)})),e.setTouchStartEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.zt(e,i,s)})),e.setTouchMoveEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Vt(e,i,s)})),e.setTouchEndEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Ot(e,i,s)})),e),Nt:(e,i)=>{t.set(e,i)},Gt:()=>{t.clear()}}},Re={left:0,right:0,top:0,bottom:0},Ie=()=>Math.round(Math.random()*Number.MAX_SAFE_INTEGER),Fe=(t,e,i)=>{e&&e.Wt();const s=i();return{Ut:t,Wt:()=>{s.forEach((e=>t.Yt(e)))}}},De={add:(t,e)=>f(t.x+e,t.y+e,t.z+e),addVec(t,...e){const i={x:t.x,y:t.y,z:t.z};for(const t of e)i.x+=t.x,i.y+=t.y,i.z+=t.z;return i},subtract:(t,e)=>f(t.x-e,t.y-e,t.z-e),subtractVec(t,...e){const i={x:t.x,y:t.y,z:t.z};for(const t of e)i.x-=t.x,i.y-=t.y,i.z-=t.z;return i},multiply:(t,e)=>f(t.x*e,t.y*e,t.z*e),divide:(t,e)=>f(t.x/e,t.y/e,t.z/e),multiplyVec(t,...e){const i={x:t.x,y:t.y,z:t.z};for(const t of e)i.x*=t.x,i.y*=t.y,i.z*=t.z;return i},divideVec(t,...e){const i={x:t.x,y:t.y,z:t.z};for(const t of e)i.x/=t.x,i.y/=t.y,i.z/=t.z;return i},length:t=>Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z),normalize:t=>De.divide(t,De.length(t)),dot:(t,e)=>t.x*e.x+t.y*e.y+t.z*e.z,cross:(t,e)=>f(t.y*e.z-t.z*e.y,t.z*e.x-t.x*e.z,t.x*e.y-t.y*e.x),angle:(t,e)=>Math.acos(De.dot(t,e)/(De.length(t)*De.length(e))),rotateAroundAxis(t,e,i){const s=Math.cos(i),r=Math.sin(i),n=De.dot(e,t),o=De.cross(e,t);return De.addVec(De.multiply(t,s),De.addVec(De.multiply(e,(1-s)*n),De.multiply(o,r)))},lerp:(t,e,i)=>(i=Rt(i,0,1),De.addVec(De.multiply(t,1-i),De.multiply(e,i))),equals:(t,e)=>Ct(t.x,e.x)&&Ct(t.y,e.y)&&Ct(t.z,e.z),abs:t=>({x:Math.abs(t.x),y:Math.abs(t.y),z:Math.abs(t.z)}),sign:t=>({x:Math.sign(t.x),y:Math.sign(t.y),z:Math.sign(t.z)})},Le=Number.MAX_SAFE_INTEGER,Ve=-Number.MAX_SAFE_INTEGER,_e=m(u(Le,Le),u(Ve,Ve)),Pe=m(f(Le,Le,Le),f(Ve,Ve,Ve)),Be=(t,e)=>{const i=Math.log(t)/Math.log(e);return Math.floor((t=>(Math.ceil(t)-t<1e-4?t=Math.ceil(t):t-Math.floor(t)<1e-4&&(t=Math.floor(t)),t))(i))},ze=(t,e)=>!(e.min.x>t.max.x||e.max.xt.max.y||e.max.y!(t[1].xe[1].x||t[3].ye[3].y),Ue=(t,e)=>m(u(Math.max(Math.min(t[0].x,t[2].x),Math.min(e[0].x,e[2].x)),Math.max(Math.min(t[0].y,t[2].y),Math.min(e[0].y,e[2].y))),u(Math.min(Math.max(t[0].x,t[2].x),Math.max(e[0].x,e[2].x)),Math.min(Math.max(t[0].y,t[2].y),Math.max(e[0].y,e[2].y)))),Oe=t=>{const e=t.length;for(let i=0;ie+t,Ye=(t,e,i)=>{const s=hi(e,t),r=s.x*s.x+s.y*s.y;if(0===r)return t;const n=hi(i,t),o=(n.x*s.x+n.y*s.y)/r;return o<=0?t:o>=1?e:u(t.x+o*s.x,t.y+o*s.y)},He=(t,e,i)=>i>e?t>=e&&t<=i:t>=i&&t<=e,Xe=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)},We=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return i*i+s*s},je=(t,e,i)=>oi(t,ni(hi(e,t),i)),$e=(t,e,i)=>De.addVec(t,De.multiply(De.subtractVec(e,t),i));function Ze(t){const e=t.length;if(e>0){let i=t[0].x,s=t[0].x,r=t[0].y,n=t[0].y;for(let o=0;oi&&(i=e.x),e.xr&&(r=e.y),e.y0){let i=t[0].x,s=t[0].x,r=t[0].y,n=t[0].y,o=t[0].z,h=t[0].z;for(let a=0;ai&&(i=e.x),e.xr&&(r=e.y),e.yo&&(o=e.z),e.z{const e={min:{x:Le,y:Le},max:{x:Ve,y:Ve}};for(const i of t)e.min.x=e.min.xi.max.x?e.max.x:i.max.x,e.min.y=e.min.yi.max.y?e.max.y:i.max.y;return e},qe=(t,e)=>m(f(t.min.xe.max.x?t.max.x:e.max.x,t.max.y>e.max.y?t.max.y:e.max.y,t.max.z>e.max.z?t.max.z:e.max.z));function Qe(t,e,i,s){const r=t.x-s.x,n=t.y-s.y,o=s.x-i.x,h=i.y-s.y,a=h*r+o*n,l=(s.y-e.y)*r+(e.x-s.x)*n,u=h*(e.x-s.x)+o*(e.y-s.y);return u<0?a<=0&&l<=0&&a+l>=u:a>=0&&l>=0&&a+l<=u}function ti(t,e,i){return u(Math.cos(i)*(t.x-e.x)+Math.sin(i)*(t.y-e.y)+e.x,-Math.sin(i)*(t.x-e.x)+Math.cos(i)*(t.y-e.y)+e.y)}function ei(t,e){return u(t.x-e.x,t.y-e.y)}function ii(t){const e=ri(t);return 0===e?u(0,0):u(t.x/e,t.y/e)}function si(t,e){let i={x:e.x-t.x,y:e.y-t.y};i=ii(i);const s=Math.PI/2,r=i.x;return i.x=-Math.sin(s)*i.y,i.y=r*Math.sin(s),i}function ri(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function ni(t,e){return u(t.x*e,t.y*e)}function oi(t,e){return u(t.x+e.x,t.y+e.y)}function hi(t,e){return u(t.x-e.x,t.y-e.y)}function ai(t,e){return u(t.x*e.x,t.y*e.y)}function li(t,e){return u(t.x/e.x,t.y/e.y)}function ui(t){return ni(t,-1)}function ci(t,e){return t.x*e.x+t.y*e.y}const di=(t,e,i)=>{const s=(i.y-e.y)/(i.x-e.x),r=e.y+(t-e.x)*s;return u(t,r)},fi=(t,e,i)=>{const s=(i.y-e.y)/(i.x-e.x),r=e.x+(t-e.y)/s;return u(r,t)};function gi(t){return t*Math.PI/180}function mi(t){return 180*t/Math.PI}function yi(t){return 180*Math.atan2(t.y,t.x)/Math.PI}function pi(t){return u(Math.cos(t),Math.sin(t))}function xi(t){let e=-1;const i=Math.cos(t),s=Math.sin(t);return i>0&&i<1&&s>0&&s<1?e=1:i<0&&i>-1&&s>0&&s<1?e=2:i<0&&i>-1&&s<0&&s>-1?e=3:i>0&&i<1&&s<0&&s>-1&&(e=4),e}const Si=(t,e,i,s)=>{let r,n,o,h;if(e.x-t.x!=0||s.x-i.x!=0)return e.x-t.x==0?(o=e.x,n=(s.y-i.y)/(s.x-i.x),h=n*(o-i.x)+i.y):s.x-i.x==0?(o=s.x,r=(e.y-t.y)/(e.x-t.x),h=r*(o-t.x)+t.y):(r=(e.y-t.y)/(e.x-t.x),n=(s.y-i.y)/(s.x-i.x),o=(i.y-n*i.x+r*t.x-t.y)/(r-n),h=r*(o-t.x)+t.y),u(o,h)},Ai=(t,e)=>{const i=t.length,s=e.length,r=new Uint16Array(i+s);return r.set(t,0),r.set(e,i),r};class vi{constructor(){this.Ht=!0}getInnerStart(){return this.$}getInnerEnd(){return this.X}getInnerInterval(){return Math.abs(this.X-this.$)}K(t,e){return this.Ht=t!==this.$||e!==this.X,this.$=t,this.X=e,this}Z(){return this.Ht=!1,this}J(){return this.Ht=!0,this}}class bi extends vi{constructor(t,e,i,s){if(super(),this.$t=!0,this.Xt=!0,this.jt=[0,0],this.Zt=!0,this.Qt=t,this.Jt=e,this.Kt=i,this.qt=t,this.ti=e,s){const t=s.N(this.ii.bind(this));this.ii(s._()),this.si=()=>s.W(t)}}tt(t){return this.j=t,this.Xt=!0,this}ei(t){return this.jt=t.map(Math.abs),this.Zt=!0,this}hi(){return this.Qt/this.Kt*this.j+this.jt[0]}ri(){return(this.Qt+this.Jt)/this.Kt*this.j-this.jt[1]}ni(){return this.getCellSize()-this.oi()}ai(){return this.j}getCellSize(){return this.li(this.j)}oi(){return this.jt[0]+this.jt[1]}ui(){return this.jt}ii(t){this.Kt=t.reduce(Ge,0),this.Qt=t.reduce(((t,e,i)=>i>=this.qt?t:t+e),0),this.Jt=t.reduce(((t,e,i)=>i>=this.qt&&iki;return!n&&!o||!!r&&(e>t?{start:n?wi:t,end:o?ki:e}:{start:o?ki:t,end:n?wi:e})}dt(t){const e=this.hi(),i=this.ri(),s=Math.max(t,wi);return e+(this.di.function(s)-this.fi.scaleStartLog)/this.fi.scaleIntervalLog*(i-e)}ct(t){const e=this.hi(),i=(t-e)/(this.ri()-e),s=this.fi.scaleStartLog+i*this.fi.scaleIntervalLog;return this.di.number**s}ci(){this.di&&this.Ai()}K(t,e){return super.K(t,e),this.di&&this.Ai(),this}ei(t){return super.ei(t),this.di&&this.Ai(),this}tt(t){return super.tt(t),this.di&&this.Ai(),this}gi(t){return this.di={internal:t,function:Ei(t),number:Ti(t)},this}pi(){return this.di.internal}mi(t,e){const i=this.dt(t)+e;return this.ct(i)}yi(){return this.Xt||this.Ht||this.Zt||this.$t}Ai(){const t=this.di.function(this.$),e=this.di.function(this.X)-t,i=2*this.hi()/this.j-1,s=2*this.ri()/this.j-1-i;return this.fi={scaleStartLog:t,scaleIntervalLog:e,viewportStart:i,viewportSize:s},this.fi}Si(){return this.fi}}const Ei=t=>"e"===t?ie:ee(t),Ti=t=>"e"===t?Math.E:t,wi=.9*10**-4,ki=1.1*10**25,Ci=[{prefix:"T",unit:10**12},{prefix:"B",unit:10**9},{prefix:"M",unit:1e6},{prefix:"K",unit:1e3}],Ri=(t,e,i)=>{const s=Math.abs(i-e),r=Math.max(2-Be(s,10),0);return t.toFixed(r)},Ii={Numeric:(t,e)=>Ri(t,e.getInnerStart(),e.getInnerEnd()),NumericUnits:(t,e)=>{const i=Math.abs(e.getInnerEnd()-e.getInnerStart()),s=t<0;t=Math.abs(t);let r="",n="";if(i>=1e3&&t>1e3){let e="";for(const i of Ci){const s=Math.round(1e3*t/i.unit)/1e3;if(s>=1){e=s.toString(),n=i.prefix;break}}r=(s?"-":"")+e}else{let e=String(Math.floor(t));const n=Be(t,1e3);for(let t=1;t<=n;t+=1){const i=e.length-(3*t+(t-1));e=`${e.substring(0,i)} ${e.substring(i,e.length)}`}r=(s?"-":"")+e+(i<=10?((t,e)=>{if(0===e)return"";let i=(Math.abs(t)-Math.abs(Math.floor(t))).toString().substring(1);return i.length>e&&(i=i.substring(0,e+1)),i})(t,2-Be(i,10)):"")}return r+=n,r},LogarithmicExponentsRounded:(t,e,i,s=10)=>{const r=Ei(s)(t);return`${s}${Fi(r)}`},LogarithmicExponents:(t,e,i,s=10)=>{const r=Ei(s),n=Math.floor(r(t)),o=t/Ti(s)**n;return`${Math.round(o)}×${s}${Fi(n)}`},LogarithmicExtreme:(t,e,i,s=10)=>{const r=Ei(s),n=Math.floor(r(t));return`${(t/Ti(s)**n).toFixed(2)}×${s}${Fi(n)}`},LogarithmicNoExponents:(t,e,i,s=10)=>{const r=Ei(s);if("e"===s)return`${Math.floor(r(t))}e`;const n=t.toString();if(t>1)return n;const o=Math.floor(r(t));return t.toFixed(Math.abs(o))}},Fi=t=>Math.round(t).toString().split("").map((t=>{switch(t){case"0":return"⁰";case"1":return"¹";case"2":return"²";case"3":return"³";case"4":return"⁴";case"5":return"⁵";case"6":return"⁶";case"7":return"⁷";case"8":return"⁸";case"9":return"⁹";case"-":return"⁻";default:return t}})).join("");class Di extends bi{constructor(t,e,i,s){super(t,e,i,s),this.vi=!1,this.xi=!1,this.bi=0,this.j=1e3,this.K(0,10),this.q()}yi(){return this.xi}ot(t,e,i,s,r){if(t===e)return!1;const n=Math.abs(s-i),o=Math.abs(e-t);if(!this.vi){const i=((t,e,i)=>{const s=((t,e)=>{if(eVe&&tVe){const i=Math.abs(t/2**23),s=Math.abs(e/2**23),r=Math.min(i,s);return 10**Math.floor(Math.log10(r))}})(t,e);if(void 0!==s)return s*i})(t,e,this.getCellSize());if(void 0===i)return!1;if(o>i)return!0;const s=(e+t)/2,h=(r?i/2:n/2)*(t>e?-1:1);return{start:s-h,end:s+h}}const h=10**-(12-Math.log10(Math.max(Math.abs(t),1)));if(o>h)return!0;const a=(e+t)/2,l=(r?h/2:n/2)*(t>e?-1:1);return{start:a-l,end:a+l}}ci(){this.q()}dt(t){return this.hi()+(t-this.$)/(this.X-this.$)*(this.ri()-this.hi())}ct(t){return this.$+(t-this.hi())/(this.ri()-this.hi())*(this.X-this.$)}K(t,e){return super.K(t,e),this.q(),this}ei(t){return super.ei(t),this.q(),this}tt(t){return super.tt(t),this.Mi=Li(this.X-this.$,this.jt,this.j,this.Jt,this.Kt),this.q(),this}_i(){return this.vi=!0,this}wi(){return this.vi}Ci(){return Math.abs(this.ki)}Ti(){return this.Ci()/this.Mi}Fi(){return this.Ii}Pi(){return this.Di}getPixelSize(){return this.Mi}Si(){return this.fi}J(){return super.J(),this.xi=!0,this}Z(){return super.Z(),this.xi=!1,this}Bi(t,e=Ii.Numeric){return e(t,this)}Li(){const t=Math.abs(this.getInnerEnd()).toString().length,e=Math.abs(this.getInnerStart()).toString().length;return t>e?t:e}Ri(t){return Li(t,this.jt,this.j,this.Jt,this.Kt)}q(){let t=this.$,e=this.X,i=0;this.vi&&(t=0,e=this.X-this.$,i=this.$);const s=e-t,r=Li(s,this.jt,this.j,this.Jt,this.Kt);this.Di=t-this.jt[0]*r,this.Ii=e+this.jt[1]*r;const n=this.Ii-this.Di,o=n-this.ki,h=Math.abs(o/r),a=s-this.bi,l=Math.abs(a/r);(!this.fi||h>=.4||l>=.4)&&(this.bi=s,this.ki=n,this.Mi=r,this.xi=!0);const u=this.ki*this.Kt/(2*this.Jt),c=-(this.Di-this.ki*this.Qt/this.Jt)-u,d=2*this.hi()/this.j-1,f=2*this.ri()/this.j-1-d;this.fi={displacement:c,scaling:u,highPrecisionOffset:i,viewportStart:d,viewportSize:f,scaleStartLog:0,scaleIntervalLog:0}}mi(t,e){return t+this.Mi*e}}const Li=(t,e,i,s=1,r=1)=>t/(i*s/r-(e[0]+e[1]));class Vi{Ei(t,e){return"x"in t?(this.x=t.x,this.y=t.y):(this.x=t,this.y=e),this}Z(){return this.x.Z(),this.y.Z(),this}J(){return this.x.J(),this.y.J(),this}tt(t,e){return"object"==typeof t?(this.x.tt(t.x),this.y.tt(t.y)):(this.x.tt(t),this.y.tt(e)),this}ai(){return u(this.x.ai(),this.y.ai())}zi(t){return this.x.ei(t),this}Vi(t){return this.y.ei(t),this}oi(){return u(this.x.oi(),this.y.oi())}Oi(t,e){return this.x.K(t,e),this}Ni(t,e){return this.y.K(t,e),this}getInnerIntervalPixels(){const t=this.x.getCellSize(),e=this.y.getCellSize();return{x:t-this.x.oi(),y:e-this.y.oi()}}Gi(){return this.x.yi()||this.y.yi()}}class _i extends Vi{constructor(){super(...arguments),this.Wi="LinearScaleXY"}ut(t,e,i,s){return this.x=new Di(t.x,e.x,i.x,s?s.x:void 0),this.y=new Di(t.y,e.y,i.y,s?s.y:void 0),this}wi(){return this.x.wi()||this.y.wi()}Ui(){return u(this.x.getPixelSize(),this.y.getPixelSize())}Si(){return{x:this.x.Si(),y:this.y.Si()}}mi(t,e){const i=this.Ui();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}Yi(t,e,i,s){const r=this.Ui(),n=si(t,e);return n.x*=s,n.y*=s,{x:t.x+i*r.x*n.x,y:t.y+i*r.y*n.y}}}class Pi extends Vi{constructor(){super(...arguments),this.Wi="MixedScaleXY"}wi(){return!1}mi(t,e){const i=this.x.dt(t.x),s=this.y.dt(t.y),r={x:i+e.x,y:s+e.y};return{x:this.x.ct(r.x),y:this.y.ct(r.y)}}Yi(t,e,i,s){const r={x:this.x.dt(t.x),y:this.y.dt(t.y)},n={x:this.x.dt(e.x),y:this.y.dt(e.y)},o=ii(hi(n,r)),h=si(n,r),a={x:r.x+o.x*s+h.x*i,y:r.y+o.y*s+h.y*i};return{x:this.x.ct(a.x),y:this.y.ct(a.y)}}Si(){const t=this.x.Si(),e=this.y.Si();return{uScaleStart:[this.x.$,this.y.$],uScaleInterval:[this.x.getInnerInterval(),this.y.getInnerInterval()],uScaleStartLog:[t.scaleStartLog,e.scaleStartLog],uScaleIntervalLog:[t.scaleIntervalLog,e.scaleIntervalLog],uViewportStart:[t.viewportStart,e.viewportStart],uViewportSize:[t.viewportSize,e.viewportSize]}}}const Bi=(t,e)=>t instanceof Mi||e instanceof Mi?(new Pi).Ei(t,e):(new _i).Ei(t,e),zi=t=>"client"===t,Ni=t=>!!(t&&"object"==typeof t&&"clientX"in t&&"number"==typeof t.clientX&&"clientY"in t&&"number"==typeof t.clientY),Ui=t=>"relative"===t,Oi=t=>!!(t&&"object"==typeof t&&"x"in t&&"number"==typeof t.x&&"y"in t&&"number"==typeof t.y);var Gi;e.HighlightModes=void 0,(Gi=e.HighlightModes||(e.HighlightModes={}))[Gi.noHighlighting=0]="noHighlighting",Gi[Gi.onHover=1]="onHover";class Yi{constructor(t,i,s,n){this.Hi=!0,this.$i=e.HighlightModes.onHover,this.Xi=!1,this.ji=!0,this.Zi=!1,this.L=new r.Eventer,this.Qi=[],this.Ji=[],this.onMouseEnter=t=>this.L.on("mouseEnter",t),this.onMouseLeave=t=>this.L.on("mouseLeave",t),this.onMouseClick=t=>this.L.on("mouseClick",t),this.onMouseDoubleClick=t=>this.L.on("mouseDoubleClick",t),this.onMouseDown=t=>this.L.on("mouseDown",t),this.onMouseUp=t=>this.L.on("mouseUp",t),this.onMouseMove=t=>this.L.on("mouseMove",t),this.offMouseEnter=t=>this.L.off(t,"mouseEnter"),this.offMouseLeave=t=>this.L.off(t,"mouseLeave"),this.offMouseClick=t=>this.L.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.L.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.L.off(t,"mouseDown"),this.offMouseUp=t=>this.L.off(t,"mouseUp"),this.offMouseMove=t=>this.L.off(t,"mouseMove"),this.offMouseDragStart=t=>this.L.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.L.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.L.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.L.off(t,"mouseWheel"),this.Ct=(t,i,s)=>{this.L.emit("mouseEnter",this,i),this.Zi=!0,this.$i===e.HighlightModes.onHover&&this.setHighlight(!0)},this.kt=(t,i,s)=>{this.L.emit("mouseLeave",this,i),this.Zi=!1,this.$i===e.HighlightModes.onHover&&this.setHighlight(!1)},this.Dt=(t,e,i)=>{this.L.emit("mouseMove",this,e)},this.Tt=(t,e,i)=>this.L.emit("mouseClick",this,e),this.Ft=(t,e,i)=>this.L.emit("mouseDoubleClick",this,e),this.It=(t,e,i)=>this.L.emit("mouseDown",this,e),this.Pt=(t,e,i)=>this.L.emit("mouseUp",this,e),this.Lt=(t,e,i,s)=>{this.L.emit("mouseDragStart",this,e,i)},this.Bt=(t,e,i,s,r,n)=>{this.L.emit("mouseDrag",this,e,i,s,r)},this.Rt=(t,e,i,s,r)=>{this.L.emit("mouseDragStop",this,e,i,s)},this.Et=(t,e,i)=>{this.L.emit("mouseWheel",this,e)},this.zt=(t,i,s)=>{this.L.emit("touchStart",this,i),this.Zi=!0,this.$i===e.HighlightModes.onHover&&this.setHighlight(!0)},this.Vt=(t,e,i)=>{this.L.emit("touchMove",this,e)},this.Ot=(t,i,s)=>{this.L.emit("touchEnd",this,i),this.Zi=!1,this.$i===e.HighlightModes.onHover&&this.setHighlight(!1)},this.Ki=t,this.qi=i,this.ts=s,this.ss=new Map,this.es=n,this.hs=this.es.rs(this,{ns:{themeEffectEnabled:this.ts.effectsText},os:{}}),this.Ki.cs.us.ls(this,(t=>{this.ss.forEach(((e,i)=>i.ds(t))),this.Ji.forEach((e=>e.setHighlight(t))),this.Qi.forEach((e=>e.ds(t)))}),{animationEnabled:this.Ki.getAnimationsEnabled()})}fs(t,e){const i=void 0===(null==e?void 0:e.setEventHandlers)||e.setEventHandlers,s=void 0!==(null==e?void 0:e.isText)&&e.isText;this.ss.set(t,{isText:s});const r=Array.from(this.ss);this.hs.ns.As(r.filter((t=>t[1].isText)).map((t=>t[0]))),this.hs.os.As(r.filter((t=>!t[1].isText)).map((t=>t[0]))),t.setMouseInteractions(this.Hi).setVisible(this.ji).ds(this.Ki.cs.us.gs(this,!0)),i&&t.setMouseEnterEventHandler(this.Ct).setMouseLeaveEventHandler(this.kt).setMouseClickEventHandler(this.Tt).setMouseDoubleClickEventHandler(this.Ft).setMouseDownEventHandler(this.It).setMouseUpEventHandler(this.Pt).setMouseMoveEventHandler(this.Dt).setMouseDragStartEventHandler(this.Lt).setMouseDragEventHandler(this.Bt).setMouseDragStopEventHandler(this.Rt).setMouseWheelEventHandler(this.Et).setTouchStartEventHandler(this.zt).setTouchMoveEventHandler(this.Vt).setTouchEndEventHandler(this.Ot);const n=t.onDispose((()=>{t.offDispose(n),this.ss.delete(t)}))}ps(t){this.Qi=t;const e=this.Ki.cs.us.gs(this,!0);t.forEach((t=>{t.ds(e).ys(this.ji)}))}setEffect(t){return this.hs.ns.Ss(t&&this.ts.effectsText),this.hs.os.Ss(t),this.Ki.cs.vs(),this}getEffect(){return this.hs.ns.xs()||this.hs.os.xs()}onHighlight(t){return this.L.on("highlight",t)}offHighlight(t){return this.L.off(t)}setIcon(t){return this.bs=t,this.Ki.cs.vs(),this}getIcon(){return this.bs}setName(t){return this.Ms=t,this.Ji.forEach((t=>t.setText(this.Ms))),this}getName(){return this.Ms}dispose(){return this.Xi||(this.Xi=!0,this.ss.forEach(((t,e)=>e.dispose())),this.qi(this),this.Ji.forEach((t=>{t.dispose()})),this.Ji.length=0,this.L.emit("dispose",this),this.Ki.cs.vs()),this}setVisible(t){return t===this.ji||(this.ji=t,this.ss.forEach(((e,i)=>i.setVisible(t))),this.Qi.forEach((e=>e.ys(t))),this.Ji.forEach((e=>e.setOn(t))),this.L.emit("visibleStateChanged",this,this.ji),this.Ki.cs.vs()),this}getVisible(){return this.ji}onVisibleStateChanged(t){return this.L.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.L.off(t,"visibleStateChanged")}setHighlight(t){return this.Ki.cs.us._s(this,t),this.L.emit("highlight",this,t),this}getHighlight(){return this.Ki.cs.us.gs(this)}setAnimationHighlight(t){return this.Ki.cs.us.ws(this,t),this}getAnimationHighlight(){return this.Ki.cs.us.Cs(this)}setMouseInteractions(t){return this.Hi=t,this.ss.forEach(((e,i)=>i.setMouseInteractions(t))),this.Ki.cs.vs(),this}getMouseInteractions(){return this.Hi}getIsUnderMouse(){return this.Zi}setHighlightOnHover(t){return this.$i=t?e.HighlightModes.onHover:e.HighlightModes.noHighlighting,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.$i!==e.HighlightModes.noHighlighting}attach(t,e=!0,i=!1){return ve(t,[this],{toggleVisibilityOnClick:e,label:this.Ms,style:void 0}),this.Ji.push(t),t.onDispose((()=>{const e=this.Ji.indexOf(t);e>=0&&this.Ji.splice(e,1)})),this}ks(){return this.bs}onMouseDragStart(t){return this.L.on("mouseDragStart",t)}onMouseDrag(t){return this.L.on("mouseDrag",t)}onMouseDragStop(t){return this.L.on("mouseDragStop",t)}onMouseWheel(t){return this.L.on("mouseWheel",t)}onTouchStart(t){return this.L.on("touchStart",t)}onTouchMove(t){return this.L.on("touchMove",t)}onTouchEnd(t){return this.L.on("touchEnd",t)}isDisposed(){return this.Xi}onDispose(t){return this.L.on("dispose",t)}offTouchStart(t){return this.L.off(t,"touchStart")}offTouchMove(t){return this.L.off(t,"touchMove")}offTouchEnd(t){return this.L.off(t,"touchEnd")}offDispose(t){return this.L.off(t,"dispose")}}class Hi extends Yi{constructor(t,e,i,s,r,n,o,h){super(e,i,o,h),this.Ts=t,this.axis=s,this.ft=r,this.Fs=n,this.Is()}}const Xi=t=>{const e=t.length;if(e>0){let i=0,s=0;for(let r=0;r{const e=t.length,i=new Array(e).fill(!1),s=(s,r)=>{for(let n=0;n=this.Rs?(this.Ls.splice(t,1),t-=1):this.Ls[t].state&&(s=!0);return this.Bs?0===e.interactions.length&&(this.Ls.push({state:!1,time:i}),this.Bs=!1):1===e.interactions.length&&"pointerdown"===e.type&&(this.Ls.push({state:!0,time:i}),s=!0,this.Bs=!0),s}Ds(t,e,i){if(i){const i=this.Ls.reduce(((t,e)=>(e.state?t.on+=1:t.off+=1,t)),{on:0,off:0});i.on>=2&&i.off>=1&&(this.Es(t,e),this.Ls.length=0)}}},$i=class{constructor(t,e,i,s=1,r=100){this.zs=t,this.Vs=e,this.Os=i,this.Ns=s,this.Gs=r}Ps(t,e){const i=e.interactions.length;if(i===this.Ns){if(void 0!==this.Ws)return!0;if("pointerdown"===e.type&&(1===i||(t=>{const e=t.length;if(e>0){const i=Xi(t);let s=0;for(let r=0;r!(!t||"object"!=typeof t||!("lineType"in t)||"solid"!==t.lineType);class Qi{constructor(t,e){this.Xs=t,this.js=e,this.Zs=e.rows*Rs,this.Qs=e.columns*Is}}var ts,es;e.OnScreenMenuButtonType=void 0,(ts=e.OnScreenMenuButtonType||(e.OnScreenMenuButtonType={}))[ts.ZoomIn=0]="ZoomIn",ts[ts.ZoomInX=1]="ZoomInX",ts[ts.ZoomInY=2]="ZoomInY",ts[ts.ZoomOut=3]="ZoomOut",ts[ts.ZoomOutX=4]="ZoomOutX",ts[ts.ZoomOutY=5]="ZoomOutY",ts[ts.ZoomToFit=6]="ZoomToFit",ts[ts.ToggleAnimations=7]="ToggleAnimations",e.OnScreenMenuButtonShape=void 0,(es=e.OnScreenMenuButtonShape||(e.OnScreenMenuButtonShape={}))[es.Circle=0]="Circle",es[es.Rectangle=1]="Rectangle",es[es.RoundedRectangle=2]="RoundedRectangle";const is={x:-43,y:0},ss={x:-65,y:0},rs={x:-86,y:0},ns={x:-107,y:-1},os={x:-128,y:-3},hs={x:-150,y:0},as={x:-171,y:0},ls={x:-276,y:0},us={x:-298,y:0},cs={x:0,y:0},ds={x:-21,y:0};class fs extends Qi{constructor(t,e,i,s){super(t,i),this.Js=bt.document.createElement("button"),this.Ks=bt.document.createElement("div"),this.qs=bt.document.createElement("label"),this.js=i,this.te=e,this.Ki=s}ie(t,e,i,s){this.se(t,s),this.ee(),this.he(e),this.re(),this.qs.textContent=i||"";const r=bt.document.createElement("div");this.ne(r),this.Js.onclick=this.onClick.bind(this),r.appendChild(this.Ks),r.appendChild(this.qs),this.Js.appendChild(r)}re(){this.Js.style.cursor="pointer"}ne(t){t.style.display="flex",t.style.justifyContent="center",t.style.alignContent="center",t.style.flexDirection="column"}he(t){"string"==typeof t?(this.Ks.style.backgroundImage=`url(${t})`,this.Ks.style.backgroundSize="100%",this.Ks.style.backgroundRepeat="no-repeat",this.Ks.style.backgroundPosition="center",this.Ks.style.width="20px",this.Ks.style.height="20px"):this.applyStyleForSprite(t),this.Ks.style.margin="auto"}ee(){switch(this.te){case e.OnScreenMenuButtonShape.RoundedRectangle:this.Js.style.borderRadius="10px";break;case e.OnScreenMenuButtonShape.Rectangle:this.Js.style.borderRadius="0px";break;case e.OnScreenMenuButtonShape.Circle:default:this.Js.style.borderRadius="31px"}}se(t,e){this.Js.style.width=`${this.Qs.toString()}px`,this.Js.style.height=`${this.Zs.toString()}px`,this.Js.style.backgroundColor=t,this.Js.style.opacity=e||Fs,this.Js.style.alignItems="center",this.Js.style.border="2px solid #707070",this.Js.style.transition="background-color .8s ease"}applyStyleForSprite(t){this.Ks.style.backgroundImage=`url(${this.Xs}/${Ds})`,this.Ks.style.backgroundPositionX=`${t.x}px`,this.Ks.style.backgroundPositionY=`${t.y}px`,this.Ks.style.backgroundSize="1600%",this.Ks.style.backgroundRepeat="no-repeat",this.Ks.style.width="20px",this.Ks.style.height="20px"}oe(t){return t.appendChild(this.Js),t}ae(){return this.Js}}class gs extends fs{constructor(t,e,i,s){super(t,e,i,s),this.le="",this.ue="",this.ce=!1,this.Ki=s}de(){this.fe(),this.onToggledStateAction()}Ae(){this.ge(),this.onInitialStateAction()}ge(){this.pe(this.le)}fe(){this.pe(this.ue)}pe(t){"string"==typeof t?this.Ks.style.background=t:(this.Ks.style.backgroundImage=`url(${this.Xs}/${Ds})`,this.Ks.style.backgroundPositionX=`${t.x}px`,this.Ks.style.backgroundPositionY=`${t.y}px`)}onClick(){this.ce?this.Ae():this.de(),this.ce=!this.ce}}class ms extends fs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),is)}onClick(){const t=this.Ki.me();t&&this.Ki.zoom(t,{x:-1,y:-1})}}class ys extends fs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),ns)}onClick(){const t=this.Ki.me();t&&this.Ki.zoom(t,{x:-1,y:0})}}class ps extends fs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),hs)}onClick(){const t=this.Ki.me();t&&this.Ki.zoom(t,{x:0,y:-1})}}class xs extends fs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),ss)}onClick(){const t=this.Ki.me();t&&this.Ki.zoom(t,{x:1,y:1})}}class Ss extends fs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),os)}onClick(){const t=this.Ki.me();t&&this.Ki.zoom(t,{x:1,y:0})}}class As extends fs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),as)}onClick(){const t=this.Ki.me();t&&this.Ki.zoom(t,{x:0,y:1})}}class vs extends gs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.le=ls,this.ue=us,this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),this.le)}onToggledStateAction(){this.Ki.setAnimationsEnabled(!1)}onInitialStateAction(){this.Ki.setAnimationsEnabled(!0)}}class bs extends fs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),rs)}onClick(){this.Ki.forEachAxis((t=>{t.fit(!0)}))}}class Ms extends fs{constructor(t,e,i){super(t,e.shape||Ls,e.dimensions||{rows:1,columns:1},i);const s=i.getTheme(),r=e.color||s.onScreenMenuBackgroundColor.toRGBAString(),n=e.icon||"",o=e.label||"",h=e.opacity||"";this.ie(r,n,o,h),this.ye=e.action}onClick(){this.ye(this.Ki)}}class Es extends gs{constructor(t,e,i,s){super(t,e,{rows:1,columns:1},i),this.Ki=i,this.Se=s,this.le=ds,this.ue=cs,this.ie(Vs,this.le)}ge(){this.pe(this.le),this.Js.style.backgroundColor=Vs,this.Js.style.border="2px solid #707070",this.Js.style.margin="0px"}fe(){this.pe(this.ue),this.Js.style.background="#FECC00 0% 0% no-repeat padding-box",this.Js.style.border="10px solid #BCBCBC12",this.Js.style.margin="1px"}onToggledStateAction(){var t;null===(t=this.Se)||void 0===t||t.style.setProperty("display","block")}onInitialStateAction(){var t;null===(t=this.Se)||void 0===t||t.style.setProperty("display","none")}}var Ts;e.MouseStyles=void 0,(Ts=e.MouseStyles||(e.MouseStyles={})).Move="move",Ts.ResizeColumn="col-resize",Ts.ResizeRow="row-resize",Ts.Horizontal="ew-resize",Ts.Vertical="ns-resize",Ts.NorthWest="nw-resize",Ts.NorthEast="ne-resize",Ts.Copy="copy",Ts.CrossHair="crosshair",Ts.Default="default",Ts.Help="help",Ts.Restricted="not-allowed",Ts.None="none",Ts.Point="pointer",Ts.Text="text",Ts.Wait="wait",Ts.ZoomIn="zoom-in",Ts.ZoomOut="zoom-out";const ws={LeftBottom:u(-1,-1),CenterBottom:u(0,-1),RightBottom:u(1,-1),LeftCenter:u(-1,0),Center:u(0,0),RightCenter:u(1,0),LeftTop:u(-1,1),CenterTop:u(0,1),RightTop:u(1,1)},ks=new G({color:E(255,255,255,0)}),Cs=new Ji({thickness:1,fillStyle:ks}),Rs=60,Is=60,Fs="1.0",Ds="osm/osm-sprite-transparent.png",Ls=e.OnScreenMenuButtonShape.Circle,Vs="#363636";var _s;e.OSMPosition=void 0,(_s=e.OSMPosition||(e.OSMPosition={}))[_s.TopRight=0]="TopRight",_s[_s.TopLeft=1]="TopLeft",_s[_s.BottomLeft=2]="BottomLeft",_s[_s.BottomRight=3]="BottomRight";class Ps extends Hi{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this.Ms="Band",this.ve=0,this.xe=0,this.be=this.ts.bandFillStyle,this.Me=this.ts.bandStrokeStyle,this._e=!0,this.we=this.Ts.Te(this.ft).ke(this.be).Ce(this.Me).ds(this.getHighlight()),this.fs(this.we)}setValueStart(t){return this.ve=t,this.L.emit("valueChange",this,this.ve,this.xe),this.Ts.vs(),this}getValueStart(){return this.ve}setValueEnd(t){return this.xe=t,this.L.emit("valueChange",this,this.ve,this.xe),this.Ts.vs(),this}getValueEnd(){return this.xe}setFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;return this.we.ke(e),this.Ts.vs(),this}getFillStyle(){return this.be}setStrokeStyle(t){this.Me="function"==typeof t?t(this.Me):t;const e=this.Me;return this.we.Ce(e),this.Ts.vs(),this}getStrokeStyle(){return this.Me}onValueChange(t){return this.L.on("valueChange",t)}offValueChange(t){return this.L.off(t,"valueChange")}Fe(){return this.we.Ie(this.Fs.toVec2(this.ve,this.Fs.getHeight(this.ft).getInnerStart())).tt(this.Fs.toVec2(this.xe-this.ve,this.Fs.getHeight(this.ft).getInnerInterval())),this}attach(t,e=!0,i=!1){return super.attach(t,e),le(t,this.ts,i,{fill:this.be,stroke:this.Me}),this}Pe(t,e){t.ds(e),this.Ts.vs()}setDefaultMouseInteractions(t){return this._e=t,this}Is(){let t,i;const s=(e,s)=>{if(!this._e)return;const r=dt(this.Ts.cs.De(s.x,s.y),this.Ts.cs.ft,this.ft),n=this.Fs.getWidth(r),o=this.axis.ft.dt(this.ve),h=this.axis.ft.dt(this.xe),a=(this.axis.ft.dt(n)-o)/(h-o);t=!(a<.1||a>.9),!1===t&&(i=a<.5)},r=(e,s,r,n,o)=>{if(!this._e)return;const h=this.Fs.getWidth(n);t?(this.ve=this.axis.ft.mi(this.ve,h),this.xe=this.axis.ft.mi(this.xe,h)):i?this.ve=this.axis.ft.mi(this.ve,h):this.xe=this.axis.ft.mi(this.xe,h),Zt(o),this.L.emit("valueChange",this,this.ve,this.xe),this.Ts.vs()};this.onMouseMove(((i,r)=>{if(!this._e)return;s(0,u(r.clientX,r.clientY));const n=t?e.MouseStyles.Point:this.Fs.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Be=this.Ki.engine.setMouseStyle(n,this.Be)})),this.onMouseLeave((()=>{this._e&&(this.Ki.engine.restoreMouseStyle(this.Be),this.Be=void 0)})),this.onMouseDrag(((t,e,i,s,n)=>{this._e&&0===i&&r(0,0,0,n,e)}));const n=Wi(new $i(s,r));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd)}}class Bs extends Hi{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this.Ms="Constant Line",this.S=0,this.Me=this.ts.constantLineStrokeStyle,this.Le=!0,this._e=!0,this.Re=this.Ts.ze(this.ft).Ee(this.Me).ds(this.getHighlight()),this.fs(this.Re)}setValue(t){return this.S=t,this.L.emit("valueChange",this,this.S),this.Ts.vs(),this}getValue(){return this.S}setStrokeStyle(t){this.Me="function"==typeof t?t(this.Me):t;const e=this.Me;return this.Re.Ee(e),this.Ts.vs(),this}getStrokeStyle(){return this.Me}setInteractionMoveByDragging(t){return this.Le=t,this}getInteractionMoveByDragging(){return this.Le}onValueChange(t){return this.L.on("valueChange",t)}offValueChange(t){return this.L.off(t,"valueChange")}Fe(){return this.Re.Oe(this.Fs.toVec2(this.S,this.Fs.getHeight(this.ft).getInnerStart())).Ve(this.Fs.toVec2(this.S,this.Fs.getHeight(this.ft).getInnerEnd())),this}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{stroke:this.Me}),this}Pe(t,e){t.ds(e),this.Ts.vs()}setDefaultMouseInteractions(t){return this._e=t,this}Is(){const t=(t,e)=>{this._e&&this.Le&&(this.S=this.axis.ft.mi(this.S,this.Fs.getWidth(e)),this.L.emit("valueChange",this,this.S),this.Ts.vs(),Zt(t))};this.onMouseMove((()=>{if(this._e&&this.Le){const t=this.Fs.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Be=this.Ki.engine.setMouseStyle(t,this.Be)}})),this.onMouseLeave((()=>{this._e&&this.Le&&(this.Ki.engine.restoreMouseStyle(this.Be),this.Be=void 0)})),this.onMouseDrag(((e,i,s,r,n)=>{this._e&&this.Le&&0===s&&t(i,n)}));const i=Wi(new $i(void 0,((e,i,s,r,n)=>t(n,r))));this.onTouchStart(i.onTouchStart),this.onTouchMove(i.onTouchMove),this.onTouchEnd(i.onTouchEnd)}}const zs={fitting:{start:(t,e,i,s)=>e>=t?i:s,end:(t,e,i,s)=>e>=t?s:i,allowIntervalLengthChange:!0},expansion:{start:(t,e,i,s)=>e>=t?it?s:t,end:(t,e,i,s)=>e>=t?s>e?s:e:ie>t?zs.progressive.end(t,e,i,s)+(t-e):s>t?s:t,end:(t,e,i,s)=>e>t?s>e?s:e:zs.progressive.start(t,e,i,s)+(e-t),allowIntervalLengthChange:!1},regressive:{start:(t,e,i,s)=>e>t?ie>t?zs.regressive.start(t,e,i,s)+(e-t):ivoid 0!==t.Ne,Os=t=>void 0!==t.Ge,Gs={We:Ii.Numeric},Ys=(t,e)=>[t,e],Hs=(t,e,i,s)=>{const r=[],n=Math.round(Math.abs((t-e)/i));for(let o=1;o{Ct(t,0)&&(t=0),Ct(e,0)&&(e=0);const n=[];let o=void 0!==s?((t,e,i)=>t-(t-i)%e)(t,i,s):t;if(i<=0)throw new Error(`_getRegularGreatKeyValues unit less than or equal to 0, unit: ${i}`);for(;o{const r=[];let n=i(t),o=0;for(;n1e3)throw new Error("Infinite loop in Axis tick key values logic.");return r.push(n),r},js=(t,...e)=>{const i=e.length>0?e.length:t?1:0;return(s,r,n,o,h,a)=>{if(r>=i)return;const l=e[r]||1;let u=!1,c=!1,d=1;return t&&(u="ignore"in t?"first"===t.ignore||"both"===t.ignore:u,c="ignore"in t?"last"===t.ignore||"both"===t.ignore:c,d="offset"in t&&void 0!==t.offset?t.offset:d),((t,e,i,s,r)=>(i&&(t=t.filter(((t,e)=>e>0))),s&&(t=t.filter(((e,i)=>i(i+r)%e==0))))(s,l,u,c,d)}},$s=(...t)=>{const e=t.length>0?t.length:0;return(i,s,r,n,o,h)=>{if(s>=e)return;const a=t[s]||1;return i.filter(((t,e)=>e%a==0))}},Zs=(t,e)=>{if(e.has(t))return e.get(t);const i=Ze(t.Ye.Ue());if(pe(i))return i;const s=t.He.mi(i.min,{x:-5,y:-5}),r=t.He.mi(i.min,{x:5,y:5}),n=t.He.mi(i.max,{x:-5,y:-5}),o=t.He.mi(i.max,{x:5,y:5}),h={min:{x:Math.min(s.x,r.x,n.x,o.x),y:Math.min(s.y,r.y,n.y,o.y)},max:{x:Math.max(s.x,r.x,n.x,o.x),y:Math.max(s.y,r.y,n.y,o.y)}};return e.set(t,h),h},Ks=t=>{const e=new Map;if(t!==Gs){for(const i of t.$e)e.set(i,new Map);for(const i of t.Xe)e.set(i,new Map)}return e};class Js{constructor(t,e,i,s,n,o,h){this.L=new r.Eventer,this.je=Gs,this.Ze=Ns.Empty,this.Qe=new Map,this.Je=new Map,this.Ke=zs.fitting,this.qe=!0,this.th=K((()=>this.chart.cs.vs()))(300,$.linear),this.ih=!0,this.ji=!0,this.sh=!1,this.eh=Ve,this.hh=!1,this.rh=!1,this.oh=Ve,this.ah=Ve,this.lh=Ve,this.uh=!1,this.dh=()=>{this.sh||void 0===this.Ke||this.chart.cs.vs(!0)},this.fh={},this.Ah=(t,e,i,s,r,n)=>{const o=[],h=[];for(const a of t){if(as){o.push(a);continue}const t=this.Qe.get(e),l=(t?t.get(a):void 0)||this.gh(a,e);l.ph=!1;const u=this.mh(l,r);n.set(l,u),o.push(a),h.push(l)}return{displayedKeyValues:o,createdTicks:h}},this.yh=(t,e,i,s,r,n,o,h,a,l,u)=>{const c=[];for(let d=0;dvoid 0!==t)).filter((e=>e.xh!==i||!!t.find((t=>t===e)))).map((t=>ze(e,Zs(t,a))?t:void 0)),m=p.some((t=>void 0!==t))}else m=!1;if(m){let t=!0;const e=p.filter((t=>void 0!==t));if(t&&e.every((t=>Us(t.xh)))&&(t=!1),t&&i.bh&&i.bh.Mh&&!1===i.bh.Mh(g,s,r,n,o,h)&&(t=!1),!1===t)continue;return!0}c.push(f)}return c},this.formatValue=t=>this.je.We(t,this.ft),this._h=!0,this.wh=!0,this.chart=t,this.Ch=e,this.ts=s,this.kh=o,this.ft=i,this.Th=h,"logarithmic"===h.type&&this.setAnimationZoom($.logarithmic(Ti(h.base))),this.Fh=o.numeric,this.Ih("Numeric"),this.Ph=i.getInnerStart(),this.Dh=i.getInnerEnd(),this.setAnimationsEnabled(n)}setDefaultInterval(t,e){return this.Bh=t,!1!==(null==e?void 0:e.applyImmediately)&&(this.uh=!0,this.chart.cs.vs()),this}getDefaultInterval(){return this.Bh}getTitle(){return this.Rh.Lh()}setTitle(t){return this.Rh.Eh(t),this.chart.cs.vs(),this}getTitleFillStyle(){return this.Rh.zh()}setIntervalRestrictions(t){return this.Vh=t,this.chart.cs.vs(),this}getIntervalRestrictions(){return this.Vh}setTitleFillStyle(t){return this.Rh.ke(t),this.chart.cs.vs(),this}getTitleFont(){return this.Rh.Oh()}setTitleFont(t){return this.Rh.Nh(t),this.chart.cs.vs(),this}setTitleRotation(t){return this.Rh.Gh(t),this.chart.cs.vs(),this}getTitleRotation(){return this.Rh.Wh()}setTitleEffect(t){return this.Uh.Ss(t),this.chart.cs.vs(),this}getTitleEffect(){return this.Uh.xs()}Ih(t,e){if(this.Qe.size>0&&this.Yh(),"Empty"===t)this.je=Gs,this.Ze=t;else if("Numeric"===t){"Numeric"!==this.Ze&&(this.Fh=this.kh.numeric);const i=e||(t=>t);this.Fh=i(this.Fh),this.je=this.Fh.Hh(this.Th),this.Ze=t}else if("DateTime"===t){"DateTime"!==this.Ze&&(this.Fh=this.kh.datetime);const i=e||(t=>t);this.Fh=i(this.Fh),this.je=this.Fh.Hh(this.Th),this.Ze=t}else if("Time"===t){"Time"!==this.Ze&&(this.Fh=this.kh.time);const i=e||(t=>t);this.Fh=i(this.Fh),this.je=this.Fh.Hh(this.Th),this.Ze=t}return this.Je.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.Je=Ks(this.je),this.chart.cs.vs(),this}$h(){return this.je}Xh(t){this.je=t,this.Je.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.Je=Ks(this.je),this.chart.cs.vs()}setInterval(t){const{start:e,end:i,animate:s,stopAxisAfter:r}=t;return this.vt(void 0!==e?e:this.Ph,void 0!==i?i:this.Dh,void 0!==s&&s,void 0===r||r,"userSetInterval"),this}vt(t,e,i=!1,s=!0,r){let n={start:t,end:e};const o=!0,h=Math.abs(e-t);if(Math.abs(this.Dh-this.Ph),void 0!==this.je.jh&&this.je.jh>h){const i=(e+t)/2,s=this.je.jh/2*(t>e?-1:1);n={start:i-s,end:i+s}}if(void 0!==this.je.Zh&&this.je.Zhe?-1:1);n={start:i-s,end:i+s}}const a=this.ft.ot(n.start,n.end,this.Ph,this.Dh,o);if(!1===a)return this;if(!0===a);else if(n=a,"zoomBandChart"===r)return this;let l;switch(r){case"userSetInterval":case"userFit":case"interactionSetInterval":case"interactionZoom":l=!0;break;case"zoomBandChart":case"synchronizedAxis":l=!1;break;default:return be(0,""),this}if(this.Qh&&this.Qh.finishAll(!1),this.th&&(!0===i||i>0)){this.setStopped(!0);const t=!0===i?void 0:i,e=!this.Qh||this.Qh.isOver()?this.th:this.Qh.NextAnimation.bind(this);this.Qh=e([[this.Ph,n.start],[this.Dh,n.end]],(([t,e])=>{this.Jh(t,e,o)}),t),this.Qh.onAnimationEnd((()=>{this.Qh=void 0,l&&(this.lh=bt.performance.now())})),this.Qh.onAnimationEnd((()=>this.setStopped(s)))}else this.Jh(n.start,n.end,o),this.setStopped(s),l&&(this.lh=bt.performance.now());return this}getInterval(){return{start:this.Ph,end:this.Dh}}setStopped(t){return t===this.sh||(t&&(this.Qh&&this.Qh.finishAll(!1),this.Qh=void 0),this.sh=t,this.L.emit("stoppedStateChanged",this,this.sh),this.eh=bt.performance.now(),this.chart.cs.vs()),this}getStopped(){return this.sh}onStoppedStateChanged(t){return this.L.on("stoppedStateChanged",t)}offStoppedStateChanged(t){return this.L.off(t,"stoppedStateChanged")}fit(t,e){const i=this.Kh(),s=this.Bh||ir,r="function"==typeof s?s({curStart:this.Ph,curEnd:this.Dh,dataMin:null==i?void 0:i.min,dataMax:null==i?void 0:i.max}):s;return this.vt(void 0!==r.start?r.start:this.Ph,void 0!==r.end?r.end:this.Dh,void 0!==r.animate?r.animate:void 0===t||t,void 0!==r.stopAxisAfter?r.stopAxisAfter:void 0===e||e,"userFit"),this}setScrollStrategy(t){return this.Ke=t,this.chart.cs.vs(),this}getScrollStrategy(){return this.Ke}setAnimationScroll(t){return this.qe=Boolean(t),this.chart.cs.vs(),this}setAnimationZoom(t,e=300){return this.Qh&&(this.Qh.finishAll(!1),this.Qh=void 0),this.th=t?K((()=>this.chart.cs.vs()))(e,t):void 0,this}setAnimationsEnabled(t){return this.ih=t,t?(this.setAnimationScroll(!0),this.setAnimationZoom($.ease,void 0)):(this.setAnimationScroll(void 0),this.setAnimationZoom(void 0)),this}getAnimationsEnabled(){return this.ih}setVisible(t){const e=this.ji!==t;return this.ji=t,this.Rh.setVisible(t),this.qh((e=>{e.Ye.setVisible(t)})),e&&this.L.emit("visibleStateChanged",this,this.ji),this}getVisible(){return this.ji}onIntervalChange(t){return this.L.on("scaleChange",t)}offIntervalChange(t){return this.L.off(t,"scaleChange")}onVisibleStateChanged(t){return this.L.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.L.off(t,"visibleStateChanged")}tr(t,e){const i=new Map;if(this.je===Gs||!this.ji)return this.Yh(),i;e=e||new Map;const s=this.ir(),r=s.min,n=s.max,o=n-r,h=t.physicalAxisSize;this.fh.physicalAxisSize=h;const a=Qs(this.je,r,n,this.Ph,this.Dh,h),l=[];if(this.sr(),l.push(...this.er(this.je,r,n,a,e,t,i)),this.hr(this.je,r,n,a,e,t,l,i),this.rr(),a)for(const[t,e]of this.Je){const i=a.get(t);if(void 0!==i)for(const[t,s]of e)i.includes(t)||(null==s||s.dispose(),e.delete(t))}return this.fh.min=r,this.fh.max=n,this.fh.scaleInterval=o,this.fh.physicalAxisSize=h,i}nr(t){const e=t.xh.ar;t.Ye.Eh(e(t.S,this.ft)).Ds()}lr(t,e){const i=e.ur;t.Ye.ke(i.getLabelFillStyle()).Nh(i.getLabelFont()).Gh(i.getLabelRotation())}gh(t,e){const i=this.Je.get(e);let s=i.get(t);s?(i.delete(t),s.xh=e,s.ys(!0)):s=this.cr(t,e);const r=this.Qe.get(e)||new Map;return r.set(t,s),this.Qe.set(e,r),this.lr(s,e),s}mh(t,e){const i=this.dr(t,e);return this.nr(t),i}er(t,e,i,s,r,n,o){const h=[];for(const a of t.$e){const t=s.get(a);for(const s of t){if(si)continue;const t=this.Qe.get(a),l=(t?t.get(s):void 0)||this.gh(s,a),u=this.mh(l,n),c=Zs(l,r);h.find((t=>ze(c,Zs(t,r))))&&l.Ye.setVisible(!1),l.ph=!1,o.set(l,u),h.push(l)}}return h}hr(t,e,i,s,r,n,o,h){let a,l=[];for(const u of t.Xe){const t=s.get(u);if(!t)break;let c;if(void 0===a)c=[{start:e,end:i,keyValues:t}];else{c=[];for(let e=0;e=i&&e0){if(void 0===u.bh){p=!1;break}const t=u.bh.Ar;if(a=t(a,d-1,n,h,e,i),void 0===a)break}const y=this.yh(m.filter((t=>a.some((e=>Ct(t.S,e))))),g,u,d,n,h,e,i,r,o,l);!0!==y?t=t.concat(y):(d+=1,f=-1,t=[])}y=t,m.forEach((e=>{t.find((t=>t===e))||this.gr(e)}))}if(l=y,!p)break}}gr(t){const e=this.Qe.get(t.xh);null==e||e.delete(t.S);const i=this.Je.get(t.xh);i&&i.has(t.S)?t.dispose():i&&(t.ys(!1),i.set(t.S,t))}qh(t){for(const e of this.Qe.values())for(const i of e.values())t(i)}pr(t,e){for(const i of this.Qe.values())for(const s of i.values())e=t(e,s);return e}Yh(){this.Qe.forEach(((t,e)=>{t.forEach((t=>this.gr(t)))})),this.Qe.clear()}sr(){for(const t of this.Qe.values())for(const e of t.values())e.ph=!0}rr(){for(const t of this.Qe.values())for(const[e,i]of t.entries())i.ph&&(i.dispose(),t.delete(e))}ir(){const t=this.ft.getInnerStart()this.ft.getInnerStart()?this.ft.getInnerEnd():this.ft.getInnerStart();return m(t,e)}Sh(t,e){return!(t.ph||0===t.Ye.Lh().length||Us(e)&&!0!==e.mr)}yr(t,e){return this.je===Gs||(this.je.$e.forEach((i=>{e=t(e,i.ur)})),this.je.Xe.forEach((i=>{(t=>void 0!==t.ar)(i)&&(e=t(e,i.ur))}))),e}Kh(){let t=this.Ch.Sr();const e=this.Ch.vr();let i;if(void 0!==t&&Et(t)&&void 0!==e&&Et(e)&&("logarithmic"===this.Th.type&&(0===t&&(t=Math.min(1,e)),Math.sign(t)!==Math.sign(e)&&(t=Math.min(1,e-.1))),i?(i.min=Math.min(i.min,t),i.max=Math.max(i.max,e)):i=m(t,e)),i&&Et(i.min)&&Et(i.max))return Ct(i.min,i.max)?{min:i.min-1,max:i.max+1}:i}br(){if(!this._h)return 0;let t=0;const e=this.Ch.Mr();return e&&(t=Math.max(t,e)),t}setAutoRegionsEnabled(t){return this._h=t,this.chart.cs.vs(),this}_r(){var t;const e=this.hh;let i=!1;if(this.uh&&this.Bh){const t=this.Kh(),e="function"==typeof this.Bh?this.Bh({curStart:this.Ph,curEnd:this.Dh,dataMin:null==t?void 0:t.min,dataMax:null==t?void 0:t.max}):this.Bh;this.setInterval(e),this.uh=!1}if(this.Ke&&!this.sh){const e=this.Kh();if(e){const s=this.Ph,r=this.Dh;let n=this.Ke.start(s,r,e.min,e.max),o=this.Ke.end(s,r,e.min,e.max);const h=null===(t=this.Ke.allowIntervalLengthChange)||void 0===t||t,a=er(this.Vh,e,{start:n,end:o},{start:s,end:r},h);n=a.start,o=a.end;const l=!1===Ct(s,n),u=!1===Ct(r,o);if(n=l?n:s,o=u?o:r,l||u){let t=!1;if(this.qe&&!this.wh)if(this.qe){t=!0;const e=l?this.wr(s,n):s,a=u?this.wr(r,o):r;if(!0===this.Jh(e,a,h)&&(l&&!1===Ct(e,n)||u&&!1===Ct(a,o))){this.chart.cs.vs(!0),i=!0;let t=Math.abs(o-n)/Math.abs(e-a);t<1&&(t=1/t),this.rh=t>=1.4}}else t=!1;t||this.Jh(n,o,h),this.wh=!1}}}return i?(this.hh!==i&&(this.hh=i,this.oh=bt.performance.now()),this.Cr&&(clearTimeout(this.Cr),this.Cr=void 0)):!0===e&&void 0===this.Cr&&(this.rh=!1,this.Cr=setTimeout((()=>{!1!==this.hh&&(this.hh=!1,this.oh=bt.performance.now()),this.Cr=void 0,this.chart.cs.vs()}),200)),this}Jh(t,e,i){let s={start:t,end:e},r=!0;if(this.Vh){const t=this.Kh();s=er(this.Vh,t,s,{start:this.Ph,end:this.Dh},i)}const n=Math.abs(e-t),o=Math.abs(this.Dh-this.Ph);if(void 0!==this.je.jh&&this.je.jh>n){const n=(e+t)/2,h=(i?this.je.jh/2:o/2)*(t>e?-1:1);s={start:n-h,end:n+h},r=!1}if(void 0!==this.je.Zh&&this.je.Zhe?-1:1);s={start:n-h,end:n+h},r=!1}let h=this.ft.ot(s.start,s.end,this.Ph,this.Dh,i);if(!1===h)return!1;!0!==h&&(s=h);const a=this.br(),l=this.kr(Math.min(s.start,s.end),Math.max(s.start,s.end),a);return h=this.ft.ot(s.end>s.start?l.min:l.max,s.end>s.start?l.max:l.min,this.Ph,this.Dh,!1),!!h&&(!0===h?this.ft.K(s.end>s.start?l.min:l.max,s.end>s.start?l.max:l.min):this.ft.K(s.start,s.end),this.Ph=s.start,this.Dh=s.end,this.L.emit("scaleChange",this,s.start,s.end),this.ah=bt.performance.now(),this.chart.cs.vs(),r)}Tr(){return this.hh}Fr(){return void 0!==this.Qh}}class qs{constructor(t,e,i,s,r=i.Dr(s).Pr(Re).Ir(Re).setMouseInteractions(!1)){this.ph=!1,this.Xi=!1,this.ss=[],this.xh=t,this.S=e,this.Br=i,this.He=s,this.Ye=r,this.ss.push(r)}ys(t){this.ss.forEach((e=>e.setVisible(t)))}dispose(){return this.Xi||(this.Xi=!0,this.ss.forEach((t=>t.dispose()))),this}}const Qs=(t,e,i,s,r,n)=>{const o=new Map;for(const n of t.$e){let t=n.Lr(e,i,s,r);t=tr(t),o.set(n,t)}let h;for(const s of t.Xe){let t;if(void 0===h)t=s.Lr(e,i,e,i);else{let r=[];const o=h.filter((t=>e<=t&&t<=i)).length;if(o>0){const t=n/(o-1);if(void 0!==s.Rr&&s.Rr>t)break}for(let t=0;t(t=(t=>{const e={},i=[],s=t.length;let r=0;for(let n=0;nt-e)),er=(t,e,i,s,r)=>{const n="function"==typeof t?t({curStart:s.start,curEnd:s.end,dataMin:null==e?void 0:e.min,dataMax:null==e?void 0:e.max}):t;if(!n)return i;const o={start:i.start,end:i.end};let h=Math.abs(i.end-i.start);if(void 0!==n.intervalMin&&hn.intervalMax){const t=(o.start+o.end)/2;o.start=t+.5*Math.sign(i.start-t)*n.intervalMax,o.end=t+.5*Math.sign(i.end-t)*n.intervalMax}return h=Math.abs(i.end-i.start),void 0!==n.startMin&&(o.start=Math.max(o.start,n.startMin),r||Ct(Math.abs(o.start-o.end),h)||(o.end=o.start+Math.sign(i.end-i.start)*h)),h=Math.abs(i.end-i.start),void 0!==n.startMax&&(o.start=Math.min(o.start,n.startMax),r||Ct(Math.abs(o.start-o.end),h)||(o.end=o.start+Math.sign(i.end-i.start)*h)),h=Math.abs(i.end-i.start),void 0!==n.endMin&&(o.end=Math.max(o.end,n.endMin),r||Ct(Math.abs(o.start-o.end),h)||(o.start=o.end+Math.sign(i.start-i.end)*h)),h=Math.abs(i.end-i.start),void 0!==n.endMax&&(o.end=Math.min(o.end,n.endMax),r||Ct(Math.abs(o.start-o.end),h)||(o.start=o.end+Math.sign(i.start-i.end)*h)),o},ir=t=>{if(void 0===t.dataMin||void 0===t.dataMax)return{stopAxisAfter:!1};const e=t.curEnd>=t.curStart;return{start:e?t.dataMin:t.dataMax,end:e?t.dataMax:t.dataMin,stopAxisAfter:!1}},sr=s.Record({type:"font",size:14,family:"Arial",weight:"normal",style:"normal",variant:!1});class rr extends sr{constructor(t){super(t)}setSize(t){return this.set("size",t)}setFamily(t){return this.set("family",t)}setWeight(t){return this.set("weight",t)}setStyle(t){return this.set("style",t)}setVariant(t){return this.set("variant",t)}getSize(){return this.get("size")}getFamily(){return this.get("family")}getWeight(){return this.get("weight")}getStyle(){return this.get("style")}getVariant(){return this.get("variant")}}const nr=t=>!(!t||"object"!=typeof t||!("type"in t)||"font"!==t.type),or=new rr,hr=new class{getFillStyle(){return z}},ar=s.Record({type:"triangulated-points-3d",shape:"sphere",size:10,fillStyle:new G,wireframeStyle:ot});class lr extends ar{constructor(t){super(t)}setSize(t){return this.set("size",t)}getSize(){return this.get("size")}setFillStyle(t){return"function"==typeof t?this.set("fillStyle",t(this.get("fillStyle"))):this.set("fillStyle",t)}getFillStyle(){return this.get("fillStyle")}setWireframeStyle(t){return"function"==typeof t?this.set("wireframeStyle",t(this.get("wireframeStyle"))):this.set("wireframeStyle",t)}getWireframeStyle(){return this.get("wireframeStyle")}setShape(t){return this.set("shape",t)}getShape(){return this.get("shape")}}const ur=t=>!(!t||"object"!=typeof t||!("type"in t)||"triangulated-points-3d"!==t.type),cr=s.Record({type:"pixelated-points-3d",size:5,fillStyle:new G});class dr extends cr{constructor(t){super(t)}setSize(t){return this.set("size",t)}getSize(){return this.get("size")}setFillStyle(t){return"function"==typeof t?this.set("fillStyle",t(this.get("fillStyle"))):this.set("fillStyle",t)}getFillStyle(){return this.get("fillStyle")}}const fr=t=>!(!t||"object"!=typeof t||!("type"in t)||"pixelated-points-3d"!==t.type),gr={Triangulated:lr,Pixelated:dr};class mr{constructor(t){this.Er=new Map,this.cs=t}ls(t,e,i){const s=i.animationEnabled;this.Er.set(t,{applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:s,curAnimatedHighlightValue:0});const r=t.onDispose((()=>{this.Er.delete(t),t.offDispose(r)}))}zr(t,e){let i=e.animationEnabled;const s=[],r=t.onDispose((()=>{s.forEach((t=>{this.Er.delete(t)})),t.offDispose(r)}));return{Vr:(t,e)=>{const r={applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:i,curAnimatedHighlightValue:0};s.push(t),this.Er.set(t,r)},Or:()=>{s.forEach((t=>{this.Er.delete(t)})),s.length=0},Nr:t=>{i=t,s.forEach((t=>{this.ws(t,i)}))},Gr:()=>i}}_s(t,e){const i=this.Er.get(t);i&&(i.curUnanimatedHighlightValue=Ae(e),this.cs.vs())}gs(t,e=!1){const i=this.Er.get(t);return i?e?i.curAnimatedHighlightValue:i.curUnanimatedHighlightValue:0}ws(t,e){const i=this.Er.get(t);i&&(i.animationEnabled=e)}Cs(t){const e=this.Er.get(t);return!!e&&e.animationEnabled}Ds(t){let e=!1;this.Er.forEach(((i,s)=>{let r;if(i.animationEnabled){const s=1e3;if(i.curUnanimatedHighlightValue>0){const n=i.curAnimationPositionMillis/s;r=i.curUnanimatedHighlightValue*Math.abs(Math.sin(n*Math.PI/2+.5));const o=0===i.curAnimatedHighlightValue?1:t;i.curAnimationPositionMillis+=o,e=!0}else i.curAnimatedHighlightValue>0&&0===i.curUnanimatedHighlightValue?(r=Math.max(i.curAnimatedHighlightValue-t/s,0),e=e||r>0):r=0,i.curAnimationPositionMillis=0}else r=i.curUnanimatedHighlightValue;r!==i.curAnimatedHighlightValue&&(i.applyHighlight(r),i.curAnimatedHighlightValue=r)})),e&&this.cs.vs(!0)}}const yr=new Map,pr=(t,e)=>{const i=t.getSize(),s=t.getFamily(),r=t.getWeight(),n=t.getStyle(),o=t.getVariant(),h=`${n} ${o?"small-caps":"normal"} ${r} ${i}px ${s}`,a=`${h} ${e.toFixed(2)}`;let l=yr.get(a);return l||(l=((t,e,i,s)=>({font:t,properties:e,dpr:i,id:s}))(h,{type:"font",size:i,family:s,style:n,variant:o,weight:r},e,a),yr.set(a,l)),l};var xr,Sr;!function(t){t[t.click=0]="click",t[t.dbclick=1]="dbclick",t[t.mouseDown=2]="mouseDown",t[t.mouseUp=3]="mouseUp",t[t.contextmenu=4]="contextmenu",t[t.wheel=5]="wheel"}(xr||(xr={})),function(t){t[t.touchStart=0]="touchStart",t[t.touchMove=1]="touchMove",t[t.touchEnd=2]="touchEnd"}(Sr||(Sr={}));const Ar=t=>({container:t.Wr,scale:t.ft,setMouseStyle:(e,i)=>t.Ur(e,i),restoreMouseStyle:e=>t.Yr(e),clientLocation2Engine:(e,i)=>t.De(e,i),engineLocation2Client:(e,i)=>t.Hr(e,i),captureFrame:(e,i,s)=>t.$r(e,i,s),renderFrame:(e,i,s=!1)=>t.Xr(e,i,s),layout:()=>{t.jr(),t.Zr(),t.Jr.Qr(),t.vs()},setBackgroundFillStyle(e){return t.setBackgroundFillStyle(e),this},setBackgroundStrokeStyle(e){return t.setBackgroundStrokeStyle(e),this},getBackgroundFillStyle:()=>t.getBackgroundFillStyle(),getBackgroundStrokeStyle:()=>t.getBackgroundStrokeStyle(),addCustomIcon:(e,i)=>t.Kr(e,i),onRenderFrame:e=>t.qr(e),offRenderFrame:e=>t.tn(e)}),vr=[];let br;const Mr=()=>{if(void 0!==br){const t=bt.getComputedStyle(bt.document.body),e=Number(t.getPropertyValue("margin-top").replace("px",""))+Number(t.getPropertyValue("margin-bottom").replace("px",""));br.style.height=bt.innerHeight-e+"px",(()=>{for(let t=0;tthis.vs()),60),this.hn=u(0,0),this.rn=!1,this.nn=kt,this.an=()=>{},this.ln=[],this.un=-1,this.cn=[],this.dn=!0,this.Xi=!1,this.fn=!1,this.Zr=()=>{const{bottom:t,left:e}=this.Wr.getBoundingClientRect();return this.hn=u(Math.floor(e),Math.floor(t)),this},this.jr=()=>{this.An&&this.An()},this.Ur=(t,e)=>{if(!e){this.Wr.style.cursor=t;const e=this.un;return this.un+=1,this.cn.push([e,t]),e}return this.Yr(e),this.Ur(t)},this.Yr=t=>{const e=t?this.cn.findIndex((e=>e[0]===t)):-1;e>=0?(this.cn.splice(e,1),this.cn.length>0?this.Wr.style.cursor=this.cn[this.cn.length-1][1]:this.Wr.style.cursor="default"):(this.cn.push([0,"default"]),this.Wr.style.cursor="default")},this.gn=t=>(this.pn.M(t),this),this.mn=()=>this.pn._(),this.yn=()=>{this.nn&&this.nn(1e3/60),this.Sn(),this.vn(),this.an&&this.an()},this.xn=t=>(this.sn.set(t.bn(),t),this.sn=new Map([...this.sn.entries()].sort(((t,e)=>t[0]-e[0]))),t),this.Mn=t=>(this.sn.delete(t),this),this.Z=()=>(this.pn.o=!1,this),this.J=()=>(this.pn.o=!0,this),this._n=t=>{if(!this.dn)return;const e=this.wn,i=e&&e.clientX===t.clientX&&e.clientY===t.clientY,s=this.De(t.clientX,t.clientY),r=this.Cn(t,{x:t.clientX,y:t.clientY});if(this.kn&&((null==r?void 0:r.entity)!==this.kn.entity||r.collectionMember!==this.kn.collectionMember)&&!this.Tn){this.kn.entity.Zi=!1;const e=this.kn.entity.Fn;e&&e(this.kn.entity,t,this.kn.collectionMember)}if(r&&r.entity.getMouseInteractions()&&!this.Tn)if(r.entity.Zi){if(!i){const e=r.entity.In;e&&e(r.entity,t,r.collectionMember)}}else{r.entity.Zi=!0;const e=r.entity.Pn;e&&e(r.entity,t,r.collectionMember)}if(this.Tn){const i=this.Tn.entity.Dn,s=e?u(t.clientX-e.clientX,e.clientY-t.clientY):{x:0,y:0};!i||0===s.x&&0===s.y||i(this.Tn.entity,t,this.Tn.button,this.Tn.startLocation,s,this.Tn.collectionMember)}this.Bn=t,this.wn=t,this.Ln=s,this.kn=r},this.Rn=t=>{if(this.dn=!1,this.Ln=void 0,this.Bn=t,this.kn&&!this.En&&!this.Tn){this.kn.entity.Zi=!1;const e=this.kn.entity.Fn;e&&e(this.kn.entity,t,this.kn.collectionMember),this.kn=void 0}},this.zn=t=>{if(this.dn=!0,this.Bn=t,this.Tn&&t.buttons<=0){const e=this.Tn.entity.Vn;e&&e(this.Tn.entity,t,this.Tn.button,this.Tn.startLocation,this.Tn.collectionMember),this.Tn=void 0}if(this.En&&t.buttons<=0){const e=this.En.entity.On;e&&e(this.En.entity,t,this.En.collectionMember),this.En=void 0}},this.Nn=()=>this.Ln,this.Jr=t,this.ts=e.theme,this.Gn=i.Gn,this.Wn=i.Wn,this.Un=i.Un,this.Yn={Hn:e&&e.overrideInteractionMouseButtons?e.overrideInteractionMouseButtons:void 0,Xs:e&&void 0!==e.resourcesBaseUrl&&null!==e.resourcesBaseUrl?e.resourcesBaseUrl:`${bt.location.origin}/resources`,$n:!e||!("warnings"in e)||"boolean"!=typeof e.warnings||e.warnings,Xn:(()=>{const t=null==e?void 0:e.pickingPrecision;if("string"==typeof t){const e=t.toLowerCase();if("best"===e)return 1;if("high"===e)return.5;if("low"===e)return 1/8}return 1/4})(),jn:void 0===(null==e?void 0:e.interactable)||e.interactable,Zn:void 0===e.textPixelSnappingEnabled||e.textPixelSnappingEnabled};const s=e?e.container:void 0;if(s){if("string"==typeof s){const t=bt.document.getElementById(s);if(!t)throw new Error(`Container "${s}" doesn't exist.`);this.Wr=t}else this.Wr=s;bt.addEventListener("resize",this.jr),this.ln.push((()=>{bt.removeEventListener("resize",this.jr)}))}else{if(void 0===br){const t=bt.document.createElement("div");t.id="lcjs-auto-flexbox",t.style.position="relative",t.style.width="100%",t.style.display="flex",t.style.flexDirection="column",bt.document.body.appendChild(t),br=t,bt.addEventListener("resize",Mr)}let t=1;for(;null!==bt.document.getElementById(`chart-${t}`);)t+=1;this.Wr=bt.document.createElement("div"),this.Wr.id=`chart-${t}`,this.Wr.style.flex="1",this.Wr.style.height="100%",br.appendChild(this.Wr),Mr(),vr.push(this.jr),this.ln.push((()=>{br&&br.removeChild(this.Wr),vr.includes(this.jr)&&vr.splice(vr.indexOf(this.jr),1),0===vr.length&&br&&(bt.document.body.removeChild(br),br=void 0,bt.removeEventListener("resize",Mr))}))}if(bt.ResizeObserver){const t=t=>{for(const e of t)e.target===this.Wr&&this.jr()};this.Qn=new bt.ResizeObserver(t.bind(this)),this.Qn.observe(this.Wr)}""===this.Wr.style.position&&(this.Wr.style.position="relative"),this.Wr.style.boxSizing="content-box",this.Wr.addEventListener("fullscreenchange",this.jr),this.Wr.addEventListener("webkitfullscreenchange",this.jr);const n=e?e.maxFps:void 0;this.Jn=n?-1===n?-1:0!==n?1e3/n:0:0;const o=new Map;let h=!1;const a=(t,e)=>i=>{const s=function(t){return{x:t.clientX,y:t.clientY}}(i);switch(i.type){case"pointerover":case"pointerenter":case"pointermove":case"pointerdown":o.set(i.pointerId,s);break;default:o.delete(i.pointerId),h=!1}switch(i.interactions=Array.from(o.values()),i.pointerType){case"pen":case"mouse":default:t&&t(i);break;case"touch":e&&e(i)}i.defaultPrevented&&(h=!0)};this.Wr.onwheel=this.Kn(xr.wheel),this.Wr.oncontextmenu=this.Kn(xr.contextmenu),this.Wr.onclick=this.Kn(xr.click),this.Wr.ondblclick=this.Kn(xr.dbclick),this.Wr.onlostpointercapture=()=>{h=!1},this.Wr.ontouchmove=t=>{h&&t.preventDefault()},this.Wr.onpointerover=a(),this.Wr.onpointerenter=a(this.zn),this.Wr.onpointerdown=a(this.Kn(xr.mouseDown),this.qn(Sr.touchStart)),this.Wr.onpointermove=a(this._n,this.qn(Sr.touchMove)),this.Wr.onpointerup=a(this.Kn(xr.mouseUp),this.qn(Sr.touchEnd)),this.Wr.onpointercancel=a(),this.Wr.onpointerout=a(),this.Wr.onpointerleave=a(this.Rn,this.qn(Sr.touchEnd)),bt.addEventListener("scroll",this.Zr,{passive:!0}),this.pn=p(new b({r:0,g:0,b:0,a:0})),this.us=new mr(this)}io(t,e){var i,s,r,n;(null===(i=this.kn)||void 0===i?void 0:i.entity)===t.entity&&this.kn.collectionMember===t.collectionMember&&(this.kn=e),(null===(s=this.so)||void 0===s?void 0:s.entity)===t.entity&&this.so.collectionMember===t.collectionMember&&(this.so=e),(null===(r=this.En)||void 0===r?void 0:r.entity)===t.entity&&this.En.collectionMember===t.collectionMember&&(this.En={...e,event:this.En.event}),(null===(n=this.Tn)||void 0===n?void 0:n.entity)===t.entity&&this.Tn.collectionMember===t.collectionMember&&(this.Tn={...e,button:this.Tn.button,startLocation:this.Tn.startLocation})}eo(){this.fn=!0,this.nn=void 0,this.an=void 0}qr(t){return this.L.on("render",t)}tn(t){return this.L.off(t)}ho(){return this.ro}no(){return this.oo}setBackgroundFillStyle(t){return this.ao.ke(t),this}getBackgroundFillStyle(){return this.ao.zh()}setBackgroundStrokeStyle(t){return this.ao.Ce(t),this}getBackgroundStrokeStyle(){return this.ao.lo()}uo(t){return this.an=t,this}co(t){return this.nn=t,this}do(t){return this.sn.get(t)}fo(){return Array.from(this.sn.keys()).reverse().reduce(((t,e)=>e!==Number.MAX_SAFE_INTEGER&&e>t?e:t),0)+1}Kn(t){return e=>this.Ao(t,e)}Ao(t,e){if(!this.dn)return;t===xr.contextmenu&&Zt(e);const i=this.De(e.clientX,e.clientY),s=this.Cn(e,{x:e.clientX,y:e.clientY});if(t===xr.mouseUp){if(this.Tn){const t=this.Tn.entity.Vn;if(t&&t(this.Tn.entity,e,this.Tn.button,this.Tn.startLocation,this.Tn.collectionMember),(null==s?void 0:s.entity)!==this.Tn.entity||s.collectionMember!==this.Tn.collectionMember){this.Tn.entity.Zi=!1;const t=this.Tn.entity.Fn;t&&t(this.Tn.entity,e,this.Tn.collectionMember)}this.Tn=void 0}if(this.En){const t=this.En.entity.getMouseInteractions()&&this.En.entity.On;t&&t(this.En.entity,e,this.En.collectionMember),this.En=void 0}}else if(s&&s.entity.getMouseInteractions()){const i=t===xr.click?s.entity.po:t===xr.dbclick?s.entity.mo:t===xr.mouseDown?s.entity.yo:t===xr.wheel?s.entity.So:t===xr.contextmenu?s.entity.vo:void 0;if(i&&i(s.entity,e,s.collectionMember),t===xr.mouseDown){this.En={entity:s.entity,collectionMember:s.collectionMember,event:e};const t=this.En.event.button,i=s.entity.xo;i&&i(s.entity,e,t,s.collectionMember),this.Tn={entity:s.entity,collectionMember:s.collectionMember,button:t,startLocation:u(e.clientX,e.clientY)}}}this.Bn=e,this.Ln=i,this.kn=s}qn(t){return e=>this.bo(t,e)}bo(t,e){const i=e.interactions.length;if(this.Mo=e,this.so){const s=t===Sr.touchMove?this.so.entity._o:t===Sr.touchEnd?this.so.entity.wo:t===Sr.touchStart?this.so.entity.Co:void 0;s&&s(this.so.entity,e,this.so.collectionMember),t===Sr.touchEnd&&0===i&&(this.so.entity.Zi=!1,this.so=void 0)}else if(t===Sr.touchStart){for(let t=0;t{t()})),this.ln.length=0}}De(t,e){return u(t-this.hn.x,this.hn.y-e)}Hr(t,e){return u(t+this.hn.x,this.hn.y-e)}Do(t){const e=this.De(t.clientX,t.clientY);return{engineX:e.x,engineY:e.y}}Bo(t){const e=this.Hr(t.engineX,t.engineY);return{clientX:e.x,clientY:e.y}}}const kr=(t=1)=>({type:"horizontalProgressive",packager:(e,i,s)=>{if(e.length>1){const r=ni(i,s*t),n=Math.abs(r.x),o=e.length,h=[];let a=0,l=0,c=e[0].x+n;for(;ls&&(s=e[l].y),e[l].y({type:"horizontalRegressive",packager:(e,i,s)=>{if(e.length>1){const r=ni(i,s*t),n=Math.abs(r.x),o=e.length,h=[];let a=0,l=0,c=e[0].x-n;for(;lc&&l=c;)e[l].y>s&&(s=e[l].y),e[l].y({type:"verticalProgressive",packager:(e,i,s)=>{if(e.length>1){const r=ni(i,s*t),n=Math.abs(r.y),o=e.length,h=[];let a=0,l=0,c=e[0].y+n;for(;ls&&(s=e[l].x),e[l].x({type:"verticalRegressive",packager:(e,i,s)=>{if(e.length>1){const r=ni(i,s*t),n=Math.abs(r.y),o=e.length,h=[];let a=0,l=0,c=e[0].y-n;for(;lc&&l=c;)e[l].x>s&&(s=e[l].x),e[l].x{const e="nearest"===t?Lr.Nearest:"nearest-x"===t?Lr.NearestX:"nearest-y"===t?Lr.NearestY:void 0;return void 0!==e?e:Lr.NearestX},_r=(t,e,i,s,r,n,o,h,a,l)=>{const u=t.length;if(0===u)return;const c=s?1:0,d=u-(r?2:1);if(i===Lr.Nearest)return Pr(t,e,n,o,c,d);if(i===Lr.NearestX||i===Lr.NearestY){if("boolean"==typeof l&&("x"===a&&i===Lr.NearestX||"y"===a&&i===Lr.NearestY))return Nr(t,dt(e,o,n),a,l,c,d);if(i===Lr.NearestX)return Br(t,dt(e,o,n),h,c,d);if(i===Lr.NearestY)return zr(t,dt(e,o,n),h,c,d)}},Pr=(t,e,i,s,r,n)=>{let o,h=Number.MAX_VALUE;for(let a=r;a<=n;a+=1){const r=t[a];if(!Number.isNaN(r.x)&&!Number.isNaN(r.y)){const t=dt(r,i,s),n=(t.x-e.x)**2+(t.y-e.y)**2;n{if(e.xi.max.x)return;let n,o=Number.MAX_VALUE;for(let i=s;i<=r;i+=1){const s=t[i],r=s.x>e.x?s.x-e.x:e.x-s.x;r{if(e.yi.max.y)return;let n,o=Number.MAX_VALUE;for(let i=s;i<=r;i+=1){const s=t[i],r=s.y>e.y?s.y-e.y:e.y-s.y;r{const o="x"===i,h=o?e.x:e.y,a=t[r],l=t[n],u=a.xl.x?a.x:l.x,f=a.y>l.y?a.y:l.y;if(o&&(hd)||!o&&(hf))return;let g=r,m=Math.floor((r+n)/2),y=n,p=-1;for(;;){const e=h-(o?t[m].x:t[m].y);if(e*(s?-1:1)>0)g=Math.min(m+1,y),p=Math.floor((g+y)/2);else{if(0===Math.abs(e))return m;y=Math.max(m-1,g),p=Math.floor((g+y)/2)}if(p===m){const i=m>r?Math.abs(h-(o?t[m-1].x:t[m-1].y)):Le,s=m{const o="x"===i,h=o?e.x:e.y,a=t[r],l=t[n],u=a.xl.x?a.x:l.x,f=a.y>l.y?a.y:l.y;if(o&&(hd)||!o&&(hf))return;let g=r,m=Math.floor((r+n)/2),y=n,p=-1;for(;;){const i=h-(o?t[m].x:t[m].y);if(i*(s?-1:1)>0)g=Math.min(m+1,y),p=Math.floor((g+y)/2);else{if(0===Math.abs(i))return{a:m,b:m,lerpAmount:0};y=Math.max(m-1,g),p=Math.floor((g+y)/2)}if(p===m){if(i*(s?-1:1)<0&&m>r){const i=t[m-1],s=t[m];return{a:m-1,b:m,lerpAmount:o?(e.x-i.x)/(s.x-i.x):(e.y-i.y)/(s.y-i.y)}}if(mthis.L.on("dispose",t),this.offDispose=t=>this.L.off(t,"dispose"),this.cs=t,this.Oo=e,this.No=i,this.Go=Or,Or+=1,this.Wo=t.ts.highlightColorOffset}Uo(t){return void 0!==this.No.find((e=>e.type===t))}Yo(t,e){var i;return!!this.Uo(t)&&!0===e(null===(i=this.No.find((e=>e.type===t)))||void 0===i?void 0:i.args)}dispose(){return this.Xi||(this.Zi&&this.Fn&&this.Fn(this,void 0,void 0),this.Xi=!0,this.Oo(this),this.L.emit("dispose",this)),this}isDisposed(){return this.Xi}setVisible(t){const e=this.ji;return this.ji=t,!t&&e&&(this.Zi&&this.Fn&&this.Fn(this,void 0,void 0),this.Zi=!1),this}getVisible(){return this.ji}setMouseInteractions(t){const e=this.Lo._();return this.Lo.M(t),t||(e&&this.Zi&&this.Fn&&this.Fn(this,void 0,void 0),this.Zi=!1),this}getMouseInteractions(){return this.Lo._()}getIsUnderMouse(){return this.Zi}getIsGrabbed(){return this.Eo}setMouseMoveEventHandler(t){return this.In=t,this}setMouseEnterEventHandler(t){return this.Pn=t,this}setMouseLeaveEventHandler(t){return this.Fn=t,this}setMouseClickEventHandler(t){return this.po=t,this}setMouseDoubleClickEventHandler(t){return this.mo=t,this}setMouseDownEventHandler(t){return this.yo=t,this}setMouseUpEventHandler(t){return this.On=t,this}setMouseWheelEventHandler(t){return this.So=t,this}setMouseContextMenuEventHandler(t){return this.vo=t,this}setMouseDragEventHandler(t){return this.Dn=t,this}setMouseDragStartEventHandler(t){return this.xo=t,this}setMouseDragStopEventHandler(t){return this.Vn=t,this}setTouchStartEventHandler(t){return this.Co=t,this}setTouchMoveEventHandler(t){return this._o=t,this}setTouchEndEventHandler(t){return this.wo=t,this}Ho(t){return this.zo=t,this}$o(){return this.zo?this.zo:Yr}ds(t){return this.Vo=t,this}Xo(){return this.Vo}jo(t){return this.Wo=t,this}Zo(){return this.Wo}}const Yr=m(u(0,0),u(0,0));class Hr extends Gr{constructor(t,e,i,s){super(t,i,s),this.Qo=0,this.Ts=e,this.Ts.Jo=!0}Ko(t){return this.Qo===t||(this.Qo=t,this.Ts.Jo=!0),this}qo(){return this.Qo}}class Xr extends Hr{constructor(t,e,i,s,r){super(t,e,s,r),this.ta=!0,this.ft=i}}const Wr=(t,e,i)=>{if(i instanceof _i){const s=i.Ui(),r=ai(e,{x:Math.abs(s.x),y:Math.abs(s.y)});return m(u(t.min.x-r.x,t.min.y-r.y),u(t.max.x+r.x,t.max.y+r.y))}return m(i.mi(u(t.min.x,t.min.y),ni(e,-1)),i.mi(u(t.max.x,t.max.y),e))},jr=(t,e)=>"function"==typeof e?e(t):e,$r=(t,e)=>!t||t!==e,Zr=t=>t!==z;class Kr extends Xr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.be=Tr.fillStyle,this.cs=t}ke(t){return this.be=jr(this.be,t),this}zh(){return this.be}ia(){return $r(this.sa,this.be)}ea(){return((t,e)=>t===z&&e!==z)(this.sa,this.be)}ha(){return Zr(this.be)}ra(t){this.sa=t}}class Jr extends Kr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Me=Tr.lineStyle,this.cs=t}Ce(t){return this.Me="function"==typeof t?t(this.Me):t,this}lo(){return this.Me}na(){return!this.oa||this.oa!==this.Me}aa(t){return!this.oa||this.oa.getThickness()!==t}ha(){return this.Me!==ot||super.ha()}ea(){return(this.Me!==ot||this.be!==z)&&this.oa===ot&&this.sa===z}la(t){this.oa=t}}class qr extends Kr{constructor(t,e,i,s,r,n=p(5)){super(t,e,i,s,r),this.size=p(5),this.size=n}tt(t){return this.size.M(t),this}}class Qr extends Kr{constructor(t,e,i,s,r,n=p(Tr.font)){super(t,e,i,s,r),this.ua=p(""),this.ca=p(u(0,0)),this.da=p(0),this.fa=p(0),this.Aa=p(u(0,0)),this.ga=p(0),this.pa=p(or),this.ma=u(0,0),this.jt=p(x(1,1,1,1)),this.ya=p(S(4,4,4,4)),this.font=p(Tr.font),this.Sa=!1,this.font=n}ha(){return Zr(this.be)&&this.ua._().length>0}ea(){return!1===this.Sa&&this.ha()}Eh(t){return this.ua.M(t),this}Lh(){return this.ua._()}Nh(t){return nr(t)?this.pa.M(t):this.pa.M(t(this.pa._())),this}Oh(){return this.pa._()}va(t){return this.pa.M(this.pa._().setFamily(t)),this}xa(){return this.pa._().getFamily()}ba(t){return this.pa.M(this.pa._().setSize(t)),this}Ma(){return this.pa._().getSize()}_a(t){return this.pa.M(this.pa._().setWeight(t)),this}wa(){return this.pa._().getWeight()}Ca(t){return this.pa.M(this.pa._().setStyle(t)),this}ka(){return this.pa._().getStyle()}Ta(t){return this.pa.M(this.pa._().setVariant(t)),this}Fa(){return this.pa._().getVariant()}Ie(t){return this.ca.M(t),this}Ia(){return this.ca._()}Gh(t){return this.ga.M(t),this}Wh(){return this.ga._()}Pa(t,e){return this.Aa.M(u(t,e)),this}Da(){return this.Aa._()}Ba(t){return this.fa.M(t),this}La(){return this.fa._()}Ra(t){return this.da.M(t),this}Ea(){return this.da._()}za(t){return this.fa.M(t.x),this.da.M(t.y),this}Ir(t){return this.jt.M(t),this}Va(){return this.jt._()}Pr(t){return this.ya.M(t),this}Oa(){return this.ya._()}}class tn extends qr{constructor(t,i,s,r,n,o=5){super(t,i,s,r,n,p(o)),this.Na=[],this.Ga=p(e.PointShape.Square),this.ga=p(0),this.Wa=p(!1),this.Ua=p(!1),this.Ya=p(!1),this.Ha=_e,this.$a=0,this.Xa=[],this.ja=0,this.Za=_e,this.Qa=Lr.Nearest,this.Ja=!1,this.Ka=void 0}qa(t){return this.Qa=t,this}tl(){return this.Xa}il(){return this.Na}sl(t){return this.Ga.M(t),this}el(){return this.Ga._()}Gh(t){return this.ga.M(t),this}Wh(){return this.ga._()}hl(t){return this.Wa.M(t),this}rl(t){return this.Ua.M(t),this}nl(t){return this.Ya.M(t),this}ol(t,e){return Array.isArray(t)||(t=[t]),this.ja+=t.length,this.Xa=ne(this.Xa,t,{canReturnB:!0}),this.Za&&(this.Za=e?Je(this.Za,e):void 0),this.Ka=void 0,this}Gt(){return this.Ja=!0,this.Na.length=0,this.$a=0,this.Ha=_e,this.Xa=[],this.ja=0,this.Ka=void 0,this}al(){return this.$a}ll(){return this.ja}}class en extends Jr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ca=p(u(0,0)),this.j=p(u(100,100)),this.ga=p(0),this.ma=p(u(0,0)),this.ul=!1}Ds(){return this.cl(),this}Ie(t){const e=this.ca._();return t.x===e.x&&t.y===e.y||(this.ca.M(t),this.cl()),this}Ia(){return this.ca._()}dl(t){const e=this.ca._();return t!==e.x&&(this.ca.M(u(t,e.y)),this.cl()),this}fl(t){const e=this.ca._();return t!==e.y&&(this.ca.M(u(e.x,t)),this.cl()),this}tt(t){const e=this.j._();return t.x===e.x&&t.y===e.y||(this.j.M(u(t.x,t.y)),this.cl()),this}ai(){return this.j._()}Al(t){const e=this.j._();return t!==e.x&&(this.j.M(u(t,e.y)),this.cl()),this}pl(t){const e=this.j._();return t!==e.x&&(this.j.M(u(e.x,t)),this.cl()),this}Gh(t){return this.ga.M(t),this}Wh(){return this.ga._()}ml(t){const e=this.ma._();return t===e&&e.x===t.x&&e.y===t.y||(void 0===t?(this.ul=!1,this.cl()):(this.ul=!0,this.ma.M(t))),this}cl(){if(!this.ul){const t=this.ca._(),e=this.j._(),i=u(t.x+e.x/2,t.y+e.y/2),s=this.ma._();i.x===s.x&&i.y===s.y||this.ma.M(i)}}}class sn extends Jr{constructor(){super(...arguments),this.Na=[],this.ca=p(u(0,0)),this.Ha=_e,this.yl=!1}Sl(t){return t=te(t),this.Na=t,this.yl=!0,this}vl(){return this.Na}bt(){return this.Ha.max.x}xt(){return this.Ha.min.x}_t(){return this.Ha.max.y}Mt(){return this.Ha.min.y}xl(){return 0}bl(){return 0}}class rn extends sn{}class nn extends Kr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Ml=new Array,this._l=new Array,this.wl=p({type:"disabled",packager:(t,e,i)=>t.slice()}),this.Ha=_e,this.Cl=0,this.kl=!1,this.Xa=[Array(),Array()],this.Tl=!1,this.Fl=(new G).setColor(E(42,171,240)),this.Ja=!1,this.Il=!1,this.Pl=!1}ol(t,e){const i=this.Cl-1,s=i>0&&!this.Tl;let[r,n]=s?[[this.Ml[i]],[this._l[i]]]:[[],[]];if(t instanceof Array){const[e,i]=g(t);r=ne(r,e,{canReturnB:!0}),n=ne(n,i,{canReturnB:!0})}else{const e=t.position;r.push(u(e,t.high)),n.push(u(e,t.low))}return this.Tl?(this.Xa[0]=ne(this.Xa[0],r,{canReturnB:!0}),this.Xa[1]=ne(this.Xa[1],n,{canReturnB:!0})):(this.Xa=[r,n],this.Tl=!0),this.Ha=Je(this.Ha,e||Je(Ze(r),Ze(n))),this}Gt(){return this.Ja=!0,this.Ml.length=0,this._l.length=0,this.Cl=0,this.Ha=_e,this}il(){return[this.Ml,this._l]}tl(){return[this.Xa[0],this.Xa[1]]}Dl(t){return this.wl.M(t),this}Bl(){return this.wl._()}Ll(t){return this.Fl="function"==typeof t?t(this.Fl):t,this}Rl(){return this.Fl}al(){return this.Cl-(Number(this.Il)+Number(this.Pl))}ll(){return this.Xa.length}El(t){return this.Il=t,this}zl(){return this.Il}Vl(t){return this.Pl=t,this}Ol(){return this.Pl}ea(){return this.sa===z&&this.Nl===z&&(this.be!==z||this.Fl!==z)}Gl(t){this.Nl=t}ha(){return this.Fl!==z||super.ha()}ia(){return super.ia()||!this.Nl||this.Nl!==this.Fl}}class on extends Jr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ca=p(u(0,0)),this.Wl=p(0),this.Ii=p(360),this.Ul=p(100),this.Yl=p(100),this.Hl=p(0),this.$l=p(void 0),this.Xl=u(0,0),this.jl=u(0,0),this.Zl=u(0,0)}Ql(){return this.Ul._()}Jl(){return this.Yl._()}Ia(){return this.ca._()}Kl(){return this.Wl._()}Fi(){return this.Ii._()}ql(){return this.Hl._()}tu(){return this.$l._()}iu(){return this.Xl}su(){return this.jl}eu(){return this.Zl}Ie(t){return this.ca.M(t),this}hu(t){return this.Wl.M(t),this}Ve(t){return this.Ii.M(t),this}ru(t){return this.Yl.M(t),this.Ul.M(t),this}nu(t){return this.Ul.M(t),this}ou(t){return this.Yl.M(t),this}au(t){return this.Hl.M(t<0?0:t),this}lu(t){return this.$l.M(void 0!==t&&t<=0?void 0:t),this}}var hn;!function(t){t[t.Complex=0]="Complex",t[t.Simple=1]="Simple"}(hn||(hn={}));class an extends Xr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.uu=Tr.lineStyle,this.engine=t}Ee(t){return this.uu=((t,e)=>"function"==typeof e?e(t):e)(this.uu,t),this}cu(){return this.uu}na(){return((t,e)=>!t||t!==e)(this.du,this.uu)}fu(t){return((t,e)=>!t||t.getThickness()!==e)(this.du,t)}ea(){return((t,e)=>t===ot&&e!==ot)(this.du,this.uu)}ha(){return(t=>t!==ot&&t.getFillStyle()!==z)(this.uu)}Au(t){this.du=t}}class ln extends an{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Di=u(0,0),this.Ii=u(0,0),this.gu=!1}M({min:t,max:e}){return t.x===this.Di.x&&t.y===this.Di.y&&e.x===this.Ii.x&&e.y===this.Ii.y||(this.gu=!0,this.Di=t,this.Ii=e),this}Pi(){return this.Di}Fi(){return this.Ii}Oe(t){return t.x===this.Di.x&&t.y===this.Di.y||(this.gu=!0,this.Di=t),this}Ve(t){return t.x===this.Ii.x&&t.y===this.Ii.y||(this.gu=!0,this.Ii=t),this}}class un extends an{constructor(t,e,i,s,r){super(t,e,i,s,r),this.pu=void 0,this.mu=!1}}class cn extends an{constructor(t,e,i,s,r){super(t,e,i,s,r),this.yu=[],this.Ha=_e,this.Xa=new Array,this.$a=0,this.Qa=Lr.NearestX,this.Ja=!1,this.Su=p(void 0),this.Il=!1,this.Pl=!1}vu(t){return this.Su.M(t),this}xu(){return this.Su._()}tl(){return this.Xa}il(){return this.yu}qa(t){return this.Qa=t,this}Gt(){return this.Ja=!0,this.yu.length=0,this.$a=0,this.Xa=[],this.Ha=_e,this}al(){return this.$a-(Number(this.Il)+Number(this.Pl))}ll(){return this.Xa.length}El(t){return this.Il=t,this}zl(){return this.Il}Vl(t){return this.Pl=t,this}Ol(){return this.Pl}}const dn=t=>{const i=t.getDraggingMode();return void 0!==i&&i!==e.UIDraggingModes.notDraggable?i===e.UIDraggingModes.draggable?e.MouseStyles.Move:i===e.UIDraggingModes.onlyHorizontal?e.MouseStyles.Horizontal:e.MouseStyles.Vertical:void 0};class fn{constructor(){this.ji=!0,this.L=new r.Eventer,this.bu=0,this.Ct=(t,e,i)=>{0===this.bu&&this.L.emit("mouseEnter",this,e),this.bu+=1},this.kt=(t,e,i)=>{this.bu-=1,this.bu<1&&(this.L.emit("mouseLeave",this,e),this.bu=0)},this.Tt=(t,e,i)=>{this.L.emit("mouseClick",this,e)},this.Ft=(t,e,i)=>{this.L.emit("mouseDoubleClick",this,e)},this.It=(t,e,i)=>{this.L.emit("mouseDown",this,e)},this.Pt=(t,e,i)=>{this.L.emit("mouseUp",this,e)},this.Dt=(t,e,i)=>{this.L.emit("mouseMove",this,e)},this.Lt=(t,e,i,s)=>{this.L.emit("mouseDragStart",this,e,i)},this.Bt=(t,e,i,s,r,n)=>{this.L.emit("mouseDrag",this,e,i,s,r)},this.Rt=(t,e,i,s,r)=>{this.L.emit("mouseDragStop",this,e,i,s)},this.Et=(t,e,i)=>{this.L.emit("mouseWheel",this,e)},this.zt=(t,e)=>{this.bu+=1,this.L.emit("touchStart",this,e)},this.Vt=(t,e)=>{this.L.emit("touchMove",this,e)},this.Ot=(t,e)=>{this.bu-=1,this.L.emit("touchEnd",this,e)},this.Mu=t=>(t instanceof Xr?t.setMouseEnterEventHandler(this.Ct).setMouseLeaveEventHandler(this.kt).setMouseClickEventHandler(this.Tt).setMouseDoubleClickEventHandler(this.Ft).setMouseDownEventHandler(this.It).setMouseUpEventHandler(this.Pt).setMouseMoveEventHandler(this.Dt).setMouseDragEventHandler(this.Bt).setMouseDragStartEventHandler(this.Lt).setMouseDragStopEventHandler(this.Rt).setMouseWheelEventHandler(this.Et).setTouchStartEventHandler(this.zt).setTouchMoveEventHandler(this.Vt).setTouchEndEventHandler(this.Ot):(t.onMouseEnter(this.Ct),t.onMouseLeave(this.kt),t.onMouseClick(this.Tt),t.onMouseDoubleClick(this.Ft),t.onMouseDown(this.It),t.onMouseUp(this.Pt),t.onMouseMove(this.Dt),t.onMouseDrag(this.Bt),t.onMouseDragStart(this.Lt),t.onMouseDragStop(this.Rt),t.onMouseWheel(this.Et),t.onTouchStart(this.zt),t.onTouchMove(this.Vt),t.onTouchEnd(this.Ot)),t)}onMouseEnter(t){return this.L.on("mouseEnter",t)}onMouseLeave(t){return this.L.on("mouseLeave",t)}onMouseClick(t){return this.L.on("mouseClick",t)}onMouseDoubleClick(t){return this.L.on("mouseDoubleClick",t)}onMouseDown(t){return this.L.on("mouseDown",t)}onMouseUp(t){return this.L.on("mouseUp",t)}onMouseMove(t){return this.L.on("mouseMove",t)}onMouseDragStart(t){return this.L.on("mouseDragStart",t)}onMouseDrag(t){return this.L.on("mouseDrag",t)}onMouseDragStop(t){return this.L.on("mouseDragStop",t)}onMouseWheel(t){return this.L.on("mouseWheel",t)}onTouchStart(t){return this.L.on("touchStart",t)}onTouchMove(t){return this.L.on("touchMove",t)}onTouchEnd(t){return this.L.on("touchEnd",t)}offMouseEnter(t){return this.L.off(t,"mouseEnter")}offMouseLeave(t){return this.L.off(t,"mouseLeave")}offMouseClick(t){return this.L.off(t,"mouseClick")}offMouseDoubleClick(t){return this.L.off(t,"mouseDoubleClick")}offMouseDown(t){return this.L.off(t,"mouseDown")}offMouseUp(t){return this.L.off(t,"mouseUp")}offMouseMove(t){return this.L.off(t,"mouseMove")}offMouseDragStart(t){return this.L.off(t,"mouseDragStart")}offMouseDrag(t){return this.L.off(t,"mouseDrag")}offMouseDragStop(t){return this.L.off(t,"mouseDragStop")}offMouseWheel(t){return this.L.off(t,"mouseWheel")}offTouchStart(t){return this.L.off(t,"touchStart")}offTouchMove(t){return this.L.off(t,"touchMove")}offTouchEnd(t){return this.L.off(t,"touchEnd")}getIsUnderMouse(){return this.bu>0}setVisible(t){const e=this.ji!==t;return this.ji=t,e&&this.L.emit("visibleStateChanged",this,this.ji),this}getVisible(){return this.ji}onVisibleStateChanged(t){return this.L.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.L.off(t,"visibleStateChanged")}}const gn=(t,i,s)=>{const r=t.getDraggingMode();if(r!==e.UIDraggingModes.notDraggable){const n=t.scale.mi(t.getPosition(),{x:r!==e.UIDraggingModes.onlyVertical?i.x:0,y:r!==e.UIDraggingModes.onlyHorizontal?i.y:0}),o=t.scale,h=t.getSize(),a=t.getOrigin(),l=o.mi({x:o.x.getInnerStart(),y:o.y.getInnerStart()},ai({x:(1+a.x)/2,y:(1+a.y)/2},h)),u=o.mi({x:o.x.getInnerEnd(),y:o.y.getInnerEnd()},ai({x:(a.x-1)/2,y:(a.y-1)/2},h)),c={x:Math.min(Math.max(n.x,l.x),u.x),y:Math.min(Math.max(n.y,l.y),u.y)};t.setPosition(c),Zt(s)}},mn=(t,e,i,s,r)=>{gn(t,r,e)},yn=(t,e,i,s,r)=>{gn(t,s,r)};class pn extends fn{constructor(t,e,i,s,r){super(),this.position=u(50,50),this.origin=u(0,0),this.size=u(0,0),this.Xi=!1,this._u=void 0,this.wu=void 0,this.Cu=dn,this.ku=void 0,this.Lo=!0,this.Tu=()=>{const t="function"==typeof this.Cu?this.Cu(this):this.Cu;t&&(this.wu=this.Ts.cs.Ur(t))},this.Fu=()=>{this.Ts.cs.Yr(this.wu)},this.jt=x(0,0,0,0),this.Ts=t,this.renderingScale=e,this.scale=i,this.Oo=s,this.ts=r,this.Ts.vs(),this.onMouseEnter(this.Tu),this.onMouseLeave(this.Fu),this.onMouseDrag(mn);const n=Wi(new $i(kt,yn,kt));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd),this.ts=r}setMouseInteractions(t){return this.Iu().forEach((e=>e.setMouseInteractions(t))),this.Lo=t,this}getMouseInteractions(){return this.Lo}setEffect(t){return this.hs=this.hs||this.Ts.cs.hs.rs(this,{Pu:{shapes:this.Iu()}}),this.hs.Pu.Ss(t),this}getEffect(){return!!this.hs&&this.hs.Pu.xs()}setAutoDispose(t){return this.ku=t,this.Ts.vs(),this}getAutoDispose(){return this.ku}getSize(t=e.UISpace.Everything){return t===e.UISpace.Everything?u(this.size.x+(this.jt.left+this.jt.right),this.size.y+(this.jt.bottom+this.jt.top)):this.size}setContentSize(t){this.size=t}setMargin(t){return this.jt="object"==typeof t?A(this.jt,t):{left:t,top:t,right:t,bottom:t},this.Ts.vs(),this}getMargin(){return this.jt}Fe(){if(this.ku){const t=this.size,e=this.renderingScale.ai(),i={x:t.x/e.x,y:t.y/e.y};("max-width"===this.ku.type&&i.x>=this.ku.maxWidth||"max-height"===this.ku.type&&i.y>=this.ku.maxHeight)&&this.dispose()}return this}Ds(){return this}dispose(){return this.Xi||(this.Ts.vs(),this.Xi=!0,this.Oo(this),this.L.emit("dispose",this),this.Iu().forEach((t=>t.dispose()))),this}setVisible(t){return super.setVisible(t),this.Iu().forEach((e=>e.setVisible(t))),this.Ts.vs(),this}isDisposed(){return this.Xi}onDispose(t){return this.L.on("dispose",t)}offDispose(t){return this.L.off(t,"dispose")}setPosition(t){return this.position=t,this.Ts.vs(),this}getPosition(t=this.origin,i=e.UISpace.Everything){const s=this.getSize(e.UISpace.Everything),r=this.scale.mi(this.position,ai({x:-(this.origin.x+1)/2,y:-(this.origin.y+1)/2},s));if(i===e.UISpace.Everything)return this.scale.mi(r,ai({x:(t.x+1)/2,y:(t.y+1)/2},s));const n=this.scale.mi(r,{x:this.jt.left,y:this.jt.bottom}),o=this.getSize(e.UISpace.Content);return this.scale.mi(n,ai({x:(t.x+1)/2,y:(t.y+1)/2},o))}setOrigin(t){return this.origin=t,this.Ts.vs(),this}getOrigin(){return this.origin}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this._u=t,this.Ts.vs(),this}getDraggingMode(){return void 0!==this._u?this._u:e.UIDraggingModes.notDraggable}setMouseStyle(t){return this.Cu=t,this}getMouseStyle(){return this.Cu}}class xn extends pn{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.ya=x(),this.Du=0,this.Ts=t,this.Bu=s,this.backgroundElement=new this.Bu(this.Ts,this.renderingScale,this.scale,kt,n),this.Mu(this.backgroundElement)}Iu(){return this.backgroundElement.Iu()}onHighlight(t){return this.L.on("highlight",t)}offHighlight(t){return this.L.off(t)}setBackground(t){return t(this.backgroundElement),this}getBackground(){return this.backgroundElement}Fe(){return super.Fe(),this.Xi||this.backgroundElement.setOrigin(this.origin).setPosition(this.getPosition(this.origin,e.UISpace.PaddedBackground)).Fe(),this}Ds(){const t=this.getSize(e.UISpace.PaddedContent);return this.backgroundElement.Lu(t).Ds(),super.Ds()}dispose(){return super.dispose(),this.backgroundElement.dispose(),this}setVisible(t){return super.setVisible(t),this.backgroundElement.setVisible(t),this}setPadding(t){return this.ya="object"==typeof t?A(this.ya,t):{left:t,top:t,right:t,bottom:t},this.Ts.vs(),this}getPadding(){return this.ya}getSize(t=e.UISpace.Everything){let i=super.getSize(t);return t>=e.UISpace.PaddedContent&&(i=u(i.x+this.ya.left+this.ya.right,i.y+this.ya.bottom+this.ya.top)),t>=e.UISpace.PaddedBackground&&(i=u(i.x+this.backgroundElement.Ru()+this.backgroundElement.Eu(),i.y+this.backgroundElement.zu()+this.backgroundElement.Vu())),i}getPosition(t=this.origin,i=e.UISpace.Everything){if(i===e.UISpace.Everything)return super.getPosition(t,i);const s=super.getPosition(u(-1,-1),e.UISpace.Everything),r=this.getMargin(),n=this.scale.mi(s,{x:r.left,y:r.bottom});if(i===e.UISpace.PaddedBackground){const i=this.getSize(e.UISpace.PaddedBackground);return this.scale.mi(n,ai({x:(t.x+1)/2,y:(t.y+1)/2},i))}const o=this.scale.mi(n,{x:this.backgroundElement.Ru(),y:this.backgroundElement.zu()});if(i===e.UISpace.PaddedContent){const i=this.getSize(e.UISpace.PaddedContent);return this.scale.mi(o,ai({x:(t.x+1)/2,y:(t.y+1)/2},i))}const h=this.getPadding(),a=this.scale.mi(o,{x:h.left,y:h.bottom}),l=this.getSize(e.UISpace.Content);return this.scale.mi(a,ai({x:(t.x+1)/2,y:(t.y+1)/2},l))}setMouseInteractions(t){return super.setMouseInteractions(t),this.backgroundElement.setMouseInteractions(t),this}getHighlight(){return this.Du}setHighlight(t){return this.Du=Ae(t),this.backgroundElement.setHighlight(t),this.L.emit("highlight",this,t),this}}const Sn=t=>"setBackground"in t;class An extends fn{constructor(t,e,i,s,r,n,o,h,a,l,u){super(),this.S=0,this.Ou=1,this.Nu=!0,this.Gu=new rr,this.Wu=!0,this.Xi=!1,this.axisScale=s,this.renderingScale=r,this.Uu=o,this.Yu=h,this.Hu=a,this.Oo=l,this.$u=e,this.Xu=i,this.ju=this.Mu(this.$u.ze(this.renderingScale)),this.ts=u,this.Zu=this.Mu(this.Hu.Qu(this.Xu,this.renderingScale,n,kt,this.ts,!1).setOrigin(jt(this.Yu)).setDirection(this.Yu)),this.axis=t,this.setMouseInteractions(!1),"major"===this.Zu.Ju?this.ju.Ee(u.xAxisNumericTicks.majorTickStyle.gridStrokeStyle):"minor"===this.Zu.Ju?this.ju.Ee(u.xAxisNumericTicks.minorTickStyle.gridStrokeStyle):"other"===this.Zu.Ju&&this.ju.Ee(u.cursorGridStrokeStyleX)}setValue(t){return this.S=t,this.Xu.vs(),this.L.emit("valueChange",this,this.S),this}getValue(){return this.S}setTextFormatter(t){return this.Ku=t,this.Xu.vs(),this}setTickLength(t){return this.Zu.setPointerLength(t),this.$u.vs(),this}getTickLength(){return this.Zu.getPointerLength()}setTickLabelPadding(t){return this.Zu.setTickLabelPadding(t),this.$u.vs(),this}setTickLabelRotation(t){return this.Zu.setTextRotation(t),this.$u.vs(),this}getTickLabelRotation(){return this.Zu.getTextRotation()}getTickLabelPadding(){return this.Zu.getTickLabelPadding()}setGridStrokeLength(t){return this.Ou=t,this.$u.vs(),this}getGridStrokeLength(){return this.Ou}setGridStrokeStyle(t){return this.ju.Ee(t),this.$u.vs(),this}getGridStrokeStyle(){return this.ju.cu()}dispose(){return this.Xi||(this.Xi=!0,this.ju.dispose(),this.Zu.dispose(),this.Oo(this),this.$u.cs.vs(),this.L.emit("dispose",this)),this}onDispose(t){return this.L.on("dispose",t)}offDispose(t){return this.L.off(t,"dispose")}setMarkerVisible(t){return this.Nu=t,this.Xu.vs(),this}getMarkerVisible(){return this.Nu}setMarker(t){return t(this.Zu),this.Xu.vs(),this}getMarker(){return this.Zu}setMouseInteractions(t){return this.Zu.setMouseInteractions(t),this.ju.setMouseInteractions(t),this}getMouseInteractions(){return this.ju.getMouseInteractions()}setAllocatesAxisSpace(t){return this.Wu=t,this.Xu.vs(),this}getAllocatesAxisSpace(){return this.Wu}isInScale(){return He(this.S,this.axisScale.getInnerStart(),this.axisScale.getInnerEnd())}onValueChange(t){return this.L.on("valueChange",t)}offValueChange(t){return this.L.off(t,"valueChange")}}class vn extends An{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,u,a,l),this.qu=!1,this.Oo=a,this.$u=e,this.Xu=i}dispose(){return this.qu=!1,super.dispose()}update(){return this}plot(t,e,i,s,r){if(this.isInScale()&&this.getVisible()&&t){this.qu=!1;const t=ct(this.S,this.axisScale,this.Uu.getWidth(this.renderingScale));this.ju.setVisible(!0).Oe(this.Uu.toPoint(t,e)).Ve(this.Uu.toPoint(t,e-(s+i*this.Ou))),this.Nu?(this.Ku&&this.Zu.setText(this.Ku(this.S,this)),this.Zu.setVisible(!0).setPosition(this.Uu.toPoint(t,r))):this.Zu.setVisible(!1)}else this.ju.setVisible(!1),this.Zu.setVisible(!1);return this.Zu.Ds().Fe(),this}tc(){const t=this.Zu.Ds().getSize();return this.Uu.getHeight(t)}}const bn=(t,e)=>t.setTextFillStyle(e.uiTextFillStyle).setTextFont(e.uiTextFont),Mn=(t,e)=>(le(t.setButtonSize(e.uiButtonSize),e,!1,{fill:e.uiButtonFillStyle}),t),En=(t,e,i)=>{i&&Sn(t)&&t.setBackground((t=>t.setFillStyle(e.uiBackgroundFillStyle).setStrokeStyle(e.uiBackgroundStrokeStyle))).setEffect(!0)},Tn={uiElement:void 0,stylers:o.List(),addStyler(t){return{...this,stylers:this.stylers.push(t)}},applyStylers(t,e){return this.stylers.forEach((i=>void 0!==i?i(t,e):void 0)),t}},wn={background:void 0,setBackground(t){return{...this,background:t}}},kn={Qu(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,s,r),r);return En(o,r,n),o}},Cn={Qu(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.background,s,r),r);return En(o,r,n),o}};class Rn extends pn{constructor(){super(...arguments),this.ic=!0}Fe(){return super.Fe(),this}setMouseInteractions(t){return this.ic=t,this}getMouseInteractions(){return this.ic}Iu(){return[]}}class In extends Rn{onHighlight(t){return this.L.on("highlight",t)}offHighlight(t){return this.L.off(t)}Lu(t){return this.size=t,this}Ru(){return 0}Eu(){return 0}Vu(){return 0}zu(){return 0}setHighlight(t){return this}getHighlight(){return 0}setFillStyle(){return this}getFillStyle(){return z}setStrokeStyle(){return this}getStrokeStyle(){return ot}setStrokeThickness(){return this}getStrokeThickness(){return 0}}class Fn extends pn{constructor(){super(...arguments),this.L=new r.Eventer,this.Du=0}onHighlight(t){return this.L.on("highlight",t)}offHighlight(t){return this.L.off(t)}getHighlight(){return this.Du}setHighlight(t){return this.Du=t,this.Iu().forEach((e=>e.ds(t))),this.L.emit("highlight",this,t),this.Ts.vs(),this}}class Dn extends Fn{}class Ln extends Dn{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.Ts=t,this.Ga=this.Ts.sc(this.renderingScale,hn.Simple).setVisible(!1).ke(z).Ce(ot),this.Mu(this.Ga)}hc(){const t=this.rc();if(t.length>2){const e=Ze(t),i=u(e.max.x-e.min.x,e.max.y-e.min.y);this.setContentSize(i);const s=t.map((t=>{const s=oi(t,ni(e.min,-1));return this.scale.mi(this.position,oi(s,ai(ni(oi(this.origin,u(1,1)),-.5),i)))})).map((t=>dt(t,this.scale,this.renderingScale)));this.Ga.Sl(s).setVisible(this.getVisible()).setVisible(this.getVisible())}else this.Ga&&this.Ga.setVisible(!1),this.setContentSize(u(0,0))}Fe(){return super.Fe(),this.Xi||this.hc(),this}Ds(){return this.hc(),super.Ds()}setVisible(t){return super.setVisible(t),this.Ga.setVisible(t),this}}const Vn=(t,e,i)=>t*(1-i)+e*i,_n=(t,e,i,s,r)=>{if(void 0===e.value||void 0===i.value||void 0===s.value||void 0===r.value)return;const n=(t.x-i.point.x)/(r.point.x-i.point.x),o=(r.point.y-i.point.y)*n+i.point.y,h=(t.x-e.point.x)/(s.point.x-e.point.x),a=(s.point.y-e.point.y)*h+e.point.y,l=(t.y-a)/(o-a),u=Vn(i.value,r.value,n),c=Vn(e.value,s.value,h);return Vn(c,u,l)},Pn={warm:t=>e=>w(60/(t-1)*e,.8,.8),cold:t=>e=>w(60/(t-1)*e+180,.8,.8),fullSpectrum:t=>e=>w(360/t*e,.8,.8),reverseSpectrum:t=>e=>w(360/t*(t-e),.8,.8),flatUI:t=>e=>w(360/t*e+8,.8,.8-.15/t*e),arction:t=>e=>{const i=1-.2/t*e;return w(360/t*e+51,i,i)},arctionWarm:t=>e=>{const i=t-1,s=1-.2/i*e;return w(46-46/i*e+4,s,s)},sunset:t=>e=>{const i=[170,320];return w(e%2?i[0]:i[1],.8,.5+.5/(t-1)*e)},dynamic:t=>e=>{const i=e%2,s=[234,346];return w(i?s[0]:s[1],i?.3:.9,.5+.5/(t-1)*e)},magenta:t=>e=>{const i=[.9,.6];return w(354,e%2?i[0]:i[1],.5+.5/(t-1)*e)},greyscale:t=>e=>w(0,0,.25+.5/(t-1)*e),frozen:t=>e=>{const i=[.8,.6];return w(160+80/(t-1)*e,.6,e%2?i[0]:i[1])},retro:t=>e=>{const i=[6,183];return w(e%2?i[0]:i[1],.7,.5+.5/(t-1)*e)},crayons:t=>e=>{let i=180+230/(t-1)*e;return i>360&&(i-=360),w(i,.9,.8)},custom:(t,e)=>i=>{const s=.25+.5/(t-1)*i;if(!e)return w(0,0,s);const r=e.getR()/255,n=e.getG()/255,o=e.getB()/255,h=Math.max(r,n,o),a=Math.min(r,n,o);let l=0;if(h!==a){const t=h-a;switch(h){case r:l=(n-o)/t+(nr=>n=>w(t+(e-t)/r*n,i,s),auroraBorealis:t=>e=>Bn([{value:0,hex:"#23FF7A"},{value:1/9,hex:"#03E65D"},{value:2/9,hex:"#04D155"},{value:3/9,hex:"#00B849"},{value:4/9,hex:"#00A869"},{value:5/9,hex:"#008F68"},{value:6/9,hex:"#00815E"},{value:7/9,hex:"#017153"},{value:8/9,hex:"#704A85"},{value:1,hex:"#743A70"}],t,e),blueSciFi:t=>e=>Bn([{value:0,hex:"#FFFFFF"},{value:1/9,hex:"#E2E7FF"},{value:2/9,hex:"#ACB9F8"},{value:3/9,hex:"#889DFF"},{value:4/9,hex:"#547EEF"},{value:5/9,hex:"#4068D8"},{value:6/9,hex:"#2B50B7"},{value:7/9,hex:"#1B3E9F"},{value:8/9,hex:"#8D1395"},{value:1,hex:"#780A74"}],t,e),light:t=>e=>Bn([{value:0,hex:"#FECC00"},{value:1/9,hex:"#F7B300"},{value:2/9,hex:"#EF9900"},{value:3/9,hex:"#E88000"},{value:4/9,hex:"#E06600"},{value:5/9,hex:"#DD5A00"},{value:6/9,hex:"#D94D00"},{value:7/9,hex:"#D13300"},{value:8/9,hex:"#C91A00"},{value:1,hex:"#C10000"}],t,e),monochrome:t=>e=>Bn([{value:0,hex:"#FFFFFF"},{value:1/9,hex:"#EEEEEE"},{value:2/9,hex:"#DCDCDC"},{value:3/9,hex:"#C1C1C1"},{value:4/9,hex:"#A4A2A2"},{value:5/9,hex:"#8B8B8B"},{value:6/9,hex:"#787878"},{value:7/9,hex:"#656565"},{value:8/9,hex:"#565555"},{value:1,hex:"#434343"}],t,e),night:t=>e=>Bn([{value:0,hex:"#F0F9E0"},{value:1/9,hex:"#C9DFA4"},{value:2/9,hex:"#B5C796"},{value:3/9,hex:"#8998B7"},{value:4/9,hex:"#6E7E9E"},{value:5/9,hex:"#5C6D8F"},{value:6/9,hex:"#47587A"},{value:7/9,hex:"#374B72"},{value:8/9,hex:"#273C65"},{value:1,hex:"#192847"}],t,e),sunset2:t=>e=>Bn([{value:0,hex:"#22334D"},{value:1/9,hex:"#82062C"},{value:2/9,hex:"#AB001D"},{value:3/9,hex:"#D80428"},{value:4/9,hex:"#CF5D1B"},{value:5/9,hex:"#CF8229"},{value:6/9,hex:"#CF9D29"},{value:7/9,hex:"#C4BE25"},{value:8/9,hex:"#E1DC49"},{value:1,hex:"#FFFA67"}],t,e)},Bn=(t,e,i)=>{const s=Nn(e,i),[r,n]=Un(s,t),o=zn(t[r]),h=zn(t[n]),a=0!==o.value?(h.value-s)/o.value:0,l={value:a,h:Vn(o.h,h.h,a),s:Vn(o.s,h.s,a),v:Vn(o.v,h.v,a)};return w(l.h,l.s,l.v)},zn=t=>{const e=(t=>{const e=t.r,i=t.g,s=t.b,r=Math.max(e,i,s),n=Math.min(e,i,s);let o=0;const h=r,a=r-n,l=0===r?0:a/r;if(r===n)o=0;else{switch(r){case e:o=(i-s)/a+(i{const i=e/t;return i<0?0:i>1?1:i},Un=(t,e)=>{if(e.length<2)throw new Error("Invalid palette size");for(let i=0;i!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"image"===t.fillType),Kn={Dotted:[1,3],DottedDense:[1,1],Dashed:[3,1],DashedEqual:[2,2],DashedLoose:[2,4],DashDotted:[3,2,1,2]},Jn=s.Record({type:"linestyle",lineType:"dashed",pattern:Kn.DashedEqual,fillStyle:new G({color:E(255,255,255)}),thickness:1,patternScale:3});class qn extends Jn{constructor(t){super({...t,lineType:"dashed"})}setFillStyle(t){return"function"==typeof t?this.set("fillStyle",t(this.getFillStyle())):this.set("fillStyle",t)}getFillStyle(){return this.get("fillStyle")}setThickness(t){return"function"==typeof t?this.set("thickness",t(this.getThickness())):this.set("thickness",t)}getThickness(){return this.get("thickness")}O(){const t=this.getThickness();return t<0?1:t}setPattern(t){return"function"==typeof t?this.set("pattern",t(this.getPattern())):this.set("pattern",t)}getPattern(){return this.get("pattern")}setPatternScale(t){return"function"==typeof t?this.set("patternScale",t(this.getPatternScale())):this.set("patternScale",t)}getPatternScale(){return this.get("patternScale")}}const Qn=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"dashed"!==t.lineType),to=s.Record({type:"icon",width:void 0,height:void 0,nc:void 0,oc:kt,ac:kt});class eo extends to{constructor(t,e,i,s){super({...s,nc:t,oc:e,ac:i})}dispose(){return this.ac(this),this}setWidth(t){const e=this.set("width",t);return this.oc(e),e}getWidth(){return this.get("width")}setHeight(t){const e=this.set("height",t);return this.oc(e),e}getHeight(){return this.get("height")}setSize(t,e){const i=this.withMutations((i=>{i.set("width",t).set("height",e)}));return this.oc(i),i}ai(){if(!this.nc)return{x:0,y:0};const t=this.nc.width,e=this.nc.height;if(0===t||0===e)return{x:0,y:0};const i=this.width,s=this.height;return"number"==typeof i&&"number"==typeof s?{x:i,y:s}:"number"==typeof i?{x:i,y:e*i/t}:"number"==typeof s?{x:t*s/e,y:s}:{x:t,y:e}}}const io=t=>!(!t||"object"!=typeof t||!("type"in t)||"icon"!==t.type),so=s.Record({type:"glow",color:E(255,255,255,50),spread:1,blur:4,offset:{x:0,y:0}});class ro extends so{constructor(t){super(t)}setSpread(t){return this.set("spread","function"==typeof t?t(this.get("spread")):t)}getSpread(){return this.get("spread")}setBlur(t){return this.set("blur","function"==typeof t?t(this.get("blur")):t)}getBlur(){return this.get("blur")}setColor(t){return this.set("color","function"==typeof t?t(this.get("color")):t)}getColor(){return this.get("color")}setOffset(t){return this.set("offset","function"==typeof t?t(this.get("offset")):t)}getOffset(){return this.get("offset")}}class no{constructor(t){this.lc=0,this.uc=0,this.cc=0,this.dc=!1,this.fc=!0,this.Ac=!1,this.gc={warningDisplayed:!1,expandEvents:[]},this.L=new r.Eventer,this.fc=!t||void 0===t.autoSortingEnabled||t.autoSortingEnabled,void 0!==(null==t?void 0:t.dataPattern)&&(this.mc={userSpecified:null===t.dataPattern?void 0:t.dataPattern}),this.yc=void 0!==(null==t?void 0:t.lookupValues)&&t.lookupValues,this.Sc=void 0!==(null==t?void 0:t.colors)&&t.colors,this.vc=void 0!==(null==t?void 0:t.ids)&&t.ids,this.xc=void 0!==(null==t?void 0:t.sizes)&&t.sizes,this.bc=void 0!==(null==t?void 0:t.rotations)&&t.rotations,this.Mc=(null==t?void 0:t.dataStorage)?t.dataStorage:Float64Array,this._c=!1!==(null==t?void 0:t.allowInputModification)}add(t){return Array.isArray(t)?this.appendJSON(t,{x:"x",y:"y"}):this.appendSample(t),this}addArraysXY(t,e){return this.appendSamples({xValues:t,yValues:e}),this}appendJSON(t,e={x:"x",y:"y"}){const i=t.length,s=e.x,r=e.y,n=e.lookupValue,o=e.size,h=e.rotation,a=e.color,l=e.id;let u,c,d,f,g,m,y;if(s){u=new this.Mc(i);for(let e=0;ea-1&&(this.lc=0,this.dc=!0),this.uc=Math.min(this.uc+1,a),this.cc+=1,this}appendSamples(t){const{lookupValues:e,colors:i,ids:s,sizes:r,rotations:n,start:o,step:h}=t;let a=t.offset,l=t.count;const u=t.xValues||t.yValues;if(!u)return this;const c=u.length;if(a=void 0!==a?a:0,l=void 0!==l?l:c-a,l<=0)return this;const d=void 0!==t.offsetLookupValues?t.offsetLookupValues:a,f=void 0!==t.offsetColors?t.offsetColors:a,g=void 0!==t.offsetIds?t.offsetIds:a,m=void 0!==t.offsetSizes?t.offsetSizes:a,y=void 0!==t.offsetRotations?t.offsetRotations:a,[p,x]=this.Bc(l,t.xValues,"x",o,h,a),[S,A]=this.Bc(l,t.yValues,"y",o,h,a),v=this.Pc(i),{samplesCacheX:b,samplesCacheY:M,samplesCacheLookup:E,samplesCacheColors:T,samplesCacheIDs:w,samplesCacheSize:k,samplesCacheRotation:C,maxSampleCount:R,dataPattern:I,incomingDataReplacedCache:F}=this.wc({appendCount:l,...0===x&&0===A&&0===a&&0===d&&0===f&&0===g&&0===m&&0===y?{incomingDataX:p,incomingDataY:S,incomingDataLookup:e,incomingDataIDs:s,incomingDataColors:v,incomingDataSize:r,incomingDataRotation:n}:{}});if(!F&&I&&this.fc&&this.kc&&this.Tc){const t=p[x],i=S[A];if(!this.Fc(I,t,i)&&!this.Ac)return this.Ic(this.kc,this.Tc,co(p,x,x+l),co(S,A,A+l),co(e,d,d+l),co(v,f,f+l),co(s,g,g+l),co(r,m,m+l),co(n,y,y+l),I),this}const D=R-this.lc,L=Math.min(l,D);if(L>0&&(F||(lo(b,p,x,L,this.lc),lo(M,S,A,L,this.lc),e&&E&&lo(E,e,d,L,this.lc),s&&w&&lo(w,s,g,L,this.lc),v&&T&&lo(T,v,f,L,this.lc),r&&k&&lo(k,r,m,L,this.lc),n&&C&&lo(C,n,y,L,this.lc)),this.Dc(this.lc,this.lc+L-1),this.lc+=L,this.lc>R-1&&(this.lc=0,this.dc=!0)),this.uc=Math.min(this.uc+L,R),this.cc+=L,this.Lc(),l-L>0){const t={xValues:p?co(p,x+L,void 0):void 0,yValues:S?co(S,A+L,void 0):void 0,lookupValues:e?co(e,d+L,void 0):void 0,ids:s?co(s,g+L,void 0):void 0,colors:v?co(v,f+L,void 0):void 0,sizes:r?co(r,m+L,void 0):void 0,rotations:n?co(n,y+L,void 0):void 0};this.appendSamples(t)}return this}setSamples(t){return this.clear().appendSamples(t)}fill(t){const e=this.kc||this.Tc;if(!e)return this;const i=e.length;if(void 0!==t.x&&(this.kc=this.kc||new this.Mc(i),this.kc.fill(t.x)),void 0!==t.y&&(this.Tc=this.Tc||new this.Mc(i),this.Tc.fill(t.y)),void 0!==t.lookupValue&&(this.Rc=this.Rc||new Float32Array(i),this.Rc.fill(t.lookupValue)),void 0!==t.color){const e=this.Pc([t.color]);e&&(this.Ec=this.Ec||new Uint32Array(i),this.Ec.fill(e[0]))}return void 0!==t.size&&(this.zc=this.zc||new Float32Array(i),this.zc.fill(t.size)),void 0!==t.rotation&&(this.Vc=this.Vc||new Float32Array(i),this.Vc.fill(t.rotation)),this.L.emit("cleared"),this}alterSamples(t,e){const{xValues:i,yValues:s,lookupValues:r,colors:n,ids:o,sizes:h,rotations:a}=e;let l=e.offset,u=e.count;const c=i||s||r||n||o||h||a;if(!c)return this;const d=c.length;if(l=void 0!==l?l:0,u=void 0!==u?u:d-l,u<=0)return this;const f=void 0!==e.offsetLookupValues?e.offsetLookupValues:l,g=void 0!==e.offsetColors?e.offsetColors:l,m=void 0!==e.offsetIds?e.offsetIds:l,y=void 0!==e.offsetSizes?e.offsetSizes:l,p=void 0!==e.offsetRotations?e.offsetRotations:l,x=this.Pc(n),S=this.cc-1,A=void 0!==this.Oc?Math.max(this.cc-this.Oc,0):0,v=t+u-1,b=Math.max(t,A),M=Math.min(v,S),E=M-b+1;if(this.cc>0&&E>0){const{samplesCacheX:e,samplesCacheY:n,samplesCacheColors:u,samplesCacheIDs:c,samplesCacheLookup:d,samplesCacheSize:S,samplesCacheRotation:v}=this.wc({appendCount:0}),T=e.length;if(void 0!==this.Oc&&this.dc&&this.cc%this.Oc!=0){const A=this.cc-this.cc%this.Oc,E=this.cc-1,w=this.cc-this.uc,k=A-1,C=Math.max(b,w),R=Math.min(M,k)-C+1;if(R>0){const A=C-t,b=oo(C,this.cc,T,this.lc);i&&lo(e,i,l+A,R,b),s&&lo(n,s,l+A,R,b),r&&d&&lo(d,r,f+A,R,b),o&&c&&lo(c,o,m+A,R,b),x&&u&&lo(u,x,g+A,R,b),h&&S&&lo(S,h,y+A,R,b),a&&v&&lo(v,a,p+A,R,b)}const I=Math.max(b,A),F=Math.min(M,E)-I+1;if(F>0){const A=I-t,b=oo(I,this.cc,T,this.lc);i&&lo(e,i,l+A,F,b),s&&lo(n,s,l+A,F,b),r&&d&&lo(d,r,f+A,F,b),o&&c&&lo(c,o,m+A,F,b),x&&u&&lo(u,x,g+A,F,b),h&&S&&lo(S,h,y+A,F,b),a&&v&&lo(v,a,p+A,F,b)}}else{const t=b-A;i&&lo(e,i,l,E,t),s&&lo(n,s,l,E,t),r&&d&&lo(d,r,f,E,t),o&&c&&lo(c,o,m,E,t),x&&u&&lo(u,x,g,E,t),h&&S&&lo(S,h,y,E,t),a&&v&&lo(v,a,p,E,t)}this.L.emit("cleared")}const T=t+u-1-S;if(T>0){const e=M+1-t;this.appendSamples({xValues:i,yValues:s,lookupValues:r,colors:n,ids:o,sizes:h,rotations:a,offset:l+e,offsetLookupValues:f+e,offsetColors:g+e,offsetIds:m+e,offsetSizes:y+e,offsetRotations:p+e,count:T})}return this}alterSamplesByID(t,e){if(!this.vc)throw new Error("LightningChart JS attempted to use alterSamplesByID on DataSetXY that doesn't have IDs enabled.");const i=t.length,s=this.Nc;if(i<=0||!s)return this;const r=(("object"==typeof e.color?this.Pc([e.color]):"number"==typeof e.color?[e.color]:[])||[])[0],n=Array.isArray(e.xValues)?new this.Mc(e.xValues):e.xValues,o=Array.isArray(e.yValues)?new this.Mc(e.yValues):e.yValues,h=Array.isArray(e.yValues)?new Float32Array(e.yValues):e.yValues,a=this.Pc(e.colors),l=Array.isArray(e.sizes)?new Float32Array(e.sizes):e.sizes,u=Array.isArray(e.rotations)?new Float32Array(e.rotations):e.rotations,c=s.length,d=this.uc,f=this.cc-1,g=Math.max(f-d+1,0);for(let d=0;ds[oo(t,this.cc,c,this.lc)])),y=oo(m,this.cc,c,this.lc);s[y]===i&&(void 0!==e.x&&this.kc&&(this.kc[y]=e.x),void 0!==e.y&&this.Tc&&(this.Tc[y]=e.y),void 0!==e.lookupValue&&this.Rc&&(this.Rc[y]=e.lookupValue),void 0!==e.size&&this.zc&&(this.zc[y]=e.size),void 0!==e.rotation&&this.Vc&&(this.Vc[y]=e.rotation),void 0!==r&&this.Ec&&(this.Ec[y]=r),n&&this.kc&&(this.kc[y]=n[d]),o&&this.Tc&&(this.Tc[y]=o[d]),h&&this.Rc&&(this.Rc[y]=h[d]),a&&this.Ec&&(this.Ec[y]=a[d]),l&&this.zc&&(this.zc[y]=l[d]),u&&this.Vc&&(this.Vc[y]=u[d]))}return this.L.emit("cleared"),this}clear(){return this.lc=0,this.uc=0,this.cc=0,this.dc=!1,this.L.emit("cleared"),this}getSampleCount(){return this.uc}getNextSampleIndex(){return this.cc}setMaxSampleCount(t){if("object"==typeof t){this.Gc&&this.offMaxSampleCountExceeded(this.Gc);const e=t.max;this.Gc=this.onMaxSampleCountExceeded(((t,i,s,r)=>{if(void 0!==e&&s>=e)return;let n=2*s;void 0!==e&&(n=Math.min(n,e)),this.setMaxSampleCount(n)})),void 0===this.Oc&&this.setMaxSampleCount(1e5)}else if("number"==typeof t){const e=t;if(void 0!==this.Oc&&this.Oc>e)throw new Error("LightningChart JS | DataSetXY.setMaxSampleCount attempted to shrink data set. This is currently not supported.");if(!this.kc||!this.Tc)return this.Oc=e,this;if(e===this.Oc)return this;if(this.dc&&0!==this.lc)throw new Error("LightningChart JS | DataSetXY.setMaxSampleCount attempted to expand data set that has exceeded its max sample count. This is currently not supported.");this.Oc=e,this.uct+e.count),0),r=new this.Mc(s),n=new this.Mc(s),o=this.Sc?new Uint32Array(s):void 0,h=this.yc?new Float32Array(s):void 0,a=this.vc?new Uint32Array(s):void 0,l=this.xc?new Float32Array(s):void 0,u=this.bc?new Float32Array(s):void 0;let c=0;for(const t of i)r.set(this.kc.subarray(t.offset,t.offset+t.count),c),n.set(this.Tc.subarray(t.offset,t.offset+t.count),c),this.Sc&&o&&this.Ec&&o.set(this.Ec.subarray(t.offset,t.offset+t.count),c),this.yc&&h&&this.Rc&&h.set(this.Rc.subarray(t.offset,t.offset+t.count),c),this.vc&&a&&this.Nc&&a.set(this.Nc.subarray(t.offset,t.offset+t.count),c),this.xc&&l&&this.zc&&l.set(this.zc.subarray(t.offset,t.offset+t.count),c),this.bc&&u&&this.Vc&&u.set(this.Vc.subarray(t.offset,t.offset+t.count),c),c+=t.count;return{xValues:r,yValues:n,lookupValues:h,colors:o,ids:a,sizes:l,rotations:u}}onMaxSampleCountExceeded(t){return this.L.on("maxSampleCountExceeded",t)}offMaxSampleCountExceeded(t){return this.L.off(t)}Bc(t,e,i,s,r,n){if(void 0===e){const e=this.Cc();r=void 0!==r?r:1,s=void 0!==s?s:e?e[i]+r:0;const n=new this.Mc(t);for(let e=0;et){e=s;break}const l={xValues:i,yValues:s,lookupValues:r,colors:n,ids:o,sizes:h,rotations:a,offset:e};this.Ac=!0,this.appendSamples(l),this.Ac=!1}else{const l=t.length,u=this.uc,f=this.cc-1,g=Math.max(f-u+1,0),m=ao(d,g,f,(e=>t[oo(e,this.cc,l,this.lc)])),y=m-1,p=m+1,x=t[oo(m,this.cc,l,this.lc)],S=p<=this.cc-1?t[oo(p,this.cc,l,this.lc)]:void 0,A=void 0!==S&&S0){const e=void 0!==this.Oc&&this.dc?this.lc:0,i=this.uc-1,s=void 0!==this.Oc&&this.dc?0:void 0,r=void 0!==this.Oc&&this.dc?this.lc-1:void 0,[n,o]=void 0!==s&&void 0!==r&&Math.abs(r-s)>Math.abs(i-e)?[s,r]:[e,i];if(1+o-n>=2){let e,i,s=this.kc[n],r=this.Tc[n];for(let t=n+1;t<=o;t+=1){if(!1!==e){const i=this.kc[t],r=Math.sign(i-s);0!==r&&e&&e.direction!==r?e=!1:0===r||e||(e={direction:r}),s=i}if(!1!==i){const e=this.Tc[t],s=Math.sign(e-r);0!==s&&i&&i.direction!==s?i=!1:0===s||i||(i={direction:s}),r=e}}t=e&&e.direction>0?Dr.ProgressiveX:e&&e.direction<0?Dr.RegressiveX:i&&i.direction>0?Dr.ProgressiveY:i&&i.direction<0?Dr.RegressiveY:void 0,this.mc={autoDetectResult:t},t&&bt.console.warn(`LightningChart JS DataSetXY warning | Data pattern was detected automatically (DataPatterns.${t}).\nAutomatic detection is only intended for kick-starting application development, not for production use.\nAdd { dataPattern: '${t}'} } to your application when creating series or DataSetXY to get clear this warning.`)}}if(t&&"ProgressiveX"!==t)throw new Error("LightningChart JS New XY rework beta features do not yet support other data patterns than ProgressiveX. This will be introduced in near future.");return t}Fc(t,e,i){const s=this.Cc();return!s||("ProgressiveX"===t?e>s.x:"RegressiveX"===t?es.y:"RegressiveY"!==t||ii-t.timestamp<5e3)),e>1e3&&this.gc.expandEvents.push({timestamp:i}),this.gc.expandEvents.length>5)return bt.console.warn("LightningChart JS warning - DataSetXY append operation was performed more than 5 times in 5 seconds.\nAutomatic max sample count control was enabled.\nFor streaming applications, DataSetXY.setMaxSampleCount() or Series.setMaxSampleCount() should be configured explicitly to get rid of this warning."),this.gc.warningDisplayed=!0,this.setMaxSampleCount({mode:"auto"}),this.wc(t)}const i=new this.Mc(e);i.set(this.kc),this.kc=i;const s=new this.Mc(e);if(s.set(this.Tc),this.Tc=s,this.yc){const t=new Float32Array(e);this.Rc&&t.set(this.Rc),this.Rc=t}if(this.vc){const t=new Uint32Array(e);this.Nc&&t.set(this.Nc),this.Nc=t}if(this.Sc){const t=new Uint32Array(e);this.Ec&&t.set(this.Ec),this.Ec=t}if(this.xc){const t=new Float32Array(e);this.zc&&t.set(this.zc),this.zc=t}if(this.bc){const t=new Float32Array(e);this.Vc&&t.set(this.Vc),this.Vc=t}return this.lc=this.uc,{dataPattern:this.Lc(),samplesCacheX:this.kc,samplesCacheY:this.Tc,samplesCacheLookup:this.Rc,samplesCacheIDs:this.Nc,samplesCacheColors:this.Ec,samplesCacheSize:this.zc,samplesCacheRotation:this.Vc,maxSampleCount:e}}if(i>4*e){const t=new this.Mc(e);t.set(this.kc.subarray(0,this.uc)),this.kc=t;const i=new this.Mc(e);if(i.set(this.Tc.subarray(0,this.uc)),this.Tc=i,this.yc){const t=new Float32Array(e);this.Rc&&t.set(this.Rc.subarray(0,this.uc)),this.Rc=t}if(this.vc){const t=new Uint32Array(e);this.Nc&&t.set(this.Nc.subarray(0,this.uc)),this.Nc=t}if(this.Sc){const t=new Uint32Array(e);this.Ec&&t.set(this.Ec.subarray(0,this.uc)),this.Ec=t}if(this.xc){const t=new Float32Array(e);this.zc&&t.set(this.zc.subarray(0,this.uc)),this.zc=t}if(this.bc){const t=new Float32Array(e);this.Vc&&t.set(this.Vc.subarray(0,this.uc)),this.Vc=t}return{dataPattern:this.Lc(),samplesCacheX:this.kc,samplesCacheY:this.Tc,samplesCacheLookup:this.Rc,samplesCacheIDs:this.Nc,samplesCacheColors:this.Ec,samplesCacheSize:this.zc,samplesCacheRotation:this.Vc,maxSampleCount:e}}return{dataPattern:this.Lc(),samplesCacheX:this.kc,samplesCacheY:this.Tc,samplesCacheLookup:this.Rc,samplesCacheIDs:this.Nc,samplesCacheColors:this.Ec,samplesCacheSize:this.zc,samplesCacheRotation:this.Vc,maxSampleCount:i}}return t.appendCount+this.uc>this.Oc&&this.L.emit("maxSampleCountExceeded",this,this.uc,this.Oc,this.uc+t.appendCount),this.kc=this.kc||new this.Mc(this.Oc),this.Tc=this.Tc||new this.Mc(this.Oc),this.Rc=this.Rc||(this.yc?new Float32Array(this.Oc):void 0),this.Nc=this.Nc||(this.vc?new Uint32Array(this.Oc):void 0),this.Ec=this.Ec||(this.Sc?new Uint32Array(this.Oc):void 0),this.zc=this.zc||(this.xc?new Float32Array(this.Oc):void 0),this.Vc=this.Vc||(this.bc?new Float32Array(this.Oc):void 0),{dataPattern:this.Lc(),samplesCacheX:this.kc,samplesCacheY:this.Tc,samplesCacheLookup:this.Rc,samplesCacheIDs:this.Nc,samplesCacheColors:this.Ec,samplesCacheSize:this.zc,samplesCacheRotation:this.Vc,maxSampleCount:this.Oc}}Hc(){if(!this.kc||!this.Tc||0===this.uc)return;if(void 0===this.Oc)return this.cc>0?{x:this.kc[0],y:this.Tc[0]}:void 0;if(!this.dc)return{x:this.kc[0],y:this.Tc[0]};let t=this.lc-this.uc;return t<0&&(t+=this.Oc),{x:this.kc[t],y:this.Tc[t]}}Cc(){if(!this.kc||!this.Tc||0===this.uc)return;if(void 0===this.Oc){const t=this.uc-1;return t>=0?{x:this.kc[t],y:this.Tc[t]}:void 0}let t=this.lc-1;return t<0&&(t+=this.Oc),{x:this.kc[t],y:this.Tc[t]}}$c(t,e,i,s){const r=this.Lc(),n=this.kc,o=this.Tc;if(!n||!o)return;const h=t=>({x:n[t],y:o[t],lookupValue:this.yc&&this.Rc?this.Rc[t]:void 0,id:this.vc&&this.Nc?this.Nc[t]:void 0,color:this.Sc&&this.Ec?this.Ec[t]:void 0,size:this.xc&&this.zc?this.zc[t]:void 0,rotation:this.bc&&this.Vc?this.Vc[t]:void 0}),a=n.length,l=this.uc,u=this.cc-1,c=Math.max(u-l+1,0);if(r){const i=this.Hc(),s=this.Cc();if(!(i&&s&&this.kc&&this.Tc))return;const n="ProgressiveX"===r||"RegressiveX"===r?"x":"y",o="x"===n?"y":"x",l="x"===n?this.kc:this.Tc,d="x"===o?this.kc:this.Tc,f=t[n],g=Math.min(i[n],s[n]),m=Math.max(i[n],s[n]);if(fm)return;const y=ao(f,c,u,(t=>l[oo(t,this.cc,a,this.lc)])),p=oo(y,this.cc,a,this.lc);if(!e)return h(p);const x=y-1,S=y+1,A=f>=l[p]&&("ProgressiveX"===r||"ProgressiveY"===r)?S<=u?oo(S,this.cc,a,this.lc):void 0:x>=c?oo(x,this.cc,a,this.lc):void 0;if(void 0===A)return;const v=l[p],b=d[p],M=l[A],E=d[A],T=Math.min(v,M),w=T===v?b:E,k=Math.max(v,M),C=Vn(w,k===v?b:E,(f-T)/(k-T));return"ProgressiveX"===r||"RegressiveX"===r?{x:f,y:C}:{x:C,y:f}}let d,f=Number.MAX_VALUE;const g=dt(t,i,s),m=this.uc-1;for(let t=0;t<=m;t+=1){const e=n[t],r=o[t];if(!Number.isNaN(e)&&!Number.isNaN(r)){const n=ct(e,i.x,s.x),o=ct(r,i.y,s.y),h=(n-g.x)**2+(o-g.y)**2;ht%i,ho=(t,e,i,s,r,n,o,h)=>{if(0===s||0===r)return;const a=i.length,l=s-1,u=Math.max(l-r+1,0),c=ao(t,u,l,(t=>i[oo(t,s,a)])),d=ao(e,u,l,(t=>i[oo(t,s,a)])),f=Math.max(c-h,u),g=Math.min(d+h,l),m=oo(f,s,a),y=oo(g,s,a);return m>y?{iFirstSample:f,iLastSample:g,iFirstSampleDataArray:m,iLastSampleDataArray:y,dataRanges:[{offset:m,count:a-m},{offset:0,count:y+1}]}:{iFirstSample:f,iLastSample:g,iFirstSampleDataArray:m,iLastSampleDataArray:y,dataRanges:[{offset:m,count:y-m+1}]}},ao=(t,e,i,s)=>{const r=i;for(;e!==i;){const r=Math.ceil((e+i)/2);t{const n=e.length;if(Array.isArray(e))for(let n=0;nvoid 0===t?void 0:Array.isArray(t)?new e(t):t instanceof e?t:new e(t),co=(t,e,i)=>{if(void 0!==t)return Array.isArray(t)?t.slice(e,i):t.subarray(e,i)};class fo extends Fn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ua="label",this.Ga=this.Ts.Dr(this.renderingScale).Eh(this.ua).ke(z).Ir(Re).Pr(Re),this.setMargin(5),this.Mu(this.Ga)}Iu(){return[this.Ga]}setFillStyle(t){return this.Ga.ke(t),this.Ts.vs(),this}getFillStyle(){return this.Ga.zh()}Fe(){const t=this.getPosition(u(0,0),e.UISpace.Content),i=dt(t,this.scale,this.renderingScale);return this.Ga.Ie(i),this}Ds(){this.Ga.Ds();const t=0===this.ua.length?u(0,0):this.Ga.Zc();return this.setContentSize(t),super.Ds()}setText(t){return this.ua=t,this.Ga.Eh(this.ua),this.Ts.vs(),this}getText(){return this.ua}setFont(t){return this.Ga.Nh(t),this.Ts.vs(),this}getFont(){return this.Ga.Oh()}setTextRotation(t){return this.Ga.Gh(t),this.Ts.vs(),this}getTextRotation(){return this.Ga.Wh()}}const go={...Tn,...kn,uiElement:fo};class mo extends Dn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Qc=!1,this.fitTo=this.Lu.bind(this),this.setSize=this.fitTo,this.Ga=this.Ts.sc(e).ke(z).Ce(ot),this.Mu(this.Ga)}Iu(){return[this.Ga]}setFillStyle(t){return this.Ga.ke(t),this.Ts.vs(),this}getFillStyle(){return this.Ga.zh()}setStrokeStyle(t){return this.Ga.Ce(t),this.Ts.vs(),this}getStrokeStyle(){return this.Ga.lo()}Fe(){const t=Ze([this.getPosition(u(-1,-1),e.UISpace.Content),this.getPosition(u(1,1),e.UISpace.Content)].map((t=>dt(t,this.scale,this.renderingScale))));return this.Qc?this.Ga.Sl([{x:(t.min.x+t.max.x)/2,y:t.min.y},{x:t.min.x,y:(t.min.y+t.max.y)/2},{x:(t.min.x+t.max.x)/2,y:t.max.y},{x:t.max.x,y:(t.min.y+t.max.y)/2}]):this.Ga.Sl([t.min,{x:t.min.x,y:t.max.y},t.max,{x:t.max.x,y:t.min.y}]),this}Lu(t){return this.setContentSize(t),this.Ts.vs(),this}Ru(){return 0}Eu(){return 0}Vu(){return 0}zu(){return 0}}class yo extends Dn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Jc=u(0,0),this.Ga=t.Kc(e).hu(0).Ve(360).ke(z).Ce(ot),this.Mu(this.Ga)}Iu(){return[this.Ga]}setFillStyle(t){return this.Ga.ke(t),this.Ts.vs(),this}getFillStyle(){return this.Ga.zh()}setStrokeStyle(t){return this.Ga.Ce(t),this.Ts.vs(),this}getStrokeStyle(){return this.Ga.lo()}Fe(){const t=this.getSize(e.UISpace.Content).x/2;return this.Ga.nu(t*this.renderingScale.Ui().x).ou(t*this.renderingScale.Ui().y).Ie(dt(this.getPosition(u(0,0),e.UISpace.Content),this.scale,this.renderingScale)).lu(255).Ds(),this}Lu(t){const e=Math.sqrt(t.x*t.x/4+t.y*t.y/4);return this.setContentSize(u(2*e,2*e)),this.Jc=t,this.Ts.vs(),this}Ru(){return(this.getSize(e.UISpace.Content).x-this.Jc.x)/2}Eu(){return(this.getSize(e.UISpace.Content).x-this.Jc.x)/2}Vu(){return(this.getSize(e.UISpace.Content).y-this.Jc.y)/2}zu(){return(this.getSize(e.UISpace.Content).y-this.Jc.y)/2}fitTo(t){const e=Math.min(t.x,t.y);return this.setContentSize(u(e,e)),this.Jc=t,this}}class po extends Ln{constructor(t,e,i,s,r){super(t,e,i,hn.Simple,s,r),this.qc=p(u(0,0)),this.td=!1,this.Ts=t,this.hc()}rc(){const t=this.qc._();if(this.td){const e=Math.min(t.x,t.y);return[u(0,0),u(e/2,e/2),u(0,e),u(-e/2,e/2)]}const e=2*Math.sqrt(this.qc._().x*this.qc._().x/4+this.qc._().y*this.qc._().y/4),i=u(Math.cos(Math.PI/4)*e,0),s=u(0,Math.sin(Math.PI/4)*e),r=u(0,0),n=oi(r,oi(i,s)),o=oi(n,oi(s,ni(i,-1)));return[r,n,o,hi(o,oi(i,s))]}Iu(){return[this.Ga]}setFillStyle(t){return this.Ga.ke(t),this.Ts.vs(),this}getFillStyle(){return this.Ga.zh()}setStrokeStyle(t){return this.Ga.Ce(t),this.Ts.vs(),this}getStrokeStyle(){return this.Ga.lo()}Lu(t){return this.qc.M(t),this.td=!1,this.Ts.vs(),this}Ru(){return this.td?0:(this.getSize(e.UISpace.Content).x-this.qc._().x)/2}Eu(){return this.td?0:(this.getSize(e.UISpace.Content).x-this.qc._().x)/2}Vu(){return this.td?0:(this.getSize(e.UISpace.Content).y-this.qc._().y)/2}zu(){return this.td?0:(this.getSize(e.UISpace.Content).y-this.qc._().y)/2}fitTo(t){return this.qc.M(t),this.td=!0,this.Ts.vs(),this}}class xo extends Ln{constructor(t,i,s,r,n){super(t,i,s,hn.Simple,r,n),this.sd=p(u(0,0)),this.ed=p(10),this.hd=p(void 0),this.Yu=p(e.UIDirections.Right),this.hc()}Iu(){return[this.Ga]}setFillStyle(t){return this.Ga.ke(t),this.Ts.vs(),this}getFillStyle(){return this.Ga.zh()}setStrokeStyle(t){return this.Ga.Ce(t),this.Ts.vs(),this}getStrokeStyle(){return this.Ga.lo()}setDirection(t){return this.Yu.M(t),this.Ts.vs(),this}getDirection(){return this.Yu._()}setPointerLength(t){return this.ed.M(t),this.Ts.vs(),this}getPointerLength(){return this.ed._()}setPointerAngle(t){return this.hd.M(t),this.Ts.vs(),this}getPointerAngle(){let t=this.hd._();if(void 0===t){const e=this.rd();if(0===e)return 0;t=0!==e?180*Math.atan(2*this.getPointerLength()/e)/Math.PI:0}return Math.min(Math.max(t,1),89)}Lu(t){return this.sd.M(t),this.Ts.vs(),this}nd(){const t=this.getPointerAngle();return 0===t?0:2*this.getPointerLength()/Math.tan(t*Math.PI/180)}od(){return $t(this.Yu._())?this.sd._().x:this.sd._().y}rd(){return $t(this.Yu._())?this.sd._().y:this.sd._().x}Ru(){switch(this.Yu._()){case e.UIDirections.Right:return 0;case e.UIDirections.Left:return this.getPointerLength();case e.UIDirections.Up:case e.UIDirections.Down:return Math.max(0,this.nd()-this.rd());default:return 0}}Eu(){switch(this.Yu._()){case e.UIDirections.Right:return this.getPointerLength();case e.UIDirections.Left:return 0;case e.UIDirections.Up:case e.UIDirections.Down:return Math.max(0,this.nd()-this.rd());default:return 0}}Vu(){switch(this.Yu._()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.nd()-this.rd());case e.UIDirections.Up:return this.getPointerLength();case e.UIDirections.Down:default:return 0}}zu(){switch(this.Yu._()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.nd()-this.rd());case e.UIDirections.Up:return 0;case e.UIDirections.Down:return this.getPointerLength();default:return 0}}rc(){const t=jt(this.Yu._()),e=si(u(0,0),t),i=this.getPointerLength(),s=this.nd(),r=this.od(),n=this.rd();if(!(0!==i&&0!==s||0!==r&&0!==n))return[];const o=u(0,0),h=oi(oi(o,ni(t,-i)),ni(e,s/2)),a=oi(h,ni(e,(n-s)/2)),l=oi(a,ni(t,-r)),c=oi(oi(o,ni(t,-i)),ni(e,-s/2)),d=oi(c,ni(e,-(n-s)/2)),f=oi(d,ni(t,-r));let g;return g=0===r||0===n?[o,h,c]:0===i||0===s?[a,l,f,d]:Ct(n,s)?[o,h,l,f,c]:[o,h,a,l,f,d,c],g}}class So extends Fn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.fitTo=this.Lu.bind(this),this.setSize=this.fitTo,this.ad=new no,this.Ga=this.Ts.fd(e).Ee(ot).dd(z).ud(z).ld(this.ad),this.Mu(this.Ga)}Iu(){return[this.Ga]}setShape(t){return this.Ga.Ad(t),this}getShape(){return this.Ga.gd()}setRotation(t){return this.Ga.pd(t),this}getRotation(){return this.Ga.md()}setFillStyle(t){return this.Ga.ud(t),this.Ts.vs(),this}getFillStyle(){return this.Ga.yd()}Fe(){const t=dt(this.getPosition({x:0,y:0},e.UISpace.Content),this.scale,this.renderingScale),i=Math.max(this.size.x,this.size.y);if(this.ad.clear(),i>0){const e=this.Ga.gd(),s=this.Ga.yd(),r=io(e)&&e,n=Zn(s)&&s;if(r){const t=i/r.ai().y;this.Ga.Sd(t)}else if(n){const t=n.source;if(t instanceof Image){const e=i/t.height;this.Ga.Sd(e)}}else this.Ga.Sd(i);this.ad.appendSample(t)}return this}Lu(t){return this.setContentSize(t),this.Ts.vs(),this}Ru(){return 0}Eu(){return 0}Vu(){return 0}zu(){return 0}}const Ao={...Tn,...kn,uiElement:So};class vo extends Rn{setSize(t){return this.setContentSize(t),this.Ts.vs(),this}}class bo extends xn{constructor(){super(...arguments),this.vd=[],this.xd=0,this.bd=t=>{const e=this.vd.indexOf(t);e>=0&&this.vd.splice(e,1)}}getMembers(){return this.vd}getMemberCount(){return this.vd.length}setMinimumSize(t){return this.Md=t,this.Ts.vs(),this}getMinimumSize(){return this.Md}addElement(t,e=-1){const i=t.Qu(this.Ts,this.renderingScale,this.scale,this.bd,this.ts,!1);return i.setMouseInteractions(this.getMouseInteractions()),e>=0?this.vd.splice(e,0,i):this.vd.push(i),i.setVisible(this.getVisible()),this.Mu(i),this.Xi&&(me(0,(()=>{})),i.dispose()),i}dispose(){return super.dispose(),this.vd.slice().forEach(wt),this}setVisible(t){return super.setVisible(t),this.vd.forEach((e=>e.setVisible(t))),this}setMouseInteractions(t){super.setMouseInteractions(t);for(let e=0;et+ +(e instanceof vo)),0),s=i>0?(this.size.x-this.xd)/i:0;return this.vd.reduce(((e,i)=>i instanceof vo?this.scale.mi({x:e,y:t.y},{x:s+i.getSize().x,y:0}).x:i.setOrigin(u(-1,1)).setPosition(u(e,t.y)).Fe().getPosition(u(1,0)).x),t.x),this}Ds(){for(let t=0;tt+ +(e instanceof vo)),0),s=i>0?(this.size.y-this.xd)/i:0;return this.vd.reduce(((e,i)=>i instanceof vo?this.scale.mi({x:t.x,y:e},{x:0,y:-(s+i.getSize().y)}).y:i.setOrigin(u(-1,1)).setPosition(u(t.x,e)).Fe().getPosition(u(0,-1)).y),t.y),this}Ds(){for(let t=0;t{const i={},s=`stylable${t}s`;return i[s]=e,i[`set${t}FillStyle`]=function(t){return this[s].forEach((e=>e.setFillStyle(t))),this},i[`get${t}FillStyle`]=function(){return this[s][0].getFillStyle()},i[`set${t}Font`]=function(t){return this[s].forEach((e=>e.setFont(t))),this},i[`get${t}Font`]=function(){return this[s][0].getFont()},i[`set${t}Rotation`]=function(t){return this[s].forEach((e=>e.setTextRotation(t))),this},i[`get${t}Rotation`]=function(){return this[s][0].getTextRotation()},i},Do=Fo("Text",[]),Lo={button:void 0,isLocked:!1,setOn(t){const e=this.button.getOn()!==t;return this.button.setOn(t),e&&this.L.emit("switch",t),this},getOn(){return this.button.getOn()},setLocked(t){return this.isLocked=t,this},getLocked(){return this.isLocked},onSwitch(t){return this.L.on("switch",(e=>t(this,e)))},offSwitch(t){return this.L.off(t,"switch")},setButtonOffFillStyle(t){return this.button.setOffFillStyle(t),this},getButtonOffFillStyle(){return this.button.getOffFillStyle()},setButtonOnFillStyle(t){return this.button.setOnFillStyle(t),this},getButtonOnFillStyle(){return this.button.getOnFillStyle()},setButtonSize(t){return this.button.setSize(t),this},getButtonSize(){return this.button.getSize()},setButtonShape(t){return this.button.setButtonShape(t),this},getButtonShape(){return this.button.getButtonShape()}},Vo={textFillStyleHidden:void 0,setTextFillStyleHidden(t){return this.textFillStyleHidden="function"==typeof t?t(this.textFillStyleHidden):t,this},getTextFillStyleHidden(){return this.textFillStyleHidden}},_o={pointable:void 0,setDirection(t){return this.pointable.setDirection(t),this},getDirection(){return this.pointable.getDirection()},setPointerLength(t){return this.pointable.setPointerLength(t),this},getPointerLength(){return this.pointable.getPointerLength()}},Po={...Tn,...wn,background:mo,Qu(t,e,i,s,r,n){const o=new Mo(t,e,i,this.background,s,r),h=o.addElement(go,void 0),a=Object.assign(o,Io,{setTextLabel:h},Do,{stylableTexts:[h]});return En(a,r,n),this.applyStylers(a,r)}}.addStyler(bn),Bo={...Tn,...wn,background:xo,Qu(t,i,s,r,n,o){const h=new Mo(t,i,s,this.background,r,n),a=h.addElement(go,void 0),l=h.getBackground(),u=Object.assign(h,Io,{setTextLabel:a},Do,{stylableTexts:[a]},_o,{pointable:l},{setTickLabelPadding(t){return this.getDirection()===e.UIDirections.Up?(this.setPadding({top:t}),a.setMargin({top:0})):this.getDirection()===e.UIDirections.Down?(this.setPadding({bottom:t}),a.setMargin({bottom:0})):this.getDirection()===e.UIDirections.Right?(this.setPadding({right:t}),a.setMargin({right:0})):this.getDirection()===e.UIDirections.Left&&(this.setPadding({left:t}),a.setMargin({left:0})),this},getTickLabelPadding(){return this.getDirection()===e.UIDirections.Up?this.getPadding().top:this.getDirection()===e.UIDirections.Down?this.getPadding().bottom:this.getDirection()===e.UIDirections.Right?this.getPadding().right:this.getPadding().left}});return u.Ju="other",u.setPointerLength(n.xAxisNumericTicks.majorTickStyle.getTickLength()).setTickLabelPadding(n.xAxisNumericTicks.majorTickStyle.getTickPadding()).setTextFont(n.uiTextFont).setTextFillStyle(n.uiTextFillStyle).setBackground((t=>t.setFillStyle(n.uiBackgroundFillStyle).setStrokeStyle(n.uiBackgroundStrokeStyle))),En(u,n,o),this.applyStylers(u,n)}};class zo extends pn{constructor(t,e,i,s,n,o){super(t,e,i,n,o),this.Bs=!1,this.L=new r.Eventer,this.wd=z,this.Cd=z,this.getOn=()=>this.Bs,this.kd=this.Mu(new So(this.Ts,this.renderingScale,this.scale,kt,o).setShape(s)),this.Cd=o.uiButtonFillStyleHidden||o.uiButtonFillStyle}Iu(){return[...this.kd.Iu()]}onHighlight(t){return this.L.on("highlight",t)}offHighlight(t){return this.L.off(t)}setOn(t){return this.Bs=t,this.kd.setFillStyle(t?this.wd:this.Cd),this.Ts.vs(),this}setOffFillStyle(t){return this.Cd="function"==typeof t?t(this.Cd):t,this.Bs||this.kd.setFillStyle(this.Cd),this}getOffFillStyle(){return this.Cd}setSize(t){return this.kd.fitTo("number"==typeof t?u(t,t):t),this}getSize(){return this.kd.getSize()}setOnFillStyle(t){return this.wd="function"==typeof t?t(this.wd):t,this.Bs&&this.kd.setFillStyle(this.wd),this}getOnFillStyle(){return this.wd}setButtonShape(t){return this.kd.setShape(t),this.Ts.vs(),this}getButtonShape(){return this.kd.getShape()}Fe(){return super.Fe(),this.kd.setVisible(this.getVisible()).setPosition(this.getPosition(u(0,0),e.UISpace.Content)).Fe(),this}Ds(){const t=this.kd.Ds().getSize();return this.setContentSize(t),super.Ds()}dispose(){return super.dispose(),this.kd.dispose(),this}setMouseInteractions(t){return this.kd.setMouseInteractions(t),this}getMouseInteractions(){return this.kd.getMouseInteractions()}setHighlight(t){const e=Ae(t);return this.kd.setHighlight(e),this.L.emit("highlight",this,t),this.Ts.vs(),this}getHighlight(){return this.kd.getHighlight()}}const No={...Tn,uiElement:zo,buttonShape:e.PointShape.Circle,setButtonShape(t){return{...this,buttonShape:t}},Qu(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.buttonShape,s,r),r);return En(o,r,n),o}},Uo={...Tn,...wn,background:mo,buttonBuilder:No,setButtonShape(t){return{...this,buttonBuilder:this.buttonBuilder.setButtonShape(t)}},Qu(t,i,s,r,n,o){const h=new Mo(t,i,s,this.background,r,n),a=h.addElement(Co);a.addGap();const l=a.addElement(this.buttonBuilder);a.addGap();const u=h.addElement(Co);u.addGap();const c=u.addElement(go);u.addGap(),h.addGap();const d=Object.assign(h,Io,{setTextLabel:c},Do,{stylableTexts:[c]},Lo,{button:l},Vo);let f;return d.onMouseClick(((t,e)=>{d.getLocked()||d.setOn(!d.getOn())})),d.onMouseEnter((()=>d.setHighlight(!0))),d.onMouseLeave((()=>d.setHighlight(!1))),d.setMouseStyle(e.MouseStyles.Point),d.setTextFillStyleHidden(n.uiTextFillStyleHidden||n.uiTextFillStyle),d.onSwitch(((t,e)=>{e?f&&d.setTextFillStyle(f):(f=d.getTextFillStyle(),d.setTextFillStyle(d.getTextFillStyleHidden()))})),d.setPadding({left:5}),En(d,n,o),this.applyStylers(d,n)}}.addStyler(bn).addStyler(Mn);class Oo extends pn{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.Td=[],this.Fd=2,this.Id="",this.Pd=(t,e)=>void 0!==t.label?t.label:e.percentageValues?`${(100*t.value).toFixed(0)}%`:Ri(t.value,e.min,e.max),this.Dd=0,this.Bd=0,this.Ld=!1,this.Ts=t,this.Rd=n,this.Ed=this.Mu(t.Te(e).Ce(ot)),this.zd=this.Mu(t.Dr(e).ke(r.uiTextFillStyle).Nh(r.uiTextFont).setMouseInteractions(!1)),"vertical"===n?(this.Vd=140,this.Od=25):(this.Vd=160,this.Od=15)}Iu(){return[this.Ed,this.zd]}Nd(t){this.Gd=t;const e=Ho(t,"vertical"===this.Rd?0:90,this.Ld);return this.Ed.ke(e),this.Ts.vs(),this}Wd(){return this.Gd}Ud(t){return this.Vd=t,this.Ts.vs(),this}Yd(){return this.Vd}Hd(t){return this.Od=t,this.Ts.vs(),this}$d(){return this.Od}Xd(t){return this.Id=t,this.Ts.vs(),this}jd(){return this.Id}Zd(t){return this.Pd=t,this.Ts.vs(),this}setLUTDisplayProportionalSteps(t){if(this.Ld=t,this.Gd){const t=Ho(this.Gd,"vertical"===this.Rd?0:90,this.Ld);this.Ed.ke(t)}return this.Ts.vs(),this}getLUTDisplayProportionalSteps(){return this.Ld}setFillStyle(t){return this.zd.ke(t),this.Ts.vs(),this}getFillStyle(){return this.zd.zh()}setFont(t){return this.zd.Nh(t),this.Ts.vs(),this}getFont(){return this.zd.Oh()}setTextRotation(t){return this.Bd=t,this.zd.Gh(t),this.Ts.vs(),this}getTextRotation(){return this.zd.Wh()}Fe(){var t,i,s,r;if(super.Fe(),this.Xi||!this.getVisible())return this;const n=this.Gd;if(n){const o=this.renderingScale.Ui(),h=n.min,a=n.max;if("vertical"===this.Rd){const s=this.getPosition({x:-1,y:-1},e.UISpace.Content),r=oi(s,{x:this.Ed.ai().x+this.Fd*o.x,y:0}),l={x:r.x,y:r.y+(this.Id.length>0?this.Dd*o.y+this.zd.ai().y:0)+.5*((null===(t=this.Td[0])||void 0===t?void 0:t.ai().y)||0)},u={x:l.x,y:this.getPosition({x:-1,y:1},e.UISpace.Content).y-.5*((null===(i=this.Td[this.Td.length-1])||void 0===i?void 0:i.ai().y)||0)};this.Ed.Ie({x:s.x,y:l.y}),this.zd.za({x:-1,y:-1}).Ie(r),n.getSteps().forEach(((t,e)=>{const i=je(l,u,this.Ld?!0===n.getInterpolation()?(t.value-h)/(a-h):.9*(t.value-h)/(a-h):!0===n.getInterpolation()?e/(n.getSteps().length-1):e/n.getSteps().length);this.Td[e].za({x:-1,y:0}).Ie(i)}))}else{const t=this.getPosition({x:-1,y:-1},e.UISpace.Content),i=this.getPosition({x:1,y:1},e.UISpace.Content),l=this.Td.reduce(((t,e)=>Math.max(t,e.ai().y)),0),u=oi(t,{x:.5*((null===(s=this.Td[0])||void 0===s?void 0:s.ai().x)||0),y:l}),c={x:i.x,y:u.y},d={x:c.x-(.5*((null===(r=this.Td[this.Td.length-1])||void 0===r?void 0:r.ai().x)||0)+(this.Id.length>0?this.Dd*o.x+this.zd.ai().x:0)),y:u.y},f={x:u.x,y:u.y+this.Fd*o.y};this.Ed.Ie(f),this.zd.za({x:1,y:1}).Ie(c),n.getSteps().forEach(((t,e)=>{const i=je(u,d,this.Ld?!0===n.getInterpolation()?(t.value-h)/(a-h):.9*(t.value-h)/(a-h):!0===n.getInterpolation()?e/(n.getSteps().length-1):e/n.getSteps().length);this.Td[e].za({x:0,y:1}).Ie(i)}))}}return this}Ds(){if(this.Gd&&this.getVisible()){const t=this.Gd.getSteps();for(let e=this.Td.length;eMath.max(t,e.Ds().Zc().x)),0),this.zd.Ds().Zc().x),s=(this.Id.length>0?this.Dd+this.zd.Ds().Zc().y:0)+e+.5*this.Td[0].Ds().Zc().y+.5*this.Td[this.Td.length-1].Ds().Zc().y;this.setContentSize({x:i,y:s})}else{const t=this.Vd,e=this.Od;this.Ed.tt({x:t*this.renderingScale.x.getPixelSize(),y:e*this.renderingScale.y.getPixelSize()});const i=Math.max(this.Id.length>0?this.Dd+this.zd.Ds().Zc().x:0,.5*this.Td[this.Td.length-1].Ds().Zc().x),s=t+.5*this.Td[0].Ds().Zc().x+i,r=e+this.Fd+this.Td.reduce(((t,e)=>Math.max(t,e.Ds().Zc().y)),0);this.setContentSize({x:s,y:r})}}else this.Td.forEach((t=>t.dispose())),this.Td.length=0,this.zd.setVisible(!1),this.Ed.setVisible(!1),this.setContentSize({x:0,y:0});return super.Ds()}dispose(){return super.dispose(),this.Ed.dispose(),this.Td.forEach(wt),this.zd.dispose(),this}setMouseInteractions(t){return this.Ed.setMouseInteractions(t),this}getMouseInteractions(){return this.Ed.getMouseInteractions()}}const Go={lutElement:{},setLUT(t){return this.lutElement.Nd(t),this},getLUT(){return this.lutElement.Wd()},setLUTLength(t){return this.lutElement.Ud(t),this},getLUTLength(){return this.lutElement.Yd()},setLUTThickness(t){return this.lutElement.Hd(t),this},getLUTThickness(){return this.lutElement.$d()},setLookUpUnit(t){return this.lutElement.Xd(t),this},getLookUpUnit(){return this.lutElement.jd()},setLUTStepValueFormatter(t){return this.lutElement.Zd(t),this},setLUTDisplayProportionalSteps(t){return this.lutElement.setLUTDisplayProportionalSteps(t),this},getLUTDisplayProportionalSteps(){return this.lutElement.getLUTDisplayProportionalSteps()}},Yo={...Tn,...wn,background:mo,alignment:"horizontal",setAlignment(t){return{...this,alignment:t}},Qu(t,e,i,s,r,n){const o=new Eo(t,e,i,this.background,s,r),h=o.addElement({Qu:()=>new Oo(t,e,i,kt,r,this.alignment)}),a=Object.assign(o,Do,{stylableTexts:[h]},Go,{lutElement:h});return En(a,r,n),this.applyStylers(a,r)}}.addStyler(bn),Ho=(t,e,i)=>{const s=t.getSteps(),r=t.min,n=t.max-r;if(!0===t.getInterpolation())return new st({angle:e,stops:s.map(((e,o)=>({offset:i?(e.value-r)/n:o/(s.length-1),color:e.color||t.color})))});const o=[];for(let e=0;enew Oo(t,i,s,kt,n,this.alignment)});"vertical"===this.alignment&&d.setMargin({left:n.uiButtonSize+6});const f=Object.assign(o,Io,{setTextLabel:c},Do,{stylableTexts:[c,d]},Fo("LUTText",[d]),Lo,{button:l},Go,{lutElement:d},Vo);let g;return f.onMouseClick((()=>{f.getLocked()||f.setOn(!f.getOn())})),f.onMouseEnter((()=>f.setHighlight(!0))),f.onMouseLeave((()=>f.setHighlight(!1))),f.setMouseStyle(e.MouseStyles.Point),f.setTextFillStyleHidden(n.uiTextFillStyleHidden||n.uiTextFillStyle),f.onSwitch(((t,e)=>{e?g&&f.setTextFillStyle(g):(g=f.getTextFillStyle(),f.setTextFillStyle(f.getTextFillStyleHidden()))})),f.setPadding({left:5}),this.applyStylers(f,n)}}.addStyler(bn).addStyler(Mn),Wo={alignment:null,title:null,entryStylers:null,legendBoxDisposed:null,entries:[],add(t,e){const i=!e||"object"!=typeof e||void 0===e.toggleVisibilityOnClick||e.toggleVisibilityOnClick,s=null==e?void 0:e.matchStyleExactly,r=e&&"object"==typeof e&&void 0!==e.builder?e.builder:void 0;return this.legendBoxDisposed()||(t instanceof Qh?this.addChart(t,i,r,s):"attach"in t?this.addAttachable(t,i,r,s):t&&this.addDashboard(t,i,r,s)),this},addAttachable(t,e,i,s){const r=t.Wd&&t.Wd(),n=t.ks&&t.ks(),o=void 0!==s&&s;let h=i;if(!h){let t=r?Xo.setAlignment(this.alignment):Uo;void 0!==n&&(t=t.setButtonShape(n)),h=t}const a=this.addElement(h);if(r&&"setLUT"in a){a.setLUT(r.lut);const t=r.lut.getUnits(),e=r.lookUpProperty,i=t.length>0?t:"x"===e?"x":"y"===e?"y":"z"===e?"z":"";a.setLookUpUnit(i)}return this.entryStylers.forEach((t=>t(a))),this.entries.push({entry:a,component:t}),t.attach(a,e,o),e||a.setLocked(!0),this},addChart(t,e,i,s){return t.Qd().forEach((t=>this.addAttachable(t,e,i,s))),this},addDashboard(t,e,i,s){return t.getCells().filter((t=>t.panel instanceof Qh)).forEach((t=>this.addChart(t.panel,e,i,s))),this},setTitle(t){return this.title.setText(t),this},getTitle(){return this.title.getText()},setTitleFillStyle(t){return this.title.setTextFillStyle(t),this},getTitleFillStyle(){return this.title.getTextFillStyle()},setTitleFont(t){return this.title.setTextFont(t),this},getTitleFont(){return this.title.getTextFont()},setTitleRotation(t){return this.title.setTextRotation(t),this},getTitleRotation(){return this.title.getTextRotation()},setEntries(t){return this.entries.forEach((e=>t(e.entry,e.component))),this}},jo={alignment:"vertical",layoutBuilder:Co,setAlignment(t){return{...this,alignment:t,layoutBuilder:"horizontal"===t?Ro:Co}},getAlignment(){return this.alignment},titleBuilder:Po,styleTitle(t){return{...this,titleBuilder:this.titleBuilder.addStyler(t)}},entryStylers:[],styleEntries(t){return{...this,entryStylers:[...this.entryStylers,t]}}},$o={...Tn,...wn,...jo,background:mo,Qu(t,e,i,s,r,n){const o=this.layoutBuilder.setBackground(this.background).Qu(t,e,i,s,r,!1);let h=Object.assign(o,Wo,{alignment:this.alignment,entryStylers:this.entryStylers,legendBoxDisposed:()=>o.Xi});h.entries=[];const a=h.addElement("horizontal"===this.alignment?Co:Ro),l=a.addElement(this.titleBuilder).setText("Legend").setTextFillStyle(r.legendTitleFillStyle).setTextFont(r.legendTitleFont);return a.addGap(),h=Object.assign(h,{title:l}),"horizontal"===this.alignment&&l.setMargin({right:6}),En(h,r,n),this.applyStylers(h,r)}}.addStyler(((t,e)=>t.setPadding(5)));class Zo extends pn{constructor(t,i,s,r,n){super(t,i,s,r,n),this.Jd=10,this.Kd=e.UIDirections.Up,this.qd=0,this.Ju="major",this.ua=this.Mu(t.Dr(this.renderingScale).Ir(Re).Pr(Re)),this.Re=this.Mu(t.ze(this.renderingScale))}Iu(){return[this.ua]}Fe(){if(super.Fe(),this.Xi)return this;const t=dt(this.getPosition(),this.scale,this.renderingScale),i=this.renderingScale.mi(t,{x:this.Kd===e.UIDirections.Right?-this.Jd:this.Kd===e.UIDirections.Left?this.Jd:0,y:this.Kd===e.UIDirections.Up?-this.Jd:this.Kd===e.UIDirections.Down?this.Jd:0}),s=this.renderingScale.mi(i,{x:this.Kd===e.UIDirections.Right?-this.qd:this.Kd===e.UIDirections.Left?this.qd:0,y:this.Kd===e.UIDirections.Up?-this.qd:this.Kd===e.UIDirections.Down?this.qd:0});return this.Re.Oe(t).Ve(i),this.ua.Ie(s).za(this.Kd===e.UIDirections.Up?{x:0,y:1}:this.Kd===e.UIDirections.Down?{x:0,y:-1}:this.Kd===e.UIDirections.Right?{x:1,y:0}:{x:-1,y:0}),this}Ds(){const t=this.Re.cu().getThickness();return this.size=this.Kd===e.UIDirections.Left||this.Kd===e.UIDirections.Right?{x:this.Jd+this.qd+this.ua.Ds().Zc().x,y:t}:{y:this.Jd+this.qd+this.ua.Ds().Zc().y,x:t},super.Ds()}dispose(){return super.dispose(),this.ua.dispose(),this.Re.dispose(),this}setVisible(t){return super.setVisible(t),this.ua.setVisible(t),this.Re.setVisible(t),this}setMouseInteractions(t){return this.ua.setMouseInteractions(t),this.Re.setMouseInteractions(t),this}getMouseInteractions(){return this.ua.getMouseInteractions()}getText(){return this.ua.Lh()}setTextFillStyle(t){return this.ua.ke(t),this.Ts.vs(),this}getTextFillStyle(){return this.ua.zh()}setTextFont(t){return this.ua.Nh(t),this}setTextRotation(t){return this.ua.Gh(t),this}getTextRotation(){return this.ua.Wh()}getTextFont(){return this.ua.Oh()}setText(t){return this.ua.Eh(t),this.Ts.vs(),this}setDirection(t){return this.Kd=t,this.Ts.vs(),this}getDirection(){return this.Kd}setPointerLength(t){return this.Jd=t,this.Ts.vs(),this}getPointerLength(){return this.Jd}setTickLabelPadding(t){return this.qd=t,this.Ts.vs(),this}getTickLabelPadding(){return this.qd}setTickStyle(t){return this.Re.Ee(t),this.Ts.vs(),this}getTickStyle(){return this.Re.cu()}}const Ko={...Tn,Qu(t,e,i,s,r,n){const o=new Zo(t,e,i,s,r);return En(o,r,n),this.applyStylers(o,r)}}.addStyler(bn),Jo=Ko.addStyler(((t,e)=>(t.Ju="major",t.setPointerLength(e.xAxisNumericTicks.majorTickStyle.tickLength).setTickLabelPadding(e.xAxisNumericTicks.majorTickStyle.tickPadding).setTickStyle(e.xAxisNumericTicks.majorTickStyle.tickStyle).setTextFont(e.xAxisNumericTicks.majorTickStyle.labelFont).setTextFillStyle(e.xAxisNumericTicks.majorTickStyle.labelFillStyle)))),qo=Ko.addStyler(((t,e)=>(t.Ju="minor",t.setPointerLength(e.xAxisNumericTicks.minorTickStyle.tickLength).setTickLabelPadding(e.xAxisNumericTicks.minorTickStyle.tickPadding).setTickStyle(e.xAxisNumericTicks.minorTickStyle.tickStyle).setTextFont(e.xAxisNumericTicks.minorTickStyle.labelFont).setTextFillStyle(e.xAxisNumericTicks.minorTickStyle.labelFillStyle)))),Qo=Uo.addStyler((t=>t.onSwitch(((e,i)=>!0===i?setTimeout((()=>t.setOn(!1)),300):void 0)))),th=$o.setAlignment("horizontal"),eh=$o.setAlignment("vertical"),ih={TextBox:Po,CheckBox:Uo,ButtonBox:Qo,PointableTextBox:Bo,AxisTickMajor:Jo,AxisTickMinor:qo,LUTRange:Yo},sh={HorizontalLegendBox:th,VerticalLegendBox:eh},rh=(t,e)=>{if(Ni(t)){const i=e.Do(t);return{x:i.engineX,y:i.engineY}}return t},nh=t=>{let e=!1,i={type:"linear"};if(t&&(void 0!==t.opposite&&(e=t.opposite),t.type&&"linear-highPrecision"===t.type&&(i={type:"linear-highPrecision"}),t.type&&"logarithmic"===t.type)){let s=10;if(t.base)if("E"===t.base||"e"===t.base||"natural"===t.base)s="e";else if("number"==typeof t.base)s=t.base;else if("string"==typeof t.base)try{s=Number(t.base)}catch(e){console.warn(`Unidentified logarithmic base "${t.base}"`)}i={base:s,type:"logarithmic"}}return{opposite:e,type:i}},oh=(t,e,i,s=1)=>Rt(t+.1*s*(e-t)+.5*s*i.getPixelSize()*Math.sign(e-t),t,e),hh=(t,e,i,s=1)=>{const r=i.dt(t),n=i.dt(e);return Rt(i.ct(r+.1*s*(n-r)+.5*s*Math.sign(n-r)),t,e)},ah={tf:0,if:1,sf:2,ef:3,hf:4,rf:5,nf:6,af:7,lf:8,uf:9,cf:10,df:11,ff:12,Af:13,gf:14,pf:15,mf:16,yf:17,Sf:18,vf:19,xf:20,bf:21,Mf:22,_f:23};class lh extends qs{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.wf=r}}class uh extends Js{constructor(t,i,s,n,o,h,a,l,c,d,f,g,m,y,p,x){var S,A,v;super(d,c,a,y,p,{numeric:c.getWidth({x:y.xAxisNumericTicks,y:y.yAxisNumericTicks}),datetime:c.getWidth({x:y.xAxisDateTimeTicks,y:y.yAxisDateTimeTicks}),time:c.getWidth({x:y.xAxisTimeTicks,y:y.yAxisTimeTicks})},x),this.Cf=new Map,this.kf=void 0,this.Tf=0,this.Ff=[],this.If=[],this.Ke=zs.fitting,this.Pf=!0,this.Df=8,this.Bf=void 0,this.Lf=void 0,this.Rf=20,this.Ef=1,this.zf=!0,this.Vf=!0,this.Of=!0,this.Nf=!0,this.Gf=!0,this.Wf=!0,this.Uf=!0,this.Yf=!0,this.Hf=!0,this.$f=!0,this.Xf=this.Ch.defaultDragMouseStyle,this.jf=this.Ch.defaultDragMouseStyle,this.Zf=this.Ch.defaultDragMouseStyle,this.Qf=this.Ch.defaultDragMouseStyle,this.Jf=this.Ch.defaultDragMouseStyle,this.L=new r.Eventer,this.Kf=[],this.qf=t=>{const e=this.If.indexOf(t);e>=0&&this.If.splice(e,1)},this.tA=t=>(this.If.indexOf(t)<0&&this.If.push(t),this.qf),this.zt=(t,e)=>this.L.emit("axisAreaTouch",this,e),this.iA=Qt(this.Kf),this.onAxisInteractionAreaMouseClick=t=>this.L.on("axisAreaMouseClick",t),this.onAxisInteractionAreaMouseDoubleClick=t=>this.L.on("axisAreaDoubleClick",t),this.onAxisInteractionAreaMouseDown=t=>this.L.on("axisAreaMouseDown",t),this.onAxisInteractionAreaMouseUp=t=>this.L.on("axisAreaMouseUp",t),this.onAxisInteractionAreaMouseEnter=t=>this.L.on("axisAreaMouseEnter",t),this.onAxisInteractionAreaMouseLeave=t=>this.L.on("axisAreaMouseLeave",t),this.onAxisInteractionAreaMouseMove=t=>this.L.on("axisAreaMouseMove",t),this.onAxisInteractionAreaMouseWheel=t=>this.L.on("axisAreaMouseWheel",t),this.onAxisInteractionAreaMouseDragStart=t=>this.L.on("axisAreaMouseDragStart",t),this.onAxisInteractionAreaMouseDrag=t=>this.L.on("axisAreaMouseDrag",t),this.onAxisInteractionAreaMouseDragStop=t=>this.L.on("axisAreaMouseDragStop",t),this.onAxisInteractionAreaTouchStart=t=>this.L.on("axisAreaTouchStart",t),this.onAxisInteractionAreaTouch=t=>this.L.on("axisAreaTouch",t),this.onAxisInteractionAreaTouchStop=t=>this.L.on("axisAreaTouchEnd",t),this.offAxisInteractionAreaMouseClick=t=>this.L.off(t,"axisAreaMouseClick"),this.offAxisInteractionAreaMouseDoubleClick=t=>this.L.off(t,"axisAreaDoubleClick"),this.offAxisInteractionAreaMouseDown=t=>this.L.off(t,"axisAreaMouseDown"),this.offAxisInteractionAreaMouseUp=t=>this.L.off(t,"axisAreaMouseUp"),this.offAxisInteractionAreaMouseEnter=t=>this.L.off(t,"axisAreaMouseEnter"),this.offAxisInteractionAreaMouseLeave=t=>this.L.off(t,"axisAreaMouseLeave"),this.offAxisInteractionAreaMouseMove=t=>this.L.off(t,"axisAreaMouseMove"),this.offAxisInteractionAreaMouseWheel=t=>this.L.off(t,"axisAreaMouseWheel"),this.offAxisInteractionAreaMouseDragStart=t=>this.L.off(t,"axisAreaMouseDragStart"),this.offAxisInteractionAreaMouseDrag=t=>this.L.off(t,"axisAreaMouseDrag"),this.offAxisInteractionAreaMouseDragStop=t=>this.L.off(t,"axisAreaMouseDragStop"),this.offAxisInteractionAreaTouchStart=t=>this.L.off(t,"axisAreaTouchStart"),this.offAxisInteractionAreaTouch=t=>this.L.off(t,"axisAreaTouch"),this.offAxisInteractionAreaTouchStop=t=>this.L.off(t,"axisAreaTouchEnd"),this.Vd={relative:1},this.sA=0,this.eA=0,this.hA=(t,e)=>e.getAllocatesAxisSpace()?Math.max(t,e.update().tc()):t,this.rA=t=>{const e=this.Ff.indexOf(t);-1!==e&&this.Ff.splice(e,1)},this.nA=(t,e)=>{this.L.emit("axisAreaDoubleClick",this,e),this.Nf&&(this.setStopped(!1),Zt(e))},this.oA=t=>{this.L.emit("axisAreaMouseEnter",this),(this.Vf||this.zf||this.Of||this.Nf)&&this.aA(t)},this.lA=t=>{this.uA(t),this.L.emit("axisAreaMouseLeave",this)},this.cA=(t,e,i)=>{var s,r;this.L.emit("axisAreaMouseDragStart",this,e,i);const n=Ft(null===(s=this.chart.dA.Hn)||void 0===s?void 0:s.axisXYZoomMouseButton,0),o=Ft(null===(r=this.chart.dA.Hn)||void 0===r?void 0:r.axisXYPanMouseButton,2),h=u(e.clientX,e.clientY);i===o&&this.Vf?(this.fA(t),Zt(e)):i===n&&this.zf&&(this.AA(t,h),Zt(e))},this.gA=(t,e,i,s,r)=>{var n,o;this.L.emit("axisAreaMouseDrag",this,e,i,s,r);const h=Ft(null===(n=this.chart.dA.Hn)||void 0===n?void 0:n.axisXYZoomMouseButton,0),a=Ft(null===(o=this.chart.dA.Hn)||void 0===o?void 0:o.axisXYPanMouseButton,2),l=u(e.clientX,e.clientY);i===a&&this.Vf?(this.pA(t,r),Zt(e)):i===h&&this.zf&&(this.mA(t,s,l,r),Zt(e))},this.yA=(t,e,i,s)=>{var r,n;this.L.emit("axisAreaMouseDragStop",this,e,i,s);const o=Ft(null===(r=this.chart.dA.Hn)||void 0===r?void 0:r.axisXYZoomMouseButton,0),h=Ft(null===(n=this.chart.dA.Hn)||void 0===n?void 0:n.axisXYPanMouseButton,2),a=u(e.clientX,e.clientY);i===h&&this.Vf?(this.SA(t),Zt(e)):i===o&&this.zf&&(this.vA(t,s,a),Zt(e)),t.getIsUnderMouse()&&(this.Vf||this.zf||this.Of||this.Nf)&&this.aA(t)},this.xA=(t,e)=>{if(this.L.emit("axisAreaMouseWheel",this,e),this.Of){this.setStopped(!0);const t=this.Ch.getWidth(this.bA.cs.De(e.clientX,e.clientY)),i=this.ft.ct(t);this.zoom(i,ge(e)),Zt(e)}},this.MA=(t,e)=>this.L.emit("axisAreaMouseClick",this,e),this._A=(t,e)=>this.L.emit("axisAreaMouseDown",this,e),this.wA=(t,e)=>this.L.emit("axisAreaMouseUp",this,e),this.CA=(t,e)=>this.L.emit("axisAreaMouseMove",this,e),this.kA=(t,e,i)=>{this.L.emit("axisAreaTouchStart",this,i),this.zf&&(this.aA(t),this.AA(t,e),Zt(i))},this.TA=(t,e,i,s,r)=>{this.L.emit("axisAreaTouch",this,r),this.zf&&(this.mA(t,e,i,s),Zt(r))},this.FA=(t,e,i,s)=>{this.L.emit("axisAreaTouchEnd",this,s),this.zf&&(this.vA(t,e,i),this.uA(t),Zt(s))},this.IA=(t,e,i,s)=>{(this.Vf||this.Of)&&(this.aA(t),this.fA(t),Zt(s))},this.PA=(t,e,i,s,r,n)=>{if(this.Vf){const e=u((s.x+r.x)/2,(s.y+r.y)/2);this.pA(t,e),Zt(n)}if(this.Of){const t=this.bA.cs.De(e.x,e.y),o=this.bA.cs.De(i.x,i.y),h=Math.abs(this.Ch.getWidth(hi(t,s))-this.Ch.getWidth(hi(o,r)))-Math.abs(this.Ch.getWidth(t)-this.Ch.getWidth(o)),a=this.ft.mi(this.Ph,-h),l=this.ft.mi(this.Dh,h);this.Jh(a,l,!0),Zt(n)}},this.DA=(t,e,i,s)=>{(this.Vf||this.Of)&&(this.SA(t),this.uA(t),Zt(s))},this.BA=(t,e)=>{(this.Gf||this.Wf)&&this.LA(t)},this.RA=(t,e)=>{this.EA(t)},this.zA=(t,e,i)=>{const s=u(e.clientX,e.clientY);this.Gf&&this.VA(t,s)},this.OA=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.Gf&&this.NA(t,n,s,r)},this.GA=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.Gf&&this.WA(t,n,s,r)},this.UA=(t,e,i,s)=>{const r=u(e.clientX,e.clientY);(this.Gf||this.Wf)&&this.YA(t,r,s),(this.Gf||this.Wf)&&this.LA(t)},this.HA=(t,e)=>{this.Wf&&(this.setStopped(!0),this.zoom(this.Ph,ge(e)),Zt(e))},this.$A=(t,e)=>{this.Wf&&(this.setStopped(!0),this.zoom(this.Dh,ge(e)),Zt(e))},this.XA=(t,e,i)=>{this.Gf&&(this.LA(t),this.VA(t,e),Zt(i))},this.jA=(t,e,i,s,r)=>{this.Gf&&(this.NA(t,e,i,s),Zt(r))},this.ZA=(t,e,i,s,r)=>{this.Gf&&(this.WA(t,e,i,s),Zt(r))},this.QA=(t,e,i,s)=>{this.Gf&&(this.YA(t,e,i),this.EA(t),Zt(s))},this.JA=t,this.bA=i,this.KA=n,this.qA=o,this.chart=d,this.tg=g,this.ig=s,this.es=h,"logarithmic"===x.type&&this.chart.cs.Gn(ah.vf),m(this,this.tA),a.sg=this,this.eg=f,this.hg=this.eg>50?1:-1,this.rg=(v=this.Ch.toPoint(0,-this.hg),Math.abs(v.x)>=Math.abs(v.y)?v.x>=0?e.UIDirections.Right:e.UIDirections.Left:v.y>=0?e.UIDirections.Up:e.UIDirections.Down),this.ng=l,this.og=this.ft instanceof Di?(new _i).Ei(this.Ch.toVec2(this.ft,this.ng)):(new Pi).Ei(this.Ch.toVec2(this.ft,this.ng)),this.ag=this.chart.pixelScale,this.lg=(new _i).Ei(this.Ch.toVec2(this.Ch.getWidth(this.ag),this.ng)),this.ug=this.bA.ze(this.og).setMouseInteractions(!1),this.cg=this.bA.ze(this.og).setMouseInteractions(!1),this.dg=this.bA.ze(this.og).setMouseInteractions(!1),this.Ag=this.ig.Te(this.ag).ke(c.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).Ce(ot).jo(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.gg=this.ig.Te(this.ag).ke(c.getWidth({x:y.xAxisZoomingBandFillStyle,y:y.yAxisZoomingBandFillStyle})).Ce(c.getWidth({x:y.xAxisZoomingBandStrokeStyle,y:y.yAxisZoomingBandStrokeStyle})),this.pg=this.ig.Te(this.ag).ke(c.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).Ce(ot).jo(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.mg=this.ig.Te(this.ag).ke(c.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).Ce(ot).jo(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.Rh=this.ig.Dr(this.og).setMouseInteractions(!1).Gh(this.Ch.getTitleTextRotation(this.hg)).Pr(Re).Ir(Re),this.chart.cs.us.ls(this.Ag,(t=>this.Ag.ds(t)),{animationEnabled:this.ih}),this.chart.cs.us.ls(this.pg,(t=>this.pg.ds(t)),{animationEnabled:this.ih}),this.chart.cs.us.ls(this.mg,(t=>this.mg.ds(t)),{animationEnabled:this.ih});const b=Wi(new $i(this.kA,this.TA,this.FA,1),new Zi(this.IA,this.PA,this.DA),new ji(this.nA)),M=Wi(new $i(this.XA,this.jA,this.QA)),E=Wi(new $i(this.XA,this.ZA,this.QA));this.Ag.setMouseEnterEventHandler(this.oA).setMouseLeaveEventHandler(this.lA).setMouseDragStartEventHandler(this.cA).setMouseDragEventHandler(this.gA).setMouseDragStopEventHandler(this.yA).setMouseWheelEventHandler(this.xA).setMouseDoubleClickEventHandler(this.nA).setMouseClickEventHandler(this.MA).setMouseDownEventHandler(this._A).setMouseUpEventHandler(this.wA).setMouseMoveEventHandler(this.CA).setTouchStartEventHandler(b.onTouchStart).setTouchMoveEventHandler(b.onTouchMove).setTouchEndEventHandler(b.onTouchEnd),this.pg.setMouseEnterEventHandler(this.BA).setMouseLeaveEventHandler(this.RA).setMouseDragStartEventHandler(this.zA).setMouseDragEventHandler(this.OA).setMouseDragStopEventHandler(this.UA).setMouseWheelEventHandler(this.HA).setTouchStartEventHandler(M.onTouchStart).setTouchMoveEventHandler(M.onTouchMove).setTouchEndEventHandler(M.onTouchEnd),this.mg.setMouseEnterEventHandler(this.BA).setMouseLeaveEventHandler(this.RA).setMouseDragStartEventHandler(this.zA).setMouseDragEventHandler(this.GA).setMouseDragStopEventHandler(this.UA).setMouseWheelEventHandler(this.$A).setTouchStartEventHandler(E.onTouchStart).setTouchMoveEventHandler(E.onTouchMove).setTouchEndEventHandler(E.onTouchEnd),this.ug.Ee(c.getWidth({x:y.xAxisStrokeStyle,y:y.yAxisStrokeStyle})),this.cg.Ee(c.getWidth({x:y.xAxisNibStyle,y:y.yAxisNibStyle})),this.dg.Ee(c.getWidth({x:y.xAxisNibStyle,y:y.yAxisNibStyle})),this.Rh.ke(c.getWidth({x:y.xAxisTitleFillStyle,y:y.yAxisTitleFillStyle})).Nh(c.getWidth({x:y.xAxisTitleFont,y:y.yAxisTitleFont})),this.hs=h.rs(this,{}),this.Uh=this.hs.yg([this.Rh]).Ss(y.effectsText),this.Sg=null!==(S=c.getWidth({x:y.xAxisMarginAfterTicks,y:y.yAxisMarginAfterTicks}))&&void 0!==S?S:7,this.vg=null!==(A=c.getWidth({x:y.xAxisMarginAfterTitle,y:y.yAxisMarginAfterTitle}))&&void 0!==A?A:7}Tr(){return this.hh}Fr(){return void 0!==this.Qh}setTickStrategy(t,e){return super.Ih(t,e)}getTickStrategy(){return this.Ze}addBand(t=!0){const e=t?this.qA:this.KA,i=new Ps(e,this.chart,this.iA,this,this.og,this.Ch,this.ts,this.es);return this.Kf.push(i),i}addConstantLine(t=!0){const e=t?this.qA:this.KA,i=new Bs(e,this.chart,this.iA,this,this.og,this.Ch,this.ts,this.es);return this.Kf.push(i),i}xg(t){this.Kf.forEach(t)}bg(t){return this.Kf.map(t)}getHighlighters(){return this.Kf}setThickness(t){return"number"==typeof t?(this.Mg=t,this._g=t):"object"==typeof t&&(this.Mg=t.min,this._g=t.max),this.chart.cs.vs(),this}getThickness(){return{min:this.Mg,max:this._g}}setMouseInteractions(t){return this.setAxisInteractionPanByDragging(t).setAxisInteractionReleaseByDoubleClicking(t).setAxisInteractionZoomByDragging(t).setAxisInteractionZoomByWheeling(t).setNibInteractionScaleByDragging(t).setNibInteractionScaleByWheeling(t)}wg(){return this.If}cr(t,e){return new lh(e,t,this.bA,this.og,this.og)}Yh(){if(this.Cf){for(const t of this.Cf)t[1].grid.dispose(),t[1].tick.dispose();this.Cf.clear()}super.Yh()}dr(t,e){const{tickStart:i}=e,s=t.xh.ur,r=i+s.getTickLength()*this.hg+s.getTickPadding()*this.hg;t.Ye.Ie(this.Ch.toPoint(t.S,r)).za(this.Ch.toPoint(s.getLabelAlignment(),-this.hg)).Gh(s.labelRotation).setVisible(this.getVisible())}Cg(t,e){const{startPosition:i,gridStrokeLen:s,gridStrokeStart:r,tickStart:n}=e,o=t.xh.ur,h=i-s*o.getGridStrokeLength(),a=n+o.getTickLength()*this.hg;return{gridStroke:{start:this.Ch.toPoint(t.S,r),end:this.Ch.toPoint(t.S,h)},tickStroke:{start:this.Ch.toPoint(t.S,n),end:this.Ch.toPoint(t.S,a)}}}wr(t,e){return"linear"===this.Th.type?oh(t,e,this.ft):hh(t,e,this.ft)}kg(t,e){return e instanceof Di?oh:hh}kr(t,e,i){if("logarithmic"!==this.Th.type){const s=this.ft.Ri(e-t);return{min:t-i*s,max:e+i*s}}const s=this.ft;return{min:s.mi(t,-i),max:s.mi(e,i)}}Ds(){if(!this.ji)return{Tg:0,Fg:0,Od:0};const t=!(this.Qe.size>0),e=this.Rh&&this.Rh.Lh().length>0&&this.getTitleFillStyle()!==z,i=this.Ch.getHeight(e?this.chart.cs.Pg.Ig(this.getTitle(),this.getTitleFont(),this.getTitleRotation()):{x:0,y:0})+(e?this.vg:0),s=this.je===Gs?new Map:Qs(this.je,Math.min(this.Ph,this.Dh),Math.max(this.Ph,this.Dh),this.Ph,this.Dh,0),r=this.ft;let n=0;s.forEach(((e,i)=>{if((t=>void 0!==t.ur&&void 0!==t.ar)(i)){const s=Math.max(...e.map((e=>{if(!He(e,this.Ph,this.Dh))return 0;const s=this.chart.cs.Pg.Ig(i.ar(e,r),i.ur.labelFont,i.ur.labelRotation);return t||!s.isEstimate?this.Ch.getHeight(s):0})))+i.ur.tickLength+i.ur.tickPadding+i.ur.labelPadding;n=Math.max(n,s)}}));const o=this.Ff.reduce(this.hA,0);n=Math.max(n,o),n+=this.Sg;const h=Rt(i+n,void 0!==this.Mg?this.Mg:0,void 0!==this._g?this._g:Le);return this.Tf=h,{Tg:n,Fg:i,Od:h}}Fe(t){const e=this.getVisible()&&t.Dg>0;this.Bg=t;const i=this.ug.cu(),s=this.ft.getInnerStart()this.ft.getInnerStart()?this.ft.getInnerEnd():this.ft.getInnerStart(),n=i.getThickness()*this.hg/2,o=this.ng.getInnerInterval(),h=this.eg/100*o,a=h+t.Lg,l=o*this.hg,u=a+n;if(e||this.Yh(),this.je!==Gs&&e){const t=this.ft.ni();this.tr({physicalAxisSize:t,startPosition:h,gridStrokeLen:l,gridStrokeStart:a,tickStart:u});for(const[e,i]of this.Qe){let s=this.Cf.get(e);if(!s)if(e.Ne)s={grid:this.JA[0].Rg(this.og).setMouseInteractions(!1),tick:this.JA[0].Rg(this.og).setMouseInteractions(!1)};else if("Eg"in e){const t=Array.from(this.Qe.keys()).filter((t=>"Eg"in t)).reverse().indexOf(e),i=this.JA[t];if(!i)throw new Error("Not enough tick layers. This is an internal LCJS error - if you see this, please contact Arction support.");s={grid:i.Rg(this.og).setMouseInteractions(!1),tick:i.Rg(this.og).setMouseInteractions(!1)}}if(s){s.grid.Gt(),s.tick.Gt();for(const[e,r]of i){const e=this.Cg(r,{physicalAxisSize:t,startPosition:h,gridStrokeLen:l,gridStrokeStart:a,tickStart:u});s.grid.Vr().zg(e.gridStroke.start,e.gridStroke.end),s.tick.Vr().zg(e.tickStroke.start,e.tickStroke.end)}s.grid.Ee(e.ur.getGridStrokeStyle()),s.tick.Ee(e.ur.getTickStyle()),this.Cf.set(e,s)}}}const c=u,d=c+this.hg*t.Vg,f=this.Gf||this.Wf?Math.min(this.Rf,.25*t.Dg):0,g={start:this.Ch.toVec2(this.ft.mi(this.ft.getInnerStart(),f),c),end:this.Ch.toVec2(this.ft.mi(this.ft.getInnerEnd(),-f),d)},m=dt(this.Ch.toVec2(this.ft.getInnerStart(),d),this.og,this.ag),y=dt(g.start,this.og,this.ag),p=dt(g.end,this.og,this.ag),x=dt(this.Ch.toVec2(this.ft.getInnerEnd(),c),this.og,this.ag);this.ug.Oe(this.Ch.toPoint(s,a)).Ve(this.Ch.toPoint(r,a)).setVisible(e),this.cg.Oe(this.Ch.toPoint(this.ft.mi(this.ft.getInnerStart(),this.Df),a)).Ve(this.Ch.toPoint(this.ft.getInnerStart(),a)).setVisible(e),this.dg.Oe(this.Ch.toPoint(this.ft.mi(this.ft.getInnerEnd(),-this.Df),a)).Ve(this.Ch.toPoint(this.ft.getInnerEnd(),a)).setVisible(e);const S=a+t.Tg*this.hg;if(this.Rh.Ie(this.Ch.toPoint(this.Ch.getWidth(dt(ni(oi(m,x),.5),this.ag,this.og)),S)).za(this.Ch.toPoint(0,-1*this.hg)).setVisible(e),this.kf){const e=this.eg/100*o+t.Lg,i=-this.hg*o-t.Lg,s={start:this.Ch.toVec2(this.kf.min,u+this.hg*this.Tf),end:this.Ch.toVec2(this.kf.max,e+i)},r=dt(s.start,this.og,this.ag),n=dt(s.end,this.og,this.ag);this.gg.Ie(r).tt(hi(n,r)).setVisible(!0)}else this.gg.setVisible(!1);this.Ag.Ie(y).tt(hi(p,y)).setVisible(e),this.pg.Ie(m).tt(hi(y,m)).setVisible(e),this.mg.Ie(p).tt(hi(x,p)).setVisible(e);for(const i of this.Ff)i.update().plot(e,a,l,t.Lg,u);for(const t of this.Kf)t.Fe()}setLength(t){return this.Vd=t,this.chart.cs.vs(),this}getLength(){return this.Vd}setMargins(t,e){return this.sA=t,this.eA=e,this.chart.cs.vs(),this}getMargins(){return{start:this.sA,end:this.eA}}getStackIndex(){var t,e;return null!==(e=null===(t=[...this.chart.Og,...this.chart.Ng,...this.chart.Gg,...this.chart.Wg].find((t=>t.axis===this)))||void 0===t?void 0:t.iStack)&&void 0!==e?e:0}getParallelIndex(){var t,e;return null!==(e=null===(t=[...this.chart.Og,...this.chart.Ng,...this.chart.Gg,...this.chart.Wg].find((t=>t.axis===this)))||void 0===t?void 0:t.iParallel)&&void 0!==e?e:0}Ug(){const t=this.Bg;if(!t)return;const e=this.getVisible()&&t.Dg>0,i=this.ug.cu().getThickness()*this.hg/2,s=this.ng.getInnerInterval(),r=this.eg/100*s+t.Lg,n=s*this.hg,o=r+i;for(const i of this.Ff)i.update().plot(e,r,n,t.Lg,o);for(const t of this.Kf)t.Fe()}Yg(){return this.Tf}Hg(t,e){e=e||ih.AxisTickMajor;const i=new vn(this,t?this.JA[0]:this.ig,this.ig,this.ft,this.lg,this.lg,this.Ch,this.rg,this.rA,this.ts,e).setTextFormatter(this.formatValue);return this.Ff.push(i),i}aA(t){this.chart.cs.us._s(t,1),this.Bf=t.cs.Ur(this.Xf,this.Bf)}uA(t){this.chart.cs.us._s(t,0),t.cs.Yr(this.Bf)}fA(t){this.setStopped(!0),t.cs.Yr(this.Bf)}pA(t,e){const i=-this.Ch.getWidth(e);this.pan(i),this.Bf=t.cs.Ur(this.jf,this.Bf)}pan(t){const e=this.Ph,i=this.Dh,s=this.ft.mi(e,t),r=this.ft.mi(i,t);this.Jh(s,r,!1)}zoom(t,e){const i=this.ft.dt(this.Ph),s=this.ft.dt(this.Dh),r=this.ft.dt(t),n=Rt((r-i)/(s-i),0,1),o=.2*this.ft.ni(),h=n*this.Ef*o*-e,a=(1-n)*this.Ef*o*e,l=this.ft.mi(this.Ph,h),u=this.ft.mi(this.Dh,a);this.Jh(l,u,!0)}SA(t){this.kf=void 0,t.cs.Yr(this.Bf)}AA(t,e){this.setStopped(!0),t.cs.Yr(this.Bf),this.chart.cs.us._s(this.Ag,0)}mA(t,e,i,s){const r=dt(this.bA.cs.De(i.x,i.y),this.bA.cs.ft,this.og),n=Rt(this.Ch.getWidth(r),this.Ph,this.Dh),o=this.Ch.getWidth(dt(this.bA.cs.De(e.x,e.y),this.bA.cs.ft,this.og));Math.abs(this.ft.dt(n)-this.ft.dt(o))>10?(this.kf=m(Math.min(n,o),Math.max(n,o)),this.Bf=t.cs.Ur(this.Zf,this.Bf)):(this.kf=void 0,this.Bf=t.cs.Ur(this.Xf,this.Bf)),this.bA.vs()}vA(t,e,i){if(this.kf){const t=this.kf.min,e=this.kf.max,i=this.Dh{e.ys(t)}));for(const e of this.Cf.values())e.grid.setVisible(t),e.tick.setVisible(t);return super.setVisible(t),this.chart.cs.vs(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationHighlight(this.ih),this}}const ch={getWidth:t=>t.x,getHeight:t=>t.y,toVec2:(t,e)=>({x:t,y:e}),toPoint:(t,e)=>u(t,e)},dh={getWidth:t=>t.y,getHeight:t=>t.x,toVec2:(t,e)=>({x:e,y:t}),toPoint:(t,e)=>u(e,t)},fh=t=>!!(t&&"object"==typeof t&&"x"in t&&t.x instanceof uh&&"y"in t&&t.y instanceof uh),gh=s.Record({type:"tick-style",gridStrokeLength:1,gridStrokeStyle:new Ji,tickLength:7,tickStyle:new Ji,tickPadding:0,labelFont:new rr,labelFillStyle:new G,labelPadding:0,labelAlignment:0,labelRotation:0});class mh extends gh{constructor(t){super(t)}setGridStrokeLength(t){return this.set("gridStrokeLength",t)}getGridStrokeLength(){return this.get("gridStrokeLength")}setGridStrokeStyle(t){return this.set("gridStrokeStyle","function"==typeof t?t(this.get("gridStrokeStyle")):t)}getGridStrokeStyle(){return this.get("gridStrokeStyle")}setTickLength(t){return this.set("tickLength",t)}getTickLength(){return this.get("tickLength")}setTickStyle(t){return this.set("tickStyle","function"==typeof t?t(this.get("tickStyle")):t)}getTickStyle(){return this.get("tickStyle")}setTickPadding(t){return this.set("tickPadding",t)}getTickPadding(){return this.get("tickPadding")}setLabelFillStyle(t){return this.set("labelFillStyle","function"==typeof t?t(this.get("labelFillStyle")):t)}getLabelFillStyle(){return this.get("labelFillStyle")}setLabelFont(t){return this.set("labelFont","function"==typeof t?t(this.get("labelFont")):t)}getLabelFont(){return this.get("labelFont")}setLabelPadding(t){return this.set("labelPadding",t)}getLabelPadding(){return this.get("labelPadding")}setLabelAlignment(t){return this.set("labelAlignment",t)}getLabelAlignment(){return this.get("labelAlignment")}setLabelRotation(t){return this.set("labelRotation",t)}getLabelRotation(){return this.get("labelRotation")}}const yh=t=>!(!t||"object"!=typeof t||!("type"in t)||"tick-style"!==t.type),ph=new mh({labelFillStyle:z,gridStrokeStyle:ot,tickStyle:ot}),xh=t=>yh(t)&&N(t.labelFillStyle)&&ht(t.gridStrokeStyle)&&ht(t.tickStyle),Sh=(t,e,i,s,r)=>(n,o)=>h=>{const a=new Date(h+n),l={year:o?a.getUTCFullYear():a.getFullYear(),monthIndex:o?a.getUTCMonth():a.getMonth(),day:o?a.getUTCDate():a.getDate(),hours:o?a.getUTCHours():a.getHours(),minutes:o?a.getUTCMinutes():a.getMinutes(),seconds:o?a.getUTCSeconds():a.getSeconds(),millis:o?a.getUTCMilliseconds():a.getMilliseconds()},u=s?s(l):void 0;if(0===t&&!0===u)return h;const c=l[e];r.includes("year")&&(l.year=Math.floor(l.year/i)*i),r.includes("monthIndex")&&(l.monthIndex=0),r.includes("day")&&(l.day=1),r.includes("hours")&&(l.hours=0),r.includes("minutes")&&(l.minutes=0),r.includes("seconds")&&(l.seconds=0),r.includes("millis")&&(l.millis=0);let d=(0===t?1:t)*i;return-1===t&&!1===u&&(d=0),0!==d&&(l[e]=i*(d>0?Math.floor((c+d)/i):Math.ceil((c+d)/i))),o?Date.UTC(l.year,l.monthIndex,l.day,l.hours,l.minutes,l.seconds,l.millis)-n:new Date(l.year,l.monthIndex,l.day,l.hours,l.minutes,l.seconds,l.millis).getTime()-n},Ah=(t,e,i,...s)=>Sh(-1,t,e,i,s),vh=(t,e,i,...s)=>Sh(-1,t,e,i,s),bh=(t,e,i,...s)=>Sh(0,t,e,i,s),Mh=(t,e,...i)=>Sh(1,t,e,void 0,i),Eh=t=>(e,i)=>s=>{const r=new Date(s+e),n=i?r.getUTCDay():r.getDay(),o=1===n&&0===(i?r.getUTCHours():r.getHours())&&0===(i?r.getUTCMinutes():r.getMinutes())&&0===r.getSeconds()&&0===r.getMilliseconds();if(0===t&&!0===o)return s;let h=i?r.getUTCDate():r.getDate();return-1===t&&1===n&&!1===o||(-1===t?h-=n>=2?n-1:n+6:h+=n>0?8-n:1),i?Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),h,0,0,0,0)-e:new Date(r.getFullYear(),r.getMonth(),h,0,0,0,0).getTime()-e},Th=[{label:"MilliSecond100",unit:100,irregular:!1,greatTicks:void 0,majorTicks:{fitFunction:js({ignore:"first"},2,5)},minorTicks:{amount:4,fitFunction:js(void 0,2)}},{label:"Second",unit:1e3,irregular:!1,greatTicks:{getReferenceKeyValue:Ah("seconds",1,(t=>0===t.millis),"millis")},majorTicks:{fitFunction:$s(5,10,15,30)},minorTicks:{amount:4,fitFunction:js(void 0,2)}},{label:"Minute",unit:6e4,irregular:!1,greatTicks:{getReferenceKeyValue:Ah("minutes",1,(t=>0===t.seconds&&0===t.millis),"seconds","millis")},majorTicks:{fitFunction:$s(5,10,15,30)},minorTicks:{amount:12,fitFunction:js(void 0,3,6)}},{label:"Hour",unit:36e5,irregular:!1,greatTicks:{getReferenceKeyValue:Ah("hours",1,(t=>0===t.minutes&&0===t.seconds&&0===t.millis),"minutes","seconds","millis")},majorTicks:{fitFunction:$s(3,6,12)},minorTicks:{amount:8,fitFunction:js(void 0,2,4)}},{label:"Day",unit:864e5,irregular:!1,greatTicks:{getReferenceKeyValue:Ah("day",1,(t=>0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"hours","minutes","seconds","millis")},majorTicks:{fitFunction:js({ignore:"last"},2,4)},minorTicks:{amount:7,fitFunction:js({ignore:"last"},2,3)}},{label:"Week",unit:6048e5,irregular:!0,getPrevKeyValue:Eh(-1),getNextKeyValueIncludingRef:Eh(0),getNextKeyValue:Eh(1),greatTicks:!0,majorTicks:{fitFunction:js(void 0,2)},minorTicks:{fitFunction:void 0}},{label:"Month",unit:2592e6,irregular:!0,getPrevKeyValue:vh("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:bh("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValue:Mh("monthIndex",1,"day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:js(void 0,2,3)},minorTicks:{fitFunction:js(void 0,2,4,6)}},{label:"Year",unit:31536e6,irregular:!0,getPrevKeyValue:vh("year",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:bh("year",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValue:Mh("year",1,"monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:js({ignore:"first"},2,5)},minorTicks:{fitFunction:js(void 0,2,5)}},{label:"Decade",unit:31536e7,irregular:!0,getPrevKeyValue:vh("year",10,(t=>t.year%10==0&&1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"year","monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:bh("year",10,(t=>t.year%10==0&&1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"year","monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValue:Mh("year",10,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:js(void 0,2,4)},minorTicks:{fitFunction:js(void 0,2,5)}},{label:"Century",unit:316224e7,irregular:!0,getPrevKeyValue:vh("year",100,(t=>t.year%100==0&&1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"year","monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:bh("year",100,(t=>t.year%100==0&&1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"year","monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValue:Mh("year",100,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:void 0},minorTicks:void 0},{label:"Millennium",unit:316224e8,irregular:!0,getPrevKeyValue:vh("year",1e3,(t=>t.year%1e3==0&&1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"year","monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:bh("year",1e3,(t=>t.year%1e3==0&&1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"year","monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValue:Mh("year",1e3,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:void 0},minorTicks:void 0}],wh=(t,e,i)=>{let s=((t,e,i,s,r)=>{const n=e-t;let o;for(let t=0;t(s,r,n,o)=>{const h=wh("great",s,r);if(void 0===h)return[];if("Decade"===h.label||"Century"===h.label||"Millennium"===h.label)return[];const a=o>n?s:r,l=(s+r)/2,u=o>n?r:s;if(Th.indexOf(h)<=Th.findIndex((t=>"Hour"===t.label)))return"left"===i?[a]:[];let c;if(!0===h.irregular)c=Ws(s,r,h.getPrevKeyValue(t,e),h.getNextKeyValue(t,e));else{const i=h.greatTicks.getReferenceKeyValue(t,e)(s);c=Xs(s,r,h.unit,i,1)}const d=((t,e,i)=>{for(const s of i)if(s>=t&&s<=e)return s})(s,r,c);return"left"===i?void 0===d||He(d,l,u)?[a]:[d]:void 0!==d&&He(d,l,u)?[d]:[u]},Ch=(t,e,i)=>(s,r,n,o)=>{const h=wh(t,n,o);let a;if(void 0===h)return[];if("great"===t&&void 0!==h.greatTicks)if(!0===h.irregular)a=Ws(s,r,h.getPrevKeyValue(e,i),h.getNextKeyValue(e,i));else{const t=h.greatTicks.getReferenceKeyValue(e,i)(s);a=Xs(s,r,h.unit,t,1)}else if("major"===t&&void 0!==h.majorTicks)a=!0===h.irregular?((t,e,i,s)=>{const r=[];let n=i(t),o=0;for(;n1e3)throw new Error("Infinite loop in Axis tick key values logic.");return r.push(n),r})(s,r,h.getPrevKeyValue(e,i),h.getNextKeyValue(e,i)):((t,e,i)=>{const s=[];let r=t,n=0;for(;r1e3)throw new Error("Infinite loop in Axis tick key values logic.");return s.push(r),s})(s,r,h.unit);else{if("minor"!==t||void 0===h.minorTicks)return[];if(!0===h.irregular)a=((t,e,i,s)=>{const r=[];let n=i(t),o=0;for(;n1e3)throw new Error("Infinite loop in Axis tick key values logic.");return r})(s,r,h.getNextKeyValueIncludingRef(e,i),h.getNextKeyValue(e,i));else{const t=(t=>{if(void 0!==t)return Th[Th.indexOf(t)+1]})(h);if(void 0===t)return[];a=Hs(s,r,t.unit/h.minorTicks.amount,1)}}return a},Rh=t=>(e,i,s,r,n,o)=>{const h=wh(t,n,o);if(void 0===h)return;let a;return"major"===t?a=h.majorTicks.fitFunction:h.minorTicks&&(a=h.minorTicks.fitFunction),a?a(e,i,s,r,n,o):void 0},Ih=s.Record({type:"date-time-ticks",utc:!1,locale:void 0,dateOrigin:void 0,cursorFormatter:void 0,greatTickStyle:new mh,majorTickStyle:new mh,minorTickStyle:new mh,formatOptionsMajorCentury:{year:"numeric"},formatOptionsMinorDecade:{year:"numeric"},formatOptionsMajorDecade:{year:"numeric"},formatOptionsMinorYear:{year:"numeric"},formatOptionsMajorYear:{year:"numeric"},formatOptionsMinorMonth:{month:"short"},formatOptionsGreatYear:{year:"numeric"},formatOptionsMajorMonth:{month:"long"},formatOptionsMinorWeek:{day:"numeric"},formatOptionsGreatMonth:{year:"numeric",month:"long"},formatOptionsMajorWeek:{day:"numeric",weekday:"short"},formatOptionsMinorDay:{day:"numeric",weekday:"short"},formatOptionsGreatWeek:(t,e,i)=>{const s=new Date(t),r=(t=>{const e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()));e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));const i=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-i.getTime())/864e5+1)/7)})(s);return`${new Intl.DateTimeFormat(i,{year:"numeric",month:"long"}).format(s)} Week ${r}`},formatOptionsMajorDay:{weekday:"long",day:"numeric"},formatOptionsMinorHour:{hour:"2-digit",minute:"2-digit"},formatOptionsGreatDay:{year:"numeric",month:"long",day:"numeric"},formatOptionsMajorHour:{hour:"2-digit",minute:"2-digit"},formatOptionsMinorMinute:{hour:"2-digit",minute:"2-digit"},formatOptionsGreatHour:{year:"numeric",month:"long",day:"numeric"},formatOptionsMajorMinute:{hour:"2-digit",minute:"2-digit"},formatOptionsMinorSecond:{hour:"2-digit",minute:"2-digit",second:"2-digit"},formatOptionsGreatMinute:{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"},formatOptionsMajorSecond:{second:"2-digit"},formatOptionsMinorMillisecond:t=>{const e=new Date(t);return`${(e.getSeconds()+e.getUTCMilliseconds()/1e3).toFixed(2)}`},formatOptionsGreatSecond:{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"},formatOptionsMajorMilliSecond:t=>{const e=new Date(t);return`${(e.getSeconds()+e.getUTCMilliseconds()/1e3).toFixed(1)}`}});class Fh extends Ih{Hh(t){const e=void 0!==this.dateOrigin?this.dateOrigin.getTime():0,i=t=>Th.map((e=>{const i=((t,e,i)=>{switch(i.label){case"MilliSecond100":return"Great"===e?void 0:"Major"===e?t.formatOptionsMajorMilliSecond:t.formatOptionsMinorMillisecond;case"Second":return"Great"===e?t.formatOptionsGreatSecond:"Major"===e?t.formatOptionsMajorSecond:t.formatOptionsMinorSecond;case"Minute":return"Great"===e?t.formatOptionsGreatMinute:"Major"===e?t.formatOptionsMajorMinute:t.formatOptionsMinorMinute;default:case"Hour":return"Great"===e?t.formatOptionsGreatHour:"Major"===e?t.formatOptionsMajorHour:t.formatOptionsMinorHour;case"Day":return"Great"===e?t.formatOptionsGreatDay:"Major"===e?t.formatOptionsMajorDay:t.formatOptionsMinorDay;case"Week":return"Great"===e?t.formatOptionsGreatWeek:"Major"===e?t.formatOptionsMajorWeek:t.formatOptionsMinorWeek;case"Month":return"Great"===e?t.formatOptionsGreatMonth:"Major"===e?t.formatOptionsMajorMonth:t.formatOptionsMinorMonth;case"Year":return"Great"===e?t.formatOptionsGreatYear:"Major"===e?t.formatOptionsMajorYear:t.formatOptionsMinorYear;case"Decade":return"Great"===e?void 0:"Major"===e?t.formatOptionsMajorDecade:t.formatOptionsMinorDecade;case"Century":return"Great"===e?void 0:"Major"===e?t.formatOptionsMajorCentury:void 0;case"Millennium":return}})(this,t,e);if("object"!=typeof i)return i;try{return new Intl.DateTimeFormat(this.locale,i)}catch(t){let e="";for(const t in i)e+=` ${t}: ${i[t]},`;bt.console.error(`Invalid Intl.DateTimeFormat ( locale: ${this.locale}, formatOptions {${e}} )`)}})),s=new Map;s.set("great",i("Great")),s.set("major",i("Major")),s.set("minor",i("Minor"));const r=t=>String(t),n=(t,i)=>(n,o)=>{let h=n+e;const a=o.getInnerStart(),l=o.getInnerEnd(),u=a>l,c=wh(t,u?l:a,u?a:l);if(void 0===c)return r(h);if("great"===t){const t=Ct(n,"left"===i?a:l);let s;if(s=!1===t?n:!1===c.irregular?"left"===i&&!1===u||"right"===i&&!0===u?c.greatTicks.getReferenceKeyValue(e,this.utc)(n):c.greatTicks.getReferenceKeyValue(e,this.utc)(n+1*c.unit):"left"===i&&!1===u||"right"===i&&!0===u?c.getPrevKeyValue(e,this.utc)(n):c.getNextKeyValue(e,this.utc)(n),h=s+e,"right"===i&&!0===t)return""}const d=s.get(t);if(void 0===d)return r(h);const f=d[Th.indexOf(c)];return void 0===f?"":"function"==typeof f?f(h,o,this.locale):f.format(h)},o=[],h=[{Ye:"Great ticks (directive)",Eg:0,Ge:!0,Lr:Ch("great",e,this.utc),Rr:void 0},{Ye:"Major ticks",Eg:1,ur:this.majorTickStyle,ar:n("major"),Lr:Ch("major",e,this.utc),bh:{Ar:Rh("major")},Rr:void 0}];xh(this.greatTickStyle)||(o.push({Ye:"Great ticks (left)",ur:this.greatTickStyle.setLabelAlignment(-1),ar:n("great","left"),Lr:kh(e,this.utc,"left"),Ne:!0,mr:!1}),o.push({Ye:"Great ticks (right)",ur:this.greatTickStyle.setLabelAlignment(1),ar:n("great","right"),Lr:kh(e,this.utc,"right"),Ne:!0,mr:!1})),xh(this.minorTickStyle)||h.push({Ye:"Minor ticks",Eg:2,ur:this.minorTickStyle,ar:n("minor"),Lr:Ch("minor",e,this.utc),bh:{Ar:Rh("minor"),Mh:(t,e,i,s,r,n)=>{const o=wh("minor",r,n);return!o||"Week"!==o.label}},Rr:void 0});const a=this.cursorFormatter;return{$e:o,Xe:h,We:a?(t,i,s)=>a(e+t,i,s):(t,i,s)=>{const r=new Date(e+t);return`${new Intl.DateTimeFormat(s,{year:"numeric",month:"numeric",day:"numeric",minute:"2-digit",hour:"2-digit"}).format(r)} `},jh:1e3,Zh:31536e9}}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}setTickStyle(t){return this.setGreatTickStyle(t).setMajorTickStyle(t).setMinorTickStyle(t)}setGreatTickStyle(t){if("function"==typeof t){const e=this.get("greatTickStyle");return this.set("greatTickStyle",t(e))}return this.set("greatTickStyle",t)}getGreatTickStyle(){return this.get("greatTickStyle")}setMajorTickStyle(t){return"function"==typeof t?this.set("majorTickStyle",t(this.get("majorTickStyle"))):this.set("majorTickStyle",t)}getMajorTickStyle(){return this.get("majorTickStyle")}setMinorTickStyle(t){if("function"==typeof t){const e=this.get("minorTickStyle");return this.set("minorTickStyle",t(e))}return this.set("minorTickStyle",t)}getMinorTickStyle(){return this.get("minorTickStyle")}setUTC(t){return this.set("utc",t)}getUTC(){return this.get("utc")}setLocale(t){return this.set("locale",t)}getLocale(){return this.get("locale")}setDateOrigin(t){return this.set("dateOrigin",t)}getDateOrigin(){return this.get("dateOrigin")}setFormatting(t,e,i){return this.withMutations((s=>s.set("formatOptionsGreatYear",t||this.formatOptionsGreatYear).set("formatOptionsGreatMonth",t||this.formatOptionsGreatMonth).set("formatOptionsGreatWeek",t||this.formatOptionsGreatWeek).set("formatOptionsGreatDay",t||this.formatOptionsGreatDay).set("formatOptionsGreatHour",t||this.formatOptionsGreatHour).set("formatOptionsGreatMinute",t||this.formatOptionsGreatMinute).set("formatOptionsGreatSecond",t||this.formatOptionsGreatSecond).set("formatOptionsMajorCentury",e||this.formatOptionsMajorCentury).set("formatOptionsMajorDecade",e||this.formatOptionsMajorDecade).set("formatOptionsMajorYear",e||this.formatOptionsMajorYear).set("formatOptionsMajorMonth",e||this.formatOptionsMajorMonth).set("formatOptionsMajorWeek",e||this.formatOptionsMajorWeek).set("formatOptionsMajorDay",e||this.formatOptionsMajorDay).set("formatOptionsMajorHour",e||this.formatOptionsMajorHour).set("formatOptionsMajorMinute",e||this.formatOptionsMajorMinute).set("formatOptionsMajorSecond",e||this.formatOptionsMajorSecond).set("formatOptionsMajorMilliSecond",e||this.formatOptionsMajorMilliSecond).set("formatOptionsMinorDecade",i||this.formatOptionsMinorDecade).set("formatOptionsMinorYear",i||this.formatOptionsMinorYear).set("formatOptionsMinorMonth",i||this.formatOptionsMinorMonth).set("formatOptionsMinorWeek",i||this.formatOptionsMinorWeek).set("formatOptionsMinorDay",i||this.formatOptionsMinorDay).set("formatOptionsMinorHour",i||this.formatOptionsMinorHour).set("formatOptionsMinorMinute",i||this.formatOptionsMinorMinute).set("formatOptionsMinorSecond",i||this.formatOptionsMinorSecond)))}setFormattingDecade(t,e){return this.withMutations((i=>(t&&(i=i.set("formatOptionsMajorDecade",t)),e&&(i=i.set("formatOptionsMinorYear",e)),i)))}setFormattingYear(t,e){return this.withMutations((i=>(t&&(i=i.set("formatOptionsMajorYear",t)),e&&(i=i.set("formatOptionsMinorMonth",e)),i)))}setFormattingMonth(t,e,i){return this.withMutations((s=>(t&&(s=s.set("formatOptionsGreatYear",t)),e&&(s=s.set("formatOptionsMajorMonth",e)),i&&(s=s.set("formatOptionsMinorWeek",i)),s)))}setFormattingWeek(t,e,i){return this.withMutations((s=>(t&&(s=s.set("formatOptionsGreatMonth",t)),e&&(s=s.set("formatOptionsMajorWeek",e)),i&&(s=s.set("formatOptionsMinorDay",i)),s)))}setFormattingDay(t,e,i){return this.withMutations((s=>(t&&(s=s.set("formatOptionsGreatWeek",t)),e&&(s=s.set("formatOptionsMajorDay",e)),i&&(s=s.set("formatOptionsMinorHour",i)),s)))}setFormattingHour(t,e,i){return this.withMutations((s=>(t&&(s=s.set("formatOptionsGreatDay",t)),e&&(s=s.set("formatOptionsMajorHour",e)),i&&(s=s.set("formatOptionsMinorMinute",i)),s)))}setFormattingMinute(t,e,i){return this.withMutations((s=>(t&&(s=s.set("formatOptionsGreatHour",t)),e&&(s=s.set("formatOptionsMajorMinute",e)),i&&(s=s.set("formatOptionsMinorSecond",i)),s)))}setFormattingSecond(t,e,i){return this.withMutations((s=>(t&&(s=s.set("formatOptionsGreatMinute",t)),e&&(s=s.set("formatOptionsMajorSecond",e)),i&&(s=s.set("formatOptionsMinorMillisecond",i)),s)))}setFormattingMilliSecond(t,e){return this.withMutations((i=>(t&&(i=i.set("formatOptionsGreatSecond",t)),e&&(i=i.set("formatOptionsMajorMilliSecond",e)),i)))}}const Dh=(t,e)=>(i,s)=>{const r=s-i;if(e){const e=Math.log10(r/2);let n=10**Math.floor(e-t);const o=1/n;n=Math.round(n*o)/o;const h=Math.round(Math.floor(i/(10*n))*n*10*o)/o;return Xs(h,s,n,void 0,o)}const n=Math.log10(r);let o=10**Math.round(n-t);const h=1/o;return o=Math.round(o*h)/h,Hs(i,s,o,h)},Lh=(t,e,i,s,r,n)=>0===e?t.filter(((t,e)=>e%2==0)):1===e?t.filter(((t,e)=>e%5==0)):void 0,Vh=(t,e,i,s,r,n)=>0===e?t.filter(((t,e)=>e%2==0)):1===e?t.filter(((t,e)=>e%3==0)):2===e?t.filter(((t,e)=>e%4==0)):3===e?t.filter(((t,e)=>e%5==0)):void 0,_h=js(void 0,2,5),Ph=(t,e,i,s,r,n)=>0===e?[t[1],t[3],t[5]]:1===e?[t[0],t[3]]:2===e?[t[1]]:void 0,Bh=(t,e)=>{const i=Ei(t),s=Ti(t);if(e)return(t,e)=>{const r=[],n=Math.floor(i(t)),o=Math.ceil(i(e));for(let t=n-1;t<=o+1;t+=1){const e=s**t;r.push(e)}return r};const r=10===t?9:4;return(t,e)=>{const n=Math.round(i(t)),o=Math.round(i(e)),h=[],a=s**n,l=(s**o-a)/r;for(let i=1;i<=r;i+=1){const s=a+l*i;s>t&&sIi.LogarithmicNoExponents(e,i,void 0,t.base):Ii.Numeric),s=this.get("majorFormattingFunction")||("logarithmic"===t.type?(e,i)=>Ii.LogarithmicNoExponents(e,i,void 0,t.base):Ii.Numeric),r=this.get("minorFormattingFunction")||("logarithmic"===t.type?(e,i)=>Ii.LogarithmicNoExponents(e,i,void 0,t.base):Ii.Numeric),n=[],o=[];xh(this.extremeTickStyle)||n.push({Ye:"Extreme ticks",ur:this.extremeTickStyle,ar:void 0===e?i:(t,s,r)=>i(e+t,s,r),Lr:Ys,Ne:!0,mr:!0}),o.push({Ye:"Major ticks",Eg:0,ur:this.majorTickStyle,ar:void 0===e?s:(t,i,r)=>s(e+t,i,r),Lr:"logarithmic"===t.type?Bh(t.base,!0):Dh(0,!0),bh:"logarithmic"===t.type?{Ar:Vh}:{Ar:Lh},Rr:void 0}),xh(this.minorTickStyle)||o.push({Ye:"Minor ticks",Eg:1,ur:this.minorTickStyle,ar:void 0===e?r:(t,i,s)=>r(e+t,i,s),Lr:"logarithmic"===t.type?Bh(t.base,!1):Dh(1,!1),bh:"logarithmic"===t.type?{Ar:Ph}:{Ar:_h},Rr:50});const h=this.cursorFormatter?this.cursorFormatter:Ii.Numeric;return{$e:n,Xe:o,We:void 0===e?h:(t,i,s)=>h(e+t,i,s),jh:1e-9,Zh:void 0}}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}setExtremeTickStyle(t){if("function"==typeof t){const e=this.get("extremeTickStyle");return this.set("extremeTickStyle",t(e))}return this.set("extremeTickStyle",t)}getExtremeTickStyle(){return this.get("extremeTickStyle")}setFormattingOffset(t){return this.set("formattingOffset",t)}getFormattingOffset(){return this.get("formattingOffset")}setTickStyle(t){const e=this.setMajorTickStyle(t).setMinorTickStyle(t);return e.extremeTickStyle!==ph?e.setExtremeTickStyle(t):e}setMajorTickStyle(t){return"function"==typeof t?this.set("majorTickStyle",t(this.get("majorTickStyle"))):this.set("majorTickStyle",t)}getMajorTickStyle(){return this.get("majorTickStyle")}setMinorTickStyle(t){if("function"==typeof t){const e=this.get("minorTickStyle");return this.set("minorTickStyle",t(e))}return this.set("minorTickStyle",t)}getMinorTickStyle(){return this.get("minorTickStyle")}setFormattingFunction(t){return this.withMutations((e=>e.set("extremeFormattingFunction",t).set("majorFormattingFunction",t).set("minorFormattingFunction",t).set("cursorFormatter",t)))}getExtremeFormattingFunction(){return this.get("extremeFormattingFunction")}setExtremeFormattingFunction(t){return this.set("extremeFormattingFunction",t)}getMajorFormattingFunction(){return this.get("majorFormattingFunction")}setMajorFormattingFunction(t){return this.set("majorFormattingFunction",t)}getMinorFormattingFunction(){return this.get("minorFormattingFunction")}setMinorFormattingFunction(t){return this.set("minorFormattingFunction",t)}}const Uh=s.Record({type:"time-ticks",cursorFormatter:void 0,timeOrigin:void 0,majorTickStyle:new mh,minorTickStyle:new mh,majorFormattingFunction:void 0,minorFormattingFunction:void 0}),Oh=(t,e)=>{const i=e-t;return i>=864e5?"MajorHours12":i>=36e5?"MajorHours":i>=6e5?"MajorMinutes15":i>=9e4?"MajorMinutes":i>=10500?"MajorSeconds15":i>=1e3?"MajorSeconds":i>=100?"MajorMilliseconds100":i>=10?"MajorMilliseconds10":i>=1?"MajorMilliseconds":i>=.1?"MajorMicroseconds100":i>=.01?"MajorMicroseconds10":i>=.001?"MajorMicroseconds":i<=.001?"MajorNanoseconds100":"Unknown"},Gh={hhmmss:t=>{let e=Math.abs(t);const i=t>=0?"":"-",s=Math.floor(e/36e5);e%=36e5;const r=Math.floor(e/6e4);e%=6e4;const n=Math.floor(e/1e3);return`${i}${de(s,2)}:${de(r,2)}:${de(n,2)}`},hhmmssmmm:t=>{let e=Math.abs(t);const i=t>=0?"":"-",s=Math.floor(e/36e5);e%=36e5;const r=Math.floor(e/6e4);e%=6e4;const n=Math.floor(e/1e3);e%=1e3;const o=Math.floor(e/1);return`${i}${de(s,2)}:${de(r,2)}:${de(n,2)}.${de(o,3)}`},hhmmssmmmuuu:t=>{const e=Math.abs(t),i=t>=0?"":"-",s=Math.floor(e/36e5),r=Math.floor(e/6e4)%60,n=Math.floor(e/1e3)%60,o=Math.floor(e/1)%1e3,h=t.toLocaleString("en-US",{minimumFractionDigits:3,maximumFractionDigits:3}).split(".")[1];return`${i}${de(s,2)}:${de(r,2)}:${de(n,2)}.${de(o,3)}${h}`},hhmmssmmmuuunnn:t=>{const e=Math.abs(t),i=t>=0?"":"-",s=Math.floor(e/36e5),r=Math.floor(e/6e4)%60,n=Math.floor(e/1e3)%60,o=Math.floor(e/1)%1e3,h=t.toLocaleString("en-US",{minimumFractionDigits:6,maximumFractionDigits:6}).split(".")[1];return`${i}${de(s,2)}:${de(r,2)}:${de(n,2)}.${de(o,3)}${h}`}},Yh={MajorHours12:{major:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>{const r=432e5;return t=Math.floor(t/(4*r))*r*4,Xs(t,e,r,void 0,1e6)},fitKeyValues:js({ignore:"first"},2,4)},minor:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>Hs(t,e,36e5,1e6),fitKeyValues:js({},2,3,4,6)},defaultValueFormatter:Gh.hhmmss},MajorHours:{major:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>{const r=36e5;return t=Math.floor(t/(12*r))*r*12,Xs(t,e,r,void 0,1e6)},fitKeyValues:js({ignore:"first"},2,6,12)},minor:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>Hs(t,e,3e5,1e6),fitKeyValues:js({},2,4,6)},defaultValueFormatter:Gh.hhmmss},MajorMinutes15:{major:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>(t=36e5*Math.floor(t/36e5),Xs(t,e,9e5,void 0,1e6)),fitKeyValues:js({ignore:"first"},2)},minor:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>Hs(t,e,6e4,1e6),fitKeyValues:js({},3,5)},defaultValueFormatter:Gh.hhmmss},MajorMinutes:{major:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>(t=6e4*Math.floor(t/6e5)*10,Xs(t,e,6e4,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>Hs(t,e,5e3,1e6),fitKeyValues:js({},2,3,4,6)},defaultValueFormatter:Gh.hhmmss},MajorSeconds15:{major:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>(t=15e3*Math.floor(t/6e4)*4,Xs(t,e,15e3,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,4)},minor:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>Hs(t,e,1e3,1e6),fitKeyValues:js({},3,5)},defaultValueFormatter:Gh.hhmmss},MajorSeconds:{major:{format:Gh.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=1e3*Math.floor(t/1e4)*10,Xs(t,e,1e3,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmssmmm,getKeyValues:(t,e,i,s)=>Hs(t,e,100,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Gh.hhmmssmmm},MajorMilliseconds100:{major:{format:Gh.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=100*Math.floor(t/1e3)*10,Xs(t,e,100,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmssmmm,getKeyValues:(t,e,i,s)=>Hs(t,e,10,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Gh.hhmmssmmm},MajorMilliseconds10:{major:{format:Gh.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=10*Math.floor(t/100)*10,Xs(t,e,10,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmssmmm,getKeyValues:(t,e,i,s)=>Hs(t,e,1,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Gh.hhmmssmmm},MajorMilliseconds:{major:{format:Gh.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=1*Math.floor(t/10)*10,Xs(t,e,1,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Hs(t,e,.1,1e6),fitKeyValues:js({},2)},defaultValueFormatter:Gh.hhmmssmmmuuu},MajorMicroseconds100:{major:{format:Gh.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.1*Math.floor(t/1)*10,Xs(t,e,.1,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Hs(t,e,.01,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Gh.hhmmssmmmuuu},MajorMicroseconds10:{major:{format:Gh.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.01*Math.floor(t/.1)*10,Xs(t,e,.01,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Hs(t,e,.001,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Gh.hhmmssmmmuuu},MajorMicroseconds:{major:{format:Gh.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>(t=.001*Math.floor(t/.01)*10,Xs(t,e,.001,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Hs(t,e,100*1e-6,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Gh.hhmmssmmmuuunnn},MajorNanoseconds100:{major:{format:Gh.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>{const r=100*1e-6;return t=Math.floor(t/.001)*r*10,Xs(t,e,r,void 0,1e6)},fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Hs(t,e,10*1e-6,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Gh.hhmmssmmmuuunnn},Unknown:{major:{format:(t,e,i)=>"",getKeyValues:(t,e,i,s)=>[],fitKeyValues:void 0},minor:{format:(t,e,i)=>"",getKeyValues:(t,e,i,s)=>[],fitKeyValues:void 0},defaultValueFormatter:(t,e,i)=>""}};class Hh extends Uh{Hh(t){const e=this.timeOrigin||0,i=[{Ye:"Major ticks",Eg:0,ur:this.majorTickStyle,ar:this.majorFormattingFunction?this.majorFormattingFunction:(t,i,s)=>{const r=Oh(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Yh[r].major.format)(t+e,i,s)},Lr:(t,e,i,s)=>{const r=Oh(i,s);return(0,Yh[r].major.getKeyValues)(t,e,i,s)},bh:{Ar:(t,e,i,s,r,n)=>{const o=Oh(r,n),h=Yh[o].major.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},Rr:void 0}];return yh(this.minorTickStyle)&&i.push({Ye:"Minor ticks",Eg:1,ur:this.minorTickStyle,ar:this.minorFormattingFunction?this.minorFormattingFunction:(t,i,s)=>{const r=Oh(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Yh[r].minor.format)(t+e,i,s)},Lr:(t,e,i,s)=>{const r=Oh(i,s);return(0,Yh[r].minor.getKeyValues)(t,e,i,s)},bh:{Ar:(t,e,i,s,r,n)=>{const o=Oh(r,n),h=Yh[o].minor.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},Rr:void 0}),{$e:[],Xe:i,We:this.cursorFormatter||((t,i,s)=>{const r=Oh(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return Yh[r].defaultValueFormatter(t+e,i,s)}),jh:1e-4,Zh:864e6}}setTickStyle(t){return this.setMajorTickStyle(t).setMinorTickStyle(t)}setMajorTickStyle(t){return"function"==typeof t?this.set("majorTickStyle",t(this.get("majorTickStyle"))):this.set("majorTickStyle",t)}getMajorTickStyle(){return this.get("majorTickStyle")}setMinorTickStyle(t){if("function"==typeof t){const e=this.get("minorTickStyle");return this.set("minorTickStyle",t(e))}return this.set("minorTickStyle",t)}getMinorTickStyle(){return this.get("minorTickStyle")}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}setTimeOrigin(t){return this.set("timeOrigin",t)}getTimeOrigin(){return this.get("timeOrigin")}setFormattingFunction(t){return this.withMutations((e=>e.set("majorFormattingFunction",t).set("minorFormattingFunction",t).set("cursorFormatter",t)))}getMajorFormattingFunction(){return this.get("majorFormattingFunction")}setMajorFormattingFunction(t){return this.set("majorFormattingFunction",t)}getMinorFormattingFunction(){return this.get("minorFormattingFunction")}setMinorFormattingFunction(t){return this.set("minorFormattingFunction",t)}}const Xh=(t,e,i="image/png",s)=>{e+=`.${i.slice(i.indexOf("image/")+6)}`;const r=t.captureFrame(i,s);if("image/png"!==i&&r.type.includes("image/png"))throw new Error(`saveToFile | type not supported by browser: ${i}\nCheck support table for HTMLCanvasElement.toDataURL`);if(bt.navigator.msSaveBlob)bt.navigator.msSaveBlob(r,e);else{const t=bt.document.createElement("a");bt.document.body.appendChild(t);const i=bt.URL.createObjectURL(r);t.href=i,t.download=e,t.click(),setTimeout((()=>{bt.URL.revokeObjectURL(i),bt.document.body.removeChild(t)}),0)}},Wh=(t,i,s,r,n,o)=>{const h=t.Qu(i,s,r,n,o,!0);return h.setDraggingMode(e.UIDraggingModes.draggable),h},jh=(t,e)=>{if("relative"===t)return e;if(t instanceof Vi)return t;const i=t.x instanceof Js?t.x.ft:t.x.x,s=t.y instanceof Js?t.y.ft:t.y.y;return Bi(i,s)},$h=(t,e,i,s,r)=>{if(i){const n=t,o=e,h=fh(o)?o:Ui(o)?s:void 0;if(h&&zi(i)){const t=dt(n,h,r.ft);return r.Bo({engineX:t.x,engineY:t.y})}if(h&&Ui(i))return dt(n,h,s);if(h&&fh(i))return dt(n,h,i)}else{const i=t;if(Ui(e)){const t=r.Do(i);return dt({x:t.engineX,y:t.engineY},r.ft,s)}if(fh(e)){const t=e,s=r.Do(i);return dt({x:s.engineX,y:s.engineY},r.ft,t)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")};class Zh{constructor(t,e,i,s,n,o,h,a){this.coordsRelative="relative",this.coordsClient="client",this.$g=[],this.Xg=[],this.L=new r.Eventer,this.jg=void 0,this.Zg=void 0,this.Qg=void 0,this.jt=x(0,0,0,0),this.Jg=!1,this.Xi=!1,this.Kg=()=>{this.qg=!0,this.tp.vs()},this.ip=t=>e=>{const i=this.$g.indexOf(e);-1!==i&&this.$g.splice(i,1),this.cs.vs(),t.U()},this.sp=t=>{const e=this.Xg.indexOf(t);-1!==e&&this.Xg.splice(e,1),this.cs.vs()},this.qg=!0,this.onInViewChange=t=>this.L.on("inViewChange",t),this.offInViewChange=t=>this.L.off(t,"inViewChange"),this.dA=t,this.ep=i,this.tp=s,this.removePanel=n,this.ts=e.cs.ts;const l=e.cs.ai();if(this.uiScale=i.d2({scaleXYConstructor:_i}).Oi(0,100).Ni(0,100).tt(l),this.pixelScale=i.d2({scaleXYConstructor:_i}).Oi(0,this.uiScale.x.getCellSize()).Ni(0,this.uiScale.y.getCellSize()).tt(l),this.engine=e.cs.hp,this.cs=e.cs.rp,this.hs=this.cs.hs.rs(this,{}),this.np=()=>e.op("unidentified ui"),this.ap=e.lp(),this.up=this.tp.Te(this.uiScale).Ie(u(0,0)).tt(u(100,100)).ke(o).Ce(h).setMouseMoveEventHandler(((t,e)=>this.L.emit("mouseMovePanelBackground",this,e))).setMouseEnterEventHandler(((t,e)=>this.L.emit("mouseEnterPanelBackground",this,e))).setMouseLeaveEventHandler(((t,e)=>this.L.emit("mouseLeavePanelBackground",this,e))).setMouseDownEventHandler(((t,e)=>this.L.emit("mouseDownPanelBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.L.emit("mouseUpPanelBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.L.emit("mouseClickPanelBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.L.emit("mouseDoubleClickPanelBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.L.emit("mouseWheelPanelBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.L.emit("mouseDragStartPanelBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.L.emit("mouseDragPanelBackground",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.L.emit("mouseDragStopPanelBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>this.L.emit("touchStartPanelBackground",this,e))).setTouchMoveEventHandler(((t,e)=>this.L.emit("touchMovePanelBackground",this,e))).setTouchEndEventHandler(((t,e)=>this.L.emit("touchEndPanelBackground",this,e))),a){const t=a.on(this.Kg);this.cp=()=>a.off(t)}else{const t=e.cs.ko(this.Kg);this.dp=e.cs.To.bind(e.cs,t)}const c=e.cs.Io((t=>{this.Jg=t,this.L.emit("inViewChange",this,t)}));this.fp=e.cs.Po.bind(e.cs,c),this.jg=n}getTheme(){return this.ts}getSizePixels(){return this.pixelScale.getInnerIntervalPixels()}setBackgroundFillStyle(t){return this.up.ke(t),this.tp.vs(),this}getBackgroundFillStyle(){return this.up.zh()}setBackgroundStrokeStyle(t){return this.up.Ce(t),this.tp.vs(),this}getBackgroundStrokeStyle(){return this.up.lo()}translateCoordinate(t,e,i){return $h(t,e,i,this.pixelScale,this.cs)}Ap(t){return this.$g.push(t),this.cs.vs(),t}gp(t){return this.Xg.push(t),this.cs.vs(),t}addUIElement(t=Po,e=this.uiScale){e=jh(e,this.pixelScale);const i=this.np();return this.Ap(Wh(t,i,this.uiScale,e,this.ip(i),this.ts))}addLegendBox(t=$o,i=this.uiScale){i=jh(i,this.pixelScale);const s=this.gp(Wh(t,this.ap,this.uiScale,i,this.sp,this.ts));return s.setDraggingMode(e.UIDraggingModes.notDraggable),void 0!==i&&i!==this.uiScale||(void 0===t||"vertical"===t.getAlignment()?s.setOrigin(ws.RightCenter).setPosition({x:100,y:50}):s.setOrigin(ws.CenterBottom).setPosition(this.uiScale.mi({x:50,y:0},{x:0,y:3}))),s}getLegendBoxes(){return this.Xg}dispose(){return this.Xi||(this.Xi=!0,this.dp&&this.dp(),this.cp&&this.cp(),Kh(this.uiScale),Kh(this.pixelScale),this.fp&&this.fp(),this.Zg&&this.Zg(),this.tp.U(),this.ap.U(),this.$g.slice().forEach((t=>{t.dispose()})),this.Xg.slice().forEach((t=>{t.dispose()})),this.cs.vs(),this.jg&&this.jg(this),this.L.emit("dispose",this)),this}isDisposed(){return this.Xi}onDispose(t){return this.L.on("dispose",t)}offDispose(t){return this.L.off(t,"dispose")}saveToFile(t,e,i){return Xh(this.engine,t,e,i),this}Ir(t){this.jt=t,this.Kg()}Z(){return this.pixelScale.Z(),this.uiScale.Z(),this}J(){return this.pixelScale.J(),this.uiScale.J(),this}Fe(t){if(this.qg){const t=this.tp.cs.ai(),e=t.x,i=t.y;this.uiScale.tt(e,i),this.pixelScale.tt(e,i);const s=[this.jt.left,this.jt.right],r=[this.jt.bottom,this.jt.top];this.uiScale.zi(s),this.uiScale.Vi(r);const n=this.uiScale.getInnerIntervalPixels();this.pixelScale.Oi(0,n.x).zi(s).Ni(0,n.y).Vi(r),this.L.emit("resize",this,n.x,n.y,e,i)}this.qg=!1}pp(){for(let t=0;t{t.si&&t.si()};class Jh extends Zh{constructor(t,e,i,s,r,n){super(t,e,i,e.yp("uipanel bg",0),s,e.cs.ts.uiPanelBackgroundFillStyle,e.cs.ts.uiPanelBackgroundStrokeStyle,n),this.mp(r,this.pixelScale)}setMinimumSize(t){return this.Md=t,this.cs.vs(),this}getMinimumSize(){return this.Md}Fe(t){super.Fe(t),super.pp()}}const qh=x(10,10,10,10);class Qh extends Zh{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,l),this.Sp={},this.ya=qh,this.ih=!0,this.vp=e.xp("chart internal ui",0),this.bp=this.vp.Dr(this.uiScale).Eh("Chart").Ie(u(50,100)).za(u(0,1)).Nh(h).ke(a).setMouseInteractions(!1),this.Mp=this.hs.yg([this.bp]).Ss(this.ts.effectsText)}setAnimationsEnabled(t){return this.ih=t,this}getAnimationsEnabled(){return this.ih}setTitle(t){return this.bp.Eh(t),this.cs.vs(),this}getTitle(){return this.bp.Lh()}getTitleSize(){return this.bp.Ds().Zc()}setTitleFillStyle(t){return this.bp.ke(t),this.Kg(),this}getTitleFillStyle(){return this.bp.zh()}setTitleFont(t){return this.bp.Nh(t),this.Kg(),this}getTitleFont(){return this.bp.Oh()}setTitleRotation(t){return this.bp.Gh(t),this.cs.vs(),this}getTitleRotation(){return this.bp.Wh()}setTitleEffect(t){return this.Mp.Ss(t),this.cs.vs(),this}getTitleEffect(){return this.Mp.xs()}setTitleMargin(t){var e,i;return this.Sp="object"==typeof t?this.Sp?(e=this.Sp,{left:void 0!==(i=t).left?i.left:e.left,top:void 0!==i.top?i.top:e.top,right:void 0!==i.right?i.right:e.right,bottom:void 0!==i.bottom?i.bottom:e.bottom}):t:{left:t,top:t,right:t,bottom:t},this.Kg(),this}getTitleMargin(){return this.Sp}setPadding(t){return this.ya="object"==typeof t?A(this.ya,t):{left:t,top:t,right:t,bottom:t},this.Kg(),this}getPadding(){return this.ya}_p(t){const e=t.wp(),i=null==e?void 0:e.height,s=null==e?void 0:e.width;if(void 0!==i&&void 0!==s)return{x:i/2,y:s/2}}dispose(){return super.dispose(),this.vp.U(),this}}const ta={Cp:(t,e)=>t.zh()!==z&&0!==t.Lh().length&&t.getVisible()?t.Ds().Zc().y:0,kp(t,e){t.Ie(u(50,100)).Ir({top:void 0!==e.top?e.top:10,right:e.right||0,left:e.left||0,bottom:e.bottom||0})}};var ea;e.AutoCursorModes=void 0,(ea=e.AutoCursorModes||(e.AutoCursorModes={}))[ea.disabled=0]="disabled",ea[ea.snapToClosest=1]="snapToClosest",ea[ea.onHover=2]="onHover";const ia={Tp(t,i,s,r,n,o){let h;const a=t.getAutoCursorMode();if(!s&&a!==e.AutoCursorModes.disabled){const s=t.cs.Nn(),l=r.find((t=>t.getIsUnderMouse()));a===e.AutoCursorModes.snapToClosest&&n?(i||void 0!==l)&&(h=s&&n(s)):void 0===l||l.getCursorEnabled&&!l.getCursorEnabled()||(h=s&&o(l,s))}h?t.Fp.pointAt(h).setVisible(!0):t.Fp.setVisible(!1),t.Fp.Ds().Fe()},$c(t,e,i){if(e.xt.uiScale.x.ri()||e.yt.uiScale.y.ri())return;let s,r=Number.MAX_VALUE;for(const n of i)if(n.getCursorEnabled()&&n.getVisible()){const i=n.$c(e);if(i){const n=dt(i.location,i.scale,t.engine.scale),o=Xe(e,n);Number.isNaN(o)||s&&!(o{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()})),t.onSeriesBackgroundMouseMove((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()})),t.onSeriesBackgroundMouseLeave((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()})),t.onSeriesBackgroundTouchStart((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()})),t.onSeriesBackgroundTouchMove((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()})),t.onSeriesBackgroundTouchEnd((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()}))},Pp(t,i){i.onMouseEnter(((i,s)=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()})),i.onMouseMove(((i,s)=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()})),i.onMouseLeave((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()}))}};class sa{constructor(t,e){this.Dp=t,this.Bp=e}alter(t){this.Lp=void 0!==this.Lp?this.Lp:this.Bp(),this.Rp=t,this.Dp(t)}resetValue(){void 0!==this.Rp&&(void 0!==this.Lp&&this.isAltered()&&this.Dp(this.Lp),this.Lp=void 0,this.Rp=void 0)}getNormalValue(){return void 0!==this.Lp?this.Lp:this.Bp()}isAltered(){return void 0!==this.Rp&&this.Bp()===this.Rp}}class ra{constructor(t,e){this.Ep=[],this.zp=t,this.ft=e}update(){return this.zp.getVisible()?!(this.Vp()&&(!this.Op()||(this.resetTable(),this.zp.Ds(),this.Vp()))&&(this.Np(),this.zp.Ds(),this.Vp()&&(this.resetTable(),this.zp.Ds(),1))):(this.Op()&&this.resetTable(),!0)}Op(){for(let t=0;t{const s=dt(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=dt(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()||s.yi.y.getInnerEnd()})(this.zp,this.ft)}Gp(){return((t,i)=>{const s=dt(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=dt(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()})(this.zp,this.ft)}Wp(){return((t,i)=>{const s=dt(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=dt(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.yi.y.getInnerEnd()})(this.zp,this.ft)}Yp(t){return this.Ep.push(t),t}}class na extends ra{constructor(){super(...arguments),this.ma=this.Yp(new sa((t=>this.zp.setOrigin(t)),(()=>this.zp.getOrigin())))}Np(){const t=this.ma.getNormalValue(),e=u(this.Gp()?-t.x:t.x,this.Wp()?-t.y:t.y);this.ma.alter(e)}}class oa extends ra{constructor(t,e,i,s){super(t,e),this.Hp=this.Yp(new sa((t=>this.zp.setTextFont((e=>e.setSize(t)))),(()=>this.zp.getTextFont().getSize()))),this.$p=i,this.Xp=s}Np(){const t=this.Hp.getNormalValue(),e=this.$p;if(enew na(t,e),FontSize:(t=5,e=5)=>(i,s)=>new oa(i,s,t,e)};class aa{constructor(){this.jp=[]}addRow(...t){return this.jp.push(t),this}}class la extends aa{Qu(){const t=this.jp;return this.jp=[],t}Zp(){return this.jp.length=0,this}}class ua extends wo{constructor(){super(...arguments),this.Gu=this.ts.cursorResultTableTextFont,this.Bd=0,this.Qp=this.ts.cursorResultTableTextFillStyle}setContent(t){for(let e=0;e=e)this.getMembers()[s].dispose(),s-=1,i-=1;else{const e=t[s].length;let i=r.getMembers().length;for(let n=0;n=e)r.getMembers()[n].dispose(),n-=1,i-=1;else if(void 0!==l&&l.length>0||u){for(let t=c.length;t{for(const e of Object.keys(h)){const i=h[e];t.set(e,i)}return t})):this.Gu,e=a||this.Qp,i=c[n];if(l){let s;i&&i instanceof fo?s=i:(i&&i.dispose(),s=r.addElement(go,n)),s.setFont(t).setFillStyle(e).setText(l).setTextRotation(this.Bd)}else if(u){let s;i&&i instanceof So?s=i:(i&&i.dispose(),s=r.addElement(Ao,n)),s.setFillStyle(e).setShape(u).setSize({y:t.size,x:t.size}),s.setMargin(5)}}else{for(let t=c.length;tt.setFillStyle(r.cursorResultTableFillStyle).setStrokeStyle(r.cursorResultTableStrokeStyle))).setTextFillStyle(r.cursorResultTableTextFillStyle).setTextFont(r.cursorResultTableTextFont),this.sm=ha.Flip(this.zp,this.scale)}dispose(){return this.im.dispose(),this.zp.dispose(),this}pointAt(t){return this.ca=t.scale===this.scale?t.location:dt(t.location,t.scale,this.scale),this.im.setPosition(this.ca),this.zp.setPosition(this.ca).setContent(t.resultTableContent),this.Ts.vs(),this}getPosition(){return this.ca}setVisible(t){return this.ji=t,this.Ts.vs(),this}getVisible(){return this.ji}setPointMarkerVisible(t){return this.Kp=t,this.Ts.vs(),this}getPointMarkerVisible(){return this.Kp}setPointMarker(t){return t(this.im),this.Ts.vs(),this}getPointMarker(){return this.im}setResultTableVisible(t){return this.qp=t,this.Ts.vs(),this}getResultTableVisible(){return this.qp}setResultTable(t){return t(this.zp),this.Ts.vs(),this}getResultTable(){return this.zp}setAutoFitStrategy(t){return this.sm&&this.sm.resetTable(),this.sm=t?t(this.zp,this.Ts.cs.ft):void 0,this.Ts.vs(),this}getAutoFitStrategy(){return void 0!==this.sm}Fe(){return this.sm&&this.sm.update(),this.zp.setVisible(this.Jg&&this.ji&&this.qp),this.im.setVisible(this.Jg&&this.ji&&this.Kp),this.im.Fe(),this.zp.Fe(),this}Ds(){return this.im.Ds(),this.zp.Ds(),this.Jg=((t,e,i=e)=>{const s=e!==i?dt(t,e,i):t;return s.x>=i.x.getInnerStart()&&s.x<=i.x.getInnerEnd()&&s.y>=i.y.getInnerStart()&&s.y<=i.y.getInnerEnd()})(this.ca,this.scale),this}}class da extends ca{constructor(){super(...arguments),this.hm=!1}pointAt(t){return this.rm(t.fillStyle),super.pointAt(t)}rm(t){t&&this.hm&&this.zp.setTextFillStyle(t)}setResultTableAutoTextStyle(t){return this.hm=t,this.Ts.vs(),this}getResultTableAutoTextStyle(){return this.hm}}class fa extends ca{setPosition(t){return this.ca=t,this.im.setPosition(t),this.zp.setPosition(t),this.Ts.vs(),this}}class ga{constructor(t,e=[]){this.nm=[],this.om=(t,e)=>(this.nm.forEach((i=>i(t,e))),t),this.tm=t,this.nm=e}}class ma extends ga{constructor(){super(...arguments),this.am=(t,e,i,s)=>this.om(new da(t,e,i,this.tm,s),s),this.addStyler=t=>new ma(this.tm,this.nm.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new ma(t,this.nm.map((t=>t)))}}class ya extends ga{constructor(){super(...arguments),this.lm=(t,e,i,s)=>this.om(new fa(t,e,i,this.tm,s),s),this.addStyler=t=>new ya(this.tm,this.nm.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new ya(t,this.nm.map((t=>t)))}}const pa=t=>t.setResultTable((t=>t.setEffect(!0).setOrigin(u(-1,-1)).setMargin(5))),xa=(t,e)=>t.setPointMarker((t=>t.setFillStyle(e.chartMarkerPointMarkerFillStyle).setSize(e.chartMarkerPointMarkerSize).setShape(e.chartMarkerPointMarkerShape))).setResultTable((t=>t.setEffect(!0).setBackground((t=>t)).setOrigin(u(-1,-1)).setMargin(10))),Sa=new ma(mo,[pa]),Aa=new ma(xo,[pa,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(u(0,-1)).setMargin(0).setBackground((t=>{t instanceof xo&&t.setDirection(e.UIDirections.Down).setPointerLength(10).setPointerAngle(60)}))))]),va=Sa,ba=Sa,Ma=Aa,Ea=new ya(mo,[xa,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(ws.LeftBottom)))]),Ta=(t,e,i,s,r)=>({location:t,scale:e,resultTableContent:i,owner:s,fillStyle:r});var wa;e.SliceLabelIndices=void 0,(wa=e.SliceLabelIndices||(e.SliceLabelIndices={}))[wa.LabelsInsideSlices=0]="LabelsInsideSlices",wa[wa.LabelsOnSides=1]="LabelsOnSides";const ka={SortByName:(t,e)=>t.getName().localeCompare(e.getName(),void 0,{numeric:!0}),SortByValueAscending:(t,e)=>t.getAnimatedValue()-e.getAnimatedValue(),SortByValueDescending:(t,e)=>e.getAnimatedValue()-t.getAnimatedValue(),None:()=>0},Ca={Name:t=>`${t.getName()}`,NamePlusValue:t=>`${t.getName()}: ${Math.round(t.getAnimatedValue())}`,NamePlusRelativeValue:(t,e)=>`${t.getName()}: ${(100*e).toFixed(2)}%`},Ra=(t,e,i,s)=>t.addRow(i.getName()).addRow(i.getAnimatedValue().toString());class Ia extends Yi{constructor(){super(...arguments),this.Ms="Slice",this.S=0}}const Fa=(t,e)=>{Zt(e),t.setExploded(!t.getExploded())};class Da extends Ia{}class La extends Da{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.um=!1,this.dm=z,this.fm=z,this.Am=this.S,this.gm=this.um?1:0,this.pm=this.getVisible(),this.ym=K((()=>this.Ki.cs.vs())),this.Sm=K((()=>this.Ki.cs.vs())),this.vm=()=>{this.xm=void 0},this.bm=()=>{this.Mm=void 0},this.index=t,this.Ki=s,this.scale=r,this.qi=n,this._m=e.Kc(r).ds(this.getHighlight()),this.fs(this._m),this.Ye=i.Dr(r).ds(this.getHighlight()),this.fs(this.Ye,{isText:!0}),this.onMouseClick(Fa),this.onTouchEnd(Fa)}setValue(t){return this.Ki.getAnimationsEnabled()?this.pm&&this.wm(this.Am,t):this.Am=t,this.S=t,this.Ki.cs.vs(),this}getValue(){return this.S}setExploded(t){if(t&&!1===this.Ki.getMultipleSliceExplosion()){const t=this.Ki.getSlices();for(let e=0;e{this.gm=t,this.Ki.cs.vs()})),this.Mm.onEveryAnimationEnd(this.bm),this.um=!this.um):!1!==this.Ki.getMultipleSliceExplosion()||t?(this.gm=this.um?0:1,this.um=!this.um):(this.gm=0,this.um=!this.um),this.Ki.cs.vs(),this}getExploded(){return this.um}setVisible(t){return this.pm=t,!1===t?this.Ki.getAnimationsEnabled()&&this.Am>0?(this.xm&&(this.xm.finish(!1),this.xm=void 0),this.wm(this.Am,0,(()=>super.setVisible(!1)))):(this.Am=0,super.setVisible(!1)):this.Ki.getAnimationsEnabled()?(this.xm&&(this.xm.finish(!1),this.xm=void 0),super.setVisible(!0),this.wm(this.Am,this.S)):(this.Am=this.S,super.setVisible(!0)),this}wm(t,e,i){this.xm=this.ym(300,$.ease)([[t,e]],(([t])=>{this.Am=t,this.Ki.cs.vs()})),this.xm.onEveryAnimationEnd(this.vm),i&&this.xm.onAnimationEnd(i)}setStyle(t,e,i,s){this.dm=t,this.fm=i,this._m.ke(this.dm).Ce(e),this.Ye.ke(this.fm).Nh(s);for(let t=0;toi(e,ni(pi(.5*(t.Kl()+t.Fi())*Math.PI/180),i)),_a=(t,e,i,s,r,n)=>{const o=t.length;let h=90;for(let a=0;a{const e=t.getSlices();for(let t=0;t{const e=this.Cm.indexOf(t);e>=0&&(this.Cm.splice(e,1),this.Gm())},this.cs.Gn(ah.lf),this.Wm=i.Um("pieChart bottom",0),this.Ym=i.Um("pieChart top",1),this.bp.Eh("Pie Chart"),this.mp(n,this.pixelScale),this.onBackgroundMouseDoubleClick(Pa);const a=Wi(new ji(Pa));this.onBackgroundTouchStart(a.onTouchStart),this.onBackgroundTouchMove(a.onTouchMove),this.onBackgroundTouchEnd(a.onTouchEnd),this.Hm=i.$m();const l=Ft(h?h.autoCursorBuilder:void 0,ba);this.Fp=l.am(this.Hm,this.uiScale,this.uiScale,this.ts),this.setAnimationsEnabled(!0!==(null==h?void 0:h.disableAnimations)&&!1!==(null==h?void 0:h.animationsEnabled))}setAutoCursor(t){return this.Fp&&t(this.Fp),this.cs.vs(),this}getAutoCursor(){return this.Fp}setAutoCursorMode(t){return this.Vm=t,this.cs.vs(),this}getAutoCursorMode(){return this.Vm}setCursorResultTableFormatter(t){return this.Om=t,this.cs.vs(),this}addSlice(t,e){const i=new La(this.Bm,this.Wm,this.Ym,this,this.pixelScale,this.Nm,this.ts,this.cs.hs);this.Bm+=1,i.setName(t);const s=this.ih;return this.ih=!1,i.setValue(e),this.ih=s,i.setEffect(this.Em),this.Xm(i),this.Cm.push(i),this.Gm(),i.setHighlightOnHover(this.Im),i.onMouseMove((()=>{this.Vm&&this.cs.vs()})),i}addSlices(t){const e=[];for(let i=0;ie.hs.os.Ss(t))),this.cs.vs(),this}getSliceEffect(){return this.Em}setSliceSorter(t){return this.km=t,this.Cm=this.Cm.sort(this.km),this.cs.vs(),this}getSliceSorter(){return this.km}setLabelFillStyle(t){this.Dm="function"==typeof t?t(this.Dm):t;for(let t=0;te.hs.ns.Ss(t))),this.cs.vs(),this}getLabelEffect(){return this.zm}setLabelFormatter(t){return this.jm=t,this.cs.vs(),this}getLabelFormatter(){return this.jm}setSliceHighlightOnHover(t){return this.Im=t,this.Cm.forEach((e=>e.setHighlightOnHover(t))),this}Fe(t){super.Fe(t),ta.kp(this.bp,this.Sp),super.pp();const e=ta.Cp(this.bp,this.Sp),i=u(this.pixelScale.x.getInnerInterval()-(this.ya.left+this.ya.right),this.pixelScale.y.getInnerInterval()-(this.ya.bottom+this.ya.top+e)),s=u(this.ya.left+i.x/2,this.ya.bottom+i.y/2);if(this.Gd){const t=this.Gd;this.Cm.forEach((e=>{this.Xm(e,new G({color:t.getColors(e.getAnimatedValue())}))}))}for(let t=0;t0;this.Cm[t]._m.setVisible(e),this.Cm[t].Ye.setVisible(e)}this.Cm=this.Cm.sort(this.km);const r=this.Cm.filter((t=>t.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;tTa(e,this.engine.scale,this.Om(new la,this,t,o[r.indexOf(t)]||0).Qu(),t,void 0))),this.Zm(r,o,s,i)}Xm(t,e=this.Tm(t.index,t)){t.setStyle(e,this.Fm,this.Dm,this.Pm)}Gm(){this.Cm=this.Cm.sort(this.km),this.cs.vs()}Qd(){return this.Cm}dispose(){return super.dispose(),this.Cm.slice().forEach((t=>t.dispose())),this.Fp.dispose(),this.Ym.U(),this.Wm.U(),this.Hm.U(),this}}const za={UserSeries:{type:"ApplicationType",args:{type:"UserSeries"}},InternalUI:{type:"ApplicationType",args:{type:"InternalUI"}}},Na=(...t)=>{const e=[];return t.forEach((t=>{var i;t&&"object"==typeof(i=t)&&i&&"pattern"in i&&e.push({type:"DataPattern",args:t})})),e};class Ua extends Ba{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.jm=Ca.NamePlusValue,this.Qm=[],this.Jm=40,this.Km=5,this.qm=10,this.ty=this.ts.pieChartConnectorStrokeStyle,this.setPadding({bottom:50})}setLabelConnectorStyle(t){this.ty=t;for(let t=0;t{const r=360*e[s],h=c-r,a=pi(gi(.5*(c+h))),l=a.x>=0?-1:1,d=oi(oi(i,ni(a,u+n)),{x:l*-o,y:0});c=h;const f={x:l,y:0};t.Ye.Ie(d).za(f),t.Ye.Ds();const g=Ze(t.Ye.Ue());return{position:d,alignment:f,shape:t.Ye,boundaries:g,sliceAngleVec:a,slice:t}})),f=[];for(let t=0;t{const s=t.slice._m,r=Va(s,i,u+h+a*t.slice.getAnimatedExplosion()),n=fi(t.position.y,r,i),o=t.position;this.iy([r,n,o])}))}getMinimumSize(){return u(500,300)}iy(t){let e;for(let t=0;t{if(qi(t)){const e=t.getThickness(),i=t.getFillStyle();if(Y(i))return 1===e?hr:new lr({size:e,fillStyle:i,shape:"sphere"})}return hr};class Ha{constructor(t,e,i,s){this.hy=[],this.ny=new Map,this.oy=t,this.ly=e,this.uy=i,this.Ay=s}gy(){this.uy&&this.uy();const t=[];return{add:(e,i)=>{t.push({instanceUniqueProperties:e,instanceSharedProperties:i})},finishPlot:()=>{const e=[];let i=[];t.forEach((t=>{const i=e.find((e=>((t,e)=>{const i=Object.keys(t);for(const s of i)if(t[s]!==e[s])return!1;return!0})(e.sharedProperties,t.instanceSharedProperties)));i?i.instances.push(t.instanceUniqueProperties):e.push({sharedProperties:t.instanceSharedProperties,instances:[t.instanceUniqueProperties]})}));const s=this.hy.slice(),r=[];e.forEach((t=>{let e=s.pop();e||(e=this.oy(),this.hy.push(e));const n=[],o=e.py().slice();t.instances.forEach(((t,e)=>{const i=o.shift();n.push({...t,existingMember:i})}));const h=this.ly(e,n,t.sharedProperties);i=ne(i,h,{canReturnB:!0});for(let i=0;i{null==e||e.bd(t)}))})),s.forEach((t=>{t.dispose();const e=this.hy.indexOf(t);e<0?me(0,(()=>{})):this.hy.splice(e,1)})),r.forEach((t=>{const e=this.ny.get(t.Go);e&&t.collection.cs.io({entity:e.collection,collectionMember:e.member},{entity:t.collection,collectionMember:t.member})})),this.ny.clear(),r.forEach((t=>{this.ny.set(t.Go,t)})),this.Ay&&this.Ay(this.hy,i)}}}my(){this.hy.forEach((t=>{t.dispose()})),this.hy.length=0}}class Xa{constructor(t){this.yy=[],this.Sy=t}gy(){return this.vy(),{add:()=>this.el(),finishPlot:()=>{this.xy()}}}el(){let t=this.yy.find((t=>t.isFree));return t||(t={isFree:!1,shape:this.Sy()},this.yy.push(t)),t.isFree=!1,t.shape}vy(){this.yy.forEach((t=>{t.isFree=!0}))}xy(){this.yy.filter((t=>t.isFree)).forEach((t=>{t.shape.dispose(),this.yy.splice(this.yy.indexOf(t),1)}))}my(){this.yy.forEach((t=>t.shape.dispose())),this.yy.length=0}}class Wa{constructor(t,e,i,s,n,o,h,a,l,u){this.L=new r.Eventer,this.S=0,this.ji=!0,this.Xi=!1,this.vs=t,this.by=e,this.My=i,this._y=s,this.wy=n,this.Cy=o,this.Bd=h,this.Qp=a,this.ky=l,this.Ku=u}setValue(t){return t===this.S||(this.S=t,this.vs(),this.L.emit("valueChange",this,this.S)),this}getValue(){return this.S}setTickStyle(t){return this.My="function"==typeof t?t(this.My):t,this.vs(),this}getTickStyle(){return this.My}setTickLength(t){return this._y=t,this.vs(),this}getTickLength(){return this._y}setGridStrokeStyle(t){return this.wy="function"==typeof t?t(this.wy):t,this.vs(),this}getGridStrokeStyle(){return this.wy}setTextPadding(t){return this.Cy=t,this.vs(),this}getTextPadding(){return this.Cy}setTextRotation(t){return this.Bd=t,this.vs(),this}getTextRotation(){return this.Bd}setTextFillStyle(t){return this.Qp="function"==typeof t?t(this.Qp):t,this.vs(),this}getTextFillStyle(){return this.Qp}setTextFont(t){return this.ky="function"==typeof t?t(this.ky):t,this.vs(),this}getTextFont(){return this.ky}setTextFormatter(t){return this.Ku=t,this.vs(),this}onValueChange(t){return this.L.on("valueChange",t)}offValueChange(t){return this.L.off(t,"valueChange")}dispose(){return this.Xi||(this.Xi=!0,this.by(),this.vs(),this.L.emit("dispose",this)),this}isDisposed(){return this.Xi}onDispose(t){return this.L.on("dispose",t)}offDispose(t){return this.L.off(t,"dispose")}setVisible(t){const e=this.ji!==t;return this.ji=t,e&&(this.L.emit("visibleStateChanged",this,this.ji),this.vs()),this}getVisible(){return this.ji}onVisibleStateChanged(t){return this.L.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.L.off(t,"visibleStateChanged")}}class ja extends Js{constructor(t,e,i,s,r,n,o,h,a){super(t,e,i,s,h,{numeric:e.Ty({x:t.cs.ts.xAxis3DNumericTicks,y:t.cs.ts.yAxis3DNumericTicks,z:t.cs.ts.zAxis3DNumericTicks}),datetime:e.Ty({x:t.cs.ts.xAxis3DDateTimeTicks,y:t.cs.ts.yAxis3DDateTimeTicks,z:t.cs.ts.zAxis3DDateTimeTicks}),time:e.Ty({x:t.cs.ts.xAxis3DTimeTicks,y:t.cs.ts.yAxis3DTimeTicks,z:t.cs.ts.zAxis3DTimeTicks})},{type:"linear"}),this.Ff=[],this.Fy=()=>{},this.Iy=()=>{},this.Py=()=>{},this.Dy=()=>{},this.chart=t,this.yt=r,this.By=n,this.Ly=o,this.Ry=this.yt.ft;const l=this.Ch.Ty({x:this.ts.xAxis3DStrokeStyle,y:this.ts.yAxis3DStrokeStyle,z:this.ts.zAxis3DStrokeStyle});this.Ey=this.yt.sy([za.InternalUI]).Ee(l).zy(Ya(l)).setMouseInteractions(!1),this.Rh=this.By.Dr(this.Ly).setMouseInteractions(!1).ke(e.Ty({x:t.cs.ts.xAxis3DTitleFillStyle,y:t.cs.ts.yAxis3DTitleFillStyle,z:t.cs.ts.zAxis3DTitleFillStyle})).Nh(e.Ty({x:t.cs.ts.xAxis3DTitleFont,y:t.cs.ts.yAxis3DTitleFont,z:t.cs.ts.zAxis3DTitleFont})),this.Vy=new Xa((()=>this.By.Dr(this.Ly))),this.Oy=new Ha((()=>this.yt.Rg().setMouseInteractions(!1)),((t,e,i)=>(t.Gt().Ee(i.lineStyle),e.map((({positions:e,existingMember:i})=>i||t.ol(e)))))),this.hs=a,this.Uh=this.hs.yg([this.Rh]).Ss(s.effectsText),this.Ey.setMouseEnterEventHandler(this.Fy).setMouseLeaveEventHandler(this.Iy).setMouseDragEventHandler(this.Py).setMouseDragStopEventHandler(this.Dy),i.sg=this}setTickStrategy(t,e){return super.Ih(t,e)}getTickStrategy(){return this.Ze}addCustomTick(){const t=new Wa((()=>this.chart.cs.vs()),(()=>{const e=this.Ff.indexOf(t);e>=0&&this.Ff.splice(e,1)}),this.ts.xAxis3DNumericTicks.majorTickStyle.tickStyle,this.ts.xAxis3DNumericTicks.majorTickStyle.tickLength,this.ts.xAxis3DNumericTicks.majorTickStyle.gridStrokeStyle,this.ts.xAxis3DNumericTicks.majorTickStyle.tickPadding,this.ts.xAxis3DNumericTicks.majorTickStyle.labelRotation,this.ts.xAxis3DNumericTicks.majorTickStyle.labelFillStyle,this.ts.xAxis3DNumericTicks.majorTickStyle.labelFont,(t=>this.formatValue(t)));return this.Ff.push(t),this.chart.cs.vs(),t}setStrokeStyle(t){return this.Ey.Ee(t).zy(Ya(this.Ey.cu())),this.chart.cs.vs(),this}getStrokeStyle(){return this.Ey.cu()}setMouseInteractions(t){return this}setVisible(t){return super.setVisible(t),this.Ey.setVisible(t),!1===t&&(this.Oy.my(),this.Vy.my()),this.By.vs(),this}wg(){return this.chart.getSeries()}Ny(t){return Math.abs(this.ft.it(t)*this.yt.Gy(1))}kr(t,e,i){const s=Math.abs(this.ft.it(e-t)*this.yt.Gy(1));return{min:t-i*s,max:e+i*s}}cr(t,e){return new $a(e,t,this.By,this.Ly,this.yt)}dr(t,e){const i=this.Wy(e,t.S,t.xh.ur.tickLength,t.xh.ur.tickPadding);return t.Ye.Ie(i.labelPosition).za(i.labelAlignment),i}Wy(t,e,i,s){const{wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:a}=t,l=(e-this.ft.getInnerStart())/(this.ft.getInnerEnd()-this.ft.getInnerStart()),c=De.addVec($e(n,o,l),De.multiplyVec(De.multiply(h,this.yt.Gy(.5*this.Ey.cu().getThickness())),r)),d=De.addVec(c,De.multiplyVec(De.multiply(h,this.yt.Gy(i)),r)),f=this.yt.Uy(d)||u(0,0);return{labelPosition:oi(dt(f,this.chart.engine.scale,this.Ly),ni(a,s)),labelAlignment:{x:-a.x,y:-a.y},posTickEnd3D:d,posTickStart3D:c,tickPositionRelative:l}}Yy(t,e,i){const{wuSize:s,start:r,end:n,tickDirection3D:o}=e,h=(t-this.ft.getInnerStart())/(this.ft.getInnerEnd()-this.ft.getInnerStart()),a=De.addVec($e(r,n,h),De.multiplyVec(De.multiply(o,this.yt.Gy(.5*this.Ey.cu().getThickness())),s)),l=De.addVec(a,De.multiplyVec(De.multiply(o,this.yt.Gy(10)),s)),c=this.yt.Uy(a)||u(0,0),d=this.yt.Uy(l)||u(0,0);return this.By.ze(this.Ly).Oe(c).Ve(d).Ee(new Ji({fillStyle:new G({color:w(120*i)}),thickness:1}))}wr(t,e){return Za(t,e,this.ft)}Fe(t){if(!this.ji)return;const e=Math.min(this.Ph,this.Dh),i=Math.max(this.Ph,this.Dh),s=this.Ry,r=f(s.x.ht(),s.y.ht(),s.z.ht());let n,o;this.Hy()?(n=f(s.x.getInnerEnd(),s.y.getInnerStart(),s.z.getInnerStart()),o=f(s.x.getInnerEnd(),s.y.getInnerStart(),s.z.getInnerEnd())):(n=f(s.x.getInnerStart(),s.y.getInnerStart(),s.z.getInnerStart()),o=this.Ch.$y(f(s.x.getInnerEnd(),s.y.getInnerEnd(),s.z.getInnerEnd()),n));const h=this.Ch.Kd,a=this.yt.Uy(n)||u(0,0),l=this.yt.Uy(o)||u(0,0),c=$e(n,o,.5),d=De.addVec(c,De.multiplyVec(De.multiply(h,-1),r)),g=this.yt.Uy(c)||u(0,0),m=this.yt.Uy(d)||u(0,0),y=ii(hi(dt(g,this.chart.engine.scale,this.Ly),dt(m,this.chart.engine.scale,this.Ly)));this.Ey.Gt().ol([n,o]);const{gridlinePositionA:p,gridlinePositionB:x,gridlinePositionC:S}=this.Ch.Xy(t),A=t=>({x:-1===t.x?this.Ry.x.getInnerStart():1===t.x?this.Ry.x.getInnerEnd():0,y:-1===t.y?this.Ry.y.getInnerStart():1===t.y?this.Ry.y.getInnerEnd():0,z:-1===t.z?this.Ry.z.getInnerStart():1===t.z?this.Ry.z.getInnerEnd():0}),v=A(p),b=A(x),M=A(S),E={physicalAxisSize:ri(hi(a,l)),wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:y,gridlinePositionA:v,gridlinePositionB:b,gridlinePositionC:M},T=this.tr(E),w=this.Oy.gy();for(const[t,e]of this.Qe)for(const[,i]of e){const e=T.get(i);if(!e)continue;const s=this.jy(E,e);w.add({Go:0,positions:[s.tickStroke.start,s.tickStroke.end]},{lineStyle:t.ur.tickStyle}),s.gridStroke&&w.add({Go:0,positions:s.gridStroke},{lineStyle:t.ur.gridStrokeStyle})}const k=this.Vy.gy(),C={x:0,y:0};this.Ff.forEach((t=>{if(!t.ji||t.Si)return;const s=this.Wy(E,t.S,t._y,t.Cy),r=this.jy(E,s),n=k.add().Ie(s.labelPosition).za(s.labelAlignment).ke(t.Qp).Nh(t.ky).Eh(t.Ku(t.S)).Gh(t.Bd).Ds().ai();C.x=Math.max(C.x,n.x),C.y=Math.max(C.y,n.y),w.add({Go:0,positions:[r.tickStroke.start,r.tickStroke.end]},{lineStyle:t.My}),r.gridStroke&&w.add({Go:0,positions:r.gridStroke},{lineStyle:t.wy})})),k.finishPlot(),w.finishPlot();const R=this.pr(((t,e)=>{const i=e.Ye.ai();return t.x=Math.max(t.x,i.x),t.y=Math.max(t.y,i.y),t}),{x:C.x,y:C.y}),I=Math.atan((l.y-a.y)/(l.x-a.x));this.Rh.za({x:0,y:0}).Gh(180*-I/Math.PI);const F=De.addVec(c,De.multiplyVec(De.multiply(h,this.yt.Gy(.5*this.Ey.cu().getThickness()+this.yr(((t,e)=>Math.max(t,e.tickLength)),0))),r)),D=this.yt.Uy(F)||u(0,0),L=oi(dt(D,this.chart.engine.scale,this.Ly),oi(oi(ai(R,y),ni(y,this.yr(((t,e)=>Math.max(t,e.labelPadding)),0))),ai(ni(this.Rh.Ds().ai(),.5),y)));this.Rh.Ie(L),this.Ey.Zy={overrideFollowing:!1,skipMousePicking:!1}}jy(t,e){const{gridlinePositionA:i,gridlinePositionB:s,gridlinePositionC:r}=t,n=e.posTickStart3D,o=e.posTickEnd3D,h=e.tickPositionRelative;let a;return Ct(h,0)||Ct(h,1)||(a=[this.Qy()?{...i,x:n.x}:this.Jy()?{...i,y:n.y}:this.Hy()?{...i,z:n.z}:{x:0,y:0,z:0},this.Qy()?{...s,x:n.x}:this.Jy()?{...s,y:n.y}:this.Hy()?{...s,z:n.z}:{x:0,y:0,z:0},this.Qy()?{...r,x:n.x}:this.Jy()?{...r,y:n.y}:this.Hy()?{...r,z:n.z}:{x:0,y:0,z:0}]),{gridStroke:a,tickStroke:{start:n,end:o}}}Yh(){super.Yh(),this.Oy.my(),this.Vy.my()}Qy(){return this.Ch.Qy()}Jy(){return this.Ch.Jy()}Hy(){return this.Ch.Hy()}}class $a extends qs{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Ky=r}}const Za=(t,e,i)=>Rt(t+.1*(e-t)+Math.abs(i.ht())/100*Math.sign(e-t),Math.min(t,e),Math.max(t,e)),Ka=(t,e,i,s)=>({Sr:()=>{const i=t();let s;for(const t of i){if(!t.qy())continue;const i=e(t);s=void 0===i?s:void 0!==s?Math.min(s,i):i}return s},vr:()=>{const e=t();let s;for(const t of e){if(!t.qy())continue;const e=i(t);s=void 0===e?s:void 0!==s?Math.max(s,e):e}return s},Mr:()=>{const e=t();let i;for(const t of e){if(!t.qy())continue;const e=s(t);i=void 0===e?i:void 0!==i?Math.max(i,e):e}return i}}),Ja=t=>({...Ka(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.Mr().y)),Ty:t=>t.y,$y:(t,e)=>({x:e.x,y:t.y,z:e.z}),Kd:f(-1,0,0),Xy:t=>{const e={x:t.x>=0?1:-1,y:t.y>=0?1:-1,z:t.z>=0?1:-1};return{gridlinePositionA:f(e.x,0,e.z),gridlinePositionB:f(e.x,0,-e.z),gridlinePositionC:f(-e.x,0,-e.z)}},Qy:()=>!1,Jy:()=>!0,Hy:()=>!1}),qa=t=>({...Ka(t,(t=>t.getZMin()),(t=>t.getZMax()),(t=>t.Mr().z)),Ty:t=>t.z,$y:(t,e)=>({x:e.x,y:e.y,z:t.z}),Kd:f(1,0,0),Xy:t=>{const e={x:t.x>=0?1:-1,y:t.y>=0?1:-1,z:t.z>=0?1:-1};return{gridlinePositionA:f(e.x,-e.y,0),gridlinePositionB:f(e.x,e.y,0),gridlinePositionC:f(-e.x,e.y,0)}},Qy:()=>!1,Jy:()=>!1,Hy:()=>!0});class Qa extends Yi{constructor(t,e,i,s,r){super(t,e,s,r),this.tS=Hn,this.iS=!0,this.sS=!0,this.Ki=t,this.yt=i,this.ss=new Map,this.onMouseWheel(this.Ki.eS),this.onMouseDrag(this.Ki.hS),this.onTouchStart(this.Ki.rS.onTouchStart),this.onTouchMove(this.Ki.rS.onTouchMove),this.onTouchEnd(this.Ki.rS.onTouchEnd)}setAutoScrollingEnabled(t){return this.iS=t,this.Ki.cs.vs(),this}getAutoScrollingEnabled(){return this.iS}setColorShadingStyle(t){return this.tS=t,this.ss.forEach(((e,i)=>i.nS(t))),this.yt.vs(),this}getColorShadingStyle(){return this.tS}setDepthTestEnabled(t){return this.sS=t,this.ss.forEach(((e,i)=>i.oS(t))),this.yt.vs(),this}getDepthTestEnabled(){return this.sS}aS(){}Fe(){}Ay(){}getXMax(){const t=this.Ga;return t?t.bt():void 0}getXMin(){const t=this.Ga;return t?t.xt():void 0}getYMax(){const t=this.Ga;return t?t._t():void 0}getYMin(){const t=this.Ga;return t?t.Mt():void 0}getZMax(){const t=this.Ga;return t?t.lS():void 0}getZMin(){const t=this.Ga;return t?t.uS():void 0}Mr(){const t=this.Ga;return t?f(t.xl(),t.bl(),t.cS()):f(0,0,0)}}class tl extends Qa{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Ms="Box Series 3D",this.dS=.25,this.fS=!1,this.Wd=()=>ue(this.be),this.be=fe(this.ts.boxSeries3DFillStyle,r),this.Ga=this.yt.gS().oS(this.sS).ke(this.be).AS(this.dS).ds(this.getHighlight()),this.fs(this.Ga)}invalidateData(t){const e=t.length;if(0===e)return this;this.fS&&this.Ki.cs.Gn(ah.xf);const i=t[0];if(!i)return this;let s;if("xMin"in i||"yMin"in i||"zMin"in i||"xMax"in i||"yMax"in i||"zMax"in i){s=[];for(let i=0;iue(this.uu.getFillStyle())}setStrokeStyle(t){this.uu="function"==typeof t?t(this.uu):t;const e=this.uu;return this.Ga.Ee(e),this.yt.vs(),this}getStrokeStyle(){return this.uu}add(t){return this.fS&&this.Ki.cs.Gn(ah.xf),this.fS=!0,(t=Array.isArray(t)?t:[t])?(this.Ga.ol(t.slice()),this.yt.vs(),this):this}clear(){return this.Ga.Gt(),this}getPointAmount(){const t=this.Ga;return t.al()+t.ll()}qy(){return this.iS&&this.getPointAmount()>0&&this.getVisible()}Pe(t,e){t.ds(e),this.yt.vs()}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{stroke:this.uu}),this}}class il extends el{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Ms="Line Series 3D",this.uu=fe(s.lineSeries3DStrokeStyle,r),this.mS=Tr.pointStyle3D,this.yS(this.uu),this.Ga=this.yt.sy([za.UserSeries]).oS(this.sS).Ee(this.uu).zy(this.mS).ds(this.getHighlight()),this.fs(this.Ga)}setStrokeStyle(t){super.setStrokeStyle(t),this.yS(this.uu);const e=this.mS;return this.Ga.zy(e),this}yS(t){const e=new gr.Triangulated({shape:"sphere",fillStyle:t.getFillStyle(),size:t.getThickness()});this.mS=e}}class sl extends el{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Ms="Point Line Series 3D",this.Wd=()=>ue(this.uu.getFillStyle())||ue(this.mS.getFillStyle()),this.mS=fe(s.pointLineSeries3DPointStyle,r),this.uu=fe(s.lineSeries3DStrokeStyle,r),this.SS(),this.Ga=this.yt.sy([za.UserSeries]).oS(this.sS).Ee(this.uu).zy(this.mS).ds(this.getHighlight()),this.fs(this.Ga)}setPointStyle(t){return this.mS="function"==typeof t?t(this.mS):t,this.SS(),this.Ga.zy(this.mS),this.yt.vs(),this}getPointStyle(){return this.mS}setStrokeStyle(t){super.setStrokeStyle(t);const e=this.uu,i=Math.abs(e.getThickness()),s=this.mS,r=s.getSize();i>("object"==typeof r?Math.max(r.x,r.y,r.z):r)&&(this.mS=s.setSize(i)),this.SS();const n=this.mS;return this.Ga.zy(n),this.yt.vs(),this}SS(){const t=this.mS,e=t.getSize();this.mS=t.setSize(e)}Pe(t,e){t.ds(e),this.yt.vs()}}class rl extends Qa{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.fS=!1,((null==n?void 0:n.individualPointSizeAxisEnabled)||(null==n?void 0:n.individualPointSizeEnabled))&&this.Ki.cs.Gn(ah.bf)}add(t){return this.fS&&this.Ki.cs.Gn(ah.xf),this.fS=!0,(t=Array.isArray(t)?t:[t])?(this.Ga.ol(t.slice()),this.yt.vs(),this):this}clear(){return this.Ga.Gt(),this}getPointAmount(){const t=this.Ga;return t.al()+t.ll()}qy(){return this.iS&&this.getPointAmount()>0&&this.getVisible()}Pe(t,e){t.ds(e),this.yt.vs()}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{point3D:this.vS}),this}}class nl extends rl{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Ms="Point Series 3D",this.Wd=()=>ue(this.vS.getFillStyle());const o=void 0!==(null==n?void 0:n.automaticColorIndex)?n.automaticColorIndex:this.Ki.getSeries().length;this.vS=fe(s.pointSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.Ga=this.yt.bS(h).oS(this.sS).xS(this.vS).ds(this.getHighlight()),this.fs(this.Ga)}setPointStyle(t){this.vS="function"==typeof t?t(this.vS):t;const e=this.vS;return this.Ga.xS(e),this.yt.vs(),this}getPointStyle(){return this.vS}}class ol extends rl{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Ms="Point Cloud Series 3D",this.Wd=()=>ue(this.vS.getFillStyle());const o=this.Ki.getSeries().length;this.vS=fe(s.pointCloudSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.Ga=this.yt.bS(h).xS(this.vS).ds(this.getHighlight()),this.fs(this.Ga)}setPointStyle(t){this.vS="function"==typeof t?t(this.vS):t;const e=this.vS;return this.Ga.xS(e),this.yt.vs(),this}getPointStyle(){return this.vS}}const hl={Triangulated:nl,Pixelated:ol};class al extends Qh{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a,l),this.MS=[],this._S=0,this.wS=t=>{const e=this.MS.indexOf(t);e>=0&&(this.MS.splice(e,1),this.L.emit("seriesDispose",this,t))},this.CS=()=>{this._S+=1},this.kS=()=>{this._S-=1},this.onSeriesBackgroundMouseEnter=t=>this.L.on("mouseEnterSeriesBackground",t),this.onSeriesBackgroundMouseLeave=t=>this.L.on("mouseLeaveSeriesBackground",t),this.onSeriesBackgroundMouseMove=t=>this.L.on("mouseMoveSeriesBackground",t),this.onSeriesBackgroundMouseDown=t=>this.L.on("mouseDownSeriesBackground",t),this.onSeriesBackgroundMouseUp=t=>this.L.on("mouseUpSeriesBackground",t),this.onSeriesBackgroundMouseClick=t=>this.L.on("mouseClickSeriesBackground",t),this.onSeriesBackgroundMouseDoubleClick=t=>this.L.on("mouseDoubleClickSeriesBackground",t),this.onSeriesBackgroundMouseDragStart=t=>this.L.on("mouseDragStartSeriesBackground",t),this.onSeriesBackgroundMouseDrag=t=>this.L.on("mouseDragSeriesBackground",t),this.onSeriesBackgroundMouseDragStop=t=>this.L.on("mouseDragStopSeriesBackground",t),this.onSeriesBackgroundMouseWheel=t=>this.L.on("mouseWheelSeriesBackground",t),this.onSeriesBackgroundTouchStart=t=>this.L.on("touchStartSeriesBackground",t),this.onSeriesBackgroundTouchMove=t=>this.L.on("touchMoveSeriesBackground",t),this.onSeriesBackgroundTouchEnd=t=>this.L.on("touchEndSeriesBackground",t),this.offSeriesBackgroundMouseEnter=t=>this.L.off(t,"mouseEnterSeriesBackground"),this.offSeriesBackgroundMouseLeave=t=>this.L.off(t,"mouseLeaveSeriesBackground"),this.offSeriesBackgroundMouseMove=t=>this.L.off(t,"mouseMoveSeriesBackground"),this.offSeriesBackgroundMouseDown=t=>this.L.off(t,"mouseDownSeriesBackground"),this.offSeriesBackgroundMouseUp=t=>this.L.off(t,"mouseUpSeriesBackground"),this.offSeriesBackgroundMouseClick=t=>this.L.off(t,"mouseClickSeriesBackground"),this.offSeriesBackgroundMouseDoubleClick=t=>this.L.off(t,"mouseDoubleClickSeriesBackground"),this.offSeriesBackgroundMouseDragStart=t=>this.L.off(t,"mouseDragStartSeriesBackground"),this.offSeriesBackgroundMouseDrag=t=>this.L.off(t,"mouseDragSeriesBackground"),this.offSeriesBackgroundMouseDragStop=t=>this.L.off(t,"mouseDragStopSeriesBackground"),this.offSeriesBackgroundMouseWheel=t=>this.L.off(t,"mouseWheelSeriesBackground"),this.offSeriesBackgroundTouchStart=t=>this.L.off(t,"touchStartSeriesBackground"),this.offSeriesBackgroundTouchMove=t=>this.L.off(t,"touchMoveSeriesBackground"),this.offSeriesBackgroundTouchEnd=t=>this.L.off(t,"touchEndSeriesBackground"),this.TS=this.hs.yg()}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.MS.forEach((e=>e.setAnimationHighlight(t))),this}FS(t,e){this.TS.As([e]),t.setMouseMoveEventHandler(((t,e)=>{this.L.emit("mouseMoveSeriesBackground",this,e)})).setMouseEnterEventHandler(((t,e)=>{this.L.emit("mouseEnterSeriesBackground",this,e)})).setMouseLeaveEventHandler(((t,e)=>{this.L.emit("mouseLeaveSeriesBackground",this,e)})).setMouseDownEventHandler(((t,e)=>this.L.emit("mouseDownSeriesBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.L.emit("mouseUpSeriesBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.L.emit("mouseClickSeriesBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.L.emit("mouseDoubleClickSeriesBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.L.emit("mouseWheelSeriesBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.L.emit("mouseDragStartSeriesBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.L.emit("mouseDragSeriesBackground",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.L.emit("mouseDragStopSeriesBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>{this.L.emit("touchStartSeriesBackground",this,e)})).setTouchMoveEventHandler(((t,e)=>{this.L.emit("touchMoveSeriesBackground",this,e)})).setTouchEndEventHandler(((t,e)=>{this.L.emit("touchEndSeriesBackground",this,e)}))}setSeriesBackgroundFillStyle(t){return this.IS.ke(t),this.cs.vs(),this}getSeriesBackgroundFillStyle(){return this.IS.zh()}setSeriesBackgroundStrokeStyle(t){return this.PS.Ce(t),this.cs.vs(),this}getSeriesBackgroundStrokeStyle(){return this.PS.lo()}setSeriesBackgroundEffect(t){return this.TS.Ss(t),this.cs.vs(),this}getSeriesBackgroundEffect(){return this.TS.xs()}DS(t){this.MS.push(t),t.onMouseEnter(this.CS),t.onMouseLeave(this.kS),void 0!==this.BS&&t.setHighlightOnHover(this.BS),this.L.emit("seriesAdded",this,t)}Qd(){return this.MS}LS(){return this._S}setSeriesHighlightOnHover(t){return this.BS=t,this.MS.forEach((e=>e.setHighlightOnHover(t))),this}dispose(){return this.MS.slice().forEach(wt),super.dispose()}RS(t){return this.L.on("seriesAdded",t)}ES(t){return this.L.off(t)}zS(t){return this.L.on("seriesDispose",t)}VS(t){return this.L.off(t)}}const ll=De.normalize({x:-.5610788649579117,y:-.35242840511865414,z:-1.1349149375849081});class ul{constructor(t,e,i,s){this.OS=!0,this.NS=!0,this.GS=2*-Math.PI/2160,this.WS=2*Math.PI/2160,this.US=.1,this.YS=1*Math.PI/180,this.HS=t,this.$S=e,this.XS=i,this.Uy=s}getDefaultCameraConfiguration(t){const e={direction:ll,location:De.multiply(ll,-1)};return this.cameraLocationChanged({boundingBox:t,cameraDirection:e.direction,cameraLocation:e.location})||e}applyCameraInteractions(t,e){let i={direction:t.cameraDirection,location:t.cameraLocation};return e.forEach((t=>{"rotate"===t.type?i=this.jS(i,t):"wheel-zoom"===t.type?i=this.ZS(i,t):"rotate+zoom"===t.type?i=this.QS(i,t):"fixed-rotate"===t.type?i=this.JS(i,t):"move"===t.type&&(i=this.KS(i,t))})),this.OS?i=this.qS(t.boundingBox,i):this.NS&&(i=this.tv(t.boundingBox,i)),i}jS(t,e){const{rotation:i}=e,s=t.location,r=De.multiply(De.normalize(t.location),-1),{Right:n,Up:o}=this.sv(r);let h=s;const a=this.ev(r),l=i.x*this.GS*a;h=De.rotateAroundAxis(h,o,l);const u=(i.y>0?1:-1)*Math.min(Math.abs(i.y)*this.WS,a-this.YS);return 0!==u&&(h=De.rotateAroundAxis(h,n,u)),{location:h,direction:De.multiply(De.normalize(h),-1)}}ZS(t,e){const{deltaY:i}=e;this.OS&&this.hv(!1);const s=t.location,r=De.multiply(De.normalize(s),-1),n=i*this.US,o=De.length(s)*-n;return{direction:r,location:De.addVec(s,De.multiply(r,o))}}QS(t,e){const{rotation:i,cameraDistance:s}=e;this.OS&&this.hv(!1);let r=this.jS(t,{type:"rotate",rotation:i});const n=r.location,o=De.multiply(De.normalize(n),-1),h=De.multiply(o,-s);return r={direction:De.multiply(De.normalize(h),-1),location:h},r}JS(t,e){this.OS&&this.hv(!1);const{rotation:i}=e,s=t.location,r=t.direction,{Right:n,Up:o}=this.sv(r),h=i.x*this.GS;let a=De.normalize(De.rotateAroundAxis(r,o,h));const l=i.y*this.WS;return a=De.normalize(De.rotateAroundAxis(a,n,l)),{location:s,direction:a}}KS(t,e){this.OS&&this.hv(!1),this.NS=!1;const{amountRight:i,amountForward:s}=e,r=t.location,n=t.direction,{Right:o}=this.sv(n);return{location:De.addVec(r,De.multiply(n,.01*s),De.multiply(o,.01*i)),direction:n}}boundingBoxChanged(t){const e={location:t.cameraLocation,direction:De.multiply(De.normalize(t.cameraLocation),-1)};return this.OS?this.qS(t.boundingBox,e):this.tv(t.boundingBox,e)}cameraLocationChanged(t){const e={location:t.cameraLocation,direction:De.multiply(De.normalize(t.cameraLocation),-1)};return this.OS?this.qS(t.boundingBox,e):this.tv(t.boundingBox,e)}viewportChanged(t){const e={location:t.cameraLocation,direction:De.multiply(De.normalize(t.cameraLocation),-1)};if(this.OS)return this.qS(t.boundingBox,e)}qS(t,e,i){let s=e;i=void 0!==i?i:0,s=this.rv(t,s,100,20,1,i,5);const r=this.ev(s.direction);return s=this.nv(s,this.ov(t,s,100,1),r),s}rv(t,e,i,s,r,n,o){return cl(n,o,(t=>({direction:e.direction,location:De.multiply(e.direction,-t)})),(e=>this.av(t,e)),i,r,"linear",s)}ov(t,e,i,s){const{Right:r,Left:n,Up:o,Down:h}=this.sv(e.direction),a=this.lv(t,!1,e);let l=e;const u=s,c=.1;return Math.abs(a.bottom-a.top)>u&&(l=a.bottom({location:l.location,direction:De.normalize(De.lerp(l.direction,h,t))})),(e=>this.uv(t,e)),0,u,!0,i):dl(0,c,(t=>({location:l.location,direction:De.normalize(De.lerp(l.direction,o,t))})),(e=>this.uv(t,e)),0,u,!0,i)),Math.abs(a.left-a.right)>u&&(l=a.left({location:l.location,direction:De.normalize(De.lerp(l.direction,n,t))})),(e=>this.cv(t,e)),0,u,!0,i):dl(0,c,(t=>({location:l.location,direction:De.normalize(De.lerp(l.direction,r,t))})),(e=>this.cv(t,e)),0,u,!0,i)),l}av(t,e){const i=this.lv(t,!0,e);return Math.min(i.left+i.right,i.top+i.bottom)}cv(t,e){const i=this.lv(t,!1,e);return Math.abs(i.left-i.right)}uv(t,e){const i=this.lv(t,!1,e);return Math.abs(i.top-i.bottom)}lv(t,e,i){const s=Ze(this.dv(t,e,i).map((t=>dt(t,this.HS,this.$S))));return{left:s.min.x,right:this.$S.x.getInnerEnd()-s.max.x,top:this.$S.y.getInnerEnd()-s.max.y,bottom:s.min.y}}dv(t,e,i){const s=this.XS,r=f(s.x.getInnerStart(),s.y.getInnerStart(),s.z.getInnerStart()),n=f(s.x.getInnerEnd(),s.y.getInnerEnd(),s.z.getInnerEnd()),o=[],h=e?16:4,a=(r.x+n.x)/2,l=(r.z+n.z)/2,u=Math.sqrt(2)*(n.x-a),c=Math.sqrt(2)*(n.z-l);return[r.y,n.y].forEach((t=>{for(let e=0;ethis.Uy(t,i))).filter((t=>void 0!==t))}tv(t,e){const i=De.length(e.location),s=this.fv(t);return i{let a,l=0,u=(e+t)/2;do{const h=i(u);if(a={value:u,result:h,score:s(h)},Math.abs(a.score-r)<=n)break;const c=a.score>r;c&&"linear"===o||!c&&"reversed"===o?(u=(a.value+t)/2,e=a.value):(u=(a.value+e)/2,t=a.value),l+=1}while(l{let a,l=0,u=t;do{const c=i(u),d=s(c);if(void 0===a||Math.abs(d-r)ue(this.be),this.tS=Gn;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.Ki.getSeries().length;this.be=fe(this.ts.surfaceGridSeries3DFillStyle,o),this.pv=fe(this.ts.surfaceGridSeries3DWireframeStyle,o);const h={heatmapDataType:"intensity",dataOrder:s.dataOrder||"columns",columns:s.columns,rows:s.rows};this.Yn=h,this.Ga=this.yt.yv(h).ke(this.be).mv(this.pv).nS(this.tS).ds(this.getHighlight()),this.fs(this.Ga),s.start&&this.setStart(s.start),s.end&&this.setEnd(s.end),s.step&&this.setStep(s.step)}Sv(){const t=this.gv.start||{x:0,z:0};let e;e=this.gv.end?{x:(this.gv.end.x-t.x)/this.Yn.columns,z:(this.gv.end.z-t.z)/this.Yn.rows}:this.gv.step?this.gv.step:{x:1,z:1},this.Ga.vv(t,e),this.Ki.cs.vs()}setStart(t){return this.gv.start=t,this.Sv(),this}getStart(){return this.Ga.xv().start}setStep(t){return this.gv.step=t,this.Sv(),this}getStep(){return this.Ga.xv().step}setEnd(t){return this.gv.end=t,this.Sv(),this}getEnd(){return this.Ga.xv().end}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Ga.ke(this.be),this.yt.vs(),this}getFillStyle(){return this.be}setWireframeStyle(t){return this.pv="function"==typeof t?t(this.pv):t,this.Ga.mv(this.pv),this.yt.vs(),this}getWireframeStyle(){return this.Ga.bv()}setIntensityInterpolation(t){return t=t||"disabled",this.Ga.Mv(t),this.yt.vs(),this}getIntensityInterpolation(){return this.Ga._v()}invalidateIntensityValues(t){if(this.fS&&this.Ki.cs.Gn(ah.xf),Array.isArray(t)){if(0===t.length||0===t[0].length)return this;const e={x:t.length,y:t[0].length,columns:"columns"===this.Yn.dataOrder?t.length:t[0].length,rows:"rows"===this.Yn.dataOrder?t.length:t[0].length},i="columns"===this.Yn.dataOrder?this.Yn.columns:this.Yn.rows,s="columns"===this.Yn.dataOrder?this.Yn.rows:this.Yn.columns;if(e.x>i||e.y>s){if(!0===this.Ki.dA.$n){const t=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.Yn.columns}x${this.Yn.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;bt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.Ki.dA.$n){const i=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.Yn.columns}x${this.Yn.rows}, input ${e.columns}x${e.rows} starting at [${t.iColumn},${t.iRow}].\n Out of bounds data will be automatically clipped. This can result in sub-optimal performance.`;bt.console.warn(i)}const a=Math.max(-i,0),l=Math.max(-r,0),u=Math.max(s-o,0),c=Math.max(n-h,0),d=e.primary-(a+u),f=[];if(0===l&&0===c)for(let e=0;ei||e.y>s){if(!0===this.Ki.dA.$n){const t=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.Yn.columns}x${this.Yn.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;bt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.Ki.dA.$n){const i=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.Yn.columns}x${this.Yn.rows}, input ${e.columns}x${e.rows} starting at [${t.iColumn},${t.iRow}].\n Out of bounds data will be automatically clipped. This can result in sub-optimal performance.`;bt.console.warn(i)}const a=Math.max(-i,0),l=Math.max(-r,0),u=Math.max(s-o,0),c=Math.max(n-h,0),d=e.primary-(a+u),f=[];if(0===l&&0===c)for(let e=0;eue(this.be),this.Ki.cs.Gn(ah.xf),this.tS=Gn;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.Ki.getSeries().length;this.be=fe(this.ts.surfaceScrollingGridSeries3DFillStyle,o),this.pv=fe(this.ts.surfaceScrollingGridSeries3DWireframeStyle,o);const h={heatmapDataType:"intensity",scrollDimension:s.scrollDimension||"columns",columns:s.columns,rows:s.rows};this.Yn=h,this.Ga=this.yt.Fv(h).ke(this.be).mv(this.pv).nS(this.tS).ds(this.getHighlight()),this.fs(this.Ga),s.start&&this.setStart(s.start),s.step&&this.setStep(s.step)}Sv(){const t=this.gv.start||{x:0,z:0};let e;e=this.gv.step?this.gv.step:{x:1,z:1},this.Ga.vv(t,e),this.Ki.cs.vs()}setStart(t){return this.gv.start=t,this.Sv(),this}getStart(){return this.Ga.xv().start}setStep(t){return this.gv.step=t,this.Sv(),this}getStep(){return this.Ga.xv().step}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Ga.ke(this.be),this.yt.vs(),this}getFillStyle(){return this.be}setWireframeStyle(t){return this.pv="function"==typeof t?t(this.pv):t,this.Ga.mv(this.pv),this.yt.vs(),this}getWireframeStyle(){return this.Ga.bv()}setIntensityInterpolation(t){return t=t||"disabled",this.Ga.Mv(t),this.yt.vs(),this}getIntensityInterpolation(){return this.Ga._v()}clear(){return this.Ga.Gt(),this.yt.vs(),this}addValues(t){if(!t)return this;let e=t.yValues,i=t.intensityValues;if(!e&&!i)return this;if(e&&0===e.length&&(e=void 0),i&&0===i.length&&(i=void 0),e){const t=e[0].length,i=0+t-1,s="columns"===this.Yn.scrollDimension?this.Yn.rows:this.Yn.columns;if(i>s-1){if(!0===this.Ki.dA.$n){const e=`SurfaceScrollingGridSeries3D.addValues input yValues overflow.\nGrid was created with ${s} ${"columns"===this.Yn.scrollDimension?"rows":"columns"}, input yValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;bt.console.warn(e)}const i=[];for(let t=0;ts-1){if(!0===this.Ki.dA.$n){const e=`SurfaceScrollingGridSeries3D.addValues intensityValues overflow.\nGrid was created with ${s} ${"columns"===this.Yn.scrollDimension?"rows":"columns"}, input intensityValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;bt.console.warn(e)}const e=[];for(let t=0;ts?e=e.slice(0,s):i=i.slice(0,t)}}const s=e?e.length:null==i?void 0:i.length,r=e?e[0].length:null==i?void 0:i[0].length;return this.Ga.Iv({startPrimary:0,startSecondary:0,lengthPrimary:s,lengthSecondary:r,heightMapValues:e,intensityValues:i}),this.yt.vs(),this}setCullMode(t){return this.Ga.kv("boolean"==typeof t?t?"cull-back":"disabled":t),this}getCullMode(){return this.Ga.Tv()}aS(){}Fe(){}Ay(){}qy(){return this.iS&&this.getVisible()}Pe(t,e){t.ds(e),this.yt.vs()}}const ml=t=>!!(t&&"object"==typeof t&&"id"in t&&"chart"in t&&t.chart instanceof Sl),yl=t=>!!(t&&"object"==typeof t&&"x"in t&&"number"==typeof t.x&&"y"in t&&"number"==typeof t.y&&"z"in t&&"number"==typeof t.z),pl={translation:(t,e,i)=>[1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1],xRotation(t){const e=Math.cos(t),i=Math.sin(t);return[1,0,0,0,0,e,i,0,0,-i,e,0,0,0,0,1]},yRotation(t){const e=Math.cos(t),i=Math.sin(t);return[e,0,-i,0,0,1,0,0,i,0,e,0,0,0,0,1]},zRotation(t){const e=Math.cos(t),i=Math.sin(t);return[e,i,0,0,-i,e,0,0,0,0,1,0,0,0,0,1]},scaling:(t,e,i)=>[t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1],translate:(t,e,i,s)=>pl.multiply(t,pl.translation(e,i,s)),xRotate:(t,e)=>pl.multiply(t,pl.xRotation(e)),yRotate:(t,e)=>pl.multiply(t,pl.yRotation(e)),zRotate:(t,e)=>pl.multiply(t,pl.zRotation(e)),rotateXYZ(t,e){let i=pl.xRotate(t,e.x);return i=pl.yRotate(i,e.y),i=pl.zRotate(i,e.z),i},scale:(t,e,i,s)=>pl.multiply(t,pl.scaling(e,i,s)),multiply(t,e){const i=e[0],s=e[1],r=e[2],n=e[3],o=e[4],h=e[5],a=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],g=e[12],m=e[13],y=e[14],p=e[15],x=t[0],S=t[1],A=t[2],v=t[3],b=t[4],M=t[5],E=t[6],T=t[7],w=t[8],k=t[9],C=t[10],R=t[11],I=t[12],F=t[13],D=t[14],L=t[15],V=[];return V[0]=i*x+s*b+r*w+n*I,V[1]=i*S+s*M+r*k+n*F,V[2]=i*A+s*E+r*C+n*D,V[3]=i*v+s*T+r*R+n*L,V[4]=o*x+h*b+a*w+l*I,V[5]=o*S+h*M+a*k+l*F,V[6]=o*A+h*E+a*C+l*D,V[7]=o*v+h*T+a*R+l*L,V[8]=u*x+c*b+d*w+f*I,V[9]=u*S+c*M+d*k+f*F,V[10]=u*A+c*E+d*C+f*D,V[11]=u*v+c*T+d*R+f*L,V[12]=g*x+m*b+y*w+p*I,V[13]=g*S+m*M+y*k+p*F,V[14]=g*A+m*E+y*C+p*D,V[15]=g*v+m*T+y*R+p*L,V},inverse(t){const e=[],i=t[0],s=t[1],r=t[2],n=t[3],o=t[4],h=t[5],a=t[6],l=t[7],u=t[8],c=t[9],d=t[10],f=t[11],g=t[12],m=t[13],y=t[14],p=t[15],x=d*p,S=y*f,A=a*p,v=y*l,b=a*f,M=d*l,E=r*p,T=y*n,w=r*f,k=d*n,C=r*l,R=a*n,I=u*m,F=g*c,D=o*m,L=g*h,V=o*c,_=u*h,P=i*m,B=g*s,z=i*c,N=u*s,U=i*h,O=o*s,G=x*h+v*c+b*m-(S*h+A*c+M*m),Y=S*s+E*c+k*m-(x*s+T*c+w*m),H=A*s+T*h+C*m-(v*s+E*h+R*m),X=M*s+w*h+R*c-(b*s+k*h+C*c),W=1/(i*G+o*Y+u*H+g*X);return e[0]=W*G,e[1]=W*Y,e[2]=W*H,e[3]=W*X,e[4]=W*(S*o+A*u+M*g-(x*o+v*u+b*g)),e[5]=W*(x*i+T*u+w*g-(S*i+E*u+k*g)),e[6]=W*(v*i+E*o+R*g-(A*i+T*o+C*g)),e[7]=W*(b*i+k*o+C*u-(M*i+w*o+R*u)),e[8]=W*(I*l+L*f+V*p-(F*l+D*f+_*p)),e[9]=W*(F*n+P*f+N*p-(I*n+B*f+z*p)),e[10]=W*(D*n+B*l+U*p-(L*n+P*l+O*p)),e[11]=W*(_*n+z*l+O*f-(V*n+N*l+U*f)),e[12]=W*(D*d+_*y+F*a-(V*y+I*a+L*d)),e[13]=W*(z*y+I*r+B*d-(P*d+N*y+F*r)),e[14]=W*(P*a+O*y+L*r-(U*y+D*r+B*a)),e[15]=W*(U*d+V*r+N*a-(z*a+O*d+_*r)),e},projectionPerspective(t,e,i,s){const r=1/Math.tan(t*Math.PI/180/2),n=1/(i-s);return[r/e,0,0,0,0,r,0,0,0,0,(i+s)*n,-1,0,0,i*s*n*2,0]},projectionOrthographic:(t,e,i,s,r,n)=>[2/(e-t),0,0,-(e+t)/(e-t),0,2/(s-i),0,-(s+i)/(s-i),0,0,-2/(n-r),-(n+r)/(n-r),0,0,0,1]};class xl extends Qa{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Ms="Mesh Model 3D",this.Pv=new Float32Array,this.ft={x:1,y:1,z:1},this.Dv={x:0,y:0,z:0},this.Bv={x:0,y:0,z:0},this.Lv={x:0,y:0,z:0},this.Rv={x:0,y:0,z:0},this.Ha=Pe,this.Wd=()=>ue(this.getFillStyle());const o=void 0!==(null==r?void 0:r.automaticColorIndex)?r.automaticColorIndex:this.Ki.getSeries().length;this.Ga=this.yt.Ev().oS(this.sS).ke(fe(this.ts.meshModel3DFillStyle||this.ts.pointSeriesFillStyle,o)).ds(this.getHighlight()),this.fs(this.Ga)}setModelGeometry(t){const{indices:e,vertices:i,normals:s}=t;let r=Ve,n=Le,o=Ve,h=Le,a=Ve,l=Le;for(let t=0;t{const t=this.yt.qv();this.ix.tx(t),this.sx.tx(t);const e=this.hx.viewportChanged(this.nx());e&&this.ox(e),this.cs.vs()},this.hS=(t,e,i,s,r)=>{if(this.Jv){const t=r;this.Xv.push({type:"rotate",rotation:t}),this.cs.vs(),Zt(e)}},this.eS=(t,e)=>{if(this.Qv){if(this.Zv)Math.sign(this.Kv)!==Math.sign(e.deltaY)?this.Kv=ge(e):this.Kv+=ge(e);else{const t=ge(e);this.Xv.push({type:"wheel-zoom",deltaY:t})}this.cs.vs(),Zt(e)}},this.cs.Gn(ah.ff),this.bp.Eh("Chart3D"),this.lx=i.d3(),this.lx.x.K(-1,1),this.lx.y.K(-1,1),this.lx.z.K(-1,1),this.yt=e.ux("chart3D layer3D",0,this.lx),this.ix=e.Ax("chart3D series bg",0),this.sx=e.Um("chart3D axis ui",1),this.gx={x:new ja(this,(h=()=>this.MS,{...Ka(h,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.Mr().x)),Ty:t=>t.x,$y:(t,e)=>({x:t.x,y:e.y,z:e.z}),Kd:f(0,-1,0),Xy:t=>{const e={x:t.x>=0?1:-1,y:t.y>=0?1:-1,z:t.z>=0?1:-1};return{gridlinePositionA:f(0,e.y,e.z),gridlinePositionB:f(0,e.y,-e.z),gridlinePositionC:f(0,-e.y,-e.z)}},Qy:()=>!0,Jy:()=>!1,Hy:()=>!1}),this.lx.x,this.ts,this.yt,this.sx,this.pixelScale,!1,this.hs),y:new ja(this,Ja((()=>this.MS)),this.lx.y,this.ts,this.yt,this.sx,this.pixelScale,!1,this.hs),z:new ja(this,qa((()=>this.MS)),this.lx.z,this.ts,this.yt,this.sx,this.pixelScale,!1,this.hs)},this.mx=this.yt.sy([za.InternalUI]).setMouseInteractions(!1),this.setBoundingBoxStrokeStyle(this.ts.chart3DBoundingBoxStrokeStyle),this.IS=this.ix.sc(this.engine.scale,hn.Simple).ke(this.ts.chart3DSeriesBackgroundFillStyle).Ce(ot).setMouseInteractions(!0),this.PS=this.ix.sc(this.engine.scale,hn.Simple).ke(z).Ce(this.ts.chart3DSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.FS(this.IS,this.PS),this.yx({x:1,y:1,z:1},!0),this.hx=new ul(this.engine.scale,this.pixelScale,this.lx,((t,e)=>(e&&this.ox(e),this.yt.Uy(t)))),this.Sx=this.hx.getDefaultCameraConfiguration(this.vx(this.xx)),this.ox(this.Sx),this.rS=Wi(new Zi(((t,e,i)=>{a={locationOne:e,locationTwo:i,cameraLocation:this.yt.getCameraLocation()}}),((t,e,i,s,r,n)=>{if(!this.Jv&&!this.Qv)return;const o=(a.locationOne.x-a.locationTwo.x)**2+(a.locationOne.y-a.locationTwo.y)**2,h=(e.x-i.x)**2+(e.y-i.y)**2,l=De.length(a.cameraLocation),c=o/h*l,d=u((s.x+r.x)/2,(s.y+r.y)/2);this.Xv.push({type:"rotate+zoom",rotation:this.Jv?d:{x:0,y:0},cameraDistance:this.Qv?c:l}),this.cs.vs(),Zt(n)}),(t=>{})),new $i((t=>{}),((t,e,i,s,r)=>{if(this.Jv){const t=s;this.Xv.push({type:"rotate",rotation:t}),this.cs.vs(),Zt(r)}}),(t=>{}))),this.onBackgroundTouchStart(this.rS.onTouchStart),this.onBackgroundTouchMove(this.rS.onTouchMove),this.onBackgroundTouchEnd(this.rS.onTouchEnd),this.onSeriesBackgroundTouchStart(this.rS.onTouchStart),this.onSeriesBackgroundTouchMove(this.rS.onTouchMove),this.onSeriesBackgroundTouchEnd(this.rS.onTouchEnd),this.onBackgroundMouseDrag(this.hS),this.onBackgroundMouseWheel(this.eS),this.onBackgroundMouseDown(((t,e)=>{Zt(e)})),this.onSeriesBackgroundMouseDrag(this.hS),this.onSeriesBackgroundMouseWheel(this.eS),this.onSeriesBackgroundMouseDown(((t,e)=>{Zt(e)})),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled)),this.onResize(this.An),this.An(),this.mp(r,this.pixelScale)}addPointSeries(t){const e=new(t&&t.type||nl)(this,this.wS,this.yt,this.ts,this.cs.hs,t);return this.DS(e),e}addLineSeries(t){const e=new il(this,this.wS,this.yt,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length,this.cs.hs);return this.DS(e),e}addPointLineSeries(t){const e=new sl(this,this.wS,this.yt,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length,this.cs.hs);return this.DS(e),e}addSurfaceGridSeries(t){const e=new fl(this,this.wS,this.yt,t,this.ts,this.cs.hs);return this.DS(e),e}addSurfaceScrollingGridSeries(t){const e=new gl(this,this.wS,this.yt,t,this.ts,this.cs.hs);return this.DS(e),e}addBoxSeries(t){const e=new tl(this,this.wS,this.yt,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length,this.cs.hs);return this.DS(e),e}addMeshModel(t){const e=new xl(this,this.wS,this.yt,this.ts,t,this.cs.hs);return this.DS(e),e}translateCoordinate(t,e,i){if(ml(e)||ml(i)||yl(t)){if(ml(e)&&ml(i)&&yl(t)){if("axes"===e.id&&"world"===i.id)return this.yt.At(t);if("world"===e.id&&"axes"===i.id)return this.yt.St(t);if(e.id===i.id)return t}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}return $h(t,e,i,this.pixelScale,this.cs)}getDefaultAxisX(){return this.gx.x}getDefaultAxisY(){return this.gx.y}getDefaultAxisZ(){return this.gx.z}get axisX(){return this.getDefaultAxisX()}get xAxis(){return this.getDefaultAxisX()}get axisY(){return this.getDefaultAxisY()}get yAxis(){return this.getDefaultAxisY()}get axisZ(){return this.getDefaultAxisZ()}get zAxis(){return this.getDefaultAxisZ()}getDefaultAxes(){return[this.gx.x,this.gx.y,this.gx.z]}setCameraLocation(t){let e={location:t,direction:De.normalize(De.multiply(t,-1))};const i=this.hx.cameraLocationChanged(this.nx(e));return i&&(e=i),this.ox(e),this.cs.vs(),this}getCameraLocation(){return this.yt.getCameraLocation()}getCameraDirection(){return this.yt.getCameraDirection()}setCameraAutomaticFittingEnabled(t){this.hx.hv(t);const e=this.hx.cameraLocationChanged(this.nx());return e&&this.ox(e),this}getCameraAutomaticFittingEnabled(){return this.hx.Av()}onCameraChange(t){return this.L.on("cameraChange",t)}offCameraChange(t){return this.L.off(t,"cameraChange")}setBoundingBoxStrokeStyle(t){return this.mx.Ee(t).zy(Ya(this.mx.cu())),this.yt.vs(),this}getBoundingBoxStrokeStyle(){return this.mx.cu()}setBoundingBox(t){return this.yx(t,!1),this}yx(t,e){this.xx=t;const i=this.vx(t);if(this.lx.x.tt(i.x),this.lx.y.tt(i.y),this.lx.z.tt(-i.z),!e){const t=this.hx.boundingBoxChanged(this.nx());t&&this.ox(t)}this.cs.vs()}getBoundingBox(){return this.xx}Fe(t){if(ta.kp(this.bp,this.Sp),0!==this.Kv){const e=this.Kv*t*.006;this.Xv.push({type:"wheel-zoom",deltaY:e}),this.Kv=Math.sign(this.Kv)*Math.max(Math.abs(this.Kv)-.01*t,0),0!==this.Kv&&this.cs.vs(!0)}const e=this.getCameraDirection();if(this.Xv.length>0){const t=this.hx.applyCameraInteractions(this.nx(),this.Xv);t&&this.ox(t),this.Xv.length=0}this.bx&&De.equals(this.bx.location,this.Sx.location)&&De.equals(this.bx.direction,this.Sx.direction)||this.L.emit("cameraChange",this,this.getCameraLocation()),this.bx=this.Sx,super.Fe(t);for(let t=0;tthis.yt.Uy(t))),o=this.yt.Uy(f((s.x+r.x)/2,(s.y+r.y)/2,(s.z+r.z)/2)),h=re(n,o),a=[];for(let t=0;t0?t-1:h.length-1],h[t{t()})),this.ln.length=0,this.lx.U(),this.yt.U(),this.sx.U(),this.ix.U(),super.dispose()}Z(){return this.lx.x.Z(),this.lx.y.Z(),this.lx.z.Z(),super.Z()}J(){return super.J()}ox(t){this.yt.setCameraLocation(t.location).setCameraDirection(t.direction).setLightLocation(De.addVec(t.location,De.multiply(t.direction,-this.jv))),this.Sx=t,this.cs.vs()}vx(t){return De.divide(t,De.length(t)/this.$v)}nx(t=this.Sx){return{boundingBox:this.vx(this.xx),cameraLocation:t.location,cameraDirection:t.direction}}setMouseInteractions(t){return this.setMouseInteractionZoom(t).setMouseInteractionRotate(t)}setMouseInteractionZoom(t){return this.Qv=t,this}getMouseInteractionZoom(){return this.Qv}setMouseInteractionRotate(t){return this.Jv=t,this}getMouseInteractionRotate(){return this.Jv}forEachAxis(t){return t(this.gx.x),t(this.gx.y),t(this.gx.z),this}getSeries(){return this.MS}getMinimumSize(){}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationZoom(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}setAnimationZoom(t){return this.Zv=!!t,this}getAnimationZoom(){return this.Zv}}const Al={Column:Co,Row:Ro};class vl extends Jh{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Mx=new Map,this._x=this.addUIElement(Al.Row).setPosition({x:0,y:100}).setOrigin(ws.LeftTop).setBackground((t=>t.setFillStyle(z).setStrokeStyle(ot)))}add(t,e){return(t instanceof Qh?[t]:t instanceof Ff?t.getCells().filter((t=>t.panel instanceof Qh)).map((t=>t.panel)):[]).forEach((t=>{const i=this._x.addElement(sh.VerticalLegendBox).setBackground((t=>t.setFillStyle(z).setStrokeStyle(ot))).add(t,e).setTitle(t.getTitle());this.Mx.set(t,i)})),this.cs.vs(),this}setLegendBoxes(t){return this.Mx.forEach(((e,i)=>t(e,i))),this}getMinimumSize(){return super.getMinimumSize()||this._x.getSize()}}const bl={World:"World",USA:"USA",NorthAmerica:"NorthAmerica",SouthAmerica:"SouthAmerica",Canada:"Canada",Europe:"Europe",Asia:"Asia",Africa:"Africa",Australia:"Australia"},Ml=(t,e)=>!(!e.name||t.name.toLowerCase()!==e.name.toLowerCase())||"ISO_A3"in t&&"ISO_A3"in e&&t.ISO_A3.toLowerCase()===e.ISO_A3.toLowerCase(),El=(t,e)=>{let i=e.geometry;return i=Tl(t,e,i),i=wl(t,e,i),i},Tl=(t,e,i)=>{if(t===bl.Asia){const t=[];for(let e=0;e{const s=e.name.toLowerCase();let r;if(t===bl.USA&&("alaska"===s?r={translate:{x:55,y:-25},scale:{x:.16,y:.16}}:"hawaii"===s&&(r={translate:{x:48,y:7},scale:{x:1,y:1}})),r){const{translate:t,scale:n}=r,o=Ze(It(i)),h=[];for(let e=0;ethis.L.on("mouseEnter",t),this.onMouseLeave=t=>this.L.on("mouseLeave",t),this.onMouseClick=t=>this.L.on("mouseClick",t),this.onMouseDoubleClick=t=>this.L.on("mouseDoubleClick",t),this.onMouseDown=t=>this.L.on("mouseDown",t),this.onMouseUp=t=>this.L.on("mouseUp",t),this.onMouseMove=t=>this.L.on("mouseMove",t),this.offMouseEnter=t=>this.L.off(t,"mouseEnter"),this.offMouseLeave=t=>this.L.off(t,"mouseLeave"),this.offMouseClick=t=>this.L.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.L.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.L.off(t,"mouseDown"),this.offMouseUp=t=>this.L.off(t,"mouseUp"),this.offMouseMove=t=>this.L.off(t,"mouseMove"),this.offMouseDragStart=t=>this.L.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.L.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.L.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.L.off(t,"mouseWheel"),this.onMapDataReady=t=>{const e=this.L.on("mapDataReady",t);return this.Dx&&bt.setTimeout((()=>t())),e},this.onViewChange=t=>this.L.on("viewChange",t),this.Bx=(t,e,i,s,r)=>{this.ft.x.tt(s).ei([this.jt.left+this.ya.left,this.jt.right+this.ya.right]),this.ft.y.tt(r).ei([this.jt.bottom+this.ya.bottom,this.jt.top+this.ya.top+ta.Cp(this.bp,this.Sp)]),this.Lx&&this.Rx(this.Ex,this.ft,this.Lx)},this.Ct=(t,i)=>{const s=i;if(!s||!this.Dx)return;const{iRegion:r,region:n}=this.zx(this.Dx,s);this.Tx!==e.AutoCursorModes.disabled&&(this.Vx(n,r),Zt(t)),this.Ix&&this.cs.us._s(n,!0),this.Ox=n,this.L.emit("mouseEnter",this,t)},this.kt=(t,e)=>{const i=e;if(!i||!this.Dx)return;const{iRegion:s,region:r}=this.zx(this.Dx,i);this.Nx(r,s),this.Ix&&this.cs.us._s(r,!1),this.Ox=void 0,this.L.emit("mouseLeave",this,t),t&&Zt(t)},this.Dt=(t,i)=>{const s=i;if(!s||!this.Dx)return;const{iRegion:r,region:n}=this.zx(this.Dx,s);this.Tx!==e.AutoCursorModes.disabled&&(this.Vx(n,r),Zt(t)),this.Ox=n,this.L.emit("mouseMove",this,t)},this.Tt=(t,e)=>this.L.emit("mouseClick",this,t),this.Ft=(t,e)=>this.L.emit("mouseDoubleClick",this,t),this.It=(t,e)=>this.L.emit("mouseDown",this,t),this.Pt=(t,e)=>this.L.emit("mouseUp",this,t),this.Lt=(t,e,i)=>{this.L.emit("mouseDragStart",this,t,e)},this.Bt=(t,e,i,s,r)=>{this.L.emit("mouseDrag",this,t,e,i,s)},this.Rt=(t,e,i,s)=>{this.L.emit("mouseDragStop",this,t,e,i)},this.Et=(t,e)=>{this.L.emit("mouseWheel",this,t)},this.zt=(t,e)=>{const i=e;if(!i||!this.Dx)return;const{iRegion:s,region:r}=this.zx(this.Dx,i);this.Gx=this.engine.clientLocation2Engine(t.clientX,t.clientY),this.Vx(r,s),this.Ix&&this.cs.us._s(r,!0),this.Ox=r,this.L.emit("touchStart",this,t),Zt(t)},this.Vt=(t,e)=>{const i=e;if(!i||!this.Dx)return;const{iRegion:s,region:r}=this.zx(this.Dx,i);this.Gx=this.engine.clientLocation2Engine(t.clientX,t.clientY),this.Vx(r,s),this.Ox=r,this.L.emit("touchMove",this,t),Zt(t)},this.Ot=(t,e)=>{const i=e;if(!i||!this.Dx)return;const{iRegion:s,region:r}=this.zx(this.Dx,i);this.Gx=void 0,this.Nx(r,s),this.Ix&&this.cs.us._s(r,!1),this.Ox=void 0,this.L.emit("touchEnd",this,t),Zt(t)},this.cs.Gn(ah.gf),this.ih=!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled),this.Wx=i.Um("mapChart plotting",0),this.onResize(this.Bx),this.bp.Eh("Map Chart");const a=Ft(o?o.autoCursorBuilder:void 0,Ea);this.Ux=a.lm(i.$m(),this.ft,this.ft,this.ts).setVisible(!1),this.Yx=this.hs.yg(),this.mp(n,this.uiScale),this.Hx=this.Wx.$x(this.ft).setMouseInteractions(this.Hi).setMouseEnterEventHandler(((t,e,i)=>this.Ct(e,i))).setMouseLeaveEventHandler(((t,e,i)=>this.kt(e,i))).setMouseClickEventHandler(((t,e,i)=>this.Tt(e,i))).setMouseDoubleClickEventHandler(((t,e,i)=>this.Ft(e,i))).setMouseDownEventHandler(((t,e,i)=>this.It(e,i))).setMouseUpEventHandler(((t,e,i)=>this.Pt(e,i))).setMouseMoveEventHandler(((t,e,i)=>this.Dt(e,i))).setMouseDragStartEventHandler(((t,e,i,s)=>this.Lt(e,i,s))).setMouseDragEventHandler(((t,e,i,s,r,n)=>this.Bt(e,i,s,r,n))).setMouseDragStopEventHandler(((t,e,i,s,r)=>this.Rt(e,i,s,r))).setMouseWheelEventHandler(((t,e,i)=>this.Et(e,i))).setTouchStartEventHandler(((t,e,i)=>this.zt(e,i))).setTouchMoveEventHandler(((t,e,i)=>this.Vt(e,i))).setTouchEndEventHandler(((t,e,i)=>this.Ot(e,i))).ke(this.ts.mapChartFillStyle).Ce(this.ts.mapChartStrokeStyle),this.Xx=this.Wx.$x(this.ft).setMouseInteractions(this.Hi).ke(this.ts.mapChartOutlierRegionFillStyle).Ce(this.ts.mapChartOutlierRegionStrokeStyle);const l=Ft(o&&o.type,bl.World);this.Ex=l,this.jx(l).then((()=>{this.L.emit("mapDataReady")}))}getRegionUnderMouse(){return this.Ox}setFillStyle(t){return this.Hx.ke(t),this.cs.vs(),this}getFillStyle(){return this.Hx.zh()}setStrokeStyle(t){return this.Hx.Ce(t),this.cs.vs(),this}getStrokeStyle(){return this.Hx.lo()}setEffect(t){return this.Yx.Ss(t),this.cs.vs(),this}getEffect(){return this.Yx.xs()}setOutlierRegionFillStyle(t){return this.Xx.ke(t),this.cs.vs(),this}getOutlierRegionFillStyle(){return this.Xx.zh()}setOutlierRegionStrokeStyle(t){return this.Xx.Ce(t),this.cs.vs(),this}getOutlierRegionStrokeStyle(){return this.Xx.lo()}setSeparateRegionFillStyle(t){return this.Cx="function"==typeof t?t(this.Cx):t,this.wx.forEach((t=>t.ke(this.Cx))),this.cs.vs(),this}getSeparateRegionFillStyle(){return this.Cx}setSeparateRegionStrokeStyle(t){return this.kx="function"==typeof t?t(this.kx):t,this.wx.forEach((t=>t.Ce(this.kx))),this.cs.vs(),this}getSeparateRegionStrokeStyle(){return this.kx}invalidateRegionValues(t){if(!this.Dx||!this.Zx)return this.Qx=this.Qx||[],this.Qx.push(t),this;if("function"==typeof t)for(let e=0;e{t.Jx(r)}))}}else for(const e of t)if(e)for(let t=0;t{t.Jx(e.value)}))}}return this.cs.vs(),this}setAutoCursor(t){return this.Ux&&t(this.Ux),this.cs.vs(),this}getAutoCursor(){return this.Ux}setAutoCursorMode(t){return this.Tx=t,this.cs.vs(),this}getAutoCursorMode(){return this.Tx}setCursorResultTableFormatter(t){return this.Om=t,this.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}onMouseDragStart(t){return this.L.on("mouseDragStart",t)}onMouseDrag(t){return this.L.on("mouseDrag",t)}onMouseDragStop(t){return this.L.on("mouseDragStop",t)}onMouseWheel(t){return this.L.on("mouseWheel",t)}onTouchStart(t){return this.L.on("touchStart",t)}onTouchMove(t){return this.L.on("touchMove",t)}onTouchEnd(t){return this.L.on("touchEnd",t)}offTouchStart(t){return this.L.off(t,"touchStart")}offTouchMove(t){return this.L.off(t,"touchMove")}offTouchEnd(t){return this.L.off(t,"touchEnd")}setMouseInteractions(t){return this.Hi=t,this.Hx.setMouseInteractions(t),this}getMouseInteractions(){return this.Hi}setHighlight(t){var e;return t=Ae(t),this.Fx=t,null===(e=this.Dx)||void 0===e||e.regions.forEach((e=>{this.cs.us._s(e,t)})),this.L.emit("highlight",this,t),this}getHighlight(){return this.Fx}setAnimationHighlight(t){var e;return null===(e=this.Dx)||void 0===e||e.regions.forEach((e=>{this.cs.us.ws(e,t)})),this}getAnimationHighlight(){var t;return this.cs.us.Cs(null===(t=this.Dx)||void 0===t?void 0:t.regions[0])}setHighlightOnHover(t){return this.Ix=t,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.Ix}onHighlight(t){return this.L.on("highlight",t)}offHighlight(t){return this.L.off(t)}offMapDataReady(t){return this.L.off(t,"mapDataReady")}offViewChange(t){return this.L.off(t,"viewChange")}async jx(t){const e=await((t,e)=>{let i;if(t===bl.World)i="countries_world.json";else if(t===bl.NorthAmerica)i="countries_northAmerica.json";else if(t===bl.SouthAmerica)i="countries_southAmerica.json";else if(t===bl.Africa)i="countries_africa.json";else if(t===bl.Europe)i="countries_europe.json";else if(t===bl.Asia)i="countries_asia.json";else if(t===bl.USA)i="states_usa.json";else if(t===bl.Canada)i="territoriesProvinces_canada.json";else{if(t!==bl.Australia){const e=`LCJS MapChart unidentified \`type\`: ${t}`;throw bt.alert(e),new Error(e)}i="territories_australia.json"}const s=`${e}/maps/${i}`;return bt.fetch(s).then((t=>t.json())).catch((t=>{we(e,s,"Map Chart",{shouldCrash:!0})}))})(t,this.dA.Xs);this.Zx=new Array(e.regions.length).map((t=>{})).fill(void 0);const i=kl[t];if(!i)throw new Error("Unidentified map type.");for(const t of e.outliers)for(const e of t.geometry)this.Xx.Vr().Sl(e);if(t===bl.USA){const t=25.8,e=29.7;this.wx.push(this.Wx.Te(this.ft).setMouseInteractions(!1).ke(this.Cx).Ce(this.kx).Ie({x:-126,y:t}).tt({x:10,y:e-t}),this.Wx.Te(this.ft).setMouseInteractions(!1).ke(this.Cx).Ce(this.kx).Ie({x:-113,y:t}).tt({x:7,y:e-t}))}const s=this.cs.us.zr(this.Hx,{animationEnabled:this.ih});for(let i=0;i{o.forEach((e=>e.ds(t)))}))}if(this.Yx.As([this.Hx]),this.Lx=i,this.Rx(t,this.ft,i),this.Dx=e,this.Qx){for(const t of this.Qx)this.invalidateRegionValues(t);this.Qx=void 0}this.cs.vs()}Rx(t,e,i){const s=Cl[t],r=e.x.getCellSize(),n=e.y.getCellSize()/r,o={min:{x:i.min.x,y:i.min.y},max:{x:i.max.x,y:i.max.y}};if(ns){const t=(o.max.y-o.min.y)*(n/s-1);o.min.y-=t/2,o.max.y+=t/2}e.x.K(o.min.x,o.max.x),e.y.K(o.min.y,o.max.y);const h=this.ft.x.ui(),a=this.ft.y.ui();this.L.emit("viewChange",{latitudeRange:{start:o.min.y,end:o.max.y},longitudeRange:{start:o.min.x,end:o.max.x},margin:{top:a[1],bottom:a[0],left:h[0],right:h[1]}})}Vx(t,e){this.Kx={region:t,iRegion:e},this.cs.vs()}Nx(t,e){this.Kx&&t===this.Kx.region&&(this.Kx=void 0,this.cs.vs())}zx(t,e){const i=Array.from(this.Px.entries()).findIndex((([t,i])=>i.includes(e)));return{iRegion:i,region:null==t?void 0:t.regions[i]}}setAnimationsEnabled(t){return this.ih=!t,this}getAnimationsEnabled(){return this.ih}getMinimumSize(){}Qd(){return[this]}Fe(t){super.Fe(t),super.pp(),ta.kp(this.bp,this.Sp);const e=y(this.ft.x.hi(),this.ft.y.hi(),this.ft.x.ni(),this.ft.y.ni());this.Wx.tx(e);const i=this.cs.Nn()||this.Gx;if(this.Kx&&i){const t=this.Zx&&this.Zx[this.Kx.iRegion];let e=dt(i,this.engine.scale,this.ft);e={x:Rt(e.x,this.ft.x.getInnerStart(),this.ft.x.getInnerEnd()),y:Rt(e.y,this.ft.y.getInnerStart(),this.ft.y.getInnerEnd())};let s=e.x,r=e.y;const n=this.Kx.region.transform;this.Kx.region.outlier&&n&&(s=(s-n.translate.x-n.vertexBoundaries.min.x)/n.scale.x+n.vertexBoundaries.min.x,r=(r-n.translate.y-n.vertexBoundaries.min.y)/n.scale.y+n.vertexBoundaries.min.y),this.Ux.setPosition(e).setVisible(!0).getResultTable().setContent(this.Om(new la,this.Kx.region,t,s,r,this).Qu())}else this.Ux.setVisible(!1);return this.Ux.Ds().Fe(),this}dispose(){return this.Wx.U(),this.Ux.dispose(),Kh(this.ft),super.dispose()}Z(){return super.Z(),this.ft.Z(),this}J(){return super.J(),this.ft.J(),this}Wd(){return ue(this.getFillStyle())}attach(t,e=!0,i=!1){return t.setText(this.getTitle()),t.setOn(!0).setLocked(!0),t.onMouseEnter((()=>{this.setHighlight(!0)})),t.onMouseLeave((()=>{this.setHighlight(!1)})),this.onMouseEnter((()=>t.setHighlight(!0))),this.onMouseLeave((()=>t.setHighlight(!1))),this.onTouchStart((()=>t.setHighlight(!0))),this.onTouchEnd((()=>t.setHighlight(!1))),le(t,this.ts,i,{fill:this.getFillStyle()}),this}}const Il=(t,e,i,s,r,n)=>(t.addRow(`${e.name}`).addRow(Fl(s,r)),void 0!==i&&t.addRow(`Region value: ${i.toFixed(1)}`),t),Fl=(t,e)=>{const i=t>0,s=e>0;return`${[de(Math.abs(0|t),2),"° ",de(Math.abs(0|(t<0?t=-t:t)%1*60),2),"' "].join("")+(i?"E":"W")}, ${[de(Math.abs(0|e),2),"° ",de(Math.abs(0|(e<0?e=-e:e)%1*60),2),"' "].join("")+(s?"N":"S")}`};class Dl extends Js{constructor(t,e,i,s,r,n,o,h,a){super(t,e,e.qx(i),s,r,{numeric:e.tb({amplitude:s.polarAmplitudeAxisNumericTicks,radial:s.polarAmplitudeAxisNumericTicks}),datetime:e.tb({amplitude:s.polarAmplitudeAxisDateTimeTicks,radial:s.polarAmplitudeAxisDateTimeTicks}),time:e.tb({amplitude:s.polarAmplitudeAxisTimeTicks,radial:s.polarAmplitudeAxisTimeTicks})},{type:"linear"}),this.ib=n,this.sb=o,this.eb=h,this.hs=a,this.hb=i,this.rb=e.tb({amplitude:s.polarAmplitudeAxisStrokeStyle,radial:s.polarRadialAxisStrokeStyle}),this.Rh=h.Dr(i).setMouseInteractions(!1).Nh(e.tb({amplitude:s.polarAmplitudeAxisTitleFont,radial:s.polarRadialAxisTitleFont})).ke(e.tb({amplitude:s.polarAmplitudeAxisTitleFillStyle,radial:s.polarRadialAxisTitleFillStyle})),this.Uh=this.hs.yg([this.Rh]).Ss(s.effectsText)}setTickStrategy(t,e){return super.Ih(t,e)}setStrokeStyle(t){return this.rb="function"==typeof t?t(this.rb):t,this.sb.vs(),this}getStrokeStyle(){return this.rb}cr(t,e){return new Ll(e,t,this.hb,this.eb,this.nb(this.ib,this.hb),this.eb.ze(this.hb).setMouseInteractions(!1))}dr(t,e){const i=this.ob(this.hb,t);this.ab&&!1===this.ab(t)?t.Ye.setVisible(!1):t.Ye.setVisible(!0).Ie(oi(this.lb(this.hb,t.S),i.padding)).za(i.alignment).Gh(i.rotation).Pa(i.offset.x,i.offset.y),this.ub(this.hb,t.cb,t.fb,t)}setMouseInteractions(t){return this}Fe(){this.tr({physicalAxisSize:0});const t=this.pr(((t,e)=>{const i=e.xh.ur,s=.5*this.rb.getThickness()+i.tickLength+i.tickPadding+Math.abs(e.Ye.Ds().Zc().y)+i.labelPadding;return Math.max(t,s)}),0);return this.Ab(this.hb,this.rb,t),this.gb(this.hb,this.Rh,t),t}}class Ll extends qs{constructor(t,e,i,s,r,n,o){super(t,e,s,i,o),this.cb=r,this.fb=n,r.setMouseInteractions(!1),this.ss.push(r,n)}}class Vl extends Dl{constructor(t,e,i,s,r,n,o,h,a){super(t,_l((()=>this.wg())),e,i,s,r,n,o,h),this.Ey=this.sb.ze(this.hb).setMouseInteractions(!1),this.pb=a,this.setScrollStrategy(zs.expansion),this.setTickStrategy(Ns.Numeric),this.setTitle("Amplitude")}wg(){return this.pb()}wr(t,e){return oh(t,e,this.hb.y)}kr(t,e,i){const s=2*(e-t),r=this.hb.x.Ri(s);return{min:t-i*r,max:e+i*r}}lb(t,e){return{x:t.mb()?e-t.yb().start:t.yb().start-e,y:0}}nb(t,e){return t.Kc(e)}ub(t,e,i,s){const r=s.xh.ur,n=t.mb()?s.S-t.yb().start:t.yb().start-s.S;Ct(s.S,t.yb().start)||Ct(s.S,t.yb().end)?e.setVisible(!1):e.setVisible(!0).hu(0).Ve(360).lu(void 0).au(0).ru(n).lu(60).ke(z).Ce(r.gridStrokeStyle);const o=.5*this.rb.getThickness();i.Oe({x:n,y:-o*t.Ui().y}).Ve({x:n,y:-(o+r.tickLength)*t.Ui().y}).Ee(r.tickStyle)}ob(t,e){const i=e.xh.ur;return{alignment:{x:0,y:1},padding:{x:0,y:t.Ui().y*-(.5*this.rb.getThickness()+i.tickLength+i.tickPadding)},rotation:0,offset:{x:0,y:0}}}Ab(t,e,i){const s=t.mb()?t.yb().end-t.yb().start:t.yb().start-t.yb().end;this.Ey.Oe({x:0,y:0}).Ve({x:s,y:0}).Ee(e)}gb(t,e,i){const s=t.mb()?(t.yb().start+t.yb().end)/2-t.yb().start:t.yb().start-(t.yb().start+t.yb().end)/2;e.za({x:0,y:1}).Ie({x:s,y:-i*t.Ui().y})}}const _l=t=>({...Ka(t,(t=>t.getAmplitudeMin()),(t=>t.getAmplitudeMax()),(t=>{})),qx:t=>({getInnerStart:()=>t.yb().start,getInnerEnd:()=>t.yb().end,K:(e,i)=>t.Sb(e,i),ot:(e,i,s,r,n)=>t.y.ot(e,i,s,r,n)}),tb:t=>t.amplitude});class Pl extends Dl{constructor(t,e,i,s,r,n,o,h){super(t,zl,e,i,s,r,n,o,h),this.vb=90,this.xb=12,this.bb=Bl,this.Ey=this.sb.Kc(this.hb).setMouseInteractions(!1),this.ab=t=>{let e=180*(t.S-this.hb.Mb())/Math.PI%360;for(;e<0;)e+=360;for(;e>360;)e-=360;if(e>=0&&e<=20||e>=340&&e<=360)return!1},this.Ke=void 0,this.setTickStyle(i.polarRadialAxisTickStyle),this.setTitle("Degrees"),this.setNorth(this.vb)}setTickStyle(t){return this._b="function"==typeof t?t(this._b):t,this.wb(),this.sb.vs(),this}getTickStyle(){return this._b}setTickFormattingFunction(t){return this.bb=t,this.wb(),this.sb.vs(),this}getTickFormattingFunction(){return this.bb}setClockwise(t){this.hb.Cb(t);const e=this.vb*Math.PI/180;return t?this.hb.kb(e+Math.PI/2):this.hb.kb(e-Math.PI/2),this.sb.vs(),this}getClockwise(){return!this.hb.Tb()}setNorth(t){for(;t<0;)t+=360;t%=360,this.vb=t;const e=t*Math.PI/180;return this.getClockwise()?this.hb.kb(e+Math.PI/2):this.hb.kb(e-Math.PI/2),this.sb.vs(),this}getNorth(){return 180*this.hb.Mb()/Math.PI}setDivision(t){return this.xb=t,this.wb(),this.sb.vs(),this}getDivision(){return this.xb}wg(){return[]}wr(t,e){return e}kr(t,e,i){return{min:t,max:e}}lb(t,e){const i=t.Tb()?1:-1,s=t.Mb(),r=t.mb()?t.yb().end-t.yb().start:t.yb().start-t.yb().end;return{x:Math.cos((e-s)*i)*r,y:Math.sin((e-s)*i)*r}}nb(t,e){return t.ze(e)}ub(t,e,i,s){const r=this._b,n=t.Tb()?1:-1,o=t.Mb(),h=(s.S-o)*n,a=Math.cos(h),l=Math.sin(h),u=t.mb()?t.yb().end-t.yb().start:t.yb().start-t.yb().end,c={x:a*u,y:l*u};e.Oe({x:0,y:0}).Ve(c);const d={x:c.x+a*r.tickLength*t.Ui().x,y:c.y+l*r.tickLength*t.Ui().y};i.Oe(c).Ve(d),e.Ee(r.gridStrokeStyle),i.Ee(r.tickStyle)}ob(t,e){const i=this._b,s=t.Tb()?1:-1,r=t.Mb();let n,o=(e.S-r)*s;for(;o<0;)o+=2*Math.PI;for(;o>=2*Math.PI;)o-=2*Math.PI;n=o>0&&o<=Math.PI?-o+Math.PI/2:-o-Math.PI/2;const h=i.tickLength+i.tickPadding,a=Math.cos(o)*h*t.Ui().x,l=Math.sin(o)*h*t.Ui().y;return{alignment:{x:0,y:0},padding:{x:a,y:l},rotation:180*n/Math.PI,offset:{x:a,y:l}}}Ab(t,e,i){const s=t.mb()?t.yb().end-t.yb().start:t.yb().start-t.yb().end;this.Ey.hu(0).Ve(360).au(0).ru(s+.5*e.getThickness()*t.Ui().x).lu(360).ke(z).Ce(e)}gb(t,e,i){const s=t.Mb(),r=this.ob(t,{S:0+s}),n=t.mb()?t.yb().end-t.yb().start:t.yb().start-t.yb().end;e.za(r.alignment).Gh(r.rotation).Pa(r.offset.x,r.offset.y).Ie(oi({x:n,y:0},r.padding))}wb(){this.Xh({$e:[],Xe:[{Ye:"Radial ticks",Eg:0,ur:this._b,ar:this.bb,Lr:(t,e,i,s)=>{const r=[],n=2*Math.PI/this.xb;for(let t=0;t<2*Math.PI;t+=n)r.push(t);return r},bh:{Ar:()=>{},Mh:()=>!1},Rr:void 0}],We:Bl,jh:void 0,Zh:void 0})}}const Bl=(t,e,i)=>(180*t/Math.PI).toFixed(0),zl={Sr:()=>{},vr:()=>{},Mr:()=>{},qx:t=>({getInnerStart:()=>0,getInnerEnd:()=>2*Math.PI,K:(t,e)=>{},ot:(e,i,s,r,n)=>t.x.ot(e,i,s,r,n)}),tb:t=>t.radial},Nl=t=>!!(t&&"object"==typeof t&&"axisAmplitude"in t&&"axisRadial"in t),Ul=t=>!!(t&&"object"==typeof t&&"angle"in t&&"number"==typeof t.angle&&"amplitude"in t&&"number"==typeof t.amplitude);class Ol extends Yi{constructor(t,e,i,s,r,n){super(e,i,r,n),this.Ms="Sector",this.Fb=0,this.Ib=1*Math.PI/2,this.Pb=void 0,this.Db=void 0,this.Ts=t,this.hb=s,this._m=this.Ts.Kc(this.hb).ds(this.getHighlight()),this.fs(this._m),this.be=r.polarSectorFillStyle,this.Me=r.polarSectorStrokeStyle,this.setMouseInteractions(!1)}setAngleStart(t){return this.Fb=Rt(t,0,360),this.Ts.vs(),this}getAngleStart(){return this.Fb}setAngleEnd(t){return this.Ib=Rt(t,0,360),this.Ts.vs(),this}getAngleEnd(){return this.Ib}setAmplitudeStart(t){return this.Pb=t,this.Ts.vs(),this}getAmplitudeStart(){return this.Pb}setAmplitudeEnd(t){return this.Db=t,this.Ts.vs(),this}getAmplitudeEnd(){return this.Db}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Ts.vs(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Ts.vs(),this}getStrokeStyle(){return this.Me}Fe(){const t=this.hb.yb(),e=180*this.hb.Mb()/Math.PI,i=void 0!==this.Pb?Rt(this.Pb,t.start,t.end):t.start,s=void 0!==this.Db?Rt(this.Db,t.start,t.end):t.end,r=this.hb.mb()?i-t.start:t.start-i,n=this.hb.mb()?s-t.start:t.start-s,o=Math.min(r,n),h=Math.max(r,n),a=this.hb.Tb()?1:-1,l=Math.abs(this.Ib-this.Fb);this._m.hu((this.Fb-e)*a).Ve((this.Ib-e)*a).au(100*o/h).ru(h).ke(this.be).Ce(this.Me).lu(Math.ceil(l/2))}Pe(t,e){t.ds(e),this.Ts.vs()}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{fill:this.be,stroke:this.Me}),this}}class Gl extends Yi{constructor(){super(...arguments),this.iS=!0,this.Bb=!0}setAutoScrollingEnabled(t){return this.iS=t,this.Ki.cs.vs(),this}getAutoScrollingEnabled(){return this.iS}aS(){}Fe(){}Ay(){}setCursorEnabled(t){return this.Bb=t,this}getCursorEnabled(){return this.Bb}}class Yl extends Gl{constructor(t,e,i,s,r,n){super(e,i,r,n),this.Ts=t,this.Ki=e,this.scale=s}getAmplitudeMin(){return this.Lb?this.Lb.min:void 0}getAmplitudeMax(){return this.Lb?this.Lb.max:void 0}}const Hl=(t,e,i,s,r)=>{const n=e.getIcon();return n?t.addRow(n,e.getName()):t.addRow(e.getName()),t.addRow("Angle:","",Math.round(i).toString()).addRow("Amplitude","",r(s))},Xl=(t,e)=>{const i=[],s=e.yb().start,r=e.yb().end,n=e.mb(),o=e.Tb()?1:-1,h=e.Mb(),a=Math.abs(r-s),l=Math.min(s,r)+.001*a,u=Math.max(s,r)-.001*a;for(const e of t){const t=Rt(e.amplitude,l,u),r=e.angle*Math.PI/180-h,a=Math.cos(r*o)*(n?t-s:s-t),c=Math.sin(r*o)*(n?t-s:s-t),d=e.color;i.push({x:a,y:c,color:d})}return i},Wl=t=>{const e={min:Le,max:Ve};for(const i of t)e.min=Math.min(e.min,i.amplitude),e.max=Math.max(e.max,i.amplitude);return e},jl=t=>t.slice().map((t=>t.angle>=0&&t.angle<=360?t:{...t,angle:t.angle%360})),$l=(t,e)=>{let i=yi(t);for(e.Tb()||(i*=-1),i+=180*e.Mb()/Math.PI;i<0;)i+=360;i%=360;const s=ri(t),r=e.yb(),n=Math.abs(r.end-r.start);return{angle:i,amplitude:Vn(r.start,r.end,s/n)}};class Zl extends Yl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n),this.Ms="Heatmap Series",this.Rb=!0,this.fS=!1,this.Om=Kl,this.Wd=()=>ue(this.be);const h=this.Ki.getSeries().length;this.be=fe(this.ts.polarHeatmapSeriesFillStyle||this.ts.heatmapGridSeriesFillStyle,h);const a=o.amplitudeStart||0,l=o.amplitudeEnd?(o.amplitudeEnd-a)/(o.annuli-1):o.amplitudeStep||1,u={sectors:o.sectors,annuli:o.annuli,amplitudeStart:a,amplitudeStep:l,heatmapDataType:"intensity",dataOrder:o.dataOrder||"annuli"};this.Yn=u,this.Eb=t.zb(s,[],u).ke(this.be).ds(this.getHighlight()),this.fs(this.Eb);const c=Math.min(u.amplitudeStart,u.amplitudeStart+(u.annuli-1)*u.amplitudeStep),d=Math.max(u.amplitudeStart,u.amplitudeStart+(u.annuli-1)*u.amplitudeStep);this.Lb={min:c,max:d},this.setHighlightOnHover(!1)}invalidateIntensityValues(t){if(this.fS&&this.Ki.cs.Gn(ah.xf),Array.isArray(t)){if(0===t.length||0===t[0].length)return this;const e={x:t.length,y:t[0].length,sectors:"annuli"===this.Yn.dataOrder?t[0].length:t.length,annuli:"annuli"===this.Yn.dataOrder?t.length:t[0].length},i="annuli"===this.Yn.dataOrder?this.Yn.annuli:this.Yn.sectors,s="annuli"===this.Yn.dataOrder?this.Yn.sectors:this.Yn.annuli;if(e.x>i||e.y>s){if(!0===this.Ki.dA.$n){const t=`PolarHeatmapSeries.invalidateIntensityValues intensity matrix overflow.\nHeatmap ${i}x${s}, input ${e.x}x${e.y}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;bt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.Ki.dA.$n){const t=`PolarHeatmapSeries.invalidateIntensityValues intensity matrix overflow.\nMax indexes ${o}x${h}, input ${e.primary}x${e.secondary} starting at [${i},${r}].\nOut of bounds data will be automatically clipped. This can result in sub-optimal performance.`;bt.console.warn(t)}const a=Math.max(s-o,0),l=e.primary-a,u=Math.max(n-h,0),c=[];for(let e=0;e0?-u:void 0);if(0===(t={iSector:t.iSector,iAnnulus:t.iAnnulus,values:c}).values.length||0===t.values[0].length)return this}this.Eb.wv({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:r,values:t.values})}return this.Ts.vs(),this.fS=!0,this}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Eb.ke(this.be),this.Ts.vs(),this}getFillStyle(){return this.be}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}clear(){return this.Eb.Gt(),this.Ts.vs(),this}setCursorInterpolationEnabled(t){return this.Rb=t,this.Ts.cs.vs(),this}getCursorInterpolationEnabled(){return this.Rb}setCursorEnabled(t){return super.setCursorEnabled(t)}setIntensityInterpolation(t){return t=t||"disabled",this.Eb.Mv(t),this.Ts.vs(),this}getIntensityInterpolation(){return this.Eb._v()}qy(){return this.iS&&this.getVisible()}Pe(t,e){t.ds(e),this.Ts.vs()}$c(t,e){const i=dt(t,this.Ki.engine.scale,this.scale),s=$l(i,this.scale),r=this.Rb?this.Eb.Vb(s):this.Eb.$c(s);if(r)return Ta(Xl([r],this.scale)[0],this.scale,this.Om(new la,this,{angleDeg:r.angle,amplitude:r.amplitude,intensity:r.cellValue,iAnnulus:r.iAnnulus,iSector:r.iSector},this.Ki.getAmplitudeAxis().formatValue).Qu(),this,this.be)}solveNearestFromScreen(t){return this.$c(rh(t,this.Ki.cs),!1)}Fe(){}attach(t,e=!0,i=!1){return super.attach(t,e),le(t,this.ts,i,{fill:this.be}),this}}const Kl=(t,e,i,s)=>{const r=e.getIcon();return r?t.addRow(r,e.getName()):t.addRow(e.getName()),t.addRow("Angle:","",Math.round(i.angleDeg).toString()).addRow("Amplitude","",s(i.amplitude)).addRow("Intensity","",i.intensity.toFixed(1))};class Jl extends Yl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this.Ms="Line Series",this.Ob=[],this.Nb=!1,this.Gb=!1,this.Om=Hl,this.uu=fe(this.ts.polarLineSeriesStrokeStyle,n),this.Wb=t.sy(s,void 0,[za.UserSeries]).Ee(this.uu).ds(this.getHighlight()).qa(Lr.Nearest),this.fs(this.Wb)}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}setData(t){return 0!==this.Ob.length&&this.Ki.cs.Gn(ah.xf),this.Ob=jl(t),this.Nb=!0,this.Lb=Wl(this.Ob),this.Ts.vs(),this}setStrokeStyle(t){this.uu="function"==typeof t?t(this.uu):t;const e=this.uu;return this.Wb.Ee(e),this.Ts.vs(),this}getStrokeStyle(){return this.uu}setConnectDataAutomaticallyEnabled(t){return this.Gb=t,this.Ts.vs(),this}getConnectDataAutomaticallyEnabled(){return this.Gb}qy(){return this.iS&&this.Ob.length>0&&this.getVisible()}Pe(t,e){t.ds(e),this.Ts.vs()}$c(t,e){return this.Ub(t,this.Wb)}solveNearestFromScreen(t){return this.Ub(rh(t,this.Ki.cs),this.Wb)}Ub(t,e){const i=e.Yb(t);if(!i)return;const{angle:s,amplitude:r}=$l(i,this.scale);return Ta(i,this.scale,this.Om(new la,this,s,r,this.Ki.getAmplitudeAxis().formatValue).Qu(),this,this.uu.getFillStyle())}Fe(){if(this.Nb||this.scale.Hb()){const t=Xl(this.Ob,this.scale),e=Ze(t);this.Gb?(t.push({...t[0]}),this.Wb.Vl(!0)):this.Wb.Vl(!1),this.Wb.Gt().ol(t).Ho(e),this.Nb=!1,this.Wb.Ds()}}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{stroke:this.uu}),this}}class ql extends Yl{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this.Ms="Point Line Series",this.Ob=[],this.Nb=!1,this.Gb=!1,this.$b=3,this.ga=0,this.Xb=e.PointShape.Circle,this.Om=Hl,this.be=fe(this.ts.polarPointLineSeriesFillStyle,o),this.uu=fe(this.ts.polarPointLineSeriesStrokeStyle,o),this.Wb=t.sy(r,void 0,[za.UserSeries]).Ee(this.uu).ds(this.getHighlight()).qa(Lr.Nearest),this.fs(this.Wb),this.jb=t.bS(r).ke(this.be).sl(this.Xb).tt(this.$b).ds(this.getHighlight()).qa(Lr.Nearest),this.fs(this.jb)}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}setData(t){return 0!==this.Ob.length&&this.Ki.cs.Gn(ah.xf),this.Ob=jl(t),this.Nb=!0,this.Lb=Wl(this.Ob),this.Ts.vs(),this}setStrokeStyle(t){this.uu="function"==typeof t?t(this.uu):t;const e=this.uu;return this.Wb.Ee(e),this.Ts.vs(),this}getStrokeStyle(){return this.uu}setPointFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;return this.jb.ke(e),this.Ts.vs(),this}getPointFillStyle(){return this.be}setPointSize(t){return this.$b=t,this.jb.tt(t),this.Ts.vs(),this}getPointSize(){return this.$b}setPointShape(t){return this.Xb=t,this.jb.sl(this.Xb),this}getPointShape(){return this.Xb}setPointRotation(t){return this.ga=t,this.jb.Gh(t),this.Ts.vs(),this}getPointRotation(){return this.ga}setConnectDataAutomaticallyEnabled(t){return this.Gb=t,this.Ts.vs(),this}getConnectDataAutomaticallyEnabled(){return this.Gb}qy(){return this.iS&&this.Ob.length>0&&this.getVisible()}Pe(t,e){t.ds(e),this.Ts.vs()}$c(t,e){return this.Ub(t,this.Wb)}solveNearestFromScreen(t){return this.Ub(rh(t,this.Ki.cs),this.Wb)}Ub(t,e){const i=e instanceof tn?e.$c(t):e.Yb(t);if(!i)return;const{angle:s,amplitude:r}=$l(i,this.scale);return Ta(i,this.scale,this.Om(new la,this,s,r,this.Ki.getAmplitudeAxis().formatValue).Qu(),this,"color"in i&&X(this.be)?new G({color:i.color}):this.be)}Fe(){if(this.Nb||this.scale.Hb()){const t=Xl(this.Ob,this.scale),e=Ze(t);this.Gb?(t.push({...t[0]}),this.Wb.Vl(!0)):this.Wb.Vl(!1),this.Wb.Gt().ol(t).Ho(e),this.jb.Gt().ol(t).Ho(e),this.Nb=!1,this.Wb.Ds(),this.jb.Ds()}}ks(){return this.bs||this.Xb}}class Ql extends fn{constructor(t,e,i,s,n,o,h,a,l){super(),this.Go=Ie(),this.L=new r.Eventer,this.Xi=!1,this.Zb=s,this.Qb=n,this.Jb=o,this.Kb=h,this.qb=a,this.Ts=t,this.scale=e,this.tM=i,this.ts=l}onHighlight(t){return this.L.on("highlight",t)}offHighlight(t){return this.L.off(t)}dispose(){return this.tM&&this.tM(this),this.Ts.cs.vs(),this.L.emit("dispose",this),this.Xi=!0,this}setVisible(t){return super.setVisible(t),this.Jb(),this.Ts.cs.vs(),this}isDisposed(){return this.Xi}onDispose(t){return this.L.on("dispose",t)}offDispose(t){return this.L.off(t,"dispose")}setMouseInteractions(t){return this.Kb(this,t),this}getMouseInteractions(){return this.qb(this)}}class tu extends Ql{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d,f,g,y,p){super(t,e,i,s,r,n,o,h,p),this.iM=1,this.sM=1,this.Ts=t,this.scale=e,this.dimensionStrategy=a,this.start=l,this.end=u,this.lowerExtreme=c,this.lowerQuartile=d,this.median=f,this.upperQuartile=g,this.upperExtreme=y,this.boundaries=m(this.dimensionStrategy.toPoint(l,c),this.dimensionStrategy.toPoint(u,y)),this.eM=this.ts.boxSeriesBodyFillStyle,this.hM=this.ts.boxSeriesBodyStrokeStyle,this.uu=this.ts.boxSeriesStrokeStyle,this.rM=this.ts.boxSeriesMedianStrokeStyle,this.Ds()}getBoundaries(){return this.boundaries}setBodyWidth(t){return this.iM=t,this.Ds(),this}getBodyWidth(){return this.iM}setBodyFillStyle(t){return this.eM="function"==typeof t?t(this.eM):t,this.Qb(),this}getBodyFillStyle(){return this.eM}setBodyStrokeStyle(t){return this.hM="function"==typeof t?t(this.hM):t,this.Qb(),this}getBodyStrokeStyle(){return this.hM}setTailWidth(t){return this.sM=t,this.Ds(),this}getTailWidth(){return this.sM}setStrokeStyle(t){return this.uu="function"==typeof t?t(this.uu):t,this.Qb(),this}getStrokeStyle(){return this.uu}setMedianStrokeStyle(t){return this.rM="function"==typeof t?t(this.rM):t,this.Qb(),this}getMedianStrokeStyle(){return this.rM}Ds(){this.Zb()}getDominantStyle(){return this.getBodyFillStyle()}}const eu=(t,e,i)=>{const s=e.ft,r=i.ft;let n=(t.x-s.getInnerStart())/(s.getInnerEnd()-s.getInnerStart()),o=(t.y-r.getInnerStart())/(r.getInnerEnd()-r.getInnerStart());return 1===i.hg&&(n=1-n),1===e.hg&&(o=1-o),u(o,n)};class iu extends fa{constructor(t,e,i,s,r,n,o,h){super(t,e,Bi(i.ft,s.ft),r,h),this.nM=!1,this.oM=!1,this.aM=!0,this.lM=!0,this.uM=!1,this.cM=!1,this.setGridStrokeYStyle=t=>(this.dM.setGridStrokeStyle(t),this),this.getGridStrokeYStyle=()=>this.dM.getGridStrokeStyle(),this.axisX=i,this.axisY=s,this.fM=n,this.AM=o,this.gM=this.axisX.Hg(!1,this.fM).setMouseInteractions(!1).setAllocatesAxisSpace(!1),this.dM=this.axisY.Hg(!1,this.AM).setMouseInteractions(!1).setAllocatesAxisSpace(!1)}dispose(){return super.dispose(),this.gM.dispose(),this.dM.dispose(),this}pointAt(t){return super.pointAt(t),this.setPosition(dt(t.location,t.scale,this.scale)),this}setPosition(t){super.setPosition(t),this.gM.setValue(t.x),this.dM.setValue(t.y);const e=eu(u(this.gM.getValue(),this.dM.getValue()),this.axisX,this.axisY);return this.gM.setGridStrokeLength(this.uM?e.x:1),this.dM.setGridStrokeLength(this.cM?e.y:1),this}Fe(){this.gM.setVisible(this.ji&&this.Jg).setMarkerVisible(this.ji&&this.Jg&&this.nM),this.dM.setVisible(this.ji&&this.Jg).setMarkerVisible(this.ji&&this.Jg&&this.oM);const t=eu(u(this.gM.getValue(),this.dM.getValue()),this.axisX,this.axisY);return this.gM.setGridStrokeLength(this.uM?t.x:1),this.dM.setGridStrokeLength(this.cM?t.y:1),super.Fe()}setGridStrokeXCut(t){return this.uM=t,this.Ts.vs(),this}getGridStrokeXCut(){return this.uM}setGridStrokeYCut(t){return this.cM=t,this.Ts.vs(),this}getGridStrokeYCut(){return this.cM}setGridStrokeXStyle(t){return this.gM.setGridStrokeStyle(t),this}getGridStrokeXStyle(){return this.gM.getGridStrokeStyle()}setTickMarkerXVisible(t){return this.nM=t,this.Ts.vs(),this}getTickMarkerXVisible(){return this.nM}setTickMarkerYVisible(t){return this.oM=t,this.Ts.vs(),this}getTickMarkerYVisible(){return this.oM}setTickMarkerX(t){return this.gM.setMarker(t),this}setTickMarkerY(t){return this.dM.setMarker(t),this}getTickMarkerX(){return this.gM.getMarker()}getTickMarkerY(){return this.dM.getMarker()}}class su extends da{constructor(t,e,i,s,r,n,o){super(t,e,i,s,o),this.uM=!1,this.cM=!1,this.pM=!1,this.mM=!1,this.yM=new Map,this.SM=new Map,this.nM=!0,this.oM=!0,this.tm=s,this.fM=r,this.AM=n,this.vM=o.cursorGridStrokeStyleX,this.xM=o.cursorGridStrokeStyleY}dispose(){return super.dispose(),this.yM.forEach((t=>t.dispose())),this.SM.forEach((t=>t.dispose())),this.bM=void 0,this.MM=void 0,this}Fe(){return this.bM&&this.bM.setVisible(this.ji&&this.Jg).setMarkerVisible(this.ji&&this.Jg&&this.nM),this.MM&&this.MM.setVisible(this.ji&&this.Jg).setMarkerVisible(this.ji&&this.Jg&&this.oM),super.Fe()}pointAt(t){const{location:e}=t,i=t.owner instanceof yu&&t.owner;if(!i)return this;const{axisX:s}=i,{axisY:r}=i,n=this.gh(s,!0),o=this.gh(r,!1);n!==this.bM&&this.bM&&this.bM.setVisible(!1),o!==this.MM&&this.MM&&this.MM.setVisible(!1),n.setValue(e.x),o.setValue(e.y);const h=eu(u(e.x,e.y),s,r);return n.setGridStrokeLength(this.uM?h.x:1),o.setGridStrokeLength(this.cM?h.y:1),this.bM=n,this.MM=o,super.pointAt(t)}rm(t){if(super.rm(t),t){const e=e=>e.setTextFillStyle(t);this.bM&&this.pM&&this.bM.setMarker(e),this.MM&&this.mM&&this.MM.setMarker(e)}}gh(t,e){let i=(e?this.yM:this.SM).get(t);return i||(e?(i=t.Hg(!1,this.fM),this.yM.set(t,i)):(i=t.Hg(!1,this.AM),this.SM.set(t,i)),this.lr(i,e),i.setMouseInteractions(!1).setAllocatesAxisSpace(!1)),i}lr(t,e){const i=e?this.vM:this.xM;return t.setGridStrokeStyle(i),t.setMouseInteractions(!1),(e?this.nM:this.oM)?t.setMarkerVisible(!0):t.setMarkerVisible(!1),t}setGridStrokeXCut(t){return this.uM=t,this.Ts.vs(),this}getGridStrokeXCut(){return this.uM}setGridStrokeYCut(t){return this.cM=t,this.Ts.vs(),this}getGridStrokeYCut(){return this.cM}setGridStrokeXStyle(t){return this.vM=t instanceof Function?t(this.getGridStrokeXStyle()):t,this.yM.forEach((t=>t.setGridStrokeStyle(this.vM))),this}getGridStrokeXStyle(){return this.vM}setGridStrokeYStyle(t){return this.xM=t instanceof Function?t(this.getGridStrokeYStyle()):t,this.SM.forEach((t=>t.setGridStrokeStyle(this.xM))),this}getGridStrokeYStyle(){return this.xM}setTickMarkerXVisible(t){return this.nM=t,this.Ts.vs(),this}getTickMarkerXVisible(){return this.nM}setTickMarkerYVisible(t){return this.oM=t,this.Ts.vs(),this}getTickMarkerYVisible(){return this.oM}setTickMarkerX(t){return this.yM.forEach((e=>e.setMarker(t))),this.fM=this.fM.addStyler(t),this.Ts.vs(),this}setTickMarkerY(t){return this.SM.forEach((e=>e.setMarker(t))),this.AM=this.AM.addStyler(t),this.Ts.vs(),this}setTickMarkerXAutoTextStyle(t){return this.pM=t,this.Ts.vs(),this}getTickMarkerXAutoTextStyle(){return this.pM}setTickMarkerYAutoTextStyle(t){return this.mM=t,this.Ts.vs(),this}getTickMarkerYAutoTextStyle(){return this.mM}}class ru extends ga{constructor(t,e,i,s){super(t,s),this.tm=t,this.fM=e,this.AM=i,this.nm=s}}class nu extends ru{constructor(){super(...arguments),this.am=(t,e,i,s)=>this.om(new su(t,e,i,this.tm,this.fM,this.AM,s),s),this.addStyler=t=>new nu(this.tm,this.fM,this.AM,this.nm.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new nu(t,this.fM,this.AM,this.nm.map((t=>t)))}}class ou extends ru{constructor(){super(...arguments),this.lm=(t,e,i,s,r)=>this.om(new iu(t,e,i,s,this.tm,this.fM,this.AM,r),r),this.addStyler=t=>new ou(this.tm,this.fM,this.AM,this.nm.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new ou(t,this.fM,this.AM,this.nm.map((t=>t)))}}const hu=new nu(mo,ih.PointableTextBox,ih.PointableTextBox,[(t,e)=>{pa(t),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),Sn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),Sn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),au=new ou(mo,ih.PointableTextBox,ih.PointableTextBox,[(t,e)=>{xa(t,e),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),Sn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),Sn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),lu=new ou(mo,ih.PointableTextBox,ih.PointableTextBox,[(t,e)=>{((t,e)=>{t.setPointMarker((t=>t.setFillStyle(e.seriesMarkerPointMarkerFillStyle).setSize(e.seriesMarkerPointMarkerSize).setShape(e.seriesMarkerPointMarkerShape))).setResultTable((t=>t.setEffect(!0).setBackground((t=>t)).setOrigin(u(-1,-1)).setMargin(10)))})(t,e),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),Sn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),Sn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),uu=(t,i,s)=>{switch(t){case e.UIVisibilityModes.always:return!0;case e.UIVisibilityModes.never:return!1;case e.UIVisibilityModes.whenDragged:return s;case e.UIVisibilityModes.whenHovered:return i&&!s;case e.UIVisibilityModes.whenHoveredOrDragged:return s||i;case e.UIVisibilityModes.whenNotDragged:return!s;default:return!1}},cu=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class du{constructor(t,i,s,n,o,h){this._M=e.UIVisibilityModes.always,this.wM=e.UIVisibilityModes.always,this.Lo=!0,this.Xi=!1,this.CM=!1,this.kM=!1,this.ca=u(0,0),this._u=e.UIDraggingModes.draggable,this.wu=void 0,this.L=new r.Eventer,this.ji=!0,this.TM=(t,i,s)=>{this.CM=!0,this.Ts.vs();const r=this._u===e.UIDraggingModes.notDraggable?this._u:s||this._u;this.wu=this.Ts.cs.Ur(r===e.UIDraggingModes.notDraggable?e.MouseStyles.Restricted:r===e.UIDraggingModes.draggable?e.MouseStyles.Move:r===e.UIDraggingModes.onlyHorizontal?e.MouseStyles.Horizontal:e.MouseStyles.Vertical)},this.FM=()=>{this.CM=!1,this.Ts.vs(),this.Ts.cs.Yr(this.wu)},this.IM=(t,e)=>{this.kM=!0,Zt(e),this.Ts.vs()},this.PM=(t,i)=>{if(this._u!==e.UIDraggingModes.notDraggable){const s=i||this._u,r=dt(this.Ts.cs.De(t.x,t.y),this.Ts.cs.ft,this.scale),n=u(s!==e.UIDraggingModes.onlyVertical?cu(r.x,this.scale.x):this.ca.x,s!==e.UIDraggingModes.onlyHorizontal?cu(r.y,this.scale.y):this.ca.y);return this.setPosition(n),!0}return!1},this.DM=(t,e)=>{this.kM=!1,Zt(e),this.Ts.vs()},this.onDispose=t=>this.L.on("dispose",t),this.offDispose=t=>this.L.off(t,"dispose"),this.Ts=t,this.renderingScale=i,this.scale=s,this.Ux=n,this.BM=o,this.ts=h;const a=n.getPointMarker().setMouseInteractions(!0);a.onMouseEnter(((t,e)=>this.TM(t,e))),a.onMouseLeave(this.FM),a.onMouseDragStart(this.IM),a.onMouseDrag(((t,e)=>this.PM(u(e.clientX,e.clientY))&&Zt(e))),a.onMouseDragStop(this.DM),a.onTouchStart(this.IM),a.onTouchMove(((t,e)=>this.PM(u(e.clientX,e.clientY))&&Zt(e))),a.onTouchEnd(this.DM),n.getResultTable().setMouseInteractions(!0),this.setPosition(this.ca)}setPosition(t){return this.ca=t,this.Ux.setPosition(t),this.L.emit("positionChange",this,this.ca),this}getPosition(){return this.ca}onPositionChange(t){return this.L.on("positionChange",t)}offPositionChange(t){return this.L.off(t,"positionChange")}setPointMarkerVisibility(t){return this._M=t,this.Ts.vs(),this}getPointMarkerVisibility(){return this._M}setResultTableVisibility(t){return this.wM=t,this.Ts.vs(),this}getResultTableVisibility(){return this.wM}setMouseInteractions(t){return this.Lo=t,this.Ux.getPointMarker().setMouseInteractions(t),this.Ux.getResultTable().setMouseInteractions(t),this}getMouseInteractions(){return this.Lo}setAutoFitStrategy(t){return this.Ux.setAutoFitStrategy(t),this}getAutoFitStrategy(){return this.Ux.getAutoFitStrategy()}isAttached(){return!0}Fe(){const t=this.isAttached();return uu(this._M,this.CM,this.kM)?this.Ux.setPointMarkerVisible(!0):this.Ux.setPointMarkerVisible(!1),t&&uu(this.wM,this.CM,this.kM)?this.Ux.setResultTableVisible(!0):this.Ux.setResultTableVisible(!1),this.Ux.Fe(),this}Ds(){return this.Ux.Ds(),this}pointAt(t){return this.Ux.pointAt(t),this}dispose(){return this.Xi||(this.Xi=!0,this.BM(this),this.Ux.dispose(),this.L.emit("dispose")),this}isDisposed(){return this.Xi}setVisible(t){const e=this.ji!==t;return this.ji=t,this.Ux.setVisible(t),e&&this.L.emit("visibleStateChanged",this,this.ji),this}getVisible(){return this.ji}onVisibleStateChanged(t){return this.L.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.L.off(t,"visibleStateChanged")}setPointMarker(t){return this.Ux.setPointMarker(t),this}getPointMarker(){return this.Ux.getPointMarker()}setResultTable(t){return this.Ux.setResultTable(t),this}getResultTable(){return this.Ux.getResultTable()}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this._u=t,this.Ts.vs(),this}getDraggingMode(){return this._u}}class fu extends du{constructor(t,i,s,r,n,o,h){super(t,i,Bi(s.ft,r.ft),n.lm(t,i,s,r,h),o,h),this.LM=e.UIVisibilityModes.always,this.RM=e.UIVisibilityModes.always,this.EM=e.UIVisibilityModes.always,this.zM=e.UIVisibilityModes.always,this.gridStrokeStyleX=this.Ux.getGridStrokeXStyle(),this.gridStrokeStyleY=this.Ux.getGridStrokeYStyle(),this.Ts=t,this.axisX=s,this.axisY=r,this.BM=o;const a=this.Ux.getTickMarkerX().setMouseInteractions(!0);a.onMouseEnter(((t,i)=>this.TM(t,i,e.UIDraggingModes.onlyHorizontal))),a.onMouseLeave(this.FM),a.onMouseDragStart(this.IM),a.onMouseDrag(((t,i)=>this.PM(u(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&Zt(i))),a.onMouseDragStop(this.DM),a.onTouchStart(this.IM),a.onTouchMove(((t,i)=>this.PM(u(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&Zt(i)));const l=this.Ux.getTickMarkerY().setMouseInteractions(!0);l.onMouseEnter(((t,i)=>this.TM(t,i,e.UIDraggingModes.onlyVertical))),l.onMouseLeave(this.FM),l.onMouseDragStart(this.IM),l.onMouseDrag(((t,i)=>this.PM(u(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&Zt(i))),l.onMouseDragStop(this.DM),l.onTouchStart(this.IM),l.onTouchMove(((t,i)=>this.PM(u(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&Zt(i)))}Fe(){const t=this.isAttached();return this.ji&&t&&uu(this.EM,this.CM,this.kM)?this.Ux.setTickMarkerXVisible(!0):this.Ux.setTickMarkerXVisible(!1),this.ji&&t&&uu(this.zM,this.CM,this.kM)?this.Ux.setTickMarkerYVisible(!0):this.Ux.setTickMarkerYVisible(!1),this.Ux.setGridStrokeXStyle(this.ji&&t&&uu(this.LM,this.CM,this.kM)?this.gridStrokeStyleX:ot),this.Ux.setGridStrokeYStyle(this.ji&&t&&uu(this.RM,this.CM,this.kM)?this.gridStrokeStyleY:ot),super.Fe()}setGridStrokeXVisibility(t){return this.LM=t,this.Ts.vs(),this}getGridStrokeXVisibility(){return this.LM}setGridStrokeYVisibility(t){return this.RM=t,this.Ts.vs(),this}getGridStrokeYVisibility(){return this.RM}setTickMarkerXVisibility(t){return this.EM=t,this.Ts.vs(),this}getTickMarkerXVisibility(){return this.EM}setTickMarkerYVisibility(t){return this.zM=t,this.Ts.vs(),this}getTickMarkerYVisibility(){return this.zM}setGridStrokeXCut(t){return this.Ux.setGridStrokeXCut(t),this}getGridStrokeXCut(){return this.Ux.getGridStrokeXCut()}setGridStrokeYCut(t){return this.Ux.setGridStrokeYCut(t),this}getGridStrokeYCut(){return this.Ux.getGridStrokeYCut()}setGridStrokeXStyle(t){return this.gridStrokeStyleX="function"==typeof t?t(this.gridStrokeStyleX):t,this}getGridStrokeXStyle(){return this.Ux.getGridStrokeXStyle()}setGridStrokeYStyle(t){return this.gridStrokeStyleY="function"==typeof t?t(this.gridStrokeStyleY):t,this}getGridStrokeYStyle(){return this.Ux.getGridStrokeYStyle()}setTickMarkerX(t){return this.Ux.setTickMarkerX(t),this}getTickMarkerX(){return this.Ux.getTickMarkerX()}setTickMarkerY(t){return this.Ux.setTickMarkerY(t),this}getTickMarkerY(){return this.Ux.getTickMarkerY()}setMouseInteractions(t){return super.setMouseInteractions(t),this.Ux.getTickMarkerX().setMouseInteractions(t),this.Ux.getTickMarkerY().setMouseInteractions(t),this}}class gu extends fu{}class mu extends gu{constructor(t,e,i,s,r,n){super(t,e,i.axisX,i.axisY,s,r,n),this.VM=!1,this.Ts=t,this.owningSeries=i}setPosition(t){return super.setPosition(t),this.VM=!1,this.Ts.vs(),this}Ds(){if(!this.VM){const t=this.owningSeries.solveNearestFromScreen(dt(this.ca,this.scale,this.Ts.cs.ft));t?(this.ca=dt(t.location,this.owningSeries.scale,this.scale),this.Ux.pointAt(t),this.VM=!0):this.Ux.setPosition(this.ca)}return super.Ds()}isAttached(){return this.VM}}class yu extends Gl{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,a,l),this.OM=[],this.addMarker=(t=lu)=>{const e=new mu(this.NM(),this.Ki.uiScale,this,t,this.removeMarker,this.ts);return this.OM.push(e),e},this.removeMarker=t=>{const e=this.OM.indexOf(t);-1!==e&&this.OM.splice(e,1)},this.ss=new Map,this.chart=t,this.Ts=i,this.axisX=s,this.axisY=r,this.axisXAttachHandler=n,this.axisYAttachHandler=o,this.NM=h,this.scale=Bi(s.ft,r.ft),this.GM=t.WM,t.WM+=1,this.UM(this.scale),this.attacheAxis(),this.onMouseEnter(this.chart.YM),this.onMouseLeave(this.chart.HM),this.onMouseWheel(this.chart.eS),this.onMouseDragStart(this.chart.$M),this.onMouseDrag(this.chart.hS),this.onMouseDragStop(this.chart.XM),this.onTouchStart(this.chart.rS.onTouchStart),this.onTouchMove(this.chart.rS.onTouchMove),this.onTouchEnd(this.chart.rS.onTouchEnd)}get xAxis(){return this.axisX}get yAxis(){return this.axisY}attacheAxis(){this.jM=this.axisXAttachHandler(this),this.ZM=this.axisYAttachHandler(this)}Fe(){super.Fe();for(let t=0;t{e.Ko(this.GM)})),this.Ki.cs.vs(),this}dispose(){return super.dispose(),this.OM.slice().forEach((t=>t.dispose())),this.jM(this),this.ZM(this),this}QM(){for(let t=0;t{const r=t.length;let n=0;if(void 0!==e){const r=i-e;if(r>0){const e=t.slice(n,r);n+=r,s(e,!0)}}for(;nt))=>{const i=[];let s;for(let r=0;r{const s=void 0!==i?i:0,r=new Array(t.length);for(let i=0;i{const r=e.getIcon();return r?t.addRow(r,e.getName()):t.addRow(e.getName()),t.addRow("X","",e.axisX.formatValue(i)).addRow("Y","",e.axisY.formatValue(s))};class vu extends yu{constructor(t,i,s,r,n,o,h,a,l,u,c){super(t,i,s,r,n,o,h,a,u,c),this.JM=[],this.yu=[],this.KM=0,this.Zi=!1,this.$i=e.HighlightModes.onHover,this.Om=Au,this.Ki.cs.Gn(ah.mf),this.qM=l}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.KM=void 0!==e&&e>0?e:0,this.Ts.vs(),this}add(t){if(0!==this.JM.length&&this.Ki.cs.Gn(ah.xf),Array.isArray(t)?this.t_(t):this.t_([t]),this.yu.length>0){const t=this.yu[this.yu.length-1];this.i_={x:t.x,y:t.y}}return this}addArrayX(t,e=1,i){let s=i;return s||(s=this.i_?this.i_.y+e:0),this.add(((t,e=1,i)=>{const s=void 0!==i?i:0,r=new Array(t.length);for(let i=0;i{const i=new Array(t.length);for(let s=0;st+e.al()+e.ll()),this.yu.length)}clear(){this.s_=void 0;for(let t=0;t0&&this.getVisible()}getXMax(){return this.qM.getXMax(this.JM,this.s_)||0}getXMin(){return this.qM.getXMin(this.JM,this.s_)||0}getYMax(){return this.qM.getYMax(this.JM,this.s_)||0}getYMin(){return this.qM.getYMin(this.JM,this.s_)||0}Mr(){const t=u(0,0);for(const e of this.JM)t.x=Math.max(t.x,e.xl()),t.y=Math.max(t.y,e.bl());return t}e_(t,e,i,s){this.qM.e_(t,e,i,s,this.scale,(t=>{}))}aS(){super.aS();const t=this.JM.length;this.h_&&this.e_(this.JM,this.getPointAmount(),this.h_,this.KM),t!==this.JM.length&&this.QM()}Fe(){super.Fe();const t=this.getBoundaries();this.yu.length>0&&(this.r_(this.yu),this.yu=[]);for(const e of this.JM)e.Ho(t);return super.Fe()}Ay(){super.Ay(),this.s_=void 0,this.yu.length=0}t_(t){0!==t.length&&(this.s_?this.s_=Je(this.s_,Ze(t)):this.s_=Ze(t),this.L.emit("dataAdd",this,t,this.s_),this.yu=ne(this.yu,t,{canReturnB:!1}),this.Ts.vs())}n_(){return xu(this.JM)}o_(t){return this.L.on("dataAdd",t)}a_(t){return this.L.off(t)}l_(t){return this.L.on("dataClear",t)}u_(t){return this.L.off(t)}}const bu=(t,e,i,s)=>{let r,n,o=Number.MAX_VALUE;for(let h=0;h{const e=this.c_.findIndex((e=>e===t));e>=0&&this.c_.splice(e,1),this.f_=!0,this.d_=void 0,this.Ts.vs()},this.Zb=()=>{this.d_=void 0,this.f_=!0,this.Ki.cs.vs()},this.Qb=()=>{this.f_=!0,this.Ki.cs.vs()},this.Jb=()=>{this.d_=void 0,this.f_=!0,this.chart.cs.vs()},this.Kb=(t,e)=>{this.setMouseInteractions(e)},this.A_=t=>this.getMouseInteractions()}Fe(){super.Fe(),this.f_&&(this.g_(this.c_),this.f_=!1)}clear(){return this.c_.slice().forEach(wt),this.c_.length=0,this.f_=!0,this.d_=void 0,this.Ts.vs(),this}p_(t,e){void 0!==e?this.c_.splice(e,0,t):this.c_.push(t),this.f_=!0,this.m_&&this.m_(t),t.onMouseEnter(((t,e)=>this.Ct(t,e))),t.onMouseLeave(((t,e)=>this.kt(t,e))),t.onMouseClick(((t,e)=>this.Tt(t,e))),t.onMouseDoubleClick(((t,e)=>this.Ft(t,e))),t.onMouseDown(((t,e)=>this.It(t,e))),t.onMouseUp(((t,e)=>this.Pt(t,e))),t.onMouseMove(((t,e)=>this.Dt(t,e))),t.onMouseDragStart(((t,e,i)=>this.Lt(t,e,i))),t.onMouseDrag(((t,e,i,s,r)=>this.Bt(t,e,i,s,r))),t.onMouseDragStop(((t,e,i,s)=>this.Rt(t,e,i,s))),t.onMouseWheel(((t,e)=>this.Et(t,e))),t.onTouchStart(((t,e)=>this.zt(t,e))),t.onTouchMove(((t,e)=>this.Vt(t,e))),t.onTouchEnd(((t,e)=>this.Ot(t,e))),this.Ts.vs()}qy(){return this.iS&&this.c_.length>0&&this.getVisible()}setDefaultStyle(t){this.m_=t,this.c_.forEach(t),t(this.y_);for(let t=0;tt.getVisible()&&t.getIsUnderMouse())):this.c_.filter((t=>t.getVisible())),this.v_,Xe);if(void 0!==i)return{location:dt(i[0],this.Ts.cs.ft,this.scale),scale:this.scale,resultTableContent:this.Om(new la,this,i[1]).Qu(),owner:this,fillStyle:i[1].getDominantStyle(),figure:i[1]}}solveNearestFromScreen(t){return this.$c(rh(t,this.Ki.cs),!1)}getXMax(){return this.d_||(this.d_=this.x_()),this.d_.max.x}getXMin(){return this.d_||(this.d_=this.x_()),this.d_.min.x}getYMax(){return this.d_||(this.d_=this.x_()),this.d_.max.y}getYMin(){return this.d_||(this.d_=this.x_()),this.d_.min.y}Mr(){return u(0,0)}x_(){const t=m(c(Le,Le),c(Ve,Ve));for(let e=0;e0?this.c_[0].getDominantStyle():this.y_.getDominantStyle()})}}const Eu=(t,e,i)=>t.addRow(e.getName()).addRow("Lower extreme","",i.lowerExtreme.toFixed(2)).addRow("Lower quartile","",i.lowerQuartile.toFixed(2)).addRow("Median","",i.median.toFixed(2)).addRow("Upper quartile","",i.upperQuartile.toFixed(2)).addRow("Upper extreme","",i.upperExtreme.toFixed(2));class Tu extends Mu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,l,u),this.Ms="Box Series",this.Om=Eu,this.b_=Ce(),this.v_=t=>dt(this.Fs.toPoint((t.start+t.end)/2,t.median),this.scale,this.Ts.cs.ft),this.Ki.cs.Gn(ah.Sf),this.Fs=a,this.y_=new tu(this.Ts,this.scale,this.tM,kt,kt,kt,kt,(t=>!1),this.Fs,0,0,0,0,0,0,0,this.ts).dispose(),this.M_=new Ha((()=>{const t=this.Ts.Rg(this.scale);return this.fs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ee(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Vr();return i.zg(e.start,e.end),i}))))),this.__=new Ha((()=>{const t=this.b_.wt(this.Ts.$x(this.scale));return this.fs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Vr();return i.Sl(e.vertices),this.b_.Nt(i,e.figure),i})))),(()=>{this.b_.Gt()}),((t,e)=>{this.ps(e)}))}UM(t){if(!(t instanceof _i||t instanceof Pi))throw new Error("BoxSeries only supports Linear Axes")}g_(t){const e=this.__.gy(),i=this.M_.gy();t.forEach((t=>{if(!t.getVisible())return;const s=this.Fs.toPoint((t.start+t.end-t.iM*(t.end-t.start))/2,t.lowerQuartile),r=this.Fs.toPoint((t.end-t.start)*t.iM,t.upperQuartile-t.lowerQuartile),n=this.Fs.toPoint((t.start+t.end)/2,t.lowerQuartile),o=this.Fs.toPoint((t.start+t.end)/2,t.lowerExtreme),h=this.Fs.toPoint((t.start+t.end)/2,t.upperQuartile),a=this.Fs.toPoint((t.start+t.end)/2,t.upperExtreme),l=this.Fs.toPoint((t.start+t.end-t.sM*(t.end-t.start))/2,t.lowerExtreme),u=this.Fs.toPoint((t.start+t.end+t.sM*(t.end-t.start))/2,t.lowerExtreme),c=this.Fs.toPoint((t.start+t.end-t.sM*(t.end-t.start))/2,t.upperExtreme),d=this.Fs.toPoint((t.start+t.end+t.sM*(t.end-t.start))/2,t.upperExtreme),f=this.Fs.toPoint((t.start+t.end-t.iM*(t.end-t.start))/2,t.median),g=this.Fs.toPoint((t.start+t.end+t.iM*(t.end-t.start))/2,t.median);e.add({Go:t.Go,vertices:[{x:s.x,y:s.y},{x:s.x,y:s.y+r.y},{x:s.x+r.x,y:s.y+r.y},{x:s.x+r.x,y:s.y}],figure:t},{fillStyle:t.eM,strokeStyle:t.hM}),i.add({Go:0,start:n,end:o,figure:t},{strokeStyle:t.uu}),i.add({Go:0,start:h,end:a,figure:t},{strokeStyle:t.uu}),i.add({Go:0,start:l,end:u,figure:t},{strokeStyle:t.uu}),i.add({Go:0,start:c,end:d,figure:t},{strokeStyle:t.uu}),i.add({Go:0,start:f,end:g,figure:t},{strokeStyle:t.rM})})),e.finishPlot(),i.finishPlot()}add(t){const e=new tu(this.Ts,this.scale,this.tM,this.Zb,this.Qb,this.Jb,this.Kb,this.A_,this.Fs,t.start,t.end,t.lowerExtreme,t.lowerQuartile,t.median,t.upperQuartile,t.upperExtreme,this.ts);return this.p_(e),this.f_=!0,this.Ki.cs.vs(),e}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}}class wu extends Ql{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.dimensions={x:0,y:0,radiusX:0,radiusY:0},this.Ha=m(u(0,0),u(0,0)),this.Ts=t,this.scale=e,this.be=fe(a.ellipseSeriesFillStyle,l),this.Me=fe(a.ellipseSeriesStrokeStyle,l)}getBoundaries(){return this.Ha}setDimensions(t){return this.dimensions=t,this.Ha=m(u(t.x-t.radiusX,t.y-t.radiusY),u(t.x+t.radiusX,t.y+t.radiusY)),this.Zb(),this.Ts.vs(),this}getDimensions(){return this.dimensions}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Qb(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Qb(),this}getStrokeStyle(){return this.Me}getDominantStyle(){return this.be}}class ku extends Mu{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.Ms="Ellipse Series",this.Om=(t,e,i)=>t.addRow(e.Ms).addRow("X","",e.axisX.formatValue(i.getDimensions().x)).addRow("Y","",e.axisY.formatValue(i.getDimensions().y)).addRow("Radius X","",e.axisX.formatValue(i.getDimensions().radiusX)).addRow("Radius Y","",e.axisY.formatValue(i.getDimensions().radiusY)),this.b_=Ce(),this.v_=t=>{const e=t.getDimensions(),i=u(e.x,e.y);return dt(i,this.scale,this.Ts.cs.ft)},this.Ki.cs.Gn(ah.Sf),this.w_=c,this.y_=new wu(this.Ts,this.scale,kt,kt,kt,kt,kt,(t=>!1),this.ts,this.w_).dispose(),this.__=new Ha((()=>{const t=this.b_.wt(this.Ts.$x(this.scale));return this.fs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Vr();return i.Sl(e.vertices),this.b_.Nt(i,e.figure),i})))),(()=>{this.b_.Gt()}),((t,e)=>{this.ps(e)}))}UM(t){if(!(t instanceof _i||t instanceof Pi))throw new Error("EllipseSeries only supports Linear Axes")}g_(t){const e=this.__.gy();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s=[],r=void 0!==i.drawSteps?i.drawSteps:72;for(let t=0;t<=r;t+=1){const e=t/r*2*Math.PI,n=i.x+i.radiusX*Math.cos(e),o=i.y+i.radiusY*Math.sin(e);s.push({x:n,y:o})}const n=t.getFillStyle(),o=t.getStrokeStyle();e.add({Go:t.Go,vertices:s,figure:t},{fillStyle:n,strokeStyle:o})})),e.finishPlot()}add(t){const e=new wu(this.Ts,this.scale,this.tM,this.Zb,this.Qb,this.Jb,this.Kb,this.A_,this.ts,this.w_).setDimensions(t);return this.p_(e),this.f_=!0,this.Ki.cs.vs(),e}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}}class Cu extends Ql{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.C_=[],this.Ha=_e,this.Ts=t,this.scale=e,this.be=fe(a.polygonSeriesFillStyle,l),this.Me=fe(a.polygonSeriesStrokeStyle,l)}getBoundaries(){return this.Ha}setDimensions(t){return this.C_=t,this.Ha=Ze(this.C_),this.Zb(),this.Ts.vs(),this}getDimensions(){return this.C_}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Qb(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Qb(),this}getStrokeStyle(){return this.Me}getDominantStyle(){return this.be}}class Ru extends Mu{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.Ms="Polygon Series",this.Om=(t,e,i)=>t.addRow(e.getName()),this.b_=Ce(),this.v_=t=>{const e=t.getBoundaries(),i=u((e.min.x+e.max.x)/2,(e.min.y+e.max.y)/2);return dt(i,this.scale,this.Ts.cs.ft)},this.Ki.cs.Gn(ah.Sf),this.w_=c,this.y_=new Cu(this.Ts,this.scale,kt,kt,kt,kt,kt,(t=>!1),this.ts,this.w_).dispose(),this.__=new Ha((()=>{const t=this.b_.wt(this.Ts.$x(this.scale));return this.fs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Vr();return i.Sl(e.vertices),this.b_.Nt(i,e.figure),i})))),(()=>{this.b_.Gt()}),((t,e)=>{this.ps(e)}))}UM(t){}g_(t){const e=this.__.gy();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s=t.getFillStyle(),r=t.getStrokeStyle();e.add({Go:t.Go,vertices:i,figure:t},{fillStyle:s,strokeStyle:r})})),e.finishPlot()}add(t){const e=new Cu(this.Ts,this.scale,this.tM,this.Zb,this.Qb,this.Jb,this.Kb,this.A_,this.ts,this.w_).setDimensions(t);return this.p_(e),this.f_=!0,this.Ki.cs.vs(),e}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}}class Iu extends Ql{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.k_={x:0,y:0,width:0,height:0},this.T_={x1:0,y1:0,x2:0,y2:0},this.Ha=m(u(0,0),u(0,0)),this.be=fe(a.rectangleSeriesFillStyle,l),this.Ts=t,this.scale=e,this.Me=fe(a.rectangleSeriesStrokeStyle,l)}getBoundaries(){return this.Ha}setDimensions(t){return"x"in t?(this.k_=t,this.T_={x1:t.x,y1:t.y,x2:t.x+t.width,y2:t.y+t.height}):(this.T_=t,this.k_={x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}),this.Ha=Ze([this.k_,u(this.k_.x+this.k_.width,this.k_.y+this.k_.height)]),this.Zb(),this.Ts.vs(),this}getDimensionsPositionAndSize(){return this.k_}getDimensionsTwoPoints(){return this.T_}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Qb(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Qb(),this}getStrokeStyle(){return this.Me}getDominantStyle(){return this.be}}class Fu extends Mu{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.Ms="Rectangle Series",this.Om=(t,e,i)=>{const s=i.getDimensionsPositionAndSize();return t.addRow(e.Ms).addRow("X","",e.axisX.formatValue(s.x)).addRow("Y","",e.axisX.formatValue(s.y)).addRow("Width","",e.axisX.formatValue(s.width)).addRow("Height","",e.axisX.formatValue(s.height))},this.b_=Ce(),this.v_=t=>{const e=t.getDimensionsPositionAndSize(),i=u(e.x+e.width/2,e.y+e.height/2);return dt(i,this.scale,this.Ts.cs.ft)},this.Ki.cs.Gn(ah.Sf),this.w_=c,this.y_=new Iu(this.Ts,this.scale,kt,kt,kt,kt,kt,(t=>!1),this.ts,this.w_).dispose(),this.__=new Ha((()=>{const t=this.b_.wt(this.Ts.$x(this.scale));return this.fs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Vr();return i.Sl(e.vertices),this.b_.Nt(i,e.figure),i})))),(()=>{this.b_.Gt()}),((t,e)=>{this.ps(e)}))}UM(t){}g_(t){const e=this.__.gy();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensionsTwoPoints(),s=[{x:i.x1,y:i.y1},{x:i.x1,y:i.y2},{x:i.x2,y:i.y2},{x:i.x2,y:i.y1}],r=t.getFillStyle(),n=t.getStrokeStyle();e.add({Go:t.Go,vertices:s,figure:t},{fillStyle:r,strokeStyle:n})})),e.finishPlot()}add(t){const e=new Iu(this.Ts,this.scale,this.tM,this.Zb,this.Qb,this.Jb,this.Kb,this.A_,this.ts,this.w_).setDimensions(t);return this.p_(e),this.f_=!0,this.Ki.cs.vs(),e}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}}class Du extends Ql{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.dimensions={startX:0,startY:0,endX:0,endY:0},this.Ha=m(u(0,0),u(0,0)),this.ts=a,this.Ts=t,this.scale=e,this.Me=fe(a.segmentSeriesStrokeStyle,l)}getBoundaries(){return this.Ha}setDimensions(t){return this.dimensions=t,this.Ha=m(u(Math.min(t.startX,t.endX),Math.min(t.startY,t.endY)),u(Math.max(t.startX,t.endX),Math.max(t.startY,t.endY))),this.Zb(),this.Ts.vs(),this}getDimensions(){return this.dimensions}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Qb(),this}getStrokeStyle(){return this.Me}getDominantStyle(){const t=this.Me;return t!==ot?t.getFillStyle():z}}class Lu extends Mu{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.Ms="Segment Series",this.Om=(t,e,i)=>t.addRow(e.Ms).addRow("Start",e.axisX.formatValue(i.getDimensions().startX),",",e.axisY.formatValue(i.getDimensions().startY)).addRow("End",e.axisX.formatValue(i.getDimensions().endX),",",e.axisY.formatValue(i.getDimensions().endY)),this.F_=Ce(),this.v_=t=>{const e=t.getDimensions(),i=u((e.startX+e.endX)/2,(e.startY+e.endY)/2);return dt(i,this.scale,this.Ts.cs.ft)},this.Ki.cs.Gn(ah.Sf),this.w_=c,this.y_=new Du(this.Ts,this.scale,kt,kt,kt,kt,kt,(t=>!1),this.ts,this.w_).dispose(),this.M_=new Ha((()=>{const t=this.F_.wt(this.Ts.Rg(this.scale));return this.fs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ee(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Vr();return i.zg(e.start,e.end),this.F_.Nt(i,e.figure),i})))),(()=>{this.F_.Gt()}),((t,e)=>{this.ps(e)}))}UM(t){}g_(t){const e=this.M_.gy();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s={x:i.startX,y:i.startY},r={x:i.endX,y:i.endY},n=t.getStrokeStyle();e.add({Go:t.Go,start:s,end:r,figure:t},{strokeStyle:n})})),e.finishPlot()}add(t){const e=new Du(this.Ts,this.scale,this.tM,this.Zb,this.Qb,this.Jb,this.Kb,this.A_,this.ts,this.w_).setDimensions(t);return this.p_(e),this.f_=!0,this.Ki.cs.vs(),e}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}}const Vu=(t,e,i)=>{const s=e.getIcon();return s?t.addRow(s,e.getName()):t.addRow(e.getName()),t.addRow("X:","",e.axisX.formatValue(i.x)).addRow("Y:","",e.axisY.formatValue(i.y)).addRow("Intensity:","",i.intensity.toFixed(1))};class _u extends yu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,l,u),this.Ms="Heatmap Grid Series",this.Om=Vu,this.Rb=!1,this.gv={},this.Ki.cs.Gn(ah.yf),this.I_=a,this.ts=l;const d=c;this.be=fe(l.heatmapGridSeriesFillStyle,d),this.pv=fe(this.ts.heatmapGridSeriesWireframeStyle,d);const f={heatmapDataType:"intensity",dataOrder:a.dataOrder||"columns",columns:a.columns,rows:a.rows};this.Yn=f,this.P_=this.Ts.D_(this.scale,[],f).ke(this.be).mv(this.pv).ds(this.getHighlight()),this.fs(this.P_),a.start&&this.setStart(a.start),a.end&&this.setEnd(a.end),a.step&&this.setStep(a.step),this.setHighlightOnHover(!1)}Sv(){const t=this.gv.start||{x:0,y:0};let e;e=this.gv.end?{x:(this.gv.end.x-t.x)/this.Yn.columns,y:(this.gv.end.y-t.y)/this.Yn.rows}:this.gv.step?this.gv.step:{x:1,y:1},this.P_.vv(t,e),this.Ki.cs.vs()}setStart(t){return this.gv.start=t,this.Sv(),this}getStart(){return this.P_.xv().start}setStep(t){return this.gv.step=t,this.Sv(),this}getStep(){return this.P_.xv().step}setEnd(t){return this.gv.end=t,this.Sv(),this}getEnd(){return this.P_.xv().end}clear(){return this.P_.Gt(),this.Ts.vs(),this.L.emit("dataClear",this),this}setWireframeStyle(t){return this.pv="function"==typeof t?t(this.pv):t,this.P_.mv(this.pv),this.Ts.vs(),this.L.emit("styleChange",this),this}getWireframeStyle(){return this.pv}setCursorInterpolationEnabled(t){return this.Rb=t,this.Ts.cs.vs(),this}getCursorInterpolationEnabled(){return this.Rb}setCursorEnabled(t){return super.setCursorEnabled(t)}setIntensityInterpolation(t){return t=t||"disabled",this.P_.Mv(t),this.Ts.vs(),this.L.emit("styleChange",this),this}getIntensityInterpolation(){return this.P_._v()}qy(){return this.iS&&this.getVisible()}Wd(){return ue(this.be)}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{fill:this.be}),this}B_(t){this.P_.B_().forEach((e=>{t.P_.wv(e)}))}u_(t){return this.L.off(t)}l_(t){return this.L.on("dataClear",t)}L_(t){return this.L.on("styleChange",t)}R_(t){return this.L.off(t)}$c(t,e,i=this.Rb){const s=dt(t,this.Ts.cs.ft,this.scale),r=e?this.P_.getIsUnderMouse()?this.P_:void 0:this.P_;if(!r)return;const n=i?r.Vb(s):r.$c(s);if(n){const t={x:n.x,y:n.y,column:n.column,row:n.column,intensity:n.cellValue};return{location:t,scale:this.scale,resultTableContent:this.Om(new la,this,t).Qu(),owner:this}}}solveNearestFromScreen(t,e=this.Rb){return this.$c(rh(t,this.Ki.cs),!1,e)}getXMax(){const t=this.P_;return t?t.bt():void 0}getXMin(){const t=this.P_;return t?t.xt():void 0}getYMax(){const t=this.P_;return t?t._t():void 0}getYMin(){const t=this.P_;return t?t.Mt():void 0}Mr(){const t=u(0,0);return t.x=Math.max(t.x,this.P_.xl()),t.y=Math.max(t.y,this.P_.bl()),t}UM(t){if(!(t instanceof _i))throw new Error("HeatmapGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof _i&&t.wi())throw new Error("HeatmapGridSeries can not be attached to a high precision Axis.")}Pe(t,e){t.ds(e),this.Ts.vs()}Fe(){return super.Fe(),this.P_.Ho(this.getBoundaries()),this}}class Pu extends _u{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,a,l,u,c),this.fS=!1,this.Om=Vu}invalidateIntensityValues(t){if(this.fS&&this.Ki.cs.Gn(ah.xf),Array.isArray(t)){if(0===t.length)return this;const e={x:t.length,y:t[0].length,columns:"columns"===this.Yn.dataOrder?t.length:t[0].length,rows:"rows"===this.Yn.dataOrder?t.length:t[0].length},i="columns"===this.Yn.dataOrder?this.Yn.columns:this.Yn.rows,s="columns"===this.Yn.dataOrder?this.Yn.rows:this.Yn.columns;if(e.x>i||e.y>s){if(!0===this.chart.dA.$n){const t=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.Yn.columns}x${this.Yn.rows}, input ${e.columns}x${e.rows}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;bt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.dA.$n){const i=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.Yn.columns}x${this.Yn.rows}, input ${e.columns}x${e.rows} starting at [${t.iColumn},${t.iRow}].\nOut of bounds data will be automatically clipped. This can result in sub-optimal performance.`;bt.console.warn(i)}const i=Math.max(s-o,0),r=e.primary-i,a=Math.max(n-h,0),l=[];for(let e=0;e0?-a:void 0);t={iColumn:t.iColumn,iRow:t.iRow,values:l}}this.P_.wv({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:r,values:t.values})}return this.L.emit("invalidateIntensity",this,t),this.Ts.vs(),this.fS=!0,this}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.P_.ke(this.be),this.L.emit("styleChange",this),this.Ts.vs(),this}getFillStyle(){return this.be}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}E_(t){return this.L.on("invalidateIntensity",t)}z_(t){return this.L.off(t)}}class Bu extends yu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,l,u),this.Ms="Scrolling Heatmap Grid Series",this.Om=Vu,this.Rb=!1,this.gv={},this.Ki.cs.Gn(ah.yf),this.Ki.cs.Gn(ah.xf);const d=c;this.be=fe(l.heatmapScrollingGridSeriesFillStyle,d),this.pv=fe(this.ts.heatmapScrollingGridSeriesWireframeStyle,d);const f={scrollDimension:"columns",heatmapDataType:"intensity",...a};this.Yn=f,this.V_=this.Ts.O_(this.scale,[],f).ke(this.be).mv(this.pv).ds(this.getHighlight()),this.fs(this.V_),a.start&&this.setStart(a.start),a.step&&this.setStep(a.step),this.setHighlightOnHover(!1)}Sv(){const t=this.gv.start||{x:0,y:0};let e;e=this.gv.step?this.gv.step:{x:1,y:1},this.V_.vv(t,e),this.Ki.cs.vs()}setStart(t){return this.gv.start=t,this.Sv(),this}getStart(){return this.V_.xv().start}setStep(t){return this.gv.step=t,this.Sv(),this}getStep(){return this.V_.xv().step}clear(){return this.V_.Gt(),this.Ts.vs(),this}setWireframeStyle(t){return this.pv="function"==typeof t?t(this.pv):t,this.V_.mv(this.pv),this.Ts.vs(),this}getWireframeStyle(){return this.pv}setPixelInterpolationMode(t){return t=t||"disabled",this.V_.Mv(t),this.Ts.vs(),this}getPixelInterpolationMode(){return this.V_._v()}setCursorInterpolationEnabled(t){return this.Rb=t,this.Ts.cs.vs(),this}getCursorInterpolationEnabled(){return this.Rb}setCursorEnabled(t){return super.setCursorEnabled(t)}setDataCleaning(t){return this.V_.vu(t),this.Ts.vs(),this}qy(){return this.iS&&this.getVisible()}Wd(){return ue(this.be)}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{fill:this.be}),this}ke(t){return this.be="function"==typeof t?t(this.be):t,this.V_.ke(this.be),this.Ts.vs(),this}$c(t,e,i=this.Rb){const s=dt(t,this.Ts.cs.ft,this.scale),r=e?this.V_.getIsUnderMouse()?this.V_:void 0:this.V_;if(!r)return;const n=i?r.Vb(s):r.$c(s);return n?Ta(n,this.scale,this.Om(new la,this,{x:n.x,y:n.y,column:n.column,row:n.column,intensity:n.cellValue}).Qu(),this):void 0}solveNearestFromScreen(t,e=this.Rb){return this.$c(rh(t,this.Ki.cs),!1,e)}UM(t){if(!(t instanceof _i))throw new Error("HeatmapScrollingGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof _i&&t.wi())throw new Error("HeatmapScrollingGridSeries can not be attached to a high precision Axis.")}getXMax(){return this.V_.bt()||0}getXMin(){return this.V_.xt()||0}getYMax(){return this.V_._t()||0}getYMin(){return this.V_.Mt()||0}Mr(){const t=u(0,0);return t.x=Math.max(t.x,this.V_.xl()),t.y=Math.max(t.y,this.V_.bl()),t}Pe(t,e){t.ds(e),this.Ts.vs()}}class zu extends Bu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,a,l,u,c),this.Om=Vu}addIntensityValues(t){if(0===t.length||0===t[0].length)return this;const e=t.length,i=t[0].length,s=("columns"===this.Yn.scrollDimension?t.length:t[0].length,"rows"===this.Yn.scrollDimension?t.length:t[0].length,0+i-1),r=this.Yn.resolution-1;if(s>r){if(!0===this.chart.dA.$n){const t=`HeatmapScrollingGridSeries.addIntensityValues intensity matrix overflow.\nGrid resolution: ${this.Yn.resolution}, input ${e}x${i}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;bt.console.warn(t)}const s=[];for(let i=0;it.slice()},this.Rb=!0,this.U_=[],this.Y_=[],this.H_=!1,this.Wd=()=>ue(this.X_)||ue(this.j_),this.Z_=t=>{const e=t.length;if(this.JM.length>0){const i=this.JM.length-1,s=this.JM[i];if(e>0){const[e,i]=s.il(),[r,n]=s.tl();if((r?e.length+r.length:e.length)>=this.h_){const o=r&&r.length>0?r[r.length-1]:e[e.length-1],h=n&&n.length>0?n[n.length-1]:i[e.length-1],a=(o.x+t[0].position)/2,l=di(a,o,u(t[0].position,t[0].high)).y,c=di(a,h,u(t[0].position,t[0].low)).y,f=d(a,l,c);s.ol(f,m(u(a,c),u(a,l))).Vl(!0),this.Q_([f].concat(t)).El(!0)}else s.ol(t)}}else e>0&&this.Q_(t)},this.J_=t=>{const e=this.U_,i=t.length;if(this.U_.length>0){if(i>0){const i=e[e.length-1],s=i.il(),r=i.tl();if(s.length+r.length>=this.h_){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=di(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.ol(a,m(u(o,h),u(o,h))).Vl(!0),e.push(this.K_([a].concat(t),this.s_).El(!0))}else i.ol(t)}}else i>0&&e.push(this.K_(t))},this.q_=t=>{const e=this.Y_,i=t.length;if(this.Y_.length>0){if(i>0){const i=e[e.length-1],s=i.il(),r=i.tl();if(s.length+r.length>=this.h_){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=di(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.ol(a,m(u(o,h),u(o,h))).Vl(!0),e.push(this.tw([a].concat(t)).El(!0))}else i.ol(t)}}else i>0&&e.push(this.tw(t))},this.iw=(t,e)=>{const i=t.Yb(e);if(i)return[dt(i[0],this.scale,this.Ts.cs.ft),dt(i[1],this.scale,this.Ts.cs.ft)]},this.sw=(t,e)=>{const i=t.ew(e);if(i)return[dt(i[0],this.scale,this.Ts.cs.ft),dt(i[1],this.scale,this.Ts.cs.ft)]}}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.KM=void 0!==e&&e>0?e:0,this.Ts.vs(),this}clear(){for(let t=0;tt+e.al()+e.ll()),this.yu.length)}setCursorInterpolationEnabled(t){return this.Rb=t,this.Ts.cs.vs(),this}getCursorInterpolationEnabled(){return this.Rb}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}setCursorEnabled(t){return super.setCursorEnabled(t)}getCursorResultTableFormatter(){return this.Om}getXMax(){return Ut(this.JM,Lt,Math.max,Bt,this.s_)||0}getXMin(){return Ut(this.JM,Dt,Math.min,Pt,this.s_)||0}getYMax(){return Ut(this.JM,_t,Math.max,Nt,this.s_)||0}getYMin(){return Ut(this.JM,Vt,Math.min,zt,this.s_)||0}Mr(){const t=u(0,0);for(const e of this.JM)t.x=Math.max(t.x,e.xl()),t.y=Math.max(t.y,e.bl());return t}qy(){return this.iS&&this.getPointAmount()>0&&this.getVisible()}UM(t){}t_(t,e,i){this.yu=ne(this.yu,t,{canReturnB:!1}),this.G_=ne(this.G_,e,{canReturnB:!1}),this.W_=ne(this.W_,i,{canReturnB:!1}),this.Ts.vs()}hw(t,e,i,s){this.rw(e,i,s),this.t_(Array.isArray(t)?t:[t],e,i)}rw(t,e,i){const s=Je(Ze(t),Ze(e));this.s_?this.s_=Je(this.s_,s):this.s_=s,i&&(this.s_=Je(this.s_,i))}nw(){const t=this.JM.length,e=Math.min(this.scale.x.getInnerStart(),this.scale.x.getInnerEnd());let i=0;if(t>1)for(let s=0;s0){const r=Math.ceil(i/e),n=t.length-r;if(n>0&&s>0){const e=n-s>0?s:n;if(e>0){for(let i=0;i0?this.JM[this.JM.length-1]:void 0,i=e?e.il()[0].length+(e.tl()[0]?e.tl()[0].length:0):void 0;pu(t,i,this.h_,this.Z_)}aw(t){const e=this.U_.length>0?this.U_[this.U_.length-1].il().length+this.U_[this.U_.length-1].tl().length:void 0;pu(t,e,this.h_,this.J_)}lw(t,e){const i=this.U_.length>0?this.U_[this.U_.length-1].il().length+this.U_[this.U_.length-1].tl().length:void 0;pu(t,i,this.h_,this.J_),pu(e,i,this.h_,this.q_)}Q_(t,e){const i=this.Ts.uw(this.scale).ol(t,e).ke(this.X_).Ll(this.j_).Dl(this.wl).ds(this.getHighlight());return this.JM.push(i),this.fs(i),i}cw(t,e,i){const s=this.Ts.sy(this.scale,void 0,[za.UserSeries]).ol(t,i).setMouseInteractions(!1).Ee(e).ds(this.getHighlight());return this.fs(s),s}K_(t,e){return this.cw(t,this.dw,e)}tw(t,e){return this.cw(t,this.fw,e)}Aw(t){this.X_="function"==typeof t?t(this.X_):t;const e=this.X_;for(let t=0;t0){const t=this.JM.length,e=this.nw();this.e_(this.JM,this.h_,this.KM,e);const i=this.JM.length;this.U_.length>0&&this.e_(this.U_,this.h_,this.KM,e),this.Y_.length>0&&this.e_(this.Y_,this.h_,this.KM,e),t!==i&&this.QM(),this.H_=!0}}Fe(){if(super.Fe(),this.yu.length>0&&(this.ow(this.yu),this.Mw(this.G_,this.W_),this.H_=!0),this.H_){const t=this.getBoundaries();for(const e of this.JM)e.Ho(t);for(const e of this.U_)e.Ho(t);for(const e of this.Y_)e.Ho(t)}}Ay(){this.s_=void 0,this.yu.length=0,this.G_.length=0,this.W_.length=0}$c(t,e,i=this.Rb){const s=((t,e,i)=>{let s,r,n=Number.MAX_VALUE;for(let o=0;ot.getIsUnderMouse())):this.JM,i?this.sw:this.iw);if(void 0!==s&&void 0!==s[0]){const t=dt(s[0][0],this.Ts.cs.ft,this.scale),e=dt(s[0][1],this.Ts.cs.ft,this.scale);return Ta(t,this.scale,this.Om(new la,this,t.x,t.y,e.y).Qu(),this,s[1].zh())}}solveNearestFromScreen(t,e=this.Rb){return this.$c(rh(t,this.Ki.cs),!1,e)}}const Uu=(t,e,i,s,r)=>{const n=e.getIcon();return n?t.addRow(n,e.getName()):t.addRow(e.getName()),t.addRow("Position","",e.axisX.formatValue(i)).addRow("Value","",e.axisY.formatValue(s)).addRow("Base","",e.axisY.formatValue(r))};class Ou extends Nu{constructor(t,e,i,s,r,n,o,h,a=0,l,u){super(t,e,i,s,r,n,o,h,l,u),this.Ms="Area Series",this.Om=Uu,this.Ki.cs.Gn(ah.mf),this._w=a}add(t){0!==this.JM.length&&this.Ki.cs.Gn(ah.xf);const e=Array.isArray(t)?t:[t];if(e.length>0){const t=this.ww(e),[i,s]=this.Cw(t);this.hw(t,i,s,m(u(Le,this._w),u(Ve,this._w)));const r=this.yu[this.yu.length-1];this.i_=r?{position:r.position,high:r.high,low:r.low}:void 0,this.L.emit("dataAdd",this,e,this.s_)}return this}addArrayY(t,e=1,i=0){let s=i;return s||(s=this.i_?this.i_.position+e:0),this.add(Su(t,e,s)),this}o_(t){return this.L.on("dataAdd",t)}a_(t){return this.L.off(t)}l_(t){return this.L.on("dataClear",t)}u_(t){return this.L.off(t)}}class Gu extends Ou{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,a,l,u);const c=t.getSeries().length;this.X_=fe(this.ts.areaSeriesBipolarHighFillStyle,c),this.dw=fe(this.ts.areaSeriesBipolarHighStrokeStyle,c),this.j_=fe(this.ts.areaSeriesBipolarLowFillStyle,c),this.fw=fe(this.ts.areaSeriesBipolarLowStrokeStyle,c)}ww(t){return this.kw(t)}Mw(t,e){return this.lw(t,e)}kw(t){let e=0;const i=[],s=t.length,r=this._w;return s>0&&(this.Tw&&(this.Tw.y<=r&&r<=t[0].y||this.Tw.y>=r&&r>=t[0].y)&&(i[e]=d(.5*(this.Tw.x+t[0].x),r,r),e+=1),this.Tw=t[s-1],1===s?this.Fw(t[0],i,e):this.Iw(t,i)),i}Fw(t,e,i=0){return e[i]=d(t.x,t.y,this._w),i+1}Iw(t,e){let i=0,s=0;const r=t.length-1,n=this._w;for(;s=n&&n>=o.y){const t=r.y,s=o.y,h=n,a=t===s?o.x:Vn(r.x,o.x,(h-t)/(s-t));e[i]=d(a,n,n),i+=1}e[i]=d(o.x,o.y,n),i+=1}return i}Cw(t){const e=t.length,i=Array(e),s=Array(e),r=this._w;for(let n=0;nr?(i[n]=u(e.position,e.high),s[n]=u(e.position,r)):e.hight[0]))}setPositiveFillStyle(t){return this.Aw(t),this}setNegativeFillStyle(t){return this.gw(t),this}setPositiveStrokeStyle(t){return this.mw(t),this}setNegativeStrokeStyle(t){return this.yw(t),this}getPositiveFillStyle(){return this.pw()}getNegativeFillStyle(){return this.Rl()}getPositiveStrokeStyle(){return this.Sw()}getNegativeStrokeStyle(){return this.xw()}attach(t,e=!0,i=!1){return le(t,this.ts,i,{fill:this.X_,fill2:this.j_,behavior:{colorStep:!0}}),super.attach(t,e,i)}}class Yu extends Ou{constructor(){super(...arguments),this.fw=ot}Mw(t){return this.aw(t)}Cw(t){const e=t.length,i=Array(e);for(let s=0;ss?d(t.x,s,s):d(t.x,t.y,s),i+1}Iw(t,e,i=0){let s=0;const r=t.length-1,n=this._w;for(;sn){const t=Si(u(Ve,n),u(Le,n),r,o);t&&(e[i]=d(t.x,t.y,n),i+=1),e[i]=d(o.x,n,n),i+=1}else e[i]=d(o.x,o.y,n),i+=1}else{const t=d(r.x,n,n);if(0!==i&&Ot(e[i-1],t)||(e[i]=t,i+=1),o.y<=n){const t=Si(u(Ve,n),u(Le,n),r,o);t&&(e[i]=d(t.x,t.y,n),i+=1),e[i]=d(o.x,o.y,n),i+=1}else e[i]=d(o.x,n,n),i+=1}}return i}n_(){return xu(this.JM,(t=>t[1]))}setFillStyle(t){return this.gw(t),this}getFillStyle(){return this.Rl()}attach(t,e=!0,i=!1){return le(t,this.ts,i,{fill:this.j_,stroke:this.dw}),super.attach(t,e,i)}}class Xu extends Yu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,a,l,u);const d=c;this.X_=fe(this.ts.areaSeriesPositiveFillStyle,d),this.j_=z,this.dw=fe(this.ts.areaSeriesPositiveStrokeStyle,d)}ww(t){return this.Dw(t)}Dw(t){const e=[];return 1===t.length?this.Fw(t[0],e):this.Iw(t,e),e}Fw(t,e,i=0){const s=this._w;return e[i]=t.y=n){const t=d(r.x,r.y,n);if(0!==i&&Ot(e[i-1],t)||(e[i]=t,i+=1),o.y=n){const t=Si(u(Ve,n),u(Le,n),r,o);t&&(e[i]=d(t.x,t.y,n),i+=1),e[i]=d(o.x,o.y,n),i+=1}else e[i]=d(o.x,n,n),i+=1}}return i}n_(){return xu(this.JM,(t=>t[0]||[]))}setFillStyle(t){return this.Aw(t),this}getFillStyle(){return this.pw()}attach(t,e=!0,i=!1){return le(t,this.ts,i,{fill:this.X_,stroke:this.dw}),super.attach(t,e,i)}}const Wu={Positive:Xu,Negative:Hu,Bipolar:Gu},ju=(t,e,i,s,r)=>t.addRow(e.getName()).addRow("Position","",e.axisX.formatValue(i)).addRow("High","",e.axisY.formatValue(s)).addRow("Low","",e.axisY.formatValue(r));class $u extends Nu{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,a,l),this.Ms="Area Range Series",this.Om=ju,this.Ki.cs.Gn(ah.mf);const c=u;this.X_=fe(this.ts.areaRangeSeriesFillStyle,c),this.dw=fe(this.ts.areaRangeSeriesStrokeStyle,c),this.j_=fe(this.ts.areaRangeSeriesFillStyleInverted,c),this.fw=fe(this.ts.areaRangeSeriesStrokeStyleInverted,c)}add(t){const e=Array.isArray(t)?t:[t],[i,s]=g(e);this.hw(t,i,s);const r=this.yu[this.yu.length-1];return this.i_=r?{position:r.position,high:r.high,low:r.low}:void 0,this.L.emit("dataAdd",this,e,this.s_),this}addArraysHighLow(t,e,i=1,s=0){if(t.length!==e.length)throw new Error("arrayHigh and arrayLow lengths are not equal");{let r=s;r||(r=this.i_?this.i_.position+i:0),this.add(((t,e,i=1,s)=>{const r=void 0!==s?s:0,n=new Array(t.length);for(let s=0;s{const e=t[0],i=t[1];if(!e||!i)return[];const s=[],r=e.length;for(let t=0;t{const i=[],s=t.length,r=e;if(s>0){let e=0,n=t[0];i[e]=n,e+=1;for(let o=1;o{const i=t*t,s=i*t,r=1-t,n=r*r,o=n*r;return u(o*e[0].x+3*t*n*e[1].x+3*i*r*e[2].x+s*e[3].x,o*e[0].y+3*t*n*e[1].y+3*i*r*e[2].y+s*e[3].y)},qu=(t,e=32)=>{if(2===t.length)return[t[0],t[1]];const i=(t=>{const e=1e-5,i=t.length-1,s=Array(i);if(i>1){let r=u(0,0),n=u(0,0),o=u(0,0),h=ii(hi(t[1],t[0]));const a=3;let l=0,c=0;for(let d=0;de?Math.abs(i/(a*r.x)):1,c=Math.abs(n.x)>e?Math.abs(i/(a*n.x)):1}f[1]=oi(ni(r,l),f[1]),f[2]=hi(f[2],ni(n,c)),s[d]=f}}return s.length>0?s:[]})(t),s=i.length,r=Array(s*e);let n=0;for(let t=0;t{if(this.JM.length>0){const e=this.JM[this.JM.length-1];if(t.length>0){const i=e.il(),s=e.tl(),r=i.length+s.length-+e.zl();if(r>=this.h_){const n=s.length>0?s[s.length-1]:i[e.zl()?r:r-1],o=u((n.x+t[0].x)/2,(n.y+t[0].y)/2);e.ol(o,m(u(o.x,o.y),u(o.x,o.y))).Vl(!0),this.zw([o].concat(t)).El(!0)}else e.ol(t,this.s_)}}else t.length>0&&this.zw(t)},this.Vw=t=>{if(this.Rw.length>0){const e=this.Rw[this.Rw.length-1];t.length>0&&((e.il().length+e.tl().length)*this.Lw>=this.h_?this.Ow(t):e.ol(t))}else t.length>0&&this.Ow(t)},this.Nw=(t,e)=>{const i=t.$c(e);if(i)return dt(i,this.scale,this.Ts.cs.ft)},this.Gw=(t,e)=>{const i=t.ew(e);if(i)return dt(i,this.scale,this.Ts.cs.ft)},this.Yn=y,this.Xb=l,this.Ww=f,this.Uw=fe(c.pointLineSeriesFillStyle,g),this.uu=fe(this.ts.pointLineSeriesStrokeStyle,g)}add(t){return super.add(t),this}n_(){return xu(this.Rw)}setStrokeStyle(t){this.uu="function"==typeof t?t(this.uu):t;const e=this.uu;for(let t=0;te.setVisible(t))),this}setCursorInterpolationEnabled(t){return this.Rb=t,this.Ts.cs.vs(),this}getCursorInterpolationEnabled(){return this.Rb}setCursorSolveBasis(t){return this.Bw=t,this.JM.forEach((e=>e.qa(Vr(t)))),this.Rw.forEach((e=>e.qa(Vr(t)))),this.Ts.vs(),this}getCursorSolveBasis(){return this.Bw}Wd(){return ue(this.Uw)||ue(this.uu.getFillStyle())}ks(){return this.bs||this.Xb}UM(t){}Pe(t,e){t.ds(e),this.Ts.vs()}r_(t){const e=this.JM.length>0?this.JM[this.JM.length-1].il().length+this.JM[this.JM.length-1].tl().length-+this.JM[this.JM.length-1].zl():void 0;pu(t,e,this.h_,this.Ew),pu(t,e,this.h_,this.Vw)}Ow(t,e){const i=this.Ts.bS(this.scale).ol(t,e).setMouseInteractions(this.Hi).ke(this.Uw).sl(this.Xb).tt(this.$b).Gh(this.ga).hl(this.Wa).rl(this.Ua).nl(this.Ya).qa(Vr(this.Bw)).ds(this.getHighlight());return this.fs(i),this.Rw.push(i),i}zw(t,e){const i=this.Ts.sy(this.scale,void 0,[za.UserSeries,...this.Ww]).ol(t,e).setMouseInteractions(this.Hi).Ee(this.uu).qa(Vr(this.Bw)).ds(this.getHighlight());return this.fs(i),this.JM.push(i),i}attach(t,e=!0,i=!1){return le(t,this.ts,i,{stroke:this.uu,fill:this.Uw}),super.attach(t,e,i)}getPointAmount(){return this.Rw.reduce(((t,e)=>t+e.al()+e.ll()),this.yu.length)}clear(){super.clear();for(let t=0;t{}))}$c(t,e,i=this.Rb){const s=i?bu(t,e?this.JM.filter((t=>t.getIsUnderMouse())):this.JM,this.Gw,"nearest-x"===this.Bw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.Bw?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2):bu(t,e?this.Rw.filter((t=>t.getIsUnderMouse())):this.Rw,this.Nw,"nearest-x"===this.Bw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.Bw?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2);if(void 0!==s){const t=dt(s[0],this.Ts.cs.ft,this.scale),e=s[1]instanceof cn?s[1].cu():s[1].zh(),i=s[1]instanceof tn?s[1].zh():void 0,r=s[1]instanceof cn?s[1].cu().getFillStyle():void 0,n=X(e)?s[0].color?new G({color:s[0].color}):new G({color:e.getFallbackColor()}):void 0;return Ta(t,this.scale,this.Om(new la,this,t.x,t.y,t).Qu(),this,r||n||i)}}solveNearestFromScreen(t,e=this.Rb){return this.$c(rh(t,this.Ki.cs),!1,e)}}const tc=(t,e)=>t.tl().length>=e?t.tl().slice(-e):Array.prototype.concat(t.il(),t.tl()).slice(-e),ec=(t,e,i)=>{const s=Array.prototype.concat(t.il(),t.tl()).slice(0,-i-1).concat(e.slice(i+1,2*i+2));t.Gt().ol(s).Ds()};class ic extends Qu{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d,f,g){super(t,e,i,s,r,n,o,h,a,l,u,c,d,f,g),this.Ms="Spline Series",this.Lw=32,this.h_=8e3,this.Yw=t=>{if(0===t.length)return;const e=this.Rw.length;if(e>0){const i=e>1,s=this.Rw[e-1];if(i){const i=Array.prototype.concat(s.il(),s.tl()),r=i.length;if(32*r>=this.h_){const i=tc(s,3),r=Array.prototype.concat(i,t),n=qu(r,32);ec(this.JM[e-1],n,32),this.zw(n.slice(66))}else if(r<5){const s=this.Rw[e-2],r=tc(s,3),n=Array.prototype.concat(r,i,t),o=qu(n,32),h=this.JM[e-1],a=o.slice(66);h.Gt().ol(a).Ds()}else{const i=this.JM[e-1],r=Array.prototype.concat(i.il(),i.tl()),n=tc(s,4),o=Array.prototype.concat(n,t),h=qu(o,32),a=r.slice(0,-66).concat(h.slice(33));i.Gt().ol(a).Ds()}}else{const i=Array.prototype.concat(s.il(),s.tl()),r=i.length,n=this.JM[e-1];if(32*r>=this.h_){const e=tc(s,3),i=Array.prototype.concat(e,t),r=qu(i,32);ec(this.JM[0],r,32),this.zw(r.slice(66))}else if(r+t.length>1){const e=Array.prototype.concat(i,t),s=qu(e,32);n.Gt().ol(s).Ds()}else n.ol(t)}}else{const e=t.length>0?qu(t,32):t,i=Ze(e);this.zw(e,i)}this.Vw(t)}}setCursorInterpolationEnabled(t){return super.setCursorInterpolationEnabled(t)}r_(t){const e=this.Rw.length,i=this.Rw.length>0?this.Rw[e-1].il().length+this.Rw[e-1].tl().length:void 0;pu(t,i,Math.ceil(this.h_/this.Lw),this.Yw)}solveNearestFromScreen(t,e=this.Rb){if(e)return super.solveNearestFromScreen(rh(t,this.Ki.cs),e);const i=bu(rh(t,this.Ki.cs),this.Rw,this.Nw,"nearest-x"===this.Bw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.Bw?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2);if(void 0!==i){const t=dt(i[0],this.Ts.cs.ft,this.scale);return Ta(t,this.scale,this.Om(new la,this,t.x,t.y,t).Qu(),this,i[1].zh())}}}class sc{constructor(){this.Wi="FreeformPattern",this.wl={type:"disabled",packager:(t,e,i)=>t.slice()}}e_(t,e,i,s,r,n){if(s>0){const r=Math.trunc((e-s)/i);if(r>0&&t.length>1){const e=t.splice(0,r);for(let t=0;t{switch(t){case"normal":default:return 1;case"high":return.25}},nc=s.Record({wl:{type:"disabled",packager:(t,e,i)=>t.slice()}});class oc extends nc{e_(t,e,i,s,r,n){if(s>0){const e=Math.ceil(s/i),o=t.length-e;if(o>0){const e=this.nw(t,r);if(e>0){const i=o-e>0?e:o;if(i>0){for(let e=0;e{const i=e.Mt();return t?Math.min(i,t):i},ac=(t,e)=>{const i=e._t();return t?Math.max(i,t):i};class lc extends oc{Hw(t,e){return Math.abs(t.x-e.x)}getYMax(t=[],e){return t.reduce(ac,e?e.max.y:void 0)}getYMin(t=[],e){return t.reduce(hc,e?e.min.y:void 0)}}const uc=(t,e)=>{const i=e.xt();return t?Math.min(i,t):i},cc=(t,e)=>{const i=e.bt();return t?Math.max(i,t):i};class dc extends oc{Hw(t,e){return Math.abs(t.y-e.y)}getXMax(t=[],e){return t.reduce(cc,e?e.max.x:void 0)}getXMin(t=[],e){return t.reduce(uc,e?e.min.x:void 0)}}const fc={horizontalProgressive:new class extends lc{constructor(){super({wl:kr()}),this.Wi="HorizontalProgressivePattern"}nw(t,e){const i=t.length,s=Math.min(e.x.getInnerStart(),e.x.getInnerEnd());let r=0;if(i>1)for(let n=0;n0?t[t.length-1].bt():void 0}getXMin(t=[],e){return t.length>0&&t[0].al()>0?t[0].xt():e?e.min.x:void 0}setPrecision(t){return this.set("_columnPackaging",kr(rc(t)))}},horizontalRegressive:new class extends lc{constructor(){super({wl:Cr()}),this.Wi="HorizontalRegressivePattern"}nw(t,e){const i=t.length,s=Math.max(e.x.getInnerStart(),e.x.getInnerEnd());let r=0;if(i>1)for(let n=0;n